@dfinity/ledger-icrc 4.1.2 → 5.0.0-next-2025-10-20

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 (63) hide show
  1. package/README.md +1 -1
  2. package/dist/candid/icrc_index-ng.certified.idl.d.ts +1 -1
  3. package/dist/candid/icrc_index-ng.certified.idl.js +96 -86
  4. package/dist/candid/icrc_index-ng.d.ts +11 -3
  5. package/dist/candid/icrc_index-ng.idl.d.ts +1 -1
  6. package/dist/candid/icrc_index-ng.idl.js +96 -86
  7. package/dist/candid/icrc_index.certified.idl.d.ts +1 -1
  8. package/dist/candid/icrc_index.certified.idl.js +68 -58
  9. package/dist/candid/icrc_index.d.ts +11 -3
  10. package/dist/candid/icrc_index.idl.d.ts +1 -1
  11. package/dist/candid/icrc_index.idl.js +68 -58
  12. package/dist/candid/icrc_ledger.certified.idl.d.ts +1 -1
  13. package/dist/candid/icrc_ledger.certified.idl.js +369 -367
  14. package/dist/candid/icrc_ledger.d.ts +11 -3
  15. package/dist/candid/icrc_ledger.idl.d.ts +1 -1
  16. package/dist/candid/icrc_ledger.idl.js +389 -383
  17. package/dist/{types/canister.d.ts → canister.d.ts} +2 -2
  18. package/dist/{types/converters → converters}/converters.d.ts +1 -1
  19. package/dist/{types/converters → converters}/index.converters.d.ts +2 -2
  20. package/dist/{types/converters → converters}/ledger.converters.d.ts +1 -1
  21. package/dist/{types/errors → errors}/ledger.errors.d.ts +1 -1
  22. package/dist/{types/index-ng.canister.d.ts → index-ng.canister.d.ts} +3 -3
  23. package/dist/{types/index.canister.d.ts → index.canister.d.ts} +2 -2
  24. package/dist/{types/index.d.ts → index.d.ts} +1 -1
  25. package/dist/index.js +2 -1
  26. package/dist/index.js.map +7 -0
  27. package/dist/index.mjs +4 -0
  28. package/dist/index.mjs.map +7 -0
  29. package/dist/{types/ledger.canister.d.ts → ledger.canister.d.ts} +2 -2
  30. package/dist/types/{types/canister.options.d.ts → canister.options.d.ts} +1 -1
  31. package/dist/types/{types/index-ng.params.d.ts → index-ng.params.d.ts} +1 -1
  32. package/dist/types/{types/index-ng.types.d.ts → index-ng.types.d.ts} +1 -1
  33. package/dist/types/{types/index.params.d.ts → index.params.d.ts} +1 -1
  34. package/dist/types/{types/index.types.d.ts → index.types.d.ts} +1 -1
  35. package/dist/types/{types/ledger.params.d.ts → ledger.params.d.ts} +1 -1
  36. package/dist/types/{types/ledger.responses.d.ts → ledger.responses.d.ts} +2 -2
  37. package/package.json +22 -11
  38. package/dist/cjs/index.cjs.js +0 -2
  39. package/dist/cjs/index.cjs.js.map +0 -7
  40. package/dist/esm/canister.js +0 -2
  41. package/dist/esm/canister.js.map +0 -7
  42. package/dist/esm/chunk-BYKVMTGO.js +0 -2
  43. package/dist/esm/chunk-BYKVMTGO.js.map +0 -7
  44. package/dist/esm/chunk-F74MWPN7.js +0 -2
  45. package/dist/esm/chunk-F74MWPN7.js.map +0 -7
  46. package/dist/esm/chunk-WTMDWX2C.js +0 -2
  47. package/dist/esm/chunk-WTMDWX2C.js.map +0 -7
  48. package/dist/esm/chunk-YO5OUZGG.js +0 -2
  49. package/dist/esm/chunk-YO5OUZGG.js.map +0 -7
  50. package/dist/esm/chunk-ZMWODXAU.js +0 -2
  51. package/dist/esm/chunk-ZMWODXAU.js.map +0 -7
  52. package/dist/esm/index-ng.canister.js +0 -2
  53. package/dist/esm/index-ng.canister.js.map +0 -7
  54. package/dist/esm/index.canister.js +0 -2
  55. package/dist/esm/index.canister.js.map +0 -7
  56. package/dist/esm/index.js +0 -2
  57. package/dist/esm/index.js.map +0 -7
  58. package/dist/esm/ledger.canister.js +0 -2
  59. package/dist/esm/ledger.canister.js.map +0 -7
  60. package/dist/index.cjs.js +0 -1
  61. /package/dist/{types/errors → errors}/index.errors.d.ts +0 -0
  62. /package/dist/{types/utils → utils}/ledger.utils.d.ts +0 -0
  63. /package/dist/{types/utils → utils}/payment.utils.d.ts +0 -0
package/README.md CHANGED
@@ -22,7 +22,7 @@ npm i @dfinity/ledger-icrc
22
22
  The bundle needs peer dependencies, be sure that following resources are available in your project as well.
23
23
 
24
24
  ```bash
25
- npm i @dfinity/agent @dfinity/candid @dfinity/principal @dfinity/utils
25
+ npm i @icp-sdk/core @dfinity/utils
26
26
  ```
27
27
 
28
28
  ## Usage
@@ -1,2 +1,2 @@
1
- import type { IDL } from "@dfinity/candid";
1
+ import type { IDL } from "@icp-sdk/core/candid";
2
2
  export const idlFactory: IDL.InterfaceFactory;
@@ -1,139 +1,149 @@
1
- /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */
1
+ /* eslint-disable */
2
+
3
+ // @ts-nocheck
4
+
5
+ // This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.
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
+
2
9
  export const idlFactory = ({ IDL }) => {
3
10
  const Value = IDL.Rec();
4
11
  const UpgradeArg = IDL.Record({
5
- 'ledger_id' : IDL.Opt(IDL.Principal),
6
- 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
12
+ ledger_id: IDL.Opt(IDL.Principal),
13
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
7
14
  });
8
15
  const InitArg = IDL.Record({
9
- 'ledger_id' : IDL.Principal,
10
- 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
16
+ ledger_id: IDL.Principal,
17
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
11
18
  });
12
- const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });
19
+ const IndexArg = IDL.Variant({ Upgrade: UpgradeArg, Init: InitArg });
13
20
  const BlockIndex = IDL.Nat;
14
21
  const SubAccount = IDL.Vec(IDL.Nat8);
15
22
  const Account = IDL.Record({
16
- 'owner' : IDL.Principal,
17
- 'subaccount' : IDL.Opt(SubAccount),
23
+ owner: IDL.Principal,
24
+ subaccount: IDL.Opt(SubAccount),
18
25
  });
19
26
  const GetAccountTransactionsArgs = IDL.Record({
20
- 'max_results' : IDL.Nat,
21
- 'start' : IDL.Opt(BlockIndex),
22
- 'account' : Account,
27
+ max_results: IDL.Nat,
28
+ start: IDL.Opt(BlockIndex),
29
+ account: Account,
23
30
  });
24
31
  const Tokens = IDL.Nat;
25
32
  const Burn = IDL.Record({
26
- 'from' : Account,
27
- 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
28
- 'created_at_time' : IDL.Opt(IDL.Nat64),
29
- 'amount' : Tokens,
30
- 'spender' : IDL.Opt(Account),
33
+ from: Account,
34
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
35
+ created_at_time: IDL.Opt(IDL.Nat64),
36
+ amount: Tokens,
37
+ spender: IDL.Opt(Account),
31
38
  });
32
39
  const Mint = IDL.Record({
33
- 'to' : Account,
34
- 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
35
- 'created_at_time' : IDL.Opt(IDL.Nat64),
36
- 'amount' : Tokens,
40
+ to: Account,
41
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
42
+ created_at_time: IDL.Opt(IDL.Nat64),
43
+ amount: Tokens,
37
44
  });
38
45
  const Approve = IDL.Record({
39
- 'fee' : IDL.Opt(Tokens),
40
- 'from' : Account,
41
- 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
42
- 'created_at_time' : IDL.Opt(IDL.Nat64),
43
- 'amount' : Tokens,
44
- 'expected_allowance' : IDL.Opt(Tokens),
45
- 'expires_at' : IDL.Opt(IDL.Nat64),
46
- 'spender' : Account,
46
+ fee: IDL.Opt(Tokens),
47
+ from: Account,
48
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
49
+ created_at_time: IDL.Opt(IDL.Nat64),
50
+ amount: Tokens,
51
+ expected_allowance: IDL.Opt(Tokens),
52
+ expires_at: IDL.Opt(IDL.Nat64),
53
+ spender: Account,
47
54
  });
48
55
  const Transfer = IDL.Record({
49
- 'to' : Account,
50
- 'fee' : IDL.Opt(Tokens),
51
- 'from' : Account,
52
- 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
53
- 'created_at_time' : IDL.Opt(IDL.Nat64),
54
- 'amount' : Tokens,
55
- 'spender' : IDL.Opt(Account),
56
+ to: Account,
57
+ fee: IDL.Opt(Tokens),
58
+ from: Account,
59
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
60
+ created_at_time: IDL.Opt(IDL.Nat64),
61
+ amount: Tokens,
62
+ spender: IDL.Opt(Account),
56
63
  });
57
64
  const Transaction = IDL.Record({
58
- 'burn' : IDL.Opt(Burn),
59
- 'kind' : IDL.Text,
60
- 'mint' : IDL.Opt(Mint),
61
- 'approve' : IDL.Opt(Approve),
62
- 'timestamp' : IDL.Nat64,
63
- 'transfer' : IDL.Opt(Transfer),
65
+ burn: IDL.Opt(Burn),
66
+ kind: IDL.Text,
67
+ mint: IDL.Opt(Mint),
68
+ approve: IDL.Opt(Approve),
69
+ timestamp: IDL.Nat64,
70
+ transfer: IDL.Opt(Transfer),
64
71
  });
65
72
  const TransactionWithId = IDL.Record({
66
- 'id' : BlockIndex,
67
- 'transaction' : Transaction,
73
+ id: BlockIndex,
74
+ transaction: Transaction,
68
75
  });
69
76
  const GetTransactions = IDL.Record({
70
- 'balance' : Tokens,
71
- 'transactions' : IDL.Vec(TransactionWithId),
72
- 'oldest_tx_id' : IDL.Opt(BlockIndex),
77
+ balance: Tokens,
78
+ transactions: IDL.Vec(TransactionWithId),
79
+ oldest_tx_id: IDL.Opt(BlockIndex),
73
80
  });
74
- const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });
81
+ const GetTransactionsErr = IDL.Record({ message: IDL.Text });
75
82
  const GetTransactionsResult = IDL.Variant({
76
- 'Ok' : GetTransactions,
77
- 'Err' : GetTransactionsErr,
83
+ Ok: GetTransactions,
84
+ Err: GetTransactionsErr,
78
85
  });
79
86
  const GetBlocksRequest = IDL.Record({
80
- 'start' : IDL.Nat,
81
- 'length' : IDL.Nat,
87
+ start: IDL.Nat,
88
+ length: IDL.Nat,
82
89
  });
83
90
  const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));
84
91
  Value.fill(
85
92
  IDL.Variant({
86
- 'Int' : IDL.Int,
87
- 'Map' : Map,
88
- 'Nat' : IDL.Nat,
89
- 'Nat64' : IDL.Nat64,
90
- 'Blob' : IDL.Vec(IDL.Nat8),
91
- 'Text' : IDL.Text,
92
- 'Array' : IDL.Vec(Value),
93
- })
93
+ Int: IDL.Int,
94
+ Map: Map,
95
+ Nat: IDL.Nat,
96
+ Nat64: IDL.Nat64,
97
+ Blob: IDL.Vec(IDL.Nat8),
98
+ Text: IDL.Text,
99
+ Array: IDL.Vec(Value),
100
+ }),
94
101
  );
95
102
  const Block = Value;
96
103
  const GetBlocksResponse = IDL.Record({
97
- 'blocks' : IDL.Vec(Block),
98
- 'chain_length' : IDL.Nat64,
104
+ blocks: IDL.Vec(Block),
105
+ chain_length: IDL.Nat64,
99
106
  });
100
107
  const FeeCollectorRanges = IDL.Record({
101
- 'ranges' : IDL.Vec(
102
- IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex)))
108
+ ranges: IDL.Vec(
109
+ IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex))),
103
110
  ),
104
111
  });
105
112
  const ListSubaccountsArgs = IDL.Record({
106
- 'owner' : IDL.Principal,
107
- 'start' : IDL.Opt(SubAccount),
113
+ owner: IDL.Principal,
114
+ start: IDL.Opt(SubAccount),
108
115
  });
109
- const Status = IDL.Record({ 'num_blocks_synced' : BlockIndex });
116
+ const Status = IDL.Record({ num_blocks_synced: BlockIndex });
117
+
110
118
  return IDL.Service({
111
- 'get_account_transactions' : IDL.Func(
112
- [GetAccountTransactionsArgs],
113
- [GetTransactionsResult],
114
- [],
115
- ),
116
- 'get_blocks' : IDL.Func([GetBlocksRequest], [GetBlocksResponse], []),
117
- 'get_fee_collectors_ranges' : IDL.Func([], [FeeCollectorRanges], []),
118
- 'icrc1_balance_of' : IDL.Func([Account], [Tokens], []),
119
- 'ledger_id' : IDL.Func([], [IDL.Principal], []),
120
- 'list_subaccounts' : IDL.Func(
121
- [ListSubaccountsArgs],
122
- [IDL.Vec(SubAccount)],
123
- [],
124
- ),
125
- 'status' : IDL.Func([], [Status], ['query']),
119
+ get_account_transactions: IDL.Func(
120
+ [GetAccountTransactionsArgs],
121
+ [GetTransactionsResult],
122
+ [],
123
+ ),
124
+ get_blocks: IDL.Func([GetBlocksRequest], [GetBlocksResponse], []),
125
+ get_fee_collectors_ranges: IDL.Func([], [FeeCollectorRanges], []),
126
+ icrc1_balance_of: IDL.Func([Account], [Tokens], []),
127
+ ledger_id: IDL.Func([], [IDL.Principal], []),
128
+ list_subaccounts: IDL.Func(
129
+ [ListSubaccountsArgs],
130
+ [IDL.Vec(SubAccount)],
131
+ [],
132
+ ),
133
+ status: IDL.Func([], [Status], ["query"]),
126
134
  });
127
135
  };
136
+
128
137
  export const init = ({ IDL }) => {
129
138
  const UpgradeArg = IDL.Record({
130
- 'ledger_id' : IDL.Opt(IDL.Principal),
131
- 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
139
+ ledger_id: IDL.Opt(IDL.Principal),
140
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
132
141
  });
133
142
  const InitArg = IDL.Record({
134
- 'ledger_id' : IDL.Principal,
135
- 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
143
+ ledger_id: IDL.Principal,
144
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
136
145
  });
137
- const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });
146
+ const IndexArg = IDL.Variant({ Upgrade: UpgradeArg, Init: InitArg });
147
+
138
148
  return [IDL.Opt(IndexArg)];
139
149
  };
@@ -1,6 +1,14 @@
1
- import type { ActorMethod } from "@dfinity/agent";
2
- import type { IDL } from "@dfinity/candid";
3
- import type { Principal } from "@dfinity/principal";
1
+ /* eslint-disable */
2
+
3
+ // @ts-nocheck
4
+
5
+ // This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.
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";
4
12
 
5
13
  export interface Account {
6
14
  owner: Principal;
@@ -1,2 +1,2 @@
1
- import type { IDL } from "@dfinity/candid";
1
+ import type { IDL } from "@icp-sdk/core/candid";
2
2
  export const idlFactory: IDL.InterfaceFactory;
@@ -1,139 +1,149 @@
1
- /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */
1
+ /* eslint-disable */
2
+
3
+ // @ts-nocheck
4
+
5
+ // This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.
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
+
2
9
  export const idlFactory = ({ IDL }) => {
3
10
  const Value = IDL.Rec();
4
11
  const UpgradeArg = IDL.Record({
5
- 'ledger_id' : IDL.Opt(IDL.Principal),
6
- 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
12
+ ledger_id: IDL.Opt(IDL.Principal),
13
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
7
14
  });
8
15
  const InitArg = IDL.Record({
9
- 'ledger_id' : IDL.Principal,
10
- 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
16
+ ledger_id: IDL.Principal,
17
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
11
18
  });
12
- const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });
19
+ const IndexArg = IDL.Variant({ Upgrade: UpgradeArg, Init: InitArg });
13
20
  const BlockIndex = IDL.Nat;
14
21
  const SubAccount = IDL.Vec(IDL.Nat8);
15
22
  const Account = IDL.Record({
16
- 'owner' : IDL.Principal,
17
- 'subaccount' : IDL.Opt(SubAccount),
23
+ owner: IDL.Principal,
24
+ subaccount: IDL.Opt(SubAccount),
18
25
  });
19
26
  const GetAccountTransactionsArgs = IDL.Record({
20
- 'max_results' : IDL.Nat,
21
- 'start' : IDL.Opt(BlockIndex),
22
- 'account' : Account,
27
+ max_results: IDL.Nat,
28
+ start: IDL.Opt(BlockIndex),
29
+ account: Account,
23
30
  });
24
31
  const Tokens = IDL.Nat;
25
32
  const Burn = IDL.Record({
26
- 'from' : Account,
27
- 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
28
- 'created_at_time' : IDL.Opt(IDL.Nat64),
29
- 'amount' : Tokens,
30
- 'spender' : IDL.Opt(Account),
33
+ from: Account,
34
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
35
+ created_at_time: IDL.Opt(IDL.Nat64),
36
+ amount: Tokens,
37
+ spender: IDL.Opt(Account),
31
38
  });
32
39
  const Mint = IDL.Record({
33
- 'to' : Account,
34
- 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
35
- 'created_at_time' : IDL.Opt(IDL.Nat64),
36
- 'amount' : Tokens,
40
+ to: Account,
41
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
42
+ created_at_time: IDL.Opt(IDL.Nat64),
43
+ amount: Tokens,
37
44
  });
38
45
  const Approve = IDL.Record({
39
- 'fee' : IDL.Opt(Tokens),
40
- 'from' : Account,
41
- 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
42
- 'created_at_time' : IDL.Opt(IDL.Nat64),
43
- 'amount' : Tokens,
44
- 'expected_allowance' : IDL.Opt(Tokens),
45
- 'expires_at' : IDL.Opt(IDL.Nat64),
46
- 'spender' : Account,
46
+ fee: IDL.Opt(Tokens),
47
+ from: Account,
48
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
49
+ created_at_time: IDL.Opt(IDL.Nat64),
50
+ amount: Tokens,
51
+ expected_allowance: IDL.Opt(Tokens),
52
+ expires_at: IDL.Opt(IDL.Nat64),
53
+ spender: Account,
47
54
  });
48
55
  const Transfer = IDL.Record({
49
- 'to' : Account,
50
- 'fee' : IDL.Opt(Tokens),
51
- 'from' : Account,
52
- 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
53
- 'created_at_time' : IDL.Opt(IDL.Nat64),
54
- 'amount' : Tokens,
55
- 'spender' : IDL.Opt(Account),
56
+ to: Account,
57
+ fee: IDL.Opt(Tokens),
58
+ from: Account,
59
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
60
+ created_at_time: IDL.Opt(IDL.Nat64),
61
+ amount: Tokens,
62
+ spender: IDL.Opt(Account),
56
63
  });
57
64
  const Transaction = IDL.Record({
58
- 'burn' : IDL.Opt(Burn),
59
- 'kind' : IDL.Text,
60
- 'mint' : IDL.Opt(Mint),
61
- 'approve' : IDL.Opt(Approve),
62
- 'timestamp' : IDL.Nat64,
63
- 'transfer' : IDL.Opt(Transfer),
65
+ burn: IDL.Opt(Burn),
66
+ kind: IDL.Text,
67
+ mint: IDL.Opt(Mint),
68
+ approve: IDL.Opt(Approve),
69
+ timestamp: IDL.Nat64,
70
+ transfer: IDL.Opt(Transfer),
64
71
  });
65
72
  const TransactionWithId = IDL.Record({
66
- 'id' : BlockIndex,
67
- 'transaction' : Transaction,
73
+ id: BlockIndex,
74
+ transaction: Transaction,
68
75
  });
69
76
  const GetTransactions = IDL.Record({
70
- 'balance' : Tokens,
71
- 'transactions' : IDL.Vec(TransactionWithId),
72
- 'oldest_tx_id' : IDL.Opt(BlockIndex),
77
+ balance: Tokens,
78
+ transactions: IDL.Vec(TransactionWithId),
79
+ oldest_tx_id: IDL.Opt(BlockIndex),
73
80
  });
74
- const GetTransactionsErr = IDL.Record({ 'message' : IDL.Text });
81
+ const GetTransactionsErr = IDL.Record({ message: IDL.Text });
75
82
  const GetTransactionsResult = IDL.Variant({
76
- 'Ok' : GetTransactions,
77
- 'Err' : GetTransactionsErr,
83
+ Ok: GetTransactions,
84
+ Err: GetTransactionsErr,
78
85
  });
79
86
  const GetBlocksRequest = IDL.Record({
80
- 'start' : IDL.Nat,
81
- 'length' : IDL.Nat,
87
+ start: IDL.Nat,
88
+ length: IDL.Nat,
82
89
  });
83
90
  const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));
84
91
  Value.fill(
85
92
  IDL.Variant({
86
- 'Int' : IDL.Int,
87
- 'Map' : Map,
88
- 'Nat' : IDL.Nat,
89
- 'Nat64' : IDL.Nat64,
90
- 'Blob' : IDL.Vec(IDL.Nat8),
91
- 'Text' : IDL.Text,
92
- 'Array' : IDL.Vec(Value),
93
- })
93
+ Int: IDL.Int,
94
+ Map: Map,
95
+ Nat: IDL.Nat,
96
+ Nat64: IDL.Nat64,
97
+ Blob: IDL.Vec(IDL.Nat8),
98
+ Text: IDL.Text,
99
+ Array: IDL.Vec(Value),
100
+ }),
94
101
  );
95
102
  const Block = Value;
96
103
  const GetBlocksResponse = IDL.Record({
97
- 'blocks' : IDL.Vec(Block),
98
- 'chain_length' : IDL.Nat64,
104
+ blocks: IDL.Vec(Block),
105
+ chain_length: IDL.Nat64,
99
106
  });
100
107
  const FeeCollectorRanges = IDL.Record({
101
- 'ranges' : IDL.Vec(
102
- IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex)))
108
+ ranges: IDL.Vec(
109
+ IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex))),
103
110
  ),
104
111
  });
105
112
  const ListSubaccountsArgs = IDL.Record({
106
- 'owner' : IDL.Principal,
107
- 'start' : IDL.Opt(SubAccount),
113
+ owner: IDL.Principal,
114
+ start: IDL.Opt(SubAccount),
108
115
  });
109
- const Status = IDL.Record({ 'num_blocks_synced' : BlockIndex });
116
+ const Status = IDL.Record({ num_blocks_synced: BlockIndex });
117
+
110
118
  return IDL.Service({
111
- 'get_account_transactions' : IDL.Func(
112
- [GetAccountTransactionsArgs],
113
- [GetTransactionsResult],
114
- ['query'],
115
- ),
116
- 'get_blocks' : IDL.Func([GetBlocksRequest], [GetBlocksResponse], ['query']),
117
- 'get_fee_collectors_ranges' : IDL.Func([], [FeeCollectorRanges], ['query']),
118
- 'icrc1_balance_of' : IDL.Func([Account], [Tokens], ['query']),
119
- 'ledger_id' : IDL.Func([], [IDL.Principal], ['query']),
120
- 'list_subaccounts' : IDL.Func(
121
- [ListSubaccountsArgs],
122
- [IDL.Vec(SubAccount)],
123
- ['query'],
124
- ),
125
- 'status' : IDL.Func([], [Status], ['query']),
119
+ get_account_transactions: IDL.Func(
120
+ [GetAccountTransactionsArgs],
121
+ [GetTransactionsResult],
122
+ ["query"],
123
+ ),
124
+ get_blocks: IDL.Func([GetBlocksRequest], [GetBlocksResponse], ["query"]),
125
+ get_fee_collectors_ranges: IDL.Func([], [FeeCollectorRanges], ["query"]),
126
+ icrc1_balance_of: IDL.Func([Account], [Tokens], ["query"]),
127
+ ledger_id: IDL.Func([], [IDL.Principal], ["query"]),
128
+ list_subaccounts: IDL.Func(
129
+ [ListSubaccountsArgs],
130
+ [IDL.Vec(SubAccount)],
131
+ ["query"],
132
+ ),
133
+ status: IDL.Func([], [Status], ["query"]),
126
134
  });
127
135
  };
136
+
128
137
  export const init = ({ IDL }) => {
129
138
  const UpgradeArg = IDL.Record({
130
- 'ledger_id' : IDL.Opt(IDL.Principal),
131
- 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
139
+ ledger_id: IDL.Opt(IDL.Principal),
140
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
132
141
  });
133
142
  const InitArg = IDL.Record({
134
- 'ledger_id' : IDL.Principal,
135
- 'retrieve_blocks_from_ledger_interval_seconds' : IDL.Opt(IDL.Nat64),
143
+ ledger_id: IDL.Principal,
144
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
136
145
  });
137
- const IndexArg = IDL.Variant({ 'Upgrade' : UpgradeArg, 'Init' : InitArg });
146
+ const IndexArg = IDL.Variant({ Upgrade: UpgradeArg, Init: InitArg });
147
+
138
148
  return [IDL.Opt(IndexArg)];
139
149
  };
@@ -1,2 +1,2 @@
1
- import type { IDL } from "@dfinity/candid";
1
+ import type { IDL } from "@icp-sdk/core/candid";
2
2
  export const idlFactory: IDL.InterfaceFactory;