@dfinity/nns 10.4.0 → 11.0.0-next-2025-10-20
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 +8 -8
- package/dist/candid/genesis_token.certified.idl.d.ts +1 -1
- package/dist/candid/genesis_token.certified.idl.js +41 -30
- package/dist/candid/genesis_token.d.ts +11 -3
- package/dist/candid/genesis_token.idl.d.ts +1 -1
- package/dist/candid/genesis_token.idl.js +41 -30
- package/dist/candid/governance.certified.idl.d.ts +1 -1
- package/dist/candid/governance.certified.idl.js +1272 -1304
- package/dist/candid/governance.d.ts +11 -3
- package/dist/candid/governance.idl.d.ts +1 -1
- package/dist/candid/governance.idl.js +1280 -1320
- package/dist/candid/governance_test.certified.idl.d.ts +1 -1
- package/dist/candid/governance_test.certified.idl.js +1273 -1305
- package/dist/candid/governance_test.d.ts +11 -3
- package/dist/candid/governance_test.idl.d.ts +1 -1
- package/dist/candid/governance_test.idl.js +1281 -1321
- package/dist/candid/old_list_neurons_service.certified.idl.js +60 -60
- package/dist/candid/sns_wasm.certified.idl.d.ts +1 -1
- package/dist/candid/sns_wasm.certified.idl.js +230 -224
- package/dist/candid/sns_wasm.d.ts +11 -3
- package/dist/candid/sns_wasm.idl.d.ts +1 -1
- package/dist/candid/sns_wasm.idl.js +230 -224
- package/dist/{types/canisters → canisters}/governance/request.converters.d.ts +2 -2
- package/dist/{types/canisters → canisters}/governance/response.converters.d.ts +2 -2
- package/dist/{types/canisters → canisters}/governance/services.d.ts +1 -1
- package/dist/{types/constants → constants}/canister_ids.d.ts +1 -1
- package/dist/{types/errors → errors}/governance.errors.d.ts +1 -1
- package/dist/{types/genesis_token.canister.d.ts → genesis_token.canister.d.ts} +1 -1
- package/dist/{types/governance.canister.d.ts → governance.canister.d.ts} +2 -2
- package/dist/{types/governance_test.canister.d.ts → governance_test.canister.d.ts} +2 -2
- package/dist/{types/index.d.ts → index.d.ts} +2 -2
- package/dist/index.js +8 -1
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +7 -0
- package/dist/{types/sns_wasm.canister.d.ts → sns_wasm.canister.d.ts} +1 -1
- package/dist/types/{types/governance.options.d.ts → governance.options.d.ts} +2 -2
- package/dist/types/{types/governance_converters.d.ts → governance_converters.d.ts} +2 -2
- package/dist/types/{types/sns_wasm.options.d.ts → sns_wasm.options.d.ts} +1 -1
- package/dist/{types/utils → utils}/account_identifier.utils.d.ts +1 -1
- package/dist/{types/utils → utils}/neurons.utils.d.ts +1 -1
- package/package.json +23 -12
- package/dist/cjs/index.cjs.js +0 -8
- package/dist/cjs/index.cjs.js.map +0 -7
- package/dist/esm/chunk-6RTK3IEW.js +0 -2
- package/dist/esm/chunk-6RTK3IEW.js.map +0 -7
- package/dist/esm/chunk-GJ7FSPCW.js +0 -2
- package/dist/esm/chunk-GJ7FSPCW.js.map +0 -7
- package/dist/esm/chunk-HK4WSMGK.js +0 -8
- package/dist/esm/chunk-HK4WSMGK.js.map +0 -7
- package/dist/esm/chunk-W6BBRGPQ.js +0 -2
- package/dist/esm/chunk-W6BBRGPQ.js.map +0 -7
- package/dist/esm/genesis_token.canister.js +0 -2
- package/dist/esm/genesis_token.canister.js.map +0 -7
- package/dist/esm/governance.canister.js +0 -2
- package/dist/esm/governance.canister.js.map +0 -7
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/sns_wasm.canister.js +0 -2
- package/dist/esm/sns_wasm.canister.js.map +0 -7
- package/dist/index.cjs.js +0 -1
- /package/dist/{types/constants → constants}/constants.d.ts +0 -0
- /package/dist/{types/enums → enums}/governance.enums.d.ts +0 -0
- /package/dist/types/{types/common.d.ts → common.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ npm i @dfinity/nns
|
|
|
21
21
|
The bundle needs peer dependencies, be sure that following resources are available in your project as well.
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
npm i @
|
|
24
|
+
npm i @icp-sdk/core @dfinity/utils
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## Usage
|
|
@@ -49,7 +49,7 @@ To execute this on a local environment, you will need to fetch the root key when
|
|
|
49
49
|
|
|
50
50
|
```typescript
|
|
51
51
|
import { GovernanceCanister } from "@dfinity/nns";
|
|
52
|
-
import { Principal } from "@
|
|
52
|
+
import { Principal } from "@icp-sdk/core/principal";
|
|
53
53
|
import { createAgent } from "@dfinity/utils";
|
|
54
54
|
|
|
55
55
|
const agent = await createAgent({
|
|
@@ -531,9 +531,9 @@ Parameters:
|
|
|
531
531
|
|
|
532
532
|
Merge Maturity of a neuron
|
|
533
533
|
|
|
534
|
-
| Method | Type
|
|
535
|
-
| ------------- |
|
|
536
|
-
| `spawnNeuron` | `({ neuronId, percentageToSpawn, newController, nonce, }: { neuronId: bigint; percentageToSpawn?: number or undefined; newController?:
|
|
534
|
+
| Method | Type |
|
|
535
|
+
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
536
|
+
| `spawnNeuron` | `({ neuronId, percentageToSpawn, newController, nonce, }: { neuronId: bigint; percentageToSpawn?: number or undefined; newController?: any; nonce?: bigint or undefined; }) => Promise<bigint>` |
|
|
537
537
|
|
|
538
538
|
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L867)
|
|
539
539
|
|
|
@@ -561,9 +561,9 @@ Remove hotkey to neuron
|
|
|
561
561
|
|
|
562
562
|
Gets the NeuronID of a newly created neuron.
|
|
563
563
|
|
|
564
|
-
| Method | Type
|
|
565
|
-
| --------------------------------- |
|
|
566
|
-
| `claimOrRefreshNeuronFromAccount` | `({ memo, controller, }: { memo: bigint; controller?:
|
|
564
|
+
| Method | Type |
|
|
565
|
+
| --------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
566
|
+
| `claimOrRefreshNeuronFromAccount` | `({ memo, controller, }: { memo: bigint; controller?: any; }) => Promise<bigint or undefined>` |
|
|
567
567
|
|
|
568
568
|
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L952)
|
|
569
569
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { IDL } from "@
|
|
1
|
+
import type { IDL } from "@icp-sdk/core/candid";
|
|
2
2
|
export const idlFactory: IDL.InterfaceFactory;
|
|
@@ -1,38 +1,49 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.
|
|
6
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
7
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
8
|
+
|
|
2
9
|
export const idlFactory = ({ IDL }) => {
|
|
3
|
-
const NeuronId = IDL.Record({
|
|
4
|
-
const Result = IDL.Variant({
|
|
5
|
-
const Result_1 = IDL.Variant({
|
|
10
|
+
const NeuronId = IDL.Record({ id: IDL.Nat64 });
|
|
11
|
+
const Result = IDL.Variant({ Ok: IDL.Vec(NeuronId), Err: IDL.Text });
|
|
12
|
+
const Result_1 = IDL.Variant({ Ok: IDL.Null, Err: IDL.Text });
|
|
6
13
|
const TransferredNeuron = IDL.Record({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
error: IDL.Opt(IDL.Text),
|
|
15
|
+
timestamp_seconds: IDL.Nat64,
|
|
16
|
+
neuron_id: IDL.Opt(NeuronId),
|
|
10
17
|
});
|
|
11
18
|
const AccountState = IDL.Record({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
authenticated_principal_id: IDL.Opt(IDL.Principal),
|
|
20
|
+
successfully_transferred_neurons: IDL.Vec(TransferredNeuron),
|
|
21
|
+
is_whitelisted_for_forwarding: IDL.Bool,
|
|
22
|
+
has_donated: IDL.Bool,
|
|
23
|
+
failed_transferred_neurons: IDL.Vec(TransferredNeuron),
|
|
24
|
+
neuron_ids: IDL.Vec(NeuronId),
|
|
25
|
+
has_claimed: IDL.Bool,
|
|
26
|
+
has_forwarded: IDL.Bool,
|
|
27
|
+
icpts: IDL.Nat32,
|
|
21
28
|
});
|
|
22
|
-
const Result_2 = IDL.Variant({
|
|
29
|
+
const Result_2 = IDL.Variant({ Ok: AccountState, Err: IDL.Text });
|
|
30
|
+
|
|
23
31
|
return IDL.Service({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
balance: IDL.Func([IDL.Text], [IDL.Nat32], []),
|
|
33
|
+
claim_neurons: IDL.Func([IDL.Text], [Result], []),
|
|
34
|
+
donate_account: IDL.Func([IDL.Text], [Result_1], []),
|
|
35
|
+
forward_whitelisted_unclaimed_accounts: IDL.Func(
|
|
36
|
+
[IDL.Null],
|
|
37
|
+
[Result_1],
|
|
38
|
+
[],
|
|
39
|
+
),
|
|
40
|
+
get_account: IDL.Func([IDL.Text], [Result_2], []),
|
|
41
|
+
get_build_metadata: IDL.Func([], [IDL.Text], []),
|
|
42
|
+
len: IDL.Func([], [IDL.Nat16], []),
|
|
43
|
+
total: IDL.Func([], [IDL.Nat32], []),
|
|
36
44
|
});
|
|
37
45
|
};
|
|
38
|
-
|
|
46
|
+
|
|
47
|
+
export const init = ({ IDL }) => {
|
|
48
|
+
return [];
|
|
49
|
+
};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.
|
|
6
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
7
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
8
|
+
|
|
9
|
+
import type { ActorMethod } from "@icp-sdk/core/agent";
|
|
10
|
+
import type { IDL } from "@icp-sdk/core/candid";
|
|
11
|
+
import type { Principal } from "@icp-sdk/core/principal";
|
|
4
12
|
|
|
5
13
|
export interface AccountState {
|
|
6
14
|
authenticated_principal_id: [] | [Principal];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { IDL } from "@
|
|
1
|
+
import type { IDL } from "@icp-sdk/core/candid";
|
|
2
2
|
export const idlFactory: IDL.InterfaceFactory;
|
|
@@ -1,38 +1,49 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.
|
|
6
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
7
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
8
|
+
|
|
2
9
|
export const idlFactory = ({ IDL }) => {
|
|
3
|
-
const NeuronId = IDL.Record({
|
|
4
|
-
const Result = IDL.Variant({
|
|
5
|
-
const Result_1 = IDL.Variant({
|
|
10
|
+
const NeuronId = IDL.Record({ id: IDL.Nat64 });
|
|
11
|
+
const Result = IDL.Variant({ Ok: IDL.Vec(NeuronId), Err: IDL.Text });
|
|
12
|
+
const Result_1 = IDL.Variant({ Ok: IDL.Null, Err: IDL.Text });
|
|
6
13
|
const TransferredNeuron = IDL.Record({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
error: IDL.Opt(IDL.Text),
|
|
15
|
+
timestamp_seconds: IDL.Nat64,
|
|
16
|
+
neuron_id: IDL.Opt(NeuronId),
|
|
10
17
|
});
|
|
11
18
|
const AccountState = IDL.Record({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
authenticated_principal_id: IDL.Opt(IDL.Principal),
|
|
20
|
+
successfully_transferred_neurons: IDL.Vec(TransferredNeuron),
|
|
21
|
+
is_whitelisted_for_forwarding: IDL.Bool,
|
|
22
|
+
has_donated: IDL.Bool,
|
|
23
|
+
failed_transferred_neurons: IDL.Vec(TransferredNeuron),
|
|
24
|
+
neuron_ids: IDL.Vec(NeuronId),
|
|
25
|
+
has_claimed: IDL.Bool,
|
|
26
|
+
has_forwarded: IDL.Bool,
|
|
27
|
+
icpts: IDL.Nat32,
|
|
21
28
|
});
|
|
22
|
-
const Result_2 = IDL.Variant({
|
|
29
|
+
const Result_2 = IDL.Variant({ Ok: AccountState, Err: IDL.Text });
|
|
30
|
+
|
|
23
31
|
return IDL.Service({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
balance: IDL.Func([IDL.Text], [IDL.Nat32], ["query"]),
|
|
33
|
+
claim_neurons: IDL.Func([IDL.Text], [Result], []),
|
|
34
|
+
donate_account: IDL.Func([IDL.Text], [Result_1], []),
|
|
35
|
+
forward_whitelisted_unclaimed_accounts: IDL.Func(
|
|
36
|
+
[IDL.Null],
|
|
37
|
+
[Result_1],
|
|
38
|
+
[],
|
|
39
|
+
),
|
|
40
|
+
get_account: IDL.Func([IDL.Text], [Result_2], ["query"]),
|
|
41
|
+
get_build_metadata: IDL.Func([], [IDL.Text], ["query"]),
|
|
42
|
+
len: IDL.Func([], [IDL.Nat16], ["query"]),
|
|
43
|
+
total: IDL.Func([], [IDL.Nat32], ["query"]),
|
|
36
44
|
});
|
|
37
45
|
};
|
|
38
|
-
|
|
46
|
+
|
|
47
|
+
export const init = ({ IDL }) => {
|
|
48
|
+
return [];
|
|
49
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { IDL } from "@
|
|
1
|
+
import type { IDL } from "@icp-sdk/core/candid";
|
|
2
2
|
export const idlFactory: IDL.InterfaceFactory;
|