Biconomy Gasless SDK (EOA)
DashboardMediumWebsite
  • 🚀Getting Started
  • Introduction
    • 🤘Why Biconomy?
    • 🙂How we simplify transactions
  • Products
    • 💸Gasless Transactions
      • Choose An Approach to Enable Gasless
        • Standard EIP 2771 Approach
          • 1. Register Artifacts on the Dashboard
          • 2. Code Changes
            • Using SDK
            • Using API
        • Custom Implementation Approach
          • 1. Register Artifacts on the Dashboard
          • 2. Code Changes
            • Using SDK
            • Using API
        • Smart Contract Wallet Approach
          • Gnosis
        • Network Agnostic Transactions
          • EIP-2771 Approach
          • Custom Approach
      • Conditional Whitelisting
      • Gasless SDK (EOA) 3
      • Networks Supported
    • ↔️Hyphen - Instant Cross-Chain Transfers
      • SDK
        • DepositManager
        • TransferManager
        • TokenManager
      • APIs
      • Helper Methods
      • Migrating from Hyphen V1
      • Contract Addresses
      • Hyphen Widget
  • Guides
    • 💻Dashboard
      • DApp Statistics
    • ⛽Gas Tank Deposits
      • Via Dashboard
      • Via Smart Contract
  • api
    • 🔧Native Meta Transaction
      • Get Retried Hashes
    • 🌎Dashboard APIs
    • ⚪Whitelist API
      • Whitelist Destination Address
      • Whitelist Proxy Contracts
    • 〰️ Check Limits
    • 💿Biconomy Data API
      • 👨‍🚀Unique User Data
      • 🧑‍🔧Per User Limits Data
      • ⛽Gas Tank Balance Data
  • SDK
    • 📙Gasless SDK (EOA)
      • Configuration
  • Tutorials
    • 🔰Native Meta Transactions
      • How To Build Your First DApp
        • Write Your First Smart Contract
        • Initialize Web3 on Client Side
        • Executing First Blockchain Transaction
      • Enable Native Meta Transactions
        • Smart Contract
          • Describe Your Structs
          • Declare Your Variables
          • Modify Respective Function
        • Client Side
          • Design Your JSON structure
          • Design Your Domain Separator
          • Design Data Types
          • Define Data To Sign
          • Generate Signatures
      • Integrate Biconomy
        • Register On Dashboard
        • Integrate Gasless SDK (EOA)
      • Summary
  • BICO Staking
    • 🪁Safety Module
  • Get in touch
    • 👥Contact Us
  • Misc
    • 🧩Projects on Biconomy
    • 🌐Supported Networks
    • 📫Contract Addresses
    • ✔︎ Smart Contracts Audit
    • ❓FAQs
Powered by GitBook
On this page
  • <existing web3 provider>
  • options
  • Example Code
  • PermitClient
  • options for daiPermit and eip2612Permit
  • 1. daiPermit
  • 2. eip2612Permit

Was this helpful?

  1. SDK
  2. Gasless SDK (EOA)

Configuration

Configure Gasless SDK (EOA) as per your requirement with multiple options

Biconomy constructor takes 2 parameters

const biconomy = new Biconomy(<existing web3 provider>, options);

<existing web3 provider>

object required

Any web3 provider that supports personal_sign, eth_accounts, eth_sendTransaction, eth_call RPC methods.

For example, it can be window.ethereum for Metamask or portis.provider for Portis and so on.

options

object required

A json object having following configuration values for initializing Gasless SDK (EOA) .

apiKey

string required API Key can be found on Gasless SDK (EOA) dashboard.

Unique id assigned to each DApp that used to authenticate requests coming from Gasless SDK (EOA).

strictMode

boolean optional

Default false

If strict mode is on, and method/api called by user is not registered on Gasless SDK (EOA) dashboard then no transaction will be initiated.

If strict mode is off, and method called by user is not registered on Gasless SDK (EOA) dashboard then existing provider will be used to send user transaction but in this case, the user will have to pay the transaction fee.

transferHandlerAddress

string optional

Default ${biconomy.transferHandlerAddress}

Transfer Handler Address is the contract address that's responsible for ERC20 token transfers after getting approval from the user. If transfer handler address is provided by the developer then Gasless SDK (EOA) will initialize helper clients with transfer handler contract using this address.

If address is not provided Gasless SDK (EOA) will initialize it to biconomy's deployed contracts based on provider's network id.

erc20ForwarderAddress

string optional

Default ${biconomy.erc20ForwarderAddress}

ERC20 Forwarder Address is the contract address thats' responsible for calculating the cost of transaction gas in ERC20 tokens, use the fee multiplier provided by fee manager, allow or block any tokens and make the transfer to fee recipient.

Biconomy currently supports universal fee proxy per network deployed by us.

If address is not provided Gasless SDK (EOA) will initialize it to biconomy's deployed contracts based on provider's network id.

debug

boolean optional

Default false

By default there will be no logs printed on console but if you want to run Gasless SDK (EOA) in debug mode, set the debug value as true and all logs will be printed that will help you in debugging the code.

Example Code

For metamask biconomy initialization code would look like:

let options = {
 apiKey: <API KEY>,
 strictMode: true,
 debug: true
};
const biconomy = new Biconomy(window.ethereum, options);

PermitClient

Permit Client constructor takes 2 parameters

const permitClient = new PermitClient(<provider>, erc20ForwarderAddress, daiTokenAddress);

If this client is directly accessed from biconomy object, it would contain erc20ForwarderAddress passed with Biconomy options which is essentially the spender of the tokens.

options for daiPermit and eip2612Permit

1. daiPermit

spender

string optional

Default ${permitClient.erc20ForwarderAddress}

spender is the ehtereum contract address or EOA thats' allowed to spend tokens on behalf of the user. Gas fees will be charged from user's wallet by making transaction IERC20.transferFrom by this spender.

expiry

Number optional

Default Math.floor(Date.now() / 1000 + 3600)

Time window in unix epoch format until the spender is allowed to make transfer of DAI tokens. If your transaction takes longer than this, please give a larger time frame to avoid giving permit again.

allowed

boolean optional

Default true

Whether the spender is allowed to spend the tokens. Used to revoke the permission before dealine it would make sense to use this with stand alone permit client.

2. eip2612Permit

spender

string optional

Default ${permitClient.erc20ForwarderAddress}

spender is the ethereum contract address or EOA thats' allowed to spend tokens on behalf of the user. Gas fees will be charged from user's wallet by making transaction IERC20.transferFrom by this spender.

deadline

Number optional

Default Math.floor(Date.now() / 1000 + 3600)

Time window in unix epoch format until the spender is allowed to make transfer of tokens. If your transaction takes longer than this, please give a larger time frame to avoid giving permit again.

value

String required

Default true

How many tokens the spender is allowed to spend. This should be in calculated based on token decimals. For example to spend 1 USDC (token decimals 18) this value would be "1000000000000000000" Used to revoke the permission before deadline it would make sense to use this with stand alone permit client.

PreviousGasless SDK (EOA)NextNative Meta Transactions

Last updated 2 years ago

Was this helpful?

Biconomy ships with permit client and can be accessed using biconomy.permitClient. Please check implementation for example. However Permit Client can be imported along with Biconomy from Gasless SDK (EOA) for your custom initialization for independent use.

Permit Client serves two methods daiPermit (for getting approval to spend DAI) and eip2612Permit (for getting approval to spend any token that supports signed approvals e.g USDC)

📙
SDK front end
EIP2612