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
  • Methods
  • preDepositCheck(checkStatusRequest)
  • deposit(request, wallet?)
  • checkDepositStatus(depositRequest)
  • getTransferFee(request)

Was this helpful?

  1. Products
  2. Hyphen - Instant Cross-Chain Transfers
  3. SDK

DepositManager

The DepositManager subclass provides methods for initiating and checking the status of cross-chain transfers through Hyphen.

Usage: hyphen.depositManager

Methods

preDepositCheck(checkStatusRequest)

Performs the required status checks before doing a cross-chain transaction. Recommended to call before performing any cross-chain transaction.

Arguments

checkStatusRequest: {
    tokenAddress: string,
    amount: string,
    fromChainId: number,
    toChainId: number,
    userAddress: string
}

Returns a Promise which resolves to an object with the following keys: 1. code: a number of type hyphen.RESPONSE_CODES, as given below

Code
Status

144

OK

145

ALREADY_EXISTS

146

UNSUPPORTED_TOKEN

148

NO_LIQUIDITY

149

UNSUPPORTED_NETWORK

150

ALLOWANCE_NOT_GIVEN

200

SUCCESS

400

BAD_REQUEST

500

ERROR_RESPONSE

2. message: a string representing the status

deposit(request, wallet?)

Initiates a cross-chain transfer.

Arguments

request: {
    sender: string,
    receiver: string,
    tokenAddress: string,
    depositContractAddress: string,
    amount: string,
    fromChainId: string,
    toChainId: string,
    useBiconomy: boolean,
    dAppName: string
}
wallet?: ethers.Wallet

checkDepositStatus(depositRequest)

Checks and returns the status of a given deposit transaction

Arguments

depositRequest: {
    depositHash: string, // Transaction Hash of deposit transaction
    fromChainId: number, // ChainId of chain on which deposit was done
}

Returns: a Promise resolving to an object with the following parameters:

{  
    amount?: Amount to be transferred
    code: 200 if Executors have started processing the tranasaction, else 404
    depositHash?: string
    exitHash?: string
    fromChainId: number
    message: string
    statusCode?: 1 if processing, 2 if processed and 3 if failed
    toChainId?: number
    tokenAddress?: string
}

getTransferFee(request)

Returns the transfer fee for a given token and amount.

Arguments

Type - GetTransferFeeRequest

{
    fromChainId: number;
    toChainId: number;
    tokenAddress: string;
    amount: BigNumberish;
}

Returns: a Promise resolving to a GetTransferFeeResponse object with the following parameters:

{  
    code: number
    message: string
    responseCode?: number
    gasFee: string, // Gas fee in USDC on destination chain e.g. "0.966"
    transferFee: string, // LP Fee in UDSC on destination chain e.g. "0.10009509"
    transferFeePercentage: string, // Percentage LP fee eg. "0.10009509"
    reward: string, // Reward in USDC if available on source chain e.g. "0"
    netTransferFee: string, // Final Net Transfer Fee (transferFee + gasFee - reward) e.g. "1.06609509"
    amountToGet: string // Approximate amount to get on destination chain (Amount deposited - netTransferFee) e.g. "98.93390491"
}
PreviousSDKNextTransferManager

Last updated 2 years ago

Was this helpful?

Returns Promise<TransactionResponse | undefined>: of the deposit transaction on fromChain.

↔️
TransactionResponse