near-safe
Version:
An SDK for controlling Ethereum Smart Accounts via ERC4337 from a Near Account.
39 lines (38 loc) • 1.61 kB
TypeScript
import { DecodedTxData, SafeEncodedSignRequest } from "../types";
/**
* Explain a Safe Signature Request.
* @param signRequest - The Safe Signature Request to explain.
* @returns The decoded transaction data as stringified JSON or null if there was an error.
*/
export declare function explainSignRequest(signRequest: SafeEncodedSignRequest): Promise<string>;
/**
* Represents a parameter in a decoded contract call.
*/
interface DecodedParameter {
/** The parameter name from the contract ABI */
name: string;
/** The parameter type (e.g., 'address', 'uint256') */
type: string;
/** The actual value of the parameter */
value: string;
}
/**
* Represents a successful response from the Safe transaction decoder.
*/
interface FunctionSignature {
/** The name of the contract method that was called */
method: string;
/** Array of decoded parameters from the function call */
parameters: DecodedParameter[];
}
/**
* Decode a transaction using the Safe Decoder API. According to this spec:
* https://safe-transaction-sepolia.safe.global/#/data-decoder/data_decoder_create
* @param data - The transaction data to decode.
* @param to - The address of the contract that was called.
* @param chainId - The chain ID of the transaction.
* @returns The decoded transaction data or null if there was an error.
*/
export declare function safeDecodeTx(data: string, to: string, chainId: number): Promise<FunctionSignature | null>;
export declare const formatEvmData: (decodedEvmData: DecodedTxData, functionSignatures?: (FunctionSignature | null)[]) => string;
export {};