Source Code

;; tipstream-groups
;; Community groups

(define-data-var total-groups uint u0)

(define-map groups uint {
  creator: principal,
  value: uint,
  at-block: uint
})

(define-public (create-group (group-type uint))
  (let
    (
      (id (var-get total-groups))
    )
    (map-set groups id {
      creator: tx-sender,
      value: group-type,
      at-block: block-height
    })
    (var-set total-groups (+ id u1))
    (ok id)
  )
)

(define-read-only (get-entry (id uint))
  (map-get? groups id)
)

(define-read-only (get-total)
  (ok (var-get total-groups))
)

Functions (3)

FunctionAccessArgs
create-grouppublicgroup-type: uint
get-entryread-onlyid: uint
get-totalread-only