@junobuild/functions 0.5.3 → 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 (79) 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/cmc/cmc.did.idl.d.ts +1 -1
  11. package/canisters/declarations/ic-management/ic-management.did.d.ts +2 -0
  12. package/canisters/declarations/ledger-icrc/icrc_icrc-1.did.d.ts +70 -0
  13. package/canisters/declarations/ledger-icrc/icrc_icrc-1.did.idl.d.ts +26 -0
  14. package/canisters/declarations/ledger-icrc/icrc_icrc-10.did.d.ts +21 -0
  15. package/canisters/declarations/ledger-icrc/icrc_icrc-10.did.idl.d.ts +13 -0
  16. package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +69 -17
  17. package/canisters/declarations/ledger-icrc/icrc_index.did.idl.d.ts +21 -4
  18. package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +6 -0
  19. package/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.d.ts +1 -0
  20. package/canisters/declarations/nns/governance.did.d.ts +54 -30
  21. package/canisters/declarations/nns/governance.did.idl.d.ts +6 -3
  22. package/canisters/declarations/nns/governance_test.did.d.ts +54 -30
  23. package/canisters/declarations/nns/governance_test.did.idl.d.ts +6 -3
  24. package/{src/canisters/declarations/sns/sns_root.did.d.ts → canisters/declarations/sns/root.did.d.ts} +12 -0
  25. package/canisters/declarations/sns/{sns_root.did.idl.d.ts → root.did.idl.d.ts} +5 -1
  26. package/canisters/ic-management/index.js +1 -1
  27. package/canisters/ledger/icp/index.js +1 -1
  28. package/canisters/ledger/icrc/index.d.ts +1 -1
  29. package/canisters/ledger/icrc/index.js +1 -1
  30. package/canisters/ledger/icrc/schemas.d.ts +1 -1
  31. package/canisters/nns/index.js +1 -1
  32. package/canisters/schemas.d.ts +1 -1
  33. package/canisters/sns/index.js +1 -1
  34. package/chunk-CAQXR2VB.js +2 -0
  35. package/chunk-CAQXR2VB.js.map +7 -0
  36. package/package.json +5 -5
  37. package/schemas/satellite.d.ts +1 -1
  38. package/sdk/schemas/controllers.d.ts +1 -1
  39. package/sdk/schemas/db.d.ts +6 -6
  40. package/sdk/schemas/params.d.ts +1 -1
  41. package/sdk/schemas/storage.d.ts +6 -6
  42. package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +2 -0
  43. package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +44 -22
  44. package/src/canisters/declarations/ckbtc/minter.did.d.ts +4 -0
  45. package/src/canisters/declarations/ckbtc/minter.did.idl.js +14 -0
  46. package/src/canisters/declarations/ic-management/ic-management.did.d.ts +2 -0
  47. package/src/canisters/declarations/ic-management/ic-management.did.idl.js +6 -2
  48. package/src/canisters/declarations/ledger-icrc/icrc_icrc-1.did.d.ts +70 -0
  49. package/src/canisters/declarations/ledger-icrc/icrc_icrc-1.did.idl.js +116 -0
  50. package/src/canisters/declarations/ledger-icrc/icrc_icrc-10.did.d.ts +21 -0
  51. package/src/canisters/declarations/ledger-icrc/icrc_icrc-10.did.idl.js +34 -0
  52. package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +69 -17
  53. package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +150 -35
  54. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +6 -0
  55. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +12 -0
  56. package/src/canisters/declarations/nns/governance.did.d.ts +54 -30
  57. package/src/canisters/declarations/nns/governance.did.idl.js +87 -17
  58. package/src/canisters/declarations/nns/governance_test.did.d.ts +54 -30
  59. package/src/canisters/declarations/nns/governance_test.did.idl.js +87 -17
  60. package/{canisters/declarations/sns/sns_root.did.d.ts → src/canisters/declarations/sns/root.did.d.ts} +12 -0
  61. package/src/canisters/declarations/sns/{sns_root.did.idl.js → root.did.idl.js} +38 -8
  62. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +0 -148
  63. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.d.ts +0 -44
  64. package/chunk-HANEPD6T.js +0 -2
  65. package/chunk-HANEPD6T.js.map +0 -7
  66. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +0 -148
  67. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.js +0 -274
  68. /package/canisters/declarations/sns/{sns_governance.did.d.ts → governance.did.d.ts} +0 -0
  69. /package/canisters/declarations/sns/{sns_governance.did.idl.d.ts → governance.did.idl.d.ts} +0 -0
  70. /package/canisters/declarations/sns/{sns_governance_test.did.d.ts → governance_test.did.d.ts} +0 -0
  71. /package/canisters/declarations/sns/{sns_governance_test.did.idl.d.ts → governance_test.did.idl.d.ts} +0 -0
  72. /package/canisters/declarations/sns/{sns_swap.did.d.ts → swap.did.d.ts} +0 -0
  73. /package/canisters/declarations/sns/{sns_swap.did.idl.d.ts → swap.did.idl.d.ts} +0 -0
  74. /package/src/canisters/declarations/sns/{sns_governance.did.d.ts → governance.did.d.ts} +0 -0
  75. /package/src/canisters/declarations/sns/{sns_governance.did.idl.js → governance.did.idl.js} +0 -0
  76. /package/src/canisters/declarations/sns/{sns_governance_test.did.d.ts → governance_test.did.d.ts} +0 -0
  77. /package/src/canisters/declarations/sns/{sns_governance_test.did.idl.js → governance_test.did.idl.js} +0 -0
  78. /package/src/canisters/declarations/sns/{sns_swap.did.d.ts → swap.did.d.ts} +0 -0
  79. /package/src/canisters/declarations/sns/{sns_swap.did.idl.js → swap.did.idl.js} +0 -0
@@ -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[];
@@ -8,47 +8,68 @@
8
8
 
9
9
  import {IDL} from '@icp-sdk/core/candid';
10
10
 
11
- export const InitArgs = IDL.Record({ledger_id: IDL.Principal});
12
- export const TxId = IDL.Nat;
11
+ export const Value = IDL.Rec();
12
+ export const UpgradeArg = IDL.Record({
13
+ ledger_id: IDL.Opt(IDL.Principal),
14
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64)
15
+ });
16
+ export const InitArg = IDL.Record({
17
+ ledger_id: IDL.Principal,
18
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64)
19
+ });
20
+ export const IndexArg = IDL.Variant({
21
+ Upgrade: UpgradeArg,
22
+ Init: InitArg
23
+ });
24
+ export const BlockIndex = IDL.Nat;
25
+ export const SubAccount = IDL.Vec(IDL.Nat8);
13
26
  export const Account = IDL.Record({
14
27
  owner: IDL.Principal,
15
- subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
28
+ subaccount: IDL.Opt(SubAccount)
16
29
  });
17
30
  export const GetAccountTransactionsArgs = IDL.Record({
18
31
  max_results: IDL.Nat,
19
- start: IDL.Opt(TxId),
32
+ start: IDL.Opt(BlockIndex),
20
33
  account: Account
21
34
  });
35
+ export const Tokens = IDL.Nat;
22
36
  export const Burn = IDL.Record({
37
+ fee: IDL.Opt(IDL.Nat),
23
38
  from: Account,
24
39
  memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
25
40
  created_at_time: IDL.Opt(IDL.Nat64),
26
- amount: IDL.Nat,
41
+ amount: Tokens,
27
42
  spender: IDL.Opt(Account)
28
43
  });
29
44
  export const Mint = IDL.Record({
30
45
  to: Account,
46
+ fee: IDL.Opt(IDL.Nat),
31
47
  memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
32
48
  created_at_time: IDL.Opt(IDL.Nat64),
33
- amount: IDL.Nat
49
+ amount: Tokens
34
50
  });
35
51
  export const Approve = IDL.Record({
36
- fee: IDL.Opt(IDL.Nat),
52
+ fee: IDL.Opt(Tokens),
37
53
  from: Account,
38
54
  memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
39
55
  created_at_time: IDL.Opt(IDL.Nat64),
40
- amount: IDL.Nat,
41
- expected_allowance: IDL.Opt(IDL.Nat),
56
+ amount: Tokens,
57
+ expected_allowance: IDL.Opt(Tokens),
42
58
  expires_at: IDL.Opt(IDL.Nat64),
43
59
  spender: Account
44
60
  });
61
+ export const FeeCollector = IDL.Record({
62
+ ts: IDL.Opt(IDL.Nat64),
63
+ fee_collector: IDL.Opt(Account),
64
+ caller: IDL.Opt(IDL.Principal)
65
+ });
45
66
  export const Transfer = IDL.Record({
46
67
  to: Account,
47
- fee: IDL.Opt(IDL.Nat),
68
+ fee: IDL.Opt(Tokens),
48
69
  from: Account,
49
70
  memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
50
71
  created_at_time: IDL.Opt(IDL.Nat64),
51
- amount: IDL.Nat,
72
+ amount: Tokens,
52
73
  spender: IDL.Opt(Account)
53
74
  });
54
75
  export const Transaction = IDL.Record({
@@ -56,78 +77,130 @@ export const Transaction = IDL.Record({
56
77
  kind: IDL.Text,
57
78
  mint: IDL.Opt(Mint),
58
79
  approve: IDL.Opt(Approve),
80
+ fee_collector: IDL.Opt(FeeCollector),
59
81
  timestamp: IDL.Nat64,
60
82
  transfer: IDL.Opt(Transfer)
61
83
  });
62
84
  export const TransactionWithId = IDL.Record({
63
- id: TxId,
85
+ id: BlockIndex,
64
86
  transaction: Transaction
65
87
  });
66
88
  export const GetTransactions = IDL.Record({
89
+ balance: Tokens,
67
90
  transactions: IDL.Vec(TransactionWithId),
68
- oldest_tx_id: IDL.Opt(TxId)
91
+ oldest_tx_id: IDL.Opt(BlockIndex)
69
92
  });
70
93
  export const GetTransactionsErr = IDL.Record({message: IDL.Text});
71
94
  export const GetTransactionsResult = IDL.Variant({
72
95
  Ok: GetTransactions,
73
96
  Err: GetTransactionsErr
74
97
  });
75
- export const SubAccount = IDL.Vec(IDL.Nat8);
98
+ export const GetBlocksRequest = IDL.Record({
99
+ start: IDL.Nat,
100
+ length: IDL.Nat
101
+ });
102
+ export const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));
103
+ Value.fill(
104
+ IDL.Variant({
105
+ Int: IDL.Int,
106
+ Map: Map,
107
+ Nat: IDL.Nat,
108
+ Nat64: IDL.Nat64,
109
+ Blob: IDL.Vec(IDL.Nat8),
110
+ Text: IDL.Text,
111
+ Array: IDL.Vec(Value)
112
+ })
113
+ );
114
+ export const Block = Value;
115
+ export const GetBlocksResponse = IDL.Record({
116
+ blocks: IDL.Vec(Block),
117
+ chain_length: IDL.Nat64
118
+ });
119
+ export const FeeCollectorRanges = IDL.Record({
120
+ ranges: IDL.Vec(IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex))))
121
+ });
76
122
  export const ListSubaccountsArgs = IDL.Record({
77
123
  owner: IDL.Principal,
78
124
  start: IDL.Opt(SubAccount)
79
125
  });
126
+ export const Status = IDL.Record({num_blocks_synced: BlockIndex});
80
127
 
81
128
  export const idlService = IDL.Service({
82
- get_account_transactions: IDL.Func([GetAccountTransactionsArgs], [GetTransactionsResult], []),
129
+ get_account_transactions: IDL.Func(
130
+ [GetAccountTransactionsArgs],
131
+ [GetTransactionsResult],
132
+ ['query']
133
+ ),
134
+ get_blocks: IDL.Func([GetBlocksRequest], [GetBlocksResponse], ['query']),
135
+ get_fee_collectors_ranges: IDL.Func([], [FeeCollectorRanges], ['query']),
136
+ icrc1_balance_of: IDL.Func([Account], [Tokens], ['query']),
83
137
  ledger_id: IDL.Func([], [IDL.Principal], ['query']),
84
- list_subaccounts: IDL.Func([ListSubaccountsArgs], [IDL.Vec(SubAccount)], ['query'])
138
+ list_subaccounts: IDL.Func([ListSubaccountsArgs], [IDL.Vec(SubAccount)], ['query']),
139
+ status: IDL.Func([], [Status], ['query'])
85
140
  });
86
141
 
87
- export const idlInitArgs = [InitArgs];
142
+ export const idlInitArgs = [IDL.Opt(IndexArg)];
88
143
 
89
144
  export const idlFactory = ({IDL}) => {
90
- const InitArgs = IDL.Record({ledger_id: IDL.Principal});
91
- const TxId = IDL.Nat;
145
+ const Value = IDL.Rec();
146
+ const UpgradeArg = IDL.Record({
147
+ ledger_id: IDL.Opt(IDL.Principal),
148
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64)
149
+ });
150
+ const InitArg = IDL.Record({
151
+ ledger_id: IDL.Principal,
152
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64)
153
+ });
154
+ const IndexArg = IDL.Variant({Upgrade: UpgradeArg, Init: InitArg});
155
+ const BlockIndex = IDL.Nat;
156
+ const SubAccount = IDL.Vec(IDL.Nat8);
92
157
  const Account = IDL.Record({
93
158
  owner: IDL.Principal,
94
- subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
159
+ subaccount: IDL.Opt(SubAccount)
95
160
  });
96
161
  const GetAccountTransactionsArgs = IDL.Record({
97
162
  max_results: IDL.Nat,
98
- start: IDL.Opt(TxId),
163
+ start: IDL.Opt(BlockIndex),
99
164
  account: Account
100
165
  });
166
+ const Tokens = IDL.Nat;
101
167
  const Burn = IDL.Record({
168
+ fee: IDL.Opt(IDL.Nat),
102
169
  from: Account,
103
170
  memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
104
171
  created_at_time: IDL.Opt(IDL.Nat64),
105
- amount: IDL.Nat,
172
+ amount: Tokens,
106
173
  spender: IDL.Opt(Account)
107
174
  });
108
175
  const Mint = IDL.Record({
109
176
  to: Account,
177
+ fee: IDL.Opt(IDL.Nat),
110
178
  memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
111
179
  created_at_time: IDL.Opt(IDL.Nat64),
112
- amount: IDL.Nat
180
+ amount: Tokens
113
181
  });
114
182
  const Approve = IDL.Record({
115
- fee: IDL.Opt(IDL.Nat),
183
+ fee: IDL.Opt(Tokens),
116
184
  from: Account,
117
185
  memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
118
186
  created_at_time: IDL.Opt(IDL.Nat64),
119
- amount: IDL.Nat,
120
- expected_allowance: IDL.Opt(IDL.Nat),
187
+ amount: Tokens,
188
+ expected_allowance: IDL.Opt(Tokens),
121
189
  expires_at: IDL.Opt(IDL.Nat64),
122
190
  spender: Account
123
191
  });
192
+ const FeeCollector = IDL.Record({
193
+ ts: IDL.Opt(IDL.Nat64),
194
+ fee_collector: IDL.Opt(Account),
195
+ caller: IDL.Opt(IDL.Principal)
196
+ });
124
197
  const Transfer = IDL.Record({
125
198
  to: Account,
126
- fee: IDL.Opt(IDL.Nat),
199
+ fee: IDL.Opt(Tokens),
127
200
  from: Account,
128
201
  memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
129
202
  created_at_time: IDL.Opt(IDL.Nat64),
130
- amount: IDL.Nat,
203
+ amount: Tokens,
131
204
  spender: IDL.Opt(Account)
132
205
  });
133
206
  const Transaction = IDL.Record({
@@ -135,37 +208,79 @@ export const idlFactory = ({IDL}) => {
135
208
  kind: IDL.Text,
136
209
  mint: IDL.Opt(Mint),
137
210
  approve: IDL.Opt(Approve),
211
+ fee_collector: IDL.Opt(FeeCollector),
138
212
  timestamp: IDL.Nat64,
139
213
  transfer: IDL.Opt(Transfer)
140
214
  });
141
215
  const TransactionWithId = IDL.Record({
142
- id: TxId,
216
+ id: BlockIndex,
143
217
  transaction: Transaction
144
218
  });
145
219
  const GetTransactions = IDL.Record({
220
+ balance: Tokens,
146
221
  transactions: IDL.Vec(TransactionWithId),
147
- oldest_tx_id: IDL.Opt(TxId)
222
+ oldest_tx_id: IDL.Opt(BlockIndex)
148
223
  });
149
224
  const GetTransactionsErr = IDL.Record({message: IDL.Text});
150
225
  const GetTransactionsResult = IDL.Variant({
151
226
  Ok: GetTransactions,
152
227
  Err: GetTransactionsErr
153
228
  });
154
- const SubAccount = IDL.Vec(IDL.Nat8);
229
+ const GetBlocksRequest = IDL.Record({
230
+ start: IDL.Nat,
231
+ length: IDL.Nat
232
+ });
233
+ const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));
234
+ Value.fill(
235
+ IDL.Variant({
236
+ Int: IDL.Int,
237
+ Map: Map,
238
+ Nat: IDL.Nat,
239
+ Nat64: IDL.Nat64,
240
+ Blob: IDL.Vec(IDL.Nat8),
241
+ Text: IDL.Text,
242
+ Array: IDL.Vec(Value)
243
+ })
244
+ );
245
+ const Block = Value;
246
+ const GetBlocksResponse = IDL.Record({
247
+ blocks: IDL.Vec(Block),
248
+ chain_length: IDL.Nat64
249
+ });
250
+ const FeeCollectorRanges = IDL.Record({
251
+ ranges: IDL.Vec(IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex))))
252
+ });
155
253
  const ListSubaccountsArgs = IDL.Record({
156
254
  owner: IDL.Principal,
157
255
  start: IDL.Opt(SubAccount)
158
256
  });
257
+ const Status = IDL.Record({num_blocks_synced: BlockIndex});
159
258
 
160
259
  return IDL.Service({
161
- get_account_transactions: IDL.Func([GetAccountTransactionsArgs], [GetTransactionsResult], []),
260
+ get_account_transactions: IDL.Func(
261
+ [GetAccountTransactionsArgs],
262
+ [GetTransactionsResult],
263
+ ['query']
264
+ ),
265
+ get_blocks: IDL.Func([GetBlocksRequest], [GetBlocksResponse], ['query']),
266
+ get_fee_collectors_ranges: IDL.Func([], [FeeCollectorRanges], ['query']),
267
+ icrc1_balance_of: IDL.Func([Account], [Tokens], ['query']),
162
268
  ledger_id: IDL.Func([], [IDL.Principal], ['query']),
163
- list_subaccounts: IDL.Func([ListSubaccountsArgs], [IDL.Vec(SubAccount)], ['query'])
269
+ list_subaccounts: IDL.Func([ListSubaccountsArgs], [IDL.Vec(SubAccount)], ['query']),
270
+ status: IDL.Func([], [Status], ['query'])
164
271
  });
165
272
  };
166
273
 
167
274
  export const init = ({IDL}) => {
168
- const InitArgs = IDL.Record({ledger_id: IDL.Principal});
275
+ const UpgradeArg = IDL.Record({
276
+ ledger_id: IDL.Opt(IDL.Principal),
277
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64)
278
+ });
279
+ const InitArg = IDL.Record({
280
+ ledger_id: IDL.Principal,
281
+ retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64)
282
+ });
283
+ const IndexArg = IDL.Variant({Upgrade: UpgradeArg, Init: InitArg});
169
284
 
170
- return [InitArgs];
285
+ return [IDL.Opt(IndexArg)];
171
286
  };
@@ -120,6 +120,11 @@ export interface DataCertificate {
120
120
  */
121
121
  export type Duration = bigint;
122
122
  export interface FeatureFlags { 'icrc2' : boolean }
123
+ export interface FeeCollector {
124
+ 'ts' : [] | [bigint],
125
+ 'fee_collector' : [] | [Account],
126
+ 'caller' : [] | [Principal],
127
+ }
123
128
  export interface FieldsDisplay {
124
129
  'fields' : Array<[string, Icrc21Value]>,
125
130
  'intent' : string,
@@ -396,6 +401,7 @@ export interface Transaction {
396
401
  'kind' : string,
397
402
  'mint' : [] | [Mint],
398
403
  'approve' : [] | [Approve],
404
+ 'fee_collector' : [] | [FeeCollector],
399
405
  'timestamp' : Timestamp,
400
406
  'transfer' : [] | [Transfer],
401
407
  }
@@ -148,6 +148,11 @@ export const Approve = IDL.Record({
148
148
  expires_at: IDL.Opt(Timestamp),
149
149
  spender: Account
150
150
  });
151
+ export const FeeCollector = IDL.Record({
152
+ ts: IDL.Opt(IDL.Nat64),
153
+ fee_collector: IDL.Opt(Account),
154
+ caller: IDL.Opt(IDL.Principal)
155
+ });
151
156
  export const Transfer = IDL.Record({
152
157
  to: Account,
153
158
  fee: IDL.Opt(IDL.Nat),
@@ -162,6 +167,7 @@ export const Transaction = IDL.Record({
162
167
  kind: IDL.Text,
163
168
  mint: IDL.Opt(Mint),
164
169
  approve: IDL.Opt(Approve),
170
+ fee_collector: IDL.Opt(FeeCollector),
165
171
  timestamp: Timestamp,
166
172
  transfer: IDL.Opt(Transfer)
167
173
  });
@@ -567,6 +573,11 @@ export const idlFactory = ({IDL}) => {
567
573
  expires_at: IDL.Opt(Timestamp),
568
574
  spender: Account
569
575
  });
576
+ const FeeCollector = IDL.Record({
577
+ ts: IDL.Opt(IDL.Nat64),
578
+ fee_collector: IDL.Opt(Account),
579
+ caller: IDL.Opt(IDL.Principal)
580
+ });
570
581
  const Transfer = IDL.Record({
571
582
  to: Account,
572
583
  fee: IDL.Opt(IDL.Nat),
@@ -581,6 +592,7 @@ export const idlFactory = ({IDL}) => {
581
592
  kind: IDL.Text,
582
593
  mint: IDL.Opt(Mint),
583
594
  approve: IDL.Opt(Approve),
595
+ fee_collector: IDL.Opt(FeeCollector),
584
596
  timestamp: Timestamp,
585
597
  transfer: IDL.Opt(Transfer)
586
598
  });