igrc1155.gno
1.09 Kb · 47 lines
1package grc1155
2
3type IGRC1155 interface {
4 SafeTransferFrom(caller, from, to address, tid TokenID, amount int64) error
5 SafeBatchTransferFrom(caller, from, to address, batch []TokenID, amounts []int64) error
6 BalanceOf(owner address, tid TokenID) (int64, error)
7 BalanceOfBatch(owners []address, batch []TokenID) ([]int64, error)
8 SetApprovalForAll(caller, operator address, approved bool) error
9 IsApprovedForAll(owner, operator address) bool
10}
11
12type IGRC1155Reader interface {
13 Uri() string
14 BalanceOf(owner address, tid TokenID) (int64, error)
15 BalanceOfBatch(owners []address, batch []TokenID) ([]int64, error)
16 IsApprovedForAll(owner, operator address) bool
17}
18
19type TokenID string
20
21type TransferSingleEvent struct {
22 Operator address
23 From address
24 To address
25 TokenID TokenID
26 Amount int64
27}
28
29type TransferBatchEvent struct {
30 Operator address
31 From address
32 To address
33 Batch []TokenID
34 Amounts []int64
35}
36
37type ApprovalForAllEvent struct {
38 Owner address
39 Operator address
40 Approved bool
41}
42
43type UpdateURIEvent struct {
44 URI string
45}
46
47type MultiTokenGetter func() IGRC1155Reader