@junobuild/functions 0.4.1 → 0.5.1-next-2025-11-29
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 +43 -6
- 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,411 @@
|
|
|
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 BuyerState {
|
|
14
|
+
'icp' : [] | [TransferableAmount],
|
|
15
|
+
'has_created_neuron_recipes' : [] | [boolean],
|
|
16
|
+
}
|
|
17
|
+
export interface CanisterCallError {
|
|
18
|
+
'code' : [] | [number],
|
|
19
|
+
'description' : string,
|
|
20
|
+
}
|
|
21
|
+
export interface CanisterStatusResultV2 {
|
|
22
|
+
'memory_metrics' : [] | [MemoryMetrics],
|
|
23
|
+
'status' : CanisterStatusType,
|
|
24
|
+
'memory_size' : bigint,
|
|
25
|
+
'cycles' : bigint,
|
|
26
|
+
'settings' : DefiniteCanisterSettingsArgs,
|
|
27
|
+
'query_stats' : [] | [QueryStats],
|
|
28
|
+
'idle_cycles_burned_per_day' : bigint,
|
|
29
|
+
'module_hash' : [] | [Uint8Array],
|
|
30
|
+
}
|
|
31
|
+
export type CanisterStatusType = { 'stopped' : null } |
|
|
32
|
+
{ 'stopping' : null } |
|
|
33
|
+
{ 'running' : null };
|
|
34
|
+
export interface CfInvestment {
|
|
35
|
+
'controller' : [] | [Principal],
|
|
36
|
+
'hotkey_principal' : string,
|
|
37
|
+
'hotkeys' : [] | [Principals],
|
|
38
|
+
'nns_neuron_id' : bigint,
|
|
39
|
+
}
|
|
40
|
+
export interface CfNeuron {
|
|
41
|
+
'has_created_neuron_recipes' : [] | [boolean],
|
|
42
|
+
'hotkeys' : [] | [Principals],
|
|
43
|
+
'nns_neuron_id' : bigint,
|
|
44
|
+
'amount_icp_e8s' : bigint,
|
|
45
|
+
}
|
|
46
|
+
export interface CfParticipant {
|
|
47
|
+
'controller' : [] | [Principal],
|
|
48
|
+
'hotkey_principal' : string,
|
|
49
|
+
'cf_neurons' : Array<CfNeuron>,
|
|
50
|
+
}
|
|
51
|
+
export interface Countries { 'iso_codes' : Array<string> }
|
|
52
|
+
export interface DefiniteCanisterSettingsArgs {
|
|
53
|
+
'freezing_threshold' : bigint,
|
|
54
|
+
'wasm_memory_threshold' : [] | [bigint],
|
|
55
|
+
'controllers' : Array<Principal>,
|
|
56
|
+
'wasm_memory_limit' : [] | [bigint],
|
|
57
|
+
'memory_allocation' : bigint,
|
|
58
|
+
'compute_allocation' : bigint,
|
|
59
|
+
}
|
|
60
|
+
export interface DerivedState {
|
|
61
|
+
'sns_tokens_per_icp' : number,
|
|
62
|
+
'buyer_total_icp_e8s' : bigint,
|
|
63
|
+
'cf_participant_count' : [] | [bigint],
|
|
64
|
+
'neurons_fund_participation_icp_e8s' : [] | [bigint],
|
|
65
|
+
'direct_participation_icp_e8s' : [] | [bigint],
|
|
66
|
+
'direct_participant_count' : [] | [bigint],
|
|
67
|
+
'cf_neuron_count' : [] | [bigint],
|
|
68
|
+
}
|
|
69
|
+
export interface DirectInvestment { 'buyer_principal' : string }
|
|
70
|
+
export interface Err {
|
|
71
|
+
'description' : [] | [string],
|
|
72
|
+
'error_type' : [] | [number],
|
|
73
|
+
}
|
|
74
|
+
export interface Err_1 { 'error_type' : [] | [number] }
|
|
75
|
+
export interface Err_2 {
|
|
76
|
+
'invalid_user_amount' : [] | [InvalidUserAmount],
|
|
77
|
+
'existing_ticket' : [] | [Ticket],
|
|
78
|
+
'error_type' : number,
|
|
79
|
+
}
|
|
80
|
+
export interface Error { 'message' : [] | [string] }
|
|
81
|
+
export interface ErrorRefundIcpRequest {
|
|
82
|
+
'source_principal_id' : [] | [Principal],
|
|
83
|
+
}
|
|
84
|
+
export interface ErrorRefundIcpResponse { 'result' : [] | [Result] }
|
|
85
|
+
export interface FailedUpdate {
|
|
86
|
+
'err' : [] | [CanisterCallError],
|
|
87
|
+
'dapp_canister_id' : [] | [Principal],
|
|
88
|
+
}
|
|
89
|
+
export interface FinalizeSwapResponse {
|
|
90
|
+
'set_dapp_controllers_call_result' : [] | [SetDappControllersCallResult],
|
|
91
|
+
'create_sns_neuron_recipes_result' : [] | [SweepResult],
|
|
92
|
+
'settle_community_fund_participation_result' : [] | [
|
|
93
|
+
SettleCommunityFundParticipationResult
|
|
94
|
+
],
|
|
95
|
+
'error_message' : [] | [string],
|
|
96
|
+
'settle_neurons_fund_participation_result' : [] | [
|
|
97
|
+
SettleNeuronsFundParticipationResult
|
|
98
|
+
],
|
|
99
|
+
'set_mode_call_result' : [] | [SetModeCallResult],
|
|
100
|
+
'sweep_icp_result' : [] | [SweepResult],
|
|
101
|
+
'claim_neuron_result' : [] | [SweepResult],
|
|
102
|
+
'sweep_sns_result' : [] | [SweepResult],
|
|
103
|
+
}
|
|
104
|
+
export interface GetAutoFinalizationStatusResponse {
|
|
105
|
+
'auto_finalize_swap_response' : [] | [FinalizeSwapResponse],
|
|
106
|
+
'has_auto_finalize_been_attempted' : [] | [boolean],
|
|
107
|
+
'is_auto_finalize_enabled' : [] | [boolean],
|
|
108
|
+
}
|
|
109
|
+
export interface GetBuyerStateRequest { 'principal_id' : [] | [Principal] }
|
|
110
|
+
export interface GetBuyerStateResponse { 'buyer_state' : [] | [BuyerState] }
|
|
111
|
+
export interface GetBuyersTotalResponse { 'buyers_total' : bigint }
|
|
112
|
+
export interface GetDerivedStateResponse {
|
|
113
|
+
'sns_tokens_per_icp' : [] | [number],
|
|
114
|
+
'buyer_total_icp_e8s' : [] | [bigint],
|
|
115
|
+
'cf_participant_count' : [] | [bigint],
|
|
116
|
+
'neurons_fund_participation_icp_e8s' : [] | [bigint],
|
|
117
|
+
'direct_participation_icp_e8s' : [] | [bigint],
|
|
118
|
+
'direct_participant_count' : [] | [bigint],
|
|
119
|
+
'cf_neuron_count' : [] | [bigint],
|
|
120
|
+
}
|
|
121
|
+
export interface GetInitResponse { 'init' : [] | [Init] }
|
|
122
|
+
export interface GetLifecycleResponse {
|
|
123
|
+
'decentralization_sale_open_timestamp_seconds' : [] | [bigint],
|
|
124
|
+
'lifecycle' : [] | [number],
|
|
125
|
+
'decentralization_swap_termination_timestamp_seconds' : [] | [bigint],
|
|
126
|
+
}
|
|
127
|
+
export interface GetOpenTicketResponse { 'result' : [] | [Result_1] }
|
|
128
|
+
export interface GetSaleParametersResponse { 'params' : [] | [Params] }
|
|
129
|
+
export interface GetStateResponse {
|
|
130
|
+
'swap' : [] | [Swap],
|
|
131
|
+
'derived' : [] | [DerivedState],
|
|
132
|
+
}
|
|
133
|
+
export interface GetTimersResponse { 'timers' : [] | [Timers] }
|
|
134
|
+
export interface GovernanceError {
|
|
135
|
+
'error_message' : string,
|
|
136
|
+
'error_type' : number,
|
|
137
|
+
}
|
|
138
|
+
export interface Icrc1Account {
|
|
139
|
+
'owner' : [] | [Principal],
|
|
140
|
+
'subaccount' : [] | [Uint8Array],
|
|
141
|
+
}
|
|
142
|
+
export interface IdealMatchedParticipationFunction {
|
|
143
|
+
'serialized_representation' : [] | [string],
|
|
144
|
+
}
|
|
145
|
+
export interface Init {
|
|
146
|
+
'nns_proposal_id' : [] | [bigint],
|
|
147
|
+
'sns_root_canister_id' : string,
|
|
148
|
+
'neurons_fund_participation' : [] | [boolean],
|
|
149
|
+
'min_participant_icp_e8s' : [] | [bigint],
|
|
150
|
+
'neuron_basket_construction_parameters' : [] | [
|
|
151
|
+
NeuronBasketConstructionParameters
|
|
152
|
+
],
|
|
153
|
+
'fallback_controller_principal_ids' : Array<string>,
|
|
154
|
+
'max_icp_e8s' : [] | [bigint],
|
|
155
|
+
'neuron_minimum_stake_e8s' : [] | [bigint],
|
|
156
|
+
'confirmation_text' : [] | [string],
|
|
157
|
+
'swap_start_timestamp_seconds' : [] | [bigint],
|
|
158
|
+
'swap_due_timestamp_seconds' : [] | [bigint],
|
|
159
|
+
'min_participants' : [] | [number],
|
|
160
|
+
'sns_token_e8s' : [] | [bigint],
|
|
161
|
+
'nns_governance_canister_id' : string,
|
|
162
|
+
'transaction_fee_e8s' : [] | [bigint],
|
|
163
|
+
'icp_ledger_canister_id' : string,
|
|
164
|
+
'sns_ledger_canister_id' : string,
|
|
165
|
+
'neurons_fund_participation_constraints' : [] | [
|
|
166
|
+
NeuronsFundParticipationConstraints
|
|
167
|
+
],
|
|
168
|
+
'should_auto_finalize' : [] | [boolean],
|
|
169
|
+
'max_participant_icp_e8s' : [] | [bigint],
|
|
170
|
+
'sns_governance_canister_id' : string,
|
|
171
|
+
'min_direct_participation_icp_e8s' : [] | [bigint],
|
|
172
|
+
'restricted_countries' : [] | [Countries],
|
|
173
|
+
'min_icp_e8s' : [] | [bigint],
|
|
174
|
+
'max_direct_participation_icp_e8s' : [] | [bigint],
|
|
175
|
+
}
|
|
176
|
+
export interface InvalidUserAmount {
|
|
177
|
+
'min_amount_icp_e8s_included' : bigint,
|
|
178
|
+
'max_amount_icp_e8s_included' : bigint,
|
|
179
|
+
}
|
|
180
|
+
export type Investor = { 'CommunityFund' : CfInvestment } |
|
|
181
|
+
{ 'Direct' : DirectInvestment };
|
|
182
|
+
export interface LinearScalingCoefficient {
|
|
183
|
+
'slope_numerator' : [] | [bigint],
|
|
184
|
+
'intercept_icp_e8s' : [] | [bigint],
|
|
185
|
+
'from_direct_participation_icp_e8s' : [] | [bigint],
|
|
186
|
+
'slope_denominator' : [] | [bigint],
|
|
187
|
+
'to_direct_participation_icp_e8s' : [] | [bigint],
|
|
188
|
+
}
|
|
189
|
+
export interface ListCommunityFundParticipantsRequest {
|
|
190
|
+
'offset' : [] | [bigint],
|
|
191
|
+
'limit' : [] | [number],
|
|
192
|
+
}
|
|
193
|
+
export interface ListCommunityFundParticipantsResponse {
|
|
194
|
+
'cf_participants' : Array<CfParticipant>,
|
|
195
|
+
}
|
|
196
|
+
export interface ListDirectParticipantsRequest {
|
|
197
|
+
'offset' : [] | [number],
|
|
198
|
+
'limit' : [] | [number],
|
|
199
|
+
}
|
|
200
|
+
export interface ListDirectParticipantsResponse {
|
|
201
|
+
'participants' : Array<Participant>,
|
|
202
|
+
}
|
|
203
|
+
export interface ListSnsNeuronRecipesRequest {
|
|
204
|
+
'offset' : [] | [bigint],
|
|
205
|
+
'limit' : [] | [number],
|
|
206
|
+
}
|
|
207
|
+
export interface ListSnsNeuronRecipesResponse {
|
|
208
|
+
'sns_neuron_recipes' : Array<SnsNeuronRecipe>,
|
|
209
|
+
}
|
|
210
|
+
export interface MemoryMetrics {
|
|
211
|
+
'wasm_binary_size' : [] | [bigint],
|
|
212
|
+
'wasm_chunk_store_size' : [] | [bigint],
|
|
213
|
+
'canister_history_size' : [] | [bigint],
|
|
214
|
+
'stable_memory_size' : [] | [bigint],
|
|
215
|
+
'snapshots_size' : [] | [bigint],
|
|
216
|
+
'wasm_memory_size' : [] | [bigint],
|
|
217
|
+
'global_memory_size' : [] | [bigint],
|
|
218
|
+
'custom_sections_size' : [] | [bigint],
|
|
219
|
+
}
|
|
220
|
+
export interface NeuronAttributes {
|
|
221
|
+
'dissolve_delay_seconds' : bigint,
|
|
222
|
+
'memo' : bigint,
|
|
223
|
+
'followees' : Array<NeuronId>,
|
|
224
|
+
}
|
|
225
|
+
export interface NeuronBasketConstructionParameters {
|
|
226
|
+
'dissolve_delay_interval_seconds' : bigint,
|
|
227
|
+
'count' : bigint,
|
|
228
|
+
}
|
|
229
|
+
export interface NeuronId { 'id' : Uint8Array }
|
|
230
|
+
export interface NeuronsFundParticipationConstraints {
|
|
231
|
+
'coefficient_intervals' : Array<LinearScalingCoefficient>,
|
|
232
|
+
'max_neurons_fund_participation_icp_e8s' : [] | [bigint],
|
|
233
|
+
'min_direct_participation_threshold_icp_e8s' : [] | [bigint],
|
|
234
|
+
'ideal_matched_participation_function' : [] | [
|
|
235
|
+
IdealMatchedParticipationFunction
|
|
236
|
+
],
|
|
237
|
+
}
|
|
238
|
+
export interface NewSaleTicketRequest {
|
|
239
|
+
'subaccount' : [] | [Uint8Array],
|
|
240
|
+
'amount_icp_e8s' : bigint,
|
|
241
|
+
}
|
|
242
|
+
export interface NewSaleTicketResponse { 'result' : [] | [Result_2] }
|
|
243
|
+
export interface Ok { 'block_height' : [] | [bigint] }
|
|
244
|
+
export interface Ok_1 {
|
|
245
|
+
'neurons_fund_participation_icp_e8s' : [] | [bigint],
|
|
246
|
+
'neurons_fund_neurons_count' : [] | [bigint],
|
|
247
|
+
}
|
|
248
|
+
export interface Ok_2 { 'ticket' : [] | [Ticket] }
|
|
249
|
+
export interface Params {
|
|
250
|
+
'min_participant_icp_e8s' : bigint,
|
|
251
|
+
'neuron_basket_construction_parameters' : [] | [
|
|
252
|
+
NeuronBasketConstructionParameters
|
|
253
|
+
],
|
|
254
|
+
'max_icp_e8s' : bigint,
|
|
255
|
+
'swap_due_timestamp_seconds' : bigint,
|
|
256
|
+
'min_participants' : number,
|
|
257
|
+
'sns_token_e8s' : bigint,
|
|
258
|
+
'sale_delay_seconds' : [] | [bigint],
|
|
259
|
+
'max_participant_icp_e8s' : bigint,
|
|
260
|
+
'min_direct_participation_icp_e8s' : [] | [bigint],
|
|
261
|
+
'min_icp_e8s' : bigint,
|
|
262
|
+
'max_direct_participation_icp_e8s' : [] | [bigint],
|
|
263
|
+
}
|
|
264
|
+
export interface Participant {
|
|
265
|
+
'participation' : [] | [BuyerState],
|
|
266
|
+
'participant_id' : [] | [Principal],
|
|
267
|
+
}
|
|
268
|
+
export type Possibility = { 'Ok' : SetDappControllersResponse } |
|
|
269
|
+
{ 'Err' : CanisterCallError };
|
|
270
|
+
export type Possibility_1 = { 'Ok' : Response } |
|
|
271
|
+
{ 'Err' : CanisterCallError };
|
|
272
|
+
export type Possibility_2 = { 'Ok' : Ok_1 } |
|
|
273
|
+
{ 'Err' : Error };
|
|
274
|
+
export type Possibility_3 = { 'Ok' : {} } |
|
|
275
|
+
{ 'Err' : CanisterCallError };
|
|
276
|
+
export interface Principals { 'principals' : Array<Principal> }
|
|
277
|
+
export interface QueryStats {
|
|
278
|
+
'response_payload_bytes_total' : [] | [bigint],
|
|
279
|
+
'num_instructions_total' : [] | [bigint],
|
|
280
|
+
'num_calls_total' : [] | [bigint],
|
|
281
|
+
'request_payload_bytes_total' : [] | [bigint],
|
|
282
|
+
}
|
|
283
|
+
export interface RefreshBuyerTokensRequest {
|
|
284
|
+
'confirmation_text' : [] | [string],
|
|
285
|
+
'buyer' : string,
|
|
286
|
+
}
|
|
287
|
+
export interface RefreshBuyerTokensResponse {
|
|
288
|
+
'icp_accepted_participation_e8s' : bigint,
|
|
289
|
+
'icp_ledger_account_balance_e8s' : bigint,
|
|
290
|
+
}
|
|
291
|
+
export interface Response { 'governance_error' : [] | [GovernanceError] }
|
|
292
|
+
export type Result = { 'Ok' : Ok } |
|
|
293
|
+
{ 'Err' : Err };
|
|
294
|
+
export type Result_1 = { 'Ok' : Ok_2 } |
|
|
295
|
+
{ 'Err' : Err_1 };
|
|
296
|
+
export type Result_2 = { 'Ok' : Ok_2 } |
|
|
297
|
+
{ 'Err' : Err_2 };
|
|
298
|
+
export interface SetDappControllersCallResult {
|
|
299
|
+
'possibility' : [] | [Possibility],
|
|
300
|
+
}
|
|
301
|
+
export interface SetDappControllersResponse {
|
|
302
|
+
'failed_updates' : Array<FailedUpdate>,
|
|
303
|
+
}
|
|
304
|
+
export interface SetModeCallResult { 'possibility' : [] | [Possibility_3] }
|
|
305
|
+
export interface SettleCommunityFundParticipationResult {
|
|
306
|
+
'possibility' : [] | [Possibility_1],
|
|
307
|
+
}
|
|
308
|
+
export interface SettleNeuronsFundParticipationResult {
|
|
309
|
+
'possibility' : [] | [Possibility_2],
|
|
310
|
+
}
|
|
311
|
+
export interface SnsNeuronRecipe {
|
|
312
|
+
'sns' : [] | [TransferableAmount],
|
|
313
|
+
'claimed_status' : [] | [number],
|
|
314
|
+
'neuron_attributes' : [] | [NeuronAttributes],
|
|
315
|
+
'investor' : [] | [Investor],
|
|
316
|
+
}
|
|
317
|
+
export interface Swap {
|
|
318
|
+
'auto_finalize_swap_response' : [] | [FinalizeSwapResponse],
|
|
319
|
+
'neuron_recipes' : Array<SnsNeuronRecipe>,
|
|
320
|
+
'next_ticket_id' : [] | [bigint],
|
|
321
|
+
'decentralization_sale_open_timestamp_seconds' : [] | [bigint],
|
|
322
|
+
'finalize_swap_in_progress' : [] | [boolean],
|
|
323
|
+
'timers' : [] | [Timers],
|
|
324
|
+
'cf_participants' : Array<CfParticipant>,
|
|
325
|
+
'init' : [] | [Init],
|
|
326
|
+
'already_tried_to_auto_finalize' : [] | [boolean],
|
|
327
|
+
'neurons_fund_participation_icp_e8s' : [] | [bigint],
|
|
328
|
+
'purge_old_tickets_last_completion_timestamp_nanoseconds' : [] | [bigint],
|
|
329
|
+
'direct_participation_icp_e8s' : [] | [bigint],
|
|
330
|
+
'lifecycle' : number,
|
|
331
|
+
'purge_old_tickets_next_principal' : [] | [Uint8Array],
|
|
332
|
+
'decentralization_swap_termination_timestamp_seconds' : [] | [bigint],
|
|
333
|
+
'buyers' : Array<[string, BuyerState]>,
|
|
334
|
+
'params' : [] | [Params],
|
|
335
|
+
'open_sns_token_swap_proposal_id' : [] | [bigint],
|
|
336
|
+
}
|
|
337
|
+
export interface SweepResult {
|
|
338
|
+
'failure' : number,
|
|
339
|
+
'skipped' : number,
|
|
340
|
+
'invalid' : number,
|
|
341
|
+
'success' : number,
|
|
342
|
+
'global_failures' : number,
|
|
343
|
+
}
|
|
344
|
+
export interface Ticket {
|
|
345
|
+
'creation_time' : bigint,
|
|
346
|
+
'ticket_id' : bigint,
|
|
347
|
+
'account' : [] | [Icrc1Account],
|
|
348
|
+
'amount_icp_e8s' : bigint,
|
|
349
|
+
}
|
|
350
|
+
export interface Timers {
|
|
351
|
+
'last_spawned_timestamp_seconds' : [] | [bigint],
|
|
352
|
+
'last_reset_timestamp_seconds' : [] | [bigint],
|
|
353
|
+
'requires_periodic_tasks' : [] | [boolean],
|
|
354
|
+
}
|
|
355
|
+
export interface TransferableAmount {
|
|
356
|
+
'transfer_fee_paid_e8s' : [] | [bigint],
|
|
357
|
+
'transfer_start_timestamp_seconds' : bigint,
|
|
358
|
+
'amount_e8s' : bigint,
|
|
359
|
+
'amount_transferred_e8s' : [] | [bigint],
|
|
360
|
+
'transfer_success_timestamp_seconds' : bigint,
|
|
361
|
+
}
|
|
362
|
+
export interface _SERVICE {
|
|
363
|
+
'error_refund_icp' : ActorMethod<
|
|
364
|
+
[ErrorRefundIcpRequest],
|
|
365
|
+
ErrorRefundIcpResponse
|
|
366
|
+
>,
|
|
367
|
+
'finalize_swap' : ActorMethod<[{}], FinalizeSwapResponse>,
|
|
368
|
+
'get_auto_finalization_status' : ActorMethod<
|
|
369
|
+
[{}],
|
|
370
|
+
GetAutoFinalizationStatusResponse
|
|
371
|
+
>,
|
|
372
|
+
'get_buyer_state' : ActorMethod<
|
|
373
|
+
[GetBuyerStateRequest],
|
|
374
|
+
GetBuyerStateResponse
|
|
375
|
+
>,
|
|
376
|
+
'get_buyers_total' : ActorMethod<[{}], GetBuyersTotalResponse>,
|
|
377
|
+
'get_canister_status' : ActorMethod<[{}], CanisterStatusResultV2>,
|
|
378
|
+
'get_derived_state' : ActorMethod<[{}], GetDerivedStateResponse>,
|
|
379
|
+
'get_init' : ActorMethod<[{}], GetInitResponse>,
|
|
380
|
+
'get_lifecycle' : ActorMethod<[{}], GetLifecycleResponse>,
|
|
381
|
+
'get_open_ticket' : ActorMethod<[{}], GetOpenTicketResponse>,
|
|
382
|
+
'get_sale_parameters' : ActorMethod<[{}], GetSaleParametersResponse>,
|
|
383
|
+
'get_state' : ActorMethod<[{}], GetStateResponse>,
|
|
384
|
+
'get_timers' : ActorMethod<[{}], GetTimersResponse>,
|
|
385
|
+
'list_community_fund_participants' : ActorMethod<
|
|
386
|
+
[ListCommunityFundParticipantsRequest],
|
|
387
|
+
ListCommunityFundParticipantsResponse
|
|
388
|
+
>,
|
|
389
|
+
'list_direct_participants' : ActorMethod<
|
|
390
|
+
[ListDirectParticipantsRequest],
|
|
391
|
+
ListDirectParticipantsResponse
|
|
392
|
+
>,
|
|
393
|
+
'list_sns_neuron_recipes' : ActorMethod<
|
|
394
|
+
[ListSnsNeuronRecipesRequest],
|
|
395
|
+
ListSnsNeuronRecipesResponse
|
|
396
|
+
>,
|
|
397
|
+
'new_sale_ticket' : ActorMethod<
|
|
398
|
+
[NewSaleTicketRequest],
|
|
399
|
+
NewSaleTicketResponse
|
|
400
|
+
>,
|
|
401
|
+
'notify_payment_failure' : ActorMethod<[{}], Ok_2>,
|
|
402
|
+
'refresh_buyer_tokens' : ActorMethod<
|
|
403
|
+
[RefreshBuyerTokensRequest],
|
|
404
|
+
RefreshBuyerTokensResponse
|
|
405
|
+
>,
|
|
406
|
+
'reset_timers' : ActorMethod<[{}], {}>,
|
|
407
|
+
}
|
|
408
|
+
export declare const idlService: IDL.ServiceClass;
|
|
409
|
+
export declare const idlInitArgs: IDL.Type[];
|
|
410
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
411
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export const NeuronBasketConstructionParameters: IDL.RecordClass;
|
|
2
|
+
export const LinearScalingCoefficient: IDL.RecordClass;
|
|
3
|
+
export const IdealMatchedParticipationFunction: IDL.RecordClass;
|
|
4
|
+
export const NeuronsFundParticipationConstraints: IDL.RecordClass;
|
|
5
|
+
export const Countries: IDL.RecordClass;
|
|
6
|
+
export const Init: IDL.RecordClass;
|
|
7
|
+
export const ErrorRefundIcpRequest: IDL.RecordClass;
|
|
8
|
+
export const Ok: IDL.RecordClass;
|
|
9
|
+
export const Err: IDL.RecordClass;
|
|
10
|
+
export const Result: IDL.VariantClass;
|
|
11
|
+
export const ErrorRefundIcpResponse: IDL.RecordClass;
|
|
12
|
+
export const CanisterCallError: IDL.RecordClass;
|
|
13
|
+
export const FailedUpdate: IDL.RecordClass;
|
|
14
|
+
export const SetDappControllersResponse: IDL.RecordClass;
|
|
15
|
+
export const Possibility: IDL.VariantClass;
|
|
16
|
+
export const SetDappControllersCallResult: IDL.RecordClass;
|
|
17
|
+
export const SweepResult: IDL.RecordClass;
|
|
18
|
+
export const GovernanceError: IDL.RecordClass;
|
|
19
|
+
export const Response: IDL.RecordClass;
|
|
20
|
+
export const Possibility_1: IDL.VariantClass;
|
|
21
|
+
export const SettleCommunityFundParticipationResult: IDL.RecordClass;
|
|
22
|
+
export const Ok_1: IDL.RecordClass;
|
|
23
|
+
export const Error: IDL.RecordClass;
|
|
24
|
+
export const Possibility_2: IDL.VariantClass;
|
|
25
|
+
export const SettleNeuronsFundParticipationResult: IDL.RecordClass;
|
|
26
|
+
export const Possibility_3: IDL.VariantClass;
|
|
27
|
+
export const SetModeCallResult: IDL.RecordClass;
|
|
28
|
+
export const FinalizeSwapResponse: IDL.RecordClass;
|
|
29
|
+
export const GetAutoFinalizationStatusResponse: IDL.RecordClass;
|
|
30
|
+
export const GetBuyerStateRequest: IDL.RecordClass;
|
|
31
|
+
export const TransferableAmount: IDL.RecordClass;
|
|
32
|
+
export const BuyerState: IDL.RecordClass;
|
|
33
|
+
export const GetBuyerStateResponse: IDL.RecordClass;
|
|
34
|
+
export const GetBuyersTotalResponse: IDL.RecordClass;
|
|
35
|
+
export const MemoryMetrics: IDL.RecordClass;
|
|
36
|
+
export const CanisterStatusType: IDL.VariantClass;
|
|
37
|
+
export const DefiniteCanisterSettingsArgs: IDL.RecordClass;
|
|
38
|
+
export const QueryStats: IDL.RecordClass;
|
|
39
|
+
export const CanisterStatusResultV2: IDL.RecordClass;
|
|
40
|
+
export const GetDerivedStateResponse: IDL.RecordClass;
|
|
41
|
+
export const GetInitResponse: IDL.RecordClass;
|
|
42
|
+
export const GetLifecycleResponse: IDL.RecordClass;
|
|
43
|
+
export const Icrc1Account: IDL.RecordClass;
|
|
44
|
+
export const Ticket: IDL.RecordClass;
|
|
45
|
+
export const Ok_2: IDL.RecordClass;
|
|
46
|
+
export const Err_1: IDL.RecordClass;
|
|
47
|
+
export const Result_1: IDL.VariantClass;
|
|
48
|
+
export const GetOpenTicketResponse: IDL.RecordClass;
|
|
49
|
+
export const Params: IDL.RecordClass;
|
|
50
|
+
export const GetSaleParametersResponse: IDL.RecordClass;
|
|
51
|
+
export const NeuronId: IDL.RecordClass;
|
|
52
|
+
export const NeuronAttributes: IDL.RecordClass;
|
|
53
|
+
export const Principals: IDL.RecordClass;
|
|
54
|
+
export const CfInvestment: IDL.RecordClass;
|
|
55
|
+
export const DirectInvestment: IDL.RecordClass;
|
|
56
|
+
export const Investor: IDL.VariantClass;
|
|
57
|
+
export const SnsNeuronRecipe: IDL.RecordClass;
|
|
58
|
+
export const Timers: IDL.RecordClass;
|
|
59
|
+
export const CfNeuron: IDL.RecordClass;
|
|
60
|
+
export const CfParticipant: IDL.RecordClass;
|
|
61
|
+
export const Swap: IDL.RecordClass;
|
|
62
|
+
export const DerivedState: IDL.RecordClass;
|
|
63
|
+
export const GetStateResponse: IDL.RecordClass;
|
|
64
|
+
export const GetTimersResponse: IDL.RecordClass;
|
|
65
|
+
export const ListCommunityFundParticipantsRequest: IDL.RecordClass;
|
|
66
|
+
export const ListCommunityFundParticipantsResponse: IDL.RecordClass;
|
|
67
|
+
export const ListDirectParticipantsRequest: IDL.RecordClass;
|
|
68
|
+
export const Participant: IDL.RecordClass;
|
|
69
|
+
export const ListDirectParticipantsResponse: IDL.RecordClass;
|
|
70
|
+
export const ListSnsNeuronRecipesRequest: IDL.RecordClass;
|
|
71
|
+
export const ListSnsNeuronRecipesResponse: IDL.RecordClass;
|
|
72
|
+
export const NewSaleTicketRequest: IDL.RecordClass;
|
|
73
|
+
export const InvalidUserAmount: IDL.RecordClass;
|
|
74
|
+
export const Err_2: IDL.RecordClass;
|
|
75
|
+
export const Result_2: IDL.VariantClass;
|
|
76
|
+
export const NewSaleTicketResponse: IDL.RecordClass;
|
|
77
|
+
export const RefreshBuyerTokensRequest: IDL.RecordClass;
|
|
78
|
+
export const RefreshBuyerTokensResponse: IDL.RecordClass;
|
|
79
|
+
export const idlService: IDL.ServiceClass<string, {
|
|
80
|
+
error_refund_icp: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
81
|
+
finalize_swap: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
82
|
+
get_auto_finalization_status: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
83
|
+
get_buyer_state: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
84
|
+
get_buyers_total: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
85
|
+
get_canister_status: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
86
|
+
get_derived_state: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
87
|
+
get_init: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
88
|
+
get_lifecycle: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
89
|
+
get_open_ticket: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
90
|
+
get_sale_parameters: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
91
|
+
get_state: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
92
|
+
get_timers: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
93
|
+
list_community_fund_participants: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
94
|
+
list_direct_participants: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
95
|
+
list_sns_neuron_recipes: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
96
|
+
new_sale_ticket: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
97
|
+
notify_payment_failure: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
98
|
+
refresh_buyer_tokens: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
99
|
+
reset_timers: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
100
|
+
}>;
|
|
101
|
+
export const idlInitArgs: IDL.RecordClass[];
|
|
102
|
+
export function idlFactory({ IDL }: {
|
|
103
|
+
IDL: any;
|
|
104
|
+
}): any;
|
|
105
|
+
export function init({ IDL }: {
|
|
106
|
+
IDL: any;
|
|
107
|
+
}): any[];
|
|
108
|
+
import { IDL } from '@icp-sdk/core/candid';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IcManagementIdl, type IcManagementDid } from '../declarations';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './schemas';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as d}from"../../../chunk-BXZ5PSUW.js";import{a}from"../../../chunk-5NZMOUKF.js";import{g as t}from"../../../chunk-EMQQE34V.js";import{a as p}from"../../../chunk-TZVF5LQY.js";import"../../../chunk-7B6WU32N.js";import{g as i,h as e}from"../../../chunk-HANEPD6T.js";import"../../../chunk-4C666HHU.js";var s=class extends a{constructor(r={}){p.parse(r),super({canisterId:r?.canisterId??d})}transfer=async({args:r})=>await t({canisterId:this.canisterId,method:"transfer",args:[[e.TransferArgs,r]],result:e.TransferResult})};export{i as IcpIndexIdl,s as IcpLedgerCanister,e as IcpLedgerIdl};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/canisters/ledger/icp/ledger.canister.ts"],
|
|
4
|
+
"sourcesContent": ["import {call} from '../../../ic-cdk/call.ic-cdk';\nimport {Canister} from '../../_canister';\nimport {ICP_LEDGER_ID} from '../../_constants';\nimport {type IcpLedgerDid, IcpLedgerIdl} from '../../declarations';\nimport {type CanisterOptions, CanisterOptionsSchema} from '../../schemas';\n\n/**\n * Provides a simple interface to interact with the ICP Ledger,\n * when developing Juno Serverless Functions in TypeScript.\n *\n * @param {CanisterOptions} [options] - Optional custom canister ID.\n */\nexport class IcpLedgerCanister extends Canister {\n constructor(options: CanisterOptions = {}) {\n CanisterOptionsSchema.parse(options);\n\n super({canisterId: options?.canisterId ?? ICP_LEDGER_ID});\n }\n\n /**\n * Sends ICP using the Ledger canister `transfer` method.\n *\n * Use this to transfer ICP from one account to another when writing\n * Juno Serverless Functions in TypeScript.\n *\n * @param {IcpLedgerDid.TransferArgs} args - The ledger transfer arguments (amount, destination account, memo, fee, etc.).\n * @returns {Promise<IcpLedgerDid.TransferResult>} The result of the ICP transfer.\n */\n transfer = async ({\n args\n }: {\n args: IcpLedgerDid.TransferArgs;\n }): Promise<IcpLedgerDid.TransferResult> =>\n await call<IcpLedgerDid.TransferResult>({\n canisterId: this.canisterId,\n method: 'transfer',\n args: [[IcpLedgerIdl.TransferArgs, args]],\n result: IcpLedgerIdl.TransferResult\n });\n}\n"],
|
|
5
|
+
"mappings": "mTAYO,IAAMA,EAAN,cAAgCC,CAAS,CAC9C,YAAYC,EAA2B,CAAC,EAAG,CACzCC,EAAsB,MAAMD,CAAO,EAEnC,MAAM,CAAC,WAAYA,GAAS,YAAcE,CAAa,CAAC,CAC1D,CAWA,SAAW,MAAO,CAChB,KAAAC,CACF,IAGE,MAAMC,EAAkC,CACtC,WAAY,KAAK,WACjB,OAAQ,WACR,KAAM,CAAC,CAACC,EAAa,aAAcF,CAAI,CAAC,EACxC,OAAQE,EAAa,cACvB,CAAC,CACL",
|
|
6
|
+
"names": ["IcpLedgerCanister", "Canister", "options", "CanisterOptionsSchema", "ICP_LEDGER_ID", "args", "call", "ledger_did_idl_exports"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Canister } from '../../_canister';
|
|
2
|
+
import { type IcpLedgerDid } from '../../declarations';
|
|
3
|
+
import { type CanisterOptions } from '../../schemas';
|
|
4
|
+
/**
|
|
5
|
+
* Provides a simple interface to interact with the ICP Ledger,
|
|
6
|
+
* when developing Juno Serverless Functions in TypeScript.
|
|
7
|
+
*
|
|
8
|
+
* @param {CanisterOptions} [options] - Optional custom canister ID.
|
|
9
|
+
*/
|
|
10
|
+
export declare class IcpLedgerCanister extends Canister {
|
|
11
|
+
constructor(options?: CanisterOptions);
|
|
12
|
+
/**
|
|
13
|
+
* Sends ICP using the Ledger canister `transfer` method.
|
|
14
|
+
*
|
|
15
|
+
* Use this to transfer ICP from one account to another when writing
|
|
16
|
+
* Juno Serverless Functions in TypeScript.
|
|
17
|
+
*
|
|
18
|
+
* @param {IcpLedgerDid.TransferArgs} args - The ledger transfer arguments (amount, destination account, memo, fee, etc.).
|
|
19
|
+
* @returns {Promise<IcpLedgerDid.TransferResult>} The result of the ICP transfer.
|
|
20
|
+
*/
|
|
21
|
+
transfer: ({ args }: {
|
|
22
|
+
args: IcpLedgerDid.TransferArgs;
|
|
23
|
+
}) => Promise<IcpLedgerDid.TransferResult>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"../../../chunk-5NZMOUKF.js";import{g as c}from"../../../chunk-EMQQE34V.js";import{a as t}from"../../../chunk-TZVF5LQY.js";import"../../../chunk-7B6WU32N.js";import{i as n,j as e}from"../../../chunk-HANEPD6T.js";import"../../../chunk-4C666HHU.js";var i=t.required();var s=class extends a{constructor(r){i.parse(r),super({canisterId:r.canisterId})}icrc1BalanceOf=async({account:r})=>await c({canisterId:this.canisterId,method:"icrc1_balance_of",args:[[e.Account,r]],result:e.Tokens});icrc1Transfer=async({args:r})=>await c({canisterId:this.canisterId,method:"icrc1_transfer",args:[[e.TransferArg,r]],result:e.TransferResult});icrc2TransferFrom=async({args:r})=>await c({canisterId:this.canisterId,method:"icrc2_transfer_from",args:[[e.TransferFromArgs,r]],result:e.TransferFromResult})};export{i as IcrcCanisterOptionsSchema,n as IcrcIndexNgIdl,s as IcrcLedgerCanister,e as IcrcLedgerIdl};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/canisters/ledger/icrc/schemas.ts", "../../../src/canisters/ledger/icrc/ledger.canister.ts"],
|
|
4
|
+
"sourcesContent": ["import type * as z from 'zod';\nimport {CanisterOptionsSchema} from '../../schemas';\n\n/**\n * @see CanisterOptions\n */\nexport const IcrcCanisterOptionsSchema = CanisterOptionsSchema.required();\n\n/**\n * The options to initialize an Icrc canister.\n */\nexport type IcrcCanisterOptions = z.infer<typeof IcrcCanisterOptionsSchema>;\n", "import {call} from '../../../ic-cdk/call.ic-cdk';\nimport {Canister} from '../../_canister';\nimport {type IcrcLedgerDid, IcrcLedgerIdl} from '../../declarations';\nimport {type IcrcCanisterOptions, IcrcCanisterOptionsSchema} from './schemas';\n\n/**\n * Provides a simple interface to interact with an ICRC Ledger,\n * when developing Juno Serverless Functions in TypeScript.\n *\n * @param {CanisterOptions} [options] - The options providing the ICRC ledger canister ID.\n */\nexport class IcrcLedgerCanister extends Canister {\n constructor(options: IcrcCanisterOptions) {\n IcrcCanisterOptionsSchema.parse(options);\n\n super({canisterId: options.canisterId});\n }\n\n /**\n * Returns the balance of an ICRC account.\n *\n * @param {IcrcLedgerDid.Account} account - The account to query.\n * @returns {Promise<IcrcLedgerDid.Tokens>} The token balance for the account.\n */\n icrc1BalanceOf = async ({\n account\n }: {\n account: IcrcLedgerDid.Account;\n }): Promise<IcrcLedgerDid.Tokens> =>\n await call<IcrcLedgerDid.Tokens>({\n canisterId: this.canisterId,\n method: 'icrc1_balance_of',\n args: [[IcrcLedgerIdl.Account, account]],\n result: IcrcLedgerIdl.Tokens\n });\n\n /**\n * Transfers tokens using the ICRC-1 `icrc1_transfer` method.\n *\n * Use this to send tokens from the caller's account to another account\n * when writing Juno Serverless Functions in TypeScript.\n *\n * @param {IcrcLedgerDid.TransferArg} args - Transfer arguments (amount, fee, to, memo, created_at_time, etc.).\n * @returns {Promise<IcrcLedgerDid.TransferResult>} The result of the transfer.\n */\n icrc1Transfer = async ({\n args\n }: {\n args: IcrcLedgerDid.TransferArg;\n }): Promise<IcrcLedgerDid.TransferResult> =>\n await call<IcrcLedgerDid.TransferResult>({\n canisterId: this.canisterId,\n method: 'icrc1_transfer',\n args: [[IcrcLedgerIdl.TransferArg, args]],\n result: IcrcLedgerIdl.TransferResult\n });\n\n /**\n * Transfers tokens using the ICRC-2 `icrc2_transfer_from` method.\n *\n * Allows transferring tokens from another user's account when an approval\n * has previously been granted via `icrc2_approve`.\n *\n * @param {IcrcLedgerDid.TransferFromArgs} args - Transfer-from arguments (amount, from_subaccount, spender, etc.).\n * @returns {Promise<IcrcLedgerDid.TransferFromResult>} The result of the transfer-from operation.\n */\n icrc2TransferFrom = async ({\n args\n }: {\n args: IcrcLedgerDid.TransferFromArgs;\n }): Promise<IcrcLedgerDid.TransferFromResult> =>\n await call<IcrcLedgerDid.TransferFromResult>({\n canisterId: this.canisterId,\n method: 'icrc2_transfer_from',\n args: [[IcrcLedgerIdl.TransferFromArgs, args]],\n result: IcrcLedgerIdl.TransferFromResult\n });\n}\n"],
|
|
5
|
+
"mappings": "oQAMO,IAAMA,EAA4BC,EAAsB,SAAS,ECKjE,IAAMC,EAAN,cAAiCC,CAAS,CAC/C,YAAYC,EAA8B,CACxCC,EAA0B,MAAMD,CAAO,EAEvC,MAAM,CAAC,WAAYA,EAAQ,UAAU,CAAC,CACxC,CAQA,eAAiB,MAAO,CACtB,QAAAE,CACF,IAGE,MAAMC,EAA2B,CAC/B,WAAY,KAAK,WACjB,OAAQ,mBACR,KAAM,CAAC,CAACC,EAAc,QAASF,CAAO,CAAC,EACvC,OAAQE,EAAc,MACxB,CAAC,EAWH,cAAgB,MAAO,CACrB,KAAAC,CACF,IAGE,MAAMF,EAAmC,CACvC,WAAY,KAAK,WACjB,OAAQ,iBACR,KAAM,CAAC,CAACC,EAAc,YAAaC,CAAI,CAAC,EACxC,OAAQD,EAAc,cACxB,CAAC,EAWH,kBAAoB,MAAO,CACzB,KAAAC,CACF,IAGE,MAAMF,EAAuC,CAC3C,WAAY,KAAK,WACjB,OAAQ,sBACR,KAAM,CAAC,CAACC,EAAc,iBAAkBC,CAAI,CAAC,EAC7C,OAAQD,EAAc,kBACxB,CAAC,CACL",
|
|
6
|
+
"names": ["IcrcCanisterOptionsSchema", "CanisterOptionsSchema", "IcrcLedgerCanister", "Canister", "options", "IcrcCanisterOptionsSchema", "account", "call", "icrc_ledger_did_idl_exports", "args"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Canister } from '../../_canister';
|
|
2
|
+
import { type IcrcLedgerDid } from '../../declarations';
|
|
3
|
+
import { type IcrcCanisterOptions } from './schemas';
|
|
4
|
+
/**
|
|
5
|
+
* Provides a simple interface to interact with an ICRC Ledger,
|
|
6
|
+
* when developing Juno Serverless Functions in TypeScript.
|
|
7
|
+
*
|
|
8
|
+
* @param {CanisterOptions} [options] - The options providing the ICRC ledger canister ID.
|
|
9
|
+
*/
|
|
10
|
+
export declare class IcrcLedgerCanister extends Canister {
|
|
11
|
+
constructor(options: IcrcCanisterOptions);
|
|
12
|
+
/**
|
|
13
|
+
* Returns the balance of an ICRC account.
|
|
14
|
+
*
|
|
15
|
+
* @param {IcrcLedgerDid.Account} account - The account to query.
|
|
16
|
+
* @returns {Promise<IcrcLedgerDid.Tokens>} The token balance for the account.
|
|
17
|
+
*/
|
|
18
|
+
icrc1BalanceOf: ({ account }: {
|
|
19
|
+
account: IcrcLedgerDid.Account;
|
|
20
|
+
}) => Promise<IcrcLedgerDid.Tokens>;
|
|
21
|
+
/**
|
|
22
|
+
* Transfers tokens using the ICRC-1 `icrc1_transfer` method.
|
|
23
|
+
*
|
|
24
|
+
* Use this to send tokens from the caller's account to another account
|
|
25
|
+
* when writing Juno Serverless Functions in TypeScript.
|
|
26
|
+
*
|
|
27
|
+
* @param {IcrcLedgerDid.TransferArg} args - Transfer arguments (amount, fee, to, memo, created_at_time, etc.).
|
|
28
|
+
* @returns {Promise<IcrcLedgerDid.TransferResult>} The result of the transfer.
|
|
29
|
+
*/
|
|
30
|
+
icrc1Transfer: ({ args }: {
|
|
31
|
+
args: IcrcLedgerDid.TransferArg;
|
|
32
|
+
}) => Promise<IcrcLedgerDid.TransferResult>;
|
|
33
|
+
/**
|
|
34
|
+
* Transfers tokens using the ICRC-2 `icrc2_transfer_from` method.
|
|
35
|
+
*
|
|
36
|
+
* Allows transferring tokens from another user's account when an approval
|
|
37
|
+
* has previously been granted via `icrc2_approve`.
|
|
38
|
+
*
|
|
39
|
+
* @param {IcrcLedgerDid.TransferFromArgs} args - Transfer-from arguments (amount, from_subaccount, spender, etc.).
|
|
40
|
+
* @returns {Promise<IcrcLedgerDid.TransferFromResult>} The result of the transfer-from operation.
|
|
41
|
+
*/
|
|
42
|
+
icrc2TransferFrom: ({ args }: {
|
|
43
|
+
args: IcrcLedgerDid.TransferFromArgs;
|
|
44
|
+
}) => Promise<IcrcLedgerDid.TransferFromResult>;
|
|
45
|
+
}
|