Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xchainjs/xchain-bitcoin

Package Overview
Dependencies
Maintainers
10
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xchainjs/xchain-bitcoin - npm Package Compare versions

Comparing version 0.22.3 to 0.22.4

15

lib/index.esm.js

@@ -122,5 +122,7 @@ import { ExplorerProvider, Network, standardFeeRates, FeeOption, calcFees, UTXOClient, checkFeeBounds } from '@xchainjs/xchain-client';

const getFee = (inputs, feeRate, data = null) => {
const inputSizeBasedOnInputs = inputs.length > 0
? inputs.reduce((a, x) => a + inputBytes(x), 0) + inputs.length // +1 byte for each input signature
: (TX_INPUT_BASE + TX_INPUT_PUBKEYHASH) * 2 + 2; // By default 2 UTXOs // Temporal solution until issue addressed https://github.com/xchainjs/xchainjs-lib/issues/850
let sum = TX_EMPTY_SIZE +
inputs.reduce((a, x) => a + inputBytes(x), 0) +
inputs.length + // +1 byte for each input signature
inputSizeBasedOnInputs +
TX_OUTPUT_BASE +

@@ -354,8 +356,3 @@ TX_OUTPUT_PUBKEYHASH +

checkFeeBounds(this.feeBounds, feeRate);
/**
* do not spend pending UTXOs when adding a memo
* https://github.com/xchainjs/xchainjs-lib/issues/330
*/
const spendPendingUTXO = !params.memo;
const { psbt } = yield this.buildTx(Object.assign(Object.assign({}, params), { feeRate, sender: this.getAddress(fromAddressIndex), spendPendingUTXO }));
const { psbt } = yield this.buildTx(Object.assign(Object.assign({}, params), { feeRate, sender: this.getAddress(fromAddressIndex) }));
const btcKeys = this.getBtcKeys(this.phrase, fromAddressIndex);

@@ -376,3 +373,3 @@ psbt.signAllInputs(btcKeys); // Sign all inputs

}
buildTx({ amount, recipient, memo, feeRate, sender, spendPendingUTXO = false, // default: prevent spending uncomfirmed UTXOs
buildTx({ amount, recipient, memo, feeRate, sender, spendPendingUTXO = true, // default: prevent spending uncomfirmed UTXOs
}) {

@@ -379,0 +376,0 @@ return __awaiter(this, void 0, void 0, function* () {

@@ -150,5 +150,7 @@ 'use strict';

const getFee = (inputs, feeRate, data = null) => {
const inputSizeBasedOnInputs = inputs.length > 0
? inputs.reduce((a, x) => a + inputBytes(x), 0) + inputs.length // +1 byte for each input signature
: (TX_INPUT_BASE + TX_INPUT_PUBKEYHASH) * 2 + 2; // By default 2 UTXOs // Temporal solution until issue addressed https://github.com/xchainjs/xchainjs-lib/issues/850
let sum = TX_EMPTY_SIZE +
inputs.reduce((a, x) => a + inputBytes(x), 0) +
inputs.length + // +1 byte for each input signature
inputSizeBasedOnInputs +
TX_OUTPUT_BASE +

@@ -382,8 +384,3 @@ TX_OUTPUT_PUBKEYHASH +

xchainClient.checkFeeBounds(this.feeBounds, feeRate);
/**
* do not spend pending UTXOs when adding a memo
* https://github.com/xchainjs/xchainjs-lib/issues/330
*/
const spendPendingUTXO = !params.memo;
const { psbt } = yield this.buildTx(Object.assign(Object.assign({}, params), { feeRate, sender: this.getAddress(fromAddressIndex), spendPendingUTXO }));
const { psbt } = yield this.buildTx(Object.assign(Object.assign({}, params), { feeRate, sender: this.getAddress(fromAddressIndex) }));
const btcKeys = this.getBtcKeys(this.phrase, fromAddressIndex);

@@ -404,3 +401,3 @@ psbt.signAllInputs(btcKeys); // Sign all inputs

}
buildTx({ amount, recipient, memo, feeRate, sender, spendPendingUTXO = false, // default: prevent spending uncomfirmed UTXOs
buildTx({ amount, recipient, memo, feeRate, sender, spendPendingUTXO = true, // default: prevent spending uncomfirmed UTXOs
}) {

@@ -407,0 +404,0 @@ return __awaiter(this, void 0, void 0, function* () {

6

package.json
{
"name": "@xchainjs/xchain-bitcoin",
"version": "0.22.3",
"version": "0.22.4",
"description": "Custom Bitcoin client and utilities used by XChainJS clients",

@@ -40,3 +40,3 @@ "keywords": [

"@xchainjs/xchain-util": "^0.13.1",
"@xchainjs/xchain-utxo-providers": "^0.2.2",
"@xchainjs/xchain-utxo-providers": "^0.2.4",
"axios": "^1.3.6",

@@ -52,3 +52,3 @@ "axios-mock-adapter": "^1.20.0",

"@xchainjs/xchain-util": "^0.13.1",
"@xchainjs/xchain-utxo-providers": "^0.2.2",
"@xchainjs/xchain-utxo-providers": "^0.2.4",
"axios": "^1.3.6",

@@ -55,0 +55,0 @@ "bitcoinjs-lib": "5.2.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc