πŸͺCreate & execute a transaction on the source chain before bridging tokens (pre-hook)

How to add a pre-hook on an EVM chain to a route request towards Moonbeam parachain using Squid SDK

Create a valid pre-Hook object on the source chain

preHook: {
            chainType: "evm",
            calls: [
              {
                chainType: "evm",
                callType: 2,
                target: bSwapAddress,
                value: "0",
                callData: bdEncodedData,
                payload: {
                  tokenAddress: "0xAcc15dC74880C9944775448304B263D191c6077F",
                  inputPos: 0, 
                },
                estimatedGas: "150000",
              },
              {
                chainType: "evm",
                callType: 1,
                target: glmbAddress,
                value: "0", 
                callData: approvalEncodedData,
                payload: {
                  tokenAddress: glmbAddress,
                  inputPos: 1,
                },
                estimatedGas: "150000",
              }
            ]
          }

Last updated