-
Notifications
You must be signed in to change notification settings - Fork 336
/
Copy pathledger_archive.did
85 lines (74 loc) · 1.99 KB
/
ledger_archive.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
type BlockIndex = nat64;
type Memo = nat64;
type AccountIdentifier = blob;
type Tokens = record { e8s : nat64 };
type Timestamp = record { timestamp_nanos : nat64 };
type Operation = variant {
Mint : record {
to : AccountIdentifier;
amount : Tokens;
};
Burn : record {
from : AccountIdentifier;
spender : opt AccountIdentifier;
amount : Tokens;
};
Transfer : record {
from : AccountIdentifier;
to : AccountIdentifier;
amount : Tokens;
fee : Tokens;
spender : opt vec nat8;
};
Approve : record {
from : AccountIdentifier;
spender : AccountIdentifier;
// This field is deprecated and should not be used.
allowance_e8s : int;
allowance: Tokens;
fee : Tokens;
expires_at : opt Timestamp;
expected_allowance : opt Tokens;
};
};
type Transaction = record {
memo : Memo;
icrc1_memo : opt blob;
// Optional to support potential future variant extensions.
operation : opt Operation;
created_at_time : Timestamp;
};
type Block = record {
parent_hash : opt blob;
transaction : Transaction;
timestamp : Timestamp;
};
type GetBlocksArgs = record {
start : BlockIndex;
length : nat64;
};
type BlockRange = record {
blocks : vec Block;
};
type GetBlocksError = variant {
/// The [GetBlocksArgs.start] is below the first block that
/// archive node stores.
BadFirstBlockIndex : record {
requested_index : BlockIndex;
first_valid_index : BlockIndex;
};
/// Reserved for future use.
Other : record {
error_code : nat64;
error_message : text;
};
};
type GetBlocksResult = variant {
Ok : BlockRange;
Err : GetBlocksError;
};
type GetEncodedBlocksResult = variant { Ok : vec blob; Err : GetBlocksError };
service : {
get_blocks : (GetBlocksArgs) -> (GetBlocksResult) query;
get_encoded_blocks : (GetBlocksArgs) -> (GetEncodedBlocksResult) query;
}