@dfinity/sns 0.0.3 → 0.0.4-next-2022-09-23
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/README.md +27 -0
- package/dist/candid/icrc1_ledger.d.ts +16 -13
- package/dist/candid/icrc1_ledger.did +2 -2
- package/dist/candid/sns_governance.certified.idl.js +34 -14
- package/dist/candid/sns_governance.d.ts +52 -33
- package/dist/candid/sns_governance.did +17 -2
- package/dist/candid/sns_governance.idl.js +34 -14
- package/dist/candid/sns_root.d.ts +17 -13
- package/dist/candid/sns_swap.certified.idl.js +70 -34
- package/dist/candid/sns_swap.d.ts +81 -36
- package/dist/candid/sns_swap.did +59 -26
- package/dist/candid/sns_swap.idl.js +70 -34
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +2 -2
- package/dist/esm/chunk-CGB4OZHY.js +2 -0
- package/dist/esm/chunk-CGB4OZHY.js.map +7 -0
- package/dist/esm/chunk-CIBAWOSU.js +2 -0
- package/dist/esm/chunk-CIBAWOSU.js.map +7 -0
- package/dist/esm/{chunk-6EXOQWQ6.js → chunk-ZVF3C5QU.js} +2 -2
- package/dist/esm/{chunk-6EXOQWQ6.js.map → chunk-ZVF3C5QU.js.map} +0 -0
- package/dist/esm/governance.canister.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/sns.js +1 -1
- package/dist/esm/swap.canister.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +3 -3
- package/dist/esm/chunk-BW5FNCFQ.js +0 -2
- package/dist/esm/chunk-BW5FNCFQ.js.map +0 -7
- package/dist/esm/chunk-MCNUXKUQ.js +0 -2
- package/dist/esm/chunk-MCNUXKUQ.js.map +0 -7
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { ActorMethod } from "@dfinity/agent";
|
|
1
2
|
import type { Principal } from "@dfinity/principal";
|
|
3
|
+
|
|
2
4
|
export interface CanisterCallError {
|
|
3
5
|
code: [] | [number];
|
|
4
6
|
description: string;
|
|
@@ -10,18 +12,18 @@ export interface CanisterStatusResult {
|
|
|
10
12
|
controller: Principal;
|
|
11
13
|
status: CanisterStatusType;
|
|
12
14
|
memory_size: bigint;
|
|
13
|
-
module_hash: [] | [
|
|
15
|
+
module_hash: [] | [Uint8Array];
|
|
14
16
|
}
|
|
15
17
|
export interface CanisterStatusResultV2 {
|
|
16
18
|
controller: Principal;
|
|
17
19
|
status: CanisterStatusType_1;
|
|
18
20
|
freezing_threshold: bigint;
|
|
19
|
-
balance: Array<[
|
|
21
|
+
balance: Array<[Uint8Array, bigint]>;
|
|
20
22
|
memory_size: bigint;
|
|
21
23
|
cycles: bigint;
|
|
22
24
|
settings: DefiniteCanisterSettingsArgs;
|
|
23
25
|
idle_cycles_burned_per_day: bigint;
|
|
24
|
-
module_hash: [] | [
|
|
26
|
+
module_hash: [] | [Uint8Array];
|
|
25
27
|
}
|
|
26
28
|
export type CanisterStatusType =
|
|
27
29
|
| { stopped: null }
|
|
@@ -83,14 +85,16 @@ export interface SnsRootCanister {
|
|
|
83
85
|
ledger_canister_id: [] | [Principal];
|
|
84
86
|
}
|
|
85
87
|
export interface _SERVICE {
|
|
86
|
-
canister_status:
|
|
87
|
-
get_build_metadata:
|
|
88
|
-
get_sns_canisters_summary:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
88
|
+
canister_status: ActorMethod<[CanisterIdRecord], CanisterStatusResult>;
|
|
89
|
+
get_build_metadata: ActorMethod<[], string>;
|
|
90
|
+
get_sns_canisters_summary: ActorMethod<
|
|
91
|
+
[GetSnsCanistersSummaryRequest],
|
|
92
|
+
GetSnsCanistersSummaryResponse
|
|
93
|
+
>;
|
|
94
|
+
list_sns_canisters: ActorMethod<[{}], ListSnsCanistersResponse>;
|
|
95
|
+
register_dapp_canister: ActorMethod<[RegisterDappCanisterRequest], {}>;
|
|
96
|
+
set_dapp_controllers: ActorMethod<
|
|
97
|
+
[SetDappControllersRequest],
|
|
98
|
+
SetDappControllersResponse
|
|
99
|
+
>;
|
|
96
100
|
}
|
|
@@ -2,25 +2,34 @@
|
|
|
2
2
|
export const idlFactory = ({ IDL }) => {
|
|
3
3
|
const Init = IDL.Record({
|
|
4
4
|
'sns_root_canister_id' : IDL.Text,
|
|
5
|
-
'min_participant_icp_e8s' : IDL.Nat64,
|
|
6
5
|
'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),
|
|
7
|
-
'max_icp_e8s' : IDL.Nat64,
|
|
8
|
-
'min_participants' : IDL.Nat32,
|
|
9
6
|
'nns_governance_canister_id' : IDL.Text,
|
|
10
7
|
'icp_ledger_canister_id' : IDL.Text,
|
|
11
8
|
'sns_ledger_canister_id' : IDL.Text,
|
|
12
|
-
'max_participant_icp_e8s' : IDL.Nat64,
|
|
13
9
|
'sns_governance_canister_id' : IDL.Text,
|
|
14
|
-
'min_icp_e8s' : IDL.Nat64,
|
|
15
10
|
});
|
|
16
11
|
const ErrorRefundIcpRequest = IDL.Record({
|
|
17
12
|
'icp_e8s' : IDL.Nat64,
|
|
18
13
|
'fee_override_e8s' : IDL.Nat64,
|
|
19
14
|
});
|
|
15
|
+
const GovernanceError = IDL.Record({
|
|
16
|
+
'error_message' : IDL.Text,
|
|
17
|
+
'error_type' : IDL.Int32,
|
|
18
|
+
});
|
|
19
|
+
const Response = IDL.Record({
|
|
20
|
+
'governance_error' : IDL.Opt(GovernanceError),
|
|
21
|
+
});
|
|
20
22
|
const CanisterCallError = IDL.Record({
|
|
21
23
|
'code' : IDL.Opt(IDL.Int32),
|
|
22
24
|
'description' : IDL.Text,
|
|
23
25
|
});
|
|
26
|
+
const Possibility = IDL.Variant({
|
|
27
|
+
'Ok' : Response,
|
|
28
|
+
'Err' : CanisterCallError,
|
|
29
|
+
});
|
|
30
|
+
const SettleCommunityFundParticipationResult = IDL.Record({
|
|
31
|
+
'possibility' : IDL.Opt(Possibility),
|
|
32
|
+
});
|
|
24
33
|
const FailedUpdate = IDL.Record({
|
|
25
34
|
'err' : IDL.Opt(CanisterCallError),
|
|
26
35
|
'dapp_canister_id' : IDL.Opt(IDL.Principal),
|
|
@@ -28,16 +37,16 @@ export const idlFactory = ({ IDL }) => {
|
|
|
28
37
|
const SetDappControllersResponse = IDL.Record({
|
|
29
38
|
'failed_updates' : IDL.Vec(FailedUpdate),
|
|
30
39
|
});
|
|
31
|
-
const
|
|
40
|
+
const Possibility_1 = IDL.Variant({
|
|
32
41
|
'Ok' : SetDappControllersResponse,
|
|
33
42
|
'Err' : CanisterCallError,
|
|
34
43
|
});
|
|
35
44
|
const SetDappControllersCallResult = IDL.Record({
|
|
36
|
-
'possibility' : IDL.Opt(
|
|
45
|
+
'possibility' : IDL.Opt(Possibility_1),
|
|
37
46
|
});
|
|
38
|
-
const
|
|
47
|
+
const Possibility_2 = IDL.Variant({ 'Err' : CanisterCallError });
|
|
39
48
|
const SetModeCallResult = IDL.Record({
|
|
40
|
-
'possibility' : IDL.Opt(
|
|
49
|
+
'possibility' : IDL.Opt(Possibility_2),
|
|
41
50
|
});
|
|
42
51
|
const SweepResult = IDL.Record({
|
|
43
52
|
'failure' : IDL.Nat32,
|
|
@@ -45,6 +54,9 @@ export const idlFactory = ({ IDL }) => {
|
|
|
45
54
|
'success' : IDL.Nat32,
|
|
46
55
|
});
|
|
47
56
|
const FinalizeSwapResponse = IDL.Record({
|
|
57
|
+
'settle_community_fund_participation_result' : IDL.Opt(
|
|
58
|
+
SettleCommunityFundParticipationResult
|
|
59
|
+
),
|
|
48
60
|
'set_dapp_controllers_result' : IDL.Opt(SetDappControllersCallResult),
|
|
49
61
|
'sns_governance_normal_mode_enabled' : IDL.Opt(SetModeCallResult),
|
|
50
62
|
'sweep_icp' : IDL.Opt(SweepResult),
|
|
@@ -54,12 +66,12 @@ export const idlFactory = ({ IDL }) => {
|
|
|
54
66
|
const GetBuyerStateRequest = IDL.Record({
|
|
55
67
|
'principal_id' : IDL.Opt(IDL.Principal),
|
|
56
68
|
});
|
|
57
|
-
const
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
61
|
-
'sns_disbursing' : IDL.Bool,
|
|
69
|
+
const TransferableAmount = IDL.Record({
|
|
70
|
+
'transfer_start_timestamp_seconds' : IDL.Nat64,
|
|
71
|
+
'amount_e8s' : IDL.Nat64,
|
|
72
|
+
'transfer_success_timestamp_seconds' : IDL.Nat64,
|
|
62
73
|
});
|
|
74
|
+
const BuyerState = IDL.Record({ 'icp' : IDL.Opt(TransferableAmount) });
|
|
63
75
|
const GetBuyerStateResponse = IDL.Record({
|
|
64
76
|
'buyer_state' : IDL.Opt(BuyerState),
|
|
65
77
|
});
|
|
@@ -87,17 +99,45 @@ export const idlFactory = ({ IDL }) => {
|
|
|
87
99
|
'idle_cycles_burned_per_day' : IDL.Nat,
|
|
88
100
|
'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
89
101
|
});
|
|
90
|
-
const
|
|
91
|
-
'
|
|
92
|
-
'
|
|
102
|
+
const CfInvestment = IDL.Record({
|
|
103
|
+
'hotkey_principal' : IDL.Text,
|
|
104
|
+
'nns_neuron_id' : IDL.Nat64,
|
|
105
|
+
});
|
|
106
|
+
const DirectInvestment = IDL.Record({ 'buyer_principal' : IDL.Text });
|
|
107
|
+
const Investor = IDL.Variant({
|
|
108
|
+
'CommunityFund' : CfInvestment,
|
|
109
|
+
'Direct' : DirectInvestment,
|
|
110
|
+
});
|
|
111
|
+
const SnsNeuronRecipe = IDL.Record({
|
|
112
|
+
'sns' : IDL.Opt(TransferableAmount),
|
|
113
|
+
'investor' : IDL.Opt(Investor),
|
|
93
114
|
});
|
|
94
|
-
const
|
|
95
|
-
'
|
|
115
|
+
const CfNeuron = IDL.Record({
|
|
116
|
+
'nns_neuron_id' : IDL.Nat64,
|
|
117
|
+
'amount_icp_e8s' : IDL.Nat64,
|
|
118
|
+
});
|
|
119
|
+
const CfParticipant = IDL.Record({
|
|
120
|
+
'hotkey_principal' : IDL.Text,
|
|
121
|
+
'cf_neurons' : IDL.Vec(CfNeuron),
|
|
122
|
+
});
|
|
123
|
+
const Params = IDL.Record({
|
|
124
|
+
'min_participant_icp_e8s' : IDL.Nat64,
|
|
125
|
+
'max_icp_e8s' : IDL.Nat64,
|
|
126
|
+
'swap_due_timestamp_seconds' : IDL.Nat64,
|
|
127
|
+
'min_participants' : IDL.Nat32,
|
|
96
128
|
'sns_token_e8s' : IDL.Nat64,
|
|
129
|
+
'max_participant_icp_e8s' : IDL.Nat64,
|
|
130
|
+
'min_icp_e8s' : IDL.Nat64,
|
|
131
|
+
});
|
|
132
|
+
const Swap = IDL.Record({
|
|
133
|
+
'neuron_recipes' : IDL.Vec(SnsNeuronRecipe),
|
|
134
|
+
'cf_participants' : IDL.Vec(CfParticipant),
|
|
135
|
+
'init' : IDL.Opt(Init),
|
|
97
136
|
'lifecycle' : IDL.Int32,
|
|
98
137
|
'buyers' : IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),
|
|
138
|
+
'params' : IDL.Opt(Params),
|
|
139
|
+
'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),
|
|
99
140
|
});
|
|
100
|
-
const Swap = IDL.Record({ 'init' : IDL.Opt(Init), 'state' : IDL.Opt(State) });
|
|
101
141
|
const DerivedState = IDL.Record({
|
|
102
142
|
'sns_tokens_per_icp' : IDL.Float32,
|
|
103
143
|
'buyer_total_icp_e8s' : IDL.Nat64,
|
|
@@ -106,9 +146,15 @@ export const idlFactory = ({ IDL }) => {
|
|
|
106
146
|
'swap' : IDL.Opt(Swap),
|
|
107
147
|
'derived' : IDL.Opt(DerivedState),
|
|
108
148
|
});
|
|
149
|
+
const OpenRequest = IDL.Record({
|
|
150
|
+
'cf_participants' : IDL.Vec(CfParticipant),
|
|
151
|
+
'params' : IDL.Opt(Params),
|
|
152
|
+
'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),
|
|
153
|
+
});
|
|
109
154
|
const RefreshBuyerTokensRequest = IDL.Record({ 'buyer' : IDL.Text });
|
|
110
|
-
const
|
|
111
|
-
'
|
|
155
|
+
const RefreshBuyerTokensResponse = IDL.Record({
|
|
156
|
+
'icp_accepted_participation_e8s' : IDL.Nat64,
|
|
157
|
+
'icp_ledger_account_balance_e8s' : IDL.Nat64,
|
|
112
158
|
});
|
|
113
159
|
return IDL.Service({
|
|
114
160
|
'error_refund_icp' : IDL.Func(
|
|
@@ -133,15 +179,10 @@ export const idlFactory = ({ IDL }) => {
|
|
|
133
179
|
[],
|
|
134
180
|
),
|
|
135
181
|
'get_state' : IDL.Func([IDL.Record({})], [GetStateResponse], []),
|
|
182
|
+
'open' : IDL.Func([OpenRequest], [IDL.Record({})], []),
|
|
136
183
|
'refresh_buyer_tokens' : IDL.Func(
|
|
137
184
|
[RefreshBuyerTokensRequest],
|
|
138
|
-
[
|
|
139
|
-
[],
|
|
140
|
-
),
|
|
141
|
-
'refresh_sns_tokens' : IDL.Func([IDL.Record({})], [IDL.Record({})], []),
|
|
142
|
-
'set_open_time_window' : IDL.Func(
|
|
143
|
-
[SetOpenTimeWindowRequest],
|
|
144
|
-
[IDL.Record({})],
|
|
185
|
+
[RefreshBuyerTokensResponse],
|
|
145
186
|
[],
|
|
146
187
|
),
|
|
147
188
|
});
|
|
@@ -149,16 +190,11 @@ export const idlFactory = ({ IDL }) => {
|
|
|
149
190
|
export const init = ({ IDL }) => {
|
|
150
191
|
const Init = IDL.Record({
|
|
151
192
|
'sns_root_canister_id' : IDL.Text,
|
|
152
|
-
'min_participant_icp_e8s' : IDL.Nat64,
|
|
153
193
|
'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),
|
|
154
|
-
'max_icp_e8s' : IDL.Nat64,
|
|
155
|
-
'min_participants' : IDL.Nat32,
|
|
156
194
|
'nns_governance_canister_id' : IDL.Text,
|
|
157
195
|
'icp_ledger_canister_id' : IDL.Text,
|
|
158
196
|
'sns_ledger_canister_id' : IDL.Text,
|
|
159
|
-
'max_participant_icp_e8s' : IDL.Nat64,
|
|
160
197
|
'sns_governance_canister_id' : IDL.Text,
|
|
161
|
-
'min_icp_e8s' : IDL.Nat64,
|
|
162
198
|
});
|
|
163
199
|
return [Init];
|
|
164
200
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import type { ActorMethod } from "@dfinity/agent";
|
|
1
2
|
import type { Principal } from "@dfinity/principal";
|
|
3
|
+
|
|
2
4
|
export interface BuyerState {
|
|
3
|
-
|
|
4
|
-
amount_sns_e8s: bigint;
|
|
5
|
-
amount_icp_e8s: bigint;
|
|
6
|
-
sns_disbursing: boolean;
|
|
5
|
+
icp: [] | [TransferableAmount];
|
|
7
6
|
}
|
|
8
7
|
export interface CanisterCallError {
|
|
9
8
|
code: [] | [number];
|
|
@@ -13,17 +12,29 @@ export interface CanisterStatusResultV2 {
|
|
|
13
12
|
controller: Principal;
|
|
14
13
|
status: CanisterStatusType;
|
|
15
14
|
freezing_threshold: bigint;
|
|
16
|
-
balance: Array<[
|
|
15
|
+
balance: Array<[Uint8Array, bigint]>;
|
|
17
16
|
memory_size: bigint;
|
|
18
17
|
cycles: bigint;
|
|
19
18
|
settings: DefiniteCanisterSettingsArgs;
|
|
20
19
|
idle_cycles_burned_per_day: bigint;
|
|
21
|
-
module_hash: [] | [
|
|
20
|
+
module_hash: [] | [Uint8Array];
|
|
22
21
|
}
|
|
23
22
|
export type CanisterStatusType =
|
|
24
23
|
| { stopped: null }
|
|
25
24
|
| { stopping: null }
|
|
26
25
|
| { running: null };
|
|
26
|
+
export interface CfInvestment {
|
|
27
|
+
hotkey_principal: string;
|
|
28
|
+
nns_neuron_id: bigint;
|
|
29
|
+
}
|
|
30
|
+
export interface CfNeuron {
|
|
31
|
+
nns_neuron_id: bigint;
|
|
32
|
+
amount_icp_e8s: bigint;
|
|
33
|
+
}
|
|
34
|
+
export interface CfParticipant {
|
|
35
|
+
hotkey_principal: string;
|
|
36
|
+
cf_neurons: Array<CfNeuron>;
|
|
37
|
+
}
|
|
27
38
|
export interface DefiniteCanisterSettingsArgs {
|
|
28
39
|
controller: Principal;
|
|
29
40
|
freezing_threshold: bigint;
|
|
@@ -35,6 +46,9 @@ export interface DerivedState {
|
|
|
35
46
|
sns_tokens_per_icp: number;
|
|
36
47
|
buyer_total_icp_e8s: bigint;
|
|
37
48
|
}
|
|
49
|
+
export interface DirectInvestment {
|
|
50
|
+
buyer_principal: string;
|
|
51
|
+
}
|
|
38
52
|
export interface ErrorRefundIcpRequest {
|
|
39
53
|
icp_e8s: bigint;
|
|
40
54
|
fee_override_e8s: bigint;
|
|
@@ -44,6 +58,9 @@ export interface FailedUpdate {
|
|
|
44
58
|
dapp_canister_id: [] | [Principal];
|
|
45
59
|
}
|
|
46
60
|
export interface FinalizeSwapResponse {
|
|
61
|
+
settle_community_fund_participation_result:
|
|
62
|
+
| []
|
|
63
|
+
| [SettleCommunityFundParticipationResult];
|
|
47
64
|
set_dapp_controllers_result: [] | [SetDappControllersCallResult];
|
|
48
65
|
sns_governance_normal_mode_enabled: [] | [SetModeCallResult];
|
|
49
66
|
sweep_icp: [] | [SweepResult];
|
|
@@ -63,67 +80,95 @@ export interface GetStateResponse {
|
|
|
63
80
|
swap: [] | [Swap];
|
|
64
81
|
derived: [] | [DerivedState];
|
|
65
82
|
}
|
|
83
|
+
export interface GovernanceError {
|
|
84
|
+
error_message: string;
|
|
85
|
+
error_type: number;
|
|
86
|
+
}
|
|
66
87
|
export interface Init {
|
|
67
88
|
sns_root_canister_id: string;
|
|
68
|
-
min_participant_icp_e8s: bigint;
|
|
69
89
|
fallback_controller_principal_ids: Array<string>;
|
|
70
|
-
max_icp_e8s: bigint;
|
|
71
|
-
min_participants: number;
|
|
72
90
|
nns_governance_canister_id: string;
|
|
73
91
|
icp_ledger_canister_id: string;
|
|
74
92
|
sns_ledger_canister_id: string;
|
|
75
|
-
max_participant_icp_e8s: bigint;
|
|
76
93
|
sns_governance_canister_id: string;
|
|
94
|
+
}
|
|
95
|
+
export type Investor =
|
|
96
|
+
| { CommunityFund: CfInvestment }
|
|
97
|
+
| { Direct: DirectInvestment };
|
|
98
|
+
export interface OpenRequest {
|
|
99
|
+
cf_participants: Array<CfParticipant>;
|
|
100
|
+
params: [] | [Params];
|
|
101
|
+
open_sns_token_swap_proposal_id: [] | [bigint];
|
|
102
|
+
}
|
|
103
|
+
export interface Params {
|
|
104
|
+
min_participant_icp_e8s: bigint;
|
|
105
|
+
max_icp_e8s: bigint;
|
|
106
|
+
swap_due_timestamp_seconds: bigint;
|
|
107
|
+
min_participants: number;
|
|
108
|
+
sns_token_e8s: bigint;
|
|
109
|
+
max_participant_icp_e8s: bigint;
|
|
77
110
|
min_icp_e8s: bigint;
|
|
78
111
|
}
|
|
79
|
-
export type Possibility =
|
|
112
|
+
export type Possibility = { Ok: Response } | { Err: CanisterCallError };
|
|
113
|
+
export type Possibility_1 =
|
|
80
114
|
| { Ok: SetDappControllersResponse }
|
|
81
115
|
| { Err: CanisterCallError };
|
|
82
|
-
export type
|
|
116
|
+
export type Possibility_2 = { Err: CanisterCallError };
|
|
83
117
|
export interface RefreshBuyerTokensRequest {
|
|
84
118
|
buyer: string;
|
|
85
119
|
}
|
|
120
|
+
export interface RefreshBuyerTokensResponse {
|
|
121
|
+
icp_accepted_participation_e8s: bigint;
|
|
122
|
+
icp_ledger_account_balance_e8s: bigint;
|
|
123
|
+
}
|
|
124
|
+
export interface Response {
|
|
125
|
+
governance_error: [] | [GovernanceError];
|
|
126
|
+
}
|
|
86
127
|
export interface SetDappControllersCallResult {
|
|
87
|
-
possibility: [] | [
|
|
128
|
+
possibility: [] | [Possibility_1];
|
|
88
129
|
}
|
|
89
130
|
export interface SetDappControllersResponse {
|
|
90
131
|
failed_updates: Array<FailedUpdate>;
|
|
91
132
|
}
|
|
92
133
|
export interface SetModeCallResult {
|
|
93
|
-
possibility: [] | [
|
|
134
|
+
possibility: [] | [Possibility_2];
|
|
94
135
|
}
|
|
95
|
-
export interface
|
|
96
|
-
|
|
136
|
+
export interface SettleCommunityFundParticipationResult {
|
|
137
|
+
possibility: [] | [Possibility];
|
|
97
138
|
}
|
|
98
|
-
export interface
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
lifecycle: number;
|
|
102
|
-
buyers: Array<[string, BuyerState]>;
|
|
139
|
+
export interface SnsNeuronRecipe {
|
|
140
|
+
sns: [] | [TransferableAmount];
|
|
141
|
+
investor: [] | [Investor];
|
|
103
142
|
}
|
|
104
143
|
export interface Swap {
|
|
144
|
+
neuron_recipes: Array<SnsNeuronRecipe>;
|
|
145
|
+
cf_participants: Array<CfParticipant>;
|
|
105
146
|
init: [] | [Init];
|
|
106
|
-
|
|
147
|
+
lifecycle: number;
|
|
148
|
+
buyers: Array<[string, BuyerState]>;
|
|
149
|
+
params: [] | [Params];
|
|
150
|
+
open_sns_token_swap_proposal_id: [] | [bigint];
|
|
107
151
|
}
|
|
108
152
|
export interface SweepResult {
|
|
109
153
|
failure: number;
|
|
110
154
|
skipped: number;
|
|
111
155
|
success: number;
|
|
112
156
|
}
|
|
113
|
-
export interface
|
|
114
|
-
|
|
115
|
-
|
|
157
|
+
export interface TransferableAmount {
|
|
158
|
+
transfer_start_timestamp_seconds: bigint;
|
|
159
|
+
amount_e8s: bigint;
|
|
160
|
+
transfer_success_timestamp_seconds: bigint;
|
|
116
161
|
}
|
|
117
162
|
export interface _SERVICE {
|
|
118
|
-
error_refund_icp:
|
|
119
|
-
finalize_swap:
|
|
120
|
-
get_buyer_state:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
163
|
+
error_refund_icp: ActorMethod<[ErrorRefundIcpRequest], {}>;
|
|
164
|
+
finalize_swap: ActorMethod<[{}], FinalizeSwapResponse>;
|
|
165
|
+
get_buyer_state: ActorMethod<[GetBuyerStateRequest], GetBuyerStateResponse>;
|
|
166
|
+
get_buyers_total: ActorMethod<[{}], GetBuyersTotalResponse>;
|
|
167
|
+
get_canister_status: ActorMethod<[{}], CanisterStatusResultV2>;
|
|
168
|
+
get_state: ActorMethod<[{}], GetStateResponse>;
|
|
169
|
+
open: ActorMethod<[OpenRequest], {}>;
|
|
170
|
+
refresh_buyer_tokens: ActorMethod<
|
|
171
|
+
[RefreshBuyerTokensRequest],
|
|
172
|
+
RefreshBuyerTokensResponse
|
|
173
|
+
>;
|
|
129
174
|
}
|
package/dist/candid/sns_swap.did
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
2
|
-
type BuyerState = record {
|
|
3
|
-
icp_disbursing : bool;
|
|
4
|
-
amount_sns_e8s : nat64;
|
|
5
|
-
amount_icp_e8s : nat64;
|
|
6
|
-
sns_disbursing : bool;
|
|
7
|
-
};
|
|
1
|
+
// Generated from IC repo commit fb28a950f1799dec4a67cc21abd3888686ab50d9 'rs/sns/swap/canister/swap.did' by import-candid
|
|
2
|
+
type BuyerState = record { icp : opt TransferableAmount };
|
|
8
3
|
type CanisterCallError = record { code : opt int32; description : text };
|
|
9
4
|
type CanisterStatusResultV2 = record {
|
|
10
5
|
controller : principal;
|
|
@@ -18,6 +13,12 @@ type CanisterStatusResultV2 = record {
|
|
|
18
13
|
module_hash : opt vec nat8;
|
|
19
14
|
};
|
|
20
15
|
type CanisterStatusType = variant { stopped; stopping; running };
|
|
16
|
+
type CfInvestment = record { hotkey_principal : text; nns_neuron_id : nat64 };
|
|
17
|
+
type CfNeuron = record { nns_neuron_id : nat64; amount_icp_e8s : nat64 };
|
|
18
|
+
type CfParticipant = record {
|
|
19
|
+
hotkey_principal : text;
|
|
20
|
+
cf_neurons : vec CfNeuron;
|
|
21
|
+
};
|
|
21
22
|
type DefiniteCanisterSettingsArgs = record {
|
|
22
23
|
controller : principal;
|
|
23
24
|
freezing_threshold : nat;
|
|
@@ -29,6 +30,7 @@ type DerivedState = record {
|
|
|
29
30
|
sns_tokens_per_icp : float32;
|
|
30
31
|
buyer_total_icp_e8s : nat64;
|
|
31
32
|
};
|
|
33
|
+
type DirectInvestment = record { buyer_principal : text };
|
|
32
34
|
type ErrorRefundIcpRequest = record {
|
|
33
35
|
icp_e8s : nat64;
|
|
34
36
|
fee_override_e8s : nat64;
|
|
@@ -38,6 +40,7 @@ type FailedUpdate = record {
|
|
|
38
40
|
dapp_canister_id : opt principal;
|
|
39
41
|
};
|
|
40
42
|
type FinalizeSwapResponse = record {
|
|
43
|
+
settle_community_fund_participation_result : opt SettleCommunityFundParticipationResult;
|
|
41
44
|
set_dapp_controllers_result : opt SetDappControllersCallResult;
|
|
42
45
|
sns_governance_normal_mode_enabled : opt SetModeCallResult;
|
|
43
46
|
sweep_icp : opt SweepResult;
|
|
@@ -48,40 +51,69 @@ type GetBuyerStateRequest = record { principal_id : opt principal };
|
|
|
48
51
|
type GetBuyerStateResponse = record { buyer_state : opt BuyerState };
|
|
49
52
|
type GetBuyersTotalResponse = record { buyers_total : nat64 };
|
|
50
53
|
type GetStateResponse = record { swap : opt Swap; derived : opt DerivedState };
|
|
54
|
+
type GovernanceError = record { error_message : text; error_type : int32 };
|
|
51
55
|
type Init = record {
|
|
52
56
|
sns_root_canister_id : text;
|
|
53
|
-
min_participant_icp_e8s : nat64;
|
|
54
57
|
fallback_controller_principal_ids : vec text;
|
|
55
|
-
max_icp_e8s : nat64;
|
|
56
|
-
min_participants : nat32;
|
|
57
58
|
nns_governance_canister_id : text;
|
|
58
59
|
icp_ledger_canister_id : text;
|
|
59
60
|
sns_ledger_canister_id : text;
|
|
60
|
-
max_participant_icp_e8s : nat64;
|
|
61
61
|
sns_governance_canister_id : text;
|
|
62
|
+
};
|
|
63
|
+
type Investor = variant {
|
|
64
|
+
CommunityFund : CfInvestment;
|
|
65
|
+
Direct : DirectInvestment;
|
|
66
|
+
};
|
|
67
|
+
type OpenRequest = record {
|
|
68
|
+
cf_participants : vec CfParticipant;
|
|
69
|
+
params : opt Params;
|
|
70
|
+
open_sns_token_swap_proposal_id : opt nat64;
|
|
71
|
+
};
|
|
72
|
+
type Params = record {
|
|
73
|
+
min_participant_icp_e8s : nat64;
|
|
74
|
+
max_icp_e8s : nat64;
|
|
75
|
+
swap_due_timestamp_seconds : nat64;
|
|
76
|
+
min_participants : nat32;
|
|
77
|
+
sns_token_e8s : nat64;
|
|
78
|
+
max_participant_icp_e8s : nat64;
|
|
62
79
|
min_icp_e8s : nat64;
|
|
63
80
|
};
|
|
64
|
-
type Possibility = variant {
|
|
81
|
+
type Possibility = variant { Ok : Response; Err : CanisterCallError };
|
|
82
|
+
type Possibility_1 = variant {
|
|
65
83
|
Ok : SetDappControllersResponse;
|
|
66
84
|
Err : CanisterCallError;
|
|
67
85
|
};
|
|
68
|
-
type
|
|
86
|
+
type Possibility_2 = variant { Err : CanisterCallError };
|
|
69
87
|
type RefreshBuyerTokensRequest = record { buyer : text };
|
|
70
|
-
type
|
|
88
|
+
type RefreshBuyerTokensResponse = record {
|
|
89
|
+
icp_accepted_participation_e8s : nat64;
|
|
90
|
+
icp_ledger_account_balance_e8s : nat64;
|
|
91
|
+
};
|
|
92
|
+
type Response = record { governance_error : opt GovernanceError };
|
|
93
|
+
type SetDappControllersCallResult = record { possibility : opt Possibility_1 };
|
|
71
94
|
type SetDappControllersResponse = record { failed_updates : vec FailedUpdate };
|
|
72
|
-
type SetModeCallResult = record { possibility : opt
|
|
73
|
-
type
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
95
|
+
type SetModeCallResult = record { possibility : opt Possibility_2 };
|
|
96
|
+
type SettleCommunityFundParticipationResult = record {
|
|
97
|
+
possibility : opt Possibility;
|
|
98
|
+
};
|
|
99
|
+
type SnsNeuronRecipe = record {
|
|
100
|
+
sns : opt TransferableAmount;
|
|
101
|
+
investor : opt Investor;
|
|
102
|
+
};
|
|
103
|
+
type Swap = record {
|
|
104
|
+
neuron_recipes : vec SnsNeuronRecipe;
|
|
105
|
+
cf_participants : vec CfParticipant;
|
|
106
|
+
init : opt Init;
|
|
77
107
|
lifecycle : int32;
|
|
78
108
|
buyers : vec record { text; BuyerState };
|
|
109
|
+
params : opt Params;
|
|
110
|
+
open_sns_token_swap_proposal_id : opt nat64;
|
|
79
111
|
};
|
|
80
|
-
type Swap = record { init : opt Init; state : opt State };
|
|
81
112
|
type SweepResult = record { failure : nat32; skipped : nat32; success : nat32 };
|
|
82
|
-
type
|
|
83
|
-
|
|
84
|
-
|
|
113
|
+
type TransferableAmount = record {
|
|
114
|
+
transfer_start_timestamp_seconds : nat64;
|
|
115
|
+
amount_e8s : nat64;
|
|
116
|
+
transfer_success_timestamp_seconds : nat64;
|
|
85
117
|
};
|
|
86
118
|
service : (Init) -> {
|
|
87
119
|
error_refund_icp : (ErrorRefundIcpRequest) -> (record {});
|
|
@@ -90,7 +122,8 @@ service : (Init) -> {
|
|
|
90
122
|
get_buyers_total : (record {}) -> (GetBuyersTotalResponse);
|
|
91
123
|
get_canister_status : (record {}) -> (CanisterStatusResultV2);
|
|
92
124
|
get_state : (record {}) -> (GetStateResponse) query;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
125
|
+
open : (OpenRequest) -> (record {});
|
|
126
|
+
refresh_buyer_tokens : (RefreshBuyerTokensRequest) -> (
|
|
127
|
+
RefreshBuyerTokensResponse,
|
|
128
|
+
);
|
|
96
129
|
}
|