Commit 4b3fb12b authored by Amaury Martiny's avatar Amaury Martiny
Browse files

docs: Add more documentation

parent 4ad06323
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
**address**: *string* **address**: *string*
*Defined in [balanceTransfer.ts:16](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L16)* *Defined in [src/balanceTransfer.ts:16](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L16)*
The ss-58 encoded address The ss-58 encoded address
...@@ -37,7 +37,7 @@ ___ ...@@ -37,7 +37,7 @@ ___
**amount**: *number* **amount**: *number*
*Defined in [balanceTransfer.ts:20](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L20)* *Defined in [src/balanceTransfer.ts:20](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L20)*
The amount to send The amount to send
...@@ -47,7 +47,7 @@ ___ ...@@ -47,7 +47,7 @@ ___
**blockHash**: *string* **blockHash**: *string*
*Defined in [balanceTransfer.ts:24](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L24)* *Defined in [src/balanceTransfer.ts:24](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L24)*
The checkpoint hash of the block, in hex The checkpoint hash of the block, in hex
...@@ -57,7 +57,7 @@ ___ ...@@ -57,7 +57,7 @@ ___
**blockNumber**: *number* **blockNumber**: *number*
*Defined in [balanceTransfer.ts:28](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L28)* *Defined in [src/balanceTransfer.ts:28](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L28)*
The checkpoint block number (u32), in hex The checkpoint block number (u32), in hex
...@@ -67,7 +67,7 @@ ___ ...@@ -67,7 +67,7 @@ ___
**genesisHash**: *string* **genesisHash**: *string*
*Defined in [balanceTransfer.ts:32](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L32)* *Defined in [src/balanceTransfer.ts:32](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L32)*
The genesis hash of the chain, in hex The genesis hash of the chain, in hex
...@@ -77,7 +77,7 @@ ___ ...@@ -77,7 +77,7 @@ ___
**metadataRpc**: *string* **metadataRpc**: *string*
*Defined in [balanceTransfer.ts:37](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L37)* *Defined in [src/balanceTransfer.ts:37](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L37)*
The SCALE-encoded metadata, as a hex string. Can be retrieved via the RPC The SCALE-encoded metadata, as a hex string. Can be retrieved via the RPC
call `state_getMetadata` call `state_getMetadata`
...@@ -88,7 +88,7 @@ ___ ...@@ -88,7 +88,7 @@ ___
**nonce**: *number* **nonce**: *number*
*Defined in [balanceTransfer.ts:41](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L41)* *Defined in [src/balanceTransfer.ts:41](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L41)*
The nonce for this transaction, The nonce for this transaction,
...@@ -98,7 +98,7 @@ ___ ...@@ -98,7 +98,7 @@ ___
**specVersion**: *number* **specVersion**: *number*
*Defined in [balanceTransfer.ts:45](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L45)* *Defined in [src/balanceTransfer.ts:45](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L45)*
The current spec version for the runtime The current spec version for the runtime
...@@ -108,7 +108,7 @@ ___ ...@@ -108,7 +108,7 @@ ___
**tip**: *number* **tip**: *number*
*Defined in [balanceTransfer.ts:49](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L49)* *Defined in [src/balanceTransfer.ts:49](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L49)*
The tip for this transaction, in hex The tip for this transaction, in hex
...@@ -118,6 +118,6 @@ ___ ...@@ -118,6 +118,6 @@ ___
**to**: *string* **to**: *string*
*Defined in [balanceTransfer.ts:53](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L53)* *Defined in [src/balanceTransfer.ts:53](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L53)*
The recipient address, ss-58 encoded The recipient address, ss-58 encoded
[@amaurymartiny/txwrapper](../README.md)[Globals](../globals.md)["balanceTransfer"](../modules/_balancetransfer_.md)[UnsignedTransaction](_balancetransfer_.unsignedtransaction.md)
# Interface: UnsignedTransaction
JSON format for an unsigned transaction
## Hierarchy
* SignerPayloadJSON
**UnsignedTransaction**
## Index
### Properties
* [address](_balancetransfer_.unsignedtransaction.md#address)
* [blockHash](_balancetransfer_.unsignedtransaction.md#blockhash)
* [blockNumber](_balancetransfer_.unsignedtransaction.md#blocknumber)
* [era](_balancetransfer_.unsignedtransaction.md#era)
* [genesisHash](_balancetransfer_.unsignedtransaction.md#genesishash)
* [method](_balancetransfer_.unsignedtransaction.md#method)
* [nonce](_balancetransfer_.unsignedtransaction.md#nonce)
* [specVersion](_balancetransfer_.unsignedtransaction.md#specversion)
* [tip](_balancetransfer_.unsignedtransaction.md#tip)
* [version](_balancetransfer_.unsignedtransaction.md#version)
## Properties
### address
**address**: *string*
*Inherited from void*
Defined in node_modules/@polkadot/types/types.d.ts:177
**`description`** The ss-58 encoded address
___
### blockHash
**blockHash**: *string*
*Inherited from void*
Defined in node_modules/@polkadot/types/types.d.ts:181
**`description`** The checkpoint hash of the block, in hex
___
### blockNumber
**blockNumber**: *string*
*Inherited from void*
Defined in node_modules/@polkadot/types/types.d.ts:185
**`description`** The checkpoint block number, in hex
___
### era
**era**: *string*
*Inherited from void*
Defined in node_modules/@polkadot/types/types.d.ts:189
**`description`** The era for this transaction, in hex
___
### genesisHash
**genesisHash**: *string*
*Inherited from void*
Defined in node_modules/@polkadot/types/types.d.ts:193
**`description`** The genesis hash of the chain, in hex
___
### method
**method**: *string*
*Inherited from void*
Defined in node_modules/@polkadot/types/types.d.ts:197
**`description`** The encoded method (with arguments) in hex
___
### nonce
**nonce**: *string*
*Inherited from void*
Defined in node_modules/@polkadot/types/types.d.ts:201
**`description`** The nonce for this transaction, in hex
___
### specVersion
**specVersion**: *string*
*Inherited from void*
Defined in node_modules/@polkadot/types/types.d.ts:205
**`description`** The current spec version for the runtime
___
### tip
**tip**: *string*
*Inherited from void*
Defined in node_modules/@polkadot/types/types.d.ts:209
**`description`** The tip for this transaction, in hex
___
### version
**version**: *number*
*Inherited from void*
Defined in node_modules/@polkadot/types/types.d.ts:213
**`description`** The version of the extrinsic we are dealing with
[@amaurymartiny/txwrapper](../README.md)[Globals](../globals.md)["generateKeypair"](../modules/_generatekeypair_.md)[KeyringPair](_generatekeypair_.keyringpair.md)
# Interface: KeyringPair
A keyring pair
## Hierarchy
* KeyringPair
**KeyringPair**
## Index
### Properties
* [address](_generatekeypair_.keyringpair.md#address)
* [decodePkcs8](_generatekeypair_.keyringpair.md#decodepkcs8)
* [derive](_generatekeypair_.keyringpair.md#derive)
* [encodePkcs8](_generatekeypair_.keyringpair.md#encodepkcs8)
* [isLocked](_generatekeypair_.keyringpair.md#islocked)
* [lock](_generatekeypair_.keyringpair.md#lock)
* [meta](_generatekeypair_.keyringpair.md#meta)
* [publicKey](_generatekeypair_.keyringpair.md#publickey)
* [setMeta](_generatekeypair_.keyringpair.md#setmeta)
* [type](_generatekeypair_.keyringpair.md#type)
### Methods
* [sign](_generatekeypair_.keyringpair.md#sign)
* [toJson](_generatekeypair_.keyringpair.md#tojson)
* [verify](_generatekeypair_.keyringpair.md#verify)
## Properties
### address
**address**: *string*
*Inherited from void*
Defined in node_modules/@polkadot/keyring/types.d.ts:27
___
### decodePkcs8
**decodePkcs8**: *function*
*Inherited from void*
Defined in node_modules/@polkadot/keyring/types.d.ts:32
#### Type declaration:
▸ (`passphrase?`: undefined | string, `encoded?`: Uint8Array): *void*
**Parameters:**
Name | Type |
------ | ------ |
`passphrase?` | undefined | string |
`encoded?` | Uint8Array |
___
### derive
**derive**: *function*
*Inherited from void*
Defined in node_modules/@polkadot/keyring/types.d.ts:33
#### Type declaration:
▸ (`suri`: string, `meta?`: KeyringPair$Meta): *KeyringPair*
**Parameters:**
Name | Type |
------ | ------ |
`suri` | string |
`meta?` | KeyringPair$Meta |
___
### encodePkcs8
**encodePkcs8**: *function*
*Inherited from void*
Defined in node_modules/@polkadot/keyring/types.d.ts:34
#### Type declaration:
▸ (`passphrase?`: undefined | string): *Uint8Array*
**Parameters:**
Name | Type |
------ | ------ |
`passphrase?` | undefined | string |
___
### isLocked
**isLocked**: *boolean*
*Inherited from void*
Defined in node_modules/@polkadot/keyring/types.d.ts:29
___
### lock
**lock**: *function*
*Inherited from void*
Defined in node_modules/@polkadot/keyring/types.d.ts:35
#### Type declaration:
▸ (): *void*
___
### meta
**meta**: *KeyringPair$Meta*
*Inherited from void*
Defined in node_modules/@polkadot/keyring/types.d.ts:28
___
### publicKey
**publicKey**: *Uint8Array*
*Inherited from void*
Defined in node_modules/@polkadot/keyring/types.d.ts:30
___
### setMeta
**setMeta**: *function*
*Inherited from void*
Defined in node_modules/@polkadot/keyring/types.d.ts:36
#### Type declaration:
▸ (`meta`: KeyringPair$Meta): *void*
**Parameters:**
Name | Type |
------ | ------ |
`meta` | KeyringPair$Meta |
___
### type
**type**: *KeypairType*
*Inherited from void*
Defined in node_modules/@polkadot/keyring/types.d.ts:31
## Methods
### sign
**sign**(`message`: Uint8Array, `options?`: SignOptions): *Uint8Array*
*Inherited from void*
Defined in node_modules/@polkadot/keyring/types.d.ts:37
**Parameters:**
Name | Type |
------ | ------ |
`message` | Uint8Array |
`options?` | SignOptions |
**Returns:** *Uint8Array*
___
### toJson
**toJson**(`passphrase?`: undefined | string): *KeyringPair$Json*
*Inherited from void*
Defined in node_modules/@polkadot/keyring/types.d.ts:38
**Parameters:**
Name | Type |
------ | ------ |
`passphrase?` | undefined | string |
**Returns:** *KeyringPair$Json*
___
### verify
**verify**(`message`: Uint8Array, `signature`: Uint8Array): *boolean*
*Inherited from void*
Defined in node_modules/@polkadot/keyring/types.d.ts:39
**Parameters:**
Name | Type |
------ | ------ |
`message` | Uint8Array |
`signature` | Uint8Array |
**Returns:** *boolean*
...@@ -7,10 +7,7 @@ ...@@ -7,10 +7,7 @@
### Interfaces ### Interfaces
* [TxInfo](../interfaces/_balancetransfer_.txinfo.md) * [TxInfo](../interfaces/_balancetransfer_.txinfo.md)
* [UnsignedTransaction](../interfaces/_balancetransfer_.unsignedtransaction.md)
### Type aliases
* [UnsignedTransaction](_balancetransfer_.md#unsignedtransaction)
### Variables ### Variables
...@@ -22,23 +19,13 @@ ...@@ -22,23 +19,13 @@
* [balanceTransfer](_balancetransfer_.md#balancetransfer) * [balanceTransfer](_balancetransfer_.md#balancetransfer)
## Type aliases
### UnsignedTransaction
Ƭ **UnsignedTransaction**: *SignerPayloadJSON*
*Defined in [balanceTransfer.ts:10](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L10)*
JSON format for an unsigned transaction
## Variables ## Variables
### `Const` BLOCKTIME ### `Const` BLOCKTIME
**BLOCKTIME**: *6* = 6 **BLOCKTIME**: *6* = 6
*Defined in [balanceTransfer.ts:57](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L57)* *Defined in [src/balanceTransfer.ts:57](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L57)*
___ ___
...@@ -46,7 +33,7 @@ ___ ...@@ -46,7 +33,7 @@ ___
**DEFAULT_MORTAL_LENGTH**: *number* = 240 * ONE_MINUTE **DEFAULT_MORTAL_LENGTH**: *number* = 240 * ONE_MINUTE
*Defined in [balanceTransfer.ts:59](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L59)* *Defined in [src/balanceTransfer.ts:59](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L59)*
___ ___
...@@ -54,15 +41,15 @@ ___ ...@@ -54,15 +41,15 @@ ___
**ONE_MINUTE**: *number* = 60 / BLOCKTIME **ONE_MINUTE**: *number* = 60 / BLOCKTIME
*Defined in [balanceTransfer.ts:58](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L58)* *Defined in [src/balanceTransfer.ts:58](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L58)*
## Functions ## Functions
### balanceTransfer ### balanceTransfer
**balanceTransfer**(`info`: [TxInfo](../interfaces/_balancetransfer_.txinfo.md)): *[UnsignedTransaction](_balancetransfer_.md#unsignedtransaction)* **balanceTransfer**(`info`: [TxInfo](../interfaces/_balancetransfer_.txinfo.md)): *[UnsignedTransaction](../interfaces/_balancetransfer_.unsignedtransaction.md)*
*Defined in [balanceTransfer.ts:68](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/balanceTransfer.ts#L68)* *Defined in [src/balanceTransfer.ts:68](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/balanceTransfer.ts#L68)*
Construct a balance transfer transaction offline. Transactions can be Construct a balance transfer transaction offline. Transactions can be
constructed in such a way that it is valid for at least 240 minutes constructed in such a way that it is valid for at least 240 minutes
...@@ -73,4 +60,4 @@ Name | Type | Description | ...@@ -73,4 +60,4 @@ Name | Type | Description |
------ | ------ | ------ | ------ | ------ | ------ |
`info` | [TxInfo](../interfaces/_balancetransfer_.txinfo.md) | Information required to construct the transaction | `info` | [TxInfo](../interfaces/_balancetransfer_.txinfo.md) | Information required to construct the transaction |
**Returns:** *[UnsignedTransaction](_balancetransfer_.md#unsignedtransaction)* **Returns:** *[UnsignedTransaction](../interfaces/_balancetransfer_.unsignedtransaction.md)*
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
### createSignedTx ### createSignedTx
**createSignedTx**(`unsigned`: [UnsignedTransaction](_balancetransfer_.md#unsignedtransaction), `signature`: string, `metadataRpc`: string): *string* **createSignedTx**(`unsigned`: [UnsignedTransaction](../interfaces/_balancetransfer_.unsignedtransaction.md), `signature`: string, `metadataRpc`: string): *string*
*Defined in [createSignedTx.ts:15](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/createSignedTx.ts#L15)* *Defined in [src/createSignedTx.ts:15](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/createSignedTx.ts#L15)*
Serialize a signed transaction in a format that can be submitted over the Serialize a signed transaction in a format that can be submitted over the
Node RPC Interface from the signing payload and signature produced by the Node RPC Interface from the signing payload and signature produced by the
...@@ -24,7 +24,7 @@ remote signer ...@@ -24,7 +24,7 @@ remote signer
Name | Type | Description | Name | Type | Description |
------ | ------ | ------ | ------ | ------ | ------ |
`unsigned` | [UnsignedTransaction](_balancetransfer_.md#unsignedtransaction) | The JSON representing the unsigned transaction | `unsigned` | [UnsignedTransaction](../interfaces/_balancetransfer_.unsignedtransaction.md) | The JSON representing the unsigned transaction |
`signature` | string | Signature of the signing payload produced by the remote signer | `signature` | string | Signature of the signing payload produced by the remote signer |
`metadataRpc` | string | - | `metadataRpc` | string | - |