-
Notifications
You must be signed in to change notification settings - Fork 28
/
nft.did
157 lines (157 loc) · 5.25 KB
/
nft.did
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
type GenericValue = variant {
Nat64Content : nat64;
Nat32Content : nat32;
BoolContent : bool;
Nat8Content : nat8;
Int64Content : int64;
IntContent : int;
NatContent : nat;
Nat16Content : nat16;
Int32Content : int32;
Int8Content : int8;
FloatContent : float64;
Int16Content : int16;
BlobContent : vec nat8;
NestedContent : Vec;
Principal : principal;
TextContent : text;
};
type InitArgs = record {
cap : opt principal;
logo : opt text;
name : opt text;
custodians : opt vec principal;
symbol : opt text;
};
type ManualReply = record {
logo : opt text;
name : opt text;
created_at : nat64;
upgraded_at : nat64;
custodians : vec principal;
symbol : opt text;
};
type ManualReply_1 = variant { Ok : vec nat; Err : NftError };
type ManualReply_2 = variant { Ok : vec TokenMetadata; Err : NftError };
type ManualReply_3 = variant { Ok : TokenMetadata; Err : NftError };
type NftError = variant {
UnauthorizedOperator;
SelfTransfer;
TokenNotFound;
UnauthorizedOwner;
SelfApprove;
OperatorNotFound;
ExistedNFT;
OwnerNotFound;
};
type Result = variant { Ok : nat; Err : NftError };
type Result_1 = variant { Ok : bool; Err : NftError };
type Result_2 = variant { Ok : opt principal; Err : NftError };
type Stats = record {
cycles : nat;
total_transactions : nat;
total_unique_holders : nat;
total_supply : nat;
};
type SupportedInterface = variant { Burn; Mint; Approval };
type TokenMetadata = record {
transferred_at : opt nat64;
transferred_by : opt principal;
owner : opt principal;
operator : opt principal;
approved_at : opt nat64;
approved_by : opt principal;
properties : vec record { text; GenericValue };
is_burned : bool;
token_identifier : nat;
burned_at : opt nat64;
burned_by : opt principal;
minted_at : nat64;
minted_by : principal;
};
type Vec = vec record {
text;
variant {
Nat64Content : nat64;
Nat32Content : nat32;
BoolContent : bool;
Nat8Content : nat8;
Int64Content : int64;
IntContent : int;
NatContent : nat;
Nat16Content : nat16;
Int32Content : int32;
Int8Content : int8;
FloatContent : float64;
Int16Content : int16;
BlobContent : vec nat8;
NestedContent : Vec;
Principal : principal;
TextContent : text;
};
};
service : (opt InitArgs) -> {
approve : (principal, nat) -> (Result);
balanceOf : (principal) -> (Result) query;
burn : (nat) -> (Result);
custodians : () -> (vec principal) query;
cycles : () -> (nat) query;
dfx_info : () -> (text) query;
dip721_approve : (principal, nat) -> (Result);
dip721_balance_of : (principal) -> (Result) query;
dip721_burn : (nat) -> (Result);
dip721_custodians : () -> (vec principal) query;
dip721_cycles : () -> (nat) query;
dip721_is_approved_for_all : (principal, principal) -> (Result_1) query;
dip721_logo : () -> (opt text) query;
dip721_metadata : () -> (ManualReply) query;
dip721_mint : (principal, nat, vec record { text; GenericValue }) -> (Result);
dip721_name : () -> (opt text) query;
dip721_operator_of : (nat) -> (Result_2) query;
dip721_operator_token_identifiers : (principal) -> (ManualReply_1) query;
dip721_operator_token_metadata : (principal) -> (ManualReply_2) query;
dip721_owner_of : (nat) -> (Result_2) query;
dip721_owner_token_identifiers : (principal) -> (ManualReply_1) query;
dip721_owner_token_metadata : (principal) -> (ManualReply_2) query;
dip721_set_approval_for_all : (principal, bool) -> (Result);
dip721_set_custodians : (vec principal) -> ();
dip721_set_logo : (text) -> ();
dip721_set_name : (text) -> ();
dip721_set_symbol : (text) -> ();
dip721_stats : () -> (Stats) query;
dip721_supported_interfaces : () -> (vec SupportedInterface) query;
dip721_symbol : () -> (opt text) query;
dip721_token_metadata : (nat) -> (ManualReply_3) query;
dip721_total_supply : () -> (nat) query;
dip721_total_transactions : () -> (nat) query;
dip721_total_unique_holders : () -> (nat) query;
dip721_transfer : (principal, nat) -> (Result);
dip721_transfer_from : (principal, principal, nat) -> (Result);
git_commit_hash : () -> (text) query;
isApprovedForAll : (principal, principal) -> (Result_1) query;
logo : () -> (opt text) query;
metadata : () -> (ManualReply) query;
mint : (principal, nat, vec record { text; GenericValue }) -> (Result);
name : () -> (opt text) query;
operatorOf : (nat) -> (Result_2) query;
operatorTokenIdentifiers : (principal) -> (ManualReply_1) query;
operatorTokenMetadata : (principal) -> (ManualReply_2) query;
ownerOf : (nat) -> (Result_2) query;
ownerTokenIdentifiers : (principal) -> (ManualReply_1) query;
ownerTokenMetadata : (principal) -> (ManualReply_2) query;
rust_toolchain_info : () -> (text) query;
setApprovalForAll : (principal, bool) -> (Result);
setCustodians : (vec principal) -> ();
setLogo : (text) -> ();
setName : (text) -> ();
setSymbol : (text) -> ();
stats : () -> (Stats) query;
supportedInterfaces : () -> (vec SupportedInterface) query;
symbol : () -> (opt text) query;
tokenMetadata : (nat) -> (ManualReply_3) query;
totalSupply : () -> (nat) query;
totalTransactions : () -> (nat) query;
totalUniqueHolders : () -> (nat) query;
transfer : (principal, nat) -> (Result);
transferFrom : (principal, principal, nat) -> (Result);
}