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

docs: Add more documentation

parent 4ad06323
......@@ -27,7 +27,7 @@
**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
......@@ -37,7 +37,7 @@ ___
**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
......@@ -47,7 +47,7 @@ ___
**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
......@@ -57,7 +57,7 @@ ___
**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
......@@ -67,7 +67,7 @@ ___
**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
......@@ -77,7 +77,7 @@ ___
**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
call `state_getMetadata`
......@@ -88,7 +88,7 @@ ___
**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,
......@@ -98,7 +98,7 @@ ___
**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
......@@ -108,7 +108,7 @@ ___
**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
......@@ -118,6 +118,6 @@ ___
**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
[@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 @@
### Interfaces
* [TxInfo](../interfaces/_balancetransfer_.txinfo.md)
### Type aliases
* [UnsignedTransaction](_balancetransfer_.md#unsignedtransaction)
* [UnsignedTransaction](../interfaces/_balancetransfer_.unsignedtransaction.md)
### Variables
......@@ -22,23 +19,13 @@
* [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
### `Const` BLOCKTIME
**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 @@ ___
**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 @@ ___
**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
### 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
constructed in such a way that it is valid for at least 240 minutes
......@@ -73,4 +60,4 @@ Name | Type | Description |
------ | ------ | ------ |
`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 @@
### 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
Node RPC Interface from the signing payload and signature produced by the
......@@ -24,7 +24,7 @@ remote signer
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 |
`metadataRpc` | string | - |
......
......@@ -12,9 +12,9 @@
### createSigningPayload
**createSigningPayload**(`unsigned`: [UnsignedTransaction](_balancetransfer_.md#unsignedtransaction)): *string*
**createSigningPayload**(`unsigned`: [UnsignedTransaction](../interfaces/_balancetransfer_.unsignedtransaction.md)): *string*
*Defined in [createSigningPayload.ts:11](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/createSigningPayload.ts#L11)*
*Defined in [src/createSigningPayload.ts:11](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/createSigningPayload.ts#L11)*
Construct the signing payload from an unsigned transaction and export it to
a remote signer (this is often called "detached signing")
......@@ -23,6 +23,6 @@ a remote signer (this is often called "detached signing")
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 |
**Returns:** *string*
......@@ -14,7 +14,7 @@
**decodeTx**(`signedTx`: string, `metadataRpc`: string): *Partial‹[TxInfo](../interfaces/_balancetransfer_.txinfo.md)›*
*Defined in [decodeTx.ts:17](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/decodeTx.ts#L17)*
*Defined in [src/decodeTx.ts:17](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/decodeTx.ts#L17)*
Parse the transaction information from an unsigned and signed transaction
offline
......
......@@ -14,7 +14,7 @@
**deriveAddress**(`publicKey`: string | Uint8Array, `ss58Format`: number): *string*
*Defined in [deriveAddress.ts:11](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/deriveAddress.ts#L11)*
*Defined in [src/deriveAddress.ts:11](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/deriveAddress.ts#L11)*
Derive an address from a cryptographic public key offline
......
......@@ -4,6 +4,10 @@
## Index
### Interfaces
* [KeyringPair](../interfaces/_generatekeypair_.keyringpair.md)
### Functions
* [generateKeypair](_generatekeypair_.md#generatekeypair)
......@@ -12,10 +16,10 @@
### generateKeypair
**generateKeypair**(): *KeyringPair*
**generateKeypair**(): *[KeyringPair](../interfaces/_generatekeypair_.keyringpair.md)*
*Defined in [generateKeypair.ts:8](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/generateKeypair.ts#L8)*
*Defined in [src/generateKeypair.ts:13](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/generateKeypair.ts#L13)*
Generate a valid public/private keypair offline
**Returns:** *KeyringPair*
**Returns:** *[KeyringPair](../interfaces/_generatekeypair_.keyringpair.md)*
......@@ -15,7 +15,7 @@
**EXTRINSIC_VERSION**: *4* = 4
*Defined in [util/constants.ts:3](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/07b7ece/src/util/constants.ts#L3)*
*Defined in [src/util/constants.ts:3](https://github.com/amaurymartiny/polkadotjs-wrapper/blob/4ad0632/src/util/constants.ts#L3)*
___
......@@ -23,4 +23,4 @@ ___
**KUSAMA_SS58_FORMAT**: *2* = 2