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

@bitgo-beta/utxo-lib

Package Overview
Dependencies
Maintainers
2
Versions
1101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bitgo-beta/utxo-lib - npm Package Compare versions

Comparing version 2.4.2-beta.25 to 2.4.2-beta.26

2

dist/src/bitgo/dash/DashPsbt.d.ts

@@ -8,3 +8,3 @@ /// <reference types="node" />

protected static transactionFromBuffer(buffer: Buffer, network: Network): DashTransaction<bigint>;
static createPsbt(opts: PsbtOpts, data: PsbtBase): DashPsbt;
static createPsbt(opts: PsbtOpts, data?: PsbtBase): DashPsbt;
setType(type: number): DashPsbt;

@@ -11,0 +11,0 @@ setExtraPayload(extraPayload?: Buffer): DashPsbt;

@@ -27,2 +27,2 @@ "use strict";

exports.DashPsbt = DashPsbt;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGFzaFBzYnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYml0Z28vZGFzaC9EYXNoUHNidC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx1REFBb0Q7QUFDcEQsMENBQWlEO0FBRWpELG1DQUEwQztBQUMxQyxpREFBZ0Q7QUFFaEQsTUFBYSxRQUFTLFNBQVEsbUJBQWlDO0lBQ25ELE1BQU0sQ0FBQyxxQkFBcUIsQ0FBQyxNQUFjLEVBQUUsT0FBZ0I7UUFDckUsT0FBTyxpQ0FBZSxDQUFDLFVBQVUsQ0FBUyxNQUFNLEVBQUUsS0FBSyxFQUFFLFFBQVEsRUFBRSxPQUFPLENBQUMsQ0FBQztJQUM5RSxDQUFDO0lBRUQsTUFBTSxDQUFDLFVBQVUsQ0FBQyxJQUFjLEVBQUUsSUFBYztRQUM5QyxPQUFPLElBQUksUUFBUSxDQUNqQixJQUFJLE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U7XG4gICAgcmV0dXJuIHRoaXM7XG4gIH1cblxuICBzZXRFeHRyYVBheWxvYWQoZXh0cmFQYXlsb2FkPzogQnVmZmVyKTogRGFzaFBzYnQge1xuICAgIHRoaXMuY2hlY2tGb3JTaWduYXR1cmVzKCdleHRyYVBheWxvYWQnKTtcbiAgICB0aGlzLnR4LmV4dHJhUGF5bG9hZCA9IGV4dHJhUGF5bG9hZDtcbiAgICByZXR1cm4gdGhpcztcbiAgfVxufVxuIl19

@@ -29,3 +29,3 @@ "use strict";

static fromBuffer(buffer, noStrict, amountType = 'number', network) {
const tx = super.fromBuffer(buffer, true, amountType, network);
const tx = new DashTransaction(network, super.fromBuffer(buffer, true, amountType, network));
tx.type = tx.version >> 16;

@@ -110,2 +110,2 @@ tx.version = tx.version & 0xffff;

DashTransaction.DASH_QUORUM_COMMITMENT = 6;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGFzaFRyYW5zYWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2JpdGdvL2Rhc2gvRGFzaFRyYW5zYWN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLCtEQUEyRTtBQUMzRSxpREFBK0Q7QUFFL0Qsd0RBQW1FO0FBQ25FLDZDQUFpRDtBQUVqRCxNQUFhLGVBQTBELFNBQVEsaUNBQXdCO0lBWXJHLFlBQVksT0FBZ0IsRUFBRSxFQUFpQyxFQUFFLFVBQWdDO1FBQy9GLEtBQUssQ0FBQyxPQUFPLEVBQUUsRUFBRSxFQUFFLFVBQVUsQ0FBQyxDQUFDO1FBSjFCLFNBQUksR0FBRyxDQUFDLENBQUM7UUFNZCxJQUFJLENBQUMsaUJBQU0sQ0FBQyxPQUFPLENBQUMsRUFBRTtZQUNwQixNQUFNLElBQUksS0FBSyxDQUFDLGlCQUFpQixDQUFDLENBQUM7U0FDcEM7UUF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sb2NVbnNhZmUoMzYgKiB0aGlzLmlucy5sZW5ndGgpKTtcblxuICAgICAgdGhpcy5pbnMuZm9yRWFjaChmdW5jdGlvbiAodHhJbikge1xuICAgICAgICBidWZmZXJXcml0ZXIud3JpdGVTbGljZSh0eEluLmhhc2gpO1xuICAgICAgICBidWZmZXJXcml0ZXIud3JpdGVVSW50MzIodHhJbi5pbmRleCk7XG4gICAgICB9KTtcblxuICAgICAgcmV0dXJuIGJjcnlwdG8uaGFzaDI1NihidWZmZXJXcml0ZXIuYnVmZmVyKTtcbiAgICB9XG5cbiAgICByZXR1cm4gQnVmZmVyLmFsbG9jKDMyLCAwKTtcbiAgfVxufVxuIl19
/// <reference types="node" />
import { TxOutput } from 'bitcoinjs-lib';
import { Network } from '../networks';
import { UtxoPsbt } from './UtxoPsbt';
import { UtxoPsbt, PsbtOpts } from './UtxoPsbt';
import { UtxoTransaction } from './UtxoTransaction';

@@ -20,3 +20,3 @@ import { UtxoTransactionBuilder } from './UtxoTransactionBuilder';

}): void;
export declare function createPsbtForNetwork(network: Network, { version }?: {
export declare function createPsbtForNetwork(psbtOpts: PsbtOpts, { version }?: {
version?: number;

@@ -23,0 +23,0 @@ }): UtxoPsbt<UtxoTransaction<bigint>>;

@@ -134,5 +134,5 @@ "use strict";

exports.setPsbtDefaults = setPsbtDefaults;
function createPsbtForNetwork(network, { version } = {}) {
function createPsbtForNetwork(psbtOpts, { version } = {}) {
let psbt;
switch (networks_1.getMainnet(network)) {
switch (networks_1.getMainnet(psbtOpts.network)) {
case networks_1.networks.bitcoin:

@@ -144,11 +144,11 @@ case networks_1.networks.bitcoincash:

case networks_1.networks.litecoin: {
psbt = new UtxoPsbt_1.UtxoPsbt({ network });
psbt = UtxoPsbt_1.UtxoPsbt.createPsbt(psbtOpts);
break;
}
case networks_1.networks.dash: {
psbt = new DashPsbt_1.DashPsbt({ network });
psbt = DashPsbt_1.DashPsbt.createPsbt(psbtOpts);
break;
}
case networks_1.networks.zcash: {
psbt = new ZcashPsbt_1.ZcashPsbt({ network });
psbt = ZcashPsbt_1.ZcashPsbt.createPsbt(psbtOpts);
break;

@@ -159,3 +159,3 @@ }

}
setPsbtDefaults(psbt, network, { version });
setPsbtDefaults(psbt, psbtOpts.network, { version });
return psbt;

@@ -207,2 +207,2 @@ }

exports.createTransactionBuilderFromTransaction = createTransactionBuilderFromTransaction;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNhY3Rpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYml0Z28vdHJhbnNhY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsMENBQTREO0FBRTVELHlDQUFzQztBQUN0Qyx1REFBb0Q7QUFDcEQscUVBQWtFO0FBQ2xFLDhDQUEyQztBQUMzQyw0REFBeUQ7QUFDekQsMEVBQXVFO0FBQ3ZFLGlEQUE4QztBQUM5Qyw2RUFBMEU7QUFDMUUsK0RBQTBFO0FBRTFFLFNBQWdCLDJCQUEyQixDQUN6QyxHQUFXLEVBQ1gsT0FBZ0IsRUFDaEIsRUFBRSxPQUFPLEtBQTJCLEVBQUUsRUFDdEMsYUFBa0MsUUFBUTtJQUUxQyxRQUFRLHFCQUFVLENBQUMsT0FBTyxDQUFDLEVBQUU7UUFDM0IsS0FBSyxtQkFBUSxDQUFDLE9BQU8sQ0FBQztRQUN0QixLQUFLLG1CQUFRLENBQUMsV0FBVyxDQUFDO1FBQzFCLEtBQUssbUJBQVEsQ0FBQyxTQUFTLENBQUM7UUFDeEIsS0FBSyxtQkFBUSxDQUFDLFdBQVcsQ0FBQztRQUMxQixLQUFLLG1CQUFRLENBQUMsUUFBUSxDQUFDO1FBQ3ZCLEtBQUssbUJBQVEsQ0FBQyxRQUFRO1lBQ3BCLE9BQU8saUNBQWUsQ0FBQyxVQUFVLENBQVUsR0FBRyxFQUFFLEtBQUssRUFBRSxVQUFVLE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bjpcbiAgICBjYXNlIG5ldHdvcmtzLmJpdGNvaW5jYXNoOlxuICAgIGNhc2UgbmV0d29ya3MuYml0Y29pbnN2OlxuICAgIGNhc2UgbmV0d29ya3MuYml0Y29pbmdvbGQ6XG4gICAgY2FzZSBuZXR3b3Jrcy5kb2dlY29pbjpcbiAgICBjYXNlIG5ldHdvcmtzLmxpdGVjb2luOlxuICAgICAgcmV0dXJuIFV0eG9UcmFuc2FjdGlvbkJ1aWxkZXIuZnJvbVRyYW5zYWN0aW9uPFROdW1iZXI+KHR4LCB1bmRlZmluZWQsIHByZXZPdXRwdXRzKTtcbiAgICBjYXNlIG5ldHdvcmtzLmRhc2g6XG4gICAgICByZXR1cm4gRGFzaFRyYW5zYWN0aW9uQnVpbGRlci5mcm9tVHJhbnNhY3Rpb248VE51bWJlcj4oXG4gICAgICAgIHR4IGFzIERhc2hUcmFuc2FjdGlvbjxUTnVtYmVyPixcbiAgICAgICAgdW5kZWZpbmVkLFxuICAgICAgICBwcmV2T3V0cHV0cyBhcyBUeE91dHB1dDxUTnVtYmVyPltdXG4gICAgICApO1xuICAgIGNhc2UgbmV0d29ya3MuemNhc2g6XG4gICAgICByZXR1cm4gWmNhc2hUcmFuc2FjdGlvbkJ1aWxkZXIuZnJvbVRyYW5zYWN0aW9uPFROdW1iZXI+KFxuICAgICAgICB0eCBhcyBaY2FzaFRyYW5zYWN0aW9uPFROdW1iZXI+LFxuICAgICAgICB1bmRlZmluZWQsXG4gICAgICAgIHByZXZPdXRwdXRzIGFzIFR4T3V0cHV0PFROdW1iZXI+W11cbiAgICAgICk7XG4gIH1cblxuICB0aHJvdyBuZXcgRXJyb3IoYGludmFsaWQgbmV0d29ya2ApO1xufVxuIl19

@@ -146,13 +146,9 @@ "use strict";

index: vout,
witnessUtxo: {
script,
value,
},
});
const inputIndex = psbt.inputCount - 1;
if (wallet_1.isSegwit(u.chain)) {
psbt.updateInput(inputIndex, {
witnessUtxo: {
script,
value,
},
});
}
else {
if (!wallet_1.isSegwit(u.chain)) {
if (!isNonWitnessUnspent(u)) {

@@ -216,2 +212,2 @@ throw new Error('Error, require previous tx to add to PSBT');

exports.unspentSum = unspentSum;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVW5zcGVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9iaXRnby9VbnNwZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGlEQUFrRDtBQUVsRCx3Q0FBNEM7QUFDNUMsbURBQXFIO0FBSXJILHFDQUF1SDtBQTBCdkgsU0FBZ0IsbUJBQW1CLENBQ2pDLENBQW1CO0lBRW5CLE9BQU8sTUFBTSxDQUFDLFFBQVEsQ0FBRSxDQUFnQyxDQUFDLE1BQU0sQ0FBQyxDQUFDO0FBQ25FLENBQUM7QUFKRCxrREFJQztBQUVEOztHQUVHO0FBQ0gsU0FBZ0IsUUFBUSxDQUFrQyxDQUFtQixFQUFFLE9BQWdCO0lBQzdGLE9BQU87UUFDTCxNQUFNLEVBQUUsd0JBQWMsQ0FBQyxDQUFDLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQztRQUMxQyxLQUFLLEVBQUUsQ0FBQyxDQUFDLEtBQUs7S0FDZixDQUFDO0FBQ0osQ0FBQztBQUxELDRCQUtDO0FBRUQ7OztHQUdHO0FBQ0gsU0FBZ0IsYUFBYSxDQUFDLFFBQWdCO0lBQzVDLE1BQU0sS0FBSyxHQUFHLFFBQVEsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDbEMsSUFBSSxLQUFLLENBQUMsTUFBTSxLQUFLLENBQUMsRUFBRTtRQUN0QixNQUFNLElBQUksS0FBSyxDQUFDLDhDQUE4QyxDQUFDLENBQUM7S0FDakU7SUFDRCxNQUFNLENBQUMsSUFBSSxFQUFFLE9BQU8sQ0FBQyxHQUFHLEtBQUssQ0FBQztJQUM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ldEtleXMucHVibGljS2V5cyk7XG4gICAgY29uc3QgYWxsTGVhZkhhc2hlcyA9IHBheW1lbnQucmVkZWVtcyEubWFwKChyKSA9PiB0YXByb290Lmhhc2hUYXBMZWFmKHIub3V0cHV0ISkpO1xuXG4gICAgcHNidC5hZGRPdXRwdXQoe1xuICAgICAgc2NyaXB0OiBwYXltZW50Lm91dHB1dCEsXG4gICAgICB2YWx1ZSxcbiAgICAgIHRhcFRyZWU6IHBheW1lbnQudGFwVHJlZSxcbiAgICAgIHRhcEludGVybmFsS2V5OiBwYXltZW50LmludGVybmFsUHVia2V5LFxuICAgICAgdGFwQmlwMzJEZXJpdmF0aW9uOiBbMCwgMSwgMl0ubWFwKChpZHgpID0+IHtcbiAgICAgICAgY29uc3QgcHVia2V5ID0gdG9YT25seVB1YmxpY0tleSh3YWxsZXRLZXlzLnRyaXBsZVtpZHhdLnB1YmxpY0tleSk7XG4gICAgICAgIGNvbnN0IGxlYWZIYXNoZXM6IEJ1ZmZlcltdID0gW107XG4gICAgICAgIHBheW1lbnQucmVkZWVtcyEuZm9yRWFjaCgociwgaWR4KSA9PiB7XG4gICAgICAgICAgaWYgKHIucHVia2V5cyEuZmluZCgocGspID0+IHBrLmVxdWFscyhwdWJrZXkpKSkge1xuICAgICAgICAgICAgbGVhZkhhc2hlcy5wdXNoKGFsbExlYWZIYXNoZXNbaWR4XSk7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICBsZWFmSGFzaGVzLFxuICAgICAgICAgIHB1YmtleSxcbiAgICAgICAgICBwYXRoOiB3YWxsZXRLZXlzLnBhdGhzW2lkeF0sXG4gICAgICAgICAgbWFzdGVyRmluZ2VycHJpbnQ6IHJvb3RXYWxsZXRLZXlzLnRyaXBsZVtpZHhdLmZpbmdlcnByaW50LFxuICAgICAgICB9O1xuICAgICAgfSksXG4gICAgfSk7XG4gIH0gZWxzZSB7XG4gICAgY29uc3QgeyBzY3JpcHR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ZSB7XG4gICAgY29uc3Qgc3VtID0gdW5zcGVudHMucmVkdWNlKChzdW0sIHUpID0+IHN1bSArICh1LnZhbHVlIGFzIG51bWJlciksIE51bWJlcigwKSk7XG4gICAgaWYgKCFOdW1iZXIuaXNTYWZlSW50ZWdlcihzdW0pKSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoJ3Vuc3BlbnQgc3VtIGlzIG5vdCBhIHNhZmUgaW50ZWdlciBudW1iZXIsIGNvbnNpZGVyIHVzaW5nIGJpZ2ludCcpO1xuICAgIH1cbiAgICByZXR1cm4gc3VtIGFzIFROdW1iZXI7XG4gIH1cbn1cbiJdfQ==

@@ -32,8 +32,9 @@ /// <reference types="node" />

protected static transactionFromBuffer(buffer: Buffer, network: Network): UtxoTransaction<bigint>;
static createPsbt(opts: PsbtOpts, data: PsbtBase): UtxoPsbt<UtxoTransaction<bigint>>;
static createPsbt(opts: PsbtOpts, data?: PsbtBase): UtxoPsbt<UtxoTransaction<bigint>>;
static fromBuffer(buffer: Buffer, opts: PsbtOpts): UtxoPsbt<UtxoTransaction<bigint>>;
static fromTransactionComplete(transaction: UtxoTransaction<bigint>, prevOutputs: TxOutput<bigint>[], fetchTransactions: (txids: string[]) => Promise<Record<string, Buffer>>): Promise<UtxoPsbt<UtxoTransaction<bigint>>>;
getNonWitnessPreviousTxids(): string[];
addNonWitnessUtxos(txBufs: Record<string, Buffer>): this;
static fromTransaction(transaction: UtxoTransaction<bigint>, prevOutputs: TxOutput<bigint>[]): UtxoPsbt<UtxoTransaction<bigint>>;
protected static newTransaction(network: Network): UtxoTransaction<bigint>;
get tx(): Tx;
protected get tx(): Tx;
protected checkForSignatures(propName?: string): void;

@@ -40,0 +41,0 @@ /**

@@ -9,3 +9,3 @@ /// <reference types="node" />

protected static transactionFromBuffer(buffer: Buffer, network: Network): ZcashTransaction<bigint>;
static createPsbt(opts: PsbtOpts, data: PsbtBase): ZcashPsbt;
static createPsbt(opts: PsbtOpts, data?: PsbtBase): ZcashPsbt;
/**

@@ -12,0 +12,0 @@ * In version < 5 of Zcash transactions, the consensus branch ID is not serialized in the transaction

@@ -129,2 +129,2 @@ "use strict";

exports.ZcashPsbt = ZcashPsbt;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiWmNhc2hQc2J0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2JpdGdvL3pjYXNoL1pjYXNoUHNidC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwwQ0FBaUQ7QUFDakQseURBSTRCO0FBQzVCLDhCQUFrRDtBQUNsRCxtQ0FBMEM7QUFDMUMsaURBQWlEO0FBRWpELE1BQU0sU0FBUyxHQUFHLE9BQU8sQ0FBQyxXQUFXLENBQUMsQ0FBQztBQUV2QyxJQUFLLE9BRUo7QUFGRCxXQUFLLE9BQU87SUFDViwyRUFBOEIsQ0FBQTtBQUNoQyxDQUFDLEVBRkksT0FBTyxLQUFQLE9BQU8sUUFFWDtBQUNELE1BQU0sdUJBQXVCLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQztJQUM1QyxNQUFNLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQztJQUNmLE1BQU0sQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDO0lBQ2YsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLEVBQUUsT0FBTyxDQUFDO0lBQzdCLE1BQU0sQ0FBQyxFQUFFLENBQUMsT0FBTyxDQUFDLHVCQUF1QixDQUFDO0NBQzNDLENBQUMsQ0FBQztBQUVILE1BQWEsU0FBVSxTQUFRLG1CQUFrQztJQUNyRCxNQUFNLENBQUMscUJBQXFCLENBQUMsTUFBYyxFQUFFLE9BQWdCO1FBQ3JFLE9BQU8sbUNBQWdCLENBQUMsVUFBVSxDQUFTLE1BQU0sRUFBRSxLQUFLLEVBQUUsUUFBUSxFQUFFLE9BQU8sQ0FBQ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Q==
{
"name": "@bitgo-beta/utxo-lib",
"version": "2.4.2-beta.25",
"version": "2.4.2-beta.26",
"description": "Client-side Bitcoin JavaScript library",

@@ -49,3 +49,3 @@ "main": "./dist/src/index.js",

"dependencies": {
"@bitgo-beta/blake2b": "3.0.4-beta.25",
"@bitgo-beta/blake2b": "3.0.4-beta.26",
"@noble/secp256k1": "1.6.3",

@@ -85,3 +85,3 @@ "bip174": "npm:@bitgo/bip174@3.0.0",

"license": "MIT",
"gitHead": "e4cf760a36b86b39531ba2f2489b6068401260c6"
"gitHead": "79ef46b8c13033848c6bc4c0710eff66472961a3"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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