@dfinity/nns 1.0.0 → 2.0.0
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 +32 -261
- package/dist/cjs/index.cjs.js +2 -8
- package/dist/cjs/index.cjs.js.map +4 -4
- package/dist/esm/{chunk-OFXRZRFU.js → chunk-IJWQXUQ5.js} +2 -2
- package/dist/esm/chunk-KCY3PAEP.js +2 -0
- package/dist/esm/chunk-KCY3PAEP.js.map +7 -0
- package/dist/esm/chunk-LARRGLCK.js +20 -0
- package/dist/esm/chunk-LARRGLCK.js.map +7 -0
- package/dist/esm/{chunk-QJA26RTP.js → chunk-YKKQOXDQ.js} +2 -2
- package/dist/esm/genesis_token.canister.js +1 -1
- package/dist/esm/governance.canister.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/sns_wasm.canister.js +1 -1
- package/dist/types/canisters/governance/request.converters.d.ts +1 -1
- package/dist/types/constants/canister_ids.d.ts +0 -1
- package/dist/types/constants/constants.d.ts +0 -4
- package/dist/types/errors/governance.errors.d.ts +0 -2
- package/dist/types/governance.canister.d.ts +1 -1
- package/dist/types/index.d.ts +0 -7
- package/dist/types/types/common.d.ts +0 -1
- package/package.json +2 -1
- package/dist/candid/ledger.certified.idl.d.ts +0 -2
- package/dist/candid/ledger.certified.idl.js +0 -245
- package/dist/candid/ledger.d.ts +0 -215
- package/dist/candid/ledger.did +0 -380
- package/dist/candid/ledger.idl.d.ts +0 -2
- package/dist/candid/ledger.idl.js +0 -265
- package/dist/esm/account_identifier.js +0 -2
- package/dist/esm/account_identifier.js.map +0 -7
- package/dist/esm/chunk-2MZ7K2GY.js +0 -4
- package/dist/esm/chunk-2MZ7K2GY.js.map +0 -7
- package/dist/esm/chunk-DGJWOAUC.js +0 -2
- package/dist/esm/chunk-DGJWOAUC.js.map +0 -7
- package/dist/esm/chunk-H5FXE6EH.js +0 -8
- package/dist/esm/chunk-H5FXE6EH.js.map +0 -7
- package/dist/esm/chunk-IS3C7V4B.js +0 -2
- package/dist/esm/chunk-IS3C7V4B.js.map +0 -7
- package/dist/esm/chunk-JCUF5KWH.js +0 -2
- package/dist/esm/chunk-JCUF5KWH.js.map +0 -7
- package/dist/esm/chunk-TETJJ4EX.js +0 -20
- package/dist/esm/chunk-TETJJ4EX.js.map +0 -7
- package/dist/esm/chunk-WDXBCCBB.js +0 -2
- package/dist/esm/chunk-WDXBCCBB.js.map +0 -7
- package/dist/esm/chunk-ZMUQLPST.js +0 -2
- package/dist/esm/chunk-ZMUQLPST.js.map +0 -7
- package/dist/esm/icp.js +0 -2
- package/dist/esm/icp.js.map +0 -7
- package/dist/esm/ledger.canister.js +0 -2
- package/dist/esm/ledger.canister.js.map +0 -7
- package/dist/types/account_identifier.d.ts +0 -29
- package/dist/types/canisters/ledger/ledger.request.converts.d.ts +0 -7
- package/dist/types/errors/ledger.errors.d.ts +0 -27
- package/dist/types/icp.d.ts +0 -22
- package/dist/types/ledger.canister.d.ts +0 -48
- package/dist/types/types/ledger.options.d.ts +0 -15
- package/dist/types/types/ledger_converters.d.ts +0 -19
- package/dist/types/utils/account_identifier.utils.d.ts +0 -5
- package/dist/types/utils/accounts.utils.d.ts +0 -6
- /package/dist/esm/{chunk-OFXRZRFU.js.map → chunk-IJWQXUQ5.js.map} +0 -0
- /package/dist/esm/{chunk-QJA26RTP.js.map → chunk-YKKQOXDQ.js.map} +0 -0
package/README.md
CHANGED
|
@@ -119,119 +119,6 @@ Parameters:
|
|
|
119
119
|
|
|
120
120
|
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L94)
|
|
121
121
|
|
|
122
|
-
### :factory: AccountIdentifier
|
|
123
|
-
|
|
124
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/account_identifier.ts#L13)
|
|
125
|
-
|
|
126
|
-
#### Methods
|
|
127
|
-
|
|
128
|
-
- [fromHex](#gear-fromhex)
|
|
129
|
-
- [fromPrincipal](#gear-fromprincipal)
|
|
130
|
-
- [toProto](#gear-toproto)
|
|
131
|
-
- [toHex](#gear-tohex)
|
|
132
|
-
- [toUint8Array](#gear-touint8array)
|
|
133
|
-
- [toNumbers](#gear-tonumbers)
|
|
134
|
-
- [toAccountIdentifierHash](#gear-toaccountidentifierhash)
|
|
135
|
-
|
|
136
|
-
##### :gear: fromHex
|
|
137
|
-
|
|
138
|
-
| Method | Type |
|
|
139
|
-
| --------- | ------------------------------------ |
|
|
140
|
-
| `fromHex` | `(hex: string) => AccountIdentifier` |
|
|
141
|
-
|
|
142
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/account_identifier.ts#L16)
|
|
143
|
-
|
|
144
|
-
##### :gear: fromPrincipal
|
|
145
|
-
|
|
146
|
-
| Method | Type |
|
|
147
|
-
| --------------- | ------------------------------------------------------------------------------------------------------- |
|
|
148
|
-
| `fromPrincipal` | `({ principal, subAccount, }: { principal: Principal; subAccount?: SubAccount; }) => AccountIdentifier` |
|
|
149
|
-
|
|
150
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/account_identifier.ts#L20)
|
|
151
|
-
|
|
152
|
-
##### :gear: toProto
|
|
153
|
-
|
|
154
|
-
| Method | Type |
|
|
155
|
-
| --------- | ---------------------------------- |
|
|
156
|
-
| `toProto` | `() => Promise<AccountIdentifier>` |
|
|
157
|
-
|
|
158
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/account_identifier.ts#L49)
|
|
159
|
-
|
|
160
|
-
##### :gear: toHex
|
|
161
|
-
|
|
162
|
-
| Method | Type |
|
|
163
|
-
| ------- | -------------- |
|
|
164
|
-
| `toHex` | `() => string` |
|
|
165
|
-
|
|
166
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/account_identifier.ts#L57)
|
|
167
|
-
|
|
168
|
-
##### :gear: toUint8Array
|
|
169
|
-
|
|
170
|
-
| Method | Type |
|
|
171
|
-
| -------------- | ------------------ |
|
|
172
|
-
| `toUint8Array` | `() => Uint8Array` |
|
|
173
|
-
|
|
174
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/account_identifier.ts#L61)
|
|
175
|
-
|
|
176
|
-
##### :gear: toNumbers
|
|
177
|
-
|
|
178
|
-
| Method | Type |
|
|
179
|
-
| ----------- | ---------------- |
|
|
180
|
-
| `toNumbers` | `() => number[]` |
|
|
181
|
-
|
|
182
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/account_identifier.ts#L65)
|
|
183
|
-
|
|
184
|
-
##### :gear: toAccountIdentifierHash
|
|
185
|
-
|
|
186
|
-
| Method | Type |
|
|
187
|
-
| ------------------------- | ------------------------- |
|
|
188
|
-
| `toAccountIdentifierHash` | `() => AccountIdentifier` |
|
|
189
|
-
|
|
190
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/account_identifier.ts#L69)
|
|
191
|
-
|
|
192
|
-
### :factory: SubAccount
|
|
193
|
-
|
|
194
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/account_identifier.ts#L76)
|
|
195
|
-
|
|
196
|
-
#### Methods
|
|
197
|
-
|
|
198
|
-
- [fromBytes](#gear-frombytes)
|
|
199
|
-
- [fromPrincipal](#gear-fromprincipal)
|
|
200
|
-
- [fromID](#gear-fromid)
|
|
201
|
-
- [toUint8Array](#gear-touint8array)
|
|
202
|
-
|
|
203
|
-
##### :gear: fromBytes
|
|
204
|
-
|
|
205
|
-
| Method | Type |
|
|
206
|
-
| ----------- | -------------------------------------------- |
|
|
207
|
-
| `fromBytes` | `(bytes: Uint8Array) => SubAccount or Error` |
|
|
208
|
-
|
|
209
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/account_identifier.ts#L79)
|
|
210
|
-
|
|
211
|
-
##### :gear: fromPrincipal
|
|
212
|
-
|
|
213
|
-
| Method | Type |
|
|
214
|
-
| --------------- | -------------------------------------- |
|
|
215
|
-
| `fromPrincipal` | `(principal: Principal) => SubAccount` |
|
|
216
|
-
|
|
217
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/account_identifier.ts#L87)
|
|
218
|
-
|
|
219
|
-
##### :gear: fromID
|
|
220
|
-
|
|
221
|
-
| Method | Type |
|
|
222
|
-
| -------- | ---------------------------- |
|
|
223
|
-
| `fromID` | `(id: number) => SubAccount` |
|
|
224
|
-
|
|
225
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/account_identifier.ts#L100)
|
|
226
|
-
|
|
227
|
-
##### :gear: toUint8Array
|
|
228
|
-
|
|
229
|
-
| Method | Type |
|
|
230
|
-
| -------------- | ------------------ |
|
|
231
|
-
| `toUint8Array` | `() => Uint8Array` |
|
|
232
|
-
|
|
233
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/account_identifier.ts#L112)
|
|
234
|
-
|
|
235
122
|
### :factory: GenesisTokenCanister
|
|
236
123
|
|
|
237
124
|
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/genesis_token.canister.ts#L9)
|
|
@@ -257,74 +144,9 @@ Parameters:
|
|
|
257
144
|
|
|
258
145
|
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/genesis_token.canister.ts#L27)
|
|
259
146
|
|
|
260
|
-
### :factory: LedgerCanister
|
|
261
|
-
|
|
262
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/ledger.canister.ts#L32)
|
|
263
|
-
|
|
264
|
-
#### Methods
|
|
265
|
-
|
|
266
|
-
- [create](#gear-create)
|
|
267
|
-
- [accountBalance](#gear-accountbalance)
|
|
268
|
-
- [transactionFee](#gear-transactionfee)
|
|
269
|
-
- [transfer](#gear-transfer)
|
|
270
|
-
- [icrc1Transfer](#gear-icrc1transfer)
|
|
271
|
-
|
|
272
|
-
##### :gear: create
|
|
273
|
-
|
|
274
|
-
| Method | Type |
|
|
275
|
-
| -------- | ----------------------------------------------------- |
|
|
276
|
-
| `create` | `(options?: LedgerCanisterOptions) => LedgerCanister` |
|
|
277
|
-
|
|
278
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/ledger.canister.ts#L43)
|
|
279
|
-
|
|
280
|
-
##### :gear: accountBalance
|
|
281
|
-
|
|
282
|
-
Returns the balance of the specified account identifier.
|
|
283
|
-
|
|
284
|
-
If `certified` is true, the request is fetched as an update call, otherwise
|
|
285
|
-
it is fetched using a query call.
|
|
286
|
-
|
|
287
|
-
| Method | Type |
|
|
288
|
-
| ---------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
289
|
-
| `accountBalance` | `({ accountIdentifier, certified, }: { accountIdentifier: AccountIdentifier; certified?: boolean; }) => Promise<bigint>` |
|
|
290
|
-
|
|
291
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/ledger.canister.ts#L75)
|
|
292
|
-
|
|
293
|
-
##### :gear: transactionFee
|
|
294
|
-
|
|
295
|
-
Returns the transaction fee of the ledger canister
|
|
296
|
-
|
|
297
|
-
| Method | Type |
|
|
298
|
-
| ---------------- | ----------------------- |
|
|
299
|
-
| `transactionFee` | `() => Promise<bigint>` |
|
|
300
|
-
|
|
301
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/ledger.canister.ts#L99)
|
|
302
|
-
|
|
303
|
-
##### :gear: transfer
|
|
304
|
-
|
|
305
|
-
Transfer ICP from the caller to the destination `accountIdentifier`.
|
|
306
|
-
Returns the index of the block containing the tx if it was successful.
|
|
307
|
-
|
|
308
|
-
| Method | Type |
|
|
309
|
-
| ---------- | ----------------------------------------------- |
|
|
310
|
-
| `transfer` | `(request: TransferRequest) => Promise<bigint>` |
|
|
311
|
-
|
|
312
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/ledger.canister.ts#L112)
|
|
313
|
-
|
|
314
|
-
##### :gear: icrc1Transfer
|
|
315
|
-
|
|
316
|
-
Transfer ICP from the caller to the destination `Account`.
|
|
317
|
-
Returns the index of the block containing the tx if it was successful.
|
|
318
|
-
|
|
319
|
-
| Method | Type |
|
|
320
|
-
| --------------- | ---------------------------------------------------- |
|
|
321
|
-
| `icrc1Transfer` | `(request: Icrc1TransferRequest) => Promise<bigint>` |
|
|
322
|
-
|
|
323
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/ledger.canister.ts#L142)
|
|
324
|
-
|
|
325
147
|
### :factory: GovernanceCanister
|
|
326
148
|
|
|
327
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
149
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L110)
|
|
328
150
|
|
|
329
151
|
#### Methods
|
|
330
152
|
|
|
@@ -366,7 +188,7 @@ Returns the index of the block containing the tx if it was successful.
|
|
|
366
188
|
| -------- | ------------------------------------------------------------- |
|
|
367
189
|
| `create` | `(options?: GovernanceCanisterOptions) => GovernanceCanister` |
|
|
368
190
|
|
|
369
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
191
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L125)
|
|
370
192
|
|
|
371
193
|
##### :gear: listNeurons
|
|
372
194
|
|
|
@@ -381,7 +203,7 @@ it is fetched using a query call.
|
|
|
381
203
|
| ------------- | ----------------------------------------------------------------------------------------------------- |
|
|
382
204
|
| `listNeurons` | `({ certified, neuronIds, }: { certified: boolean; neuronIds?: bigint[]; }) => Promise<NeuronInfo[]>` |
|
|
383
205
|
|
|
384
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
206
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L157)
|
|
385
207
|
|
|
386
208
|
##### :gear: listKnownNeurons
|
|
387
209
|
|
|
@@ -395,7 +217,7 @@ it is fetched using a query call.
|
|
|
395
217
|
| ------------------ | ------------------------------------------------- |
|
|
396
218
|
| `listKnownNeurons` | `(certified?: boolean) => Promise<KnownNeuron[]>` |
|
|
397
219
|
|
|
398
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
220
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L188)
|
|
399
221
|
|
|
400
222
|
##### :gear: getLastestRewardEvent
|
|
401
223
|
|
|
@@ -408,7 +230,7 @@ it's fetched using a query call.
|
|
|
408
230
|
| ----------------------- | ----------------------------------------------- |
|
|
409
231
|
| `getLastestRewardEvent` | `(certified?: boolean) => Promise<RewardEvent>` |
|
|
410
232
|
|
|
411
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
233
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L210)
|
|
412
234
|
|
|
413
235
|
##### :gear: listProposals
|
|
414
236
|
|
|
@@ -427,7 +249,7 @@ Parameters:
|
|
|
427
249
|
- `request`: the options to list the proposals (limit number of results, topics to search for, etc.)
|
|
428
250
|
- `certified`: query or update calls
|
|
429
251
|
|
|
430
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
252
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L226)
|
|
431
253
|
|
|
432
254
|
##### :gear: stakeNeuron
|
|
433
255
|
|
|
@@ -435,7 +257,7 @@ Parameters:
|
|
|
435
257
|
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
436
258
|
| `stakeNeuron` | `({ stake, principal, fromSubAccount, ledgerCanister, createdAt, fee, }: { stake: bigint; principal: Principal; fromSubAccount?: number[]; ledgerCanister: LedgerCanister; createdAt?: bigint; fee?: bigint; }) => Promise<bigint>` |
|
|
437
259
|
|
|
438
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
260
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L245)
|
|
439
261
|
|
|
440
262
|
##### :gear: stakeNeuronIcrc1
|
|
441
263
|
|
|
@@ -443,7 +265,7 @@ Parameters:
|
|
|
443
265
|
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
444
266
|
| `stakeNeuronIcrc1` | `({ stake, principal, fromSubAccount, ledgerCanister, createdAt, fee, }: { stake: bigint; principal: Principal; fromSubAccount?: Uint8Array; ledgerCanister: LedgerCanister; createdAt?: bigint; fee?: bigint; }) => Promise<...>` |
|
|
445
267
|
|
|
446
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
268
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L311)
|
|
447
269
|
|
|
448
270
|
##### :gear: increaseDissolveDelay
|
|
449
271
|
|
|
@@ -453,7 +275,7 @@ Increases dissolve delay of a neuron
|
|
|
453
275
|
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
454
276
|
| `increaseDissolveDelay` | `({ neuronId, additionalDissolveDelaySeconds, }: { neuronId: bigint; additionalDissolveDelaySeconds: number; }) => Promise<void>` |
|
|
455
277
|
|
|
456
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
278
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L376)
|
|
457
279
|
|
|
458
280
|
##### :gear: setDissolveDelay
|
|
459
281
|
|
|
@@ -464,7 +286,7 @@ The new date is now + dissolveDelaySeconds.
|
|
|
464
286
|
| ------------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
465
287
|
| `setDissolveDelay` | `({ neuronId, dissolveDelaySeconds, }: { neuronId: bigint; dissolveDelaySeconds: number; }) => Promise<void>` |
|
|
466
288
|
|
|
467
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
289
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L408)
|
|
468
290
|
|
|
469
291
|
##### :gear: startDissolving
|
|
470
292
|
|
|
@@ -474,7 +296,7 @@ Start dissolving process of a neuron
|
|
|
474
296
|
| ----------------- | ------------------------------------- |
|
|
475
297
|
| `startDissolving` | `(neuronId: bigint) => Promise<void>` |
|
|
476
298
|
|
|
477
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
299
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L431)
|
|
478
300
|
|
|
479
301
|
##### :gear: stopDissolving
|
|
480
302
|
|
|
@@ -484,7 +306,7 @@ Stop dissolving process of a neuron
|
|
|
484
306
|
| ---------------- | ------------------------------------- |
|
|
485
307
|
| `stopDissolving` | `(neuronId: bigint) => Promise<void>` |
|
|
486
308
|
|
|
487
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
309
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L448)
|
|
488
310
|
|
|
489
311
|
##### :gear: joinCommunityFund
|
|
490
312
|
|
|
@@ -494,7 +316,7 @@ Neuron joins the community fund
|
|
|
494
316
|
| ------------------- | ------------------------------------- |
|
|
495
317
|
| `joinCommunityFund` | `(neuronId: bigint) => Promise<void>` |
|
|
496
318
|
|
|
497
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
319
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L465)
|
|
498
320
|
|
|
499
321
|
##### :gear: autoStakeMaturity
|
|
500
322
|
|
|
@@ -509,7 +331,7 @@ Parameters:
|
|
|
509
331
|
- `neuronId`: The id of the neuron for which to request a change of the auto stake feature
|
|
510
332
|
- `autoStake`: `true` to enable the auto-stake maturity for this neuron, `false` to turn it off
|
|
511
333
|
|
|
512
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
334
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L487)
|
|
513
335
|
|
|
514
336
|
##### :gear: leaveCommunityFund
|
|
515
337
|
|
|
@@ -519,7 +341,7 @@ Neuron leaves the community fund
|
|
|
519
341
|
| -------------------- | ------------------------------------- |
|
|
520
342
|
| `leaveCommunityFund` | `(neuronId: bigint) => Promise<void>` |
|
|
521
343
|
|
|
522
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
344
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L501)
|
|
523
345
|
|
|
524
346
|
##### :gear: setNodeProviderAccount
|
|
525
347
|
|
|
@@ -530,7 +352,7 @@ Where the reward is paid to.
|
|
|
530
352
|
| ------------------------ | ---------------------------------------------- |
|
|
531
353
|
| `setNodeProviderAccount` | `(accountIdentifier: string) => Promise<void>` |
|
|
532
354
|
|
|
533
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
355
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L518)
|
|
534
356
|
|
|
535
357
|
##### :gear: mergeNeurons
|
|
536
358
|
|
|
@@ -540,7 +362,7 @@ Merge two neurons
|
|
|
540
362
|
| -------------- | --------------------------------------------------------------------------------- |
|
|
541
363
|
| `mergeNeurons` | `(request: { sourceNeuronId: bigint; targetNeuronId: bigint; }) => Promise<void>` |
|
|
542
364
|
|
|
543
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
365
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L538)
|
|
544
366
|
|
|
545
367
|
##### :gear: simulateMergeNeurons
|
|
546
368
|
|
|
@@ -550,7 +372,7 @@ Simulate merging two neurons
|
|
|
550
372
|
| ---------------------- | --------------------------------------------------------------------------------------- |
|
|
551
373
|
| `simulateMergeNeurons` | `(request: { sourceNeuronId: bigint; targetNeuronId: bigint; }) => Promise<NeuronInfo>` |
|
|
552
374
|
|
|
553
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
375
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L555)
|
|
554
376
|
|
|
555
377
|
##### :gear: splitNeuron
|
|
556
378
|
|
|
@@ -560,7 +382,7 @@ Splits a neuron creating a new one
|
|
|
560
382
|
| ------------- | ----------------------------------------------------------------------------------- |
|
|
561
383
|
| `splitNeuron` | `({ neuronId, amount, }: { neuronId: bigint; amount: bigint; }) => Promise<bigint>` |
|
|
562
384
|
|
|
563
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
385
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L600)
|
|
564
386
|
|
|
565
387
|
##### :gear: getProposal
|
|
566
388
|
|
|
@@ -573,7 +395,7 @@ it is fetched using a query call.
|
|
|
573
395
|
| ------------- | ----------------------------------------------------------------------------------------------------- |
|
|
574
396
|
| `getProposal` | `({ proposalId, certified, }: { proposalId: bigint; certified?: boolean; }) => Promise<ProposalInfo>` |
|
|
575
397
|
|
|
576
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
398
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L640)
|
|
577
399
|
|
|
578
400
|
##### :gear: makeProposal
|
|
579
401
|
|
|
@@ -583,7 +405,7 @@ Create new proposal
|
|
|
583
405
|
| -------------- | ------------------------------------------------- |
|
|
584
406
|
| `makeProposal` | `(request: MakeProposalRequest) => Promise<void>` |
|
|
585
407
|
|
|
586
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
408
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L657)
|
|
587
409
|
|
|
588
410
|
##### :gear: registerVote
|
|
589
411
|
|
|
@@ -593,7 +415,7 @@ Registers vote for a proposal from the neuron passed.
|
|
|
593
415
|
| -------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
594
416
|
| `registerVote` | `({ neuronId, vote, proposalId, }: { neuronId: bigint; vote: Vote; proposalId: bigint; }) => Promise<void>` |
|
|
595
417
|
|
|
596
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
418
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L672)
|
|
597
419
|
|
|
598
420
|
##### :gear: setFollowees
|
|
599
421
|
|
|
@@ -603,7 +425,7 @@ Edit neuron followees per topic
|
|
|
603
425
|
| -------------- | ------------------------------------------------- |
|
|
604
426
|
| `setFollowees` | `(followRequest: FollowRequest) => Promise<void>` |
|
|
605
427
|
|
|
606
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
428
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L694)
|
|
607
429
|
|
|
608
430
|
##### :gear: disburse
|
|
609
431
|
|
|
@@ -613,7 +435,7 @@ Disburse neuron on Account
|
|
|
613
435
|
| ---------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
614
436
|
| `disburse` | `({ neuronId, toAccountId, amount, }: { neuronId: bigint; toAccountId?: string; amount?: bigint; }) => Promise<void>` |
|
|
615
437
|
|
|
616
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
438
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L709)
|
|
617
439
|
|
|
618
440
|
##### :gear: mergeMaturity
|
|
619
441
|
|
|
@@ -623,7 +445,7 @@ Merge Maturity of a neuron
|
|
|
623
445
|
| --------------- | ------------------------------------------------------------------------------------------------------- |
|
|
624
446
|
| `mergeMaturity` | `({ neuronId, percentageToMerge, }: { neuronId: bigint; percentageToMerge: number; }) => Promise<void>` |
|
|
625
447
|
|
|
626
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
448
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L748)
|
|
627
449
|
|
|
628
450
|
##### :gear: stakeMaturity
|
|
629
451
|
|
|
@@ -638,7 +460,7 @@ Parameters:
|
|
|
638
460
|
- `neuronId`: The id of the neuron for which to stake the maturity
|
|
639
461
|
- `percentageToStake`: Optional. Percentage of the current maturity to stake. If not provided, all of the neuron's current maturity will be staked.
|
|
640
462
|
|
|
641
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
463
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L781)
|
|
642
464
|
|
|
643
465
|
##### :gear: spawnNeuron
|
|
644
466
|
|
|
@@ -648,7 +470,7 @@ Merge Maturity of a neuron
|
|
|
648
470
|
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
649
471
|
| `spawnNeuron` | `({ neuronId, percentageToSpawn, newController, nonce, }: { neuronId: bigint; percentageToSpawn?: number; newController?: Principal; nonce?: bigint; }) => Promise<bigint>` |
|
|
650
472
|
|
|
651
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
473
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L803)
|
|
652
474
|
|
|
653
475
|
##### :gear: addHotkey
|
|
654
476
|
|
|
@@ -658,7 +480,7 @@ Add hotkey to neuron
|
|
|
658
480
|
| ----------- | ------------------------------------------------------------------------------------------ |
|
|
659
481
|
| `addHotkey` | `({ neuronId, principal, }: { neuronId: bigint; principal: Principal; }) => Promise<void>` |
|
|
660
482
|
|
|
661
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
483
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L857)
|
|
662
484
|
|
|
663
485
|
##### :gear: removeHotkey
|
|
664
486
|
|
|
@@ -668,7 +490,7 @@ Remove hotkey to neuron
|
|
|
668
490
|
| -------------- | ------------------------------------------------------------------------------------------ |
|
|
669
491
|
| `removeHotkey` | `({ neuronId, principal, }: { neuronId: bigint; principal: Principal; }) => Promise<void>` |
|
|
670
492
|
|
|
671
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
493
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L881)
|
|
672
494
|
|
|
673
495
|
##### :gear: claimOrRefreshNeuronFromAccount
|
|
674
496
|
|
|
@@ -678,7 +500,7 @@ Gets the NeuronID of a newly created neuron.
|
|
|
678
500
|
| --------------------------------- | --------------------------------------------------------------------------------------- |
|
|
679
501
|
| `claimOrRefreshNeuronFromAccount` | `({ memo, controller, }: { memo: bigint; controller?: Principal; }) => Promise<bigint>` |
|
|
680
502
|
|
|
681
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
503
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L902)
|
|
682
504
|
|
|
683
505
|
##### :gear: claimOrRefreshNeuron
|
|
684
506
|
|
|
@@ -689,7 +511,7 @@ Uses query call only.
|
|
|
689
511
|
| ---------------------- | ----------------------------------------------------------- |
|
|
690
512
|
| `claimOrRefreshNeuron` | `(request: ClaimOrRefreshNeuronRequest) => Promise<bigint>` |
|
|
691
513
|
|
|
692
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
514
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L933)
|
|
693
515
|
|
|
694
516
|
##### :gear: getNeuron
|
|
695
517
|
|
|
@@ -699,58 +521,7 @@ Return the data of the neuron provided as id.
|
|
|
699
521
|
| ----------- | ---------------------------------------------------------------------------------------------- |
|
|
700
522
|
| `getNeuron` | `({ certified, neuronId, }: { certified: boolean; neuronId: bigint; }) => Promise<NeuronInfo>` |
|
|
701
523
|
|
|
702
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
703
|
-
|
|
704
|
-
### :factory: ICP
|
|
705
|
-
|
|
706
|
-
We don't extend to keep `fromE8s` and `fromString` as backwards compatible.
|
|
707
|
-
|
|
708
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/icp.ts#L14)
|
|
709
|
-
|
|
710
|
-
#### Methods
|
|
711
|
-
|
|
712
|
-
- [fromE8s](#gear-frome8s)
|
|
713
|
-
- [fromString](#gear-fromstring)
|
|
714
|
-
- [toE8s](#gear-toe8s)
|
|
715
|
-
- [toProto](#gear-toproto)
|
|
716
|
-
|
|
717
|
-
##### :gear: fromE8s
|
|
718
|
-
|
|
719
|
-
| Method | Type |
|
|
720
|
-
| --------- | ------------------------- |
|
|
721
|
-
| `fromE8s` | `(amount: bigint) => ICP` |
|
|
722
|
-
|
|
723
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/icp.ts#L20)
|
|
724
|
-
|
|
725
|
-
##### :gear: fromString
|
|
726
|
-
|
|
727
|
-
Initialize from a string. Accepted formats:
|
|
728
|
-
|
|
729
|
-
1234567.8901
|
|
730
|
-
1'234'567.8901
|
|
731
|
-
1,234,567.8901
|
|
732
|
-
|
|
733
|
-
| Method | Type |
|
|
734
|
-
| ------------ | --------------------------------------------------- |
|
|
735
|
-
| `fromString` | `(amount: string) => ICP or FromStringToTokenError` |
|
|
736
|
-
|
|
737
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/icp.ts#L31)
|
|
738
|
-
|
|
739
|
-
##### :gear: toE8s
|
|
740
|
-
|
|
741
|
-
| Method | Type |
|
|
742
|
-
| ------- | -------------- |
|
|
743
|
-
| `toE8s` | `() => bigint` |
|
|
744
|
-
|
|
745
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/icp.ts#L39)
|
|
746
|
-
|
|
747
|
-
##### :gear: toProto
|
|
748
|
-
|
|
749
|
-
| Method | Type |
|
|
750
|
-
| --------- | ---------------------- |
|
|
751
|
-
| `toProto` | `() => Promise<ICPTs>` |
|
|
752
|
-
|
|
753
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/icp.ts#L43)
|
|
524
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L984)
|
|
754
525
|
|
|
755
526
|
### :factory: SnsWasmCanister
|
|
756
527
|
|