@dfinity/sns 0.0.1 → 0.0.2
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/sns_governance.certified.idl.js +14 -6
- package/dist/candid/sns_governance.d.ts +8 -4
- package/dist/candid/sns_governance.did +5 -7
- package/dist/candid/sns_governance.idl.js +14 -6
- package/dist/candid/sns_root.certified.idl.js +85 -3
- package/dist/candid/sns_root.d.ts +62 -3
- package/dist/candid/sns_root.did +52 -6
- package/dist/candid/sns_root.idl.js +85 -3
- package/dist/candid/sns_swap.certified.idl.js +24 -1
- package/dist/candid/sns_swap.d.ts +24 -1
- package/dist/candid/sns_swap.did +21 -2
- package/dist/candid/sns_swap.idl.js +24 -1
- package/dist/cjs/index.cjs.js +31 -31
- package/dist/cjs/index.cjs.js.map +3 -3
- package/dist/esm/chunk-5EFW5NLJ.js +2 -0
- package/dist/esm/chunk-5EFW5NLJ.js.map +7 -0
- package/dist/esm/chunk-NJ4DNYU7.js +2 -0
- package/dist/esm/chunk-NJ4DNYU7.js.map +7 -0
- package/dist/esm/chunk-QOHSQFP6.js +2 -0
- package/dist/esm/chunk-QOHSQFP6.js.map +7 -0
- package/dist/esm/chunk-S7OOQWQZ.js +2 -0
- package/dist/esm/chunk-S7OOQWQZ.js.map +7 -0
- package/dist/esm/chunk-TGR2FDNH.js +2 -0
- package/dist/esm/chunk-TGR2FDNH.js.map +7 -0
- package/dist/esm/chunk-Y5V5O772.js +2 -0
- package/dist/esm/chunk-Y5V5O772.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 +2 -0
- package/dist/esm/swap.canister.js.map +7 -0
- package/dist/types/enums/swap.enums.d.ts +7 -0
- package/dist/types/index.d.ts +5 -2
- package/dist/types/root.canister.d.ts +5 -8
- package/dist/types/sns.d.ts +2 -2
- package/dist/types/sns.wrapper.d.ts +8 -1
- package/dist/types/swap.canister.d.ts +11 -0
- package/dist/types/utils/did.utils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/esm/chunk-7F6PCBCJ.js +0 -2
- package/dist/esm/chunk-7F6PCBCJ.js.map +0 -7
- package/dist/esm/chunk-LXL5LYD3.js +0 -2
- package/dist/esm/chunk-LXL5LYD3.js.map +0 -7
- package/dist/esm/chunk-RB6XGLR7.js +0 -2
- package/dist/esm/chunk-RB6XGLR7.js.map +0 -7
- package/dist/esm/chunk-WPRZTZWQ.js +0 -2
- package/dist/esm/chunk-WPRZTZWQ.js.map +0 -7
- package/dist/esm/chunk-YKP66JDM.js +0 -2
- package/dist/esm/chunk-YKP66JDM.js.map +0 -7
- package/dist/esm/chunk-YL4WAPXH.js +0 -2
- package/dist/esm/chunk-YL4WAPXH.js.map +0 -7
|
@@ -138,9 +138,13 @@ export const idlFactory = ({ IDL }) => {
|
|
|
138
138
|
'function_id' : IDL.Nat64,
|
|
139
139
|
'followees' : IDL.Vec(NeuronId),
|
|
140
140
|
});
|
|
141
|
-
const
|
|
141
|
+
const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
|
|
142
|
+
const Account = IDL.Record({
|
|
143
|
+
'of' : IDL.Opt(IDL.Principal),
|
|
144
|
+
'subaccount' : IDL.Opt(Subaccount),
|
|
145
|
+
});
|
|
142
146
|
const DisburseMaturity = IDL.Record({
|
|
143
|
-
'to_account' : IDL.Opt(
|
|
147
|
+
'to_account' : IDL.Opt(Account),
|
|
144
148
|
'percentage_to_disburse' : IDL.Nat32,
|
|
145
149
|
});
|
|
146
150
|
const IncreaseDissolveDelay = IDL.Record({
|
|
@@ -180,7 +184,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
180
184
|
const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });
|
|
181
185
|
const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });
|
|
182
186
|
const Disburse = IDL.Record({
|
|
183
|
-
'to_account' : IDL.Opt(
|
|
187
|
+
'to_account' : IDL.Opt(Account),
|
|
184
188
|
'amount' : IDL.Opt(Amount),
|
|
185
189
|
});
|
|
186
190
|
const Command_2 = IDL.Variant({
|
|
@@ -496,9 +500,13 @@ export const init = ({ IDL }) => {
|
|
|
496
500
|
'function_id' : IDL.Nat64,
|
|
497
501
|
'followees' : IDL.Vec(NeuronId),
|
|
498
502
|
});
|
|
499
|
-
const
|
|
503
|
+
const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
|
|
504
|
+
const Account = IDL.Record({
|
|
505
|
+
'of' : IDL.Opt(IDL.Principal),
|
|
506
|
+
'subaccount' : IDL.Opt(Subaccount),
|
|
507
|
+
});
|
|
500
508
|
const DisburseMaturity = IDL.Record({
|
|
501
|
-
'to_account' : IDL.Opt(
|
|
509
|
+
'to_account' : IDL.Opt(Account),
|
|
502
510
|
'percentage_to_disburse' : IDL.Nat32,
|
|
503
511
|
});
|
|
504
512
|
const IncreaseDissolveDelay = IDL.Record({
|
|
@@ -538,7 +546,7 @@ export const init = ({ IDL }) => {
|
|
|
538
546
|
const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });
|
|
539
547
|
const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });
|
|
540
548
|
const Disburse = IDL.Record({
|
|
541
|
-
'to_account' : IDL.Opt(
|
|
549
|
+
'to_account' : IDL.Opt(Account),
|
|
542
550
|
'amount' : IDL.Opt(Amount),
|
|
543
551
|
});
|
|
544
552
|
const Command_2 = IDL.Variant({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Principal } from "@dfinity/principal";
|
|
2
|
-
export interface
|
|
3
|
-
|
|
2
|
+
export interface Account {
|
|
3
|
+
of: [] | [Principal];
|
|
4
|
+
subaccount: [] | [Subaccount];
|
|
4
5
|
}
|
|
5
6
|
export type Action =
|
|
6
7
|
| {
|
|
@@ -99,11 +100,11 @@ export interface DefiniteCanisterSettingsArgs {
|
|
|
99
100
|
compute_allocation: bigint;
|
|
100
101
|
}
|
|
101
102
|
export interface Disburse {
|
|
102
|
-
to_account: [] | [
|
|
103
|
+
to_account: [] | [Account];
|
|
103
104
|
amount: [] | [Amount];
|
|
104
105
|
}
|
|
105
106
|
export interface DisburseMaturity {
|
|
106
|
-
to_account: [] | [
|
|
107
|
+
to_account: [] | [Account];
|
|
107
108
|
percentage_to_disburse: number;
|
|
108
109
|
}
|
|
109
110
|
export interface DisburseMaturityResponse {
|
|
@@ -337,6 +338,9 @@ export interface Split {
|
|
|
337
338
|
export interface SplitResponse {
|
|
338
339
|
created_neuron_id: [] | [NeuronId];
|
|
339
340
|
}
|
|
341
|
+
export interface Subaccount {
|
|
342
|
+
subaccount: Array<number>;
|
|
343
|
+
}
|
|
340
344
|
export interface Tally {
|
|
341
345
|
no: bigint;
|
|
342
346
|
yes: bigint;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
2
|
-
type
|
|
1
|
+
// Generated from IC repo commit 12bd50418009ea8d6aabf4f5ac1182aceaf56689 'rs/sns/governance/canister/governance.did' by import-candid
|
|
2
|
+
type Account = record { of : opt principal; subaccount : opt Subaccount };
|
|
3
3
|
type Action = variant {
|
|
4
4
|
ManageNervousSystemParameters : NervousSystemParameters;
|
|
5
5
|
AddGenericNervousSystemFunction : NervousSystemFunction;
|
|
@@ -86,12 +86,9 @@ type DefiniteCanisterSettingsArgs = record {
|
|
|
86
86
|
memory_allocation : nat;
|
|
87
87
|
compute_allocation : nat;
|
|
88
88
|
};
|
|
89
|
-
type Disburse = record {
|
|
90
|
-
to_account : opt AccountIdentifier;
|
|
91
|
-
amount : opt Amount;
|
|
92
|
-
};
|
|
89
|
+
type Disburse = record { to_account : opt Account; amount : opt Amount };
|
|
93
90
|
type DisburseMaturity = record {
|
|
94
|
-
to_account : opt
|
|
91
|
+
to_account : opt Account;
|
|
95
92
|
percentage_to_disburse : nat32;
|
|
96
93
|
};
|
|
97
94
|
type DisburseMaturityResponse = record {
|
|
@@ -276,6 +273,7 @@ type SetDissolveTimestamp = record { dissolve_timestamp_seconds : nat64 };
|
|
|
276
273
|
type SetMode = record { mode : int32 };
|
|
277
274
|
type Split = record { memo : nat64; amount_e8s : nat64 };
|
|
278
275
|
type SplitResponse = record { created_neuron_id : opt NeuronId };
|
|
276
|
+
type Subaccount = record { subaccount : vec nat8 };
|
|
279
277
|
type Tally = record {
|
|
280
278
|
no : nat64;
|
|
281
279
|
yes : nat64;
|
|
@@ -138,9 +138,13 @@ export const idlFactory = ({ IDL }) => {
|
|
|
138
138
|
'function_id' : IDL.Nat64,
|
|
139
139
|
'followees' : IDL.Vec(NeuronId),
|
|
140
140
|
});
|
|
141
|
-
const
|
|
141
|
+
const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
|
|
142
|
+
const Account = IDL.Record({
|
|
143
|
+
'of' : IDL.Opt(IDL.Principal),
|
|
144
|
+
'subaccount' : IDL.Opt(Subaccount),
|
|
145
|
+
});
|
|
142
146
|
const DisburseMaturity = IDL.Record({
|
|
143
|
-
'to_account' : IDL.Opt(
|
|
147
|
+
'to_account' : IDL.Opt(Account),
|
|
144
148
|
'percentage_to_disburse' : IDL.Nat32,
|
|
145
149
|
});
|
|
146
150
|
const IncreaseDissolveDelay = IDL.Record({
|
|
@@ -180,7 +184,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
180
184
|
const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });
|
|
181
185
|
const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });
|
|
182
186
|
const Disburse = IDL.Record({
|
|
183
|
-
'to_account' : IDL.Opt(
|
|
187
|
+
'to_account' : IDL.Opt(Account),
|
|
184
188
|
'amount' : IDL.Opt(Amount),
|
|
185
189
|
});
|
|
186
190
|
const Command_2 = IDL.Variant({
|
|
@@ -500,9 +504,13 @@ export const init = ({ IDL }) => {
|
|
|
500
504
|
'function_id' : IDL.Nat64,
|
|
501
505
|
'followees' : IDL.Vec(NeuronId),
|
|
502
506
|
});
|
|
503
|
-
const
|
|
507
|
+
const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
|
|
508
|
+
const Account = IDL.Record({
|
|
509
|
+
'of' : IDL.Opt(IDL.Principal),
|
|
510
|
+
'subaccount' : IDL.Opt(Subaccount),
|
|
511
|
+
});
|
|
504
512
|
const DisburseMaturity = IDL.Record({
|
|
505
|
-
'to_account' : IDL.Opt(
|
|
513
|
+
'to_account' : IDL.Opt(Account),
|
|
506
514
|
'percentage_to_disburse' : IDL.Nat32,
|
|
507
515
|
});
|
|
508
516
|
const IncreaseDissolveDelay = IDL.Record({
|
|
@@ -542,7 +550,7 @@ export const init = ({ IDL }) => {
|
|
|
542
550
|
const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });
|
|
543
551
|
const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });
|
|
544
552
|
const Disburse = IDL.Record({
|
|
545
|
-
'to_account' : IDL.Opt(
|
|
553
|
+
'to_account' : IDL.Opt(Account),
|
|
546
554
|
'amount' : IDL.Opt(Amount),
|
|
547
555
|
});
|
|
548
556
|
const Command_2 = IDL.Variant({
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_root.did */
|
|
2
2
|
export const idlFactory = ({ IDL }) => {
|
|
3
|
+
const SnsRootCanister = IDL.Record({
|
|
4
|
+
'dapp_canister_ids' : IDL.Vec(IDL.Principal),
|
|
5
|
+
'governance_canister_id' : IDL.Opt(IDL.Principal),
|
|
6
|
+
'swap_canister_id' : IDL.Opt(IDL.Principal),
|
|
7
|
+
'ledger_canister_id' : IDL.Opt(IDL.Principal),
|
|
8
|
+
});
|
|
9
|
+
const CanisterIdRecord = IDL.Record({ 'canister_id' : IDL.Principal });
|
|
10
|
+
const CanisterStatusType = IDL.Variant({
|
|
11
|
+
'stopped' : IDL.Null,
|
|
12
|
+
'stopping' : IDL.Null,
|
|
13
|
+
'running' : IDL.Null,
|
|
14
|
+
});
|
|
15
|
+
const CanisterStatusResult = IDL.Record({
|
|
16
|
+
'controller' : IDL.Principal,
|
|
17
|
+
'status' : CanisterStatusType,
|
|
18
|
+
'memory_size' : IDL.Nat,
|
|
19
|
+
'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
20
|
+
});
|
|
3
21
|
const CanisterStatusType_1 = IDL.Variant({
|
|
4
22
|
'stopped' : IDL.Null,
|
|
5
23
|
'stopping' : IDL.Null,
|
|
@@ -23,12 +41,76 @@ export const idlFactory = ({ IDL }) => {
|
|
|
23
41
|
'idle_cycles_burned_per_day' : IDL.Nat,
|
|
24
42
|
'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
25
43
|
});
|
|
44
|
+
const CanisterSummary = IDL.Record({
|
|
45
|
+
'status' : IDL.Opt(CanisterStatusResultV2),
|
|
46
|
+
'canister_id' : IDL.Opt(IDL.Principal),
|
|
47
|
+
});
|
|
48
|
+
const GetSnsCanistersSummaryResponse = IDL.Record({
|
|
49
|
+
'ledger_canister_summary' : IDL.Opt(CanisterSummary),
|
|
50
|
+
'governance_canister_summary' : IDL.Opt(CanisterSummary),
|
|
51
|
+
'root_canister_summary' : IDL.Opt(CanisterSummary),
|
|
52
|
+
'dapp_canister_summaries' : IDL.Vec(CanisterSummary),
|
|
53
|
+
});
|
|
54
|
+
const ListSnsCanistersResponse = IDL.Record({
|
|
55
|
+
'root' : IDL.Opt(IDL.Principal),
|
|
56
|
+
'swap' : IDL.Opt(IDL.Principal),
|
|
57
|
+
'ledger' : IDL.Opt(IDL.Principal),
|
|
58
|
+
'governance' : IDL.Opt(IDL.Principal),
|
|
59
|
+
'dapps' : IDL.Vec(IDL.Principal),
|
|
60
|
+
'archives' : IDL.Vec(IDL.Principal),
|
|
61
|
+
});
|
|
62
|
+
const RegisterDappCanisterRequest = IDL.Record({
|
|
63
|
+
'canister_id' : IDL.Opt(IDL.Principal),
|
|
64
|
+
});
|
|
65
|
+
const SetDappControllersRequest = IDL.Record({
|
|
66
|
+
'controller_principal_ids' : IDL.Vec(IDL.Principal),
|
|
67
|
+
});
|
|
68
|
+
const CanisterCallError = IDL.Record({
|
|
69
|
+
'code' : IDL.Opt(IDL.Int32),
|
|
70
|
+
'description' : IDL.Text,
|
|
71
|
+
});
|
|
72
|
+
const FailedUpdate = IDL.Record({
|
|
73
|
+
'err' : IDL.Opt(CanisterCallError),
|
|
74
|
+
'dapp_canister_id' : IDL.Opt(IDL.Principal),
|
|
75
|
+
});
|
|
76
|
+
const SetDappControllersResponse = IDL.Record({
|
|
77
|
+
'failed_updates' : IDL.Vec(FailedUpdate),
|
|
78
|
+
});
|
|
26
79
|
return IDL.Service({
|
|
80
|
+
'canister_status' : IDL.Func(
|
|
81
|
+
[CanisterIdRecord],
|
|
82
|
+
[CanisterStatusResult],
|
|
83
|
+
[],
|
|
84
|
+
),
|
|
85
|
+
'get_build_metadata' : IDL.Func([], [IDL.Text], []),
|
|
27
86
|
'get_sns_canisters_summary' : IDL.Func(
|
|
28
|
-
[IDL.
|
|
29
|
-
[
|
|
87
|
+
[IDL.Record({})],
|
|
88
|
+
[GetSnsCanistersSummaryResponse],
|
|
89
|
+
[],
|
|
90
|
+
),
|
|
91
|
+
'list_sns_canisters' : IDL.Func(
|
|
92
|
+
[IDL.Record({})],
|
|
93
|
+
[ListSnsCanistersResponse],
|
|
30
94
|
[],
|
|
31
95
|
),
|
|
96
|
+
'register_dapp_canister' : IDL.Func(
|
|
97
|
+
[RegisterDappCanisterRequest],
|
|
98
|
+
[IDL.Record({})],
|
|
99
|
+
[],
|
|
100
|
+
),
|
|
101
|
+
'set_dapp_controllers' : IDL.Func(
|
|
102
|
+
[SetDappControllersRequest],
|
|
103
|
+
[SetDappControllersResponse],
|
|
104
|
+
[],
|
|
105
|
+
),
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
export const init = ({ IDL }) => {
|
|
109
|
+
const SnsRootCanister = IDL.Record({
|
|
110
|
+
'dapp_canister_ids' : IDL.Vec(IDL.Principal),
|
|
111
|
+
'governance_canister_id' : IDL.Opt(IDL.Principal),
|
|
112
|
+
'swap_canister_id' : IDL.Opt(IDL.Principal),
|
|
113
|
+
'ledger_canister_id' : IDL.Opt(IDL.Principal),
|
|
32
114
|
});
|
|
115
|
+
return [SnsRootCanister];
|
|
33
116
|
};
|
|
34
|
-
export const init = ({ IDL }) => { return []; };
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import type { Principal } from "@dfinity/principal";
|
|
2
|
+
export interface CanisterCallError {
|
|
3
|
+
code: [] | [number];
|
|
4
|
+
description: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CanisterIdRecord {
|
|
7
|
+
canister_id: Principal;
|
|
8
|
+
}
|
|
9
|
+
export interface CanisterStatusResult {
|
|
10
|
+
controller: Principal;
|
|
11
|
+
status: CanisterStatusType;
|
|
12
|
+
memory_size: bigint;
|
|
13
|
+
module_hash: [] | [Array<number>];
|
|
14
|
+
}
|
|
2
15
|
export interface CanisterStatusResultV2 {
|
|
3
16
|
controller: Principal;
|
|
4
17
|
status: CanisterStatusType_1;
|
|
@@ -10,10 +23,18 @@ export interface CanisterStatusResultV2 {
|
|
|
10
23
|
idle_cycles_burned_per_day: bigint;
|
|
11
24
|
module_hash: [] | [Array<number>];
|
|
12
25
|
}
|
|
26
|
+
export type CanisterStatusType =
|
|
27
|
+
| { stopped: null }
|
|
28
|
+
| { stopping: null }
|
|
29
|
+
| { running: null };
|
|
13
30
|
export type CanisterStatusType_1 =
|
|
14
31
|
| { stopped: null }
|
|
15
32
|
| { stopping: null }
|
|
16
33
|
| { running: null };
|
|
34
|
+
export interface CanisterSummary {
|
|
35
|
+
status: [] | [CanisterStatusResultV2];
|
|
36
|
+
canister_id: [] | [Principal];
|
|
37
|
+
}
|
|
17
38
|
export interface DefiniteCanisterSettingsArgs {
|
|
18
39
|
controller: Principal;
|
|
19
40
|
freezing_threshold: bigint;
|
|
@@ -21,8 +42,46 @@ export interface DefiniteCanisterSettingsArgs {
|
|
|
21
42
|
memory_allocation: bigint;
|
|
22
43
|
compute_allocation: bigint;
|
|
23
44
|
}
|
|
45
|
+
export interface FailedUpdate {
|
|
46
|
+
err: [] | [CanisterCallError];
|
|
47
|
+
dapp_canister_id: [] | [Principal];
|
|
48
|
+
}
|
|
49
|
+
export interface GetSnsCanistersSummaryResponse {
|
|
50
|
+
ledger_canister_summary: [] | [CanisterSummary];
|
|
51
|
+
governance_canister_summary: [] | [CanisterSummary];
|
|
52
|
+
root_canister_summary: [] | [CanisterSummary];
|
|
53
|
+
dapp_canister_summaries: Array<CanisterSummary>;
|
|
54
|
+
}
|
|
55
|
+
export interface ListSnsCanistersResponse {
|
|
56
|
+
root: [] | [Principal];
|
|
57
|
+
swap: [] | [Principal];
|
|
58
|
+
ledger: [] | [Principal];
|
|
59
|
+
governance: [] | [Principal];
|
|
60
|
+
dapps: Array<Principal>;
|
|
61
|
+
archives: Array<Principal>;
|
|
62
|
+
}
|
|
63
|
+
export interface RegisterDappCanisterRequest {
|
|
64
|
+
canister_id: [] | [Principal];
|
|
65
|
+
}
|
|
66
|
+
export interface SetDappControllersRequest {
|
|
67
|
+
controller_principal_ids: Array<Principal>;
|
|
68
|
+
}
|
|
69
|
+
export interface SetDappControllersResponse {
|
|
70
|
+
failed_updates: Array<FailedUpdate>;
|
|
71
|
+
}
|
|
72
|
+
export interface SnsRootCanister {
|
|
73
|
+
dapp_canister_ids: Array<Principal>;
|
|
74
|
+
governance_canister_id: [] | [Principal];
|
|
75
|
+
swap_canister_id: [] | [Principal];
|
|
76
|
+
ledger_canister_id: [] | [Principal];
|
|
77
|
+
}
|
|
24
78
|
export interface _SERVICE {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
) => Promise<
|
|
79
|
+
canister_status: (arg_0: CanisterIdRecord) => Promise<CanisterStatusResult>;
|
|
80
|
+
get_build_metadata: () => Promise<string>;
|
|
81
|
+
get_sns_canisters_summary: (arg_0: {}) => Promise<GetSnsCanistersSummaryResponse>;
|
|
82
|
+
list_sns_canisters: (arg_0: {}) => Promise<ListSnsCanistersResponse>;
|
|
83
|
+
register_dapp_canister: (arg_0: RegisterDappCanisterRequest) => Promise<{}>;
|
|
84
|
+
set_dapp_controllers: (
|
|
85
|
+
arg_0: SetDappControllersRequest
|
|
86
|
+
) => Promise<SetDappControllersResponse>;
|
|
28
87
|
}
|
package/dist/candid/sns_root.did
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit 12bd50418009ea8d6aabf4f5ac1182aceaf56689 'rs/sns/root/canister/root.did' by import-candid
|
|
2
|
+
type CanisterCallError = record { code : opt int32; description : text };
|
|
3
|
+
type CanisterIdRecord = record { canister_id : principal };
|
|
4
|
+
type CanisterStatusResult = record {
|
|
5
|
+
controller : principal;
|
|
6
|
+
status : CanisterStatusType;
|
|
7
|
+
memory_size : nat;
|
|
8
|
+
module_hash : opt vec nat8;
|
|
9
|
+
};
|
|
2
10
|
type CanisterStatusResultV2 = record {
|
|
3
11
|
controller : principal;
|
|
4
12
|
status : CanisterStatusType_1;
|
|
@@ -7,10 +15,15 @@ type CanisterStatusResultV2 = record {
|
|
|
7
15
|
memory_size : nat;
|
|
8
16
|
cycles : nat;
|
|
9
17
|
settings : DefiniteCanisterSettingsArgs;
|
|
10
|
-
module_hash : opt vec nat8;
|
|
11
18
|
idle_cycles_burned_per_day : nat;
|
|
19
|
+
module_hash : opt vec nat8;
|
|
12
20
|
};
|
|
21
|
+
type CanisterStatusType = variant { stopped; stopping; running };
|
|
13
22
|
type CanisterStatusType_1 = variant { stopped; stopping; running };
|
|
23
|
+
type CanisterSummary = record {
|
|
24
|
+
status : opt CanisterStatusResultV2;
|
|
25
|
+
canister_id : opt principal;
|
|
26
|
+
};
|
|
14
27
|
type DefiniteCanisterSettingsArgs = record {
|
|
15
28
|
controller : principal;
|
|
16
29
|
freezing_threshold : nat;
|
|
@@ -18,9 +31,42 @@ type DefiniteCanisterSettingsArgs = record {
|
|
|
18
31
|
memory_allocation : nat;
|
|
19
32
|
compute_allocation : nat;
|
|
20
33
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
type FailedUpdate = record {
|
|
35
|
+
err : opt CanisterCallError;
|
|
36
|
+
dapp_canister_id : opt principal;
|
|
37
|
+
};
|
|
38
|
+
type GetSnsCanistersSummaryResponse = record {
|
|
39
|
+
ledger_canister_summary : opt CanisterSummary;
|
|
40
|
+
governance_canister_summary : opt CanisterSummary;
|
|
41
|
+
root_canister_summary : opt CanisterSummary;
|
|
42
|
+
dapp_canister_summaries : vec CanisterSummary;
|
|
43
|
+
};
|
|
44
|
+
type ListSnsCanistersResponse = record {
|
|
45
|
+
root : opt principal;
|
|
46
|
+
swap : opt principal;
|
|
47
|
+
ledger : opt principal;
|
|
48
|
+
governance : opt principal;
|
|
49
|
+
dapps : vec principal;
|
|
50
|
+
archives : vec principal;
|
|
51
|
+
};
|
|
52
|
+
type RegisterDappCanisterRequest = record { canister_id : opt principal };
|
|
53
|
+
type SetDappControllersRequest = record {
|
|
54
|
+
controller_principal_ids : vec principal;
|
|
55
|
+
};
|
|
56
|
+
type SetDappControllersResponse = record { failed_updates : vec FailedUpdate };
|
|
57
|
+
type SnsRootCanister = record {
|
|
58
|
+
dapp_canister_ids : vec principal;
|
|
59
|
+
governance_canister_id : opt principal;
|
|
60
|
+
swap_canister_id : opt principal;
|
|
61
|
+
ledger_canister_id : opt principal;
|
|
62
|
+
};
|
|
63
|
+
service : (SnsRootCanister) -> {
|
|
64
|
+
canister_status : (CanisterIdRecord) -> (CanisterStatusResult);
|
|
65
|
+
get_build_metadata : () -> (text) query;
|
|
66
|
+
get_sns_canisters_summary : (record {}) -> (GetSnsCanistersSummaryResponse);
|
|
67
|
+
list_sns_canisters : (record {}) -> (ListSnsCanistersResponse) query;
|
|
68
|
+
register_dapp_canister : (RegisterDappCanisterRequest) -> (record {});
|
|
69
|
+
set_dapp_controllers : (SetDappControllersRequest) -> (
|
|
70
|
+
SetDappControllersResponse,
|
|
25
71
|
);
|
|
26
72
|
}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_root.did */
|
|
2
2
|
export const idlFactory = ({ IDL }) => {
|
|
3
|
+
const SnsRootCanister = IDL.Record({
|
|
4
|
+
'dapp_canister_ids' : IDL.Vec(IDL.Principal),
|
|
5
|
+
'governance_canister_id' : IDL.Opt(IDL.Principal),
|
|
6
|
+
'swap_canister_id' : IDL.Opt(IDL.Principal),
|
|
7
|
+
'ledger_canister_id' : IDL.Opt(IDL.Principal),
|
|
8
|
+
});
|
|
9
|
+
const CanisterIdRecord = IDL.Record({ 'canister_id' : IDL.Principal });
|
|
10
|
+
const CanisterStatusType = IDL.Variant({
|
|
11
|
+
'stopped' : IDL.Null,
|
|
12
|
+
'stopping' : IDL.Null,
|
|
13
|
+
'running' : IDL.Null,
|
|
14
|
+
});
|
|
15
|
+
const CanisterStatusResult = IDL.Record({
|
|
16
|
+
'controller' : IDL.Principal,
|
|
17
|
+
'status' : CanisterStatusType,
|
|
18
|
+
'memory_size' : IDL.Nat,
|
|
19
|
+
'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
20
|
+
});
|
|
3
21
|
const CanisterStatusType_1 = IDL.Variant({
|
|
4
22
|
'stopped' : IDL.Null,
|
|
5
23
|
'stopping' : IDL.Null,
|
|
@@ -23,12 +41,76 @@ export const idlFactory = ({ IDL }) => {
|
|
|
23
41
|
'idle_cycles_burned_per_day' : IDL.Nat,
|
|
24
42
|
'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
25
43
|
});
|
|
44
|
+
const CanisterSummary = IDL.Record({
|
|
45
|
+
'status' : IDL.Opt(CanisterStatusResultV2),
|
|
46
|
+
'canister_id' : IDL.Opt(IDL.Principal),
|
|
47
|
+
});
|
|
48
|
+
const GetSnsCanistersSummaryResponse = IDL.Record({
|
|
49
|
+
'ledger_canister_summary' : IDL.Opt(CanisterSummary),
|
|
50
|
+
'governance_canister_summary' : IDL.Opt(CanisterSummary),
|
|
51
|
+
'root_canister_summary' : IDL.Opt(CanisterSummary),
|
|
52
|
+
'dapp_canister_summaries' : IDL.Vec(CanisterSummary),
|
|
53
|
+
});
|
|
54
|
+
const ListSnsCanistersResponse = IDL.Record({
|
|
55
|
+
'root' : IDL.Opt(IDL.Principal),
|
|
56
|
+
'swap' : IDL.Opt(IDL.Principal),
|
|
57
|
+
'ledger' : IDL.Opt(IDL.Principal),
|
|
58
|
+
'governance' : IDL.Opt(IDL.Principal),
|
|
59
|
+
'dapps' : IDL.Vec(IDL.Principal),
|
|
60
|
+
'archives' : IDL.Vec(IDL.Principal),
|
|
61
|
+
});
|
|
62
|
+
const RegisterDappCanisterRequest = IDL.Record({
|
|
63
|
+
'canister_id' : IDL.Opt(IDL.Principal),
|
|
64
|
+
});
|
|
65
|
+
const SetDappControllersRequest = IDL.Record({
|
|
66
|
+
'controller_principal_ids' : IDL.Vec(IDL.Principal),
|
|
67
|
+
});
|
|
68
|
+
const CanisterCallError = IDL.Record({
|
|
69
|
+
'code' : IDL.Opt(IDL.Int32),
|
|
70
|
+
'description' : IDL.Text,
|
|
71
|
+
});
|
|
72
|
+
const FailedUpdate = IDL.Record({
|
|
73
|
+
'err' : IDL.Opt(CanisterCallError),
|
|
74
|
+
'dapp_canister_id' : IDL.Opt(IDL.Principal),
|
|
75
|
+
});
|
|
76
|
+
const SetDappControllersResponse = IDL.Record({
|
|
77
|
+
'failed_updates' : IDL.Vec(FailedUpdate),
|
|
78
|
+
});
|
|
26
79
|
return IDL.Service({
|
|
80
|
+
'canister_status' : IDL.Func(
|
|
81
|
+
[CanisterIdRecord],
|
|
82
|
+
[CanisterStatusResult],
|
|
83
|
+
[],
|
|
84
|
+
),
|
|
85
|
+
'get_build_metadata' : IDL.Func([], [IDL.Text], ['query']),
|
|
27
86
|
'get_sns_canisters_summary' : IDL.Func(
|
|
28
|
-
[IDL.
|
|
29
|
-
[
|
|
87
|
+
[IDL.Record({})],
|
|
88
|
+
[GetSnsCanistersSummaryResponse],
|
|
30
89
|
[],
|
|
31
90
|
),
|
|
91
|
+
'list_sns_canisters' : IDL.Func(
|
|
92
|
+
[IDL.Record({})],
|
|
93
|
+
[ListSnsCanistersResponse],
|
|
94
|
+
['query'],
|
|
95
|
+
),
|
|
96
|
+
'register_dapp_canister' : IDL.Func(
|
|
97
|
+
[RegisterDappCanisterRequest],
|
|
98
|
+
[IDL.Record({})],
|
|
99
|
+
[],
|
|
100
|
+
),
|
|
101
|
+
'set_dapp_controllers' : IDL.Func(
|
|
102
|
+
[SetDappControllersRequest],
|
|
103
|
+
[SetDappControllersResponse],
|
|
104
|
+
[],
|
|
105
|
+
),
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
export const init = ({ IDL }) => {
|
|
109
|
+
const SnsRootCanister = IDL.Record({
|
|
110
|
+
'dapp_canister_ids' : IDL.Vec(IDL.Principal),
|
|
111
|
+
'governance_canister_id' : IDL.Opt(IDL.Principal),
|
|
112
|
+
'swap_canister_id' : IDL.Opt(IDL.Principal),
|
|
113
|
+
'ledger_canister_id' : IDL.Opt(IDL.Principal),
|
|
32
114
|
});
|
|
115
|
+
return [SnsRootCanister];
|
|
33
116
|
};
|
|
34
|
-
export const init = ({ IDL }) => { return []; };
|
|
@@ -35,8 +35,31 @@ export const idlFactory = ({ IDL }) => {
|
|
|
35
35
|
'sweep_sns' : IDL.Opt(SweepResult),
|
|
36
36
|
'create_neuron' : IDL.Opt(SweepResult),
|
|
37
37
|
});
|
|
38
|
+
const CanisterStatusType = IDL.Variant({
|
|
39
|
+
'stopped' : IDL.Null,
|
|
40
|
+
'stopping' : IDL.Null,
|
|
41
|
+
'running' : IDL.Null,
|
|
42
|
+
});
|
|
43
|
+
const DefiniteCanisterSettingsArgs = IDL.Record({
|
|
44
|
+
'controller' : IDL.Principal,
|
|
45
|
+
'freezing_threshold' : IDL.Nat,
|
|
46
|
+
'controllers' : IDL.Vec(IDL.Principal),
|
|
47
|
+
'memory_allocation' : IDL.Nat,
|
|
48
|
+
'compute_allocation' : IDL.Nat,
|
|
49
|
+
});
|
|
50
|
+
const CanisterStatusResultV2 = IDL.Record({
|
|
51
|
+
'controller' : IDL.Principal,
|
|
52
|
+
'status' : CanisterStatusType,
|
|
53
|
+
'freezing_threshold' : IDL.Nat,
|
|
54
|
+
'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),
|
|
55
|
+
'memory_size' : IDL.Nat,
|
|
56
|
+
'cycles' : IDL.Nat,
|
|
57
|
+
'settings' : DefiniteCanisterSettingsArgs,
|
|
58
|
+
'idle_cycles_burned_per_day' : IDL.Nat,
|
|
59
|
+
'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
60
|
+
});
|
|
38
61
|
const GetCanisterStatusResponse = IDL.Record({
|
|
39
|
-
'
|
|
62
|
+
'status' : CanisterStatusResultV2,
|
|
40
63
|
});
|
|
41
64
|
const TimeWindow = IDL.Record({
|
|
42
65
|
'start_timestamp_seconds' : IDL.Nat64,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Principal } from "@dfinity/principal";
|
|
1
2
|
export interface BuyerState {
|
|
2
3
|
icp_disbursing: boolean;
|
|
3
4
|
amount_sns_e8s: bigint;
|
|
@@ -8,6 +9,28 @@ export interface CanisterCallError {
|
|
|
8
9
|
code: [] | [number];
|
|
9
10
|
description: string;
|
|
10
11
|
}
|
|
12
|
+
export interface CanisterStatusResultV2 {
|
|
13
|
+
controller: Principal;
|
|
14
|
+
status: CanisterStatusType;
|
|
15
|
+
freezing_threshold: bigint;
|
|
16
|
+
balance: Array<[Array<number>, bigint]>;
|
|
17
|
+
memory_size: bigint;
|
|
18
|
+
cycles: bigint;
|
|
19
|
+
settings: DefiniteCanisterSettingsArgs;
|
|
20
|
+
idle_cycles_burned_per_day: bigint;
|
|
21
|
+
module_hash: [] | [Array<number>];
|
|
22
|
+
}
|
|
23
|
+
export type CanisterStatusType =
|
|
24
|
+
| { stopped: null }
|
|
25
|
+
| { stopping: null }
|
|
26
|
+
| { running: null };
|
|
27
|
+
export interface DefiniteCanisterSettingsArgs {
|
|
28
|
+
controller: Principal;
|
|
29
|
+
freezing_threshold: bigint;
|
|
30
|
+
controllers: Array<Principal>;
|
|
31
|
+
memory_allocation: bigint;
|
|
32
|
+
compute_allocation: bigint;
|
|
33
|
+
}
|
|
11
34
|
export interface DerivedState {
|
|
12
35
|
sns_tokens_per_icp: number;
|
|
13
36
|
buyer_total_icp_e8s: bigint;
|
|
@@ -23,7 +46,7 @@ export interface FinalizeSwapResponse {
|
|
|
23
46
|
create_neuron: [] | [SweepResult];
|
|
24
47
|
}
|
|
25
48
|
export interface GetCanisterStatusResponse {
|
|
26
|
-
|
|
49
|
+
status: CanisterStatusResultV2;
|
|
27
50
|
}
|
|
28
51
|
export interface GetStateResponse {
|
|
29
52
|
swap: [] | [Swap];
|
package/dist/candid/sns_swap.did
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit 12bd50418009ea8d6aabf4f5ac1182aceaf56689 '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;
|
|
@@ -6,6 +6,25 @@ type BuyerState = record {
|
|
|
6
6
|
sns_disbursing : bool;
|
|
7
7
|
};
|
|
8
8
|
type CanisterCallError = record { code : opt int32; description : text };
|
|
9
|
+
type CanisterStatusResultV2 = record {
|
|
10
|
+
controller : principal;
|
|
11
|
+
status : CanisterStatusType;
|
|
12
|
+
freezing_threshold : nat;
|
|
13
|
+
balance : vec record { vec nat8; nat };
|
|
14
|
+
memory_size : nat;
|
|
15
|
+
cycles : nat;
|
|
16
|
+
settings : DefiniteCanisterSettingsArgs;
|
|
17
|
+
idle_cycles_burned_per_day : nat;
|
|
18
|
+
module_hash : opt vec nat8;
|
|
19
|
+
};
|
|
20
|
+
type CanisterStatusType = variant { stopped; stopping; running };
|
|
21
|
+
type DefiniteCanisterSettingsArgs = record {
|
|
22
|
+
controller : principal;
|
|
23
|
+
freezing_threshold : nat;
|
|
24
|
+
controllers : vec principal;
|
|
25
|
+
memory_allocation : nat;
|
|
26
|
+
compute_allocation : nat;
|
|
27
|
+
};
|
|
9
28
|
type DerivedState = record {
|
|
10
29
|
sns_tokens_per_icp : float32;
|
|
11
30
|
buyer_total_icp_e8s : nat64;
|
|
@@ -20,7 +39,7 @@ type FinalizeSwapResponse = record {
|
|
|
20
39
|
sweep_sns : opt SweepResult;
|
|
21
40
|
create_neuron : opt SweepResult;
|
|
22
41
|
};
|
|
23
|
-
type GetCanisterStatusResponse = record {
|
|
42
|
+
type GetCanisterStatusResponse = record { status : CanisterStatusResultV2 };
|
|
24
43
|
type GetStateResponse = record { swap : opt Swap; derived : opt DerivedState };
|
|
25
44
|
type Init = record {
|
|
26
45
|
min_participant_icp_e8s : nat64;
|
|
@@ -35,8 +35,31 @@ export const idlFactory = ({ IDL }) => {
|
|
|
35
35
|
'sweep_sns' : IDL.Opt(SweepResult),
|
|
36
36
|
'create_neuron' : IDL.Opt(SweepResult),
|
|
37
37
|
});
|
|
38
|
+
const CanisterStatusType = IDL.Variant({
|
|
39
|
+
'stopped' : IDL.Null,
|
|
40
|
+
'stopping' : IDL.Null,
|
|
41
|
+
'running' : IDL.Null,
|
|
42
|
+
});
|
|
43
|
+
const DefiniteCanisterSettingsArgs = IDL.Record({
|
|
44
|
+
'controller' : IDL.Principal,
|
|
45
|
+
'freezing_threshold' : IDL.Nat,
|
|
46
|
+
'controllers' : IDL.Vec(IDL.Principal),
|
|
47
|
+
'memory_allocation' : IDL.Nat,
|
|
48
|
+
'compute_allocation' : IDL.Nat,
|
|
49
|
+
});
|
|
50
|
+
const CanisterStatusResultV2 = IDL.Record({
|
|
51
|
+
'controller' : IDL.Principal,
|
|
52
|
+
'status' : CanisterStatusType,
|
|
53
|
+
'freezing_threshold' : IDL.Nat,
|
|
54
|
+
'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),
|
|
55
|
+
'memory_size' : IDL.Nat,
|
|
56
|
+
'cycles' : IDL.Nat,
|
|
57
|
+
'settings' : DefiniteCanisterSettingsArgs,
|
|
58
|
+
'idle_cycles_burned_per_day' : IDL.Nat,
|
|
59
|
+
'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
60
|
+
});
|
|
38
61
|
const GetCanisterStatusResponse = IDL.Record({
|
|
39
|
-
'
|
|
62
|
+
'status' : CanisterStatusResultV2,
|
|
40
63
|
});
|
|
41
64
|
const TimeWindow = IDL.Record({
|
|
42
65
|
'start_timestamp_seconds' : IDL.Nat64,
|