offering-directory-v1
SPCW5Y4J68QWP7MVVB06Q8ZX43RNSW86FAYH26PFSource Code
;; Service Catalog - Catalog of services
(define-map catalog uint {name: (string-ascii 100), provider: principal, price: uint})
(define-data-var next-id uint u0)
(define-public (add-service (name (string-ascii 100)) (price uint))
(let ((id (var-get next-id)))
(map-set catalog id {name: name, provider: tx-sender, price: price})
(var-set next-id (+ id u1))
(ok id)))
(define-read-only (get-service (id uint))
(map-get? catalog id))
Functions (2)
| Function | Access | Args |
|---|---|---|
| add-service | public | name: (string-ascii 100 |
| get-service | read-only | id: uint |