πLocal Accounts - Request an order
How to create orders and send them to the auctioneer.
Requesting an intent
const baseTokenAddress = '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2' // USDT on Base
const arbitrumTokenAddress = '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9' // USDT on Arbitrum
const destinationAddress = '0x2b7Aa410B79aB7D22EEdAEc66deB3416A106F3ae'
const tokenAmount = 8000n // Amount in big int units (e.g., 6 Decimals for USDT)
const deadline = Math.floor(Date.now() / 1000) + 3600 // One hour from now
const response = await baseEvmClient.createAndSendOrder({
deadline,
destinationAddress,
destinationChainId: ChainID.Arbitrum,
destinationTokenAddress: arbitrumTokenAddress,
sourceChainId: ChainID.Base,
sourceTokenAddress: baseTokenAddress,
sourceTokenAmount: tokenAmount,
destinationTokenMinAmount: 1n, // Optional: Minimum tokens to receive
minStablecoinAmount: 1n, // Optional: Minimum stablecoin amount for the swap
})Last updated