@dfinity/sns 0.0.2 → 0.0.3-nightly-2022-08-02
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/dist/candid/ledger.did +1 -1
- package/dist/candid/sns_governance.certified.idl.js +2 -0
- package/dist/candid/sns_governance.d.ts +1 -0
- package/dist/candid/sns_governance.did +2 -1
- package/dist/candid/sns_governance.idl.js +2 -0
- package/dist/candid/sns_root.certified.idl.js +6 -4
- package/dist/candid/sns_root.d.ts +6 -4
- package/dist/candid/sns_root.did +7 -5
- package/dist/candid/sns_root.idl.js +6 -4
- package/dist/candid/sns_swap.certified.idl.js +41 -12
- package/dist/candid/sns_swap.d.ts +29 -5
- package/dist/candid/sns_swap.did +22 -5
- package/dist/candid/sns_swap.idl.js +41 -12
- package/dist/cjs/index.cjs.js +1 -852
- package/dist/cjs/index.cjs.js.map +3 -3
- package/dist/esm/chunk-35UDT4DT.js +2 -0
- package/dist/esm/chunk-35UDT4DT.js.map +7 -0
- package/dist/esm/chunk-464ISDAK.js +2 -0
- package/dist/esm/{chunk-QOHSQFP6.js.map → chunk-464ISDAK.js.map} +2 -2
- package/dist/esm/chunk-7L7EHWBZ.js +2 -0
- package/dist/esm/chunk-7L7EHWBZ.js.map +7 -0
- package/dist/esm/chunk-CY2Y37XS.js +2 -0
- package/dist/esm/chunk-CY2Y37XS.js.map +7 -0
- package/dist/esm/chunk-FDLDR4RP.js +2 -0
- package/dist/esm/chunk-FDLDR4RP.js.map +7 -0
- package/dist/esm/chunk-GJVDASM7.js +2 -0
- package/dist/esm/chunk-GJVDASM7.js.map +7 -0
- package/dist/esm/chunk-QTQFYNZS.js +2 -0
- package/dist/esm/chunk-QTQFYNZS.js.map +7 -0
- package/dist/esm/chunk-WKFE6CZ2.js +2 -0
- package/dist/esm/chunk-WKFE6CZ2.js.map +7 -0
- package/dist/esm/governance.canister.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/ledger.canister.js +1 -1
- package/dist/esm/root.canister.js +1 -1
- package/dist/esm/sns.js +1 -1
- package/dist/esm/sns.wrapper.js +1 -1
- package/dist/esm/swap.canister.js +1 -1
- package/dist/types/governance.canister.d.ts +6 -6
- package/dist/types/index.d.ts +7 -7
- package/dist/types/ledger.canister.d.ts +4 -4
- package/dist/types/root.canister.d.ts +4 -4
- package/dist/types/sns.d.ts +3 -3
- package/dist/types/sns.wrapper.d.ts +14 -11
- package/dist/types/swap.canister.d.ts +12 -4
- package/dist/types/types/canister.options.d.ts +3 -1
- package/dist/types/types/governance.params.d.ts +1 -1
- package/dist/types/utils/actor.utils.d.ts +2 -2
- package/package.json +2 -2
- package/dist/esm/chunk-5EFW5NLJ.js +0 -2
- package/dist/esm/chunk-5EFW5NLJ.js.map +0 -7
- package/dist/esm/chunk-A576P2ZR.js +0 -2
- package/dist/esm/chunk-A576P2ZR.js.map +0 -7
- package/dist/esm/chunk-NJ4DNYU7.js +0 -2
- package/dist/esm/chunk-NJ4DNYU7.js.map +0 -7
- package/dist/esm/chunk-QOHSQFP6.js +0 -2
- package/dist/esm/chunk-S7OOQWQZ.js +0 -2
- package/dist/esm/chunk-S7OOQWQZ.js.map +0 -7
- package/dist/esm/chunk-TGR2FDNH.js +0 -2
- package/dist/esm/chunk-TGR2FDNH.js.map +0 -7
- package/dist/esm/chunk-VMVMYL6O.js +0 -840
- package/dist/esm/chunk-VMVMYL6O.js.map +0 -7
- package/dist/esm/chunk-Y5V5O772.js +0 -2
- package/dist/esm/chunk-Y5V5O772.js.map +0 -7
package/dist/candid/ledger.did
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit d06567deb84dddcfb495be96ed9c318d2d3e8ce1 'rs/rosetta-api/ledger_canister/ledger.did' by import-candid
|
|
2
2
|
// This is the official Ledger interface that is guaranteed to be backward compatible.
|
|
3
3
|
|
|
4
4
|
// Amount of tokens, measured in 10^-8 of a token.
|
|
@@ -102,6 +102,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
102
102
|
'ManageNervousSystemParameters' : NervousSystemParameters,
|
|
103
103
|
'AddGenericNervousSystemFunction' : NervousSystemFunction,
|
|
104
104
|
'RemoveGenericNervousSystemFunction' : IDL.Nat64,
|
|
105
|
+
'UpgradeSnsToNextVersion' : IDL.Record({}),
|
|
105
106
|
'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,
|
|
106
107
|
'Unspecified' : IDL.Record({}),
|
|
107
108
|
'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,
|
|
@@ -464,6 +465,7 @@ export const init = ({ IDL }) => {
|
|
|
464
465
|
'ManageNervousSystemParameters' : NervousSystemParameters,
|
|
465
466
|
'AddGenericNervousSystemFunction' : NervousSystemFunction,
|
|
466
467
|
'RemoveGenericNervousSystemFunction' : IDL.Nat64,
|
|
468
|
+
'UpgradeSnsToNextVersion' : IDL.Record({}),
|
|
467
469
|
'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,
|
|
468
470
|
'Unspecified' : IDL.Record({}),
|
|
469
471
|
'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,
|
|
@@ -9,6 +9,7 @@ export type Action =
|
|
|
9
9
|
}
|
|
10
10
|
| { AddGenericNervousSystemFunction: NervousSystemFunction }
|
|
11
11
|
| { RemoveGenericNervousSystemFunction: bigint }
|
|
12
|
+
| { UpgradeSnsToNextVersion: {} }
|
|
12
13
|
| { UpgradeSnsControlledCanister: UpgradeSnsControlledCanister }
|
|
13
14
|
| { Unspecified: {} }
|
|
14
15
|
| {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit d06567deb84dddcfb495be96ed9c318d2d3e8ce1 'rs/sns/governance/canister/governance.did' by import-candid
|
|
2
2
|
type Account = record { of : opt principal; subaccount : opt Subaccount };
|
|
3
3
|
type Action = variant {
|
|
4
4
|
ManageNervousSystemParameters : NervousSystemParameters;
|
|
5
5
|
AddGenericNervousSystemFunction : NervousSystemFunction;
|
|
6
6
|
RemoveGenericNervousSystemFunction : nat64;
|
|
7
|
+
UpgradeSnsToNextVersion : record {};
|
|
7
8
|
UpgradeSnsControlledCanister : UpgradeSnsControlledCanister;
|
|
8
9
|
Unspecified : record {};
|
|
9
10
|
ExecuteGenericNervousSystemFunction : ExecuteGenericNervousSystemFunction;
|
|
@@ -102,6 +102,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
102
102
|
'ManageNervousSystemParameters' : NervousSystemParameters,
|
|
103
103
|
'AddGenericNervousSystemFunction' : NervousSystemFunction,
|
|
104
104
|
'RemoveGenericNervousSystemFunction' : IDL.Nat64,
|
|
105
|
+
'UpgradeSnsToNextVersion' : IDL.Record({}),
|
|
105
106
|
'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,
|
|
106
107
|
'Unspecified' : IDL.Record({}),
|
|
107
108
|
'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,
|
|
@@ -468,6 +469,7 @@ export const init = ({ IDL }) => {
|
|
|
468
469
|
'ManageNervousSystemParameters' : NervousSystemParameters,
|
|
469
470
|
'AddGenericNervousSystemFunction' : NervousSystemFunction,
|
|
470
471
|
'RemoveGenericNervousSystemFunction' : IDL.Nat64,
|
|
472
|
+
'UpgradeSnsToNextVersion' : IDL.Record({}),
|
|
471
473
|
'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,
|
|
472
474
|
'Unspecified' : IDL.Record({}),
|
|
473
475
|
'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,
|
|
@@ -46,10 +46,12 @@ export const idlFactory = ({ IDL }) => {
|
|
|
46
46
|
'canister_id' : IDL.Opt(IDL.Principal),
|
|
47
47
|
});
|
|
48
48
|
const GetSnsCanistersSummaryResponse = IDL.Record({
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
49
|
+
'root' : IDL.Opt(CanisterSummary),
|
|
50
|
+
'swap' : IDL.Opt(CanisterSummary),
|
|
51
|
+
'ledger' : IDL.Opt(CanisterSummary),
|
|
52
|
+
'governance' : IDL.Opt(CanisterSummary),
|
|
53
|
+
'dapps' : IDL.Vec(CanisterSummary),
|
|
54
|
+
'archives' : IDL.Vec(CanisterSummary),
|
|
53
55
|
});
|
|
54
56
|
const ListSnsCanistersResponse = IDL.Record({
|
|
55
57
|
'root' : IDL.Opt(IDL.Principal),
|
|
@@ -47,10 +47,12 @@ export interface FailedUpdate {
|
|
|
47
47
|
dapp_canister_id: [] | [Principal];
|
|
48
48
|
}
|
|
49
49
|
export interface GetSnsCanistersSummaryResponse {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
root: [] | [CanisterSummary];
|
|
51
|
+
swap: [] | [CanisterSummary];
|
|
52
|
+
ledger: [] | [CanisterSummary];
|
|
53
|
+
governance: [] | [CanisterSummary];
|
|
54
|
+
dapps: Array<CanisterSummary>;
|
|
55
|
+
archives: Array<CanisterSummary>;
|
|
54
56
|
}
|
|
55
57
|
export interface ListSnsCanistersResponse {
|
|
56
58
|
root: [] | [Principal];
|
package/dist/candid/sns_root.did
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit d06567deb84dddcfb495be96ed9c318d2d3e8ce1 'rs/sns/root/canister/root.did' by import-candid
|
|
2
2
|
type CanisterCallError = record { code : opt int32; description : text };
|
|
3
3
|
type CanisterIdRecord = record { canister_id : principal };
|
|
4
4
|
type CanisterStatusResult = record {
|
|
@@ -36,10 +36,12 @@ type FailedUpdate = record {
|
|
|
36
36
|
dapp_canister_id : opt principal;
|
|
37
37
|
};
|
|
38
38
|
type GetSnsCanistersSummaryResponse = record {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
root : opt CanisterSummary;
|
|
40
|
+
swap : opt CanisterSummary;
|
|
41
|
+
ledger : opt CanisterSummary;
|
|
42
|
+
governance : opt CanisterSummary;
|
|
43
|
+
dapps : vec CanisterSummary;
|
|
44
|
+
archives : vec CanisterSummary;
|
|
43
45
|
};
|
|
44
46
|
type ListSnsCanistersResponse = record {
|
|
45
47
|
root : opt principal;
|
|
@@ -46,10 +46,12 @@ export const idlFactory = ({ IDL }) => {
|
|
|
46
46
|
'canister_id' : IDL.Opt(IDL.Principal),
|
|
47
47
|
});
|
|
48
48
|
const GetSnsCanistersSummaryResponse = IDL.Record({
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
49
|
+
'root' : IDL.Opt(CanisterSummary),
|
|
50
|
+
'swap' : IDL.Opt(CanisterSummary),
|
|
51
|
+
'ledger' : IDL.Opt(CanisterSummary),
|
|
52
|
+
'governance' : IDL.Opt(CanisterSummary),
|
|
53
|
+
'dapps' : IDL.Vec(CanisterSummary),
|
|
54
|
+
'archives' : IDL.Vec(CanisterSummary),
|
|
53
55
|
});
|
|
54
56
|
const ListSnsCanistersResponse = IDL.Record({
|
|
55
57
|
'root' : IDL.Opt(IDL.Principal),
|
|
@@ -20,21 +20,49 @@ export const idlFactory = ({ IDL }) => {
|
|
|
20
20
|
'code' : IDL.Opt(IDL.Int32),
|
|
21
21
|
'description' : IDL.Text,
|
|
22
22
|
});
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const FailedUpdate = IDL.Record({
|
|
24
|
+
'err' : IDL.Opt(CanisterCallError),
|
|
25
|
+
'dapp_canister_id' : IDL.Opt(IDL.Principal),
|
|
26
|
+
});
|
|
27
|
+
const SetDappControllersResponse = IDL.Record({
|
|
28
|
+
'failed_updates' : IDL.Vec(FailedUpdate),
|
|
29
|
+
});
|
|
30
|
+
const Possibility = IDL.Variant({
|
|
31
|
+
'Ok' : SetDappControllersResponse,
|
|
32
|
+
'Err' : CanisterCallError,
|
|
33
|
+
});
|
|
34
|
+
const SetDappControllersCallResult = IDL.Record({
|
|
25
35
|
'possibility' : IDL.Opt(Possibility),
|
|
26
36
|
});
|
|
37
|
+
const Possibility_1 = IDL.Variant({ 'Err' : CanisterCallError });
|
|
38
|
+
const SetModeCallResult = IDL.Record({
|
|
39
|
+
'possibility' : IDL.Opt(Possibility_1),
|
|
40
|
+
});
|
|
27
41
|
const SweepResult = IDL.Record({
|
|
28
42
|
'failure' : IDL.Nat32,
|
|
29
43
|
'skipped' : IDL.Nat32,
|
|
30
44
|
'success' : IDL.Nat32,
|
|
31
45
|
});
|
|
32
46
|
const FinalizeSwapResponse = IDL.Record({
|
|
47
|
+
'set_dapp_controllers_result' : IDL.Opt(SetDappControllersCallResult),
|
|
33
48
|
'sns_governance_normal_mode_enabled' : IDL.Opt(SetModeCallResult),
|
|
34
49
|
'sweep_icp' : IDL.Opt(SweepResult),
|
|
35
50
|
'sweep_sns' : IDL.Opt(SweepResult),
|
|
36
51
|
'create_neuron' : IDL.Opt(SweepResult),
|
|
37
52
|
});
|
|
53
|
+
const GetBuyerStateRequest = IDL.Record({
|
|
54
|
+
'principal_id' : IDL.Opt(IDL.Principal),
|
|
55
|
+
});
|
|
56
|
+
const BuyerState = IDL.Record({
|
|
57
|
+
'icp_disbursing' : IDL.Bool,
|
|
58
|
+
'amount_sns_e8s' : IDL.Nat64,
|
|
59
|
+
'amount_icp_e8s' : IDL.Nat64,
|
|
60
|
+
'sns_disbursing' : IDL.Bool,
|
|
61
|
+
});
|
|
62
|
+
const GetBuyerStateResponse = IDL.Record({
|
|
63
|
+
'buyer_state' : IDL.Opt(BuyerState),
|
|
64
|
+
});
|
|
65
|
+
const GetBuyersTotalResponse = IDL.Record({ 'buyers_total' : IDL.Nat64 });
|
|
38
66
|
const CanisterStatusType = IDL.Variant({
|
|
39
67
|
'stopped' : IDL.Null,
|
|
40
68
|
'stopping' : IDL.Null,
|
|
@@ -58,19 +86,10 @@ export const idlFactory = ({ IDL }) => {
|
|
|
58
86
|
'idle_cycles_burned_per_day' : IDL.Nat,
|
|
59
87
|
'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
60
88
|
});
|
|
61
|
-
const GetCanisterStatusResponse = IDL.Record({
|
|
62
|
-
'status' : CanisterStatusResultV2,
|
|
63
|
-
});
|
|
64
89
|
const TimeWindow = IDL.Record({
|
|
65
90
|
'start_timestamp_seconds' : IDL.Nat64,
|
|
66
91
|
'end_timestamp_seconds' : IDL.Nat64,
|
|
67
92
|
});
|
|
68
|
-
const BuyerState = IDL.Record({
|
|
69
|
-
'icp_disbursing' : IDL.Bool,
|
|
70
|
-
'amount_sns_e8s' : IDL.Nat64,
|
|
71
|
-
'amount_icp_e8s' : IDL.Nat64,
|
|
72
|
-
'sns_disbursing' : IDL.Bool,
|
|
73
|
-
});
|
|
74
93
|
const State = IDL.Record({
|
|
75
94
|
'open_time_window' : IDL.Opt(TimeWindow),
|
|
76
95
|
'sns_token_e8s' : IDL.Nat64,
|
|
@@ -97,9 +116,19 @@ export const idlFactory = ({ IDL }) => {
|
|
|
97
116
|
[],
|
|
98
117
|
),
|
|
99
118
|
'finalize_swap' : IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),
|
|
119
|
+
'get_buyer_state' : IDL.Func(
|
|
120
|
+
[GetBuyerStateRequest],
|
|
121
|
+
[GetBuyerStateResponse],
|
|
122
|
+
[],
|
|
123
|
+
),
|
|
124
|
+
'get_buyers_total' : IDL.Func(
|
|
125
|
+
[IDL.Record({})],
|
|
126
|
+
[GetBuyersTotalResponse],
|
|
127
|
+
[],
|
|
128
|
+
),
|
|
100
129
|
'get_canister_status' : IDL.Func(
|
|
101
130
|
[IDL.Record({})],
|
|
102
|
-
[
|
|
131
|
+
[CanisterStatusResultV2],
|
|
103
132
|
[],
|
|
104
133
|
),
|
|
105
134
|
'get_state' : IDL.Func([IDL.Record({})], [GetStateResponse], []),
|
|
@@ -39,14 +39,25 @@ export interface ErrorRefundIcpRequest {
|
|
|
39
39
|
icp_e8s: bigint;
|
|
40
40
|
fee_override_e8s: bigint;
|
|
41
41
|
}
|
|
42
|
+
export interface FailedUpdate {
|
|
43
|
+
err: [] | [CanisterCallError];
|
|
44
|
+
dapp_canister_id: [] | [Principal];
|
|
45
|
+
}
|
|
42
46
|
export interface FinalizeSwapResponse {
|
|
47
|
+
set_dapp_controllers_result: [] | [SetDappControllersCallResult];
|
|
43
48
|
sns_governance_normal_mode_enabled: [] | [SetModeCallResult];
|
|
44
49
|
sweep_icp: [] | [SweepResult];
|
|
45
50
|
sweep_sns: [] | [SweepResult];
|
|
46
51
|
create_neuron: [] | [SweepResult];
|
|
47
52
|
}
|
|
48
|
-
export interface
|
|
49
|
-
|
|
53
|
+
export interface GetBuyerStateRequest {
|
|
54
|
+
principal_id: [] | [Principal];
|
|
55
|
+
}
|
|
56
|
+
export interface GetBuyerStateResponse {
|
|
57
|
+
buyer_state: [] | [BuyerState];
|
|
58
|
+
}
|
|
59
|
+
export interface GetBuyersTotalResponse {
|
|
60
|
+
buyers_total: bigint;
|
|
50
61
|
}
|
|
51
62
|
export interface GetStateResponse {
|
|
52
63
|
swap: [] | [Swap];
|
|
@@ -64,13 +75,22 @@ export interface Init {
|
|
|
64
75
|
sns_governance_canister_id: string;
|
|
65
76
|
min_icp_e8s: bigint;
|
|
66
77
|
}
|
|
67
|
-
export type Possibility =
|
|
78
|
+
export type Possibility =
|
|
79
|
+
| { Ok: SetDappControllersResponse }
|
|
80
|
+
| { Err: CanisterCallError };
|
|
81
|
+
export type Possibility_1 = { Err: CanisterCallError };
|
|
68
82
|
export interface RefreshBuyerTokensRequest {
|
|
69
83
|
buyer: string;
|
|
70
84
|
}
|
|
71
|
-
export interface
|
|
85
|
+
export interface SetDappControllersCallResult {
|
|
72
86
|
possibility: [] | [Possibility];
|
|
73
87
|
}
|
|
88
|
+
export interface SetDappControllersResponse {
|
|
89
|
+
failed_updates: Array<FailedUpdate>;
|
|
90
|
+
}
|
|
91
|
+
export interface SetModeCallResult {
|
|
92
|
+
possibility: [] | [Possibility_1];
|
|
93
|
+
}
|
|
74
94
|
export interface SetOpenTimeWindowRequest {
|
|
75
95
|
open_time_window: [] | [TimeWindow];
|
|
76
96
|
}
|
|
@@ -96,7 +116,11 @@ export interface TimeWindow {
|
|
|
96
116
|
export interface _SERVICE {
|
|
97
117
|
error_refund_icp: (arg_0: ErrorRefundIcpRequest) => Promise<{}>;
|
|
98
118
|
finalize_swap: (arg_0: {}) => Promise<FinalizeSwapResponse>;
|
|
99
|
-
|
|
119
|
+
get_buyer_state: (
|
|
120
|
+
arg_0: GetBuyerStateRequest
|
|
121
|
+
) => Promise<GetBuyerStateResponse>;
|
|
122
|
+
get_buyers_total: (arg_0: {}) => Promise<GetBuyersTotalResponse>;
|
|
123
|
+
get_canister_status: (arg_0: {}) => Promise<CanisterStatusResultV2>;
|
|
100
124
|
get_state: (arg_0: {}) => Promise<GetStateResponse>;
|
|
101
125
|
refresh_buyer_tokens: (arg_0: RefreshBuyerTokensRequest) => Promise<{}>;
|
|
102
126
|
refresh_sns_tokens: (arg_0: {}) => Promise<{}>;
|
package/dist/candid/sns_swap.did
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit d06567deb84dddcfb495be96ed9c318d2d3e8ce1 'rs/sns/swap/canister/swap.did' by import-candid
|
|
2
2
|
type BuyerState = record {
|
|
3
3
|
icp_disbursing : bool;
|
|
4
4
|
amount_sns_e8s : nat64;
|
|
@@ -33,15 +33,24 @@ type ErrorRefundIcpRequest = record {
|
|
|
33
33
|
icp_e8s : nat64;
|
|
34
34
|
fee_override_e8s : nat64;
|
|
35
35
|
};
|
|
36
|
+
type FailedUpdate = record {
|
|
37
|
+
err : opt CanisterCallError;
|
|
38
|
+
dapp_canister_id : opt principal;
|
|
39
|
+
};
|
|
36
40
|
type FinalizeSwapResponse = record {
|
|
41
|
+
set_dapp_controllers_result : opt SetDappControllersCallResult;
|
|
37
42
|
sns_governance_normal_mode_enabled : opt SetModeCallResult;
|
|
38
43
|
sweep_icp : opt SweepResult;
|
|
39
44
|
sweep_sns : opt SweepResult;
|
|
40
45
|
create_neuron : opt SweepResult;
|
|
41
46
|
};
|
|
42
|
-
type
|
|
47
|
+
type GetBuyerStateRequest = record { principal_id : opt principal };
|
|
48
|
+
type GetBuyerStateResponse = record { buyer_state : opt BuyerState };
|
|
49
|
+
type GetBuyersTotalResponse = record { buyers_total : nat64 };
|
|
43
50
|
type GetStateResponse = record { swap : opt Swap; derived : opt DerivedState };
|
|
44
51
|
type Init = record {
|
|
52
|
+
// Not deployed yet
|
|
53
|
+
// sns_root_canister_id : text;
|
|
45
54
|
min_participant_icp_e8s : nat64;
|
|
46
55
|
fallback_controller_principal_ids : vec text;
|
|
47
56
|
max_icp_e8s : nat64;
|
|
@@ -53,9 +62,15 @@ type Init = record {
|
|
|
53
62
|
sns_governance_canister_id : text;
|
|
54
63
|
min_icp_e8s : nat64;
|
|
55
64
|
};
|
|
56
|
-
type Possibility = variant {
|
|
65
|
+
type Possibility = variant {
|
|
66
|
+
Ok : SetDappControllersResponse;
|
|
67
|
+
Err : CanisterCallError;
|
|
68
|
+
};
|
|
69
|
+
type Possibility_1 = variant { Err : CanisterCallError };
|
|
57
70
|
type RefreshBuyerTokensRequest = record { buyer : text };
|
|
58
|
-
type
|
|
71
|
+
type SetDappControllersCallResult = record { possibility : opt Possibility };
|
|
72
|
+
type SetDappControllersResponse = record { failed_updates : vec FailedUpdate };
|
|
73
|
+
type SetModeCallResult = record { possibility : opt Possibility_1 };
|
|
59
74
|
type SetOpenTimeWindowRequest = record { open_time_window : opt TimeWindow };
|
|
60
75
|
type State = record {
|
|
61
76
|
open_time_window : opt TimeWindow;
|
|
@@ -72,7 +87,9 @@ type TimeWindow = record {
|
|
|
72
87
|
service : (Init) -> {
|
|
73
88
|
error_refund_icp : (ErrorRefundIcpRequest) -> (record {});
|
|
74
89
|
finalize_swap : (record {}) -> (FinalizeSwapResponse);
|
|
75
|
-
|
|
90
|
+
get_buyer_state : (GetBuyerStateRequest) -> (GetBuyerStateResponse) query;
|
|
91
|
+
get_buyers_total : (record {}) -> (GetBuyersTotalResponse);
|
|
92
|
+
get_canister_status : (record {}) -> (CanisterStatusResultV2);
|
|
76
93
|
get_state : (record {}) -> (GetStateResponse) query;
|
|
77
94
|
refresh_buyer_tokens : (RefreshBuyerTokensRequest) -> (record {});
|
|
78
95
|
refresh_sns_tokens : (record {}) -> (record {});
|
|
@@ -20,21 +20,49 @@ export const idlFactory = ({ IDL }) => {
|
|
|
20
20
|
'code' : IDL.Opt(IDL.Int32),
|
|
21
21
|
'description' : IDL.Text,
|
|
22
22
|
});
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const FailedUpdate = IDL.Record({
|
|
24
|
+
'err' : IDL.Opt(CanisterCallError),
|
|
25
|
+
'dapp_canister_id' : IDL.Opt(IDL.Principal),
|
|
26
|
+
});
|
|
27
|
+
const SetDappControllersResponse = IDL.Record({
|
|
28
|
+
'failed_updates' : IDL.Vec(FailedUpdate),
|
|
29
|
+
});
|
|
30
|
+
const Possibility = IDL.Variant({
|
|
31
|
+
'Ok' : SetDappControllersResponse,
|
|
32
|
+
'Err' : CanisterCallError,
|
|
33
|
+
});
|
|
34
|
+
const SetDappControllersCallResult = IDL.Record({
|
|
25
35
|
'possibility' : IDL.Opt(Possibility),
|
|
26
36
|
});
|
|
37
|
+
const Possibility_1 = IDL.Variant({ 'Err' : CanisterCallError });
|
|
38
|
+
const SetModeCallResult = IDL.Record({
|
|
39
|
+
'possibility' : IDL.Opt(Possibility_1),
|
|
40
|
+
});
|
|
27
41
|
const SweepResult = IDL.Record({
|
|
28
42
|
'failure' : IDL.Nat32,
|
|
29
43
|
'skipped' : IDL.Nat32,
|
|
30
44
|
'success' : IDL.Nat32,
|
|
31
45
|
});
|
|
32
46
|
const FinalizeSwapResponse = IDL.Record({
|
|
47
|
+
'set_dapp_controllers_result' : IDL.Opt(SetDappControllersCallResult),
|
|
33
48
|
'sns_governance_normal_mode_enabled' : IDL.Opt(SetModeCallResult),
|
|
34
49
|
'sweep_icp' : IDL.Opt(SweepResult),
|
|
35
50
|
'sweep_sns' : IDL.Opt(SweepResult),
|
|
36
51
|
'create_neuron' : IDL.Opt(SweepResult),
|
|
37
52
|
});
|
|
53
|
+
const GetBuyerStateRequest = IDL.Record({
|
|
54
|
+
'principal_id' : IDL.Opt(IDL.Principal),
|
|
55
|
+
});
|
|
56
|
+
const BuyerState = IDL.Record({
|
|
57
|
+
'icp_disbursing' : IDL.Bool,
|
|
58
|
+
'amount_sns_e8s' : IDL.Nat64,
|
|
59
|
+
'amount_icp_e8s' : IDL.Nat64,
|
|
60
|
+
'sns_disbursing' : IDL.Bool,
|
|
61
|
+
});
|
|
62
|
+
const GetBuyerStateResponse = IDL.Record({
|
|
63
|
+
'buyer_state' : IDL.Opt(BuyerState),
|
|
64
|
+
});
|
|
65
|
+
const GetBuyersTotalResponse = IDL.Record({ 'buyers_total' : IDL.Nat64 });
|
|
38
66
|
const CanisterStatusType = IDL.Variant({
|
|
39
67
|
'stopped' : IDL.Null,
|
|
40
68
|
'stopping' : IDL.Null,
|
|
@@ -58,19 +86,10 @@ export const idlFactory = ({ IDL }) => {
|
|
|
58
86
|
'idle_cycles_burned_per_day' : IDL.Nat,
|
|
59
87
|
'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
60
88
|
});
|
|
61
|
-
const GetCanisterStatusResponse = IDL.Record({
|
|
62
|
-
'status' : CanisterStatusResultV2,
|
|
63
|
-
});
|
|
64
89
|
const TimeWindow = IDL.Record({
|
|
65
90
|
'start_timestamp_seconds' : IDL.Nat64,
|
|
66
91
|
'end_timestamp_seconds' : IDL.Nat64,
|
|
67
92
|
});
|
|
68
|
-
const BuyerState = IDL.Record({
|
|
69
|
-
'icp_disbursing' : IDL.Bool,
|
|
70
|
-
'amount_sns_e8s' : IDL.Nat64,
|
|
71
|
-
'amount_icp_e8s' : IDL.Nat64,
|
|
72
|
-
'sns_disbursing' : IDL.Bool,
|
|
73
|
-
});
|
|
74
93
|
const State = IDL.Record({
|
|
75
94
|
'open_time_window' : IDL.Opt(TimeWindow),
|
|
76
95
|
'sns_token_e8s' : IDL.Nat64,
|
|
@@ -97,9 +116,19 @@ export const idlFactory = ({ IDL }) => {
|
|
|
97
116
|
[],
|
|
98
117
|
),
|
|
99
118
|
'finalize_swap' : IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),
|
|
119
|
+
'get_buyer_state' : IDL.Func(
|
|
120
|
+
[GetBuyerStateRequest],
|
|
121
|
+
[GetBuyerStateResponse],
|
|
122
|
+
['query'],
|
|
123
|
+
),
|
|
124
|
+
'get_buyers_total' : IDL.Func(
|
|
125
|
+
[IDL.Record({})],
|
|
126
|
+
[GetBuyersTotalResponse],
|
|
127
|
+
[],
|
|
128
|
+
),
|
|
100
129
|
'get_canister_status' : IDL.Func(
|
|
101
130
|
[IDL.Record({})],
|
|
102
|
-
[
|
|
131
|
+
[CanisterStatusResultV2],
|
|
103
132
|
[],
|
|
104
133
|
),
|
|
105
134
|
'get_state' : IDL.Func([IDL.Record({})], [GetStateResponse], ['query']),
|