The searcher’s own transaction, which calls the submitFlashBid function on the FastLane Auction Handler contract.
The transactions must be presented in that specific order and there must be exactly two transactions in the bundle. The transactions must be hexadecimal encoded (see Relay JSON-RPC API for more information)
Example:
// Check next doc page of `submitFlashBid` // for ethers implementation insteadconstWeb3=require('web3');var web3 =newWeb3("https://matic-mainnet.infura.io/v3/some_random_hash_provider"); constPRIVATE_KEY="0xsomePrivateKey";constoppTxHash="0xb1fe7a7b31de3d4c703725898fd190672791fb6dd4a48496ac7efa563ef6eec9";constoppTxSigned="0xf82392...29302932"; // Yours to gather from hash.constfunctionCall= {"inputs": [ {"internalType":"uint256","name":"_bidAmount","type":"uint256" }, {"internalType":"bytes32","name":"_oppTxHash","type":"bytes32" }, {"internalType":"address","name":"_searcherToAddress","type":"address" }, {"internalType":"bytes","name":"_searcherCallData","type":"bytes" } ],"name":"submitFlashBid","outputs": [],"stateMutability":"payable","type":"function" };constbidAmount=100000;constsearcherContract="0xeA26974363EC1dBc132C99cF9A29273B17254aE3";// Assuming we intend to use _searcherCallDataBytes// when received on our searcher contract `fastLaneCall(` callback// to then trigger searcherContract.myMethod(uint256,string);// See: Searcher Call Data section of the docs for more informationsconstsearcherCallDataBytes=web3.eth.abi.encodeFunctionCall({ name:'myMethod', type:'function', inputs: [{ type:'uint256', name:'myNumber' },{ type:'string', name:'myString' }]}, ['2345675643','Hello!%']);constdataField=web3.eth.abi.encodeFunctionCall(functionCall, [ bidAmount, oppTxHash, searcherContract, searcherCallDataBytes ])// Gas must matchconsttransaction= {'to':'0xf5df545113dee4df10f8149090aa737ddc05070a',// Auction Handler Beta'value':1000000000000000000,// 1 ETH'gas':1337,// Yours to handle, must match oppTx gas'gasLimit':1337'nonce': 12,'data': dataField };asyncfunctionmain() {constsignedTx=awaitweb3.eth.accounts.signTransaction(transaction,PRIVATE_KEY); console.log(signedTx.rawTransaction); // 0xf901b20c8502e155e78c8275309431b98d14007bdee637298086988a0bbd...1baddd8f2f8f940fc5d387832a1
constbundle= [ oppTxSignedsignedTx.rawTransaction, ]return bundle;}main();