Class EvmWeb3Private

Class containing methods for executing the functions of contracts and sending transactions in order to change the state of the blockchain. To get information from the blockchain use Web3Public.

Hierarchy

Constructors

Properties

address: string

Current wallet provider address.

web3: default

Instance of web3, initialized with ethereum wallet, e.g. Metamask, WalletConnect.

Methods

  • Parameters

    • tokenAddress: string

      Token address you want to approve for spending

    • permit2Address: string

      Addres of permit2 contract

    • spenderAddress: string

      Contract address spending your tokens

    • amount: BigNumber | "infinity" = 'infinity'

      Approved amount

    • deadline: BigNumber = ...

      Ms number added to current time (Date.now()) until approve expiration

    • options: EvmTransactionOptions = {}

    Returns Promise<TransactionReceipt>

  • Build encoded approve transaction config.

    Returns

    Encoded approve transaction config.

    Parameters

    • tokenAddress: string

      Address of the smart-contract corresponding to the token.

    • spenderAddress: string

      Wallet or contract address to approve.

    • value: BigNumber | "infinity"

      Amount of tokens in approval window in spending cap field

    • Optional options: EvmTransactionOptions = {}

      Additional options.

    Returns Promise<TransactionConfig>

  • Executes method of smart-contract and resolve the promise when the transaction is included in the block.

    Returns

    Smart-contract method returned value.

    Parameters

    • contractAddress: string

      Address of smart-contract which method is to be executed.

    • contractAbi: AbiItem[]

      Abi of smart-contract which method is to be executed.

    • methodName: string

      Method name to execute.

    • methodArguments: unknown[]

      Method arguments.

    • Optional options: EvmTransactionOptions = {}

      Additional options.

    Returns Promise<TransactionReceipt>

  • Tries to execute method of smart-contract and resolve the promise when the transaction is included in the block or rejects the error.

    Parameters

    • contractAddress: string

      Address of smart-contract which method is to be executed.

    • contractAbi: AbiItem[]

      Abi of smart-contract which method is to be executed.

    • methodName: string

      Method name to execute.

    • methodArguments: unknown[]

      Method arguments.

    • Optional options: EvmTransactionOptions = {}

      Additional options.

    • Optional allowError: ((err: Web3Error) => boolean)

      Check error and decides to execute contact if error is allowed.

    Returns Promise<TransactionReceipt>

Generated using TypeDoc