| 35 | export type MultiSendTransactions = MultiSendTransaction[]; |
| 36 | |
| 37 | export const getMultiSendCallData = (transactions: MultiSendTransactions): `0x${string}` => { |
| 38 | |
| 39 | // Encode the transactions into the format required by MultiSend contract |
| 40 | let packedTransactions = '0x'; // Start with empty hex string |
| 41 | for (const tx of transactions) { |
| 42 | const encodedTx = encodePacked( |
| 43 | ['uint8', 'address', 'uint256', 'uint256', 'bytes'], |
| 44 | [tx.operation, tx.to, tx.value, BigInt(tx.data.length), tx.data] |
| 45 | ); |
| 46 | packedTransactions += encodedTx.slice(2); // Append the packed transaction data |
| 47 | } |
| 48 | return packedTransactions as `0x${string}`; |
| 49 | |
| 50 | } |
| 51 | |
| 52 | |
| 53 | // Function to check if the account is delegated |