Constructor
new Chain(data)
Create a Chain
Parameters:
Name | Type | Description |
---|---|---|
data |
object | An object representing a chain |
- Source:
Methods
address(accountAddress) → {string|null}
Return a link to Explorer for a given Address
Parameters:
Name | Type | Description |
---|---|---|
accountAddress |
string | An account address |
- Source:
Returns:
- Type
- string | null
block(blockHashOrHeight) → {string|null}
Return a link to Explorer for a given Block Hash
Parameters:
Name | Type | Description |
---|---|---|
blockHashOrHeight |
string | A block hash or block height |
- Source:
Returns:
- Type
- string | null
chain() → {string}
Return the chain group name
- Source:
Returns:
- Type
- string
chainId() → {number}
Return the chainId
- Source:
Returns:
- Type
- number
explorerName() → {string|undefined}
Return the explorer name
- Source:
Returns:
- Type
- string | undefined
explorerUrl() → {string|undefined}
Return the explorer base URL
- Source:
Returns:
- Type
- string | undefined
(async) fetchChain() → {Chain}
Find or fetch data to build a Chain object
Parameters:
Type | Description |
---|---|
number | The chainId of the Chain |
- Source:
Returns:
- Type
- Chain
infoURL() → {string}
Return the main URL
- Source:
Returns:
- Type
- string
name() → {string}
Return the name
- Source:
Returns:
- Type
- string
nativeCurrency() → {objct}
Return the native currency
- Source:
Returns:
- Type
- objct
shortName() → {string}
Return the short name - See EIP-3770 https://eips.ethereum.org/EIPS/eip-3770
- Source:
Returns:
- Type
- string
token(tokenAddress) → {string|null}
Return a link to Explorer for a given ERC-20 Token Address
Parameters:
Name | Type | Description |
---|---|---|
tokenAddress |
string | A token contract address |
- Source:
Returns:
- Type
- string | null
tx(txHash) → {string|null}
Return a link to Explorer for a given Transaction Hash
Parameters:
Name | Type | Description |
---|---|---|
txHash |
string | A transaction hash |
- Source:
Returns:
- Type
- string | null