@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,119 @@
|
|
|
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 GetAccountIdentifierTransactionsArgs {
|
|
18
|
+
'max_results' : bigint,
|
|
19
|
+
'start' : [] | [bigint],
|
|
20
|
+
'account_identifier' : string,
|
|
21
|
+
}
|
|
22
|
+
export interface GetAccountIdentifierTransactionsError { 'message' : string }
|
|
23
|
+
export interface GetAccountIdentifierTransactionsResponse {
|
|
24
|
+
'balance' : bigint,
|
|
25
|
+
'transactions' : Array<TransactionWithId>,
|
|
26
|
+
'oldest_tx_id' : [] | [bigint],
|
|
27
|
+
}
|
|
28
|
+
export type GetAccountIdentifierTransactionsResult = {
|
|
29
|
+
'Ok' : GetAccountIdentifierTransactionsResponse
|
|
30
|
+
} |
|
|
31
|
+
{ 'Err' : GetAccountIdentifierTransactionsError };
|
|
32
|
+
export interface GetAccountTransactionsArgs {
|
|
33
|
+
/**
|
|
34
|
+
* Maximum number of transactions to fetch.
|
|
35
|
+
*/
|
|
36
|
+
'max_results' : bigint,
|
|
37
|
+
/**
|
|
38
|
+
* The txid of the last transaction seen by the client.
|
|
39
|
+
* If None then the results will start from the most recent
|
|
40
|
+
* txid. If set then the results will start from the next
|
|
41
|
+
* most recent txid after start (start won't be included).
|
|
42
|
+
*/
|
|
43
|
+
'start' : [] | [bigint],
|
|
44
|
+
'account' : Account,
|
|
45
|
+
}
|
|
46
|
+
export interface GetBlocksRequest { 'start' : bigint, 'length' : bigint }
|
|
47
|
+
export interface GetBlocksResponse {
|
|
48
|
+
'blocks' : Array<Uint8Array>,
|
|
49
|
+
'chain_length' : bigint,
|
|
50
|
+
}
|
|
51
|
+
export interface HttpRequest {
|
|
52
|
+
'url' : string,
|
|
53
|
+
'method' : string,
|
|
54
|
+
'body' : Uint8Array,
|
|
55
|
+
'headers' : Array<[string, string]>,
|
|
56
|
+
}
|
|
57
|
+
export interface HttpResponse {
|
|
58
|
+
'body' : Uint8Array,
|
|
59
|
+
'headers' : Array<[string, string]>,
|
|
60
|
+
'status_code' : number,
|
|
61
|
+
}
|
|
62
|
+
export interface InitArg { 'ledger_id' : Principal }
|
|
63
|
+
export type Operation = {
|
|
64
|
+
'Approve' : {
|
|
65
|
+
'fee' : Tokens,
|
|
66
|
+
'from' : string,
|
|
67
|
+
'allowance' : Tokens,
|
|
68
|
+
'expected_allowance' : [] | [Tokens],
|
|
69
|
+
'expires_at' : [] | [TimeStamp],
|
|
70
|
+
'spender' : string,
|
|
71
|
+
}
|
|
72
|
+
} |
|
|
73
|
+
{
|
|
74
|
+
'Burn' : { 'from' : string, 'amount' : Tokens, 'spender' : [] | [string] }
|
|
75
|
+
} |
|
|
76
|
+
{ 'Mint' : { 'to' : string, 'amount' : Tokens } } |
|
|
77
|
+
{
|
|
78
|
+
'Transfer' : {
|
|
79
|
+
'to' : string,
|
|
80
|
+
'fee' : Tokens,
|
|
81
|
+
'from' : string,
|
|
82
|
+
'amount' : Tokens,
|
|
83
|
+
'spender' : [] | [string],
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
export interface Status { 'num_blocks_synced' : bigint }
|
|
87
|
+
export interface TimeStamp { 'timestamp_nanos' : bigint }
|
|
88
|
+
export interface Tokens { 'e8s' : bigint }
|
|
89
|
+
export interface Transaction {
|
|
90
|
+
'memo' : bigint,
|
|
91
|
+
'icrc1_memo' : [] | [Uint8Array],
|
|
92
|
+
'operation' : Operation,
|
|
93
|
+
'timestamp' : [] | [TimeStamp],
|
|
94
|
+
'created_at_time' : [] | [TimeStamp],
|
|
95
|
+
}
|
|
96
|
+
export interface TransactionWithId {
|
|
97
|
+
'id' : bigint,
|
|
98
|
+
'transaction' : Transaction,
|
|
99
|
+
}
|
|
100
|
+
export interface _SERVICE {
|
|
101
|
+
'get_account_identifier_balance' : ActorMethod<[string], bigint>,
|
|
102
|
+
'get_account_identifier_transactions' : ActorMethod<
|
|
103
|
+
[GetAccountIdentifierTransactionsArgs],
|
|
104
|
+
GetAccountIdentifierTransactionsResult
|
|
105
|
+
>,
|
|
106
|
+
'get_account_transactions' : ActorMethod<
|
|
107
|
+
[GetAccountTransactionsArgs],
|
|
108
|
+
GetAccountIdentifierTransactionsResult
|
|
109
|
+
>,
|
|
110
|
+
'get_blocks' : ActorMethod<[GetBlocksRequest], GetBlocksResponse>,
|
|
111
|
+
'http_request' : ActorMethod<[HttpRequest], HttpResponse>,
|
|
112
|
+
'icrc1_balance_of' : ActorMethod<[Account], bigint>,
|
|
113
|
+
'ledger_id' : ActorMethod<[], Principal>,
|
|
114
|
+
'status' : ActorMethod<[], Status>,
|
|
115
|
+
}
|
|
116
|
+
export declare const idlService: IDL.ServiceClass;
|
|
117
|
+
export declare const idlInitArgs: IDL.Type[];
|
|
118
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
119
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -0,0 +1,225 @@
|
|
|
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 InitArg = IDL.Record({ledger_id: IDL.Principal});
|
|
12
|
+
export const GetAccountIdentifierTransactionsArgs = IDL.Record({
|
|
13
|
+
max_results: IDL.Nat64,
|
|
14
|
+
start: IDL.Opt(IDL.Nat64),
|
|
15
|
+
account_identifier: IDL.Text
|
|
16
|
+
});
|
|
17
|
+
export const Tokens = IDL.Record({e8s: IDL.Nat64});
|
|
18
|
+
export const TimeStamp = IDL.Record({timestamp_nanos: IDL.Nat64});
|
|
19
|
+
export const Operation = IDL.Variant({
|
|
20
|
+
Approve: IDL.Record({
|
|
21
|
+
fee: Tokens,
|
|
22
|
+
from: IDL.Text,
|
|
23
|
+
allowance: Tokens,
|
|
24
|
+
expected_allowance: IDL.Opt(Tokens),
|
|
25
|
+
expires_at: IDL.Opt(TimeStamp),
|
|
26
|
+
spender: IDL.Text
|
|
27
|
+
}),
|
|
28
|
+
Burn: IDL.Record({
|
|
29
|
+
from: IDL.Text,
|
|
30
|
+
amount: Tokens,
|
|
31
|
+
spender: IDL.Opt(IDL.Text)
|
|
32
|
+
}),
|
|
33
|
+
Mint: IDL.Record({to: IDL.Text, amount: Tokens}),
|
|
34
|
+
Transfer: IDL.Record({
|
|
35
|
+
to: IDL.Text,
|
|
36
|
+
fee: Tokens,
|
|
37
|
+
from: IDL.Text,
|
|
38
|
+
amount: Tokens,
|
|
39
|
+
spender: IDL.Opt(IDL.Text)
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
export const Transaction = IDL.Record({
|
|
43
|
+
memo: IDL.Nat64,
|
|
44
|
+
icrc1_memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
45
|
+
operation: Operation,
|
|
46
|
+
timestamp: IDL.Opt(TimeStamp),
|
|
47
|
+
created_at_time: IDL.Opt(TimeStamp)
|
|
48
|
+
});
|
|
49
|
+
export const TransactionWithId = IDL.Record({
|
|
50
|
+
id: IDL.Nat64,
|
|
51
|
+
transaction: Transaction
|
|
52
|
+
});
|
|
53
|
+
export const GetAccountIdentifierTransactionsResponse = IDL.Record({
|
|
54
|
+
balance: IDL.Nat64,
|
|
55
|
+
transactions: IDL.Vec(TransactionWithId),
|
|
56
|
+
oldest_tx_id: IDL.Opt(IDL.Nat64)
|
|
57
|
+
});
|
|
58
|
+
export const GetAccountIdentifierTransactionsError = IDL.Record({
|
|
59
|
+
message: IDL.Text
|
|
60
|
+
});
|
|
61
|
+
export const GetAccountIdentifierTransactionsResult = IDL.Variant({
|
|
62
|
+
Ok: GetAccountIdentifierTransactionsResponse,
|
|
63
|
+
Err: GetAccountIdentifierTransactionsError
|
|
64
|
+
});
|
|
65
|
+
export const Account = IDL.Record({
|
|
66
|
+
owner: IDL.Principal,
|
|
67
|
+
subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
|
|
68
|
+
});
|
|
69
|
+
export const GetAccountTransactionsArgs = IDL.Record({
|
|
70
|
+
max_results: IDL.Nat,
|
|
71
|
+
start: IDL.Opt(IDL.Nat),
|
|
72
|
+
account: Account
|
|
73
|
+
});
|
|
74
|
+
export const GetBlocksRequest = IDL.Record({
|
|
75
|
+
start: IDL.Nat,
|
|
76
|
+
length: IDL.Nat
|
|
77
|
+
});
|
|
78
|
+
export const GetBlocksResponse = IDL.Record({
|
|
79
|
+
blocks: IDL.Vec(IDL.Vec(IDL.Nat8)),
|
|
80
|
+
chain_length: IDL.Nat64
|
|
81
|
+
});
|
|
82
|
+
export const HttpRequest = IDL.Record({
|
|
83
|
+
url: IDL.Text,
|
|
84
|
+
method: IDL.Text,
|
|
85
|
+
body: IDL.Vec(IDL.Nat8),
|
|
86
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))
|
|
87
|
+
});
|
|
88
|
+
export const HttpResponse = IDL.Record({
|
|
89
|
+
body: IDL.Vec(IDL.Nat8),
|
|
90
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
91
|
+
status_code: IDL.Nat16
|
|
92
|
+
});
|
|
93
|
+
export const Status = IDL.Record({num_blocks_synced: IDL.Nat64});
|
|
94
|
+
|
|
95
|
+
export const idlService = IDL.Service({
|
|
96
|
+
get_account_identifier_balance: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),
|
|
97
|
+
get_account_identifier_transactions: IDL.Func(
|
|
98
|
+
[GetAccountIdentifierTransactionsArgs],
|
|
99
|
+
[GetAccountIdentifierTransactionsResult],
|
|
100
|
+
['query']
|
|
101
|
+
),
|
|
102
|
+
get_account_transactions: IDL.Func(
|
|
103
|
+
[GetAccountTransactionsArgs],
|
|
104
|
+
[GetAccountIdentifierTransactionsResult],
|
|
105
|
+
['query']
|
|
106
|
+
),
|
|
107
|
+
get_blocks: IDL.Func([GetBlocksRequest], [GetBlocksResponse], ['query']),
|
|
108
|
+
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
|
|
109
|
+
icrc1_balance_of: IDL.Func([Account], [IDL.Nat64], ['query']),
|
|
110
|
+
ledger_id: IDL.Func([], [IDL.Principal], ['query']),
|
|
111
|
+
status: IDL.Func([], [Status], ['query'])
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export const idlInitArgs = [InitArg];
|
|
115
|
+
|
|
116
|
+
export const idlFactory = ({IDL}) => {
|
|
117
|
+
const InitArg = IDL.Record({ledger_id: IDL.Principal});
|
|
118
|
+
const GetAccountIdentifierTransactionsArgs = IDL.Record({
|
|
119
|
+
max_results: IDL.Nat64,
|
|
120
|
+
start: IDL.Opt(IDL.Nat64),
|
|
121
|
+
account_identifier: IDL.Text
|
|
122
|
+
});
|
|
123
|
+
const Tokens = IDL.Record({e8s: IDL.Nat64});
|
|
124
|
+
const TimeStamp = IDL.Record({timestamp_nanos: IDL.Nat64});
|
|
125
|
+
const Operation = IDL.Variant({
|
|
126
|
+
Approve: IDL.Record({
|
|
127
|
+
fee: Tokens,
|
|
128
|
+
from: IDL.Text,
|
|
129
|
+
allowance: Tokens,
|
|
130
|
+
expected_allowance: IDL.Opt(Tokens),
|
|
131
|
+
expires_at: IDL.Opt(TimeStamp),
|
|
132
|
+
spender: IDL.Text
|
|
133
|
+
}),
|
|
134
|
+
Burn: IDL.Record({
|
|
135
|
+
from: IDL.Text,
|
|
136
|
+
amount: Tokens,
|
|
137
|
+
spender: IDL.Opt(IDL.Text)
|
|
138
|
+
}),
|
|
139
|
+
Mint: IDL.Record({to: IDL.Text, amount: Tokens}),
|
|
140
|
+
Transfer: IDL.Record({
|
|
141
|
+
to: IDL.Text,
|
|
142
|
+
fee: Tokens,
|
|
143
|
+
from: IDL.Text,
|
|
144
|
+
amount: Tokens,
|
|
145
|
+
spender: IDL.Opt(IDL.Text)
|
|
146
|
+
})
|
|
147
|
+
});
|
|
148
|
+
const Transaction = IDL.Record({
|
|
149
|
+
memo: IDL.Nat64,
|
|
150
|
+
icrc1_memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
151
|
+
operation: Operation,
|
|
152
|
+
timestamp: IDL.Opt(TimeStamp),
|
|
153
|
+
created_at_time: IDL.Opt(TimeStamp)
|
|
154
|
+
});
|
|
155
|
+
const TransactionWithId = IDL.Record({
|
|
156
|
+
id: IDL.Nat64,
|
|
157
|
+
transaction: Transaction
|
|
158
|
+
});
|
|
159
|
+
const GetAccountIdentifierTransactionsResponse = IDL.Record({
|
|
160
|
+
balance: IDL.Nat64,
|
|
161
|
+
transactions: IDL.Vec(TransactionWithId),
|
|
162
|
+
oldest_tx_id: IDL.Opt(IDL.Nat64)
|
|
163
|
+
});
|
|
164
|
+
const GetAccountIdentifierTransactionsError = IDL.Record({
|
|
165
|
+
message: IDL.Text
|
|
166
|
+
});
|
|
167
|
+
const GetAccountIdentifierTransactionsResult = IDL.Variant({
|
|
168
|
+
Ok: GetAccountIdentifierTransactionsResponse,
|
|
169
|
+
Err: GetAccountIdentifierTransactionsError
|
|
170
|
+
});
|
|
171
|
+
const Account = IDL.Record({
|
|
172
|
+
owner: IDL.Principal,
|
|
173
|
+
subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
|
|
174
|
+
});
|
|
175
|
+
const GetAccountTransactionsArgs = IDL.Record({
|
|
176
|
+
max_results: IDL.Nat,
|
|
177
|
+
start: IDL.Opt(IDL.Nat),
|
|
178
|
+
account: Account
|
|
179
|
+
});
|
|
180
|
+
const GetBlocksRequest = IDL.Record({
|
|
181
|
+
start: IDL.Nat,
|
|
182
|
+
length: IDL.Nat
|
|
183
|
+
});
|
|
184
|
+
const GetBlocksResponse = IDL.Record({
|
|
185
|
+
blocks: IDL.Vec(IDL.Vec(IDL.Nat8)),
|
|
186
|
+
chain_length: IDL.Nat64
|
|
187
|
+
});
|
|
188
|
+
const HttpRequest = IDL.Record({
|
|
189
|
+
url: IDL.Text,
|
|
190
|
+
method: IDL.Text,
|
|
191
|
+
body: IDL.Vec(IDL.Nat8),
|
|
192
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))
|
|
193
|
+
});
|
|
194
|
+
const HttpResponse = IDL.Record({
|
|
195
|
+
body: IDL.Vec(IDL.Nat8),
|
|
196
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
197
|
+
status_code: IDL.Nat16
|
|
198
|
+
});
|
|
199
|
+
const Status = IDL.Record({num_blocks_synced: IDL.Nat64});
|
|
200
|
+
|
|
201
|
+
return IDL.Service({
|
|
202
|
+
get_account_identifier_balance: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),
|
|
203
|
+
get_account_identifier_transactions: IDL.Func(
|
|
204
|
+
[GetAccountIdentifierTransactionsArgs],
|
|
205
|
+
[GetAccountIdentifierTransactionsResult],
|
|
206
|
+
['query']
|
|
207
|
+
),
|
|
208
|
+
get_account_transactions: IDL.Func(
|
|
209
|
+
[GetAccountTransactionsArgs],
|
|
210
|
+
[GetAccountIdentifierTransactionsResult],
|
|
211
|
+
['query']
|
|
212
|
+
),
|
|
213
|
+
get_blocks: IDL.Func([GetBlocksRequest], [GetBlocksResponse], ['query']),
|
|
214
|
+
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
|
|
215
|
+
icrc1_balance_of: IDL.Func([Account], [IDL.Nat64], ['query']),
|
|
216
|
+
ledger_id: IDL.Func([], [IDL.Principal], ['query']),
|
|
217
|
+
status: IDL.Func([], [Status], ['query'])
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export const init = ({IDL}) => {
|
|
222
|
+
const InitArg = IDL.Record({ledger_id: IDL.Principal});
|
|
223
|
+
|
|
224
|
+
return [InitArg];
|
|
225
|
+
};
|