@junobuild/admin 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/cmc/index.js +6 -1
- package/declarations/console/console.did.d.ts +5 -4
- package/declarations/console/console.factory.did.js +3 -2
- package/declarations/console/console.factory.did.mjs +3 -2
- package/declarations/console/index.js +6 -1
- package/declarations/ic/ic.did +131 -18
- package/declarations/ic/ic.did.d.ts +184 -53
- package/declarations/ic/ic.factory.did.js +167 -24
- package/declarations/mission_control/index.js +7 -1
- package/declarations/mission_control/mission_control.did.d.ts +1 -0
- package/declarations/mission_control/mission_control.factory.did.js +5 -0
- package/declarations/observatory/index.js +7 -1
- package/declarations/satellite/index.js +6 -1
- package/declarations/satellite/satellite.did.d.ts +1 -0
- package/declarations/satellite/satellite.factory.did.js +1 -0
- package/declarations/satellite/satellite.factory.did.mjs +1 -0
- package/dist/browser/index.js +15 -15
- package/dist/browser/index.js.map +4 -4
- package/dist/declarations/cmc/index.js +6 -1
- package/dist/declarations/console/console.did.d.ts +5 -4
- package/dist/declarations/console/console.factory.did.js +3 -2
- package/dist/declarations/console/console.factory.did.mjs +3 -2
- package/dist/declarations/console/index.js +6 -1
- package/dist/declarations/ic/ic.did +131 -18
- package/dist/declarations/ic/ic.did.d.ts +184 -53
- package/dist/declarations/ic/ic.factory.did.js +167 -24
- package/dist/declarations/mission_control/index.js +7 -1
- package/dist/declarations/mission_control/mission_control.did.d.ts +1 -0
- package/dist/declarations/mission_control/mission_control.factory.did.js +5 -0
- package/dist/declarations/observatory/index.js +7 -1
- package/dist/declarations/satellite/index.js +6 -1
- package/dist/declarations/satellite/satellite.did.d.ts +1 -0
- package/dist/declarations/satellite/satellite.factory.did.js +1 -0
- package/dist/declarations/satellite/satellite.factory.did.mjs +1 -0
- package/dist/node/index.mjs +19 -19
- package/dist/node/index.mjs.map +4 -4
- package/dist/types/api/ic.api.d.ts +1 -1
- package/dist/types/constants/config.constants.d.ts +2 -0
- package/dist/types/services/mission-control.services.d.ts +1 -1
- package/dist/types/services/satellite.services.d.ts +2 -2
- package/dist/types/types/config.types.d.ts +9 -3
- package/dist/types/types/ic.types.d.ts +2 -1
- package/package.json +1 -1
- package/declarations/frontend/frontend.did +0 -188
- package/declarations/frontend/frontend.did.d.ts +0 -172
- package/declarations/frontend/frontend.factory.did.js +0 -210
- package/declarations/frontend/index.d.ts +0 -45
- package/declarations/frontend/index.js +0 -32
- package/declarations/internet_identity/index.d.ts +0 -45
- package/declarations/internet_identity/index.js +0 -32
- package/declarations/internet_identity/internet_identity.did +0 -378
- package/declarations/internet_identity/internet_identity.did.d.ts +0 -231
- package/declarations/internet_identity/internet_identity.factory.did.js +0 -277
- package/declarations/ledger/index.d.ts +0 -45
- package/declarations/ledger/index.js +0 -32
- package/declarations/ledger/ledger.did +0 -266
- package/declarations/ledger/ledger.did.d.ts +0 -117
- package/declarations/ledger/ledger.factory.did.js +0 -115
- package/dist/declarations/frontend/frontend.did +0 -188
- package/dist/declarations/frontend/frontend.did.d.ts +0 -172
- package/dist/declarations/frontend/frontend.factory.did.js +0 -210
- package/dist/declarations/frontend/index.d.ts +0 -45
- package/dist/declarations/frontend/index.js +0 -32
- package/dist/declarations/internet_identity/index.d.ts +0 -45
- package/dist/declarations/internet_identity/index.js +0 -32
- package/dist/declarations/internet_identity/internet_identity.did +0 -378
- package/dist/declarations/internet_identity/internet_identity.did.d.ts +0 -231
- package/dist/declarations/internet_identity/internet_identity.factory.did.js +0 -277
- package/dist/declarations/ledger/index.d.ts +0 -45
- package/dist/declarations/ledger/index.js +0 -32
- package/dist/declarations/ledger/ledger.did +0 -266
- package/dist/declarations/ledger/ledger.did.d.ts +0 -117
- package/dist/declarations/ledger/ledger.factory.did.js +0 -115
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
// This is the official Ledger interface that is guaranteed to be backward compatible.
|
|
2
|
-
|
|
3
|
-
// Amount of tokens, measured in 10^-8 of a token.
|
|
4
|
-
type Tokens = record {
|
|
5
|
-
e8s : nat64;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
// Number of nanoseconds from the UNIX epoch in UTC timezone.
|
|
9
|
-
type TimeStamp = record {
|
|
10
|
-
timestamp_nanos: nat64;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
// AccountIdentifier is a 32-byte array.
|
|
14
|
-
// The first 4 bytes is big-endian encoding of a CRC32 checksum of the last 28 bytes.
|
|
15
|
-
type AccountIdentifier = blob;
|
|
16
|
-
|
|
17
|
-
// Subaccount is an arbitrary 32-byte byte array.
|
|
18
|
-
// Ledger uses subaccounts to compute the source address, which enables one
|
|
19
|
-
// principal to control multiple ledger accounts.
|
|
20
|
-
type SubAccount = blob;
|
|
21
|
-
|
|
22
|
-
// Sequence number of a block produced by the ledger.
|
|
23
|
-
type BlockIndex = nat64;
|
|
24
|
-
|
|
25
|
-
type Transaction = record {
|
|
26
|
-
memo : Memo;
|
|
27
|
-
icrc1_memo: opt blob;
|
|
28
|
-
operation : opt Operation;
|
|
29
|
-
created_at_time : TimeStamp;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// An arbitrary number associated with a transaction.
|
|
33
|
-
// The caller can set it in a `transfer` call as a correlation identifier.
|
|
34
|
-
type Memo = nat64;
|
|
35
|
-
|
|
36
|
-
// Arguments for the `transfer` call.
|
|
37
|
-
type TransferArgs = record {
|
|
38
|
-
// Transaction memo.
|
|
39
|
-
// See comments for the `Memo` type.
|
|
40
|
-
memo: Memo;
|
|
41
|
-
// The amount that the caller wants to transfer to the destination address.
|
|
42
|
-
amount: Tokens;
|
|
43
|
-
// The amount that the caller pays for the transaction.
|
|
44
|
-
// Must be 10000 e8s.
|
|
45
|
-
fee: Tokens;
|
|
46
|
-
// The subaccount from which the caller wants to transfer funds.
|
|
47
|
-
// If null, the ledger uses the default (all zeros) subaccount to compute the source address.
|
|
48
|
-
// See comments for the `SubAccount` type.
|
|
49
|
-
from_subaccount: opt SubAccount;
|
|
50
|
-
// The destination account.
|
|
51
|
-
// If the transfer is successful, the balance of this address increases by `amount`.
|
|
52
|
-
to: AccountIdentifier;
|
|
53
|
-
// The point in time when the caller created this request.
|
|
54
|
-
// If null, the ledger uses current IC time as the timestamp.
|
|
55
|
-
created_at_time: opt TimeStamp;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
type TransferError = variant {
|
|
59
|
-
// The fee that the caller specified in the transfer request was not the one that ledger expects.
|
|
60
|
-
// The caller can change the transfer fee to the `expected_fee` and retry the request.
|
|
61
|
-
BadFee : record { expected_fee : Tokens; };
|
|
62
|
-
// The account specified by the caller doesn't have enough funds.
|
|
63
|
-
InsufficientFunds : record { balance: Tokens; };
|
|
64
|
-
// The request is too old.
|
|
65
|
-
// The ledger only accepts requests created within 24 hours window.
|
|
66
|
-
// This is a non-recoverable error.
|
|
67
|
-
TxTooOld : record { allowed_window_nanos: nat64 };
|
|
68
|
-
// The caller specified `created_at_time` that is too far in future.
|
|
69
|
-
// The caller can retry the request later.
|
|
70
|
-
TxCreatedInFuture : null;
|
|
71
|
-
// The ledger has already executed the request.
|
|
72
|
-
// `duplicate_of` field is equal to the index of the block containing the original transaction.
|
|
73
|
-
TxDuplicate : record { duplicate_of: BlockIndex; }
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
type TransferResult = variant {
|
|
77
|
-
Ok : BlockIndex;
|
|
78
|
-
Err : TransferError;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
// Arguments for the `account_balance` call.
|
|
82
|
-
type AccountBalanceArgs = record {
|
|
83
|
-
account: AccountIdentifier;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
type TransferFeeArg = record {};
|
|
87
|
-
|
|
88
|
-
type TransferFee = record {
|
|
89
|
-
// The fee to pay to perform a transfer
|
|
90
|
-
transfer_fee: Tokens;
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
type GetBlocksArgs = record {
|
|
94
|
-
// The index of the first block to fetch.
|
|
95
|
-
start : BlockIndex;
|
|
96
|
-
// Max number of blocks to fetch.
|
|
97
|
-
length : nat64;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
type Operation = variant {
|
|
101
|
-
Mint : record {
|
|
102
|
-
to : AccountIdentifier;
|
|
103
|
-
amount : Tokens;
|
|
104
|
-
};
|
|
105
|
-
Burn : record {
|
|
106
|
-
from : AccountIdentifier;
|
|
107
|
-
amount : Tokens;
|
|
108
|
-
};
|
|
109
|
-
Transfer : record {
|
|
110
|
-
from : AccountIdentifier;
|
|
111
|
-
to : AccountIdentifier;
|
|
112
|
-
amount : Tokens;
|
|
113
|
-
fee : Tokens;
|
|
114
|
-
};
|
|
115
|
-
Approve : record {
|
|
116
|
-
from : AccountIdentifier;
|
|
117
|
-
spender : AccountIdentifier;
|
|
118
|
-
allowance_e8s : int;
|
|
119
|
-
fee : Tokens;
|
|
120
|
-
expires_at : opt TimeStamp;
|
|
121
|
-
};
|
|
122
|
-
TransferFrom : record {
|
|
123
|
-
from : AccountIdentifier;
|
|
124
|
-
to : AccountIdentifier;
|
|
125
|
-
spender : AccountIdentifier;
|
|
126
|
-
amount : Tokens;
|
|
127
|
-
fee : Tokens;
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
type Block = record {
|
|
134
|
-
parent_hash : opt blob;
|
|
135
|
-
transaction : Transaction;
|
|
136
|
-
timestamp : TimeStamp;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
// A prefix of the block range specified in the [GetBlocksArgs] request.
|
|
140
|
-
type BlockRange = record {
|
|
141
|
-
// A prefix of the requested block range.
|
|
142
|
-
// The index of the first block is equal to [GetBlocksArgs.from].
|
|
143
|
-
//
|
|
144
|
-
// Note that the number of blocks might be less than the requested
|
|
145
|
-
// [GetBlocksArgs.len] for various reasons, for example:
|
|
146
|
-
//
|
|
147
|
-
// 1. The query might have hit the replica with an outdated state
|
|
148
|
-
// that doesn't have the full block range yet.
|
|
149
|
-
// 2. The requested range is too large to fit into a single reply.
|
|
150
|
-
//
|
|
151
|
-
// NOTE: the list of blocks can be empty if:
|
|
152
|
-
// 1. [GetBlocksArgs.len] was zero.
|
|
153
|
-
// 2. [GetBlocksArgs.from] was larger than the last block known to the canister.
|
|
154
|
-
blocks : vec Block;
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
// An error indicating that the arguments passed to [QueryArchiveFn] were invalid.
|
|
158
|
-
type QueryArchiveError = variant {
|
|
159
|
-
// [GetBlocksArgs.from] argument was smaller than the first block
|
|
160
|
-
// served by the canister that received the request.
|
|
161
|
-
BadFirstBlockIndex : record {
|
|
162
|
-
requested_index : BlockIndex;
|
|
163
|
-
first_valid_index : BlockIndex;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
// Reserved for future use.
|
|
167
|
-
Other : record {
|
|
168
|
-
error_code : nat64;
|
|
169
|
-
error_message : text;
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
type QueryArchiveResult = variant {
|
|
174
|
-
// Successfully fetched zero or more blocks.
|
|
175
|
-
Ok : BlockRange;
|
|
176
|
-
// The [GetBlocksArgs] request was invalid.
|
|
177
|
-
Err : QueryArchiveError;
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
// A function that is used for fetching archived ledger blocks.
|
|
181
|
-
type QueryArchiveFn = func (GetBlocksArgs) -> (QueryArchiveResult) query;
|
|
182
|
-
|
|
183
|
-
// The result of a "query_blocks" call.
|
|
184
|
-
//
|
|
185
|
-
// The structure of the result is somewhat complicated because the main ledger canister might
|
|
186
|
-
// not have all the blocks that the caller requested: One or more "archive" canisters might
|
|
187
|
-
// store some of the requested blocks.
|
|
188
|
-
//
|
|
189
|
-
// Note: as of Q4 2021 when this interface is authored, the IC doesn't support making nested
|
|
190
|
-
// query calls within a query call.
|
|
191
|
-
type QueryBlocksResponse = record {
|
|
192
|
-
// The total number of blocks in the chain.
|
|
193
|
-
// If the chain length is positive, the index of the last block is `chain_len - 1`.
|
|
194
|
-
chain_length : nat64;
|
|
195
|
-
|
|
196
|
-
// System certificate for the hash of the latest block in the chain.
|
|
197
|
-
// Only present if `query_blocks` is called in a non-replicated query context.
|
|
198
|
-
certificate : opt blob;
|
|
199
|
-
|
|
200
|
-
// List of blocks that were available in the ledger when it processed the call.
|
|
201
|
-
//
|
|
202
|
-
// The blocks form a contiguous range, with the first block having index
|
|
203
|
-
// [first_block_index] (see below), and the last block having index
|
|
204
|
-
// [first_block_index] + len(blocks) - 1.
|
|
205
|
-
//
|
|
206
|
-
// The block range can be an arbitrary sub-range of the originally requested range.
|
|
207
|
-
blocks : vec Block;
|
|
208
|
-
|
|
209
|
-
// The index of the first block in "blocks".
|
|
210
|
-
// If the blocks vector is empty, the exact value of this field is not specified.
|
|
211
|
-
first_block_index : BlockIndex;
|
|
212
|
-
|
|
213
|
-
// Encoding of instructions for fetching archived blocks whose indices fall into the
|
|
214
|
-
// requested range.
|
|
215
|
-
//
|
|
216
|
-
// For each entry `e` in [archived_blocks], `[e.from, e.from + len)` is a sub-range
|
|
217
|
-
// of the originally requested block range.
|
|
218
|
-
archived_blocks : vec record {
|
|
219
|
-
// The index of the first archived block that can be fetched using the callback.
|
|
220
|
-
start : BlockIndex;
|
|
221
|
-
|
|
222
|
-
// The number of blocks that can be fetch using the callback.
|
|
223
|
-
length : nat64;
|
|
224
|
-
|
|
225
|
-
// The function that should be called to fetch the archived blocks.
|
|
226
|
-
// The range of the blocks accessible using this function is given by [from]
|
|
227
|
-
// and [len] fields above.
|
|
228
|
-
callback : QueryArchiveFn;
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
type Archive = record {
|
|
233
|
-
canister_id: principal;
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
type Archives = record {
|
|
237
|
-
archives: vec Archive;
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
service : {
|
|
241
|
-
// Transfers tokens from a subaccount of the caller to the destination address.
|
|
242
|
-
// The source address is computed from the principal of the caller and the specified subaccount.
|
|
243
|
-
// When successful, returns the index of the block containing the transaction.
|
|
244
|
-
transfer : (TransferArgs) -> (TransferResult);
|
|
245
|
-
|
|
246
|
-
// Returns the amount of Tokens on the specified account.
|
|
247
|
-
account_balance : (AccountBalanceArgs) -> (Tokens) query;
|
|
248
|
-
|
|
249
|
-
// Returns the current transfer_fee.
|
|
250
|
-
transfer_fee : (TransferFeeArg) -> (TransferFee) query;
|
|
251
|
-
|
|
252
|
-
// Queries blocks in the specified range.
|
|
253
|
-
query_blocks : (GetBlocksArgs) -> (QueryBlocksResponse) query;
|
|
254
|
-
|
|
255
|
-
// Returns token symbol.
|
|
256
|
-
symbol : () -> (record { symbol: text }) query;
|
|
257
|
-
|
|
258
|
-
// Returns token name.
|
|
259
|
-
name : () -> (record { name: text }) query;
|
|
260
|
-
|
|
261
|
-
// Returns token decimals.
|
|
262
|
-
decimals : () -> (record { decimals: nat32 }) query;
|
|
263
|
-
|
|
264
|
-
// Returns the existing archive canisters information.
|
|
265
|
-
archives : () -> (Archives) query;
|
|
266
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import type {ActorMethod} from '@dfinity/agent';
|
|
2
|
-
import type {Principal} from '@dfinity/principal';
|
|
3
|
-
|
|
4
|
-
export interface AccountBalanceArgs {
|
|
5
|
-
account: AccountIdentifier;
|
|
6
|
-
}
|
|
7
|
-
export type AccountIdentifier = Uint8Array | number[];
|
|
8
|
-
export interface Archive {
|
|
9
|
-
canister_id: Principal;
|
|
10
|
-
}
|
|
11
|
-
export interface Archives {
|
|
12
|
-
archives: Array<Archive>;
|
|
13
|
-
}
|
|
14
|
-
export interface Block {
|
|
15
|
-
transaction: Transaction;
|
|
16
|
-
timestamp: TimeStamp;
|
|
17
|
-
parent_hash: [] | [Uint8Array | number[]];
|
|
18
|
-
}
|
|
19
|
-
export type BlockIndex = bigint;
|
|
20
|
-
export interface BlockRange {
|
|
21
|
-
blocks: Array<Block>;
|
|
22
|
-
}
|
|
23
|
-
export interface GetBlocksArgs {
|
|
24
|
-
start: BlockIndex;
|
|
25
|
-
length: bigint;
|
|
26
|
-
}
|
|
27
|
-
export type Memo = bigint;
|
|
28
|
-
export type Operation =
|
|
29
|
-
| {
|
|
30
|
-
Approve: {
|
|
31
|
-
fee: Tokens;
|
|
32
|
-
from: AccountIdentifier;
|
|
33
|
-
allowance_e8s: bigint;
|
|
34
|
-
expires_at: [] | [TimeStamp];
|
|
35
|
-
spender: AccountIdentifier;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
| {Burn: {from: AccountIdentifier; amount: Tokens}}
|
|
39
|
-
| {Mint: {to: AccountIdentifier; amount: Tokens}}
|
|
40
|
-
| {
|
|
41
|
-
Transfer: {
|
|
42
|
-
to: AccountIdentifier;
|
|
43
|
-
fee: Tokens;
|
|
44
|
-
from: AccountIdentifier;
|
|
45
|
-
amount: Tokens;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
| {
|
|
49
|
-
TransferFrom: {
|
|
50
|
-
to: AccountIdentifier;
|
|
51
|
-
fee: Tokens;
|
|
52
|
-
from: AccountIdentifier;
|
|
53
|
-
amount: Tokens;
|
|
54
|
-
spender: AccountIdentifier;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
export type QueryArchiveError =
|
|
58
|
-
| {
|
|
59
|
-
BadFirstBlockIndex: {
|
|
60
|
-
requested_index: BlockIndex;
|
|
61
|
-
first_valid_index: BlockIndex;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
| {Other: {error_message: string; error_code: bigint}};
|
|
65
|
-
export type QueryArchiveFn = ActorMethod<[GetBlocksArgs], QueryArchiveResult>;
|
|
66
|
-
export type QueryArchiveResult = {Ok: BlockRange} | {Err: QueryArchiveError};
|
|
67
|
-
export interface QueryBlocksResponse {
|
|
68
|
-
certificate: [] | [Uint8Array | number[]];
|
|
69
|
-
blocks: Array<Block>;
|
|
70
|
-
chain_length: bigint;
|
|
71
|
-
first_block_index: BlockIndex;
|
|
72
|
-
archived_blocks: Array<{callback: QueryArchiveFn; start: BlockIndex; length: bigint}>;
|
|
73
|
-
}
|
|
74
|
-
export type SubAccount = Uint8Array | number[];
|
|
75
|
-
export interface TimeStamp {
|
|
76
|
-
timestamp_nanos: bigint;
|
|
77
|
-
}
|
|
78
|
-
export interface Tokens {
|
|
79
|
-
e8s: bigint;
|
|
80
|
-
}
|
|
81
|
-
export interface Transaction {
|
|
82
|
-
memo: Memo;
|
|
83
|
-
icrc1_memo: [] | [Uint8Array | number[]];
|
|
84
|
-
operation: [] | [Operation];
|
|
85
|
-
created_at_time: TimeStamp;
|
|
86
|
-
}
|
|
87
|
-
export interface TransferArgs {
|
|
88
|
-
to: AccountIdentifier;
|
|
89
|
-
fee: Tokens;
|
|
90
|
-
memo: Memo;
|
|
91
|
-
from_subaccount: [] | [SubAccount];
|
|
92
|
-
created_at_time: [] | [TimeStamp];
|
|
93
|
-
amount: Tokens;
|
|
94
|
-
}
|
|
95
|
-
export type TransferError =
|
|
96
|
-
| {
|
|
97
|
-
TxTooOld: {allowed_window_nanos: bigint};
|
|
98
|
-
}
|
|
99
|
-
| {BadFee: {expected_fee: Tokens}}
|
|
100
|
-
| {TxDuplicate: {duplicate_of: BlockIndex}}
|
|
101
|
-
| {TxCreatedInFuture: null}
|
|
102
|
-
| {InsufficientFunds: {balance: Tokens}};
|
|
103
|
-
export interface TransferFee {
|
|
104
|
-
transfer_fee: Tokens;
|
|
105
|
-
}
|
|
106
|
-
export type TransferFeeArg = {};
|
|
107
|
-
export type TransferResult = {Ok: BlockIndex} | {Err: TransferError};
|
|
108
|
-
export interface _SERVICE {
|
|
109
|
-
account_balance: ActorMethod<[AccountBalanceArgs], Tokens>;
|
|
110
|
-
archives: ActorMethod<[], Archives>;
|
|
111
|
-
decimals: ActorMethod<[], {decimals: number}>;
|
|
112
|
-
name: ActorMethod<[], {name: string}>;
|
|
113
|
-
query_blocks: ActorMethod<[GetBlocksArgs], QueryBlocksResponse>;
|
|
114
|
-
symbol: ActorMethod<[], {symbol: string}>;
|
|
115
|
-
transfer: ActorMethod<[TransferArgs], TransferResult>;
|
|
116
|
-
transfer_fee: ActorMethod<[TransferFeeArg], TransferFee>;
|
|
117
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
export const idlFactory = ({IDL}) => {
|
|
3
|
-
const AccountIdentifier = IDL.Vec(IDL.Nat8);
|
|
4
|
-
const AccountBalanceArgs = IDL.Record({account: AccountIdentifier});
|
|
5
|
-
const Tokens = IDL.Record({e8s: IDL.Nat64});
|
|
6
|
-
const Archive = IDL.Record({canister_id: IDL.Principal});
|
|
7
|
-
const Archives = IDL.Record({archives: IDL.Vec(Archive)});
|
|
8
|
-
const BlockIndex = IDL.Nat64;
|
|
9
|
-
const GetBlocksArgs = IDL.Record({
|
|
10
|
-
start: BlockIndex,
|
|
11
|
-
length: IDL.Nat64
|
|
12
|
-
});
|
|
13
|
-
const Memo = IDL.Nat64;
|
|
14
|
-
const TimeStamp = IDL.Record({timestamp_nanos: IDL.Nat64});
|
|
15
|
-
const Operation = IDL.Variant({
|
|
16
|
-
Approve: IDL.Record({
|
|
17
|
-
fee: Tokens,
|
|
18
|
-
from: AccountIdentifier,
|
|
19
|
-
allowance_e8s: IDL.Int,
|
|
20
|
-
expires_at: IDL.Opt(TimeStamp),
|
|
21
|
-
spender: AccountIdentifier
|
|
22
|
-
}),
|
|
23
|
-
Burn: IDL.Record({from: AccountIdentifier, amount: Tokens}),
|
|
24
|
-
Mint: IDL.Record({to: AccountIdentifier, amount: Tokens}),
|
|
25
|
-
Transfer: IDL.Record({
|
|
26
|
-
to: AccountIdentifier,
|
|
27
|
-
fee: Tokens,
|
|
28
|
-
from: AccountIdentifier,
|
|
29
|
-
amount: Tokens
|
|
30
|
-
}),
|
|
31
|
-
TransferFrom: IDL.Record({
|
|
32
|
-
to: AccountIdentifier,
|
|
33
|
-
fee: Tokens,
|
|
34
|
-
from: AccountIdentifier,
|
|
35
|
-
amount: Tokens,
|
|
36
|
-
spender: AccountIdentifier
|
|
37
|
-
})
|
|
38
|
-
});
|
|
39
|
-
const Transaction = IDL.Record({
|
|
40
|
-
memo: Memo,
|
|
41
|
-
icrc1_memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
42
|
-
operation: IDL.Opt(Operation),
|
|
43
|
-
created_at_time: TimeStamp
|
|
44
|
-
});
|
|
45
|
-
const Block = IDL.Record({
|
|
46
|
-
transaction: Transaction,
|
|
47
|
-
timestamp: TimeStamp,
|
|
48
|
-
parent_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
|
|
49
|
-
});
|
|
50
|
-
const BlockRange = IDL.Record({blocks: IDL.Vec(Block)});
|
|
51
|
-
const QueryArchiveError = IDL.Variant({
|
|
52
|
-
BadFirstBlockIndex: IDL.Record({
|
|
53
|
-
requested_index: BlockIndex,
|
|
54
|
-
first_valid_index: BlockIndex
|
|
55
|
-
}),
|
|
56
|
-
Other: IDL.Record({
|
|
57
|
-
error_message: IDL.Text,
|
|
58
|
-
error_code: IDL.Nat64
|
|
59
|
-
})
|
|
60
|
-
});
|
|
61
|
-
const QueryArchiveResult = IDL.Variant({
|
|
62
|
-
Ok: BlockRange,
|
|
63
|
-
Err: QueryArchiveError
|
|
64
|
-
});
|
|
65
|
-
const QueryArchiveFn = IDL.Func([GetBlocksArgs], [QueryArchiveResult], ['query']);
|
|
66
|
-
const QueryBlocksResponse = IDL.Record({
|
|
67
|
-
certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
68
|
-
blocks: IDL.Vec(Block),
|
|
69
|
-
chain_length: IDL.Nat64,
|
|
70
|
-
first_block_index: BlockIndex,
|
|
71
|
-
archived_blocks: IDL.Vec(
|
|
72
|
-
IDL.Record({
|
|
73
|
-
callback: QueryArchiveFn,
|
|
74
|
-
start: BlockIndex,
|
|
75
|
-
length: IDL.Nat64
|
|
76
|
-
})
|
|
77
|
-
)
|
|
78
|
-
});
|
|
79
|
-
const SubAccount = IDL.Vec(IDL.Nat8);
|
|
80
|
-
const TransferArgs = IDL.Record({
|
|
81
|
-
to: AccountIdentifier,
|
|
82
|
-
fee: Tokens,
|
|
83
|
-
memo: Memo,
|
|
84
|
-
from_subaccount: IDL.Opt(SubAccount),
|
|
85
|
-
created_at_time: IDL.Opt(TimeStamp),
|
|
86
|
-
amount: Tokens
|
|
87
|
-
});
|
|
88
|
-
const TransferError = IDL.Variant({
|
|
89
|
-
TxTooOld: IDL.Record({allowed_window_nanos: IDL.Nat64}),
|
|
90
|
-
BadFee: IDL.Record({expected_fee: Tokens}),
|
|
91
|
-
TxDuplicate: IDL.Record({duplicate_of: BlockIndex}),
|
|
92
|
-
TxCreatedInFuture: IDL.Null,
|
|
93
|
-
InsufficientFunds: IDL.Record({balance: Tokens})
|
|
94
|
-
});
|
|
95
|
-
const TransferResult = IDL.Variant({
|
|
96
|
-
Ok: BlockIndex,
|
|
97
|
-
Err: TransferError
|
|
98
|
-
});
|
|
99
|
-
const TransferFeeArg = IDL.Record({});
|
|
100
|
-
const TransferFee = IDL.Record({transfer_fee: Tokens});
|
|
101
|
-
return IDL.Service({
|
|
102
|
-
account_balance: IDL.Func([AccountBalanceArgs], [Tokens], ['query']),
|
|
103
|
-
archives: IDL.Func([], [Archives], ['query']),
|
|
104
|
-
decimals: IDL.Func([], [IDL.Record({decimals: IDL.Nat32})], ['query']),
|
|
105
|
-
name: IDL.Func([], [IDL.Record({name: IDL.Text})], ['query']),
|
|
106
|
-
query_blocks: IDL.Func([GetBlocksArgs], [QueryBlocksResponse], ['query']),
|
|
107
|
-
symbol: IDL.Func([], [IDL.Record({symbol: IDL.Text})], ['query']),
|
|
108
|
-
transfer: IDL.Func([TransferArgs], [TransferResult], []),
|
|
109
|
-
transfer_fee: IDL.Func([TransferFeeArg], [TransferFee], ['query'])
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
// @ts-ignore
|
|
113
|
-
export const init = ({IDL}) => {
|
|
114
|
-
return [];
|
|
115
|
-
};
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
type BatchId = nat;
|
|
2
|
-
type ChunkId = nat;
|
|
3
|
-
type Key = text;
|
|
4
|
-
type Time = int;
|
|
5
|
-
|
|
6
|
-
type CreateAssetArguments = record {
|
|
7
|
-
key: Key;
|
|
8
|
-
content_type: text;
|
|
9
|
-
max_age: opt nat64;
|
|
10
|
-
headers: opt vec HeaderField;
|
|
11
|
-
enable_aliasing: opt bool;
|
|
12
|
-
allow_raw_access: opt bool;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
// Add or change content for an asset, by content encoding
|
|
16
|
-
type SetAssetContentArguments = record {
|
|
17
|
-
key: Key;
|
|
18
|
-
content_encoding: text;
|
|
19
|
-
chunk_ids: vec ChunkId;
|
|
20
|
-
sha256: opt blob;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// Remove content for an asset, by content encoding
|
|
24
|
-
type UnsetAssetContentArguments = record {
|
|
25
|
-
key: Key;
|
|
26
|
-
content_encoding: text;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// Delete an asset
|
|
30
|
-
type DeleteAssetArguments = record {
|
|
31
|
-
key: Key;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// Reset everything
|
|
35
|
-
type ClearArguments = record {};
|
|
36
|
-
|
|
37
|
-
type BatchOperationKind = variant {
|
|
38
|
-
CreateAsset: CreateAssetArguments;
|
|
39
|
-
SetAssetContent: SetAssetContentArguments;
|
|
40
|
-
|
|
41
|
-
UnsetAssetContent: UnsetAssetContentArguments;
|
|
42
|
-
DeleteAsset: DeleteAssetArguments;
|
|
43
|
-
|
|
44
|
-
Clear: ClearArguments;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
type HeaderField = record { text; text; };
|
|
48
|
-
|
|
49
|
-
type HttpRequest = record {
|
|
50
|
-
method: text;
|
|
51
|
-
url: text;
|
|
52
|
-
headers: vec HeaderField;
|
|
53
|
-
body: blob;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
type HttpResponse = record {
|
|
57
|
-
status_code: nat16;
|
|
58
|
-
headers: vec HeaderField;
|
|
59
|
-
body: blob;
|
|
60
|
-
streaming_strategy: opt StreamingStrategy;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
type StreamingCallbackHttpResponse = record {
|
|
64
|
-
body: blob;
|
|
65
|
-
token: opt StreamingCallbackToken;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
type StreamingCallbackToken = record {
|
|
69
|
-
key: Key;
|
|
70
|
-
content_encoding: text;
|
|
71
|
-
index: nat;
|
|
72
|
-
sha256: opt blob;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
type StreamingStrategy = variant {
|
|
76
|
-
Callback: record {
|
|
77
|
-
callback: func (StreamingCallbackToken) -> (opt StreamingCallbackHttpResponse) query;
|
|
78
|
-
token: StreamingCallbackToken;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
type SetAssetPropertiesArguments = record {
|
|
83
|
-
key: Key;
|
|
84
|
-
max_age: opt opt nat64;
|
|
85
|
-
headers: opt opt vec HeaderField;
|
|
86
|
-
allow_raw_access: opt opt bool;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
type Permission = variant {
|
|
90
|
-
Commit;
|
|
91
|
-
ManagePermissions;
|
|
92
|
-
Prepare;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
type GrantPermission = record {
|
|
96
|
-
to_principal: principal;
|
|
97
|
-
permission: Permission;
|
|
98
|
-
};
|
|
99
|
-
type RevokePermission = record {
|
|
100
|
-
of_principal: principal;
|
|
101
|
-
permission: Permission;
|
|
102
|
-
};
|
|
103
|
-
type ListPermitted = record { permission: Permission };
|
|
104
|
-
|
|
105
|
-
type ValidationResult = variant { Ok : text; Err : text };
|
|
106
|
-
|
|
107
|
-
service: {
|
|
108
|
-
get: (record {
|
|
109
|
-
key: Key;
|
|
110
|
-
accept_encodings: vec text;
|
|
111
|
-
}) -> (record {
|
|
112
|
-
content: blob; // may be the entirety of the content, or just chunk index 0
|
|
113
|
-
content_type: text;
|
|
114
|
-
content_encoding: text;
|
|
115
|
-
sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments
|
|
116
|
-
total_length: nat; // all chunks except last have size == content.size()
|
|
117
|
-
}) query;
|
|
118
|
-
|
|
119
|
-
// if get() returned chunks > 1, call this to retrieve them.
|
|
120
|
-
// chunks may or may not be split up at the same boundaries as presented to create_chunk().
|
|
121
|
-
get_chunk: (record {
|
|
122
|
-
key: Key;
|
|
123
|
-
content_encoding: text;
|
|
124
|
-
index: nat;
|
|
125
|
-
sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments
|
|
126
|
-
}) -> (record { content: blob }) query;
|
|
127
|
-
|
|
128
|
-
list : (record {}) -> (vec record {
|
|
129
|
-
key: Key;
|
|
130
|
-
content_type: text;
|
|
131
|
-
encodings: vec record {
|
|
132
|
-
content_encoding: text;
|
|
133
|
-
sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments
|
|
134
|
-
length: nat; // Size of this encoding's blob. Calculated when uploading assets.
|
|
135
|
-
modified: Time;
|
|
136
|
-
};
|
|
137
|
-
}) query;
|
|
138
|
-
|
|
139
|
-
certified_tree : (record {}) -> (record {
|
|
140
|
-
certificate: blob;
|
|
141
|
-
tree: blob;
|
|
142
|
-
}) query;
|
|
143
|
-
|
|
144
|
-
create_batch : (record {}) -> (record { batch_id: BatchId });
|
|
145
|
-
|
|
146
|
-
create_chunk: (record { batch_id: BatchId; content: blob }) -> (record { chunk_id: ChunkId });
|
|
147
|
-
|
|
148
|
-
// Perform all operations successfully, or reject
|
|
149
|
-
commit_batch: (record { batch_id: BatchId; operations: vec BatchOperationKind }) -> ();
|
|
150
|
-
|
|
151
|
-
create_asset: (CreateAssetArguments) -> ();
|
|
152
|
-
set_asset_content: (SetAssetContentArguments) -> ();
|
|
153
|
-
unset_asset_content: (UnsetAssetContentArguments) -> ();
|
|
154
|
-
|
|
155
|
-
delete_asset: (DeleteAssetArguments) -> ();
|
|
156
|
-
|
|
157
|
-
clear: (ClearArguments) -> ();
|
|
158
|
-
|
|
159
|
-
// Single call to create an asset with content for a single content encoding that
|
|
160
|
-
// fits within the message ingress limit.
|
|
161
|
-
store: (record {
|
|
162
|
-
key: Key;
|
|
163
|
-
content_type: text;
|
|
164
|
-
content_encoding: text;
|
|
165
|
-
content: blob;
|
|
166
|
-
sha256: opt blob
|
|
167
|
-
}) -> ();
|
|
168
|
-
|
|
169
|
-
http_request: (request: HttpRequest) -> (HttpResponse) query;
|
|
170
|
-
http_request_streaming_callback: (token: StreamingCallbackToken) -> (opt StreamingCallbackHttpResponse) query;
|
|
171
|
-
|
|
172
|
-
authorize: (principal) -> ();
|
|
173
|
-
deauthorize: (principal) -> ();
|
|
174
|
-
list_authorized: () -> (vec principal) query;
|
|
175
|
-
grant_permission: (GrantPermission) -> ();
|
|
176
|
-
revoke_permission: (RevokePermission) -> ();
|
|
177
|
-
list_permitted: (ListPermitted) -> (vec principal) query;
|
|
178
|
-
take_ownership: () -> ();
|
|
179
|
-
|
|
180
|
-
get_asset_properties : (key: Key) -> (record {
|
|
181
|
-
max_age: opt nat64;
|
|
182
|
-
headers: opt vec HeaderField;
|
|
183
|
-
allow_raw_access: opt bool; } ) query;
|
|
184
|
-
set_asset_properties: (SetAssetPropertiesArguments) -> ();
|
|
185
|
-
|
|
186
|
-
validate_grant_permission: (GrantPermission) -> (ValidationResult);
|
|
187
|
-
validate_revoke_permission: (RevokePermission) -> (ValidationResult);
|
|
188
|
-
}
|