Skip to content

isERC20Deposit

Checks if a request is a ERC-20 deposit coming from the ERC20Portal smart contract.

Usage

import { createApp } from "@deroll/app";
import { isERC20Deposit, parseERC20Deposit } from "@deroll/wallet";
 
// create app
const app = createApp({ url: "http://127.0.0.1:5004" });
 
app.addAdvanceHandler(async (data) => {
    if (isERC20Deposit(data)) { 
        const deposit = parseERC20Deposit(data.payload);
        deposit.
amount
sender
success
token
} return "accept"; });

Returns

Type: boolean

True if request is a ERC-20 deposit from the ERC20Portal smart contract.

Parameters

Type: AdvanceRequestData