Skip to main content

Send transactions

📋Prerequisites
💡Note

Games can only use ERC-20 tokens issued by the game itself, meaning currencies like ETH, USDC, IMX, USDT, etc. cannot be used in-game.

  • to: The destination address
  • value: The value to transfer for the transaction in wei
  • data: Byte string containing the associated data of the message

This method does not support the gas, gasPrice, maxPriorityFeePerGas, or maxFeePerGas properties as the relayer abstracts these away from the user. Additionally, the from property is not supported as the user's Passport wallet address is used instead.

Sends a transaction to the network, signs it using the logged-in Passport account, and waits for the transaction to be included in a block.

using Immutable.Passport.Model;

TransactionRequest request = new TransactionRequest()
{
to = address,
value = amount,
data = data
}
TransactionReceiptResponse response = await passport.ZkEvmSendTransactionWithConfirmation(request);

switch (response.status)
{
case "1":
// Successful
break;
case "0":
// Failed
break;
}

See here for more details.