Messina SDK
  • Introduction
    • Introduction
  • SETTING UP
    • Installation
  • Contracts
    • Contracts
  • METHODS
    • Algorand
      • transferFromAlgorand()
      • getEmitterAddressAlgorand()
      • parseSequenceFromLogAlgorand()
      • redeemOnAlgorand()
    • EVM
      • getAllowanceEth()
      • approveEth()
      • transferFromEth()
      • getEmitterAddressEth()
      • parseSequenceFromLogEth()
      • redeemOnEth()
      • redeemOnEthWithType()
    • Guardian
      • getSignedVAA()
    • Utils
      • nativeToHexString()
  • Bridging
    • Algorand -> Ethereum
    • Ethereum -> Algorand
  • Contact
    • Email
    • Discord
    • Telegram
    • Twitter
Powered by GitBook
On this page
  • Method Parameters
  • Returns
  • Usage
  1. METHODS
  2. EVM

getAllowanceEth()

Gets ERC-20 token spend allowance for contract

Method Parameters

tokenBridgeAddress: string

Ethereum bridge contract address

tokenAddress: string

Ethereum token address

signer: ethers.Signer

ethers js Signer

Returns

Returns allowance as ethers.BigNumber from ethers js

Usage

import { ethers } from "ethers";
import { getAllowanceEth } from "@algo-foundry/messina-sdk";

const provider = new ethers.providers.WebSocketProvider(<ETH_NODE_URL>) as any;   
const signer = new ethers.Wallet(<ETH_PRIVATE_KEY>, provider);

const allowance: ethers.BigNumber = await getAllowanceEth("0xf72a04B891bA46819D83c75687d31f22f6d646c1","0xbF0482884043B7ea1eB55516770C217C77CC7A48", signer);

PreviousEVMNextapproveEth()

Last updated 6 months ago