@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
package/README.md
CHANGED
|
@@ -182,6 +182,7 @@ Parameters:
|
|
|
182
182
|
|
|
183
183
|
- [create](#gear-create)
|
|
184
184
|
- [metadata](#gear-metadata)
|
|
185
|
+
- [balance](#gear-balance)
|
|
185
186
|
|
|
186
187
|
##### :gear: create
|
|
187
188
|
|
|
@@ -197,6 +198,18 @@ The token metadata (name, symbol, etc.).
|
|
|
197
198
|
| ---------- | ------------------------------------------------------------ |
|
|
198
199
|
| `metadata` | `(params: QueryParams) => Promise<SnsTokenMetadataResponse>` |
|
|
199
200
|
|
|
201
|
+
##### :gear: balance
|
|
202
|
+
|
|
203
|
+
Returns the balance of the given account.
|
|
204
|
+
|
|
205
|
+
| Method | Type |
|
|
206
|
+
| --------- | -------------------------------------------- |
|
|
207
|
+
| `balance` | `(params: BalanceParams) => Promise<bigint>` |
|
|
208
|
+
|
|
209
|
+
Parameters:
|
|
210
|
+
|
|
211
|
+
- `params`: The parameters to get the balance of an account.
|
|
212
|
+
|
|
200
213
|
### :factory: SnsRootCanister
|
|
201
214
|
|
|
202
215
|
#### Constructors
|
|
@@ -297,6 +310,8 @@ Parameters:
|
|
|
297
310
|
|
|
298
311
|
- [listNeurons](#gear-listneurons)
|
|
299
312
|
- [metadata](#gear-metadata)
|
|
313
|
+
- [ledgerMetadata](#gear-ledgermetadata)
|
|
314
|
+
- [balance](#gear-balance)
|
|
300
315
|
- [getNeuron](#gear-getneuron)
|
|
301
316
|
- [addNeuronPermissions](#gear-addneuronpermissions)
|
|
302
317
|
- [removeNeuronPermissions](#gear-removeneuronpermissions)
|
|
@@ -316,6 +331,18 @@ Parameters:
|
|
|
316
331
|
| ---------- | ------------------------------------------------------------------------------------------------------ |
|
|
317
332
|
| `metadata` | `(params: Omit<QueryParams, "certified">) => Promise<[GetMetadataResponse, SnsTokenMetadataResponse]>` |
|
|
318
333
|
|
|
334
|
+
##### :gear: ledgerMetadata
|
|
335
|
+
|
|
336
|
+
| Method | Type |
|
|
337
|
+
| ---------------- | ------------------------------------------------------------------------------- |
|
|
338
|
+
| `ledgerMetadata` | `(params: Omit<QueryParams, "certified">) => Promise<SnsTokenMetadataResponse>` |
|
|
339
|
+
|
|
340
|
+
##### :gear: balance
|
|
341
|
+
|
|
342
|
+
| Method | Type |
|
|
343
|
+
| --------- | --------------------------------------------------------------- |
|
|
344
|
+
| `balance` | `(params: Omit<BalanceParams, "certified">) => Promise<bigint>` |
|
|
345
|
+
|
|
319
346
|
##### :gear: getNeuron
|
|
320
347
|
|
|
321
348
|
| Method | Type |
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { ActorMethod } from "@dfinity/agent";
|
|
1
2
|
import type { Principal } from "@dfinity/principal";
|
|
3
|
+
|
|
2
4
|
export interface Account {
|
|
3
5
|
owner: Principal;
|
|
4
6
|
subaccount: [] | [Subaccount];
|
|
@@ -21,13 +23,13 @@ export interface InitArgs {
|
|
|
21
23
|
};
|
|
22
24
|
token_name: string;
|
|
23
25
|
}
|
|
24
|
-
export type Subaccount =
|
|
26
|
+
export type Subaccount = Uint8Array;
|
|
25
27
|
export type Timestamp = bigint;
|
|
26
28
|
export type Tokens = bigint;
|
|
27
29
|
export interface TransferArg {
|
|
28
30
|
to: Account;
|
|
29
31
|
fee: [] | [Tokens];
|
|
30
|
-
memo: [] | [
|
|
32
|
+
memo: [] | [Uint8Array];
|
|
31
33
|
from_subaccount: [] | [Subaccount];
|
|
32
34
|
created_at_time: [] | [Timestamp];
|
|
33
35
|
amount: Tokens;
|
|
@@ -47,19 +49,20 @@ export type TransferResult = { Ok: BlockIndex } | { Err: TransferError };
|
|
|
47
49
|
export type Value =
|
|
48
50
|
| { Int: bigint }
|
|
49
51
|
| { Nat: bigint }
|
|
50
|
-
| { Blob:
|
|
52
|
+
| { Blob: Uint8Array }
|
|
51
53
|
| { Text: string };
|
|
52
54
|
export interface _SERVICE {
|
|
53
|
-
icrc1_balance_of:
|
|
54
|
-
icrc1_decimals:
|
|
55
|
-
icrc1_fee:
|
|
56
|
-
icrc1_metadata:
|
|
57
|
-
icrc1_minting_account:
|
|
58
|
-
icrc1_name:
|
|
59
|
-
icrc1_supported_standards:
|
|
55
|
+
icrc1_balance_of: ActorMethod<[Account], Tokens>;
|
|
56
|
+
icrc1_decimals: ActorMethod<[], number>;
|
|
57
|
+
icrc1_fee: ActorMethod<[], Tokens>;
|
|
58
|
+
icrc1_metadata: ActorMethod<[], Array<[string, Value]>>;
|
|
59
|
+
icrc1_minting_account: ActorMethod<[], [] | [Account]>;
|
|
60
|
+
icrc1_name: ActorMethod<[], string>;
|
|
61
|
+
icrc1_supported_standards: ActorMethod<
|
|
62
|
+
[],
|
|
60
63
|
Array<{ url: string; name: string }>
|
|
61
64
|
>;
|
|
62
|
-
icrc1_symbol:
|
|
63
|
-
icrc1_total_supply:
|
|
64
|
-
icrc1_transfer:
|
|
65
|
+
icrc1_symbol: ActorMethod<[], string>;
|
|
66
|
+
icrc1_total_supply: ActorMethod<[], Tokens>;
|
|
67
|
+
icrc1_transfer: ActorMethod<[TransferArg], TransferResult>;
|
|
65
68
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit fb28a950f1799dec4a67cc21abd3888686ab50d9 'rs/rosetta-api/icrc1/ledger/icrc1.did' by import-candid
|
|
2
2
|
type BlockIndex = nat;
|
|
3
3
|
type Subaccount = blob;
|
|
4
4
|
// Number of nanoseconds since the UNIX epoch in UTC timezone.
|
|
@@ -71,7 +71,7 @@ service : (InitArgs) -> {
|
|
|
71
71
|
icrc1_total_supply : () -> (Tokens) query;
|
|
72
72
|
icrc1_fee : () -> (Tokens) query;
|
|
73
73
|
icrc1_minting_account : () -> (opt Account) query;
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
icrc1_balance_of : (Account) -> (Tokens) query;
|
|
76
76
|
icrc1_transfer : (TransferArg) -> (TransferResult);
|
|
77
77
|
icrc1_supported_standards : () -> (vec record { name : text; url : text }) query;
|
|
@@ -92,6 +92,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
92
92
|
const UpgradeInProgress = IDL.Record({
|
|
93
93
|
'mark_failed_at_seconds' : IDL.Nat64,
|
|
94
94
|
'checking_upgrade_lock' : IDL.Nat64,
|
|
95
|
+
'proposal_id' : IDL.Nat64,
|
|
95
96
|
'target_version' : IDL.Opt(Version),
|
|
96
97
|
});
|
|
97
98
|
const GovernanceError = IDL.Record({
|
|
@@ -113,6 +114,12 @@ export const idlFactory = ({ IDL }) => {
|
|
|
113
114
|
'new_canister_wasm' : IDL.Vec(IDL.Nat8),
|
|
114
115
|
'canister_id' : IDL.Opt(IDL.Principal),
|
|
115
116
|
});
|
|
117
|
+
const ManageSnsMetadata = IDL.Record({
|
|
118
|
+
'url' : IDL.Opt(IDL.Text),
|
|
119
|
+
'logo' : IDL.Opt(IDL.Text),
|
|
120
|
+
'name' : IDL.Opt(IDL.Text),
|
|
121
|
+
'description' : IDL.Opt(IDL.Text),
|
|
122
|
+
});
|
|
116
123
|
const ExecuteGenericNervousSystemFunction = IDL.Record({
|
|
117
124
|
'function_id' : IDL.Nat64,
|
|
118
125
|
'payload' : IDL.Vec(IDL.Nat8),
|
|
@@ -125,6 +132,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
125
132
|
'UpgradeSnsToNextVersion' : IDL.Record({}),
|
|
126
133
|
'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,
|
|
127
134
|
'Unspecified' : IDL.Record({}),
|
|
135
|
+
'ManageSnsMetadata' : ManageSnsMetadata,
|
|
128
136
|
'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,
|
|
129
137
|
'Motion' : Motion,
|
|
130
138
|
});
|
|
@@ -228,12 +236,6 @@ export const idlFactory = ({ IDL }) => {
|
|
|
228
236
|
'command' : IDL.Opt(Command_2),
|
|
229
237
|
'timestamp' : IDL.Nat64,
|
|
230
238
|
});
|
|
231
|
-
const GetMetadataResponse = IDL.Record({
|
|
232
|
-
'url' : IDL.Opt(IDL.Text),
|
|
233
|
-
'logo' : IDL.Opt(IDL.Text),
|
|
234
|
-
'name' : IDL.Opt(IDL.Text),
|
|
235
|
-
'description' : IDL.Opt(IDL.Text),
|
|
236
|
-
});
|
|
237
239
|
const NeuronPermission = IDL.Record({
|
|
238
240
|
'principal' : IDL.Opt(IDL.Principal),
|
|
239
241
|
'permission_type' : IDL.Vec(IDL.Int32),
|
|
@@ -263,16 +265,23 @@ export const idlFactory = ({ IDL }) => {
|
|
|
263
265
|
'mode' : IDL.Int32,
|
|
264
266
|
'parameters' : IDL.Opt(NervousSystemParameters),
|
|
265
267
|
'deployed_version' : IDL.Opt(Version),
|
|
268
|
+
'sns_initialization_parameters' : IDL.Text,
|
|
266
269
|
'latest_reward_event' : IDL.Opt(RewardEvent),
|
|
267
270
|
'pending_version' : IDL.Opt(UpgradeInProgress),
|
|
268
271
|
'swap_canister_id' : IDL.Opt(IDL.Principal),
|
|
269
272
|
'ledger_canister_id' : IDL.Opt(IDL.Principal),
|
|
270
273
|
'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
|
|
271
274
|
'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),
|
|
272
|
-
'sns_metadata' : IDL.Opt(
|
|
275
|
+
'sns_metadata' : IDL.Opt(ManageSnsMetadata),
|
|
273
276
|
'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),
|
|
274
277
|
'genesis_timestamp_seconds' : IDL.Nat64,
|
|
275
278
|
});
|
|
279
|
+
const GetMetadataResponse = IDL.Record({
|
|
280
|
+
'url' : IDL.Opt(IDL.Text),
|
|
281
|
+
'logo' : IDL.Opt(IDL.Text),
|
|
282
|
+
'name' : IDL.Opt(IDL.Text),
|
|
283
|
+
'description' : IDL.Opt(IDL.Text),
|
|
284
|
+
});
|
|
276
285
|
const GetNeuron = IDL.Record({ 'neuron_id' : IDL.Opt(NeuronId) });
|
|
277
286
|
const Result = IDL.Variant({ 'Error' : GovernanceError, 'Neuron' : Neuron });
|
|
278
287
|
const GetNeuronResponse = IDL.Record({ 'result' : IDL.Opt(Result) });
|
|
@@ -309,6 +318,9 @@ export const idlFactory = ({ IDL }) => {
|
|
|
309
318
|
'deployed_version' : IDL.Opt(Version),
|
|
310
319
|
'pending_version' : IDL.Opt(UpgradeInProgress),
|
|
311
320
|
});
|
|
321
|
+
const GetSnsInitializationParametersResponse = IDL.Record({
|
|
322
|
+
'sns_initialization_parameters' : IDL.Text,
|
|
323
|
+
});
|
|
312
324
|
const ListNervousSystemFunctionsResponse = IDL.Record({
|
|
313
325
|
'reserved_ids' : IDL.Vec(IDL.Nat64),
|
|
314
326
|
'functions' : IDL.Vec(NervousSystemFunction),
|
|
@@ -395,6 +407,11 @@ export const idlFactory = ({ IDL }) => {
|
|
|
395
407
|
[GetRunningSnsVersionResponse],
|
|
396
408
|
[],
|
|
397
409
|
),
|
|
410
|
+
'get_sns_initialization_parameters' : IDL.Func(
|
|
411
|
+
[IDL.Record({})],
|
|
412
|
+
[GetSnsInitializationParametersResponse],
|
|
413
|
+
[],
|
|
414
|
+
),
|
|
398
415
|
'list_nervous_system_functions' : IDL.Func(
|
|
399
416
|
[],
|
|
400
417
|
[ListNervousSystemFunctionsResponse],
|
|
@@ -499,6 +516,7 @@ export const init = ({ IDL }) => {
|
|
|
499
516
|
const UpgradeInProgress = IDL.Record({
|
|
500
517
|
'mark_failed_at_seconds' : IDL.Nat64,
|
|
501
518
|
'checking_upgrade_lock' : IDL.Nat64,
|
|
519
|
+
'proposal_id' : IDL.Nat64,
|
|
502
520
|
'target_version' : IDL.Opt(Version),
|
|
503
521
|
});
|
|
504
522
|
const GovernanceError = IDL.Record({
|
|
@@ -520,6 +538,12 @@ export const init = ({ IDL }) => {
|
|
|
520
538
|
'new_canister_wasm' : IDL.Vec(IDL.Nat8),
|
|
521
539
|
'canister_id' : IDL.Opt(IDL.Principal),
|
|
522
540
|
});
|
|
541
|
+
const ManageSnsMetadata = IDL.Record({
|
|
542
|
+
'url' : IDL.Opt(IDL.Text),
|
|
543
|
+
'logo' : IDL.Opt(IDL.Text),
|
|
544
|
+
'name' : IDL.Opt(IDL.Text),
|
|
545
|
+
'description' : IDL.Opt(IDL.Text),
|
|
546
|
+
});
|
|
523
547
|
const ExecuteGenericNervousSystemFunction = IDL.Record({
|
|
524
548
|
'function_id' : IDL.Nat64,
|
|
525
549
|
'payload' : IDL.Vec(IDL.Nat8),
|
|
@@ -532,6 +556,7 @@ export const init = ({ IDL }) => {
|
|
|
532
556
|
'UpgradeSnsToNextVersion' : IDL.Record({}),
|
|
533
557
|
'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,
|
|
534
558
|
'Unspecified' : IDL.Record({}),
|
|
559
|
+
'ManageSnsMetadata' : ManageSnsMetadata,
|
|
535
560
|
'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,
|
|
536
561
|
'Motion' : Motion,
|
|
537
562
|
});
|
|
@@ -635,12 +660,6 @@ export const init = ({ IDL }) => {
|
|
|
635
660
|
'command' : IDL.Opt(Command_2),
|
|
636
661
|
'timestamp' : IDL.Nat64,
|
|
637
662
|
});
|
|
638
|
-
const GetMetadataResponse = IDL.Record({
|
|
639
|
-
'url' : IDL.Opt(IDL.Text),
|
|
640
|
-
'logo' : IDL.Opt(IDL.Text),
|
|
641
|
-
'name' : IDL.Opt(IDL.Text),
|
|
642
|
-
'description' : IDL.Opt(IDL.Text),
|
|
643
|
-
});
|
|
644
663
|
const NeuronPermission = IDL.Record({
|
|
645
664
|
'principal' : IDL.Opt(IDL.Principal),
|
|
646
665
|
'permission_type' : IDL.Vec(IDL.Int32),
|
|
@@ -670,13 +689,14 @@ export const init = ({ IDL }) => {
|
|
|
670
689
|
'mode' : IDL.Int32,
|
|
671
690
|
'parameters' : IDL.Opt(NervousSystemParameters),
|
|
672
691
|
'deployed_version' : IDL.Opt(Version),
|
|
692
|
+
'sns_initialization_parameters' : IDL.Text,
|
|
673
693
|
'latest_reward_event' : IDL.Opt(RewardEvent),
|
|
674
694
|
'pending_version' : IDL.Opt(UpgradeInProgress),
|
|
675
695
|
'swap_canister_id' : IDL.Opt(IDL.Principal),
|
|
676
696
|
'ledger_canister_id' : IDL.Opt(IDL.Principal),
|
|
677
697
|
'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
|
|
678
698
|
'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),
|
|
679
|
-
'sns_metadata' : IDL.Opt(
|
|
699
|
+
'sns_metadata' : IDL.Opt(ManageSnsMetadata),
|
|
680
700
|
'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),
|
|
681
701
|
'genesis_timestamp_seconds' : IDL.Nat64,
|
|
682
702
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { ActorMethod } from "@dfinity/agent";
|
|
1
2
|
import type { Principal } from "@dfinity/principal";
|
|
3
|
+
|
|
2
4
|
export interface Account {
|
|
3
5
|
owner: [] | [Principal];
|
|
4
6
|
subaccount: [] | [Subaccount];
|
|
@@ -12,6 +14,7 @@ export type Action =
|
|
|
12
14
|
| { UpgradeSnsToNextVersion: {} }
|
|
13
15
|
| { UpgradeSnsControlledCanister: UpgradeSnsControlledCanister }
|
|
14
16
|
| { Unspecified: {} }
|
|
17
|
+
| { ManageSnsMetadata: ManageSnsMetadata }
|
|
15
18
|
| {
|
|
16
19
|
ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction;
|
|
17
20
|
}
|
|
@@ -33,12 +36,12 @@ export interface CanisterStatusResultV2 {
|
|
|
33
36
|
controller: Principal;
|
|
34
37
|
status: CanisterStatusType;
|
|
35
38
|
freezing_threshold: bigint;
|
|
36
|
-
balance: Array<[
|
|
39
|
+
balance: Array<[Uint8Array, bigint]>;
|
|
37
40
|
memory_size: bigint;
|
|
38
41
|
cycles: bigint;
|
|
39
42
|
settings: DefiniteCanisterSettingsArgs;
|
|
40
43
|
idle_cycles_burned_per_day: bigint;
|
|
41
|
-
module_hash: [] | [
|
|
44
|
+
module_hash: [] | [Uint8Array];
|
|
42
45
|
}
|
|
43
46
|
export type CanisterStatusType =
|
|
44
47
|
| { stopped: null }
|
|
@@ -120,7 +123,7 @@ export type DissolveState =
|
|
|
120
123
|
| { WhenDissolvedTimestampSeconds: bigint };
|
|
121
124
|
export interface ExecuteGenericNervousSystemFunction {
|
|
122
125
|
function_id: bigint;
|
|
123
|
-
payload:
|
|
126
|
+
payload: Uint8Array;
|
|
124
127
|
}
|
|
125
128
|
export interface Follow {
|
|
126
129
|
function_id: bigint;
|
|
@@ -160,6 +163,9 @@ export interface GetRunningSnsVersionResponse {
|
|
|
160
163
|
deployed_version: [] | [Version];
|
|
161
164
|
pending_version: [] | [UpgradeInProgress];
|
|
162
165
|
}
|
|
166
|
+
export interface GetSnsInitializationParametersResponse {
|
|
167
|
+
sns_initialization_parameters: string;
|
|
168
|
+
}
|
|
163
169
|
export interface Governance {
|
|
164
170
|
root_canister_id: [] | [Principal];
|
|
165
171
|
id_to_nervous_system_functions: Array<[bigint, NervousSystemFunction]>;
|
|
@@ -167,13 +173,14 @@ export interface Governance {
|
|
|
167
173
|
mode: number;
|
|
168
174
|
parameters: [] | [NervousSystemParameters];
|
|
169
175
|
deployed_version: [] | [Version];
|
|
176
|
+
sns_initialization_parameters: string;
|
|
170
177
|
latest_reward_event: [] | [RewardEvent];
|
|
171
178
|
pending_version: [] | [UpgradeInProgress];
|
|
172
179
|
swap_canister_id: [] | [Principal];
|
|
173
180
|
ledger_canister_id: [] | [Principal];
|
|
174
181
|
proposals: Array<[bigint, ProposalData]>;
|
|
175
182
|
in_flight_commands: Array<[string, NeuronInFlightCommand]>;
|
|
176
|
-
sns_metadata: [] | [
|
|
183
|
+
sns_metadata: [] | [ManageSnsMetadata];
|
|
177
184
|
neurons: Array<[string, Neuron]>;
|
|
178
185
|
genesis_timestamp_seconds: bigint;
|
|
179
186
|
}
|
|
@@ -202,7 +209,7 @@ export interface IncreaseDissolveDelay {
|
|
|
202
209
|
additional_dissolve_delay_seconds: number;
|
|
203
210
|
}
|
|
204
211
|
export interface ListNervousSystemFunctionsResponse {
|
|
205
|
-
reserved_ids:
|
|
212
|
+
reserved_ids: BigUint64Array;
|
|
206
213
|
functions: Array<NervousSystemFunction>;
|
|
207
214
|
}
|
|
208
215
|
export interface ListNeurons {
|
|
@@ -214,22 +221,28 @@ export interface ListNeuronsResponse {
|
|
|
214
221
|
neurons: Array<Neuron>;
|
|
215
222
|
}
|
|
216
223
|
export interface ListProposals {
|
|
217
|
-
include_reward_status:
|
|
224
|
+
include_reward_status: Int32Array;
|
|
218
225
|
before_proposal: [] | [ProposalId];
|
|
219
226
|
limit: number;
|
|
220
|
-
exclude_type:
|
|
221
|
-
include_status:
|
|
227
|
+
exclude_type: BigUint64Array;
|
|
228
|
+
include_status: Int32Array;
|
|
222
229
|
}
|
|
223
230
|
export interface ListProposalsResponse {
|
|
224
231
|
proposals: Array<ProposalData>;
|
|
225
232
|
}
|
|
226
233
|
export interface ManageNeuron {
|
|
227
|
-
subaccount:
|
|
234
|
+
subaccount: Uint8Array;
|
|
228
235
|
command: [] | [Command];
|
|
229
236
|
}
|
|
230
237
|
export interface ManageNeuronResponse {
|
|
231
238
|
command: [] | [Command_1];
|
|
232
239
|
}
|
|
240
|
+
export interface ManageSnsMetadata {
|
|
241
|
+
url: [] | [string];
|
|
242
|
+
logo: [] | [string];
|
|
243
|
+
name: [] | [string];
|
|
244
|
+
description: [] | [string];
|
|
245
|
+
}
|
|
233
246
|
export interface MemoAndController {
|
|
234
247
|
controller: [] | [Principal];
|
|
235
248
|
memo: bigint;
|
|
@@ -282,7 +295,7 @@ export interface Neuron {
|
|
|
282
295
|
neuron_fees_e8s: bigint;
|
|
283
296
|
}
|
|
284
297
|
export interface NeuronId {
|
|
285
|
-
id:
|
|
298
|
+
id: Uint8Array;
|
|
286
299
|
}
|
|
287
300
|
export interface NeuronInFlightCommand {
|
|
288
301
|
command: [] | [Command_2];
|
|
@@ -290,10 +303,10 @@ export interface NeuronInFlightCommand {
|
|
|
290
303
|
}
|
|
291
304
|
export interface NeuronPermission {
|
|
292
305
|
principal: [] | [Principal];
|
|
293
|
-
permission_type:
|
|
306
|
+
permission_type: Int32Array;
|
|
294
307
|
}
|
|
295
308
|
export interface NeuronPermissionList {
|
|
296
|
-
permissions:
|
|
309
|
+
permissions: Int32Array;
|
|
297
310
|
}
|
|
298
311
|
export type Operation =
|
|
299
312
|
| { StopDissolving: {} }
|
|
@@ -359,7 +372,7 @@ export interface SplitResponse {
|
|
|
359
372
|
created_neuron_id: [] | [NeuronId];
|
|
360
373
|
}
|
|
361
374
|
export interface Subaccount {
|
|
362
|
-
subaccount:
|
|
375
|
+
subaccount: Uint8Array;
|
|
363
376
|
}
|
|
364
377
|
export interface Tally {
|
|
365
378
|
no: bigint;
|
|
@@ -370,18 +383,19 @@ export interface Tally {
|
|
|
370
383
|
export interface UpgradeInProgress {
|
|
371
384
|
mark_failed_at_seconds: bigint;
|
|
372
385
|
checking_upgrade_lock: bigint;
|
|
386
|
+
proposal_id: bigint;
|
|
373
387
|
target_version: [] | [Version];
|
|
374
388
|
}
|
|
375
389
|
export interface UpgradeSnsControlledCanister {
|
|
376
|
-
new_canister_wasm:
|
|
390
|
+
new_canister_wasm: Uint8Array;
|
|
377
391
|
canister_id: [] | [Principal];
|
|
378
392
|
}
|
|
379
393
|
export interface Version {
|
|
380
|
-
archive_wasm_hash:
|
|
381
|
-
root_wasm_hash:
|
|
382
|
-
swap_wasm_hash:
|
|
383
|
-
ledger_wasm_hash:
|
|
384
|
-
governance_wasm_hash:
|
|
394
|
+
archive_wasm_hash: Uint8Array;
|
|
395
|
+
root_wasm_hash: Uint8Array;
|
|
396
|
+
swap_wasm_hash: Uint8Array;
|
|
397
|
+
ledger_wasm_hash: Uint8Array;
|
|
398
|
+
governance_wasm_hash: Uint8Array;
|
|
385
399
|
}
|
|
386
400
|
export interface VotingRewardsParameters {
|
|
387
401
|
start_timestamp_seconds: [] | [bigint];
|
|
@@ -394,18 +408,23 @@ export interface WaitForQuietState {
|
|
|
394
408
|
current_deadline_timestamp_seconds: bigint;
|
|
395
409
|
}
|
|
396
410
|
export interface _SERVICE {
|
|
397
|
-
get_build_metadata:
|
|
398
|
-
get_metadata:
|
|
399
|
-
get_nervous_system_parameters:
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
+
get_build_metadata: ActorMethod<[], string>;
|
|
412
|
+
get_metadata: ActorMethod<[{}], GetMetadataResponse>;
|
|
413
|
+
get_nervous_system_parameters: ActorMethod<[null], NervousSystemParameters>;
|
|
414
|
+
get_neuron: ActorMethod<[GetNeuron], GetNeuronResponse>;
|
|
415
|
+
get_proposal: ActorMethod<[GetProposal], GetProposalResponse>;
|
|
416
|
+
get_root_canister_status: ActorMethod<[null], CanisterStatusResultV2>;
|
|
417
|
+
get_running_sns_version: ActorMethod<[{}], GetRunningSnsVersionResponse>;
|
|
418
|
+
get_sns_initialization_parameters: ActorMethod<
|
|
419
|
+
[{}],
|
|
420
|
+
GetSnsInitializationParametersResponse
|
|
421
|
+
>;
|
|
422
|
+
list_nervous_system_functions: ActorMethod<
|
|
423
|
+
[],
|
|
424
|
+
ListNervousSystemFunctionsResponse
|
|
425
|
+
>;
|
|
426
|
+
list_neurons: ActorMethod<[ListNeurons], ListNeuronsResponse>;
|
|
427
|
+
list_proposals: ActorMethod<[ListProposals], ListProposalsResponse>;
|
|
428
|
+
manage_neuron: ActorMethod<[ManageNeuron], ManageNeuronResponse>;
|
|
429
|
+
set_mode: ActorMethod<[SetMode], {}>;
|
|
411
430
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit fb28a950f1799dec4a67cc21abd3888686ab50d9 'rs/sns/governance/canister/governance.did' by import-candid
|
|
2
2
|
type Account = record { owner : opt principal; subaccount : opt Subaccount };
|
|
3
3
|
type Action = variant {
|
|
4
4
|
ManageNervousSystemParameters : NervousSystemParameters;
|
|
@@ -7,6 +7,7 @@ type Action = variant {
|
|
|
7
7
|
UpgradeSnsToNextVersion : record {};
|
|
8
8
|
UpgradeSnsControlledCanister : UpgradeSnsControlledCanister;
|
|
9
9
|
Unspecified : record {};
|
|
10
|
+
ManageSnsMetadata : ManageSnsMetadata;
|
|
10
11
|
ExecuteGenericNervousSystemFunction : ExecuteGenericNervousSystemFunction;
|
|
11
12
|
Motion : Motion;
|
|
12
13
|
};
|
|
@@ -131,6 +132,9 @@ type GetRunningSnsVersionResponse = record {
|
|
|
131
132
|
deployed_version : opt Version;
|
|
132
133
|
pending_version : opt UpgradeInProgress;
|
|
133
134
|
};
|
|
135
|
+
type GetSnsInitializationParametersResponse = record {
|
|
136
|
+
sns_initialization_parameters : text;
|
|
137
|
+
};
|
|
134
138
|
type Governance = record {
|
|
135
139
|
root_canister_id : opt principal;
|
|
136
140
|
id_to_nervous_system_functions : vec record { nat64; NervousSystemFunction };
|
|
@@ -138,13 +142,14 @@ type Governance = record {
|
|
|
138
142
|
mode : int32;
|
|
139
143
|
parameters : opt NervousSystemParameters;
|
|
140
144
|
deployed_version : opt Version;
|
|
145
|
+
sns_initialization_parameters : text;
|
|
141
146
|
latest_reward_event : opt RewardEvent;
|
|
142
147
|
pending_version : opt UpgradeInProgress;
|
|
143
148
|
swap_canister_id : opt principal;
|
|
144
149
|
ledger_canister_id : opt principal;
|
|
145
150
|
proposals : vec record { nat64; ProposalData };
|
|
146
151
|
in_flight_commands : vec record { text; NeuronInFlightCommand };
|
|
147
|
-
sns_metadata : opt
|
|
152
|
+
sns_metadata : opt ManageSnsMetadata;
|
|
148
153
|
neurons : vec record { text; Neuron };
|
|
149
154
|
genesis_timestamp_seconds : nat64;
|
|
150
155
|
};
|
|
@@ -189,6 +194,12 @@ type ListProposals = record {
|
|
|
189
194
|
type ListProposalsResponse = record { proposals : vec ProposalData };
|
|
190
195
|
type ManageNeuron = record { subaccount : vec nat8; command : opt Command };
|
|
191
196
|
type ManageNeuronResponse = record { command : opt Command_1 };
|
|
197
|
+
type ManageSnsMetadata = record {
|
|
198
|
+
url : opt text;
|
|
199
|
+
logo : opt text;
|
|
200
|
+
name : opt text;
|
|
201
|
+
description : opt text;
|
|
202
|
+
};
|
|
192
203
|
type MemoAndController = record { controller : opt principal; memo : nat64 };
|
|
193
204
|
type MergeMaturity = record { percentage_to_merge : nat32 };
|
|
194
205
|
type MergeMaturityResponse = record {
|
|
@@ -303,6 +314,7 @@ type Tally = record {
|
|
|
303
314
|
type UpgradeInProgress = record {
|
|
304
315
|
mark_failed_at_seconds : nat64;
|
|
305
316
|
checking_upgrade_lock : nat64;
|
|
317
|
+
proposal_id : nat64;
|
|
306
318
|
target_version : opt Version;
|
|
307
319
|
};
|
|
308
320
|
type UpgradeSnsControlledCanister = record {
|
|
@@ -332,6 +344,9 @@ service : (Governance) -> {
|
|
|
332
344
|
get_proposal : (GetProposal) -> (GetProposalResponse) query;
|
|
333
345
|
get_root_canister_status : (null) -> (CanisterStatusResultV2);
|
|
334
346
|
get_running_sns_version : (record {}) -> (GetRunningSnsVersionResponse) query;
|
|
347
|
+
get_sns_initialization_parameters : (record {}) -> (
|
|
348
|
+
GetSnsInitializationParametersResponse,
|
|
349
|
+
) query;
|
|
335
350
|
list_nervous_system_functions : () -> (
|
|
336
351
|
ListNervousSystemFunctionsResponse,
|
|
337
352
|
) query;
|
|
@@ -92,6 +92,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
92
92
|
const UpgradeInProgress = IDL.Record({
|
|
93
93
|
'mark_failed_at_seconds' : IDL.Nat64,
|
|
94
94
|
'checking_upgrade_lock' : IDL.Nat64,
|
|
95
|
+
'proposal_id' : IDL.Nat64,
|
|
95
96
|
'target_version' : IDL.Opt(Version),
|
|
96
97
|
});
|
|
97
98
|
const GovernanceError = IDL.Record({
|
|
@@ -113,6 +114,12 @@ export const idlFactory = ({ IDL }) => {
|
|
|
113
114
|
'new_canister_wasm' : IDL.Vec(IDL.Nat8),
|
|
114
115
|
'canister_id' : IDL.Opt(IDL.Principal),
|
|
115
116
|
});
|
|
117
|
+
const ManageSnsMetadata = IDL.Record({
|
|
118
|
+
'url' : IDL.Opt(IDL.Text),
|
|
119
|
+
'logo' : IDL.Opt(IDL.Text),
|
|
120
|
+
'name' : IDL.Opt(IDL.Text),
|
|
121
|
+
'description' : IDL.Opt(IDL.Text),
|
|
122
|
+
});
|
|
116
123
|
const ExecuteGenericNervousSystemFunction = IDL.Record({
|
|
117
124
|
'function_id' : IDL.Nat64,
|
|
118
125
|
'payload' : IDL.Vec(IDL.Nat8),
|
|
@@ -125,6 +132,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
125
132
|
'UpgradeSnsToNextVersion' : IDL.Record({}),
|
|
126
133
|
'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,
|
|
127
134
|
'Unspecified' : IDL.Record({}),
|
|
135
|
+
'ManageSnsMetadata' : ManageSnsMetadata,
|
|
128
136
|
'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,
|
|
129
137
|
'Motion' : Motion,
|
|
130
138
|
});
|
|
@@ -228,12 +236,6 @@ export const idlFactory = ({ IDL }) => {
|
|
|
228
236
|
'command' : IDL.Opt(Command_2),
|
|
229
237
|
'timestamp' : IDL.Nat64,
|
|
230
238
|
});
|
|
231
|
-
const GetMetadataResponse = IDL.Record({
|
|
232
|
-
'url' : IDL.Opt(IDL.Text),
|
|
233
|
-
'logo' : IDL.Opt(IDL.Text),
|
|
234
|
-
'name' : IDL.Opt(IDL.Text),
|
|
235
|
-
'description' : IDL.Opt(IDL.Text),
|
|
236
|
-
});
|
|
237
239
|
const NeuronPermission = IDL.Record({
|
|
238
240
|
'principal' : IDL.Opt(IDL.Principal),
|
|
239
241
|
'permission_type' : IDL.Vec(IDL.Int32),
|
|
@@ -263,16 +265,23 @@ export const idlFactory = ({ IDL }) => {
|
|
|
263
265
|
'mode' : IDL.Int32,
|
|
264
266
|
'parameters' : IDL.Opt(NervousSystemParameters),
|
|
265
267
|
'deployed_version' : IDL.Opt(Version),
|
|
268
|
+
'sns_initialization_parameters' : IDL.Text,
|
|
266
269
|
'latest_reward_event' : IDL.Opt(RewardEvent),
|
|
267
270
|
'pending_version' : IDL.Opt(UpgradeInProgress),
|
|
268
271
|
'swap_canister_id' : IDL.Opt(IDL.Principal),
|
|
269
272
|
'ledger_canister_id' : IDL.Opt(IDL.Principal),
|
|
270
273
|
'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
|
|
271
274
|
'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),
|
|
272
|
-
'sns_metadata' : IDL.Opt(
|
|
275
|
+
'sns_metadata' : IDL.Opt(ManageSnsMetadata),
|
|
273
276
|
'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),
|
|
274
277
|
'genesis_timestamp_seconds' : IDL.Nat64,
|
|
275
278
|
});
|
|
279
|
+
const GetMetadataResponse = IDL.Record({
|
|
280
|
+
'url' : IDL.Opt(IDL.Text),
|
|
281
|
+
'logo' : IDL.Opt(IDL.Text),
|
|
282
|
+
'name' : IDL.Opt(IDL.Text),
|
|
283
|
+
'description' : IDL.Opt(IDL.Text),
|
|
284
|
+
});
|
|
276
285
|
const GetNeuron = IDL.Record({ 'neuron_id' : IDL.Opt(NeuronId) });
|
|
277
286
|
const Result = IDL.Variant({ 'Error' : GovernanceError, 'Neuron' : Neuron });
|
|
278
287
|
const GetNeuronResponse = IDL.Record({ 'result' : IDL.Opt(Result) });
|
|
@@ -309,6 +318,9 @@ export const idlFactory = ({ IDL }) => {
|
|
|
309
318
|
'deployed_version' : IDL.Opt(Version),
|
|
310
319
|
'pending_version' : IDL.Opt(UpgradeInProgress),
|
|
311
320
|
});
|
|
321
|
+
const GetSnsInitializationParametersResponse = IDL.Record({
|
|
322
|
+
'sns_initialization_parameters' : IDL.Text,
|
|
323
|
+
});
|
|
312
324
|
const ListNervousSystemFunctionsResponse = IDL.Record({
|
|
313
325
|
'reserved_ids' : IDL.Vec(IDL.Nat64),
|
|
314
326
|
'functions' : IDL.Vec(NervousSystemFunction),
|
|
@@ -399,6 +411,11 @@ export const idlFactory = ({ IDL }) => {
|
|
|
399
411
|
[GetRunningSnsVersionResponse],
|
|
400
412
|
['query'],
|
|
401
413
|
),
|
|
414
|
+
'get_sns_initialization_parameters' : IDL.Func(
|
|
415
|
+
[IDL.Record({})],
|
|
416
|
+
[GetSnsInitializationParametersResponse],
|
|
417
|
+
['query'],
|
|
418
|
+
),
|
|
402
419
|
'list_nervous_system_functions' : IDL.Func(
|
|
403
420
|
[],
|
|
404
421
|
[ListNervousSystemFunctionsResponse],
|
|
@@ -507,6 +524,7 @@ export const init = ({ IDL }) => {
|
|
|
507
524
|
const UpgradeInProgress = IDL.Record({
|
|
508
525
|
'mark_failed_at_seconds' : IDL.Nat64,
|
|
509
526
|
'checking_upgrade_lock' : IDL.Nat64,
|
|
527
|
+
'proposal_id' : IDL.Nat64,
|
|
510
528
|
'target_version' : IDL.Opt(Version),
|
|
511
529
|
});
|
|
512
530
|
const GovernanceError = IDL.Record({
|
|
@@ -528,6 +546,12 @@ export const init = ({ IDL }) => {
|
|
|
528
546
|
'new_canister_wasm' : IDL.Vec(IDL.Nat8),
|
|
529
547
|
'canister_id' : IDL.Opt(IDL.Principal),
|
|
530
548
|
});
|
|
549
|
+
const ManageSnsMetadata = IDL.Record({
|
|
550
|
+
'url' : IDL.Opt(IDL.Text),
|
|
551
|
+
'logo' : IDL.Opt(IDL.Text),
|
|
552
|
+
'name' : IDL.Opt(IDL.Text),
|
|
553
|
+
'description' : IDL.Opt(IDL.Text),
|
|
554
|
+
});
|
|
531
555
|
const ExecuteGenericNervousSystemFunction = IDL.Record({
|
|
532
556
|
'function_id' : IDL.Nat64,
|
|
533
557
|
'payload' : IDL.Vec(IDL.Nat8),
|
|
@@ -540,6 +564,7 @@ export const init = ({ IDL }) => {
|
|
|
540
564
|
'UpgradeSnsToNextVersion' : IDL.Record({}),
|
|
541
565
|
'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,
|
|
542
566
|
'Unspecified' : IDL.Record({}),
|
|
567
|
+
'ManageSnsMetadata' : ManageSnsMetadata,
|
|
543
568
|
'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,
|
|
544
569
|
'Motion' : Motion,
|
|
545
570
|
});
|
|
@@ -643,12 +668,6 @@ export const init = ({ IDL }) => {
|
|
|
643
668
|
'command' : IDL.Opt(Command_2),
|
|
644
669
|
'timestamp' : IDL.Nat64,
|
|
645
670
|
});
|
|
646
|
-
const GetMetadataResponse = IDL.Record({
|
|
647
|
-
'url' : IDL.Opt(IDL.Text),
|
|
648
|
-
'logo' : IDL.Opt(IDL.Text),
|
|
649
|
-
'name' : IDL.Opt(IDL.Text),
|
|
650
|
-
'description' : IDL.Opt(IDL.Text),
|
|
651
|
-
});
|
|
652
671
|
const NeuronPermission = IDL.Record({
|
|
653
672
|
'principal' : IDL.Opt(IDL.Principal),
|
|
654
673
|
'permission_type' : IDL.Vec(IDL.Int32),
|
|
@@ -678,13 +697,14 @@ export const init = ({ IDL }) => {
|
|
|
678
697
|
'mode' : IDL.Int32,
|
|
679
698
|
'parameters' : IDL.Opt(NervousSystemParameters),
|
|
680
699
|
'deployed_version' : IDL.Opt(Version),
|
|
700
|
+
'sns_initialization_parameters' : IDL.Text,
|
|
681
701
|
'latest_reward_event' : IDL.Opt(RewardEvent),
|
|
682
702
|
'pending_version' : IDL.Opt(UpgradeInProgress),
|
|
683
703
|
'swap_canister_id' : IDL.Opt(IDL.Principal),
|
|
684
704
|
'ledger_canister_id' : IDL.Opt(IDL.Principal),
|
|
685
705
|
'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
|
|
686
706
|
'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),
|
|
687
|
-
'sns_metadata' : IDL.Opt(
|
|
707
|
+
'sns_metadata' : IDL.Opt(ManageSnsMetadata),
|
|
688
708
|
'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),
|
|
689
709
|
'genesis_timestamp_seconds' : IDL.Nat64,
|
|
690
710
|
});
|