Skip to main content

Helpers

getBlockTime​

- Get Block Time by given block height.
Using this function, user can get block time by given block height

Parameters:​
  •   <number> - block height
Results:​
  •   Promise<undefined | string> - Block time
Example:​
const blockHeight = 2341;
// Get block time at Block #2341
const blockTime = await helpers.getBlockTime(blockHeight);

getTxListFromResponse​

- Get Transaction List by given transaction data response.
Using this function, user can Get Transaction List by given transaction data response

Parameters:​
  •   <TxListDataResult> - transaction data response
Results:​
  •   Promise<null | TxInfo[]> - transaction list
Example:​
const address = "fra12dsfew";
const type = "to";
const dataResult = await Network.getTxList(address, type);
// Get tx list
const txList = await helpers.getTxListFromResponse();

getTxOperationsList​

- Get Operation List by given parsed transaction
Using this function, user can Get Transaction List by given parsed transaction

Parameters:​
  •   <ParsedTx> - parsed tx info
Results:​
  •   TxOperation[]> - transaction operation list
Example:​
const address = "fra12dsfew";
const type = "to";
const dataResult = await Network.getTxList(address, type);
// Get tx list
const txList = await helpers.getTxListFromResponse();
// Get one parsed tx
parsedTx = JSON.parse(Base64.decode(txList[0].tx));
// Get operation Lsit
opList = helpers.getTxOperationsList(parsedTx);
© Findora 2022
|
|

Â