This doc covers how to interact with the EvmTx type returned by the Skip Go API
EvmTx
type for the developer to pass to the user for signingEvmTx
to help their users move from/to EVM chains.EvmTx
Data Structureto
: The address of the smart contract or externally owned account (EOA) with which this transaction interacts, as a hex-string prefixed with 0x (e.g. 0xfc05aD74C6FE2e7046E091D6Ad4F660D2A159762)value
: The amount of wei
this transaction sends to the contract its interacting with (1 ETH = 1^18 WEI)data
: The calldata this transaction uses to call the smart contract it interacts with, as a hex string. The data bytes will be interpreted according to the application-binary-interface (ABI) of the contract that’s being interacted with. If this field is empty, it means the transaction is sending funds to an address, rather than calling a contract.required_erc20_approvals
: The permissions that must be granted to a specific smart contract to spend or transfer a certain amount of their ERC-20 tokens on behalf of the end user. This allows smart contracts to execute expressive flows that may involve moving some amount of the user’s ERC-20 tokens
EvmTx
populated by the other fields in the response can be submitted to the network. Otherwise, it will fail to execute with a permission error.ERC20Approval
object has 3 fields that define approval:
_ token_contract
: The address of the ERC-20 token on which the approval is granted
_ spender
: The address of the contract to which the approval will grant spend authority * amount
: The amount of token_contract
tokens the approval will grant the spender
to spendchain_id
: This is the same as in the Cosmos context (simply an identifier for the chain), but it’s an int instead of a stringSkipClient
client with the EVM WalletClient
objectgetEVMSigner
function in the SkipClient
constructor to initialize this signer object for the a given EVM chain.
For example, with Viem, we do the following:
SkipClient
and get required chainSkipClient
SkipClient.executeRoute
to prompt the user to sign the approval(s) and transaction, and submit the transaction on chain.