@dfinity/nns 0.2.2 → 0.3.0-nightly-2022-04-10

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 (55) hide show
  1. package/README.md +1 -6
  2. package/dist/candid/governanceTypes.d.ts +13 -9
  3. package/dist/cjs/index.cjs.js +36 -36
  4. package/dist/cjs/index.cjs.js.map +3 -3
  5. package/dist/esm/account_identifier.js +1 -1
  6. package/dist/esm/{chunk-2DZXLOEC.js → chunk-27LBXZJR.js} +3 -3
  7. package/dist/esm/{chunk-2DZXLOEC.js.map → chunk-27LBXZJR.js.map} +2 -2
  8. package/dist/esm/{chunk-HMU24NWJ.js → chunk-7AFR3LOO.js} +2 -2
  9. package/dist/esm/{chunk-HMU24NWJ.js.map → chunk-7AFR3LOO.js.map} +0 -0
  10. package/dist/esm/chunk-EXEYDII6.js +18 -0
  11. package/dist/esm/{chunk-FVDRR6PO.js.map → chunk-EXEYDII6.js.map} +3 -3
  12. package/dist/esm/chunk-F6ES4H7R.js +2 -0
  13. package/dist/esm/{chunk-QR4654XK.js.map → chunk-F6ES4H7R.js.map} +3 -3
  14. package/dist/esm/chunk-FY5QONEL.js +4 -0
  15. package/dist/esm/chunk-FY5QONEL.js.map +7 -0
  16. package/dist/esm/{chunk-D2W3ELRE.js → chunk-HQLGGFMH.js} +2 -2
  17. package/dist/esm/{chunk-D2W3ELRE.js.map → chunk-HQLGGFMH.js.map} +1 -1
  18. package/dist/esm/chunk-LSSEKDUC.js +3 -0
  19. package/dist/esm/chunk-LSSEKDUC.js.map +7 -0
  20. package/dist/esm/governance.js +1 -1
  21. package/dist/esm/icp.js +1 -1
  22. package/dist/esm/index.js +1 -1
  23. package/dist/esm/index.js.map +3 -3
  24. package/dist/esm/ledger.js +1 -1
  25. package/dist/proto/base_types_pb.js +217 -140
  26. package/dist/proto/ledger_pb.js +1571 -969
  27. package/dist/types/canisters/governance/payloads.d.ts +1 -1
  28. package/dist/types/canisters/governance/request.converters.d.ts +24 -26
  29. package/dist/types/canisters/governance/response.converters.d.ts +6 -35
  30. package/dist/types/canisters/governance/services.d.ts +9 -0
  31. package/dist/types/errors/governance.errors.d.ts +22 -0
  32. package/dist/types/errors/ledger.errors.d.ts +21 -0
  33. package/dist/types/governance.d.ts +95 -7
  34. package/dist/types/index.d.ts +4 -0
  35. package/dist/types/ledger.d.ts +9 -3
  36. package/dist/types/types/common.d.ts +4 -0
  37. package/dist/types/types/governance_converters.d.ts +1 -70
  38. package/dist/types/types/ledger.d.ts +3 -24
  39. package/dist/types/utils/converter.utils.d.ts +1 -6
  40. package/dist/types/utils/neurons.utils.d.ts +13 -0
  41. package/package.json +6 -4
  42. package/dist/candid/nns_dapp.certified.idl.js +0 -206
  43. package/dist/candid/nns_dapp.did +0 -240
  44. package/dist/candid/nns_dapp.idl.js +0 -206
  45. package/dist/esm/chunk-4FZAJTYF.js +0 -2
  46. package/dist/esm/chunk-4FZAJTYF.js.map +0 -7
  47. package/dist/esm/chunk-FVDRR6PO.js +0 -17
  48. package/dist/esm/chunk-LNMGZ6W7.js +0 -3
  49. package/dist/esm/chunk-LNMGZ6W7.js.map +0 -7
  50. package/dist/esm/chunk-QR4654XK.js +0 -2
  51. package/dist/esm/chunk-RUFBUR7C.js +0 -4
  52. package/dist/esm/chunk-RUFBUR7C.js.map +0 -7
  53. package/dist/esm/chunk-ZWZRSVU4.js +0 -2
  54. package/dist/esm/chunk-ZWZRSVU4.js.map +0 -7
  55. package/dist/types/types/option.d.ts +0 -1
package/README.md CHANGED
@@ -1,14 +1,9 @@
1
1
  # nns-js
2
2
 
3
- A library for interfacing with the Internet Computer's Network Nervous System.
3
+ A library for interfacing with the ledger and governance canisters of the Internet Computer's Network Nervous System.
4
4
 
5
5
  This library is still in active development, and new features will incrementally be available.
6
6
 
7
- - [x] Ledger Canister
8
- - [x] `accountBalance`
9
- - [x] `transfer`
10
- - [ ] Governance Canister (Coming soon)
11
-
12
7
  ## Example Usage
13
8
 
14
9
  ```ts
@@ -64,7 +64,7 @@ export type Command =
64
64
  | { MergeMaturity: MergeMaturity }
65
65
  | { Disburse: Disburse };
66
66
  export type Command_1 =
67
- | { Error: GovernanceError }
67
+ | { Error: GovernanceErrorDetail }
68
68
  | { Spawn: SpawnResponse }
69
69
  | { Split: SpawnResponse }
70
70
  | { Follow: {} }
@@ -148,7 +148,7 @@ export interface GovernanceCachedMetrics {
148
148
  community_fund_total_staked_e8s: bigint;
149
149
  timestamp_seconds: bigint;
150
150
  }
151
- export interface GovernanceError {
151
+ export interface GovernanceErrorDetail {
152
152
  error_message: string;
153
153
  error_type: number;
154
154
  }
@@ -288,7 +288,7 @@ export interface Proposal {
288
288
  }
289
289
  export interface ProposalData {
290
290
  id: [] | [NeuronId];
291
- failure_reason: [] | [GovernanceError];
291
+ failure_reason: [] | [GovernanceErrorDetail];
292
292
  ballots: Array<[bigint, Ballot]>;
293
293
  proposal_timestamp_seconds: bigint;
294
294
  reward_event_round: bigint;
@@ -305,7 +305,7 @@ export interface ProposalInfo {
305
305
  id: [] | [NeuronId];
306
306
  status: number;
307
307
  topic: number;
308
- failure_reason: [] | [GovernanceError];
308
+ failure_reason: [] | [GovernanceErrorDetail];
309
309
  ballots: Array<[bigint, Ballot]>;
310
310
  proposal_timestamp_seconds: bigint;
311
311
  reward_event_round: bigint;
@@ -326,11 +326,15 @@ export interface RegisterVote {
326
326
  export interface RemoveHotKey {
327
327
  hot_key_to_remove: [] | [Principal];
328
328
  }
329
- export type Result = { Ok: null } | { Err: GovernanceError };
330
- export type Result_1 = { Error: GovernanceError } | { NeuronId: NeuronId };
331
- export type Result_2 = { Ok: Neuron } | { Err: GovernanceError };
332
- export type Result_3 = { Ok: RewardNodeProviders } | { Err: GovernanceError };
333
- export type Result_4 = { Ok: NeuronInfo } | { Err: GovernanceError };
329
+ export type Result = { Ok: null } | { Err: GovernanceErrorDetail };
330
+ export type Result_1 =
331
+ | { Error: GovernanceErrorDetail }
332
+ | { NeuronId: NeuronId };
333
+ export type Result_2 = { Ok: Neuron } | { Err: GovernanceErrorDetail };
334
+ export type Result_3 =
335
+ | { Ok: RewardNodeProviders }
336
+ | { Err: GovernanceErrorDetail };
337
+ export type Result_4 = { Ok: NeuronInfo } | { Err: GovernanceErrorDetail };
334
338
  export interface RewardEvent {
335
339
  day_after_genesis: bigint;
336
340
  actual_timestamp_seconds: bigint;