forked from dfinity/ICRC-1
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathICRC-1.did
52 lines (45 loc) · 1.45 KB
/
ICRC-1.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
// Number of nanoseconds since the UNIX epoch in UTC timezone.
type Timestamp = nat64;
// Number of nanoseconds between two [Timestamp]s.
type Duration = nat64;
type Subaccount = blob;
type Account = record {
owner : principal;
subaccount : opt Subaccount;
};
type TransferArgs = record {
from_subaccount : opt Subaccount;
to : Account;
amount : nat;
fee : opt nat;
memo : opt blob;
created_at_time : opt Timestamp;
};
type TransferError = variant {
BadFee : record { expected_fee : nat };
BadBurn : record { min_burn_amount : nat };
InsufficientFunds : record { balance : nat };
TooOld;
CreatedInFuture: record { ledger_time : Timestamp };
Duplicate : record { duplicate_of : nat };
TemporarilyUnavailable;
GenericError : record { error_code : nat; message : text };
};
type Value = variant {
Nat : nat;
Int : int;
Text : text;
Blob : blob;
};
service : {
icrc1_metadata : () -> (vec record { text; Value; }) query;
icrc1_name : () -> (text) query;
icrc1_symbol : () -> (text) query;
icrc1_decimals : () -> (nat8) query;
icrc1_fee : () -> (nat) query;
icrc1_total_supply : () -> (nat) query;
icrc1_minting_account : () -> (opt Account) query;
icrc1_balance_of : (Account) -> (nat) query;
icrc1_transfer : (TransferArgs) -> (variant { Ok : nat; Err : TransferError });
icrc1_supported_standards : () -> (vec record { name : text; url : text }) query;
}