@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,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Sequence = void 0;
|
|
4
|
+
const TimeLockMode_1 = require("./TimeLockMode");
|
|
5
|
+
const MAX_SEQUENCE = 4294967295;
|
|
6
|
+
const DEFAULT_SEQUENCE = 4294967295;
|
|
7
|
+
/**
|
|
8
|
+
* A transaction input's nSequence field according to BIP 68 where
|
|
9
|
+
* rules for relative timelocks are defined. Relative timelocks prevent
|
|
10
|
+
* mining of a transaction until a certain age of the spent output
|
|
11
|
+
* in blocks or timespan.
|
|
12
|
+
*
|
|
13
|
+
* nSequence defaults to a value of 0xffff_ffff which disables the field.
|
|
14
|
+
* When using a nLocktime, at least one transaction must be non-default.
|
|
15
|
+
* In this condition, it is standard to use 0xffff_fffe.
|
|
16
|
+
*/
|
|
17
|
+
class Sequence {
|
|
18
|
+
/**
|
|
19
|
+
* Parses the value from a byte stream
|
|
20
|
+
* @param reader
|
|
21
|
+
*/
|
|
22
|
+
static parse(reader) {
|
|
23
|
+
return new Sequence(reader.readUInt32LE());
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates an nSequence value of 0xffff_fffe which is used to enable
|
|
27
|
+
* nLockTime.
|
|
28
|
+
*/
|
|
29
|
+
static locktime() {
|
|
30
|
+
return new Sequence(4294967294);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Creates an nSequence value of 0xffff_fffd which is used to
|
|
34
|
+
* enable opt-in full replace-by-fee.
|
|
35
|
+
*/
|
|
36
|
+
static rbf() {
|
|
37
|
+
return new Sequence(4294967293);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Creates an nSequence value of 0xffff_ffff
|
|
41
|
+
*/
|
|
42
|
+
static default() {
|
|
43
|
+
return new Sequence();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Creates an nSequence value of 0
|
|
47
|
+
*/
|
|
48
|
+
static zero() {
|
|
49
|
+
return new Sequence(0);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Creates an nSequence value with the specified block delay
|
|
53
|
+
* @param blocks number of blocks sequence must wait
|
|
54
|
+
*/
|
|
55
|
+
static blockDelay(blocks) {
|
|
56
|
+
const sut = new Sequence();
|
|
57
|
+
sut.blockDelay = blocks;
|
|
58
|
+
return sut;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Creates an nSequence value with the specified time delay
|
|
62
|
+
* @param seconds delay in seconds which will be rounded up to the
|
|
63
|
+
* nearest 512 second interval
|
|
64
|
+
*/
|
|
65
|
+
static timeDelay(seconds) {
|
|
66
|
+
const sut = new Sequence();
|
|
67
|
+
sut.timeDelay = seconds;
|
|
68
|
+
return sut;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Gets or sets the raw nSequence value.
|
|
72
|
+
*/
|
|
73
|
+
get value() {
|
|
74
|
+
return this._value;
|
|
75
|
+
}
|
|
76
|
+
set value(val) {
|
|
77
|
+
if (val < 0 || val > MAX_SEQUENCE)
|
|
78
|
+
throw new Error('Invalid nSequence');
|
|
79
|
+
this._value = val;
|
|
80
|
+
}
|
|
81
|
+
constructor(val = DEFAULT_SEQUENCE) {
|
|
82
|
+
this.value = val;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Returns true when the nSequence is the default value 0xffff_ffff
|
|
86
|
+
*/
|
|
87
|
+
get isDefault() {
|
|
88
|
+
return this.value === DEFAULT_SEQUENCE;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns true when the relative timelock is enabled. Technically
|
|
92
|
+
* this occurs when the top-most bit is unset. This means that the
|
|
93
|
+
* default value of 0xffff_ffff is unset.
|
|
94
|
+
*/
|
|
95
|
+
get enabled() {
|
|
96
|
+
return BigInt(this.value) >> BigInt(31) === BigInt(0);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Returns true for a value that would enable nLockTime. To enable
|
|
100
|
+
* nLockTime, at least one input in the transaction must have a
|
|
101
|
+
* non-default nSequence value.
|
|
102
|
+
*/
|
|
103
|
+
get isLockTimeSignaled() {
|
|
104
|
+
return this.value < DEFAULT_SEQUENCE;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Returns true for a value that would signal opt-in replace-by-fee
|
|
108
|
+
* as defined in BIP 125. To signal this, the nSequence must be less
|
|
109
|
+
* than 0xffffffff-1.
|
|
110
|
+
*/
|
|
111
|
+
get isRBFSignaled() {
|
|
112
|
+
return this.value < DEFAULT_SEQUENCE - 1;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Gets the time lock mode for the nSequence. Technically, the bit
|
|
116
|
+
* with index 22 controls the mode. When the bit is set, it will use
|
|
117
|
+
* time-based relative time locks. When it is unset, it will use
|
|
118
|
+
* block-based relatively time locks.
|
|
119
|
+
*/
|
|
120
|
+
get mode() {
|
|
121
|
+
if (this.value >> 22 === 1)
|
|
122
|
+
return TimeLockMode_1.TimeLockMode.Time;
|
|
123
|
+
else
|
|
124
|
+
return TimeLockMode_1.TimeLockMode.Block;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Gets or sets a relative timelock in seconds. Time-based relative
|
|
128
|
+
* time locks are encoded in 512 second granularity which is close
|
|
129
|
+
* to the 600 seconds each block should be generated in. When
|
|
130
|
+
* setting a value in seconds, it will rounded up to the nearest
|
|
131
|
+
* 512s granularity.
|
|
132
|
+
*/
|
|
133
|
+
get timeDelay() {
|
|
134
|
+
return (this.value & 0xffff) * 512;
|
|
135
|
+
}
|
|
136
|
+
set timeDelay(seconds) {
|
|
137
|
+
// calculate the delay in 512 second granularity
|
|
138
|
+
let value = Math.ceil(seconds / 512);
|
|
139
|
+
// if the value execeeds the max value, throw an error
|
|
140
|
+
if (value < 0 || value > 0xffff)
|
|
141
|
+
throw new Error('Invalid nSequence value');
|
|
142
|
+
// set the typeto time-based relatively timelock
|
|
143
|
+
value |= 1 << 22;
|
|
144
|
+
// set the actual value
|
|
145
|
+
this.value = value;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Gets or set a relative timelock in blocks.
|
|
149
|
+
*/
|
|
150
|
+
get blockDelay() {
|
|
151
|
+
return this.value & 0xffff;
|
|
152
|
+
}
|
|
153
|
+
set blockDelay(blocks) {
|
|
154
|
+
// if the value exceeds the max value, throw an error
|
|
155
|
+
if (blocks < 0 || blocks > 0xffff)
|
|
156
|
+
throw new Error('Invalid nSequence value');
|
|
157
|
+
this.value = blocks;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Serializes the value to a buffer
|
|
161
|
+
*/
|
|
162
|
+
serialize() {
|
|
163
|
+
const buf = Buffer.alloc(4);
|
|
164
|
+
buf.writeUInt32LE(this.value, 0);
|
|
165
|
+
return buf;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Returns the raw value as a hex encoded string, eg: 0xfffffffe
|
|
169
|
+
*/
|
|
170
|
+
toString() {
|
|
171
|
+
return '0x' + this.value.toString(16).padStart(8, '0');
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Returns the raw value as a hex encoded string, eg: 0xfffffffe
|
|
175
|
+
*/
|
|
176
|
+
toJSON() {
|
|
177
|
+
return this.toString();
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Clone via deep copy
|
|
181
|
+
*/
|
|
182
|
+
clone() {
|
|
183
|
+
return new Sequence(this._value);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
exports.Sequence = Sequence;
|
|
187
|
+
//# sourceMappingURL=Sequence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sequence.js","sourceRoot":"","sources":["../lib/Sequence.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSigHashTypeValid = exports.SigHashType = void 0;
|
|
4
|
+
var SigHashType;
|
|
5
|
+
(function (SigHashType) {
|
|
6
|
+
SigHashType[SigHashType["SIGHASH_ALL"] = 1] = "SIGHASH_ALL";
|
|
7
|
+
SigHashType[SigHashType["SIGHASH_NONE"] = 2] = "SIGHASH_NONE";
|
|
8
|
+
SigHashType[SigHashType["SIGHASH_SINGLE"] = 3] = "SIGHASH_SINGLE";
|
|
9
|
+
SigHashType[SigHashType["SIGHASH_ANYONECANPAY"] = 128] = "SIGHASH_ANYONECANPAY";
|
|
10
|
+
})(SigHashType = exports.SigHashType || (exports.SigHashType = {}));
|
|
11
|
+
function isSigHashTypeValid(type) {
|
|
12
|
+
if (type === SigHashType.SIGHASH_ALL)
|
|
13
|
+
return true;
|
|
14
|
+
if (type === SigHashType.SIGHASH_NONE)
|
|
15
|
+
return true;
|
|
16
|
+
if (type === SigHashType.SIGHASH_SINGLE)
|
|
17
|
+
return true;
|
|
18
|
+
if (type === (SigHashType.SIGHASH_ALL | SigHashType.SIGHASH_ANYONECANPAY))
|
|
19
|
+
return true;
|
|
20
|
+
if (type === (SigHashType.SIGHASH_NONE | SigHashType.SIGHASH_ANYONECANPAY))
|
|
21
|
+
return true;
|
|
22
|
+
if (type === (SigHashType.SIGHASH_SINGLE | SigHashType.SIGHASH_ANYONECANPAY))
|
|
23
|
+
return true;
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
exports.isSigHashTypeValid = isSigHashTypeValid;
|
|
27
|
+
//# sourceMappingURL=SigHashType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SigHashType.js","sourceRoot":"","sources":["../lib/SigHashType.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,2DAAkB,CAAA;IAClB,6DAAmB,CAAA;IACnB,iEAAqB,CAAA;IACrB,+EAA2B,CAAA;AAC7B,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAED,SAAgB,kBAAkB,CAAC,IAAiB;IAClD,IAAI,IAAI,KAAK,WAAW,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAClD,IAAI,IAAI,KAAK,WAAW,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IACnD,IAAI,IAAI,KAAK,WAAW,CAAC,cAAc;QAAE,OAAO,IAAI,CAAC;IACrD,IAAI,IAAI,KAAK,CAAC,WAAW,CAAC,WAAW,GAAG,WAAW,CAAC,oBAAoB,CAAC;QACvE,OAAO,IAAI,CAAC;IACd,IAAI,IAAI,KAAK,CAAC,WAAW,CAAC,YAAY,GAAG,WAAW,CAAC,oBAAoB,CAAC;QACxE,OAAO,IAAI,CAAC;IACd,IAAI,IAAI,KAAK,CAAC,WAAW,CAAC,cAAc,GAAG,WAAW,CAAC,oBAAoB,CAAC;QAC1E,OAAO,IAAI,CAAC;IACd,OAAO,KAAK,CAAC;AACf,CAAC;AAXD,gDAWC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SizeResult.js","sourceRoot":"","sources":["../lib/SizeResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Sorter<T> = (a: T, b: T) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sorter.js","sourceRoot":"","sources":["../lib/Sorter.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare class Stack {
|
|
3
|
+
/**
|
|
4
|
+
* Decodes a number from the stack format (signed magnitude
|
|
5
|
+
* representation).
|
|
6
|
+
* @param buf
|
|
7
|
+
*/
|
|
8
|
+
static decodeNum(buf: Buffer): bigint;
|
|
9
|
+
/**
|
|
10
|
+
* Encodes a number into a stack compatible byte-array. The number
|
|
11
|
+
* is encoded using little-endian signed-magnitude representation.
|
|
12
|
+
* @param num
|
|
13
|
+
*/
|
|
14
|
+
static encodeNum(input: number | bigint): Buffer;
|
|
15
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Stack = void 0;
|
|
4
|
+
class Stack {
|
|
5
|
+
/**
|
|
6
|
+
* Decodes a number from the stack format (signed magnitude
|
|
7
|
+
* representation).
|
|
8
|
+
* @param buf
|
|
9
|
+
*/
|
|
10
|
+
static decodeNum(buf) {
|
|
11
|
+
let result = BigInt(0);
|
|
12
|
+
if (buf.length === 0) {
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
// convert little-endian number to big-endian which swaps around the bytes
|
|
16
|
+
// that occurred during encoding making the negative flag be in the first
|
|
17
|
+
// byte
|
|
18
|
+
const be = Buffer.from(buf).reverse();
|
|
19
|
+
// check if the number is negative, which occurs when the 0x80 bit is set
|
|
20
|
+
// on the first number
|
|
21
|
+
let neg = false;
|
|
22
|
+
if (be[0] & 0x80) {
|
|
23
|
+
neg = true;
|
|
24
|
+
be[0] = be[0] & 0x7f; // remove the 0x80 bit
|
|
25
|
+
}
|
|
26
|
+
// set result to MSB
|
|
27
|
+
result = BigInt(be[0]);
|
|
28
|
+
// read each byte off the buffer
|
|
29
|
+
for (let i = 1; i < be.length; i++) {
|
|
30
|
+
result <<= BigInt(8); // shift right 1-byte
|
|
31
|
+
result += BigInt(be[i]);
|
|
32
|
+
}
|
|
33
|
+
if (neg) {
|
|
34
|
+
return -result;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Encodes a number into a stack compatible byte-array. The number
|
|
42
|
+
* is encoded using little-endian signed-magnitude representation.
|
|
43
|
+
* @param num
|
|
44
|
+
*/
|
|
45
|
+
static encodeNum(input) {
|
|
46
|
+
const num = BigInt(input);
|
|
47
|
+
const bytes = [];
|
|
48
|
+
const neg = num < 0;
|
|
49
|
+
let abs = num > 0 ? num : -num;
|
|
50
|
+
// push each byte starting with the smallest
|
|
51
|
+
while (abs > 0) {
|
|
52
|
+
bytes.push(Number(abs & BigInt(0xff))); // push on smallest byte
|
|
53
|
+
abs >>= BigInt(8); // shift off smallest byte
|
|
54
|
+
}
|
|
55
|
+
// check if the last byte has the 0x80 bit set if so, then we either push
|
|
56
|
+
// a 0 or 0x80 if it is postive or negative
|
|
57
|
+
if (bytes[bytes.length - 1] & 0x80) {
|
|
58
|
+
if (neg) {
|
|
59
|
+
bytes.push(0x80);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
bytes.push(0x00);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// if the number is negative we set the 0x80 bit for the number to indicate
|
|
66
|
+
// it is negative
|
|
67
|
+
else {
|
|
68
|
+
if (neg) {
|
|
69
|
+
bytes[bytes.length - 1] |= 0x80;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// return a buffer of the number
|
|
73
|
+
return Buffer.from(bytes);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.Stack = Stack;
|
|
77
|
+
//# sourceMappingURL=Stack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.js","sourceRoot":"","sources":["../lib/Stack.ts"],"names":[],"mappings":";;;AAAA,MAAa,KAAK;IAChB;;;;OAIG;IACI,MAAM,CAAC,SAAS,CAAC,GAAW;QACjC,IAAI,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;YACpB,OAAO,MAAM,CAAC;SACf;QAED,0EAA0E;QAC1E,yEAAyE;QACzE,OAAO;QACP,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;QAEtC,yEAAyE;QACzE,sBAAsB;QACtB,IAAI,GAAG,GAAG,KAAK,CAAC;QAChB,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE;YAChB,GAAG,GAAG,IAAI,CAAC;YACX,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,sBAAsB;SAC7C;QAED,oBAAoB;QACpB,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAEvB,gCAAgC;QAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAClC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB;YAC3C,MAAM,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;SACzB;QAED,IAAI,GAAG,EAAE;YACP,OAAO,CAAC,MAAM,CAAC;SAChB;aAAM;YACL,OAAO,MAAM,CAAC;SACf;IACH,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,SAAS,CAAC,KAAsB;QAC5C,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAE1B,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;QACpB,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QAE/B,4CAA4C;QAC5C,OAAO,GAAG,GAAG,CAAC,EAAE;YACd,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,wBAAwB;YAChE,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,0BAA0B;SAC9C;QAED,yEAAyE;QACzE,2CAA2C;QAC3C,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE;YAClC,IAAI,GAAG,EAAE;gBACP,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAClB;iBAAM;gBACL,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAClB;SACF;QAED,2EAA2E;QAC3E,iBAAiB;aACZ;YACH,IAAI,GAAG,EAAE;gBACP,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;aACjC;SACF;QAED,gCAAgC;QAChC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;CACF;AAhFD,sBAgFC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Specifies what a time lock is based on. Currently this can either be
|
|
3
|
+
* a block-based or timestamp-based time lock and is used for absolute
|
|
4
|
+
* time locks (nLocktime) or relative time locks (nSequence).
|
|
5
|
+
*/
|
|
6
|
+
export declare enum TimeLockMode {
|
|
7
|
+
/**
|
|
8
|
+
* Block height based time lock
|
|
9
|
+
*/
|
|
10
|
+
Block = 0,
|
|
11
|
+
/**
|
|
12
|
+
* Unix timestamps based time lock
|
|
13
|
+
*/
|
|
14
|
+
Time = 1
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimeLockMode = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Specifies what a time lock is based on. Currently this can either be
|
|
6
|
+
* a block-based or timestamp-based time lock and is used for absolute
|
|
7
|
+
* time locks (nLocktime) or relative time locks (nSequence).
|
|
8
|
+
*/
|
|
9
|
+
var TimeLockMode;
|
|
10
|
+
(function (TimeLockMode) {
|
|
11
|
+
/**
|
|
12
|
+
* Block height based time lock
|
|
13
|
+
*/
|
|
14
|
+
TimeLockMode[TimeLockMode["Block"] = 0] = "Block";
|
|
15
|
+
/**
|
|
16
|
+
* Unix timestamps based time lock
|
|
17
|
+
*/
|
|
18
|
+
TimeLockMode[TimeLockMode["Time"] = 1] = "Time";
|
|
19
|
+
})(TimeLockMode = exports.TimeLockMode || (exports.TimeLockMode = {}));
|
|
20
|
+
//# sourceMappingURL=TimeLockMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeLockMode.js","sourceRoot":"","sources":["../lib/TimeLockMode.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,YAUX;AAVD,WAAY,YAAY;IACtB;;OAEG;IACH,iDAAK,CAAA;IAEL;;OAEG;IACH,+CAAI,CAAA;AACN,CAAC,EAVW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAUvB"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { StreamReader } from '@node-dlc/bufio';
|
|
3
|
+
import { HashValue } from './HashValue';
|
|
4
|
+
import { LockTime } from './LockTime';
|
|
5
|
+
import { SizeResult } from './SizeResult';
|
|
6
|
+
import { TxIn } from './TxIn';
|
|
7
|
+
import { TxOut } from './TxOut';
|
|
8
|
+
/**
|
|
9
|
+
* This class is an immutable Bitcoin transaction. This class is used
|
|
10
|
+
* as a data container from parsed blocks, RPC, or other sources. To use
|
|
11
|
+
* a mutable transaction, you should use `TxBuilder` class.
|
|
12
|
+
*/
|
|
13
|
+
export declare class Tx {
|
|
14
|
+
/**
|
|
15
|
+
* Decodes a `Tx` stream similar to Bitcoin Core's DecodeTx method
|
|
16
|
+
* in that it will first try to parse with SegWit markers enabled.
|
|
17
|
+
* If there is an error (such as with a base transaction with no
|
|
18
|
+
* inputs), then it will try parsing using the legacy method.
|
|
19
|
+
* @param reader
|
|
20
|
+
*/
|
|
21
|
+
static decode(reader: StreamReader): Tx;
|
|
22
|
+
/**
|
|
23
|
+
* Parses a transaction from its byte format in a stream. Capable of
|
|
24
|
+
* parsing both legacy and segwit transactions. This method is
|
|
25
|
+
* similar to Bitcoin Core's `UnserializeTransaction` on the
|
|
26
|
+
* `Transaction` type. This method is expected to throw if witness
|
|
27
|
+
* is enabled and we have an ambiguous base transaction (zero inputs).
|
|
28
|
+
* @param reader
|
|
29
|
+
*/
|
|
30
|
+
private static parse;
|
|
31
|
+
/**
|
|
32
|
+
* Parses the inputs for a transaction
|
|
33
|
+
* @param reader
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
private static parseInputs;
|
|
37
|
+
/**
|
|
38
|
+
* Parses the outputs for a transaction
|
|
39
|
+
* @param reader
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
private static parseOutputs;
|
|
43
|
+
/**
|
|
44
|
+
* Parses a transaction from a buffer that contains the fully
|
|
45
|
+
* serialization transaction bytes.
|
|
46
|
+
* @param buf
|
|
47
|
+
*/
|
|
48
|
+
static fromBuffer(buf: Buffer): Tx;
|
|
49
|
+
/**
|
|
50
|
+
* Parses a transaction from a hex string containing the fully
|
|
51
|
+
* serialized transaction bytes.
|
|
52
|
+
* @param hex
|
|
53
|
+
*/
|
|
54
|
+
static fromHex(hex: string): Tx;
|
|
55
|
+
/**
|
|
56
|
+
* Get the transaction version. The transaction version corresponds
|
|
57
|
+
* to features that are enabled for the transaction such as time
|
|
58
|
+
* locks.
|
|
59
|
+
*/
|
|
60
|
+
get version(): number;
|
|
61
|
+
/**
|
|
62
|
+
* Gets the transaction identifier. The `txId` for both legacy and
|
|
63
|
+
* segwit transaction is the hash256 of
|
|
64
|
+
* `hash256(version||inputs||ouputs||locktime)`.
|
|
65
|
+
*/
|
|
66
|
+
get txId(): HashValue;
|
|
67
|
+
/**
|
|
68
|
+
* Gets the transaction segwit transaction identifier. For legacy
|
|
69
|
+
* transaction this is the same as the `txId` property. For segwit
|
|
70
|
+
* transaction this is the hash256 of
|
|
71
|
+
* `hash256(version||0x0001||inputs||outputs||witness||locktime)`.
|
|
72
|
+
*
|
|
73
|
+
* This is the same value as the `hash` property in bitcoind RPC
|
|
74
|
+
* results.
|
|
75
|
+
*/
|
|
76
|
+
get witnessTxId(): HashValue;
|
|
77
|
+
/**
|
|
78
|
+
* Gets the transaction inputs.
|
|
79
|
+
*/
|
|
80
|
+
get inputs(): TxIn[];
|
|
81
|
+
/**
|
|
82
|
+
* Gets the transaction outputs
|
|
83
|
+
*/
|
|
84
|
+
get outputs(): TxOut[];
|
|
85
|
+
/**
|
|
86
|
+
* Gets the transaction `nLocktime` value that is used to control
|
|
87
|
+
* absolute timelocks.
|
|
88
|
+
*/
|
|
89
|
+
get locktime(): LockTime;
|
|
90
|
+
get isSegWit(): boolean;
|
|
91
|
+
get size(): number;
|
|
92
|
+
get vsize(): number;
|
|
93
|
+
get weight(): number;
|
|
94
|
+
private _version;
|
|
95
|
+
private _txId;
|
|
96
|
+
private _wtxid;
|
|
97
|
+
private _inputs;
|
|
98
|
+
private _outputs;
|
|
99
|
+
private _locktime;
|
|
100
|
+
private _sizes;
|
|
101
|
+
constructor(version?: number, inputs?: TxIn[], outputs?: TxOut[], locktime?: LockTime, sizes?: SizeResult);
|
|
102
|
+
/**
|
|
103
|
+
* Serializes legacy or segwit transactions into a Buffer
|
|
104
|
+
*/
|
|
105
|
+
serialize(): Buffer;
|
|
106
|
+
toJSON(): {
|
|
107
|
+
version: number;
|
|
108
|
+
inputs: {
|
|
109
|
+
outpoint: {
|
|
110
|
+
txid: string;
|
|
111
|
+
index: number;
|
|
112
|
+
};
|
|
113
|
+
scriptSig: string;
|
|
114
|
+
sequence: string;
|
|
115
|
+
}[];
|
|
116
|
+
outputs: {
|
|
117
|
+
value: string;
|
|
118
|
+
scriptPubKey: string;
|
|
119
|
+
}[];
|
|
120
|
+
locktime: number;
|
|
121
|
+
};
|
|
122
|
+
toHex(pretty?: boolean): string;
|
|
123
|
+
private _prettyHex;
|
|
124
|
+
private _serializeLegacy;
|
|
125
|
+
private _serializeSegWit;
|
|
126
|
+
/**
|
|
127
|
+
* Decodes the txId and hash from the Buffer.
|
|
128
|
+
*
|
|
129
|
+
* For non-segwit transitions, the hash value is the double-sha256 of
|
|
130
|
+
* version|vins|vouts|locktime. The txid is the reverse of the hash.
|
|
131
|
+
*
|
|
132
|
+
* For segwit transactions, the hash value is returned as the wtxid as
|
|
133
|
+
* calculated by the double-sha256 of
|
|
134
|
+
* version|0x00|0x01|inputs|outputs|witness|locktime. The txId is
|
|
135
|
+
* calculate the same as legacy transactions by performing a double
|
|
136
|
+
* sha256 hash of the data minus segwit data and markers.
|
|
137
|
+
*/
|
|
138
|
+
private _calcTxId;
|
|
139
|
+
/**
|
|
140
|
+
* Calculates the size, virtual size, and weight properties from the
|
|
141
|
+
* based on the current inputs and outputs.
|
|
142
|
+
*
|
|
143
|
+
* `size` is the number of raw bytes.
|
|
144
|
+
* `weight` is the number of witness bytes + the number of non-witness
|
|
145
|
+
* bytes multiplied by four.
|
|
146
|
+
* `vsize` is the weight divided by four.
|
|
147
|
+
*/
|
|
148
|
+
private _calcSize;
|
|
149
|
+
private _lazyCalc;
|
|
150
|
+
}
|