[CI Skip] 0.34.1
This commit is contained in:
@@ -1,24 +1,31 @@
|
||||
* ["address/decode"](modules/_address_decode_.md)
|
||||
* ["address/decode.spec"](modules/_address_decode_spec_.md)
|
||||
* ["address/defaults"](modules/_address_defaults_.md)
|
||||
* ["address/encode"](modules/_address_encode_.md)
|
||||
* ["address/encode.spec"](modules/_address_encode_spec_.md)
|
||||
* ["address/index"](modules/_address_index_.md)
|
||||
* ["address/setPrefix"](modules/_address_setprefix_.md)
|
||||
* ["address/setPrefix.spec"](modules/_address_setprefix_spec_.md)
|
||||
* ["address/types"](modules/_address_types_.md)
|
||||
* ["index"](modules/_index_.md)
|
||||
* [Keyring](classes/_index_.keyring.md)
|
||||
* ["index.spec"](modules/_index_spec_.md)
|
||||
* ["pair/decode"](modules/_pair_decode_.md)
|
||||
* ["pair/decode.spec"](modules/_pair_decode_spec_.md)
|
||||
* ["pair/defaults"](modules/_pair_defaults_.md)
|
||||
* ["pair/encode"](modules/_pair_encode_.md)
|
||||
* ["pair/getMeta"](modules/_pair_getmeta_.md)
|
||||
* ["pair/encode.spec"](modules/_pair_encode_spec_.md)
|
||||
* ["pair/index"](modules/_pair_index_.md)
|
||||
* ["pair/index.spec"](modules/_pair_index_spec_.md)
|
||||
* ["pair/nobody"](modules/_pair_nobody_.md)
|
||||
* ["pair/setMeta"](modules/_pair_setmeta_.md)
|
||||
* ["pair/toJson"](modules/_pair_tojson_.md)
|
||||
* ["pair/toJson.spec"](modules/_pair_tojson_spec_.md)
|
||||
* ["pair/types"](modules/_pair_types_.md)
|
||||
* ["pairs"](modules/_pairs_.md)
|
||||
* [Pairs](classes/_pairs_.pairs.md)
|
||||
* ["testing"](modules/_testing_.md)
|
||||
* ["testingPairs"](modules/_testingpairs_.md)
|
||||
* ["testingPairs.spec"](modules/_testingpairs_spec_.md)
|
||||
* ["types"](modules/_types_.md)
|
||||
* [KeyringInstance](interfaces/_types_.keyringinstance.md)
|
||||
* [KeyringPairs](interfaces/_types_.keyringpairs.md)
|
||||
|
||||
@@ -11,8 +11,6 @@ Overview
|
||||
|
||||
*__description__*: Allows generation of keyring pairs from a variety of input combinations, such as json object containing account address or public key, account metadata, and account encoded using `addFromJson`, or by providing those values as arguments separately to `addFromAddress`, or by providing the mnemonic (seed phrase) and account metadata as arguments to `addFromMnemonic`. Stores the keyring pairs in a keyring pair dictionary. Removal of the keyring pairs from the keyring pair dictionary is achieved using `removePair`. Retrieval of all the stored pairs via `getPairs` or perform lookup of a pair for a given account address or public key using `getPair`. JSON metadata associated with an account may be obtained using `toJson` accompanied by the account passphrase.
|
||||
|
||||
*__example__*: See [Polkadot-JS Common Keyring Examples](https://polkadot.js.org/api/common/examples/keyring/) and the [Polkadot-JS Apps ui-keyring package](https://github.com/polkadot-js/apps/tree/master/packages/ui-keyring) where it is implemented.
|
||||
|
||||
# Hierarchy
|
||||
|
||||
**Keyring**
|
||||
@@ -27,9 +25,15 @@ Overview
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new Keyring**(): [Keyring](_index_.keyring.md)
|
||||
⊕ **new Keyring**(options: *[KeyringOptions](../modules/_types_.md#keyringoptions)*): [Keyring](_index_.keyring.md)
|
||||
|
||||
*Defined in [index.ts:33](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L33)*
|
||||
*Defined in [index.ts:32](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L32)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| options | [KeyringOptions](../modules/_types_.md#keyringoptions) |
|
||||
|
||||
**Returns:** [Keyring](_index_.keyring.md)
|
||||
|
||||
@@ -45,7 +49,7 @@ ___
|
||||
|
||||
*Implementation of [KeyringInstance](../interfaces/_types_.keyringinstance.md).[decodeAddress](../interfaces/_types_.keyringinstance.md#decodeaddress)*
|
||||
|
||||
*Defined in [index.ts:39](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L39)*
|
||||
*Defined in [index.ts:43](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L43)*
|
||||
|
||||
___
|
||||
<a id="encodeaddress"></a>
|
||||
@@ -56,7 +60,7 @@ ___
|
||||
|
||||
*Implementation of [KeyringInstance](../interfaces/_types_.keyringinstance.md).[encodeAddress](../interfaces/_types_.keyringinstance.md#encodeaddress)*
|
||||
|
||||
*Defined in [index.ts:40](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L40)*
|
||||
*Defined in [index.ts:44](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L44)*
|
||||
|
||||
___
|
||||
<a id="setaddressprefix"></a>
|
||||
@@ -67,7 +71,7 @@ ___
|
||||
|
||||
*Implementation of [KeyringInstance](../interfaces/_types_.keyringinstance.md).[setAddressPrefix](../interfaces/_types_.keyringinstance.md#setaddressprefix)*
|
||||
|
||||
*Defined in [index.ts:41](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L41)*
|
||||
*Defined in [index.ts:45](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L45)*
|
||||
|
||||
___
|
||||
|
||||
@@ -77,9 +81,11 @@ ___
|
||||
|
||||
## addFromAddress
|
||||
|
||||
▸ **addFromAddress**(address: *`string` | `Uint8Array`*, meta?: *[KeyringPair$Meta](../modules/_types_.md#keyringpair_meta)*, defaultEncoded?: *`Uint8Array`*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
▸ **addFromAddress**(address: *`string` | `Uint8Array`*, meta: *[KeyringPair$Meta](../modules/_types_.md#keyringpair_meta)*, encoded: *`Uint8Array` | `null`*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
*Defined in [index.ts:61](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L61)*
|
||||
*Implementation of [KeyringInstance](../interfaces/_types_.keyringinstance.md).[addFromAddress](../interfaces/_types_.keyringinstance.md#addfromaddress)*
|
||||
|
||||
*Defined in [index.ts:65](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L65)*
|
||||
|
||||
*__name__*: addFromAddress
|
||||
|
||||
@@ -94,8 +100,8 @@ ___
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| address | `string` | `Uint8Array` |
|
||||
| `Optional` meta | [KeyringPair$Meta](../modules/_types_.md#keyringpair_meta) |
|
||||
| `Optional` defaultEncoded | `Uint8Array` |
|
||||
| meta | [KeyringPair$Meta](../modules/_types_.md#keyringpair_meta) |
|
||||
| encoded | `Uint8Array` | `null` |
|
||||
|
||||
**Returns:** [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
@@ -106,7 +112,7 @@ ___
|
||||
|
||||
▸ **addFromJson**(__namedParameters: *`object`*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
*Defined in [index.ts:76](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L76)*
|
||||
*Defined in [index.ts:77](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L77)*
|
||||
|
||||
*__name__*: addFromJson
|
||||
|
||||
@@ -116,8 +122,6 @@ ___
|
||||
|
||||
*__description__*: Allows user to provide a json object argument that contains account information (that may be obtained from the json file of an account backup), and then generates a keyring pair from it that it passes to `addPair` to stores in a keyring pair dictionary the public key of the generated pair as a key and the pair as the associated value.
|
||||
|
||||
*__example__*: Refer to an actual implementation in [Polkadot-JS ui-keyring > account > save](https://github.com/polkadot-js/apps/blob/master/packages/ui-keyring/src/account/save.ts#L15)
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
@@ -131,11 +135,11 @@ ___
|
||||
|
||||
## addFromMnemonic
|
||||
|
||||
▸ **addFromMnemonic**(mnemonic: *`string`*, meta?: *[KeyringPair$Meta](../modules/_types_.md#keyringpair_meta)*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
▸ **addFromMnemonic**(mnemonic: *`string`*, meta: *[KeyringPair$Meta](../modules/_types_.md#keyringpair_meta)*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
*Implementation of [KeyringInstance](../interfaces/_types_.keyringinstance.md).[addFromMnemonic](../interfaces/_types_.keyringinstance.md#addfrommnemonic)*
|
||||
|
||||
*Defined in [index.ts:89](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L89)*
|
||||
*Defined in [index.ts:90](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L90)*
|
||||
|
||||
*__name__*: addFromMnemonic
|
||||
|
||||
@@ -150,7 +154,7 @@ ___
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| mnemonic | `string` |
|
||||
| `Optional` meta | [KeyringPair$Meta](../modules/_types_.md#keyringpair_meta) |
|
||||
| meta | [KeyringPair$Meta](../modules/_types_.md#keyringpair_meta) |
|
||||
|
||||
**Returns:** [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
@@ -159,11 +163,11 @@ ___
|
||||
|
||||
## addFromSeed
|
||||
|
||||
▸ **addFromSeed**(seed: *`Uint8Array`*, meta?: *[KeyringPair$Meta](../modules/_types_.md#keyringpair_meta)*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
▸ **addFromSeed**(seed: *`Uint8Array`*, meta: *[KeyringPair$Meta](../modules/_types_.md#keyringpair_meta)*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
*Implementation of [KeyringInstance](../interfaces/_types_.keyringinstance.md).[addFromSeed](../interfaces/_types_.keyringinstance.md#addfromseed)*
|
||||
|
||||
*Defined in [index.ts:118](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L118)*
|
||||
*Defined in [index.ts:102](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L102)*
|
||||
|
||||
*__name__*: addFromSeed
|
||||
|
||||
@@ -173,29 +177,12 @@ ___
|
||||
|
||||
*__description__*: Stores in a keyring pair dictionary the public key of the pair as a key and the pair as the associated value. Allows user to provide the account seed as an argument, and then generates a keyring pair from it that it passes to `addPair` to store in a keyring pair dictionary the public key of the generated pair as a key and the pair as the associated value.
|
||||
|
||||
*__example__*:
|
||||
|
||||
```javascript
|
||||
import Keyring from '@polkadot/keyring';
|
||||
import stringToU8a from '@polkadot/util/string/toU8a';
|
||||
|
||||
const ALICE_SEED = 'Alice'.padEnd(32, ' ');
|
||||
|
||||
// Create an instance of the Keyring
|
||||
const keyring = new Keyring();
|
||||
|
||||
// Add Alice to our keyring pair dictionary (with the known seed for the account)
|
||||
const pairAlice = keyring.addFromSeed(stringToU8a(ALICE_SEED));
|
||||
```
|
||||
|
||||
Refer to an actual implementation in [Polkadot-JS ui-keyring > account > create](https://github.com/polkadot-js/apps/blob/master/packages/ui-keyring/src/account/create.ts#L11)
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| seed | `Uint8Array` |
|
||||
| `Optional` meta | [KeyringPair$Meta](../modules/_types_.md#keyringpair_meta) |
|
||||
| meta | [KeyringPair$Meta](../modules/_types_.md#keyringpair_meta) |
|
||||
|
||||
**Returns:** [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
@@ -208,7 +195,7 @@ ___
|
||||
|
||||
*Implementation of [KeyringInstance](../interfaces/_types_.keyringinstance.md).[addPair](../interfaces/_types_.keyringinstance.md#addpair)*
|
||||
|
||||
*Defined in [index.ts:48](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L48)*
|
||||
*Defined in [index.ts:52](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L52)*
|
||||
|
||||
*__name__*: addPair
|
||||
|
||||
@@ -233,7 +220,7 @@ ___
|
||||
|
||||
*Implementation of [KeyringInstance](../interfaces/_types_.keyringinstance.md).[getPair](../interfaces/_types_.keyringinstance.md#getpair)*
|
||||
|
||||
*Defined in [index.ts:154](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L154)*
|
||||
*Defined in [index.ts:117](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L117)*
|
||||
|
||||
*__name__*: getPair
|
||||
|
||||
@@ -243,31 +230,6 @@ ___
|
||||
|
||||
*__description__*: Returns a keyring pair value from the keyring pair dictionary by performing a key lookup using the provided account address or public key (after decoding it).
|
||||
|
||||
*__example__*:
|
||||
|
||||
```javascript
|
||||
import Keyring from '@polkadot/keyring';
|
||||
import stringToU8a from '@polkadot/util/string/toU8a';
|
||||
|
||||
const ALICE_SEED = 'Alice'.padEnd(32, ' ');
|
||||
|
||||
// Create an instance of the Keyring
|
||||
const keyring = new Keyring();
|
||||
|
||||
// Add Alice to our keyring pair dictionary (with the known seed for the account)
|
||||
const pairAlice = keyring.addFromSeed(stringToU8a(ALICE_SEED));
|
||||
|
||||
// Retrieve the same pair that is stored in the keyring pair dictionary by
|
||||
// providing the account address as an argument, and also the public key as an argument.
|
||||
// The pairs that are returned should both be the same value as `pairAlice` above
|
||||
const pairAliceRetrievedWithAddress = keyring.getPair(pairAlice.address());
|
||||
const pairAliceRetrievedWithPublicKey = keyring.getPair(pairAlice.publicKey());
|
||||
|
||||
// Check if all returned pairs are the same
|
||||
console.log(`Are all pairs the same? : ` +
|
||||
`${pairAlice === pairAliceRetrievedWithAddress === pairAliceRetrievedWithPublicKey}`);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
@@ -285,7 +247,7 @@ ___
|
||||
|
||||
*Implementation of [KeyringInstance](../interfaces/_types_.keyringinstance.md).[getPairs](../interfaces/_types_.keyringinstance.md#getpairs)*
|
||||
|
||||
*Defined in [index.ts:186](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L186)*
|
||||
*Defined in [index.ts:127](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L127)*
|
||||
|
||||
*__name__*: getPairs
|
||||
|
||||
@@ -295,28 +257,6 @@ ___
|
||||
|
||||
*__description__*: Returns an array list of all the keyring pair values that are stored in the keyring pair dictionary.
|
||||
|
||||
*__example__*:
|
||||
|
||||
```javascript
|
||||
import testKeyring from '@polkadot/keyring/testing';
|
||||
|
||||
// Create an instance of Keyring that includes test accounts
|
||||
const keyring = testingPairs();
|
||||
|
||||
keyring
|
||||
.getPairs()
|
||||
.forEach((pair) => {
|
||||
const address = pair.address();
|
||||
|
||||
keyring.addPair(address, {
|
||||
address,
|
||||
meta: pair.getMeta()
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
Refer to an actual implementation in [Polkadot-JS ui-keyring > loadAll](https://github.com/polkadot-js/apps/blob/master/packages/ui-keyring/src/loadAll.ts)
|
||||
|
||||
**Returns:** `Array`<[KeyringPair](../modules/_types_.md#keyringpair)>
|
||||
|
||||
___
|
||||
@@ -328,7 +268,7 @@ ___
|
||||
|
||||
*Implementation of [KeyringInstance](../interfaces/_types_.keyringinstance.md).[getPublicKeys](../interfaces/_types_.keyringinstance.md#getpublickeys)*
|
||||
|
||||
*Defined in [index.ts:196](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L196)*
|
||||
*Defined in [index.ts:137](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L137)*
|
||||
|
||||
*__name__*: getPublicKeys
|
||||
|
||||
@@ -349,7 +289,7 @@ ___
|
||||
|
||||
*Implementation of [KeyringInstance](../interfaces/_types_.keyringinstance.md).[removePair](../interfaces/_types_.keyringinstance.md#removepair)*
|
||||
|
||||
*Defined in [index.ts:211](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L211)*
|
||||
*Defined in [index.ts:150](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L150)*
|
||||
|
||||
*__name__*: removePair
|
||||
|
||||
@@ -357,8 +297,6 @@ ___
|
||||
|
||||
*__description__*: Deletes the provided input address or public key from the stored Keyring Pair Dictionary.
|
||||
|
||||
*__example__*: Refer to an actual implementation in [Polkadot-JS ui-keyring > account > forget](https://github.com/polkadot-js/apps/blob/master/packages/ui-keyring/src/account/forget.ts)
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
@@ -376,7 +314,7 @@ ___
|
||||
|
||||
*Implementation of [KeyringInstance](../interfaces/_types_.keyringinstance.md).[toJson](../interfaces/_types_.keyringinstance.md#tojson)*
|
||||
|
||||
*Defined in [index.ts:226](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/index.ts#L226)*
|
||||
*Defined in [index.ts:163](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/index.ts#L163)*
|
||||
|
||||
*__name__*: toJson
|
||||
|
||||
@@ -386,8 +324,6 @@ ___
|
||||
|
||||
*__description__*: Returns a JSON object containing the metadata associated with an account when valid address or public key and when the account passphrase is provided if the account secret is not already unlocked and available in memory. Note that in [Polkadot-JS Apps](https://github.com/polkadot-js/apps) the user may backup their account to a JSON file that contains this information.
|
||||
|
||||
*__example__*: Refer to an actual implementation in [Polkadot-JS ui-keyring > account > save](https://github.com/polkadot-js/apps/blob/master/packages/ui-keyring/src/account/save.ts#L9)
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
⊕ **new Pairs**(): [Pairs](_pairs_.pairs.md)
|
||||
|
||||
*Defined in [pairs.ts:17](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/pairs.ts#L17)*
|
||||
*Defined in [pairs.ts:17](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/pairs.ts#L17)*
|
||||
|
||||
**Returns:** [Pairs](_pairs_.pairs.md)
|
||||
|
||||
@@ -30,7 +30,7 @@ ___
|
||||
|
||||
▸ **add**(pair: *[KeyringPair](../modules/_types_.md#keyringpair)*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
*Defined in [pairs.ts:23](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/pairs.ts#L23)*
|
||||
*Defined in [pairs.ts:23](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/pairs.ts#L23)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -47,7 +47,7 @@ ___
|
||||
|
||||
▸ **all**(): `Array`<[KeyringPair](../modules/_types_.md#keyringpair)>
|
||||
|
||||
*Defined in [pairs.ts:30](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/pairs.ts#L30)*
|
||||
*Defined in [pairs.ts:30](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/pairs.ts#L30)*
|
||||
|
||||
**Returns:** `Array`<[KeyringPair](../modules/_types_.md#keyringpair)>
|
||||
|
||||
@@ -58,7 +58,7 @@ ___
|
||||
|
||||
▸ **get**(address: *`string` | `Uint8Array`*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
*Defined in [pairs.ts:34](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/pairs.ts#L34)*
|
||||
*Defined in [pairs.ts:34](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/pairs.ts#L34)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -75,7 +75,7 @@ ___
|
||||
|
||||
▸ **remove**(address: *`string` | `Uint8Array`*): `void`
|
||||
|
||||
*Defined in [pairs.ts:49](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/pairs.ts#L49)*
|
||||
*Defined in [pairs.ts:49](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/pairs.ts#L49)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -397,7 +397,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"keyring","level":"1.2","depth":1,"next":{"title":"trie-db","level":"1.3","depth":1,"path":"trie-db/README.md","ref":"trie-db/README.md","articles":[]},"previous":{"title":"Introduction","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/common/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot Common Book","gitbook":">=2.4.0"},"file":{"path":"keyring/README.md","mtime":"2019-01-23T13:16:04.542Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-23T13:17:24.348Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"keyring","level":"1.2","depth":1,"next":{"title":"trie-db","level":"1.3","depth":1,"path":"trie-db/README.md","ref":"trie-db/README.md","articles":[]},"previous":{"title":"Introduction","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/common/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot Common Book","gitbook":">=2.4.0"},"file":{"path":"keyring/README.md","mtime":"2019-02-13T15:50:09.308Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-02-13T15:51:24.854Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -14,16 +14,17 @@
|
||||
|
||||
## addFromAddress
|
||||
|
||||
▸ **addFromAddress**(address: *`string` | `Uint8Array`*, meta?: *[KeyringPair$Meta](../modules/_types_.md#keyringpair_meta)*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
▸ **addFromAddress**(address: *`string` | `Uint8Array`*, meta: *[KeyringPair$Meta](../modules/_types_.md#keyringpair_meta)*, encoded: *`Uint8Array` | `null`*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
*Defined in [types.ts:49](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L49)*
|
||||
*Defined in [types.ts:60](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L60)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| address | `string` | `Uint8Array` |
|
||||
| `Optional` meta | [KeyringPair$Meta](../modules/_types_.md#keyringpair_meta) |
|
||||
| meta | [KeyringPair$Meta](../modules/_types_.md#keyringpair_meta) |
|
||||
| encoded | `Uint8Array` | `null` |
|
||||
|
||||
**Returns:** [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
@@ -34,7 +35,7 @@ ___
|
||||
|
||||
▸ **addFromJson**(pair: *[KeyringPair$Json](../modules/_types_.md#keyringpair_json)*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
*Defined in [types.ts:52](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L52)*
|
||||
*Defined in [types.ts:63](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L63)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -49,16 +50,16 @@ ___
|
||||
|
||||
## addFromMnemonic
|
||||
|
||||
▸ **addFromMnemonic**(mnemonic: *`string`*, meta?: *[KeyringPair$Meta](../modules/_types_.md#keyringpair_meta)*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
▸ **addFromMnemonic**(mnemonic: *`string`*, meta: *[KeyringPair$Meta](../modules/_types_.md#keyringpair_meta)*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
*Defined in [types.ts:50](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L50)*
|
||||
*Defined in [types.ts:61](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L61)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| mnemonic | `string` |
|
||||
| `Optional` meta | [KeyringPair$Meta](../modules/_types_.md#keyringpair_meta) |
|
||||
| meta | [KeyringPair$Meta](../modules/_types_.md#keyringpair_meta) |
|
||||
|
||||
**Returns:** [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
@@ -67,16 +68,16 @@ ___
|
||||
|
||||
## addFromSeed
|
||||
|
||||
▸ **addFromSeed**(seed: *`Uint8Array`*, meta?: *[KeyringPair$Meta](../modules/_types_.md#keyringpair_meta)*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
▸ **addFromSeed**(seed: *`Uint8Array`*, meta: *[KeyringPair$Meta](../modules/_types_.md#keyringpair_meta)*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
*Defined in [types.ts:51](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L51)*
|
||||
*Defined in [types.ts:62](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L62)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| seed | `Uint8Array` |
|
||||
| `Optional` meta | [KeyringPair$Meta](../modules/_types_.md#keyringpair_meta) |
|
||||
| meta | [KeyringPair$Meta](../modules/_types_.md#keyringpair_meta) |
|
||||
|
||||
**Returns:** [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
@@ -87,7 +88,7 @@ ___
|
||||
|
||||
▸ **addPair**(pair: *[KeyringPair](../modules/_types_.md#keyringpair)*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
*Defined in [types.ts:48](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L48)*
|
||||
*Defined in [types.ts:59](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L59)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -104,7 +105,7 @@ ___
|
||||
|
||||
▸ **decodeAddress**(encoded: *`string` | `Uint8Array`*): `Uint8Array`
|
||||
|
||||
*Defined in [types.ts:44](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L44)*
|
||||
*Defined in [types.ts:55](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L55)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -121,7 +122,7 @@ ___
|
||||
|
||||
▸ **encodeAddress**(key: *`Uint8Array` | `string`*): `string`
|
||||
|
||||
*Defined in [types.ts:45](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L45)*
|
||||
*Defined in [types.ts:56](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L56)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -138,7 +139,7 @@ ___
|
||||
|
||||
▸ **getPair**(address: *`string` | `Uint8Array`*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
|
||||
*Defined in [types.ts:53](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L53)*
|
||||
*Defined in [types.ts:64](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L64)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -155,7 +156,7 @@ ___
|
||||
|
||||
▸ **getPairs**(): `Array`<[KeyringPair](../modules/_types_.md#keyringpair)>
|
||||
|
||||
*Defined in [types.ts:54](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L54)*
|
||||
*Defined in [types.ts:65](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L65)*
|
||||
|
||||
**Returns:** `Array`<[KeyringPair](../modules/_types_.md#keyringpair)>
|
||||
|
||||
@@ -166,7 +167,7 @@ ___
|
||||
|
||||
▸ **getPublicKeys**(): `Array`<`Uint8Array`>
|
||||
|
||||
*Defined in [types.ts:55](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L55)*
|
||||
*Defined in [types.ts:66](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L66)*
|
||||
|
||||
**Returns:** `Array`<`Uint8Array`>
|
||||
|
||||
@@ -177,7 +178,7 @@ ___
|
||||
|
||||
▸ **removePair**(address: *`string` | `Uint8Array`*): `void`
|
||||
|
||||
*Defined in [types.ts:56](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L56)*
|
||||
*Defined in [types.ts:67](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L67)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -194,7 +195,7 @@ ___
|
||||
|
||||
▸ **setAddressPrefix**(prefix: *[Prefix](../modules/_address_types_.md#prefix)*): `void`
|
||||
|
||||
*Defined in [types.ts:46](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L46)*
|
||||
*Defined in [types.ts:57](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L57)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -211,7 +212,7 @@ ___
|
||||
|
||||
▸ **toJson**(address: *`string` | `Uint8Array`*, passphrase?: *`undefined` | `string`*): [KeyringPair$Json](../modules/_types_.md#keyringpair_json)
|
||||
|
||||
*Defined in [types.ts:57](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L57)*
|
||||
*Defined in [types.ts:68](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L68)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
**● add**: *`function`*
|
||||
|
||||
*Defined in [types.ts:37](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L37)*
|
||||
*Defined in [types.ts:48](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L48)*
|
||||
|
||||
#### Type declaration
|
||||
▸(pair: *[KeyringPair](../modules/_types_.md#keyringpair)*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
@@ -36,7 +36,7 @@ ___
|
||||
|
||||
**● all**: *`function`*
|
||||
|
||||
*Defined in [types.ts:38](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L38)*
|
||||
*Defined in [types.ts:49](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L49)*
|
||||
|
||||
#### Type declaration
|
||||
▸(): `Array`<[KeyringPair](../modules/_types_.md#keyringpair)>
|
||||
@@ -50,7 +50,7 @@ ___
|
||||
|
||||
**● get**: *`function`*
|
||||
|
||||
*Defined in [types.ts:39](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L39)*
|
||||
*Defined in [types.ts:50](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L50)*
|
||||
|
||||
#### Type declaration
|
||||
▸(address: *`string` | `Uint8Array`*): [KeyringPair](../modules/_types_.md#keyringpair)
|
||||
@@ -70,7 +70,7 @@ ___
|
||||
|
||||
**● remove**: *`function`*
|
||||
|
||||
*Defined in [types.ts:40](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L40)*
|
||||
*Defined in [types.ts:51](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L51)*
|
||||
|
||||
#### Type declaration
|
||||
▸(address: *`string` | `Uint8Array`*): `void`
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
▸ **decode**(encoded: *`string` | `Uint8Array`*, prefix?: *[Prefix](_address_types_.md#prefix)*): `Uint8Array`
|
||||
|
||||
*Defined in [address/decode.ts:15](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/address/decode.ts#L15)*
|
||||
*Defined in [address/decode.ts:15](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/address/decode.ts#L15)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
▸ **encode**(_key: *`Uint8Array` | `string`*, prefix?: *[Prefix](_address_types_.md#prefix)*): `string`
|
||||
|
||||
*Defined in [address/encode.ts:15](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/address/encode.ts#L15)*
|
||||
*Defined in [address/encode.ts:15](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/address/encode.ts#L15)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
▸ **setPrefix**(prefix: *[Prefix](_address_types_.md#prefix)*): `void`
|
||||
|
||||
*Defined in [address/setPrefix.ts:9](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/address/setPrefix.ts#L9)*
|
||||
*Defined in [address/setPrefix.ts:9](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/address/setPrefix.ts#L9)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
**Ƭ Prefix**: *`0` | `1` | `3` | `42` | `43` | `68` | `69`*
|
||||
|
||||
*Defined in [address/types.ts:5](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/address/types.ts#L5)*
|
||||
*Defined in [address/types.ts:5](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/address/types.ts#L5)*
|
||||
|
||||
___
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
|
||||
## decode
|
||||
|
||||
▸ **decode**(passphrase?: *`undefined` | `string`*, _encrypted?: *`Uint8Array`*): `object`
|
||||
▸ **decode**(passphrase?: *`undefined` | `string`*, _encrypted?: *`Uint8Array` | `null`*): `DecodeResult`
|
||||
|
||||
*Defined in [pair/decode.ts:15](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/pair/decode.ts#L15)*
|
||||
*Defined in [pair/decode.ts:19](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/pair/decode.ts#L19)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| `Optional` passphrase | `undefined` | `string` |
|
||||
| `Optional` _encrypted | `Uint8Array` |
|
||||
| `Optional` _encrypted | `Uint8Array` | `null` |
|
||||
|
||||
**Returns:** `object`
|
||||
**Returns:** `DecodeResult`
|
||||
|
||||
___
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -6,15 +6,16 @@
|
||||
|
||||
## encode
|
||||
|
||||
▸ **encode**(secretKey: *`Uint8Array`*, passphrase?: *`undefined` | `string`*): `Uint8Array`
|
||||
▸ **encode**(publicKey: *`Uint8Array`*, seed?: *`Uint8Array` | `null`*, passphrase?: *`undefined` | `string`*): `Uint8Array`
|
||||
|
||||
*Defined in [pair/encode.ts:10](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/pair/encode.ts#L10)*
|
||||
*Defined in [pair/encode.ts:10](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/pair/encode.ts#L10)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| secretKey | `Uint8Array` |
|
||||
| publicKey | `Uint8Array` |
|
||||
| `Optional` seed | `Uint8Array` | `null` |
|
||||
| `Optional` passphrase | `undefined` | `string` |
|
||||
|
||||
**Returns:** `Uint8Array`
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="getmeta"></a>
|
||||
|
||||
## getMeta
|
||||
|
||||
▸ **getMeta**(state: *[PairState](_pair_types_.md#pairstate)*): [KeyringPair$Meta](_types_.md#keyringpair_meta)
|
||||
|
||||
*Defined in [pair/getMeta.ts:8](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/pair/getMeta.ts#L8)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| state | [PairState](_pair_types_.md#pairstate) |
|
||||
|
||||
**Returns:** [KeyringPair$Meta](_types_.md#keyringpair_meta)
|
||||
|
||||
___
|
||||
|
||||
@@ -6,14 +6,12 @@
|
||||
|
||||
## pair
|
||||
|
||||
▸ **pair**(__namedParameters: *`object`*, meta?: *[KeyringPair$Meta](_types_.md#keyringpair_meta)*, defaultEncoded?: *`Uint8Array`*): [KeyringPair](_types_.md#keyringpair)
|
||||
▸ **pair**(type: *[PairType](_types_.md#pairtype)*, __namedParameters: *`object`*, meta?: *[KeyringPair$Meta](_types_.md#keyringpair_meta)*, encoded: *`Uint8Array` | `null`*): [KeyringPair](_types_.md#keyringpair)
|
||||
|
||||
*Defined in [pair/index.ts:50](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/pair/index.ts#L50)*
|
||||
*Defined in [pair/index.ts:47](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/pair/index.ts#L47)*
|
||||
|
||||
*__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.
|
||||
@@ -32,9 +30,10 @@ It has properties whose values are functions that may be called to perform accou
|
||||
|
||||
| Name | Type | Default value |
|
||||
| ------ | ------ | ------ |
|
||||
| type | [PairType](_types_.md#pairtype) | - |
|
||||
| __namedParameters | `object` | - |
|
||||
| `Default value` meta | [KeyringPair$Meta](_types_.md#keyringpair_meta) | {} |
|
||||
| `Optional` defaultEncoded | `Uint8Array` | - |
|
||||
| encoded | `Uint8Array` | `null` | - |
|
||||
|
||||
**Returns:** [KeyringPair](_types_.md#keyringpair)
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
▸ **everybody**(): [KeyringPair](_types_.md#keyringpair)
|
||||
|
||||
*Defined in [pair/nobody.ts:25](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/pair/nobody.ts#L25)*
|
||||
*Defined in [pair/nobody.ts:25](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/pair/nobody.ts#L25)*
|
||||
|
||||
**Returns:** [KeyringPair](_types_.md#keyringpair)
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="setmeta"></a>
|
||||
|
||||
## setMeta
|
||||
|
||||
▸ **setMeta**(state: *[PairState](_pair_types_.md#pairstate)*, meta: *[KeyringPair$Meta](_types_.md#keyringpair_meta)*): `void`
|
||||
|
||||
*Defined in [pair/setMeta.ts:8](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/pair/setMeta.ts#L8)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| state | [PairState](_pair_types_.md#pairstate) |
|
||||
| meta | [KeyringPair$Meta](_types_.md#keyringpair_meta) |
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
___
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
▸ **toJson**(__namedParameters: *`object`*, encoded: *`Uint8Array`*, isEncrypted: *`boolean`*): [KeyringPair$Json](_types_.md#keyringpair_json)
|
||||
|
||||
*Defined in [pair/toJson.ts:12](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/pair/toJson.ts#L12)*
|
||||
*Defined in [pair/toJson.ts:15](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/pair/toJson.ts#L15)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
# Type aliases
|
||||
|
||||
<a id="pairstate"></a>
|
||||
<a id="pairinfo"></a>
|
||||
|
||||
## PairState
|
||||
## PairInfo
|
||||
|
||||
**Ƭ PairState**: *`object`*
|
||||
**Ƭ PairInfo**: *`object`*
|
||||
|
||||
*Defined in [pair/types.ts:7](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/pair/types.ts#L7)*
|
||||
*Defined in [pair/types.ts:5](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/pair/types.ts#L5)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
## testKeyring
|
||||
|
||||
▸ **testKeyring**(): [KeyringInstance](../interfaces/_types_.keyringinstance.md)
|
||||
▸ **testKeyring**(options: *[KeyringOptions](_types_.md#keyringoptions)*): [KeyringInstance](../interfaces/_types_.keyringinstance.md)
|
||||
|
||||
*Defined in [testing.ts:57](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/testing.ts#L57)*
|
||||
*Defined in [testing.ts:42](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/testing.ts#L42)*
|
||||
|
||||
*__name__*: testKeyring
|
||||
|
||||
@@ -18,20 +18,11 @@
|
||||
|
||||
*__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__*:
|
||||
**Parameters:**
|
||||
|
||||
```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();
|
||||
```
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| options | [KeyringOptions](_types_.md#keyringoptions) |
|
||||
|
||||
**Returns:** [KeyringInstance](../interfaces/_types_.keyringinstance.md)
|
||||
|
||||
|
||||
@@ -6,9 +6,15 @@
|
||||
|
||||
## testKeyringPairs
|
||||
|
||||
▸ **testKeyringPairs**(): `TestKeyringMap`
|
||||
▸ **testKeyringPairs**(options: *[KeyringOptions](_types_.md#keyringoptions)*): `TestKeyringMap`
|
||||
|
||||
*Defined in [testingPairs.ts:14](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/testingPairs.ts#L14)*
|
||||
*Defined in [testingPairs.ts:14](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/testingPairs.ts#L14)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| options | [KeyringOptions](_types_.md#keyringoptions) |
|
||||
|
||||
**Returns:** `TestKeyringMap`
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -9,21 +9,36 @@
|
||||
|
||||
### Type aliases
|
||||
|
||||
* [KeyringOptions](_types_.md#keyringoptions)
|
||||
* [KeyringPair](_types_.md#keyringpair)
|
||||
* [KeyringPair$Json](_types_.md#keyringpair_json)
|
||||
* [KeyringPair$JsonEncoding](_types_.md#keyringpair_jsonencoding)
|
||||
* [KeyringPair$JsonVersion](_types_.md#keyringpair_jsonversion)
|
||||
* [KeyringPair$Meta](_types_.md#keyringpair_meta)
|
||||
* [PairType](_types_.md#pairtype)
|
||||
|
||||
---
|
||||
|
||||
# Type aliases
|
||||
|
||||
<a id="keyringoptions"></a>
|
||||
|
||||
## KeyringOptions
|
||||
|
||||
**Ƭ KeyringOptions**: *`object`*
|
||||
|
||||
*Defined in [types.ts:9](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L9)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
<a id="keyringpair"></a>
|
||||
|
||||
## KeyringPair
|
||||
|
||||
**Ƭ KeyringPair**: *`object`*
|
||||
|
||||
*Defined in [types.ts:22](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L22)*
|
||||
*Defined in [types.ts:33](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L33)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
@@ -34,10 +49,30 @@ ___
|
||||
|
||||
**Ƭ KeyringPair$Json**: *`object`*
|
||||
|
||||
*Defined in [types.ts:11](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L11)*
|
||||
*Defined in [types.ts:26](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L26)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
<a id="keyringpair_jsonencoding"></a>
|
||||
|
||||
## KeyringPair$JsonEncoding
|
||||
|
||||
**Ƭ KeyringPair$JsonEncoding**: *`object`*
|
||||
|
||||
*Defined in [types.ts:20](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L20)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
<a id="keyringpair_jsonversion"></a>
|
||||
|
||||
## KeyringPair$JsonVersion
|
||||
|
||||
**Ƭ KeyringPair$JsonVersion**: *"0" | "1"*
|
||||
|
||||
*Defined in [types.ts:18](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L18)*
|
||||
|
||||
___
|
||||
<a id="keyringpair_meta"></a>
|
||||
|
||||
@@ -45,11 +80,20 @@ ___
|
||||
|
||||
**Ƭ KeyringPair$Meta**: *`object`*
|
||||
|
||||
*Defined in [types.ts:7](https://github.com/polkadot-js/common/blob/5cb5390/packages/keyring/src/types.ts#L7)*
|
||||
*Defined in [types.ts:14](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L14)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
[index: `string`]: `any`
|
||||
|
||||
___
|
||||
<a id="pairtype"></a>
|
||||
|
||||
## PairType
|
||||
|
||||
**Ƭ PairType**: *"ed25519" | "sr25519"*
|
||||
|
||||
*Defined in [types.ts:7](https://github.com/polkadot-js/common/blob/2aba82e/packages/keyring/src/types.ts#L7)*
|
||||
|
||||
___
|
||||
|
||||
|
||||
Reference in New Issue
Block a user