Global

Members

(constant) DEFAULT_ENDPOINT :Endpoint

Source:
Type:

(constant) NodeStatus :number

Source:
Properties:
Name Type Description
OK number
DISCONNECTED number
ERROR number
Type:
  • number

Methods

getUnkownAttribute(value, attributes) → {string|undefined}

Source:
Parameters:
Name Type Description
value any
attributes Array.<string>
Returns:
Type
string | undefined

heximalToNumber(heximal, defaultValue) → {number}

Source:
Parameters:
Name Type Description
heximal any
defaultValue number
Returns:
Type
number

isAbi(value) → {boolean}

Source:
Parameters:
Name Type Description
value Abi
Returns:
Type
boolean

isEthAddressHeximal(value) → {boolean}

Source:
Parameters:
Name Type Description
value EthAddressHeximal
Returns:
Type
boolean

isPositiveInteger(value) → {boolean}

Source:
Parameters:
Name Type Description
value any
Returns:
Type
boolean

isTransactionHashHeximal(value) → {boolean}

Source:
Parameters:
Name Type Description
value TransactionHashHeximal
Returns:
Type
boolean

isUnsignedInteger(value) → {boolean}

Source:
Parameters:
Name Type Description
value any
Returns:
Type
boolean

isValidEndpoint(value) → {boolean}

Source:
Parameters:
Name Type Description
value Endpoint
Returns:
Type
boolean

isValidHttpUrl(value) → {boolean}

Source:
Parameters:
Name Type Description
value HttpUrl
Returns:
Type
boolean

numberToHeximal(number, defaultValue) → {Heximal|undefined}

Source:
Parameters:
Name Type Description
number any
defaultValue Heximal
Returns:
Type
Heximal | undefined

Type Definitions

Abi

Source:

ABI of a contract on ETH network.

Type:
  • Array

Block

Source:
Properties:
Name Type Description
parentHash Heximal
receiptsRoot Heximal
totalDifficulty Heximal
transactionsRoot Heximal
gasLimit Heximal
nonce Heximal
number UnsignedInteger
gasUsed Heximal
mixHash Heximal
sha3Uncles Heximal
timestamp UnsignedInteger
uncles Array
difficulty Heximal
hash Heximal
logsBloom Heximal
stateRoot Heximal
transactions Array.<TransactionHashHeximal>
extraData Heximal
miner EthAddressHeximal
size Heximal
Type:
  • object

BlockHashHeximal

Source:

32 bytes block hash as heximal with prefix "0x".

Type:
  • string

ClientConfig

Source:
Properties:
Name Type Attributes Default Description
endpoints Array.<Endpoint> <optional>
[DEFAULT_ENDPOINT]

List of ETH RPC endpoints.

reorganisationBlocks UnsignedInteger <optional>
6

There is a block n = latest - reorganisationBlocks. Where latest is newest mined block number. The client will not process related things that has block number greater than block number n.

healthCheckInterval PositiveInteger <optional>
3000

For each time period, check health of nodes, in miliseconds. Default is 3000.

Type:
  • object

DiaryConfig

Source:
Properties:
Name Type Attributes Default Description
maxRetry UnsignedInteger <optional>
10

Number of times for retring getting log before give up.

reorganisationBlocks UnsignedInteger <optional>
6

There is a block n = latest - reorganisationBlocks, the diary does not process things that has block number greater than n. Where latest is latest mined block number.

Type:
  • object

Endpoint

Source:
Properties:
Name Type Description
url HttpUrl

A HTTP URL such as http:// or https://.

weight UnsignedInteger

The greater value, the more requests will be send to this node. If it is zero then the node will not receive any requests.

Type:
  • object

EthAddressHeximal

Source:

ETH address, 20 bytes as heximal with prefix "0x".

Type:
  • string

EthProviderConfig

Source:
Properties:
Name Type Description
endpoint string

URL refer to ETH RPC endpoint.

Type:
  • object

GateWayConfig

Source:
Properties:
Name Type Attributes Default Description
healthcheckInterval UnsignedInteger <optional>
3000

For each time period, check health of nodes, in miliseconds.

reorganisationBlocks UnsignedInteger <optional>
6

Safe block number s = latest - reorganisationBlocks.

Type:
  • object

Heximal

Source:

Hex string with prefix "0x".

Type:
  • string

HttpUrl

Source:

A URL that has protocol http or https.

Type:
  • string

HttpUrl

Source:
Type:
  • string

Log

Source:
Properties:
Name Type Description
address EthAddressHeximal
blockNumber UnsignedInteger
logIndex UnsignedInteger
transactionIndex UnsignedInteger
removed boolean
topics Array.<Topic>
data Heximal
blockHash BlockHashHeximal
transactionHash TransactionHashHeximal
Type:
  • object

LogFilter

Source:
Properties:
Name Type Attributes Default Description
fromBlock UnsignedInteger

Searching where block number is greater than or equal this one.

toBlock UnsignedInteger

Searching where block number is less than or equal this one.

addresses Array.<EthAddressHeximal> <optional>
[]

List of addresses that emits log records.

topics Array.<Topic> <optional>
[]

Searching for matched topics.

Type:
  • object

NodeConfig

Source:
Properties:
Name Type Attributes Default Description
identity UnsignedInteger
endpoint HttpUrl <optional>
'http://localhost:8545'
weight UnsignedInteger <optional>
1

It is use for evalution and distribution requests between nodes. The greater weight, the more requests is dispatch to this node.

Type:
  • object

NodeStat

Source:
Properties:
Name Type Description
status NodeStatus
blockNumber UnsignedInteger | undefined
message string | undefined
Type:
  • object

PositiveInteger

Source:

Positive integer number.

Type:
  • number

RpcLogFilter

Source:
Properties:
Name Type Attributes Default Description
fromBlock Heximal

Searching where block number is greater than or equal this one.

toBlock Heximal

Searching where block number is less than or equal this one.

addresses Array.<EthAddressHeximal> <optional>
[]

List of addresses that emits log records.

topics Array.<Topic> <optional>
[]

Searching for matched topics.

Type:
  • object

TrackedNode

Source:
Properties:
Name Type Description
stat NodeStat
node Node
Type:
  • object

Transaction

Source:
Properties:
Name Type Description
hash TransactionHashHeximal
from EthAddressHeximal
to EthAddressHeximal
blockNumber number
transactionIndex number
type number
nonce number
gas BigInt
gasPrice BigInt
input Heximal
value Heximal
r Heximal
s Heximal
v Heximal
Type:
  • object

TransactionHashHeximal

Source:

32 bytes as heximal string.

Type:
  • string

UnsignedInteger

Source:

Unsigned integer number.

Type:
  • number