import { Address, Hex } from 'viem'; import { UserOperation } from '@prex0/prex-structs'; import { PublicKeyCredentialCreationOptionsJSON, RegistrationResponseJSON } from '@simplewebauthn/typescript-types'; interface LoginResponse { data: { id: string; eth_address?: Address; sub?: string; public_id: string; }; } interface PrepareResponse { options: PublicKeyCredentialCreationOptionsJSON; } interface RegistrationResponse { eth_address: Address; } interface CreateAccountResponse { eth_address: Address; } interface GetWallet2Response { id: string; public_id: string; eth_address: Address; wallet_nickname: string; sub: string; created_at: string; wallet_passkeys: { id: string; user_handle: string; passkey_name: string; public_key?: Hex; owner_index: number; is_registered: boolean; backup_status: boolean; created_at: string; }[]; wallet_eoas: { id: number; owner_index: number; public_key: Address; is_registered: boolean; created_at: string; }[]; } interface PrexApiServiceOptions { maxRetries: number; } interface RecipientData { recipient: Address; sig: Hex; metadata: Hex; } interface GetHistoryRequest { history_type: 'allTransfers' | 'transfers' | 'onetimeLocks' | 'swap'; variables: { token?: Address; eth_address?: Address; limit: number; offset: number; }; } interface TransferHistoryItemResponse { id: string; movingType: string; token: { id: string; }; sender: { id: string; }; recipient: { id: string; }; amount: string; metadata: any; txHash: string; createdAt: string; } interface OnetimeLockHistoryItemResponse { id: string; token: { id: string; }; sender: { id: string; }; recipient?: { id: string; }; expiry: string; amount: string; metadata: any; txHash: string; createdAt: string; updatedAt: string; status: 'LIVE' | 'COMPLETED' | 'CANCELLED'; } interface SwapHistoryItemResponse { id: string; reactor: string; token: { id: string; }; swapper: { id: string; }; outputs: { id: string; token: { id: string; }; amount: string; recipient: { id: string; }; }[]; createdAt: string; txHash: string; } interface FeeTier { address: Address; feeTiers: { fee: string; minAmount: string; }[]; } export declare class PrexApiService { chainId: number; ruleId: string; endpoint: string; options: PrexApiServiceOptions; apiKey: string | null; ethAddress: Address | null; constructor(chainId: number, ruleId: string, endpoint: string, options?: PrexApiServiceOptions); setApiKey(apiKey: string): void; setEthAddress(ethAddress: Address): void; login(recapture_response?: string): Promise; prepare(wallet_id: string, user_name?: string): Promise; register(wallet_id: string, response: RegistrationResponseJSON, subkey?: string): Promise; createAccount(wallet_id: string): Promise; addKey(eth_address: string, user_handle?: string): Promise; removeKey(eth_address: string, owner_index: number): Promise; signPaymasterAndData(userOperation: UserOperation): Promise<`0x${string}`>; execute(userOperation: UserOperation, signature: Hex): Promise<{ gas_used: number; hash: Hex; }>; mint(token: Address, recipient: Address, amount: bigint): Promise; transfer(encodedRequest: string, sig: string): Promise<{ hash: Hex; }>; submitLinkTransfer(encodedRequest: string, sig: string): Promise<{ hash: Hex; }>; confirmLinkTransfer(id: string, recipientData: RecipientData): Promise<{ hash: Hex; }>; confirmSecretTransfer(request: string, sig: string, recipientData: RecipientData): Promise; permit(permitRequest: { address: Address; owner: Address; spender: Address; value: string; deadline: string; signature: Hex; }): Promise; swap(encoded_order: any, sig: string, swap_route: Hex): Promise<{ hash: Hex; }>; distributeSubmit(encoded_request: string, sig: string): Promise; distributeDeposit(encoded_request: string, sig: string): Promise<{ hash: Hex; }>; distributeWithdraw(request: { requestId: Hex; recipient: Address; nonce: string; deadline: string; sig: Hex; subPublicKey: Hex; subSig: Hex; }): Promise<{ hash: Hex; }>; getConfig(chainId: number): Promise<{ fee: FeeTier[]; max_fee_per_gas: string; max_priority_fee_per_gas: string; }>; getFeeTiers(chainId: number): Promise<{ fee: FeeTier[]; }>; getWallet2(walletId?: string): Promise<{ wallet: GetWallet2Response | null; }>; getWalletByPasskeyID(passkeyId: string): Promise<{ id: string; eth_address: string; owner_index: number; public_id: string; }>; getWalletByEOA(public_key: Address): Promise<{ id: string; eth_address: string; owner_index: number; public_id: string; }>; getAddress(owner: Hex): Promise; getHistory(request: GetHistoryRequest): Promise; postGraph(body: any): Promise; postExecutePumSwap(order: string, sig: string): Promise<{ hash: Hex; }>; postIssuePumToken(order: string, sig: string): Promise<{ result: Address; hash: Hex; }>; postBuyPoint(order: string, sig: string): Promise; getLinkTransferHistory(request: GetHistoryRequest): Promise; getSwapHistory(request: GetHistoryRequest): Promise; uploadAvatar({ file, eth_address, signature, timestamp, }: { file: File; timestamp: number; eth_address: string; signature: Hex; }): Promise<{ path: string; fullPath: string; url: string; }>; uploadAvatarV2({ file, eth_address, }: { file: File; eth_address: string; }): Promise<{ path: string; fullPath: string; url: string; }>; copyAvatarV2({ picture_url, eth_address, }: { picture_url: string; eth_address: string; }): Promise<{ path: string; fullPath: string; url: string; }>; generateAuthOptions({ rp_id, sub }: { rp_id: string; sub: string; }): Promise; _post(path: string, data: any): Promise; _postFormData(path: string, data: FormData): Promise; _postRaw(path: string, data: any, contentType?: string): Promise; _put(path: string, data: any): Promise; _get(url: string): Promise; } export {}; //# sourceMappingURL=api.d.ts.map