[CI Skip] 0.32.4
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="decode"></a>
|
||||
|
||||
## decode
|
||||
|
||||
▸ **decode**(encoded: * `string` | `Uint8Array`*, prefix?: *`Prefix`*): `Uint8Array`
|
||||
|
||||
*Defined in [address/decode.ts:15](https://github.com/polkadot-js/common/blob/1fb1f9d/packages/keyring/src/address/decode.ts#L15)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Default value |
|
||||
| ------ | ------ | ------ |
|
||||
| encoded | `string` | `Uint8Array`| - |
|
||||
| `Default value` prefix | `Prefix` | defaults.prefix |
|
||||
|
||||
**Returns:** `Uint8Array`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="encode"></a>
|
||||
|
||||
## encode
|
||||
|
||||
▸ **encode**(_key: * `Uint8Array` | `string`*, prefix?: *`Prefix`*): `string`
|
||||
|
||||
*Defined in [address/encode.ts:15](https://github.com/polkadot-js/common/blob/1fb1f9d/packages/keyring/src/address/encode.ts#L15)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Default value |
|
||||
| ------ | ------ | ------ |
|
||||
| _key | `Uint8Array` | `string`| - |
|
||||
| `Default value` prefix | `Prefix` | defaults.prefix |
|
||||
|
||||
**Returns:** `string`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="setprefix"></a>
|
||||
|
||||
## setPrefix
|
||||
|
||||
▸ **setPrefix**(prefix: *`Prefix`*): `void`
|
||||
|
||||
*Defined in [address/setPrefix.ts:9](https://github.com/polkadot-js/common/blob/1fb1f9d/packages/keyring/src/address/setPrefix.ts#L9)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| prefix | `Prefix` |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
# Index
|
||||
|
||||
### Classes
|
||||
|
||||
* [Keyring](../classes/_index_.keyring.md)
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="decode"></a>
|
||||
|
||||
## decode
|
||||
|
||||
▸ **decode**(passphrase?: * `undefined` | `string`*, _encrypted?: *`Uint8Array`*): `object`
|
||||
|
||||
*Defined in [pair/decode.ts:15](https://github.com/polkadot-js/common/blob/1fb1f9d/packages/keyring/src/pair/decode.ts#L15)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| `Optional` passphrase | `undefined` | `string`|
|
||||
| `Optional` _encrypted | `Uint8Array` |
|
||||
|
||||
**Returns:** `object`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="encode"></a>
|
||||
|
||||
## encode
|
||||
|
||||
▸ **encode**(secretKey: *`Uint8Array`*, passphrase?: * `undefined` | `string`*): `Uint8Array`
|
||||
|
||||
*Defined in [pair/encode.ts:10](https://github.com/polkadot-js/common/blob/1fb1f9d/packages/keyring/src/pair/encode.ts#L10)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| secretKey | `Uint8Array` |
|
||||
| `Optional` passphrase | `undefined` | `string`|
|
||||
|
||||
**Returns:** `Uint8Array`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="getmeta"></a>
|
||||
|
||||
## getMeta
|
||||
|
||||
▸ **getMeta**(state: *`PairState`*): `KeyringPair$Meta`
|
||||
|
||||
*Defined in [pair/getMeta.ts:8](https://github.com/polkadot-js/common/blob/1fb1f9d/packages/keyring/src/pair/getMeta.ts#L8)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| state | `PairState` |
|
||||
|
||||
**Returns:** `KeyringPair$Meta`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="pair"></a>
|
||||
|
||||
## pair
|
||||
|
||||
▸ **pair**(__namedParameters: *`object`*, meta?: *`KeyringPair$Meta`*, defaultEncoded?: *`Uint8Array`*): `KeyringPair`
|
||||
|
||||
*Defined in [pair/index.ts:50](https://github.com/polkadot-js/common/blob/1fb1f9d/packages/keyring/src/pair/index.ts#L50)*
|
||||
|
||||
*__name__*: pair
|
||||
|
||||
*__signature__*: pair ({ publicKey, secretKey }: KeypairType, meta: KeyringPair$Meta = {}, defaultEncoded?: Uint8Array): KeyringPair
|
||||
|
||||
*__summary__*: Creates a keyring pair object
|
||||
|
||||
*__description__*: Creates a keyring pair object with provided account public key, metadata, and encoded arguments. The keyring pair stores the account state including the encoded address and associated metadata.
|
||||
|
||||
It has properties whose values are functions that may be called to perform account actions:
|
||||
|
||||
* `address` function retrieves the address associated with the account.
|
||||
* `decodedPkcs8` function is called with the account passphrase and account encoded public key. It decodes the encoded public key using the passphrase provided to obtain the decoded account public key and associated secret key that are then available in memory, and changes the account address stored in the state of the pair to correspond to the address of the decoded public key.
|
||||
* `encodePkcs8` function when provided with the correct passphrase associated with the account pair and when the secret key is in memory (when the account pair is not locked) it returns an encoded public key of the account.
|
||||
* `getMeta` returns the metadata that is stored in the state of the pair, either when it was originally created or set via `setMeta`.
|
||||
* `publicKey` returns the public key stored in memory for the pair.
|
||||
* `sign` may be used to return a signature by signing a provided message with the secret key (if it is in memory) using Nacl.
|
||||
* `toJson` calls another `toJson` function and provides the state of the pair, it generates arguments to be passed to the other `toJson` function including an encoded public key of the account that it generates using the secret key from memory (if it has been made available in memory) and the optionally provided passphrase argument. It passes a third boolean argument to `toJson` indicating whether the public key has been encoded or not (if a passphrase argument was provided then it is encoded). The `toJson` function that it calls returns a JSON object with properties including the `address` and `meta` that are assigned with the values stored in the corresponding state variables of the account pair, an `encoded` property that is assigned with the encoded public key in hex format, and an `encoding` property that indicates whether the public key value of the `encoded` property is encoded or not.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type | Default value |
|
||||
| ------ | ------ | ------ |
|
||||
| __namedParameters | `object` | - |
|
||||
| `Default value` meta | `KeyringPair$Meta` | {} |
|
||||
| `Optional` defaultEncoded | `Uint8Array` | - |
|
||||
|
||||
**Returns:** `KeyringPair`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="everybody"></a>
|
||||
|
||||
## everybody
|
||||
|
||||
▸ **everybody**(): `KeyringPair`
|
||||
|
||||
*Defined in [pair/nobody.ts:25](https://github.com/polkadot-js/common/blob/1fb1f9d/packages/keyring/src/pair/nobody.ts#L25)*
|
||||
|
||||
**Returns:** `KeyringPair`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="setmeta"></a>
|
||||
|
||||
## setMeta
|
||||
|
||||
▸ **setMeta**(state: *`PairState`*, meta: *`KeyringPair$Meta`*): `void`
|
||||
|
||||
*Defined in [pair/setMeta.ts:8](https://github.com/polkadot-js/common/blob/1fb1f9d/packages/keyring/src/pair/setMeta.ts#L8)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| state | `PairState` |
|
||||
| meta | `KeyringPair$Meta` |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="tojson"></a>
|
||||
|
||||
## toJson
|
||||
|
||||
▸ **toJson**(__namedParameters: *`object`*, encoded: *`Uint8Array`*, isEncrypted: *`boolean`*): `KeyringPair$Json`
|
||||
|
||||
*Defined in [pair/toJson.ts:10](https://github.com/polkadot-js/common/blob/1fb1f9d/packages/keyring/src/pair/toJson.ts#L10)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Param | Type |
|
||||
| ------ | ------ |
|
||||
| __namedParameters | `object` |
|
||||
| encoded | `Uint8Array` |
|
||||
| isEncrypted | `boolean` |
|
||||
|
||||
**Returns:** `KeyringPair$Json`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
# Index
|
||||
|
||||
### Classes
|
||||
|
||||
* [Pairs](../classes/_pairs_.pairs.md)
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="testkeyring"></a>
|
||||
|
||||
## testKeyring
|
||||
|
||||
▸ **testKeyring**(): `KeyringInstance`
|
||||
|
||||
*Defined in [testing.ts:57](https://github.com/polkadot-js/common/blob/1fb1f9d/packages/keyring/src/testing.ts#L57)*
|
||||
|
||||
*__name__*: testKeyring
|
||||
|
||||
*__signature__*: testKeyring (): KeyringInstance
|
||||
|
||||
*__summary__*: Create an instance of Keyring pre-populated with locked test accounts
|
||||
|
||||
*__description__*: The test accounts (i.e. alice, bob, dave, eve, ferdie) are available on the dev chain and each test account is initialised with DOT funds.
|
||||
|
||||
*__example__*:
|
||||
```javascript
|
||||
import testKeyring from '@polkadot/keyring/testing';
|
||||
|
||||
// Create an instance of Keyring that includes test accounts
|
||||
const keyring = testingPairs();
|
||||
|
||||
// Retrieve the address of one of the test accounts
|
||||
const addressAlice = keyring.alice.address();
|
||||
|
||||
// Retrieve the public key of one of the test accounts
|
||||
const publicKeyAlice = keyring.alice.publicKey();
|
||||
```
|
||||
|
||||
**Returns:** `KeyringInstance`
|
||||
|
||||
___
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="testkeyringpairs"></a>
|
||||
|
||||
## testKeyringPairs
|
||||
|
||||
▸ **testKeyringPairs**(): `TestKeyringMap`
|
||||
|
||||
*Defined in [testingPairs.ts:14](https://github.com/polkadot-js/common/blob/1fb1f9d/packages/keyring/src/testingPairs.ts#L14)*
|
||||
|
||||
**Returns:** `TestKeyringMap`
|
||||
|
||||
___
|
||||
|
||||
Reference in New Issue
Block a user