Class

RawTransactions

RawTransactions()

Methods

# combineRawTransaction(params) → {Promise.<string>}

Combine multiple partially signed transactions into one transaction.

The combined transaction may be another partially signed transaction or a fully signed transaction.

Parameters:
Name Type Description
params
txs Array

A json array of hex strings of partially signed transactions

View Source methods/raw-transactions/raw-transactions.ts, line 318

The hex-encoded raw transaction with signature(s)

Promise.<string>

# createRawTransaction(params) → {Promise.<string>}

Create a transaction spending the given inputs and creating new outputs.

Outputs are addresses (paired with a RVN amount, data or object specifying an asset operation) or data.

Returns hex-encoded raw transaction.

Note that the transaction's inputs are not signed, and it is not stored in the wallet or transmitted to the network.

Paying for Asset Operations: Some operations require an amount of RVN to be sent to a burn address.

Paying for Asset Operations: Some operations require an amount of RVN to be sent to a burn address:

  • Operation: Amount + Burn Address
    • transfer: 0
    • transferwithmessage: 0
    • issue: " + i64tostr(GetBurnAmount(AssetType::ROOT) / COIN) + " to " + GetBurnAddress(AssetType::ROOT) +
    • issue (subasset): " + i64tostr(GetBurnAmount(AssetType::SUB) / COIN) + " to " + GetBurnAddress(AssetType::SUB) +
    • issue_unique: " + i64tostr(GetBurnAmount(AssetType::UNIQUE) / COIN) + " to " + GetBurnAddress(AssetType::UNIQUE) +
    • reissue: " + i64tostr(GetBurnAmount(AssetType::REISSUE) / COIN) + " to " + GetBurnAddress(AssetType::REISSUE) +
    • issue_restricted: " + i64tostr(GetBurnAmount(AssetType::RESTRICTED) / COIN) + " to " + GetBurnAddress(AssetType::RESTRICTED) +
    • reissue_restricted: " + i64tostr(GetBurnAmount(AssetType::REISSUE) / COIN) + " to " + GetBurnAddress(AssetType::REISSUE) +
    • issue_qualifier: " + i64tostr(GetBurnAmount(AssetType::QUALIFIER) / COIN) + " to " + GetBurnAddress(AssetType::QUALIFIER) +
    • issue_qualifier (sub): " + i64tostr(GetBurnAmount(AssetType::SUB_QUALIFIER) / COIN) + " to " + GetBurnAddress(AssetType::SUB_QUALIFIER) +
    • tag_addresses: " + "0.1 to " + GetBurnAddress(AssetType::NULL_ADD_QUALIFIER) + " (per address)
    • untag_addresses: " + "0.1 to " + GetBurnAddress(AssetType::NULL_ADD_QUALIFIER) + " (per address)
    • freeze_addresses: 0
    • unfreeze_addresses: 0
    • freeze_asset: 0
    • unfreeze_asset: 0 Assets For Authorization: These operations require a specific asset input for authorization:
  • Root Owner Token:
    • reissue
    • issue_unique
    • issue_restricted
    • reissue_restricted
    • freeze_addresses
    • unfreeze_addresses
    • freeze_asset
    • unfreeze_asset
    • Root Qualifier Token:
      • issue_qualifier (when issuing subqualifier)
    • Qualifier Token:
      • tag_addresses
      • untag_addresses

Output Ordering: Asset operations require the following:

  1. All coin outputs come first (including the burn output).
  2. The owner token change output comes next (if required).
  3. An issue, reissue, or any number of transfers comes last
    • (different types can't be mixed in a single transaction).
Parameters:
Name Type Attributes Default Description
params
inputs Array
outputs Array
locktime number <optional>
0

View Source methods/raw-transactions/raw-transactions.ts, line 281

transaction - hex string of the transaction

Promise.<string>

# decodeRawTransaction(params, hexstring) → {Promise.<DecodeRawTransactionResponse>}

Return a JSON object representing the serialized, hex-encoded transaction.

Parameters:
Name Type Description
params
hexstring string

The transaction hex string

View Source methods/raw-transactions/raw-transactions.ts, line 289

Parsed transaction

# decodeScript(params) → {Promise.<DecodeScriptResponse>}

Decode a hex-encoded script.

Parameters:
Name Type Description
params
hexstring string

// the hex encoded script

View Source methods/raw-transactions/raw-transactions.ts, line 297

Promise.<DecodeScriptResponse>

# getRawTransaction(params) → {Promise.<(string|GetRawTransactionResponse)>}

Parameters:
Name Type Attributes Default Description
params
txid string

The transaction id

verbose boolean <optional>
false

If false, return a string, otherwise return a json object

Deprecated:
  • NOTE: By default this function only works for mempool transactions. If the -txindex option is enabled, it also works for blockchain transactions. DEPRECATED: for now, it also works for transactions with unspent outputs. Return the raw transaction data. If verbose is 'true', returns an Object with information about 'txid'. If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.

View Source methods/raw-transactions/raw-transactions.ts, line 220

The serialized, hex-encoded data for 'txid' or verbose txid

Promise.<(string|GetRawTransactionResponse)>

# getTxOutProof(params) → {Promise.<GetTxOutProofResponse>}

Returns a hex-encoded proof that "txid" was included in a block.

NOTE: By default this function only works sometimes. This is when there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option or specify the block in which the transaction is included manually (by blockhash).

Parameters:
Name Type Attributes Description
params
txids Array

An array of transaction hashes

blockhash string <optional>

If specified, looks for txid in the block with this hash

View Source methods/raw-transactions/raw-transactions.ts, line 357

A string that is a serialized, hex-encoded data for the proof.

Promise.<GetTxOutProofResponse>

# sendRawTransaction(params) → {Promise.<string>}

Submits raw transaction (serialized, hex-encoded) to local node and network.

Also see createrawtransaction and signrawtransaction calls.

Parameters:
Name Type Attributes Default Description
params
hexstring string

The hex string of the raw transaction)

allowhighfees boolean <optional>
false

Allow high fees

View Source methods/raw-transactions/raw-transactions.ts, line 308

The transaction hash in hex

Promise.<string>

# signRawTransaction(params) → {Promise.<SignRawTransactionResponse>}

Sign inputs for raw transaction (serialized, hex-encoded).

The second optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain.

The third optional argument (may be null) is an array of base58-encoded private keys that, if given, will be the only keys used to sign the transaction.

Parameters:
Name Type Attributes Description
params
hexstring string

The transaction hex string

prevtxs Array <optional>

Array of json objects, or 'null' if none provided

privkeys Array <optional>

Array of strings, or 'null' if none provided. Private key in base58-encoding

sighashtype string <optional>

'ALL' | 'NONE' | 'SINGLE' | 'ALL|ANYONECANPAY' | 'NONE|ANYONECANPAY' | 'SINGLE|ANYONECANPAY'. Default = ALL. The signature hash type

View Source methods/raw-transactions/raw-transactions.ts, line 333

Promise.<SignRawTransactionResponse>

# testMempoolAccept(params) → {Promise.<TestMempoolAcceptResponse>}

Returns if raw transaction (serialized, hex-encoded) would be accepted by mempool.

This checks if the transaction violates the consensus or policy rules.

See sendrawtransaction call.

Parameters:
Name Type Attributes Default Description
params
rawtxs Array

An array of hex strings of raw transactions. Length must be one for now.

parasm.allowhighfees boolean <optional>
false

Default = false. Allow high fees.

View Source methods/raw-transactions/raw-transactions.ts, line 346

The result of the mempool acceptance test for each raw transaction in the input array. Length is exactly one for now.

Promise.<TestMempoolAcceptResponse>

# verifyTxOutProof(params) → {Promise.<VerifyTxOutProofResponse>}

Verifies that a proof points to a transaction in a block, returning the transaction it commits to and throwing an RPC error if the block is not in our best chain

Parameters:
Name Type Description
params
proof string

The hex-encoded proof generated by gettxoutproof

View Source methods/raw-transactions/raw-transactions.ts, line 365

Array of the txid(s) which the proof commits to, or empty array if the proof is invalid

Promise.<VerifyTxOutProofResponse>