import { createHashportStore } from './helpers/hashportTransactionStore.js'; import { HashportApiClient } from '../../clients/hashportApiClient/index.js'; import { MirrorNodeClient } from '../../clients/mirrorNodeClient/index.js'; import { HashportTransactionData } from '../../types/state'; import { BridgeParams } from '../../types/api/bridge'; import { HashportClientConfig } from '../../types/clients'; import { EvmSigner } from '../../types/signers/evmSigner'; import { HederaSigner } from '../../types/signers/hederaSigner'; import { ValidatorPollResponse } from '../../types/validator'; import { Logger } from '../../utils/logger.js'; /** * Initializes a client for validating and executing bridging operations on hashport. */ export declare class HashportClient { protected logger: Logger; apiClient: HashportApiClient; mirrorNodeClient: MirrorNodeClient; mode: 'mainnet' | 'testnet'; evmSigner: EvmSigner; hederaSigner: HederaSigner; transactionStore: ReturnType['getState']>; subscribe: ReturnType['subscribe']; constructor({ evmSigner, hederaSigner, mode, customMirrorNodeCredentials, customMirrorNodeUrl, debug, persistOptions, }: HashportClientConfig); /** * @private * Checks that the user has sufficient fungible token balance for the transaction. */ private checkFungibleBalances; /** * @private * Checks the ownership of the given NFT serial. */ private checkNftOwnership; /** * @private * Verifies that the user has the proper fungible balance or NFT serial ownership. */ private verifyBalances; /** * Validates and queues a hashport bridging transaction. */ queueTransaction(params: BridgeParams): Promise; /** * Executes all the necessary contract calls for a given hashport transaction. * @param {string} id The internal id of the hashport transaction * @returns {Promise} The final state of the completed transactions. Useful for * building a confirmation receipt. */ execute(id: string): Promise; /** * Executes all the hashport transaction that are in the queue. Returns completed state from * each transaction. */ executeAll(): Promise[]>; /** * @private * Checks token association for a given Hedera token. If the token is not associated, * the token will be associated automatically. Returns null if the token is already associated, * or the transaction id of the successful association transaction. */ private handleTokenAssociation; /** * @private * Executes steps related to the Hedera network: token association and checks, deposit * transactions, NFT approvals, and NFT transfers. */ private handleHederaStep; /** * @private * Executes contract methods on the router contract. */ private handleEvmStep; /** * @private * Queries the validators to either get transaction confirmation or to get the signatures * required to complete a bridging operation. */ private handlePollStep; }