Module to connect to the Fennel network through a Fennel parachain node
- Source:
Methods
(inner) getBalance(address) → {Promise}
Gets the balance of the specified Fennel blockchain account
Parameters:
Name | Type | Description |
---|---|---|
address |
string |
- Source:
Returns:
- Type
- Promise
(inner) getBlock(blockHash) → {Promise}
Gets a block by its hash
Parameters:
Name | Type | Description |
---|---|---|
blockHash |
string |
- Source:
Returns:
resolves to a JOSN representation of the block
- Type
- Promise
(inner) getBlockByHash(blockHash, fullopt) → {Promise}
Gets a block by its hash
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
blockHash |
string | ||
full |
boolean |
<optional> |
get the full block including extrinsics (default) |
- Source:
Returns:
resolves to a JSON representation of the block
- Type
- Promise
(inner) getBlockByNumber(blockNumber, fullopt) → {Promise}
Gets a block by its number including transaction data
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
blockNumber |
Object | ||
full |
boolean |
<optional> |
get the full block including extrinsics (default) |
- Source:
Returns:
resolves to block including extrinsics
- Type
- Promise
(inner) getBlockHash(blockNumber) → {Promise}
Gets the hash of the block specified by its block number
Parameters:
Name | Type | Description |
---|---|---|
blockNumber |
Object |
- Source:
Returns:
resolves to block hash
- Type
- Promise
(inner) getBlockHeader(blockHash) → {Promise}
Gets a block header by its hash
Parameters:
Name | Type | Description |
---|---|---|
blockHash |
string |
- Source:
Returns:
resolves to a JOSN representation of the block header
- Type
- Promise
(inner) getChainType() → {Promise}
Gets the chain type
- Source:
Returns:
resolves to chain type
- Type
- Promise
(inner) getFullBlock(blockHash) → {Promise}
Gets a full block by its hash
Parameters:
Name | Type | Description |
---|---|---|
blockHash |
string |
- Source:
Returns:
resolves to a JOSN representation of the block
- Type
- Promise
(inner) getHighestBlock() → {Promise}
Gets the highest block, i.e. the current block count of the longest chains
- Source:
Returns:
resolves to highest known block number
- Type
- Promise
(inner) getNodePeerId() → {Promise}
Gets the system peer id
- Source:
Returns:
resolves to system name
- Type
- Promise
(inner) getNodeRoles() → {Promise}
Gets the node roles
- Source:
Returns:
resolves to array with node roles
- Type
- Promise
(inner) getPeerCount() → {Promise}
Gets the number of peers
- Source:
Returns:
resolves to the number of peers
- Type
- Promise
(inner) getRuntimeVersion() → {Promise}
Gets the runtime version information
- Source:
Returns:
resolves to version info
- Type
- Promise
(inner) getSyncState() → {Promise}
Gets the system synchronisation state
- Source:
Returns:
resolves to connection count
- Type
- Promise
(inner) getSystemHealth() → {Promise}
Gets the node health
- Source:
Returns:
resolves to the node's system health
- Type
- Promise
(inner) getSystemName() → {Promise}
Gets the system name
- Source:
Returns:
resolves to system name
- Type
- Promise
(inner) getSystemVersion() → {Promise}
Gets the system version
- Source:
Returns:
resolves to connection count
- Type
- Promise
(inner) getTransactionCount(address) → {Promise}
Gets the transaction count of the specified Fennel blockchain account
Parameters:
Name | Type | Description |
---|---|---|
address |
string |
- Source:
Returns:
- Type
- Promise
(inner) initRpc(fnlConfig, fnlState) → {Promise}
Initialises Fennel RPC
Parameters:
Name | Type | Description |
---|---|---|
fnlConfig |
Object | the Fennel blockchain configuration |
fnlState |
Object | the Fennel blockchain state |
- Source:
Returns:
resolve if succesfully initialised
- Type
- Promise
(inner) isSyncing() → {Promise}
Checks if the node is syncing
- Source:
Returns:
resolves to syncing infomration
- Type
- Promise
(inner) sendSignal(keyring, data) → {Promise}
Send a signal transaction to the Fennel blockchain
Parameters:
Name | Type | Description |
---|---|---|
keyring |
Object | the Polkadot keyring to sign the transaction |
data |
string | the data to be sent as a signal |
- Source:
Returns:
resolves to the transaction hash
- Type
- Promise
(inner) sendTokens(keyring, toAddress, amount) → {Promise}
Sends a token transfer transaction to the Fennel blockchain
Parameters:
Name | Type | Description |
---|---|---|
keyring |
Object | the Polkadot keyring to sign the transaction |
toAddress |
string | the address to transfer the tokens to |
amount |
number | the amount of tokens to transfer |
- Source:
Returns:
resolves to the transaction hash
- Type
- Promise