Files
linea-monorepo/postman/scripts/helpers.ts
kyzooghost 36fc728dd5 [Feat] Postman Sponsorship manual test script (#899)
* postman test script

* logString fixes

* Revert "logString fixes"

This reverts commit 66e15176d553abb741194be8446bf63e4defe114.
2025-04-24 18:01:27 +10:00

19 lines
434 B
TypeScript

import { ethers } from "ethers";
export function encodeSendMessage(
sender: string,
receiver: string,
fee: bigint,
amount: bigint,
messageNonce: bigint,
calldata: string,
) {
const abiCoder = new ethers.AbiCoder();
const data = abiCoder.encode(
["address", "address", "uint256", "uint256", "uint256", "bytes"],
[sender, receiver, fee, amount, messageNonce, calldata],
);
return ethers.keccak256(data);
}