import { Account } from "near-api-js"; import { Address, Signature } from "viem"; import { FunctionCallTransaction, SignArgs } from "./types"; import { FinalExecutionOutcome } from "near-api-js/lib/providers"; /** * Near Contract Type for change methods. * * @typeParam T - The type of the arguments for the change method */ export interface ChangeMethodArgs { /** Change method function arguments */ args: T; /** Gas limit on transaction execution */ gas: string; /** Account signing the call */ signerAccount: Account; /** Attached deposit (i.e., payable amount) to attach to the transaction */ amount: string; } /** * High-level interface for the Near MPC-Recovery Contract * located in: https://github.com/near/mpc-recovery */ export declare class MpcContract implements IMpcContract { rootPublicKey: string | undefined; contractId: string; connectedAccount: Account; /** * Creates a new MPC Contract instance * * @param account - The NEAR account to use * @param contractId - The contract ID * @param rootPublicKey - Optional root public key */ constructor(account: Account, contractId: string, rootPublicKey?: string); /** * Gets the contract ID * * @returns The contract ID */ accountId(): string; /** * Derives an Ethereum address from a derivation path * * @param derivationPath - The path to derive the address from * @returns The derived Ethereum address */ deriveEthAddress: (derivationPath: string) => Promise
; /** * Requests a signature from the MPC contract * * @param signArgs - The arguments for the signature request * @param gas - Optional gas limit * @returns The signature */ requestSignature: (signArgs: SignArgs, gas?: bigint) => Promise; /** * Encodes a signature request into a transaction * * @param signArgs - The arguments for the signature request * @param gas - Optional gas limit * @returns The encoded transaction */ encodeSignatureRequestTx(signArgs: SignArgs, gas?: bigint): Promise>; /** * Signs and sends a signature request * * @param transaction - The transaction to sign and send * @param blockTimeout - Optional timeout in blocks * @returns The execution outcome */ signAndSendSignRequest(transaction: FunctionCallTransaction<{ request: SignArgs; }>): Promise; } /** Interface for MPC Contract implementation */ export interface IMpcContract { connectedAccount: Account; accountId(): string; deriveEthAddress(derivationPath: string): Promise
; requestSignature(signArgs: SignArgs, gas?: bigint): Promise; encodeSignatureRequestTx(signArgs: SignArgs, gas?: bigint): Promise>; }