call()

call()

Call any smart contract function without FLR gas. Encode the calldata with ethers.js and pass the target address, staking, governance, NFT mints, anything.

Usage

typescript
import { Zedkr } from "zedkr";
const client   = await Zedkr.create({ provider });
const callData = iface.encodeFunctionData("stake", [ethers.parseUnits("100", 18)]);
const result   = await client.call(signer, STAKING_CONTRACT, callData);
console.log(result.txHash);

Example - staking contract

typescript
import { ethers } from "ethers";

const iface    = new ethers.Interface(["function stake(uint256 amount)"]);
const callData = iface.encodeFunctionData("stake", [ethers.parseUnits("100", 18)]);
const result   = await client.call(signer, "0xStakingContract", callData);
Warning
The user must have approved the router for their fee token before calling call().

Parameters

ParamTypeDescription
signerethers.SignerThe user's wallet signer
targetstringContract address to call
callDatastringABI-encoded function + arguments