/
traits.clar
39 lines (31 loc) · 1.18 KB
/
traits.clar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(define-trait wallet-trait
(
(add-owner (principal) (response bool uint))
(remove-owner (principal) (response bool uint))
(set-min-confirmation (uint) (response bool uint))
(set-valid-chain ((buff 256) bool) (response bool uint))
)
)
(define-trait executor-trait
(
(execute (<wallet-trait> principal uint (buff 256) bool) (response bool uint))
)
)
(define-trait sip-010-trait
(
;; Transfer from the caller to a new principal
(transfer (uint principal principal (optional (buff 34))) (response bool uint))
;; the human readable name of the token
(get-name () (response (string-ascii 32) uint))
;; the ticker symbol, or empty if none
(get-symbol () (response (string-ascii 32) uint))
;; the number of decimals used, e.g. 6 would mean 1_000_000 represents 1 token
(get-decimals () (response uint uint))
;; the balance of the passed principal
(get-balance (principal) (response uint uint))
;; the current total supply (which does not need to be a constant)
(get-total-supply () (response uint uint))
;; an optional URI that represents metadata of this token
(get-token-uri () (response (optional (string-utf8 256)) uint))
)
)