diff --git a/src/cjs/index.cjs b/src/cjs/index.cjs index 30033351a..8bd22c864 100644 --- a/src/cjs/index.cjs +++ b/src/cjs/index.cjs @@ -47,6 +47,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); exports.initEccLib = exports.Transaction = exports.opcodes = + exports.toXOnly = exports.Psbt = exports.Block = exports.script = @@ -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', { diff --git a/src/cjs/index.d.ts b/src/cjs/index.d.ts index dc4335db9..f2badff81 100644 --- a/src/cjs/index.d.ts +++ b/src/cjs/index.d.ts @@ -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'; diff --git a/src/cjs/psbt.cjs b/src/cjs/psbt.cjs index b6b28e643..c6ccbf07d 100644 --- a/src/cjs/psbt.cjs +++ b/src/cjs/psbt.cjs @@ -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'); @@ -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')); /** diff --git a/src/cjs/psbt.d.ts b/src/cjs/psbt.d.ts index 4e2da7f66..92d65335d 100644 --- a/src/cjs/psbt.d.ts +++ b/src/cjs/psbt.d.ts @@ -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; @@ -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 {}; diff --git a/src/esm/index.js b/src/esm/index.js index fccfcb1d1..0b87f3023 100644 --- a/src/esm/index.js +++ b/src/esm/index.js @@ -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'; diff --git a/src/esm/psbt.js b/src/esm/psbt.js index 7af7cd79b..5e2e39b93 100644 --- a/src/esm/psbt.js +++ b/src/esm/psbt.js @@ -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. */