@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.
Files changed (64) hide show
  1. package/README.md +8 -8
  2. package/dist/candid/genesis_token.certified.idl.d.ts +1 -1
  3. package/dist/candid/genesis_token.certified.idl.js +41 -30
  4. package/dist/candid/genesis_token.d.ts +11 -3
  5. package/dist/candid/genesis_token.idl.d.ts +1 -1
  6. package/dist/candid/genesis_token.idl.js +41 -30
  7. package/dist/candid/governance.certified.idl.d.ts +1 -1
  8. package/dist/candid/governance.certified.idl.js +1272 -1304
  9. package/dist/candid/governance.d.ts +11 -3
  10. package/dist/candid/governance.idl.d.ts +1 -1
  11. package/dist/candid/governance.idl.js +1280 -1320
  12. package/dist/candid/governance_test.certified.idl.d.ts +1 -1
  13. package/dist/candid/governance_test.certified.idl.js +1273 -1305
  14. package/dist/candid/governance_test.d.ts +11 -3
  15. package/dist/candid/governance_test.idl.d.ts +1 -1
  16. package/dist/candid/governance_test.idl.js +1281 -1321
  17. package/dist/candid/old_list_neurons_service.certified.idl.js +60 -60
  18. package/dist/candid/sns_wasm.certified.idl.d.ts +1 -1
  19. package/dist/candid/sns_wasm.certified.idl.js +230 -224
  20. package/dist/candid/sns_wasm.d.ts +11 -3
  21. package/dist/candid/sns_wasm.idl.d.ts +1 -1
  22. package/dist/candid/sns_wasm.idl.js +230 -224
  23. package/dist/{types/canisters → canisters}/governance/request.converters.d.ts +2 -2
  24. package/dist/{types/canisters → canisters}/governance/response.converters.d.ts +2 -2
  25. package/dist/{types/canisters → canisters}/governance/services.d.ts +1 -1
  26. package/dist/{types/constants → constants}/canister_ids.d.ts +1 -1
  27. package/dist/{types/errors → errors}/governance.errors.d.ts +1 -1
  28. package/dist/{types/genesis_token.canister.d.ts → genesis_token.canister.d.ts} +1 -1
  29. package/dist/{types/governance.canister.d.ts → governance.canister.d.ts} +2 -2
  30. package/dist/{types/governance_test.canister.d.ts → governance_test.canister.d.ts} +2 -2
  31. package/dist/{types/index.d.ts → index.d.ts} +2 -2
  32. package/dist/index.js +8 -1
  33. package/dist/index.js.map +7 -0
  34. package/dist/index.mjs +10 -0
  35. package/dist/index.mjs.map +7 -0
  36. package/dist/{types/sns_wasm.canister.d.ts → sns_wasm.canister.d.ts} +1 -1
  37. package/dist/types/{types/governance.options.d.ts → governance.options.d.ts} +2 -2
  38. package/dist/types/{types/governance_converters.d.ts → governance_converters.d.ts} +2 -2
  39. package/dist/types/{types/sns_wasm.options.d.ts → sns_wasm.options.d.ts} +1 -1
  40. package/dist/{types/utils → utils}/account_identifier.utils.d.ts +1 -1
  41. package/dist/{types/utils → utils}/neurons.utils.d.ts +1 -1
  42. package/package.json +23 -12
  43. package/dist/cjs/index.cjs.js +0 -8
  44. package/dist/cjs/index.cjs.js.map +0 -7
  45. package/dist/esm/chunk-6RTK3IEW.js +0 -2
  46. package/dist/esm/chunk-6RTK3IEW.js.map +0 -7
  47. package/dist/esm/chunk-GJ7FSPCW.js +0 -2
  48. package/dist/esm/chunk-GJ7FSPCW.js.map +0 -7
  49. package/dist/esm/chunk-HK4WSMGK.js +0 -8
  50. package/dist/esm/chunk-HK4WSMGK.js.map +0 -7
  51. package/dist/esm/chunk-W6BBRGPQ.js +0 -2
  52. package/dist/esm/chunk-W6BBRGPQ.js.map +0 -7
  53. package/dist/esm/genesis_token.canister.js +0 -2
  54. package/dist/esm/genesis_token.canister.js.map +0 -7
  55. package/dist/esm/governance.canister.js +0 -2
  56. package/dist/esm/governance.canister.js.map +0 -7
  57. package/dist/esm/index.js +0 -2
  58. package/dist/esm/index.js.map +0 -7
  59. package/dist/esm/sns_wasm.canister.js +0 -2
  60. package/dist/esm/sns_wasm.canister.js.map +0 -7
  61. package/dist/index.cjs.js +0 -1
  62. /package/dist/{types/constants → constants}/constants.d.ts +0 -0
  63. /package/dist/{types/enums → enums}/governance.enums.d.ts +0 -0
  64. /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 @dfinity/agent @dfinity/candid @dfinity/principal @dfinity/utils
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 "@dfinity/principal";
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?: Principal or undefined; nonce?: bigint or undefined; }) => Promise<bigint>` |
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?: Principal or undefined; }) => Promise<bigint or undefined>` |
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 "@dfinity/candid";
1
+ import type { IDL } from "@icp-sdk/core/candid";
2
2
  export const idlFactory: IDL.InterfaceFactory;
@@ -1,38 +1,49 @@
1
- /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/nns/candid/genesis_token.did */
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({ 'id' : IDL.Nat64 });
4
- const Result = IDL.Variant({ 'Ok' : IDL.Vec(NeuronId), 'Err' : IDL.Text });
5
- const Result_1 = IDL.Variant({ 'Ok' : IDL.Null, 'Err' : IDL.Text });
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
- 'error' : IDL.Opt(IDL.Text),
8
- 'timestamp_seconds' : IDL.Nat64,
9
- 'neuron_id' : IDL.Opt(NeuronId),
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
- 'authenticated_principal_id' : IDL.Opt(IDL.Principal),
13
- 'successfully_transferred_neurons' : IDL.Vec(TransferredNeuron),
14
- 'is_whitelisted_for_forwarding' : IDL.Bool,
15
- 'has_donated' : IDL.Bool,
16
- 'failed_transferred_neurons' : IDL.Vec(TransferredNeuron),
17
- 'neuron_ids' : IDL.Vec(NeuronId),
18
- 'has_claimed' : IDL.Bool,
19
- 'has_forwarded' : IDL.Bool,
20
- 'icpts' : IDL.Nat32,
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({ 'Ok' : AccountState, 'Err' : IDL.Text });
29
+ const Result_2 = IDL.Variant({ Ok: AccountState, Err: IDL.Text });
30
+
23
31
  return IDL.Service({
24
- 'balance' : IDL.Func([IDL.Text], [IDL.Nat32], []),
25
- 'claim_neurons' : IDL.Func([IDL.Text], [Result], []),
26
- 'donate_account' : IDL.Func([IDL.Text], [Result_1], []),
27
- 'forward_whitelisted_unclaimed_accounts' : IDL.Func(
28
- [IDL.Null],
29
- [Result_1],
30
- [],
31
- ),
32
- 'get_account' : IDL.Func([IDL.Text], [Result_2], []),
33
- 'get_build_metadata' : IDL.Func([], [IDL.Text], []),
34
- 'len' : IDL.Func([], [IDL.Nat16], []),
35
- 'total' : IDL.Func([], [IDL.Nat32], []),
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
- export const init = ({ IDL }) => { return []; };
46
+
47
+ export const init = ({ IDL }) => {
48
+ return [];
49
+ };
@@ -1,6 +1,14 @@
1
- import type { ActorMethod } from "@dfinity/agent";
2
- import type { IDL } from "@dfinity/candid";
3
- import type { Principal } from "@dfinity/principal";
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 "@dfinity/candid";
1
+ import type { IDL } from "@icp-sdk/core/candid";
2
2
  export const idlFactory: IDL.InterfaceFactory;
@@ -1,38 +1,49 @@
1
- /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/nns/candid/genesis_token.did */
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({ 'id' : IDL.Nat64 });
4
- const Result = IDL.Variant({ 'Ok' : IDL.Vec(NeuronId), 'Err' : IDL.Text });
5
- const Result_1 = IDL.Variant({ 'Ok' : IDL.Null, 'Err' : IDL.Text });
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
- 'error' : IDL.Opt(IDL.Text),
8
- 'timestamp_seconds' : IDL.Nat64,
9
- 'neuron_id' : IDL.Opt(NeuronId),
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
- 'authenticated_principal_id' : IDL.Opt(IDL.Principal),
13
- 'successfully_transferred_neurons' : IDL.Vec(TransferredNeuron),
14
- 'is_whitelisted_for_forwarding' : IDL.Bool,
15
- 'has_donated' : IDL.Bool,
16
- 'failed_transferred_neurons' : IDL.Vec(TransferredNeuron),
17
- 'neuron_ids' : IDL.Vec(NeuronId),
18
- 'has_claimed' : IDL.Bool,
19
- 'has_forwarded' : IDL.Bool,
20
- 'icpts' : IDL.Nat32,
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({ 'Ok' : AccountState, 'Err' : IDL.Text });
29
+ const Result_2 = IDL.Variant({ Ok: AccountState, Err: IDL.Text });
30
+
23
31
  return IDL.Service({
24
- 'balance' : IDL.Func([IDL.Text], [IDL.Nat32], ['query']),
25
- 'claim_neurons' : IDL.Func([IDL.Text], [Result], []),
26
- 'donate_account' : IDL.Func([IDL.Text], [Result_1], []),
27
- 'forward_whitelisted_unclaimed_accounts' : IDL.Func(
28
- [IDL.Null],
29
- [Result_1],
30
- [],
31
- ),
32
- 'get_account' : IDL.Func([IDL.Text], [Result_2], ['query']),
33
- 'get_build_metadata' : IDL.Func([], [IDL.Text], ['query']),
34
- 'len' : IDL.Func([], [IDL.Nat16], ['query']),
35
- 'total' : IDL.Func([], [IDL.Nat32], ['query']),
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
- export const init = ({ IDL }) => { return []; };
46
+
47
+ export const init = ({ IDL }) => {
48
+ return [];
49
+ };
@@ -1,2 +1,2 @@
1
- import type { IDL } from "@dfinity/candid";
1
+ import type { IDL } from "@icp-sdk/core/candid";
2
2
  export const idlFactory: IDL.InterfaceFactory;