Class: NodeClient

node.NodeClient()

Node Client

Constructor

new NodeClient()

Create a node client.

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) getCoin(hash, index) → {Object}

Get UTXO.

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

(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

hook(type, handler)

Add a listener.

Parameters:
Name Type Description
type String
handler function
Source:

init()

Initialize the client.

Source:

(async) open() → {Promise}

Open the client.

Source:
Returns:
Type
Promise

(async) rescan(start, filter, iter) → {Promise}

Rescan for any missed transactions.

Parameters:
Name Type Description
start Number | Hash

Start block.

filter Bloom
iter function

Iterator.

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