@junobuild/functions 0.5.4 → 0.5.5-next-2026-01-16

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 (71) hide show
  1. package/canisters/ckbtc/index.js +1 -1
  2. package/canisters/cketh/index.js +1 -1
  3. package/canisters/cmc/index.js +1 -1
  4. package/canisters/declarations/_idl.d.ts +5 -5
  5. package/canisters/declarations/_types.d.ts +5 -5
  6. package/canisters/declarations/ckbtc/bitcoin.did.d.ts +2 -0
  7. package/canisters/declarations/ckbtc/bitcoin.did.idl.d.ts +3 -2
  8. package/canisters/declarations/ckbtc/minter.did.d.ts +4 -0
  9. package/canisters/declarations/ckbtc/minter.did.idl.d.ts +1 -0
  10. package/canisters/declarations/ic-management/ic-management.did.d.ts +2 -0
  11. package/canisters/declarations/ledger-icrc/icrc_icrc-1.did.d.ts +70 -0
  12. package/canisters/declarations/ledger-icrc/icrc_icrc-1.did.idl.d.ts +26 -0
  13. package/canisters/declarations/ledger-icrc/icrc_icrc-10.did.d.ts +21 -0
  14. package/canisters/declarations/ledger-icrc/icrc_icrc-10.did.idl.d.ts +13 -0
  15. package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +69 -17
  16. package/canisters/declarations/ledger-icrc/icrc_index.did.idl.d.ts +21 -4
  17. package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +6 -0
  18. package/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.d.ts +1 -0
  19. package/canisters/declarations/nns/governance.did.d.ts +54 -30
  20. package/canisters/declarations/nns/governance.did.idl.d.ts +6 -3
  21. package/canisters/declarations/nns/governance_test.did.d.ts +54 -30
  22. package/canisters/declarations/nns/governance_test.did.idl.d.ts +6 -3
  23. package/{src/canisters/declarations/sns/sns_root.did.d.ts → canisters/declarations/sns/root.did.d.ts} +12 -0
  24. package/canisters/declarations/sns/{sns_root.did.idl.d.ts → root.did.idl.d.ts} +5 -1
  25. package/canisters/ic-management/index.js +1 -1
  26. package/canisters/ledger/icp/index.js +1 -1
  27. package/canisters/ledger/icrc/index.d.ts +1 -1
  28. package/canisters/ledger/icrc/index.js +1 -1
  29. package/canisters/nns/index.js +1 -1
  30. package/canisters/sns/index.js +1 -1
  31. package/chunk-CAQXR2VB.js +2 -0
  32. package/chunk-CAQXR2VB.js.map +7 -0
  33. package/package.json +5 -5
  34. package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +2 -0
  35. package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +44 -22
  36. package/src/canisters/declarations/ckbtc/minter.did.d.ts +4 -0
  37. package/src/canisters/declarations/ckbtc/minter.did.idl.js +14 -0
  38. package/src/canisters/declarations/ic-management/ic-management.did.d.ts +2 -0
  39. package/src/canisters/declarations/ic-management/ic-management.did.idl.js +6 -2
  40. package/src/canisters/declarations/ledger-icrc/icrc_icrc-1.did.d.ts +70 -0
  41. package/src/canisters/declarations/ledger-icrc/icrc_icrc-1.did.idl.js +116 -0
  42. package/src/canisters/declarations/ledger-icrc/icrc_icrc-10.did.d.ts +21 -0
  43. package/src/canisters/declarations/ledger-icrc/icrc_icrc-10.did.idl.js +34 -0
  44. package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +69 -17
  45. package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +150 -35
  46. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +6 -0
  47. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +12 -0
  48. package/src/canisters/declarations/nns/governance.did.d.ts +54 -30
  49. package/src/canisters/declarations/nns/governance.did.idl.js +87 -17
  50. package/src/canisters/declarations/nns/governance_test.did.d.ts +54 -30
  51. package/src/canisters/declarations/nns/governance_test.did.idl.js +87 -17
  52. package/{canisters/declarations/sns/sns_root.did.d.ts → src/canisters/declarations/sns/root.did.d.ts} +12 -0
  53. package/src/canisters/declarations/sns/{sns_root.did.idl.js → root.did.idl.js} +38 -8
  54. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +0 -148
  55. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.d.ts +0 -44
  56. package/chunk-HANEPD6T.js +0 -2
  57. package/chunk-HANEPD6T.js.map +0 -7
  58. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +0 -148
  59. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.js +0 -274
  60. /package/canisters/declarations/sns/{sns_governance.did.d.ts → governance.did.d.ts} +0 -0
  61. /package/canisters/declarations/sns/{sns_governance.did.idl.d.ts → governance.did.idl.d.ts} +0 -0
  62. /package/canisters/declarations/sns/{sns_governance_test.did.d.ts → governance_test.did.d.ts} +0 -0
  63. /package/canisters/declarations/sns/{sns_governance_test.did.idl.d.ts → governance_test.did.idl.d.ts} +0 -0
  64. /package/canisters/declarations/sns/{sns_swap.did.d.ts → swap.did.d.ts} +0 -0
  65. /package/canisters/declarations/sns/{sns_swap.did.idl.d.ts → swap.did.idl.d.ts} +0 -0
  66. /package/src/canisters/declarations/sns/{sns_governance.did.d.ts → governance.did.d.ts} +0 -0
  67. /package/src/canisters/declarations/sns/{sns_governance.did.idl.js → governance.did.idl.js} +0 -0
  68. /package/src/canisters/declarations/sns/{sns_governance_test.did.d.ts → governance_test.did.d.ts} +0 -0
  69. /package/src/canisters/declarations/sns/{sns_governance_test.did.idl.js → governance_test.did.idl.js} +0 -0
  70. /package/src/canisters/declarations/sns/{sns_swap.did.d.ts → swap.did.d.ts} +0 -0
  71. /package/src/canisters/declarations/sns/{sns_swap.did.idl.js → swap.did.idl.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/functions",
3
- "version": "0.5.4",
3
+ "version": "0.5.5-next-2026-01-16",
4
4
  "description": "JavaScript and TypeScript utilities for Juno Serverless Functions",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",
@@ -94,8 +94,8 @@
94
94
  ],
95
95
  "homepage": "https://juno.build",
96
96
  "peerDependencies": {
97
- "@dfinity/utils": "^4.1",
98
- "@icp-sdk/core": "^5",
99
- "zod": "^4"
97
+ "@dfinity/utils": "*",
98
+ "@icp-sdk/core": "*",
99
+ "zod": "*"
100
100
  }
101
- }
101
+ }
@@ -14,6 +14,8 @@ export type address = string;
14
14
  export type block_hash = Uint8Array;
15
15
  export type block_header = Uint8Array;
16
16
  export type block_height = number;
17
+ export type canister_arg = { 'init' : init_config } |
18
+ { 'upgrade' : [] | [set_config_request] };
17
19
  export interface config {
18
20
  'api_access' : flag,
19
21
  'lazily_evaluate_fee_percentiles' : flag,
@@ -43,6 +43,20 @@ export const init_config = IDL.Record({
43
43
  burn_cycles: IDL.Opt(flag),
44
44
  disable_api_if_not_fully_synced: IDL.Opt(flag)
45
45
  });
46
+ export const set_config_request = IDL.Record({
47
+ api_access: IDL.Opt(flag),
48
+ lazily_evaluate_fee_percentiles: IDL.Opt(flag),
49
+ fees: IDL.Opt(fees),
50
+ watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
51
+ stability_threshold: IDL.Opt(IDL.Nat),
52
+ syncing: IDL.Opt(flag),
53
+ burn_cycles: IDL.Opt(flag),
54
+ disable_api_if_not_fully_synced: IDL.Opt(flag)
55
+ });
56
+ export const canister_arg = IDL.Variant({
57
+ init: init_config,
58
+ upgrade: IDL.Opt(set_config_request)
59
+ });
46
60
  export const address = IDL.Text;
47
61
  export const get_balance_request = IDL.Record({
48
62
  network: network,
@@ -102,16 +116,6 @@ export const config = IDL.Record({
102
116
  burn_cycles: flag,
103
117
  disable_api_if_not_fully_synced: flag
104
118
  });
105
- export const set_config_request = IDL.Record({
106
- api_access: IDL.Opt(flag),
107
- lazily_evaluate_fee_percentiles: IDL.Opt(flag),
108
- fees: IDL.Opt(fees),
109
- watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
110
- stability_threshold: IDL.Opt(IDL.Nat),
111
- syncing: IDL.Opt(flag),
112
- burn_cycles: IDL.Opt(flag),
113
- disable_api_if_not_fully_synced: IDL.Opt(flag)
114
- });
115
119
 
116
120
  export const idlService = IDL.Service({
117
121
  bitcoin_get_balance: IDL.Func([get_balance_request], [satoshi], []),
@@ -133,7 +137,7 @@ export const idlService = IDL.Service({
133
137
  set_config: IDL.Func([set_config_request], [], [])
134
138
  });
135
139
 
136
- export const idlInitArgs = [init_config];
140
+ export const idlInitArgs = [canister_arg];
137
141
 
138
142
  export const idlFactory = ({IDL}) => {
139
143
  const flag = IDL.Variant({disabled: IDL.Null, enabled: IDL.Null});
@@ -168,6 +172,20 @@ export const idlFactory = ({IDL}) => {
168
172
  burn_cycles: IDL.Opt(flag),
169
173
  disable_api_if_not_fully_synced: IDL.Opt(flag)
170
174
  });
175
+ const set_config_request = IDL.Record({
176
+ api_access: IDL.Opt(flag),
177
+ lazily_evaluate_fee_percentiles: IDL.Opt(flag),
178
+ fees: IDL.Opt(fees),
179
+ watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
180
+ stability_threshold: IDL.Opt(IDL.Nat),
181
+ syncing: IDL.Opt(flag),
182
+ burn_cycles: IDL.Opt(flag),
183
+ disable_api_if_not_fully_synced: IDL.Opt(flag)
184
+ });
185
+ const canister_arg = IDL.Variant({
186
+ init: init_config,
187
+ upgrade: IDL.Opt(set_config_request)
188
+ });
171
189
  const address = IDL.Text;
172
190
  const get_balance_request = IDL.Record({
173
191
  network: network,
@@ -232,16 +250,6 @@ export const idlFactory = ({IDL}) => {
232
250
  burn_cycles: flag,
233
251
  disable_api_if_not_fully_synced: flag
234
252
  });
235
- const set_config_request = IDL.Record({
236
- api_access: IDL.Opt(flag),
237
- lazily_evaluate_fee_percentiles: IDL.Opt(flag),
238
- fees: IDL.Opt(fees),
239
- watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
240
- stability_threshold: IDL.Opt(IDL.Nat),
241
- syncing: IDL.Opt(flag),
242
- burn_cycles: IDL.Opt(flag),
243
- disable_api_if_not_fully_synced: IDL.Opt(flag)
244
- });
245
253
 
246
254
  return IDL.Service({
247
255
  bitcoin_get_balance: IDL.Func([get_balance_request], [satoshi], []),
@@ -297,6 +305,20 @@ export const init = ({IDL}) => {
297
305
  burn_cycles: IDL.Opt(flag),
298
306
  disable_api_if_not_fully_synced: IDL.Opt(flag)
299
307
  });
308
+ const set_config_request = IDL.Record({
309
+ api_access: IDL.Opt(flag),
310
+ lazily_evaluate_fee_percentiles: IDL.Opt(flag),
311
+ fees: IDL.Opt(fees),
312
+ watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
313
+ stability_threshold: IDL.Opt(IDL.Nat),
314
+ syncing: IDL.Opt(flag),
315
+ burn_cycles: IDL.Opt(flag),
316
+ disable_api_if_not_fully_synced: IDL.Opt(flag)
317
+ });
318
+ const canister_arg = IDL.Variant({
319
+ init: init_config,
320
+ upgrade: IDL.Opt(set_config_request)
321
+ });
300
322
 
301
- return [init_config];
323
+ return [canister_arg];
302
324
  };
@@ -44,6 +44,8 @@ export interface CanisterStatusResponse {
44
44
  'memory_metrics' : MemoryMetrics,
45
45
  'status' : CanisterStatusType,
46
46
  'memory_size' : bigint,
47
+ 'ready_for_migration' : boolean,
48
+ 'version' : bigint,
47
49
  'cycles' : bigint,
48
50
  'settings' : DefiniteCanisterSettings,
49
51
  'query_stats' : QueryStats,
@@ -57,6 +59,7 @@ export type CanisterStatusType = { 'stopped' : null } |
57
59
  export interface DefiniteCanisterSettings {
58
60
  'freezing_threshold' : bigint,
59
61
  'wasm_memory_threshold' : bigint,
62
+ 'environment_variables' : Array<environment_variable>,
60
63
  'controllers' : Array<Principal>,
61
64
  'reserved_cycles_limit' : bigint,
62
65
  'log_visibility' : LogVisibility,
@@ -681,6 +684,7 @@ export interface WithdrawalFee { 'minter_fee' : bigint, 'bitcoin_fee' : bigint }
681
684
  export type WithdrawalReimbursementReason = {
682
685
  'invalid_transaction' : InvalidTransactionError
683
686
  };
687
+ export interface environment_variable { 'value' : string, 'name' : string }
684
688
  export interface _SERVICE {
685
689
  /**
686
690
  * / Returns an estimate of the user's fee (in Satoshi) for a
@@ -63,6 +63,10 @@ export const CanisterStatusType = IDL.Variant({
63
63
  stopping: IDL.Null,
64
64
  running: IDL.Null
65
65
  });
66
+ export const environment_variable = IDL.Record({
67
+ value: IDL.Text,
68
+ name: IDL.Text
69
+ });
66
70
  export const LogVisibility = IDL.Variant({
67
71
  controllers: IDL.Null,
68
72
  public: IDL.Null,
@@ -71,6 +75,7 @@ export const LogVisibility = IDL.Variant({
71
75
  export const DefiniteCanisterSettings = IDL.Record({
72
76
  freezing_threshold: IDL.Nat,
73
77
  wasm_memory_threshold: IDL.Nat,
78
+ environment_variables: IDL.Vec(environment_variable),
74
79
  controllers: IDL.Vec(IDL.Principal),
75
80
  reserved_cycles_limit: IDL.Nat,
76
81
  log_visibility: LogVisibility,
@@ -88,6 +93,8 @@ export const CanisterStatusResponse = IDL.Record({
88
93
  memory_metrics: MemoryMetrics,
89
94
  status: CanisterStatusType,
90
95
  memory_size: IDL.Nat,
96
+ ready_for_migration: IDL.Bool,
97
+ version: IDL.Nat64,
91
98
  cycles: IDL.Nat,
92
99
  settings: DefiniteCanisterSettings,
93
100
  query_stats: QueryStats,
@@ -481,6 +488,10 @@ export const idlFactory = ({IDL}) => {
481
488
  stopping: IDL.Null,
482
489
  running: IDL.Null
483
490
  });
491
+ const environment_variable = IDL.Record({
492
+ value: IDL.Text,
493
+ name: IDL.Text
494
+ });
484
495
  const LogVisibility = IDL.Variant({
485
496
  controllers: IDL.Null,
486
497
  public: IDL.Null,
@@ -489,6 +500,7 @@ export const idlFactory = ({IDL}) => {
489
500
  const DefiniteCanisterSettings = IDL.Record({
490
501
  freezing_threshold: IDL.Nat,
491
502
  wasm_memory_threshold: IDL.Nat,
503
+ environment_variables: IDL.Vec(environment_variable),
492
504
  controllers: IDL.Vec(IDL.Principal),
493
505
  reserved_cycles_limit: IDL.Nat,
494
506
  log_visibility: LogVisibility,
@@ -506,6 +518,8 @@ export const idlFactory = ({IDL}) => {
506
518
  memory_metrics: MemoryMetrics,
507
519
  status: CanisterStatusType,
508
520
  memory_size: IDL.Nat,
521
+ ready_for_migration: IDL.Bool,
522
+ version: IDL.Nat64,
509
523
  cycles: IDL.Nat,
510
524
  settings: DefiniteCanisterSettings,
511
525
  query_stats: QueryStats,
@@ -357,6 +357,8 @@ export interface subnet_info_result {
357
357
  export interface take_canister_snapshot_args {
358
358
  'replace_snapshot' : [] | [snapshot_id],
359
359
  'canister_id' : canister_id,
360
+ 'uninstall_code' : [] | [boolean],
361
+ 'sender_canister_version' : [] | [bigint],
360
362
  }
361
363
  export type take_canister_snapshot_result = snapshot;
362
364
  export interface uninstall_code_args {
@@ -417,7 +417,9 @@ export const subnet_info_result = IDL.Record({
417
417
  });
418
418
  export const take_canister_snapshot_args = IDL.Record({
419
419
  replace_snapshot: IDL.Opt(snapshot_id),
420
- canister_id: canister_id
420
+ canister_id: canister_id,
421
+ uninstall_code: IDL.Opt(IDL.Bool),
422
+ sender_canister_version: IDL.Opt(IDL.Nat64)
421
423
  });
422
424
  export const take_canister_snapshot_result = snapshot;
423
425
  export const uninstall_code_args = IDL.Record({
@@ -989,7 +991,9 @@ export const idlFactory = ({IDL}) => {
989
991
  });
990
992
  const take_canister_snapshot_args = IDL.Record({
991
993
  replace_snapshot: IDL.Opt(snapshot_id),
992
- canister_id: canister_id
994
+ canister_id: canister_id,
995
+ uninstall_code: IDL.Opt(IDL.Bool),
996
+ sender_canister_version: IDL.Opt(IDL.Nat64)
993
997
  });
994
998
  const take_canister_snapshot_result = snapshot;
995
999
  const uninstall_code_args = IDL.Record({
@@ -0,0 +1,70 @@
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 type { ActorMethod } from '@icp-sdk/core/agent';
10
+ import type { IDL } from '@icp-sdk/core/candid';
11
+ import type { Principal } from '@icp-sdk/core/principal';
12
+
13
+ export interface Account {
14
+ 'owner' : Principal,
15
+ 'subaccount' : [] | [Subaccount],
16
+ }
17
+ /**
18
+ * Number of nanoseconds between two [Timestamp]s.
19
+ */
20
+ export type Duration = bigint;
21
+ export type Subaccount = Uint8Array;
22
+ /**
23
+ * Number of nanoseconds since the UNIX epoch in UTC timezone.
24
+ */
25
+ export type Timestamp = bigint;
26
+ export interface TransferArgs {
27
+ 'to' : Account,
28
+ 'fee' : [] | [bigint],
29
+ 'memo' : [] | [Uint8Array],
30
+ 'from_subaccount' : [] | [Subaccount],
31
+ 'created_at_time' : [] | [Timestamp],
32
+ 'amount' : bigint,
33
+ }
34
+ export type TransferError = {
35
+ 'GenericError' : { 'message' : string, 'error_code' : bigint }
36
+ } |
37
+ { 'TemporarilyUnavailable' : null } |
38
+ { 'BadBurn' : { 'min_burn_amount' : bigint } } |
39
+ { 'Duplicate' : { 'duplicate_of' : bigint } } |
40
+ { 'BadFee' : { 'expected_fee' : bigint } } |
41
+ { 'CreatedInFuture' : { 'ledger_time' : Timestamp } } |
42
+ { 'TooOld' : null } |
43
+ { 'InsufficientFunds' : { 'balance' : bigint } };
44
+ export type Value = { 'Int' : bigint } |
45
+ { 'Nat' : bigint } |
46
+ { 'Blob' : Uint8Array } |
47
+ { 'Text' : string };
48
+ export interface _SERVICE {
49
+ 'icrc1_balance_of' : ActorMethod<[Account], bigint>,
50
+ 'icrc1_decimals' : ActorMethod<[], number>,
51
+ 'icrc1_fee' : ActorMethod<[], bigint>,
52
+ 'icrc1_metadata' : ActorMethod<[], Array<[string, Value]>>,
53
+ 'icrc1_minting_account' : ActorMethod<[], [] | [Account]>,
54
+ 'icrc1_name' : ActorMethod<[], string>,
55
+ 'icrc1_supported_standards' : ActorMethod<
56
+ [],
57
+ Array<{ 'url' : string, 'name' : string }>
58
+ >,
59
+ 'icrc1_symbol' : ActorMethod<[], string>,
60
+ 'icrc1_total_supply' : ActorMethod<[], bigint>,
61
+ 'icrc1_transfer' : ActorMethod<
62
+ [TransferArgs],
63
+ { 'Ok' : bigint } |
64
+ { 'Err' : TransferError }
65
+ >,
66
+ }
67
+ export declare const idlService: IDL.ServiceClass;
68
+ export declare const idlInitArgs: IDL.Type[];
69
+ export declare const idlFactory: IDL.InterfaceFactory;
70
+ export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
@@ -0,0 +1,116 @@
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 Value = IDL.Variant({
17
+ Int: IDL.Int,
18
+ Nat: IDL.Nat,
19
+ Blob: IDL.Vec(IDL.Nat8),
20
+ Text: IDL.Text
21
+ });
22
+ export const Timestamp = IDL.Nat64;
23
+ export const TransferArgs = IDL.Record({
24
+ to: Account,
25
+ fee: IDL.Opt(IDL.Nat),
26
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
27
+ from_subaccount: IDL.Opt(Subaccount),
28
+ created_at_time: IDL.Opt(Timestamp),
29
+ amount: IDL.Nat
30
+ });
31
+ export const TransferError = IDL.Variant({
32
+ GenericError: IDL.Record({message: IDL.Text, error_code: IDL.Nat}),
33
+ TemporarilyUnavailable: IDL.Null,
34
+ BadBurn: IDL.Record({min_burn_amount: IDL.Nat}),
35
+ Duplicate: IDL.Record({duplicate_of: IDL.Nat}),
36
+ BadFee: IDL.Record({expected_fee: IDL.Nat}),
37
+ CreatedInFuture: IDL.Record({ledger_time: Timestamp}),
38
+ TooOld: IDL.Null,
39
+ InsufficientFunds: IDL.Record({balance: IDL.Nat})
40
+ });
41
+
42
+ export const idlService = IDL.Service({
43
+ icrc1_balance_of: IDL.Func([Account], [IDL.Nat], ['query']),
44
+ icrc1_decimals: IDL.Func([], [IDL.Nat8], ['query']),
45
+ icrc1_fee: IDL.Func([], [IDL.Nat], ['query']),
46
+ icrc1_metadata: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, Value))], ['query']),
47
+ icrc1_minting_account: IDL.Func([], [IDL.Opt(Account)], ['query']),
48
+ icrc1_name: IDL.Func([], [IDL.Text], ['query']),
49
+ icrc1_supported_standards: IDL.Func(
50
+ [],
51
+ [IDL.Vec(IDL.Record({url: IDL.Text, name: IDL.Text}))],
52
+ ['query']
53
+ ),
54
+ icrc1_symbol: IDL.Func([], [IDL.Text], ['query']),
55
+ icrc1_total_supply: IDL.Func([], [IDL.Nat], ['query']),
56
+ icrc1_transfer: IDL.Func([TransferArgs], [IDL.Variant({Ok: IDL.Nat, Err: TransferError})], [])
57
+ });
58
+
59
+ export const idlInitArgs = [];
60
+
61
+ export const idlFactory = ({IDL}) => {
62
+ const Subaccount = IDL.Vec(IDL.Nat8);
63
+ const Account = IDL.Record({
64
+ owner: IDL.Principal,
65
+ subaccount: IDL.Opt(Subaccount)
66
+ });
67
+ const Value = IDL.Variant({
68
+ Int: IDL.Int,
69
+ Nat: IDL.Nat,
70
+ Blob: IDL.Vec(IDL.Nat8),
71
+ Text: IDL.Text
72
+ });
73
+ const Timestamp = IDL.Nat64;
74
+ const TransferArgs = IDL.Record({
75
+ to: Account,
76
+ fee: IDL.Opt(IDL.Nat),
77
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
78
+ from_subaccount: IDL.Opt(Subaccount),
79
+ created_at_time: IDL.Opt(Timestamp),
80
+ amount: IDL.Nat
81
+ });
82
+ const TransferError = IDL.Variant({
83
+ GenericError: IDL.Record({
84
+ message: IDL.Text,
85
+ error_code: IDL.Nat
86
+ }),
87
+ TemporarilyUnavailable: IDL.Null,
88
+ BadBurn: IDL.Record({min_burn_amount: IDL.Nat}),
89
+ Duplicate: IDL.Record({duplicate_of: IDL.Nat}),
90
+ BadFee: IDL.Record({expected_fee: IDL.Nat}),
91
+ CreatedInFuture: IDL.Record({ledger_time: Timestamp}),
92
+ TooOld: IDL.Null,
93
+ InsufficientFunds: IDL.Record({balance: IDL.Nat})
94
+ });
95
+
96
+ return IDL.Service({
97
+ icrc1_balance_of: IDL.Func([Account], [IDL.Nat], ['query']),
98
+ icrc1_decimals: IDL.Func([], [IDL.Nat8], ['query']),
99
+ icrc1_fee: IDL.Func([], [IDL.Nat], ['query']),
100
+ icrc1_metadata: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, Value))], ['query']),
101
+ icrc1_minting_account: IDL.Func([], [IDL.Opt(Account)], ['query']),
102
+ icrc1_name: IDL.Func([], [IDL.Text], ['query']),
103
+ icrc1_supported_standards: IDL.Func(
104
+ [],
105
+ [IDL.Vec(IDL.Record({url: IDL.Text, name: IDL.Text}))],
106
+ ['query']
107
+ ),
108
+ icrc1_symbol: IDL.Func([], [IDL.Text], ['query']),
109
+ icrc1_total_supply: IDL.Func([], [IDL.Nat], ['query']),
110
+ icrc1_transfer: IDL.Func([TransferArgs], [IDL.Variant({Ok: IDL.Nat, Err: TransferError})], [])
111
+ });
112
+ };
113
+
114
+ export const init = ({IDL}) => {
115
+ return [];
116
+ };
@@ -0,0 +1,21 @@
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 type { ActorMethod } from '@icp-sdk/core/agent';
10
+ import type { IDL } from '@icp-sdk/core/candid';
11
+ import type { Principal } from '@icp-sdk/core/principal';
12
+
13
+ export interface SupportedStandard { 'url' : string, 'name' : string }
14
+ export type SupportedStandardsResponse = Array<SupportedStandard>;
15
+ export interface _SERVICE {
16
+ 'icrc10_supported_standards' : ActorMethod<[], SupportedStandardsResponse>,
17
+ }
18
+ export declare const idlService: IDL.ServiceClass;
19
+ export declare const idlInitArgs: IDL.Type[];
20
+ export declare const idlFactory: IDL.InterfaceFactory;
21
+ export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
@@ -0,0 +1,34 @@
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 SupportedStandard = IDL.Record({
12
+ url: IDL.Text,
13
+ name: IDL.Text
14
+ });
15
+ export const SupportedStandardsResponse = IDL.Vec(SupportedStandard);
16
+
17
+ export const idlService = IDL.Service({
18
+ icrc10_supported_standards: IDL.Func([], [SupportedStandardsResponse], ['query'])
19
+ });
20
+
21
+ export const idlInitArgs = [];
22
+
23
+ export const idlFactory = ({IDL}) => {
24
+ const SupportedStandard = IDL.Record({url: IDL.Text, name: IDL.Text});
25
+ const SupportedStandardsResponse = IDL.Vec(SupportedStandard);
26
+
27
+ return IDL.Service({
28
+ icrc10_supported_standards: IDL.Func([], [SupportedStandardsResponse], ['query'])
29
+ });
30
+ };
31
+
32
+ export const init = ({IDL}) => {
33
+ return [];
34
+ };
@@ -12,25 +12,36 @@ import type { Principal } from '@icp-sdk/core/principal';
12
12
 
13
13
  export interface Account {
14
14
  'owner' : Principal,
15
- 'subaccount' : [] | [Uint8Array],
15
+ 'subaccount' : [] | [SubAccount],
16
16
  }
17
17
  export interface Approve {
18
- 'fee' : [] | [bigint],
18
+ 'fee' : [] | [Tokens],
19
19
  'from' : Account,
20
20
  'memo' : [] | [Uint8Array],
21
21
  'created_at_time' : [] | [bigint],
22
- 'amount' : bigint,
23
- 'expected_allowance' : [] | [bigint],
22
+ 'amount' : Tokens,
23
+ 'expected_allowance' : [] | [Tokens],
24
24
  'expires_at' : [] | [bigint],
25
25
  'spender' : Account,
26
26
  }
27
+ export type Block = Value;
28
+ export type BlockIndex = bigint;
27
29
  export interface Burn {
30
+ 'fee' : [] | [bigint],
28
31
  'from' : Account,
29
32
  'memo' : [] | [Uint8Array],
30
33
  'created_at_time' : [] | [bigint],
31
- 'amount' : bigint,
34
+ 'amount' : Tokens,
32
35
  'spender' : [] | [Account],
33
36
  }
37
+ export interface FeeCollector {
38
+ 'ts' : [] | [bigint],
39
+ 'fee_collector' : [] | [Account],
40
+ 'caller' : [] | [Principal],
41
+ }
42
+ export interface FeeCollectorRanges {
43
+ 'ranges' : Array<[Account, Array<[BlockIndex, BlockIndex]>]>,
44
+ }
34
45
  export interface GetAccountTransactionsArgs {
35
46
  /**
36
47
  * Maximum number of transactions to fetch.
@@ -39,62 +50,103 @@ export interface GetAccountTransactionsArgs {
39
50
  /**
40
51
  * The txid of the last transaction seen by the client.
41
52
  * If None then the results will start from the most recent
42
- * txid.
53
+ * txid. If set then the results will start from the next
54
+ * most recent txid after start (start won't be included).
43
55
  */
44
- 'start' : [] | [TxId],
56
+ 'start' : [] | [BlockIndex],
45
57
  'account' : Account,
46
58
  }
59
+ export interface GetBlocksRequest { 'start' : bigint, 'length' : bigint }
60
+ export interface GetBlocksResponse {
61
+ 'blocks' : Array<Block>,
62
+ 'chain_length' : bigint,
63
+ }
47
64
  export interface GetTransactions {
65
+ 'balance' : Tokens,
48
66
  'transactions' : Array<TransactionWithId>,
49
67
  /**
50
68
  * The txid of the oldest transaction the account has
51
69
  */
52
- 'oldest_tx_id' : [] | [TxId],
70
+ 'oldest_tx_id' : [] | [BlockIndex],
53
71
  }
54
72
  export interface GetTransactionsErr { 'message' : string }
55
73
  export type GetTransactionsResult = { 'Ok' : GetTransactions } |
56
74
  { 'Err' : GetTransactionsErr };
57
- /**
58
- * The initialization parameters of the Index canister.
59
- */
60
- export interface InitArgs { 'ledger_id' : Principal }
75
+ export type IndexArg = { 'Upgrade' : UpgradeArg } |
76
+ { 'Init' : InitArg };
77
+ export interface InitArg {
78
+ 'ledger_id' : Principal,
79
+ /**
80
+ * The interval in seconds in which to retrieve blocks from the ledger. A lower value makes the index more
81
+ * responsive in showing new blocks, but increases the consumption of cycles of both the index and ledger canisters.
82
+ * A higher values means that it takes longer for new blocks to show up in the index.
83
+ */
84
+ 'retrieve_blocks_from_ledger_interval_seconds' : [] | [bigint],
85
+ }
61
86
  export interface ListSubaccountsArgs {
62
87
  'owner' : Principal,
63
88
  'start' : [] | [SubAccount],
64
89
  }
90
+ export type Map = Array<[string, Value]>;
65
91
  export interface Mint {
66
92
  'to' : Account,
93
+ 'fee' : [] | [bigint],
67
94
  'memo' : [] | [Uint8Array],
68
95
  'created_at_time' : [] | [bigint],
69
- 'amount' : bigint,
96
+ 'amount' : Tokens,
70
97
  }
98
+ export interface Status { 'num_blocks_synced' : BlockIndex }
71
99
  export type SubAccount = Uint8Array;
100
+ export type Tokens = bigint;
72
101
  export interface Transaction {
73
102
  'burn' : [] | [Burn],
74
103
  'kind' : string,
75
104
  'mint' : [] | [Mint],
76
105
  'approve' : [] | [Approve],
106
+ 'fee_collector' : [] | [FeeCollector],
77
107
  'timestamp' : bigint,
78
108
  'transfer' : [] | [Transfer],
79
109
  }
80
- export interface TransactionWithId { 'id' : TxId, 'transaction' : Transaction }
110
+ export interface TransactionWithId {
111
+ 'id' : BlockIndex,
112
+ 'transaction' : Transaction,
113
+ }
81
114
  export interface Transfer {
82
115
  'to' : Account,
83
- 'fee' : [] | [bigint],
116
+ 'fee' : [] | [Tokens],
84
117
  'from' : Account,
85
118
  'memo' : [] | [Uint8Array],
86
119
  'created_at_time' : [] | [bigint],
87
- 'amount' : bigint,
120
+ 'amount' : Tokens,
88
121
  'spender' : [] | [Account],
89
122
  }
90
- export type TxId = bigint;
123
+ export interface UpgradeArg {
124
+ 'ledger_id' : [] | [Principal],
125
+ /**
126
+ * The interval in seconds in which to retrieve blocks from the ledger. A lower value makes the index more
127
+ * responsive in showing new blocks, but increases the consumption of cycles of both the index and ledger canisters.
128
+ * A higher values means that it takes longer for new blocks to show up in the index.
129
+ */
130
+ 'retrieve_blocks_from_ledger_interval_seconds' : [] | [bigint],
131
+ }
132
+ export type Value = { 'Int' : bigint } |
133
+ { 'Map' : Map } |
134
+ { 'Nat' : bigint } |
135
+ { 'Nat64' : bigint } |
136
+ { 'Blob' : Uint8Array } |
137
+ { 'Text' : string } |
138
+ { 'Array' : Array<Value> };
91
139
  export interface _SERVICE {
92
140
  'get_account_transactions' : ActorMethod<
93
141
  [GetAccountTransactionsArgs],
94
142
  GetTransactionsResult
95
143
  >,
144
+ 'get_blocks' : ActorMethod<[GetBlocksRequest], GetBlocksResponse>,
145
+ 'get_fee_collectors_ranges' : ActorMethod<[], FeeCollectorRanges>,
146
+ 'icrc1_balance_of' : ActorMethod<[Account], Tokens>,
96
147
  'ledger_id' : ActorMethod<[], Principal>,
97
148
  'list_subaccounts' : ActorMethod<[ListSubaccountsArgs], Array<SubAccount>>,
149
+ 'status' : ActorMethod<[], Status>,
98
150
  }
99
151
  export declare const idlService: IDL.ServiceClass;
100
152
  export declare const idlInitArgs: IDL.Type[];