UNPKG

@lifi/sdk

Version:

LI.FI Any-to-Any Cross-Chain-Swap SDK

34 lines 1.17 kB
import { isUTXOAddress } from '@bigmi/core'; import { ChainType } from '@lifi/types'; import { getUTXOBalance } from './getUTXOBalance.js'; import { resolveUTXOAddress } from './resolveUTXOAddress.js'; import { UTXOStepExecutor } from './UTXOStepExecutor.js'; export function UTXO(options) { const _options = options ?? {}; return { get type() { return ChainType.UTXO; }, isAddress: isUTXOAddress, resolveAddress: resolveUTXOAddress, getBalance: getUTXOBalance, async getStepExecutor(options) { if (!_options.getWalletClient) { throw new Error('Client is not provided.'); } const walletClient = await _options.getWalletClient(); const executor = new UTXOStepExecutor({ client: walletClient, routeId: options.routeId, executionOptions: { ...options.executionOptions, }, }); return executor; }, setOptions(options) { Object.assign(_options, options); }, }; } //# sourceMappingURL=UTXO.js.map