@btc-vision/bitcoin 6.5.6 → 7.0.0-alpha.0
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 +56 -9
- 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 +12482 -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 +57 -10
- package/build/address.d.ts.map +1 -0
- package/build/address.js +80 -24
- 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 +204 -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 +36 -9
- package/build/payments/bip341.d.ts.map +1 -0
- package/build/payments/bip341.js +35 -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 -152
- 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 +429 -104
- 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 +466 -144
- 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 +113 -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 +411 -412
- 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 +100 -36
- 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 +175 -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 +66 -8
- package/scripts/bundle-ecc.ts +111 -0
- package/src/address.ts +81 -44
- package/src/bech32utils.ts +3 -3
- package/src/bip66.ts +34 -24
- package/src/block.ts +196 -84
- package/src/branded.ts +18 -0
- package/src/crypto.ts +64 -26
- package/src/ecc/context.ts +277 -0
- package/src/ecc/index.ts +14 -0
- package/src/ecc/types.ts +154 -0
- package/src/ecpair.d.ts +99 -0
- package/src/errors.ts +163 -0
- package/src/index.ts +113 -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 +34 -33
- package/src/payments/embed.ts +244 -41
- package/src/payments/index.ts +12 -10
- package/src/payments/p2ms.ts +490 -118
- package/src/payments/p2op.ts +431 -133
- package/src/payments/p2pk.ts +370 -72
- package/src/payments/p2pkh.ts +524 -130
- package/src/payments/p2sh.ts +572 -172
- package/src/payments/p2tr.ts +686 -194
- package/src/payments/p2wpkh.ts +484 -107
- package/src/payments/p2wsh.ts +526 -164
- package/src/payments/types.ts +80 -66
- package/src/psbt/bip371.ts +68 -51
- package/src/psbt/psbtutils.ts +39 -40
- package/src/psbt/types.ts +331 -0
- package/src/psbt/utils.ts +188 -0
- package/src/psbt/validation.ts +192 -0
- package/src/psbt.ts +566 -809
- package/src/pubkey.ts +22 -23
- package/src/push_data.ts +18 -16
- package/src/script.ts +82 -64
- package/src/script_number.ts +6 -6
- package/src/script_signature.ts +33 -36
- package/src/transaction.ts +458 -238
- package/src/types.ts +231 -100
- package/src/workers/WorkerSigningPool.node.ts +887 -0
- package/src/workers/WorkerSigningPool.ts +670 -0
- package/src/workers/ecc-bundle.ts +26 -0
- package/src/workers/index.ts +165 -0
- package/src/workers/psbt-parallel.ts +332 -0
- package/src/workers/signing-worker.ts +353 -0
- package/src/workers/types.ts +413 -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/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
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import { B as _ } from "./crypto-BhCpKpek.js";
|
|
2
|
-
import { p as D, g as d, U as C, q as H, u as L, A as l, v as h, w as M, k as I, x as w, y as V, z as B, d as F, C as m, l as K } from "./utils-DNZi-T5W.js";
|
|
3
|
-
const o = {
|
|
4
|
-
OP_FALSE: 0,
|
|
5
|
-
OP_0: 0,
|
|
6
|
-
OP_PUSHDATA1: 76,
|
|
7
|
-
OP_PUSHDATA2: 77,
|
|
8
|
-
OP_PUSHDATA4: 78,
|
|
9
|
-
OP_1NEGATE: 79,
|
|
10
|
-
OP_RESERVED: 80,
|
|
11
|
-
OP_TRUE: 81,
|
|
12
|
-
OP_1: 81,
|
|
13
|
-
OP_2: 82,
|
|
14
|
-
OP_3: 83,
|
|
15
|
-
OP_4: 84,
|
|
16
|
-
OP_5: 85,
|
|
17
|
-
OP_6: 86,
|
|
18
|
-
OP_7: 87,
|
|
19
|
-
OP_8: 88,
|
|
20
|
-
OP_9: 89,
|
|
21
|
-
OP_10: 90,
|
|
22
|
-
OP_11: 91,
|
|
23
|
-
OP_12: 92,
|
|
24
|
-
OP_13: 93,
|
|
25
|
-
OP_14: 94,
|
|
26
|
-
OP_15: 95,
|
|
27
|
-
OP_16: 96,
|
|
28
|
-
OP_NOP: 97,
|
|
29
|
-
OP_VER: 98,
|
|
30
|
-
OP_IF: 99,
|
|
31
|
-
OP_NOTIF: 100,
|
|
32
|
-
OP_VERIF: 101,
|
|
33
|
-
OP_VERNOTIF: 102,
|
|
34
|
-
OP_ELSE: 103,
|
|
35
|
-
OP_ENDIF: 104,
|
|
36
|
-
OP_VERIFY: 105,
|
|
37
|
-
OP_RETURN: 106,
|
|
38
|
-
OP_TOALTSTACK: 107,
|
|
39
|
-
OP_FROMALTSTACK: 108,
|
|
40
|
-
OP_2DROP: 109,
|
|
41
|
-
OP_2DUP: 110,
|
|
42
|
-
OP_3DUP: 111,
|
|
43
|
-
OP_2OVER: 112,
|
|
44
|
-
OP_2ROT: 113,
|
|
45
|
-
OP_2SWAP: 114,
|
|
46
|
-
OP_IFDUP: 115,
|
|
47
|
-
OP_DEPTH: 116,
|
|
48
|
-
OP_DROP: 117,
|
|
49
|
-
OP_DUP: 118,
|
|
50
|
-
OP_NIP: 119,
|
|
51
|
-
OP_OVER: 120,
|
|
52
|
-
OP_PICK: 121,
|
|
53
|
-
OP_ROLL: 122,
|
|
54
|
-
OP_ROT: 123,
|
|
55
|
-
OP_SWAP: 124,
|
|
56
|
-
OP_TUCK: 125,
|
|
57
|
-
OP_CAT: 126,
|
|
58
|
-
OP_SUBSTR: 127,
|
|
59
|
-
OP_LEFT: 128,
|
|
60
|
-
OP_RIGHT: 129,
|
|
61
|
-
OP_SIZE: 130,
|
|
62
|
-
OP_INVERT: 131,
|
|
63
|
-
OP_AND: 132,
|
|
64
|
-
OP_OR: 133,
|
|
65
|
-
OP_XOR: 134,
|
|
66
|
-
OP_EQUAL: 135,
|
|
67
|
-
OP_EQUALVERIFY: 136,
|
|
68
|
-
OP_RESERVED1: 137,
|
|
69
|
-
OP_RESERVED2: 138,
|
|
70
|
-
OP_1ADD: 139,
|
|
71
|
-
OP_1SUB: 140,
|
|
72
|
-
OP_2MUL: 141,
|
|
73
|
-
OP_2DIV: 142,
|
|
74
|
-
OP_NEGATE: 143,
|
|
75
|
-
OP_ABS: 144,
|
|
76
|
-
OP_NOT: 145,
|
|
77
|
-
OP_0NOTEQUAL: 146,
|
|
78
|
-
OP_ADD: 147,
|
|
79
|
-
OP_SUB: 148,
|
|
80
|
-
OP_MUL: 149,
|
|
81
|
-
OP_DIV: 150,
|
|
82
|
-
OP_MOD: 151,
|
|
83
|
-
OP_LSHIFT: 152,
|
|
84
|
-
OP_RSHIFT: 153,
|
|
85
|
-
OP_BOOLAND: 154,
|
|
86
|
-
OP_BOOLOR: 155,
|
|
87
|
-
OP_NUMEQUAL: 156,
|
|
88
|
-
OP_NUMEQUALVERIFY: 157,
|
|
89
|
-
OP_NUMNOTEQUAL: 158,
|
|
90
|
-
OP_LESSTHAN: 159,
|
|
91
|
-
OP_GREATERTHAN: 160,
|
|
92
|
-
OP_LESSTHANOREQUAL: 161,
|
|
93
|
-
OP_GREATERTHANOREQUAL: 162,
|
|
94
|
-
OP_MIN: 163,
|
|
95
|
-
OP_MAX: 164,
|
|
96
|
-
OP_WITHIN: 165,
|
|
97
|
-
OP_RIPEMD160: 166,
|
|
98
|
-
OP_SHA1: 167,
|
|
99
|
-
OP_SHA256: 168,
|
|
100
|
-
OP_HASH160: 169,
|
|
101
|
-
OP_HASH256: 170,
|
|
102
|
-
OP_CODESEPARATOR: 171,
|
|
103
|
-
OP_CHECKSIG: 172,
|
|
104
|
-
OP_CHECKSIGVERIFY: 173,
|
|
105
|
-
OP_CHECKMULTISIG: 174,
|
|
106
|
-
OP_CHECKMULTISIGVERIFY: 175,
|
|
107
|
-
OP_NOP1: 176,
|
|
108
|
-
OP_NOP2: 177,
|
|
109
|
-
OP_CHECKLOCKTIMEVERIFY: 177,
|
|
110
|
-
OP_NOP3: 178,
|
|
111
|
-
OP_CHECKSEQUENCEVERIFY: 178,
|
|
112
|
-
OP_NOP4: 179,
|
|
113
|
-
OP_NOP5: 180,
|
|
114
|
-
OP_NOP6: 181,
|
|
115
|
-
OP_NOP7: 182,
|
|
116
|
-
OP_NOP8: 183,
|
|
117
|
-
OP_NOP9: 184,
|
|
118
|
-
OP_NOP10: 185,
|
|
119
|
-
OP_CHECKSIGADD: 186,
|
|
120
|
-
OP_PUBKEYHASH: 253,
|
|
121
|
-
OP_PUBKEY: 254,
|
|
122
|
-
OP_INVALIDOPCODE: 255
|
|
123
|
-
}, T = {};
|
|
124
|
-
for (const t of Object.keys(o)) {
|
|
125
|
-
const n = o[t];
|
|
126
|
-
T[n] = t;
|
|
127
|
-
}
|
|
128
|
-
function G(t, n, e) {
|
|
129
|
-
n = n || 4, e = e === void 0 ? !0 : e;
|
|
130
|
-
const r = t.length;
|
|
131
|
-
if (r === 0) return 0;
|
|
132
|
-
if (r > n) throw new TypeError("Script number overflow");
|
|
133
|
-
if (e && (t[r - 1] & 127) === 0 && (r <= 1 || (t[r - 2] & 128) === 0))
|
|
134
|
-
throw new Error("Non-minimally encoded script number");
|
|
135
|
-
if (r === 5) {
|
|
136
|
-
const P = t.readUInt32LE(0), i = t.readUInt8(4);
|
|
137
|
-
return i & 128 ? -((i & -129) * 4294967296 + P) : i * 4294967296 + P;
|
|
138
|
-
}
|
|
139
|
-
let O = 0;
|
|
140
|
-
for (let P = 0; P < r; ++P)
|
|
141
|
-
O |= t[P] << 8 * P;
|
|
142
|
-
return t[r - 1] & 128 ? -(O & ~(128 << 8 * (r - 1))) : O;
|
|
143
|
-
}
|
|
144
|
-
function v(t) {
|
|
145
|
-
return t > 2147483647 ? 5 : t > 8388607 ? 4 : t > 32767 ? 3 : t > 127 ? 2 : t > 0 ? 1 : 0;
|
|
146
|
-
}
|
|
147
|
-
function R(t) {
|
|
148
|
-
let n = Math.abs(t);
|
|
149
|
-
const e = v(n), r = _.allocUnsafe(e), O = t < 0;
|
|
150
|
-
for (let P = 0; P < e; ++P)
|
|
151
|
-
r.writeUInt8(n & 255, P), n >>= 8;
|
|
152
|
-
return r[e - 1] & 128 ? r.writeUInt8(O ? 128 : 0, e - 1) : O && (r[e - 1] |= 128), r;
|
|
153
|
-
}
|
|
154
|
-
const b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
155
|
-
__proto__: null,
|
|
156
|
-
decode: G,
|
|
157
|
-
encode: R
|
|
158
|
-
}, Symbol.toStringTag, { value: "Module" })), { typeforce: $ } = d, f = _.alloc(1, 0);
|
|
159
|
-
function a(t) {
|
|
160
|
-
const n = t & -129;
|
|
161
|
-
return n > 0 && n < 4;
|
|
162
|
-
}
|
|
163
|
-
function A(t) {
|
|
164
|
-
let n = 0;
|
|
165
|
-
for (; t[n] === 0; ) ++n;
|
|
166
|
-
return n === t.length ? f : (t = t.subarray(n), t[0] & 128 ? _.concat([f, t], 1 + t.length) : t);
|
|
167
|
-
}
|
|
168
|
-
function S(t) {
|
|
169
|
-
t[0] === 0 && (t = t.subarray(1));
|
|
170
|
-
const n = _.alloc(32, 0), e = Math.max(0, 32 - t.length);
|
|
171
|
-
return t.copy(n, e), n;
|
|
172
|
-
}
|
|
173
|
-
function Q(t) {
|
|
174
|
-
const n = t.readUInt8(t.length - 1);
|
|
175
|
-
if (!a(n))
|
|
176
|
-
throw new Error(`Invalid hashType ${n}`);
|
|
177
|
-
const e = D(t.subarray(0, -1)), r = S(e.r), O = S(e.s);
|
|
178
|
-
return { signature: _.concat([r, O], 64), hashType: n };
|
|
179
|
-
}
|
|
180
|
-
function Y(t, n) {
|
|
181
|
-
if ($(
|
|
182
|
-
{
|
|
183
|
-
signature: H(64),
|
|
184
|
-
hashType: C
|
|
185
|
-
},
|
|
186
|
-
{ signature: t, hashType: n }
|
|
187
|
-
), !a(n))
|
|
188
|
-
throw new Error(`Invalid hashType ${n}`);
|
|
189
|
-
const e = _.allocUnsafe(1);
|
|
190
|
-
e.writeUInt8(n, 0);
|
|
191
|
-
const r = A(t.subarray(0, 32)), O = A(t.subarray(32, 64));
|
|
192
|
-
return _.concat([L(r, O), e]);
|
|
193
|
-
}
|
|
194
|
-
const j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
195
|
-
__proto__: null,
|
|
196
|
-
decode: Q,
|
|
197
|
-
encode: Y,
|
|
198
|
-
isDefinedHashType: a
|
|
199
|
-
}, Symbol.toStringTag, { value: "Module" })), { typeforce: s } = d, U = o.OP_RESERVED;
|
|
200
|
-
function z(t) {
|
|
201
|
-
return K(t) && (t === o.OP_0 || t >= o.OP_1 && t <= o.OP_16 || t === o.OP_1NEGATE);
|
|
202
|
-
}
|
|
203
|
-
function N(t) {
|
|
204
|
-
return I(t) || z(t);
|
|
205
|
-
}
|
|
206
|
-
function p(t) {
|
|
207
|
-
return l(t) && t.every(N);
|
|
208
|
-
}
|
|
209
|
-
function W(t) {
|
|
210
|
-
return t.length - t.filter(N).length;
|
|
211
|
-
}
|
|
212
|
-
function c(t) {
|
|
213
|
-
if (t.length === 0) return o.OP_0;
|
|
214
|
-
if (t.length === 1) {
|
|
215
|
-
if (t[0] >= 1 && t[0] <= 16) return U + t[0];
|
|
216
|
-
if (t[0] === 129) return o.OP_1NEGATE;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
function g(t) {
|
|
220
|
-
return _.isBuffer(t);
|
|
221
|
-
}
|
|
222
|
-
function X(t) {
|
|
223
|
-
return l(t);
|
|
224
|
-
}
|
|
225
|
-
function E(t) {
|
|
226
|
-
return _.isBuffer(t);
|
|
227
|
-
}
|
|
228
|
-
function y(t) {
|
|
229
|
-
if (g(t)) return t;
|
|
230
|
-
s(l, t);
|
|
231
|
-
const n = t.reduce((O, P) => E(P) ? P.length === 1 && c(P) !== void 0 ? O + 1 : O + h(P.length) + P.length : O + 1, 0), e = _.allocUnsafe(n);
|
|
232
|
-
let r = 0;
|
|
233
|
-
if (t.forEach((O) => {
|
|
234
|
-
if (E(O)) {
|
|
235
|
-
const P = c(O);
|
|
236
|
-
if (P !== void 0) {
|
|
237
|
-
e.writeUInt8(P, r), r += 1;
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
r += M(e, O.length, r), O.copy(e, r), r += O.length;
|
|
241
|
-
} else
|
|
242
|
-
e.writeUInt8(O, r), r += 1;
|
|
243
|
-
}), r !== e.length) throw new Error("Could not decode chunks");
|
|
244
|
-
return e;
|
|
245
|
-
}
|
|
246
|
-
function u(t) {
|
|
247
|
-
if (X(t)) return t;
|
|
248
|
-
s(I, t);
|
|
249
|
-
const n = [];
|
|
250
|
-
let e = 0;
|
|
251
|
-
for (; e < t.length; ) {
|
|
252
|
-
const r = t[e];
|
|
253
|
-
if (r > o.OP_0 && r <= o.OP_PUSHDATA4) {
|
|
254
|
-
const O = w(t, e);
|
|
255
|
-
if (O === null || (e += O.size, e + O.number > t.length)) return null;
|
|
256
|
-
const P = t.subarray(e, e + O.number);
|
|
257
|
-
e += O.number;
|
|
258
|
-
const i = c(P);
|
|
259
|
-
i !== void 0 ? n.push(i) : n.push(P);
|
|
260
|
-
} else
|
|
261
|
-
n.push(r), e += 1;
|
|
262
|
-
}
|
|
263
|
-
return n;
|
|
264
|
-
}
|
|
265
|
-
function Z(t) {
|
|
266
|
-
if (g(t) && (t = u(t)), !t)
|
|
267
|
-
throw new Error("Could not convert invalid chunks to ASM");
|
|
268
|
-
return t.map((n) => {
|
|
269
|
-
if (E(n)) {
|
|
270
|
-
const e = c(n);
|
|
271
|
-
if (e === void 0) return n.toString("hex");
|
|
272
|
-
n = e;
|
|
273
|
-
}
|
|
274
|
-
return T[n];
|
|
275
|
-
}).join(" ");
|
|
276
|
-
}
|
|
277
|
-
function q(t) {
|
|
278
|
-
return s(V, t), y(
|
|
279
|
-
t.split(" ").map((n) => o[n] !== void 0 ? o[n] : (s(B, n), _.from(n, "hex")))
|
|
280
|
-
);
|
|
281
|
-
}
|
|
282
|
-
function J(t) {
|
|
283
|
-
return t = u(t), s(p, t), t.map((n) => E(n) ? n : n === o.OP_0 ? _.allocUnsafe(0) : R(n - U));
|
|
284
|
-
}
|
|
285
|
-
function x(t) {
|
|
286
|
-
return F(t);
|
|
287
|
-
}
|
|
288
|
-
function k(t) {
|
|
289
|
-
return !_.isBuffer(t) || !a(t[t.length - 1]) ? !1 : m(t.subarray(0, -1));
|
|
290
|
-
}
|
|
291
|
-
const tt = b, nt = j, Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
292
|
-
__proto__: null,
|
|
293
|
-
compile: y,
|
|
294
|
-
countNonPushOnlyOPs: W,
|
|
295
|
-
decompile: u,
|
|
296
|
-
fromASM: q,
|
|
297
|
-
isCanonicalPubKey: x,
|
|
298
|
-
isCanonicalScriptSignature: k,
|
|
299
|
-
isPushOnly: p,
|
|
300
|
-
number: tt,
|
|
301
|
-
opcodes: o,
|
|
302
|
-
signature: nt,
|
|
303
|
-
toASM: Z,
|
|
304
|
-
toStack: J
|
|
305
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
306
|
-
export {
|
|
307
|
-
x as a,
|
|
308
|
-
W as b,
|
|
309
|
-
y as c,
|
|
310
|
-
u as d,
|
|
311
|
-
p as e,
|
|
312
|
-
J as f,
|
|
313
|
-
Ot as g,
|
|
314
|
-
k as i,
|
|
315
|
-
o,
|
|
316
|
-
nt as s,
|
|
317
|
-
Z as t
|
|
318
|
-
};
|