-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.did
68 lines (57 loc) · 2.13 KB
/
index.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
type Transaction = record {
"args": opt TransferArgs;
"fee": nat;
"from": opt Account;
"kind": TransactionKind;
"timestamp": nat64;
};
type Account = record {
"owner": principal;
"subaccount": opt blob;
};
type Metadatum = record { text; Value };
type SupportedStandard = record {
"name": text;
"url": text;
};
type TransferArgs = record {
"amount": nat;
"created_at_time": opt nat64;
"fee": opt nat;
"from_subaccount": opt blob;
"memo": opt blob;
"to": Account;
};
type InitArgs = record {
"decimals": nat8;
"fee": nat;
"initial_account_balances": vec InitialAccountBalance;
"metadata": vec Metadatum;
"minting_account": opt Account;
"name": text;
"permitted_drift_nanos": opt nat64;
"supported_standards": vec SupportedStandard;
"symbol": text;
"transaction_window_nanos": opt nat64;
};
type InitialAccountBalance = record {
"account": Account;
"balance": nat;
};
type TransferResult = variant { "Ok": nat; "Err": TransferError };
type TransferError = variant { "BadBurn": record { "min_burn_amount": nat; }; "BadFee": record { "expected_fee": nat; }; "CreatedInFuture": record { "ledger_time": nat64; }; "Duplicate": record { "duplicate_of": nat; }; "GenericError": record { "error_code": nat; "message": text; }; "InsufficientFunds": record { "balance": nat; }; "TemporarilyUnavailable": null; "TooOld": null };
type TransactionKind = variant { "Burn": null; "Mint": null; "Transfer": null };
type Value = variant { "Blob": blob; "Int": int; "Nat": nat; "Text": text };
service: (InitArgs) -> {
"get_transactions": (opt nat64, opt nat64) -> (vec Transaction) query;
"icrc1_balance_of": (Account) -> (nat) query;
"icrc1_decimals": () -> (nat8) query;
"icrc1_fee": () -> (nat) query;
"icrc1_metadata": () -> (vec Metadatum) query;
"icrc1_minting_account": () -> (opt Account) query;
"icrc1_name": () -> (text) query;
"icrc1_supported_standards": () -> (vec SupportedStandard) query;
"icrc1_symbol": () -> (text) query;
"icrc1_total_supply": () -> (nat) query;
"icrc1_transfer": (TransferArgs) -> (TransferResult);
}