UNPKG

near-safe

Version:

An SDK for controlling Ethereum Smart Accounts via ERC4337 from a Near Account.

23 lines (22 loc) 974 B
import { type SafeInfo } from "@safe-global/safe-gateway-typescript-sdk"; import { EIP712TypedData } from "near-ca"; import { Hash } from "viem"; export type DecodedSafeMessage = { decodedMessage: string | EIP712TypedData; safeMessageMessage: string; safeMessageHash: Hash; }; export type MinimalSafeInfo = Pick<SafeInfo, "address" | "version" | "chainId">; /** * Returns the decoded message, the hash of the `message` and the hash of the `safeMessage`. * The `safeMessageMessage` is the value inside the SafeMessage and the `safeMessageHash` gets signed if the connected wallet does not support `eth_signTypedData`. * * @param message message as string, UTF-8 encoded hex string or EIP-712 Typed Data * @param safe SafeInfo of the opened Safe * @returns `{ * decodedMessage, * safeMessageMessage, * safeMessageHash * }` */ export declare function decodeSafeMessage(message: string | EIP712TypedData, safe: MinimalSafeInfo): DecodedSafeMessage;