Network

getAbciInfo

- Get ABCI information This method is used to get ABCI information.

Parameters:

  • <string> - a wallet address

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<AbciInfoResult> - An instance of AbciInfoResult containing the response and error.

Example:

const data = "0x12345d";

// Get ABCI information
const acbiInfo = await Network.getAbciInfo(data);

getAbciNoce

- Get ABCI Noce This method is used to get ABCI Noce.

Parameters:

  • <string> - a wallet address

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<AbciNoceResult> - An instance of AbciNoceResult containing the response and error.

Example:

const data = "0x12345d";

// Get ABCI Noce
const acbiNoce = await Network.getAbciNoce(data);

getAssetToken

- Get information of given type of asset token This method is used to get information of given type of asset token

Parameters:

  • <string> - asset code

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<AssetTokenDataResult> - An instance of AssetTokenDataResult containing the response and error.

Example:

const data = "0x12345d";

// Get ABCI Noce
const acbiNoce = await Network.getAbciNoce(data);

getBlock

- Get datails of given block This method is used to get details of given block.

Parameters:

  • <number> - block Height

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<BlockDetailsDataResult> - An instance of BlockDetailsDataResult containing the response and error.

Example:

const blockHeight = 1432;// Get block #1432 detailsconst blockDetail = await Network.getBlock(blockHeight);

getDelegateInfo

- Get the delegation information This method is used to get the delegation information.

Parameters:

  • <string> - public key

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<DelegateInfoDataResult> - An instance of DelegateInfoDataResult containing the response and error.

Example:

const publickey = "qsedx23rtgds";

// Get the delegation information
const blockDetail = await Network.getDelegateInfo(publickey);

getHashSwap

- Get transaction details This method is used to get details of transaction with given hash

Parameters:

  • <string> - transaction hash

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<HashSwapDataResult> - An instance of HashSwapDataResult containing the response and error.

Example:

const hash = `YOUR_TX_HASH`;

// Get transaction details of given hash
const txDetail = await Network.getHashSwap(hash);

getIssuedRecords

- Get information of issued records for given public key This method is used to get information of issued records for given public key

Parameters:

  • <string> - public key

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<IssuedRecordDataResult> - An instance of IssuedRecordDataResult containing the response and error.

Example:

const publickey = `publickeyexample`;

// Get issed records information
const issuedRecords = await Network.getIssuedRecords(publickey);

getOwnedSids

- Get Sids owned by given address This method is used to get Sids owned by given address

Parameters:

  • <string> - wallet address

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<OwnedSidsDataResult> - An instance of OwnedSidsDataResult containing the response and error.

Example:

const address = `frabhhjsswerf`;

// Get Sids' information
const ownedSids = await Network.getOwnedSids(address);

getOwnerMemo

- Get the owner memo by given UTXO sid This method is used to get owner memo by given UTXO sid

Parameters:

  • <number> - UTXO sid

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<OwnerMemoDataResult> - An instance of OwnerMemoDataResult containing the response and error.

Example:

const utxoSid = 143;

// Get owner memo
const ownerMemo = await Network.getOwnerMemo(utxoSid);

getStateCommitment

- Returns state commitment An important property of a Fractal ledger is the ability to authenticate transactions. Users can authenticate transactions against a small tag called the state commitment. The state commitment is a commitment to the current state of the ledger. The state commitment response is a tuple containing the state commitment and the state commitment version.

Parameters:

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<StateCommitmentDataResult> - An instance of StateCommitmentDataResult containing the response and error.

Example:

// Get state commitment
const stateCommitment = await Network.getStateCommitment();

getTransactionStatus

- Returns transaction status Using the transaction handle, user can fetch the status of the transaction from the query server.

Parameters:

  • <string> - transaction handle (hash)

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<TransactionStatusDataResult> - An instance of TransactionStatusDataResult containing the response and error.

Example:

const handle = `YOUR_TX_HASH`;

// Get transaction status
const transactionStatus = await Network.getTransactionStatus(handle);

getTransactionDetails

- Returns transaction details Using the transaction handle, user can fetch the details of the transaction from the query server.

Parameters:

  • <string> - transaction handle (hash)

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<TxDetailsDataResult> - An instance of TxDetailsDataResult containing the response and error.

Example:

const handle = `YOUR_TX_HASH`;

// Get transaction details
const transactionDetails = await Network.getTransactionDetails(handle);

getTxList

- Get a list of transactions for given wallet address This method is used to get a list of transactions for given wallet address

Parameters:

  • <string> - wallet address

  • <"to"|"from"> - transaction type. it can only be "to" or "from"

  • <number> - pagination. Default is 1.

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<TxListDataResult> - An instance of TxListDataResult containing the response and error.

Example:

const address = `fra000xxsr`;
const type = "to";

// Get list of `to` transaction of given address
const txDetail = await Network.getTxList(address, type);

getUtxo

- Get UTXO ledger for given utxo sid This method is used to get UTXO ledger for given UTXO sid

Parameters:

  • <number> - UTXO SID

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<UtxoDataResult> - An instance of UtxoDataResult containing the response and error.

Example:

const utxoSid = 143;

// Get UTXO details
const utxoData = await Network.getUtxo(utxoSid);

getValidatorList

- Get validator list This method is used to get the list of validators.

Parameters:

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<ValidatorListDataResult> - An instance of ValidatorListDataResult containing the response and error.

Example:

// Get validator list
const acbiInfo = await Network.getValidatorList();

sendRpcCall

- Send RPC call This method is used to send RPC call.

Parameters:

  • <string> - RPC url

  • <{[key: string]: any}> - payload

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<T> - The response object from RPC call.

Example:

cont url = `https://prod-testnet.prod.findora.org:8545`;
const payload = {
  method: `eth_getBlockByHash`,
  params: ['0x1af723767d06...',true],
};

// Send the RPC call to get block details by hash
const response = await Network.sendRpcCall(url,payload);

submitEvmTx

- Submit EVM transaction This method is used to submit a EVM transaction.

Parameters:

  • <string> - transaction hash

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<SubmitEvmTxResult> - An instance of SubmitEvmTxResult containing the response and error.

Example:

const tx = "Your_TX_Hash";

// Submit a EVM transaction
const result = await Network.submitEvmTx(tx);

submitTransaction

- Submit transation This method is used to submit a transaction

Parameters:

  • <TransactionData> - (optinal) transaction data

  • <NetworkAxiosConfig> - (optinal) network config

Results:

  • Promise<SubmitTransactionDataResult> - An instance of SubmitTransactionDataResult containing the response and error.

Example:

const data = `Your_Transaction_Data`;

// Submit transaction
const txResult = await Network.submitTransaction(data);

Last updated