Skip to content

Commit

Permalink
add toXOnly export of cjs & esm
Browse files Browse the repository at this point in the history
  • Loading branch information
Heracles4179 committed Dec 14, 2024
1 parent bf0e806 commit 72ac2f7
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/cjs/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
exports.initEccLib =
exports.Transaction =
exports.opcodes =
exports.toXOnly =
exports.Psbt =
exports.Block =
exports.script =
Expand Down Expand Up @@ -79,6 +80,12 @@ Object.defineProperty(exports, 'Psbt', {
return psbt_js_1.Psbt;
},
});
Object.defineProperty(exports, 'toXOnly', {
enumerable: true,
get: function () {
return psbt_js_1.toXOnly;
},
});
/** @hidden */
var ops_js_1 = require('./ops.cjs');
Object.defineProperty(exports, 'opcodes', {
Expand Down
2 changes: 1 addition & 1 deletion src/cjs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export { address, crypto, networks, payments, script };
export { Block } from './block.js';
/** @hidden */
export { TaggedHashPrefix } from './crypto.js';
export { Psbt, PsbtTxInput, PsbtTxOutput, Signer, SignerAsync, HDSigner, HDSignerAsync, } from './psbt.js';
export { Psbt, PsbtTxInput, PsbtTxOutput, Signer, SignerAsync, HDSigner, HDSignerAsync, toXOnly, } from './psbt.js';
/** @hidden */
export { OPS as opcodes } from './ops.js';
export { Transaction } from './transaction.js';
Expand Down
8 changes: 7 additions & 1 deletion src/cjs/psbt.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var __importStar =
return result;
};
Object.defineProperty(exports, '__esModule', { value: true });
exports.Psbt = void 0;
exports.Psbt = exports.toXOnly = void 0;
const bip174_1 = require('bip174');
const varuint = __importStar(require('varuint-bitcoin'));
const bip174_2 = require('bip174');
Expand All @@ -56,6 +56,12 @@ const bip341_js_1 = require('./payments/bip341.cjs');
const bscript = __importStar(require('./script.cjs'));
const transaction_js_1 = require('./transaction.cjs');
const bip371_js_1 = require('./psbt/bip371.cjs');
Object.defineProperty(exports, 'toXOnly', {
enumerable: true,
get: function () {
return bip371_js_1.toXOnly;
},
});
const psbtutils_js_1 = require('./psbt/psbtutils.cjs');
const tools = __importStar(require('uint8array-tools'));
/**
Expand Down
3 changes: 2 additions & 1 deletion src/cjs/psbt.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Psbt as PsbtBase } from 'bip174';
import { KeyValue, PsbtGlobalUpdate, PsbtInput, PsbtInputUpdate, PsbtOutput, PsbtOutputUpdate } from 'bip174';
import { Network } from './networks.js';
import { Transaction } from './transaction.js';
import { toXOnly } from './psbt/bip371.js';
export { toXOnly };
export interface TransactionInput {
hash: string | Uint8Array;
index: number;
Expand Down Expand Up @@ -202,4 +204,3 @@ tapLeafHashToFinalize?: Uint8Array) => {
finalScriptWitness: Uint8Array | undefined;
};
type AllScriptType = 'witnesspubkeyhash' | 'pubkeyhash' | 'multisig' | 'pubkey' | 'nonstandard' | 'p2sh-witnesspubkeyhash' | 'p2sh-pubkeyhash' | 'p2sh-multisig' | 'p2sh-pubkey' | 'p2sh-nonstandard' | 'p2wsh-pubkeyhash' | 'p2wsh-multisig' | 'p2wsh-pubkey' | 'p2wsh-nonstandard' | 'p2sh-p2wsh-pubkeyhash' | 'p2sh-p2wsh-multisig' | 'p2sh-p2wsh-pubkey' | 'p2sh-p2wsh-nonstandard';
export {};
2 changes: 1 addition & 1 deletion src/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as payments from './payments/index.js';
import * as script from './script.js';
export { address, crypto, networks, payments, script };
export { Block } from './block.js';
export { Psbt } from './psbt.js';
export { Psbt, toXOnly } from './psbt.js';
/** @hidden */
export { OPS as opcodes } from './ops.js';
export { Transaction } from './transaction.js';
Expand Down
1 change: 1 addition & 0 deletions src/esm/psbt.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
isP2TR,
} from './psbt/psbtutils.js';
import * as tools from 'uint8array-tools';
export { toXOnly };
/**
* These are the default arguments for a Psbt instance.
*/
Expand Down

0 comments on commit 72ac2f7

Please sign in to comment.