import type { Action } from "@near-js/transactions"; import { Logger } from "./utils.js"; import { BridgeOptions, Network, PendingDepositWithIntent, PendingWidthdrawData, WithdrawArgsWithPending } from "./types.js"; import OmniApi from "./api.js"; import { ReviewFee } from "./fee.js"; import type { SolanaOmniService } from "./bridge-solana/index.js"; import type { CosmosService } from "./bridge-cosmos/index.js"; import StellarService from "./bridge-stellar/index.js"; import EvmOmniService from "./bridge-evm/index.js"; import TonOmniService from "./bridge-ton/index.js"; import NearBridge from "./bridge-near/index.js"; declare class HotBridge { readonly options: BridgeOptions; logger?: Logger; executeNearTransaction?: ({ receiverId, actions }: { receiverId: string; actions: Action[]; }) => Promise<{ sender: string; hash: string; }>; publishIntents: (signedDatas: any[], quoteHashes: string[]) => Promise<{ sender: string; hash: string; }>; defaultEvmWithdrawGasLimit: bigint; customEvmWithdrawGasLimit: Record; stellar: StellarService; ton: TonOmniService; evm: EvmOmniService; near: NearBridge; api: OmniApi; constructor(options: BridgeOptions); _solana: SolanaOmniService | null; solana(): Promise; _cosmos: CosmosService | null; cosmos(): Promise; private _cacheCompleted; /** Check pending withdrawal and cache completed withdrawals */ checkPendingWithdrawalWithCache(pending: WithdrawArgsWithPending, data: { completedWithHash?: (pending: WithdrawArgsWithPending) => Promise; completedWithoutHash?: (pending: WithdrawArgsWithPending) => Promise; needToExecute?: (pending: WithdrawArgsWithPending) => Promise; }): Promise; parsePendingWithdrawal(pending: PendingWidthdrawData): WithdrawArgsWithPending; /** Iterates over the withdrawals, in parallel for chains and sequentially and chronologically for each chain */ iterateWithdrawals(args: { logger?: Logger; signal?: AbortSignal; submitHashesPwd?: string; execute: (pending: WithdrawArgsWithPending) => Promise; }): Promise; executeIntents: (signedDatas: any[], quoteHashes: string[]) => Promise<{ sender: string; hash: any; }>; getAllIntentBalances(intentAccount: string, intentsContract?: string): Promise>; getIntentBalances(intents: string[], intentAccount: string, intentsContract?: string): Promise>; getIntentBalance(intentId: string, intentAccount: string, intentsContract?: string): Promise; getPendingWithdrawals(chain: number, receiver: string): Promise; getPendingWithdrawalsWithStatus(chain: number, receiver: string): Promise<(WithdrawArgsWithPending & { completed: boolean; })[]>; clearPendingWithdrawals(withdrawals: WithdrawArgsWithPending[]): Promise<{ sender: string; hash: string; } | null>; isDepositUsed(chain: number, nonce: string): Promise; isWithdrawUsed(chain: number, nonce: string, receiver: string): Promise; getPendingWithdrawal(nonce: string): Promise; waitPendingDeposit(chain: number, hash: string, intentAccount: string, abort?: AbortSignal): Promise; /** Returns { hash } or null if deposit already finished */ finishDeposit(deposit: PendingDepositWithIntent): Promise<{ sender: string; hash: string; } | null>; getGaslessWithdrawFee(options: { chain: number; token: string; receiver: string; }): Promise<{ gasPrice: bigint; blockNumber: bigint; }>; buildWithdrawIntent(args: { chain: Network; token: string; amount: bigint; receiver: string; intentAccount: string; }): Promise<{ intent: string; amounts: string[]; receiver_id: string; token_ids: string[]; token: string; memo: string; amount?: undefined; } | { intent: string; memo: string | undefined; receiver_id: string; token: string | undefined; amount: string; amounts?: undefined; token_ids?: undefined; }>; buildSwapExectInIntent(args: { intentAccount: string; intentFrom: string; intentTo: string; amountIn: bigint; }): Promise<{ amountOut: bigint; signed_fee_quote: { payload: string; public_key: string; signature: string; standard: string; }; quote_hashes: string[]; intent: { diff: { [args.intentFrom]: string; [args.intentTo]: string; }; referral: string; intent: string; }; }>; buildSwapExectOutIntent(args: { intentFrom: string; intentTo: string; amountOut: bigint; }): Promise<{ signed_fee_quote: { payload: string; public_key: string; signature: string; standard: string; }; quote_hashes: string[]; amount_in: bigint; intent: { diff: { [args.intentFrom]: string; [args.intentTo]: string; }; referral: string; intent: string; }; }>; buildGaslessWithdrawIntent(args: { feeToken: string; feeAmount: bigint; blockNumber: bigint; chain: Network; token: string; amount: bigint; receiver: string; }): Promise<{ intent: string; receiver_id: string; amounts: string[]; token_ids: string[]; token: string; msg: string; }>; getGaslessWithdrawStatus(nonce: string): Promise; checkWithdrawNonce(chain: number, receiver: string, nonce: string): Promise; checkLocker(chain: number, address: string, receiver: string): Promise; checkWithdrawLocker(chain: number, address: string, receiver: string): Promise; buildGaslessWithdrawToken(args: { chain: Network; token: string; amount: bigint; receiver: string; gasless?: boolean; }): Promise<{ gasless: boolean; intents: any[]; quoteHashes: string[]; }>; buildWithdrawToken(args: { chain: number; token: string; amount: bigint; receiver: string; intentAccount: string; gasless?: boolean; }): Promise<{ intents: any[]; quoteHashes: string[]; gasless: boolean; }>; waitGaslessWithdraw(nonce: string, chain: number, receiver: string): Promise; gaslessWithdrawToken(args: { chain: Network; token: string; amount: bigint; receiver: string; intentAccount: string; signIntents: (intents: any[]) => Promise; }): Promise; withdrawToken(args: { chain: number; token: string; amount: bigint; receiver: string; intentAccount: string; signIntents: (intents: Record[]) => Promise; adjustMax?: boolean; gasless?: boolean; }): Promise<{ nonce: string; tx: string; sender: string; } | undefined>; waitUntilBalance(intent: string, amount: bigint, intentAccount: string, attempts?: number): Promise; swapTokens(args: { intentFrom: string; intentTo: string; amountIn: bigint; minAmountOut: bigint; intentAccount: string; signIntents: (intents: any[]) => Promise; }): Promise<{ amountOut: bigint; }>; getWithdrawFee(address: string, chain: number, token: string, gasless?: boolean): Promise; getDepositFee(options: { chain: number; token: string; amount: bigint; sender: string; intentAccount: string; }): Promise; } export default HotBridge;