Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @sec-block/secjs-transactionpool with all npm packages installed. Try it out:

var secjsTransactionpool = require("@sec-block/secjs-transactionpool")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@sec-block/secjs-transactionpool v1.0.10

sec blockchain transaction-pool lib

JavaScript Style Guide

[JavaScript Style Guide]

SECTransactionPool

This package is for sec blockchain transaction pool

new SECTransactionPool(config)

create a transaction pool with config, such as transaction pool of token chain or transaction chain

ParamType
configObject

secTransactionPool.addTxIntoPool(transaction)

save the transaction into local transaction pool

Kind: instance method of SECTransactionPool

ParamType
transactionObject

secTransactionPool.updateBlockHashArray(blockChain)

upate the block hash array this blockChainHashBuffer is for checking the transaction in transaction pool, just compare the TxHash

Kind: instance method of SECTransactionPool

ParamType
blockChainObject

secTransactionPool.compareTxWithHashTable()

remove transactions in transaction pool, if they are already upload to blockchain

Kind: instance method of SECTransactionPool

secTransactionPool.addTxFromOtherPeerIntoPool(txFromOtherPeer)

to update the local transaction pool with transactions from other peers

Kind: instance method of SECTransactionPool

ParamType
txFromOtherPeerObject

secTransactionPool.getTxStatus(transaction) => Status

get transaction status: pending, success, error

Kind: instance method of SECTransactionPool

ParamType
transactionObject

secTransactionPool.getAllTxFromPool() => Array

return all transaction from pool

Kind: instance method of SECTransactionPool

secTransactionPool.clear()

clear the transaction pool

Kind: instance method of SECTransactionPool

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free