RPCWallet

RPCWallet

Easily interact with an RPC Wallet to send Bulk transactions extremely quickly in series




Constructor

new RPCWallet()

Source:

Methods




addAncestor(hex) → {Boolean}

Add a transaction we just sent to the ancestor count/size

Parameters:
Name Type Description
hex String

The transaction hex to count

Source:
Returns:

Returns true on success

Type:
Boolean



(async) checkAncestorCount() → {Boolean}

Checks the current ancestor count and returns when it is safe to send more transactions. This method will wait for tx's in the mempool to be confirmed before continuing.

Source:
Returns:

Returns true once it is safe to continue sending transactions

Type:
Boolean



(async) connectToPeers()

Create fcoin "Peers" for all peers that the rpc full node as access to.

Source:



createAndSignTransaction(input, outputs, floData) → {String}

Create and sign a transaction using bitcoinjs-lib and js-oip libraries

Parameters:
Name Type Description
input Object

[description]

outputs Object

[description]

floData String

[description]

Source:
Returns:

Returns the built hex string

Type:
String



destroyPeers()

Destroy peers created in rebroadcastTransactions

Source:



(async) getUTXOs() → {Array.<Object>}

Get the latest unspent transaction outputs

Source:
Returns:

Returns an Array of UTXO's

Type:
Array.<Object>



(async) initialize() → {Boolean}

Initialize the RPC Wallet. This imports the Private Key, and then checks for unconfirmed transactions in the mempool.

Source:
Returns:

Returns true on Success

Type:
Boolean



(async) rebroadcastTransactions()

Rebroadcast out all transactions on our local mempool

Source:



(async) rpcRequest(method, parameters) → {Object}

Make any RPC request

Parameters:
Name Type Description
method String

The RPC method you wish to call

parameters Array

The parameters to pass to with RPC method you are calling

Source:
Returns:

Returns the data response

Type:
Object



(async) sendDataToChain(floData) → {String}

Create and broadcast a transaction containing the requested data as floData

Parameters:
Name Type Description
floData String

The data you wish to be placed into the floData of the transaction.

Source:
Returns:

Returns the TXID of the transaction if sent successfully

Type:
String



(async) sendTX(inputs, outputs, floData) → {String}

Send a Transaction using the requested inputs, outputs, and floData

Parameters:
Name Type Description
inputs Array.<Object>

An array of utxo inputs to use to fund the transaction

outputs Object

An Object that contains addresses to output to as the key, and the amount to send as the value (i.e. { 'mypublicaddresshere': 1 })

floData String

The floData you wish to include in the transaction

Source:
Returns:

Returns the txid of the transaction if sent successfully

Type:
String



(async) signMessage(message) → {String}

Sign a message using the internal private key

Parameters:
Name Type Description
message String

The message you wish to have signed

Source:
Returns:

Returns the base64 version of the Signature

Type:
String



(async) updateAncestorStatus() → {Boolean}

Grab the latest unconfirmed tx and check how many ancestors it has

Source:
Returns:

Returns true if the update was successful

Type:
Boolean