tipstream-splits
SP31PKQVQZVZCK3FM3NH67CGD6G1FMR17VQVS2W5TSource Code
;; tipstream-splits
;; Split payments
(define-data-var total-splits uint u0)
(define-map splits uint {
creator: principal,
value: uint,
at-block: uint
})
(define-public (create-split (split-count uint))
(let
(
(id (var-get total-splits))
)
(map-set splits id {
creator: tx-sender,
value: split-count,
at-block: block-height
})
(var-set total-splits (+ id u1))
(ok id)
)
)
(define-read-only (get-entry (id uint))
(map-get? splits id)
)
(define-read-only (get-total)
(ok (var-get total-splits))
)
Functions (3)
| Function | Access | Args |
|---|---|---|
| create-split | public | split-count: uint |
| get-entry | read-only | id: uint |
| get-total | read-only |