@lifi/sdk
Version:
LI.FI Any-to-Any Cross-Chain-Swap SDK
37 lines • 1.35 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UTXO = UTXO;
const core_1 = require("@bigmi/core");
const types_1 = require("@lifi/types");
const getUTXOBalance_js_1 = require("./getUTXOBalance.js");
const resolveUTXOAddress_js_1 = require("./resolveUTXOAddress.js");
const UTXOStepExecutor_js_1 = require("./UTXOStepExecutor.js");
function UTXO(options) {
const _options = options ?? {};
return {
get type() {
return types_1.ChainType.UTXO;
},
isAddress: core_1.isUTXOAddress,
resolveAddress: resolveUTXOAddress_js_1.resolveUTXOAddress,
getBalance: getUTXOBalance_js_1.getUTXOBalance,
async getStepExecutor(options) {
if (!_options.getWalletClient) {
throw new Error('Client is not provided.');
}
const walletClient = await _options.getWalletClient();
const executor = new UTXOStepExecutor_js_1.UTXOStepExecutor({
client: walletClient,
routeId: options.routeId,
executionOptions: {
...options.executionOptions,
},
});
return executor;
},
setOptions(options) {
Object.assign(_options, options);
},
};
}
//# sourceMappingURL=UTXO.js.map