@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.
- package/canisters/ckbtc/index.js +1 -1
- package/canisters/cketh/index.js +1 -1
- package/canisters/cmc/index.js +1 -1
- package/canisters/declarations/_idl.d.ts +5 -5
- package/canisters/declarations/_types.d.ts +5 -5
- package/canisters/declarations/ckbtc/bitcoin.did.d.ts +2 -0
- package/canisters/declarations/ckbtc/bitcoin.did.idl.d.ts +3 -2
- package/canisters/declarations/ckbtc/minter.did.d.ts +4 -0
- package/canisters/declarations/ckbtc/minter.did.idl.d.ts +1 -0
- package/canisters/declarations/cmc/cmc.did.idl.d.ts +1 -1
- package/canisters/declarations/ic-management/ic-management.did.d.ts +2 -0
- package/canisters/declarations/ledger-icrc/icrc_icrc-1.did.d.ts +70 -0
- package/canisters/declarations/ledger-icrc/icrc_icrc-1.did.idl.d.ts +26 -0
- package/canisters/declarations/ledger-icrc/icrc_icrc-10.did.d.ts +21 -0
- package/canisters/declarations/ledger-icrc/icrc_icrc-10.did.idl.d.ts +13 -0
- package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +69 -17
- package/canisters/declarations/ledger-icrc/icrc_index.did.idl.d.ts +21 -4
- package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +6 -0
- package/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.d.ts +1 -0
- package/canisters/declarations/nns/governance.did.d.ts +54 -30
- package/canisters/declarations/nns/governance.did.idl.d.ts +6 -3
- package/canisters/declarations/nns/governance_test.did.d.ts +54 -30
- package/canisters/declarations/nns/governance_test.did.idl.d.ts +6 -3
- package/{src/canisters/declarations/sns/sns_root.did.d.ts → canisters/declarations/sns/root.did.d.ts} +12 -0
- package/canisters/declarations/sns/{sns_root.did.idl.d.ts → root.did.idl.d.ts} +5 -1
- package/canisters/ic-management/index.js +1 -1
- package/canisters/ledger/icp/index.js +1 -1
- package/canisters/ledger/icrc/index.d.ts +1 -1
- package/canisters/ledger/icrc/index.js +1 -1
- package/canisters/ledger/icrc/schemas.d.ts +1 -1
- package/canisters/nns/index.js +1 -1
- package/canisters/schemas.d.ts +1 -1
- package/canisters/sns/index.js +1 -1
- package/chunk-CAQXR2VB.js +2 -0
- package/chunk-CAQXR2VB.js.map +7 -0
- package/package.json +5 -5
- package/schemas/satellite.d.ts +1 -1
- package/sdk/schemas/controllers.d.ts +1 -1
- package/sdk/schemas/db.d.ts +6 -6
- package/sdk/schemas/params.d.ts +1 -1
- package/sdk/schemas/storage.d.ts +6 -6
- package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +2 -0
- package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +44 -22
- package/src/canisters/declarations/ckbtc/minter.did.d.ts +4 -0
- package/src/canisters/declarations/ckbtc/minter.did.idl.js +14 -0
- package/src/canisters/declarations/ic-management/ic-management.did.d.ts +2 -0
- package/src/canisters/declarations/ic-management/ic-management.did.idl.js +6 -2
- package/src/canisters/declarations/ledger-icrc/icrc_icrc-1.did.d.ts +70 -0
- package/src/canisters/declarations/ledger-icrc/icrc_icrc-1.did.idl.js +116 -0
- package/src/canisters/declarations/ledger-icrc/icrc_icrc-10.did.d.ts +21 -0
- package/src/canisters/declarations/ledger-icrc/icrc_icrc-10.did.idl.js +34 -0
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +69 -17
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +150 -35
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +6 -0
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +12 -0
- package/src/canisters/declarations/nns/governance.did.d.ts +54 -30
- package/src/canisters/declarations/nns/governance.did.idl.js +87 -17
- package/src/canisters/declarations/nns/governance_test.did.d.ts +54 -30
- package/src/canisters/declarations/nns/governance_test.did.idl.js +87 -17
- package/{canisters/declarations/sns/sns_root.did.d.ts → src/canisters/declarations/sns/root.did.d.ts} +12 -0
- package/src/canisters/declarations/sns/{sns_root.did.idl.js → root.did.idl.js} +38 -8
- package/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +0 -148
- package/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.d.ts +0 -44
- package/chunk-HANEPD6T.js +0 -2
- package/chunk-HANEPD6T.js.map +0 -7
- package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +0 -148
- package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.js +0 -274
- /package/canisters/declarations/sns/{sns_governance.did.d.ts → governance.did.d.ts} +0 -0
- /package/canisters/declarations/sns/{sns_governance.did.idl.d.ts → governance.did.idl.d.ts} +0 -0
- /package/canisters/declarations/sns/{sns_governance_test.did.d.ts → governance_test.did.d.ts} +0 -0
- /package/canisters/declarations/sns/{sns_governance_test.did.idl.d.ts → governance_test.did.idl.d.ts} +0 -0
- /package/canisters/declarations/sns/{sns_swap.did.d.ts → swap.did.d.ts} +0 -0
- /package/canisters/declarations/sns/{sns_swap.did.idl.d.ts → swap.did.idl.d.ts} +0 -0
- /package/src/canisters/declarations/sns/{sns_governance.did.d.ts → governance.did.d.ts} +0 -0
- /package/src/canisters/declarations/sns/{sns_governance.did.idl.js → governance.did.idl.js} +0 -0
- /package/src/canisters/declarations/sns/{sns_governance_test.did.d.ts → governance_test.did.d.ts} +0 -0
- /package/src/canisters/declarations/sns/{sns_governance_test.did.idl.js → governance_test.did.idl.js} +0 -0
- /package/src/canisters/declarations/sns/{sns_swap.did.d.ts → swap.did.d.ts} +0 -0
- /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' : [] | [
|
|
15
|
+
'subaccount' : [] | [SubAccount],
|
|
16
16
|
}
|
|
17
17
|
export interface Approve {
|
|
18
|
-
'fee' : [] | [
|
|
18
|
+
'fee' : [] | [Tokens],
|
|
19
19
|
'from' : Account,
|
|
20
20
|
'memo' : [] | [Uint8Array],
|
|
21
21
|
'created_at_time' : [] | [bigint],
|
|
22
|
-
'amount' :
|
|
23
|
-
'expected_allowance' : [] | [
|
|
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' :
|
|
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' : [] | [
|
|
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' : [] | [
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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' :
|
|
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 {
|
|
110
|
+
export interface TransactionWithId {
|
|
111
|
+
'id' : BlockIndex,
|
|
112
|
+
'transaction' : Transaction,
|
|
113
|
+
}
|
|
81
114
|
export interface Transfer {
|
|
82
115
|
'to' : Account,
|
|
83
|
-
'fee' : [] | [
|
|
116
|
+
'fee' : [] | [Tokens],
|
|
84
117
|
'from' : Account,
|
|
85
118
|
'memo' : [] | [Uint8Array],
|
|
86
119
|
'created_at_time' : [] | [bigint],
|
|
87
|
-
'amount' :
|
|
120
|
+
'amount' : Tokens,
|
|
88
121
|
'spender' : [] | [Account],
|
|
89
122
|
}
|
|
90
|
-
export
|
|
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
|
|
12
|
-
export const
|
|
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(
|
|
28
|
+
subaccount: IDL.Opt(SubAccount)
|
|
16
29
|
});
|
|
17
30
|
export const GetAccountTransactionsArgs = IDL.Record({
|
|
18
31
|
max_results: IDL.Nat,
|
|
19
|
-
start: IDL.Opt(
|
|
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:
|
|
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:
|
|
49
|
+
amount: Tokens
|
|
34
50
|
});
|
|
35
51
|
export const Approve = IDL.Record({
|
|
36
|
-
fee: IDL.Opt(
|
|
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:
|
|
41
|
-
expected_allowance: IDL.Opt(
|
|
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(
|
|
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:
|
|
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:
|
|
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(
|
|
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
|
|
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(
|
|
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 = [
|
|
142
|
+
export const idlInitArgs = [IDL.Opt(IndexArg)];
|
|
88
143
|
|
|
89
144
|
export const idlFactory = ({IDL}) => {
|
|
90
|
-
const
|
|
91
|
-
const
|
|
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(
|
|
159
|
+
subaccount: IDL.Opt(SubAccount)
|
|
95
160
|
});
|
|
96
161
|
const GetAccountTransactionsArgs = IDL.Record({
|
|
97
162
|
max_results: IDL.Nat,
|
|
98
|
-
start: IDL.Opt(
|
|
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:
|
|
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:
|
|
180
|
+
amount: Tokens
|
|
113
181
|
});
|
|
114
182
|
const Approve = IDL.Record({
|
|
115
|
-
fee: IDL.Opt(
|
|
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:
|
|
120
|
-
expected_allowance: IDL.Opt(
|
|
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(
|
|
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:
|
|
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:
|
|
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(
|
|
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
|
|
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(
|
|
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
|
|
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 [
|
|
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
|
});
|