Cleanup old docs/ (now on gh-pages branch) (#747)

This commit is contained in:
Jaco Greeff
2019-02-28 17:22:42 +01:00
committed by GitHub
parent b95af2580d
commit 0157f0b2e2
1347 changed files with 0 additions and 172998 deletions
-17
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-21
View File
File diff suppressed because one or more lines are too long
-193
View File
@@ -36,196 +36,3 @@
- [Display system events](examples/rx/08_system_events/README.md)(
- [Transaction with events](examples/rx/09_transfer_events/README.md)
- [Upgrade via sudo](examples/rx/10_upgrade_chain/README.md)
<!-- These are hidden, allowing HTML generation but does not appear in the sidebar -->
<!-- codec -->
- [hidden](types/classes/_codec_base_.base.md)
- [hidden](types/classes/_codec_compact_.compact.md)
- [hidden](types/classes/_codec_enum_.enum.md)
- [hidden](types/classes/_codec_enumtype_.enumtype.md)
- [hidden](types/classes/_codec_int_.int.md)
- [hidden](types/classes/_codec_option_.option.md)
- [hidden](types/classes/_codec_set_.set.md)
- [hidden](types/classes/_codec_struct_.struct.md)
- [hidden](types/classes/_codec_tuple_.tuple.md)
- [hidden](types/classes/_codec_typeregistry_.typeregistry.md)
- [hidden](types/classes/_codec_u8a_.u8a.md)
- [hidden](types/classes/_codec_u8afixed_.u8afixed.md)
- [hidden](types/classes/_codec_uint_.uint.md)
- [hidden](types/classes/_codec_vector_.vector.md)
<!-- primitives -->
- [hidden](types/classes/_primitive_bool_.bool.md)
- [hidden](types/classes/_primitive_bytes_.bytes.md)
- [hidden](types/classes/_primitive_data_.data.md)
- [hidden](types/classes/_primitive_h160_.h160.md)
- [hidden](types/classes/_primitive_h256_.h256.md)
- [hidden](types/classes/_primitive_h512_.h512.md)
- [hidden](types/classes/_primitive_i128_.i128.md)
- [hidden](types/classes/_primitive_i16_.i16.md)
- [hidden](types/classes/_primitive_i256_.i256.md)
- [hidden](types/classes/_primitive_i32_.i32.md)
- [hidden](types/classes/_primitive_i64_.i64.md)
- [hidden](types/classes/_primitive_i8_.i8.md)
- [hidden](types/classes/_primitive_method_.method.md)
- [hidden](types/classes/_primitive_method_.methodindex.md)
- [hidden](types/classes/_primitive_moment_.moment.md)
- [hidden](types/classes/_primitive_null_.null.md)
- [hidden](types/classes/_primitive_storagedata_.storagedata.md)
- [hidden](types/classes/_primitive_storagekey_.storagekey.md)
- [hidden](types/classes/_primitive_text_.text.md)
- [hidden](types/classes/_primitive_type_.type.md)
- [hidden](types/classes/_primitive_u128_.u128.md)
- [hidden](types/classes/_primitive_u16_.u16.md)
- [hidden](types/classes/_primitive_u256_.u256.md)
- [hidden](types/classes/_primitive_u32_.u32.md)
- [hidden](types/classes/_primitive_u64_.u64.md)
- [hidden](types/classes/_primitive_u8_.u8.md)
- [hidden](types/classes/_primitive_usize_.usize.md)
<!-- derived -->
- [hidden](types/classes/_type_header_.headerextended.md)
- [hidden](api-derive/classes/_democracy_referenduminfo_.referenduminfoextended.md)
<!-- metadata -->
- [hidden](types/classes/_metadata_index_.metadata.md)
- [hidden](types/classes/_metadata_magicnumber_.magicnumber.md)
- [hidden](types/classes/_metadata_metadataversioned_.metadataversioned.md)
- [hidden](types/classes/_metadata_v0_calls_.outerdispatchcall.md)
- [hidden](types/classes/_metadata_v0_calls_.outerdispatchmetadata.md)
- [hidden](types/classes/_metadata_v0_events_.eventmetadata.md)
- [hidden](types/classes/_metadata_v0_events_.outereventmetadata.md)
- [hidden](types/classes/_metadata_v0_events_.outereventmetadataevent.md)
- [hidden](types/classes/_metadata_v0_index_.metadatav0.md)
- [hidden](types/classes/_metadata_v0_modules_.callmetadata.md)
- [hidden](types/classes/_metadata_v0_modules_.functionargumentmetadata.md)
- [hidden](types/classes/_metadata_v0_modules_.functionmetadata.md)
- [hidden](types/classes/_metadata_v0_modules_.,maptype.md)
- [hidden](types/classes/_metadata_v0_modules_.modulemetadata.md)
- [hidden](types/classes/_metadata_v0_modules_.runtimemodulemetadata.md)
- [hidden](types/classes/_metadata_v0_modules_.storagefunctionmetadata.md)
- [hidden](types/classes/_metadata_v0_modules_.storagefunctionmodifier.md)
- [hidden](types/classes/_metadata_v0_modules_.storagefunctiontype.md)
- [hidden](types/classes/_metadata_v0_modules_.storagefunctiontype_map.md)
- [hidden](types/classes/_metadata_v0_modules_.storagemetadata.md)
- [hidden](types/classes/_metadata_v1_calls_.metadatacall.md)
- [hidden](types/classes/_metadata_v1_calls_.metadatacallarg.md)
- [hidden](types/classes/_metadata_v1_events_.metadataevent.md)
- [hidden](types/classes/_metadata_v1_index_.metadatamodule.md)
- [hidden](types/classes/_metadata_v1_index_.metadatav1.md)
- [hidden](types/classes/_metadata_v1_storage_.default.md)
- [hidden](types/classes/_metadata_v1_storage_.maptype.md)
- [hidden](types/classes/_metadata_v1_storage_.metadatastorage.md)
- [hidden](types/classes/_metadata_v1_storage_.metadatastoragemodifier.md)
- [hidden](types/classes/_metadata_v1_storage_.metadatastoragetype.md)
- [hidden](types/classes/_metadata_v1_storage_.optional.md)
- [hidden](types/classes/_metadata_v1_storage_.plaintype.md)
<!-- substrate -->
- [hidden](types/classes/_type_accountid_.accountid.md)
- [hidden](types/classes/_type_accountid_.accountidof.md)
- [hidden](types/classes/_type_accountindex_.accountindex.md)
- [hidden](types/classes/_type_address_.address.md)
- [hidden](types/classes/_type_amount_.amount.md)
- [hidden](types/classes/_type_assetof_.assetof.md)
- [hidden](types/classes/_type_attestedcandidate_.attestedcandidate.md)
- [hidden](types/classes/_type_attestedcandidate_.availabilityvote.md)
- [hidden](types/classes/_type_attestedcandidate_.balanceupload.md)
- [hidden](types/classes/_type_attestedcandidate_.candidatereceipt.md)
- [hidden](types/classes/_type_attestedcandidate_.candidatesignature.md)
- [hidden](types/classes/_type_attestedcandidate_.egressqueueroot.md)
- [hidden](types/classes/_type_attestedcandidate_.explicitcandidatesignature.md)
- [hidden](types/classes/_type_attestedcandidate_.headdata.md)
- [hidden](types/classes/_type_attestedcandidate_.implicitcandidatesignature.md)
- [hidden](types/classes/_type_attestedcandidate_.validityattestation.md)
- [hidden](types/classes/_type_attestedcandidate_.validityvote.md)
- [hidden](types/classes/_type_authorityid_.authorityid.md)
- [hidden](types/classes/_type_balance_.balance.md)
- [hidden](types/classes/_type_balance_.balanceof.md)
- [hidden](types/classes/_type_bft_.bftauthoritysignature.md)
- [hidden](types/classes/_type_bft_.bfthashsignature.md)
- [hidden](types/classes/_type_block_.block.md)
- [hidden](types/classes/_type_blocknumber_.blocknumber.md)
- [hidden](types/classes/_type_chainproperties_.chainproperties.md)
- [hidden](types/classes/_type_codehash_.codehash.md)
- [hidden](types/classes/_type_digest_.authoritieschange.md)
- [hidden](types/classes/_type_digest_.changestrieroot.md)
- [hidden](types/classes/_type_digest_.digest.md)
- [hidden](types/classes/_type_digest_.digestitem.md)
- [hidden](types/classes/_type_digest_.other.md)
- [hidden](types/classes/_type_digest_.seal.md)
- [hidden](types/classes/_type_event_.event.md)
- [hidden](types/classes/_type_event_.eventdata.md)
- [hidden](types/classes/_type_event_.eventindex.md)
- [hidden](types/classes/_type_eventrecord_.applyextrinsic.md)
- [hidden](types/classes/_type_eventrecord_.eventrecord.md)
- [hidden](types/classes/_type_eventrecord_.finalization.md)
- [hidden](types/classes/_type_eventrecord_.phase.md)
- [hidden](types/classes/_type_extrinsic_.extrinsic.md)
- [hidden](types/classes/_type_extrinsicera_.extrinsicera.md)
- [hidden](types/classes/_type_extrinsics_.extrinsics.md)
- [hidden](types/classes/_type_extrinsicsignature_.extrinsicsignature.md)
- [hidden](types/classes/_type_extrinsicstatus_.broadcast.md)
- [hidden](types/classes/_type_extrinsicstatus_.dropped.md)
- [hidden](types/classes/_type_extrinsicstatus_.extrinsicstatus.md)
- [hidden](types/classes/_type_extrinsicstatus_.finalised.md)
- [hidden](types/classes/_type_extrinsicstatus_.future.md)
- [hidden](types/classes/_type_extrinsicstatus_.invalid.md)
- [hidden](types/classes/_type_extrinsicstatus_.ready.md)
- [hidden](types/classes/_type_extrinsicstatus_.usurped.md)
- [hidden](types/classes/_type_gas_.gas.md)
- [hidden](types/classes/_type_hash_.hash.md)
- [hidden](types/classes/_type_header_.header.md)
- [hidden](types/classes/_type_health_.health.md)
- [hidden](types/classes/_type_inherentofflinereport_.inherentofflinereport.md)
- [hidden](types/classes/_type_justification_.justification.md)
- [hidden](types/classes/_type_justification_.rhdjustification.md)
- [hidden](types/classes/_type_keyvalue_.keyvalue.md)
- [hidden](types/classes/_type_keyvalue_.keyvalueoption.md)
- [hidden](types/classes/_type_lockperiods_.lockperiods.md)
- [hidden](types/classes/_type_misbehaviorreport_.bftatreport.md)
- [hidden](types/classes/_type_misbehaviorreport_.bftdoublecommit.md)
- [hidden](types/classes/_type_misbehaviorreport_.bftdoubleprepare.md)
- [hidden](types/classes/_type_misbehaviorreport_.bftdoublepropose.md)
- [hidden](types/classes/_type_misbehaviorreport_.bftproposeoutofturn.md)
- [hidden](types/classes/_type_misbehaviorreport_.misbehaviorkind.md)
- [hidden](types/classes/_type_misbehaviorreport_.misbehaviorreport.md)
- [hidden](types/classes/_type_newaccountoutcome_.newaccountoutcome.md)
- [hidden](types/classes/_type_nonce_.nonce.md)
- [hidden](types/classes/_type_noncecompact_.noncecompact.md)
- [hidden](types/classes/_type_origin_.origin.md)
- [hidden](types/classes/_type_paraid_.paraid.md)
- [hidden](types/classes/_type_peerinfo_.peerinfo.md)
- [hidden](types/classes/_type_pendingextrinsics_.pendingextrinsics.md)
- [hidden](types/classes/_type_perbill_.perbill.md)
- [hidden](types/classes/_type_permill_.permill.md)
- [hidden](types/classes/_type_prefabwasmmodule_.prefabwasmmodule.md)
- [hidden](types/classes/_type_propindex_.propindex.md)
- [hidden](types/classes/_type_proposal_.proposal.md)
- [hidden](types/classes/_type_proposalindex_.proposalindex.md)
- [hidden](types/classes/_type_referendumindex_.referendumindex.md)
- [hidden](types/classes/_type_referenduminfo_.referenduminfo.md)
- [hidden](types/classes/_type_runtimeversion_.apiid.md)
- [hidden](types/classes/_type_runtimeversion_.runtimeversion.md)
- [hidden](types/classes/_type_runtimeversion_.runtimeversionapi.md)
- [hidden](types/classes/_type_schedule_.schedule.md)
- [hidden](types/classes/_type_seedof_.seedof.md)
- [hidden](types/classes/_type_sessionkey_.sessionkey.md)
- [hidden](types/classes/_type_signature_.ed25519signature.md)
- [hidden](types/classes/_type_signature_.signature.md)
- [hidden](types/classes/_type_signature_.sr25519signature.md)
- [hidden](types/classes/_type_signaturepayload_.signaturepayload.md)
- [hidden](types/classes/_type_signedblock_.signedblock.md)
- [hidden](types/classes/_type_storagechangeset_.storagechangeset.md)
- [hidden](types/classes/_type_storedpendingchange_.nextauthority.md)
- [hidden](types/classes/_type_storedpendingchange_.storedpendingchange.md)
- [hidden](types/classes/_type_validatorprefs_.validatorprefs.md)
- [hidden](types/classes/_type_vestingschedule_.vestingschedule.md)
- [hidden](types/classes/_type_vote_.vote.md)
- [hidden](types/classes/_type_voteindex_.voteindex.md)
- [hidden](types/classes/_type_votethreshold_.votethreshold.md)
-11
View File
@@ -1,11 +0,0 @@
@polkadot/api-derive
====================
Common functions used across Polkadot, derived from RPC calls and storage queries.
Classes
-------
[Classes](SUMMARY.md)
File diff suppressed because one or more lines are too long
-28
View File
@@ -1,28 +0,0 @@
* [&quot;accounts/idAndIndex&quot;](modules/_accounts_idandindex_.md)
* [&quot;accounts/idToIndex&quot;](modules/_accounts_idtoindex_.md)
* [&quot;accounts/indexToId&quot;](modules/_accounts_indextoid_.md)
* [&quot;accounts/indexes&quot;](modules/_accounts_indexes_.md)
* [&quot;balances/fees&quot;](modules/_balances_fees_.md)
* [&quot;balances/validatingBalance&quot;](modules/_balances_validatingbalance_.md)
* [&quot;balances/validatingBalances&quot;](modules/_balances_validatingbalances_.md)
* [&quot;balances/votingBalance&quot;](modules/_balances_votingbalance_.md)
* [&quot;balances/votingBalances&quot;](modules/_balances_votingbalances_.md)
* [&quot;balances/votingBalancesNominatorsFor&quot;](modules/_balances_votingbalancesnominatorsfor_.md)
* [&quot;chain/bestNumber&quot;](modules/_chain_bestnumber_.md)
* [&quot;chain/bestNumberFinalised&quot;](modules/_chain_bestnumberfinalised_.md)
* [&quot;chain/bestNumberLag&quot;](modules/_chain_bestnumberlag_.md)
* [&quot;chain/getHeader&quot;](modules/_chain_getheader_.md)
* [&quot;chain/subscribeNewHead&quot;](modules/_chain_subscribenewhead_.md)
* [&quot;democracy/referendumInfo&quot;](modules/_democracy_referenduminfo_.md)
* [ReferendumInfoExtended](classes/_democracy_referenduminfo_.referenduminfoextended.md)
* [&quot;democracy/referendumInfos&quot;](modules/_democracy_referenduminfos_.md)
* [&quot;democracy/referendumVotesFor&quot;](modules/_democracy_referendumvotesfor_.md)
* [&quot;democracy/referendums&quot;](modules/_democracy_referendums_.md)
* [&quot;democracy/votes&quot;](modules/_democracy_votes_.md)
* [&quot;session/eraLength&quot;](modules/_session_eralength_.md)
* [&quot;session/eraProgress&quot;](modules/_session_eraprogress_.md)
* [&quot;session/sessionProgress&quot;](modules/_session_sessionprogress_.md)
* [&quot;staking/intentionsBalances&quot;](modules/_staking_intentionsbalances_.md)
* [&quot;types&quot;](modules/_types_.md)
* [&quot;util/cache&quot;](modules/_util_cache_.md)
* [&quot;util/drr&quot;](modules/_util_drr_.md)
File diff suppressed because one or more lines are too long
@@ -1,512 +0,0 @@
*__name__*: ReferendumInfoExtended
*__description__*: A \[\[ReferendumInfo\]\] with an additional `index` field
# Type parameters
#### S : `ConstructorDef`
#### T : `object`
#### V : `object`
#### E : `object`
# Hierarchy
`ReferendumInfo`
**↳ ReferendumInfoExtended**
# Implements
* `Codec`
# Constructors
<a id="constructor"></a>
## constructor
⊕ **new ReferendumInfoExtended**(value: *`ReferendumInfo` \| [ReferendumInfoExtended](_democracy_referenduminfo_.referenduminfoextended.md)*, index?: *`BN` \| `number`*): [ReferendumInfoExtended](_democracy_referenduminfo_.referenduminfoextended.md)
*Overrides ReferendumInfo.__constructor*
*Defined in [democracy/referendumInfo.ts:20](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/democracy/referendumInfo.ts#L20)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| value | `ReferendumInfo` \| [ReferendumInfoExtended](_democracy_referenduminfo_.referenduminfoextended.md) |
| `Optional` index | `BN` \| `number` |
**Returns:** [ReferendumInfoExtended](_democracy_referenduminfo_.referenduminfoextended.md)
___
# Properties
<a id="___tostringtag"></a>
## __@toStringTag
**● __@toStringTag**: *`string`*
*Inherited from Map.[Symbol.toStringTag]*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:130*
___
<a id="size"></a>
## size
**● size**: *`number`*
*Inherited from Map.size*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:28*
___
# Accessors
<a id="type"></a>
## Type
**get Type**(): `E`
*Inherited from Struct.Type*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:160](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L160)*
*__description__*: Returns the Type description to sthe structure
**Returns:** `E`
___
<a id="delay"></a>
## delay
**get delay**(): `BlockNumber`
*Inherited from ReferendumInfo.delay*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/ReferendumInfo.ts:58](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/ReferendumInfo.ts#L58)*
*__description__*: The delay (in blocks) to wait after a successful referendum before deploying
**Returns:** `BlockNumber`
___
<a id="encodedlength"></a>
## encodedLength
**get encodedLength**(): `number`
*Inherited from Struct.encodedLength*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:167](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L167)*
*__description__*: The length of the value when encoded as a Uint8Array
**Returns:** `number`
___
<a id="end"></a>
## end
**get end**(): `BlockNumber`
*Inherited from ReferendumInfo.end*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/ReferendumInfo.ts:37](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/ReferendumInfo.ts#L37)*
*__description__*: When voting on this referendum will end
**Returns:** `BlockNumber`
___
<a id="index"></a>
## index
**get index**(): `ReferendumIndex`
*Defined in [democracy/referendumInfo.ts:33](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/democracy/referendumInfo.ts#L33)*
*__description__*: Convenience getter, returns the referendumIndex
**Returns:** `ReferendumIndex`
___
<a id="isempty"></a>
## isEmpty
**get isEmpty**(): `boolean`
*Inherited from Struct.isEmpty*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:145](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L145)*
*__description__*: Checks if the value is an empty value
**Returns:** `boolean`
___
<a id="proposal"></a>
## proposal
**get proposal**(): `Proposal`
*Inherited from ReferendumInfo.proposal*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/ReferendumInfo.ts:44](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/ReferendumInfo.ts#L44)*
*__description__*: The proposal being voted on
**Returns:** `Proposal`
___
<a id="threshold"></a>
## threshold
**get threshold**(): `VoteThreshold`
*Inherited from ReferendumInfo.threshold*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/ReferendumInfo.ts:51](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/ReferendumInfo.ts#L51)*
*__description__*: The thresholding mechanism to determine whether it passed
**Returns:** `VoteThreshold`
___
# Methods
<a id="___iterator"></a>
## __@iterator
▸ **__@iterator**(): `IterableIterator`<[`keyof S`, `Codec`]>
*Inherited from Map.[Symbol.iterator]*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.iterable.d.ts:113*
Returns an iterable of entries in the map.
**Returns:** `IterableIterator`<[`keyof S`, `Codec`]>
___
<a id="clear"></a>
## clear
▸ **clear**(): `void`
*Inherited from Map.clear*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:22*
**Returns:** `void`
___
<a id="delete"></a>
## delete
▸ **delete**(key: *`keyof S`*): `boolean`
*Inherited from Map.delete*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:23*
**Parameters:**
| Name | Type |
| ------ | ------ |
| key | `keyof S` |
**Returns:** `boolean`
___
<a id="entries"></a>
## entries
▸ **entries**(): `IterableIterator`<[`keyof S`, `Codec`]>
*Inherited from Map.entries*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.iterable.d.ts:118*
Returns an iterable of key, value pairs for every entry in the map.
**Returns:** `IterableIterator`<[`keyof S`, `Codec`]>
___
<a id="eq"></a>
## eq
▸ **eq**(other?: *`any`*): `boolean`
*Inherited from Struct.eq*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:176](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L176)*
*__description__*: Compares the value of the input to see if there is a match
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` other | `any` |
**Returns:** `boolean`
___
<a id="foreach"></a>
## forEach
▸ **forEach**(callbackfn: *`function`*, thisArg?: *`any`*): `void`
*Inherited from Map.forEach*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:24*
**Parameters:**
| Name | Type |
| ------ | ------ |
| callbackfn | `function` |
| `Optional` thisArg | `any` |
**Returns:** `void`
___
<a id="get"></a>
## get
▸ **get**(name: *`keyof S`*): `Codec` \| `undefined`
*Inherited from Struct.get*
*Overrides Map.get*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:184](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L184)*
*__description__*: Returns a specific names entry in the structure
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| name | `keyof S` | The name of the entry to retrieve |
**Returns:** `Codec` \| `undefined`
___
<a id="getatindex"></a>
## getAtIndex
▸ **getAtIndex**(index: *`number`*): `Codec`
*Inherited from Struct.getAtIndex*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:191](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L191)*
*__description__*: Returns the values of a member at a specific index (Rather use get(name) for performance)
**Parameters:**
| Name | Type |
| ------ | ------ |
| index | `number` |
**Returns:** `Codec`
___
<a id="has"></a>
## has
▸ **has**(key: *`keyof S`*): `boolean`
*Inherited from Map.has*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:26*
**Parameters:**
| Name | Type |
| ------ | ------ |
| key | `keyof S` |
**Returns:** `boolean`
___
<a id="keys"></a>
## keys
▸ **keys**(): `IterableIterator`<`keyof S`>
*Inherited from Map.keys*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.iterable.d.ts:123*
Returns an iterable of keys in the map
**Returns:** `IterableIterator`<`keyof S`>
___
<a id="set"></a>
## set
▸ **set**(key: *`keyof S`*, value: *`Codec`*): `this`
*Inherited from Map.set*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:27*
**Parameters:**
| Name | Type |
| ------ | ------ |
| key | `keyof S` |
| value | `Codec` |
**Returns:** `this`
___
<a id="toarray"></a>
## toArray
▸ **toArray**(): `Array`<`Codec`>
*Inherited from Struct.toArray*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:198](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L198)*
*__description__*: Converts the Object to an standard JavaScript Array
**Returns:** `Array`<`Codec`>
___
<a id="tohex"></a>
## toHex
▸ **toHex**(): `string`
*Inherited from Struct.toHex*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:205](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L205)*
*__description__*: Returns a hex string representation of the value
**Returns:** `string`
___
<a id="tojson"></a>
## toJSON
▸ **toJSON**(): `any`
*Overrides Struct.toJSON*
*Defined in [democracy/referendumInfo.ts:40](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/democracy/referendumInfo.ts#L40)*
*__description__*: Creates the JSON representation
**Returns:** `any`
___
<a id="tostring"></a>
## toString
▸ **toString**(): `string`
*Inherited from Struct.toString*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:226](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L226)*
*__description__*: Returns the string representation of the value
**Returns:** `string`
___
<a id="tou8a"></a>
## toU8a
▸ **toU8a**(isBare?: *`undefined` \| `false` \| `true`*): `Uint8Array`
*Inherited from Struct.toU8a*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:234](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L234)*
*__description__*: Encodes the value as a Uint8Array as per the parity-codec specifications
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| `Optional` isBare | `undefined` \| `false` \| `true` | true when the value has none of the type-specific prefixes (internal) |
**Returns:** `Uint8Array`
___
<a id="values"></a>
## values
▸ **values**(): `IterableIterator`<`Codec`>
*Inherited from Map.values*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.iterable.d.ts:128*
Returns an iterable of values in the map
**Returns:** `IterableIterator`<`Codec`>
___
<a id="with"></a>
## `<Static>` with
▸ **with**<`S`>(Types: *`S`*): `Constructor`<`Struct`<`S`>>
*Inherited from Struct.with*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:125](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L125)*
**Type parameters:**
#### S : `ConstructorDef`
**Parameters:**
| Name | Type |
| ------ | ------ |
| Types | `S` |
**Returns:** `Constructor`<`Struct`<`S`>>
___
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,34 +0,0 @@
# Type aliases
<a id="accountidandindex"></a>
## AccountIdAndIndex
**Ƭ AccountIdAndIndex**: *[`undefined` \| `AccountId`, `undefined` \| `AccountIndex`]*
*Defined in [accounts/idAndIndex.ts:16](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/accounts/idAndIndex.ts#L16)*
___
# Functions
<a id="idandindex"></a>
## idAndIndex
▸ **idAndIndex**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [accounts/idAndIndex.ts:18](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/accounts/idAndIndex.ts#L18)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="idtoindex"></a>
## idToIndex
▸ **idToIndex**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [accounts/idToIndex.ts:13](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/accounts/idToIndex.ts#L13)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,38 +0,0 @@
# Type aliases
<a id="accountindexes"></a>
## AccountIndexes
**Ƭ AccountIndexes**: *`object`*
*Defined in [accounts/indexes.ts:13](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/accounts/indexes.ts#L13)*
#### Type declaration
[index: `string`]: `AccountIndex`
___
# Functions
<a id="indexes"></a>
## indexes
▸ **indexes**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [accounts/indexes.ts:15](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/accounts/indexes.ts#L15)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="indextoid"></a>
## indexToId
▸ **indexToId**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [accounts/indexToId.ts:13](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/accounts/indexToId.ts#L13)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="fees"></a>
## fees
▸ **fees**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [balances/fees.ts:13](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/balances/fees.ts#L13)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="validatingbalance"></a>
## validatingBalance
▸ **validatingBalance**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [balances/validatingBalance.ts:16](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/balances/validatingBalance.ts#L16)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="validatingbalances"></a>
## validatingBalances
▸ **validatingBalances**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [balances/validatingBalances.ts:14](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/balances/validatingBalances.ts#L14)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="votingbalance"></a>
## votingBalance
▸ **votingBalance**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [balances/votingBalance.ts:16](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/balances/votingBalance.ts#L16)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="votingbalances"></a>
## votingBalances
▸ **votingBalances**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [balances/votingBalances.ts:13](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/balances/votingBalances.ts#L13)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="votingbalancesnominatorsfor"></a>
## votingBalancesNominatorsFor
▸ **votingBalancesNominatorsFor**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [balances/votingBalancesNominatorsFor.ts:15](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/balances/votingBalancesNominatorsFor.ts#L15)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,32 +0,0 @@
# Functions
<a id="bestnumber"></a>
## bestNumber
▸ **bestNumber**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [chain/bestNumber.ts:23](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/chain/bestNumber.ts#L23)*
*__description__*: Get the latest block number.
*__example__*:
```javascript
api.derive.chain.bestNumber((blockNumber) => {
console.log(`the current best block is #${blockNumber}`);
});
```
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,30 +0,0 @@
# Functions
<a id="bestnumberfinalised"></a>
## bestNumberFinalised
▸ **bestNumberFinalised**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [chain/bestNumberFinalised.ts:23](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/chain/bestNumberFinalised.ts#L23)*
*__description__*: Get the latest finalised block number. example
```javascript
api.derive.chain.bestNumberFinalised((blockNumber) => {
console.log(`the current finalised block is #${blockNumber}`);
});
```
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,32 +0,0 @@
# Functions
<a id="bestnumberlag"></a>
## bestNumberLag
▸ **bestNumberLag**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [chain/bestNumberLag.ts:25](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/chain/bestNumberLag.ts#L25)*
*__description__*: Calculates the lag between finalised head and best head
*__example__*:
```javascript
api.derive.chain.bestNumberLag((lag) => {
console.log(`finalised is ${lag} blocks behind head`);
});
```
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,32 +0,0 @@
# Functions
<a id="getheader"></a>
## getHeader
▸ **getHeader**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [chain/getHeader.ts:25](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/chain/getHeader.ts#L25)*
*__description__*: Get the a specific block header and extend it with the author
*__example__*:
```javascript
const { author, blockNumber } = await api.derive.chain.getHeader('0x123...456');
console.log(`block #${blockNumber} was authored by ${author}`);
```
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,44 +0,0 @@
# Type aliases
<a id="headerandvalidators"></a>
## HeaderAndValidators
**Ƭ HeaderAndValidators**: *[`Header`, `Array`<`AccountId`>]*
*Defined in [chain/subscribeNewHead.ts:12](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/chain/subscribeNewHead.ts#L12)*
___
# Functions
<a id="subscribenewhead"></a>
## subscribeNewHead
▸ **subscribeNewHead**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [chain/subscribeNewHead.ts:25](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/chain/subscribeNewHead.ts#L25)*
*__description__*: Subscribe to block headers and extend it with the author
*__example__*:
```javascript
api.derive.chain.subscribeNewHead(({ author, blockNumber }) => {
console.log(`block #${blockNumber} was authored by ${author}`);
});
```
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,34 +0,0 @@
# Index
### Classes
* [ReferendumInfoExtended](../classes/_democracy_referenduminfo_.referenduminfoextended.md)
### Functions
* [referendumInfo](_democracy_referenduminfo_.md#referenduminfo)
---
# Functions
<a id="referenduminfo"></a>
## referendumInfo
▸ **referendumInfo**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [democracy/referendumInfo.ts:48](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/democracy/referendumInfo.ts#L48)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="referenduminfos"></a>
## referendumInfos
▸ **referendumInfos**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [democracy/referendumInfos.ts:13](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/democracy/referendumInfos.ts#L13)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="referendums"></a>
## referendums
▸ **referendums**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [democracy/referendums.ts:14](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/democracy/referendums.ts#L14)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="referendumvotesfor"></a>
## referendumVotesFor
▸ **referendumVotesFor**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [democracy/referendumVotesFor.ts:16](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/democracy/referendumVotesFor.ts#L16)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="votes"></a>
## votes
▸ **votes**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [democracy/votes.ts:12](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/democracy/votes.ts#L12)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="eralength"></a>
## eraLength
▸ **eraLength**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [session/eraLength.ts:13](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/session/eraLength.ts#L13)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="eraprogress"></a>
## eraProgress
▸ **eraProgress**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [session/eraProgress.ts:14](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/session/eraProgress.ts#L14)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
# Functions
<a id="sessionprogress"></a>
## sessionProgress
▸ **sessionProgress**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [session/sessionProgress.ts:14](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/session/sessionProgress.ts#L14)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
@@ -1,24 +0,0 @@
# Functions
<a id="intentionsbalances"></a>
## intentionsBalances
▸ **intentionsBalances**(api: *`ApiInterface$Rx`*): `(Anonymous function)`
*Defined in [staking/intentionsBalances.ts:17](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/staking/intentionsBalances.ts#L17)*
Get the balances for all intentions and their nominators
**Parameters:**
| Name | Type |
| ------ | ------ |
| api | `ApiInterface$Rx` |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
-51
View File
@@ -1,51 +0,0 @@
# Type aliases
<a id="derivedbalances"></a>
## DerivedBalances
**Ƭ DerivedBalances**: *`object`*
*Defined in [types.ts:8](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/types.ts#L8)*
#### Type declaration
___
<a id="derivedbalancesmap"></a>
## DerivedBalancesMap
**Ƭ DerivedBalancesMap**: *`object`*
*Defined in [types.ts:26](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/types.ts#L26)*
#### Type declaration
[index: `string`]: [DerivedBalances](_types_.md#derivedbalances)
___
<a id="derivedfees"></a>
## DerivedFees
**Ƭ DerivedFees**: *`object`*
*Defined in [types.ts:18](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/types.ts#L18)*
#### Type declaration
___
<a id="derivedreferendumvote"></a>
## DerivedReferendumVote
**Ƭ DerivedReferendumVote**: *`object`*
*Defined in [types.ts:30](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/types.ts#L30)*
#### Type declaration
___
File diff suppressed because one or more lines are too long
-25
View File
@@ -1,25 +0,0 @@
# Functions
<a id="cache"></a>
## `<Const>` cache
▸ **cache**(fn: *`Function`*, map?: *`WeakMap`<`object`, `any`>*): `(Anonymous function)`
*Defined in [util/cache.ts:23](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api-derive/src/util/cache.ts#L23)*
Create memoization for a 2-currified function.
**Parameters:**
| Name | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| fn | `Function` | - | The function to memoize. |
| `Default value` map | `WeakMap`<`object`, `any`> | new WeakMap() | The Map used to cache function returns. |
**Returns:** `(Anonymous function)`
___
File diff suppressed because one or more lines are too long
-2
View File
@@ -1,2 +0,0 @@
-107
View File
@@ -1,107 +0,0 @@
@polkadot/api
=============
The Polkadot-JS API provides easy-to-use wrappers around JSONRPC calls that flow from an application to a node. It handles all the encoding and decoding or parameters, provides access to RPC functions and allows for the query of chain state and the submission of transactions.
The API wrappers provide a standard interface for use -
* A static `.create(<optional ApiOptions>)` that returns an API instance when connected, decorated and ready-to use. ApiOptions can include an optional WsProvider and optional custom type definitions `{ provider: <Optional WsProvider>, types: <Optional RegistryTypes> }`.
* The above is just a wrapper for `new Api(<optional ApiOptions>)`, exposing the `isReady` getter
* `api.rpc.<section>.<method>` provides access to actual RPC calls, be it for queries, submission or retrieving chain information
* [RPC (node interface)](../METHODS_RPC.md)
* `api.query.<section>.<method>` provides access to chain state queries. These are dynamically populated based on what the runtime provides
* [Storage chain state (runtime node interface)](../METHODS_STORAGE.md)
* `api.tx.<section>.<method>` provides the ability to create a transaction, like chain state, this list is populated from a runtime query
* [Extrinsics (runtime node interface)](../METHODS_EXTRINSICS.md)
API Selection
-------------
There are two flavours of the API provided, one allowing a standard interface via JavaScript Promises and the second provides an Observable wrapper using [RxJS](https://github.com/ReactiveX/rxjs). Depending on your use-case and familiarity, you can choose either (or even both) for your application.
* [ApiPromise](classes/_promise_api_.apipromise.md) All interface calls returns Promises, including the static `.create(...)`. Additionally any subscription method uses `(value) => {}` callbacks, returning the value as the subscription is updated.
* [ApiRx](classes/_rx_api_.apirx.md) All interface calls return RxJS Observables, including the static `.create(...)`. In the same fashion subscription-based methods return long-running Observables that update with the latest values.
Dynamic by default
------------------
Substrate (upon which Polkadot is built) uses on-chain WASM runtimes, allowing for upgradability. Each runtime defining the actual chain extrinsics (submitted transactions and block intrinsics) as well as available entries in the chain state. Due to this, the API endpoints for queries and transactions are dynamically populated from the running chain.
Due to this dynamic nature, this API departs from traditional APIs which only has fixed endpoints, driving use by what is available by the runtime. As a start, this generic nature has a learning curve, although the provided documentation, examples and linked documentation tries to make that experience as seamless as possible.
Installation & import
---------------------
Installation -
```
npm install --save @polkadot/api
```
Subscribing to blocks via Promise-based API -
```javascript
import { ApiPromise } from '@polkadot/api';
// initialise via static create
const api = await ApiPromise.create();
// make a call to retrieve the current network head
api.rpc.chain.subscribeNewHead((header) => {
console.log(`Chain is at #${header.blockNumber}`);
});
```
Subscribing to blocks via RxJS-based API -
```javascript
import { ApiRx } from '@polkadot/api';
// initialise via static create
const api = await ApiRx.create().toPromise();
// make a call to retrieve the current network head
api.rpc.chain.subscribeNewHead().subscribe((header) => {
console.log(`Chain is at #${header.blockNumber}`);
});
```
Registering custom types
------------------------
Additional types used by runtime modules can be added when a new instance of the API is created. This is necessary if the runtime modules use types which are not available in the base Substrate runtime.
```javascript
import { ApiPromise } from '@polkadot/api';
// initialise via static create and register custom types
const api = await ApiPromise.create({
types: {
CustomTypesExample: {
"id": "u32",
"data": "Vec<u8>",
"deposit": "Balance",
"owner": "AccountId",
"application_expiry": "Moment",
"whitelisted": "bool",
"challenge_id": "u32"
}
}
});
```
Users
-----
Some of the users of the API (let us know if you are missing from the list), include -
* [Polkadot-JS UI](https://github.com/polkadot-js/apps) A user-interface that allows you to make transactions, query the network or participate in actions on the network such as referendums and staking
* [Polkabot](https://gitlab.com/Polkabot) Polkabot is a Matrix chatbot that keeps an eye on the Polkadot network. You can see Polkabot in action in [https://matrix.to/#/#polkadot-network-status:matrix.org](https://matrix.to/#/#polkadot-network-status:matrix.org)
* [Polkawallet.io](https://polkawallet.io) and [Polkawallet (Github)](https://github.com/polkawallet-io/polkawallet-RN/) A mobile wallet for the Polkadot network to manage funds and make transactions, available on both Androind and iOS
Classes
-------
[Classes](SUMMARY.md)
File diff suppressed because one or more lines are too long
-35
View File
@@ -1,35 +0,0 @@
* [&quot;Base&quot;](modules/_base_.md)
* [ApiBase](classes/_base_.apibase.md)
* [&quot;SubmittableExtrinsic&quot;](modules/_submittableextrinsic_.md)
* [SubmittableExtrinsic](classes/_submittableextrinsic_.submittableextrinsic.md)
* [SubmittableResult](classes/_submittableextrinsic_.submittableresult.md)
* [&quot;checkTypes.manual&quot;](modules/_checktypes_manual_.md)
* [&quot;promise/Api&quot;](modules/_promise_api_.md)
* [ApiPromise](classes/_promise_api_.apipromise.md)
* [&quot;promise/Combinator&quot;](modules/_promise_combinator_.md)
* [Combinator](classes/_promise_combinator_.combinator.md)
* [&quot;promise/types&quot;](modules/_promise_types_.md)
* [ApiPromiseInterface](interfaces/_promise_types_.apipromiseinterface.md)
* [&quot;rx/Api&quot;](modules/_rx_api_.md)
* [ApiRx](classes/_rx_api_.apirx.md)
* [&quot;rx/types&quot;](modules/_rx_types_.md)
* [ApiRxInterface](interfaces/_rx_types_.apirxinterface.md)
* [&quot;types&quot;](modules/_types_.md)
* [ApiBaseInterface](interfaces/_types_.apibaseinterface.md)
* [ApiInterface$Decorated](interfaces/_types_.apiinterface_decorated.md)
* [ApiOptions](interfaces/_types_.apioptions.md)
* [DecoratedRpc](interfaces/_types_.decoratedrpc.md)
* [DecoratedRpc$Method](interfaces/_types_.decoratedrpc_method.md)
* [DecoratedRpc$Section](interfaces/_types_.decoratedrpc_section.md)
* [Derive](interfaces/_types_.derive.md)
* [DeriveMethodBase](interfaces/_types_.derivemethodbase.md)
* [DeriveSection](interfaces/_types_.derivesection.md)
* [QueryableModuleStorage](interfaces/_types_.queryablemodulestorage.md)
* [QueryableStorage](interfaces/_types_.queryablestorage.md)
* [QueryableStorageFunctionBase](interfaces/_types_.queryablestoragefunctionbase.md)
* [Signer](interfaces/_types_.signer.md)
* [SubmittableExtrinsicFunction](interfaces/_types_.submittableextrinsicfunction.md)
* [SubmittableExtrinsics](interfaces/_types_.submittableextrinsics.md)
* [SubmittableModuleExtrinsics](interfaces/_types_.submittablemoduleextrinsics.md)
* [&quot;util/filterEvents&quot;](modules/_util_filterevents_.md)
* [&quot;util/logging&quot;](modules/_util_logging_.md)
File diff suppressed because one or more lines are too long
-345
View File
@@ -1,345 +0,0 @@
# Type parameters
#### CodecResult
#### SubscriptionResult
# Hierarchy
**ApiBase**
↳ [ApiRxInterface](../interfaces/_rx_types_.apirxinterface.md)
↳ [ApiPromiseInterface](../interfaces/_promise_types_.apipromiseinterface.md)
↳ [ApiPromise](_promise_api_.apipromise.md)
↳ [ApiRx](_rx_api_.apirx.md)
# Implements
* [ApiBaseInterface](../interfaces/_types_.apibaseinterface.md)<`CodecResult`, `SubscriptionResult`>
# Constructors
<a id="constructor"></a>
## constructor
⊕ **new ApiBase**(provider?: *[ApiOptions](../interfaces/_types_.apioptions.md) \| `ProviderInterface`*, type: *[ApiType](../modules/_types_.md#apitype)*): [ApiBase](_base_.apibase.md)
*Defined in [Base.ts:81](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L81)*
*__description__*: Create an instance of the class
*__example__*:
```javascript
import Api from '@polkadot/api/promise';
const api = new Api().isReady();
api.rpc.subscribeNewHead((header) => {
console.log(`new block #${header.blockNumber.toNumber()}`);
});
```
**Parameters:**
| Name | Type | Default value |
| ------ | ------ | ------ |
| `Default value` provider | [ApiOptions](../interfaces/_types_.apioptions.md) \| `ProviderInterface` | {} |
| type | [ApiType](../modules/_types_.md#apitype) | - |
**Returns:** [ApiBase](_base_.apibase.md)
___
# Accessors
<a id="derive"></a>
## derive
**get derive**(): [Derive](../interfaces/_types_.derive.md)<`CodecResult`, `SubscriptionResult`>
*Defined in [Base.ts:196](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L196)*
*__description__*: Derived results that are injected into the API, allowing for combinations of various query results.
*__example__*:
```javascript
api.derive.chain.bestNumber((number) => {
console.log('best number', number);
});
```
**Returns:** [Derive](../interfaces/_types_.derive.md)<`CodecResult`, `SubscriptionResult`>
___
<a id="genesishash"></a>
## genesisHash
**get genesisHash**(): `Hash`
*Defined in [Base.ts:132](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L132)*
*__description__*: Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.
**Returns:** `Hash`
___
<a id="hassubscriptions"></a>
## hasSubscriptions
**get hasSubscriptions**(): `boolean`
*Defined in [Base.ts:141](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L141)*
*__description__*: `true` when subscriptions are supported
**Returns:** `boolean`
___
<a id="libraryinfo"></a>
## libraryInfo
**get libraryInfo**(): `string`
*Defined in [Base.ts:148](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L148)*
*__description__*: The library information name & version (from package.json)
**Returns:** `string`
___
<a id="query"></a>
## query
**get query**(): [QueryableStorage](../interfaces/_types_.queryablestorage.md)<`CodecResult`, `SubscriptionResult`>
*Defined in [Base.ts:216](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L216)*
*__description__*: Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.
All calls inside the namespace, is denoted by `section`.`method` and may take an optional query parameter. As an example, `api.query.timestamp.now()` (current block timestamp) does not take parameters, while `api.query.system.accountNonce(<accountId>)` (retrieving the associated nonce for an account), takes the `AccountId` as a parameter.
*__example__*:
```javascript
api.query.balances.freeBalance(<accountId>, (balance) => {
console.log('new balance', balance);
});
```
**Returns:** [QueryableStorage](../interfaces/_types_.queryablestorage.md)<`CodecResult`, `SubscriptionResult`>
___
<a id="rpc"></a>
## rpc
**get rpc**(): [DecoratedRpc](../interfaces/_types_.decoratedrpc.md)<`CodecResult`, `SubscriptionResult`>
*Defined in [Base.ts:236](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L236)*
*__description__*: Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic `api.query` and `api.tx` sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.
RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (usine known keys) and the submission of transactions.
*__example__*:
```javascript
api.rpc.chain.subscribeNewHead((header) => {
console.log('new header', header);
});
```
**Returns:** [DecoratedRpc](../interfaces/_types_.decoratedrpc.md)<`CodecResult`, `SubscriptionResult`>
___
<a id="runtimemetadata"></a>
## runtimeMetadata
**get runtimeMetadata**(): `Metadata`
*Defined in [Base.ts:155](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L155)*
*__description__*: Yields the current attached runtime metadata. Generally this is only used to construct extrinsics & storage, but is useful for current runtime inspection.
**Returns:** `Metadata`
___
<a id="runtimeversion"></a>
## runtimeVersion
**get runtimeVersion**(): `RuntimeVersion`
*Defined in [Base.ts:164](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L164)*
*__description__*: Contains the version information for the current runtime.
**Returns:** `RuntimeVersion`
___
<a id="tx"></a>
## tx
**get tx**(): [SubmittableExtrinsics](../interfaces/_types_.submittableextrinsics.md)<`CodecResult`, `SubscriptionResult`>
*Defined in [Base.ts:254](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L254)*
*__description__*: Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.
*__example__*:
```javascript
api.tx.balances
.transfer(<recipientId>, <balance>)
.signAndSend(<keyPair>, ({status}) => {
console.log('tx status', status.asFinalised.toHex());
});
```
**Returns:** [SubmittableExtrinsics](../interfaces/_types_.submittableextrinsics.md)<`CodecResult`, `SubscriptionResult`>
___
<a id="type"></a>
## type
**get type**(): [ApiType](../modules/_types_.md#apitype)
*Defined in [Base.ts:173](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L173)*
*__description__*: The type of this API instance, either 'rxjs' or 'promise'
**Returns:** [ApiType](../modules/_types_.md#apitype)
___
# Methods
<a id="disconnect"></a>
## disconnect
▸ **disconnect**(): `void`
*Defined in [Base.ts:263](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L263)*
*__description__*: Disconnect from the underlying provider, halting all comms
**Returns:** `void`
___
<a id="on"></a>
## on
▸ **on**(type: *[ApiInterface$Events](../modules/_types_.md#apiinterface_events)*, handler: *`function`*): `this`
*Defined in [Base.ts:286](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L286)*
*__description__*: Attach an eventemitter handler to listen to a specific event
*__example__*:
```javascript
api.on('connected', () => {
console.log('API has been connected to the endpoint');
});
api.on('disconnected', () => {
console.log('API has been disconnected from the endpoint');
});
```
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| type | [ApiInterface$Events](../modules/_types_.md#apiinterface_events) | The type of event to listen to. Available events are \`connected\`, \`disconnected\`, \`ready\` and \`error\` |
| handler | `function` | The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments. |
**Returns:** `this`
___
<a id="once"></a>
## once
▸ **once**(type: *[ApiInterface$Events](../modules/_types_.md#apiinterface_events)*, handler: *`function`*): `this`
*Defined in [Base.ts:311](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L311)*
*__description__*: Attach an one-time eventemitter handler to listen to a specific event
*__example__*:
```javascript
api.once('connected', () => {
console.log('API has been connected to the endpoint');
});
api.once('disconnected', () => {
console.log('API has been disconnected from the endpoint');
});
```
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| type | [ApiInterface$Events](../modules/_types_.md#apiinterface_events) | The type of event to listen to. Available events are \`connected\`, \`disconnected\`, \`ready\` and \`error\` |
| handler | `function` | The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments. |
**Returns:** `this`
___
<a id="registertypes"></a>
## registerTypes
▸ **registerTypes**(types?: *`RegistryTypes`*): `void`
*Defined in [Base.ts:320](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L320)*
*__description__*: Register additional user-defined of chain-specific types in the type registry
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` types | `RegistryTypes` |
**Returns:** `void`
___
<a id="setsigner"></a>
## setSigner
▸ **setSigner**(signer: *[Signer](../interfaces/_types_.signer.md)*): `void`
*Defined in [Base.ts:180](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L180)*
*__description__*: Set an external signer which will be used to sign extrinsic when account passed in is not KeyringPair
**Parameters:**
| Name | Type |
| ------ | ------ |
| signer | [Signer](../interfaces/_types_.signer.md) |
**Returns:** `void`
___
File diff suppressed because one or more lines are too long
@@ -1,551 +0,0 @@
@polkadot/api/promise
=====================
Overview
--------
*__name__*: ApiPromise
*__description__*: ApiPromise is a standard JavaScript wrapper around the RPC and interfaces on the Polkadot network. As a full Promise-based, all interface calls return Promises, including the static `.create(...)`. Subscription calls utilise `(value) => {}` callbacks to pass through the latest values.
The API is well suited to real-time applications where either the single-shot state is needed or use is to be made of the subscription-based features of Polkadot (and Substrate) clients.
*__see__*: [ApiRx](_rx_api_.apirx.md)
Usage
-----
Making rpc calls -
```javascript
import ApiPromise from '@polkadot/api/promise';
// initialise via static create
const api = await ApiPromise.create();
// make a subscription to the network head
api.rpc.chain.subscribeNewHead((header) => {
console.log(`Chain is at #${header.blockNumber}`);
});
```
Subscribing to chain state -
```javascript
import { ApiPromise, WsProvider } from '@polkadot/api';
// initialise a provider with a specific endpoint
const provider = new WsProvider('wss://example.com:9944')
// initialise via isReady & new with specific provider
const api = await new ApiPromise(provider).isReady;
// retrieve the block target time
const blockPeriod = await api.query.timestamp.blockPeriod().toNumber();
let last = 0;
// subscribe to the current block timestamp, updates automatically (callback provided)
api.query.timestamp.now((timestamp) => {
const elapsed = last
? `, ${timestamp.toNumber() - last}s since last`
: '';
last = timestamp.toNumber();
console.log(`timestamp ${timestamp}${elapsed} (${blockPeriod}s target)`);
});
```
Submitting a transaction -
```javascript
import ApiPromise from '@polkadot/api/promise';
ApiPromise.create().then((api) => {
const nonce = await api.query.system.accountNonce(keyring.alice.address());
api.tx.balances
// create transfer
transfer(keyring.bob.address(), 12345)
// sign the transcation
.sign(keyring.alice, { nonce })
// send the transaction (optional status callback)
.send((status) => {
console.log(`current status ${status.type}`);
})
// retrieve the submitted extrinsic hash
.then((hash) => {
console.log(`submitted with hash ${hash}`);
});
});
```
# Hierarchy
[ApiBase](_base_.apibase.md)<[CodecResult](), [SubscriptionResult]()>
**↳ ApiPromise**
# Implements
* [ApiBaseInterface](../interfaces/_types_.apibaseinterface.md)<[CodecResult](), [SubscriptionResult]()>
* [ApiPromiseInterface](../interfaces/_promise_types_.apipromiseinterface.md)
# Constructors
<a id="constructor"></a>
## constructor
⊕ **new ApiPromise**(options?: *[ApiOptions](../interfaces/_types_.apioptions.md) \| `ProviderInterface`*): [ApiPromise](_promise_api_.apipromise.md)
*Overrides [ApiBase](_base_.apibase.md).[constructor](_base_.apibase.md#constructor)*
*Defined in [promise/Api.ts:127](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/promise/Api.ts#L127)*
*__description__*: Creates an instance of the ApiPromise class
*__example__*:
```javascript
import Api from '@polkadot/api/promise';
new Api().isReady.then((api) => {
api.rpc.subscribeNewHead((header) => {
console.log(`new block #${header.blockNumber.toNumber()}`);
});
});
```
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| `Optional` options | [ApiOptions](../interfaces/_types_.apioptions.md) \| `ProviderInterface` | Options to create an instance. This can be either [ApiOptions](../interfaces/_types_.apioptions.md) or an \[\[WsProvider\]\]. |
**Returns:** [ApiPromise](_promise_api_.apipromise.md)
___
# Accessors
<a id="derive"></a>
## derive
**get derive**(): [Derive](../interfaces/_types_.derive.md)<[CodecResult](), [SubscriptionResult]()>
*Inherited from [ApiBase](_base_.apibase.md).[derive](_base_.apibase.md#derive)*
*Defined in [Base.ts:196](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L196)*
*__description__*: Derived results that are injected into the API, allowing for combinations of various query results.
*__example__*:
```javascript
api.derive.chain.bestNumber((number) => {
console.log('best number', number);
});
```
**Returns:** [Derive](../interfaces/_types_.derive.md)<[CodecResult](), [SubscriptionResult]()>
___
<a id="genesishash"></a>
## genesisHash
**get genesisHash**(): `Hash`
*Inherited from [ApiBase](_base_.apibase.md).[genesisHash](_base_.apibase.md#genesishash)*
*Defined in [Base.ts:132](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L132)*
*__description__*: Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.
**Returns:** `Hash`
___
<a id="hassubscriptions"></a>
## hasSubscriptions
**get hasSubscriptions**(): `boolean`
*Inherited from [ApiBase](_base_.apibase.md).[hasSubscriptions](_base_.apibase.md#hassubscriptions)*
*Defined in [Base.ts:141](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L141)*
*__description__*: `true` when subscriptions are supported
**Returns:** `boolean`
___
<a id="isready"></a>
## isReady
**get isReady**(): `Promise`<[ApiPromise](_promise_api_.apipromise.md)>
*Defined in [promise/Api.ts:161](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/promise/Api.ts#L161)*
*__description__*: Promise that returns the first time we are connected and loaded
**Returns:** `Promise`<[ApiPromise](_promise_api_.apipromise.md)>
___
<a id="libraryinfo"></a>
## libraryInfo
**get libraryInfo**(): `string`
*Inherited from [ApiBase](_base_.apibase.md).[libraryInfo](_base_.apibase.md#libraryinfo)*
*Defined in [Base.ts:148](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L148)*
*__description__*: The library information name & version (from package.json)
**Returns:** `string`
___
<a id="query"></a>
## query
**get query**(): [QueryableStorage](../interfaces/_types_.queryablestorage.md)<[CodecResult](), [SubscriptionResult]()>
*Inherited from [ApiBase](_base_.apibase.md).[query](_base_.apibase.md#query)*
*Defined in [Base.ts:216](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L216)*
*__description__*: Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.
All calls inside the namespace, is denoted by `section`.`method` and may take an optional query parameter. As an example, `api.query.timestamp.now()` (current block timestamp) does not take parameters, while `api.query.system.accountNonce(<accountId>)` (retrieving the associated nonce for an account), takes the `AccountId` as a parameter.
*__example__*:
```javascript
api.query.balances.freeBalance(<accountId>, (balance) => {
console.log('new balance', balance);
});
```
**Returns:** [QueryableStorage](../interfaces/_types_.queryablestorage.md)<[CodecResult](), [SubscriptionResult]()>
___
<a id="rpc"></a>
## rpc
**get rpc**(): [DecoratedRpc](../interfaces/_types_.decoratedrpc.md)<[CodecResult](), [SubscriptionResult]()>
*Inherited from [ApiBase](_base_.apibase.md).[rpc](_base_.apibase.md#rpc)*
*Defined in [Base.ts:236](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L236)*
*__description__*: Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic `api.query` and `api.tx` sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.
RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (usine known keys) and the submission of transactions.
*__example__*:
```javascript
api.rpc.chain.subscribeNewHead((header) => {
console.log('new header', header);
});
```
**Returns:** [DecoratedRpc](../interfaces/_types_.decoratedrpc.md)<[CodecResult](), [SubscriptionResult]()>
___
<a id="runtimemetadata"></a>
## runtimeMetadata
**get runtimeMetadata**(): `Metadata`
*Inherited from [ApiBase](_base_.apibase.md).[runtimeMetadata](_base_.apibase.md#runtimemetadata)*
*Defined in [Base.ts:155](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L155)*
*__description__*: Yields the current attached runtime metadata. Generally this is only used to construct extrinsics & storage, but is useful for current runtime inspection.
**Returns:** `Metadata`
___
<a id="runtimeversion"></a>
## runtimeVersion
**get runtimeVersion**(): `RuntimeVersion`
*Inherited from [ApiBase](_base_.apibase.md).[runtimeVersion](_base_.apibase.md#runtimeversion)*
*Defined in [Base.ts:164](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L164)*
*__description__*: Contains the version information for the current runtime.
**Returns:** `RuntimeVersion`
___
<a id="tx"></a>
## tx
**get tx**(): [SubmittableExtrinsics](../interfaces/_types_.submittableextrinsics.md)<[CodecResult](), [SubscriptionResult]()>
*Inherited from [ApiBase](_base_.apibase.md).[tx](_base_.apibase.md#tx)*
*Defined in [Base.ts:254](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L254)*
*__description__*: Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.
*__example__*:
```javascript
api.tx.balances
.transfer(<recipientId>, <balance>)
.signAndSend(<keyPair>, ({status}) => {
console.log('tx status', status.asFinalised.toHex());
});
```
**Returns:** [SubmittableExtrinsics](../interfaces/_types_.submittableextrinsics.md)<[CodecResult](), [SubscriptionResult]()>
___
<a id="type"></a>
## type
**get type**(): [ApiType](../modules/_types_.md#apitype)
*Inherited from [ApiBase](_base_.apibase.md).[type](_base_.apibase.md#type)*
*Defined in [Base.ts:173](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L173)*
*__description__*: The type of this API instance, either 'rxjs' or 'promise'
**Returns:** [ApiType](../modules/_types_.md#apitype)
___
# Methods
<a id="clone"></a>
## clone
▸ **clone**(): [ApiPromise](_promise_api_.apipromise.md)
*Defined in [promise/Api.ts:168](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/promise/Api.ts#L168)*
*__description__*: Returns a clone of this ApiPromise instance (new underlying provider connection)
**Returns:** [ApiPromise](_promise_api_.apipromise.md)
___
<a id="combinelatest"></a>
## combineLatest
▸ **combineLatest**(fns: *`Array`<[CombinatorFunction](../modules/_promise_combinator_.md#combinatorfunction) \| [[CombinatorFunction](../modules/_promise_combinator_.md#combinatorfunction), `Array`]>*, callback: *[CombinatorCallback](../modules/_promise_combinator_.md#combinatorcallback)*): [SubscriptionResult]()
*Defined in [promise/Api.ts:195](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/promise/Api.ts#L195)*
*__description__*: Creates a combinator that can be used to combine the latest results from multiple subscriptions
*__example__*:
```javascript
const address = '5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFacT7';
// combines values from balance & nonce as it updates
api.combineLatest([
api.rpc.chain.subscribeNewHead,
[api.query.balances.freeBalance, address],
(cb) => api.query.system.accountNonce(address, cb)
], ([head, balance, nonce]) => {
console.log(`#${head.number}: You have ${balance} units, with ${nonce} transactions sent`);
});
```
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| fns | `Array`<[CombinatorFunction](../modules/_promise_combinator_.md#combinatorfunction) \| [[CombinatorFunction](../modules/_promise_combinator_.md#combinatorfunction), `Array`]> | An array of function to combine, each in the form of \`(cb: (value: void)) => void\` |
| callback | [CombinatorCallback](../modules/_promise_combinator_.md#combinatorcallback) | A callback that will return an Array of all the values this combinator has been applied to |
**Returns:** [SubscriptionResult]()
___
<a id="disconnect"></a>
## disconnect
▸ **disconnect**(): `void`
*Implementation of [ApiPromiseInterface](../interfaces/_promise_types_.apipromiseinterface.md).[disconnect](../interfaces/_promise_types_.apipromiseinterface.md#disconnect)*
*Inherited from [ApiBase](_base_.apibase.md).[disconnect](_base_.apibase.md#disconnect)*
*Defined in [Base.ts:263](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L263)*
*__description__*: Disconnect from the underlying provider, halting all comms
**Returns:** `void`
___
<a id="on"></a>
## on
▸ **on**(type: *[ApiInterface$Events](../modules/_types_.md#apiinterface_events)*, handler: *`function`*): `this`
*Inherited from [ApiBase](_base_.apibase.md).[on](_base_.apibase.md#on)*
*Defined in [Base.ts:286](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L286)*
*__description__*: Attach an eventemitter handler to listen to a specific event
*__example__*:
```javascript
api.on('connected', () => {
console.log('API has been connected to the endpoint');
});
api.on('disconnected', () => {
console.log('API has been disconnected from the endpoint');
});
```
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| type | [ApiInterface$Events](../modules/_types_.md#apiinterface_events) | The type of event to listen to. Available events are \`connected\`, \`disconnected\`, \`ready\` and \`error\` |
| handler | `function` | The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments. |
**Returns:** `this`
___
<a id="once"></a>
## once
▸ **once**(type: *[ApiInterface$Events](../modules/_types_.md#apiinterface_events)*, handler: *`function`*): `this`
*Inherited from [ApiBase](_base_.apibase.md).[once](_base_.apibase.md#once)*
*Defined in [Base.ts:311](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L311)*
*__description__*: Attach an one-time eventemitter handler to listen to a specific event
*__example__*:
```javascript
api.once('connected', () => {
console.log('API has been connected to the endpoint');
});
api.once('disconnected', () => {
console.log('API has been disconnected from the endpoint');
});
```
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| type | [ApiInterface$Events](../modules/_types_.md#apiinterface_events) | The type of event to listen to. Available events are \`connected\`, \`disconnected\`, \`ready\` and \`error\` |
| handler | `function` | The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments. |
**Returns:** `this`
___
<a id="registertypes"></a>
## registerTypes
▸ **registerTypes**(types?: *`RegistryTypes`*): `void`
*Implementation of [ApiPromiseInterface](../interfaces/_promise_types_.apipromiseinterface.md).[registerTypes](../interfaces/_promise_types_.apipromiseinterface.md#registertypes)*
*Inherited from [ApiBase](_base_.apibase.md).[registerTypes](_base_.apibase.md#registertypes)*
*Defined in [Base.ts:320](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L320)*
*__description__*: Register additional user-defined of chain-specific types in the type registry
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` types | `RegistryTypes` |
**Returns:** `void`
___
<a id="setsigner"></a>
## setSigner
▸ **setSigner**(signer: *[Signer](../interfaces/_types_.signer.md)*): `void`
*Implementation of [ApiPromiseInterface](../interfaces/_promise_types_.apipromiseinterface.md).[setSigner](../interfaces/_promise_types_.apipromiseinterface.md#setsigner)*
*Inherited from [ApiBase](_base_.apibase.md).[setSigner](_base_.apibase.md#setsigner)*
*Defined in [Base.ts:180](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L180)*
*__description__*: Set an external signer which will be used to sign extrinsic when account passed in is not KeyringPair
**Parameters:**
| Name | Type |
| ------ | ------ |
| signer | [Signer](../interfaces/_types_.signer.md) |
**Returns:** `void`
___
<a id="create"></a>
## `<Static>` create
▸ **create**(options?: *[ApiOptions](../interfaces/_types_.apioptions.md) \| `ProviderInterface`*): `Promise`<[ApiPromise](_promise_api_.apipromise.md)>
*Defined in [promise/Api.ts:125](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/promise/Api.ts#L125)*
*__description__*: Creates an ApiPromise instance using the supplied provider. Returns an Promise containing the actual Api instance.
*__example__*:
```javascript
import Api from '@polkadot/api/promise';
Api.create().then(async (api) => {
const timestamp = await api.query.timestamp.now();
console.log(`lastest block timestamp ${timestamp}`);
});
```
**Parameters:**
| Name | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| `Default value` options | [ApiOptions](../interfaces/_types_.apioptions.md) \| `ProviderInterface` | {} | options that is passed to the class contructor. Can be either [ApiOptions](../interfaces/_types_.apioptions.md) or a provider (see the constructor arguments) |
**Returns:** `Promise`<[ApiPromise](_promise_api_.apipromise.md)>
___
File diff suppressed because one or more lines are too long
@@ -1,41 +0,0 @@
# Hierarchy
**Combinator**
# Constructors
<a id="constructor"></a>
## constructor
⊕ **new Combinator**(fns: *`Array`<[CombinatorFunction](../modules/_promise_combinator_.md#combinatorfunction) \| [[CombinatorFunction](../modules/_promise_combinator_.md#combinatorfunction), `Array`]>*, callback: *[CombinatorCallback](../modules/_promise_combinator_.md#combinatorcallback)*): [Combinator](_promise_combinator_.combinator.md)
*Defined in [promise/Combinator.ts:21](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/promise/Combinator.ts#L21)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| fns | `Array`<[CombinatorFunction](../modules/_promise_combinator_.md#combinatorfunction) \| [[CombinatorFunction](../modules/_promise_combinator_.md#combinatorfunction), `Array`]> |
| callback | [CombinatorCallback](../modules/_promise_combinator_.md#combinatorcallback) |
**Returns:** [Combinator](_promise_combinator_.combinator.md)
___
# Methods
<a id="unsubscribe"></a>
## unsubscribe
▸ **unsubscribe**(): `void`
*Defined in [promise/Combinator.ts:67](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/promise/Combinator.ts#L67)*
**Returns:** `void`
___
File diff suppressed because one or more lines are too long
-551
View File
@@ -1,551 +0,0 @@
@polkadot/api/rx
================
Overview
--------
*__name__*: ApiRx
*__description__*: ApiRx is a powerfull RxJS Observable wrapper around the RPC and interfaces on the Polkadot network. As a full Observable API, all interface calls return RxJS Observables, including the static `.create(...)`. In the same fashion and subscription-based methods return long-running Observables that update with the latest values.
The API is well suited to real-time applications where the latest state is needed, unlocking the subscription-based features of Polkadot (and Substrate) clients. Some familiarity with RxJS is a requirement to use the API, however just understanding `.subscribe` and `.pipe` on Observables will unlock full-scale use thereof.
*__see__*: [ApiPromise](_promise_api_.apipromise.md)
Usage
-----
Making rpc calls -
```javascript
import ApiRx from '@polkadot/api/rx';
// initialise via Promise & static create
const api = await ApiRx.create().toPromise();
// make a call to retrieve the current network head
api.rpc.chain.subscribeNewHead().subscribe((header) => {
console.log(`Chain is at #${header.blockNumber}`);
});
```
Subscribing to chain state -
```javascript
import { combineLatest } from 'rxjs';
import { pairwise, switchMap } from 'rxjs/operators';
import { ApiRx, WsProvider } from '@polkadot/api';
// initialise a provider with a specific endpoint
const provider = new WsProvider('wss://example.com:9944')
// initialise via isReady & new with specific provider
new ApiRx(provider)
.isReady
.pipe(
switchMap((api) =>
combineLatest([
api.query.timestamp.blockPeriod(),
api.query.timestamp.now().pipe(pairwise())
])
)
)
.subscribe(([blockPeriod, timestamp]) => {
const elapsed = timestamp[1].toNumber() - timestamp[0].toNumber();
console.log(`timestamp ${timestamp[1]} \nelapsed ${elapsed} \n(${blockPeriod}s target)`);
});
```
Submitting a transaction -
```javascript
import { first, switchMap } from 'rxjs/operators';
import ApiRx from '@polkadot/api/rx';
// import the test keyring (already has dev keys for Alice, Bob, Charlie, Eve & Ferdie)
import testingPairs from '@polkadot/keyring/testingPairs';
const keyring = testingPairs();
// get api via Promise
const api = await ApiRx.create().toPromise();
// retrieve nonce for the account
api.query.system
.accountNonce(keyring.alice.address())
.pipe(
first(),
// pipe nonce into transfer
switchMap((nonce) =>
api.tx.balances
// create transfer
.transfer(keyring.bob.address(), 12345)
// sign the transcation
.sign(keyring.alice, { nonce })
// send the transaction
.send()
)
)
// subscribe to overall result
.subscribe(({ status, type }) => {
if (type === 'Finalised') {
console.log('Completed at block hash', status.asFinalised.toHex());
}
});
```
# Hierarchy
[ApiBase](_base_.apibase.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
**↳ ApiRx**
# Implements
* [ApiBaseInterface](../interfaces/_types_.apibaseinterface.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
* [ApiRxInterface](../interfaces/_rx_types_.apirxinterface.md)
# Constructors
<a id="constructor"></a>
## constructor
⊕ **new ApiRx**(provider?: *[ApiOptions](../interfaces/_types_.apioptions.md) \| `ProviderInterface`*): [ApiRx](_rx_api_.apirx.md)
*Overrides [ApiBase](_base_.apibase.md).[constructor](_base_.apibase.md#constructor)*
*Defined in [rx/Api.ts:141](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/rx/Api.ts#L141)*
*__description__*: Create an instance of the ApiRx class
*__example__*:
```javascript
import { switchMap } from 'rxjs/operators';
import Api from '@polkadot/api/rx';
new Api().isReady
.pipe(
switchMap((api) =>
api.rpc.chain.subscribeNewHead()
))
.subscribe((header) => {
console.log(`new block #${header.blockNumber.toNumber()}`);
});
```
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` provider | [ApiOptions](../interfaces/_types_.apioptions.md) \| `ProviderInterface` |
**Returns:** [ApiRx](_rx_api_.apirx.md)
___
# Accessors
<a id="derive"></a>
## derive
**get derive**(): [Derive](../interfaces/_types_.derive.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
*Inherited from [ApiBase](_base_.apibase.md).[derive](_base_.apibase.md#derive)*
*Defined in [Base.ts:196](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L196)*
*__description__*: Derived results that are injected into the API, allowing for combinations of various query results.
*__example__*:
```javascript
api.derive.chain.bestNumber((number) => {
console.log('best number', number);
});
```
**Returns:** [Derive](../interfaces/_types_.derive.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
___
<a id="genesishash"></a>
## genesisHash
**get genesisHash**(): `Hash`
*Inherited from [ApiBase](_base_.apibase.md).[genesisHash](_base_.apibase.md#genesishash)*
*Defined in [Base.ts:132](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L132)*
*__description__*: Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.
**Returns:** `Hash`
___
<a id="hassubscriptions"></a>
## hasSubscriptions
**get hasSubscriptions**(): `boolean`
*Inherited from [ApiBase](_base_.apibase.md).[hasSubscriptions](_base_.apibase.md#hassubscriptions)*
*Defined in [Base.ts:141](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L141)*
*__description__*: `true` when subscriptions are supported
**Returns:** `boolean`
___
<a id="isconnected"></a>
## isConnected
**get isConnected**(): `Observable`<`boolean`>
*Defined in [rx/Api.ts:181](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/rx/Api.ts#L181)*
*__description__*: Observable that carries the connected state for the provider. Results in a boolean flag that is true/false based on the connectivity.
**Returns:** `Observable`<`boolean`>
___
<a id="isready"></a>
## isReady
**get isReady**(): `Observable`<[ApiRx](_rx_api_.apirx.md)>
*Defined in [rx/Api.ts:188](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/rx/Api.ts#L188)*
*__description__*: Observable that returns the first time we are connected and loaded
**Returns:** `Observable`<[ApiRx](_rx_api_.apirx.md)>
___
<a id="libraryinfo"></a>
## libraryInfo
**get libraryInfo**(): `string`
*Inherited from [ApiBase](_base_.apibase.md).[libraryInfo](_base_.apibase.md#libraryinfo)*
*Defined in [Base.ts:148](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L148)*
*__description__*: The library information name & version (from package.json)
**Returns:** `string`
___
<a id="query"></a>
## query
**get query**(): [QueryableStorage](../interfaces/_types_.queryablestorage.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
*Inherited from [ApiBase](_base_.apibase.md).[query](_base_.apibase.md#query)*
*Defined in [Base.ts:216](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L216)*
*__description__*: Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.
All calls inside the namespace, is denoted by `section`.`method` and may take an optional query parameter. As an example, `api.query.timestamp.now()` (current block timestamp) does not take parameters, while `api.query.system.accountNonce(<accountId>)` (retrieving the associated nonce for an account), takes the `AccountId` as a parameter.
*__example__*:
```javascript
api.query.balances.freeBalance(<accountId>, (balance) => {
console.log('new balance', balance);
});
```
**Returns:** [QueryableStorage](../interfaces/_types_.queryablestorage.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
___
<a id="rpc"></a>
## rpc
**get rpc**(): [DecoratedRpc](../interfaces/_types_.decoratedrpc.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
*Inherited from [ApiBase](_base_.apibase.md).[rpc](_base_.apibase.md#rpc)*
*Defined in [Base.ts:236](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L236)*
*__description__*: Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic `api.query` and `api.tx` sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.
RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (usine known keys) and the submission of transactions.
*__example__*:
```javascript
api.rpc.chain.subscribeNewHead((header) => {
console.log('new header', header);
});
```
**Returns:** [DecoratedRpc](../interfaces/_types_.decoratedrpc.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
___
<a id="runtimemetadata"></a>
## runtimeMetadata
**get runtimeMetadata**(): `Metadata`
*Inherited from [ApiBase](_base_.apibase.md).[runtimeMetadata](_base_.apibase.md#runtimemetadata)*
*Defined in [Base.ts:155](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L155)*
*__description__*: Yields the current attached runtime metadata. Generally this is only used to construct extrinsics & storage, but is useful for current runtime inspection.
**Returns:** `Metadata`
___
<a id="runtimeversion"></a>
## runtimeVersion
**get runtimeVersion**(): `RuntimeVersion`
*Inherited from [ApiBase](_base_.apibase.md).[runtimeVersion](_base_.apibase.md#runtimeversion)*
*Defined in [Base.ts:164](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L164)*
*__description__*: Contains the version information for the current runtime.
**Returns:** `RuntimeVersion`
___
<a id="tx"></a>
## tx
**get tx**(): [SubmittableExtrinsics](../interfaces/_types_.submittableextrinsics.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
*Inherited from [ApiBase](_base_.apibase.md).[tx](_base_.apibase.md#tx)*
*Defined in [Base.ts:254](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L254)*
*__description__*: Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.
*__example__*:
```javascript
api.tx.balances
.transfer(<recipientId>, <balance>)
.signAndSend(<keyPair>, ({status}) => {
console.log('tx status', status.asFinalised.toHex());
});
```
**Returns:** [SubmittableExtrinsics](../interfaces/_types_.submittableextrinsics.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
___
<a id="type"></a>
## type
**get type**(): [ApiType](../modules/_types_.md#apitype)
*Inherited from [ApiBase](_base_.apibase.md).[type](_base_.apibase.md#type)*
*Defined in [Base.ts:173](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L173)*
*__description__*: The type of this API instance, either 'rxjs' or 'promise'
**Returns:** [ApiType](../modules/_types_.md#apitype)
___
# Methods
<a id="clone"></a>
## clone
▸ **clone**(): [ApiRx](_rx_api_.apirx.md)
*Defined in [rx/Api.ts:195](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/rx/Api.ts#L195)*
*__description__*: Returns a clone of this ApiRx instance (new underlying provider connection)
**Returns:** [ApiRx](_rx_api_.apirx.md)
___
<a id="disconnect"></a>
## disconnect
▸ **disconnect**(): `void`
*Implementation of [ApiRxInterface](../interfaces/_rx_types_.apirxinterface.md).[disconnect](../interfaces/_rx_types_.apirxinterface.md#disconnect)*
*Inherited from [ApiBase](_base_.apibase.md).[disconnect](_base_.apibase.md#disconnect)*
*Defined in [Base.ts:263](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L263)*
*__description__*: Disconnect from the underlying provider, halting all comms
**Returns:** `void`
___
<a id="on"></a>
## on
▸ **on**(type: *[ApiInterface$Events](../modules/_types_.md#apiinterface_events)*, handler: *`function`*): `this`
*Inherited from [ApiBase](_base_.apibase.md).[on](_base_.apibase.md#on)*
*Defined in [Base.ts:286](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L286)*
*__description__*: Attach an eventemitter handler to listen to a specific event
*__example__*:
```javascript
api.on('connected', () => {
console.log('API has been connected to the endpoint');
});
api.on('disconnected', () => {
console.log('API has been disconnected from the endpoint');
});
```
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| type | [ApiInterface$Events](../modules/_types_.md#apiinterface_events) | The type of event to listen to. Available events are \`connected\`, \`disconnected\`, \`ready\` and \`error\` |
| handler | `function` | The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments. |
**Returns:** `this`
___
<a id="once"></a>
## once
▸ **once**(type: *[ApiInterface$Events](../modules/_types_.md#apiinterface_events)*, handler: *`function`*): `this`
*Inherited from [ApiBase](_base_.apibase.md).[once](_base_.apibase.md#once)*
*Defined in [Base.ts:311](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L311)*
*__description__*: Attach an one-time eventemitter handler to listen to a specific event
*__example__*:
```javascript
api.once('connected', () => {
console.log('API has been connected to the endpoint');
});
api.once('disconnected', () => {
console.log('API has been disconnected from the endpoint');
});
```
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| type | [ApiInterface$Events](../modules/_types_.md#apiinterface_events) | The type of event to listen to. Available events are \`connected\`, \`disconnected\`, \`ready\` and \`error\` |
| handler | `function` | The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments. |
**Returns:** `this`
___
<a id="registertypes"></a>
## registerTypes
▸ **registerTypes**(types?: *`RegistryTypes`*): `void`
*Implementation of [ApiRxInterface](../interfaces/_rx_types_.apirxinterface.md).[registerTypes](../interfaces/_rx_types_.apirxinterface.md#registertypes)*
*Inherited from [ApiBase](_base_.apibase.md).[registerTypes](_base_.apibase.md#registertypes)*
*Defined in [Base.ts:320](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L320)*
*__description__*: Register additional user-defined of chain-specific types in the type registry
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` types | `RegistryTypes` |
**Returns:** `void`
___
<a id="setsigner"></a>
## setSigner
▸ **setSigner**(signer: *[Signer](../interfaces/_types_.signer.md)*): `void`
*Implementation of [ApiRxInterface](../interfaces/_rx_types_.apirxinterface.md).[setSigner](../interfaces/_rx_types_.apirxinterface.md#setsigner)*
*Inherited from [ApiBase](_base_.apibase.md).[setSigner](_base_.apibase.md#setsigner)*
*Defined in [Base.ts:180](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L180)*
*__description__*: Set an external signer which will be used to sign extrinsic when account passed in is not KeyringPair
**Parameters:**
| Name | Type |
| ------ | ------ |
| signer | [Signer](../interfaces/_types_.signer.md) |
**Returns:** `void`
___
<a id="create"></a>
## `<Static>` create
▸ **create**(options?: *[ApiOptions](../interfaces/_types_.apioptions.md) \| `ProviderInterface`*): `Observable`<[ApiRx](_rx_api_.apirx.md)>
*Defined in [rx/Api.ts:139](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/rx/Api.ts#L139)*
*__description__*: Creates an ApiRx instance using the supplied provider. Returns an Observable containing the actual Api instance.
*__example__*:
```javascript
import { switchMap } from 'rxjs/operators';
import Api from '@polkadot/api/rx';
Api.create()
.pipe(
switchMap((api) =>
api.rpc.chain.subscribeNewHead()
))
.subscribe((header) => {
console.log(`new block #${header.blockNumber.toNumber()}`);
});
```
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| `Optional` options | [ApiOptions](../interfaces/_types_.apioptions.md) \| `ProviderInterface` | options that is passed to the class contructor. Can be either [ApiOptions](../interfaces/_types_.apioptions.md) or \[\[WsProvider\]\] |
**Returns:** `Observable`<[ApiRx](_rx_api_.apirx.md)>
___
File diff suppressed because one or more lines are too long
@@ -1,699 +0,0 @@
# Type parameters
#### CodecResult
#### SubscriptionResult
#### S : `ConstructorDef`
#### T : `object`
#### V : `object`
#### E : `object`
# Hierarchy
`Extrinsic`
**↳ SubmittableExtrinsic**
# Implements
* `Codec`
# Constructors
<a id="constructor"></a>
## constructor
⊕ **new SubmittableExtrinsic**(type: *[ApiType](../modules/_types_.md#apitype)*, api: *[ApiInterface$Rx](../modules/_types_.md#apiinterface_rx)*, onCall: *[OnCallDefinition](../modules/_types_.md#oncalldefinition)<`CodecResult`, `SubscriptionResult`>*, extrinsic: *`Extrinsic` \| `Method`*): [SubmittableExtrinsic](_submittableextrinsic_.submittableextrinsic.md)
*Overrides Extrinsic.__constructor*
*Defined in [SubmittableExtrinsic.ts:62](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/SubmittableExtrinsic.ts#L62)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| type | [ApiType](../modules/_types_.md#apitype) |
| api | [ApiInterface$Rx](../modules/_types_.md#apiinterface_rx) |
| onCall | [OnCallDefinition](../modules/_types_.md#oncalldefinition)<`CodecResult`, `SubscriptionResult`> |
| extrinsic | `Extrinsic` \| `Method` |
**Returns:** [SubmittableExtrinsic](_submittableextrinsic_.submittableextrinsic.md)
___
# Properties
<a id="___tostringtag"></a>
## __@toStringTag
**● __@toStringTag**: *`string`*
*Inherited from Map.[Symbol.toStringTag]*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:130*
___
<a id="size"></a>
## size
**● size**: *`number`*
*Inherited from Map.size*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:28*
___
# Accessors
<a id="type"></a>
## Type
**get Type**(): `E`
*Inherited from Struct.Type*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:160](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L160)*
*__description__*: Returns the Type description to sthe structure
**Returns:** `E`
___
<a id="args"></a>
## args
**get args**(): `Array`<`Codec`>
*Inherited from Extrinsic.args*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:76](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L76)*
*__description__*: The arguments passed to for the call, exposes args so it is compatible with \[\[Method\]\]
**Returns:** `Array`<`Codec`>
___
<a id="callindex"></a>
## callIndex
**get callIndex**(): `Uint8Array`
*Inherited from Extrinsic.callIndex*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:83](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L83)*
*__description__*: The actual `[sectionIndex, methodIndex]` as used in the Method
**Returns:** `Uint8Array`
___
<a id="data"></a>
## data
**get data**(): `Uint8Array`
*Inherited from Extrinsic.data*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:90](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L90)*
*__description__*: The actual data for the Method
**Returns:** `Uint8Array`
___
<a id="encodedlength"></a>
## encodedLength
**get encodedLength**(): `number`
*Inherited from Extrinsic.encodedLength*
*Overrides Struct.encodedLength*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:97](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L97)*
*__description__*: The length of the value when encoded as a Uint8Array
**Returns:** `number`
___
<a id="hash"></a>
## hash
**get hash**(): `Hash`
*Inherited from Extrinsic.hash*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:106](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L106)*
*__description__*: Convernience function, encodes the extrinsic and returns the actual hash
**Returns:** `Hash`
___
<a id="isempty"></a>
## isEmpty
**get isEmpty**(): `boolean`
*Inherited from Struct.isEmpty*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:145](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L145)*
*__description__*: Checks if the value is an empty value
**Returns:** `boolean`
___
<a id="issigned"></a>
## isSigned
**get isSigned**(): `boolean`
*Inherited from Extrinsic.isSigned*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:115](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L115)*
*__description__*: `true` id the extrinsic is signed
**Returns:** `boolean`
___
<a id="length"></a>
## length
**get length**(): `number`
*Inherited from Extrinsic.length*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:122](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L122)*
*__description__*: The length of the encoded value
**Returns:** `number`
___
<a id="meta"></a>
## meta
**get meta**(): `FunctionMetadata`
*Inherited from Extrinsic.meta*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:129](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L129)*
*__description__*: The \[\[FunctionMetadata\]\] that describes the extrinsic
**Returns:** `FunctionMetadata`
___
<a id="method"></a>
## method
**get method**(): `Method`
*Inherited from Extrinsic.method*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:136](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L136)*
*__description__*: The \[\[Method\]\] this extrinsic wraps
**Returns:** `Method`
___
<a id="signature"></a>
## signature
**get signature**(): `ExtrinsicSignature`
*Inherited from Extrinsic.signature*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:143](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L143)*
*__description__*: The \[\[ExtrinsicSignature\]\]
**Returns:** `ExtrinsicSignature`
___
# Methods
<a id="___iterator"></a>
## __@iterator
▸ **__@iterator**(): `IterableIterator`<[`keyof S`, `Codec`]>
*Inherited from Map.[Symbol.iterator]*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.iterable.d.ts:113*
Returns an iterable of entries in the map.
**Returns:** `IterableIterator`<[`keyof S`, `Codec`]>
___
<a id="addsignature"></a>
## addSignature
▸ **addSignature**(signer: *`Address` \| `Uint8Array`*, signature: *`Uint8Array`*, nonce: *`AnyNumber`*, era?: *`Uint8Array`*): `Extrinsic`
*Inherited from Extrinsic.addSignature*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:150](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L150)*
*__description__*: Add an \[\[ExtrinsicSignature\]\] to the extrinsic (already generated)
**Parameters:**
| Name | Type |
| ------ | ------ |
| signer | `Address` \| `Uint8Array` |
| signature | `Uint8Array` |
| nonce | `AnyNumber` |
| `Optional` era | `Uint8Array` |
**Returns:** `Extrinsic`
___
<a id="clear"></a>
## clear
▸ **clear**(): `void`
*Inherited from Map.clear*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:22*
**Returns:** `void`
___
<a id="delete"></a>
## delete
▸ **delete**(key: *`keyof S`*): `boolean`
*Inherited from Map.delete*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:23*
**Parameters:**
| Name | Type |
| ------ | ------ |
| key | `keyof S` |
**Returns:** `boolean`
___
<a id="entries"></a>
## entries
▸ **entries**(): `IterableIterator`<[`keyof S`, `Codec`]>
*Inherited from Map.entries*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.iterable.d.ts:118*
Returns an iterable of key, value pairs for every entry in the map.
**Returns:** `IterableIterator`<[`keyof S`, `Codec`]>
___
<a id="eq"></a>
## eq
▸ **eq**(other?: *`any`*): `boolean`
*Inherited from Struct.eq*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:176](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L176)*
*__description__*: Compares the value of the input to see if there is a match
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` other | `any` |
**Returns:** `boolean`
___
<a id="foreach"></a>
## forEach
▸ **forEach**(callbackfn: *`function`*, thisArg?: *`any`*): `void`
*Inherited from Map.forEach*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:24*
**Parameters:**
| Name | Type |
| ------ | ------ |
| callbackfn | `function` |
| `Optional` thisArg | `any` |
**Returns:** `void`
___
<a id="get"></a>
## get
▸ **get**(name: *`keyof S`*): `Codec` \| `undefined`
*Inherited from Struct.get*
*Overrides Map.get*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:184](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L184)*
*__description__*: Returns a specific names entry in the structure
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| name | `keyof S` | The name of the entry to retrieve |
**Returns:** `Codec` \| `undefined`
___
<a id="getatindex"></a>
## getAtIndex
▸ **getAtIndex**(index: *`number`*): `Codec`
*Inherited from Struct.getAtIndex*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:191](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L191)*
*__description__*: Returns the values of a member at a specific index (Rather use get(name) for performance)
**Parameters:**
| Name | Type |
| ------ | ------ |
| index | `number` |
**Returns:** `Codec`
___
<a id="has"></a>
## has
▸ **has**(key: *`keyof S`*): `boolean`
*Inherited from Map.has*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:26*
**Parameters:**
| Name | Type |
| ------ | ------ |
| key | `keyof S` |
**Returns:** `boolean`
___
<a id="keys"></a>
## keys
▸ **keys**(): `IterableIterator`<`keyof S`>
*Inherited from Map.keys*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.iterable.d.ts:123*
Returns an iterable of keys in the map
**Returns:** `IterableIterator`<`keyof S`>
___
<a id="send"></a>
## send
▸ **send**(): `SumbitableResultResult`<`CodecResult`, `SubscriptionResult`>
▸ **send**(statusCb: *`function`*): `SumbitableResultSubscription`<`CodecResult`, `SubscriptionResult`>
*Defined in [SubmittableExtrinsic.ts:135](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/SubmittableExtrinsic.ts#L135)*
**Returns:** `SumbitableResultResult`<`CodecResult`, `SubscriptionResult`>
*Defined in [SubmittableExtrinsic.ts:136](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/SubmittableExtrinsic.ts#L136)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| statusCb | `function` |
**Returns:** `SumbitableResultSubscription`<`CodecResult`, `SubscriptionResult`>
___
<a id="set"></a>
## set
▸ **set**(key: *`keyof S`*, value: *`Codec`*): `this`
*Inherited from Map.set*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:27*
**Parameters:**
| Name | Type |
| ------ | ------ |
| key | `keyof S` |
| value | `Codec` |
**Returns:** `this`
___
<a id="sign"></a>
## sign
▸ **sign**(account: *`KeyringPair`*, _options: *`Partial`<`SignatureOptions`>*): [SubmittableExtrinsic](_submittableextrinsic_.submittableextrinsic.md)<`CodecResult`, `SubscriptionResult`>
*Overrides Extrinsic.sign*
*Defined in [SubmittableExtrinsic.ts:153](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/SubmittableExtrinsic.ts#L153)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| account | `KeyringPair` |
| _options | `Partial`<`SignatureOptions`> |
**Returns:** [SubmittableExtrinsic](_submittableextrinsic_.submittableextrinsic.md)<`CodecResult`, `SubscriptionResult`>
___
<a id="signandsend"></a>
## signAndSend
▸ **signAndSend**(account: *`KeyringPair` \| `string` \| `AccountId` \| `Address`*, options?: *`Partial`<`Partial`<`SignatureOptions`>>*): `SumbitableResultResult`<`CodecResult`, `SubscriptionResult`>
▸ **signAndSend**(account: *`KeyringPair` \| `string` \| `AccountId` \| `Address`*, statusCb: *`StatusCb`*): `SumbitableResultSubscription`<`CodecResult`, `SubscriptionResult`>
*Defined in [SubmittableExtrinsic.ts:165](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/SubmittableExtrinsic.ts#L165)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| account | `KeyringPair` \| `string` \| `AccountId` \| `Address` |
| `Optional` options | `Partial`<`Partial`<`SignatureOptions`>> |
**Returns:** `SumbitableResultResult`<`CodecResult`, `SubscriptionResult`>
*Defined in [SubmittableExtrinsic.ts:166](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/SubmittableExtrinsic.ts#L166)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| account | `KeyringPair` \| `string` \| `AccountId` \| `Address` |
| statusCb | `StatusCb` |
**Returns:** `SumbitableResultSubscription`<`CodecResult`, `SubscriptionResult`>
___
<a id="toarray"></a>
## toArray
▸ **toArray**(): `Array`<`Codec`>
*Inherited from Struct.toArray*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:198](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L198)*
*__description__*: Converts the Object to an standard JavaScript Array
**Returns:** `Array`<`Codec`>
___
<a id="tohex"></a>
## toHex
▸ **toHex**(): `string`
*Inherited from Extrinsic.toHex*
*Overrides Struct.toHex*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:168](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L168)*
*__description__*: Returns a hex string representation of the value
**Returns:** `string`
___
<a id="tojson"></a>
## toJSON
▸ **toJSON**(): `any`
*Inherited from Extrinsic.toJSON*
*Overrides Struct.toJSON*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:175](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L175)*
*__description__*: Converts the Object to JSON, typically used for RPC transfers
**Returns:** `any`
___
<a id="tostring"></a>
## toString
▸ **toString**(): `string`
*Inherited from Struct.toString*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:226](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L226)*
*__description__*: Returns the string representation of the value
**Returns:** `string`
___
<a id="tou8a"></a>
## toU8a
▸ **toU8a**(isBare?: *`undefined` \| `false` \| `true`*): `Uint8Array`
*Inherited from Extrinsic.toU8a*
*Overrides Struct.toU8a*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:183](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L183)*
*__description__*: Encodes the value as a Uint8Array as per the parity-codec specifications
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| `Optional` isBare | `undefined` \| `false` \| `true` | true when the value has none of the type-specific prefixes (internal) |
**Returns:** `Uint8Array`
___
<a id="values"></a>
## values
▸ **values**(): `IterableIterator`<`Codec`>
*Inherited from Map.values*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.iterable.d.ts:128*
Returns an iterable of values in the map
**Returns:** `IterableIterator`<`Codec`>
___
<a id="decodeextrinsic"></a>
## `<Static>` decodeExtrinsic
▸ **decodeExtrinsic**(value: *`ExtrinsicValue` \| `AnyU8a` \| `Method`*): `ExtrinsicValue` \| `Array`<`number`> \| `Uint8Array`
*Inherited from Extrinsic.decodeExtrinsic*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/type/Extrinsic.ts:44](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/type/Extrinsic.ts#L44)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| value | `ExtrinsicValue` \| `AnyU8a` \| `Method` |
**Returns:** `ExtrinsicValue` \| `Array`<`number`> \| `Uint8Array`
___
<a id="with"></a>
## `<Static>` with
▸ **with**<`S`>(Types: *`S`*): `Constructor`<`Struct`<`S`>>
*Inherited from Struct.with*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:125](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L125)*
**Type parameters:**
#### S : `ConstructorDef`
**Parameters:**
| Name | Type |
| ------ | ------ |
| Types | `S` |
**Returns:** `Constructor`<`Struct`<`S`>>
___
File diff suppressed because one or more lines are too long
@@ -1,473 +0,0 @@
# Type parameters
#### S : `ConstructorDef`
#### T : `object`
#### V : `object`
#### E : `object`
# Hierarchy
`Struct`
**↳ SubmittableResult**
# Implements
* `Codec`
# Constructors
<a id="constructor"></a>
## constructor
⊕ **new SubmittableResult**(value?: *`any`*): [SubmittableResult](_submittableextrinsic_.submittableresult.md)
*Overrides Struct.__constructor*
*Defined in [SubmittableExtrinsic.ts:28](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/SubmittableExtrinsic.ts#L28)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` value | `any` |
**Returns:** [SubmittableResult](_submittableextrinsic_.submittableresult.md)
___
# Properties
<a id="___tostringtag"></a>
## __@toStringTag
**● __@toStringTag**: *`string`*
*Inherited from Map.[Symbol.toStringTag]*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:130*
___
<a id="size"></a>
## size
**● size**: *`number`*
*Inherited from Map.size*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:28*
___
# Accessors
<a id="type"></a>
## Type
**get Type**(): `E`
*Inherited from Struct.Type*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:160](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L160)*
*__description__*: Returns the Type description to sthe structure
**Returns:** `E`
___
<a id="encodedlength"></a>
## encodedLength
**get encodedLength**(): `number`
*Inherited from Struct.encodedLength*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:167](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L167)*
*__description__*: The length of the value when encoded as a Uint8Array
**Returns:** `number`
___
<a id="events"></a>
## events
**get events**(): `Array`<`EventRecord`>
*Defined in [SubmittableExtrinsic.ts:40](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/SubmittableExtrinsic.ts#L40)*
*__description__*: the contained events
**Returns:** `Array`<`EventRecord`>
___
<a id="isempty"></a>
## isEmpty
**get isEmpty**(): `boolean`
*Inherited from Struct.isEmpty*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:145](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L145)*
*__description__*: Checks if the value is an empty value
**Returns:** `boolean`
___
<a id="status"></a>
## status
**get status**(): `ExtrinsicStatus`
*Defined in [SubmittableExtrinsic.ts:47](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/SubmittableExtrinsic.ts#L47)*
*__description__*: the status
**Returns:** `ExtrinsicStatus`
___
<a id="type-1"></a>
## type
**get type**(): `string`
*Defined in [SubmittableExtrinsic.ts:54](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/SubmittableExtrinsic.ts#L54)*
*__description__*: the type
**Returns:** `string`
___
# Methods
<a id="___iterator"></a>
## __@iterator
▸ **__@iterator**(): `IterableIterator`<[`keyof S`, `Codec`]>
*Inherited from Map.[Symbol.iterator]*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.iterable.d.ts:113*
Returns an iterable of entries in the map.
**Returns:** `IterableIterator`<[`keyof S`, `Codec`]>
___
<a id="clear"></a>
## clear
▸ **clear**(): `void`
*Inherited from Map.clear*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:22*
**Returns:** `void`
___
<a id="delete"></a>
## delete
▸ **delete**(key: *`keyof S`*): `boolean`
*Inherited from Map.delete*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:23*
**Parameters:**
| Name | Type |
| ------ | ------ |
| key | `keyof S` |
**Returns:** `boolean`
___
<a id="entries"></a>
## entries
▸ **entries**(): `IterableIterator`<[`keyof S`, `Codec`]>
*Inherited from Map.entries*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.iterable.d.ts:118*
Returns an iterable of key, value pairs for every entry in the map.
**Returns:** `IterableIterator`<[`keyof S`, `Codec`]>
___
<a id="eq"></a>
## eq
▸ **eq**(other?: *`any`*): `boolean`
*Inherited from Struct.eq*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:176](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L176)*
*__description__*: Compares the value of the input to see if there is a match
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` other | `any` |
**Returns:** `boolean`
___
<a id="foreach"></a>
## forEach
▸ **forEach**(callbackfn: *`function`*, thisArg?: *`any`*): `void`
*Inherited from Map.forEach*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:24*
**Parameters:**
| Name | Type |
| ------ | ------ |
| callbackfn | `function` |
| `Optional` thisArg | `any` |
**Returns:** `void`
___
<a id="get"></a>
## get
▸ **get**(name: *`keyof S`*): `Codec` \| `undefined`
*Inherited from Struct.get*
*Overrides Map.get*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:184](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L184)*
*__description__*: Returns a specific names entry in the structure
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| name | `keyof S` | The name of the entry to retrieve |
**Returns:** `Codec` \| `undefined`
___
<a id="getatindex"></a>
## getAtIndex
▸ **getAtIndex**(index: *`number`*): `Codec`
*Inherited from Struct.getAtIndex*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:191](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L191)*
*__description__*: Returns the values of a member at a specific index (Rather use get(name) for performance)
**Parameters:**
| Name | Type |
| ------ | ------ |
| index | `number` |
**Returns:** `Codec`
___
<a id="has"></a>
## has
▸ **has**(key: *`keyof S`*): `boolean`
*Inherited from Map.has*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:26*
**Parameters:**
| Name | Type |
| ------ | ------ |
| key | `keyof S` |
**Returns:** `boolean`
___
<a id="keys"></a>
## keys
▸ **keys**(): `IterableIterator`<`keyof S`>
*Inherited from Map.keys*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.iterable.d.ts:123*
Returns an iterable of keys in the map
**Returns:** `IterableIterator`<`keyof S`>
___
<a id="set"></a>
## set
▸ **set**(key: *`keyof S`*, value: *`Codec`*): `this`
*Inherited from Map.set*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.collection.d.ts:27*
**Parameters:**
| Name | Type |
| ------ | ------ |
| key | `keyof S` |
| value | `Codec` |
**Returns:** `this`
___
<a id="toarray"></a>
## toArray
▸ **toArray**(): `Array`<`Codec`>
*Inherited from Struct.toArray*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:198](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L198)*
*__description__*: Converts the Object to an standard JavaScript Array
**Returns:** `Array`<`Codec`>
___
<a id="tohex"></a>
## toHex
▸ **toHex**(): `string`
*Inherited from Struct.toHex*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:205](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L205)*
*__description__*: Returns a hex string representation of the value
**Returns:** `string`
___
<a id="tojson"></a>
## toJSON
▸ **toJSON**(): `any`
*Inherited from Struct.toJSON*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:212](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L212)*
*__description__*: Converts the Object to JSON, typically used for RPC transfers
**Returns:** `any`
___
<a id="tostring"></a>
## toString
▸ **toString**(): `string`
*Inherited from Struct.toString*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:226](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L226)*
*__description__*: Returns the string representation of the value
**Returns:** `string`
___
<a id="tou8a"></a>
## toU8a
▸ **toU8a**(isBare?: *`undefined` \| `false` \| `true`*): `Uint8Array`
*Inherited from Struct.toU8a*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:234](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L234)*
*__description__*: Encodes the value as a Uint8Array as per the parity-codec specifications
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| `Optional` isBare | `undefined` \| `false` \| `true` | true when the value has none of the type-specific prefixes (internal) |
**Returns:** `Uint8Array`
___
<a id="values"></a>
## values
▸ **values**(): `IterableIterator`<`Codec`>
*Inherited from Map.values*
*Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es2015.iterable.d.ts:128*
Returns an iterable of values in the map
**Returns:** `IterableIterator`<`Codec`>
___
<a id="with"></a>
## `<Static>` with
▸ **with**<`S`>(Types: *`S`*): `Constructor`<`Struct`<`S`>>
*Inherited from Struct.with*
*Defined in [/home/travis/build/polkadot-js/api/packages/types/src/codec/Struct.ts:125](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/types/src/codec/Struct.ts#L125)*
**Type parameters:**
#### S : `ConstructorDef`
**Parameters:**
| Name | Type |
| ------ | ------ |
| Types | `S` |
**Returns:** `Constructor`<`Struct`<`S`>>
___
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,384 +0,0 @@
# Hierarchy
[ApiBase](../classes/_base_.apibase.md)<[CodecResult](../modules/_promise_types_.md#codecresult), [SubscriptionResult](../modules/_promise_types_.md#subscriptionresult)>
**↳ ApiPromiseInterface**
# Implements
* [ApiBaseInterface](_types_.apibaseinterface.md)<[CodecResult](../modules/_promise_types_.md#codecresult), [SubscriptionResult](../modules/_promise_types_.md#subscriptionresult)>
# Implemented by
* [ApiPromise](../classes/_promise_api_.apipromise.md)
# Constructors
<a id="constructor"></a>
## constructor
⊕ **new ApiPromiseInterface**(provider?: *[ApiOptions](_types_.apioptions.md) \| `ProviderInterface`*, type: *[ApiType](../modules/_types_.md#apitype)*): [ApiPromiseInterface](_promise_types_.apipromiseinterface.md)
*Inherited from [ApiBase](../classes/_base_.apibase.md).[constructor](../classes/_base_.apibase.md#constructor)*
*Defined in [Base.ts:81](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L81)*
*__description__*: Create an instance of the class
*__example__*:
```javascript
import Api from '@polkadot/api/promise';
const api = new Api().isReady();
api.rpc.subscribeNewHead((header) => {
console.log(`new block #${header.blockNumber.toNumber()}`);
});
```
**Parameters:**
| Name | Type | Default value |
| ------ | ------ | ------ |
| `Default value` provider | [ApiOptions](_types_.apioptions.md) \| `ProviderInterface` | {} |
| type | [ApiType](../modules/_types_.md#apitype) | - |
**Returns:** [ApiPromiseInterface](_promise_types_.apipromiseinterface.md)
___
# Properties
<a id="isready"></a>
## isReady
**● isReady**: *`Promise`<[ApiPromiseInterface](_promise_types_.apipromiseinterface.md)>*
*Defined in [promise/types.ts:16](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/promise/types.ts#L16)*
___
# Accessors
<a id="derive"></a>
## derive
**get derive**(): [Derive](_types_.derive.md)<[CodecResult](../modules/_promise_types_.md#codecresult), [SubscriptionResult](../modules/_promise_types_.md#subscriptionresult)>
*Inherited from [ApiBase](../classes/_base_.apibase.md).[derive](../classes/_base_.apibase.md#derive)*
*Defined in [Base.ts:196](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L196)*
*__description__*: Derived results that are injected into the API, allowing for combinations of various query results.
*__example__*:
```javascript
api.derive.chain.bestNumber((number) => {
console.log('best number', number);
});
```
**Returns:** [Derive](_types_.derive.md)<[CodecResult](../modules/_promise_types_.md#codecresult), [SubscriptionResult](../modules/_promise_types_.md#subscriptionresult)>
___
<a id="genesishash"></a>
## genesisHash
**get genesisHash**(): `Hash`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[genesisHash](../classes/_base_.apibase.md#genesishash)*
*Defined in [Base.ts:132](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L132)*
*__description__*: Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.
**Returns:** `Hash`
___
<a id="hassubscriptions"></a>
## hasSubscriptions
**get hasSubscriptions**(): `boolean`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[hasSubscriptions](../classes/_base_.apibase.md#hassubscriptions)*
*Defined in [Base.ts:141](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L141)*
*__description__*: `true` when subscriptions are supported
**Returns:** `boolean`
___
<a id="libraryinfo"></a>
## libraryInfo
**get libraryInfo**(): `string`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[libraryInfo](../classes/_base_.apibase.md#libraryinfo)*
*Defined in [Base.ts:148](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L148)*
*__description__*: The library information name & version (from package.json)
**Returns:** `string`
___
<a id="query"></a>
## query
**get query**(): [QueryableStorage](_types_.queryablestorage.md)<[CodecResult](../modules/_promise_types_.md#codecresult), [SubscriptionResult](../modules/_promise_types_.md#subscriptionresult)>
*Inherited from [ApiBase](../classes/_base_.apibase.md).[query](../classes/_base_.apibase.md#query)*
*Defined in [Base.ts:216](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L216)*
*__description__*: Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.
All calls inside the namespace, is denoted by `section`.`method` and may take an optional query parameter. As an example, `api.query.timestamp.now()` (current block timestamp) does not take parameters, while `api.query.system.accountNonce(<accountId>)` (retrieving the associated nonce for an account), takes the `AccountId` as a parameter.
*__example__*:
```javascript
api.query.balances.freeBalance(<accountId>, (balance) => {
console.log('new balance', balance);
});
```
**Returns:** [QueryableStorage](_types_.queryablestorage.md)<[CodecResult](../modules/_promise_types_.md#codecresult), [SubscriptionResult](../modules/_promise_types_.md#subscriptionresult)>
___
<a id="rpc"></a>
## rpc
**get rpc**(): [DecoratedRpc](_types_.decoratedrpc.md)<[CodecResult](../modules/_promise_types_.md#codecresult), [SubscriptionResult](../modules/_promise_types_.md#subscriptionresult)>
*Inherited from [ApiBase](../classes/_base_.apibase.md).[rpc](../classes/_base_.apibase.md#rpc)*
*Defined in [Base.ts:236](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L236)*
*__description__*: Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic `api.query` and `api.tx` sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.
RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (usine known keys) and the submission of transactions.
*__example__*:
```javascript
api.rpc.chain.subscribeNewHead((header) => {
console.log('new header', header);
});
```
**Returns:** [DecoratedRpc](_types_.decoratedrpc.md)<[CodecResult](../modules/_promise_types_.md#codecresult), [SubscriptionResult](../modules/_promise_types_.md#subscriptionresult)>
___
<a id="runtimemetadata"></a>
## runtimeMetadata
**get runtimeMetadata**(): `Metadata`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[runtimeMetadata](../classes/_base_.apibase.md#runtimemetadata)*
*Defined in [Base.ts:155](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L155)*
*__description__*: Yields the current attached runtime metadata. Generally this is only used to construct extrinsics & storage, but is useful for current runtime inspection.
**Returns:** `Metadata`
___
<a id="runtimeversion"></a>
## runtimeVersion
**get runtimeVersion**(): `RuntimeVersion`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[runtimeVersion](../classes/_base_.apibase.md#runtimeversion)*
*Defined in [Base.ts:164](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L164)*
*__description__*: Contains the version information for the current runtime.
**Returns:** `RuntimeVersion`
___
<a id="tx"></a>
## tx
**get tx**(): [SubmittableExtrinsics](_types_.submittableextrinsics.md)<[CodecResult](../modules/_promise_types_.md#codecresult), [SubscriptionResult](../modules/_promise_types_.md#subscriptionresult)>
*Inherited from [ApiBase](../classes/_base_.apibase.md).[tx](../classes/_base_.apibase.md#tx)*
*Defined in [Base.ts:254](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L254)*
*__description__*: Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.
*__example__*:
```javascript
api.tx.balances
.transfer(<recipientId>, <balance>)
.signAndSend(<keyPair>, ({status}) => {
console.log('tx status', status.asFinalised.toHex());
});
```
**Returns:** [SubmittableExtrinsics](_types_.submittableextrinsics.md)<[CodecResult](../modules/_promise_types_.md#codecresult), [SubscriptionResult](../modules/_promise_types_.md#subscriptionresult)>
___
<a id="type"></a>
## type
**get type**(): [ApiType](../modules/_types_.md#apitype)
*Inherited from [ApiBase](../classes/_base_.apibase.md).[type](../classes/_base_.apibase.md#type)*
*Defined in [Base.ts:173](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L173)*
*__description__*: The type of this API instance, either 'rxjs' or 'promise'
**Returns:** [ApiType](../modules/_types_.md#apitype)
___
# Methods
<a id="disconnect"></a>
## disconnect
▸ **disconnect**(): `void`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[disconnect](../classes/_base_.apibase.md#disconnect)*
*Defined in [Base.ts:263](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L263)*
*__description__*: Disconnect from the underlying provider, halting all comms
**Returns:** `void`
___
<a id="on"></a>
## on
▸ **on**(type: *[ApiInterface$Events](../modules/_types_.md#apiinterface_events)*, handler: *`function`*): `this`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[on](../classes/_base_.apibase.md#on)*
*Defined in [Base.ts:286](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L286)*
*__description__*: Attach an eventemitter handler to listen to a specific event
*__example__*:
```javascript
api.on('connected', () => {
console.log('API has been connected to the endpoint');
});
api.on('disconnected', () => {
console.log('API has been disconnected from the endpoint');
});
```
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| type | [ApiInterface$Events](../modules/_types_.md#apiinterface_events) | The type of event to listen to. Available events are \`connected\`, \`disconnected\`, \`ready\` and \`error\` |
| handler | `function` | The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments. |
**Returns:** `this`
___
<a id="once"></a>
## once
▸ **once**(type: *[ApiInterface$Events](../modules/_types_.md#apiinterface_events)*, handler: *`function`*): `this`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[once](../classes/_base_.apibase.md#once)*
*Defined in [Base.ts:311](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L311)*
*__description__*: Attach an one-time eventemitter handler to listen to a specific event
*__example__*:
```javascript
api.once('connected', () => {
console.log('API has been connected to the endpoint');
});
api.once('disconnected', () => {
console.log('API has been disconnected from the endpoint');
});
```
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| type | [ApiInterface$Events](../modules/_types_.md#apiinterface_events) | The type of event to listen to. Available events are \`connected\`, \`disconnected\`, \`ready\` and \`error\` |
| handler | `function` | The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments. |
**Returns:** `this`
___
<a id="registertypes"></a>
## registerTypes
▸ **registerTypes**(types?: *`RegistryTypes`*): `void`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[registerTypes](../classes/_base_.apibase.md#registertypes)*
*Defined in [Base.ts:320](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L320)*
*__description__*: Register additional user-defined of chain-specific types in the type registry
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` types | `RegistryTypes` |
**Returns:** `void`
___
<a id="setsigner"></a>
## setSigner
▸ **setSigner**(signer: *[Signer](_types_.signer.md)*): `void`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[setSigner](../classes/_base_.apibase.md#setsigner)*
*Defined in [Base.ts:180](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L180)*
*__description__*: Set an external signer which will be used to sign extrinsic when account passed in is not KeyringPair
**Parameters:**
| Name | Type |
| ------ | ------ |
| signer | [Signer](_types_.signer.md) |
**Returns:** `void`
___
File diff suppressed because one or more lines are too long
@@ -1,393 +0,0 @@
# Hierarchy
[ApiBase](../classes/_base_.apibase.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
**↳ ApiRxInterface**
# Implements
* [ApiBaseInterface](_types_.apibaseinterface.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
# Implemented by
* [ApiRx](../classes/_rx_api_.apirx.md)
# Constructors
<a id="constructor"></a>
## constructor
⊕ **new ApiRxInterface**(provider?: *[ApiOptions](_types_.apioptions.md) \| `ProviderInterface`*, type: *[ApiType](../modules/_types_.md#apitype)*): [ApiRxInterface](_rx_types_.apirxinterface.md)
*Inherited from [ApiBase](../classes/_base_.apibase.md).[constructor](../classes/_base_.apibase.md#constructor)*
*Defined in [Base.ts:81](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L81)*
*__description__*: Create an instance of the class
*__example__*:
```javascript
import Api from '@polkadot/api/promise';
const api = new Api().isReady();
api.rpc.subscribeNewHead((header) => {
console.log(`new block #${header.blockNumber.toNumber()}`);
});
```
**Parameters:**
| Name | Type | Default value |
| ------ | ------ | ------ |
| `Default value` provider | [ApiOptions](_types_.apioptions.md) \| `ProviderInterface` | {} |
| type | [ApiType](../modules/_types_.md#apitype) | - |
**Returns:** [ApiRxInterface](_rx_types_.apirxinterface.md)
___
# Properties
<a id="isconnected"></a>
## isConnected
**● isConnected**: *`Observable`<`boolean`>*
*Defined in [rx/types.ts:13](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/rx/types.ts#L13)*
___
<a id="isready"></a>
## isReady
**● isReady**: *`Observable`<[ApiRxInterface](_rx_types_.apirxinterface.md)>*
*Defined in [rx/types.ts:14](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/rx/types.ts#L14)*
___
# Accessors
<a id="derive"></a>
## derive
**get derive**(): [Derive](_types_.derive.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
*Inherited from [ApiBase](../classes/_base_.apibase.md).[derive](../classes/_base_.apibase.md#derive)*
*Defined in [Base.ts:196](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L196)*
*__description__*: Derived results that are injected into the API, allowing for combinations of various query results.
*__example__*:
```javascript
api.derive.chain.bestNumber((number) => {
console.log('best number', number);
});
```
**Returns:** [Derive](_types_.derive.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
___
<a id="genesishash"></a>
## genesisHash
**get genesisHash**(): `Hash`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[genesisHash](../classes/_base_.apibase.md#genesishash)*
*Defined in [Base.ts:132](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L132)*
*__description__*: Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.
**Returns:** `Hash`
___
<a id="hassubscriptions"></a>
## hasSubscriptions
**get hasSubscriptions**(): `boolean`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[hasSubscriptions](../classes/_base_.apibase.md#hassubscriptions)*
*Defined in [Base.ts:141](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L141)*
*__description__*: `true` when subscriptions are supported
**Returns:** `boolean`
___
<a id="libraryinfo"></a>
## libraryInfo
**get libraryInfo**(): `string`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[libraryInfo](../classes/_base_.apibase.md#libraryinfo)*
*Defined in [Base.ts:148](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L148)*
*__description__*: The library information name & version (from package.json)
**Returns:** `string`
___
<a id="query"></a>
## query
**get query**(): [QueryableStorage](_types_.queryablestorage.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
*Inherited from [ApiBase](../classes/_base_.apibase.md).[query](../classes/_base_.apibase.md#query)*
*Defined in [Base.ts:216](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L216)*
*__description__*: Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.
All calls inside the namespace, is denoted by `section`.`method` and may take an optional query parameter. As an example, `api.query.timestamp.now()` (current block timestamp) does not take parameters, while `api.query.system.accountNonce(<accountId>)` (retrieving the associated nonce for an account), takes the `AccountId` as a parameter.
*__example__*:
```javascript
api.query.balances.freeBalance(<accountId>, (balance) => {
console.log('new balance', balance);
});
```
**Returns:** [QueryableStorage](_types_.queryablestorage.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
___
<a id="rpc"></a>
## rpc
**get rpc**(): [DecoratedRpc](_types_.decoratedrpc.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
*Inherited from [ApiBase](../classes/_base_.apibase.md).[rpc](../classes/_base_.apibase.md#rpc)*
*Defined in [Base.ts:236](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L236)*
*__description__*: Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic `api.query` and `api.tx` sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.
RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (usine known keys) and the submission of transactions.
*__example__*:
```javascript
api.rpc.chain.subscribeNewHead((header) => {
console.log('new header', header);
});
```
**Returns:** [DecoratedRpc](_types_.decoratedrpc.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
___
<a id="runtimemetadata"></a>
## runtimeMetadata
**get runtimeMetadata**(): `Metadata`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[runtimeMetadata](../classes/_base_.apibase.md#runtimemetadata)*
*Defined in [Base.ts:155](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L155)*
*__description__*: Yields the current attached runtime metadata. Generally this is only used to construct extrinsics & storage, but is useful for current runtime inspection.
**Returns:** `Metadata`
___
<a id="runtimeversion"></a>
## runtimeVersion
**get runtimeVersion**(): `RuntimeVersion`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[runtimeVersion](../classes/_base_.apibase.md#runtimeversion)*
*Defined in [Base.ts:164](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L164)*
*__description__*: Contains the version information for the current runtime.
**Returns:** `RuntimeVersion`
___
<a id="tx"></a>
## tx
**get tx**(): [SubmittableExtrinsics](_types_.submittableextrinsics.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
*Inherited from [ApiBase](../classes/_base_.apibase.md).[tx](../classes/_base_.apibase.md#tx)*
*Defined in [Base.ts:254](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L254)*
*__description__*: Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.
*__example__*:
```javascript
api.tx.balances
.transfer(<recipientId>, <balance>)
.signAndSend(<keyPair>, ({status}) => {
console.log('tx status', status.asFinalised.toHex());
});
```
**Returns:** [SubmittableExtrinsics](_types_.submittableextrinsics.md)<[RxResult](../modules/_rx_types_.md#rxresult), [RxResult](../modules/_rx_types_.md#rxresult)>
___
<a id="type"></a>
## type
**get type**(): [ApiType](../modules/_types_.md#apitype)
*Inherited from [ApiBase](../classes/_base_.apibase.md).[type](../classes/_base_.apibase.md#type)*
*Defined in [Base.ts:173](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L173)*
*__description__*: The type of this API instance, either 'rxjs' or 'promise'
**Returns:** [ApiType](../modules/_types_.md#apitype)
___
# Methods
<a id="disconnect"></a>
## disconnect
▸ **disconnect**(): `void`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[disconnect](../classes/_base_.apibase.md#disconnect)*
*Defined in [Base.ts:263](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L263)*
*__description__*: Disconnect from the underlying provider, halting all comms
**Returns:** `void`
___
<a id="on"></a>
## on
▸ **on**(type: *[ApiInterface$Events](../modules/_types_.md#apiinterface_events)*, handler: *`function`*): `this`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[on](../classes/_base_.apibase.md#on)*
*Defined in [Base.ts:286](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L286)*
*__description__*: Attach an eventemitter handler to listen to a specific event
*__example__*:
```javascript
api.on('connected', () => {
console.log('API has been connected to the endpoint');
});
api.on('disconnected', () => {
console.log('API has been disconnected from the endpoint');
});
```
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| type | [ApiInterface$Events](../modules/_types_.md#apiinterface_events) | The type of event to listen to. Available events are \`connected\`, \`disconnected\`, \`ready\` and \`error\` |
| handler | `function` | The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments. |
**Returns:** `this`
___
<a id="once"></a>
## once
▸ **once**(type: *[ApiInterface$Events](../modules/_types_.md#apiinterface_events)*, handler: *`function`*): `this`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[once](../classes/_base_.apibase.md#once)*
*Defined in [Base.ts:311](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L311)*
*__description__*: Attach an one-time eventemitter handler to listen to a specific event
*__example__*:
```javascript
api.once('connected', () => {
console.log('API has been connected to the endpoint');
});
api.once('disconnected', () => {
console.log('API has been disconnected from the endpoint');
});
```
**Parameters:**
| Name | Type | Description |
| ------ | ------ | ------ |
| type | [ApiInterface$Events](../modules/_types_.md#apiinterface_events) | The type of event to listen to. Available events are \`connected\`, \`disconnected\`, \`ready\` and \`error\` |
| handler | `function` | The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments. |
**Returns:** `this`
___
<a id="registertypes"></a>
## registerTypes
▸ **registerTypes**(types?: *`RegistryTypes`*): `void`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[registerTypes](../classes/_base_.apibase.md#registertypes)*
*Defined in [Base.ts:320](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L320)*
*__description__*: Register additional user-defined of chain-specific types in the type registry
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` types | `RegistryTypes` |
**Returns:** `void`
___
<a id="setsigner"></a>
## setSigner
▸ **setSigner**(signer: *[Signer](_types_.signer.md)*): `void`
*Inherited from [ApiBase](../classes/_base_.apibase.md).[setSigner](../classes/_base_.apibase.md#setsigner)*
*Defined in [Base.ts:180](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/Base.ts#L180)*
*__description__*: Set an external signer which will be used to sign extrinsic when account passed in is not KeyringPair
**Parameters:**
| Name | Type |
| ------ | ------ |
| signer | [Signer](_types_.signer.md) |
**Returns:** `void`
___
File diff suppressed because one or more lines are too long
@@ -1,73 +0,0 @@
# Type parameters
#### CodecResult
#### SubscriptionResult
# Hierarchy
`object`
**↳ ApiBaseInterface**
# Implemented by
* [ApiBase](../classes/_base_.apibase.md)
* [ApiPromise](../classes/_promise_api_.apipromise.md)
* [ApiPromiseInterface](_promise_types_.apipromiseinterface.md)
* [ApiRx](../classes/_rx_api_.apirx.md)
* [ApiRxInterface](_rx_types_.apirxinterface.md)
# Properties
<a id="on"></a>
## on
**● on**: *`function`*
*Defined in [types.ts:158](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L158)*
#### Type declaration
▸(type: *[ApiInterface$Events](../modules/_types_.md#apiinterface_events)*, handler: *`function`*): `this`
**Parameters:**
| Name | Type |
| ------ | ------ |
| type | [ApiInterface$Events](../modules/_types_.md#apiinterface_events) |
| handler | `function` |
**Returns:** `this`
___
<a id="once"></a>
## once
**● once**: *`function`*
*Defined in [types.ts:159](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L159)*
#### Type declaration
▸(type: *[ApiInterface$Events](../modules/_types_.md#apiinterface_events)*, handler: *`function`*): `this`
**Parameters:**
| Name | Type |
| ------ | ------ |
| type | [ApiInterface$Events](../modules/_types_.md#apiinterface_events) |
| handler | `function` |
**Returns:** `this`
___
<a id="type"></a>
## type
**● type**: *[ApiType](../modules/_types_.md#apitype)*
*Defined in [types.ts:156](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L156)*
___
File diff suppressed because one or more lines are too long
@@ -1,93 +0,0 @@
# Type parameters
#### CodecResult
#### SubscriptionResult
# Hierarchy
**ApiInterface$Decorated**
# Properties
<a id="derive"></a>
## derive
**● derive**: *[Derive](_types_.derive.md)<`CodecResult`, `SubscriptionResult`>*
*Defined in [types.ts:142](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L142)*
___
<a id="genesishash"></a>
## genesisHash
**● genesisHash**: *`Hash`*
*Defined in [types.ts:138](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L138)*
___
<a id="hassubscriptions"></a>
## hasSubscriptions
**● hasSubscriptions**: *`boolean`*
*Defined in [types.ts:139](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L139)*
___
<a id="query"></a>
## query
**● query**: *[QueryableStorage](_types_.queryablestorage.md)<`CodecResult`, `SubscriptionResult`>*
*Defined in [types.ts:143](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L143)*
___
<a id="rpc"></a>
## rpc
**● rpc**: *[DecoratedRpc](_types_.decoratedrpc.md)<`CodecResult`, `SubscriptionResult`>*
*Defined in [types.ts:144](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L144)*
___
<a id="runtimemetadata"></a>
## runtimeMetadata
**● runtimeMetadata**: *`Metadata`*
*Defined in [types.ts:140](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L140)*
___
<a id="runtimeversion"></a>
## runtimeVersion
**● runtimeVersion**: *`RuntimeVersion`*
*Defined in [types.ts:141](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L141)*
___
<a id="signer"></a>
## `<Optional>` signer
**● signer**: *[Signer](_types_.signer.md)*
*Defined in [types.ts:146](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L146)*
___
<a id="tx"></a>
## tx
**● tx**: *[SubmittableExtrinsics](_types_.submittableextrinsics.md)<`CodecResult`, `SubscriptionResult`>*
*Defined in [types.ts:145](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L145)*
___
File diff suppressed because one or more lines are too long
-64
View File
@@ -1,64 +0,0 @@
# Hierarchy
**ApiOptions**
# Properties
<a id="derives"></a>
## `<Optional>` derives
**● derives**: *`DeriveCustom`*
*Defined in [types.ts:116](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L116)*
*__description__*: Add custom derives to be injected
___
<a id="provider"></a>
## `<Optional>` provider
**● provider**: *`ProviderInterface`*
*Defined in [types.ts:121](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L121)*
*__description__*: Transport Provider from rpc-provider. If not specified, it will default to connecting to a WsProvider connecting localhost with the default port, i.e. `ws://127.0.0.1:9944`
___
<a id="signer"></a>
## `<Optional>` signer
**● signer**: *[Signer](_types_.signer.md)*
*Defined in [types.ts:125](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L125)*
*__description__*: An external signer which will be used to sign extrinsic when account passed in is not KeyringPair
___
<a id="source"></a>
## `<Optional>` source
**● source**: *[ApiBase](../classes/_base_.apibase.md)<`any`, `any`>*
*Defined in [types.ts:129](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L129)*
*__description__*: The source object to use for runtime information (only used when cloning)
___
<a id="types"></a>
## `<Optional>` types
**● types**: *`RegistryTypes`*
*Defined in [types.ts:134](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L134)*
*__description__*: Additional types used by runtime modules. This is nessusary if the runtime modules uses types not available in the base Substrate runtime.
___
File diff suppressed because one or more lines are too long
@@ -1,48 +0,0 @@
# Type parameters
#### CodecResult
#### SubscriptionResult
# Hierarchy
**DecoratedRpc**
# Properties
<a id="author"></a>
## author
**● author**: *[DecoratedRpc$Section](_types_.decoratedrpc_section.md)<`CodecResult`, `SubscriptionResult`>*
*Defined in [types.ts:34](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L34)*
___
<a id="chain"></a>
## chain
**● chain**: *[DecoratedRpc$Section](_types_.decoratedrpc_section.md)<`CodecResult`, `SubscriptionResult`>*
*Defined in [types.ts:35](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L35)*
___
<a id="state"></a>
## state
**● state**: *[DecoratedRpc$Section](_types_.decoratedrpc_section.md)<`CodecResult`, `SubscriptionResult`>*
*Defined in [types.ts:36](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L36)*
___
<a id="system"></a>
## system
**● system**: *[DecoratedRpc$Section](_types_.decoratedrpc_section.md)<`CodecResult`, `SubscriptionResult`>*
*Defined in [types.ts:37](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L37)*
___
File diff suppressed because one or more lines are too long
@@ -1,49 +0,0 @@
# Type parameters
#### CodecResult
#### SubscriptionResult
# Hierarchy
**DecoratedRpc$Method**
# Callable
▸ **__call**(callback: *`CodecCallback`*): `SubscriptionResult`
▸ **__call**(arg1: *`CodecArg`*, callback: *`CodecCallback`*): `SubscriptionResult`
▸ **__call**(arg1?: *`CodecArg`*, arg2?: *`CodecArg`*, arg3?: *`CodecArg`*): `CodecResult`
*Defined in [types.ts:23](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L23)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| callback | `CodecCallback` |
**Returns:** `SubscriptionResult`
*Defined in [types.ts:24](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L24)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| arg1 | `CodecArg` |
| callback | `CodecCallback` |
**Returns:** `SubscriptionResult`
*Defined in [types.ts:25](https://github.com/polkadot-js/api/blob/1ea1f6f/packages/api/src/types.ts#L25)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` arg1 | `CodecArg` |
| `Optional` arg2 | `CodecArg` |
| `Optional` arg3 | `CodecArg` |
**Returns:** `CodecResult`
File diff suppressed because one or more lines are too long
@@ -1,12 +0,0 @@
# Type parameters
#### CodecResult
#### SubscriptionResult
# Hierarchy
**DecoratedRpc$Section**
# Indexable
\[index: `string`\]:&nbsp;[DecoratedRpc$Method](_types_.decoratedrpc_method.md)<`CodecResult`, `SubscriptionResult`>

Some files were not shown because too many files have changed in this diff Show More