UNPKG

@lifi/sdk

Version:

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

34 lines 1.2 kB
import { ChainType } from '@lifi/types'; import { getSolanaBalance } from './getSolanaBalance.js'; import { isSVMAddress } from './isSVMAddress.js'; import { resolveSolanaAddress } from './resolveSolanaAddress.js'; import { SolanaStepExecutor } from './SolanaStepExecutor.js'; export function Solana(options) { const _options = options ?? {}; return { get type() { return ChainType.SVM; }, isAddress: isSVMAddress, resolveAddress: resolveSolanaAddress, getBalance: getSolanaBalance, async getStepExecutor(options) { if (!_options.getWalletAdapter) { throw new Error('getWalletAdapter is not provided.'); } const walletAdapter = await _options.getWalletAdapter(); const executor = new SolanaStepExecutor({ walletAdapter, routeId: options.routeId, executionOptions: { ...options.executionOptions, }, }); return executor; }, setOptions(options) { Object.assign(_options, options); }, }; } //# sourceMappingURL=Solana.js.map