import { SessionRequestParams } from "near-ca"; import { Address, Hex } from "viem"; import { PaymasterData, MetaTransaction, UserOperation } from "./types"; export declare const PLACEHOLDER_SIG: `0x${string}`; type IntLike = Hex | bigint | string | number; export declare const packGas: (hi: IntLike, lo: IntLike) => string; export declare function packSignature(signature: `0x${string}`, validFrom?: number, validTo?: number): Hex; export declare function packPaymasterData(data: PaymasterData): Hex; export declare function containsValue(transactions: MetaTransaction[]): boolean; export declare function isContract(address: Address, chainId: number): Promise; export declare function metaTransactionsFromRequest(params: SessionRequestParams): MetaTransaction[]; export declare function saltNonceFromMessage(input: string): string; /** * Fetches the signature for a NEAR transaction hash. If an `accountId` is provided, * it fetches the signature from the appropriate network. Otherwise, it races across * both `testnet` and `mainnet`. * * @param {string} txHash - The NEAR transaction hash for which to fetch the signature. * @param {string} [accountId] - (Optional) The account ID associated with the transaction. * Providing this will reduce dangling promises as the network is determined by the account. * * @returns {Promise} A promise that resolves to the hex-encoded signature. * * @throws Will throw an error if no signature is found for the given transaction hash. */ export declare function signatureFromTxHash(txHash: string, accountId?: string): Promise; /** * Races an array of promises and resolves with the first promise that fulfills. * If all promises reject, the function will reject with an error. * * @template T * @param {Promise[]} promises - An array of promises to race. Each promise should resolve to type `T`. * * @returns {Promise} A promise that resolves to the value of the first successfully resolved promise. * * @throws Will throw an error if all promises reject with the message "All promises rejected". */ export declare function raceToFirstResolve(promises: Promise[]): Promise; export declare function assertUnique(iterable: Iterable, errorMessage?: string): void; export declare function userOpTransactionCost(userOp: UserOperation): bigint; export {};