@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.
- package/README.md +1 -1
- package/dist/candid/icrc_index-ng.certified.idl.d.ts +1 -1
- package/dist/candid/icrc_index-ng.certified.idl.js +96 -86
- package/dist/candid/icrc_index-ng.d.ts +11 -3
- package/dist/candid/icrc_index-ng.idl.d.ts +1 -1
- package/dist/candid/icrc_index-ng.idl.js +96 -86
- package/dist/candid/icrc_index.certified.idl.d.ts +1 -1
- package/dist/candid/icrc_index.certified.idl.js +68 -58
- package/dist/candid/icrc_index.d.ts +11 -3
- package/dist/candid/icrc_index.idl.d.ts +1 -1
- package/dist/candid/icrc_index.idl.js +68 -58
- package/dist/candid/icrc_ledger.certified.idl.d.ts +1 -1
- package/dist/candid/icrc_ledger.certified.idl.js +369 -367
- package/dist/candid/icrc_ledger.d.ts +11 -3
- package/dist/candid/icrc_ledger.idl.d.ts +1 -1
- package/dist/candid/icrc_ledger.idl.js +389 -383
- package/dist/{types/canister.d.ts → canister.d.ts} +2 -2
- package/dist/{types/converters → converters}/converters.d.ts +1 -1
- package/dist/{types/converters → converters}/index.converters.d.ts +2 -2
- package/dist/{types/converters → converters}/ledger.converters.d.ts +1 -1
- package/dist/{types/errors → errors}/ledger.errors.d.ts +1 -1
- package/dist/{types/index-ng.canister.d.ts → index-ng.canister.d.ts} +3 -3
- package/dist/{types/index.canister.d.ts → index.canister.d.ts} +2 -2
- package/dist/{types/index.d.ts → index.d.ts} +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +7 -0
- package/dist/{types/ledger.canister.d.ts → ledger.canister.d.ts} +2 -2
- package/dist/types/{types/canister.options.d.ts → canister.options.d.ts} +1 -1
- package/dist/types/{types/index-ng.params.d.ts → index-ng.params.d.ts} +1 -1
- package/dist/types/{types/index-ng.types.d.ts → index-ng.types.d.ts} +1 -1
- package/dist/types/{types/index.params.d.ts → index.params.d.ts} +1 -1
- package/dist/types/{types/index.types.d.ts → index.types.d.ts} +1 -1
- package/dist/types/{types/ledger.params.d.ts → ledger.params.d.ts} +1 -1
- package/dist/types/{types/ledger.responses.d.ts → ledger.responses.d.ts} +2 -2
- package/package.json +22 -11
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/index.cjs.js.map +0 -7
- package/dist/esm/canister.js +0 -2
- package/dist/esm/canister.js.map +0 -7
- package/dist/esm/chunk-BYKVMTGO.js +0 -2
- package/dist/esm/chunk-BYKVMTGO.js.map +0 -7
- package/dist/esm/chunk-F74MWPN7.js +0 -2
- package/dist/esm/chunk-F74MWPN7.js.map +0 -7
- package/dist/esm/chunk-WTMDWX2C.js +0 -2
- package/dist/esm/chunk-WTMDWX2C.js.map +0 -7
- package/dist/esm/chunk-YO5OUZGG.js +0 -2
- package/dist/esm/chunk-YO5OUZGG.js.map +0 -7
- package/dist/esm/chunk-ZMWODXAU.js +0 -2
- package/dist/esm/chunk-ZMWODXAU.js.map +0 -7
- package/dist/esm/index-ng.canister.js +0 -2
- package/dist/esm/index-ng.canister.js.map +0 -7
- package/dist/esm/index.canister.js +0 -2
- package/dist/esm/index.canister.js.map +0 -7
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/ledger.canister.js +0 -2
- package/dist/esm/ledger.canister.js.map +0 -7
- package/dist/index.cjs.js +0 -1
- /package/dist/{types/errors → errors}/index.errors.d.ts +0 -0
- /package/dist/{types/utils → utils}/ledger.utils.d.ts +0 -0
- /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 @
|
|
25
|
+
npm i @icp-sdk/core @dfinity/utils
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
## Usage
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { IDL } from "@
|
|
1
|
+
import type { IDL } from "@icp-sdk/core/candid";
|
|
2
2
|
export const idlFactory: IDL.InterfaceFactory;
|
|
@@ -1,139 +1,149 @@
|
|
|
1
|
-
/*
|
|
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
|
-
|
|
6
|
-
|
|
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
|
-
|
|
10
|
-
|
|
16
|
+
ledger_id: IDL.Principal,
|
|
17
|
+
retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
|
|
11
18
|
});
|
|
12
|
-
const IndexArg = IDL.Variant({
|
|
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
|
-
|
|
17
|
-
|
|
23
|
+
owner: IDL.Principal,
|
|
24
|
+
subaccount: IDL.Opt(SubAccount),
|
|
18
25
|
});
|
|
19
26
|
const GetAccountTransactionsArgs = IDL.Record({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
67
|
-
|
|
73
|
+
id: BlockIndex,
|
|
74
|
+
transaction: Transaction,
|
|
68
75
|
});
|
|
69
76
|
const GetTransactions = IDL.Record({
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
77
|
+
balance: Tokens,
|
|
78
|
+
transactions: IDL.Vec(TransactionWithId),
|
|
79
|
+
oldest_tx_id: IDL.Opt(BlockIndex),
|
|
73
80
|
});
|
|
74
|
-
const GetTransactionsErr = IDL.Record({
|
|
81
|
+
const GetTransactionsErr = IDL.Record({ message: IDL.Text });
|
|
75
82
|
const GetTransactionsResult = IDL.Variant({
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
Ok: GetTransactions,
|
|
84
|
+
Err: GetTransactionsErr,
|
|
78
85
|
});
|
|
79
86
|
const GetBlocksRequest = IDL.Record({
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
98
|
-
|
|
104
|
+
blocks: IDL.Vec(Block),
|
|
105
|
+
chain_length: IDL.Nat64,
|
|
99
106
|
});
|
|
100
107
|
const FeeCollectorRanges = IDL.Record({
|
|
101
|
-
|
|
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
|
-
|
|
107
|
-
|
|
113
|
+
owner: IDL.Principal,
|
|
114
|
+
start: IDL.Opt(SubAccount),
|
|
108
115
|
});
|
|
109
|
-
const Status = IDL.Record({
|
|
116
|
+
const Status = IDL.Record({ num_blocks_synced: BlockIndex });
|
|
117
|
+
|
|
110
118
|
return IDL.Service({
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
131
|
-
|
|
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
|
-
|
|
135
|
-
|
|
143
|
+
ledger_id: IDL.Principal,
|
|
144
|
+
retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
|
|
136
145
|
});
|
|
137
|
-
const IndexArg = IDL.Variant({
|
|
146
|
+
const IndexArg = IDL.Variant({ Upgrade: UpgradeArg, Init: InitArg });
|
|
147
|
+
|
|
138
148
|
return [IDL.Opt(IndexArg)];
|
|
139
149
|
};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 "@
|
|
1
|
+
import type { IDL } from "@icp-sdk/core/candid";
|
|
2
2
|
export const idlFactory: IDL.InterfaceFactory;
|
|
@@ -1,139 +1,149 @@
|
|
|
1
|
-
/*
|
|
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
|
-
|
|
6
|
-
|
|
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
|
-
|
|
10
|
-
|
|
16
|
+
ledger_id: IDL.Principal,
|
|
17
|
+
retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
|
|
11
18
|
});
|
|
12
|
-
const IndexArg = IDL.Variant({
|
|
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
|
-
|
|
17
|
-
|
|
23
|
+
owner: IDL.Principal,
|
|
24
|
+
subaccount: IDL.Opt(SubAccount),
|
|
18
25
|
});
|
|
19
26
|
const GetAccountTransactionsArgs = IDL.Record({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
67
|
-
|
|
73
|
+
id: BlockIndex,
|
|
74
|
+
transaction: Transaction,
|
|
68
75
|
});
|
|
69
76
|
const GetTransactions = IDL.Record({
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
77
|
+
balance: Tokens,
|
|
78
|
+
transactions: IDL.Vec(TransactionWithId),
|
|
79
|
+
oldest_tx_id: IDL.Opt(BlockIndex),
|
|
73
80
|
});
|
|
74
|
-
const GetTransactionsErr = IDL.Record({
|
|
81
|
+
const GetTransactionsErr = IDL.Record({ message: IDL.Text });
|
|
75
82
|
const GetTransactionsResult = IDL.Variant({
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
Ok: GetTransactions,
|
|
84
|
+
Err: GetTransactionsErr,
|
|
78
85
|
});
|
|
79
86
|
const GetBlocksRequest = IDL.Record({
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
98
|
-
|
|
104
|
+
blocks: IDL.Vec(Block),
|
|
105
|
+
chain_length: IDL.Nat64,
|
|
99
106
|
});
|
|
100
107
|
const FeeCollectorRanges = IDL.Record({
|
|
101
|
-
|
|
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
|
-
|
|
107
|
-
|
|
113
|
+
owner: IDL.Principal,
|
|
114
|
+
start: IDL.Opt(SubAccount),
|
|
108
115
|
});
|
|
109
|
-
const Status = IDL.Record({
|
|
116
|
+
const Status = IDL.Record({ num_blocks_synced: BlockIndex });
|
|
117
|
+
|
|
110
118
|
return IDL.Service({
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
131
|
-
|
|
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
|
-
|
|
135
|
-
|
|
143
|
+
ledger_id: IDL.Principal,
|
|
144
|
+
retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64),
|
|
136
145
|
});
|
|
137
|
-
const IndexArg = IDL.Variant({
|
|
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 "@
|
|
1
|
+
import type { IDL } from "@icp-sdk/core/candid";
|
|
2
2
|
export const idlFactory: IDL.InterfaceFactory;
|