import { BnsClient, BnsSubmitRawTxResp } from './bns_client'; import { BnsEvmProvider, BnsEvmTxConfig, BnsTxOperation } from './bns_evm_tx'; import { RuntimeType } from './runtime'; import { SnBnsPublishDnsTxtReq, SnBnsPublishDocumentReq, SnBnsProxyResp, SnClient } from './sn_client'; export type BnsTxRoute = 'sn-proxy' | 'wallet' | 'local'; export type BnsLocalPrivateKeyProvider = string | (() => Promise | string | null); export interface BnsWalletUser { sn_username?: unknown; sn_user_name?: unknown; sn_account?: unknown; [key: string]: unknown; } export type BnsTxSnClient = Pick; export type BnsTxRawClient = Pick; export interface BnsTxExecutorOptions { snClient?: BnsTxSnClient | null; bnsClient?: BnsTxRawClient | null; localPrivateKey?: BnsLocalPrivateKeyProvider | null; evmConfig?: BnsEvmTxConfig | null; evmProvider?: BnsEvmProvider | null; getRuntimeType?: () => RuntimeType; getCurrentWalletUser?: () => Promise | unknown; } export interface BnsSnProxyExecutionResult { route: 'sn-proxy'; operation: BnsTxOperation['type']; response: SnBnsProxyResp; } export interface BnsLocalExecutionResult { route: 'local'; operation: BnsTxOperation['type']; response: BnsSubmitRawTxResp; } export type BnsTxExecutionResult = BnsSnProxyExecutionResult | BnsLocalExecutionResult; export type BnsTxExecutorErrorCode = 'SN_CLIENT_UNAVAILABLE' | 'BNS_CLIENT_UNAVAILABLE' | 'LOCAL_SIGNING_UNAVAILABLE' | 'WALLET_EXECUTION_NOT_IMPLEMENTED'; export declare class BnsTxExecutorError extends Error { readonly code: BnsTxExecutorErrorCode; readonly route: BnsTxRoute; constructor(code: BnsTxExecutorErrorCode, route: BnsTxRoute, message: string); } export declare function walletUserHasSnAccount(walletUser: unknown): boolean; export declare class BnsTxExecutor { private readonly options; private readonly evmTxBuilder; private localExecutionTail; constructor(options?: BnsTxExecutorOptions); resolveRoute(): Promise; private resolveRouteFor; execute(operation: BnsTxOperation): Promise; publishDnsTxt(request: SnBnsPublishDnsTxtReq): Promise; publishDocument(request: SnBnsPublishDocumentReq): Promise; private getRuntimeType; private getCurrentWalletUser; private getLocalPrivateKey; private executeWithSn; private executeLocally; private enqueueLocalExecution; } export type { BnsTxOperation } from './bns_evm_tx'; //# sourceMappingURL=bns_tx_executor.d.ts.map