@atomicfinance/bitcoin-dlc-provider 3.6.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nvmrc +1 -1
- package/.turbo/turbo-build.log +1 -0
- package/.turbo/turbo-test.log +0 -0
- package/.yalc/@node-dlc/messaging/.nyc_output/2cf48009-1094-4275-bb91-c164c932feb6.json +1 -0
- package/.yalc/@node-dlc/messaging/.nyc_output/processinfo/2cf48009-1094-4275-bb91-c164c932feb6.json +1 -0
- package/.yalc/@node-dlc/messaging/.nyc_output/processinfo/index.json +1 -0
- package/.yalc/@node-dlc/messaging/README.md +24 -0
- package/.yalc/@node-dlc/messaging/__tests__/_test-utils.ts +12 -0
- package/.yalc/@node-dlc/messaging/__tests__/chain/ChainManager.spec.ts +178 -0
- package/.yalc/@node-dlc/messaging/__tests__/compatibility/dlcspecs-compatibility.spec.ts +473 -0
- package/.yalc/@node-dlc/messaging/__tests__/compatibility/rust-dlc-cross-language.spec.ts +342 -0
- package/.yalc/@node-dlc/messaging/__tests__/compatibility/true-serialization-compatibility.spec.ts +611 -0
- package/.yalc/@node-dlc/messaging/__tests__/dlc_message_test.json +155 -0
- package/.yalc/@node-dlc/messaging/__tests__/irc/IrcMessage.spec.ts +94 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/AddressCache.spec.ts +79 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/BatchFundingGroup.spec.ts +72 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/CetAdaptorSignatures.spec.ts +57 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/ContractDescriptor.spec.ts +264 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/ContractInfo.spec.ts +419 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/DigitDecompositionEventDescriptor.spec.ts +59 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/DlcAccept.spec.ts +242 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/DlcCancel.spec.ts +42 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/DlcClose.spec.ts +315 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/DlcOffer.spec.ts +527 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/DlcSign.spec.ts +118 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/DlcTransactions.spec.ts +157 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/EnumEventDescriptor.spec.ts +50 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/EventDescriptor.spec.ts +93 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/FundingInput.spec.ts +84 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/FundingSignatures.spec.ts +83 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/NegotiationFields.spec.ts +328 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/NodeAnnouncementMessage.spec.ts +115 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/OracleAnnouncement.spec.ts +415 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/OracleAttestation.spec.ts +326 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/OracleEvent.spec.ts +143 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/OracleEventContainer.spec.ts +95 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/OracleIdentifier.spec.ts +48 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/OracleInfo.spec.ts +116 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/OrderAccept.spec.ts +77 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/OrderNegotiationFields.spec.ts +216 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/OrderOffer.spec.ts +121 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/OrderPositionInfo.spec.ts +75 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/PayoutCurvePiece.spec.ts +220 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/PayoutFunction.spec.ts +101 -0
- package/.yalc/@node-dlc/messaging/__tests__/messages/RoundingIntervals.spec.ts +75 -0
- package/.yalc/@node-dlc/messaging/__tests__/serialize/F64.spec.ts +260 -0
- package/.yalc/@node-dlc/messaging/__tests__/tsconfig.json +8 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/base.css +224 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/block-navigation.js +79 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/favicon.png +0 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/index.html +201 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/MessageType.ts.html +494 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/chain/ChainManager.ts.html +1058 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/chain/ChainMemoryStore.ts.html +182 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/chain/index.html +126 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/domain/Address.ts.html +272 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/domain/index.html +111 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/index.html +141 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/index.ts.html +212 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/irc/IrcMessage.ts.html +563 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/irc/index.html +111 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/AddressCache.ts.html +302 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/BatchFundingGroup.ts.html +503 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/CetAdaptorSignatures.ts.html +347 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/CetAdaptorSignaturesV0.ts.html +347 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/ContractDescriptor.ts.html +1040 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/ContractInfo.ts.html +1382 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcAccept.ts.html +1865 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcCancel.ts.html +251 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcClose.ts.html +986 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcCloseMetadata.ts.html +443 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcIds.ts.html +281 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcInfo.ts.html +323 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcMessage.ts.html +341 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcOffer.ts.html +1895 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcSign.ts.html +1142 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcTransactions.ts.html +719 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/EventDescriptor.ts.html +947 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/FundingInput.ts.html +728 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/FundingSignatures.ts.html +374 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/FundingSignaturesV0.ts.html +374 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/NegotiationFields.ts.html +836 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/NodeAnnouncementMessage.ts.html +515 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleAnnouncement.ts.html +608 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleAnnouncementV0.ts.html +605 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleAttestation.ts.html +956 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleAttestationV0.ts.html +770 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleEvent.ts.html +830 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleEventContainer.ts.html +347 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleEventContainerV0.ts.html +347 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleEventV0.ts.html +827 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleIdentifier.ts.html +314 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleIdentifierV0.ts.html +314 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleInfo.ts.html +1637 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleInfoV0.ts.html +1631 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderAccept.ts.html +557 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderIrcInfo.ts.html +380 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderMetadata.ts.html +437 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderNegotiationFields.ts.html +551 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderOffer.ts.html +1337 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderPositionInfo.ts.html +590 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/PayoutCurvePiece.ts.html +1427 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/PayoutFunction.ts.html +800 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/RoundingIntervals.ts.html +461 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/RoundingIntervalsV0.ts.html +482 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/ScriptWitnessV0.ts.html +269 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/index.html +636 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serde/SerdeUtils.ts.html +1394 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serde/index.html +111 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serialize/F64.ts.html +1136 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serialize/deserializeTlv.ts.html +125 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serialize/getTlv.ts.html +143 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serialize/index.html +141 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/util.ts.html +179 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/validation/index.html +111 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/validation/validate.ts.html +182 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/prettify.css +1 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/prettify.js +2 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov-report/sorter.js +170 -0
- package/.yalc/@node-dlc/messaging/coverage/lcov.info +5394 -0
- package/.yalc/@node-dlc/messaging/dist/MessageType.d.ts +100 -0
- package/.yalc/@node-dlc/messaging/dist/MessageType.js +117 -0
- package/.yalc/@node-dlc/messaging/dist/MessageType.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/chain/ChainManager.d.ts +50 -0
- package/.yalc/@node-dlc/messaging/dist/chain/ChainManager.js +211 -0
- package/.yalc/@node-dlc/messaging/dist/chain/ChainManager.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/chain/ChainMemoryStore.d.ts +14 -0
- package/.yalc/@node-dlc/messaging/dist/chain/ChainMemoryStore.js +28 -0
- package/.yalc/@node-dlc/messaging/dist/chain/ChainMemoryStore.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/chain/DlcStore.d.ts +11 -0
- package/.yalc/@node-dlc/messaging/dist/chain/DlcStore.js +3 -0
- package/.yalc/@node-dlc/messaging/dist/chain/DlcStore.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/chain/IChainFilterChainClient.d.ts +48 -0
- package/.yalc/@node-dlc/messaging/dist/chain/IChainFilterChainClient.js +3 -0
- package/.yalc/@node-dlc/messaging/dist/chain/IChainFilterChainClient.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/domain/Address.d.ts +24 -0
- package/.yalc/@node-dlc/messaging/dist/domain/Address.js +46 -0
- package/.yalc/@node-dlc/messaging/dist/domain/Address.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/index.d.ts +44 -0
- package/.yalc/@node-dlc/messaging/dist/index.js +63 -0
- package/.yalc/@node-dlc/messaging/dist/index.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/irc/IrcMessage.d.ts +43 -0
- package/.yalc/@node-dlc/messaging/dist/irc/IrcMessage.js +116 -0
- package/.yalc/@node-dlc/messaging/dist/irc/IrcMessage.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/AddressCache.d.ts +15 -0
- package/.yalc/@node-dlc/messaging/dist/messages/AddressCache.js +51 -0
- package/.yalc/@node-dlc/messaging/dist/messages/AddressCache.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/BatchFundingGroup.d.ts +61 -0
- package/.yalc/@node-dlc/messaging/dist/messages/BatchFundingGroup.js +113 -0
- package/.yalc/@node-dlc/messaging/dist/messages/BatchFundingGroup.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/CetAdaptorSignatures.d.ts +40 -0
- package/.yalc/@node-dlc/messaging/dist/messages/CetAdaptorSignatures.js +67 -0
- package/.yalc/@node-dlc/messaging/dist/messages/CetAdaptorSignatures.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/ContractDescriptor.d.ts +122 -0
- package/.yalc/@node-dlc/messaging/dist/messages/ContractDescriptor.js +222 -0
- package/.yalc/@node-dlc/messaging/dist/messages/ContractDescriptor.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/ContractInfo.d.ts +135 -0
- package/.yalc/@node-dlc/messaging/dist/messages/ContractInfo.js +304 -0
- package/.yalc/@node-dlc/messaging/dist/messages/ContractInfo.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcAccept.d.ts +145 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcAccept.js +428 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcAccept.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcCancel.d.ts +31 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcCancel.js +51 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcCancel.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcClose.d.ts +68 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcClose.js +210 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcClose.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcCloseMetadata.d.ts +44 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcCloseMetadata.js +74 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcCloseMetadata.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcIds.d.ts +26 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcIds.js +58 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcIds.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcInfo.d.ts +31 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcInfo.js +61 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcInfo.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcMessage.d.ts +23 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcMessage.js +54 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcMessage.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcOffer.d.ts +131 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcOffer.js +418 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcOffer.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcSign.d.ts +96 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcSign.js +267 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcSign.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcTransactions.d.ts +69 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcTransactions.js +149 -0
- package/.yalc/@node-dlc/messaging/dist/messages/DlcTransactions.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/EventDescriptor.d.ts +106 -0
- package/.yalc/@node-dlc/messaging/dist/messages/EventDescriptor.js +209 -0
- package/.yalc/@node-dlc/messaging/dist/messages/EventDescriptor.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/FundingInput.d.ts +62 -0
- package/.yalc/@node-dlc/messaging/dist/messages/FundingInput.js +163 -0
- package/.yalc/@node-dlc/messaging/dist/messages/FundingInput.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/FundingSignatures.d.ts +36 -0
- package/.yalc/@node-dlc/messaging/dist/messages/FundingSignatures.js +78 -0
- package/.yalc/@node-dlc/messaging/dist/messages/FundingSignatures.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/IWireMessage.d.ts +6 -0
- package/.yalc/@node-dlc/messaging/dist/messages/IWireMessage.js +3 -0
- package/.yalc/@node-dlc/messaging/dist/messages/IWireMessage.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/NegotiationFields.d.ts +86 -0
- package/.yalc/@node-dlc/messaging/dist/messages/NegotiationFields.js +185 -0
- package/.yalc/@node-dlc/messaging/dist/messages/NegotiationFields.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/NodeAnnouncementMessage.d.ts +57 -0
- package/.yalc/@node-dlc/messaging/dist/messages/NodeAnnouncementMessage.js +127 -0
- package/.yalc/@node-dlc/messaging/dist/messages/NodeAnnouncementMessage.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleAnnouncement.d.ts +76 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleAnnouncement.js +131 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleAnnouncement.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleAttestation.d.ts +68 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleAttestation.js +239 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleAttestation.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleEvent.d.ts +90 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleEvent.js +189 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleEvent.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleEventContainer.d.ts +32 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleEventContainer.js +67 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleEventContainer.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleIdentifier.d.ts +32 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleIdentifier.js +58 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleIdentifier.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleIdentifierV0.d.ts +32 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleIdentifierV0.js +58 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleIdentifierV0.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleInfo.d.ts +161 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleInfo.js +390 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleInfo.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleInfoV0.d.ts +161 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleInfoV0.js +387 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OracleInfoV0.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderAccept.d.ts +65 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderAccept.js +125 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderAccept.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderIrcInfo.d.ts +42 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderIrcInfo.js +74 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderIrcInfo.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderMetadata.d.ts +56 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderMetadata.js +87 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderMetadata.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderNegotiationFields.d.ts +69 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderNegotiationFields.js +114 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderNegotiationFields.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderOffer.d.ts +97 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderOffer.js +296 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderOffer.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderPositionInfo.d.ts +50 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderPositionInfo.js +125 -0
- package/.yalc/@node-dlc/messaging/dist/messages/OrderPositionInfo.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/PayoutCurvePiece.d.ts +129 -0
- package/.yalc/@node-dlc/messaging/dist/messages/PayoutCurvePiece.js +327 -0
- package/.yalc/@node-dlc/messaging/dist/messages/PayoutCurvePiece.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/PayoutFunction.d.ts +66 -0
- package/.yalc/@node-dlc/messaging/dist/messages/PayoutFunction.js +170 -0
- package/.yalc/@node-dlc/messaging/dist/messages/PayoutFunction.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/RoundingIntervals.d.ts +52 -0
- package/.yalc/@node-dlc/messaging/dist/messages/RoundingIntervals.js +95 -0
- package/.yalc/@node-dlc/messaging/dist/messages/RoundingIntervals.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/ScriptWitnessV0.d.ts +29 -0
- package/.yalc/@node-dlc/messaging/dist/messages/ScriptWitnessV0.js +50 -0
- package/.yalc/@node-dlc/messaging/dist/messages/ScriptWitnessV0.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/messages/Tlv.d.ts +15 -0
- package/.yalc/@node-dlc/messaging/dist/messages/Tlv.js +32 -0
- package/.yalc/@node-dlc/messaging/dist/messages/Tlv.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/serialize/F64.d.ts +154 -0
- package/.yalc/@node-dlc/messaging/dist/serialize/F64.js +307 -0
- package/.yalc/@node-dlc/messaging/dist/serialize/F64.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/serialize/deserializeTlv.d.ts +9 -0
- package/.yalc/@node-dlc/messaging/dist/serialize/deserializeTlv.js +11 -0
- package/.yalc/@node-dlc/messaging/dist/serialize/deserializeTlv.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/serialize/getTlv.d.ts +4 -0
- package/.yalc/@node-dlc/messaging/dist/serialize/getTlv.js +23 -0
- package/.yalc/@node-dlc/messaging/dist/serialize/getTlv.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/serialize/readTlvs.d.ts +8 -0
- package/.yalc/@node-dlc/messaging/dist/serialize/readTlvs.js +33 -0
- package/.yalc/@node-dlc/messaging/dist/serialize/readTlvs.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/util.d.ts +13 -0
- package/.yalc/@node-dlc/messaging/dist/util.js +40 -0
- package/.yalc/@node-dlc/messaging/dist/util.js.map +1 -0
- package/.yalc/@node-dlc/messaging/dist/validation/validate.d.ts +4 -0
- package/.yalc/@node-dlc/messaging/dist/validation/validate.js +31 -0
- package/.yalc/@node-dlc/messaging/dist/validation/validate.js.map +1 -0
- package/.yalc/@node-dlc/messaging/lib/MessageType.ts +138 -0
- package/.yalc/@node-dlc/messaging/lib/chain/ChainManager.ts +326 -0
- package/.yalc/@node-dlc/messaging/lib/chain/ChainMemoryStore.ts +34 -0
- package/.yalc/@node-dlc/messaging/lib/chain/DlcStore.ts +11 -0
- package/.yalc/@node-dlc/messaging/lib/chain/IChainFilterChainClient.ts +57 -0
- package/.yalc/@node-dlc/messaging/lib/domain/Address.ts +64 -0
- package/.yalc/@node-dlc/messaging/lib/index.ts +44 -0
- package/.yalc/@node-dlc/messaging/lib/irc/IrcMessage.ts +161 -0
- package/.yalc/@node-dlc/messaging/lib/messages/AddressCache.ts +74 -0
- package/.yalc/@node-dlc/messaging/lib/messages/BatchFundingGroup.ts +141 -0
- package/.yalc/@node-dlc/messaging/lib/messages/CetAdaptorSignatures.ts +89 -0
- package/.yalc/@node-dlc/messaging/lib/messages/ContractDescriptor.ts +318 -0
- package/.yalc/@node-dlc/messaging/lib/messages/ContractInfo.ts +434 -0
- package/.yalc/@node-dlc/messaging/lib/messages/DlcAccept.ts +595 -0
- package/.yalc/@node-dlc/messaging/lib/messages/DlcCancel.ts +57 -0
- package/.yalc/@node-dlc/messaging/lib/messages/DlcClose.ts +302 -0
- package/.yalc/@node-dlc/messaging/lib/messages/DlcCloseMetadata.ts +121 -0
- package/.yalc/@node-dlc/messaging/lib/messages/DlcIds.ts +67 -0
- package/.yalc/@node-dlc/messaging/lib/messages/DlcInfo.ts +81 -0
- package/.yalc/@node-dlc/messaging/lib/messages/DlcMessage.ts +87 -0
- package/.yalc/@node-dlc/messaging/lib/messages/DlcOffer.ts +605 -0
- package/.yalc/@node-dlc/messaging/lib/messages/DlcSign.ts +354 -0
- package/.yalc/@node-dlc/messaging/lib/messages/DlcTransactions.ts +213 -0
- package/.yalc/@node-dlc/messaging/lib/messages/EventDescriptor.ts +289 -0
- package/.yalc/@node-dlc/messaging/lib/messages/FundingInput.ts +216 -0
- package/.yalc/@node-dlc/messaging/lib/messages/FundingSignatures.ts +98 -0
- package/.yalc/@node-dlc/messaging/lib/messages/IWireMessage.ts +6 -0
- package/.yalc/@node-dlc/messaging/lib/messages/NegotiationFields.ts +252 -0
- package/.yalc/@node-dlc/messaging/lib/messages/NodeAnnouncementMessage.ts +145 -0
- package/.yalc/@node-dlc/messaging/lib/messages/OracleAnnouncement.ts +176 -0
- package/.yalc/@node-dlc/messaging/lib/messages/OracleAttestation.ts +292 -0
- package/.yalc/@node-dlc/messaging/lib/messages/OracleEvent.ts +250 -0
- package/.yalc/@node-dlc/messaging/lib/messages/OracleEventContainer.ts +89 -0
- package/.yalc/@node-dlc/messaging/lib/messages/OracleIdentifier.ts +78 -0
- package/.yalc/@node-dlc/messaging/lib/messages/OracleInfo.ts +519 -0
- package/.yalc/@node-dlc/messaging/lib/messages/OrderAccept.ts +159 -0
- package/.yalc/@node-dlc/messaging/lib/messages/OrderIrcInfo.ts +100 -0
- package/.yalc/@node-dlc/messaging/lib/messages/OrderMetadata.ts +119 -0
- package/.yalc/@node-dlc/messaging/lib/messages/OrderNegotiationFields.ts +157 -0
- package/.yalc/@node-dlc/messaging/lib/messages/OrderOffer.ts +419 -0
- package/.yalc/@node-dlc/messaging/lib/messages/OrderPositionInfo.ts +170 -0
- package/.yalc/@node-dlc/messaging/lib/messages/PayoutCurvePiece.ts +449 -0
- package/.yalc/@node-dlc/messaging/lib/messages/PayoutFunction.ts +240 -0
- package/.yalc/@node-dlc/messaging/lib/messages/RoundingIntervals.ts +127 -0
- package/.yalc/@node-dlc/messaging/lib/messages/ScriptWitnessV0.ts +63 -0
- package/.yalc/@node-dlc/messaging/lib/messages/Tlv.ts +40 -0
- package/.yalc/@node-dlc/messaging/lib/serialize/F64.ts +352 -0
- package/.yalc/@node-dlc/messaging/lib/serialize/deserializeTlv.ts +15 -0
- package/.yalc/@node-dlc/messaging/lib/serialize/getTlv.ts +21 -0
- package/.yalc/@node-dlc/messaging/lib/serialize/readTlvs.ts +37 -0
- package/.yalc/@node-dlc/messaging/lib/util.ts +33 -0
- package/.yalc/@node-dlc/messaging/lib/validation/validate.ts +34 -0
- package/.yalc/@node-dlc/messaging/package.json +42 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_3_of_3_test.json +210 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_3_of_5_test.json +468 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_and_numerical_3_of_5_test.json +1517 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_and_numerical_5_of_5_test.json +545 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_and_numerical_with_diff_3_of_5_test.json +4761 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_and_numerical_with_diff_5_of_5_test.json +2169 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_single_oracle_test.json +164 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/single_oracle_numerical_hyperbola_test.json +502 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/single_oracle_numerical_test.json +262 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/three_of_five_oracle_numerical_with_diff_test.json +4382 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/three_of_three_oracle_numerical_test.json +324 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/three_of_three_oracle_numerical_with_diff_test.json +652 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/two_of_five_oracle_numerical_test.json +1138 -0
- package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/two_of_five_oracle_numerical_with_diff_test.json +2222 -0
- package/.yalc/@node-dlc/messaging/test_vectors/oracle/external_oracle_announcements.json +0 -0
- package/.yalc/@node-dlc/messaging/test_vectors/oracle/oracle_message_test_vectors.json +115 -0
- package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/accept_msg.json +1465 -0
- package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/dlc_fee_test.json +12362 -0
- package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/dlc_fee_test_scripts.json +57 -0
- package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/dlc_test.json +2766 -0
- package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/dlc_tx_test.json +2899 -0
- package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/offer_msg.json +163 -0
- package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/offer_msg_disjoint.json +352 -0
- package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/segment_chunk_msg.json +12635 -0
- package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/segment_start_msg.json +4022 -0
- package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/sign_msg.json +383 -0
- package/.yalc/@node-dlc/messaging/tsconfig.json +7 -0
- package/.yalc/@node-dlc/messaging/yalc.sig +1 -0
- package/CHANGELOG.md +83 -0
- package/dist/BitcoinDlcProvider.d.ts +17 -16
- package/dist/BitcoinDlcProvider.js +375 -317
- package/dist/BitcoinDlcProvider.js.map +1 -1
- package/dist/utils/Utils.d.ts +6 -6
- package/dist/utils/Utils.js +4 -4
- package/dist/utils/Utils.js.map +1 -1
- package/lib/BitcoinDlcProvider.ts +637 -621
- package/lib/utils/Utils.ts +19 -24
- package/package.json +13 -11
- package/yalc.lock +10 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DigitDecompositionEventDescriptorV0 = exports.DigitDecompositionEventDescriptor = exports.EnumEventDescriptorV0 = exports.EnumEventDescriptor = exports.EventDescriptor = void 0;
|
|
4
|
+
const bufio_1 = require("@node-dlc/bufio");
|
|
5
|
+
const MessageType_1 = require("../MessageType");
|
|
6
|
+
class EventDescriptor {
|
|
7
|
+
static deserialize(buf) {
|
|
8
|
+
const reader = new bufio_1.BufferReader(buf);
|
|
9
|
+
const type = Number(reader.readBigSize());
|
|
10
|
+
switch (type) {
|
|
11
|
+
case MessageType_1.MessageType.EnumEventDescriptor:
|
|
12
|
+
return EnumEventDescriptor.deserialize(buf);
|
|
13
|
+
case MessageType_1.MessageType.DigitDecompositionEventDescriptor:
|
|
14
|
+
return DigitDecompositionEventDescriptor.deserialize(buf);
|
|
15
|
+
default:
|
|
16
|
+
throw new Error(`Payout function TLV type must be EnumEventDescriptorV0 or DigitDecompositionEventDescriptor`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Creates an EventDescriptor from JSON data
|
|
21
|
+
* @param json JSON object representing event descriptor
|
|
22
|
+
*/
|
|
23
|
+
static fromJSON(json) {
|
|
24
|
+
if (!json) {
|
|
25
|
+
throw new Error('eventDescriptor is required');
|
|
26
|
+
}
|
|
27
|
+
// Check if it's an enum event or digit decomposition event
|
|
28
|
+
if (json.enumEvent || json.enum_event) {
|
|
29
|
+
return EnumEventDescriptor.fromJSON(json.enumEvent || json.enum_event);
|
|
30
|
+
}
|
|
31
|
+
else if (json.digitDecompositionEvent || json.digit_decomposition_event) {
|
|
32
|
+
return DigitDecompositionEventDescriptor.fromJSON(json.digitDecompositionEvent || json.digit_decomposition_event);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
throw new Error('eventDescriptor must have either enumEvent or digitDecompositionEvent');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.EventDescriptor = EventDescriptor;
|
|
40
|
+
/**
|
|
41
|
+
* EnumEventDescriptor message contains the event outcomes for enumerated events.
|
|
42
|
+
* Simplified class name (removed V0 suffix).
|
|
43
|
+
*/
|
|
44
|
+
class EnumEventDescriptor extends EventDescriptor {
|
|
45
|
+
constructor() {
|
|
46
|
+
super(...arguments);
|
|
47
|
+
/**
|
|
48
|
+
* The type for enum_event_descriptor_v0 message. enum_event_descriptor_v0 = 55302
|
|
49
|
+
*/
|
|
50
|
+
this.type = EnumEventDescriptor.type;
|
|
51
|
+
this.length = BigInt(0); // Required by EventDescriptor parent class
|
|
52
|
+
this.outcomes = [];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Creates an EnumEventDescriptor from JSON data
|
|
56
|
+
* @param json JSON object representing an enum event descriptor
|
|
57
|
+
*/
|
|
58
|
+
static fromJSON(json) {
|
|
59
|
+
const instance = new EnumEventDescriptor();
|
|
60
|
+
instance.outcomes = json.outcomes || [];
|
|
61
|
+
return instance;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Deserializes an enum_event_descriptor_v0 message
|
|
65
|
+
* @param buf
|
|
66
|
+
*/
|
|
67
|
+
static deserialize(buf) {
|
|
68
|
+
const instance = new EnumEventDescriptor();
|
|
69
|
+
const reader = new bufio_1.BufferReader(buf);
|
|
70
|
+
reader.readBigSize(); // read type
|
|
71
|
+
instance.length = reader.readBigSize(); // need to fix this
|
|
72
|
+
reader.readUInt16BE(); // num_outcomes
|
|
73
|
+
while (!reader.eof) {
|
|
74
|
+
const outcomeLen = reader.readBigSize();
|
|
75
|
+
const outcomeBuf = reader.readBytes(Number(outcomeLen));
|
|
76
|
+
instance.outcomes.push(outcomeBuf.toString());
|
|
77
|
+
}
|
|
78
|
+
return instance;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Converts enum_event_descriptor to JSON
|
|
82
|
+
*/
|
|
83
|
+
toJSON() {
|
|
84
|
+
return {
|
|
85
|
+
enumEvent: {
|
|
86
|
+
outcomes: this.outcomes,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Serializes the enum_event_descriptor_v0 message into a Buffer
|
|
92
|
+
*/
|
|
93
|
+
serialize() {
|
|
94
|
+
const writer = new bufio_1.BufferWriter();
|
|
95
|
+
writer.writeBigSize(this.type);
|
|
96
|
+
const dataWriter = new bufio_1.BufferWriter();
|
|
97
|
+
dataWriter.writeUInt16BE(this.outcomes.length);
|
|
98
|
+
for (const outcome of this.outcomes) {
|
|
99
|
+
dataWriter.writeBigSize(outcome.length);
|
|
100
|
+
dataWriter.writeBytes(Buffer.from(outcome));
|
|
101
|
+
}
|
|
102
|
+
writer.writeBigSize(dataWriter.size);
|
|
103
|
+
writer.writeBytes(dataWriter.toBuffer());
|
|
104
|
+
return writer.toBuffer();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.EnumEventDescriptor = EnumEventDescriptor;
|
|
108
|
+
EnumEventDescriptor.type = MessageType_1.MessageType.EnumEventDescriptorV0;
|
|
109
|
+
// Legacy support - keep V0 alias for backward compatibility
|
|
110
|
+
exports.EnumEventDescriptorV0 = EnumEventDescriptor;
|
|
111
|
+
/**
|
|
112
|
+
* DigitDecompositionEventDescriptor is a simple enumeration of outcomes.
|
|
113
|
+
* Simplified class name (removed V0 suffix).
|
|
114
|
+
*/
|
|
115
|
+
class DigitDecompositionEventDescriptor extends EventDescriptor {
|
|
116
|
+
constructor() {
|
|
117
|
+
super(...arguments);
|
|
118
|
+
/**
|
|
119
|
+
* The type for digit_decomposition_event_descriptor message. digit_decomposition_event_descriptor = 55306
|
|
120
|
+
*/
|
|
121
|
+
this.type = DigitDecompositionEventDescriptor.type;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Creates a DigitDecompositionEventDescriptor from JSON data
|
|
125
|
+
* @param json JSON object representing digit decomposition event descriptor
|
|
126
|
+
*/
|
|
127
|
+
static fromJSON(json) {
|
|
128
|
+
const instance = new DigitDecompositionEventDescriptor();
|
|
129
|
+
instance.base = json.base || 10;
|
|
130
|
+
instance.isSigned = json.isSigned || json.is_signed || false;
|
|
131
|
+
instance.unit = json.unit || '';
|
|
132
|
+
instance.precision = json.precision || 0;
|
|
133
|
+
instance.nbDigits = json.nbDigits || json.nb_digits || 0;
|
|
134
|
+
return instance;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Deserializes an digit_decomposition_event_descriptor message
|
|
138
|
+
* @param buf
|
|
139
|
+
*/
|
|
140
|
+
static deserialize(buf) {
|
|
141
|
+
const instance = new DigitDecompositionEventDescriptor();
|
|
142
|
+
const reader = new bufio_1.BufferReader(buf);
|
|
143
|
+
reader.readBigSize(); // read type
|
|
144
|
+
instance.length = reader.readBigSize(); // need to fix this
|
|
145
|
+
/**
|
|
146
|
+
* NOTE: BASE IS INCORRECT FORMAT FOR DLC SPEC (SHOULD BE BIGSIZE)
|
|
147
|
+
* Will be fixed in oracle_announcement_v1
|
|
148
|
+
* https://github.com/discreetlogcontracts/dlcspecs/blob/master/Oracle.md#version-0-digit_decomposition_event_descriptor
|
|
149
|
+
*/
|
|
150
|
+
instance.base = reader.readUInt16BE();
|
|
151
|
+
instance.isSigned = reader.readUInt8() === 1;
|
|
152
|
+
const unitLen = reader.readBigSize();
|
|
153
|
+
const unitBuf = reader.readBytes(Number(unitLen));
|
|
154
|
+
instance.unit = unitBuf.toString();
|
|
155
|
+
instance.precision = reader.readUInt32BE();
|
|
156
|
+
instance.nbDigits = reader.readUInt16BE();
|
|
157
|
+
return instance;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Validates correctness of all fields in the message
|
|
161
|
+
* https://github.com/discreetlogcontracts/dlcspecs/blob/master/Oracle.md
|
|
162
|
+
* @throws Will throw an error if validation fails
|
|
163
|
+
*/
|
|
164
|
+
validate() {
|
|
165
|
+
if (this.base <= 0) {
|
|
166
|
+
throw new Error('base must be greater than 0');
|
|
167
|
+
}
|
|
168
|
+
// TODO: support isSigned according to specifications
|
|
169
|
+
if (this.isSigned) {
|
|
170
|
+
throw new Error('node-dlc does not support isSigned');
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Converts digit_decomposition_event_descriptor to JSON (canonical rust-dlc format)
|
|
175
|
+
*/
|
|
176
|
+
toJSON() {
|
|
177
|
+
return {
|
|
178
|
+
digitDecompositionEvent: {
|
|
179
|
+
base: this.base,
|
|
180
|
+
isSigned: this.isSigned,
|
|
181
|
+
unit: this.unit,
|
|
182
|
+
precision: this.precision,
|
|
183
|
+
nbDigits: this.nbDigits,
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Serializes the digit_decomposition_event_descriptor message into a Buffer
|
|
189
|
+
*/
|
|
190
|
+
serialize() {
|
|
191
|
+
const writer = new bufio_1.BufferWriter();
|
|
192
|
+
writer.writeBigSize(this.type);
|
|
193
|
+
const dataWriter = new bufio_1.BufferWriter();
|
|
194
|
+
dataWriter.writeUInt16BE(this.base); // Switch to BigSize in oracle_announcement_v1
|
|
195
|
+
dataWriter.writeUInt8(this.isSigned ? 1 : 0);
|
|
196
|
+
dataWriter.writeBigSize(this.unit.length);
|
|
197
|
+
dataWriter.writeBytes(Buffer.from(this.unit));
|
|
198
|
+
dataWriter.writeUInt32BE(this.precision);
|
|
199
|
+
dataWriter.writeUInt16BE(this.nbDigits);
|
|
200
|
+
writer.writeBigSize(dataWriter.size);
|
|
201
|
+
writer.writeBytes(dataWriter.toBuffer());
|
|
202
|
+
return writer.toBuffer();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
exports.DigitDecompositionEventDescriptor = DigitDecompositionEventDescriptor;
|
|
206
|
+
DigitDecompositionEventDescriptor.type = MessageType_1.MessageType.DigitDecompositionEventDescriptor;
|
|
207
|
+
// Legacy support - keep V0 alias for backward compatibility
|
|
208
|
+
exports.DigitDecompositionEventDescriptorV0 = DigitDecompositionEventDescriptor;
|
|
209
|
+
//# sourceMappingURL=EventDescriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventDescriptor.js","sourceRoot":"","sources":["../../lib/messages/EventDescriptor.ts"],"names":[],"mappings":";;;AAAA,2CAA6D;AAE7D,gDAA6C;AAG7C,MAAsB,eAAe;IAC5B,MAAM,CAAC,WAAW,CACvB,GAAW;QAEX,MAAM,MAAM,GAAG,IAAI,oBAAY,CAAC,GAAG,CAAC,CAAC;QAErC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QAE1C,QAAQ,IAAI,EAAE;YACZ,KAAK,yBAAW,CAAC,mBAAmB;gBAClC,OAAO,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;YAC9C,KAAK,yBAAW,CAAC,iCAAiC;gBAChD,OAAO,iCAAiC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;YAC5D;gBACE,MAAM,IAAI,KAAK,CACb,6FAA6F,CAC9F,CAAC;SACL;IACH,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,QAAQ,CAAC,IAAS;QAC9B,IAAI,CAAC,IAAI,EAAE;YACT,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;SAChD;QAED,2DAA2D;QAC3D,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE;YACrC,OAAO,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;SACxE;aAAM,IAAI,IAAI,CAAC,uBAAuB,IAAI,IAAI,CAAC,yBAAyB,EAAE;YACzE,OAAO,iCAAiC,CAAC,QAAQ,CAC/C,IAAI,CAAC,uBAAuB,IAAI,IAAI,CAAC,yBAAyB,CAC/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AAC,iCAAiC,CAAC;AAiHrE,4DAA4D;AAC/C,QAAA,mCAAmC,GAAG,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Sequence, Tx } from '@node-dlc/bitcoin';
|
|
3
|
+
import { MessageType } from '../MessageType';
|
|
4
|
+
import { IDlcMessage } from './DlcMessage';
|
|
5
|
+
/**
|
|
6
|
+
* FundingInput contains information about a specific input to be used
|
|
7
|
+
* in a funding transaction, as well as its corresponding on-chain UTXO.
|
|
8
|
+
* Matches rust-dlc FundingInput struct.
|
|
9
|
+
*/
|
|
10
|
+
export declare class FundingInput implements IDlcMessage {
|
|
11
|
+
static type: MessageType;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a FundingInput from JSON data (e.g., from test vectors)
|
|
14
|
+
* @param json JSON object representing funding input
|
|
15
|
+
*/
|
|
16
|
+
static fromJSON(json: any): FundingInput;
|
|
17
|
+
/**
|
|
18
|
+
* Deserializes a funding_input message
|
|
19
|
+
* @param buf
|
|
20
|
+
*/
|
|
21
|
+
static deserialize(buf: Buffer): FundingInput;
|
|
22
|
+
/**
|
|
23
|
+
* Deserializes a funding_input message without TLV wrapper (for use in DlcOffer)
|
|
24
|
+
* This matches rust-dlc behavior where FundingInput is in a vector without individual TLV wrappers
|
|
25
|
+
* @param buf
|
|
26
|
+
*/
|
|
27
|
+
static deserializeBody(buf: Buffer): FundingInput;
|
|
28
|
+
/**
|
|
29
|
+
* The type for funding_input message. funding_input = 42772
|
|
30
|
+
*/
|
|
31
|
+
type: MessageType;
|
|
32
|
+
length: bigint;
|
|
33
|
+
inputSerialId: bigint;
|
|
34
|
+
prevTx: Tx;
|
|
35
|
+
prevTxVout: number;
|
|
36
|
+
sequence: Sequence;
|
|
37
|
+
maxWitnessLen: number;
|
|
38
|
+
redeemScript: Buffer;
|
|
39
|
+
scriptSigLength(): number;
|
|
40
|
+
/**
|
|
41
|
+
* Validates correctness of all fields
|
|
42
|
+
* @throws Will throw an error if validation fails
|
|
43
|
+
*/
|
|
44
|
+
validate(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Converts funding_input to JSON (canonical rust-dlc format)
|
|
47
|
+
*/
|
|
48
|
+
toJSON(): IFundingInputJSON;
|
|
49
|
+
/**
|
|
50
|
+
* Serializes the funding_input message into a Buffer
|
|
51
|
+
*/
|
|
52
|
+
serialize(): Buffer;
|
|
53
|
+
serializeBody(): Buffer;
|
|
54
|
+
}
|
|
55
|
+
export interface IFundingInputJSON {
|
|
56
|
+
inputSerialId: number;
|
|
57
|
+
prevTx: string;
|
|
58
|
+
prevTxVout: number;
|
|
59
|
+
sequence: number;
|
|
60
|
+
maxWitnessLen: number;
|
|
61
|
+
redeemScript: string;
|
|
62
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FundingInput = void 0;
|
|
4
|
+
const bitcoin_1 = require("@node-dlc/bitcoin");
|
|
5
|
+
const bufio_1 = require("@node-dlc/bufio");
|
|
6
|
+
const MessageType_1 = require("../MessageType");
|
|
7
|
+
const util_1 = require("../util");
|
|
8
|
+
/**
|
|
9
|
+
* FundingInput contains information about a specific input to be used
|
|
10
|
+
* in a funding transaction, as well as its corresponding on-chain UTXO.
|
|
11
|
+
* Matches rust-dlc FundingInput struct.
|
|
12
|
+
*/
|
|
13
|
+
class FundingInput {
|
|
14
|
+
constructor() {
|
|
15
|
+
/**
|
|
16
|
+
* The type for funding_input message. funding_input = 42772
|
|
17
|
+
*/
|
|
18
|
+
this.type = FundingInput.type;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates a FundingInput from JSON data (e.g., from test vectors)
|
|
22
|
+
* @param json JSON object representing funding input
|
|
23
|
+
*/
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
|
25
|
+
static fromJSON(json) {
|
|
26
|
+
const instance = new FundingInput();
|
|
27
|
+
instance.inputSerialId = (0, util_1.toBigInt)(json.inputSerialId || json.input_serial_id);
|
|
28
|
+
// Parse previous transaction
|
|
29
|
+
const prevTxHex = json.prevTx || json.prev_tx;
|
|
30
|
+
if (prevTxHex) {
|
|
31
|
+
instance.prevTx = bitcoin_1.Tx.decode(bufio_1.StreamReader.fromBuffer(Buffer.from(prevTxHex, 'hex')));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
// Create a minimal transaction for test purposes
|
|
35
|
+
// TODO: This should be properly implemented when full test vector support is needed
|
|
36
|
+
const writer = new bufio_1.BufferWriter();
|
|
37
|
+
writer.writeUInt32BE(2); // version
|
|
38
|
+
writer.writeUInt8(0); // input count
|
|
39
|
+
writer.writeUInt8(1); // output count
|
|
40
|
+
writer.writeUInt64BE(BigInt(100000000)); // output value
|
|
41
|
+
writer.writeUInt8(25); // script length
|
|
42
|
+
writer.writeBytes(Buffer.alloc(25)); // script
|
|
43
|
+
writer.writeUInt32BE(0); // locktime
|
|
44
|
+
const txBytes = writer.toBuffer();
|
|
45
|
+
instance.prevTx = bitcoin_1.Tx.decode(bufio_1.StreamReader.fromBuffer(txBytes));
|
|
46
|
+
}
|
|
47
|
+
instance.prevTxVout = json.prevTxVout || json.prev_tx_vout || 0;
|
|
48
|
+
instance.sequence = new bitcoin_1.Sequence(json.sequence || 0xffffffff);
|
|
49
|
+
instance.maxWitnessLen = json.maxWitnessLen || json.max_witness_len || 108;
|
|
50
|
+
const redeemScript = json.redeemScript || json.redeem_script || '';
|
|
51
|
+
instance.redeemScript = Buffer.from(redeemScript, 'hex');
|
|
52
|
+
return instance;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Deserializes a funding_input message
|
|
56
|
+
* @param buf
|
|
57
|
+
*/
|
|
58
|
+
static deserialize(buf) {
|
|
59
|
+
const instance = new FundingInput();
|
|
60
|
+
const reader = new bufio_1.BufferReader(buf);
|
|
61
|
+
reader.readBigSize(); // read type
|
|
62
|
+
instance.length = reader.readBigSize();
|
|
63
|
+
instance.inputSerialId = reader.readUInt64BE();
|
|
64
|
+
const prevTxLen = reader.readUInt16BE();
|
|
65
|
+
instance.prevTx = bitcoin_1.Tx.decode(bufio_1.StreamReader.fromBuffer(reader.readBytes(prevTxLen)));
|
|
66
|
+
instance.prevTxVout = reader.readUInt32BE();
|
|
67
|
+
instance.sequence = new bitcoin_1.Sequence(reader.readUInt32BE());
|
|
68
|
+
instance.maxWitnessLen = reader.readUInt16BE();
|
|
69
|
+
const redeemScriptLen = reader.readUInt16BE();
|
|
70
|
+
instance.redeemScript = reader.readBytes(redeemScriptLen);
|
|
71
|
+
return instance;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Deserializes a funding_input message without TLV wrapper (for use in DlcOffer)
|
|
75
|
+
* This matches rust-dlc behavior where FundingInput is in a vector without individual TLV wrappers
|
|
76
|
+
* @param buf
|
|
77
|
+
*/
|
|
78
|
+
static deserializeBody(buf) {
|
|
79
|
+
const instance = new FundingInput();
|
|
80
|
+
const reader = new bufio_1.BufferReader(buf);
|
|
81
|
+
// No TLV type/length to read - funding input body is serialized directly
|
|
82
|
+
instance.inputSerialId = reader.readUInt64BE();
|
|
83
|
+
// Read prev_tx with BigSize length (to match rust-dlc)
|
|
84
|
+
const prevTxLen = Number(reader.readBigSize());
|
|
85
|
+
instance.prevTx = bitcoin_1.Tx.decode(bufio_1.StreamReader.fromBuffer(reader.readBytes(prevTxLen)));
|
|
86
|
+
instance.prevTxVout = reader.readUInt32BE();
|
|
87
|
+
instance.sequence = new bitcoin_1.Sequence(reader.readUInt32BE());
|
|
88
|
+
instance.maxWitnessLen = reader.readUInt16BE();
|
|
89
|
+
// Test: Read redeem_script with simple u16 length (to match rust-bitcoin ScriptBuf)
|
|
90
|
+
const redeemScriptLen = reader.readUInt16BE();
|
|
91
|
+
instance.redeemScript = reader.readBytes(redeemScriptLen);
|
|
92
|
+
return instance;
|
|
93
|
+
}
|
|
94
|
+
scriptSigLength() {
|
|
95
|
+
if (this.redeemScript.length > 0) {
|
|
96
|
+
return 1 + this.redeemScript.length;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Validates correctness of all fields
|
|
104
|
+
* @throws Will throw an error if validation fails
|
|
105
|
+
*/
|
|
106
|
+
validate() {
|
|
107
|
+
// 1. Type is set automatically in class
|
|
108
|
+
// 2. Ensure inputs are segwit
|
|
109
|
+
if (!this.prevTx.isSegWit)
|
|
110
|
+
throw new Error('fundingInput must be segwit');
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Converts funding_input to JSON (canonical rust-dlc format)
|
|
114
|
+
*/
|
|
115
|
+
toJSON() {
|
|
116
|
+
return {
|
|
117
|
+
inputSerialId: (0, util_1.bigIntToNumber)(this.inputSerialId),
|
|
118
|
+
prevTx: this.prevTx.serialize().toString('hex'),
|
|
119
|
+
prevTxVout: this.prevTxVout,
|
|
120
|
+
sequence: this.sequence.value,
|
|
121
|
+
maxWitnessLen: this.maxWitnessLen,
|
|
122
|
+
redeemScript: this.redeemScript.toString('hex'),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Serializes the funding_input message into a Buffer
|
|
127
|
+
*/
|
|
128
|
+
serialize() {
|
|
129
|
+
const writer = new bufio_1.BufferWriter();
|
|
130
|
+
writer.writeBigSize(this.type);
|
|
131
|
+
const dataWriter = new bufio_1.BufferWriter();
|
|
132
|
+
dataWriter.writeUInt64BE(this.inputSerialId);
|
|
133
|
+
dataWriter.writeUInt16BE(this.prevTx.serialize().length);
|
|
134
|
+
dataWriter.writeBytes(this.prevTx.serialize());
|
|
135
|
+
dataWriter.writeUInt32BE(this.prevTxVout);
|
|
136
|
+
dataWriter.writeUInt32BE(this.sequence.value);
|
|
137
|
+
dataWriter.writeUInt16BE(this.maxWitnessLen);
|
|
138
|
+
dataWriter.writeUInt16BE(this.redeemScript.length);
|
|
139
|
+
dataWriter.writeBytes(this.redeemScript);
|
|
140
|
+
writer.writeBigSize(dataWriter.size);
|
|
141
|
+
writer.writeBytes(dataWriter.toBuffer());
|
|
142
|
+
return writer.toBuffer();
|
|
143
|
+
}
|
|
144
|
+
serializeBody() {
|
|
145
|
+
// Serialize funding input body without TLV wrapper (for embedding in DlcOffer)
|
|
146
|
+
// This matches rust-dlc behavior where FundingInput.write() doesn't add type_id
|
|
147
|
+
const writer = new bufio_1.BufferWriter();
|
|
148
|
+
writer.writeUInt64BE(this.inputSerialId);
|
|
149
|
+
// Use BigSize for prev_tx length to match rust-dlc (prev_tx, vec)
|
|
150
|
+
writer.writeBigSize(this.prevTx.serialize().length);
|
|
151
|
+
writer.writeBytes(this.prevTx.serialize());
|
|
152
|
+
writer.writeUInt32BE(this.prevTxVout);
|
|
153
|
+
writer.writeUInt32BE(this.sequence.value);
|
|
154
|
+
writer.writeUInt16BE(this.maxWitnessLen);
|
|
155
|
+
// Test: Use simple u16 length for redeem_script to match rust-bitcoin ScriptBuf
|
|
156
|
+
writer.writeUInt16BE(this.redeemScript.length);
|
|
157
|
+
writer.writeBytes(this.redeemScript);
|
|
158
|
+
return writer.toBuffer();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.FundingInput = FundingInput;
|
|
162
|
+
FundingInput.type = MessageType_1.MessageType.FundingInput;
|
|
163
|
+
//# sourceMappingURL=FundingInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FundingInput.js","sourceRoot":"","sources":["../../lib/messages/FundingInput.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AACjD,2CAA2E;AAE3E,gDAA6C;AAC7C,kCAAmD;AAGnD;;;;GAIG;AACH,MAAa,YAAY;IAAzB;QAoGE;;WAEG;QACI,SAAI,GAAG,YAAY,CAAC,IAAI,CAAC;IA2FlC,CAAC;IA/LC;;;OAGG;IAC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C;QAEzC,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEzC,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAEM,aAAa;QAClB,+EAA+E;QAC/E,gFAAgF;QAChF,MAAM,MAAM,GAAG,IAAI,oBAAY,EAAE,CAAC;QAClC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEzC,kEAAkE;QAClE,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAE3C,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACtC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEzC,gFAAgF;QAChF,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC/C,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAErC,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;;AAjMH,oCAkMC;AAjMe,iBAAI,GAAG,yBAAW,CAAC,YAAY,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { MessageType } from '../MessageType';
|
|
3
|
+
import { IDlcMessage } from './DlcMessage';
|
|
4
|
+
import { IScriptWitnessV0JSON, ScriptWitnessV0 } from './ScriptWitnessV0';
|
|
5
|
+
/**
|
|
6
|
+
* FundingSignatures contains signatures of the funding transaction
|
|
7
|
+
* and any necessary information linking the signatures to their inputs.
|
|
8
|
+
*/
|
|
9
|
+
export declare class FundingSignatures implements IDlcMessage {
|
|
10
|
+
static type: MessageType;
|
|
11
|
+
/**
|
|
12
|
+
* Deserializes a funding_signatures message
|
|
13
|
+
* @param buf
|
|
14
|
+
*/
|
|
15
|
+
static deserialize(buf: Buffer): FundingSignatures;
|
|
16
|
+
/**
|
|
17
|
+
* The type for funding_signatures message. funding_signatures = 42776
|
|
18
|
+
*/
|
|
19
|
+
type: MessageType;
|
|
20
|
+
length: bigint;
|
|
21
|
+
witnessElements: ScriptWitnessV0[][];
|
|
22
|
+
/**
|
|
23
|
+
* Converts funding_signatures to JSON (canonical rust-dlc format)
|
|
24
|
+
*/
|
|
25
|
+
toJSON(): IFundingSignaturesJSON;
|
|
26
|
+
/**
|
|
27
|
+
* Serializes the funding_signatures message into a Buffer
|
|
28
|
+
*/
|
|
29
|
+
serialize(): Buffer;
|
|
30
|
+
}
|
|
31
|
+
export interface IFundingSignaturesJSON {
|
|
32
|
+
fundingSignatures: IFundingSignatureJSON[];
|
|
33
|
+
}
|
|
34
|
+
export interface IFundingSignatureJSON {
|
|
35
|
+
witnessElements: IScriptWitnessV0JSON[];
|
|
36
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FundingSignatures = void 0;
|
|
4
|
+
const bufio_1 = require("@node-dlc/bufio");
|
|
5
|
+
const MessageType_1 = require("../MessageType");
|
|
6
|
+
const ScriptWitnessV0_1 = require("./ScriptWitnessV0");
|
|
7
|
+
/**
|
|
8
|
+
* FundingSignatures contains signatures of the funding transaction
|
|
9
|
+
* and any necessary information linking the signatures to their inputs.
|
|
10
|
+
*/
|
|
11
|
+
class FundingSignatures {
|
|
12
|
+
constructor() {
|
|
13
|
+
/**
|
|
14
|
+
* The type for funding_signatures message. funding_signatures = 42776
|
|
15
|
+
*/
|
|
16
|
+
this.type = FundingSignatures.type;
|
|
17
|
+
this.witnessElements = [];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Deserializes a funding_signatures message
|
|
21
|
+
* @param buf
|
|
22
|
+
*/
|
|
23
|
+
static deserialize(buf) {
|
|
24
|
+
const instance = new FundingSignatures();
|
|
25
|
+
const reader = new bufio_1.BufferReader(buf);
|
|
26
|
+
// reader.readBigSize(); // read type
|
|
27
|
+
// instance.length = reader.readBigSize();
|
|
28
|
+
const numWitnesses = Number(reader.readBigSize());
|
|
29
|
+
for (let i = 0; i < numWitnesses; i++) {
|
|
30
|
+
const numWitnessElements = Number(reader.readBigSize());
|
|
31
|
+
const witnessElements = [];
|
|
32
|
+
for (let j = 0; j < numWitnessElements; j++) {
|
|
33
|
+
// Read witness element directly: [bigsize:len][len*byte:witness]
|
|
34
|
+
const witnessLength = Number(reader.readBigSize());
|
|
35
|
+
const witnessBytes = reader.readBytes(witnessLength);
|
|
36
|
+
const witness = new ScriptWitnessV0_1.ScriptWitnessV0();
|
|
37
|
+
witness.length = witnessLength;
|
|
38
|
+
witness.witness = witnessBytes;
|
|
39
|
+
witnessElements.push(witness);
|
|
40
|
+
}
|
|
41
|
+
instance.witnessElements.push(witnessElements);
|
|
42
|
+
}
|
|
43
|
+
return instance;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Converts funding_signatures to JSON (canonical rust-dlc format)
|
|
47
|
+
*/
|
|
48
|
+
toJSON() {
|
|
49
|
+
return {
|
|
50
|
+
fundingSignatures: this.witnessElements.map((witnessElement) => {
|
|
51
|
+
return {
|
|
52
|
+
witnessElements: witnessElement.map((witness) => witness.toJSON()),
|
|
53
|
+
};
|
|
54
|
+
}),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Serializes the funding_signatures message into a Buffer
|
|
59
|
+
*/
|
|
60
|
+
serialize() {
|
|
61
|
+
const writer = new bufio_1.BufferWriter();
|
|
62
|
+
// writer.writeBigSize(this.type);
|
|
63
|
+
const dataWriter = new bufio_1.BufferWriter();
|
|
64
|
+
dataWriter.writeBigSize(this.witnessElements.length);
|
|
65
|
+
for (const witnessElements of this.witnessElements) {
|
|
66
|
+
dataWriter.writeBigSize(witnessElements.length);
|
|
67
|
+
for (const witnessElement of witnessElements) {
|
|
68
|
+
dataWriter.writeBytes(witnessElement.serialize());
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// writer.writeBigSize(dataWriter.size);
|
|
72
|
+
writer.writeBytes(dataWriter.toBuffer());
|
|
73
|
+
return writer.toBuffer();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.FundingSignatures = FundingSignatures;
|
|
77
|
+
FundingSignatures.type = MessageType_1.MessageType.FundingSignatures;
|
|
78
|
+
//# sourceMappingURL=FundingSignatures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FundingSignatures.js","sourceRoot":"","sources":["../../lib/messages/FundingSignatures.ts"],"names":[],"mappings":";;;AAAA,2CAA6D;AAE7D,gDAA6C;AAE7C,uDAA0E;AAE1E;;;GAGG;AACH,MAAa,iBAAiB;IAA9B;QAkCE;;WAEG;QACI,SAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC;QAI9B,oBAAe,GAAwB,EAAE,CAAC;IAsCnD,CAAC;IA5EC;;;OAGG;IACI,MAAM,CAAC,WAAW,CAAC,GAAW;QACnC,MAAM,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,IAAI,oBAAY,CAAC,GAAG,CAAC,CAAC;QAErC,qCAAqC;QACrC,0CAA0C;QAC1C,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QAElD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,W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