This is the main class that interact with IOST blockchain and IOST smart contracts to send and get transactions from them.
constructor
constructor method is a special method for creating and initializing Transaction class.
DO NOT need to initialize by user, user will use Transaction class by rpc.transaction.
getTxByHash
get tx by hash from blockchain
Parameters
Name Type Description
hash String base58 encode txHash
Returns
Promise returns transaction object.
Transaction Object
Name Type Description
hash String transaction hash
time Number transaction timestamp
expiration Number expiration timestamp
gas_ratio Number gas gas_ratio
gas_limit Number gas limit
delay Number delay nanoseconds
actions Array array of Action Object
signers Array array of signer string
publisher String transaction publisher
referred_tx String referred transaction hash
amount_limit Array array of AmountLimit Object
tx_receipt Object TxReceipt Object
Action Object
Name Type Description
contract String contract name
action_name String action name
data String data
AmountLimit Object
Name Type Description
token String token name
value Number limit value
TxReceipt Object
Name Type Description
tx_hash String transaction hash
gas_usage Number gas usage
ram_usage Map ram usage
status_code String status code
message String message
returns Array transaction returns
receipts Array array of Receipt Object
Receipt Object
Name Type Description
func_name String function name
content String content
Example
const rpc = new IOST.RPC(new IOST.HTTPProvider('http://127.0.0.1:30001' ));
rpc.transaction.getTxByHash("5YdA8qPq5N6W47rZV4u31FdbQzeMt2QX9KGj4uPyERZa" ).then(console .log);
getTxReceiptByTxHash
get transaction receipt by transaction hash
Parameters
Name Type Description
hash String base58 encode txHas
Returns
Promise returns TxReceipt Object
Example
const rpc = new IOST.RPC(new IOST.HTTPProvider('http://127.0.0.1:30001' ));
rpc.transaction.getTxByHash("5YdA8qPq5N6W47rZV4u31FdbQzeMt2QX9KGj4uPyERZa" ).then(console .log);
sendTx
send transaction to IOST blockchain