@dfinity/sns 0.0.2 → 0.0.3-next-2022-08-08
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.certified.idl.d.ts → icrc1_ledger.certified.idl.d.ts} +0 -0
- package/dist/candid/icrc1_ledger.certified.idl.js +104 -0
- package/dist/candid/icrc1_ledger.d.ts +64 -0
- package/dist/candid/icrc1_ledger.did +77 -0
- package/dist/candid/{ledger.idl.d.ts → icrc1_ledger.idl.d.ts} +0 -0
- package/dist/candid/icrc1_ledger.idl.js +108 -0
- package/dist/candid/sns_governance.certified.idl.js +21 -0
- package/dist/candid/sns_governance.d.ts +11 -0
- package/dist/candid/sns_governance.did +12 -1
- package/dist/candid/sns_governance.idl.js +25 -0
- package/dist/candid/sns_root.certified.idl.js +10 -4
- package/dist/candid/sns_root.d.ts +8 -4
- package/dist/candid/sns_root.did +9 -5
- package/dist/candid/sns_root.idl.js +10 -4
- package/dist/candid/sns_swap.certified.idl.js +43 -12
- package/dist/candid/sns_swap.d.ts +30 -5
- package/dist/candid/sns_swap.did +21 -5
- package/dist/candid/sns_swap.idl.js +43 -12
- package/dist/cjs/index.cjs.js +1 -852
- package/dist/cjs/index.cjs.js.map +3 -3
- package/dist/esm/chunk-BW5FNCFQ.js +2 -0
- package/dist/esm/chunk-BW5FNCFQ.js.map +7 -0
- package/dist/esm/chunk-C7NIDDRE.js +2 -0
- package/dist/esm/chunk-C7NIDDRE.js.map +7 -0
- package/dist/esm/chunk-ETZUMPBI.js +2 -0
- package/dist/esm/chunk-ETZUMPBI.js.map +7 -0
- package/dist/esm/chunk-OZ3QVZ6V.js +2 -0
- package/dist/esm/chunk-OZ3QVZ6V.js.map +7 -0
- package/dist/esm/chunk-UTRXOFS6.js +2 -0
- package/dist/esm/chunk-UTRXOFS6.js.map +7 -0
- package/dist/esm/chunk-WP45ZSPX.js +2 -0
- package/dist/esm/chunk-WP45ZSPX.js.map +7 -0
- package/dist/esm/chunk-YFZBYWX4.js +2 -0
- package/dist/esm/chunk-YFZBYWX4.js.map +7 -0
- package/dist/esm/governance.canister.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +3 -3
- 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/converters/governance.converters.d.ts +4 -0
- package/dist/types/enums/governance.enums.d.ts +11 -0
- package/dist/types/errors/governance.errors.d.ts +2 -0
- package/dist/types/governance.canister.d.ts +32 -7
- package/dist/types/index.d.ts +11 -8
- package/dist/types/ledger.canister.d.ts +10 -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 +20 -13
- package/dist/types/swap.canister.d.ts +12 -4
- package/dist/types/types/canister.options.d.ts +2 -5
- package/dist/types/types/governance.params.d.ts +16 -1
- package/dist/types/types/ledger.responses.d.ts +11 -0
- package/package.json +6 -4
- package/dist/candid/ledger.certified.idl.js +0 -97
- package/dist/candid/ledger.d.ts +0 -106
- package/dist/candid/ledger.did +0 -250
- package/dist/candid/ledger.idl.js +0 -109
- 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-QOHSQFP6.js.map +0 -7
- 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/types/utils/actor.utils.d.ts +0 -14
- package/dist/types/utils/agent.utils.d.ts +0 -5
- package/dist/types/utils/asserts.utils.d.ts +0 -3
- package/dist/types/utils/did.utils.d.ts +0 -2
|
@@ -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];
|
|
@@ -71,6 +73,8 @@ export interface SetDappControllersResponse {
|
|
|
71
73
|
}
|
|
72
74
|
export interface SnsRootCanister {
|
|
73
75
|
dapp_canister_ids: Array<Principal>;
|
|
76
|
+
latest_ledger_archive_poll_timestamp_seconds: [] | [bigint];
|
|
77
|
+
archive_canister_ids: Array<Principal>;
|
|
74
78
|
governance_canister_id: [] | [Principal];
|
|
75
79
|
swap_canister_id: [] | [Principal];
|
|
76
80
|
ledger_canister_id: [] | [Principal];
|
package/dist/candid/sns_root.did
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit 518271451cf8901c77c986e007e2c4762d1fc948 '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;
|
|
@@ -56,6 +58,8 @@ type SetDappControllersRequest = record {
|
|
|
56
58
|
type SetDappControllersResponse = record { failed_updates : vec FailedUpdate };
|
|
57
59
|
type SnsRootCanister = record {
|
|
58
60
|
dapp_canister_ids : vec principal;
|
|
61
|
+
latest_ledger_archive_poll_timestamp_seconds : opt nat64;
|
|
62
|
+
archive_canister_ids : vec principal;
|
|
59
63
|
governance_canister_id : opt principal;
|
|
60
64
|
swap_canister_id : opt principal;
|
|
61
65
|
ledger_canister_id : opt principal;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
export const idlFactory = ({ IDL }) => {
|
|
3
3
|
const SnsRootCanister = IDL.Record({
|
|
4
4
|
'dapp_canister_ids' : IDL.Vec(IDL.Principal),
|
|
5
|
+
'latest_ledger_archive_poll_timestamp_seconds' : IDL.Opt(IDL.Nat64),
|
|
6
|
+
'archive_canister_ids' : IDL.Vec(IDL.Principal),
|
|
5
7
|
'governance_canister_id' : IDL.Opt(IDL.Principal),
|
|
6
8
|
'swap_canister_id' : IDL.Opt(IDL.Principal),
|
|
7
9
|
'ledger_canister_id' : IDL.Opt(IDL.Principal),
|
|
@@ -46,10 +48,12 @@ export const idlFactory = ({ IDL }) => {
|
|
|
46
48
|
'canister_id' : IDL.Opt(IDL.Principal),
|
|
47
49
|
});
|
|
48
50
|
const GetSnsCanistersSummaryResponse = IDL.Record({
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
51
|
+
'root' : IDL.Opt(CanisterSummary),
|
|
52
|
+
'swap' : IDL.Opt(CanisterSummary),
|
|
53
|
+
'ledger' : IDL.Opt(CanisterSummary),
|
|
54
|
+
'governance' : IDL.Opt(CanisterSummary),
|
|
55
|
+
'dapps' : IDL.Vec(CanisterSummary),
|
|
56
|
+
'archives' : IDL.Vec(CanisterSummary),
|
|
53
57
|
});
|
|
54
58
|
const ListSnsCanistersResponse = IDL.Record({
|
|
55
59
|
'root' : IDL.Opt(IDL.Principal),
|
|
@@ -108,6 +112,8 @@ export const idlFactory = ({ IDL }) => {
|
|
|
108
112
|
export const init = ({ IDL }) => {
|
|
109
113
|
const SnsRootCanister = IDL.Record({
|
|
110
114
|
'dapp_canister_ids' : IDL.Vec(IDL.Principal),
|
|
115
|
+
'latest_ledger_archive_poll_timestamp_seconds' : IDL.Opt(IDL.Nat64),
|
|
116
|
+
'archive_canister_ids' : IDL.Vec(IDL.Principal),
|
|
111
117
|
'governance_canister_id' : IDL.Opt(IDL.Principal),
|
|
112
118
|
'swap_canister_id' : IDL.Opt(IDL.Principal),
|
|
113
119
|
'ledger_canister_id' : IDL.Opt(IDL.Principal),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_swap.did */
|
|
2
2
|
export const idlFactory = ({ IDL }) => {
|
|
3
3
|
const Init = IDL.Record({
|
|
4
|
+
'sns_root_canister_id' : IDL.Text,
|
|
4
5
|
'min_participant_icp_e8s' : IDL.Nat64,
|
|
5
6
|
'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),
|
|
6
7
|
'max_icp_e8s' : IDL.Nat64,
|
|
@@ -20,21 +21,49 @@ export const idlFactory = ({ IDL }) => {
|
|
|
20
21
|
'code' : IDL.Opt(IDL.Int32),
|
|
21
22
|
'description' : IDL.Text,
|
|
22
23
|
});
|
|
23
|
-
const
|
|
24
|
-
|
|
24
|
+
const FailedUpdate = IDL.Record({
|
|
25
|
+
'err' : IDL.Opt(CanisterCallError),
|
|
26
|
+
'dapp_canister_id' : IDL.Opt(IDL.Principal),
|
|
27
|
+
});
|
|
28
|
+
const SetDappControllersResponse = IDL.Record({
|
|
29
|
+
'failed_updates' : IDL.Vec(FailedUpdate),
|
|
30
|
+
});
|
|
31
|
+
const Possibility = IDL.Variant({
|
|
32
|
+
'Ok' : SetDappControllersResponse,
|
|
33
|
+
'Err' : CanisterCallError,
|
|
34
|
+
});
|
|
35
|
+
const SetDappControllersCallResult = IDL.Record({
|
|
25
36
|
'possibility' : IDL.Opt(Possibility),
|
|
26
37
|
});
|
|
38
|
+
const Possibility_1 = IDL.Variant({ 'Err' : CanisterCallError });
|
|
39
|
+
const SetModeCallResult = IDL.Record({
|
|
40
|
+
'possibility' : IDL.Opt(Possibility_1),
|
|
41
|
+
});
|
|
27
42
|
const SweepResult = IDL.Record({
|
|
28
43
|
'failure' : IDL.Nat32,
|
|
29
44
|
'skipped' : IDL.Nat32,
|
|
30
45
|
'success' : IDL.Nat32,
|
|
31
46
|
});
|
|
32
47
|
const FinalizeSwapResponse = IDL.Record({
|
|
48
|
+
'set_dapp_controllers_result' : IDL.Opt(SetDappControllersCallResult),
|
|
33
49
|
'sns_governance_normal_mode_enabled' : IDL.Opt(SetModeCallResult),
|
|
34
50
|
'sweep_icp' : IDL.Opt(SweepResult),
|
|
35
51
|
'sweep_sns' : IDL.Opt(SweepResult),
|
|
36
52
|
'create_neuron' : IDL.Opt(SweepResult),
|
|
37
53
|
});
|
|
54
|
+
const GetBuyerStateRequest = IDL.Record({
|
|
55
|
+
'principal_id' : IDL.Opt(IDL.Principal),
|
|
56
|
+
});
|
|
57
|
+
const BuyerState = IDL.Record({
|
|
58
|
+
'icp_disbursing' : IDL.Bool,
|
|
59
|
+
'amount_sns_e8s' : IDL.Nat64,
|
|
60
|
+
'amount_icp_e8s' : IDL.Nat64,
|
|
61
|
+
'sns_disbursing' : IDL.Bool,
|
|
62
|
+
});
|
|
63
|
+
const GetBuyerStateResponse = IDL.Record({
|
|
64
|
+
'buyer_state' : IDL.Opt(BuyerState),
|
|
65
|
+
});
|
|
66
|
+
const GetBuyersTotalResponse = IDL.Record({ 'buyers_total' : IDL.Nat64 });
|
|
38
67
|
const CanisterStatusType = IDL.Variant({
|
|
39
68
|
'stopped' : IDL.Null,
|
|
40
69
|
'stopping' : IDL.Null,
|
|
@@ -58,19 +87,10 @@ export const idlFactory = ({ IDL }) => {
|
|
|
58
87
|
'idle_cycles_burned_per_day' : IDL.Nat,
|
|
59
88
|
'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
60
89
|
});
|
|
61
|
-
const GetCanisterStatusResponse = IDL.Record({
|
|
62
|
-
'status' : CanisterStatusResultV2,
|
|
63
|
-
});
|
|
64
90
|
const TimeWindow = IDL.Record({
|
|
65
91
|
'start_timestamp_seconds' : IDL.Nat64,
|
|
66
92
|
'end_timestamp_seconds' : IDL.Nat64,
|
|
67
93
|
});
|
|
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
94
|
const State = IDL.Record({
|
|
75
95
|
'open_time_window' : IDL.Opt(TimeWindow),
|
|
76
96
|
'sns_token_e8s' : IDL.Nat64,
|
|
@@ -97,9 +117,19 @@ export const idlFactory = ({ IDL }) => {
|
|
|
97
117
|
[],
|
|
98
118
|
),
|
|
99
119
|
'finalize_swap' : IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),
|
|
120
|
+
'get_buyer_state' : IDL.Func(
|
|
121
|
+
[GetBuyerStateRequest],
|
|
122
|
+
[GetBuyerStateResponse],
|
|
123
|
+
[],
|
|
124
|
+
),
|
|
125
|
+
'get_buyers_total' : IDL.Func(
|
|
126
|
+
[IDL.Record({})],
|
|
127
|
+
[GetBuyersTotalResponse],
|
|
128
|
+
[],
|
|
129
|
+
),
|
|
100
130
|
'get_canister_status' : IDL.Func(
|
|
101
131
|
[IDL.Record({})],
|
|
102
|
-
[
|
|
132
|
+
[CanisterStatusResultV2],
|
|
103
133
|
[],
|
|
104
134
|
),
|
|
105
135
|
'get_state' : IDL.Func([IDL.Record({})], [GetStateResponse], []),
|
|
@@ -118,6 +148,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
118
148
|
};
|
|
119
149
|
export const init = ({ IDL }) => {
|
|
120
150
|
const Init = IDL.Record({
|
|
151
|
+
'sns_root_canister_id' : IDL.Text,
|
|
121
152
|
'min_participant_icp_e8s' : IDL.Nat64,
|
|
122
153
|
'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),
|
|
123
154
|
'max_icp_e8s' : IDL.Nat64,
|
|
@@ -39,20 +39,32 @@ 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];
|
|
53
64
|
derived: [] | [DerivedState];
|
|
54
65
|
}
|
|
55
66
|
export interface Init {
|
|
67
|
+
sns_root_canister_id: string;
|
|
56
68
|
min_participant_icp_e8s: bigint;
|
|
57
69
|
fallback_controller_principal_ids: Array<string>;
|
|
58
70
|
max_icp_e8s: bigint;
|
|
@@ -64,13 +76,22 @@ export interface Init {
|
|
|
64
76
|
sns_governance_canister_id: string;
|
|
65
77
|
min_icp_e8s: bigint;
|
|
66
78
|
}
|
|
67
|
-
export type Possibility =
|
|
79
|
+
export type Possibility =
|
|
80
|
+
| { Ok: SetDappControllersResponse }
|
|
81
|
+
| { Err: CanisterCallError };
|
|
82
|
+
export type Possibility_1 = { Err: CanisterCallError };
|
|
68
83
|
export interface RefreshBuyerTokensRequest {
|
|
69
84
|
buyer: string;
|
|
70
85
|
}
|
|
71
|
-
export interface
|
|
86
|
+
export interface SetDappControllersCallResult {
|
|
72
87
|
possibility: [] | [Possibility];
|
|
73
88
|
}
|
|
89
|
+
export interface SetDappControllersResponse {
|
|
90
|
+
failed_updates: Array<FailedUpdate>;
|
|
91
|
+
}
|
|
92
|
+
export interface SetModeCallResult {
|
|
93
|
+
possibility: [] | [Possibility_1];
|
|
94
|
+
}
|
|
74
95
|
export interface SetOpenTimeWindowRequest {
|
|
75
96
|
open_time_window: [] | [TimeWindow];
|
|
76
97
|
}
|
|
@@ -96,7 +117,11 @@ export interface TimeWindow {
|
|
|
96
117
|
export interface _SERVICE {
|
|
97
118
|
error_refund_icp: (arg_0: ErrorRefundIcpRequest) => Promise<{}>;
|
|
98
119
|
finalize_swap: (arg_0: {}) => Promise<FinalizeSwapResponse>;
|
|
99
|
-
|
|
120
|
+
get_buyer_state: (
|
|
121
|
+
arg_0: GetBuyerStateRequest
|
|
122
|
+
) => Promise<GetBuyerStateResponse>;
|
|
123
|
+
get_buyers_total: (arg_0: {}) => Promise<GetBuyersTotalResponse>;
|
|
124
|
+
get_canister_status: (arg_0: {}) => Promise<CanisterStatusResultV2>;
|
|
100
125
|
get_state: (arg_0: {}) => Promise<GetStateResponse>;
|
|
101
126
|
refresh_buyer_tokens: (arg_0: RefreshBuyerTokensRequest) => Promise<{}>;
|
|
102
127
|
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 518271451cf8901c77c986e007e2c4762d1fc948 '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,23 @@ 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
|
+
sns_root_canister_id : text;
|
|
45
53
|
min_participant_icp_e8s : nat64;
|
|
46
54
|
fallback_controller_principal_ids : vec text;
|
|
47
55
|
max_icp_e8s : nat64;
|
|
@@ -53,9 +61,15 @@ type Init = record {
|
|
|
53
61
|
sns_governance_canister_id : text;
|
|
54
62
|
min_icp_e8s : nat64;
|
|
55
63
|
};
|
|
56
|
-
type Possibility = variant {
|
|
64
|
+
type Possibility = variant {
|
|
65
|
+
Ok : SetDappControllersResponse;
|
|
66
|
+
Err : CanisterCallError;
|
|
67
|
+
};
|
|
68
|
+
type Possibility_1 = variant { Err : CanisterCallError };
|
|
57
69
|
type RefreshBuyerTokensRequest = record { buyer : text };
|
|
58
|
-
type
|
|
70
|
+
type SetDappControllersCallResult = record { possibility : opt Possibility };
|
|
71
|
+
type SetDappControllersResponse = record { failed_updates : vec FailedUpdate };
|
|
72
|
+
type SetModeCallResult = record { possibility : opt Possibility_1 };
|
|
59
73
|
type SetOpenTimeWindowRequest = record { open_time_window : opt TimeWindow };
|
|
60
74
|
type State = record {
|
|
61
75
|
open_time_window : opt TimeWindow;
|
|
@@ -72,7 +86,9 @@ type TimeWindow = record {
|
|
|
72
86
|
service : (Init) -> {
|
|
73
87
|
error_refund_icp : (ErrorRefundIcpRequest) -> (record {});
|
|
74
88
|
finalize_swap : (record {}) -> (FinalizeSwapResponse);
|
|
75
|
-
|
|
89
|
+
get_buyer_state : (GetBuyerStateRequest) -> (GetBuyerStateResponse) query;
|
|
90
|
+
get_buyers_total : (record {}) -> (GetBuyersTotalResponse);
|
|
91
|
+
get_canister_status : (record {}) -> (CanisterStatusResultV2);
|
|
76
92
|
get_state : (record {}) -> (GetStateResponse) query;
|
|
77
93
|
refresh_buyer_tokens : (RefreshBuyerTokensRequest) -> (record {});
|
|
78
94
|
refresh_sns_tokens : (record {}) -> (record {});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_swap.did */
|
|
2
2
|
export const idlFactory = ({ IDL }) => {
|
|
3
3
|
const Init = IDL.Record({
|
|
4
|
+
'sns_root_canister_id' : IDL.Text,
|
|
4
5
|
'min_participant_icp_e8s' : IDL.Nat64,
|
|
5
6
|
'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),
|
|
6
7
|
'max_icp_e8s' : IDL.Nat64,
|
|
@@ -20,21 +21,49 @@ export const idlFactory = ({ IDL }) => {
|
|
|
20
21
|
'code' : IDL.Opt(IDL.Int32),
|
|
21
22
|
'description' : IDL.Text,
|
|
22
23
|
});
|
|
23
|
-
const
|
|
24
|
-
|
|
24
|
+
const FailedUpdate = IDL.Record({
|
|
25
|
+
'err' : IDL.Opt(CanisterCallError),
|
|
26
|
+
'dapp_canister_id' : IDL.Opt(IDL.Principal),
|
|
27
|
+
});
|
|
28
|
+
const SetDappControllersResponse = IDL.Record({
|
|
29
|
+
'failed_updates' : IDL.Vec(FailedUpdate),
|
|
30
|
+
});
|
|
31
|
+
const Possibility = IDL.Variant({
|
|
32
|
+
'Ok' : SetDappControllersResponse,
|
|
33
|
+
'Err' : CanisterCallError,
|
|
34
|
+
});
|
|
35
|
+
const SetDappControllersCallResult = IDL.Record({
|
|
25
36
|
'possibility' : IDL.Opt(Possibility),
|
|
26
37
|
});
|
|
38
|
+
const Possibility_1 = IDL.Variant({ 'Err' : CanisterCallError });
|
|
39
|
+
const SetModeCallResult = IDL.Record({
|
|
40
|
+
'possibility' : IDL.Opt(Possibility_1),
|
|
41
|
+
});
|
|
27
42
|
const SweepResult = IDL.Record({
|
|
28
43
|
'failure' : IDL.Nat32,
|
|
29
44
|
'skipped' : IDL.Nat32,
|
|
30
45
|
'success' : IDL.Nat32,
|
|
31
46
|
});
|
|
32
47
|
const FinalizeSwapResponse = IDL.Record({
|
|
48
|
+
'set_dapp_controllers_result' : IDL.Opt(SetDappControllersCallResult),
|
|
33
49
|
'sns_governance_normal_mode_enabled' : IDL.Opt(SetModeCallResult),
|
|
34
50
|
'sweep_icp' : IDL.Opt(SweepResult),
|
|
35
51
|
'sweep_sns' : IDL.Opt(SweepResult),
|
|
36
52
|
'create_neuron' : IDL.Opt(SweepResult),
|
|
37
53
|
});
|
|
54
|
+
const GetBuyerStateRequest = IDL.Record({
|
|
55
|
+
'principal_id' : IDL.Opt(IDL.Principal),
|
|
56
|
+
});
|
|
57
|
+
const BuyerState = IDL.Record({
|
|
58
|
+
'icp_disbursing' : IDL.Bool,
|
|
59
|
+
'amount_sns_e8s' : IDL.Nat64,
|
|
60
|
+
'amount_icp_e8s' : IDL.Nat64,
|
|
61
|
+
'sns_disbursing' : IDL.Bool,
|
|
62
|
+
});
|
|
63
|
+
const GetBuyerStateResponse = IDL.Record({
|
|
64
|
+
'buyer_state' : IDL.Opt(BuyerState),
|
|
65
|
+
});
|
|
66
|
+
const GetBuyersTotalResponse = IDL.Record({ 'buyers_total' : IDL.Nat64 });
|
|
38
67
|
const CanisterStatusType = IDL.Variant({
|
|
39
68
|
'stopped' : IDL.Null,
|
|
40
69
|
'stopping' : IDL.Null,
|
|
@@ -58,19 +87,10 @@ export const idlFactory = ({ IDL }) => {
|
|
|
58
87
|
'idle_cycles_burned_per_day' : IDL.Nat,
|
|
59
88
|
'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
60
89
|
});
|
|
61
|
-
const GetCanisterStatusResponse = IDL.Record({
|
|
62
|
-
'status' : CanisterStatusResultV2,
|
|
63
|
-
});
|
|
64
90
|
const TimeWindow = IDL.Record({
|
|
65
91
|
'start_timestamp_seconds' : IDL.Nat64,
|
|
66
92
|
'end_timestamp_seconds' : IDL.Nat64,
|
|
67
93
|
});
|
|
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
94
|
const State = IDL.Record({
|
|
75
95
|
'open_time_window' : IDL.Opt(TimeWindow),
|
|
76
96
|
'sns_token_e8s' : IDL.Nat64,
|
|
@@ -97,9 +117,19 @@ export const idlFactory = ({ IDL }) => {
|
|
|
97
117
|
[],
|
|
98
118
|
),
|
|
99
119
|
'finalize_swap' : IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),
|
|
120
|
+
'get_buyer_state' : IDL.Func(
|
|
121
|
+
[GetBuyerStateRequest],
|
|
122
|
+
[GetBuyerStateResponse],
|
|
123
|
+
['query'],
|
|
124
|
+
),
|
|
125
|
+
'get_buyers_total' : IDL.Func(
|
|
126
|
+
[IDL.Record({})],
|
|
127
|
+
[GetBuyersTotalResponse],
|
|
128
|
+
[],
|
|
129
|
+
),
|
|
100
130
|
'get_canister_status' : IDL.Func(
|
|
101
131
|
[IDL.Record({})],
|
|
102
|
-
[
|
|
132
|
+
[CanisterStatusResultV2],
|
|
103
133
|
[],
|
|
104
134
|
),
|
|
105
135
|
'get_state' : IDL.Func([IDL.Record({})], [GetStateResponse], ['query']),
|
|
@@ -118,6 +148,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
118
148
|
};
|
|
119
149
|
export const init = ({ IDL }) => {
|
|
120
150
|
const Init = IDL.Record({
|
|
151
|
+
'sns_root_canister_id' : IDL.Text,
|
|
121
152
|
'min_participant_icp_e8s' : IDL.Nat64,
|
|
122
153
|
'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),
|
|
123
154
|
'max_icp_e8s' : IDL.Nat64,
|