Class: NodeClient

node.NodeClient(node)

Node Client

Constructor

new NodeClient(node)

Create a node client.

Parameters:
Name Type Description
node Node
Source:

Members

node :Node

Type:
  • Node
Source:

Methods

(async) addFilter(data) → {Promise}

Add data to filter.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
Promise

bind(type, handler)

Add a listener.

Parameters:
Name Type Description
type String
handler function
Source:

(async) close() → {Promise}

Close the client.

Source:
Returns:
Type
Promise

(async) estimateFee(blocksnullable) → {Promise}

Esimate smart fee.

Parameters:
Name Type Attributes Description
blocks Number <nullable>
Source:
Returns:
Type
Promise

(async) getBlockHeader(block) → {Promise.<ChainEntry>}

Get block header.

Parameters:
Name Type Description
block Hash | Number
Source:
Returns:
Type
Promise.<ChainEntry>

(async) getCoin(hash, index) → {Object}

Get UTXO.

Parameters:
Name Type Description
hash Hash
index Number
Source:
Returns:
Type
Object

(async) getEntries(start, end) → {Promise.<Array.<ChainEntry>>}

Get entries range.

Parameters:
Name Type Description
start Number
end Number
Source:
Returns:
Type
Promise.<Array.<ChainEntry>>

(async) getEntry(hash) → {Promise}

Get chain entry.

Parameters:
Name Type Description
hash Hash
Source:
Returns:
Type
Promise

(async) getHashes(start, end) → {Promise}

Get hash range.

Parameters:
Name Type Description
start Number
end Number
Source:
Returns:
Type
Promise

(async) getNameStatus(nameHash) → {Object}

Get name state.

Parameters:
Name Type Description
nameHash Buffer
Source:
Returns:
Type
Object

(async) getTip() → {Promise}

Get chain tip.

Source:
Returns:
Type
Promise

handleCall(event, …args) → {Promise}

Call a hook.

Parameters:
Name Type Attributes Description
event String
args Object <repeatable>
Source:
Returns:
Type
Promise

hook(event, handler)

Add a hook.

Parameters:
Name Type Description
event String
handler function
Source:

init()

Initialize the client.

Source:

(async) open() → {Promise}

Open the client.

Source:
Returns:
Type
Promise

(async) rescan(start) → {Promise}

Rescan for any missed transactions.

Parameters:
Name Type Description
start Number | Hash

Start block.

Source:
Returns:
Type
Promise

(async) rescanInteractive(start, fullLockopt) → {Promise}

Rescan interactive for any missed transactions.

Parameters:
Name Type Attributes Default Description
start Number | Hash

Start block.

fullLock Boolean <optional>
false
Source:
Returns:
Type
Promise

(async) resetFilter() → {Promise}

Reset filter.

Source:
Returns:
Type
Promise

(async) send(tx) → {Promise}

Send a transaction. Do not wait for promise.

Parameters:
Name Type Description
tx TX
Source:
Returns:
Type
Promise

(async) sendClaim(claim) → {Promise}

Send a claim. Do not wait for promise.

Parameters:
Name Type Description
claim Claim
Source:
Returns:
Type
Promise

(async) setFilter(filter) → {Promise}

Set bloom filter.

Parameters:
Name Type Description
filter Bloom
Source:
Returns:
Type
Promise

unhook(event)

Remove a hook.

Parameters:
Name Type Description
event String
Source: