@junobuild/functions 0.8.3 → 0.8.4-next-2026-04-17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/canisters/ckbtc/index.js +1 -1
- package/canisters/cketh/index.js +1 -1
- package/canisters/cmc/index.js +1 -1
- package/canisters/declarations/_idl.d.ts +2 -1
- package/canisters/declarations/_types.d.ts +2 -1
- package/canisters/declarations/ckbtc/bitcoin.did.d.ts +8 -0
- package/canisters/declarations/ckbtc/bitcoin.did.idl.d.ts +2 -0
- package/canisters/declarations/ckbtc/minter.did.d.ts +190 -0
- package/canisters/declarations/ckbtc/minter.did.idl.d.ts +9 -0
- package/canisters/declarations/cketh/minter.did.d.ts +140 -0
- package/canisters/declarations/cketh/minter.did.idl.d.ts +8 -0
- package/canisters/declarations/cycles-ledger/cycles-ledger.did.d.ts +413 -0
- package/canisters/declarations/cycles-ledger/cycles-ledger.did.idl.d.ts +82 -0
- package/canisters/declarations/ic-management/ic-management.did.d.ts +18 -4
- package/canisters/declarations/ledger-icp/index.did.d.ts +20 -1
- package/canisters/declarations/ledger-icp/index.did.idl.d.ts +5 -1
- package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +1 -0
- package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +1 -0
- package/canisters/declarations/nns/governance.did.d.ts +100 -0
- package/canisters/declarations/nns/governance.did.idl.d.ts +11 -0
- package/canisters/declarations/nns/governance_test.did.d.ts +100 -0
- package/canisters/declarations/nns/governance_test.did.idl.d.ts +11 -0
- package/canisters/declarations/nns/sns_wasm.did.d.ts +4 -0
- package/canisters/declarations/nns/sns_wasm.did.idl.d.ts +1 -0
- package/canisters/declarations/sns/governance.did.d.ts +4 -0
- package/canisters/declarations/sns/governance.did.idl.d.ts +1 -0
- package/canisters/declarations/sns/governance_test.did.d.ts +4 -0
- package/canisters/declarations/sns/governance_test.did.idl.d.ts +1 -0
- package/canisters/ic-management/index.js +1 -1
- package/canisters/ledger/cycles/index.d.ts +1 -0
- package/canisters/ledger/cycles/index.js +2 -0
- package/canisters/ledger/cycles/index.js.map +7 -0
- package/canisters/ledger/icp/index.d.ts +1 -0
- package/canisters/ledger/icp/index.js +1 -1
- package/canisters/ledger/icp/index.js.map +4 -4
- package/canisters/ledger/icp/ledger.canister.d.ts +5 -5
- package/canisters/ledger/icp/schema.d.ts +152 -0
- package/canisters/ledger/icrc/index.d.ts +1 -1
- package/canisters/ledger/icrc/index.js +1 -1
- package/canisters/ledger/icrc/index.js.map +4 -4
- package/canisters/ledger/icrc/ledger.canister.d.ts +13 -14
- package/canisters/ledger/icrc/schema.d.ts +351 -0
- package/canisters/nns/index.js +1 -1
- package/canisters/sns/index.js +1 -1
- package/chunk-I3WMKZTG.js +2 -0
- package/chunk-I3WMKZTG.js.map +7 -0
- package/package.json +10 -6
- package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +8 -0
- package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +16 -0
- package/src/canisters/declarations/ckbtc/minter.did.d.ts +190 -0
- package/src/canisters/declarations/ckbtc/minter.did.idl.js +118 -0
- package/src/canisters/declarations/cketh/minter.did.d.ts +140 -0
- package/src/canisters/declarations/cketh/minter.did.idl.js +78 -0
- package/src/canisters/declarations/cycles-ledger/cycles-ledger.did.d.ts +413 -0
- package/src/canisters/declarations/cycles-ledger/cycles-ledger.did.idl.js +806 -0
- package/src/canisters/declarations/ic-management/ic-management.did.d.ts +18 -4
- package/src/canisters/declarations/ic-management/ic-management.did.idl.js +32 -8
- package/src/canisters/declarations/ledger-icp/index.did.d.ts +20 -1
- package/src/canisters/declarations/ledger-icp/index.did.idl.js +32 -5
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +1 -0
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +2 -0
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +1 -0
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +2 -0
- package/src/canisters/declarations/nns/governance.did.d.ts +100 -0
- package/src/canisters/declarations/nns/governance.did.idl.js +132 -0
- package/src/canisters/declarations/nns/governance_test.did.d.ts +100 -0
- package/src/canisters/declarations/nns/governance_test.did.idl.js +132 -0
- package/src/canisters/declarations/nns/sns_wasm.did.d.ts +4 -0
- package/src/canisters/declarations/nns/sns_wasm.did.idl.js +8 -0
- package/src/canisters/declarations/sns/governance.did.d.ts +4 -0
- package/src/canisters/declarations/sns/governance.did.idl.js +12 -0
- package/src/canisters/declarations/sns/governance_test.did.d.ts +4 -0
- package/src/canisters/declarations/sns/governance_test.did.idl.js +12 -0
- package/canisters/ledger/icrc/schemas.d.ts +0 -11
- package/chunk-I4MVAQHI.js +0 -2
- package/chunk-I4MVAQHI.js.map +0 -7
|
@@ -18,9 +18,12 @@ export interface AccountIdentifier { 'hash' : Uint8Array }
|
|
|
18
18
|
export type Action = { 'RegisterKnownNeuron' : KnownNeuron } |
|
|
19
19
|
{ 'FulfillSubnetRentalRequest' : FulfillSubnetRentalRequest } |
|
|
20
20
|
{ 'ManageNeuron' : ManageNeuronProposal } |
|
|
21
|
+
{ 'LoadCanisterSnapshot' : LoadCanisterSnapshot } |
|
|
22
|
+
{ 'BlessAlternativeGuestOsVersion' : BlessAlternativeGuestOsVersion } |
|
|
21
23
|
{ 'UpdateCanisterSettings' : UpdateCanisterSettings } |
|
|
22
24
|
{ 'InstallCode' : InstallCode } |
|
|
23
25
|
{ 'DeregisterKnownNeuron' : DeregisterKnownNeuron } |
|
|
26
|
+
{ 'TakeCanisterSnapshot' : TakeCanisterSnapshot } |
|
|
24
27
|
{ 'StopOrStartCanister' : StopOrStartCanister } |
|
|
25
28
|
{ 'CreateServiceNervousSystem' : CreateServiceNervousSystem } |
|
|
26
29
|
{ 'ExecuteNnsFunction' : ExecuteNnsFunction } |
|
|
@@ -42,6 +45,29 @@ export interface BallotInfo {
|
|
|
42
45
|
'vote' : number,
|
|
43
46
|
'proposal_id' : [] | [ProposalId],
|
|
44
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Declares an approved set of alternative replica virtual machine software for
|
|
50
|
+
* disaster recovery purposes.
|
|
51
|
+
*/
|
|
52
|
+
export interface BlessAlternativeGuestOsVersion {
|
|
53
|
+
/**
|
|
54
|
+
* Hexadecimal fingerprint of the recovery rootfs.
|
|
55
|
+
* Must contain only hexadecimal characters (0-9, A-F, a-f).
|
|
56
|
+
*/
|
|
57
|
+
'rootfs_hash' : [] | [string],
|
|
58
|
+
/**
|
|
59
|
+
* AMD Secure Processor chip IDs that are allowed to run this software.
|
|
60
|
+
* Each chip ID must be exactly 64 bytes.
|
|
61
|
+
*/
|
|
62
|
+
'chip_ids' : [] | [Array<Uint8Array>],
|
|
63
|
+
/**
|
|
64
|
+
* The version being replaced by this (alternative version) must match this
|
|
65
|
+
* field (or one of the possibilities therein).
|
|
66
|
+
*
|
|
67
|
+
* (Here, we refer to the version being replaced as the "base" version.)
|
|
68
|
+
*/
|
|
69
|
+
'base_guest_launch_measurements' : [] | [GuestLaunchMeasurements],
|
|
70
|
+
}
|
|
45
71
|
export type By = { 'NeuronIdOrSubaccount' : {} } |
|
|
46
72
|
{ 'MemoAndController' : ClaimOrRefreshNeuronFromAccount } |
|
|
47
73
|
{ 'Memo' : bigint };
|
|
@@ -122,6 +148,42 @@ export interface Committed_1 {
|
|
|
122
148
|
export interface Configure { 'operation' : [] | [Operation] }
|
|
123
149
|
export interface Controllers { 'controllers' : Array<Principal> }
|
|
124
150
|
export interface Countries { 'iso_codes' : Array<string> }
|
|
151
|
+
/**
|
|
152
|
+
* Request to create a new neuron using ICRC-2 transfer_from.
|
|
153
|
+
* The caller must have previously approved the governance canister to spend the specified amount.
|
|
154
|
+
*/
|
|
155
|
+
export interface CreateNeuronRequest {
|
|
156
|
+
/**
|
|
157
|
+
* The controller of the new neuron. Defaults to the caller.
|
|
158
|
+
*/
|
|
159
|
+
'controller' : [] | [Principal],
|
|
160
|
+
/**
|
|
161
|
+
* The subaccount of the caller to transfer ICP from. Defaults to the default subaccount.
|
|
162
|
+
*/
|
|
163
|
+
'source_subaccount' : [] | [Uint8Array],
|
|
164
|
+
/**
|
|
165
|
+
* The dissolve delay in seconds. Defaults to 7 days. Clamped to [0, 8 years].
|
|
166
|
+
*/
|
|
167
|
+
'dissolve_delay_seconds' : [] | [bigint],
|
|
168
|
+
/**
|
|
169
|
+
* Whether to automatically stake maturity. Defaults to false.
|
|
170
|
+
*/
|
|
171
|
+
'auto_stake_maturity' : [] | [boolean],
|
|
172
|
+
/**
|
|
173
|
+
* Required. The amount of ICP to stake in e8s.
|
|
174
|
+
*/
|
|
175
|
+
'amount_e8s' : [] | [bigint],
|
|
176
|
+
/**
|
|
177
|
+
* The followees to set for the new neuron. Defaults to the network's default followees.
|
|
178
|
+
*/
|
|
179
|
+
'followees' : [] | [SetFollowing],
|
|
180
|
+
/**
|
|
181
|
+
* Whether the neuron should start dissolving immediately. Defaults to false.
|
|
182
|
+
*/
|
|
183
|
+
'dissolving' : [] | [boolean],
|
|
184
|
+
}
|
|
185
|
+
export type CreateNeuronResponse = { 'Ok' : CreatedNeuron } |
|
|
186
|
+
{ 'Err' : GovernanceError };
|
|
125
187
|
export interface CreateServiceNervousSystem {
|
|
126
188
|
'url' : [] | [string],
|
|
127
189
|
'governance_parameters' : [] | [GovernanceParameters],
|
|
@@ -134,6 +196,10 @@ export interface CreateServiceNervousSystem {
|
|
|
134
196
|
'swap_parameters' : [] | [SwapParameters],
|
|
135
197
|
'initial_token_distribution' : [] | [InitialTokenDistribution],
|
|
136
198
|
}
|
|
199
|
+
export interface CreatedNeuron { 'neuron_id' : [] | [NeuronId] }
|
|
200
|
+
export interface CustomProposalCriticality {
|
|
201
|
+
'additional_critical_native_action_ids' : [] | [BigUint64Array],
|
|
202
|
+
}
|
|
137
203
|
export interface DateRangeFilter {
|
|
138
204
|
'start_timestamp_seconds' : [] | [bigint],
|
|
139
205
|
'end_timestamp_seconds' : [] | [bigint],
|
|
@@ -319,9 +385,29 @@ export interface GovernanceParameters {
|
|
|
319
385
|
'neuron_minimum_stake' : [] | [Tokens],
|
|
320
386
|
'proposal_wait_for_quiet_deadline_increase' : [] | [Duration],
|
|
321
387
|
'proposal_initial_voting_period' : [] | [Duration],
|
|
388
|
+
'custom_proposal_criticality' : [] | [CustomProposalCriticality],
|
|
322
389
|
'proposal_rejection_fee' : [] | [Tokens],
|
|
323
390
|
'voting_reward_parameters' : [] | [VotingRewardParameters],
|
|
324
391
|
}
|
|
392
|
+
export interface GuestLaunchMeasurement {
|
|
393
|
+
/**
|
|
394
|
+
* Metadata associated with the measurement.
|
|
395
|
+
*/
|
|
396
|
+
'metadata' : [] | [GuestLaunchMeasurementMetadata],
|
|
397
|
+
/**
|
|
398
|
+
* SEV-SNP measurement (48 bytes).
|
|
399
|
+
*/
|
|
400
|
+
'measurement' : [] | [Uint8Array],
|
|
401
|
+
}
|
|
402
|
+
export interface GuestLaunchMeasurementMetadata {
|
|
403
|
+
/**
|
|
404
|
+
* Kernel command line used for this measurement.
|
|
405
|
+
*/
|
|
406
|
+
'kernel_cmdline' : [] | [string],
|
|
407
|
+
}
|
|
408
|
+
export interface GuestLaunchMeasurements {
|
|
409
|
+
'guest_launch_measurements' : [] | [Array<GuestLaunchMeasurement>],
|
|
410
|
+
}
|
|
325
411
|
export interface IdealMatchedParticipationFunction {
|
|
326
412
|
'serialized_representation' : [] | [string],
|
|
327
413
|
}
|
|
@@ -473,6 +559,10 @@ export interface ListProposalInfoRequest {
|
|
|
473
559
|
export interface ListProposalInfoResponse {
|
|
474
560
|
'proposal_info' : Array<ProposalInfo>,
|
|
475
561
|
}
|
|
562
|
+
export interface LoadCanisterSnapshot {
|
|
563
|
+
'canister_id' : [] | [Principal],
|
|
564
|
+
'snapshot_id' : [] | [Uint8Array],
|
|
565
|
+
}
|
|
476
566
|
export interface MakeProposalRequest {
|
|
477
567
|
'url' : string,
|
|
478
568
|
'title' : [] | [string],
|
|
@@ -892,9 +982,12 @@ export interface Proposal {
|
|
|
892
982
|
export type ProposalActionRequest = { 'RegisterKnownNeuron' : KnownNeuron } |
|
|
893
983
|
{ 'FulfillSubnetRentalRequest' : FulfillSubnetRentalRequest } |
|
|
894
984
|
{ 'ManageNeuron' : ManageNeuronRequest } |
|
|
985
|
+
{ 'LoadCanisterSnapshot' : LoadCanisterSnapshot } |
|
|
986
|
+
{ 'BlessAlternativeGuestOsVersion' : BlessAlternativeGuestOsVersion } |
|
|
895
987
|
{ 'UpdateCanisterSettings' : UpdateCanisterSettings } |
|
|
896
988
|
{ 'InstallCode' : InstallCodeRequest } |
|
|
897
989
|
{ 'DeregisterKnownNeuron' : DeregisterKnownNeuron } |
|
|
990
|
+
{ 'TakeCanisterSnapshot' : TakeCanisterSnapshot } |
|
|
898
991
|
{ 'StopOrStartCanister' : StopOrStartCanister } |
|
|
899
992
|
{ 'CreateServiceNervousSystem' : CreateServiceNervousSystem } |
|
|
900
993
|
{ 'ExecuteNnsFunction' : ExecuteNnsFunction } |
|
|
@@ -1021,6 +1114,8 @@ export type SelfDescribingValue = { 'Int' : bigint } |
|
|
|
1021
1114
|
{ 'Map' : Array<[string, SelfDescribingValue]> } |
|
|
1022
1115
|
{ 'Nat' : bigint } |
|
|
1023
1116
|
{ 'Blob' : Uint8Array } |
|
|
1117
|
+
{ 'Bool' : boolean } |
|
|
1118
|
+
{ 'Null' : null } |
|
|
1024
1119
|
{ 'Text' : string } |
|
|
1025
1120
|
{ 'Array' : Array<SelfDescribingValue> };
|
|
1026
1121
|
export interface SetDefaultFollowees {
|
|
@@ -1101,6 +1196,10 @@ export interface SwapParticipationLimits {
|
|
|
1101
1196
|
'min_direct_participation_icp_e8s' : [] | [bigint],
|
|
1102
1197
|
'max_direct_participation_icp_e8s' : [] | [bigint],
|
|
1103
1198
|
}
|
|
1199
|
+
export interface TakeCanisterSnapshot {
|
|
1200
|
+
'replace_snapshot' : [] | [Uint8Array],
|
|
1201
|
+
'canister_id' : [] | [Principal],
|
|
1202
|
+
}
|
|
1104
1203
|
export interface Tally {
|
|
1105
1204
|
'no' : bigint,
|
|
1106
1205
|
'yes' : bigint,
|
|
@@ -1206,6 +1305,7 @@ export interface _SERVICE {
|
|
|
1206
1305
|
[ClaimOrRefreshNeuronFromAccount],
|
|
1207
1306
|
ClaimOrRefreshNeuronFromAccountResponse
|
|
1208
1307
|
>,
|
|
1308
|
+
'create_neuron' : ActorMethod<[CreateNeuronRequest], CreateNeuronResponse>,
|
|
1209
1309
|
'get_build_metadata' : ActorMethod<[], string>,
|
|
1210
1310
|
'get_full_neuron' : ActorMethod<[bigint], Result_2>,
|
|
1211
1311
|
'get_full_neuron_by_id_or_subaccount' : ActorMethod<
|
|
@@ -71,14 +71,21 @@ export const Disburse: IDL.RecordClass;
|
|
|
71
71
|
export const ManageNeuronProposalCommand: IDL.VariantClass;
|
|
72
72
|
export const NeuronIdOrSubaccount: IDL.VariantClass;
|
|
73
73
|
export const ManageNeuronProposal: IDL.RecordClass;
|
|
74
|
+
export const LoadCanisterSnapshot: IDL.RecordClass;
|
|
75
|
+
export const GuestLaunchMeasurementMetadata: IDL.RecordClass;
|
|
76
|
+
export const GuestLaunchMeasurement: IDL.RecordClass;
|
|
77
|
+
export const GuestLaunchMeasurements: IDL.RecordClass;
|
|
78
|
+
export const BlessAlternativeGuestOsVersion: IDL.RecordClass;
|
|
74
79
|
export const Controllers: IDL.RecordClass;
|
|
75
80
|
export const CanisterSettings: IDL.RecordClass;
|
|
76
81
|
export const UpdateCanisterSettings: IDL.RecordClass;
|
|
77
82
|
export const InstallCode: IDL.RecordClass;
|
|
78
83
|
export const DeregisterKnownNeuron: IDL.RecordClass;
|
|
84
|
+
export const TakeCanisterSnapshot: IDL.RecordClass;
|
|
79
85
|
export const StopOrStartCanister: IDL.RecordClass;
|
|
80
86
|
export const Duration: IDL.RecordClass;
|
|
81
87
|
export const Tokens: IDL.RecordClass;
|
|
88
|
+
export const CustomProposalCriticality: IDL.RecordClass;
|
|
82
89
|
export const VotingRewardParameters: IDL.RecordClass;
|
|
83
90
|
export const GovernanceParameters: IDL.RecordClass;
|
|
84
91
|
export const Image: IDL.RecordClass;
|
|
@@ -120,6 +127,9 @@ export const Governance: IDL.RecordClass;
|
|
|
120
127
|
export const Result: IDL.VariantClass;
|
|
121
128
|
export const Result_1: IDL.VariantClass;
|
|
122
129
|
export const ClaimOrRefreshNeuronFromAccountResponse: IDL.RecordClass;
|
|
130
|
+
export const CreateNeuronRequest: IDL.RecordClass;
|
|
131
|
+
export const CreatedNeuron: IDL.RecordClass;
|
|
132
|
+
export const CreateNeuronResponse: IDL.VariantClass;
|
|
123
133
|
export const Result_2: IDL.VariantClass;
|
|
124
134
|
export const Result_3: IDL.VariantClass;
|
|
125
135
|
export const Result_4: IDL.VariantClass;
|
|
@@ -180,6 +190,7 @@ export const UpdateNodeProvider: IDL.RecordClass;
|
|
|
180
190
|
export const idlService: IDL.ServiceClass<string, {
|
|
181
191
|
claim_gtc_neurons: IDL.FuncClass<[IDL.PrincipalClass, IDL.VecClass<Record<string, any>>], [IDL.VariantClass]>;
|
|
182
192
|
claim_or_refresh_neuron_from_account: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
193
|
+
create_neuron: IDL.FuncClass<[IDL.RecordClass], [IDL.VariantClass]>;
|
|
183
194
|
get_build_metadata: IDL.FuncClass<[], [IDL.TextClass]>;
|
|
184
195
|
get_full_neuron: IDL.FuncClass<[IDL.FixedNatClass], [IDL.VariantClass]>;
|
|
185
196
|
get_full_neuron_by_id_or_subaccount: IDL.FuncClass<[IDL.VariantClass], [IDL.VariantClass]>;
|
|
@@ -18,9 +18,12 @@ export interface AccountIdentifier { 'hash' : Uint8Array }
|
|
|
18
18
|
export type Action = { 'RegisterKnownNeuron' : KnownNeuron } |
|
|
19
19
|
{ 'FulfillSubnetRentalRequest' : FulfillSubnetRentalRequest } |
|
|
20
20
|
{ 'ManageNeuron' : ManageNeuronProposal } |
|
|
21
|
+
{ 'LoadCanisterSnapshot' : LoadCanisterSnapshot } |
|
|
22
|
+
{ 'BlessAlternativeGuestOsVersion' : BlessAlternativeGuestOsVersion } |
|
|
21
23
|
{ 'UpdateCanisterSettings' : UpdateCanisterSettings } |
|
|
22
24
|
{ 'InstallCode' : InstallCode } |
|
|
23
25
|
{ 'DeregisterKnownNeuron' : DeregisterKnownNeuron } |
|
|
26
|
+
{ 'TakeCanisterSnapshot' : TakeCanisterSnapshot } |
|
|
24
27
|
{ 'StopOrStartCanister' : StopOrStartCanister } |
|
|
25
28
|
{ 'CreateServiceNervousSystem' : CreateServiceNervousSystem } |
|
|
26
29
|
{ 'ExecuteNnsFunction' : ExecuteNnsFunction } |
|
|
@@ -42,6 +45,29 @@ export interface BallotInfo {
|
|
|
42
45
|
'vote' : number,
|
|
43
46
|
'proposal_id' : [] | [ProposalId],
|
|
44
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Declares an approved set of alternative replica virtual machine software for
|
|
50
|
+
* disaster recovery purposes.
|
|
51
|
+
*/
|
|
52
|
+
export interface BlessAlternativeGuestOsVersion {
|
|
53
|
+
/**
|
|
54
|
+
* Hexadecimal fingerprint of the recovery rootfs.
|
|
55
|
+
* Must contain only hexadecimal characters (0-9, A-F, a-f).
|
|
56
|
+
*/
|
|
57
|
+
'rootfs_hash' : [] | [string],
|
|
58
|
+
/**
|
|
59
|
+
* AMD Secure Processor chip IDs that are allowed to run this software.
|
|
60
|
+
* Each chip ID must be exactly 64 bytes.
|
|
61
|
+
*/
|
|
62
|
+
'chip_ids' : [] | [Array<Uint8Array>],
|
|
63
|
+
/**
|
|
64
|
+
* The version being replaced by this (alternative version) must match this
|
|
65
|
+
* field (or one of the possibilities therein).
|
|
66
|
+
*
|
|
67
|
+
* (Here, we refer to the version being replaced as the "base" version.)
|
|
68
|
+
*/
|
|
69
|
+
'base_guest_launch_measurements' : [] | [GuestLaunchMeasurements],
|
|
70
|
+
}
|
|
45
71
|
export type By = { 'NeuronIdOrSubaccount' : {} } |
|
|
46
72
|
{ 'MemoAndController' : ClaimOrRefreshNeuronFromAccount } |
|
|
47
73
|
{ 'Memo' : bigint };
|
|
@@ -122,6 +148,42 @@ export interface Committed_1 {
|
|
|
122
148
|
export interface Configure { 'operation' : [] | [Operation] }
|
|
123
149
|
export interface Controllers { 'controllers' : Array<Principal> }
|
|
124
150
|
export interface Countries { 'iso_codes' : Array<string> }
|
|
151
|
+
/**
|
|
152
|
+
* Request to create a new neuron using ICRC-2 transfer_from.
|
|
153
|
+
* The caller must have previously approved the governance canister to spend the specified amount.
|
|
154
|
+
*/
|
|
155
|
+
export interface CreateNeuronRequest {
|
|
156
|
+
/**
|
|
157
|
+
* The controller of the new neuron. Defaults to the caller.
|
|
158
|
+
*/
|
|
159
|
+
'controller' : [] | [Principal],
|
|
160
|
+
/**
|
|
161
|
+
* The subaccount of the caller to transfer ICP from. Defaults to the default subaccount.
|
|
162
|
+
*/
|
|
163
|
+
'source_subaccount' : [] | [Uint8Array],
|
|
164
|
+
/**
|
|
165
|
+
* The dissolve delay in seconds. Defaults to 7 days. Clamped to [0, 8 years].
|
|
166
|
+
*/
|
|
167
|
+
'dissolve_delay_seconds' : [] | [bigint],
|
|
168
|
+
/**
|
|
169
|
+
* Whether to automatically stake maturity. Defaults to false.
|
|
170
|
+
*/
|
|
171
|
+
'auto_stake_maturity' : [] | [boolean],
|
|
172
|
+
/**
|
|
173
|
+
* Required. The amount of ICP to stake in e8s.
|
|
174
|
+
*/
|
|
175
|
+
'amount_e8s' : [] | [bigint],
|
|
176
|
+
/**
|
|
177
|
+
* The followees to set for the new neuron. Defaults to the network's default followees.
|
|
178
|
+
*/
|
|
179
|
+
'followees' : [] | [SetFollowing],
|
|
180
|
+
/**
|
|
181
|
+
* Whether the neuron should start dissolving immediately. Defaults to false.
|
|
182
|
+
*/
|
|
183
|
+
'dissolving' : [] | [boolean],
|
|
184
|
+
}
|
|
185
|
+
export type CreateNeuronResponse = { 'Ok' : CreatedNeuron } |
|
|
186
|
+
{ 'Err' : GovernanceError };
|
|
125
187
|
export interface CreateServiceNervousSystem {
|
|
126
188
|
'url' : [] | [string],
|
|
127
189
|
'governance_parameters' : [] | [GovernanceParameters],
|
|
@@ -134,6 +196,10 @@ export interface CreateServiceNervousSystem {
|
|
|
134
196
|
'swap_parameters' : [] | [SwapParameters],
|
|
135
197
|
'initial_token_distribution' : [] | [InitialTokenDistribution],
|
|
136
198
|
}
|
|
199
|
+
export interface CreatedNeuron { 'neuron_id' : [] | [NeuronId] }
|
|
200
|
+
export interface CustomProposalCriticality {
|
|
201
|
+
'additional_critical_native_action_ids' : [] | [BigUint64Array],
|
|
202
|
+
}
|
|
137
203
|
export interface DateRangeFilter {
|
|
138
204
|
'start_timestamp_seconds' : [] | [bigint],
|
|
139
205
|
'end_timestamp_seconds' : [] | [bigint],
|
|
@@ -319,9 +385,29 @@ export interface GovernanceParameters {
|
|
|
319
385
|
'neuron_minimum_stake' : [] | [Tokens],
|
|
320
386
|
'proposal_wait_for_quiet_deadline_increase' : [] | [Duration],
|
|
321
387
|
'proposal_initial_voting_period' : [] | [Duration],
|
|
388
|
+
'custom_proposal_criticality' : [] | [CustomProposalCriticality],
|
|
322
389
|
'proposal_rejection_fee' : [] | [Tokens],
|
|
323
390
|
'voting_reward_parameters' : [] | [VotingRewardParameters],
|
|
324
391
|
}
|
|
392
|
+
export interface GuestLaunchMeasurement {
|
|
393
|
+
/**
|
|
394
|
+
* Metadata associated with the measurement.
|
|
395
|
+
*/
|
|
396
|
+
'metadata' : [] | [GuestLaunchMeasurementMetadata],
|
|
397
|
+
/**
|
|
398
|
+
* SEV-SNP measurement (48 bytes).
|
|
399
|
+
*/
|
|
400
|
+
'measurement' : [] | [Uint8Array],
|
|
401
|
+
}
|
|
402
|
+
export interface GuestLaunchMeasurementMetadata {
|
|
403
|
+
/**
|
|
404
|
+
* Kernel command line used for this measurement.
|
|
405
|
+
*/
|
|
406
|
+
'kernel_cmdline' : [] | [string],
|
|
407
|
+
}
|
|
408
|
+
export interface GuestLaunchMeasurements {
|
|
409
|
+
'guest_launch_measurements' : [] | [Array<GuestLaunchMeasurement>],
|
|
410
|
+
}
|
|
325
411
|
export interface IdealMatchedParticipationFunction {
|
|
326
412
|
'serialized_representation' : [] | [string],
|
|
327
413
|
}
|
|
@@ -473,6 +559,10 @@ export interface ListProposalInfoRequest {
|
|
|
473
559
|
export interface ListProposalInfoResponse {
|
|
474
560
|
'proposal_info' : Array<ProposalInfo>,
|
|
475
561
|
}
|
|
562
|
+
export interface LoadCanisterSnapshot {
|
|
563
|
+
'canister_id' : [] | [Principal],
|
|
564
|
+
'snapshot_id' : [] | [Uint8Array],
|
|
565
|
+
}
|
|
476
566
|
export interface MakeProposalRequest {
|
|
477
567
|
'url' : string,
|
|
478
568
|
'title' : [] | [string],
|
|
@@ -892,9 +982,12 @@ export interface Proposal {
|
|
|
892
982
|
export type ProposalActionRequest = { 'RegisterKnownNeuron' : KnownNeuron } |
|
|
893
983
|
{ 'FulfillSubnetRentalRequest' : FulfillSubnetRentalRequest } |
|
|
894
984
|
{ 'ManageNeuron' : ManageNeuronRequest } |
|
|
985
|
+
{ 'LoadCanisterSnapshot' : LoadCanisterSnapshot } |
|
|
986
|
+
{ 'BlessAlternativeGuestOsVersion' : BlessAlternativeGuestOsVersion } |
|
|
895
987
|
{ 'UpdateCanisterSettings' : UpdateCanisterSettings } |
|
|
896
988
|
{ 'InstallCode' : InstallCodeRequest } |
|
|
897
989
|
{ 'DeregisterKnownNeuron' : DeregisterKnownNeuron } |
|
|
990
|
+
{ 'TakeCanisterSnapshot' : TakeCanisterSnapshot } |
|
|
898
991
|
{ 'StopOrStartCanister' : StopOrStartCanister } |
|
|
899
992
|
{ 'CreateServiceNervousSystem' : CreateServiceNervousSystem } |
|
|
900
993
|
{ 'ExecuteNnsFunction' : ExecuteNnsFunction } |
|
|
@@ -1021,6 +1114,8 @@ export type SelfDescribingValue = { 'Int' : bigint } |
|
|
|
1021
1114
|
{ 'Map' : Array<[string, SelfDescribingValue]> } |
|
|
1022
1115
|
{ 'Nat' : bigint } |
|
|
1023
1116
|
{ 'Blob' : Uint8Array } |
|
|
1117
|
+
{ 'Bool' : boolean } |
|
|
1118
|
+
{ 'Null' : null } |
|
|
1024
1119
|
{ 'Text' : string } |
|
|
1025
1120
|
{ 'Array' : Array<SelfDescribingValue> };
|
|
1026
1121
|
export interface SetDefaultFollowees {
|
|
@@ -1101,6 +1196,10 @@ export interface SwapParticipationLimits {
|
|
|
1101
1196
|
'min_direct_participation_icp_e8s' : [] | [bigint],
|
|
1102
1197
|
'max_direct_participation_icp_e8s' : [] | [bigint],
|
|
1103
1198
|
}
|
|
1199
|
+
export interface TakeCanisterSnapshot {
|
|
1200
|
+
'replace_snapshot' : [] | [Uint8Array],
|
|
1201
|
+
'canister_id' : [] | [Principal],
|
|
1202
|
+
}
|
|
1104
1203
|
export interface Tally {
|
|
1105
1204
|
'no' : bigint,
|
|
1106
1205
|
'yes' : bigint,
|
|
@@ -1206,6 +1305,7 @@ export interface _SERVICE {
|
|
|
1206
1305
|
[ClaimOrRefreshNeuronFromAccount],
|
|
1207
1306
|
ClaimOrRefreshNeuronFromAccountResponse
|
|
1208
1307
|
>,
|
|
1308
|
+
'create_neuron' : ActorMethod<[CreateNeuronRequest], CreateNeuronResponse>,
|
|
1209
1309
|
'get_build_metadata' : ActorMethod<[], string>,
|
|
1210
1310
|
'get_full_neuron' : ActorMethod<[bigint], Result_2>,
|
|
1211
1311
|
'get_full_neuron_by_id_or_subaccount' : ActorMethod<
|
|
@@ -71,14 +71,21 @@ export const Disburse: IDL.RecordClass;
|
|
|
71
71
|
export const ManageNeuronProposalCommand: IDL.VariantClass;
|
|
72
72
|
export const NeuronIdOrSubaccount: IDL.VariantClass;
|
|
73
73
|
export const ManageNeuronProposal: IDL.RecordClass;
|
|
74
|
+
export const LoadCanisterSnapshot: IDL.RecordClass;
|
|
75
|
+
export const GuestLaunchMeasurementMetadata: IDL.RecordClass;
|
|
76
|
+
export const GuestLaunchMeasurement: IDL.RecordClass;
|
|
77
|
+
export const GuestLaunchMeasurements: IDL.RecordClass;
|
|
78
|
+
export const BlessAlternativeGuestOsVersion: IDL.RecordClass;
|
|
74
79
|
export const Controllers: IDL.RecordClass;
|
|
75
80
|
export const CanisterSettings: IDL.RecordClass;
|
|
76
81
|
export const UpdateCanisterSettings: IDL.RecordClass;
|
|
77
82
|
export const InstallCode: IDL.RecordClass;
|
|
78
83
|
export const DeregisterKnownNeuron: IDL.RecordClass;
|
|
84
|
+
export const TakeCanisterSnapshot: IDL.RecordClass;
|
|
79
85
|
export const StopOrStartCanister: IDL.RecordClass;
|
|
80
86
|
export const Duration: IDL.RecordClass;
|
|
81
87
|
export const Tokens: IDL.RecordClass;
|
|
88
|
+
export const CustomProposalCriticality: IDL.RecordClass;
|
|
82
89
|
export const VotingRewardParameters: IDL.RecordClass;
|
|
83
90
|
export const GovernanceParameters: IDL.RecordClass;
|
|
84
91
|
export const Image: IDL.RecordClass;
|
|
@@ -120,6 +127,9 @@ export const Governance: IDL.RecordClass;
|
|
|
120
127
|
export const Result: IDL.VariantClass;
|
|
121
128
|
export const Result_1: IDL.VariantClass;
|
|
122
129
|
export const ClaimOrRefreshNeuronFromAccountResponse: IDL.RecordClass;
|
|
130
|
+
export const CreateNeuronRequest: IDL.RecordClass;
|
|
131
|
+
export const CreatedNeuron: IDL.RecordClass;
|
|
132
|
+
export const CreateNeuronResponse: IDL.VariantClass;
|
|
123
133
|
export const Result_2: IDL.VariantClass;
|
|
124
134
|
export const Result_3: IDL.VariantClass;
|
|
125
135
|
export const Result_4: IDL.VariantClass;
|
|
@@ -180,6 +190,7 @@ export const UpdateNodeProvider: IDL.RecordClass;
|
|
|
180
190
|
export const idlService: IDL.ServiceClass<string, {
|
|
181
191
|
claim_gtc_neurons: IDL.FuncClass<[IDL.PrincipalClass, IDL.VecClass<Record<string, any>>], [IDL.VariantClass]>;
|
|
182
192
|
claim_or_refresh_neuron_from_account: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
193
|
+
create_neuron: IDL.FuncClass<[IDL.RecordClass], [IDL.VariantClass]>;
|
|
183
194
|
get_build_metadata: IDL.FuncClass<[], [IDL.TextClass]>;
|
|
184
195
|
get_full_neuron: IDL.FuncClass<[IDL.FixedNatClass], [IDL.VariantClass]>;
|
|
185
196
|
get_full_neuron_by_id_or_subaccount: IDL.FuncClass<[IDL.VariantClass], [IDL.VariantClass]>;
|
|
@@ -18,6 +18,9 @@ export interface AddWasmRequest {
|
|
|
18
18
|
export interface AddWasmResponse { 'result' : [] | [Result] }
|
|
19
19
|
export interface Canister { 'id' : [] | [Principal] }
|
|
20
20
|
export interface Countries { 'iso_codes' : Array<string> }
|
|
21
|
+
export interface CustomProposalCriticality {
|
|
22
|
+
'additional_critical_native_action_ids' : BigUint64Array,
|
|
23
|
+
}
|
|
21
24
|
export interface DappCanisters { 'canisters' : Array<Canister> }
|
|
22
25
|
export interface DappCanistersTransferResult {
|
|
23
26
|
'restored_dapp_canisters' : Array<Canister>,
|
|
@@ -179,6 +182,7 @@ export interface SnsInitPayload {
|
|
|
179
182
|
'wait_for_quiet_deadline_increase_seconds' : [] | [bigint],
|
|
180
183
|
'transaction_fee_e8s' : [] | [bigint],
|
|
181
184
|
'dapp_canisters' : [] | [DappCanisters],
|
|
185
|
+
'custom_proposal_criticality' : [] | [CustomProposalCriticality],
|
|
182
186
|
'neurons_fund_participation_constraints' : [] | [
|
|
183
187
|
NeuronsFundParticipationConstraints
|
|
184
188
|
],
|
|
@@ -7,6 +7,7 @@ export const AddWasmResponse: IDL.RecordClass;
|
|
|
7
7
|
export const NeuronBasketConstructionParameters: IDL.RecordClass;
|
|
8
8
|
export const Canister: IDL.RecordClass;
|
|
9
9
|
export const DappCanisters: IDL.RecordClass;
|
|
10
|
+
export const CustomProposalCriticality: IDL.RecordClass;
|
|
10
11
|
export const LinearScalingCoefficient: IDL.RecordClass;
|
|
11
12
|
export const IdealMatchedParticipationFunction: IDL.RecordClass;
|
|
12
13
|
export const NeuronsFundParticipationConstraints: IDL.RecordClass;
|
|
@@ -140,6 +140,9 @@ export type Command_2 = { 'Split' : Split } |
|
|
|
140
140
|
{ 'MergeMaturity' : MergeMaturity } |
|
|
141
141
|
{ 'Disburse' : Disburse };
|
|
142
142
|
export interface Configure { 'operation' : [] | [Operation] }
|
|
143
|
+
export interface CustomProposalCriticality {
|
|
144
|
+
'additional_critical_native_action_ids' : BigUint64Array,
|
|
145
|
+
}
|
|
143
146
|
export interface Decimal { 'human_readable' : [] | [string] }
|
|
144
147
|
export interface DefaultFollowees { 'followees' : Array<[bigint, Followees]> }
|
|
145
148
|
export interface DefiniteCanisterSettingsArgs {
|
|
@@ -438,6 +441,7 @@ export interface NervousSystemParameters {
|
|
|
438
441
|
'wait_for_quiet_deadline_increase_seconds' : [] | [bigint],
|
|
439
442
|
'max_number_of_neurons' : [] | [bigint],
|
|
440
443
|
'transaction_fee_e8s' : [] | [bigint],
|
|
444
|
+
'custom_proposal_criticality' : [] | [CustomProposalCriticality],
|
|
441
445
|
'max_number_of_proposals_with_ballots' : [] | [bigint],
|
|
442
446
|
'max_age_bonus_percentage' : [] | [bigint],
|
|
443
447
|
'neuron_grantable_permissions' : [] | [NeuronPermissionList],
|
|
@@ -26,6 +26,7 @@ export const NeuronId: IDL.RecordClass;
|
|
|
26
26
|
export const Followees: IDL.RecordClass;
|
|
27
27
|
export const DefaultFollowees: IDL.RecordClass;
|
|
28
28
|
export const NeuronPermissionList: IDL.RecordClass;
|
|
29
|
+
export const CustomProposalCriticality: IDL.RecordClass;
|
|
29
30
|
export const VotingRewardsParameters: IDL.RecordClass;
|
|
30
31
|
export const NervousSystemParameters: IDL.RecordClass;
|
|
31
32
|
export const RewardEvent: IDL.RecordClass;
|
|
@@ -152,6 +152,9 @@ export type Command_2 = { 'Split' : Split } |
|
|
|
152
152
|
{ 'MergeMaturity' : MergeMaturity } |
|
|
153
153
|
{ 'Disburse' : Disburse };
|
|
154
154
|
export interface Configure { 'operation' : [] | [Operation] }
|
|
155
|
+
export interface CustomProposalCriticality {
|
|
156
|
+
'additional_critical_native_action_ids' : BigUint64Array,
|
|
157
|
+
}
|
|
155
158
|
export interface Decimal { 'human_readable' : [] | [string] }
|
|
156
159
|
export interface DefaultFollowees { 'followees' : Array<[bigint, Followees]> }
|
|
157
160
|
export interface DefiniteCanisterSettingsArgs {
|
|
@@ -454,6 +457,7 @@ export interface NervousSystemParameters {
|
|
|
454
457
|
'wait_for_quiet_deadline_increase_seconds' : [] | [bigint],
|
|
455
458
|
'max_number_of_neurons' : [] | [bigint],
|
|
456
459
|
'transaction_fee_e8s' : [] | [bigint],
|
|
460
|
+
'custom_proposal_criticality' : [] | [CustomProposalCriticality],
|
|
457
461
|
'max_number_of_proposals_with_ballots' : [] | [bigint],
|
|
458
462
|
'max_age_bonus_percentage' : [] | [bigint],
|
|
459
463
|
'neuron_grantable_permissions' : [] | [NeuronPermissionList],
|
|
@@ -26,6 +26,7 @@ export const NeuronId: IDL.RecordClass;
|
|
|
26
26
|
export const Followees: IDL.RecordClass;
|
|
27
27
|
export const DefaultFollowees: IDL.RecordClass;
|
|
28
28
|
export const NeuronPermissionList: IDL.RecordClass;
|
|
29
|
+
export const CustomProposalCriticality: IDL.RecordClass;
|
|
29
30
|
export const VotingRewardsParameters: IDL.RecordClass;
|
|
30
31
|
export const NervousSystemParameters: IDL.RecordClass;
|
|
31
32
|
export const RewardEvent: IDL.RecordClass;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{g as e}from"../../chunk-I3WMKZTG.js";import"../../chunk-4C666HHU.js";export{e as IcManagementIdl};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CyclesLedgerIdl, type CyclesLedgerDid } from '../../declarations';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as p}from"../../../chunk-BXZ5PSUW.js";import{a}from"../../../chunk-ZBCLFWQJ.js";import{g as c}from"../../../chunk-YHNBR22R.js";import"../../../chunk-JU5CZHLY.js";import{a as o}from"../../../chunk-X3EF7OU6.js";import{h as b,i as n}from"../../../chunk-I3WMKZTG.js";import"../../../chunk-4C666HHU.js";import{schemaFromIdl as O,schemaToIdl as z}from"@junobuild/schema/utils";import{j as e}from"@junobuild/schema";import*as t from"zod";var T=e.instanceof(Uint8Array),m=e.strictObject({e8s:e.bigint()}),x=e.strictObject({timestamp_nanos:e.bigint()}),g=e.instanceof(Uint8Array),s=e.strictObject({to:T,fee:m,memo:e.bigint(),from_subaccount:g.optional(),created_at_time:x.optional(),amount:m}),I=t.union([t.strictObject({TxTooOld:t.strictObject({allowed_window_nanos:t.bigint()})}),t.strictObject({BadFee:t.strictObject({expected_fee:t.strictObject({e8s:t.bigint()})})}),t.strictObject({TxDuplicate:t.strictObject({duplicate_of:t.bigint()})}),t.strictObject({TxCreatedInFuture:t.null()}),t.strictObject({InsufficientFunds:t.strictObject({balance:t.strictObject({e8s:t.bigint()})})})]),f=t.union([t.strictObject({Ok:t.bigint()}),t.strictObject({Err:I})]);var i=class extends a{constructor(r={}){o.parse(r),super({canisterId:r?.canisterId??p})}transfer=async({args:r})=>{let u=s.parse(r),d=z({schema:s,value:u}),l=await c({canisterId:this.canisterId,method:"transfer",args:[[n.TransferArgs,d]],result:n.TransferResult});return O({schema:f,value:l})}};export{T as AccountIdentifierSchema,b as IcpIndexIdl,i as IcpLedgerCanister,n as IcpLedgerIdl,g as SubAccountSchema,x as TimeStampSchema,m as TokensSchema,s as TransferArgsSchema,I as TransferErrorSchema,f as TransferResultSchema};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
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 {
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["IcpLedgerCanister", "Canister", "options", "CanisterOptionsSchema", "ICP_LEDGER_ID", "args", "call", "ledger_did_idl_exports"]
|
|
3
|
+
"sources": ["../../../src/canisters/ledger/icp/ledger.canister.ts", "../../../src/canisters/ledger/icp/schema.ts"],
|
|
4
|
+
"sourcesContent": ["import {schemaFromIdl, schemaToIdl} from '@junobuild/schema/utils';\nimport {call} from '../../../ic-cdk/call.ic-cdk';\nimport {Canister} from '../../_canister';\nimport {ICP_LEDGER_ID} from '../../_constants';\nimport {IcpLedgerIdl} from '../../declarations';\nimport {type CanisterOptions, CanisterOptionsSchema} from '../../schemas';\nimport {\n type TransferArgs,\n type TransferResult,\n TransferArgsSchema,\n TransferResultSchema\n} from './schema';\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 {TransferArgs} args - The ledger transfer arguments (amount, destination account, memo, fee, etc.).\n * @returns {Promise<TransferResult>} The result of the ICP transfer.\n */\n transfer = async ({args}: {args: TransferArgs}): Promise<TransferResult> => {\n const parsed = TransferArgsSchema.parse(args);\n\n const idlArgs = schemaToIdl({\n schema: TransferArgsSchema,\n value: parsed\n });\n\n const idlResult = await call<TransferResult>({\n canisterId: this.canisterId,\n method: 'transfer',\n args: [[IcpLedgerIdl.TransferArgs, idlArgs]],\n result: IcpLedgerIdl.TransferResult\n });\n\n return schemaFromIdl({schema: TransferResultSchema, value: idlResult}) as TransferResult;\n };\n}\n", "import {j} from '@junobuild/schema';\nimport * as z from 'zod';\n\nexport const AccountIdentifierSchema = j.instanceof(Uint8Array);\nexport const TokensSchema = j.strictObject({e8s: j.bigint()});\nexport const TimeStampSchema = j.strictObject({timestamp_nanos: j.bigint()});\nexport const SubAccountSchema = j.instanceof(Uint8Array);\n\nexport const TransferArgsSchema = j.strictObject({\n to: AccountIdentifierSchema,\n fee: TokensSchema,\n memo: j.bigint(),\n from_subaccount: SubAccountSchema.optional(),\n created_at_time: TimeStampSchema.optional(),\n amount: TokensSchema\n});\n\nexport const TransferErrorSchema = z.union([\n z.strictObject({TxTooOld: z.strictObject({allowed_window_nanos: z.bigint()})}),\n z.strictObject({BadFee: z.strictObject({expected_fee: z.strictObject({e8s: z.bigint()})})}),\n z.strictObject({TxDuplicate: z.strictObject({duplicate_of: z.bigint()})}),\n z.strictObject({TxCreatedInFuture: z.null()}),\n z.strictObject({InsufficientFunds: z.strictObject({balance: z.strictObject({e8s: z.bigint()})})})\n]);\n\nexport const TransferResultSchema = z.union([\n z.strictObject({Ok: z.bigint()}),\n z.strictObject({Err: TransferErrorSchema})\n]);\n\n/**\n * The destination account identifier.\n * A 32-byte array where the first 4 bytes are a CRC32 checksum of the last 28 bytes.\n */\nexport type AccountIdentifier = Uint8Array;\n\n/**\n * Amount of tokens, measured in 10^-8 of a token.\n */\nexport interface Tokens {\n e8s: bigint;\n}\n\n/**\n * A point in time, represented as nanoseconds since the Unix epoch.\n */\nexport interface TimeStamp {\n timestamp_nanos: bigint;\n}\n\n/**\n * Subaccount is an arbitrary 32-byte array used to compute the source address.\n */\nexport type SubAccount = Uint8Array;\n\n/**\n * Arguments for the ICP Ledger `transfer` call.\n */\nexport interface TransferArgs {\n /** The destination account identifier. */\n to: AccountIdentifier;\n /** The transaction fee. Must be 10000 e8s. */\n fee: Tokens;\n /** An arbitrary number associated with the transaction for correlation. */\n memo: bigint;\n /** The subaccount to transfer from. Uses the default subaccount if not provided. */\n from_subaccount?: SubAccount;\n /** The time at which the caller created this request. Uses current IC time if not provided. */\n created_at_time?: TimeStamp;\n /** The amount to transfer to the destination address. */\n amount: Tokens;\n}\n\n/**\n * Errors that can occur during an ICP Ledger transfer.\n */\nexport type TransferError =\n /** The request is too old. The ledger only accepts requests created within a 24-hour window. */\n | {TxTooOld: {allowed_window_nanos: bigint}}\n /** The fee specified in the transfer request does not match the expected fee. */\n | {BadFee: {expected_fee: Tokens}}\n /** The ledger has already executed this request. */\n | {TxDuplicate: {duplicate_of: bigint}}\n /** The specified `created_at_time` is too far in the future. */\n | {TxCreatedInFuture: null}\n /** The caller's account does not have enough funds. */\n | {InsufficientFunds: {balance: Tokens}};\n\n/**\n * The result of an ICP Ledger `transfer` call.\n * Returns the block index of the transaction on success.\n */\nexport type TransferResult = {Ok: bigint} | {Err: TransferError};\n"],
|
|
5
|
+
"mappings": "mTAAA,OAAQ,iBAAAA,EAAe,eAAAC,MAAkB,0BCAzC,OAAQ,KAAAC,MAAQ,oBAChB,UAAYC,MAAO,MAEZ,IAAMC,EAA0BF,EAAE,WAAW,UAAU,EACjDG,EAAeH,EAAE,aAAa,CAAC,IAAKA,EAAE,OAAO,CAAC,CAAC,EAC/CI,EAAkBJ,EAAE,aAAa,CAAC,gBAAiBA,EAAE,OAAO,CAAC,CAAC,EAC9DK,EAAmBL,EAAE,WAAW,UAAU,EAE1CM,EAAqBN,EAAE,aAAa,CAC/C,GAAIE,EACJ,IAAKC,EACL,KAAMH,EAAE,OAAO,EACf,gBAAiBK,EAAiB,SAAS,EAC3C,gBAAiBD,EAAgB,SAAS,EAC1C,OAAQD,CACV,CAAC,EAEYI,EAAwB,QAAM,CACvC,eAAa,CAAC,SAAY,eAAa,CAAC,qBAAwB,SAAO,CAAC,CAAC,CAAC,CAAC,EAC3E,eAAa,CAAC,OAAU,eAAa,CAAC,aAAgB,eAAa,CAAC,IAAO,SAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACxF,eAAa,CAAC,YAAe,eAAa,CAAC,aAAgB,SAAO,CAAC,CAAC,CAAC,CAAC,EACtE,eAAa,CAAC,kBAAqB,OAAK,CAAC,CAAC,EAC1C,eAAa,CAAC,kBAAqB,eAAa,CAAC,QAAW,eAAa,CAAC,IAAO,SAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAClG,CAAC,EAEYC,EAAyB,QAAM,CACxC,eAAa,CAAC,GAAM,SAAO,CAAC,CAAC,EAC7B,eAAa,CAAC,IAAKD,CAAmB,CAAC,CAC3C,CAAC,EDTM,IAAME,EAAN,cAAgCC,CAAS,CAC9C,YAAYC,EAA2B,CAAC,EAAG,CACzCC,EAAsB,MAAMD,CAAO,EAEnC,MAAM,CAAC,WAAYA,GAAS,YAAcE,CAAa,CAAC,CAC1D,CAWA,SAAW,MAAO,CAAC,KAAAC,CAAI,IAAqD,CAC1E,IAAMC,EAASC,EAAmB,MAAMF,CAAI,EAEtCG,EAAUC,EAAY,CAC1B,OAAQF,EACR,MAAOD,CACT,CAAC,EAEKI,EAAY,MAAMC,EAAqB,CAC3C,WAAY,KAAK,WACjB,OAAQ,WACR,KAAM,CAAC,CAACC,EAAa,aAAcJ,CAAO,CAAC,EAC3C,OAAQI,EAAa,cACvB,CAAC,EAED,OAAOC,EAAc,CAAC,OAAQC,EAAsB,MAAOJ,CAAS,CAAC,CACvE,CACF",
|
|
6
|
+
"names": ["schemaFromIdl", "schemaToIdl", "j", "z", "AccountIdentifierSchema", "TokensSchema", "TimeStampSchema", "SubAccountSchema", "TransferArgsSchema", "TransferErrorSchema", "TransferResultSchema", "IcpLedgerCanister", "Canister", "options", "CanisterOptionsSchema", "ICP_LEDGER_ID", "args", "parsed", "TransferArgsSchema", "idlArgs", "schemaToIdl", "idlResult", "call", "ledger_did_idl_exports", "schemaFromIdl", "TransferResultSchema"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Canister } from '../../_canister';
|
|
2
|
-
import { type IcpLedgerDid } from '../../declarations';
|
|
3
2
|
import { type CanisterOptions } from '../../schemas';
|
|
3
|
+
import { type TransferArgs, type TransferResult } from './schema';
|
|
4
4
|
/**
|
|
5
5
|
* Provides a simple interface to interact with the ICP Ledger,
|
|
6
6
|
* when developing Juno Serverless Functions in TypeScript.
|
|
@@ -15,10 +15,10 @@ export declare class IcpLedgerCanister extends Canister {
|
|
|
15
15
|
* Use this to transfer ICP from one account to another when writing
|
|
16
16
|
* Juno Serverless Functions in TypeScript.
|
|
17
17
|
*
|
|
18
|
-
* @param {
|
|
19
|
-
* @returns {Promise<
|
|
18
|
+
* @param {TransferArgs} args - The ledger transfer arguments (amount, destination account, memo, fee, etc.).
|
|
19
|
+
* @returns {Promise<TransferResult>} The result of the ICP transfer.
|
|
20
20
|
*/
|
|
21
21
|
transfer: ({ args }: {
|
|
22
|
-
args:
|
|
23
|
-
}) => Promise<
|
|
22
|
+
args: TransferArgs;
|
|
23
|
+
}) => Promise<TransferResult>;
|
|
24
24
|
}
|