@junobuild/functions 0.4.1 → 0.5.0

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.
Files changed (137) hide show
  1. package/canisters/_canister.d.ts +17 -0
  2. package/canisters/_constants.d.ts +3 -0
  3. package/canisters/ckbtc/index.d.ts +1 -0
  4. package/canisters/ckbtc/index.js +2 -0
  5. package/canisters/cketh/index.d.ts +1 -0
  6. package/canisters/cketh/index.js +2 -0
  7. package/canisters/cketh/index.js.map +7 -0
  8. package/canisters/cmc/cmc.canister.d.ts +28 -0
  9. package/canisters/cmc/index.d.ts +2 -0
  10. package/canisters/cmc/index.js +2 -0
  11. package/canisters/cmc/index.js.map +7 -0
  12. package/canisters/declarations/_idl.d.ts +16 -0
  13. package/canisters/declarations/_types.d.ts +16 -0
  14. package/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
  15. package/canisters/declarations/ckbtc/bitcoin.did.idl.d.ts +40 -0
  16. package/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
  17. package/canisters/declarations/ckbtc/minter.did.idl.d.ts +61 -0
  18. package/canisters/declarations/cketh/minter.did.d.ts +893 -0
  19. package/canisters/declarations/cketh/minter.did.idl.d.ts +58 -0
  20. package/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
  21. package/canisters/declarations/cketh/orchestrator.did.idl.d.ts +34 -0
  22. package/canisters/declarations/cmc/cmc.did.d.ts +344 -0
  23. package/canisters/declarations/cmc/cmc.did.idl.d.ts +53 -0
  24. package/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
  25. package/canisters/declarations/ic-management/ic-management.did.idl.d.ts +147 -0
  26. package/canisters/declarations/index.d.ts +2 -0
  27. package/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
  28. package/canisters/declarations/ledger-icp/index.did.idl.d.ts +35 -0
  29. package/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
  30. package/canisters/declarations/ledger-icp/ledger.did.idl.d.ts +106 -0
  31. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
  32. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.d.ts +44 -0
  33. package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
  34. package/canisters/declarations/ledger-icrc/icrc_index.did.idl.d.ts +28 -0
  35. package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
  36. package/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.d.ts +100 -0
  37. package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
  38. package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.d.ts +39 -0
  39. package/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
  40. package/canisters/declarations/nns/genesis_token.did.idl.d.ts +24 -0
  41. package/canisters/declarations/nns/governance.did.d.ts +1254 -0
  42. package/canisters/declarations/nns/governance.did.idl.d.ts +217 -0
  43. package/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
  44. package/canisters/declarations/nns/governance_test.did.idl.d.ts +218 -0
  45. package/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
  46. package/canisters/declarations/nns/sns_wasm.did.idl.d.ts +80 -0
  47. package/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
  48. package/canisters/declarations/sns/sns_governance.did.idl.d.ts +189 -0
  49. package/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
  50. package/canisters/declarations/sns/sns_governance_test.did.idl.d.ts +199 -0
  51. package/canisters/declarations/sns/sns_root.did.d.ts +204 -0
  52. package/canisters/declarations/sns/sns_root.did.idl.d.ts +53 -0
  53. package/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
  54. package/canisters/declarations/sns/sns_swap.did.idl.d.ts +108 -0
  55. package/canisters/ic-management/index.d.ts +1 -0
  56. package/canisters/ic-management/index.js +2 -0
  57. package/canisters/ic-management/index.js.map +7 -0
  58. package/canisters/index.d.ts +1 -0
  59. package/canisters/index.js +2 -0
  60. package/canisters/index.js.map +7 -0
  61. package/canisters/ledger/icp/index.d.ts +2 -0
  62. package/canisters/ledger/icp/index.js +2 -0
  63. package/canisters/ledger/icp/index.js.map +7 -0
  64. package/canisters/ledger/icp/ledger.canister.d.ts +24 -0
  65. package/canisters/ledger/icrc/index.d.ts +3 -0
  66. package/canisters/ledger/icrc/index.js +2 -0
  67. package/canisters/ledger/icrc/index.js.map +7 -0
  68. package/canisters/ledger/icrc/ledger.canister.d.ts +45 -0
  69. package/canisters/ledger/icrc/schemas.d.ts +11 -0
  70. package/canisters/nns/index.d.ts +1 -0
  71. package/canisters/nns/index.js +2 -0
  72. package/canisters/nns/index.js.map +7 -0
  73. package/canisters/schemas.d.ts +11 -0
  74. package/canisters/sns/index.d.ts +1 -0
  75. package/canisters/sns/index.js +2 -0
  76. package/canisters/sns/index.js.map +7 -0
  77. package/chunk-4C666HHU.js +2 -0
  78. package/chunk-4C666HHU.js.map +7 -0
  79. package/chunk-5NZMOUKF.js +2 -0
  80. package/chunk-5NZMOUKF.js.map +7 -0
  81. package/chunk-BXZ5PSUW.js +2 -0
  82. package/chunk-BXZ5PSUW.js.map +7 -0
  83. package/chunk-EMQQE34V.js +2 -0
  84. package/chunk-EMQQE34V.js.map +7 -0
  85. package/chunk-HANEPD6T.js +2 -0
  86. package/chunk-HANEPD6T.js.map +7 -0
  87. package/chunk-TZVF5LQY.js +2 -0
  88. package/chunk-TZVF5LQY.js.map +7 -0
  89. package/ic-cdk.js +1 -1
  90. package/ic-cdk.js.map +4 -4
  91. package/index.js +1 -1
  92. package/index.js.map +1 -1
  93. package/package.json +39 -2
  94. package/sdk.js +1 -1
  95. package/sdk.js.map +1 -1
  96. package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
  97. package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +302 -0
  98. package/src/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
  99. package/src/canisters/declarations/ckbtc/minter.did.idl.js +893 -0
  100. package/src/canisters/declarations/cketh/minter.did.d.ts +893 -0
  101. package/src/canisters/declarations/cketh/minter.did.idl.js +878 -0
  102. package/src/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
  103. package/src/canisters/declarations/cketh/orchestrator.did.idl.js +343 -0
  104. package/src/canisters/declarations/cmc/cmc.did.d.ts +344 -0
  105. package/src/canisters/declarations/cmc/cmc.did.idl.js +338 -0
  106. package/src/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
  107. package/src/canisters/declarations/ic-management/ic-management.did.idl.js +1150 -0
  108. package/src/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
  109. package/src/canisters/declarations/ledger-icp/index.did.idl.js +225 -0
  110. package/src/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
  111. package/src/canisters/declarations/ledger-icp/ledger.did.idl.js +813 -0
  112. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
  113. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.js +274 -0
  114. package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
  115. package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +171 -0
  116. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
  117. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +923 -0
  118. package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
  119. package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.js +163 -0
  120. package/src/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
  121. package/src/canisters/declarations/nns/genesis_token.did.idl.js +84 -0
  122. package/src/canisters/declarations/nns/governance.did.d.ts +1254 -0
  123. package/src/canisters/declarations/nns/governance.did.idl.js +2756 -0
  124. package/src/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
  125. package/src/canisters/declarations/nns/governance_test.did.idl.js +2758 -0
  126. package/src/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
  127. package/src/canisters/declarations/nns/sns_wasm.did.idl.js +589 -0
  128. package/src/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
  129. package/src/canisters/declarations/sns/sns_governance.did.idl.js +2235 -0
  130. package/src/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
  131. package/src/canisters/declarations/sns/sns_governance_test.did.idl.js +2283 -0
  132. package/src/canisters/declarations/sns/sns_root.did.d.ts +204 -0
  133. package/src/canisters/declarations/sns/sns_root.did.idl.js +433 -0
  134. package/src/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
  135. package/src/canisters/declarations/sns/sns_swap.did.idl.js +858 -0
  136. package/global.d.js +0 -1
  137. /package/{global.d.js.map → canisters/ckbtc/index.js.map} +0 -0
@@ -0,0 +1,923 @@
1
+ /* eslint-disable */
2
+
3
+ // @ts-nocheck
4
+
5
+ // This file was automatically generated by @icp-sdk/bindgen@0.2.0.
6
+ // You should NOT make any changes in this file as it will be overwritten.
7
+ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
8
+
9
+ import {IDL} from '@icp-sdk/core/candid';
10
+
11
+ export const GetBlocksResult = IDL.Rec();
12
+ export const ICRC3Value = IDL.Rec();
13
+ export const Value = IDL.Rec();
14
+ export const ChangeArchiveOptions = IDL.Record({
15
+ num_blocks_to_archive: IDL.Opt(IDL.Nat64),
16
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
17
+ trigger_threshold: IDL.Opt(IDL.Nat64),
18
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
19
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
20
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
21
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
22
+ controller_id: IDL.Opt(IDL.Principal)
23
+ });
24
+ export const MetadataValue = IDL.Variant({
25
+ Int: IDL.Int,
26
+ Nat: IDL.Nat,
27
+ Blob: IDL.Vec(IDL.Nat8),
28
+ Text: IDL.Text
29
+ });
30
+ export const Subaccount = IDL.Vec(IDL.Nat8);
31
+ export const Account = IDL.Record({
32
+ owner: IDL.Principal,
33
+ subaccount: IDL.Opt(Subaccount)
34
+ });
35
+ export const ChangeFeeCollector = IDL.Variant({
36
+ SetTo: Account,
37
+ Unset: IDL.Null
38
+ });
39
+ export const FeatureFlags = IDL.Record({icrc2: IDL.Bool});
40
+ export const UpgradeArgs = IDL.Record({
41
+ change_archive_options: IDL.Opt(ChangeArchiveOptions),
42
+ token_symbol: IDL.Opt(IDL.Text),
43
+ transfer_fee: IDL.Opt(IDL.Nat),
44
+ metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),
45
+ change_fee_collector: IDL.Opt(ChangeFeeCollector),
46
+ max_memo_length: IDL.Opt(IDL.Nat16),
47
+ index_principal: IDL.Opt(IDL.Principal),
48
+ token_name: IDL.Opt(IDL.Text),
49
+ feature_flags: IDL.Opt(FeatureFlags)
50
+ });
51
+ export const InitArgs = IDL.Record({
52
+ decimals: IDL.Opt(IDL.Nat8),
53
+ token_symbol: IDL.Text,
54
+ transfer_fee: IDL.Nat,
55
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),
56
+ minting_account: Account,
57
+ initial_balances: IDL.Vec(IDL.Tuple(Account, IDL.Nat)),
58
+ fee_collector_account: IDL.Opt(Account),
59
+ archive_options: IDL.Record({
60
+ num_blocks_to_archive: IDL.Nat64,
61
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
62
+ trigger_threshold: IDL.Nat64,
63
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
64
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
65
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
66
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
67
+ controller_id: IDL.Principal
68
+ }),
69
+ max_memo_length: IDL.Opt(IDL.Nat16),
70
+ index_principal: IDL.Opt(IDL.Principal),
71
+ token_name: IDL.Text,
72
+ feature_flags: IDL.Opt(FeatureFlags)
73
+ });
74
+ export const LedgerArg = IDL.Variant({
75
+ Upgrade: IDL.Opt(UpgradeArgs),
76
+ Init: InitArgs
77
+ });
78
+ export const BlockIndex = IDL.Nat;
79
+ export const ArchiveInfo = IDL.Record({
80
+ block_range_end: BlockIndex,
81
+ canister_id: IDL.Principal,
82
+ block_range_start: BlockIndex
83
+ });
84
+ export const GetBlocksArgs = IDL.Record({
85
+ start: BlockIndex,
86
+ length: IDL.Nat
87
+ });
88
+ export const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));
89
+ Value.fill(
90
+ IDL.Variant({
91
+ Int: IDL.Int,
92
+ Map: Map,
93
+ Nat: IDL.Nat,
94
+ Nat64: IDL.Nat64,
95
+ Blob: IDL.Vec(IDL.Nat8),
96
+ Text: IDL.Text,
97
+ Array: IDL.Vec(Value)
98
+ })
99
+ );
100
+ export const Block = Value;
101
+ export const BlockRange = IDL.Record({blocks: IDL.Vec(Block)});
102
+ export const QueryBlockArchiveFn = IDL.Func([GetBlocksArgs], [BlockRange], ['query']);
103
+ export const GetBlocksResponse = IDL.Record({
104
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
105
+ first_index: BlockIndex,
106
+ blocks: IDL.Vec(Block),
107
+ chain_length: IDL.Nat64,
108
+ archived_blocks: IDL.Vec(
109
+ IDL.Record({
110
+ callback: QueryBlockArchiveFn,
111
+ start: BlockIndex,
112
+ length: IDL.Nat
113
+ })
114
+ )
115
+ });
116
+ export const DataCertificate = IDL.Record({
117
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
118
+ hash_tree: IDL.Vec(IDL.Nat8)
119
+ });
120
+ export const TxIndex = IDL.Nat;
121
+ export const GetTransactionsRequest = IDL.Record({
122
+ start: TxIndex,
123
+ length: IDL.Nat
124
+ });
125
+ export const Timestamp = IDL.Nat64;
126
+ export const Burn = IDL.Record({
127
+ fee: IDL.Opt(IDL.Nat),
128
+ from: Account,
129
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
130
+ created_at_time: IDL.Opt(Timestamp),
131
+ amount: IDL.Nat,
132
+ spender: IDL.Opt(Account)
133
+ });
134
+ export const Mint = IDL.Record({
135
+ to: Account,
136
+ fee: IDL.Opt(IDL.Nat),
137
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
138
+ created_at_time: IDL.Opt(Timestamp),
139
+ amount: IDL.Nat
140
+ });
141
+ export const Approve = IDL.Record({
142
+ fee: IDL.Opt(IDL.Nat),
143
+ from: Account,
144
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
145
+ created_at_time: IDL.Opt(Timestamp),
146
+ amount: IDL.Nat,
147
+ expected_allowance: IDL.Opt(IDL.Nat),
148
+ expires_at: IDL.Opt(Timestamp),
149
+ spender: Account
150
+ });
151
+ export const Transfer = IDL.Record({
152
+ to: Account,
153
+ fee: IDL.Opt(IDL.Nat),
154
+ from: Account,
155
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
156
+ created_at_time: IDL.Opt(Timestamp),
157
+ amount: IDL.Nat,
158
+ spender: IDL.Opt(Account)
159
+ });
160
+ export const Transaction = IDL.Record({
161
+ burn: IDL.Opt(Burn),
162
+ kind: IDL.Text,
163
+ mint: IDL.Opt(Mint),
164
+ approve: IDL.Opt(Approve),
165
+ timestamp: Timestamp,
166
+ transfer: IDL.Opt(Transfer)
167
+ });
168
+ export const TransactionRange = IDL.Record({
169
+ transactions: IDL.Vec(Transaction)
170
+ });
171
+ export const QueryArchiveFn = IDL.Func([GetTransactionsRequest], [TransactionRange], ['query']);
172
+ export const GetTransactionsResponse = IDL.Record({
173
+ first_index: TxIndex,
174
+ log_length: IDL.Nat,
175
+ transactions: IDL.Vec(Transaction),
176
+ archived_transactions: IDL.Vec(
177
+ IDL.Record({
178
+ callback: QueryArchiveFn,
179
+ start: TxIndex,
180
+ length: IDL.Nat
181
+ })
182
+ )
183
+ });
184
+ export const GetAllowancesArgs = IDL.Record({
185
+ take: IDL.Opt(IDL.Nat),
186
+ prev_spender: IDL.Opt(Account),
187
+ from_account: IDL.Opt(Account)
188
+ });
189
+ export const Allowance103 = IDL.Record({
190
+ from_account: Account,
191
+ to_spender: Account,
192
+ allowance: IDL.Nat,
193
+ expires_at: IDL.Opt(IDL.Nat64)
194
+ });
195
+ export const GetAllowancesError = IDL.Variant({
196
+ GenericError: IDL.Record({message: IDL.Text, error_code: IDL.Nat}),
197
+ AccessDenied: IDL.Record({reason: IDL.Text})
198
+ });
199
+ export const icrc103_get_allowances_response = IDL.Variant({
200
+ Ok: IDL.Vec(Allowance103),
201
+ Err: GetAllowancesError
202
+ });
203
+ export const GetIndexPrincipalError = IDL.Variant({
204
+ GenericError: IDL.Record({
205
+ description: IDL.Text,
206
+ error_code: IDL.Nat
207
+ }),
208
+ IndexPrincipalNotSet: IDL.Null
209
+ });
210
+ export const GetIndexPrincipalResult = IDL.Variant({
211
+ Ok: IDL.Principal,
212
+ Err: GetIndexPrincipalError
213
+ });
214
+ export const Tokens = IDL.Nat;
215
+ export const StandardRecord = IDL.Record({
216
+ url: IDL.Text,
217
+ name: IDL.Text
218
+ });
219
+ export const TransferArg = IDL.Record({
220
+ to: Account,
221
+ fee: IDL.Opt(Tokens),
222
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
223
+ from_subaccount: IDL.Opt(Subaccount),
224
+ created_at_time: IDL.Opt(Timestamp),
225
+ amount: Tokens
226
+ });
227
+ export const TransferError = IDL.Variant({
228
+ GenericError: IDL.Record({message: IDL.Text, error_code: IDL.Nat}),
229
+ TemporarilyUnavailable: IDL.Null,
230
+ BadBurn: IDL.Record({min_burn_amount: Tokens}),
231
+ Duplicate: IDL.Record({duplicate_of: BlockIndex}),
232
+ BadFee: IDL.Record({expected_fee: Tokens}),
233
+ CreatedInFuture: IDL.Record({ledger_time: Timestamp}),
234
+ TooOld: IDL.Null,
235
+ InsufficientFunds: IDL.Record({balance: Tokens})
236
+ });
237
+ export const TransferResult = IDL.Variant({
238
+ Ok: BlockIndex,
239
+ Err: TransferError
240
+ });
241
+ export const icrc21_consent_message_metadata = IDL.Record({
242
+ utc_offset_minutes: IDL.Opt(IDL.Int16),
243
+ language: IDL.Text
244
+ });
245
+ export const icrc21_consent_message_spec = IDL.Record({
246
+ metadata: icrc21_consent_message_metadata,
247
+ device_spec: IDL.Opt(IDL.Variant({GenericDisplay: IDL.Null, FieldsDisplay: IDL.Null}))
248
+ });
249
+ export const icrc21_consent_message_request = IDL.Record({
250
+ arg: IDL.Vec(IDL.Nat8),
251
+ method: IDL.Text,
252
+ user_preferences: icrc21_consent_message_spec
253
+ });
254
+ export const Icrc21Value = IDL.Variant({
255
+ Text: IDL.Record({content: IDL.Text}),
256
+ TokenAmount: IDL.Record({
257
+ decimals: IDL.Nat8,
258
+ amount: IDL.Nat64,
259
+ symbol: IDL.Text
260
+ }),
261
+ TimestampSeconds: IDL.Record({amount: IDL.Nat64}),
262
+ DurationSeconds: IDL.Record({amount: IDL.Nat64})
263
+ });
264
+ export const FieldsDisplay = IDL.Record({
265
+ fields: IDL.Vec(IDL.Tuple(IDL.Text, Icrc21Value)),
266
+ intent: IDL.Text
267
+ });
268
+ export const icrc21_consent_message = IDL.Variant({
269
+ FieldsDisplayMessage: FieldsDisplay,
270
+ GenericDisplayMessage: IDL.Text
271
+ });
272
+ export const icrc21_consent_info = IDL.Record({
273
+ metadata: icrc21_consent_message_metadata,
274
+ consent_message: icrc21_consent_message
275
+ });
276
+ export const icrc21_error_info = IDL.Record({description: IDL.Text});
277
+ export const icrc21_error = IDL.Variant({
278
+ GenericError: IDL.Record({
279
+ description: IDL.Text,
280
+ error_code: IDL.Nat
281
+ }),
282
+ InsufficientPayment: icrc21_error_info,
283
+ UnsupportedCanisterCall: icrc21_error_info,
284
+ ConsentMessageUnavailable: icrc21_error_info
285
+ });
286
+ export const icrc21_consent_message_response = IDL.Variant({
287
+ Ok: icrc21_consent_info,
288
+ Err: icrc21_error
289
+ });
290
+ export const AllowanceArgs = IDL.Record({
291
+ account: Account,
292
+ spender: Account
293
+ });
294
+ export const Allowance = IDL.Record({
295
+ allowance: IDL.Nat,
296
+ expires_at: IDL.Opt(Timestamp)
297
+ });
298
+ export const ApproveArgs = IDL.Record({
299
+ fee: IDL.Opt(IDL.Nat),
300
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
301
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
302
+ created_at_time: IDL.Opt(Timestamp),
303
+ amount: IDL.Nat,
304
+ expected_allowance: IDL.Opt(IDL.Nat),
305
+ expires_at: IDL.Opt(Timestamp),
306
+ spender: Account
307
+ });
308
+ export const ApproveError = IDL.Variant({
309
+ GenericError: IDL.Record({message: IDL.Text, error_code: IDL.Nat}),
310
+ TemporarilyUnavailable: IDL.Null,
311
+ Duplicate: IDL.Record({duplicate_of: BlockIndex}),
312
+ BadFee: IDL.Record({expected_fee: IDL.Nat}),
313
+ AllowanceChanged: IDL.Record({current_allowance: IDL.Nat}),
314
+ CreatedInFuture: IDL.Record({ledger_time: Timestamp}),
315
+ TooOld: IDL.Null,
316
+ Expired: IDL.Record({ledger_time: Timestamp}),
317
+ InsufficientFunds: IDL.Record({balance: IDL.Nat})
318
+ });
319
+ export const ApproveResult = IDL.Variant({
320
+ Ok: BlockIndex,
321
+ Err: ApproveError
322
+ });
323
+ export const TransferFromArgs = IDL.Record({
324
+ to: Account,
325
+ fee: IDL.Opt(Tokens),
326
+ spender_subaccount: IDL.Opt(Subaccount),
327
+ from: Account,
328
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
329
+ created_at_time: IDL.Opt(Timestamp),
330
+ amount: Tokens
331
+ });
332
+ export const TransferFromError = IDL.Variant({
333
+ GenericError: IDL.Record({message: IDL.Text, error_code: IDL.Nat}),
334
+ TemporarilyUnavailable: IDL.Null,
335
+ InsufficientAllowance: IDL.Record({allowance: Tokens}),
336
+ BadBurn: IDL.Record({min_burn_amount: Tokens}),
337
+ Duplicate: IDL.Record({duplicate_of: BlockIndex}),
338
+ BadFee: IDL.Record({expected_fee: Tokens}),
339
+ CreatedInFuture: IDL.Record({ledger_time: Timestamp}),
340
+ TooOld: IDL.Null,
341
+ InsufficientFunds: IDL.Record({balance: Tokens})
342
+ });
343
+ export const TransferFromResult = IDL.Variant({
344
+ Ok: BlockIndex,
345
+ Err: TransferFromError
346
+ });
347
+ export const GetArchivesArgs = IDL.Record({from: IDL.Opt(IDL.Principal)});
348
+ export const GetArchivesResult = IDL.Vec(
349
+ IDL.Record({
350
+ end: IDL.Nat,
351
+ canister_id: IDL.Principal,
352
+ start: IDL.Nat
353
+ })
354
+ );
355
+ ICRC3Value.fill(
356
+ IDL.Variant({
357
+ Int: IDL.Int,
358
+ Map: IDL.Vec(IDL.Tuple(IDL.Text, ICRC3Value)),
359
+ Nat: IDL.Nat,
360
+ Blob: IDL.Vec(IDL.Nat8),
361
+ Text: IDL.Text,
362
+ Array: IDL.Vec(ICRC3Value)
363
+ })
364
+ );
365
+ GetBlocksResult.fill(
366
+ IDL.Record({
367
+ log_length: IDL.Nat,
368
+ blocks: IDL.Vec(IDL.Record({id: IDL.Nat, block: ICRC3Value})),
369
+ archived_blocks: IDL.Vec(
370
+ IDL.Record({
371
+ args: IDL.Vec(GetBlocksArgs),
372
+ callback: IDL.Func([IDL.Vec(GetBlocksArgs)], [GetBlocksResult], ['query'])
373
+ })
374
+ )
375
+ })
376
+ );
377
+ export const ICRC3DataCertificate = IDL.Record({
378
+ certificate: IDL.Vec(IDL.Nat8),
379
+ hash_tree: IDL.Vec(IDL.Nat8)
380
+ });
381
+
382
+ export const idlService = IDL.Service({
383
+ archives: IDL.Func([], [IDL.Vec(ArchiveInfo)], ['query']),
384
+ get_blocks: IDL.Func([GetBlocksArgs], [GetBlocksResponse], ['query']),
385
+ get_data_certificate: IDL.Func([], [DataCertificate], ['query']),
386
+ get_transactions: IDL.Func([GetTransactionsRequest], [GetTransactionsResponse], ['query']),
387
+ icrc103_get_allowances: IDL.Func(
388
+ [GetAllowancesArgs],
389
+ [icrc103_get_allowances_response],
390
+ ['query']
391
+ ),
392
+ icrc106_get_index_principal: IDL.Func([], [GetIndexPrincipalResult], ['query']),
393
+ icrc10_supported_standards: IDL.Func(
394
+ [],
395
+ [IDL.Vec(IDL.Record({url: IDL.Text, name: IDL.Text}))],
396
+ ['query']
397
+ ),
398
+ icrc1_balance_of: IDL.Func([Account], [Tokens], ['query']),
399
+ icrc1_decimals: IDL.Func([], [IDL.Nat8], ['query']),
400
+ icrc1_fee: IDL.Func([], [Tokens], ['query']),
401
+ icrc1_metadata: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))], ['query']),
402
+ icrc1_minting_account: IDL.Func([], [IDL.Opt(Account)], ['query']),
403
+ icrc1_name: IDL.Func([], [IDL.Text], ['query']),
404
+ icrc1_supported_standards: IDL.Func([], [IDL.Vec(StandardRecord)], ['query']),
405
+ icrc1_symbol: IDL.Func([], [IDL.Text], ['query']),
406
+ icrc1_total_supply: IDL.Func([], [Tokens], ['query']),
407
+ icrc1_transfer: IDL.Func([TransferArg], [TransferResult], []),
408
+ icrc21_canister_call_consent_message: IDL.Func(
409
+ [icrc21_consent_message_request],
410
+ [icrc21_consent_message_response],
411
+ []
412
+ ),
413
+ icrc2_allowance: IDL.Func([AllowanceArgs], [Allowance], ['query']),
414
+ icrc2_approve: IDL.Func([ApproveArgs], [ApproveResult], []),
415
+ icrc2_transfer_from: IDL.Func([TransferFromArgs], [TransferFromResult], []),
416
+ icrc3_get_archives: IDL.Func([GetArchivesArgs], [GetArchivesResult], ['query']),
417
+ icrc3_get_blocks: IDL.Func([IDL.Vec(GetBlocksArgs)], [GetBlocksResult], ['query']),
418
+ icrc3_get_tip_certificate: IDL.Func([], [IDL.Opt(ICRC3DataCertificate)], ['query']),
419
+ icrc3_supported_block_types: IDL.Func(
420
+ [],
421
+ [IDL.Vec(IDL.Record({url: IDL.Text, block_type: IDL.Text}))],
422
+ ['query']
423
+ ),
424
+ is_ledger_ready: IDL.Func([], [IDL.Bool], ['query'])
425
+ });
426
+
427
+ export const idlInitArgs = [LedgerArg];
428
+
429
+ export const idlFactory = ({IDL}) => {
430
+ const GetBlocksResult = IDL.Rec();
431
+ const ICRC3Value = IDL.Rec();
432
+ const Value = IDL.Rec();
433
+ const ChangeArchiveOptions = IDL.Record({
434
+ num_blocks_to_archive: IDL.Opt(IDL.Nat64),
435
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
436
+ trigger_threshold: IDL.Opt(IDL.Nat64),
437
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
438
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
439
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
440
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
441
+ controller_id: IDL.Opt(IDL.Principal)
442
+ });
443
+ const MetadataValue = IDL.Variant({
444
+ Int: IDL.Int,
445
+ Nat: IDL.Nat,
446
+ Blob: IDL.Vec(IDL.Nat8),
447
+ Text: IDL.Text
448
+ });
449
+ const Subaccount = IDL.Vec(IDL.Nat8);
450
+ const Account = IDL.Record({
451
+ owner: IDL.Principal,
452
+ subaccount: IDL.Opt(Subaccount)
453
+ });
454
+ const ChangeFeeCollector = IDL.Variant({
455
+ SetTo: Account,
456
+ Unset: IDL.Null
457
+ });
458
+ const FeatureFlags = IDL.Record({icrc2: IDL.Bool});
459
+ const UpgradeArgs = IDL.Record({
460
+ change_archive_options: IDL.Opt(ChangeArchiveOptions),
461
+ token_symbol: IDL.Opt(IDL.Text),
462
+ transfer_fee: IDL.Opt(IDL.Nat),
463
+ metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),
464
+ change_fee_collector: IDL.Opt(ChangeFeeCollector),
465
+ max_memo_length: IDL.Opt(IDL.Nat16),
466
+ index_principal: IDL.Opt(IDL.Principal),
467
+ token_name: IDL.Opt(IDL.Text),
468
+ feature_flags: IDL.Opt(FeatureFlags)
469
+ });
470
+ const InitArgs = IDL.Record({
471
+ decimals: IDL.Opt(IDL.Nat8),
472
+ token_symbol: IDL.Text,
473
+ transfer_fee: IDL.Nat,
474
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),
475
+ minting_account: Account,
476
+ initial_balances: IDL.Vec(IDL.Tuple(Account, IDL.Nat)),
477
+ fee_collector_account: IDL.Opt(Account),
478
+ archive_options: IDL.Record({
479
+ num_blocks_to_archive: IDL.Nat64,
480
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
481
+ trigger_threshold: IDL.Nat64,
482
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
483
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
484
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
485
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
486
+ controller_id: IDL.Principal
487
+ }),
488
+ max_memo_length: IDL.Opt(IDL.Nat16),
489
+ index_principal: IDL.Opt(IDL.Principal),
490
+ token_name: IDL.Text,
491
+ feature_flags: IDL.Opt(FeatureFlags)
492
+ });
493
+ const LedgerArg = IDL.Variant({
494
+ Upgrade: IDL.Opt(UpgradeArgs),
495
+ Init: InitArgs
496
+ });
497
+ const BlockIndex = IDL.Nat;
498
+ const ArchiveInfo = IDL.Record({
499
+ block_range_end: BlockIndex,
500
+ canister_id: IDL.Principal,
501
+ block_range_start: BlockIndex
502
+ });
503
+ const GetBlocksArgs = IDL.Record({
504
+ start: BlockIndex,
505
+ length: IDL.Nat
506
+ });
507
+ const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));
508
+ Value.fill(
509
+ IDL.Variant({
510
+ Int: IDL.Int,
511
+ Map: Map,
512
+ Nat: IDL.Nat,
513
+ Nat64: IDL.Nat64,
514
+ Blob: IDL.Vec(IDL.Nat8),
515
+ Text: IDL.Text,
516
+ Array: IDL.Vec(Value)
517
+ })
518
+ );
519
+ const Block = Value;
520
+ const BlockRange = IDL.Record({blocks: IDL.Vec(Block)});
521
+ const QueryBlockArchiveFn = IDL.Func([GetBlocksArgs], [BlockRange], ['query']);
522
+ const GetBlocksResponse = IDL.Record({
523
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
524
+ first_index: BlockIndex,
525
+ blocks: IDL.Vec(Block),
526
+ chain_length: IDL.Nat64,
527
+ archived_blocks: IDL.Vec(
528
+ IDL.Record({
529
+ callback: QueryBlockArchiveFn,
530
+ start: BlockIndex,
531
+ length: IDL.Nat
532
+ })
533
+ )
534
+ });
535
+ const DataCertificate = IDL.Record({
536
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
537
+ hash_tree: IDL.Vec(IDL.Nat8)
538
+ });
539
+ const TxIndex = IDL.Nat;
540
+ const GetTransactionsRequest = IDL.Record({
541
+ start: TxIndex,
542
+ length: IDL.Nat
543
+ });
544
+ const Timestamp = IDL.Nat64;
545
+ const Burn = IDL.Record({
546
+ fee: IDL.Opt(IDL.Nat),
547
+ from: Account,
548
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
549
+ created_at_time: IDL.Opt(Timestamp),
550
+ amount: IDL.Nat,
551
+ spender: IDL.Opt(Account)
552
+ });
553
+ const Mint = IDL.Record({
554
+ to: Account,
555
+ fee: IDL.Opt(IDL.Nat),
556
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
557
+ created_at_time: IDL.Opt(Timestamp),
558
+ amount: IDL.Nat
559
+ });
560
+ const Approve = IDL.Record({
561
+ fee: IDL.Opt(IDL.Nat),
562
+ from: Account,
563
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
564
+ created_at_time: IDL.Opt(Timestamp),
565
+ amount: IDL.Nat,
566
+ expected_allowance: IDL.Opt(IDL.Nat),
567
+ expires_at: IDL.Opt(Timestamp),
568
+ spender: Account
569
+ });
570
+ const Transfer = IDL.Record({
571
+ to: Account,
572
+ fee: IDL.Opt(IDL.Nat),
573
+ from: Account,
574
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
575
+ created_at_time: IDL.Opt(Timestamp),
576
+ amount: IDL.Nat,
577
+ spender: IDL.Opt(Account)
578
+ });
579
+ const Transaction = IDL.Record({
580
+ burn: IDL.Opt(Burn),
581
+ kind: IDL.Text,
582
+ mint: IDL.Opt(Mint),
583
+ approve: IDL.Opt(Approve),
584
+ timestamp: Timestamp,
585
+ transfer: IDL.Opt(Transfer)
586
+ });
587
+ const TransactionRange = IDL.Record({
588
+ transactions: IDL.Vec(Transaction)
589
+ });
590
+ const QueryArchiveFn = IDL.Func([GetTransactionsRequest], [TransactionRange], ['query']);
591
+ const GetTransactionsResponse = IDL.Record({
592
+ first_index: TxIndex,
593
+ log_length: IDL.Nat,
594
+ transactions: IDL.Vec(Transaction),
595
+ archived_transactions: IDL.Vec(
596
+ IDL.Record({
597
+ callback: QueryArchiveFn,
598
+ start: TxIndex,
599
+ length: IDL.Nat
600
+ })
601
+ )
602
+ });
603
+ const GetAllowancesArgs = IDL.Record({
604
+ take: IDL.Opt(IDL.Nat),
605
+ prev_spender: IDL.Opt(Account),
606
+ from_account: IDL.Opt(Account)
607
+ });
608
+ const Allowance103 = IDL.Record({
609
+ from_account: Account,
610
+ to_spender: Account,
611
+ allowance: IDL.Nat,
612
+ expires_at: IDL.Opt(IDL.Nat64)
613
+ });
614
+ const GetAllowancesError = IDL.Variant({
615
+ GenericError: IDL.Record({
616
+ message: IDL.Text,
617
+ error_code: IDL.Nat
618
+ }),
619
+ AccessDenied: IDL.Record({reason: IDL.Text})
620
+ });
621
+ const icrc103_get_allowances_response = IDL.Variant({
622
+ Ok: IDL.Vec(Allowance103),
623
+ Err: GetAllowancesError
624
+ });
625
+ const GetIndexPrincipalError = IDL.Variant({
626
+ GenericError: IDL.Record({
627
+ description: IDL.Text,
628
+ error_code: IDL.Nat
629
+ }),
630
+ IndexPrincipalNotSet: IDL.Null
631
+ });
632
+ const GetIndexPrincipalResult = IDL.Variant({
633
+ Ok: IDL.Principal,
634
+ Err: GetIndexPrincipalError
635
+ });
636
+ const Tokens = IDL.Nat;
637
+ const StandardRecord = IDL.Record({url: IDL.Text, name: IDL.Text});
638
+ const TransferArg = IDL.Record({
639
+ to: Account,
640
+ fee: IDL.Opt(Tokens),
641
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
642
+ from_subaccount: IDL.Opt(Subaccount),
643
+ created_at_time: IDL.Opt(Timestamp),
644
+ amount: Tokens
645
+ });
646
+ const TransferError = IDL.Variant({
647
+ GenericError: IDL.Record({
648
+ message: IDL.Text,
649
+ error_code: IDL.Nat
650
+ }),
651
+ TemporarilyUnavailable: IDL.Null,
652
+ BadBurn: IDL.Record({min_burn_amount: Tokens}),
653
+ Duplicate: IDL.Record({duplicate_of: BlockIndex}),
654
+ BadFee: IDL.Record({expected_fee: Tokens}),
655
+ CreatedInFuture: IDL.Record({ledger_time: Timestamp}),
656
+ TooOld: IDL.Null,
657
+ InsufficientFunds: IDL.Record({balance: Tokens})
658
+ });
659
+ const TransferResult = IDL.Variant({
660
+ Ok: BlockIndex,
661
+ Err: TransferError
662
+ });
663
+ const icrc21_consent_message_metadata = IDL.Record({
664
+ utc_offset_minutes: IDL.Opt(IDL.Int16),
665
+ language: IDL.Text
666
+ });
667
+ const icrc21_consent_message_spec = IDL.Record({
668
+ metadata: icrc21_consent_message_metadata,
669
+ device_spec: IDL.Opt(IDL.Variant({GenericDisplay: IDL.Null, FieldsDisplay: IDL.Null}))
670
+ });
671
+ const icrc21_consent_message_request = IDL.Record({
672
+ arg: IDL.Vec(IDL.Nat8),
673
+ method: IDL.Text,
674
+ user_preferences: icrc21_consent_message_spec
675
+ });
676
+ const Icrc21Value = IDL.Variant({
677
+ Text: IDL.Record({content: IDL.Text}),
678
+ TokenAmount: IDL.Record({
679
+ decimals: IDL.Nat8,
680
+ amount: IDL.Nat64,
681
+ symbol: IDL.Text
682
+ }),
683
+ TimestampSeconds: IDL.Record({amount: IDL.Nat64}),
684
+ DurationSeconds: IDL.Record({amount: IDL.Nat64})
685
+ });
686
+ const FieldsDisplay = IDL.Record({
687
+ fields: IDL.Vec(IDL.Tuple(IDL.Text, Icrc21Value)),
688
+ intent: IDL.Text
689
+ });
690
+ const icrc21_consent_message = IDL.Variant({
691
+ FieldsDisplayMessage: FieldsDisplay,
692
+ GenericDisplayMessage: IDL.Text
693
+ });
694
+ const icrc21_consent_info = IDL.Record({
695
+ metadata: icrc21_consent_message_metadata,
696
+ consent_message: icrc21_consent_message
697
+ });
698
+ const icrc21_error_info = IDL.Record({description: IDL.Text});
699
+ const icrc21_error = IDL.Variant({
700
+ GenericError: IDL.Record({
701
+ description: IDL.Text,
702
+ error_code: IDL.Nat
703
+ }),
704
+ InsufficientPayment: icrc21_error_info,
705
+ UnsupportedCanisterCall: icrc21_error_info,
706
+ ConsentMessageUnavailable: icrc21_error_info
707
+ });
708
+ const icrc21_consent_message_response = IDL.Variant({
709
+ Ok: icrc21_consent_info,
710
+ Err: icrc21_error
711
+ });
712
+ const AllowanceArgs = IDL.Record({
713
+ account: Account,
714
+ spender: Account
715
+ });
716
+ const Allowance = IDL.Record({
717
+ allowance: IDL.Nat,
718
+ expires_at: IDL.Opt(Timestamp)
719
+ });
720
+ const ApproveArgs = IDL.Record({
721
+ fee: IDL.Opt(IDL.Nat),
722
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
723
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
724
+ created_at_time: IDL.Opt(Timestamp),
725
+ amount: IDL.Nat,
726
+ expected_allowance: IDL.Opt(IDL.Nat),
727
+ expires_at: IDL.Opt(Timestamp),
728
+ spender: Account
729
+ });
730
+ const ApproveError = IDL.Variant({
731
+ GenericError: IDL.Record({
732
+ message: IDL.Text,
733
+ error_code: IDL.Nat
734
+ }),
735
+ TemporarilyUnavailable: IDL.Null,
736
+ Duplicate: IDL.Record({duplicate_of: BlockIndex}),
737
+ BadFee: IDL.Record({expected_fee: IDL.Nat}),
738
+ AllowanceChanged: IDL.Record({current_allowance: IDL.Nat}),
739
+ CreatedInFuture: IDL.Record({ledger_time: Timestamp}),
740
+ TooOld: IDL.Null,
741
+ Expired: IDL.Record({ledger_time: Timestamp}),
742
+ InsufficientFunds: IDL.Record({balance: IDL.Nat})
743
+ });
744
+ const ApproveResult = IDL.Variant({
745
+ Ok: BlockIndex,
746
+ Err: ApproveError
747
+ });
748
+ const TransferFromArgs = IDL.Record({
749
+ to: Account,
750
+ fee: IDL.Opt(Tokens),
751
+ spender_subaccount: IDL.Opt(Subaccount),
752
+ from: Account,
753
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
754
+ created_at_time: IDL.Opt(Timestamp),
755
+ amount: Tokens
756
+ });
757
+ const TransferFromError = IDL.Variant({
758
+ GenericError: IDL.Record({
759
+ message: IDL.Text,
760
+ error_code: IDL.Nat
761
+ }),
762
+ TemporarilyUnavailable: IDL.Null,
763
+ InsufficientAllowance: IDL.Record({allowance: Tokens}),
764
+ BadBurn: IDL.Record({min_burn_amount: Tokens}),
765
+ Duplicate: IDL.Record({duplicate_of: BlockIndex}),
766
+ BadFee: IDL.Record({expected_fee: Tokens}),
767
+ CreatedInFuture: IDL.Record({ledger_time: Timestamp}),
768
+ TooOld: IDL.Null,
769
+ InsufficientFunds: IDL.Record({balance: Tokens})
770
+ });
771
+ const TransferFromResult = IDL.Variant({
772
+ Ok: BlockIndex,
773
+ Err: TransferFromError
774
+ });
775
+ const GetArchivesArgs = IDL.Record({from: IDL.Opt(IDL.Principal)});
776
+ const GetArchivesResult = IDL.Vec(
777
+ IDL.Record({
778
+ end: IDL.Nat,
779
+ canister_id: IDL.Principal,
780
+ start: IDL.Nat
781
+ })
782
+ );
783
+ ICRC3Value.fill(
784
+ IDL.Variant({
785
+ Int: IDL.Int,
786
+ Map: IDL.Vec(IDL.Tuple(IDL.Text, ICRC3Value)),
787
+ Nat: IDL.Nat,
788
+ Blob: IDL.Vec(IDL.Nat8),
789
+ Text: IDL.Text,
790
+ Array: IDL.Vec(ICRC3Value)
791
+ })
792
+ );
793
+ GetBlocksResult.fill(
794
+ IDL.Record({
795
+ log_length: IDL.Nat,
796
+ blocks: IDL.Vec(IDL.Record({id: IDL.Nat, block: ICRC3Value})),
797
+ archived_blocks: IDL.Vec(
798
+ IDL.Record({
799
+ args: IDL.Vec(GetBlocksArgs),
800
+ callback: IDL.Func([IDL.Vec(GetBlocksArgs)], [GetBlocksResult], ['query'])
801
+ })
802
+ )
803
+ })
804
+ );
805
+ const ICRC3DataCertificate = IDL.Record({
806
+ certificate: IDL.Vec(IDL.Nat8),
807
+ hash_tree: IDL.Vec(IDL.Nat8)
808
+ });
809
+
810
+ return IDL.Service({
811
+ archives: IDL.Func([], [IDL.Vec(ArchiveInfo)], ['query']),
812
+ get_blocks: IDL.Func([GetBlocksArgs], [GetBlocksResponse], ['query']),
813
+ get_data_certificate: IDL.Func([], [DataCertificate], ['query']),
814
+ get_transactions: IDL.Func([GetTransactionsRequest], [GetTransactionsResponse], ['query']),
815
+ icrc103_get_allowances: IDL.Func(
816
+ [GetAllowancesArgs],
817
+ [icrc103_get_allowances_response],
818
+ ['query']
819
+ ),
820
+ icrc106_get_index_principal: IDL.Func([], [GetIndexPrincipalResult], ['query']),
821
+ icrc10_supported_standards: IDL.Func(
822
+ [],
823
+ [IDL.Vec(IDL.Record({url: IDL.Text, name: IDL.Text}))],
824
+ ['query']
825
+ ),
826
+ icrc1_balance_of: IDL.Func([Account], [Tokens], ['query']),
827
+ icrc1_decimals: IDL.Func([], [IDL.Nat8], ['query']),
828
+ icrc1_fee: IDL.Func([], [Tokens], ['query']),
829
+ icrc1_metadata: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))], ['query']),
830
+ icrc1_minting_account: IDL.Func([], [IDL.Opt(Account)], ['query']),
831
+ icrc1_name: IDL.Func([], [IDL.Text], ['query']),
832
+ icrc1_supported_standards: IDL.Func([], [IDL.Vec(StandardRecord)], ['query']),
833
+ icrc1_symbol: IDL.Func([], [IDL.Text], ['query']),
834
+ icrc1_total_supply: IDL.Func([], [Tokens], ['query']),
835
+ icrc1_transfer: IDL.Func([TransferArg], [TransferResult], []),
836
+ icrc21_canister_call_consent_message: IDL.Func(
837
+ [icrc21_consent_message_request],
838
+ [icrc21_consent_message_response],
839
+ []
840
+ ),
841
+ icrc2_allowance: IDL.Func([AllowanceArgs], [Allowance], ['query']),
842
+ icrc2_approve: IDL.Func([ApproveArgs], [ApproveResult], []),
843
+ icrc2_transfer_from: IDL.Func([TransferFromArgs], [TransferFromResult], []),
844
+ icrc3_get_archives: IDL.Func([GetArchivesArgs], [GetArchivesResult], ['query']),
845
+ icrc3_get_blocks: IDL.Func([IDL.Vec(GetBlocksArgs)], [GetBlocksResult], ['query']),
846
+ icrc3_get_tip_certificate: IDL.Func([], [IDL.Opt(ICRC3DataCertificate)], ['query']),
847
+ icrc3_supported_block_types: IDL.Func(
848
+ [],
849
+ [IDL.Vec(IDL.Record({url: IDL.Text, block_type: IDL.Text}))],
850
+ ['query']
851
+ ),
852
+ is_ledger_ready: IDL.Func([], [IDL.Bool], ['query'])
853
+ });
854
+ };
855
+
856
+ export const init = ({IDL}) => {
857
+ const ChangeArchiveOptions = IDL.Record({
858
+ num_blocks_to_archive: IDL.Opt(IDL.Nat64),
859
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
860
+ trigger_threshold: IDL.Opt(IDL.Nat64),
861
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
862
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
863
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
864
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
865
+ controller_id: IDL.Opt(IDL.Principal)
866
+ });
867
+ const MetadataValue = IDL.Variant({
868
+ Int: IDL.Int,
869
+ Nat: IDL.Nat,
870
+ Blob: IDL.Vec(IDL.Nat8),
871
+ Text: IDL.Text
872
+ });
873
+ const Subaccount = IDL.Vec(IDL.Nat8);
874
+ const Account = IDL.Record({
875
+ owner: IDL.Principal,
876
+ subaccount: IDL.Opt(Subaccount)
877
+ });
878
+ const ChangeFeeCollector = IDL.Variant({
879
+ SetTo: Account,
880
+ Unset: IDL.Null
881
+ });
882
+ const FeatureFlags = IDL.Record({icrc2: IDL.Bool});
883
+ const UpgradeArgs = IDL.Record({
884
+ change_archive_options: IDL.Opt(ChangeArchiveOptions),
885
+ token_symbol: IDL.Opt(IDL.Text),
886
+ transfer_fee: IDL.Opt(IDL.Nat),
887
+ metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),
888
+ change_fee_collector: IDL.Opt(ChangeFeeCollector),
889
+ max_memo_length: IDL.Opt(IDL.Nat16),
890
+ index_principal: IDL.Opt(IDL.Principal),
891
+ token_name: IDL.Opt(IDL.Text),
892
+ feature_flags: IDL.Opt(FeatureFlags)
893
+ });
894
+ const InitArgs = IDL.Record({
895
+ decimals: IDL.Opt(IDL.Nat8),
896
+ token_symbol: IDL.Text,
897
+ transfer_fee: IDL.Nat,
898
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),
899
+ minting_account: Account,
900
+ initial_balances: IDL.Vec(IDL.Tuple(Account, IDL.Nat)),
901
+ fee_collector_account: IDL.Opt(Account),
902
+ archive_options: IDL.Record({
903
+ num_blocks_to_archive: IDL.Nat64,
904
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
905
+ trigger_threshold: IDL.Nat64,
906
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
907
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
908
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
909
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
910
+ controller_id: IDL.Principal
911
+ }),
912
+ max_memo_length: IDL.Opt(IDL.Nat16),
913
+ index_principal: IDL.Opt(IDL.Principal),
914
+ token_name: IDL.Text,
915
+ feature_flags: IDL.Opt(FeatureFlags)
916
+ });
917
+ const LedgerArg = IDL.Variant({
918
+ Upgrade: IDL.Opt(UpgradeArgs),
919
+ Init: InitArgs
920
+ });
921
+
922
+ return [LedgerArg];
923
+ };