@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.
Files changed (368) hide show
  1. package/.yalc/@node-dlc/messaging/.nyc_output/2cf48009-1094-4275-bb91-c164c932feb6.json +1 -0
  2. package/.yalc/@node-dlc/messaging/.nyc_output/processinfo/2cf48009-1094-4275-bb91-c164c932feb6.json +1 -0
  3. package/.yalc/@node-dlc/messaging/.nyc_output/processinfo/index.json +1 -0
  4. package/.yalc/@node-dlc/messaging/README.md +24 -0
  5. package/.yalc/@node-dlc/messaging/__tests__/_test-utils.ts +12 -0
  6. package/.yalc/@node-dlc/messaging/__tests__/chain/ChainManager.spec.ts +178 -0
  7. package/.yalc/@node-dlc/messaging/__tests__/compatibility/dlcspecs-compatibility.spec.ts +473 -0
  8. package/.yalc/@node-dlc/messaging/__tests__/compatibility/rust-dlc-cross-language.spec.ts +342 -0
  9. package/.yalc/@node-dlc/messaging/__tests__/compatibility/true-serialization-compatibility.spec.ts +611 -0
  10. package/.yalc/@node-dlc/messaging/__tests__/dlc_message_test.json +155 -0
  11. package/.yalc/@node-dlc/messaging/__tests__/irc/IrcMessage.spec.ts +94 -0
  12. package/.yalc/@node-dlc/messaging/__tests__/messages/AddressCache.spec.ts +79 -0
  13. package/.yalc/@node-dlc/messaging/__tests__/messages/BatchFundingGroup.spec.ts +72 -0
  14. package/.yalc/@node-dlc/messaging/__tests__/messages/CetAdaptorSignatures.spec.ts +57 -0
  15. package/.yalc/@node-dlc/messaging/__tests__/messages/ContractDescriptor.spec.ts +264 -0
  16. package/.yalc/@node-dlc/messaging/__tests__/messages/ContractInfo.spec.ts +419 -0
  17. package/.yalc/@node-dlc/messaging/__tests__/messages/DigitDecompositionEventDescriptor.spec.ts +59 -0
  18. package/.yalc/@node-dlc/messaging/__tests__/messages/DlcAccept.spec.ts +242 -0
  19. package/.yalc/@node-dlc/messaging/__tests__/messages/DlcCancel.spec.ts +42 -0
  20. package/.yalc/@node-dlc/messaging/__tests__/messages/DlcClose.spec.ts +315 -0
  21. package/.yalc/@node-dlc/messaging/__tests__/messages/DlcOffer.spec.ts +527 -0
  22. package/.yalc/@node-dlc/messaging/__tests__/messages/DlcSign.spec.ts +118 -0
  23. package/.yalc/@node-dlc/messaging/__tests__/messages/DlcTransactions.spec.ts +157 -0
  24. package/.yalc/@node-dlc/messaging/__tests__/messages/EnumEventDescriptor.spec.ts +50 -0
  25. package/.yalc/@node-dlc/messaging/__tests__/messages/EventDescriptor.spec.ts +93 -0
  26. package/.yalc/@node-dlc/messaging/__tests__/messages/FundingInput.spec.ts +84 -0
  27. package/.yalc/@node-dlc/messaging/__tests__/messages/FundingSignatures.spec.ts +83 -0
  28. package/.yalc/@node-dlc/messaging/__tests__/messages/NegotiationFields.spec.ts +328 -0
  29. package/.yalc/@node-dlc/messaging/__tests__/messages/NodeAnnouncementMessage.spec.ts +115 -0
  30. package/.yalc/@node-dlc/messaging/__tests__/messages/OracleAnnouncement.spec.ts +415 -0
  31. package/.yalc/@node-dlc/messaging/__tests__/messages/OracleAttestation.spec.ts +326 -0
  32. package/.yalc/@node-dlc/messaging/__tests__/messages/OracleEvent.spec.ts +143 -0
  33. package/.yalc/@node-dlc/messaging/__tests__/messages/OracleEventContainer.spec.ts +95 -0
  34. package/.yalc/@node-dlc/messaging/__tests__/messages/OracleIdentifier.spec.ts +48 -0
  35. package/.yalc/@node-dlc/messaging/__tests__/messages/OracleInfo.spec.ts +116 -0
  36. package/.yalc/@node-dlc/messaging/__tests__/messages/OrderAccept.spec.ts +77 -0
  37. package/.yalc/@node-dlc/messaging/__tests__/messages/OrderNegotiationFields.spec.ts +216 -0
  38. package/.yalc/@node-dlc/messaging/__tests__/messages/OrderOffer.spec.ts +121 -0
  39. package/.yalc/@node-dlc/messaging/__tests__/messages/OrderPositionInfo.spec.ts +75 -0
  40. package/.yalc/@node-dlc/messaging/__tests__/messages/PayoutCurvePiece.spec.ts +220 -0
  41. package/.yalc/@node-dlc/messaging/__tests__/messages/PayoutFunction.spec.ts +101 -0
  42. package/.yalc/@node-dlc/messaging/__tests__/messages/RoundingIntervals.spec.ts +75 -0
  43. package/.yalc/@node-dlc/messaging/__tests__/serialize/F64.spec.ts +260 -0
  44. package/.yalc/@node-dlc/messaging/__tests__/tsconfig.json +8 -0
  45. package/.yalc/@node-dlc/messaging/coverage/lcov-report/base.css +224 -0
  46. package/.yalc/@node-dlc/messaging/coverage/lcov-report/block-navigation.js +79 -0
  47. package/.yalc/@node-dlc/messaging/coverage/lcov-report/favicon.png +0 -0
  48. package/.yalc/@node-dlc/messaging/coverage/lcov-report/index.html +201 -0
  49. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/MessageType.ts.html +494 -0
  50. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/chain/ChainManager.ts.html +1058 -0
  51. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/chain/ChainMemoryStore.ts.html +182 -0
  52. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/chain/index.html +126 -0
  53. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/domain/Address.ts.html +272 -0
  54. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/domain/index.html +111 -0
  55. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/index.html +141 -0
  56. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/index.ts.html +212 -0
  57. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/irc/IrcMessage.ts.html +563 -0
  58. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/irc/index.html +111 -0
  59. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/AddressCache.ts.html +302 -0
  60. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/BatchFundingGroup.ts.html +503 -0
  61. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/CetAdaptorSignatures.ts.html +347 -0
  62. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/CetAdaptorSignaturesV0.ts.html +347 -0
  63. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/ContractDescriptor.ts.html +1040 -0
  64. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/ContractInfo.ts.html +1382 -0
  65. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcAccept.ts.html +1865 -0
  66. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcCancel.ts.html +251 -0
  67. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcClose.ts.html +986 -0
  68. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcCloseMetadata.ts.html +443 -0
  69. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcIds.ts.html +281 -0
  70. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcInfo.ts.html +323 -0
  71. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcMessage.ts.html +341 -0
  72. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcOffer.ts.html +1895 -0
  73. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcSign.ts.html +1142 -0
  74. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/DlcTransactions.ts.html +719 -0
  75. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/EventDescriptor.ts.html +947 -0
  76. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/FundingInput.ts.html +728 -0
  77. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/FundingSignatures.ts.html +374 -0
  78. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/FundingSignaturesV0.ts.html +374 -0
  79. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/NegotiationFields.ts.html +836 -0
  80. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/NodeAnnouncementMessage.ts.html +515 -0
  81. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleAnnouncement.ts.html +608 -0
  82. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleAnnouncementV0.ts.html +605 -0
  83. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleAttestation.ts.html +956 -0
  84. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleAttestationV0.ts.html +770 -0
  85. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleEvent.ts.html +830 -0
  86. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleEventContainer.ts.html +347 -0
  87. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleEventContainerV0.ts.html +347 -0
  88. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleEventV0.ts.html +827 -0
  89. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleIdentifier.ts.html +314 -0
  90. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleIdentifierV0.ts.html +314 -0
  91. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleInfo.ts.html +1637 -0
  92. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OracleInfoV0.ts.html +1631 -0
  93. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderAccept.ts.html +557 -0
  94. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderIrcInfo.ts.html +380 -0
  95. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderMetadata.ts.html +437 -0
  96. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderNegotiationFields.ts.html +551 -0
  97. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderOffer.ts.html +1337 -0
  98. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/OrderPositionInfo.ts.html +590 -0
  99. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/PayoutCurvePiece.ts.html +1427 -0
  100. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/PayoutFunction.ts.html +800 -0
  101. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/RoundingIntervals.ts.html +461 -0
  102. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/RoundingIntervalsV0.ts.html +482 -0
  103. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/ScriptWitnessV0.ts.html +269 -0
  104. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/messages/index.html +636 -0
  105. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serde/SerdeUtils.ts.html +1394 -0
  106. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serde/index.html +111 -0
  107. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serialize/F64.ts.html +1136 -0
  108. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serialize/deserializeTlv.ts.html +125 -0
  109. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serialize/getTlv.ts.html +143 -0
  110. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/serialize/index.html +141 -0
  111. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/util.ts.html +179 -0
  112. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/validation/index.html +111 -0
  113. package/.yalc/@node-dlc/messaging/coverage/lcov-report/lib/validation/validate.ts.html +182 -0
  114. package/.yalc/@node-dlc/messaging/coverage/lcov-report/prettify.css +1 -0
  115. package/.yalc/@node-dlc/messaging/coverage/lcov-report/prettify.js +2 -0
  116. package/.yalc/@node-dlc/messaging/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  117. package/.yalc/@node-dlc/messaging/coverage/lcov-report/sorter.js +170 -0
  118. package/.yalc/@node-dlc/messaging/coverage/lcov.info +5394 -0
  119. package/.yalc/@node-dlc/messaging/dist/MessageType.d.ts +100 -0
  120. package/.yalc/@node-dlc/messaging/dist/MessageType.js +117 -0
  121. package/.yalc/@node-dlc/messaging/dist/MessageType.js.map +1 -0
  122. package/.yalc/@node-dlc/messaging/dist/chain/ChainManager.d.ts +50 -0
  123. package/.yalc/@node-dlc/messaging/dist/chain/ChainManager.js +211 -0
  124. package/.yalc/@node-dlc/messaging/dist/chain/ChainManager.js.map +1 -0
  125. package/.yalc/@node-dlc/messaging/dist/chain/ChainMemoryStore.d.ts +14 -0
  126. package/.yalc/@node-dlc/messaging/dist/chain/ChainMemoryStore.js +28 -0
  127. package/.yalc/@node-dlc/messaging/dist/chain/ChainMemoryStore.js.map +1 -0
  128. package/.yalc/@node-dlc/messaging/dist/chain/DlcStore.d.ts +11 -0
  129. package/.yalc/@node-dlc/messaging/dist/chain/DlcStore.js +3 -0
  130. package/.yalc/@node-dlc/messaging/dist/chain/DlcStore.js.map +1 -0
  131. package/.yalc/@node-dlc/messaging/dist/chain/IChainFilterChainClient.d.ts +48 -0
  132. package/.yalc/@node-dlc/messaging/dist/chain/IChainFilterChainClient.js +3 -0
  133. package/.yalc/@node-dlc/messaging/dist/chain/IChainFilterChainClient.js.map +1 -0
  134. package/.yalc/@node-dlc/messaging/dist/domain/Address.d.ts +24 -0
  135. package/.yalc/@node-dlc/messaging/dist/domain/Address.js +46 -0
  136. package/.yalc/@node-dlc/messaging/dist/domain/Address.js.map +1 -0
  137. package/.yalc/@node-dlc/messaging/dist/index.d.ts +44 -0
  138. package/.yalc/@node-dlc/messaging/dist/index.js +63 -0
  139. package/.yalc/@node-dlc/messaging/dist/index.js.map +1 -0
  140. package/.yalc/@node-dlc/messaging/dist/irc/IrcMessage.d.ts +43 -0
  141. package/.yalc/@node-dlc/messaging/dist/irc/IrcMessage.js +116 -0
  142. package/.yalc/@node-dlc/messaging/dist/irc/IrcMessage.js.map +1 -0
  143. package/.yalc/@node-dlc/messaging/dist/messages/AddressCache.d.ts +15 -0
  144. package/.yalc/@node-dlc/messaging/dist/messages/AddressCache.js +51 -0
  145. package/.yalc/@node-dlc/messaging/dist/messages/AddressCache.js.map +1 -0
  146. package/.yalc/@node-dlc/messaging/dist/messages/BatchFundingGroup.d.ts +61 -0
  147. package/.yalc/@node-dlc/messaging/dist/messages/BatchFundingGroup.js +113 -0
  148. package/.yalc/@node-dlc/messaging/dist/messages/BatchFundingGroup.js.map +1 -0
  149. package/.yalc/@node-dlc/messaging/dist/messages/CetAdaptorSignatures.d.ts +40 -0
  150. package/.yalc/@node-dlc/messaging/dist/messages/CetAdaptorSignatures.js +67 -0
  151. package/.yalc/@node-dlc/messaging/dist/messages/CetAdaptorSignatures.js.map +1 -0
  152. package/.yalc/@node-dlc/messaging/dist/messages/ContractDescriptor.d.ts +122 -0
  153. package/.yalc/@node-dlc/messaging/dist/messages/ContractDescriptor.js +222 -0
  154. package/.yalc/@node-dlc/messaging/dist/messages/ContractDescriptor.js.map +1 -0
  155. package/.yalc/@node-dlc/messaging/dist/messages/ContractInfo.d.ts +135 -0
  156. package/.yalc/@node-dlc/messaging/dist/messages/ContractInfo.js +304 -0
  157. package/.yalc/@node-dlc/messaging/dist/messages/ContractInfo.js.map +1 -0
  158. package/.yalc/@node-dlc/messaging/dist/messages/DlcAccept.d.ts +145 -0
  159. package/.yalc/@node-dlc/messaging/dist/messages/DlcAccept.js +428 -0
  160. package/.yalc/@node-dlc/messaging/dist/messages/DlcAccept.js.map +1 -0
  161. package/.yalc/@node-dlc/messaging/dist/messages/DlcCancel.d.ts +31 -0
  162. package/.yalc/@node-dlc/messaging/dist/messages/DlcCancel.js +51 -0
  163. package/.yalc/@node-dlc/messaging/dist/messages/DlcCancel.js.map +1 -0
  164. package/.yalc/@node-dlc/messaging/dist/messages/DlcClose.d.ts +68 -0
  165. package/.yalc/@node-dlc/messaging/dist/messages/DlcClose.js +210 -0
  166. package/.yalc/@node-dlc/messaging/dist/messages/DlcClose.js.map +1 -0
  167. package/.yalc/@node-dlc/messaging/dist/messages/DlcCloseMetadata.d.ts +44 -0
  168. package/.yalc/@node-dlc/messaging/dist/messages/DlcCloseMetadata.js +74 -0
  169. package/.yalc/@node-dlc/messaging/dist/messages/DlcCloseMetadata.js.map +1 -0
  170. package/.yalc/@node-dlc/messaging/dist/messages/DlcIds.d.ts +26 -0
  171. package/.yalc/@node-dlc/messaging/dist/messages/DlcIds.js +58 -0
  172. package/.yalc/@node-dlc/messaging/dist/messages/DlcIds.js.map +1 -0
  173. package/.yalc/@node-dlc/messaging/dist/messages/DlcInfo.d.ts +31 -0
  174. package/.yalc/@node-dlc/messaging/dist/messages/DlcInfo.js +61 -0
  175. package/.yalc/@node-dlc/messaging/dist/messages/DlcInfo.js.map +1 -0
  176. package/.yalc/@node-dlc/messaging/dist/messages/DlcMessage.d.ts +23 -0
  177. package/.yalc/@node-dlc/messaging/dist/messages/DlcMessage.js +54 -0
  178. package/.yalc/@node-dlc/messaging/dist/messages/DlcMessage.js.map +1 -0
  179. package/.yalc/@node-dlc/messaging/dist/messages/DlcOffer.d.ts +131 -0
  180. package/.yalc/@node-dlc/messaging/dist/messages/DlcOffer.js +418 -0
  181. package/.yalc/@node-dlc/messaging/dist/messages/DlcOffer.js.map +1 -0
  182. package/.yalc/@node-dlc/messaging/dist/messages/DlcSign.d.ts +96 -0
  183. package/.yalc/@node-dlc/messaging/dist/messages/DlcSign.js +267 -0
  184. package/.yalc/@node-dlc/messaging/dist/messages/DlcSign.js.map +1 -0
  185. package/.yalc/@node-dlc/messaging/dist/messages/DlcTransactions.d.ts +69 -0
  186. package/.yalc/@node-dlc/messaging/dist/messages/DlcTransactions.js +149 -0
  187. package/.yalc/@node-dlc/messaging/dist/messages/DlcTransactions.js.map +1 -0
  188. package/.yalc/@node-dlc/messaging/dist/messages/EventDescriptor.d.ts +106 -0
  189. package/.yalc/@node-dlc/messaging/dist/messages/EventDescriptor.js +209 -0
  190. package/.yalc/@node-dlc/messaging/dist/messages/EventDescriptor.js.map +1 -0
  191. package/.yalc/@node-dlc/messaging/dist/messages/FundingInput.d.ts +62 -0
  192. package/.yalc/@node-dlc/messaging/dist/messages/FundingInput.js +163 -0
  193. package/.yalc/@node-dlc/messaging/dist/messages/FundingInput.js.map +1 -0
  194. package/.yalc/@node-dlc/messaging/dist/messages/FundingSignatures.d.ts +36 -0
  195. package/.yalc/@node-dlc/messaging/dist/messages/FundingSignatures.js +78 -0
  196. package/.yalc/@node-dlc/messaging/dist/messages/FundingSignatures.js.map +1 -0
  197. package/.yalc/@node-dlc/messaging/dist/messages/IWireMessage.d.ts +6 -0
  198. package/.yalc/@node-dlc/messaging/dist/messages/IWireMessage.js +3 -0
  199. package/.yalc/@node-dlc/messaging/dist/messages/IWireMessage.js.map +1 -0
  200. package/.yalc/@node-dlc/messaging/dist/messages/NegotiationFields.d.ts +86 -0
  201. package/.yalc/@node-dlc/messaging/dist/messages/NegotiationFields.js +185 -0
  202. package/.yalc/@node-dlc/messaging/dist/messages/NegotiationFields.js.map +1 -0
  203. package/.yalc/@node-dlc/messaging/dist/messages/NodeAnnouncementMessage.d.ts +57 -0
  204. package/.yalc/@node-dlc/messaging/dist/messages/NodeAnnouncementMessage.js +127 -0
  205. package/.yalc/@node-dlc/messaging/dist/messages/NodeAnnouncementMessage.js.map +1 -0
  206. package/.yalc/@node-dlc/messaging/dist/messages/OracleAnnouncement.d.ts +76 -0
  207. package/.yalc/@node-dlc/messaging/dist/messages/OracleAnnouncement.js +131 -0
  208. package/.yalc/@node-dlc/messaging/dist/messages/OracleAnnouncement.js.map +1 -0
  209. package/.yalc/@node-dlc/messaging/dist/messages/OracleAttestation.d.ts +68 -0
  210. package/.yalc/@node-dlc/messaging/dist/messages/OracleAttestation.js +239 -0
  211. package/.yalc/@node-dlc/messaging/dist/messages/OracleAttestation.js.map +1 -0
  212. package/.yalc/@node-dlc/messaging/dist/messages/OracleEvent.d.ts +90 -0
  213. package/.yalc/@node-dlc/messaging/dist/messages/OracleEvent.js +189 -0
  214. package/.yalc/@node-dlc/messaging/dist/messages/OracleEvent.js.map +1 -0
  215. package/.yalc/@node-dlc/messaging/dist/messages/OracleEventContainer.d.ts +32 -0
  216. package/.yalc/@node-dlc/messaging/dist/messages/OracleEventContainer.js +67 -0
  217. package/.yalc/@node-dlc/messaging/dist/messages/OracleEventContainer.js.map +1 -0
  218. package/.yalc/@node-dlc/messaging/dist/messages/OracleIdentifier.d.ts +32 -0
  219. package/.yalc/@node-dlc/messaging/dist/messages/OracleIdentifier.js +58 -0
  220. package/.yalc/@node-dlc/messaging/dist/messages/OracleIdentifier.js.map +1 -0
  221. package/.yalc/@node-dlc/messaging/dist/messages/OracleIdentifierV0.d.ts +32 -0
  222. package/.yalc/@node-dlc/messaging/dist/messages/OracleIdentifierV0.js +58 -0
  223. package/.yalc/@node-dlc/messaging/dist/messages/OracleIdentifierV0.js.map +1 -0
  224. package/.yalc/@node-dlc/messaging/dist/messages/OracleInfo.d.ts +161 -0
  225. package/.yalc/@node-dlc/messaging/dist/messages/OracleInfo.js +390 -0
  226. package/.yalc/@node-dlc/messaging/dist/messages/OracleInfo.js.map +1 -0
  227. package/.yalc/@node-dlc/messaging/dist/messages/OracleInfoV0.d.ts +161 -0
  228. package/.yalc/@node-dlc/messaging/dist/messages/OracleInfoV0.js +387 -0
  229. package/.yalc/@node-dlc/messaging/dist/messages/OracleInfoV0.js.map +1 -0
  230. package/.yalc/@node-dlc/messaging/dist/messages/OrderAccept.d.ts +65 -0
  231. package/.yalc/@node-dlc/messaging/dist/messages/OrderAccept.js +125 -0
  232. package/.yalc/@node-dlc/messaging/dist/messages/OrderAccept.js.map +1 -0
  233. package/.yalc/@node-dlc/messaging/dist/messages/OrderIrcInfo.d.ts +42 -0
  234. package/.yalc/@node-dlc/messaging/dist/messages/OrderIrcInfo.js +74 -0
  235. package/.yalc/@node-dlc/messaging/dist/messages/OrderIrcInfo.js.map +1 -0
  236. package/.yalc/@node-dlc/messaging/dist/messages/OrderMetadata.d.ts +56 -0
  237. package/.yalc/@node-dlc/messaging/dist/messages/OrderMetadata.js +87 -0
  238. package/.yalc/@node-dlc/messaging/dist/messages/OrderMetadata.js.map +1 -0
  239. package/.yalc/@node-dlc/messaging/dist/messages/OrderNegotiationFields.d.ts +69 -0
  240. package/.yalc/@node-dlc/messaging/dist/messages/OrderNegotiationFields.js +114 -0
  241. package/.yalc/@node-dlc/messaging/dist/messages/OrderNegotiationFields.js.map +1 -0
  242. package/.yalc/@node-dlc/messaging/dist/messages/OrderOffer.d.ts +97 -0
  243. package/.yalc/@node-dlc/messaging/dist/messages/OrderOffer.js +296 -0
  244. package/.yalc/@node-dlc/messaging/dist/messages/OrderOffer.js.map +1 -0
  245. package/.yalc/@node-dlc/messaging/dist/messages/OrderPositionInfo.d.ts +50 -0
  246. package/.yalc/@node-dlc/messaging/dist/messages/OrderPositionInfo.js +125 -0
  247. package/.yalc/@node-dlc/messaging/dist/messages/OrderPositionInfo.js.map +1 -0
  248. package/.yalc/@node-dlc/messaging/dist/messages/PayoutCurvePiece.d.ts +129 -0
  249. package/.yalc/@node-dlc/messaging/dist/messages/PayoutCurvePiece.js +327 -0
  250. package/.yalc/@node-dlc/messaging/dist/messages/PayoutCurvePiece.js.map +1 -0
  251. package/.yalc/@node-dlc/messaging/dist/messages/PayoutFunction.d.ts +66 -0
  252. package/.yalc/@node-dlc/messaging/dist/messages/PayoutFunction.js +170 -0
  253. package/.yalc/@node-dlc/messaging/dist/messages/PayoutFunction.js.map +1 -0
  254. package/.yalc/@node-dlc/messaging/dist/messages/RoundingIntervals.d.ts +52 -0
  255. package/.yalc/@node-dlc/messaging/dist/messages/RoundingIntervals.js +95 -0
  256. package/.yalc/@node-dlc/messaging/dist/messages/RoundingIntervals.js.map +1 -0
  257. package/.yalc/@node-dlc/messaging/dist/messages/ScriptWitnessV0.d.ts +29 -0
  258. package/.yalc/@node-dlc/messaging/dist/messages/ScriptWitnessV0.js +50 -0
  259. package/.yalc/@node-dlc/messaging/dist/messages/ScriptWitnessV0.js.map +1 -0
  260. package/.yalc/@node-dlc/messaging/dist/messages/Tlv.d.ts +15 -0
  261. package/.yalc/@node-dlc/messaging/dist/messages/Tlv.js +32 -0
  262. package/.yalc/@node-dlc/messaging/dist/messages/Tlv.js.map +1 -0
  263. package/.yalc/@node-dlc/messaging/dist/serialize/F64.d.ts +154 -0
  264. package/.yalc/@node-dlc/messaging/dist/serialize/F64.js +307 -0
  265. package/.yalc/@node-dlc/messaging/dist/serialize/F64.js.map +1 -0
  266. package/.yalc/@node-dlc/messaging/dist/serialize/deserializeTlv.d.ts +9 -0
  267. package/.yalc/@node-dlc/messaging/dist/serialize/deserializeTlv.js +11 -0
  268. package/.yalc/@node-dlc/messaging/dist/serialize/deserializeTlv.js.map +1 -0
  269. package/.yalc/@node-dlc/messaging/dist/serialize/getTlv.d.ts +4 -0
  270. package/.yalc/@node-dlc/messaging/dist/serialize/getTlv.js +23 -0
  271. package/.yalc/@node-dlc/messaging/dist/serialize/getTlv.js.map +1 -0
  272. package/.yalc/@node-dlc/messaging/dist/serialize/readTlvs.d.ts +8 -0
  273. package/.yalc/@node-dlc/messaging/dist/serialize/readTlvs.js +33 -0
  274. package/.yalc/@node-dlc/messaging/dist/serialize/readTlvs.js.map +1 -0
  275. package/.yalc/@node-dlc/messaging/dist/util.d.ts +13 -0
  276. package/.yalc/@node-dlc/messaging/dist/util.js +40 -0
  277. package/.yalc/@node-dlc/messaging/dist/util.js.map +1 -0
  278. package/.yalc/@node-dlc/messaging/dist/validation/validate.d.ts +4 -0
  279. package/.yalc/@node-dlc/messaging/dist/validation/validate.js +31 -0
  280. package/.yalc/@node-dlc/messaging/dist/validation/validate.js.map +1 -0
  281. package/.yalc/@node-dlc/messaging/lib/MessageType.ts +138 -0
  282. package/.yalc/@node-dlc/messaging/lib/chain/ChainManager.ts +326 -0
  283. package/.yalc/@node-dlc/messaging/lib/chain/ChainMemoryStore.ts +34 -0
  284. package/.yalc/@node-dlc/messaging/lib/chain/DlcStore.ts +11 -0
  285. package/.yalc/@node-dlc/messaging/lib/chain/IChainFilterChainClient.ts +57 -0
  286. package/.yalc/@node-dlc/messaging/lib/domain/Address.ts +64 -0
  287. package/.yalc/@node-dlc/messaging/lib/index.ts +44 -0
  288. package/.yalc/@node-dlc/messaging/lib/irc/IrcMessage.ts +161 -0
  289. package/.yalc/@node-dlc/messaging/lib/messages/AddressCache.ts +74 -0
  290. package/.yalc/@node-dlc/messaging/lib/messages/BatchFundingGroup.ts +141 -0
  291. package/.yalc/@node-dlc/messaging/lib/messages/CetAdaptorSignatures.ts +89 -0
  292. package/.yalc/@node-dlc/messaging/lib/messages/ContractDescriptor.ts +318 -0
  293. package/.yalc/@node-dlc/messaging/lib/messages/ContractInfo.ts +434 -0
  294. package/.yalc/@node-dlc/messaging/lib/messages/DlcAccept.ts +595 -0
  295. package/.yalc/@node-dlc/messaging/lib/messages/DlcCancel.ts +57 -0
  296. package/.yalc/@node-dlc/messaging/lib/messages/DlcClose.ts +302 -0
  297. package/.yalc/@node-dlc/messaging/lib/messages/DlcCloseMetadata.ts +121 -0
  298. package/.yalc/@node-dlc/messaging/lib/messages/DlcIds.ts +67 -0
  299. package/.yalc/@node-dlc/messaging/lib/messages/DlcInfo.ts +81 -0
  300. package/.yalc/@node-dlc/messaging/lib/messages/DlcMessage.ts +87 -0
  301. package/.yalc/@node-dlc/messaging/lib/messages/DlcOffer.ts +605 -0
  302. package/.yalc/@node-dlc/messaging/lib/messages/DlcSign.ts +354 -0
  303. package/.yalc/@node-dlc/messaging/lib/messages/DlcTransactions.ts +213 -0
  304. package/.yalc/@node-dlc/messaging/lib/messages/EventDescriptor.ts +289 -0
  305. package/.yalc/@node-dlc/messaging/lib/messages/FundingInput.ts +216 -0
  306. package/.yalc/@node-dlc/messaging/lib/messages/FundingSignatures.ts +98 -0
  307. package/.yalc/@node-dlc/messaging/lib/messages/IWireMessage.ts +6 -0
  308. package/.yalc/@node-dlc/messaging/lib/messages/NegotiationFields.ts +252 -0
  309. package/.yalc/@node-dlc/messaging/lib/messages/NodeAnnouncementMessage.ts +145 -0
  310. package/.yalc/@node-dlc/messaging/lib/messages/OracleAnnouncement.ts +176 -0
  311. package/.yalc/@node-dlc/messaging/lib/messages/OracleAttestation.ts +292 -0
  312. package/.yalc/@node-dlc/messaging/lib/messages/OracleEvent.ts +250 -0
  313. package/.yalc/@node-dlc/messaging/lib/messages/OracleEventContainer.ts +89 -0
  314. package/.yalc/@node-dlc/messaging/lib/messages/OracleIdentifier.ts +78 -0
  315. package/.yalc/@node-dlc/messaging/lib/messages/OracleInfo.ts +519 -0
  316. package/.yalc/@node-dlc/messaging/lib/messages/OrderAccept.ts +159 -0
  317. package/.yalc/@node-dlc/messaging/lib/messages/OrderIrcInfo.ts +100 -0
  318. package/.yalc/@node-dlc/messaging/lib/messages/OrderMetadata.ts +119 -0
  319. package/.yalc/@node-dlc/messaging/lib/messages/OrderNegotiationFields.ts +157 -0
  320. package/.yalc/@node-dlc/messaging/lib/messages/OrderOffer.ts +419 -0
  321. package/.yalc/@node-dlc/messaging/lib/messages/OrderPositionInfo.ts +170 -0
  322. package/.yalc/@node-dlc/messaging/lib/messages/PayoutCurvePiece.ts +449 -0
  323. package/.yalc/@node-dlc/messaging/lib/messages/PayoutFunction.ts +240 -0
  324. package/.yalc/@node-dlc/messaging/lib/messages/RoundingIntervals.ts +127 -0
  325. package/.yalc/@node-dlc/messaging/lib/messages/ScriptWitnessV0.ts +63 -0
  326. package/.yalc/@node-dlc/messaging/lib/messages/Tlv.ts +40 -0
  327. package/.yalc/@node-dlc/messaging/lib/serialize/F64.ts +352 -0
  328. package/.yalc/@node-dlc/messaging/lib/serialize/deserializeTlv.ts +15 -0
  329. package/.yalc/@node-dlc/messaging/lib/serialize/getTlv.ts +21 -0
  330. package/.yalc/@node-dlc/messaging/lib/serialize/readTlvs.ts +37 -0
  331. package/.yalc/@node-dlc/messaging/lib/util.ts +33 -0
  332. package/.yalc/@node-dlc/messaging/lib/validation/validate.ts +34 -0
  333. package/.yalc/@node-dlc/messaging/package.json +42 -0
  334. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_3_of_3_test.json +210 -0
  335. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_3_of_5_test.json +468 -0
  336. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_and_numerical_3_of_5_test.json +1517 -0
  337. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_and_numerical_5_of_5_test.json +545 -0
  338. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_and_numerical_with_diff_3_of_5_test.json +4761 -0
  339. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_and_numerical_with_diff_5_of_5_test.json +2169 -0
  340. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/enum_single_oracle_test.json +164 -0
  341. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/single_oracle_numerical_hyperbola_test.json +502 -0
  342. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/single_oracle_numerical_test.json +262 -0
  343. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/three_of_five_oracle_numerical_with_diff_test.json +4382 -0
  344. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/three_of_three_oracle_numerical_test.json +324 -0
  345. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/three_of_three_oracle_numerical_with_diff_test.json +652 -0
  346. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/two_of_five_oracle_numerical_test.json +1138 -0
  347. package/.yalc/@node-dlc/messaging/test_vectors/dlcspecs/two_of_five_oracle_numerical_with_diff_test.json +2222 -0
  348. package/.yalc/@node-dlc/messaging/test_vectors/oracle/external_oracle_announcements.json +0 -0
  349. package/.yalc/@node-dlc/messaging/test_vectors/oracle/oracle_message_test_vectors.json +115 -0
  350. package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/accept_msg.json +1465 -0
  351. package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/dlc_fee_test.json +12362 -0
  352. package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/dlc_fee_test_scripts.json +57 -0
  353. package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/dlc_test.json +2766 -0
  354. package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/dlc_tx_test.json +2899 -0
  355. package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/offer_msg.json +163 -0
  356. package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/offer_msg_disjoint.json +352 -0
  357. package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/segment_chunk_msg.json +12635 -0
  358. package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/segment_start_msg.json +4022 -0
  359. package/.yalc/@node-dlc/messaging/test_vectors/rust-dlc/sign_msg.json +383 -0
  360. package/.yalc/@node-dlc/messaging/tsconfig.json +7 -0
  361. package/.yalc/@node-dlc/messaging/yalc.sig +1 -0
  362. package/CHANGELOG.md +64 -0
  363. package/dist/dlc.d.ts +3 -3
  364. package/dist/models/Output.js.map +1 -1
  365. package/lib/dlc.ts +4 -14
  366. package/lib/models/Output.ts +4 -1
  367. package/package.json +4 -4
  368. package/yalc.lock +10 -0
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DlcClose = void 0;
4
+ const bufio_1 = require("@node-dlc/bufio");
5
+ const MessageType_1 = require("../MessageType");
6
+ const deserializeTlv_1 = require("../serialize/deserializeTlv");
7
+ const getTlv_1 = require("../serialize/getTlv");
8
+ const util_1 = require("../util");
9
+ const FundingInput_1 = require("./FundingInput");
10
+ const FundingSignatures_1 = require("./FundingSignatures");
11
+ const ScriptWitnessV0_1 = require("./ScriptWitnessV0");
12
+ /**
13
+ * DlcClose message contains information about a node and indicates its
14
+ * desire to close an existing contract.
15
+ * Updated to follow DlcOffer architectural patterns.
16
+ */
17
+ class DlcClose {
18
+ constructor() {
19
+ /**
20
+ * The type for close_dlc message. close_dlc = 52170
21
+ */
22
+ this.type = DlcClose.type;
23
+ // New fields as per dlcspecs PR #163
24
+ this.protocolVersion = MessageType_1.PROTOCOL_VERSION; // Default to current protocol version
25
+ this.fundingInputs = [];
26
+ }
27
+ /**
28
+ * Creates a DlcClose from JSON data (e.g., from test vectors)
29
+ * Handles both our internal format and external test vector formats
30
+ * @param json JSON object representing a DLC close message
31
+ */
32
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
33
+ static fromJSON(json) {
34
+ const instance = new DlcClose();
35
+ // Basic fields with field name variations
36
+ instance.protocolVersion =
37
+ json.protocolVersion || json.protocol_version || MessageType_1.PROTOCOL_VERSION;
38
+ // Basic fields with field name variations
39
+ instance.contractId = Buffer.from(json.contractId || json.contract_id, 'hex');
40
+ instance.closeSignature = Buffer.from(json.closeSignature || json.close_signature, 'hex');
41
+ // Use toBigInt helper to handle BigInt values from json-bigint
42
+ instance.offerPayoutSatoshis = (0, util_1.toBigInt)(json.offerPayoutSatoshis || json.offer_payout_satoshis);
43
+ instance.acceptPayoutSatoshis = (0, util_1.toBigInt)(json.acceptPayoutSatoshis || json.accept_payout_satoshis);
44
+ instance.fundInputSerialId = (0, util_1.toBigInt)(json.fundInputSerialId || json.fund_input_serial_id);
45
+ // Use FundingInput.fromJSON() for each funding input - proper delegation
46
+ instance.fundingInputs = (json.fundingInputs || json.funding_inputs || [])
47
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
+ .map((inputJson) => FundingInput_1.FundingInput.fromJSON(inputJson));
49
+ // Create FundingSignatures manually since it doesn't have fromJSON
50
+ if (json.fundingSignatures || json.funding_signatures) {
51
+ instance.fundingSignatures = new FundingSignatures_1.FundingSignatures();
52
+ const sigData = json.fundingSignatures || json.funding_signatures;
53
+ // Handle different possible structures
54
+ if (sigData.fundingSignatures) {
55
+ // Standard format
56
+ instance.fundingSignatures.witnessElements = sigData.fundingSignatures.map(
57
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
+ (sig) => sig.witnessElements?.map((elem) => {
59
+ const witness = new ScriptWitnessV0_1.ScriptWitnessV0();
60
+ witness.length =
61
+ elem.length || Buffer.from(elem.witness || '', 'hex').length;
62
+ witness.witness = Buffer.from(elem.witness || '', 'hex');
63
+ return witness;
64
+ }) || []);
65
+ }
66
+ else if (Array.isArray(sigData)) {
67
+ // Array format
68
+ instance.fundingSignatures.witnessElements = sigData.map(
69
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
70
+ (sig) => sig.witnessElements?.map((elem) => {
71
+ const witness = new ScriptWitnessV0_1.ScriptWitnessV0();
72
+ witness.length =
73
+ elem.length || Buffer.from(elem.witness || '', 'hex').length;
74
+ witness.witness = Buffer.from(elem.witness || '', 'hex');
75
+ return witness;
76
+ }) || []);
77
+ }
78
+ }
79
+ return instance;
80
+ }
81
+ /**
82
+ * Deserializes a close_dlc message with backward compatibility
83
+ * Detects old format (without protocol_version) vs new format (with protocol_version)
84
+ * @param buf
85
+ */
86
+ static deserialize(buf) {
87
+ const instance = new DlcClose();
88
+ const reader = new bufio_1.BufferReader(buf);
89
+ const type = reader.readUInt16BE(); // read type
90
+ // Validate type matches expected DlcClose type
91
+ if (type !== MessageType_1.MessageType.DlcClose) {
92
+ throw new Error(`Invalid message type. Expected ${MessageType_1.MessageType.DlcClose}, got ${type}`);
93
+ }
94
+ // Read protocol version
95
+ instance.protocolVersion = reader.readUInt32BE();
96
+ instance.contractId = reader.readBytes(32);
97
+ instance.closeSignature = reader.readBytes(64);
98
+ instance.offerPayoutSatoshis = reader.readUInt64BE();
99
+ instance.acceptPayoutSatoshis = reader.readUInt64BE();
100
+ instance.fundInputSerialId = reader.readUInt64BE();
101
+ // Changed from u16 to bigsize for consistency with DlcOffer
102
+ const fundingInputsLen = Number(reader.readBigSize());
103
+ for (let i = 0; i < fundingInputsLen; i++) {
104
+ // FundingInput body is serialized directly without TLV wrapper in rust-dlc format
105
+ const fundingInput = FundingInput_1.FundingInput.deserializeBody(reader.buffer.subarray(reader.position));
106
+ instance.fundingInputs.push(fundingInput);
107
+ // Skip past the FundingInput we just read
108
+ const fundingInputLength = fundingInput.serializeBody().length;
109
+ reader.position += fundingInputLength;
110
+ }
111
+ // Handle FundingSignatures - deserialize raw data (no TLV wrapper) like DlcSign
112
+ instance.fundingSignatures = FundingSignatures_1.FundingSignatures.deserialize(reader.buffer.subarray(reader.position));
113
+ // Skip past the funding signatures we just read
114
+ const fundingLength = instance.fundingSignatures.serialize().length;
115
+ reader.position += fundingLength;
116
+ // Parse any additional TLV stream (for future extensibility)
117
+ while (!reader.eof) {
118
+ const buf = (0, getTlv_1.getTlv)(reader);
119
+ const tlvReader = new bufio_1.BufferReader(buf);
120
+ const { type } = (0, deserializeTlv_1.deserializeTlv)(tlvReader);
121
+ // Store unknown TLVs for future compatibility
122
+ if (!instance.unknownTlvs) {
123
+ instance.unknownTlvs = [];
124
+ }
125
+ instance.unknownTlvs.push({ type: Number(type), data: buf });
126
+ }
127
+ return instance;
128
+ }
129
+ /**
130
+ * Validates correctness of all fields
131
+ * @throws Will throw an error if validation fails
132
+ */
133
+ validate() {
134
+ // Type is set automatically in class
135
+ // protocol_version validation
136
+ if (this.protocolVersion !== MessageType_1.PROTOCOL_VERSION) {
137
+ throw new Error(`Unsupported protocol version: ${this.protocolVersion}, expected: ${MessageType_1.PROTOCOL_VERSION}`);
138
+ }
139
+ // contractId validation
140
+ if (!this.contractId || this.contractId.length !== 32) {
141
+ throw new Error('contractId must be 32 bytes');
142
+ }
143
+ // closeSignature validation
144
+ if (!this.closeSignature || this.closeSignature.length !== 64) {
145
+ throw new Error('closeSignature must be 64 bytes');
146
+ }
147
+ // Ensure input serial ids are unique
148
+ const inputSerialIds = this.fundingInputs.map((input) => input.inputSerialId);
149
+ if (new Set(inputSerialIds).size !== inputSerialIds.length) {
150
+ throw new Error('inputSerialIds must be unique');
151
+ }
152
+ // Ensure funding inputs are segwit
153
+ this.fundingInputs.forEach((input) => input.validate());
154
+ // Note: FundingSignatures doesn't have a validate method, so we skip validation
155
+ }
156
+ /**
157
+ * Converts dlc_close to JSON (canonical rust-dlc format)
158
+ */
159
+ toJSON() {
160
+ // Include unknown TLVs for debugging
161
+ const tlvs = [];
162
+ if (this.unknownTlvs) {
163
+ this.unknownTlvs.forEach((tlv) => tlvs.push({ type: tlv.type, data: tlv.data.toString('hex') }));
164
+ }
165
+ // Return canonical rust-dlc format
166
+ return {
167
+ protocolVersion: this.protocolVersion,
168
+ contractId: this.contractId.toString('hex'),
169
+ closeSignature: this.closeSignature.toString('hex'),
170
+ offerPayoutSatoshis: (0, util_1.bigIntToNumber)(this.offerPayoutSatoshis),
171
+ acceptPayoutSatoshis: (0, util_1.bigIntToNumber)(this.acceptPayoutSatoshis),
172
+ fundInputSerialId: (0, util_1.bigIntToNumber)(this.fundInputSerialId),
173
+ fundingInputs: this.fundingInputs.map((input) => input.toJSON()),
174
+ fundingSignatures: this.fundingSignatures.toJSON(),
175
+ }; // Allow different field names from interface
176
+ }
177
+ /**
178
+ * Serializes the close_dlc message into a Buffer
179
+ * Updated serialization format to match DlcOffer patterns
180
+ */
181
+ serialize() {
182
+ const writer = new bufio_1.BufferWriter();
183
+ writer.writeUInt16BE(this.type);
184
+ // New fields as per dlcspecs PR #163
185
+ writer.writeUInt32BE(this.protocolVersion);
186
+ writer.writeBytes(this.contractId);
187
+ writer.writeBytes(this.closeSignature);
188
+ writer.writeUInt64BE(this.offerPayoutSatoshis);
189
+ writer.writeUInt64BE(this.acceptPayoutSatoshis);
190
+ writer.writeUInt64BE(this.fundInputSerialId);
191
+ // Changed from u16 to bigsize for consistency with DlcOffer
192
+ writer.writeBigSize(this.fundingInputs.length);
193
+ for (const fundingInput of this.fundingInputs) {
194
+ // Use serializeBody() to match rust-dlc behavior - funding inputs in vec are serialized without TLV wrapper
195
+ writer.writeBytes(fundingInput.serializeBody());
196
+ }
197
+ // Serialize FundingSignatures directly (no TLV wrapper) like DlcSign
198
+ writer.writeBytes(this.fundingSignatures.serialize());
199
+ // Write unknown TLVs for forward compatibility
200
+ if (this.unknownTlvs) {
201
+ this.unknownTlvs.forEach((tlv) => {
202
+ writer.writeBytes(tlv.data);
203
+ });
204
+ }
205
+ return writer.toBuffer();
206
+ }
207
+ }
208
+ exports.DlcClose = DlcClose;
209
+ DlcClose.type = MessageType_1.MessageType.DlcClose;
210
+ //# sourceMappingURL=DlcClose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DlcClose.js","sourceRoot":"","sources":["../../lib/messages/DlcClose.ts"],"names":[],"mappings":";;;AAAA,2CAA6D;AAE7D,gDAA+D;AAC/D,gEAA6D;AAC7D,gDAA6C;AAC7C,kCAAmD;AAEnD,iDAAiE;AACjE,2DAAgF;AAChF,uDAAoD;AAEpD;;;;GAIG;AACH,MAAa,QAAQ;IAArB;QAkJE;;WAEG;QACI,SAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAE5B,qCAAqC;QAC9B,oBAAe,GAAW,8BAAgB,CAAC,CAAC,sCAAsC;QAYlF,kBAAa,GAAmB,EAAE,CAAC;IA2G5C,CAAC;IA5QC;;;;OAIG;IACH,iHAAiH;IAC1G,MAAM,CAAC,QAAQ,CAAC,IAAS;QAC9B,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAEhC,0CAA0C;QAC1C,QAAQ,CAAC,eAAe;YACtB,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,gBAAgB,IAAI,8BAAgB,CAAC;QAEpE,0CAA0C;QAC1C,QAAQ,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,CAC/B,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,EACnC,KAAK,CACN,CAAC;QACF,QAAQ,CAAC,cAAc,GAAG,MAAM,CAAC,IAAI,CACnC,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,eAAe,EAC3C,KAAK,CACN,CAAC;QAEF,+DAA+D;QAC/D,QAAQ,CAAC,mBAAmB,GAAG,IAAA,eAAQ,EACrC,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,qBAAqB,C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,CAAC;QAEhC,qCAAqC;QACrC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC3C,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACvC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC/C,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAChD,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAE7C,4DAA4D;QAC5D,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAE/C,KAAK,MAAM,YAAY,IAAI,IAAI,CAAC,aAAa,EAAE;YAC7C,4GAA4G;YAC5G,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC,CAAC;SACjD;QAED,qEAAqE;QACrE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC,CAAC;QAEtD,+CAA+C;QAC/C,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC/B,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;;AA9QH,4BA+QC;AA9Qe,aAAI,GAAG,yBAAW,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,44 @@
1
+ /// <reference types="node" />
2
+ import { Tx } from '@node-dlc/bitcoin';
3
+ import { DlcAccept, DlcOffer, DlcTransactions } from '..';
4
+ /**
5
+ * DlcClose Metadata object contains information required for verifying DlcClose
6
+ * message.
7
+ */
8
+ export declare class DlcCloseMetadata {
9
+ /**
10
+ * Convert JSON to DlcCloseMetadata
11
+ * @param json
12
+ */
13
+ static fromJSON(json: IDlcCloseMetadataJSON): DlcCloseMetadata;
14
+ static fromDlcMessages(dlcOffer: DlcOffer, dlcAccept: DlcAccept, dlcTxs: DlcTransactions): DlcCloseMetadata;
15
+ offerFundingPubKey: Buffer;
16
+ acceptFundingPubKey: Buffer;
17
+ offerPayoutSPK: Buffer;
18
+ acceptPayoutSPK: Buffer;
19
+ offerPayoutSerialId: bigint;
20
+ acceptPayoutSerialId: bigint;
21
+ feeRatePerVb: bigint;
22
+ fundTx: Tx;
23
+ fundTxVout: number;
24
+ /**
25
+ * Converts dlc_close_metadata to JSON
26
+ */
27
+ toJSON(): IDlcCloseMetadataJSON;
28
+ toDlcMessages(): {
29
+ dlcOffer: DlcOffer;
30
+ dlcAccept: DlcAccept;
31
+ dlcTxs: DlcTransactions;
32
+ };
33
+ }
34
+ export interface IDlcCloseMetadataJSON {
35
+ offerFundingPubKey: string;
36
+ acceptFundingPubKey: string;
37
+ offerPayoutSPK: string;
38
+ acceptPayoutSPK: string;
39
+ offerPayoutSerialId: number;
40
+ acceptPayoutSerialId: number;
41
+ feeRatePerVb: number;
42
+ fundTx: string;
43
+ fundTxVout: number;
44
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DlcCloseMetadata = void 0;
4
+ const bitcoin_1 = require("@node-dlc/bitcoin");
5
+ const __1 = require("..");
6
+ /**
7
+ * DlcClose Metadata object contains information required for verifying DlcClose
8
+ * message.
9
+ */
10
+ class DlcCloseMetadata {
11
+ /**
12
+ * Convert JSON to DlcCloseMetadata
13
+ * @param json
14
+ */
15
+ static fromJSON(json) {
16
+ const instance = new DlcCloseMetadata();
17
+ instance.offerFundingPubKey = Buffer.from(json.offerFundingPubKey, 'hex');
18
+ instance.acceptFundingPubKey = Buffer.from(json.acceptFundingPubKey, 'hex');
19
+ instance.offerPayoutSPK = Buffer.from(json.offerPayoutSPK, 'hex');
20
+ instance.acceptPayoutSPK = Buffer.from(json.acceptPayoutSPK, 'hex');
21
+ instance.offerPayoutSerialId = BigInt(json.offerPayoutSerialId);
22
+ instance.acceptPayoutSerialId = BigInt(json.acceptPayoutSerialId);
23
+ instance.feeRatePerVb = BigInt(json.feeRatePerVb);
24
+ instance.fundTx = bitcoin_1.Tx.fromHex(json.fundTx);
25
+ instance.fundTxVout = json.fundTxVout;
26
+ return instance;
27
+ }
28
+ static fromDlcMessages(dlcOffer, dlcAccept, dlcTxs) {
29
+ const instance = new DlcCloseMetadata();
30
+ instance.offerFundingPubKey = dlcOffer.fundingPubkey;
31
+ instance.acceptFundingPubKey = dlcAccept.fundingPubkey;
32
+ instance.offerPayoutSPK = dlcOffer.payoutSpk;
33
+ instance.acceptPayoutSPK = dlcAccept.payoutSpk;
34
+ instance.offerPayoutSerialId = dlcOffer.payoutSerialId;
35
+ instance.acceptPayoutSerialId = dlcAccept.payoutSerialId;
36
+ instance.feeRatePerVb = dlcOffer.feeRatePerVb;
37
+ instance.fundTx = dlcTxs.fundTx;
38
+ instance.fundTxVout = dlcTxs.fundTxVout;
39
+ return instance;
40
+ }
41
+ /**
42
+ * Converts dlc_close_metadata to JSON
43
+ */
44
+ toJSON() {
45
+ return {
46
+ offerFundingPubKey: this.offerFundingPubKey.toString('hex'),
47
+ acceptFundingPubKey: this.acceptFundingPubKey.toString('hex'),
48
+ offerPayoutSPK: this.offerPayoutSPK.toString('hex'),
49
+ acceptPayoutSPK: this.acceptPayoutSPK.toString('hex'),
50
+ offerPayoutSerialId: Number(this.offerPayoutSerialId),
51
+ acceptPayoutSerialId: Number(this.acceptPayoutSerialId),
52
+ feeRatePerVb: Number(this.feeRatePerVb),
53
+ fundTx: this.fundTx.serialize().toString('hex'),
54
+ fundTxVout: this.fundTxVout,
55
+ };
56
+ }
57
+ toDlcMessages() {
58
+ const dlcOffer = new __1.DlcOffer();
59
+ const dlcAccept = new __1.DlcAccept();
60
+ const dlcTxs = new __1.DlcTransactions();
61
+ dlcOffer.fundingPubkey = this.offerFundingPubKey;
62
+ dlcAccept.fundingPubkey = this.acceptFundingPubKey;
63
+ dlcOffer.payoutSpk = this.offerPayoutSPK;
64
+ dlcAccept.payoutSpk = this.acceptPayoutSPK;
65
+ dlcOffer.payoutSerialId = this.offerPayoutSerialId;
66
+ dlcAccept.payoutSerialId = this.acceptPayoutSerialId;
67
+ dlcOffer.feeRatePerVb = this.feeRatePerVb;
68
+ dlcTxs.fundTx = this.fundTx;
69
+ dlcTxs.fundTxVout = this.fundTxVout;
70
+ return { dlcOffer, dlcAccept, dlcTxs };
71
+ }
72
+ }
73
+ exports.DlcCloseMetadata = DlcCloseMetadata;
74
+ //# sourceMappingURL=DlcCloseMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DlcCloseMetadata.js","sourceRoot":"","sources":["../../lib/messages/DlcCloseMetadata.ts"],"names":[],"mappings":";;;AAAA,+CAAuC;AAGvC,0BAA0D;AAI1D;;;GAGG;AACH,MAAa,gBAAgB;IAC3B;;;OAGG;IACI,MAAM,CAAC,QAAQ,CAAC,IAA2B;QAChD,MAAM,QAAQ,GAAG,IAAI,gBAAgB,EAAE,CAAC;QAExC,QAAQ,CAAC,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;QAC1E,QAAQ,CAAC,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;QAC5E,QAAQ,CAAC,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QAClE,QAAQ,CAAC,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QACpE,QAAQ,CAAC,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAA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2
+ import { MessageType } from '../MessageType';
3
+ import { IDlcMessage } from './DlcMessage';
4
+ /**
5
+ * DlcIds message contains list of buffers
6
+ */
7
+ export declare class DlcIds implements IDlcMessage {
8
+ static type: MessageType;
9
+ static deserialize(buf: Buffer): DlcIds;
10
+ /**
11
+ * Deserializes an dlc_ids message
12
+ * @param buf
13
+ */
14
+ private static deserializeV0;
15
+ /**
16
+ * The type for dlc_ids message
17
+ */
18
+ type: MessageType;
19
+ ids: Buffer[];
20
+ /**
21
+ * Serializes the dlc_ids message into a Buffer
22
+ */
23
+ serialize(): Buffer;
24
+ }
25
+ export declare const DlcIdsV0: typeof DlcIds;
26
+ export type DlcIdsV0 = DlcIds;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DlcIdsV0 = exports.DlcIds = void 0;
4
+ const bufio_1 = require("@node-dlc/bufio");
5
+ const MessageType_1 = require("../MessageType");
6
+ /**
7
+ * DlcIds message contains list of buffers
8
+ */
9
+ class DlcIds {
10
+ constructor() {
11
+ /**
12
+ * The type for dlc_ids message
13
+ */
14
+ this.type = DlcIds.type;
15
+ this.ids = [];
16
+ }
17
+ static deserialize(buf) {
18
+ const reader = new bufio_1.BufferReader(buf);
19
+ const type = Number(reader.readUInt16BE());
20
+ switch (type) {
21
+ case MessageType_1.MessageType.DlcIdsV0:
22
+ return DlcIds.deserializeV0(buf);
23
+ default:
24
+ throw new Error(`DLC IDs message type must be DlcIdsV0`);
25
+ }
26
+ }
27
+ /**
28
+ * Deserializes an dlc_ids message
29
+ * @param buf
30
+ */
31
+ static deserializeV0(buf) {
32
+ const instance = new DlcIds();
33
+ const reader = new bufio_1.BufferReader(buf);
34
+ reader.readUInt16BE(); // read type
35
+ const idsLen = reader.readBigSize(); // ids length
36
+ for (let i = 0; i < idsLen; i++) {
37
+ instance.ids.push(reader.readBytes(32));
38
+ }
39
+ return instance;
40
+ }
41
+ /**
42
+ * Serializes the dlc_ids message into a Buffer
43
+ */
44
+ serialize() {
45
+ const writer = new bufio_1.BufferWriter();
46
+ writer.writeUInt16BE(this.type);
47
+ writer.writeBigSize(this.ids.length);
48
+ for (const id of this.ids) {
49
+ writer.writeBytes(id);
50
+ }
51
+ return writer.toBuffer();
52
+ }
53
+ }
54
+ exports.DlcIds = DlcIds;
55
+ DlcIds.type = MessageType_1.MessageType.DlcIds;
56
+ // Legacy support - keeping old class name as alias
57
+ exports.DlcIdsV0 = DlcIds;
58
+ //# sourceMappingURL=DlcIds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DlcIds.js","sourceRoot":"","sources":["../../lib/messages/DlcIds.ts"],"names":[],"mappings":";;;AAAA,2CAA6D;AAE7D,gDAA6C;AAG7C;;GAEG;AACH,MAAa,MAAM;IAAnB;QAkCE;;WAEG;QACI,SAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QAEnB,QAAG,GAAa,EAAE,CAAC;IAe5B,CAAC;IAnDQ,MAAM,CAAC,WAAW,CAAC,GAAW;QACnC,MAAM,MAAM,GAAG,IAAI,oBAAY,CAAC,GAAG,CAAC,CAAC;QAErC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;QAE3C,QAAQ,IAAI,EAAE;YACZ,KAAK,yBAAW,CAAC,QAAQ;gBACvB,OAAO,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;YACnC;gBACE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;SAC5D;IACH,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,aAAa,CAAC,GAAW;QACtC,MAAM,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,IAAI,oBAAY,CAAC,GAAG,CAAC,CAAC;QAErC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,YAAY;QACnC,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,aAAa;QAElD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;YAC/B,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;SACzC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IASD;;OAEG;IACI,SAAS;QACd,MAAM,MAAM,GAAG,IAAI,oBAAY,EAAE,CAAC;QAClC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACrC,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE;YACzB,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;SACvB;QAED,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;;AArDH,wBAsDC;AArDe,WAAI,GAAG,yBAAW,CAAC,MAAM,CAAC;AAuD1C,mDAAmD;AACtC,QAAA,QAAQ,GAAG,MAAM,CAAC"}
@@ -0,0 +1,31 @@
1
+ /// <reference types="node" />
2
+ import { MessageType } from '../MessageType';
3
+ import { IDlcMessage } from './DlcMessage';
4
+ /**
5
+ * DlcInfo message contains list of buffers
6
+ */
7
+ export declare class DlcInfo implements IDlcMessage {
8
+ static type: MessageType;
9
+ static deserialize(buf: Buffer): DlcInfo;
10
+ /**
11
+ * Deserializes an dlc_info message
12
+ * @param buf
13
+ */
14
+ private static deserializeV0;
15
+ /**
16
+ * The type for dlc_info message
17
+ */
18
+ type: MessageType;
19
+ numDlcOffers: number;
20
+ numDlcAccepts: number;
21
+ numDlcSigns: number;
22
+ numDlcCancels: number;
23
+ numDlcCloses: number;
24
+ numDlcTransactions: number;
25
+ /**
26
+ * Serializes the dlc_info message into a Buffer
27
+ */
28
+ serialize(): Buffer;
29
+ }
30
+ export declare const DlcInfoV0: typeof DlcInfo;
31
+ export type DlcInfoV0 = DlcInfo;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DlcInfoV0 = exports.DlcInfo = void 0;
4
+ const bufio_1 = require("@node-dlc/bufio");
5
+ const MessageType_1 = require("../MessageType");
6
+ /**
7
+ * DlcInfo message contains list of buffers
8
+ */
9
+ class DlcInfo {
10
+ constructor() {
11
+ /**
12
+ * The type for dlc_info message
13
+ */
14
+ this.type = DlcInfo.type;
15
+ }
16
+ static deserialize(buf) {
17
+ const reader = new bufio_1.BufferReader(buf);
18
+ const type = Number(reader.readUInt16BE());
19
+ switch (type) {
20
+ case MessageType_1.MessageType.DlcInfoV0:
21
+ return DlcInfo.deserializeV0(buf);
22
+ default:
23
+ throw new Error(`DLC Info message type must be DlcInfoV0`);
24
+ }
25
+ }
26
+ /**
27
+ * Deserializes an dlc_info message
28
+ * @param buf
29
+ */
30
+ static deserializeV0(buf) {
31
+ const instance = new DlcInfo();
32
+ const reader = new bufio_1.BufferReader(buf);
33
+ reader.readUInt16BE(); // read type
34
+ instance.numDlcOffers = reader.readUInt32BE();
35
+ instance.numDlcAccepts = reader.readUInt32BE();
36
+ instance.numDlcSigns = reader.readUInt32BE();
37
+ instance.numDlcCancels = reader.readUInt32BE();
38
+ instance.numDlcCloses = reader.readUInt32BE();
39
+ instance.numDlcTransactions = reader.readUInt32BE();
40
+ return instance;
41
+ }
42
+ /**
43
+ * Serializes the dlc_info message into a Buffer
44
+ */
45
+ serialize() {
46
+ const writer = new bufio_1.BufferWriter();
47
+ writer.writeUInt16BE(this.type);
48
+ writer.writeUInt32BE(this.numDlcOffers);
49
+ writer.writeUInt32BE(this.numDlcAccepts);
50
+ writer.writeUInt32BE(this.numDlcSigns);
51
+ writer.writeUInt32BE(this.numDlcCancels);
52
+ writer.writeUInt32BE(this.numDlcCloses);
53
+ writer.writeUInt32BE(this.numDlcTransactions);
54
+ return writer.toBuffer();
55
+ }
56
+ }
57
+ exports.DlcInfo = DlcInfo;
58
+ DlcInfo.type = MessageType_1.MessageType.DlcInfo;
59
+ // Legacy support - keeping old class name as alias
60
+ exports.DlcInfoV0 = DlcInfo;
61
+ //# sourceMappingURL=DlcInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DlcInfo.js","sourceRoot":"","sources":["../../lib/messages/DlcInfo.ts"],"names":[],"mappings":";;;AAAA,2CAA6D;AAE7D,gDAA6C;AAG7C;;GAEG;AACH,MAAa,OAAO;IAApB;QAoCE;;WAEG;QACI,SAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B7B,CAAC;IAjEQ,MAAM,CAAC,WAAW,CAAC,GAAW;QACnC,MAAM,MAAM,GAAG,IAAI,oBAAY,CAAC,GAAG,CAAC,CAAC;QAErC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;QAE3C,QAAQ,IAAI,EAAE;YACZ,KAAK,yBAAW,CAAC,SAAS;gBACxB,OAAO,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;YACpC;gBACE,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;SAC9D;IACH,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,aAAa,CAAC,GAAW;QACtC,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,oBAAY,CAAC,GAAG,CAAC,CAAC;QAErC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,YAAY;QAEnC,QAAQ,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;QAC9C,QAAQ,CAAC,aAAa,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;QAC/C,QAAQ,CAAC,WAAW,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;QAC7C,QAAQ,CAAC,aAAa,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;QAC/C,QAAQ,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;QAC9C,QAAQ,CAAC,kBAAkB,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;QAEpD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAmBD;;OAEG;IACI,SAAS;QACd,MAAM,MAAM,GAAG,IAAI,oBAAY,EAAE,CAAC;QAClC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACxC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACvC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACxC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAE9C,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;;AAnEH,0BAoEC;AAnEe,YAAI,GAAG,yBAAW,CAAC,OAAO,CAAC;AAqE3C,mDAAmD;AACtC,QAAA,SAAS,GAAG,OAAO,CAAC"}
@@ -0,0 +1,23 @@
1
+ /// <reference types="node" />
2
+ import { EnumeratedDescriptor, NumericalDescriptor } from './ContractDescriptor';
3
+ import { DisjointContractInfo, IContractInfoV0JSON, IContractInfoV1JSON, SingleContractInfo } from './ContractInfo';
4
+ import { DlcAccept } from './DlcAccept';
5
+ import { DlcClose } from './DlcClose';
6
+ import { DlcOffer } from './DlcOffer';
7
+ import { DlcSign } from './DlcSign';
8
+ import { NodeAnnouncementMessage } from './NodeAnnouncementMessage';
9
+ import { OracleAnnouncement } from './OracleAnnouncement';
10
+ import { OracleAttestation } from './OracleAttestation';
11
+ import { OrderAccept } from './OrderAccept';
12
+ import { OrderOffer } from './OrderOffer';
13
+ export interface IDlcMessage {
14
+ type: number;
15
+ serialize(): Buffer;
16
+ }
17
+ export type ContractInfoV0JSON = IContractInfoV0JSON;
18
+ export type ContractInfoV1JSON = IContractInfoV1JSON;
19
+ export declare abstract class DlcMessage {
20
+ static deserialize(buf: Buffer): EnumeratedDescriptor | NumericalDescriptor | SingleContractInfo | DisjointContractInfo | OrderOffer | OrderAccept | DlcOffer | DlcAccept | DlcSign | DlcClose | OracleAttestation | OracleAnnouncement | NodeAnnouncementMessage;
21
+ abstract type: number;
22
+ abstract serialize(): Buffer;
23
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DlcMessage = void 0;
4
+ const bufio_1 = require("@node-dlc/bufio");
5
+ const MessageType_1 = require("../MessageType");
6
+ const ContractDescriptor_1 = require("./ContractDescriptor");
7
+ const ContractInfo_1 = require("./ContractInfo");
8
+ const DlcAccept_1 = require("./DlcAccept");
9
+ const DlcClose_1 = require("./DlcClose");
10
+ const DlcOffer_1 = require("./DlcOffer");
11
+ const DlcSign_1 = require("./DlcSign");
12
+ const NodeAnnouncementMessage_1 = require("./NodeAnnouncementMessage");
13
+ const OracleAnnouncement_1 = require("./OracleAnnouncement");
14
+ const OracleAttestation_1 = require("./OracleAttestation");
15
+ const OrderAccept_1 = require("./OrderAccept");
16
+ const OrderOffer_1 = require("./OrderOffer");
17
+ class DlcMessage {
18
+ static deserialize(buf) {
19
+ const reader = new bufio_1.BufferReader(buf);
20
+ const type = reader.readUInt16BE();
21
+ switch (type) {
22
+ case MessageType_1.MessageType.ContractDescriptorV0:
23
+ return ContractDescriptor_1.EnumeratedDescriptor.deserialize(buf);
24
+ case MessageType_1.MessageType.ContractDescriptorV1:
25
+ return ContractDescriptor_1.NumericalDescriptor.deserialize(buf);
26
+ case MessageType_1.MessageType.SingleContractInfo:
27
+ return ContractInfo_1.SingleContractInfo.deserialize(buf);
28
+ case MessageType_1.MessageType.DisjointContractInfo:
29
+ return ContractInfo_1.DisjointContractInfo.deserialize(buf);
30
+ case MessageType_1.MessageType.OrderOffer:
31
+ return OrderOffer_1.OrderOffer.deserialize(buf);
32
+ case MessageType_1.MessageType.OrderAccept:
33
+ return OrderAccept_1.OrderAccept.deserialize(buf);
34
+ case MessageType_1.MessageType.DlcOffer:
35
+ return DlcOffer_1.DlcOffer.deserialize(buf);
36
+ case MessageType_1.MessageType.DlcAccept:
37
+ return DlcAccept_1.DlcAccept.deserialize(buf);
38
+ case MessageType_1.MessageType.DlcSign:
39
+ return DlcSign_1.DlcSign.deserialize(buf);
40
+ case MessageType_1.MessageType.DlcClose:
41
+ return DlcClose_1.DlcClose.deserialize(buf);
42
+ case MessageType_1.MessageType.OracleAttestation:
43
+ return OracleAttestation_1.OracleAttestation.deserialize(buf);
44
+ case MessageType_1.MessageType.OracleAnnouncement:
45
+ return OracleAnnouncement_1.OracleAnnouncement.deserialize(buf);
46
+ case MessageType_1.MessageType.NodeAnnouncement:
47
+ return NodeAnnouncementMessage_1.NodeAnnouncementMessage.deserialize(buf);
48
+ default:
49
+ throw new Error(`DlcMessage type ${type} not supported`);
50
+ }
51
+ }
52
+ }
53
+ exports.DlcMessage = DlcMessage;
54
+ //# sourceMappingURL=DlcMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DlcMessage.js","sourceRoot":"","sources":["../../lib/messages/DlcMessage.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAE/C,gDAA6C;AAC7C,6DAG8B;AAC9B,iDAKwB;AACxB,2CAAwC;AACxC,yCAAsC;AACtC,yCAAsC;AACtC,uCAAoC;AACpC,uEAAoE;AACpE,6DAA0D;AAC1D,2DAAwD;AACxD,+CAA4C;AAC5C,6CAA0C;AAU1C,MAAsB,UAAU;IACvB,MAAM,CAAC,WAAW,CACvB,GAAW;QAeX,MAAM,MAAM,GAAG,IAAI,oBAAY,CAAC,GAAG,CAAC,CAAC;QACrC,MAAM,IAAI,GAAG,MAAM,CAAC,YAAY,EAAE,C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