@btc-vision/bitcoin 6.5.6 → 7.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HOW_TO_WRITE_GOOD_CODE.md +2436 -0
- package/benchmark/psbt-2000-inputs.bench.ts +178 -0
- package/benchmark/signing.bench.ts +147 -0
- package/browser/address.d.ts +57 -10
- package/browser/address.d.ts.map +1 -0
- package/browser/bech32utils.d.ts +9 -1
- package/browser/bech32utils.d.ts.map +1 -0
- package/browser/bip66.d.ts +11 -6
- package/browser/bip66.d.ts.map +1 -0
- package/browser/block.d.ts +117 -11
- package/browser/block.d.ts.map +1 -0
- package/browser/branded.d.ts +20 -0
- package/browser/branded.d.ts.map +1 -0
- package/browser/crypto/crypto.d.ts +1 -0
- package/browser/crypto/crypto.d.ts.map +1 -0
- package/browser/crypto.d.ts +46 -7
- package/browser/crypto.d.ts.map +1 -0
- package/browser/ecc/context.d.ts +129 -0
- package/browser/ecc/context.d.ts.map +1 -0
- package/browser/ecc/index.d.ts +11 -0
- package/browser/ecc/index.d.ts.map +1 -0
- package/browser/ecc/types.d.ts +128 -0
- package/browser/ecc/types.d.ts.map +1 -0
- package/browser/ecpair.d.ts +99 -0
- package/browser/errors.d.ts +124 -0
- package/browser/errors.d.ts.map +1 -0
- package/browser/index.d.ts +32 -5
- package/browser/index.d.ts.map +1 -0
- package/browser/index.js +12477 -101
- package/browser/io/BinaryReader.d.ts +276 -0
- package/browser/io/BinaryReader.d.ts.map +1 -0
- package/browser/io/BinaryWriter.d.ts +391 -0
- package/browser/io/BinaryWriter.d.ts.map +1 -0
- package/browser/io/MemoryPool.d.ts +220 -0
- package/browser/io/MemoryPool.d.ts.map +1 -0
- package/browser/io/base64.d.ts +13 -0
- package/browser/io/base64.d.ts.map +1 -0
- package/browser/io/hex.d.ts +67 -0
- package/browser/io/hex.d.ts.map +1 -0
- package/browser/io/index.d.ts +17 -0
- package/browser/io/index.d.ts.map +1 -0
- package/browser/io/utils.d.ts +199 -0
- package/browser/io/utils.d.ts.map +1 -0
- package/browser/merkle.d.ts +10 -1
- package/browser/merkle.d.ts.map +1 -0
- package/browser/networks.d.ts +70 -9
- package/browser/networks.d.ts.map +1 -0
- package/browser/opcodes.d.ts +1 -0
- package/browser/opcodes.d.ts.map +1 -0
- package/browser/payments/bip341.d.ts +35 -9
- package/browser/payments/bip341.d.ts.map +1 -0
- package/browser/payments/embed.d.ts +112 -1
- package/browser/payments/embed.d.ts.map +1 -0
- package/browser/payments/index.d.ts +17 -10
- package/browser/payments/index.d.ts.map +1 -0
- package/browser/payments/p2ms.d.ts +150 -0
- package/browser/payments/p2ms.d.ts.map +1 -0
- package/browser/payments/p2op.d.ts +150 -24
- package/browser/payments/p2op.d.ts.map +1 -0
- package/browser/payments/p2pk.d.ts +154 -1
- package/browser/payments/p2pk.d.ts.map +1 -0
- package/browser/payments/p2pkh.d.ts +176 -1
- package/browser/payments/p2pkh.d.ts.map +1 -0
- package/browser/payments/p2sh.d.ts +150 -1
- package/browser/payments/p2sh.d.ts.map +1 -0
- package/browser/payments/p2tr.d.ts +185 -1
- package/browser/payments/p2tr.d.ts.map +1 -0
- package/browser/payments/p2wpkh.d.ts +161 -1
- package/browser/payments/p2wpkh.d.ts.map +1 -0
- package/browser/payments/p2wsh.d.ts +146 -1
- package/browser/payments/p2wsh.d.ts.map +1 -0
- package/browser/payments/types.d.ts +94 -64
- package/browser/payments/types.d.ts.map +1 -0
- package/browser/psbt/bip371.d.ts +34 -8
- package/browser/psbt/bip371.d.ts.map +1 -0
- package/browser/psbt/psbtutils.d.ts +56 -16
- package/browser/psbt/psbtutils.d.ts.map +1 -0
- package/browser/psbt/types.d.ts +245 -0
- package/browser/psbt/types.d.ts.map +1 -0
- package/browser/psbt/utils.d.ts +64 -0
- package/browser/psbt/utils.d.ts.map +1 -0
- package/browser/psbt/validation.d.ts +84 -0
- package/browser/psbt/validation.d.ts.map +1 -0
- package/browser/psbt.d.ts +82 -118
- package/browser/psbt.d.ts.map +1 -0
- package/browser/pubkey.d.ts +27 -6
- package/browser/pubkey.d.ts.map +1 -0
- package/browser/push_data.d.ts +24 -2
- package/browser/push_data.d.ts.map +1 -0
- package/browser/script.d.ts +33 -8
- package/browser/script.d.ts.map +1 -0
- package/browser/script_number.d.ts +17 -0
- package/browser/script_number.d.ts.map +1 -0
- package/browser/script_signature.d.ts +23 -5
- package/browser/script_signature.d.ts.map +1 -0
- package/browser/transaction.d.ts +160 -18
- package/browser/transaction.d.ts.map +1 -0
- package/browser/types.d.ts +36 -38
- package/browser/types.d.ts.map +1 -0
- package/browser/workers/WorkerSigningPool.d.ts +143 -0
- package/browser/workers/WorkerSigningPool.d.ts.map +1 -0
- package/browser/workers/WorkerSigningPool.node.d.ts +116 -0
- package/browser/workers/WorkerSigningPool.node.d.ts.map +1 -0
- package/browser/workers/ecc-bundle.d.ts +25 -0
- package/browser/workers/ecc-bundle.d.ts.map +1 -0
- package/browser/workers/index.d.ts +91 -0
- package/browser/workers/index.d.ts.map +1 -0
- package/browser/workers/psbt-parallel.d.ts +88 -0
- package/browser/workers/psbt-parallel.d.ts.map +1 -0
- package/browser/workers/signing-worker.d.ts +37 -0
- package/browser/workers/signing-worker.d.ts.map +1 -0
- package/browser/workers/types.d.ts +365 -0
- package/browser/workers/types.d.ts.map +1 -0
- package/build/address.d.ts +58 -11
- package/build/address.d.ts.map +1 -0
- package/build/address.js +82 -25
- package/build/address.js.map +1 -0
- package/build/bech32utils.d.ts +9 -1
- package/build/bech32utils.d.ts.map +1 -0
- package/build/bech32utils.js +10 -2
- package/build/bech32utils.js.map +1 -0
- package/build/bip66.d.ts +11 -6
- package/build/bip66.d.ts.map +1 -0
- package/build/bip66.js +32 -3
- package/build/bip66.js.map +1 -0
- package/build/block.d.ts +117 -11
- package/build/block.d.ts.map +1 -0
- package/build/block.js +202 -72
- package/build/block.js.map +1 -0
- package/build/branded.d.ts +20 -0
- package/build/branded.d.ts.map +1 -0
- package/build/branded.js +7 -0
- package/build/branded.js.map +1 -0
- package/build/crypto/crypto.d.ts +1 -0
- package/build/crypto/crypto.d.ts.map +1 -0
- package/build/crypto/crypto.js +1 -0
- package/build/crypto/crypto.js.map +1 -0
- package/build/crypto.d.ts +46 -7
- package/build/crypto.d.ts.map +1 -0
- package/build/crypto.js +65 -20
- package/build/crypto.js.map +1 -0
- package/build/ecc/context.d.ts +135 -0
- package/build/ecc/context.d.ts.map +1 -0
- package/build/ecc/context.js +232 -0
- package/build/ecc/context.js.map +1 -0
- package/build/ecc/index.d.ts +11 -0
- package/build/ecc/index.d.ts.map +1 -0
- package/build/ecc/index.js +11 -0
- package/build/ecc/index.js.map +1 -0
- package/build/ecc/types.d.ts +134 -0
- package/build/ecc/types.d.ts.map +1 -0
- package/build/ecc/types.js +8 -0
- package/build/ecc/types.js.map +1 -0
- package/build/errors.d.ts +124 -0
- package/build/errors.d.ts.map +1 -0
- package/build/errors.js +155 -0
- package/build/errors.js.map +1 -0
- package/build/index.d.ts +32 -5
- package/build/index.d.ts.map +1 -0
- package/build/index.js +26 -3
- package/build/index.js.map +1 -0
- package/build/io/BinaryReader.d.ts +276 -0
- package/build/io/BinaryReader.d.ts.map +1 -0
- package/build/io/BinaryReader.js +425 -0
- package/build/io/BinaryReader.js.map +1 -0
- package/build/io/BinaryWriter.d.ts +391 -0
- package/build/io/BinaryWriter.d.ts.map +1 -0
- package/build/io/BinaryWriter.js +611 -0
- package/build/io/BinaryWriter.js.map +1 -0
- package/build/io/MemoryPool.d.ts +220 -0
- package/build/io/MemoryPool.d.ts.map +1 -0
- package/build/io/MemoryPool.js +309 -0
- package/build/io/MemoryPool.js.map +1 -0
- package/build/io/base64.d.ts +13 -0
- package/build/io/base64.d.ts.map +1 -0
- package/build/io/base64.js +20 -0
- package/build/io/base64.js.map +1 -0
- package/build/io/hex.d.ts +67 -0
- package/build/io/hex.d.ts.map +1 -0
- package/build/io/hex.js +138 -0
- package/build/io/hex.js.map +1 -0
- package/build/io/index.d.ts +17 -0
- package/build/io/index.d.ts.map +1 -0
- package/build/io/index.js +23 -0
- package/build/io/index.js.map +1 -0
- package/build/io/utils.d.ts +199 -0
- package/build/io/utils.d.ts.map +1 -0
- package/build/io/utils.js +271 -0
- package/build/io/utils.js.map +1 -0
- package/build/merkle.d.ts +10 -1
- package/build/merkle.d.ts.map +1 -0
- package/build/merkle.js +12 -1
- package/build/merkle.js.map +1 -0
- package/build/networks.d.ts +70 -9
- package/build/networks.d.ts.map +1 -0
- package/build/networks.js +90 -4
- package/build/networks.js.map +1 -0
- package/build/opcodes.d.ts +1 -0
- package/build/opcodes.d.ts.map +1 -0
- package/build/opcodes.js +1 -0
- package/build/opcodes.js.map +1 -0
- package/build/payments/bip341.d.ts +35 -9
- package/build/payments/bip341.d.ts.map +1 -0
- package/build/payments/bip341.js +34 -15
- package/build/payments/bip341.js.map +1 -0
- package/build/payments/embed.d.ts +120 -1
- package/build/payments/embed.d.ts.map +1 -0
- package/build/payments/embed.js +215 -34
- package/build/payments/embed.js.map +1 -0
- package/build/payments/index.d.ts +17 -10
- package/build/payments/index.d.ts.map +1 -0
- package/build/payments/index.js +20 -10
- package/build/payments/index.js.map +1 -0
- package/build/payments/p2ms.d.ts +159 -1
- package/build/payments/p2ms.d.ts.map +1 -0
- package/build/payments/p2ms.js +427 -108
- package/build/payments/p2ms.js.map +1 -0
- package/build/payments/p2op.d.ts +158 -24
- package/build/payments/p2op.d.ts.map +1 -0
- package/build/payments/p2op.js +379 -93
- package/build/payments/p2op.js.map +1 -0
- package/build/payments/p2pk.d.ts +162 -1
- package/build/payments/p2pk.d.ts.map +1 -0
- package/build/payments/p2pk.js +327 -58
- package/build/payments/p2pk.js.map +1 -0
- package/build/payments/p2pkh.d.ts +185 -1
- package/build/payments/p2pkh.d.ts.map +1 -0
- package/build/payments/p2pkh.js +467 -114
- package/build/payments/p2pkh.js.map +1 -0
- package/build/payments/p2sh.d.ts +159 -1
- package/build/payments/p2sh.d.ts.map +1 -0
- package/build/payments/p2sh.js +500 -150
- package/build/payments/p2sh.js.map +1 -0
- package/build/payments/p2tr.d.ts +193 -1
- package/build/payments/p2tr.d.ts.map +1 -0
- package/build/payments/p2tr.js +592 -174
- package/build/payments/p2tr.js.map +1 -0
- package/build/payments/p2wpkh.d.ts +170 -1
- package/build/payments/p2wpkh.d.ts.map +1 -0
- package/build/payments/p2wpkh.js +428 -103
- package/build/payments/p2wpkh.js.map +1 -0
- package/build/payments/p2wsh.d.ts +155 -1
- package/build/payments/p2wsh.d.ts.map +1 -0
- package/build/payments/p2wsh.js +465 -143
- package/build/payments/p2wsh.js.map +1 -0
- package/build/payments/types.d.ts +98 -64
- package/build/payments/types.d.ts.map +1 -0
- package/build/payments/types.js +17 -13
- package/build/payments/types.js.map +1 -0
- package/build/psbt/bip371.d.ts +35 -9
- package/build/psbt/bip371.d.ts.map +1 -0
- package/build/psbt/bip371.js +117 -28
- package/build/psbt/bip371.js.map +1 -0
- package/build/psbt/psbtutils.d.ts +56 -16
- package/build/psbt/psbtutils.d.ts.map +1 -0
- package/build/psbt/psbtutils.js +71 -16
- package/build/psbt/psbtutils.js.map +1 -0
- package/build/psbt/types.d.ts +249 -0
- package/build/psbt/types.d.ts.map +1 -0
- package/build/psbt/types.js +6 -0
- package/build/psbt/types.js.map +1 -0
- package/build/psbt/utils.d.ts +68 -0
- package/build/psbt/utils.d.ts.map +1 -0
- package/build/psbt/utils.js +171 -0
- package/build/psbt/utils.js.map +1 -0
- package/build/psbt/validation.d.ts +88 -0
- package/build/psbt/validation.d.ts.map +1 -0
- package/build/psbt/validation.js +149 -0
- package/build/psbt/validation.js.map +1 -0
- package/build/psbt.d.ts +84 -120
- package/build/psbt.d.ts.map +1 -0
- package/build/psbt.js +406 -413
- package/build/psbt.js.map +1 -0
- package/build/pubkey.d.ts +27 -6
- package/build/pubkey.d.ts.map +1 -0
- package/build/pubkey.js +36 -12
- package/build/pubkey.js.map +1 -0
- package/build/push_data.d.ts +24 -2
- package/build/push_data.d.ts.map +1 -0
- package/build/push_data.js +44 -12
- package/build/push_data.js.map +1 -0
- package/build/script.d.ts +33 -8
- package/build/script.d.ts.map +1 -0
- package/build/script.js +101 -37
- package/build/script.js.map +1 -0
- package/build/script_number.d.ts +17 -0
- package/build/script_number.d.ts.map +1 -0
- package/build/script_number.js +19 -0
- package/build/script_number.js.map +1 -0
- package/build/script_signature.d.ts +23 -5
- package/build/script_signature.d.ts.map +1 -0
- package/build/script_signature.js +48 -15
- package/build/script_signature.js.map +1 -0
- package/build/transaction.d.ts +160 -18
- package/build/transaction.d.ts.map +1 -0
- package/build/transaction.js +443 -176
- package/build/transaction.js.map +1 -0
- package/build/tsconfig.build.tsbuildinfo +1 -0
- package/build/types.d.ts +36 -38
- package/build/types.d.ts.map +1 -0
- package/build/types.js +169 -57
- package/build/types.js.map +1 -0
- package/build/workers/WorkerSigningPool.d.ts +174 -0
- package/build/workers/WorkerSigningPool.d.ts.map +1 -0
- package/build/workers/WorkerSigningPool.js +553 -0
- package/build/workers/WorkerSigningPool.js.map +1 -0
- package/build/workers/WorkerSigningPool.node.d.ts +124 -0
- package/build/workers/WorkerSigningPool.node.d.ts.map +1 -0
- package/build/workers/WorkerSigningPool.node.js +753 -0
- package/build/workers/WorkerSigningPool.node.js.map +1 -0
- package/build/workers/ecc-bundle.d.ts +25 -0
- package/build/workers/ecc-bundle.d.ts.map +1 -0
- package/build/workers/ecc-bundle.js +25 -0
- package/build/workers/ecc-bundle.js.map +1 -0
- package/build/workers/index.d.ts +91 -0
- package/build/workers/index.d.ts.map +1 -0
- package/build/workers/index.js +114 -0
- package/build/workers/index.js.map +1 -0
- package/build/workers/psbt-parallel.d.ts +117 -0
- package/build/workers/psbt-parallel.d.ts.map +1 -0
- package/build/workers/psbt-parallel.js +233 -0
- package/build/workers/psbt-parallel.js.map +1 -0
- package/build/workers/signing-worker.d.ts +37 -0
- package/build/workers/signing-worker.d.ts.map +1 -0
- package/build/workers/signing-worker.js +350 -0
- package/build/workers/signing-worker.js.map +1 -0
- package/build/workers/types.d.ts +365 -0
- package/build/workers/types.d.ts.map +1 -0
- package/build/workers/types.js +60 -0
- package/build/workers/types.js.map +1 -0
- package/package.json +68 -9
- package/scripts/bundle-ecc.ts +111 -0
- package/src/address.ts +91 -45
- package/src/bech32utils.ts +3 -3
- package/src/bip66.ts +34 -24
- package/src/block.ts +205 -86
- package/src/branded.ts +18 -0
- package/src/crypto.ts +64 -26
- package/src/ecc/context.ts +280 -0
- package/src/ecc/index.ts +14 -0
- package/src/ecc/types.ts +147 -0
- package/src/ecpair.d.ts +99 -0
- package/src/errors.ts +163 -0
- package/src/index.ts +112 -9
- package/src/io/BinaryReader.ts +461 -0
- package/src/io/BinaryWriter.ts +696 -0
- package/src/io/MemoryPool.ts +343 -0
- package/src/io/base64.ts +20 -0
- package/src/io/hex.ts +155 -0
- package/src/io/index.ts +41 -0
- package/src/io/utils.ts +283 -0
- package/src/merkle.ts +14 -9
- package/src/networks.ts +9 -9
- package/src/payments/bip341.ts +32 -33
- package/src/payments/embed.ts +244 -41
- package/src/payments/index.ts +12 -10
- package/src/payments/p2ms.ts +497 -118
- package/src/payments/p2op.ts +432 -134
- package/src/payments/p2pk.ts +370 -72
- package/src/payments/p2pkh.ts +524 -130
- package/src/payments/p2sh.ts +572 -169
- package/src/payments/p2tr.ts +686 -194
- package/src/payments/p2wpkh.ts +482 -105
- package/src/payments/p2wsh.ts +524 -162
- package/src/payments/types.ts +80 -66
- package/src/psbt/bip371.ts +72 -51
- package/src/psbt/psbtutils.ts +39 -40
- package/src/psbt/types.ts +324 -0
- package/src/psbt/utils.ts +188 -0
- package/src/psbt/validation.ts +185 -0
- package/src/psbt.ts +608 -827
- package/src/pubkey.ts +22 -23
- package/src/push_data.ts +18 -16
- package/src/script.ts +81 -66
- package/src/script_number.ts +6 -6
- package/src/script_signature.ts +33 -36
- package/src/transaction.ts +462 -239
- package/src/types.ts +229 -100
- package/src/workers/WorkerSigningPool.node.ts +887 -0
- package/src/workers/WorkerSigningPool.ts +666 -0
- package/src/workers/ecc-bundle.ts +26 -0
- package/src/workers/index.ts +165 -0
- package/src/workers/psbt-parallel.ts +327 -0
- package/src/workers/signing-worker.ts +353 -0
- package/src/workers/types.ts +417 -0
- package/test/address.spec.ts +9 -6
- package/test/bitcoin.core.spec.ts +16 -17
- package/test/block.spec.ts +8 -7
- package/test/bufferutils.spec.ts +228 -214
- package/test/crypto.spec.ts +19 -11
- package/test/fixtures/p2pk.json +0 -8
- package/test/fixtures/p2pkh.json +1 -1
- package/test/fixtures/p2sh.json +1 -1
- package/test/fixtures/script.json +1 -1
- package/test/fixtures/transaction.json +2 -2
- package/test/integration/_regtest.ts +25 -0
- package/test/integration/addresses.spec.ts +4 -3
- package/test/integration/bip32.spec.ts +2 -1
- package/test/integration/blocks.spec.ts +1 -1
- package/test/integration/cltv.spec.ts +18 -16
- package/test/integration/csv.spec.ts +37 -64
- package/test/integration/payments.spec.ts +5 -3
- package/test/integration/taproot.spec.ts +76 -83
- package/test/integration/transactions.spec.ts +38 -35
- package/test/payments.spec.ts +35 -13
- package/test/payments.utils.ts +17 -16
- package/test/psbt.spec.ts +111 -100
- package/test/script.spec.ts +11 -10
- package/test/script_signature.spec.ts +9 -11
- package/test/taproot-cache.spec.ts +694 -0
- package/test/transaction.spec.ts +32 -40
- package/test/types.spec.ts +74 -29
- package/test/workers-pool.spec.ts +963 -0
- package/test/workers-signing.spec.ts +635 -0
- package/test/workers.spec.ts +1390 -0
- package/tsconfig.base.json +34 -18
- package/tsconfig.browser.json +15 -0
- package/tsconfig.build.json +5 -0
- package/tsconfig.json +5 -14
- package/typedoc.json +29 -0
- package/vite.config.browser.ts +3 -42
- package/vitest.config.integration.ts +2 -0
- package/browser/bufferutils.d.ts +0 -34
- package/browser/chunks/crypto-BhCpKpek.js +0 -2033
- package/browser/chunks/payments-B1wlSccx.js +0 -1089
- package/browser/chunks/psbt-BCNk7JUx.js +0 -4055
- package/browser/chunks/script-DyPItFEl.js +0 -318
- package/browser/chunks/transaction-C_UbhMGn.js +0 -432
- package/browser/chunks/utils-DNZi-T5W.js +0 -761
- package/browser/ecc_lib.d.ts +0 -3
- package/browser/hooks/AdvancedSignatureManager.d.ts +0 -16
- package/browser/hooks/HookedSigner.d.ts +0 -4
- package/browser/hooks/SignatureManager.d.ts +0 -13
- package/browser/payments/lazy.d.ts +0 -2
- package/browser/typeforce.d.ts +0 -38
- package/build/bufferutils.d.ts +0 -34
- package/build/bufferutils.js +0 -141
- package/build/ecc_lib.d.ts +0 -3
- package/build/ecc_lib.js +0 -61
- package/build/hooks/AdvancedSignatureManager.d.ts +0 -16
- package/build/hooks/AdvancedSignatureManager.js +0 -52
- package/build/hooks/HookedSigner.d.ts +0 -4
- package/build/hooks/HookedSigner.js +0 -64
- package/build/hooks/SignatureManager.d.ts +0 -13
- package/build/hooks/SignatureManager.js +0 -45
- package/build/payments/lazy.d.ts +0 -2
- package/build/payments/lazy.js +0 -28
- package/build/tsconfig.tsbuildinfo +0 -1
- package/src/bufferutils.ts +0 -188
- package/src/ecc_lib.ts +0 -94
- package/src/hooks/AdvancedSignatureManager.ts +0 -104
- package/src/hooks/HookedSigner.ts +0 -108
- package/src/hooks/SignatureManager.ts +0 -84
- package/src/payments/lazy.ts +0 -28
- package/src/typeforce.d.ts +0 -38
- package/tsconfig.webpack.json +0 -18
package/build/payments/p2ms.js
CHANGED
|
@@ -1,135 +1,454 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pay-to-Multisig (P2MS) payment class.
|
|
3
|
+
*
|
|
4
|
+
* P2MS is a bare multisig script where M-of-N signatures are required
|
|
5
|
+
* to spend the output. The public keys are embedded directly in the script.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
1
9
|
import { bitcoin as BITCOIN_NETWORK } from '../networks.js';
|
|
2
10
|
import * as bscript from '../script.js';
|
|
3
|
-
import { isPoint, stacksEqual,
|
|
11
|
+
import { isPoint, stacksEqual, } from '../types.js';
|
|
4
12
|
import { PaymentType } from './types.js';
|
|
5
|
-
import * as lazy from './lazy.js';
|
|
6
13
|
const OPS = bscript.opcodes;
|
|
7
|
-
const OP_INT_BASE = OPS.OP_RESERVED;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
14
|
+
const OP_INT_BASE = OPS.OP_RESERVED; // OP_1 - 1
|
|
15
|
+
/**
|
|
16
|
+
* Pay-to-Multisig (P2MS) payment class.
|
|
17
|
+
*
|
|
18
|
+
* Creates locking scripts of the form:
|
|
19
|
+
* `m {pubKey1} {pubKey2} ... {pubKeyN} n OP_CHECKMULTISIG`
|
|
20
|
+
*
|
|
21
|
+
* Spending requires: `OP_0 {sig1} {sig2} ... {sigM}`
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import { P2MS } from '@btc-vision/bitcoin';
|
|
26
|
+
*
|
|
27
|
+
* // Create a 2-of-3 multisig
|
|
28
|
+
* const payment = P2MS.fromPubkeys(2, [pubkey1, pubkey2, pubkey3]);
|
|
29
|
+
* console.log(payment.output); // scriptPubKey
|
|
30
|
+
* console.log(payment.m); // 2
|
|
31
|
+
* console.log(payment.n); // 3
|
|
32
|
+
*
|
|
33
|
+
* // Decode an existing output
|
|
34
|
+
* const decoded = P2MS.fromOutput(scriptPubKey);
|
|
35
|
+
* console.log(decoded.pubkeys); // array of public keys
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export class P2MS {
|
|
39
|
+
// Static public fields
|
|
40
|
+
static NAME = PaymentType.P2MS;
|
|
41
|
+
// Private instance fields
|
|
42
|
+
#network;
|
|
43
|
+
#opts;
|
|
44
|
+
// Input data (provided by user)
|
|
45
|
+
#inputM;
|
|
46
|
+
#inputN;
|
|
47
|
+
#inputPubkeys;
|
|
48
|
+
#inputSignatures;
|
|
49
|
+
#inputOutput;
|
|
50
|
+
#inputInput;
|
|
51
|
+
// Cached computed values
|
|
52
|
+
#m;
|
|
53
|
+
#n;
|
|
54
|
+
#pubkeys;
|
|
55
|
+
#signatures;
|
|
56
|
+
#output;
|
|
57
|
+
#input;
|
|
58
|
+
#witness;
|
|
59
|
+
// Cache flags
|
|
60
|
+
#mComputed = false;
|
|
61
|
+
#nComputed = false;
|
|
62
|
+
#pubkeysComputed = false;
|
|
63
|
+
#signaturesComputed = false;
|
|
64
|
+
#outputComputed = false;
|
|
65
|
+
#inputComputed = false;
|
|
66
|
+
#witnessComputed = false;
|
|
67
|
+
// Decoded chunks cache
|
|
68
|
+
#decodedChunks;
|
|
69
|
+
#decoded = false;
|
|
70
|
+
/**
|
|
71
|
+
* Creates a new P2MS payment instance.
|
|
72
|
+
*
|
|
73
|
+
* @param params - Payment parameters
|
|
74
|
+
* @param params.m - Required number of signatures
|
|
75
|
+
* @param params.n - Total number of public keys (optional, derived from pubkeys)
|
|
76
|
+
* @param params.pubkeys - Array of public keys
|
|
77
|
+
* @param params.signatures - Array of signatures
|
|
78
|
+
* @param params.output - The scriptPubKey
|
|
79
|
+
* @param params.input - The scriptSig
|
|
80
|
+
* @param params.network - Network parameters (defaults to mainnet)
|
|
81
|
+
* @param opts - Payment options
|
|
82
|
+
* @param opts.validate - Whether to validate inputs (default: true)
|
|
83
|
+
* @param opts.allowIncomplete - Allow incomplete signatures (default: false)
|
|
84
|
+
*
|
|
85
|
+
* @throws {TypeError} If validation is enabled and data is invalid
|
|
86
|
+
*/
|
|
87
|
+
constructor(params, opts) {
|
|
88
|
+
this.#network = params.network ?? BITCOIN_NETWORK;
|
|
89
|
+
this.#opts = {
|
|
90
|
+
validate: opts?.validate ?? true,
|
|
91
|
+
allowIncomplete: opts?.allowIncomplete ?? false,
|
|
92
|
+
};
|
|
93
|
+
// Store input data
|
|
94
|
+
this.#inputM = params.m;
|
|
95
|
+
this.#inputN = params.n;
|
|
96
|
+
this.#inputPubkeys = params.pubkeys;
|
|
97
|
+
this.#inputSignatures = params.signatures;
|
|
98
|
+
this.#inputOutput = params.output;
|
|
99
|
+
this.#inputInput = params.input;
|
|
100
|
+
// Validate if requested
|
|
101
|
+
if (this.#opts.validate) {
|
|
102
|
+
this.#validate();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// Public getters
|
|
106
|
+
/**
|
|
107
|
+
* Payment type discriminant.
|
|
108
|
+
*/
|
|
109
|
+
get name() {
|
|
110
|
+
const m = this.m;
|
|
111
|
+
const n = this.n;
|
|
112
|
+
if (m !== undefined && n !== undefined) {
|
|
113
|
+
return `p2ms(${m} of ${n})`;
|
|
114
|
+
}
|
|
115
|
+
return PaymentType.P2MS;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Network parameters.
|
|
119
|
+
*/
|
|
120
|
+
get network() {
|
|
121
|
+
return this.#network;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Required number of signatures (M in M-of-N).
|
|
125
|
+
*/
|
|
126
|
+
get m() {
|
|
127
|
+
if (!this.#mComputed) {
|
|
128
|
+
this.#m = this.#computeM();
|
|
129
|
+
this.#mComputed = true;
|
|
130
|
+
}
|
|
131
|
+
return this.#m;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Total number of public keys (N in M-of-N).
|
|
135
|
+
*/
|
|
136
|
+
get n() {
|
|
137
|
+
if (!this.#nComputed) {
|
|
138
|
+
this.#n = this.#computeN();
|
|
139
|
+
this.#nComputed = true;
|
|
140
|
+
}
|
|
141
|
+
return this.#n;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Array of public keys.
|
|
145
|
+
*/
|
|
146
|
+
get pubkeys() {
|
|
147
|
+
if (!this.#pubkeysComputed) {
|
|
148
|
+
this.#pubkeys = this.#computePubkeys();
|
|
149
|
+
this.#pubkeysComputed = true;
|
|
150
|
+
}
|
|
151
|
+
return this.#pubkeys;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Array of signatures.
|
|
155
|
+
*/
|
|
156
|
+
get signatures() {
|
|
157
|
+
if (!this.#signaturesComputed) {
|
|
158
|
+
this.#signatures = this.#computeSignatures();
|
|
159
|
+
this.#signaturesComputed = true;
|
|
160
|
+
}
|
|
161
|
+
return this.#signatures;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The scriptPubKey: `m {pubkeys} n OP_CHECKMULTISIG`
|
|
165
|
+
*/
|
|
166
|
+
get output() {
|
|
167
|
+
if (!this.#outputComputed) {
|
|
168
|
+
this.#output = this.#computeOutput();
|
|
169
|
+
this.#outputComputed = true;
|
|
170
|
+
}
|
|
171
|
+
return this.#output;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The scriptSig: `OP_0 {signatures}`
|
|
175
|
+
*/
|
|
176
|
+
get input() {
|
|
177
|
+
if (!this.#inputComputed) {
|
|
178
|
+
this.#input = this.#computeInput();
|
|
179
|
+
this.#inputComputed = true;
|
|
180
|
+
}
|
|
181
|
+
return this.#input;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Witness stack (empty for P2MS as it's not a SegWit type).
|
|
185
|
+
*/
|
|
186
|
+
get witness() {
|
|
187
|
+
if (!this.#witnessComputed) {
|
|
188
|
+
this.#witness = this.#computeWitness();
|
|
189
|
+
this.#witnessComputed = true;
|
|
190
|
+
}
|
|
191
|
+
return this.#witness;
|
|
192
|
+
}
|
|
193
|
+
// Static factory methods
|
|
194
|
+
/**
|
|
195
|
+
* Creates a P2MS payment from public keys.
|
|
196
|
+
*
|
|
197
|
+
* @param m - Required number of signatures
|
|
198
|
+
* @param pubkeys - Array of public keys
|
|
199
|
+
* @param network - Network parameters (defaults to mainnet)
|
|
200
|
+
* @returns A new P2MS payment instance
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```typescript
|
|
204
|
+
* // Create a 2-of-3 multisig
|
|
205
|
+
* const payment = P2MS.fromPubkeys(2, [pubkey1, pubkey2, pubkey3]);
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
static fromPubkeys(m, pubkeys, network) {
|
|
209
|
+
return new P2MS({ m, pubkeys, network });
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Creates a P2MS payment from a scriptPubKey.
|
|
213
|
+
*
|
|
214
|
+
* @param output - The scriptPubKey
|
|
215
|
+
* @param network - Network parameters (defaults to mainnet)
|
|
216
|
+
* @returns A new P2MS payment instance
|
|
217
|
+
*/
|
|
218
|
+
static fromOutput(output, network) {
|
|
219
|
+
return new P2MS({ output, network });
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Creates a P2MS payment from signatures (for spending).
|
|
223
|
+
*
|
|
224
|
+
* @param signatures - Array of signatures
|
|
225
|
+
* @param m - Required number of signatures (optional)
|
|
226
|
+
* @param pubkeys - Array of public keys (optional, for validation)
|
|
227
|
+
* @param network - Network parameters (defaults to mainnet)
|
|
228
|
+
* @returns A new P2MS payment instance
|
|
229
|
+
*/
|
|
230
|
+
static fromSignatures(signatures, m, pubkeys, network) {
|
|
231
|
+
return new P2MS({ signatures, m, pubkeys, network });
|
|
232
|
+
}
|
|
233
|
+
// Private helper methods
|
|
234
|
+
/**
|
|
235
|
+
* Converts to a plain P2MSPayment object for backwards compatibility.
|
|
236
|
+
*
|
|
237
|
+
* @returns A P2MSPayment object
|
|
238
|
+
*/
|
|
239
|
+
toPayment() {
|
|
240
|
+
return {
|
|
241
|
+
name: this.name,
|
|
242
|
+
network: this.network,
|
|
243
|
+
m: this.m,
|
|
244
|
+
n: this.n,
|
|
245
|
+
pubkeys: this.pubkeys,
|
|
246
|
+
signatures: this.signatures,
|
|
247
|
+
output: this.output,
|
|
248
|
+
input: this.input,
|
|
249
|
+
witness: this.witness,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
// Private computation methods
|
|
253
|
+
#decode(output) {
|
|
254
|
+
if (this.#decoded)
|
|
87
255
|
return;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
256
|
+
this.#decoded = true;
|
|
257
|
+
this.#decodedChunks = (bscript.decompile(output) ?? []);
|
|
258
|
+
this.#m = this.#decodedChunks[0] - OP_INT_BASE;
|
|
259
|
+
this.#n = this.#decodedChunks[this.#decodedChunks.length - 2] - OP_INT_BASE;
|
|
260
|
+
this.#pubkeys = this.#decodedChunks.slice(1, -2);
|
|
261
|
+
this.#mComputed = true;
|
|
262
|
+
this.#nComputed = true;
|
|
263
|
+
this.#pubkeysComputed = true;
|
|
264
|
+
}
|
|
265
|
+
#computeM() {
|
|
266
|
+
if (this.#inputM !== undefined) {
|
|
267
|
+
return this.#inputM;
|
|
268
|
+
}
|
|
269
|
+
const output = this.#inputOutput ?? this.output;
|
|
270
|
+
if (output) {
|
|
271
|
+
this.#decode(output);
|
|
272
|
+
return this.#m;
|
|
273
|
+
}
|
|
274
|
+
return undefined;
|
|
275
|
+
}
|
|
276
|
+
#computeN() {
|
|
277
|
+
if (this.#inputN !== undefined) {
|
|
278
|
+
return this.#inputN;
|
|
279
|
+
}
|
|
280
|
+
if (this.#inputPubkeys) {
|
|
281
|
+
return this.#inputPubkeys.length;
|
|
282
|
+
}
|
|
283
|
+
if (this.#inputOutput) {
|
|
284
|
+
this.#decode(this.#inputOutput);
|
|
285
|
+
return this.#n;
|
|
286
|
+
}
|
|
287
|
+
return undefined;
|
|
288
|
+
}
|
|
289
|
+
#computePubkeys() {
|
|
290
|
+
if (this.#inputPubkeys) {
|
|
291
|
+
return this.#inputPubkeys;
|
|
292
|
+
}
|
|
293
|
+
if (this.#inputOutput) {
|
|
294
|
+
this.#decode(this.#inputOutput);
|
|
295
|
+
return this.#pubkeys;
|
|
296
|
+
}
|
|
297
|
+
return undefined;
|
|
298
|
+
}
|
|
299
|
+
#computeSignatures() {
|
|
300
|
+
if (this.#inputSignatures) {
|
|
301
|
+
return this.#inputSignatures;
|
|
302
|
+
}
|
|
303
|
+
if (this.#inputInput) {
|
|
304
|
+
const decompiled = bscript.decompile(this.#inputInput);
|
|
305
|
+
if (decompiled === null || decompiled === undefined) {
|
|
306
|
+
return undefined;
|
|
307
|
+
}
|
|
308
|
+
return decompiled.slice(1);
|
|
309
|
+
}
|
|
310
|
+
return undefined;
|
|
311
|
+
}
|
|
312
|
+
#computeOutput() {
|
|
313
|
+
if (this.#inputOutput) {
|
|
314
|
+
return this.#inputOutput;
|
|
315
|
+
}
|
|
316
|
+
const m = this.#inputM;
|
|
317
|
+
const n = this.n;
|
|
318
|
+
const pubkeys = this.#inputPubkeys;
|
|
319
|
+
if (m === undefined || n === undefined || !pubkeys) {
|
|
320
|
+
return undefined;
|
|
321
|
+
}
|
|
322
|
+
return bscript.compile([].concat(OP_INT_BASE + m, pubkeys, OP_INT_BASE + n, OPS.OP_CHECKMULTISIG));
|
|
323
|
+
}
|
|
324
|
+
#computeInput() {
|
|
325
|
+
if (this.#inputInput) {
|
|
326
|
+
return this.#inputInput;
|
|
327
|
+
}
|
|
328
|
+
if (!this.#inputSignatures) {
|
|
329
|
+
return undefined;
|
|
330
|
+
}
|
|
331
|
+
return bscript.compile([OPS.OP_0].concat(this.#inputSignatures));
|
|
332
|
+
}
|
|
333
|
+
// Validation
|
|
334
|
+
#computeWitness() {
|
|
335
|
+
if (this.input) {
|
|
336
|
+
return [];
|
|
337
|
+
}
|
|
338
|
+
return undefined;
|
|
339
|
+
}
|
|
340
|
+
#isAcceptableSignature(x) {
|
|
341
|
+
return (bscript.isCanonicalScriptSignature(x) ||
|
|
342
|
+
(this.#opts.allowIncomplete && x === OPS.OP_0));
|
|
343
|
+
}
|
|
344
|
+
#validate() {
|
|
345
|
+
if (this.#inputOutput) {
|
|
346
|
+
this.#decode(this.#inputOutput);
|
|
347
|
+
const chunks = this.#decodedChunks;
|
|
348
|
+
if (!chunks) {
|
|
349
|
+
throw new TypeError('Output is invalid');
|
|
350
|
+
}
|
|
351
|
+
if (typeof chunks[0] !== 'number') {
|
|
352
|
+
throw new TypeError('Output is invalid');
|
|
353
|
+
}
|
|
354
|
+
if (typeof chunks[chunks.length - 2] !== 'number') {
|
|
94
355
|
throw new TypeError('Output is invalid');
|
|
95
|
-
|
|
356
|
+
}
|
|
357
|
+
if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG) {
|
|
96
358
|
throw new TypeError('Output is invalid');
|
|
97
|
-
|
|
359
|
+
}
|
|
360
|
+
const m = this.#m;
|
|
361
|
+
const n = this.#n;
|
|
362
|
+
const pubkeys = this.#pubkeys;
|
|
363
|
+
if (m === undefined || n === undefined || !pubkeys) {
|
|
98
364
|
throw new TypeError('Output is invalid');
|
|
99
|
-
|
|
365
|
+
}
|
|
366
|
+
if (m <= 0 || n > 16 || m > n || n !== chunks.length - 3) {
|
|
100
367
|
throw new TypeError('Output is invalid');
|
|
101
|
-
|
|
368
|
+
}
|
|
369
|
+
if (!pubkeys.every((x) => isPoint(x))) {
|
|
102
370
|
throw new TypeError('Output is invalid');
|
|
103
|
-
|
|
371
|
+
}
|
|
372
|
+
if (this.#inputM !== undefined && this.#inputM !== m) {
|
|
104
373
|
throw new TypeError('m mismatch');
|
|
105
|
-
|
|
374
|
+
}
|
|
375
|
+
if (this.#inputN !== undefined && this.#inputN !== n) {
|
|
106
376
|
throw new TypeError('n mismatch');
|
|
107
|
-
|
|
377
|
+
}
|
|
378
|
+
if (this.#inputPubkeys && !stacksEqual(this.#inputPubkeys, pubkeys)) {
|
|
108
379
|
throw new TypeError('Pubkeys mismatch');
|
|
380
|
+
}
|
|
109
381
|
}
|
|
110
|
-
if (
|
|
111
|
-
if (
|
|
382
|
+
if (this.#inputPubkeys) {
|
|
383
|
+
if (this.#inputN !== undefined && this.#inputN !== this.#inputPubkeys.length) {
|
|
112
384
|
throw new TypeError('Pubkey count mismatch');
|
|
113
|
-
|
|
114
|
-
|
|
385
|
+
}
|
|
386
|
+
this.#n = this.#inputPubkeys.length;
|
|
387
|
+
this.#nComputed = true;
|
|
388
|
+
if (this.#m !== undefined && this.#n < this.#m) {
|
|
115
389
|
throw new TypeError('Pubkey count cannot be less than m');
|
|
390
|
+
}
|
|
116
391
|
}
|
|
117
|
-
if (
|
|
118
|
-
if (
|
|
392
|
+
if (this.#inputSignatures) {
|
|
393
|
+
if (this.#m !== undefined && this.#inputSignatures.length < this.#m) {
|
|
119
394
|
throw new TypeError('Not enough signatures provided');
|
|
120
|
-
|
|
395
|
+
}
|
|
396
|
+
if (this.#m !== undefined && this.#inputSignatures.length > this.#m) {
|
|
121
397
|
throw new TypeError('Too many signatures provided');
|
|
398
|
+
}
|
|
122
399
|
}
|
|
123
|
-
if (
|
|
124
|
-
if (
|
|
400
|
+
if (this.#inputInput) {
|
|
401
|
+
if (this.#inputInput[0] !== OPS.OP_0) {
|
|
125
402
|
throw new TypeError('Input is invalid');
|
|
126
|
-
|
|
403
|
+
}
|
|
404
|
+
const sigs = this.signatures;
|
|
405
|
+
if (!sigs || sigs.length === 0 || !sigs.every((s) => this.#isAcceptableSignature(s))) {
|
|
127
406
|
throw new TypeError('Input has invalid signature(s)');
|
|
128
|
-
|
|
407
|
+
}
|
|
408
|
+
if (this.#inputSignatures && !stacksEqual(this.#inputSignatures, sigs)) {
|
|
129
409
|
throw new TypeError('Signature mismatch');
|
|
130
|
-
|
|
410
|
+
}
|
|
411
|
+
if (this.#inputM !== undefined &&
|
|
412
|
+
this.#inputSignatures &&
|
|
413
|
+
this.#inputM !== this.#inputSignatures.length) {
|
|
131
414
|
throw new TypeError('Signature count mismatch');
|
|
415
|
+
}
|
|
132
416
|
}
|
|
133
417
|
}
|
|
134
|
-
return Object.assign(o, a);
|
|
135
418
|
}
|
|
419
|
+
/**
|
|
420
|
+
* Creates a Pay-to-Multisig (P2MS) payment object.
|
|
421
|
+
*
|
|
422
|
+
* This is the legacy factory function for backwards compatibility.
|
|
423
|
+
* For new code, prefer using the P2MS class directly.
|
|
424
|
+
*
|
|
425
|
+
* @param a - The payment object containing the necessary data
|
|
426
|
+
* @param opts - Optional payment options
|
|
427
|
+
* @returns The P2MS payment object
|
|
428
|
+
* @throws {TypeError} If the required data is not provided or if the data is invalid
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* ```typescript
|
|
432
|
+
* import { p2ms } from '@btc-vision/bitcoin';
|
|
433
|
+
*
|
|
434
|
+
* // Create a 2-of-3 multisig
|
|
435
|
+
* const payment = p2ms({ m: 2, pubkeys: [pubkey1, pubkey2, pubkey3] });
|
|
436
|
+
* ```
|
|
437
|
+
*/
|
|
438
|
+
export function p2ms(a, opts) {
|
|
439
|
+
if (!a.input && !a.output && !(a.pubkeys && a.m !== undefined) && !a.signatures) {
|
|
440
|
+
throw new TypeError('Not enough data');
|
|
441
|
+
}
|
|
442
|
+
const instance = new P2MS({
|
|
443
|
+
m: a.m,
|
|
444
|
+
n: a.n,
|
|
445
|
+
pubkeys: a.pubkeys,
|
|
446
|
+
signatures: a.signatures,
|
|
447
|
+
output: a.output,
|
|
448
|
+
input: a.input,
|
|
449
|
+
network: a.network,
|
|
450
|
+
}, opts);
|
|
451
|
+
// Return a merged object for backwards compatibility
|
|
452
|
+
return Object.assign(instance.toPayment(), a);
|
|
453
|
+
}
|
|
454
|
+
//# sourceMappingURL=p2ms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"p2ms.js","sourceRoot":"","sources":["../../src/payments/p2ms.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,IAAI,eAAe,EAAgB,MAAM,gBAAgB,CAAC;AAC1E,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EACH,OAAO,EAKP,WAAW,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAsC,WAAW,EAAE,MAAM,YAAY,CAAC;AAE7E,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;AAC5B,MAAM,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC,WAAW;AAEhD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,IAAI;IACb,uBAAuB;IACvB,MAAM,CAAU,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;IAExC,0BAA0B;IACjB,QAAQ,CAAU;IAClB,KAAK,CAAwB;IAEtC,gCAAgC;IAChC,OAAO,CAAsB;IAC7B,OAAO,CAAsB;IAC7B,aAAa,CAA4B;IACzC,gBAAgB,CAA4B;IAC5C,YAAY,CAA0B;IACtC,WAAW,CAA0B;IAErC,yBAAyB;IACzB,EAAE,CAAsB;IACxB,EAAE,CAAsB;IACxB,QAAQ,CAA4B;IACpC,WAAW,CAA4B;IACvC,OAAO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