Skip to main content

Transactions on Erc20

tip

Transactions are operations that are executed on the blockchain.

Transfer

Transfer parameters

To pass an ERC20 you need to send an object with the necessary arguments.

const payload: TransferErc20Payload = {
asset: Asset,
to: new Owner("0xa73a3b8ACa335855EeaC2f9Fb505BB0360A1B703"),
amount: new Amount("10000"),
};
Native ERC20 Assets

The currencies of each blockchain are considered a native erc20 asset, such as in the ethereum network the native currency is ether or in the polygon network the native currency is matic. Both are considered erc20 assets and the sdk will transfer the assets identifying whether they are native or not depending on the network.

Execute transfer transaction

We use the api for the erc20.

const erc20Api = sdk.transactions.erc20Api;

And we send the data.

const caller = sdk.transactions.callers.getCaller();
const transaction = await erc20Api.transfer(payload, caller);