near-safe-test
Version:
An SDK for controlling Ethereum Smart Accounts via ERC4337 from a Near Account.
27 lines (26 loc) • 1.1 kB
TypeScript
import { EvmMessage } from "near-ca-test";
import { TransactionSerializable } from "viem";
import { DecodedTxData, SafeEncodedSignRequest, UserOperation } from "../types";
/**
* Decodes transaction data for a given EVM transaction and extracts relevant details.
*
* @param {EvmTransactionData} data - The raw transaction data to be decoded.
* @returns {DecodedTxData} - An object containing the chain ID, estimated cost, and a list of decoded meta-transactions.
*/
export declare function decodeTxData({ evmMessage, chainId, }: Omit<SafeEncodedSignRequest, "hashToSign">): DecodedTxData;
/**
* Represents different types of broadcastable messages
*/
export type BroadcastTarget = {
type: "evm";
transaction: TransactionSerializable;
} | {
type: "bundler";
userOp: UserOperation;
};
/**
* Determines where and how an EVM message should be broadcast
* @param evmMessage - The message to be analyzed
* @returns Information about how to broadcast the message, or null if invalid
*/
export declare function determineBroadcastTarget(evmMessage: EvmMessage): BroadcastTarget | null;