@junobuild/functions 0.4.1 → 0.5.1

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,813 @@
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 SubAccount = IDL.Vec(IDL.Nat8);
12
+ export const Account = IDL.Record({
13
+ owner: IDL.Principal,
14
+ subaccount: IDL.Opt(SubAccount)
15
+ });
16
+ export const FeatureFlags = IDL.Record({icrc2: IDL.Bool});
17
+ export const UpgradeArgs = IDL.Record({
18
+ icrc1_minting_account: IDL.Opt(Account),
19
+ feature_flags: IDL.Opt(FeatureFlags)
20
+ });
21
+ export const Tokens = IDL.Record({e8s: IDL.Nat64});
22
+ export const TextAccountIdentifier = IDL.Text;
23
+ export const Duration = IDL.Record({secs: IDL.Nat64, nanos: IDL.Nat32});
24
+ export const ArchiveOptions = IDL.Record({
25
+ num_blocks_to_archive: IDL.Nat64,
26
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
27
+ trigger_threshold: IDL.Nat64,
28
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
29
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
30
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
31
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
32
+ controller_id: IDL.Principal
33
+ });
34
+ export const InitArgs = IDL.Record({
35
+ send_whitelist: IDL.Vec(IDL.Principal),
36
+ token_symbol: IDL.Opt(IDL.Text),
37
+ transfer_fee: IDL.Opt(Tokens),
38
+ minting_account: TextAccountIdentifier,
39
+ transaction_window: IDL.Opt(Duration),
40
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
41
+ icrc1_minting_account: IDL.Opt(Account),
42
+ archive_options: IDL.Opt(ArchiveOptions),
43
+ initial_values: IDL.Vec(IDL.Tuple(TextAccountIdentifier, Tokens)),
44
+ token_name: IDL.Opt(IDL.Text),
45
+ feature_flags: IDL.Opt(FeatureFlags)
46
+ });
47
+ export const LedgerCanisterPayload = IDL.Variant({
48
+ Upgrade: IDL.Opt(UpgradeArgs),
49
+ Init: InitArgs
50
+ });
51
+ export const AccountIdentifier = IDL.Vec(IDL.Nat8);
52
+ export const AccountBalanceArgs = IDL.Record({account: AccountIdentifier});
53
+ export const AccountBalanceArgsDfx = IDL.Record({
54
+ account: TextAccountIdentifier
55
+ });
56
+ export const Archive = IDL.Record({canister_id: IDL.Principal});
57
+ export const Archives = IDL.Record({archives: IDL.Vec(Archive)});
58
+ export const GetAllowancesArgs = IDL.Record({
59
+ prev_spender_id: IDL.Opt(TextAccountIdentifier),
60
+ from_account_id: TextAccountIdentifier,
61
+ take: IDL.Opt(IDL.Nat64)
62
+ });
63
+ export const Allowances = IDL.Vec(
64
+ IDL.Record({
65
+ from_account_id: TextAccountIdentifier,
66
+ to_spender_id: TextAccountIdentifier,
67
+ allowance: Tokens,
68
+ expires_at: IDL.Opt(IDL.Nat64)
69
+ })
70
+ );
71
+ export const Icrc1Tokens = IDL.Nat;
72
+ export const Value = IDL.Variant({
73
+ Int: IDL.Int,
74
+ Nat: IDL.Nat,
75
+ Blob: IDL.Vec(IDL.Nat8),
76
+ Text: IDL.Text
77
+ });
78
+ export const Icrc1Timestamp = IDL.Nat64;
79
+ export const TransferArg = IDL.Record({
80
+ to: Account,
81
+ fee: IDL.Opt(Icrc1Tokens),
82
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
83
+ from_subaccount: IDL.Opt(SubAccount),
84
+ created_at_time: IDL.Opt(Icrc1Timestamp),
85
+ amount: Icrc1Tokens
86
+ });
87
+ export const Icrc1BlockIndex = IDL.Nat;
88
+ export const Icrc1TransferError = IDL.Variant({
89
+ GenericError: IDL.Record({message: IDL.Text, error_code: IDL.Nat}),
90
+ TemporarilyUnavailable: IDL.Null,
91
+ BadBurn: IDL.Record({min_burn_amount: Icrc1Tokens}),
92
+ Duplicate: IDL.Record({duplicate_of: Icrc1BlockIndex}),
93
+ BadFee: IDL.Record({expected_fee: Icrc1Tokens}),
94
+ CreatedInFuture: IDL.Record({ledger_time: IDL.Nat64}),
95
+ TooOld: IDL.Null,
96
+ InsufficientFunds: IDL.Record({balance: Icrc1Tokens})
97
+ });
98
+ export const Icrc1TransferResult = IDL.Variant({
99
+ Ok: Icrc1BlockIndex,
100
+ Err: Icrc1TransferError
101
+ });
102
+ export const icrc21_consent_message_metadata = IDL.Record({
103
+ utc_offset_minutes: IDL.Opt(IDL.Int16),
104
+ language: IDL.Text
105
+ });
106
+ export const icrc21_consent_message_spec = IDL.Record({
107
+ metadata: icrc21_consent_message_metadata,
108
+ device_spec: IDL.Opt(IDL.Variant({GenericDisplay: IDL.Null, FieldsDisplay: IDL.Null}))
109
+ });
110
+ export const icrc21_consent_message_request = IDL.Record({
111
+ arg: IDL.Vec(IDL.Nat8),
112
+ method: IDL.Text,
113
+ user_preferences: icrc21_consent_message_spec
114
+ });
115
+ export const Icrc21Value = IDL.Variant({
116
+ Text: IDL.Record({content: IDL.Text}),
117
+ TokenAmount: IDL.Record({
118
+ decimals: IDL.Nat8,
119
+ amount: IDL.Nat64,
120
+ symbol: IDL.Text
121
+ }),
122
+ TimestampSeconds: IDL.Record({amount: IDL.Nat64}),
123
+ DurationSeconds: IDL.Record({amount: IDL.Nat64})
124
+ });
125
+ export const FieldsDisplay = IDL.Record({
126
+ fields: IDL.Vec(IDL.Tuple(IDL.Text, Icrc21Value)),
127
+ intent: IDL.Text
128
+ });
129
+ export const icrc21_consent_message = IDL.Variant({
130
+ FieldsDisplayMessage: FieldsDisplay,
131
+ GenericDisplayMessage: IDL.Text
132
+ });
133
+ export const icrc21_consent_info = IDL.Record({
134
+ metadata: icrc21_consent_message_metadata,
135
+ consent_message: icrc21_consent_message
136
+ });
137
+ export const icrc21_error_info = IDL.Record({description: IDL.Text});
138
+ export const icrc21_error = IDL.Variant({
139
+ GenericError: IDL.Record({
140
+ description: IDL.Text,
141
+ error_code: IDL.Nat
142
+ }),
143
+ InsufficientPayment: icrc21_error_info,
144
+ UnsupportedCanisterCall: icrc21_error_info,
145
+ ConsentMessageUnavailable: icrc21_error_info
146
+ });
147
+ export const icrc21_consent_message_response = IDL.Variant({
148
+ Ok: icrc21_consent_info,
149
+ Err: icrc21_error
150
+ });
151
+ export const AllowanceArgs = IDL.Record({
152
+ account: Account,
153
+ spender: Account
154
+ });
155
+ export const Allowance = IDL.Record({
156
+ allowance: Icrc1Tokens,
157
+ expires_at: IDL.Opt(Icrc1Timestamp)
158
+ });
159
+ export const ApproveArgs = IDL.Record({
160
+ fee: IDL.Opt(Icrc1Tokens),
161
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
162
+ from_subaccount: IDL.Opt(SubAccount),
163
+ created_at_time: IDL.Opt(Icrc1Timestamp),
164
+ amount: Icrc1Tokens,
165
+ expected_allowance: IDL.Opt(Icrc1Tokens),
166
+ expires_at: IDL.Opt(Icrc1Timestamp),
167
+ spender: Account
168
+ });
169
+ export const ApproveError = IDL.Variant({
170
+ GenericError: IDL.Record({message: IDL.Text, error_code: IDL.Nat}),
171
+ TemporarilyUnavailable: IDL.Null,
172
+ Duplicate: IDL.Record({duplicate_of: Icrc1BlockIndex}),
173
+ BadFee: IDL.Record({expected_fee: Icrc1Tokens}),
174
+ AllowanceChanged: IDL.Record({current_allowance: Icrc1Tokens}),
175
+ CreatedInFuture: IDL.Record({ledger_time: IDL.Nat64}),
176
+ TooOld: IDL.Null,
177
+ Expired: IDL.Record({ledger_time: IDL.Nat64}),
178
+ InsufficientFunds: IDL.Record({balance: Icrc1Tokens})
179
+ });
180
+ export const ApproveResult = IDL.Variant({
181
+ Ok: Icrc1BlockIndex,
182
+ Err: ApproveError
183
+ });
184
+ export const TransferFromArgs = IDL.Record({
185
+ to: Account,
186
+ fee: IDL.Opt(Icrc1Tokens),
187
+ spender_subaccount: IDL.Opt(SubAccount),
188
+ from: Account,
189
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
190
+ created_at_time: IDL.Opt(Icrc1Timestamp),
191
+ amount: Icrc1Tokens
192
+ });
193
+ export const TransferFromError = IDL.Variant({
194
+ GenericError: IDL.Record({message: IDL.Text, error_code: IDL.Nat}),
195
+ TemporarilyUnavailable: IDL.Null,
196
+ InsufficientAllowance: IDL.Record({allowance: Icrc1Tokens}),
197
+ BadBurn: IDL.Record({min_burn_amount: Icrc1Tokens}),
198
+ Duplicate: IDL.Record({duplicate_of: Icrc1BlockIndex}),
199
+ BadFee: IDL.Record({expected_fee: Icrc1Tokens}),
200
+ CreatedInFuture: IDL.Record({ledger_time: Icrc1Timestamp}),
201
+ TooOld: IDL.Null,
202
+ InsufficientFunds: IDL.Record({balance: Icrc1Tokens})
203
+ });
204
+ export const TransferFromResult = IDL.Variant({
205
+ Ok: Icrc1BlockIndex,
206
+ Err: TransferFromError
207
+ });
208
+ export const BlockIndex = IDL.Nat64;
209
+ export const GetBlocksArgs = IDL.Record({
210
+ start: BlockIndex,
211
+ length: IDL.Nat64
212
+ });
213
+ export const Memo = IDL.Nat64;
214
+ export const TimeStamp = IDL.Record({timestamp_nanos: IDL.Nat64});
215
+ export const Operation = IDL.Variant({
216
+ Approve: IDL.Record({
217
+ fee: Tokens,
218
+ from: AccountIdentifier,
219
+ allowance_e8s: IDL.Int,
220
+ allowance: Tokens,
221
+ expected_allowance: IDL.Opt(Tokens),
222
+ expires_at: IDL.Opt(TimeStamp),
223
+ spender: AccountIdentifier
224
+ }),
225
+ Burn: IDL.Record({
226
+ from: AccountIdentifier,
227
+ amount: Tokens,
228
+ spender: IDL.Opt(AccountIdentifier)
229
+ }),
230
+ Mint: IDL.Record({to: AccountIdentifier, amount: Tokens}),
231
+ Transfer: IDL.Record({
232
+ to: AccountIdentifier,
233
+ fee: Tokens,
234
+ from: AccountIdentifier,
235
+ amount: Tokens,
236
+ spender: IDL.Opt(IDL.Vec(IDL.Nat8))
237
+ })
238
+ });
239
+ export const Transaction = IDL.Record({
240
+ memo: Memo,
241
+ icrc1_memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
242
+ operation: IDL.Opt(Operation),
243
+ created_at_time: TimeStamp
244
+ });
245
+ export const Block = IDL.Record({
246
+ transaction: Transaction,
247
+ timestamp: TimeStamp,
248
+ parent_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
249
+ });
250
+ export const BlockRange = IDL.Record({blocks: IDL.Vec(Block)});
251
+ export const QueryArchiveError = IDL.Variant({
252
+ BadFirstBlockIndex: IDL.Record({
253
+ requested_index: BlockIndex,
254
+ first_valid_index: BlockIndex
255
+ }),
256
+ Other: IDL.Record({
257
+ error_message: IDL.Text,
258
+ error_code: IDL.Nat64
259
+ })
260
+ });
261
+ export const QueryArchiveResult = IDL.Variant({
262
+ Ok: BlockRange,
263
+ Err: QueryArchiveError
264
+ });
265
+ export const QueryArchiveFn = IDL.Func([GetBlocksArgs], [QueryArchiveResult], ['query']);
266
+ export const ArchivedBlocksRange = IDL.Record({
267
+ callback: QueryArchiveFn,
268
+ start: BlockIndex,
269
+ length: IDL.Nat64
270
+ });
271
+ export const QueryBlocksResponse = IDL.Record({
272
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
273
+ blocks: IDL.Vec(Block),
274
+ chain_length: IDL.Nat64,
275
+ first_block_index: BlockIndex,
276
+ archived_blocks: IDL.Vec(ArchivedBlocksRange)
277
+ });
278
+ export const ArchivedEncodedBlocksRange = IDL.Record({
279
+ callback: IDL.Func(
280
+ [GetBlocksArgs],
281
+ [
282
+ IDL.Variant({
283
+ Ok: IDL.Vec(IDL.Vec(IDL.Nat8)),
284
+ Err: QueryArchiveError
285
+ })
286
+ ],
287
+ ['query']
288
+ ),
289
+ start: IDL.Nat64,
290
+ length: IDL.Nat64
291
+ });
292
+ export const QueryEncodedBlocksResponse = IDL.Record({
293
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
294
+ blocks: IDL.Vec(IDL.Vec(IDL.Nat8)),
295
+ chain_length: IDL.Nat64,
296
+ first_block_index: IDL.Nat64,
297
+ archived_blocks: IDL.Vec(ArchivedEncodedBlocksRange)
298
+ });
299
+ export const RemoveApprovalArgs = IDL.Record({
300
+ fee: IDL.Opt(Icrc1Tokens),
301
+ from_subaccount: IDL.Opt(SubAccount),
302
+ spender: AccountIdentifier
303
+ });
304
+ export const SendArgs = IDL.Record({
305
+ to: TextAccountIdentifier,
306
+ fee: Tokens,
307
+ memo: Memo,
308
+ from_subaccount: IDL.Opt(SubAccount),
309
+ created_at_time: IDL.Opt(TimeStamp),
310
+ amount: Tokens
311
+ });
312
+ export const TipOfChainRes = IDL.Record({
313
+ certification: IDL.Opt(IDL.Vec(IDL.Nat8)),
314
+ tip_index: BlockIndex
315
+ });
316
+ export const TransferArgs = IDL.Record({
317
+ to: AccountIdentifier,
318
+ fee: Tokens,
319
+ memo: Memo,
320
+ from_subaccount: IDL.Opt(SubAccount),
321
+ created_at_time: IDL.Opt(TimeStamp),
322
+ amount: Tokens
323
+ });
324
+ export const TransferError = IDL.Variant({
325
+ TxTooOld: IDL.Record({allowed_window_nanos: IDL.Nat64}),
326
+ BadFee: IDL.Record({expected_fee: Tokens}),
327
+ TxDuplicate: IDL.Record({duplicate_of: BlockIndex}),
328
+ TxCreatedInFuture: IDL.Null,
329
+ InsufficientFunds: IDL.Record({balance: Tokens})
330
+ });
331
+ export const TransferResult = IDL.Variant({
332
+ Ok: BlockIndex,
333
+ Err: TransferError
334
+ });
335
+ export const TransferFeeArg = IDL.Record({});
336
+ export const TransferFee = IDL.Record({transfer_fee: Tokens});
337
+
338
+ export const idlService = IDL.Service({
339
+ account_balance: IDL.Func([AccountBalanceArgs], [Tokens], ['query']),
340
+ account_balance_dfx: IDL.Func([AccountBalanceArgsDfx], [Tokens], ['query']),
341
+ account_identifier: IDL.Func([Account], [AccountIdentifier], ['query']),
342
+ archives: IDL.Func([], [Archives], ['query']),
343
+ decimals: IDL.Func([], [IDL.Record({decimals: IDL.Nat32})], ['query']),
344
+ get_allowances: IDL.Func([GetAllowancesArgs], [Allowances], ['query']),
345
+ icrc10_supported_standards: IDL.Func(
346
+ [],
347
+ [IDL.Vec(IDL.Record({url: IDL.Text, name: IDL.Text}))],
348
+ ['query']
349
+ ),
350
+ icrc1_balance_of: IDL.Func([Account], [Icrc1Tokens], ['query']),
351
+ icrc1_decimals: IDL.Func([], [IDL.Nat8], ['query']),
352
+ icrc1_fee: IDL.Func([], [Icrc1Tokens], ['query']),
353
+ icrc1_metadata: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, Value))], ['query']),
354
+ icrc1_minting_account: IDL.Func([], [IDL.Opt(Account)], ['query']),
355
+ icrc1_name: IDL.Func([], [IDL.Text], ['query']),
356
+ icrc1_supported_standards: IDL.Func(
357
+ [],
358
+ [IDL.Vec(IDL.Record({url: IDL.Text, name: IDL.Text}))],
359
+ ['query']
360
+ ),
361
+ icrc1_symbol: IDL.Func([], [IDL.Text], ['query']),
362
+ icrc1_total_supply: IDL.Func([], [Icrc1Tokens], ['query']),
363
+ icrc1_transfer: IDL.Func([TransferArg], [Icrc1TransferResult], []),
364
+ icrc21_canister_call_consent_message: IDL.Func(
365
+ [icrc21_consent_message_request],
366
+ [icrc21_consent_message_response],
367
+ []
368
+ ),
369
+ icrc2_allowance: IDL.Func([AllowanceArgs], [Allowance], ['query']),
370
+ icrc2_approve: IDL.Func([ApproveArgs], [ApproveResult], []),
371
+ icrc2_transfer_from: IDL.Func([TransferFromArgs], [TransferFromResult], []),
372
+ is_ledger_ready: IDL.Func([], [IDL.Bool], ['query']),
373
+ name: IDL.Func([], [IDL.Record({name: IDL.Text})], ['query']),
374
+ query_blocks: IDL.Func([GetBlocksArgs], [QueryBlocksResponse], ['query']),
375
+ query_encoded_blocks: IDL.Func([GetBlocksArgs], [QueryEncodedBlocksResponse], ['query']),
376
+ remove_approval: IDL.Func([RemoveApprovalArgs], [ApproveResult], []),
377
+ send_dfx: IDL.Func([SendArgs], [BlockIndex], []),
378
+ symbol: IDL.Func([], [IDL.Record({symbol: IDL.Text})], ['query']),
379
+ tip_of_chain: IDL.Func([], [TipOfChainRes], ['query']),
380
+ transfer: IDL.Func([TransferArgs], [TransferResult], []),
381
+ transfer_fee: IDL.Func([TransferFeeArg], [TransferFee], ['query'])
382
+ });
383
+
384
+ export const idlInitArgs = [LedgerCanisterPayload];
385
+
386
+ export const idlFactory = ({IDL}) => {
387
+ const SubAccount = IDL.Vec(IDL.Nat8);
388
+ const Account = IDL.Record({
389
+ owner: IDL.Principal,
390
+ subaccount: IDL.Opt(SubAccount)
391
+ });
392
+ const FeatureFlags = IDL.Record({icrc2: IDL.Bool});
393
+ const UpgradeArgs = IDL.Record({
394
+ icrc1_minting_account: IDL.Opt(Account),
395
+ feature_flags: IDL.Opt(FeatureFlags)
396
+ });
397
+ const Tokens = IDL.Record({e8s: IDL.Nat64});
398
+ const TextAccountIdentifier = IDL.Text;
399
+ const Duration = IDL.Record({secs: IDL.Nat64, nanos: IDL.Nat32});
400
+ const ArchiveOptions = IDL.Record({
401
+ num_blocks_to_archive: IDL.Nat64,
402
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
403
+ trigger_threshold: IDL.Nat64,
404
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
405
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
406
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
407
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
408
+ controller_id: IDL.Principal
409
+ });
410
+ const InitArgs = IDL.Record({
411
+ send_whitelist: IDL.Vec(IDL.Principal),
412
+ token_symbol: IDL.Opt(IDL.Text),
413
+ transfer_fee: IDL.Opt(Tokens),
414
+ minting_account: TextAccountIdentifier,
415
+ transaction_window: IDL.Opt(Duration),
416
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
417
+ icrc1_minting_account: IDL.Opt(Account),
418
+ archive_options: IDL.Opt(ArchiveOptions),
419
+ initial_values: IDL.Vec(IDL.Tuple(TextAccountIdentifier, Tokens)),
420
+ token_name: IDL.Opt(IDL.Text),
421
+ feature_flags: IDL.Opt(FeatureFlags)
422
+ });
423
+ const LedgerCanisterPayload = IDL.Variant({
424
+ Upgrade: IDL.Opt(UpgradeArgs),
425
+ Init: InitArgs
426
+ });
427
+ const AccountIdentifier = IDL.Vec(IDL.Nat8);
428
+ const AccountBalanceArgs = IDL.Record({account: AccountIdentifier});
429
+ const AccountBalanceArgsDfx = IDL.Record({
430
+ account: TextAccountIdentifier
431
+ });
432
+ const Archive = IDL.Record({canister_id: IDL.Principal});
433
+ const Archives = IDL.Record({archives: IDL.Vec(Archive)});
434
+ const GetAllowancesArgs = IDL.Record({
435
+ prev_spender_id: IDL.Opt(TextAccountIdentifier),
436
+ from_account_id: TextAccountIdentifier,
437
+ take: IDL.Opt(IDL.Nat64)
438
+ });
439
+ const Allowances = IDL.Vec(
440
+ IDL.Record({
441
+ from_account_id: TextAccountIdentifier,
442
+ to_spender_id: TextAccountIdentifier,
443
+ allowance: Tokens,
444
+ expires_at: IDL.Opt(IDL.Nat64)
445
+ })
446
+ );
447
+ const Icrc1Tokens = IDL.Nat;
448
+ const Value = IDL.Variant({
449
+ Int: IDL.Int,
450
+ Nat: IDL.Nat,
451
+ Blob: IDL.Vec(IDL.Nat8),
452
+ Text: IDL.Text
453
+ });
454
+ const Icrc1Timestamp = IDL.Nat64;
455
+ const TransferArg = IDL.Record({
456
+ to: Account,
457
+ fee: IDL.Opt(Icrc1Tokens),
458
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
459
+ from_subaccount: IDL.Opt(SubAccount),
460
+ created_at_time: IDL.Opt(Icrc1Timestamp),
461
+ amount: Icrc1Tokens
462
+ });
463
+ const Icrc1BlockIndex = IDL.Nat;
464
+ const Icrc1TransferError = IDL.Variant({
465
+ GenericError: IDL.Record({
466
+ message: IDL.Text,
467
+ error_code: IDL.Nat
468
+ }),
469
+ TemporarilyUnavailable: IDL.Null,
470
+ BadBurn: IDL.Record({min_burn_amount: Icrc1Tokens}),
471
+ Duplicate: IDL.Record({duplicate_of: Icrc1BlockIndex}),
472
+ BadFee: IDL.Record({expected_fee: Icrc1Tokens}),
473
+ CreatedInFuture: IDL.Record({ledger_time: IDL.Nat64}),
474
+ TooOld: IDL.Null,
475
+ InsufficientFunds: IDL.Record({balance: Icrc1Tokens})
476
+ });
477
+ const Icrc1TransferResult = IDL.Variant({
478
+ Ok: Icrc1BlockIndex,
479
+ Err: Icrc1TransferError
480
+ });
481
+ const icrc21_consent_message_metadata = IDL.Record({
482
+ utc_offset_minutes: IDL.Opt(IDL.Int16),
483
+ language: IDL.Text
484
+ });
485
+ const icrc21_consent_message_spec = IDL.Record({
486
+ metadata: icrc21_consent_message_metadata,
487
+ device_spec: IDL.Opt(IDL.Variant({GenericDisplay: IDL.Null, FieldsDisplay: IDL.Null}))
488
+ });
489
+ const icrc21_consent_message_request = IDL.Record({
490
+ arg: IDL.Vec(IDL.Nat8),
491
+ method: IDL.Text,
492
+ user_preferences: icrc21_consent_message_spec
493
+ });
494
+ const Icrc21Value = IDL.Variant({
495
+ Text: IDL.Record({content: IDL.Text}),
496
+ TokenAmount: IDL.Record({
497
+ decimals: IDL.Nat8,
498
+ amount: IDL.Nat64,
499
+ symbol: IDL.Text
500
+ }),
501
+ TimestampSeconds: IDL.Record({amount: IDL.Nat64}),
502
+ DurationSeconds: IDL.Record({amount: IDL.Nat64})
503
+ });
504
+ const FieldsDisplay = IDL.Record({
505
+ fields: IDL.Vec(IDL.Tuple(IDL.Text, Icrc21Value)),
506
+ intent: IDL.Text
507
+ });
508
+ const icrc21_consent_message = IDL.Variant({
509
+ FieldsDisplayMessage: FieldsDisplay,
510
+ GenericDisplayMessage: IDL.Text
511
+ });
512
+ const icrc21_consent_info = IDL.Record({
513
+ metadata: icrc21_consent_message_metadata,
514
+ consent_message: icrc21_consent_message
515
+ });
516
+ const icrc21_error_info = IDL.Record({description: IDL.Text});
517
+ const icrc21_error = IDL.Variant({
518
+ GenericError: IDL.Record({
519
+ description: IDL.Text,
520
+ error_code: IDL.Nat
521
+ }),
522
+ InsufficientPayment: icrc21_error_info,
523
+ UnsupportedCanisterCall: icrc21_error_info,
524
+ ConsentMessageUnavailable: icrc21_error_info
525
+ });
526
+ const icrc21_consent_message_response = IDL.Variant({
527
+ Ok: icrc21_consent_info,
528
+ Err: icrc21_error
529
+ });
530
+ const AllowanceArgs = IDL.Record({
531
+ account: Account,
532
+ spender: Account
533
+ });
534
+ const Allowance = IDL.Record({
535
+ allowance: Icrc1Tokens,
536
+ expires_at: IDL.Opt(Icrc1Timestamp)
537
+ });
538
+ const ApproveArgs = IDL.Record({
539
+ fee: IDL.Opt(Icrc1Tokens),
540
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
541
+ from_subaccount: IDL.Opt(SubAccount),
542
+ created_at_time: IDL.Opt(Icrc1Timestamp),
543
+ amount: Icrc1Tokens,
544
+ expected_allowance: IDL.Opt(Icrc1Tokens),
545
+ expires_at: IDL.Opt(Icrc1Timestamp),
546
+ spender: Account
547
+ });
548
+ const ApproveError = IDL.Variant({
549
+ GenericError: IDL.Record({
550
+ message: IDL.Text,
551
+ error_code: IDL.Nat
552
+ }),
553
+ TemporarilyUnavailable: IDL.Null,
554
+ Duplicate: IDL.Record({duplicate_of: Icrc1BlockIndex}),
555
+ BadFee: IDL.Record({expected_fee: Icrc1Tokens}),
556
+ AllowanceChanged: IDL.Record({current_allowance: Icrc1Tokens}),
557
+ CreatedInFuture: IDL.Record({ledger_time: IDL.Nat64}),
558
+ TooOld: IDL.Null,
559
+ Expired: IDL.Record({ledger_time: IDL.Nat64}),
560
+ InsufficientFunds: IDL.Record({balance: Icrc1Tokens})
561
+ });
562
+ const ApproveResult = IDL.Variant({
563
+ Ok: Icrc1BlockIndex,
564
+ Err: ApproveError
565
+ });
566
+ const TransferFromArgs = IDL.Record({
567
+ to: Account,
568
+ fee: IDL.Opt(Icrc1Tokens),
569
+ spender_subaccount: IDL.Opt(SubAccount),
570
+ from: Account,
571
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
572
+ created_at_time: IDL.Opt(Icrc1Timestamp),
573
+ amount: Icrc1Tokens
574
+ });
575
+ const TransferFromError = IDL.Variant({
576
+ GenericError: IDL.Record({
577
+ message: IDL.Text,
578
+ error_code: IDL.Nat
579
+ }),
580
+ TemporarilyUnavailable: IDL.Null,
581
+ InsufficientAllowance: IDL.Record({allowance: Icrc1Tokens}),
582
+ BadBurn: IDL.Record({min_burn_amount: Icrc1Tokens}),
583
+ Duplicate: IDL.Record({duplicate_of: Icrc1BlockIndex}),
584
+ BadFee: IDL.Record({expected_fee: Icrc1Tokens}),
585
+ CreatedInFuture: IDL.Record({ledger_time: Icrc1Timestamp}),
586
+ TooOld: IDL.Null,
587
+ InsufficientFunds: IDL.Record({balance: Icrc1Tokens})
588
+ });
589
+ const TransferFromResult = IDL.Variant({
590
+ Ok: Icrc1BlockIndex,
591
+ Err: TransferFromError
592
+ });
593
+ const BlockIndex = IDL.Nat64;
594
+ const GetBlocksArgs = IDL.Record({
595
+ start: BlockIndex,
596
+ length: IDL.Nat64
597
+ });
598
+ const Memo = IDL.Nat64;
599
+ const TimeStamp = IDL.Record({timestamp_nanos: IDL.Nat64});
600
+ const Operation = IDL.Variant({
601
+ Approve: IDL.Record({
602
+ fee: Tokens,
603
+ from: AccountIdentifier,
604
+ allowance_e8s: IDL.Int,
605
+ allowance: Tokens,
606
+ expected_allowance: IDL.Opt(Tokens),
607
+ expires_at: IDL.Opt(TimeStamp),
608
+ spender: AccountIdentifier
609
+ }),
610
+ Burn: IDL.Record({
611
+ from: AccountIdentifier,
612
+ amount: Tokens,
613
+ spender: IDL.Opt(AccountIdentifier)
614
+ }),
615
+ Mint: IDL.Record({to: AccountIdentifier, amount: Tokens}),
616
+ Transfer: IDL.Record({
617
+ to: AccountIdentifier,
618
+ fee: Tokens,
619
+ from: AccountIdentifier,
620
+ amount: Tokens,
621
+ spender: IDL.Opt(IDL.Vec(IDL.Nat8))
622
+ })
623
+ });
624
+ const Transaction = IDL.Record({
625
+ memo: Memo,
626
+ icrc1_memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
627
+ operation: IDL.Opt(Operation),
628
+ created_at_time: TimeStamp
629
+ });
630
+ const Block = IDL.Record({
631
+ transaction: Transaction,
632
+ timestamp: TimeStamp,
633
+ parent_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
634
+ });
635
+ const BlockRange = IDL.Record({blocks: IDL.Vec(Block)});
636
+ const QueryArchiveError = IDL.Variant({
637
+ BadFirstBlockIndex: IDL.Record({
638
+ requested_index: BlockIndex,
639
+ first_valid_index: BlockIndex
640
+ }),
641
+ Other: IDL.Record({
642
+ error_message: IDL.Text,
643
+ error_code: IDL.Nat64
644
+ })
645
+ });
646
+ const QueryArchiveResult = IDL.Variant({
647
+ Ok: BlockRange,
648
+ Err: QueryArchiveError
649
+ });
650
+ const QueryArchiveFn = IDL.Func([GetBlocksArgs], [QueryArchiveResult], ['query']);
651
+ const ArchivedBlocksRange = IDL.Record({
652
+ callback: QueryArchiveFn,
653
+ start: BlockIndex,
654
+ length: IDL.Nat64
655
+ });
656
+ const QueryBlocksResponse = IDL.Record({
657
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
658
+ blocks: IDL.Vec(Block),
659
+ chain_length: IDL.Nat64,
660
+ first_block_index: BlockIndex,
661
+ archived_blocks: IDL.Vec(ArchivedBlocksRange)
662
+ });
663
+ const ArchivedEncodedBlocksRange = IDL.Record({
664
+ callback: IDL.Func(
665
+ [GetBlocksArgs],
666
+ [
667
+ IDL.Variant({
668
+ Ok: IDL.Vec(IDL.Vec(IDL.Nat8)),
669
+ Err: QueryArchiveError
670
+ })
671
+ ],
672
+ ['query']
673
+ ),
674
+ start: IDL.Nat64,
675
+ length: IDL.Nat64
676
+ });
677
+ const QueryEncodedBlocksResponse = IDL.Record({
678
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
679
+ blocks: IDL.Vec(IDL.Vec(IDL.Nat8)),
680
+ chain_length: IDL.Nat64,
681
+ first_block_index: IDL.Nat64,
682
+ archived_blocks: IDL.Vec(ArchivedEncodedBlocksRange)
683
+ });
684
+ const RemoveApprovalArgs = IDL.Record({
685
+ fee: IDL.Opt(Icrc1Tokens),
686
+ from_subaccount: IDL.Opt(SubAccount),
687
+ spender: AccountIdentifier
688
+ });
689
+ const SendArgs = IDL.Record({
690
+ to: TextAccountIdentifier,
691
+ fee: Tokens,
692
+ memo: Memo,
693
+ from_subaccount: IDL.Opt(SubAccount),
694
+ created_at_time: IDL.Opt(TimeStamp),
695
+ amount: Tokens
696
+ });
697
+ const TipOfChainRes = IDL.Record({
698
+ certification: IDL.Opt(IDL.Vec(IDL.Nat8)),
699
+ tip_index: BlockIndex
700
+ });
701
+ const TransferArgs = IDL.Record({
702
+ to: AccountIdentifier,
703
+ fee: Tokens,
704
+ memo: Memo,
705
+ from_subaccount: IDL.Opt(SubAccount),
706
+ created_at_time: IDL.Opt(TimeStamp),
707
+ amount: Tokens
708
+ });
709
+ const TransferError = IDL.Variant({
710
+ TxTooOld: IDL.Record({allowed_window_nanos: IDL.Nat64}),
711
+ BadFee: IDL.Record({expected_fee: Tokens}),
712
+ TxDuplicate: IDL.Record({duplicate_of: BlockIndex}),
713
+ TxCreatedInFuture: IDL.Null,
714
+ InsufficientFunds: IDL.Record({balance: Tokens})
715
+ });
716
+ const TransferResult = IDL.Variant({
717
+ Ok: BlockIndex,
718
+ Err: TransferError
719
+ });
720
+ const TransferFeeArg = IDL.Record({});
721
+ const TransferFee = IDL.Record({transfer_fee: Tokens});
722
+
723
+ return IDL.Service({
724
+ account_balance: IDL.Func([AccountBalanceArgs], [Tokens], ['query']),
725
+ account_balance_dfx: IDL.Func([AccountBalanceArgsDfx], [Tokens], ['query']),
726
+ account_identifier: IDL.Func([Account], [AccountIdentifier], ['query']),
727
+ archives: IDL.Func([], [Archives], ['query']),
728
+ decimals: IDL.Func([], [IDL.Record({decimals: IDL.Nat32})], ['query']),
729
+ get_allowances: IDL.Func([GetAllowancesArgs], [Allowances], ['query']),
730
+ icrc10_supported_standards: IDL.Func(
731
+ [],
732
+ [IDL.Vec(IDL.Record({url: IDL.Text, name: IDL.Text}))],
733
+ ['query']
734
+ ),
735
+ icrc1_balance_of: IDL.Func([Account], [Icrc1Tokens], ['query']),
736
+ icrc1_decimals: IDL.Func([], [IDL.Nat8], ['query']),
737
+ icrc1_fee: IDL.Func([], [Icrc1Tokens], ['query']),
738
+ icrc1_metadata: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, Value))], ['query']),
739
+ icrc1_minting_account: IDL.Func([], [IDL.Opt(Account)], ['query']),
740
+ icrc1_name: IDL.Func([], [IDL.Text], ['query']),
741
+ icrc1_supported_standards: IDL.Func(
742
+ [],
743
+ [IDL.Vec(IDL.Record({url: IDL.Text, name: IDL.Text}))],
744
+ ['query']
745
+ ),
746
+ icrc1_symbol: IDL.Func([], [IDL.Text], ['query']),
747
+ icrc1_total_supply: IDL.Func([], [Icrc1Tokens], ['query']),
748
+ icrc1_transfer: IDL.Func([TransferArg], [Icrc1TransferResult], []),
749
+ icrc21_canister_call_consent_message: IDL.Func(
750
+ [icrc21_consent_message_request],
751
+ [icrc21_consent_message_response],
752
+ []
753
+ ),
754
+ icrc2_allowance: IDL.Func([AllowanceArgs], [Allowance], ['query']),
755
+ icrc2_approve: IDL.Func([ApproveArgs], [ApproveResult], []),
756
+ icrc2_transfer_from: IDL.Func([TransferFromArgs], [TransferFromResult], []),
757
+ is_ledger_ready: IDL.Func([], [IDL.Bool], ['query']),
758
+ name: IDL.Func([], [IDL.Record({name: IDL.Text})], ['query']),
759
+ query_blocks: IDL.Func([GetBlocksArgs], [QueryBlocksResponse], ['query']),
760
+ query_encoded_blocks: IDL.Func([GetBlocksArgs], [QueryEncodedBlocksResponse], ['query']),
761
+ remove_approval: IDL.Func([RemoveApprovalArgs], [ApproveResult], []),
762
+ send_dfx: IDL.Func([SendArgs], [BlockIndex], []),
763
+ symbol: IDL.Func([], [IDL.Record({symbol: IDL.Text})], ['query']),
764
+ tip_of_chain: IDL.Func([], [TipOfChainRes], ['query']),
765
+ transfer: IDL.Func([TransferArgs], [TransferResult], []),
766
+ transfer_fee: IDL.Func([TransferFeeArg], [TransferFee], ['query'])
767
+ });
768
+ };
769
+
770
+ export const init = ({IDL}) => {
771
+ const SubAccount = IDL.Vec(IDL.Nat8);
772
+ const Account = IDL.Record({
773
+ owner: IDL.Principal,
774
+ subaccount: IDL.Opt(SubAccount)
775
+ });
776
+ const FeatureFlags = IDL.Record({icrc2: IDL.Bool});
777
+ const UpgradeArgs = IDL.Record({
778
+ icrc1_minting_account: IDL.Opt(Account),
779
+ feature_flags: IDL.Opt(FeatureFlags)
780
+ });
781
+ const Tokens = IDL.Record({e8s: IDL.Nat64});
782
+ const TextAccountIdentifier = IDL.Text;
783
+ const Duration = IDL.Record({secs: IDL.Nat64, nanos: IDL.Nat32});
784
+ const ArchiveOptions = IDL.Record({
785
+ num_blocks_to_archive: IDL.Nat64,
786
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
787
+ trigger_threshold: IDL.Nat64,
788
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
789
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
790
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
791
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
792
+ controller_id: IDL.Principal
793
+ });
794
+ const InitArgs = IDL.Record({
795
+ send_whitelist: IDL.Vec(IDL.Principal),
796
+ token_symbol: IDL.Opt(IDL.Text),
797
+ transfer_fee: IDL.Opt(Tokens),
798
+ minting_account: TextAccountIdentifier,
799
+ transaction_window: IDL.Opt(Duration),
800
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
801
+ icrc1_minting_account: IDL.Opt(Account),
802
+ archive_options: IDL.Opt(ArchiveOptions),
803
+ initial_values: IDL.Vec(IDL.Tuple(TextAccountIdentifier, Tokens)),
804
+ token_name: IDL.Opt(IDL.Text),
805
+ feature_flags: IDL.Opt(FeatureFlags)
806
+ });
807
+ const LedgerCanisterPayload = IDL.Variant({
808
+ Upgrade: IDL.Opt(UpgradeArgs),
809
+ Init: InitArgs
810
+ });
811
+
812
+ return [LedgerCanisterPayload];
813
+ };