Utility

FCT Core Library utility functions

import { utils } from "@kirobo/fct-core";

getVariablesAsBytes32

Convert array of variables as bytes32[]

const variablesAsBytes32 = utils.getVariablesAsBytes32(variables)

Method Arguments

Returns

bytes32[] - Variables array

transactionValidator

Promise function - Validate FCT transaction

const { isValid, txData, prices, error } = await utils.transactionValidator(
    validatorData
)

Method Arguments

ITxValidator

Returns

object

getGasPrices

Promise function - get EIP1559 slow, average ,fast and fastest speeds maxFeePerGas and maxPriorityFeePerGas

const variablesAsBytes32 = utils.getGasPrices({
    rpcUrl,
    historicalBlock
})

Method Arguments

Returns

object

{
  slow: {
    maxFeePerGas: number,
    maxPriorityFeePerGas: number,
  },
  average: {
    maxFeePerGas: number,
    maxPriorityFeePerGas: number,
  },
  fast: {
    maxFeePerGas: number,
    maxPriorityFeePerGas: number,
  },
  fastest: {
    maxFeePerGas: number,
    maxPriorityFeePerGas: number,
  },
}

Last updated