@atomicfinance/types 3.6.1 → 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/.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 +64 -0
- package/dist/dlc.d.ts +3 -3
- package/dist/models/Output.js.map +1 -1
- package/lib/dlc.ts +4 -14
- package/lib/models/Output.ts +4 -1
- package/package.json +4 -4
- package/yalc.lock +10 -0
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DlcAcceptContainer = exports.DlcAcceptWithoutSigs = exports.DlcAccept = void 0;
|
|
7
|
+
const bitcoin_1 = require("@node-dlc/bitcoin");
|
|
8
|
+
const bufio_1 = require("@node-dlc/bufio");
|
|
9
|
+
const crypto_1 = require("@node-dlc/crypto");
|
|
10
|
+
const bitcoinjs_lib_1 = require("bitcoinjs-lib");
|
|
11
|
+
const secp256k1_1 = __importDefault(require("secp256k1"));
|
|
12
|
+
const MessageType_1 = require("../MessageType");
|
|
13
|
+
const deserializeTlv_1 = require("../serialize/deserializeTlv");
|
|
14
|
+
const getTlv_1 = require("../serialize/getTlv");
|
|
15
|
+
const util_1 = require("../util");
|
|
16
|
+
const BatchFundingGroup_1 = require("./BatchFundingGroup");
|
|
17
|
+
const CetAdaptorSignatures_1 = require("./CetAdaptorSignatures");
|
|
18
|
+
const FundingInput_1 = require("./FundingInput");
|
|
19
|
+
const NegotiationFields_1 = require("./NegotiationFields");
|
|
20
|
+
/**
|
|
21
|
+
* DlcAccept contains information about a node and indicates its
|
|
22
|
+
* acceptance of the new DLC, as well as its CET and refund
|
|
23
|
+
* transaction signatures. This is the second step toward creating
|
|
24
|
+
* the funding transaction and closing transactions.
|
|
25
|
+
* Updated to support dlcspecs PR #163 format.
|
|
26
|
+
*/
|
|
27
|
+
class DlcAccept {
|
|
28
|
+
constructor() {
|
|
29
|
+
/**
|
|
30
|
+
* The type for accept_dlc message. accept_dlc = 42780
|
|
31
|
+
*/
|
|
32
|
+
this.type = DlcAccept.type;
|
|
33
|
+
// New fields as per dlcspecs PR #163
|
|
34
|
+
this.protocolVersion = MessageType_1.PROTOCOL_VERSION; // Default to current protocol version
|
|
35
|
+
this.fundingInputs = [];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates a DlcAccept from JSON data (e.g., from test vectors)
|
|
39
|
+
* Handles both our internal format and external test vector formats
|
|
40
|
+
* @param json JSON object representing a DLC accept
|
|
41
|
+
*/
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
|
43
|
+
static fromJSON(json) {
|
|
44
|
+
const instance = new DlcAccept();
|
|
45
|
+
// Helper function to parse DER-encoded signature and extract raw r,s values (64 bytes total)
|
|
46
|
+
const parseDerSignature = (hexSig) => {
|
|
47
|
+
const sigBuffer = Buffer.from(hexSig, 'hex');
|
|
48
|
+
// If it's already 64 bytes, assume it's raw
|
|
49
|
+
if (sigBuffer.length === 64) {
|
|
50
|
+
return sigBuffer;
|
|
51
|
+
}
|
|
52
|
+
// Use secp256k1.signatureImport to parse DER signature
|
|
53
|
+
try {
|
|
54
|
+
const rawSig = secp256k1_1.default.signatureImport(sigBuffer);
|
|
55
|
+
return Buffer.from(rawSig);
|
|
56
|
+
}
|
|
57
|
+
catch (ex) {
|
|
58
|
+
throw new Error(`Invalid DER signature: ${ex.message}`);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
// Handle both internal and external field naming conventions
|
|
62
|
+
instance.protocolVersion =
|
|
63
|
+
json.protocolVersion || json.protocol_version || MessageType_1.PROTOCOL_VERSION;
|
|
64
|
+
instance.temporaryContractId = Buffer.from(json.temporaryContractId ||
|
|
65
|
+
json.tempContractId ||
|
|
66
|
+
json.temporary_contract_id, 'hex');
|
|
67
|
+
instance.acceptCollateral = (0, util_1.toBigInt)(json.acceptCollateral ||
|
|
68
|
+
json.acceptCollateralSatoshis ||
|
|
69
|
+
json.accept_collateral);
|
|
70
|
+
// Handle field name variations between formats
|
|
71
|
+
instance.fundingPubkey = Buffer.from(json.fundingPubkey || json.fundingPubKey || json.funding_pubkey, 'hex');
|
|
72
|
+
instance.payoutSpk = Buffer.from(json.payoutSpk || json.payoutSPK || json.payout_spk, 'hex');
|
|
73
|
+
instance.payoutSerialId = (0, util_1.toBigInt)(json.payoutSerialId || json.payout_serial_id);
|
|
74
|
+
instance.changeSpk = Buffer.from(json.changeSpk || json.changeSPK || json.change_spk, 'hex');
|
|
75
|
+
instance.changeSerialId = (0, util_1.toBigInt)(json.changeSerialId || json.change_serial_id);
|
|
76
|
+
// Parse FundingInputs
|
|
77
|
+
instance.fundingInputs = DlcAccept.parseFundingInputsFromJSON(json.fundingInputs || json.funding_inputs || []);
|
|
78
|
+
// Parse CET adaptor signatures
|
|
79
|
+
instance.cetAdaptorSignatures = DlcAccept.parseCetAdaptorSignaturesFromJSON(json.cetAdaptorSignatures || json.cet_adaptor_signatures);
|
|
80
|
+
// Parse refund signature - handle DER encoding
|
|
81
|
+
const refundSigHex = json.refundSignature || json.refund_signature;
|
|
82
|
+
instance.refundSignature = parseDerSignature(refundSigHex);
|
|
83
|
+
// Parse optional negotiation fields
|
|
84
|
+
if (json.negotiationFields || json.negotiation_fields) {
|
|
85
|
+
instance.negotiationFields = DlcAccept.parseNegotiationFieldsFromJSON(json.negotiationFields || json.negotiation_fields);
|
|
86
|
+
}
|
|
87
|
+
return instance;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Parses FundingInputs from JSON
|
|
91
|
+
* @param fundingInputsJson Array of JSON objects representing funding inputs
|
|
92
|
+
*/
|
|
93
|
+
static parseFundingInputsFromJSON(fundingInputsJson) {
|
|
94
|
+
return fundingInputsJson.map((inputJson) => {
|
|
95
|
+
// Use the existing FundingInput.fromJSON method which handles all the field mapping correctly
|
|
96
|
+
return FundingInput_1.FundingInput.fromJSON(inputJson);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Parses CetAdaptorSignatures from JSON
|
|
101
|
+
* @param cetSigsJson JSON object representing CET adaptor signatures
|
|
102
|
+
*/
|
|
103
|
+
static parseCetAdaptorSignaturesFromJSON(cetSigsJson) {
|
|
104
|
+
const instance = new CetAdaptorSignatures_1.CetAdaptorSignatures();
|
|
105
|
+
if (cetSigsJson.ecdsaAdaptorSignatures ||
|
|
106
|
+
cetSigsJson.ecdsa_adaptor_signatures) {
|
|
107
|
+
const ecdsaSigs = cetSigsJson.ecdsaAdaptorSignatures ||
|
|
108
|
+
cetSigsJson.ecdsa_adaptor_signatures;
|
|
109
|
+
instance.sigs = ecdsaSigs.map((sig) => {
|
|
110
|
+
// The test vectors use 'signature' field, but our internal format uses encryptedSig/dleqProof
|
|
111
|
+
// Adaptor signatures have different format than regular ECDSA (65 bytes + 97 bytes)
|
|
112
|
+
const sigBuffer = Buffer.from(sig.signature, 'hex');
|
|
113
|
+
return {
|
|
114
|
+
encryptedSig: sigBuffer.slice(0, 65),
|
|
115
|
+
dleqProof: sigBuffer.length > 65 ? sigBuffer.slice(65, 162) : Buffer.alloc(97), // Next 97 bytes or empty
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return instance;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Parses NegotiationFields from JSON
|
|
123
|
+
* @param negotiationJson JSON object representing negotiation fields
|
|
124
|
+
*/
|
|
125
|
+
static parseNegotiationFieldsFromJSON(negotiationJson) {
|
|
126
|
+
return NegotiationFields_1.NegotiationFields.fromJSON(negotiationJson);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Deserializes an accept_dlc message
|
|
130
|
+
* @param buf
|
|
131
|
+
*/
|
|
132
|
+
static deserialize(buf, parseCets = true) {
|
|
133
|
+
const instance = new DlcAccept();
|
|
134
|
+
const reader = new bufio_1.BufferReader(buf);
|
|
135
|
+
reader.readUInt16BE(); // read type
|
|
136
|
+
// New fields as per dlcspecs PR #163
|
|
137
|
+
instance.protocolVersion = reader.readUInt32BE();
|
|
138
|
+
instance.temporaryContractId = reader.readBytes(32);
|
|
139
|
+
instance.acceptCollateral = reader.readUInt64BE();
|
|
140
|
+
instance.fundingPubkey = reader.readBytes(33);
|
|
141
|
+
const payoutSpkLen = reader.readUInt16BE();
|
|
142
|
+
instance.payoutSpk = reader.readBytes(payoutSpkLen);
|
|
143
|
+
instance.payoutSerialId = reader.readUInt64BE();
|
|
144
|
+
// Changed from u16 to bigsize as per dlcspecs PR #163
|
|
145
|
+
const fundingInputsLen = Number(reader.readBigSize());
|
|
146
|
+
for (let i = 0; i < fundingInputsLen; i++) {
|
|
147
|
+
// FundingInput body is serialized directly without TLV wrapper in rust-dlc format
|
|
148
|
+
const fundingInput = FundingInput_1.FundingInput.deserializeBody(reader.buffer.subarray(reader.position));
|
|
149
|
+
instance.fundingInputs.push(fundingInput);
|
|
150
|
+
// Skip past the FundingInput we just read
|
|
151
|
+
const fundingInputLength = fundingInput.serializeBody().length;
|
|
152
|
+
reader.position += fundingInputLength;
|
|
153
|
+
}
|
|
154
|
+
const changeSpkLen = reader.readUInt16BE();
|
|
155
|
+
instance.changeSpk = reader.readBytes(changeSpkLen);
|
|
156
|
+
instance.changeSerialId = reader.readUInt64BE();
|
|
157
|
+
if (parseCets) {
|
|
158
|
+
// Read CET adaptor signatures directly to match serialize format (no TLV wrapping)
|
|
159
|
+
instance.cetAdaptorSignatures = CetAdaptorSignatures_1.CetAdaptorSignatures.deserialize(reader.buffer.subarray(reader.position));
|
|
160
|
+
// Skip past the CET adaptor signatures we just read
|
|
161
|
+
const cetLength = instance.cetAdaptorSignatures.serialize().length;
|
|
162
|
+
reader.position += cetLength;
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
instance.cetAdaptorSignatures = new CetAdaptorSignatures_1.CetAdaptorSignatures();
|
|
166
|
+
}
|
|
167
|
+
instance.refundSignature = reader.readBytes(64);
|
|
168
|
+
// negotiation_fields is now optional as per dlcspecs PR #163
|
|
169
|
+
// Check if there's enough data left for the new format fields (backward compatibility)
|
|
170
|
+
// The old format ends exactly after refundSignature. If there's more data, it should be new format.
|
|
171
|
+
const remainingBytes = reader.buffer.length - reader.position;
|
|
172
|
+
if (remainingBytes > 0) {
|
|
173
|
+
// Only try to parse new fields if we have a reasonable amount of extra data
|
|
174
|
+
// A single stray byte is likely not valid new format data
|
|
175
|
+
if (remainingBytes >= 1) {
|
|
176
|
+
try {
|
|
177
|
+
const hasNegotiationFields = reader.readUInt8();
|
|
178
|
+
if (hasNegotiationFields === 0x01) {
|
|
179
|
+
instance.negotiationFields = NegotiationFields_1.NegotiationFields.deserialize((0, getTlv_1.getTlv)(reader));
|
|
180
|
+
}
|
|
181
|
+
// Parse TLV stream as per dlcspecs PR #163
|
|
182
|
+
// Only continue if there's still data left after the hasNegotiationFields flag
|
|
183
|
+
while (reader.position < reader.buffer.length) {
|
|
184
|
+
const buf = (0, getTlv_1.getTlv)(reader);
|
|
185
|
+
const tlvReader = new bufio_1.BufferReader(buf);
|
|
186
|
+
const { type } = (0, deserializeTlv_1.deserializeTlv)(tlvReader);
|
|
187
|
+
switch (Number(type)) {
|
|
188
|
+
case MessageType_1.MessageType.BatchFundingGroup:
|
|
189
|
+
if (!instance.batchFundingGroups) {
|
|
190
|
+
instance.batchFundingGroups = [];
|
|
191
|
+
}
|
|
192
|
+
instance.batchFundingGroups.push(BatchFundingGroup_1.BatchFundingGroup.deserialize(buf));
|
|
193
|
+
break;
|
|
194
|
+
default:
|
|
195
|
+
// Store unknown TLVs for future compatibility
|
|
196
|
+
if (!instance.unknownTlvs) {
|
|
197
|
+
instance.unknownTlvs = [];
|
|
198
|
+
}
|
|
199
|
+
instance.unknownTlvs.push({ type: Number(type), data: buf });
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
// If parsing new format fails, assume it's old format and ignore the extra bytes
|
|
206
|
+
// This provides backward compatibility for malformed or old format data
|
|
207
|
+
// Silently ignore parsing errors for backward compatibility
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return instance;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Get funding, change and payout address from DlcAccept
|
|
215
|
+
* @param network Bitcoin Network
|
|
216
|
+
* @returns {IDlcAcceptAddresses}
|
|
217
|
+
*/
|
|
218
|
+
getAddresses(network) {
|
|
219
|
+
const fundingSPK = bitcoin_1.Script.p2wpkhLock((0, crypto_1.hash160)(this.fundingPubkey))
|
|
220
|
+
.serialize()
|
|
221
|
+
.slice(1);
|
|
222
|
+
const fundingAddress = bitcoinjs_lib_1.address.fromOutputScript(fundingSPK, network);
|
|
223
|
+
const changeAddress = bitcoinjs_lib_1.address.fromOutputScript(this.changeSpk, network);
|
|
224
|
+
const payoutAddress = bitcoinjs_lib_1.address.fromOutputScript(this.payoutSpk, network);
|
|
225
|
+
return {
|
|
226
|
+
fundingAddress,
|
|
227
|
+
changeAddress,
|
|
228
|
+
payoutAddress,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Validates correctness of all fields
|
|
233
|
+
* Updated validation rules as per dlcspecs PR #163
|
|
234
|
+
* https://github.com/discreetlogcontracts/dlcspecs/blob/master/Protocol.md#the-accept_dlc-message
|
|
235
|
+
* @throws Will throw an error if validation fails
|
|
236
|
+
*/
|
|
237
|
+
validate() {
|
|
238
|
+
// 1. Type is set automatically in class
|
|
239
|
+
// 2. protocol_version validation
|
|
240
|
+
if (this.protocolVersion !== MessageType_1.PROTOCOL_VERSION) {
|
|
241
|
+
throw new Error(`Unsupported protocol version: ${this.protocolVersion}, expected: ${MessageType_1.PROTOCOL_VERSION}`);
|
|
242
|
+
}
|
|
243
|
+
// 3. temporary_contract_id must match the one from offer_dlc
|
|
244
|
+
if (!this.temporaryContractId || this.temporaryContractId.length !== 32) {
|
|
245
|
+
throw new Error('temporaryContractId must be 32 bytes');
|
|
246
|
+
}
|
|
247
|
+
// 4. payout_spk and change_spk must be standard script pubkeys
|
|
248
|
+
try {
|
|
249
|
+
bitcoinjs_lib_1.address.fromOutputScript(this.payoutSpk);
|
|
250
|
+
}
|
|
251
|
+
catch (e) {
|
|
252
|
+
throw new Error('payoutSpk is invalid');
|
|
253
|
+
}
|
|
254
|
+
try {
|
|
255
|
+
bitcoinjs_lib_1.address.fromOutputScript(this.changeSpk);
|
|
256
|
+
}
|
|
257
|
+
catch (e) {
|
|
258
|
+
throw new Error('changeSpk is invalid');
|
|
259
|
+
}
|
|
260
|
+
// 5. funding_pubkey must be a valid secp256k1 pubkey in compressed format
|
|
261
|
+
// https://github.com/bitcoin/bips/blob/master/bip-0137.mediawiki#background-on-ecdsa-signatures
|
|
262
|
+
if (secp256k1_1.default.publicKeyVerify(Buffer.from(this.fundingPubkey))) {
|
|
263
|
+
if (this.fundingPubkey[0] != 0x02 && this.fundingPubkey[0] != 0x03) {
|
|
264
|
+
throw new Error('fundingPubkey must be in compressed format');
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
throw new Error('fundingPubkey is not a valid secp256k1 key');
|
|
269
|
+
}
|
|
270
|
+
// 6. inputSerialId must be unique for each input
|
|
271
|
+
const inputSerialIds = this.fundingInputs.map((input) => input.inputSerialId);
|
|
272
|
+
if (new Set(inputSerialIds).size !== inputSerialIds.length) {
|
|
273
|
+
throw new Error('inputSerialIds must be unique');
|
|
274
|
+
}
|
|
275
|
+
// 7. Ensure funding inputs are segwit
|
|
276
|
+
this.fundingInputs.forEach((input) => input.validate());
|
|
277
|
+
// 8. validate funding amount
|
|
278
|
+
const fundingAmount = this.fundingInputs.reduce((acc, fundingInput) => {
|
|
279
|
+
const input = fundingInput;
|
|
280
|
+
return acc + input.prevTx.outputs[input.prevTxVout].value.sats;
|
|
281
|
+
}, BigInt(0));
|
|
282
|
+
if (this.acceptCollateral >= fundingAmount) {
|
|
283
|
+
throw new Error('fundingAmount must be greater than acceptCollateral');
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Converts accept_dlc to JSON (canonical rust-dlc format)
|
|
288
|
+
*/
|
|
289
|
+
toJSON() {
|
|
290
|
+
// Convert raw signature back to DER format for canonical rust-dlc JSON
|
|
291
|
+
const derRefundSignature = secp256k1_1.default.signatureExport(this.refundSignature);
|
|
292
|
+
return {
|
|
293
|
+
protocolVersion: this.protocolVersion,
|
|
294
|
+
temporaryContractId: this.temporaryContractId.toString('hex'),
|
|
295
|
+
acceptCollateral: (0, util_1.bigIntToNumber)(this.acceptCollateral),
|
|
296
|
+
fundingPubkey: this.fundingPubkey.toString('hex'),
|
|
297
|
+
payoutSpk: this.payoutSpk.toString('hex'),
|
|
298
|
+
payoutSerialId: (0, util_1.bigIntToNumber)(this.payoutSerialId),
|
|
299
|
+
fundingInputs: this.fundingInputs.map((input) => input.toJSON()),
|
|
300
|
+
changeSpk: this.changeSpk.toString('hex'),
|
|
301
|
+
changeSerialId: (0, util_1.bigIntToNumber)(this.changeSerialId),
|
|
302
|
+
cetAdaptorSignatures: this.cetAdaptorSignatures.toJSON(),
|
|
303
|
+
refundSignature: Buffer.from(derRefundSignature).toString('hex'),
|
|
304
|
+
negotiationFields: this.negotiationFields?.toJSON(),
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Serializes the accept_dlc message into a Buffer
|
|
309
|
+
* Updated serialization format as per dlcspecs PR #163
|
|
310
|
+
*/
|
|
311
|
+
serialize() {
|
|
312
|
+
const writer = new bufio_1.BufferWriter();
|
|
313
|
+
writer.writeUInt16BE(this.type);
|
|
314
|
+
// New fields as per dlcspecs PR #163
|
|
315
|
+
writer.writeUInt32BE(this.protocolVersion);
|
|
316
|
+
writer.writeBytes(this.temporaryContractId);
|
|
317
|
+
writer.writeUInt64BE(this.acceptCollateral);
|
|
318
|
+
writer.writeBytes(this.fundingPubkey);
|
|
319
|
+
writer.writeUInt16BE(this.payoutSpk.length);
|
|
320
|
+
writer.writeBytes(this.payoutSpk);
|
|
321
|
+
writer.writeUInt64BE(this.payoutSerialId);
|
|
322
|
+
// Changed from u16 to bigsize as per dlcspecs PR #163
|
|
323
|
+
writer.writeBigSize(this.fundingInputs.length);
|
|
324
|
+
for (const fundingInput of this.fundingInputs) {
|
|
325
|
+
// Use serializeBody() to match rust-dlc behavior - funding inputs in vec are serialized without TLV wrapper
|
|
326
|
+
writer.writeBytes(fundingInput.serializeBody());
|
|
327
|
+
}
|
|
328
|
+
writer.writeUInt16BE(this.changeSpk.length);
|
|
329
|
+
writer.writeBytes(this.changeSpk);
|
|
330
|
+
writer.writeUInt64BE(this.changeSerialId);
|
|
331
|
+
writer.writeBytes(this.cetAdaptorSignatures.serialize());
|
|
332
|
+
writer.writeBytes(this.refundSignature);
|
|
333
|
+
// negotiation_fields is now optional as per dlcspecs PR #163
|
|
334
|
+
if (this.negotiationFields) {
|
|
335
|
+
writer.writeUInt8(0x01); // present
|
|
336
|
+
writer.writeBytes(this.negotiationFields.serialize());
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
writer.writeUInt8(0x00); // absent
|
|
340
|
+
}
|
|
341
|
+
// TLV stream as per dlcspecs PR #163
|
|
342
|
+
if (this.batchFundingGroups)
|
|
343
|
+
this.batchFundingGroups.forEach((fundingInfo) => writer.writeBytes(fundingInfo.serialize()));
|
|
344
|
+
// Write unknown TLVs for forward compatibility
|
|
345
|
+
if (this.unknownTlvs) {
|
|
346
|
+
this.unknownTlvs.forEach((tlv) => {
|
|
347
|
+
writer.writeBytes(tlv.data);
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
return writer.toBuffer();
|
|
351
|
+
}
|
|
352
|
+
withoutSigs() {
|
|
353
|
+
return new DlcAcceptWithoutSigs(this.protocolVersion, this.temporaryContractId, this.acceptCollateral, this.fundingPubkey, this.payoutSpk, this.payoutSerialId, this.fundingInputs, this.changeSpk, this.changeSerialId, this.negotiationFields, this.batchFundingGroups);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
exports.DlcAccept = DlcAccept;
|
|
357
|
+
DlcAccept.type = MessageType_1.MessageType.DlcAccept;
|
|
358
|
+
class DlcAcceptWithoutSigs {
|
|
359
|
+
constructor(protocolVersion, temporaryContractId, acceptCollateral, fundingPubkey, payoutSpk, payoutSerialId, fundingInputs, changeSpk, changeSerialId, negotiationFields, batchFundingGroups) {
|
|
360
|
+
this.protocolVersion = protocolVersion;
|
|
361
|
+
this.temporaryContractId = temporaryContractId;
|
|
362
|
+
this.acceptCollateral = acceptCollateral;
|
|
363
|
+
this.fundingPubkey = fundingPubkey;
|
|
364
|
+
this.payoutSpk = payoutSpk;
|
|
365
|
+
this.payoutSerialId = payoutSerialId;
|
|
366
|
+
this.fundingInputs = fundingInputs;
|
|
367
|
+
this.changeSpk = changeSpk;
|
|
368
|
+
this.changeSerialId = changeSerialId;
|
|
369
|
+
this.negotiationFields = negotiationFields;
|
|
370
|
+
this.batchFundingGroups = batchFundingGroups;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
exports.DlcAcceptWithoutSigs = DlcAcceptWithoutSigs;
|
|
374
|
+
class DlcAcceptContainer {
|
|
375
|
+
constructor() {
|
|
376
|
+
this.accepts = [];
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Adds a DlcAccept to the container.
|
|
380
|
+
* @param accept The DlcAccept to add.
|
|
381
|
+
*/
|
|
382
|
+
addAccept(accept) {
|
|
383
|
+
this.accepts.push(accept);
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Returns all DlcAccepts in the container.
|
|
387
|
+
* @returns An array of DlcAccept instances.
|
|
388
|
+
*/
|
|
389
|
+
getAccepts() {
|
|
390
|
+
return this.accepts;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Serializes all DlcAccepts in the container to a Buffer.
|
|
394
|
+
* @returns A Buffer containing the serialized DlcAccepts.
|
|
395
|
+
*/
|
|
396
|
+
serialize() {
|
|
397
|
+
const writer = new bufio_1.BufferWriter();
|
|
398
|
+
// Write the number of accepts in the container first.
|
|
399
|
+
writer.writeBigSize(this.accepts.length);
|
|
400
|
+
// Serialize each accept and write it.
|
|
401
|
+
this.accepts.forEach((accept) => {
|
|
402
|
+
const serializedAccept = accept.serialize();
|
|
403
|
+
// Optionally, write the length of the serialized accept for easier deserialization.
|
|
404
|
+
writer.writeBigSize(serializedAccept.length);
|
|
405
|
+
writer.writeBytes(serializedAccept);
|
|
406
|
+
});
|
|
407
|
+
return writer.toBuffer();
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Deserializes a Buffer into a DlcAcceptContainer with DlcAccepts.
|
|
411
|
+
* @param buf The Buffer to deserialize.
|
|
412
|
+
* @returns A DlcAcceptContainer instance.
|
|
413
|
+
*/
|
|
414
|
+
static deserialize(buf, parseCets = true) {
|
|
415
|
+
const reader = new bufio_1.BufferReader(buf);
|
|
416
|
+
const container = new DlcAcceptContainer();
|
|
417
|
+
const acceptsCount = reader.readBigSize();
|
|
418
|
+
for (let i = 0; i < acceptsCount; i++) {
|
|
419
|
+
const acceptLength = reader.readBigSize();
|
|
420
|
+
const acceptBuf = reader.readBytes(Number(acceptLength));
|
|
421
|
+
const accept = DlcAccept.deserialize(acceptBuf, parseCets);
|
|
422
|
+
container.addAccept(accept);
|
|
423
|
+
}
|
|
424
|
+
return container;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
exports.DlcAcceptContainer = DlcAcceptContainer;
|
|
428
|
+
//# sourceMappingURL=DlcAccept.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DlcAccept.js","sourceRoot":"","sources":["../../lib/messages/DlcAccept.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAyD;AACzD,2CAA2E;AAC3E,6CAA2C;AAE3C,iDAAwC;AACxC,0DAAkC;AAElC,gDAA+D;AAC/D,gEAA6D;AAC7D,gDAAsD;AACtD,kCAAmD;AACnD,2DAAgF;AAChF,iEAGgC;AAEhC,iDAAiE;AACjE,2DAK6B;AAE7B;;;;;;GAMG;AACH,MAAa,SAAS;IAAtB;QA0PE;;WAEG;QACI,SAAI,GAAG,SAAS,CAAC,IAAI,CAAC;QAE7B,qCAAqC;QAC9B,oBAAe,GAAW,8BAAgB,CAAC,CAAC,sCAAsC;QAalF,kBAAa,GAAmB,EAAE,CAAC;IAqM5C,CAAC;IA/cC;;;;OAIG;IACH,iHAAiH;IAC1G,MAAM,CAAC,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,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC9B,MAAM,gBAAgB,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;YAC5C,oFAAoF;YACpF,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;YAC7C,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAC,GAAW,EAAE,SAAS,GAAG,IAAI;QACrD,MAAM,MAAM,GAAG,IAAI,oBAAY,CAAC,GAAG,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAC3C,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YAC1C,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;YACzD,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YAC3D,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;SAC7B;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAtDD,gDAsDC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { MessageType } from '../MessageType';
|
|
3
|
+
import { IDlcMessage } from './DlcMessage';
|
|
4
|
+
/**
|
|
5
|
+
* DlcCancel message contains information about a node's desire to cancel
|
|
6
|
+
* a DLC contract negotiation.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DlcCancel implements IDlcMessage {
|
|
9
|
+
static type: MessageType;
|
|
10
|
+
/**
|
|
11
|
+
* Deserializes a dlc_cancel message
|
|
12
|
+
* @param buf
|
|
13
|
+
*/
|
|
14
|
+
static deserialize(buf: Buffer): DlcCancel;
|
|
15
|
+
/**
|
|
16
|
+
* The type for dlc_cancel message. dlc_cancel = 52172
|
|
17
|
+
*/
|
|
18
|
+
type: MessageType;
|
|
19
|
+
contractId: Buffer;
|
|
20
|
+
cancelType: CancelType;
|
|
21
|
+
/**
|
|
22
|
+
* Serializes the dlc_cancel message into a Buffer
|
|
23
|
+
*/
|
|
24
|
+
serialize(): Buffer;
|
|
25
|
+
}
|
|
26
|
+
export declare enum CancelType {
|
|
27
|
+
Unknown = 0,
|
|
28
|
+
Market = 1,
|
|
29
|
+
Error = 2
|
|
30
|
+
}
|
|
31
|
+
export declare const DlcCancelV0: typeof DlcCancel;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DlcCancelV0 = exports.CancelType = exports.DlcCancel = void 0;
|
|
4
|
+
const bufio_1 = require("@node-dlc/bufio");
|
|
5
|
+
const MessageType_1 = require("../MessageType");
|
|
6
|
+
/**
|
|
7
|
+
* DlcCancel message contains information about a node's desire to cancel
|
|
8
|
+
* a DLC contract negotiation.
|
|
9
|
+
*/
|
|
10
|
+
class DlcCancel {
|
|
11
|
+
constructor() {
|
|
12
|
+
/**
|
|
13
|
+
* The type for dlc_cancel message. dlc_cancel = 52172
|
|
14
|
+
*/
|
|
15
|
+
this.type = DlcCancel.type;
|
|
16
|
+
this.cancelType = 0;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Deserializes a dlc_cancel message
|
|
20
|
+
* @param buf
|
|
21
|
+
*/
|
|
22
|
+
static deserialize(buf) {
|
|
23
|
+
const instance = new DlcCancel();
|
|
24
|
+
const reader = new bufio_1.BufferReader(buf);
|
|
25
|
+
reader.readUInt16BE(); // read type
|
|
26
|
+
instance.contractId = reader.readBytes(32);
|
|
27
|
+
instance.cancelType = reader.readUInt8();
|
|
28
|
+
return instance;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Serializes the dlc_cancel message into a Buffer
|
|
32
|
+
*/
|
|
33
|
+
serialize() {
|
|
34
|
+
const writer = new bufio_1.BufferWriter();
|
|
35
|
+
writer.writeUInt16BE(this.type);
|
|
36
|
+
writer.writeBytes(this.contractId);
|
|
37
|
+
writer.writeUInt8(this.cancelType);
|
|
38
|
+
return writer.toBuffer();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.DlcCancel = DlcCancel;
|
|
42
|
+
DlcCancel.type = MessageType_1.MessageType.DlcCancel;
|
|
43
|
+
var CancelType;
|
|
44
|
+
(function (CancelType) {
|
|
45
|
+
CancelType[CancelType["Unknown"] = 0] = "Unknown";
|
|
46
|
+
CancelType[CancelType["Market"] = 1] = "Market";
|
|
47
|
+
CancelType[CancelType["Error"] = 2] = "Error";
|
|
48
|
+
})(CancelType = exports.CancelType || (exports.CancelType = {}));
|
|
49
|
+
// Backward compatibility alias
|
|
50
|
+
exports.DlcCancelV0 = DlcCancel;
|
|
51
|
+
//# sourceMappingURL=DlcCancel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DlcCancel.js","sourceRoot":"","sources":["../../lib/messages/DlcCancel.ts"],"names":[],"mappings":";;;AAAA,2CAA6D;AAE7D,gDAA6C;AAG7C;;;GAGG;AACH,MAAa,SAAS;IAAtB;QAkBE;;WAEG;QACI,SAAI,GAAG,SAAS,CAAC,IAAI,CAAC;QAItB,eAAU,GAAe,CAAC,CAAC;IAapC,CAAC;IAnCC;;;OAGG;IACI,MAAM,CAAC,WAAW,CAAC,GAAW;QACnC,MAAM,QAAQ,GAAG,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,oBAAY,CAAC,GAAG,CAAC,CAAC;QAErC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,YAAY;QACnC,QAAQ,CAAC,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAC3C,QAAQ,CAAC,UAAU,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QAEzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAWD;;OAEG;IACI,SAAS;QACd,MAAM,MAAM,GAAG,IAAI,oBAAY,EAAE,CAAC;QAClC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEnC,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;;AArCH,8BAsCC;AArCe,cAAI,GAAG,yBAAW,CAAC,SAAS,CAAC;AAuC7C,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iDAAW,CAAA;IACX,+CAAU,CAAA;IACV,6CAAS,CAAA;AACX,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB;AAED,+BAA+B;AAClB,QAAA,WAAW,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { MessageType } from '../MessageType';
|
|
3
|
+
import { IDlcMessage } from './DlcMessage';
|
|
4
|
+
import { FundingInput, IFundingInputJSON } from './FundingInput';
|
|
5
|
+
import { FundingSignatures, IFundingSignaturesJSON } from './FundingSignatures';
|
|
6
|
+
/**
|
|
7
|
+
* DlcClose message contains information about a node and indicates its
|
|
8
|
+
* desire to close an existing contract.
|
|
9
|
+
* Updated to follow DlcOffer architectural patterns.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DlcClose implements IDlcMessage {
|
|
12
|
+
static type: MessageType;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a DlcClose from JSON data (e.g., from test vectors)
|
|
15
|
+
* Handles both our internal format and external test vector formats
|
|
16
|
+
* @param json JSON object representing a DLC close message
|
|
17
|
+
*/
|
|
18
|
+
static fromJSON(json: any): DlcClose;
|
|
19
|
+
/**
|
|
20
|
+
* Deserializes a close_dlc message with backward compatibility
|
|
21
|
+
* Detects old format (without protocol_version) vs new format (with protocol_version)
|
|
22
|
+
* @param buf
|
|
23
|
+
*/
|
|
24
|
+
static deserialize(buf: Buffer): DlcClose;
|
|
25
|
+
/**
|
|
26
|
+
* The type for close_dlc message. close_dlc = 52170
|
|
27
|
+
*/
|
|
28
|
+
type: MessageType;
|
|
29
|
+
protocolVersion: number;
|
|
30
|
+
contractId: Buffer;
|
|
31
|
+
closeSignature: Buffer;
|
|
32
|
+
offerPayoutSatoshis: bigint;
|
|
33
|
+
acceptPayoutSatoshis: bigint;
|
|
34
|
+
fundInputSerialId: bigint;
|
|
35
|
+
fundingInputs: FundingInput[];
|
|
36
|
+
fundingSignatures: FundingSignatures;
|
|
37
|
+
unknownTlvs?: Array<{
|
|
38
|
+
type: number;
|
|
39
|
+
data: Buffer;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Validates correctness of all fields
|
|
43
|
+
* @throws Will throw an error if validation fails
|
|
44
|
+
*/
|
|
45
|
+
validate(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Converts dlc_close to JSON (canonical rust-dlc format)
|
|
48
|
+
*/
|
|
49
|
+
toJSON(): IDlcCloseJSON;
|
|
50
|
+
/**
|
|
51
|
+
* Serializes the close_dlc message into a Buffer
|
|
52
|
+
* Updated serialization format to match DlcOffer patterns
|
|
53
|
+
*/
|
|
54
|
+
serialize(): Buffer;
|
|
55
|
+
}
|
|
56
|
+
export interface IDlcCloseJSON {
|
|
57
|
+
type?: number;
|
|
58
|
+
protocolVersion: number;
|
|
59
|
+
contractId: string;
|
|
60
|
+
closeSignature: string;
|
|
61
|
+
offerPayoutSatoshis: number;
|
|
62
|
+
acceptPayoutSatoshis: number;
|
|
63
|
+
fundInputSerialId: number;
|
|
64
|
+
fundingInputs: IFundingInputJSON[];
|
|
65
|
+
fundingSignatures: IFundingSignaturesJSON;
|
|
66
|
+
serialized?: string;
|
|
67
|
+
tlvs?: any[];
|
|
68
|
+
}
|