@junobuild/functions 0.4.1 → 0.5.0
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/_canister.d.ts +17 -0
- package/canisters/_constants.d.ts +3 -0
- package/canisters/ckbtc/index.d.ts +1 -0
- package/canisters/ckbtc/index.js +2 -0
- package/canisters/cketh/index.d.ts +1 -0
- package/canisters/cketh/index.js +2 -0
- package/canisters/cketh/index.js.map +7 -0
- package/canisters/cmc/cmc.canister.d.ts +28 -0
- package/canisters/cmc/index.d.ts +2 -0
- package/canisters/cmc/index.js +2 -0
- package/canisters/cmc/index.js.map +7 -0
- package/canisters/declarations/_idl.d.ts +16 -0
- package/canisters/declarations/_types.d.ts +16 -0
- package/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
- package/canisters/declarations/ckbtc/bitcoin.did.idl.d.ts +40 -0
- package/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
- package/canisters/declarations/ckbtc/minter.did.idl.d.ts +61 -0
- package/canisters/declarations/cketh/minter.did.d.ts +893 -0
- package/canisters/declarations/cketh/minter.did.idl.d.ts +58 -0
- package/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
- package/canisters/declarations/cketh/orchestrator.did.idl.d.ts +34 -0
- package/canisters/declarations/cmc/cmc.did.d.ts +344 -0
- package/canisters/declarations/cmc/cmc.did.idl.d.ts +53 -0
- package/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
- package/canisters/declarations/ic-management/ic-management.did.idl.d.ts +147 -0
- package/canisters/declarations/index.d.ts +2 -0
- package/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
- package/canisters/declarations/ledger-icp/index.did.idl.d.ts +35 -0
- package/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
- package/canisters/declarations/ledger-icp/ledger.did.idl.d.ts +106 -0
- package/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
- package/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.d.ts +44 -0
- package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
- package/canisters/declarations/ledger-icrc/icrc_index.did.idl.d.ts +28 -0
- package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
- package/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.d.ts +100 -0
- package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
- package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.d.ts +39 -0
- package/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
- package/canisters/declarations/nns/genesis_token.did.idl.d.ts +24 -0
- package/canisters/declarations/nns/governance.did.d.ts +1254 -0
- package/canisters/declarations/nns/governance.did.idl.d.ts +217 -0
- package/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
- package/canisters/declarations/nns/governance_test.did.idl.d.ts +218 -0
- package/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
- package/canisters/declarations/nns/sns_wasm.did.idl.d.ts +80 -0
- package/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
- package/canisters/declarations/sns/sns_governance.did.idl.d.ts +189 -0
- package/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
- package/canisters/declarations/sns/sns_governance_test.did.idl.d.ts +199 -0
- package/canisters/declarations/sns/sns_root.did.d.ts +204 -0
- package/canisters/declarations/sns/sns_root.did.idl.d.ts +53 -0
- package/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
- package/canisters/declarations/sns/sns_swap.did.idl.d.ts +108 -0
- package/canisters/ic-management/index.d.ts +1 -0
- package/canisters/ic-management/index.js +2 -0
- package/canisters/ic-management/index.js.map +7 -0
- package/canisters/index.d.ts +1 -0
- package/canisters/index.js +2 -0
- package/canisters/index.js.map +7 -0
- package/canisters/ledger/icp/index.d.ts +2 -0
- package/canisters/ledger/icp/index.js +2 -0
- package/canisters/ledger/icp/index.js.map +7 -0
- package/canisters/ledger/icp/ledger.canister.d.ts +24 -0
- package/canisters/ledger/icrc/index.d.ts +3 -0
- package/canisters/ledger/icrc/index.js +2 -0
- package/canisters/ledger/icrc/index.js.map +7 -0
- package/canisters/ledger/icrc/ledger.canister.d.ts +45 -0
- package/canisters/ledger/icrc/schemas.d.ts +11 -0
- package/canisters/nns/index.d.ts +1 -0
- package/canisters/nns/index.js +2 -0
- package/canisters/nns/index.js.map +7 -0
- package/canisters/schemas.d.ts +11 -0
- package/canisters/sns/index.d.ts +1 -0
- package/canisters/sns/index.js +2 -0
- package/canisters/sns/index.js.map +7 -0
- package/chunk-4C666HHU.js +2 -0
- package/chunk-4C666HHU.js.map +7 -0
- package/chunk-5NZMOUKF.js +2 -0
- package/chunk-5NZMOUKF.js.map +7 -0
- package/chunk-BXZ5PSUW.js +2 -0
- package/chunk-BXZ5PSUW.js.map +7 -0
- package/chunk-EMQQE34V.js +2 -0
- package/chunk-EMQQE34V.js.map +7 -0
- package/chunk-HANEPD6T.js +2 -0
- package/chunk-HANEPD6T.js.map +7 -0
- package/chunk-TZVF5LQY.js +2 -0
- package/chunk-TZVF5LQY.js.map +7 -0
- package/ic-cdk.js +1 -1
- package/ic-cdk.js.map +4 -4
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +39 -2
- package/sdk.js +1 -1
- package/sdk.js.map +1 -1
- package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
- package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +302 -0
- package/src/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
- package/src/canisters/declarations/ckbtc/minter.did.idl.js +893 -0
- package/src/canisters/declarations/cketh/minter.did.d.ts +893 -0
- package/src/canisters/declarations/cketh/minter.did.idl.js +878 -0
- package/src/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
- package/src/canisters/declarations/cketh/orchestrator.did.idl.js +343 -0
- package/src/canisters/declarations/cmc/cmc.did.d.ts +344 -0
- package/src/canisters/declarations/cmc/cmc.did.idl.js +338 -0
- package/src/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
- package/src/canisters/declarations/ic-management/ic-management.did.idl.js +1150 -0
- package/src/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
- package/src/canisters/declarations/ledger-icp/index.did.idl.js +225 -0
- package/src/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
- package/src/canisters/declarations/ledger-icp/ledger.did.idl.js +813 -0
- package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
- package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.js +274 -0
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +171 -0
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +923 -0
- package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
- package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.js +163 -0
- package/src/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
- package/src/canisters/declarations/nns/genesis_token.did.idl.js +84 -0
- package/src/canisters/declarations/nns/governance.did.d.ts +1254 -0
- package/src/canisters/declarations/nns/governance.did.idl.js +2756 -0
- package/src/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
- package/src/canisters/declarations/nns/governance_test.did.idl.js +2758 -0
- package/src/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
- package/src/canisters/declarations/nns/sns_wasm.did.idl.js +589 -0
- package/src/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
- package/src/canisters/declarations/sns/sns_governance.did.idl.js +2235 -0
- package/src/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
- package/src/canisters/declarations/sns/sns_governance_test.did.idl.js +2283 -0
- package/src/canisters/declarations/sns/sns_root.did.d.ts +204 -0
- package/src/canisters/declarations/sns/sns_root.did.idl.js +433 -0
- package/src/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
- package/src/canisters/declarations/sns/sns_swap.did.idl.js +858 -0
- package/global.d.js +0 -1
- /package/{global.d.js.map → canisters/ckbtc/index.js.map} +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// This file was automatically generated by @icp-sdk/bindgen@0.2.0.
|
|
6
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
7
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
8
|
+
|
|
9
|
+
import type { ActorMethod } from '@icp-sdk/core/agent';
|
|
10
|
+
import type { IDL } from '@icp-sdk/core/candid';
|
|
11
|
+
import type { Principal } from '@icp-sdk/core/principal';
|
|
12
|
+
|
|
13
|
+
export interface Account {
|
|
14
|
+
'owner' : Principal,
|
|
15
|
+
'subaccount' : [] | [SubAccount],
|
|
16
|
+
}
|
|
17
|
+
export interface Approve {
|
|
18
|
+
'fee' : [] | [Tokens],
|
|
19
|
+
'from' : Account,
|
|
20
|
+
'memo' : [] | [Uint8Array],
|
|
21
|
+
'created_at_time' : [] | [bigint],
|
|
22
|
+
'amount' : Tokens,
|
|
23
|
+
'expected_allowance' : [] | [Tokens],
|
|
24
|
+
'expires_at' : [] | [bigint],
|
|
25
|
+
'spender' : Account,
|
|
26
|
+
}
|
|
27
|
+
export type Block = Value;
|
|
28
|
+
export type BlockIndex = bigint;
|
|
29
|
+
export interface Burn {
|
|
30
|
+
'fee' : [] | [bigint],
|
|
31
|
+
'from' : Account,
|
|
32
|
+
'memo' : [] | [Uint8Array],
|
|
33
|
+
'created_at_time' : [] | [bigint],
|
|
34
|
+
'amount' : Tokens,
|
|
35
|
+
'spender' : [] | [Account],
|
|
36
|
+
}
|
|
37
|
+
export interface FeeCollectorRanges {
|
|
38
|
+
'ranges' : Array<[Account, Array<[BlockIndex, BlockIndex]>]>,
|
|
39
|
+
}
|
|
40
|
+
export interface GetAccountTransactionsArgs {
|
|
41
|
+
/**
|
|
42
|
+
* Maximum number of transactions to fetch.
|
|
43
|
+
*/
|
|
44
|
+
'max_results' : bigint,
|
|
45
|
+
/**
|
|
46
|
+
* The txid of the last transaction seen by the client.
|
|
47
|
+
* If None then the results will start from the most recent
|
|
48
|
+
* txid. If set then the results will start from the next
|
|
49
|
+
* most recent txid after start (start won't be included).
|
|
50
|
+
*/
|
|
51
|
+
'start' : [] | [BlockIndex],
|
|
52
|
+
'account' : Account,
|
|
53
|
+
}
|
|
54
|
+
export interface GetBlocksRequest { 'start' : bigint, 'length' : bigint }
|
|
55
|
+
export interface GetBlocksResponse {
|
|
56
|
+
'blocks' : Array<Block>,
|
|
57
|
+
'chain_length' : bigint,
|
|
58
|
+
}
|
|
59
|
+
export interface GetTransactions {
|
|
60
|
+
'balance' : Tokens,
|
|
61
|
+
'transactions' : Array<TransactionWithId>,
|
|
62
|
+
/**
|
|
63
|
+
* The txid of the oldest transaction the account has
|
|
64
|
+
*/
|
|
65
|
+
'oldest_tx_id' : [] | [BlockIndex],
|
|
66
|
+
}
|
|
67
|
+
export interface GetTransactionsErr { 'message' : string }
|
|
68
|
+
export type GetTransactionsResult = { 'Ok' : GetTransactions } |
|
|
69
|
+
{ 'Err' : GetTransactionsErr };
|
|
70
|
+
export type IndexArg = { 'Upgrade' : UpgradeArg } |
|
|
71
|
+
{ 'Init' : InitArg };
|
|
72
|
+
export interface InitArg {
|
|
73
|
+
'ledger_id' : Principal,
|
|
74
|
+
/**
|
|
75
|
+
* The interval in seconds in which to retrieve blocks from the ledger. A lower value makes the index more
|
|
76
|
+
* responsive in showing new blocks, but increases the consumption of cycles of both the index and ledger canisters.
|
|
77
|
+
* A higher values means that it takes longer for new blocks to show up in the index.
|
|
78
|
+
*/
|
|
79
|
+
'retrieve_blocks_from_ledger_interval_seconds' : [] | [bigint],
|
|
80
|
+
}
|
|
81
|
+
export interface ListSubaccountsArgs {
|
|
82
|
+
'owner' : Principal,
|
|
83
|
+
'start' : [] | [SubAccount],
|
|
84
|
+
}
|
|
85
|
+
export type Map = Array<[string, Value]>;
|
|
86
|
+
export interface Mint {
|
|
87
|
+
'to' : Account,
|
|
88
|
+
'fee' : [] | [bigint],
|
|
89
|
+
'memo' : [] | [Uint8Array],
|
|
90
|
+
'created_at_time' : [] | [bigint],
|
|
91
|
+
'amount' : Tokens,
|
|
92
|
+
}
|
|
93
|
+
export interface Status { 'num_blocks_synced' : BlockIndex }
|
|
94
|
+
export type SubAccount = Uint8Array;
|
|
95
|
+
export type Tokens = bigint;
|
|
96
|
+
export interface Transaction {
|
|
97
|
+
'burn' : [] | [Burn],
|
|
98
|
+
'kind' : string,
|
|
99
|
+
'mint' : [] | [Mint],
|
|
100
|
+
'approve' : [] | [Approve],
|
|
101
|
+
'timestamp' : bigint,
|
|
102
|
+
'transfer' : [] | [Transfer],
|
|
103
|
+
}
|
|
104
|
+
export interface TransactionWithId {
|
|
105
|
+
'id' : BlockIndex,
|
|
106
|
+
'transaction' : Transaction,
|
|
107
|
+
}
|
|
108
|
+
export interface Transfer {
|
|
109
|
+
'to' : Account,
|
|
110
|
+
'fee' : [] | [Tokens],
|
|
111
|
+
'from' : Account,
|
|
112
|
+
'memo' : [] | [Uint8Array],
|
|
113
|
+
'created_at_time' : [] | [bigint],
|
|
114
|
+
'amount' : Tokens,
|
|
115
|
+
'spender' : [] | [Account],
|
|
116
|
+
}
|
|
117
|
+
export interface UpgradeArg {
|
|
118
|
+
'ledger_id' : [] | [Principal],
|
|
119
|
+
/**
|
|
120
|
+
* The interval in seconds in which to retrieve blocks from the ledger. A lower value makes the index more
|
|
121
|
+
* responsive in showing new blocks, but increases the consumption of cycles of both the index and ledger canisters.
|
|
122
|
+
* A higher values means that it takes longer for new blocks to show up in the index.
|
|
123
|
+
*/
|
|
124
|
+
'retrieve_blocks_from_ledger_interval_seconds' : [] | [bigint],
|
|
125
|
+
}
|
|
126
|
+
export type Value = { 'Int' : bigint } |
|
|
127
|
+
{ 'Map' : Map } |
|
|
128
|
+
{ 'Nat' : bigint } |
|
|
129
|
+
{ 'Nat64' : bigint } |
|
|
130
|
+
{ 'Blob' : Uint8Array } |
|
|
131
|
+
{ 'Text' : string } |
|
|
132
|
+
{ 'Array' : Array<Value> };
|
|
133
|
+
export interface _SERVICE {
|
|
134
|
+
'get_account_transactions' : ActorMethod<
|
|
135
|
+
[GetAccountTransactionsArgs],
|
|
136
|
+
GetTransactionsResult
|
|
137
|
+
>,
|
|
138
|
+
'get_blocks' : ActorMethod<[GetBlocksRequest], GetBlocksResponse>,
|
|
139
|
+
'get_fee_collectors_ranges' : ActorMethod<[], FeeCollectorRanges>,
|
|
140
|
+
'icrc1_balance_of' : ActorMethod<[Account], Tokens>,
|
|
141
|
+
'ledger_id' : ActorMethod<[], Principal>,
|
|
142
|
+
'list_subaccounts' : ActorMethod<[ListSubaccountsArgs], Array<SubAccount>>,
|
|
143
|
+
'status' : ActorMethod<[], Status>,
|
|
144
|
+
}
|
|
145
|
+
export declare const idlService: IDL.ServiceClass;
|
|
146
|
+
export declare const idlInitArgs: IDL.Type[];
|
|
147
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
148
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// This file was automatically generated by @icp-sdk/bindgen@0.2.0.
|
|
6
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
7
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
8
|
+
|
|
9
|
+
import {IDL} from '@icp-sdk/core/candid';
|
|
10
|
+
|
|
11
|
+
export const 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);
|
|
26
|
+
export const Account = IDL.Record({
|
|
27
|
+
owner: IDL.Principal,
|
|
28
|
+
subaccount: IDL.Opt(SubAccount)
|
|
29
|
+
});
|
|
30
|
+
export const GetAccountTransactionsArgs = IDL.Record({
|
|
31
|
+
max_results: IDL.Nat,
|
|
32
|
+
start: IDL.Opt(BlockIndex),
|
|
33
|
+
account: Account
|
|
34
|
+
});
|
|
35
|
+
export const Tokens = IDL.Nat;
|
|
36
|
+
export const Burn = IDL.Record({
|
|
37
|
+
fee: IDL.Opt(IDL.Nat),
|
|
38
|
+
from: Account,
|
|
39
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
40
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
41
|
+
amount: Tokens,
|
|
42
|
+
spender: IDL.Opt(Account)
|
|
43
|
+
});
|
|
44
|
+
export const Mint = IDL.Record({
|
|
45
|
+
to: Account,
|
|
46
|
+
fee: IDL.Opt(IDL.Nat),
|
|
47
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
48
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
49
|
+
amount: Tokens
|
|
50
|
+
});
|
|
51
|
+
export const Approve = IDL.Record({
|
|
52
|
+
fee: IDL.Opt(Tokens),
|
|
53
|
+
from: Account,
|
|
54
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
55
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
56
|
+
amount: Tokens,
|
|
57
|
+
expected_allowance: IDL.Opt(Tokens),
|
|
58
|
+
expires_at: IDL.Opt(IDL.Nat64),
|
|
59
|
+
spender: Account
|
|
60
|
+
});
|
|
61
|
+
export const Transfer = IDL.Record({
|
|
62
|
+
to: Account,
|
|
63
|
+
fee: IDL.Opt(Tokens),
|
|
64
|
+
from: Account,
|
|
65
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
66
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
67
|
+
amount: Tokens,
|
|
68
|
+
spender: IDL.Opt(Account)
|
|
69
|
+
});
|
|
70
|
+
export const Transaction = IDL.Record({
|
|
71
|
+
burn: IDL.Opt(Burn),
|
|
72
|
+
kind: IDL.Text,
|
|
73
|
+
mint: IDL.Opt(Mint),
|
|
74
|
+
approve: IDL.Opt(Approve),
|
|
75
|
+
timestamp: IDL.Nat64,
|
|
76
|
+
transfer: IDL.Opt(Transfer)
|
|
77
|
+
});
|
|
78
|
+
export const TransactionWithId = IDL.Record({
|
|
79
|
+
id: BlockIndex,
|
|
80
|
+
transaction: Transaction
|
|
81
|
+
});
|
|
82
|
+
export const GetTransactions = IDL.Record({
|
|
83
|
+
balance: Tokens,
|
|
84
|
+
transactions: IDL.Vec(TransactionWithId),
|
|
85
|
+
oldest_tx_id: IDL.Opt(BlockIndex)
|
|
86
|
+
});
|
|
87
|
+
export const GetTransactionsErr = IDL.Record({message: IDL.Text});
|
|
88
|
+
export const GetTransactionsResult = IDL.Variant({
|
|
89
|
+
Ok: GetTransactions,
|
|
90
|
+
Err: GetTransactionsErr
|
|
91
|
+
});
|
|
92
|
+
export const GetBlocksRequest = IDL.Record({
|
|
93
|
+
start: IDL.Nat,
|
|
94
|
+
length: IDL.Nat
|
|
95
|
+
});
|
|
96
|
+
export const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));
|
|
97
|
+
Value.fill(
|
|
98
|
+
IDL.Variant({
|
|
99
|
+
Int: IDL.Int,
|
|
100
|
+
Map: Map,
|
|
101
|
+
Nat: IDL.Nat,
|
|
102
|
+
Nat64: IDL.Nat64,
|
|
103
|
+
Blob: IDL.Vec(IDL.Nat8),
|
|
104
|
+
Text: IDL.Text,
|
|
105
|
+
Array: IDL.Vec(Value)
|
|
106
|
+
})
|
|
107
|
+
);
|
|
108
|
+
export const Block = Value;
|
|
109
|
+
export const GetBlocksResponse = IDL.Record({
|
|
110
|
+
blocks: IDL.Vec(Block),
|
|
111
|
+
chain_length: IDL.Nat64
|
|
112
|
+
});
|
|
113
|
+
export const FeeCollectorRanges = IDL.Record({
|
|
114
|
+
ranges: IDL.Vec(IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex))))
|
|
115
|
+
});
|
|
116
|
+
export const ListSubaccountsArgs = IDL.Record({
|
|
117
|
+
owner: IDL.Principal,
|
|
118
|
+
start: IDL.Opt(SubAccount)
|
|
119
|
+
});
|
|
120
|
+
export const Status = IDL.Record({num_blocks_synced: BlockIndex});
|
|
121
|
+
|
|
122
|
+
export const idlService = IDL.Service({
|
|
123
|
+
get_account_transactions: IDL.Func(
|
|
124
|
+
[GetAccountTransactionsArgs],
|
|
125
|
+
[GetTransactionsResult],
|
|
126
|
+
['query']
|
|
127
|
+
),
|
|
128
|
+
get_blocks: IDL.Func([GetBlocksRequest], [GetBlocksResponse], ['query']),
|
|
129
|
+
get_fee_collectors_ranges: IDL.Func([], [FeeCollectorRanges], ['query']),
|
|
130
|
+
icrc1_balance_of: IDL.Func([Account], [Tokens], ['query']),
|
|
131
|
+
ledger_id: IDL.Func([], [IDL.Principal], ['query']),
|
|
132
|
+
list_subaccounts: IDL.Func([ListSubaccountsArgs], [IDL.Vec(SubAccount)], ['query']),
|
|
133
|
+
status: IDL.Func([], [Status], ['query'])
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export const idlInitArgs = [IDL.Opt(IndexArg)];
|
|
137
|
+
|
|
138
|
+
export const idlFactory = ({IDL}) => {
|
|
139
|
+
const Value = IDL.Rec();
|
|
140
|
+
const UpgradeArg = IDL.Record({
|
|
141
|
+
ledger_id: IDL.Opt(IDL.Principal),
|
|
142
|
+
retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64)
|
|
143
|
+
});
|
|
144
|
+
const InitArg = IDL.Record({
|
|
145
|
+
ledger_id: IDL.Principal,
|
|
146
|
+
retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64)
|
|
147
|
+
});
|
|
148
|
+
const IndexArg = IDL.Variant({Upgrade: UpgradeArg, Init: InitArg});
|
|
149
|
+
const BlockIndex = IDL.Nat;
|
|
150
|
+
const SubAccount = IDL.Vec(IDL.Nat8);
|
|
151
|
+
const Account = IDL.Record({
|
|
152
|
+
owner: IDL.Principal,
|
|
153
|
+
subaccount: IDL.Opt(SubAccount)
|
|
154
|
+
});
|
|
155
|
+
const GetAccountTransactionsArgs = IDL.Record({
|
|
156
|
+
max_results: IDL.Nat,
|
|
157
|
+
start: IDL.Opt(BlockIndex),
|
|
158
|
+
account: Account
|
|
159
|
+
});
|
|
160
|
+
const Tokens = IDL.Nat;
|
|
161
|
+
const Burn = IDL.Record({
|
|
162
|
+
fee: IDL.Opt(IDL.Nat),
|
|
163
|
+
from: Account,
|
|
164
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
165
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
166
|
+
amount: Tokens,
|
|
167
|
+
spender: IDL.Opt(Account)
|
|
168
|
+
});
|
|
169
|
+
const Mint = IDL.Record({
|
|
170
|
+
to: Account,
|
|
171
|
+
fee: IDL.Opt(IDL.Nat),
|
|
172
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
173
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
174
|
+
amount: Tokens
|
|
175
|
+
});
|
|
176
|
+
const Approve = IDL.Record({
|
|
177
|
+
fee: IDL.Opt(Tokens),
|
|
178
|
+
from: Account,
|
|
179
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
180
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
181
|
+
amount: Tokens,
|
|
182
|
+
expected_allowance: IDL.Opt(Tokens),
|
|
183
|
+
expires_at: IDL.Opt(IDL.Nat64),
|
|
184
|
+
spender: Account
|
|
185
|
+
});
|
|
186
|
+
const Transfer = IDL.Record({
|
|
187
|
+
to: Account,
|
|
188
|
+
fee: IDL.Opt(Tokens),
|
|
189
|
+
from: Account,
|
|
190
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
191
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
192
|
+
amount: Tokens,
|
|
193
|
+
spender: IDL.Opt(Account)
|
|
194
|
+
});
|
|
195
|
+
const Transaction = IDL.Record({
|
|
196
|
+
burn: IDL.Opt(Burn),
|
|
197
|
+
kind: IDL.Text,
|
|
198
|
+
mint: IDL.Opt(Mint),
|
|
199
|
+
approve: IDL.Opt(Approve),
|
|
200
|
+
timestamp: IDL.Nat64,
|
|
201
|
+
transfer: IDL.Opt(Transfer)
|
|
202
|
+
});
|
|
203
|
+
const TransactionWithId = IDL.Record({
|
|
204
|
+
id: BlockIndex,
|
|
205
|
+
transaction: Transaction
|
|
206
|
+
});
|
|
207
|
+
const GetTransactions = IDL.Record({
|
|
208
|
+
balance: Tokens,
|
|
209
|
+
transactions: IDL.Vec(TransactionWithId),
|
|
210
|
+
oldest_tx_id: IDL.Opt(BlockIndex)
|
|
211
|
+
});
|
|
212
|
+
const GetTransactionsErr = IDL.Record({message: IDL.Text});
|
|
213
|
+
const GetTransactionsResult = IDL.Variant({
|
|
214
|
+
Ok: GetTransactions,
|
|
215
|
+
Err: GetTransactionsErr
|
|
216
|
+
});
|
|
217
|
+
const GetBlocksRequest = IDL.Record({
|
|
218
|
+
start: IDL.Nat,
|
|
219
|
+
length: IDL.Nat
|
|
220
|
+
});
|
|
221
|
+
const Map = IDL.Vec(IDL.Tuple(IDL.Text, Value));
|
|
222
|
+
Value.fill(
|
|
223
|
+
IDL.Variant({
|
|
224
|
+
Int: IDL.Int,
|
|
225
|
+
Map: Map,
|
|
226
|
+
Nat: IDL.Nat,
|
|
227
|
+
Nat64: IDL.Nat64,
|
|
228
|
+
Blob: IDL.Vec(IDL.Nat8),
|
|
229
|
+
Text: IDL.Text,
|
|
230
|
+
Array: IDL.Vec(Value)
|
|
231
|
+
})
|
|
232
|
+
);
|
|
233
|
+
const Block = Value;
|
|
234
|
+
const GetBlocksResponse = IDL.Record({
|
|
235
|
+
blocks: IDL.Vec(Block),
|
|
236
|
+
chain_length: IDL.Nat64
|
|
237
|
+
});
|
|
238
|
+
const FeeCollectorRanges = IDL.Record({
|
|
239
|
+
ranges: IDL.Vec(IDL.Tuple(Account, IDL.Vec(IDL.Tuple(BlockIndex, BlockIndex))))
|
|
240
|
+
});
|
|
241
|
+
const ListSubaccountsArgs = IDL.Record({
|
|
242
|
+
owner: IDL.Principal,
|
|
243
|
+
start: IDL.Opt(SubAccount)
|
|
244
|
+
});
|
|
245
|
+
const Status = IDL.Record({num_blocks_synced: BlockIndex});
|
|
246
|
+
|
|
247
|
+
return IDL.Service({
|
|
248
|
+
get_account_transactions: IDL.Func(
|
|
249
|
+
[GetAccountTransactionsArgs],
|
|
250
|
+
[GetTransactionsResult],
|
|
251
|
+
['query']
|
|
252
|
+
),
|
|
253
|
+
get_blocks: IDL.Func([GetBlocksRequest], [GetBlocksResponse], ['query']),
|
|
254
|
+
get_fee_collectors_ranges: IDL.Func([], [FeeCollectorRanges], ['query']),
|
|
255
|
+
icrc1_balance_of: IDL.Func([Account], [Tokens], ['query']),
|
|
256
|
+
ledger_id: IDL.Func([], [IDL.Principal], ['query']),
|
|
257
|
+
list_subaccounts: IDL.Func([ListSubaccountsArgs], [IDL.Vec(SubAccount)], ['query']),
|
|
258
|
+
status: IDL.Func([], [Status], ['query'])
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
export const init = ({IDL}) => {
|
|
263
|
+
const UpgradeArg = IDL.Record({
|
|
264
|
+
ledger_id: IDL.Opt(IDL.Principal),
|
|
265
|
+
retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64)
|
|
266
|
+
});
|
|
267
|
+
const InitArg = IDL.Record({
|
|
268
|
+
ledger_id: IDL.Principal,
|
|
269
|
+
retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64)
|
|
270
|
+
});
|
|
271
|
+
const IndexArg = IDL.Variant({Upgrade: UpgradeArg, Init: InitArg});
|
|
272
|
+
|
|
273
|
+
return [IDL.Opt(IndexArg)];
|
|
274
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// This file was automatically generated by @icp-sdk/bindgen@0.2.0.
|
|
6
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
7
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
8
|
+
|
|
9
|
+
import type { ActorMethod } from '@icp-sdk/core/agent';
|
|
10
|
+
import type { IDL } from '@icp-sdk/core/candid';
|
|
11
|
+
import type { Principal } from '@icp-sdk/core/principal';
|
|
12
|
+
|
|
13
|
+
export interface Account {
|
|
14
|
+
'owner' : Principal,
|
|
15
|
+
'subaccount' : [] | [Uint8Array],
|
|
16
|
+
}
|
|
17
|
+
export interface Approve {
|
|
18
|
+
'fee' : [] | [bigint],
|
|
19
|
+
'from' : Account,
|
|
20
|
+
'memo' : [] | [Uint8Array],
|
|
21
|
+
'created_at_time' : [] | [bigint],
|
|
22
|
+
'amount' : bigint,
|
|
23
|
+
'expected_allowance' : [] | [bigint],
|
|
24
|
+
'expires_at' : [] | [bigint],
|
|
25
|
+
'spender' : Account,
|
|
26
|
+
}
|
|
27
|
+
export interface Burn {
|
|
28
|
+
'from' : Account,
|
|
29
|
+
'memo' : [] | [Uint8Array],
|
|
30
|
+
'created_at_time' : [] | [bigint],
|
|
31
|
+
'amount' : bigint,
|
|
32
|
+
'spender' : [] | [Account],
|
|
33
|
+
}
|
|
34
|
+
export interface GetAccountTransactionsArgs {
|
|
35
|
+
/**
|
|
36
|
+
* Maximum number of transactions to fetch.
|
|
37
|
+
*/
|
|
38
|
+
'max_results' : bigint,
|
|
39
|
+
/**
|
|
40
|
+
* The txid of the last transaction seen by the client.
|
|
41
|
+
* If None then the results will start from the most recent
|
|
42
|
+
* txid.
|
|
43
|
+
*/
|
|
44
|
+
'start' : [] | [TxId],
|
|
45
|
+
'account' : Account,
|
|
46
|
+
}
|
|
47
|
+
export interface GetTransactions {
|
|
48
|
+
'transactions' : Array<TransactionWithId>,
|
|
49
|
+
/**
|
|
50
|
+
* The txid of the oldest transaction the account has
|
|
51
|
+
*/
|
|
52
|
+
'oldest_tx_id' : [] | [TxId],
|
|
53
|
+
}
|
|
54
|
+
export interface GetTransactionsErr { 'message' : string }
|
|
55
|
+
export type GetTransactionsResult = { 'Ok' : GetTransactions } |
|
|
56
|
+
{ 'Err' : GetTransactionsErr };
|
|
57
|
+
/**
|
|
58
|
+
* The initialization parameters of the Index canister.
|
|
59
|
+
*/
|
|
60
|
+
export interface InitArgs { 'ledger_id' : Principal }
|
|
61
|
+
export interface ListSubaccountsArgs {
|
|
62
|
+
'owner' : Principal,
|
|
63
|
+
'start' : [] | [SubAccount],
|
|
64
|
+
}
|
|
65
|
+
export interface Mint {
|
|
66
|
+
'to' : Account,
|
|
67
|
+
'memo' : [] | [Uint8Array],
|
|
68
|
+
'created_at_time' : [] | [bigint],
|
|
69
|
+
'amount' : bigint,
|
|
70
|
+
}
|
|
71
|
+
export type SubAccount = Uint8Array;
|
|
72
|
+
export interface Transaction {
|
|
73
|
+
'burn' : [] | [Burn],
|
|
74
|
+
'kind' : string,
|
|
75
|
+
'mint' : [] | [Mint],
|
|
76
|
+
'approve' : [] | [Approve],
|
|
77
|
+
'timestamp' : bigint,
|
|
78
|
+
'transfer' : [] | [Transfer],
|
|
79
|
+
}
|
|
80
|
+
export interface TransactionWithId { 'id' : TxId, 'transaction' : Transaction }
|
|
81
|
+
export interface Transfer {
|
|
82
|
+
'to' : Account,
|
|
83
|
+
'fee' : [] | [bigint],
|
|
84
|
+
'from' : Account,
|
|
85
|
+
'memo' : [] | [Uint8Array],
|
|
86
|
+
'created_at_time' : [] | [bigint],
|
|
87
|
+
'amount' : bigint,
|
|
88
|
+
'spender' : [] | [Account],
|
|
89
|
+
}
|
|
90
|
+
export type TxId = bigint;
|
|
91
|
+
export interface _SERVICE {
|
|
92
|
+
'get_account_transactions' : ActorMethod<
|
|
93
|
+
[GetAccountTransactionsArgs],
|
|
94
|
+
GetTransactionsResult
|
|
95
|
+
>,
|
|
96
|
+
'ledger_id' : ActorMethod<[], Principal>,
|
|
97
|
+
'list_subaccounts' : ActorMethod<[ListSubaccountsArgs], Array<SubAccount>>,
|
|
98
|
+
}
|
|
99
|
+
export declare const idlService: IDL.ServiceClass;
|
|
100
|
+
export declare const idlInitArgs: IDL.Type[];
|
|
101
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
102
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// This file was automatically generated by @icp-sdk/bindgen@0.2.0.
|
|
6
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
7
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
8
|
+
|
|
9
|
+
import {IDL} from '@icp-sdk/core/candid';
|
|
10
|
+
|
|
11
|
+
export const InitArgs = IDL.Record({ledger_id: IDL.Principal});
|
|
12
|
+
export const TxId = IDL.Nat;
|
|
13
|
+
export const Account = IDL.Record({
|
|
14
|
+
owner: IDL.Principal,
|
|
15
|
+
subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
|
|
16
|
+
});
|
|
17
|
+
export const GetAccountTransactionsArgs = IDL.Record({
|
|
18
|
+
max_results: IDL.Nat,
|
|
19
|
+
start: IDL.Opt(TxId),
|
|
20
|
+
account: Account
|
|
21
|
+
});
|
|
22
|
+
export const Burn = IDL.Record({
|
|
23
|
+
from: Account,
|
|
24
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
25
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
26
|
+
amount: IDL.Nat,
|
|
27
|
+
spender: IDL.Opt(Account)
|
|
28
|
+
});
|
|
29
|
+
export const Mint = IDL.Record({
|
|
30
|
+
to: Account,
|
|
31
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
32
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
33
|
+
amount: IDL.Nat
|
|
34
|
+
});
|
|
35
|
+
export const Approve = IDL.Record({
|
|
36
|
+
fee: IDL.Opt(IDL.Nat),
|
|
37
|
+
from: Account,
|
|
38
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
39
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
40
|
+
amount: IDL.Nat,
|
|
41
|
+
expected_allowance: IDL.Opt(IDL.Nat),
|
|
42
|
+
expires_at: IDL.Opt(IDL.Nat64),
|
|
43
|
+
spender: Account
|
|
44
|
+
});
|
|
45
|
+
export const Transfer = IDL.Record({
|
|
46
|
+
to: Account,
|
|
47
|
+
fee: IDL.Opt(IDL.Nat),
|
|
48
|
+
from: Account,
|
|
49
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
50
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
51
|
+
amount: IDL.Nat,
|
|
52
|
+
spender: IDL.Opt(Account)
|
|
53
|
+
});
|
|
54
|
+
export const Transaction = IDL.Record({
|
|
55
|
+
burn: IDL.Opt(Burn),
|
|
56
|
+
kind: IDL.Text,
|
|
57
|
+
mint: IDL.Opt(Mint),
|
|
58
|
+
approve: IDL.Opt(Approve),
|
|
59
|
+
timestamp: IDL.Nat64,
|
|
60
|
+
transfer: IDL.Opt(Transfer)
|
|
61
|
+
});
|
|
62
|
+
export const TransactionWithId = IDL.Record({
|
|
63
|
+
id: TxId,
|
|
64
|
+
transaction: Transaction
|
|
65
|
+
});
|
|
66
|
+
export const GetTransactions = IDL.Record({
|
|
67
|
+
transactions: IDL.Vec(TransactionWithId),
|
|
68
|
+
oldest_tx_id: IDL.Opt(TxId)
|
|
69
|
+
});
|
|
70
|
+
export const GetTransactionsErr = IDL.Record({message: IDL.Text});
|
|
71
|
+
export const GetTransactionsResult = IDL.Variant({
|
|
72
|
+
Ok: GetTransactions,
|
|
73
|
+
Err: GetTransactionsErr
|
|
74
|
+
});
|
|
75
|
+
export const SubAccount = IDL.Vec(IDL.Nat8);
|
|
76
|
+
export const ListSubaccountsArgs = IDL.Record({
|
|
77
|
+
owner: IDL.Principal,
|
|
78
|
+
start: IDL.Opt(SubAccount)
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export const idlService = IDL.Service({
|
|
82
|
+
get_account_transactions: IDL.Func([GetAccountTransactionsArgs], [GetTransactionsResult], []),
|
|
83
|
+
ledger_id: IDL.Func([], [IDL.Principal], ['query']),
|
|
84
|
+
list_subaccounts: IDL.Func([ListSubaccountsArgs], [IDL.Vec(SubAccount)], ['query'])
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export const idlInitArgs = [InitArgs];
|
|
88
|
+
|
|
89
|
+
export const idlFactory = ({IDL}) => {
|
|
90
|
+
const InitArgs = IDL.Record({ledger_id: IDL.Principal});
|
|
91
|
+
const TxId = IDL.Nat;
|
|
92
|
+
const Account = IDL.Record({
|
|
93
|
+
owner: IDL.Principal,
|
|
94
|
+
subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
|
|
95
|
+
});
|
|
96
|
+
const GetAccountTransactionsArgs = IDL.Record({
|
|
97
|
+
max_results: IDL.Nat,
|
|
98
|
+
start: IDL.Opt(TxId),
|
|
99
|
+
account: Account
|
|
100
|
+
});
|
|
101
|
+
const Burn = IDL.Record({
|
|
102
|
+
from: Account,
|
|
103
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
104
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
105
|
+
amount: IDL.Nat,
|
|
106
|
+
spender: IDL.Opt(Account)
|
|
107
|
+
});
|
|
108
|
+
const Mint = IDL.Record({
|
|
109
|
+
to: Account,
|
|
110
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
111
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
112
|
+
amount: IDL.Nat
|
|
113
|
+
});
|
|
114
|
+
const Approve = IDL.Record({
|
|
115
|
+
fee: IDL.Opt(IDL.Nat),
|
|
116
|
+
from: Account,
|
|
117
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
118
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
119
|
+
amount: IDL.Nat,
|
|
120
|
+
expected_allowance: IDL.Opt(IDL.Nat),
|
|
121
|
+
expires_at: IDL.Opt(IDL.Nat64),
|
|
122
|
+
spender: Account
|
|
123
|
+
});
|
|
124
|
+
const Transfer = IDL.Record({
|
|
125
|
+
to: Account,
|
|
126
|
+
fee: IDL.Opt(IDL.Nat),
|
|
127
|
+
from: Account,
|
|
128
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
129
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
130
|
+
amount: IDL.Nat,
|
|
131
|
+
spender: IDL.Opt(Account)
|
|
132
|
+
});
|
|
133
|
+
const Transaction = IDL.Record({
|
|
134
|
+
burn: IDL.Opt(Burn),
|
|
135
|
+
kind: IDL.Text,
|
|
136
|
+
mint: IDL.Opt(Mint),
|
|
137
|
+
approve: IDL.Opt(Approve),
|
|
138
|
+
timestamp: IDL.Nat64,
|
|
139
|
+
transfer: IDL.Opt(Transfer)
|
|
140
|
+
});
|
|
141
|
+
const TransactionWithId = IDL.Record({
|
|
142
|
+
id: TxId,
|
|
143
|
+
transaction: Transaction
|
|
144
|
+
});
|
|
145
|
+
const GetTransactions = IDL.Record({
|
|
146
|
+
transactions: IDL.Vec(TransactionWithId),
|
|
147
|
+
oldest_tx_id: IDL.Opt(TxId)
|
|
148
|
+
});
|
|
149
|
+
const GetTransactionsErr = IDL.Record({message: IDL.Text});
|
|
150
|
+
const GetTransactionsResult = IDL.Variant({
|
|
151
|
+
Ok: GetTransactions,
|
|
152
|
+
Err: GetTransactionsErr
|
|
153
|
+
});
|
|
154
|
+
const SubAccount = IDL.Vec(IDL.Nat8);
|
|
155
|
+
const ListSubaccountsArgs = IDL.Record({
|
|
156
|
+
owner: IDL.Principal,
|
|
157
|
+
start: IDL.Opt(SubAccount)
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
return IDL.Service({
|
|
161
|
+
get_account_transactions: IDL.Func([GetAccountTransactionsArgs], [GetTransactionsResult], []),
|
|
162
|
+
ledger_id: IDL.Func([], [IDL.Principal], ['query']),
|
|
163
|
+
list_subaccounts: IDL.Func([ListSubaccountsArgs], [IDL.Vec(SubAccount)], ['query'])
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export const init = ({IDL}) => {
|
|
168
|
+
const InitArgs = IDL.Record({ledger_id: IDL.Principal});
|
|
169
|
+
|
|
170
|
+
return [InitArgs];
|
|
171
|
+
};
|