@atomicfinance/types 4.0.0 → 4.0.2
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/.turbo/turbo-lint.log +1 -0
- package/.yalc/@node-dlc/bitcoin/.nyc_output/982e80bf-a70c-452f-b63d-d749ae385531.json +1 -0
- package/.yalc/@node-dlc/bitcoin/.nyc_output/processinfo/982e80bf-a70c-452f-b63d-d749ae385531.json +1 -0
- package/.yalc/@node-dlc/bitcoin/.nyc_output/processinfo/index.json +1 -0
- package/.yalc/@node-dlc/bitcoin/README.md +11 -0
- package/.yalc/@node-dlc/bitcoin/__tests__/bitcoin/amount.spec.ts +330 -0
- package/.yalc/@node-dlc/bitcoin/__tests__/bitcoin/value.spec.ts +320 -0
- package/.yalc/@node-dlc/bitcoin/__tests__/tsconfig.json +8 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/Amount.ts.html +290 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/Base58.ts.html +269 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/Base58Check.ts.html +182 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/BitcoinError.ts.html +173 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/BitcoinErrorCode.ts.html +110 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/HashByteOrder.ts.html +143 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/HashValue.ts.html +350 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/LexicographicalSorters.ts.html +191 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/LockTime.ts.html +386 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/OpCodes.ts.html +437 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/OutPoint.ts.html +383 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/Script.ts.html +1607 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/Sequence.ts.html +713 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/SigHashType.ts.html +137 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/Stack.ts.html +323 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/TimeLockMode.ts.html +128 -0
- package/.yalc/@node-dlc/{messaging/coverage/lcov-report/lib/serde/SerdeUtils.ts.html → bitcoin/coverage/lcov-report/Tx.ts.html} +617 -491
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/TxBuilder.ts.html +971 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/TxIn.ts.html +425 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/TxOut.ts.html +341 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/Value.ts.html +683 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/Wif.ts.html +311 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/Witness.ts.html +275 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/base.css +224 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/block-navigation.js +79 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/favicon.png +0 -0
- package/.yalc/@node-dlc/{messaging/coverage/lcov-report/lib/serde → bitcoin/coverage/lcov-report}/index.html +45 -30
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/index.ts.html +164 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/prettify.css +1 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/prettify.js +2 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov-report/sorter.js +170 -0
- package/.yalc/@node-dlc/bitcoin/coverage/lcov.info +123 -0
- package/.yalc/@node-dlc/bitcoin/dist/Amount.d.ts +48 -0
- package/.yalc/@node-dlc/bitcoin/dist/Amount.js +68 -0
- package/.yalc/@node-dlc/bitcoin/dist/Amount.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/Base58.d.ts +22 -0
- package/.yalc/@node-dlc/bitcoin/dist/Base58.js +62 -0
- package/.yalc/@node-dlc/bitcoin/dist/Base58.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/Base58Check.d.ts +14 -0
- package/.yalc/@node-dlc/bitcoin/dist/Base58Check.js +36 -0
- package/.yalc/@node-dlc/bitcoin/dist/Base58Check.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/BitcoinError.d.ts +6 -0
- package/.yalc/@node-dlc/bitcoin/dist/BitcoinError.js +36 -0
- package/.yalc/@node-dlc/bitcoin/dist/BitcoinError.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/BitcoinErrorCode.d.ts +10 -0
- package/.yalc/@node-dlc/bitcoin/dist/BitcoinErrorCode.js +15 -0
- package/.yalc/@node-dlc/bitcoin/dist/BitcoinErrorCode.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/Block.d.ts +19 -0
- package/.yalc/@node-dlc/bitcoin/dist/Block.js +3 -0
- package/.yalc/@node-dlc/bitcoin/dist/Block.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/HashByteOrder.d.ts +20 -0
- package/.yalc/@node-dlc/bitcoin/dist/HashByteOrder.js +25 -0
- package/.yalc/@node-dlc/bitcoin/dist/HashByteOrder.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/HashValue.d.ts +55 -0
- package/.yalc/@node-dlc/bitcoin/dist/HashValue.js +82 -0
- package/.yalc/@node-dlc/bitcoin/dist/HashValue.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/ICloneable.d.ts +3 -0
- package/.yalc/@node-dlc/bitcoin/dist/ICloneable.js +3 -0
- package/.yalc/@node-dlc/bitcoin/dist/ICloneable.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/LexicographicalSorters.d.ts +18 -0
- package/.yalc/@node-dlc/bitcoin/dist/LexicographicalSorters.js +41 -0
- package/.yalc/@node-dlc/bitcoin/dist/LexicographicalSorters.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/LockTime.d.ts +61 -0
- package/.yalc/@node-dlc/bitcoin/dist/LockTime.js +94 -0
- package/.yalc/@node-dlc/bitcoin/dist/LockTime.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/OpCodes.d.ts +102 -0
- package/.yalc/@node-dlc/bitcoin/dist/OpCodes.js +116 -0
- package/.yalc/@node-dlc/bitcoin/dist/OpCodes.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/OutPoint.d.ts +57 -0
- package/.yalc/@node-dlc/bitcoin/dist/OutPoint.js +88 -0
- package/.yalc/@node-dlc/bitcoin/dist/OutPoint.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/Script.d.ts +185 -0
- package/.yalc/@node-dlc/bitcoin/dist/Script.js +404 -0
- package/.yalc/@node-dlc/bitcoin/dist/Script.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/ScriptCmd.d.ts +3 -0
- package/.yalc/@node-dlc/bitcoin/dist/ScriptCmd.js +3 -0
- package/.yalc/@node-dlc/bitcoin/dist/ScriptCmd.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/Sequence.d.ts +116 -0
- package/.yalc/@node-dlc/bitcoin/dist/Sequence.js +187 -0
- package/.yalc/@node-dlc/bitcoin/dist/Sequence.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/SigHashType.d.ts +7 -0
- package/.yalc/@node-dlc/bitcoin/dist/SigHashType.js +27 -0
- package/.yalc/@node-dlc/bitcoin/dist/SigHashType.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/SizeResult.d.ts +5 -0
- package/.yalc/@node-dlc/bitcoin/dist/SizeResult.js +3 -0
- package/.yalc/@node-dlc/bitcoin/dist/SizeResult.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/Sorter.d.ts +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/Sorter.js +3 -0
- package/.yalc/@node-dlc/bitcoin/dist/Sorter.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/Stack.d.ts +15 -0
- package/.yalc/@node-dlc/bitcoin/dist/Stack.js +77 -0
- package/.yalc/@node-dlc/bitcoin/dist/Stack.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/TimeLockMode.d.ts +15 -0
- package/.yalc/@node-dlc/bitcoin/dist/TimeLockMode.js +20 -0
- package/.yalc/@node-dlc/bitcoin/dist/TimeLockMode.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/Tx.d.ts +150 -0
- package/.yalc/@node-dlc/bitcoin/dist/Tx.js +408 -0
- package/.yalc/@node-dlc/bitcoin/dist/Tx.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/TxBuilder.d.ts +110 -0
- package/.yalc/@node-dlc/bitcoin/dist/TxBuilder.js +238 -0
- package/.yalc/@node-dlc/bitcoin/dist/TxBuilder.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/TxIn.d.ts +71 -0
- package/.yalc/@node-dlc/bitcoin/dist/TxIn.js +79 -0
- package/.yalc/@node-dlc/bitcoin/dist/TxIn.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/TxOut.d.ts +57 -0
- package/.yalc/@node-dlc/bitcoin/dist/TxOut.js +68 -0
- package/.yalc/@node-dlc/bitcoin/dist/TxOut.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/Value.d.ts +122 -0
- package/.yalc/@node-dlc/bitcoin/dist/Value.js +180 -0
- package/.yalc/@node-dlc/bitcoin/dist/Value.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/Wif.d.ts +41 -0
- package/.yalc/@node-dlc/bitcoin/dist/Wif.js +62 -0
- package/.yalc/@node-dlc/bitcoin/dist/Wif.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/Witness.d.ts +41 -0
- package/.yalc/@node-dlc/bitcoin/dist/Witness.js +63 -0
- package/.yalc/@node-dlc/bitcoin/dist/Witness.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/dist/index.d.ts +28 -0
- package/.yalc/@node-dlc/bitcoin/dist/index.js +45 -0
- package/.yalc/@node-dlc/bitcoin/dist/index.js.map +1 -0
- package/.yalc/@node-dlc/bitcoin/lib/Amount.ts +70 -0
- package/.yalc/@node-dlc/bitcoin/lib/Base58.ts +63 -0
- package/.yalc/@node-dlc/bitcoin/lib/Base58Check.ts +34 -0
- package/.yalc/@node-dlc/bitcoin/lib/BitcoinError.ts +31 -0
- package/.yalc/@node-dlc/bitcoin/lib/BitcoinErrorCode.ts +10 -0
- package/.yalc/@node-dlc/bitcoin/lib/Block.ts +20 -0
- package/.yalc/@node-dlc/bitcoin/lib/HashByteOrder.ts +21 -0
- package/.yalc/@node-dlc/bitcoin/lib/HashValue.ts +90 -0
- package/.yalc/@node-dlc/bitcoin/lib/ICloneable.ts +3 -0
- package/.yalc/@node-dlc/bitcoin/lib/LexicographicalSorters.ts +37 -0
- package/.yalc/@node-dlc/bitcoin/lib/LockTime.ts +102 -0
- package/.yalc/@node-dlc/bitcoin/lib/OpCodes.ts +119 -0
- package/.yalc/@node-dlc/bitcoin/lib/OutPoint.ts +101 -0
- package/.yalc/@node-dlc/bitcoin/lib/Script.ts +509 -0
- package/.yalc/@node-dlc/bitcoin/lib/ScriptCmd.ts +3 -0
- package/.yalc/@node-dlc/bitcoin/lib/Sequence.ts +211 -0
- package/.yalc/@node-dlc/bitcoin/lib/SigHashType.ts +19 -0
- package/.yalc/@node-dlc/bitcoin/lib/SizeResult.ts +5 -0
- package/.yalc/@node-dlc/bitcoin/lib/Sorter.ts +1 -0
- package/.yalc/@node-dlc/bitcoin/lib/Stack.ts +81 -0
- package/.yalc/@node-dlc/bitcoin/lib/TimeLockMode.ts +16 -0
- package/.yalc/@node-dlc/bitcoin/lib/Tx.ts +480 -0
- package/.yalc/@node-dlc/bitcoin/lib/TxBuilder.ts +297 -0
- package/.yalc/@node-dlc/bitcoin/lib/TxIn.ts +115 -0
- package/.yalc/@node-dlc/bitcoin/lib/TxOut.ts +87 -0
- package/.yalc/@node-dlc/bitcoin/lib/Value.ts +201 -0
- package/.yalc/@node-dlc/bitcoin/lib/Wif.ts +77 -0
- package/.yalc/@node-dlc/bitcoin/lib/Witness.ts +65 -0
- package/.yalc/@node-dlc/bitcoin/lib/index.ts +28 -0
- package/.yalc/@node-dlc/bitcoin/package.json +31 -0
- package/.yalc/@node-dlc/bitcoin/tsconfig.json +8 -0
- package/.yalc/@node-dlc/bitcoin/yalc.sig +1 -0
- package/.yalc/@node-dlc/messaging/.nyc_output/83d37f9d-cecf-4c52-a753-115ff80bbca0.json +1 -0
- package/.yalc/@node-dlc/messaging/.nyc_output/processinfo/83d37f9d-cecf-4c52-a753-115ff80bbca0.json +1 -0
- package/.yalc/@node-dlc/messaging/.nyc_output/processinfo/index.json +1 -1
- package/.yalc/@node-dlc/messaging/__tests__/_test-utils.ts +1 -0
- package/.yalc/@node-dlc/messaging/__tests__/compatibility/dlcspecs-compatibility.spec.ts +13 -47
- package/.yalc/@node-dlc/messaging/__tests__/compatibility/rust-dlc-cross-language.spec.ts +166 -253
- package/.yalc/@node-dlc/messaging/__tests__/compatibility/true-serialization-compatibility.spec.ts +214 -483
- package/.yalc/@node-dlc/messaging/__tests__/messages/ContractDescriptor.spec.ts +3 -1
- package/.yalc/@node-dlc/messaging/__tests__/messages/ContractInfo.spec.ts +1 -1
- package/.yalc/@node-dlc/messaging/__tests__/messages/DlcAccept.spec.ts +72 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/DlcInput.spec.ts +111 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/DlcOffer.spec.ts +99 -37
- package/.yalc/@node-dlc/messaging/__tests__/messages/FundingInput.spec.ts +148 -63
- package/.yalc/@node-dlc/messaging/__tests__/messages/OracleAttestation.spec.ts +2 -4
- package/.yalc/@node-dlc/messaging/__tests__/messages/OrderAccept.spec.ts +7 -9
- package/.yalc/@node-dlc/messaging/__tests__/messages/OrderNegotiationFields.spec.ts +135 -52
- package/.yalc/@node-dlc/messaging/__tests__/messages/OrderPositionInfo.spec.ts +6 -6
- package/.yalc/@node-dlc/messaging/__tests__/messages/PayoutCurvePiece.spec.ts +1 -1
- package/.yalc/@node-dlc/messaging/__tests__/messages/PayoutFunction.spec.ts +1 -1
- package/.yalc/@node-dlc/messaging/__tests__/serialize/F64.spec.ts +1 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/index.html +31 -31
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/MessageType.ts.html +11 -5
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/chain/ChainManager.ts.html +6 -3
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/chain/ChainMemoryStore.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/chain/index.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/domain/Address.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/domain/index.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/index.html +9 -9
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/index.ts.html +11 -8
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/irc/IrcMessage.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/irc/index.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/AddressCache.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/BatchFundingGroup.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/CetAdaptorSignatures.ts.html +22 -22
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/CetAdaptorSignaturesV0.ts.html +46 -37
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/CloseTLV.ts.html +344 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/ContractDescriptor.ts.html +61 -70
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/ContractInfo.ts.html +59 -44
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcAccept.ts.html +251 -119
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcCancel.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcClose.ts.html +12 -3
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcCloseMetadata.ts.html +2 -11
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcIds.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcInfo.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcInput.ts.html +581 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcMessage.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcOffer.ts.html +307 -127
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcSign.ts.html +61 -46
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcTransactions.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/EventDescriptor.ts.html +67 -52
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/FundingInput.ts.html +202 -70
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/FundingSignatures.ts.html +15 -15
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/FundingSignaturesV0.ts.html +47 -77
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/NegotiationFields.ts.html +16 -4
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/NodeAnnouncementMessage.ts.html +3 -3
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleAnnouncement.ts.html +22 -22
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleAnnouncementV0.ts.html +48 -270
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleAttestation.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleAttestationV0.ts.html +113 -404
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleEvent.ts.html +49 -49
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleEventContainer.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleEventContainerV0.ts.html +22 -22
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleEventV0.ts.html +61 -385
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleIdentifier.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleIdentifierV0.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleInfo.ts.html +46 -25
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleInfoV0.ts.html +55 -1378
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderAccept.ts.html +68 -23
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderIrcInfo.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderMetadata.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderNegotiationFields.ts.html +266 -107
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderOffer.ts.html +31 -34
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderPositionInfo.ts.html +19 -88
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/PayoutCurvePiece.ts.html +36 -21
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/PayoutFunction.ts.html +34 -28
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/RoundingIntervals.ts.html +18 -15
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/RoundingIntervalsV0.ts.html +75 -129
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/ScriptWitnessV0.ts.html +6 -6
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/index.html +84 -69
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serialize/F64.ts.html +8 -53
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serialize/deserializeTlv.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serialize/getTlv.ts.html +9 -9
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serialize/index.html +15 -15
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/util.ts.html +22 -10
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/validation/index.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/validation/validate.ts.html +1 -1
- package/.yalc/@node-dlc/messaging/coverage/lcov.info +3049 -2826
- package/.yalc/@node-dlc/messaging/dist/MessageType.d.ts +2 -1
- package/.yalc/@node-dlc/messaging/dist/MessageType.js +2 -1
- package/.yalc/@node-dlc/messaging/dist/MessageType.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/chain/ChainManager.js +1 -0
- package/.yalc/@node-dlc/messaging/dist/chain/ChainManager.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/index.d.ts +5 -4
- package/.yalc/@node-dlc/messaging/dist/index.js +5 -4
- package/.yalc/@node-dlc/messaging/dist/index.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/CetAdaptorSignaturesV0.d.ts +42 -0
- package/.yalc/@node-dlc/messaging/dist/messages/CetAdaptorSignaturesV0.js +68 -0
- package/.yalc/@node-dlc/messaging/dist/messages/CetAdaptorSignaturesV0.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/CloseTLV.d.ts +38 -0
- package/.yalc/@node-dlc/messaging/dist/messages/CloseTLV.js +59 -0
- package/.yalc/@node-dlc/messaging/dist/messages/CloseTLV.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/ContractDescriptor.d.ts +11 -12
- package/.yalc/@node-dlc/messaging/dist/messages/ContractDescriptor.js +0 -1
- package/.yalc/@node-dlc/messaging/dist/messages/ContractDescriptor.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/ContractInfo.d.ts +10 -10
- package/.yalc/@node-dlc/messaging/dist/messages/ContractInfo.js +5 -1
- package/.yalc/@node-dlc/messaging/dist/messages/ContractInfo.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/DlcAccept.d.ts +15 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcAccept.js +46 -5
- package/.yalc/@node-dlc/messaging/dist/messages/DlcAccept.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/DlcClose.js +6 -2
- package/.yalc/@node-dlc/messaging/dist/messages/DlcClose.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/DlcCloseMetadata.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/DlcInput.d.ts +56 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcInput.js +135 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcInput.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcOffer.d.ts +16 -1
- package/.yalc/@node-dlc/messaging/dist/messages/DlcOffer.js +50 -5
- package/.yalc/@node-dlc/messaging/dist/messages/DlcOffer.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/DlcSign.js +11 -3
- package/.yalc/@node-dlc/messaging/dist/messages/DlcSign.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/EventDescriptor.d.ts +7 -6
- package/.yalc/@node-dlc/messaging/dist/messages/EventDescriptor.js +3 -0
- package/.yalc/@node-dlc/messaging/dist/messages/EventDescriptor.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/FundingInput.d.ts +7 -0
- package/.yalc/@node-dlc/messaging/dist/messages/FundingInput.js +31 -1
- package/.yalc/@node-dlc/messaging/dist/messages/FundingInput.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/FundingSignaturesV0.d.ts +34 -0
- package/.yalc/@node-dlc/messaging/dist/messages/FundingSignaturesV0.js +72 -0
- package/.yalc/@node-dlc/messaging/dist/messages/FundingSignaturesV0.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/NegotiationFields.d.ts +2 -2
- package/.yalc/@node-dlc/messaging/dist/messages/NegotiationFields.js +4 -0
- package/.yalc/@node-dlc/messaging/dist/messages/NegotiationFields.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/OracleAnnouncementV0.d.ts +47 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleAnnouncementV0.js +76 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleAnnouncementV0.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleAttestationV0.d.ts +48 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleAttestationV0.js +100 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleAttestationV0.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleEventContainerV0.d.ts +32 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleEventContainerV0.js +67 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleEventContainerV0.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleEventV0.d.ts +54 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleEventV0.js +100 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleEventV0.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleInfo.d.ts +8 -6
- package/.yalc/@node-dlc/messaging/dist/messages/OracleInfo.js +3 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleInfo.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/OracleInfoV0.d.ts +15 -141
- package/.yalc/@node-dlc/messaging/dist/messages/OracleInfoV0.js +21 -350
- package/.yalc/@node-dlc/messaging/dist/messages/OracleInfoV0.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/OrderAccept.d.ts +3 -2
- package/.yalc/@node-dlc/messaging/dist/messages/OrderAccept.js +22 -7
- package/.yalc/@node-dlc/messaging/dist/messages/OrderAccept.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/OrderNegotiationFields.d.ts +48 -36
- package/.yalc/@node-dlc/messaging/dist/messages/OrderNegotiationFields.js +97 -50
- package/.yalc/@node-dlc/messaging/dist/messages/OrderNegotiationFields.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/OrderOffer.d.ts +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/OrderOffer.js +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/OrderOffer.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/OrderPositionInfo.d.ts +7 -13
- package/.yalc/@node-dlc/messaging/dist/messages/OrderPositionInfo.js +11 -25
- package/.yalc/@node-dlc/messaging/dist/messages/OrderPositionInfo.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/PayoutCurvePiece.js +5 -0
- package/.yalc/@node-dlc/messaging/dist/messages/PayoutCurvePiece.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/PayoutFunction.js +4 -1
- package/.yalc/@node-dlc/messaging/dist/messages/PayoutFunction.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/RoundingIntervals.js +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/RoundingIntervals.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/messages/RoundingIntervalsV0.d.ts +47 -0
- package/.yalc/@node-dlc/messaging/dist/messages/RoundingIntervalsV0.js +86 -0
- package/.yalc/@node-dlc/messaging/dist/messages/RoundingIntervalsV0.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/serialize/F64.d.ts +0 -8
- package/.yalc/@node-dlc/messaging/dist/serialize/F64.js +0 -13
- package/.yalc/@node-dlc/messaging/dist/serialize/F64.js.map +1 -1
- package/.yalc/@node-dlc/messaging/dist/util.d.ts +1 -1
- package/.yalc/@node-dlc/messaging/dist/util.js +2 -0
- package/.yalc/@node-dlc/messaging/dist/util.js.map +1 -1
- package/.yalc/@node-dlc/messaging/lib/MessageType.ts +3 -1
- package/.yalc/@node-dlc/messaging/lib/chain/ChainManager.ts +1 -0
- package/.yalc/@node-dlc/messaging/lib/index.ts +5 -4
- package/.yalc/@node-dlc/messaging/lib/messages/ContractDescriptor.ts +15 -16
- package/.yalc/@node-dlc/messaging/lib/messages/ContractInfo.ts +17 -12
- package/.yalc/@node-dlc/messaging/lib/messages/DlcAccept.ts +50 -6
- package/.yalc/@node-dlc/messaging/lib/messages/DlcClose.ts +4 -1
- package/.yalc/@node-dlc/messaging/lib/messages/DlcCloseMetadata.ts +0 -3
- package/.yalc/@node-dlc/messaging/lib/messages/DlcInput.ts +167 -0
- package/.yalc/@node-dlc/messaging/lib/messages/DlcOffer.ts +67 -7
- package/.yalc/@node-dlc/messaging/lib/messages/DlcSign.ts +5 -0
- package/.yalc/@node-dlc/messaging/lib/messages/EventDescriptor.ts +12 -7
- package/.yalc/@node-dlc/messaging/lib/messages/FundingInput.ts +45 -1
- package/.yalc/@node-dlc/messaging/lib/messages/NegotiationFields.ts +6 -2
- package/.yalc/@node-dlc/messaging/lib/messages/NodeAnnouncementMessage.ts +2 -2
- package/.yalc/@node-dlc/messaging/lib/messages/OracleInfo.ts +15 -8
- package/.yalc/@node-dlc/messaging/lib/messages/OrderAccept.ts +28 -13
- package/.yalc/@node-dlc/messaging/lib/messages/OrderNegotiationFields.ts +127 -74
- package/.yalc/@node-dlc/messaging/lib/messages/OrderOffer.ts +2 -3
- package/.yalc/@node-dlc/messaging/lib/messages/OrderPositionInfo.ts +10 -33
- package/.yalc/@node-dlc/messaging/lib/messages/PayoutCurvePiece.ts +5 -0
- package/.yalc/@node-dlc/messaging/lib/messages/PayoutFunction.ts +2 -0
- package/.yalc/@node-dlc/messaging/lib/messages/RoundingIntervals.ts +1 -0
- package/.yalc/@node-dlc/messaging/lib/serialize/F64.ts +0 -15
- package/.yalc/@node-dlc/messaging/lib/serialize/readTlvs.ts +1 -1
- package/.yalc/@node-dlc/messaging/lib/util.ts +5 -1
- package/.yalc/@node-dlc/messaging/package.json +8 -8
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_3_of_3_test.json +76 -74
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_3_of_5_test.json +90 -88
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_and_numerical_3_of_5_test.json +162 -160
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_and_numerical_5_of_5_test.json +162 -160
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_and_numerical_with_diff_3_of_5_test.json +164 -162
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_and_numerical_with_diff_5_of_5_test.json +164 -162
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_single_oracle_test.json +60 -58
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/single_oracle_numerical_hyperbola_test.json +71 -69
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/single_oracle_numerical_test.json +71 -69
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/three_of_five_oracle_numerical_with_diff_test.json +119 -117
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/three_of_three_oracle_numerical_test.json +95 -93
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/three_of_three_oracle_numerical_with_diff_test.json +97 -95
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/two_of_five_oracle_numerical_test.json +117 -115
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/two_of_five_oracle_numerical_with_diff_test.json +119 -117
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/enum_3_of_3_test.json +210 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/enum_3_of_5_test.json +468 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/enum_and_numerical_3_of_5_test.json +1517 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/enum_and_numerical_5_of_5_test.json +545 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/enum_and_numerical_with_diff_3_of_5_test.json +4761 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/enum_and_numerical_with_diff_5_of_5_test.json +2169 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/enum_single_oracle_test.json +164 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/single_oracle_numerical_hyperbola_test.json +502 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/single_oracle_numerical_test.json +262 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/three_of_five_oracle_numerical_with_diff_test.json +4382 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/three_of_three_oracle_numerical_test.json +324 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/three_of_three_oracle_numerical_with_diff_test.json +652 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/two_of_five_oracle_numerical_test.json +1138 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250718_132453/two_of_five_oracle_numerical_with_diff_test.json +2222 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/enum_3_of_3_test.json +212 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/enum_3_of_5_test.json +470 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/enum_and_numerical_3_of_5_test.json +1519 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/enum_and_numerical_5_of_5_test.json +547 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/enum_and_numerical_with_diff_3_of_5_test.json +4763 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/enum_and_numerical_with_diff_5_of_5_test.json +2171 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/enum_single_oracle_test.json +166 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/single_oracle_numerical_hyperbola_test.json +504 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/single_oracle_numerical_test.json +264 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/three_of_five_oracle_numerical_with_diff_test.json +4384 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/three_of_three_oracle_numerical_test.json +326 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/three_of_three_oracle_numerical_with_diff_test.json +654 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/two_of_five_oracle_numerical_test.json +1140 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs_backup_20250719_185952/two_of_five_oracle_numerical_with_diff_test.json +2224 -0
- package/.yalc/@node-dlc/messaging/yalc.sig +1 -1
- package/.yalc/@node-dlc/noise/.eslintrc +6 -0
- package/.yalc/@node-dlc/noise/.nyc_output/cce169d2-1730-4a39-9e05-4edcd8b14961.json +1 -0
- package/.yalc/@node-dlc/noise/.nyc_output/processinfo/cce169d2-1730-4a39-9e05-4edcd8b14961.json +1 -0
- package/.yalc/@node-dlc/noise/.nyc_output/processinfo/index.json +1 -0
- package/.yalc/@node-dlc/noise/README.md +165 -0
- package/.yalc/@node-dlc/noise/__integration__/ping-pong.spec.ts +85 -0
- package/.yalc/@node-dlc/noise/__tests__/noise-server.spec.ts +82 -0
- package/.yalc/@node-dlc/noise/__tests__/noise-socket.spec.ts +574 -0
- package/.yalc/@node-dlc/noise/__tests__/noise-state.spec.ts +485 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/base.css +224 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/block-navigation.js +79 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/favicon.png +0 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/handshake-state.ts.html +230 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/index.html +201 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/index.ts.html +344 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/noise-error.ts.html +89 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/noise-server.ts.html +485 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/noise-socket.ts.html +1223 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/noise-state.ts.html +1523 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/prettify.css +1 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/prettify.js +2 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/read-state.ts.html +95 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/.yalc/@node-dlc/noise/coverage/lcov-report/sorter.js +170 -0
- package/.yalc/@node-dlc/noise/coverage/lcov.info +565 -0
- package/.yalc/@node-dlc/noise/dist/handshake-state.d.ts +46 -0
- package/.yalc/@node-dlc/noise/dist/handshake-state.js +51 -0
- package/.yalc/@node-dlc/noise/dist/handshake-state.js.map +1 -0
- package/.yalc/@node-dlc/noise/dist/index.d.ts +46 -0
- package/.yalc/@node-dlc/noise/dist/index.js +69 -0
- package/.yalc/@node-dlc/noise/dist/index.js.map +1 -0
- package/.yalc/@node-dlc/noise/dist/noise-error.d.ts +3 -0
- package/.yalc/@node-dlc/noise/dist/noise-error.js +11 -0
- package/.yalc/@node-dlc/noise/dist/noise-error.js.map +1 -0
- package/.yalc/@node-dlc/noise/dist/noise-server-listen-options.d.ts +23 -0
- package/.yalc/@node-dlc/noise/dist/noise-server-listen-options.js +3 -0
- package/.yalc/@node-dlc/noise/dist/noise-server-listen-options.js.map +1 -0
- package/.yalc/@node-dlc/noise/dist/noise-server-options.d.ts +13 -0
- package/.yalc/@node-dlc/noise/dist/noise-server-options.js +3 -0
- package/.yalc/@node-dlc/noise/dist/noise-server-options.js.map +1 -0
- package/.yalc/@node-dlc/noise/dist/noise-server.d.ts +71 -0
- package/.yalc/@node-dlc/noise/dist/noise-server.js +125 -0
- package/.yalc/@node-dlc/noise/dist/noise-server.js.map +1 -0
- package/.yalc/@node-dlc/noise/dist/noise-socket-options.d.ts +28 -0
- package/.yalc/@node-dlc/noise/dist/noise-socket-options.js +3 -0
- package/.yalc/@node-dlc/noise/dist/noise-socket-options.js.map +1 -0
- package/.yalc/@node-dlc/noise/dist/noise-socket.d.ts +98 -0
- package/.yalc/@node-dlc/noise/dist/noise-socket.js +278 -0
- package/.yalc/@node-dlc/noise/dist/noise-socket.js.map +1 -0
- package/.yalc/@node-dlc/noise/dist/noise-state-options.d.ts +16 -0
- package/.yalc/@node-dlc/noise/dist/noise-state-options.js +3 -0
- package/.yalc/@node-dlc/noise/dist/noise-state-options.js.map +1 -0
- package/.yalc/@node-dlc/noise/dist/noise-state.d.ts +164 -0
- package/.yalc/@node-dlc/noise/dist/noise-state.js +304 -0
- package/.yalc/@node-dlc/noise/dist/noise-state.js.map +1 -0
- package/.yalc/@node-dlc/noise/dist/read-state.d.ts +5 -0
- package/.yalc/@node-dlc/noise/dist/read-state.js +10 -0
- package/.yalc/@node-dlc/noise/dist/read-state.js.map +1 -0
- package/.yalc/@node-dlc/noise/lib/handshake-state.ts +50 -0
- package/.yalc/@node-dlc/noise/lib/index.ts +88 -0
- package/.yalc/@node-dlc/noise/lib/noise-error.ts +3 -0
- package/.yalc/@node-dlc/noise/lib/noise-server-listen-options.ts +25 -0
- package/.yalc/@node-dlc/noise/lib/noise-server-options.ts +13 -0
- package/.yalc/@node-dlc/noise/lib/noise-server.ts +135 -0
- package/.yalc/@node-dlc/noise/lib/noise-socket-options.ts +32 -0
- package/.yalc/@node-dlc/noise/lib/noise-socket.ts +381 -0
- package/.yalc/@node-dlc/noise/lib/noise-state-options.ts +18 -0
- package/.yalc/@node-dlc/noise/lib/noise-state.ts +481 -0
- package/.yalc/@node-dlc/noise/lib/read-state.ts +5 -0
- package/.yalc/@node-dlc/noise/package.json +35 -0
- package/.yalc/@node-dlc/noise/tsconfig-build.json +7 -0
- package/.yalc/@node-dlc/noise/tsconfig.json +4 -0
- package/.yalc/@node-dlc/noise/yalc.sig +1 -0
- package/CHANGELOG.md +45 -5
- package/dist/dlc.d.ts +99 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/models/Amount.js +4 -2
- package/dist/models/Amount.js.map +1 -1
- package/dist/models/Input.d.ts +30 -1
- package/dist/models/Input.js +45 -9
- package/dist/models/Input.js.map +1 -1
- package/dist/models/Outcome.js +1 -0
- package/dist/models/Outcome.js.map +1 -1
- package/dist/models/Utxo.d.ts +3 -3
- package/dist/models/Utxo.js +11 -13
- package/dist/models/Utxo.js.map +1 -1
- package/dist/transaction.js.map +1 -1
- package/lib/block.ts +1 -0
- package/lib/dlc.ts +125 -1
- package/lib/index.ts +7 -1
- package/lib/models/Amount.ts +4 -1
- package/lib/models/Input.ts +75 -8
- package/lib/models/Outcome.ts +1 -0
- package/lib/models/Utxo.ts +21 -13
- package/lib/transaction.ts +1 -0
- package/lib/wallet.ts +1 -0
- package/package.json +4 -4
- package/yalc.lock +12 -2
- package/.yalc/@node-dlc/messaging/.nyc_output/2cf48009-1094-4275-bb91-c164c932feb6.json +0 -1
- package/.yalc/@node-dlc/messaging/.nyc_output/processinfo/2cf48009-1094-4275-bb91-c164c932feb6.json +0 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Value = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Represents bitcoin value that can be converted to or from multiple
|
|
6
|
+
* formats.
|
|
7
|
+
*/
|
|
8
|
+
class Value {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a value object from value in bitcoin, eg: 1.12345678
|
|
11
|
+
* @param num
|
|
12
|
+
*/
|
|
13
|
+
static fromBitcoin(num) {
|
|
14
|
+
return Value.fromSats(Math.round(num * 1e8));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a value instance from value in satoshis where 1 satoshis
|
|
18
|
+
* equates to 0.00000001 bitcoin.
|
|
19
|
+
* @param num
|
|
20
|
+
*/
|
|
21
|
+
static fromSats(num) {
|
|
22
|
+
return new Value(BigInt(num) * BigInt(1e12));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Creates a value instance from value in millisatoshis, 1/1000 of a
|
|
26
|
+
* satoshi.
|
|
27
|
+
* eg: 123 millisatoshis equates to 0.123 satoshis
|
|
28
|
+
* eg: 123 millisatoshis equates to 0.00000000123 bitcoin
|
|
29
|
+
* @param num
|
|
30
|
+
*/
|
|
31
|
+
static fromMilliSats(num) {
|
|
32
|
+
return new Value(BigInt(num) * BigInt(1e9));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Creates a value instance from value in microsatoshis, 1/1e6 of a
|
|
36
|
+
* satoshi.
|
|
37
|
+
* eg: 123 microsatoshis equates to 0.000123 satoshis
|
|
38
|
+
* eg: 123 microsatoshis equates to 0.00000000000123 bitcoin
|
|
39
|
+
* @param num
|
|
40
|
+
*/
|
|
41
|
+
static fromMicroSats(num) {
|
|
42
|
+
return new Value(BigInt(num) * BigInt(1e6));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Creates a value instance from value in picosatoshis, 1/1e12 of a
|
|
46
|
+
* satoshi.
|
|
47
|
+
* eg: 123 picosatoshis equates to 0.000000000123 satoshis
|
|
48
|
+
* eg: 123 picosatoshis equates to 0.00000000000000000123 bitcoin
|
|
49
|
+
* @param num
|
|
50
|
+
*/
|
|
51
|
+
static fromPicoSats(num) {
|
|
52
|
+
return new Value(BigInt(num));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Generates a value instance of zero
|
|
56
|
+
*/
|
|
57
|
+
static zero() {
|
|
58
|
+
return new Value(BigInt(0));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Gets the value in picosatoshis (1/1e12 satoshis)
|
|
62
|
+
*/
|
|
63
|
+
get psats() {
|
|
64
|
+
return this._picoSats;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Gets the value in millionth of satoshis (1/1e6 satoshis)
|
|
68
|
+
*/
|
|
69
|
+
get microsats() {
|
|
70
|
+
return this._picoSats / BigInt(1e6);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Gets the value in millisatoshis (1/1000 satoshis)
|
|
74
|
+
*/
|
|
75
|
+
get msats() {
|
|
76
|
+
return this._picoSats / BigInt(1e9);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Gets the value in satoshis (1/1e8 bitcoin)
|
|
80
|
+
*/
|
|
81
|
+
get sats() {
|
|
82
|
+
return this._picoSats / BigInt(1e12);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Gets the value in bitcoin
|
|
86
|
+
*/
|
|
87
|
+
get bitcoin() {
|
|
88
|
+
return Math.max(0, Number(this.sats) / 1e8);
|
|
89
|
+
}
|
|
90
|
+
constructor(picoSats) {
|
|
91
|
+
this._picoSats = picoSats;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Clone via deep copy
|
|
95
|
+
*/
|
|
96
|
+
clone() {
|
|
97
|
+
return new Value(this._picoSats);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Adds another value to this instance and returns this instance
|
|
101
|
+
* @param other
|
|
102
|
+
*/
|
|
103
|
+
add(other) {
|
|
104
|
+
this._picoSats += other.psats;
|
|
105
|
+
return this;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Adds another value to the current value and returns a new Value instance
|
|
109
|
+
* @param other
|
|
110
|
+
*/
|
|
111
|
+
addn(other) {
|
|
112
|
+
return new Value(this._picoSats + other.psats);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Subtracts another value from this instance and returns this instance
|
|
116
|
+
* @param other
|
|
117
|
+
*/
|
|
118
|
+
sub(other) {
|
|
119
|
+
if (this._picoSats < other.psats) {
|
|
120
|
+
throw new Error('Value underflow');
|
|
121
|
+
}
|
|
122
|
+
this._picoSats -= other.psats;
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Subtracts another value from the current value and returns a new Value instance
|
|
127
|
+
* @param other
|
|
128
|
+
*/
|
|
129
|
+
subn(other) {
|
|
130
|
+
if (this._picoSats < other.psats) {
|
|
131
|
+
throw new Error('Value underflow');
|
|
132
|
+
}
|
|
133
|
+
return new Value(this._picoSats - other.psats);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Returns true if this value is less than the other value
|
|
137
|
+
* @param other
|
|
138
|
+
*/
|
|
139
|
+
lt(other) {
|
|
140
|
+
return this._picoSats < other.psats;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Returns true if this value is equal to the other value
|
|
144
|
+
* @param other
|
|
145
|
+
*/
|
|
146
|
+
eq(other) {
|
|
147
|
+
return this._picoSats === other.psats;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Returns true if this value is greater than the other value
|
|
151
|
+
* @param other
|
|
152
|
+
*/
|
|
153
|
+
gt(other) {
|
|
154
|
+
return this._picoSats > other.psats;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Returns true if this value is greater than or equal to the other value
|
|
158
|
+
* @param other
|
|
159
|
+
*/
|
|
160
|
+
gte(other) {
|
|
161
|
+
return this._picoSats >= other.psats;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Returns true if this value is less than or equal to the other value
|
|
165
|
+
* @param other
|
|
166
|
+
*/
|
|
167
|
+
lte(other) {
|
|
168
|
+
return this._picoSats <= other.psats;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Returns a string representation of the value in bitcoin format
|
|
172
|
+
* with 8 decimal places
|
|
173
|
+
*/
|
|
174
|
+
toString() {
|
|
175
|
+
const btc = this.bitcoin;
|
|
176
|
+
return btc.toFixed(8);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
exports.Value = Value;
|
|
180
|
+
//# sourceMappingURL=Value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Value.js","sourceRoot":"","sources":["../lib/Value.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,KAAK;IAChB;;;OAGG;IACI,MAAM,CAAC,WAAW,CAAC,GAAW;QACnC,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,GAAoB;QACzC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,aAAa,CAAC,GAAoB;QAC9C,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,aAAa,CAAC,GAAoB;QAC9C,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,YAAY,CAAC,GAAoB;QAC7C,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,IAAI;QAChB,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;IAID;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;IAC9C,CAAC;IAED,YAAsB,QAAgB;QACpC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED;;OAEG;IACI,KAAK;QACV,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACI,GAAG,CAAC,KAAY;QACrB,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACI,IAAI,CAAC,KAAY;QACtB,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACI,GAAG,CAAC,KAAY;QACrB,IAAI,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,EAAE;YAChC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;SACpC;QACD,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACI,IAAI,CAAC,KAAY;QACtB,IAAI,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,EAAE;YAChC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;SACpC;QACD,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACI,EAAE,CAAC,KAAY;QACpB,OAAO,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC;IACtC,CAAC;IAED;;;OAGG;IACI,EAAE,CAAC,KAAY;QACpB,OAAO,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,KAAK,CAAC;IACxC,CAAC;IAED;;;OAGG;IACI,EAAE,CAAC,KAAY;QACpB,OAAO,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC;IACtC,CAAC;IAED;;;OAGG;IACI,GAAG,CAAC,KAAY;QACrB,OAAO,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC;IACvC,CAAC;IAED;;;OAGG;IACI,GAAG,CAAC,KAAY;QACrB,OAAO,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC;IACvC,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC;QACzB,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC;CACF;AAlMD,sBAkMC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export type WifDecodeResult = {
|
|
3
|
+
privateKey: Buffer;
|
|
4
|
+
compressed: boolean;
|
|
5
|
+
prefix: number;
|
|
6
|
+
};
|
|
7
|
+
export declare class Wif {
|
|
8
|
+
/**
|
|
9
|
+
* Encodes a private key using the WIF format. Can encode with compressed
|
|
10
|
+
* or uncompressed format and can be for testnet or mainnet.
|
|
11
|
+
*
|
|
12
|
+
* Mainnet prefix: 0x80
|
|
13
|
+
* Testnet prefix: 0xef
|
|
14
|
+
*
|
|
15
|
+
* Algorithm for WIF is:
|
|
16
|
+
* 1. Start with the prefix
|
|
17
|
+
* 2. Encode the secret in 32-byte big-endian format
|
|
18
|
+
* 3. If the SEC format used for the public key address was compressed add
|
|
19
|
+
* a suffix of 0x01
|
|
20
|
+
* 4. Combine wthe prefix from #1, serialized secret from #2, and suffix from #3
|
|
21
|
+
* 5. Do hash256 of the result from #4 and get the first 4 bytes
|
|
22
|
+
* 6. Take the combination of #4 and #5 and encode it with Base58
|
|
23
|
+
*
|
|
24
|
+
* @param privateKey a 32-byte private key as a big-endian buffer
|
|
25
|
+
* @param compressed default of true
|
|
26
|
+
* @param testnet default of false
|
|
27
|
+
*/
|
|
28
|
+
static encode(privateKey: Buffer, compressed?: boolean, testnet?: boolean): string;
|
|
29
|
+
/**
|
|
30
|
+
* To decode a WIF value, we must first decode the base58check
|
|
31
|
+
* input. If this validates then we need to split the resulting
|
|
32
|
+
* buffer of data into two or three parts.
|
|
33
|
+
*
|
|
34
|
+
* The first byte is the prefix
|
|
35
|
+
* The next 32-bytes are the private key
|
|
36
|
+
*
|
|
37
|
+
*
|
|
38
|
+
* @param buf
|
|
39
|
+
*/
|
|
40
|
+
static decode(input: string): WifDecodeResult;
|
|
41
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Wif = void 0;
|
|
4
|
+
const Base58Check_1 = require("./Base58Check");
|
|
5
|
+
class Wif {
|
|
6
|
+
/**
|
|
7
|
+
* Encodes a private key using the WIF format. Can encode with compressed
|
|
8
|
+
* or uncompressed format and can be for testnet or mainnet.
|
|
9
|
+
*
|
|
10
|
+
* Mainnet prefix: 0x80
|
|
11
|
+
* Testnet prefix: 0xef
|
|
12
|
+
*
|
|
13
|
+
* Algorithm for WIF is:
|
|
14
|
+
* 1. Start with the prefix
|
|
15
|
+
* 2. Encode the secret in 32-byte big-endian format
|
|
16
|
+
* 3. If the SEC format used for the public key address was compressed add
|
|
17
|
+
* a suffix of 0x01
|
|
18
|
+
* 4. Combine wthe prefix from #1, serialized secret from #2, and suffix from #3
|
|
19
|
+
* 5. Do hash256 of the result from #4 and get the first 4 bytes
|
|
20
|
+
* 6. Take the combination of #4 and #5 and encode it with Base58
|
|
21
|
+
*
|
|
22
|
+
* @param privateKey a 32-byte private key as a big-endian buffer
|
|
23
|
+
* @param compressed default of true
|
|
24
|
+
* @param testnet default of false
|
|
25
|
+
*/
|
|
26
|
+
static encode(privateKey, compressed = true, testnet = false) {
|
|
27
|
+
// 1. prefix
|
|
28
|
+
const prefix = Buffer.from([testnet ? 0xef : 0x80]);
|
|
29
|
+
// 2. encode as 32-byte big-endian number
|
|
30
|
+
// 3. suffix
|
|
31
|
+
const suffix = compressed ? Buffer.from([0x01]) : Buffer.alloc(0);
|
|
32
|
+
// 4. combine 1, 2, and 3
|
|
33
|
+
return Base58Check_1.Base58Check.encode(Buffer.concat([prefix, privateKey, suffix]));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* To decode a WIF value, we must first decode the base58check
|
|
37
|
+
* input. If this validates then we need to split the resulting
|
|
38
|
+
* buffer of data into two or three parts.
|
|
39
|
+
*
|
|
40
|
+
* The first byte is the prefix
|
|
41
|
+
* The next 32-bytes are the private key
|
|
42
|
+
*
|
|
43
|
+
*
|
|
44
|
+
* @param buf
|
|
45
|
+
*/
|
|
46
|
+
static decode(input) {
|
|
47
|
+
const raw = Base58Check_1.Base58Check.decode(input);
|
|
48
|
+
if (raw.length !== 33 && raw.length !== 34) {
|
|
49
|
+
throw new Error('Invalid WIF encoding');
|
|
50
|
+
}
|
|
51
|
+
// prefix is the first byte
|
|
52
|
+
const prefix = raw[0];
|
|
53
|
+
// next 32-bytes are the private key
|
|
54
|
+
const privateKey = raw.slice(1, 33);
|
|
55
|
+
// check for compressed byte
|
|
56
|
+
const compressed = raw.length === 34 && raw[33] === 0x01;
|
|
57
|
+
// return our result object
|
|
58
|
+
return { privateKey, compressed, prefix };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.Wif = Wif;
|
|
62
|
+
//# sourceMappingURL=Wif.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Wif.js","sourceRoot":"","sources":["../lib/Wif.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAQ5C,MAAa,GAAG;IACd;;;;;;;;;;;;;;;;;;;OAmBG;IACI,MAAM,CAAC,MAAM,CAClB,UAAkB,EAClB,UAAU,GAAG,IAAI,EACjB,OAAO,GAAG,KAAK;QAEf,YAAY;QACZ,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAEpD,yCAAyC;QAEzC,YAAY;QACZ,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAElE,yBAAyB;QACzB,OAAO,yBAAW,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;OAUG;IACI,MAAM,CAAC,MAAM,CAAC,KAAa;QAChC,MAAM,GAAG,GAAG,yBAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEtC,IAAI,GAAG,CAAC,MAAM,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,KAAK,EAAE,EAAE;YAC1C,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;SACzC;QAED,2BAA2B;QAC3B,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAEtB,oCAAoC;QACpC,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAEpC,4BAA4B;QAC5B,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,KAAK,EAAE,IAAI,GAAG,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;QAEzD,2BAA2B;QAC3B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAC5C,CAAC;CACF;AApED,kBAoEC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { StreamReader } from '@node-dlc/bufio';
|
|
3
|
+
import { ICloneable } from './ICloneable';
|
|
4
|
+
/**
|
|
5
|
+
* Represents segregated witness data. This data is nothing more than a
|
|
6
|
+
* buffer.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Witness implements ICloneable<Witness> {
|
|
9
|
+
readonly data: Buffer;
|
|
10
|
+
/**
|
|
11
|
+
* Parses witness data
|
|
12
|
+
* @param reader
|
|
13
|
+
*/
|
|
14
|
+
static parse(reader: StreamReader): Witness;
|
|
15
|
+
/**
|
|
16
|
+
* Hex-encoded Witness data. This method interally creates a
|
|
17
|
+
* StreamReader and uses the parse function
|
|
18
|
+
* @param hex encoded as a string
|
|
19
|
+
*/
|
|
20
|
+
static fromHex(hex: string): Witness;
|
|
21
|
+
constructor(data: Buffer);
|
|
22
|
+
/**
|
|
23
|
+
* Serializes witness data into a buffer in the format:
|
|
24
|
+
*
|
|
25
|
+
* [varint] length
|
|
26
|
+
* [length] data
|
|
27
|
+
*/
|
|
28
|
+
serialize(): Buffer;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the string of a piece of witness data
|
|
31
|
+
*/
|
|
32
|
+
toString(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the string of a piece of witness data
|
|
35
|
+
*/
|
|
36
|
+
toJSON(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Clone via deep copy
|
|
39
|
+
*/
|
|
40
|
+
clone(): Witness;
|
|
41
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Witness = void 0;
|
|
4
|
+
const bufio_1 = require("@node-dlc/bufio");
|
|
5
|
+
/**
|
|
6
|
+
* Represents segregated witness data. This data is nothing more than a
|
|
7
|
+
* buffer.
|
|
8
|
+
*/
|
|
9
|
+
class Witness {
|
|
10
|
+
/**
|
|
11
|
+
* Parses witness data
|
|
12
|
+
* @param reader
|
|
13
|
+
*/
|
|
14
|
+
static parse(reader) {
|
|
15
|
+
const len = reader.readVarInt();
|
|
16
|
+
const data = reader.readBytes(Number(len));
|
|
17
|
+
return new Witness(data);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Hex-encoded Witness data. This method interally creates a
|
|
21
|
+
* StreamReader and uses the parse function
|
|
22
|
+
* @param hex encoded as a string
|
|
23
|
+
*/
|
|
24
|
+
static fromHex(hex) {
|
|
25
|
+
return Witness.parse(bufio_1.StreamReader.fromHex(hex));
|
|
26
|
+
}
|
|
27
|
+
constructor(data) {
|
|
28
|
+
this.data = data;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Serializes witness data into a buffer in the format:
|
|
32
|
+
*
|
|
33
|
+
* [varint] length
|
|
34
|
+
* [length] data
|
|
35
|
+
*/
|
|
36
|
+
serialize() {
|
|
37
|
+
const writer = new bufio_1.BufferWriter();
|
|
38
|
+
writer.writeVarInt(this.data.length);
|
|
39
|
+
writer.writeBytes(this.data);
|
|
40
|
+
return writer.toBuffer();
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Returns the string of a piece of witness data
|
|
44
|
+
*/
|
|
45
|
+
toString() {
|
|
46
|
+
return this.data.toString('hex');
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Returns the string of a piece of witness data
|
|
50
|
+
*/
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
52
|
+
toJSON() {
|
|
53
|
+
return this.toString();
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Clone via deep copy
|
|
57
|
+
*/
|
|
58
|
+
clone() {
|
|
59
|
+
return new Witness(Buffer.from(this.data));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.Witness = Witness;
|
|
63
|
+
//# sourceMappingURL=Witness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.js","sourceRoot":"","sources":["../lib/Witness.ts"],"names":[],"mappings":";;;AAAA,2CAA6D;AAI7D;;;GAGG;AACH,MAAa,OAAO;IAClB;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,MAAoB;QACtC,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,OAAO,CAAC,GAAW;QAC/B,OAAO,OAAO,CAAC,KAAK,CAAC,oBAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,YAAqB,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAErC;;;;;OAKG;IACI,SAAS;QACd,MAAM,MAAM,GAAG,IAAI,oBAAY,EAAE,CAAC;QAClC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,6EAA6E;IACtE,MAAM;QACX,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,KAAK;QACV,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,CAAC;CACF;AAxDD,0BAwDC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export * from './Amount';
|
|
2
|
+
export * from './Base58';
|
|
3
|
+
export * from './Base58Check';
|
|
4
|
+
export * from './BitcoinError';
|
|
5
|
+
export * from './BitcoinErrorCode';
|
|
6
|
+
export * from './Block';
|
|
7
|
+
export * from './HashByteOrder';
|
|
8
|
+
export * from './HashValue';
|
|
9
|
+
export * from './ICloneable';
|
|
10
|
+
export * from './LexicographicalSorters';
|
|
11
|
+
export * from './LockTime';
|
|
12
|
+
export * from './OpCodes';
|
|
13
|
+
export * from './OutPoint';
|
|
14
|
+
export * from './Script';
|
|
15
|
+
export * from './ScriptCmd';
|
|
16
|
+
export * from './Sequence';
|
|
17
|
+
export * from './SigHashType';
|
|
18
|
+
export * from './SizeResult';
|
|
19
|
+
export * from './Sorter';
|
|
20
|
+
export * from './Stack';
|
|
21
|
+
export * from './TimeLockMode';
|
|
22
|
+
export * from './Tx';
|
|
23
|
+
export * from './TxBuilder';
|
|
24
|
+
export * from './TxIn';
|
|
25
|
+
export * from './TxOut';
|
|
26
|
+
export * from './Value';
|
|
27
|
+
export * from './Wif';
|
|
28
|
+
export * from './Witness';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Amount"), exports);
|
|
18
|
+
__exportStar(require("./Base58"), exports);
|
|
19
|
+
__exportStar(require("./Base58Check"), exports);
|
|
20
|
+
__exportStar(require("./BitcoinError"), exports);
|
|
21
|
+
__exportStar(require("./BitcoinErrorCode"), exports);
|
|
22
|
+
__exportStar(require("./Block"), exports);
|
|
23
|
+
__exportStar(require("./HashByteOrder"), exports);
|
|
24
|
+
__exportStar(require("./HashValue"), exports);
|
|
25
|
+
__exportStar(require("./ICloneable"), exports);
|
|
26
|
+
__exportStar(require("./LexicographicalSorters"), exports);
|
|
27
|
+
__exportStar(require("./LockTime"), exports);
|
|
28
|
+
__exportStar(require("./OpCodes"), exports);
|
|
29
|
+
__exportStar(require("./OutPoint"), exports);
|
|
30
|
+
__exportStar(require("./Script"), exports);
|
|
31
|
+
__exportStar(require("./ScriptCmd"), exports);
|
|
32
|
+
__exportStar(require("./Sequence"), exports);
|
|
33
|
+
__exportStar(require("./SigHashType"), exports);
|
|
34
|
+
__exportStar(require("./SizeResult"), exports);
|
|
35
|
+
__exportStar(require("./Sorter"), exports);
|
|
36
|
+
__exportStar(require("./Stack"), exports);
|
|
37
|
+
__exportStar(require("./TimeLockMode"), exports);
|
|
38
|
+
__exportStar(require("./Tx"), exports);
|
|
39
|
+
__exportStar(require("./TxBuilder"), exports);
|
|
40
|
+
__exportStar(require("./TxIn"), exports);
|
|
41
|
+
__exportStar(require("./TxOut"), exports);
|
|
42
|
+
__exportStar(require("./Value"), exports);
|
|
43
|
+
__exportStar(require("./Wif"), exports);
|
|
44
|
+
__exportStar(require("./Witness"), exports);
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,gDAA8B;AAC9B,iDAA+B;AAC/B,qDAAmC;AACnC,0CAAwB;AACxB,kDAAgC;AAChC,8CAA4B;AAC5B,+CAA6B;AAC7B,2DAAyC;AACzC,6CAA2B;AAC3B,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,8CAA4B;AAC5B,6CAA2B;AAC3B,gDAA8B;AAC9B,+CAA6B;AAC7B,2CAAyB;AACzB,0CAAwB;AACxB,iDAA+B;AAC/B,uCAAqB;AACrB,8CAA4B;AAC5B,yCAAuB;AACvB,0CAAwB;AACxB,0CAAwB;AACxB,wCAAsB;AACtB,4CAA0B"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Value } from './Value';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents bitcoin amount that can be converted to or from multiple
|
|
5
|
+
* formats.
|
|
6
|
+
*
|
|
7
|
+
* The key difference between Amount and Value, is Amount can be negative
|
|
8
|
+
*
|
|
9
|
+
* Value should be used for Bitcoin transactions, Amount should only be used
|
|
10
|
+
* for UI display, i.e. PnL
|
|
11
|
+
*/
|
|
12
|
+
export class Amount extends Value {
|
|
13
|
+
/**
|
|
14
|
+
* Creates a value object from amount in bitcoin, eg: 1.12345678
|
|
15
|
+
* @param num
|
|
16
|
+
*/
|
|
17
|
+
public static fromBitcoin(num: number): Amount {
|
|
18
|
+
return Amount.fromSats(Math.round(num * 1e8));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Creates a value instance from value in satoshis where 1 satoshis
|
|
23
|
+
* equates to 0.00000001 bitcoin.
|
|
24
|
+
* @param num
|
|
25
|
+
*/
|
|
26
|
+
public static fromSats(num: bigint | number): Amount {
|
|
27
|
+
return new Amount(BigInt(num) * BigInt(1e12));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Creates a value instance from amount
|
|
32
|
+
* @param value
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
public static fromValue(value: Value): Amount {
|
|
36
|
+
return Amount.fromSats(value.sats);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Gets the value in bitcoin
|
|
41
|
+
*/
|
|
42
|
+
public get bitcoin(): number {
|
|
43
|
+
return Number(this.sats) / 1e8;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private constructor(picoSats: bigint) {
|
|
47
|
+
super(picoSats);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Modifies the current instance by subtracting the other value
|
|
52
|
+
* from our existing value. Since Amount is signed, the value can
|
|
53
|
+
* be less than zero.
|
|
54
|
+
* @param other
|
|
55
|
+
*/
|
|
56
|
+
public sub(other: Value): this {
|
|
57
|
+
this._picoSats -= other.psats;
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Subtracts supplied value from the current value and returns a new
|
|
63
|
+
* value instance. Since Amount is signed, the value can
|
|
64
|
+
* be less than zero.
|
|
65
|
+
* @param other
|
|
66
|
+
*/
|
|
67
|
+
public subn(other: Value): Amount {
|
|
68
|
+
return new Amount(this._picoSats - other.psats);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { bigToBufBE } from '@node-dlc/bufio';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns a tuple containing the quotient and remainder when the divident (num) is
|
|
5
|
+
* divided by the divisor (mod).
|
|
6
|
+
* @param num divident
|
|
7
|
+
* @param mod divisor
|
|
8
|
+
*/
|
|
9
|
+
export function divmod(num: bigint, mod: bigint): [bigint, bigint] {
|
|
10
|
+
return [num / mod, num % mod];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Base58 encoding and decoding utility
|
|
15
|
+
*/
|
|
16
|
+
export class Base58 {
|
|
17
|
+
public static alphabet =
|
|
18
|
+
'123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Encodes a buffer into a base58 string
|
|
22
|
+
*/
|
|
23
|
+
public static encode(buf: Buffer): string {
|
|
24
|
+
let n = BigInt('0x' + buf.toString('hex'));
|
|
25
|
+
|
|
26
|
+
// encode into base58
|
|
27
|
+
let str = '';
|
|
28
|
+
while (n > BigInt(0)) {
|
|
29
|
+
const mod = n % BigInt(58);
|
|
30
|
+
str = Base58.alphabet[Number(mod)] + str;
|
|
31
|
+
n = n / BigInt(58);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// add leading zeros
|
|
35
|
+
for (const val of buf) {
|
|
36
|
+
if (val !== 0) break;
|
|
37
|
+
str = '1' + str;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return str;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Decodes the base58 string into a buffer
|
|
45
|
+
*/
|
|
46
|
+
public static decode(str: string): Buffer {
|
|
47
|
+
// determine leading zero bytes which will be prepended
|
|
48
|
+
let prefix = 0;
|
|
49
|
+
for (let i = 0; i < str.length; i++) {
|
|
50
|
+
if (str[i] === '1') prefix += 1;
|
|
51
|
+
else break;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// decode from base58
|
|
55
|
+
let n = BigInt(0);
|
|
56
|
+
for (const char of str) {
|
|
57
|
+
n *= BigInt(58);
|
|
58
|
+
n += BigInt(Base58.alphabet.indexOf(char));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return Buffer.concat([Buffer.alloc(prefix), bigToBufBE(n)]);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { hash256 } from '@node-dlc/crypto';
|
|
2
|
+
|
|
3
|
+
import { Base58 } from './Base58';
|
|
4
|
+
import { BitcoinError } from './BitcoinError';
|
|
5
|
+
import { BitcoinErrorCode } from './BitcoinErrorCode';
|
|
6
|
+
|
|
7
|
+
export class Base58Check {
|
|
8
|
+
/**
|
|
9
|
+
* Perform a base58 encoding by appends a 4-byte hash256 checksum
|
|
10
|
+
* at the end of the value.
|
|
11
|
+
* @param buf
|
|
12
|
+
*/
|
|
13
|
+
public static encode(buf: Buffer): string {
|
|
14
|
+
return Base58.encode(Buffer.concat([buf, hash256(buf).slice(0, 4)]));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Decodes a base58 check value. Throws error if checksum is invalid
|
|
19
|
+
* @param buf
|
|
20
|
+
*/
|
|
21
|
+
public static decode(input: string): Buffer {
|
|
22
|
+
const total = Base58.decode(input);
|
|
23
|
+
const data = total.slice(0, total.length - 4);
|
|
24
|
+
const checksum = total.slice(total.length - 4);
|
|
25
|
+
const hash = hash256(data).slice(0, 4);
|
|
26
|
+
if (!hash.equals(checksum)) {
|
|
27
|
+
throw new BitcoinError(BitcoinErrorCode.Base58ChecksumFailed, {
|
|
28
|
+
actual: hash,
|
|
29
|
+
expected: checksum,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return data;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BitcoinErrorCode } from './BitcoinErrorCode';
|
|
2
|
+
|
|
3
|
+
function getMessage(code: BitcoinErrorCode) {
|
|
4
|
+
switch (code) {
|
|
5
|
+
case BitcoinErrorCode.Base58ChecksumFailed:
|
|
6
|
+
return 'Base58Check checksum failed';
|
|
7
|
+
case BitcoinErrorCode.PubKeyInvalid:
|
|
8
|
+
return 'Invalid pubkey';
|
|
9
|
+
case BitcoinErrorCode.PubKeyHashInvalid:
|
|
10
|
+
return 'Invalid pubkeyhash';
|
|
11
|
+
case BitcoinErrorCode.SigEncodingInvalid:
|
|
12
|
+
return 'Signatures requires BIP66 DER encoding';
|
|
13
|
+
case BitcoinErrorCode.SigHashTypeInvalid:
|
|
14
|
+
return 'Invalid Signature SIGHASH type';
|
|
15
|
+
case BitcoinErrorCode.MultiSigSetupInvalid:
|
|
16
|
+
return 'MultiSig structure is invalid';
|
|
17
|
+
case BitcoinErrorCode.Hash160Invalid:
|
|
18
|
+
return 'Hash160 requires 20-byte Buffer';
|
|
19
|
+
case BitcoinErrorCode.Hash256Invalid:
|
|
20
|
+
return 'return Hash256 requires 32-byte Buffer';
|
|
21
|
+
default:
|
|
22
|
+
return 'Unknown';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class BitcoinError extends Error {
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
|
28
|
+
constructor(readonly code: BitcoinErrorCode, readonly data?: any) {
|
|
29
|
+
super(getMessage(code));
|
|
30
|
+
}
|
|
31
|
+
}
|