@lifi/sdk
Version:
LI.FI Any-to-Any Cross-Chain-Swap SDK
22 lines • 743 B
JavaScript
import { ChainId as BigmiChainId } from '@bigmi/core';
import { ChainId } from '@lifi/types';
export function isPsbtFinalized(psbt) {
try {
psbt.extractTransaction();
return true;
}
catch (_) {
return false;
}
}
// helper function to convert full public key (33 bytes) to x-only compressed format (32 bytes) required after taproot update
export const toXOnly = (pubKey) => pubKey.length === 32 ? pubKey : pubKey.subarray(1, 33);
export const toBigmiChainId = (chainId) => {
switch (chainId) {
case ChainId.BTC:
return BigmiChainId.BITCOIN_MAINNET;
default:
throw new Error(`Unsupported chainId mapping: ${chainId}`);
}
};
//# sourceMappingURL=utils.js.map