Skip to main content

Setup Transactions

Reference

Some chains require additional transactions to be submitted besides the usual lock, mint, burn or release transactions. Examples include "approve" transactions for ERC20s on Ethereum, or creating associated token accounts on Solana.

If required, these transactions will be available in gateway.inSetup on gateways and on gatewayTransaction.outSetup for Gateways and GatewayTransactions.

inSetup and outSetup are objects with the field names containing a simple description, and the value being a TxSubmitter or TxWater.

Example of handling setup transactions

inSetup:

inSetup transactions should be submitted before gateway.in:

// Before calling gateway.in.submit()`
for (const setupTx of Object.values(gateway.inSetup)) {
await setupTx.submit?.();
await setupTx.wait();
}

outSetup:

outSetup transactions should be submitted before

// Before calling gatewayTx.out.submit()`
for (const setupTx of Object.values(gatewayTx.outSetup)) {
await setupTx.submit?.();
await setupTx.wait();
}