@did-btcr2/method 0.13.1

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 (310) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +7 -0
  3. package/dist/browser.js +2364 -0
  4. package/dist/browser.js.map +7 -0
  5. package/dist/browser.mjs +2364 -0
  6. package/dist/browser.mjs.map +7 -0
  7. package/dist/cjs/bitcoin/constants.js +20 -0
  8. package/dist/cjs/bitcoin/constants.js.map +1 -0
  9. package/dist/cjs/bitcoin/errors.js +11 -0
  10. package/dist/cjs/bitcoin/errors.js.map +1 -0
  11. package/dist/cjs/bitcoin/index.js +95 -0
  12. package/dist/cjs/bitcoin/index.js.map +1 -0
  13. package/dist/cjs/bitcoin/interface.js +2 -0
  14. package/dist/cjs/bitcoin/interface.js.map +1 -0
  15. package/dist/cjs/bitcoin/network.js +17 -0
  16. package/dist/cjs/bitcoin/network.js.map +1 -0
  17. package/dist/cjs/bitcoin/rest-client.js +289 -0
  18. package/dist/cjs/bitcoin/rest-client.js.map +1 -0
  19. package/dist/cjs/bitcoin/rpc-client.js +722 -0
  20. package/dist/cjs/bitcoin/rpc-client.js.map +1 -0
  21. package/dist/cjs/bitcoin/taproot.js +219 -0
  22. package/dist/cjs/bitcoin/taproot.js.map +1 -0
  23. package/dist/cjs/btcr2/beacon/aggregation/coordinator.js +120 -0
  24. package/dist/cjs/btcr2/beacon/aggregation/coordinator.js.map +1 -0
  25. package/dist/cjs/btcr2/beacon/aggregation/messages/advert.js +24 -0
  26. package/dist/cjs/btcr2/beacon/aggregation/messages/advert.js.map +1 -0
  27. package/dist/cjs/btcr2/beacon/aggregation/messages/base.js +37 -0
  28. package/dist/cjs/btcr2/beacon/aggregation/messages/base.js.map +1 -0
  29. package/dist/cjs/btcr2/beacon/aggregation/messages/cohort-set.js +25 -0
  30. package/dist/cjs/btcr2/beacon/aggregation/messages/cohort-set.js.map +1 -0
  31. package/dist/cjs/btcr2/beacon/aggregation/messages/keygen.js +8 -0
  32. package/dist/cjs/btcr2/beacon/aggregation/messages/keygen.js.map +1 -0
  33. package/dist/cjs/btcr2/beacon/aggregation/messages/opt-in.js +23 -0
  34. package/dist/cjs/btcr2/beacon/aggregation/messages/opt-in.js.map +1 -0
  35. package/dist/cjs/btcr2/beacon/aggregation/messages/sign.js +7 -0
  36. package/dist/cjs/btcr2/beacon/aggregation/messages/sign.js.map +1 -0
  37. package/dist/cjs/btcr2/beacon/aggregation/models/cohort/index.js +92 -0
  38. package/dist/cjs/btcr2/beacon/aggregation/models/cohort/index.js.map +1 -0
  39. package/dist/cjs/btcr2/beacon/aggregation/models/cohort/status.js +8 -0
  40. package/dist/cjs/btcr2/beacon/aggregation/models/cohort/status.js.map +1 -0
  41. package/dist/cjs/btcr2/beacon/aggregation/participant.js +2 -0
  42. package/dist/cjs/btcr2/beacon/aggregation/participant.js.map +1 -0
  43. package/dist/cjs/btcr2/beacon/aggregation/protocol/nostr.js +57 -0
  44. package/dist/cjs/btcr2/beacon/aggregation/protocol/nostr.js.map +1 -0
  45. package/dist/cjs/btcr2/beacon/aggregation/protocol/service.js +2 -0
  46. package/dist/cjs/btcr2/beacon/aggregation/protocol/service.js.map +1 -0
  47. package/dist/cjs/btcr2/beacon/cid-aggregate.js +116 -0
  48. package/dist/cjs/btcr2/beacon/cid-aggregate.js.map +1 -0
  49. package/dist/cjs/btcr2/beacon/factory.js +30 -0
  50. package/dist/cjs/btcr2/beacon/factory.js.map +1 -0
  51. package/dist/cjs/btcr2/beacon/singleton.js +220 -0
  52. package/dist/cjs/btcr2/beacon/singleton.js.map +1 -0
  53. package/dist/cjs/btcr2/beacon/smt-aggregate.js +126 -0
  54. package/dist/cjs/btcr2/beacon/smt-aggregate.js.map +1 -0
  55. package/dist/cjs/btcr2/crud/create.js +102 -0
  56. package/dist/cjs/btcr2/crud/create.js.map +1 -0
  57. package/dist/cjs/btcr2/crud/deactivate.js +14 -0
  58. package/dist/cjs/btcr2/crud/deactivate.js.map +1 -0
  59. package/dist/cjs/btcr2/crud/read.js +686 -0
  60. package/dist/cjs/btcr2/crud/read.js.map +1 -0
  61. package/dist/cjs/btcr2/crud/update.js +195 -0
  62. package/dist/cjs/btcr2/crud/update.js.map +1 -0
  63. package/dist/cjs/btcr2/key-manager/index.js +290 -0
  64. package/dist/cjs/btcr2/key-manager/index.js.map +1 -0
  65. package/dist/cjs/btcr2/key-manager/interface.js +2 -0
  66. package/dist/cjs/btcr2/key-manager/interface.js.map +1 -0
  67. package/dist/cjs/did-btcr2.js +222 -0
  68. package/dist/cjs/did-btcr2.js.map +1 -0
  69. package/dist/cjs/index.js +27 -0
  70. package/dist/cjs/index.js.map +1 -0
  71. package/dist/cjs/interfaces/beacon.js +41 -0
  72. package/dist/cjs/interfaces/beacon.js.map +1 -0
  73. package/dist/cjs/interfaces/crud.js +2 -0
  74. package/dist/cjs/interfaces/crud.js.map +1 -0
  75. package/dist/cjs/interfaces/ibeacon.js +2 -0
  76. package/dist/cjs/interfaces/ibeacon.js.map +1 -0
  77. package/dist/cjs/package.json +1 -0
  78. package/dist/cjs/types/bitcoin.js +62 -0
  79. package/dist/cjs/types/bitcoin.js.map +1 -0
  80. package/dist/cjs/types/crud.js +2 -0
  81. package/dist/cjs/types/crud.js.map +1 -0
  82. package/dist/cjs/utils/appendix.js +221 -0
  83. package/dist/cjs/utils/appendix.js.map +1 -0
  84. package/dist/cjs/utils/beacons.js +206 -0
  85. package/dist/cjs/utils/beacons.js.map +1 -0
  86. package/dist/cjs/utils/did-document-builder.js +61 -0
  87. package/dist/cjs/utils/did-document-builder.js.map +1 -0
  88. package/dist/cjs/utils/did-document.js +380 -0
  89. package/dist/cjs/utils/did-document.js.map +1 -0
  90. package/dist/cjs/utils/general.js +195 -0
  91. package/dist/cjs/utils/general.js.map +1 -0
  92. package/dist/cjs/utils/identifier.js +238 -0
  93. package/dist/cjs/utils/identifier.js.map +1 -0
  94. package/dist/esm/bitcoin/constants.js +20 -0
  95. package/dist/esm/bitcoin/constants.js.map +1 -0
  96. package/dist/esm/bitcoin/errors.js +11 -0
  97. package/dist/esm/bitcoin/errors.js.map +1 -0
  98. package/dist/esm/bitcoin/index.js +95 -0
  99. package/dist/esm/bitcoin/index.js.map +1 -0
  100. package/dist/esm/bitcoin/interface.js +2 -0
  101. package/dist/esm/bitcoin/interface.js.map +1 -0
  102. package/dist/esm/bitcoin/network.js +17 -0
  103. package/dist/esm/bitcoin/network.js.map +1 -0
  104. package/dist/esm/bitcoin/rest-client.js +289 -0
  105. package/dist/esm/bitcoin/rest-client.js.map +1 -0
  106. package/dist/esm/bitcoin/rpc-client.js +722 -0
  107. package/dist/esm/bitcoin/rpc-client.js.map +1 -0
  108. package/dist/esm/bitcoin/taproot.js +219 -0
  109. package/dist/esm/bitcoin/taproot.js.map +1 -0
  110. package/dist/esm/btcr2/beacon/aggregation/coordinator.js +120 -0
  111. package/dist/esm/btcr2/beacon/aggregation/coordinator.js.map +1 -0
  112. package/dist/esm/btcr2/beacon/aggregation/messages/advert.js +24 -0
  113. package/dist/esm/btcr2/beacon/aggregation/messages/advert.js.map +1 -0
  114. package/dist/esm/btcr2/beacon/aggregation/messages/base.js +37 -0
  115. package/dist/esm/btcr2/beacon/aggregation/messages/base.js.map +1 -0
  116. package/dist/esm/btcr2/beacon/aggregation/messages/cohort-set.js +25 -0
  117. package/dist/esm/btcr2/beacon/aggregation/messages/cohort-set.js.map +1 -0
  118. package/dist/esm/btcr2/beacon/aggregation/messages/keygen.js +8 -0
  119. package/dist/esm/btcr2/beacon/aggregation/messages/keygen.js.map +1 -0
  120. package/dist/esm/btcr2/beacon/aggregation/messages/opt-in.js +23 -0
  121. package/dist/esm/btcr2/beacon/aggregation/messages/opt-in.js.map +1 -0
  122. package/dist/esm/btcr2/beacon/aggregation/messages/sign.js +7 -0
  123. package/dist/esm/btcr2/beacon/aggregation/messages/sign.js.map +1 -0
  124. package/dist/esm/btcr2/beacon/aggregation/models/cohort/index.js +92 -0
  125. package/dist/esm/btcr2/beacon/aggregation/models/cohort/index.js.map +1 -0
  126. package/dist/esm/btcr2/beacon/aggregation/models/cohort/status.js +8 -0
  127. package/dist/esm/btcr2/beacon/aggregation/models/cohort/status.js.map +1 -0
  128. package/dist/esm/btcr2/beacon/aggregation/participant.js +2 -0
  129. package/dist/esm/btcr2/beacon/aggregation/participant.js.map +1 -0
  130. package/dist/esm/btcr2/beacon/aggregation/protocol/nostr.js +57 -0
  131. package/dist/esm/btcr2/beacon/aggregation/protocol/nostr.js.map +1 -0
  132. package/dist/esm/btcr2/beacon/aggregation/protocol/service.js +2 -0
  133. package/dist/esm/btcr2/beacon/aggregation/protocol/service.js.map +1 -0
  134. package/dist/esm/btcr2/beacon/cid-aggregate.js +116 -0
  135. package/dist/esm/btcr2/beacon/cid-aggregate.js.map +1 -0
  136. package/dist/esm/btcr2/beacon/factory.js +30 -0
  137. package/dist/esm/btcr2/beacon/factory.js.map +1 -0
  138. package/dist/esm/btcr2/beacon/singleton.js +220 -0
  139. package/dist/esm/btcr2/beacon/singleton.js.map +1 -0
  140. package/dist/esm/btcr2/beacon/smt-aggregate.js +126 -0
  141. package/dist/esm/btcr2/beacon/smt-aggregate.js.map +1 -0
  142. package/dist/esm/btcr2/crud/create.js +102 -0
  143. package/dist/esm/btcr2/crud/create.js.map +1 -0
  144. package/dist/esm/btcr2/crud/deactivate.js +14 -0
  145. package/dist/esm/btcr2/crud/deactivate.js.map +1 -0
  146. package/dist/esm/btcr2/crud/read.js +686 -0
  147. package/dist/esm/btcr2/crud/read.js.map +1 -0
  148. package/dist/esm/btcr2/crud/update.js +195 -0
  149. package/dist/esm/btcr2/crud/update.js.map +1 -0
  150. package/dist/esm/btcr2/key-manager/index.js +290 -0
  151. package/dist/esm/btcr2/key-manager/index.js.map +1 -0
  152. package/dist/esm/btcr2/key-manager/interface.js +2 -0
  153. package/dist/esm/btcr2/key-manager/interface.js.map +1 -0
  154. package/dist/esm/did-btcr2.js +222 -0
  155. package/dist/esm/did-btcr2.js.map +1 -0
  156. package/dist/esm/index.js +27 -0
  157. package/dist/esm/index.js.map +1 -0
  158. package/dist/esm/interfaces/beacon.js +41 -0
  159. package/dist/esm/interfaces/beacon.js.map +1 -0
  160. package/dist/esm/interfaces/crud.js +2 -0
  161. package/dist/esm/interfaces/crud.js.map +1 -0
  162. package/dist/esm/interfaces/ibeacon.js +2 -0
  163. package/dist/esm/interfaces/ibeacon.js.map +1 -0
  164. package/dist/esm/types/bitcoin.js +62 -0
  165. package/dist/esm/types/bitcoin.js.map +1 -0
  166. package/dist/esm/types/crud.js +2 -0
  167. package/dist/esm/types/crud.js.map +1 -0
  168. package/dist/esm/utils/appendix.js +221 -0
  169. package/dist/esm/utils/appendix.js.map +1 -0
  170. package/dist/esm/utils/beacons.js +206 -0
  171. package/dist/esm/utils/beacons.js.map +1 -0
  172. package/dist/esm/utils/did-document-builder.js +61 -0
  173. package/dist/esm/utils/did-document-builder.js.map +1 -0
  174. package/dist/esm/utils/did-document.js +380 -0
  175. package/dist/esm/utils/did-document.js.map +1 -0
  176. package/dist/esm/utils/general.js +195 -0
  177. package/dist/esm/utils/general.js.map +1 -0
  178. package/dist/esm/utils/identifier.js +238 -0
  179. package/dist/esm/utils/identifier.js.map +1 -0
  180. package/dist/types/bitcoin/constants.d.ts +19 -0
  181. package/dist/types/bitcoin/constants.d.ts.map +1 -0
  182. package/dist/types/bitcoin/errors.d.ts +5 -0
  183. package/dist/types/bitcoin/errors.d.ts.map +1 -0
  184. package/dist/types/bitcoin/index.d.ts +75 -0
  185. package/dist/types/bitcoin/index.d.ts.map +1 -0
  186. package/dist/types/bitcoin/interface.d.ts +86 -0
  187. package/dist/types/bitcoin/interface.d.ts.map +1 -0
  188. package/dist/types/bitcoin/network.d.ts +2 -0
  189. package/dist/types/bitcoin/network.d.ts.map +1 -0
  190. package/dist/types/bitcoin/rest-client.d.ts +268 -0
  191. package/dist/types/bitcoin/rest-client.d.ts.map +1 -0
  192. package/dist/types/bitcoin/rpc-client.d.ts +506 -0
  193. package/dist/types/bitcoin/rpc-client.d.ts.map +1 -0
  194. package/dist/types/bitcoin/taproot.d.ts +34 -0
  195. package/dist/types/bitcoin/taproot.d.ts.map +1 -0
  196. package/dist/types/btcr2/beacon/aggregation/coordinator.d.ts +74 -0
  197. package/dist/types/btcr2/beacon/aggregation/coordinator.d.ts.map +1 -0
  198. package/dist/types/btcr2/beacon/aggregation/messages/advert.d.ts +22 -0
  199. package/dist/types/btcr2/beacon/aggregation/messages/advert.d.ts.map +1 -0
  200. package/dist/types/btcr2/beacon/aggregation/messages/base.d.ts +36 -0
  201. package/dist/types/btcr2/beacon/aggregation/messages/base.d.ts.map +1 -0
  202. package/dist/types/btcr2/beacon/aggregation/messages/cohort-set.d.ts +23 -0
  203. package/dist/types/btcr2/beacon/aggregation/messages/cohort-set.d.ts.map +1 -0
  204. package/dist/types/btcr2/beacon/aggregation/messages/keygen.d.ts +6 -0
  205. package/dist/types/btcr2/beacon/aggregation/messages/keygen.d.ts.map +1 -0
  206. package/dist/types/btcr2/beacon/aggregation/messages/opt-in.d.ts +22 -0
  207. package/dist/types/btcr2/beacon/aggregation/messages/opt-in.d.ts.map +1 -0
  208. package/dist/types/btcr2/beacon/aggregation/messages/sign.d.ts +5 -0
  209. package/dist/types/btcr2/beacon/aggregation/messages/sign.d.ts.map +1 -0
  210. package/dist/types/btcr2/beacon/aggregation/models/cohort/index.d.ts +77 -0
  211. package/dist/types/btcr2/beacon/aggregation/models/cohort/index.d.ts.map +1 -0
  212. package/dist/types/btcr2/beacon/aggregation/models/cohort/status.d.ts +7 -0
  213. package/dist/types/btcr2/beacon/aggregation/models/cohort/status.d.ts.map +1 -0
  214. package/dist/types/btcr2/beacon/aggregation/participant.d.ts +1 -0
  215. package/dist/types/btcr2/beacon/aggregation/participant.d.ts.map +1 -0
  216. package/dist/types/btcr2/beacon/aggregation/protocol/nostr.d.ts +36 -0
  217. package/dist/types/btcr2/beacon/aggregation/protocol/nostr.d.ts.map +1 -0
  218. package/dist/types/btcr2/beacon/aggregation/protocol/service.d.ts +6 -0
  219. package/dist/types/btcr2/beacon/aggregation/protocol/service.d.ts.map +1 -0
  220. package/dist/types/btcr2/beacon/cid-aggregate.d.ts +103 -0
  221. package/dist/types/btcr2/beacon/cid-aggregate.d.ts.map +1 -0
  222. package/dist/types/btcr2/beacon/factory.d.ts +17 -0
  223. package/dist/types/btcr2/beacon/factory.d.ts.map +1 -0
  224. package/dist/types/btcr2/beacon/singleton.d.ts +93 -0
  225. package/dist/types/btcr2/beacon/singleton.d.ts.map +1 -0
  226. package/dist/types/btcr2/beacon/smt-aggregate.d.ts +112 -0
  227. package/dist/types/btcr2/beacon/smt-aggregate.d.ts.map +1 -0
  228. package/dist/types/btcr2/crud/create.d.ts +92 -0
  229. package/dist/types/btcr2/crud/create.d.ts.map +1 -0
  230. package/dist/types/btcr2/crud/deactivate.d.ts +13 -0
  231. package/dist/types/btcr2/crud/deactivate.d.ts.map +1 -0
  232. package/dist/types/btcr2/crud/read.d.ts +341 -0
  233. package/dist/types/btcr2/crud/read.d.ts.map +1 -0
  234. package/dist/types/btcr2/crud/update.d.ts +83 -0
  235. package/dist/types/btcr2/crud/update.d.ts.map +1 -0
  236. package/dist/types/btcr2/key-manager/index.d.ts +145 -0
  237. package/dist/types/btcr2/key-manager/index.d.ts.map +1 -0
  238. package/dist/types/btcr2/key-manager/interface.d.ts +113 -0
  239. package/dist/types/btcr2/key-manager/interface.d.ts.map +1 -0
  240. package/dist/types/did-btcr2.d.ts +117 -0
  241. package/dist/types/did-btcr2.d.ts.map +1 -0
  242. package/dist/types/index.d.ts +26 -0
  243. package/dist/types/index.d.ts.map +1 -0
  244. package/dist/types/interfaces/beacon.d.ts +57 -0
  245. package/dist/types/interfaces/beacon.d.ts.map +1 -0
  246. package/dist/types/interfaces/crud.d.ts +35 -0
  247. package/dist/types/interfaces/crud.d.ts.map +1 -0
  248. package/dist/types/interfaces/ibeacon.d.ts +66 -0
  249. package/dist/types/interfaces/ibeacon.d.ts.map +1 -0
  250. package/dist/types/types/bitcoin.d.ts +827 -0
  251. package/dist/types/types/bitcoin.d.ts.map +1 -0
  252. package/dist/types/types/crud.d.ts +38 -0
  253. package/dist/types/types/crud.d.ts.map +1 -0
  254. package/dist/types/utils/appendix.d.ts +118 -0
  255. package/dist/types/utils/appendix.d.ts.map +1 -0
  256. package/dist/types/utils/beacons.d.ts +156 -0
  257. package/dist/types/utils/beacons.d.ts.map +1 -0
  258. package/dist/types/utils/did-document-builder.d.ts +13 -0
  259. package/dist/types/utils/did-document-builder.d.ts.map +1 -0
  260. package/dist/types/utils/did-document.d.ts +211 -0
  261. package/dist/types/utils/did-document.d.ts.map +1 -0
  262. package/dist/types/utils/general.d.ts +85 -0
  263. package/dist/types/utils/general.d.ts.map +1 -0
  264. package/dist/types/utils/identifier.d.ts +59 -0
  265. package/dist/types/utils/identifier.d.ts.map +1 -0
  266. package/package.json +137 -0
  267. package/src/bitcoin/constants.ts +19 -0
  268. package/src/bitcoin/errors.ts +10 -0
  269. package/src/bitcoin/index.ts +154 -0
  270. package/src/bitcoin/interface.ts +160 -0
  271. package/src/bitcoin/network.ts +17 -0
  272. package/src/bitcoin/rest-client.ts +415 -0
  273. package/src/bitcoin/rpc-client.ts +888 -0
  274. package/src/bitcoin/taproot.ts +237 -0
  275. package/src/btcr2/beacon/aggregation/coordinator.ts +135 -0
  276. package/src/btcr2/beacon/aggregation/messages/advert.ts +36 -0
  277. package/src/btcr2/beacon/aggregation/messages/base.ts +59 -0
  278. package/src/btcr2/beacon/aggregation/messages/cohort-set.ts +37 -0
  279. package/src/btcr2/beacon/aggregation/messages/keygen.ts +8 -0
  280. package/src/btcr2/beacon/aggregation/messages/opt-in.ts +35 -0
  281. package/src/btcr2/beacon/aggregation/messages/sign.ts +7 -0
  282. package/src/btcr2/beacon/aggregation/models/cohort/index.ts +112 -0
  283. package/src/btcr2/beacon/aggregation/models/cohort/status.ts +7 -0
  284. package/src/btcr2/beacon/aggregation/participant.ts +0 -0
  285. package/src/btcr2/beacon/aggregation/protocol/nostr.ts +81 -0
  286. package/src/btcr2/beacon/aggregation/protocol/service.ts +6 -0
  287. package/src/btcr2/beacon/cid-aggregate.ts +154 -0
  288. package/src/btcr2/beacon/factory.ts +36 -0
  289. package/src/btcr2/beacon/singleton.ts +257 -0
  290. package/src/btcr2/beacon/smt-aggregate.ts +136 -0
  291. package/src/btcr2/crud/create.ts +160 -0
  292. package/src/btcr2/crud/deactivate.ts +13 -0
  293. package/src/btcr2/crud/read.ts +946 -0
  294. package/src/btcr2/crud/update.ts +277 -0
  295. package/src/btcr2/key-manager/index.ts +364 -0
  296. package/src/btcr2/key-manager/interface.ts +129 -0
  297. package/src/canonicalize.d.ts +6 -0
  298. package/src/did-btcr2.ts +288 -0
  299. package/src/index.ts +34 -0
  300. package/src/interfaces/beacon.ts +68 -0
  301. package/src/interfaces/crud.ts +36 -0
  302. package/src/interfaces/ibeacon.ts +76 -0
  303. package/src/types/bitcoin.ts +1028 -0
  304. package/src/types/crud.ts +41 -0
  305. package/src/utils/appendix.ts +257 -0
  306. package/src/utils/beacons.ts +276 -0
  307. package/src/utils/did-document-builder.ts +73 -0
  308. package/src/utils/did-document.ts +474 -0
  309. package/src/utils/general.ts +204 -0
  310. package/src/utils/identifier.ts +276 -0
@@ -0,0 +1,86 @@
1
+ import { AddMultiSigAddressParams, BatchOption, BlockResponse, BumpFeeOption, BumpFeeResult, ChainInfo, CreateMultiSigResult, CreateRawTxInputs, CreateRawTxOutputs, CreateWalletParams, CreateWalletResult, DecodedRawTransaction, FeeEstimateMode, FundRawTxOptions, GetBlockParams, MempoolInfo, MiningInfo, PeerInfo, RawTransactionResponse, ScriptDecoded, ValidateAddressResult } from '../types/bitcoin.js';
2
+ /**
3
+ * Interface for the Bitcoin Core RPC client.
4
+ */
5
+ export interface IBitcoinRpc {
6
+ /** Executes multiple commands in a batch request. */
7
+ command?<R extends ReturnType<any>>(methods: BatchOption[]): Promise<ReadonlyArray<R>>;
8
+ /** Marks a transaction and its in-wallet descendants as abandoned, allowing their inputs to be respent. */
9
+ abandonTransaction(txid: string): Promise<void>;
10
+ /** Stops the current wallet rescan triggered by an RPC call, such as by an importprivkey call. */
11
+ abortRescan(): Promise<void>;
12
+ /** Adds a multi-signature address with n required signatures and a set of keys. */
13
+ addMultiSigAddress({ nrequired, keys, account }: AddMultiSigAddressParams): Promise<string>;
14
+ /** Adds a witness address for SegWit compatibility. */
15
+ addWitnessAddress(address: string): Promise<void>;
16
+ /** Backs up the wallet file to a specified destination. */
17
+ backupWallet(destination: string): Promise<void>;
18
+ /** Increases the fee of an unconfirmed transaction to improve its confirmation time. */
19
+ bumpFee(txid: string, options?: BumpFeeOption): Promise<BumpFeeResult>;
20
+ /** Removes all banned nodes from the ban list. */
21
+ clearBanned(): Promise<void>;
22
+ /** Combines multiple raw transactions into a single transaction. */
23
+ combineRawTransaction(txs: string[]): Promise<string>;
24
+ /** Creates a multi-signature address with n required signatures and a set of keys. */
25
+ createMultiSig(nrequired: number, keys: string[]): Promise<CreateMultiSigResult>;
26
+ /** Creates a raw transaction spending specified inputs to specified outputs. */
27
+ createRawTransaction(inputs: CreateRawTxInputs[], outputs: CreateRawTxOutputs[], locktime?: number, replacable?: boolean): Promise<string>;
28
+ /** Creates a new wallet with various optional parameters. */
29
+ createWallet({ wallet_name, disable_private_keys, blank, passphrase, avoid_reuse, descriptors, load_on_startup, }: CreateWalletParams): Promise<CreateWalletResult>;
30
+ /** Decodes a raw transaction hex string. */
31
+ decodeRawTransaction(hexstring: string): Promise<DecodedRawTransaction>;
32
+ /** Decodes a hex-encoded script. */
33
+ decodeScript(hexstring: string): Promise<ScriptDecoded>;
34
+ /** Disconnects a node by address or node ID. */
35
+ disconnectNode(address?: string, nodeid?: number): Promise<void>;
36
+ /** Reveals the private key corresponding to an address. */
37
+ dumpPrivKey(address: string): Promise<string>;
38
+ /** Dumps all wallet keys and metadata to a file. */
39
+ dumpWallet(filename: string): Promise<{
40
+ filename: string;
41
+ }>;
42
+ /** Encrypts the wallet with a passphrase. */
43
+ encryptWallet(passphrase: string): Promise<void>;
44
+ /** Estimates the fee rate for a given confirmation target. */
45
+ estimateSmartFee(conf_target: number, estimate_mode?: FeeEstimateMode): Promise<{
46
+ feerate?: number;
47
+ errors?: string[];
48
+ blocks?: number;
49
+ }>;
50
+ /** Funds a raw transaction by adding necessary inputs and change. */
51
+ fundRawTransaction(hexstring: string, options: FundRawTxOptions): Promise<{
52
+ hex: string;
53
+ fee: number;
54
+ changepos: number;
55
+ }>;
56
+ /** Returns the number of blocks in the longest blockchain. */
57
+ getBlockCount(): Promise<number>;
58
+ /** Gets the hash of a block at a given height. */
59
+ getBlockHash(height: number): Promise<string>;
60
+ /** Gets detailed information about a specific block. */
61
+ getBlock({ blockhash, height, verbosity }: GetBlockParams): Promise<BlockResponse | undefined>;
62
+ /** Retrieves general blockchain state info. */
63
+ getBlockchainInfo(): Promise<ChainInfo>;
64
+ /** Gets the number of active connections to other nodes. */
65
+ getConnectionCount(): Promise<number>;
66
+ /** Gets the estimated network difficulty. */
67
+ getDifficulty(): Promise<number>;
68
+ /** Retrieves memory pool statistics. */
69
+ getMempoolInfo(): Promise<MempoolInfo>;
70
+ /** Retrieves mining statistics. */
71
+ getMiningInfo(): Promise<MiningInfo>;
72
+ /** Gets a new Bitcoin address for receiving payments. */
73
+ getNewAddress(account?: string): Promise<string>;
74
+ /** Gets detailed peer connection information. */
75
+ getPeerInfo(): Promise<PeerInfo[]>;
76
+ /** Sends raw transaction hex to the Bitcoin network. */
77
+ sendRawTransaction(hexstring: string, maxfeerate?: number | string, maxBurnAmount?: number | string): Promise<string>;
78
+ /** Sends bitcoins to a specified address. */
79
+ sendToAddress(address: string, amount: number, comment?: string, comment_to?: string, subtreactfeefromamount?: boolean, replaceable?: boolean, conf_target?: number, estimate_mode?: FeeEstimateMode): Promise<RawTransactionResponse>;
80
+ /** Validates a Bitcoin address. */
81
+ validateAddress(address: string): Promise<ValidateAddressResult>;
82
+ /** Verifies a signed message. */
83
+ verifyMessage(address: string, signature: string, message: string): Promise<boolean>;
84
+ /** Locks the wallet, requiring a passphrase to unlock. */
85
+ walletLock(passphrase: string, timeout: number): Promise<void>;
86
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/bitcoin/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,WAAW,EACX,aAAa,EACb,aAAa,EACb,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,UAAU,EACV,QAAQ,EACR,sBAAsB,EACtB,aAAa,EACb,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,qDAAqD;IACrD,OAAO,CAAC,CAAC,CAAC,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvF,2GAA2G;IAC3G,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD,kGAAkG;IAClG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7B,mFAAmF;IACnF,kBAAkB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE5F,uDAAuD;IACvD,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD,2DAA2D;IAC3D,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjD,wFAAwF;IACxF,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,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,iDAAiD;IACjD,WAAW,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEnC,wDAAwD;IACxD,kBAAkB,CAChB,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAC5B,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAC9B,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB,6CAA6C;IAC7C,aAAa,CACT,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,sBAAsB,CAAC,EAAE,OAAO,EAChC,WAAW,CAAC,EAAE,OAAO,EACrB,WAAW,CAAC,EAAE,MAAM,EACpB,aAAa,CAAC,EAAE,eAAe,GAChC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAEnC,mCAAmC;IACnC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAEjE,iCAAiC;IACjC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAErF,0DAA0D;IAC1D,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE"}
@@ -0,0 +1,2 @@
1
+ import { networks } from 'bitcoinjs-lib';
2
+ export declare function getNetwork(network: string): networks.Network;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../../src/bitcoin/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC,OAAO,CAc5D"}
@@ -0,0 +1,268 @@
1
+ import { Bytes, UnixTimestamp } from '@did-btcr2/common';
2
+ import { BlockResponse, GetBlockParams, TxInPrevout } from '../types/bitcoin.js';
3
+ export type TransactionStatus = {
4
+ confirmed: boolean;
5
+ block_height: number;
6
+ block_hash: string;
7
+ block_time: UnixTimestamp;
8
+ };
9
+ export interface Vin {
10
+ txid: string;
11
+ vout: number;
12
+ prevout?: TxInPrevout;
13
+ scriptsig: string;
14
+ scriptsig_asm: string;
15
+ witness: string[];
16
+ is_coinbase: boolean;
17
+ sequence: number;
18
+ }
19
+ export interface Vout {
20
+ scriptpubkey: string;
21
+ scriptpubkey_asm: string;
22
+ scriptpubkey_type: string;
23
+ scriptpubkey_address?: string;
24
+ value: number;
25
+ }
26
+ export interface ChainStats {
27
+ funded_txo_count: number;
28
+ funded_txo_sum: number;
29
+ spent_txo_count: number;
30
+ spent_txo_sum: number;
31
+ tx_count: number;
32
+ }
33
+ export interface MempoolStats {
34
+ funded_txo_count: number;
35
+ funded_txo_sum: number;
36
+ spent_txo_count: number;
37
+ spent_txo_sum: number;
38
+ tx_count: number;
39
+ }
40
+ export interface AddressInfo {
41
+ address: string;
42
+ chain_stats: ChainStats;
43
+ mempool_stats: MempoolStats;
44
+ }
45
+ export interface RawTransactionRest {
46
+ txid: string;
47
+ version: number;
48
+ locktime: number;
49
+ vin: Array<Vin>;
50
+ vout: Array<Vout>;
51
+ size: number;
52
+ weight: number;
53
+ fee: number;
54
+ status: TransactionStatus;
55
+ }
56
+ export interface AddressUtxo {
57
+ txid: string;
58
+ vout: number;
59
+ status: TransactionStatus;
60
+ value: number;
61
+ }
62
+ export interface RestClientConfigParams {
63
+ host: string;
64
+ headers?: {
65
+ [key: string]: string;
66
+ };
67
+ }
68
+ export declare class RestClientConfig {
69
+ host: string;
70
+ headers?: {
71
+ [key: string]: string;
72
+ };
73
+ constructor({ host, headers }: RestClientConfigParams);
74
+ }
75
+ export interface RestApiCallParams {
76
+ path: string;
77
+ url?: string;
78
+ method?: string;
79
+ body?: any;
80
+ headers?: any;
81
+ }
82
+ export interface RestResponse extends Response {
83
+ [key: string]: any;
84
+ }
85
+ /**
86
+ * Implements a strongly-typed BitcoinRest to connect to remote bitcoin node via REST API.
87
+ * @class BitcoinRest
88
+ * @type {BitcoinRest}
89
+ */
90
+ export default class BitcoinRest {
91
+ /**
92
+ * The encapsulated {@link RestClientConfig} object.
93
+ * @private
94
+ * @type {RestClientConfig}
95
+ */
96
+ private _config;
97
+ /**
98
+ * The api calls related to bitcoin transactions.
99
+ * @type {BitcoinTransaction}
100
+ */
101
+ transaction: BitcoinTransaction;
102
+ /**
103
+ * The api calls related to bitcoin blocks.
104
+ * @type {BitcoinBlock}
105
+ */
106
+ block: BitcoinBlock;
107
+ /**
108
+ * The api calls related to bitcoin addresses.
109
+ * @type {BitcoinAddress}
110
+ */
111
+ address: BitcoinAddress;
112
+ /**
113
+ * The API call method that can be used to make requests to the REST API.
114
+ * @returns {Promise<any>} A promise resolving to the response data.
115
+ */
116
+ api: (params: RestApiCallParams) => Promise<any>;
117
+ constructor(config: RestClientConfig);
118
+ /**
119
+ * Get the configuration object.
120
+ * @private
121
+ */
122
+ get config(): RestClientConfig;
123
+ /**
124
+ * Static method connects to a bitcoin node running a esplora REST API.
125
+ *
126
+ * @param {RestClientConfig} config The configuration object for the client (optional).
127
+ * @returns A new {@link BitcoinRest} instance.
128
+ * @example
129
+ * ```
130
+ * const rest = BitcoinRest.connect();
131
+ * ```
132
+ */
133
+ static connect(config?: RestClientConfig): BitcoinRest;
134
+ /**
135
+ * Make a REST API call to the configured Bitcoin node.
136
+ * @private
137
+ * @param {RestApiCallParams} params The parameters for the API call. See {@link RestApiCallParams} for details.
138
+ * @param {string} [params.path] The path to the API endpoint (required).
139
+ * @param {string} [params.url] The full URL to the API endpoint (optional).
140
+ * @param {string} [params.method] The HTTP method to use (default is 'GET').
141
+ * @param {any} [params.body] The body of the request (optional).
142
+ * @param {any} [params.headers] Additional headers to include in the request (optional).
143
+ * @returns {Promise<any>} A promise resolving to the response data.
144
+ */
145
+ private call;
146
+ }
147
+ export declare class BitcoinTransaction {
148
+ private api;
149
+ constructor(api: (params: RestApiCallParams) => Promise<any>);
150
+ /**
151
+ * Returns the transaction in JSON format.
152
+ * See {@link https://github.com/blockstream/esplora/blob/master/API.md#get-txtxid | Esplora GET /tx/:txid } for details.
153
+ * @param {string} txid The transaction id (required).
154
+ * @returns {GetRawTransaction} A promise resolving to data about a transaction in the form specified by verbosity.
155
+ */
156
+ get(txid: string): Promise<RawTransactionRest>;
157
+ /**
158
+ * Returns the transaction in JSON format.
159
+ * See {@link https://github.com/blockstream/esplora/blob/master/API.md#get-txtxid | Esplora GET /tx/:txid } for details.
160
+ * @param {string} txid The transaction id (required).
161
+ * @returns {GetRawTransaction} A promise resolving to data about a transaction in the form specified by verbosity.
162
+ */
163
+ isConfirmed(txid: string): Promise<boolean>;
164
+ /**
165
+ * Returns the raw transaction in hex or as binary data.
166
+ * See {@link https://github.com/blockstream/esplora/blob/master/API.md#get-txtxidhex | Esplora GET /tx/:txid/hex } and
167
+ * {@link https://github.com/blockstream/esplora/blob/master/API.md#get-txtxidraw | Esplora GET /tx/:txid/raw } for details.
168
+ * @param {string} txid The transaction id (required).
169
+ * @returns {Promise<RawTransactionRest | string>} A promise resolving to the raw transaction in the specified format.
170
+ */
171
+ getHex(txid: string): Promise<string>;
172
+ /**
173
+ * Returns the raw transaction in hex or as binary data.
174
+ * See {@link https://github.com/blockstream/esplora/blob/master/API.md#get-txtxidhex | Esplora GET /tx/:txid/hex } and
175
+ * {@link https://github.com/blockstream/esplora/blob/master/API.md#get-txtxidraw | Esplora GET /tx/:txid/raw } for details.
176
+ * @param {string} txid The transaction id (required).
177
+ * @returns {Promise<RawTransactionRest | string>} A promise resolving to the raw transaction in the specified format.
178
+ */
179
+ getRaw(txid: string): Promise<Bytes>;
180
+ /**
181
+ * Broadcast a raw transaction to the network. The transaction should be provided as hex in the request body. The txid
182
+ * will be returned on success.
183
+ * See {@link https://github.com/blockstream/esplora/blob/master/API.md#post-tx | Esplora POST /tx } for details.
184
+ * @param {string} tx The raw transaction in hex format (required).
185
+ * @returns {Promise<string>} The transaction id of the broadcasted transaction.
186
+ */
187
+ send(tx: string): Promise<string>;
188
+ }
189
+ /**
190
+ * Implements a strongly-typed BitcoinRest to connect to remote bitcoin node via REST API for block-related operations.
191
+ * @class BitcoinBlock
192
+ * @type {BitcoinBlock}
193
+ */
194
+ export declare class BitcoinBlock {
195
+ private api;
196
+ constructor(api: (params: RestApiCallParams) => Promise<any>);
197
+ /**
198
+ * Returns the blockheight of the most-work fully-validated chain. The genesis block has height 0.
199
+ * @returns {Blockheight} The number of the blockheight with the most-work of the fully-validated chain.
200
+ */
201
+ count(): Promise<number>;
202
+ /**
203
+ * Returns the block data associated with a `blockhash` of a valid block.
204
+ * @param {GetBlockParams} params See {@link GetBlockParams} for details.
205
+ * @param {?string} params.blockhash The blockhash of the block to query.
206
+ * @param {?number} params.height The block height of the block to query.
207
+ * @returns {BlockResponse} A promise resolving to a {@link BlockResponse} formatted depending on `verbosity` level.
208
+ * @throws {BitcoinRpcError} If neither `blockhash` nor `height` is provided.
209
+ */
210
+ get({ blockhash, height }: GetBlockParams): Promise<BlockResponse | undefined>;
211
+ /**
212
+ * Get the block hash for a given block height.
213
+ * See {@link https://github.com/blockstream/esplora/blob/master/API.md#get-block-heightheight | Esplora GET /block-height/:height } for details.
214
+ * @param {number} height The block height (required).
215
+ * @returns {Promise<string>} The hash of the block currently at height..
216
+ */
217
+ getHash(height: number): Promise<string>;
218
+ }
219
+ export declare class BitcoinAddress {
220
+ private api;
221
+ constructor(api: (params: RestApiCallParams) => Promise<any>);
222
+ /**
223
+ * Get transaction history for the specified address/scripthash, sorted with newest first.
224
+ * Returns up to 50 mempool transactions plus the first 25 confirmed transactions.
225
+ * See {@link https://github.com/blockstream/esplora/blob/master/API.md#get-addressaddresstxs | Esplora GET /address/:address/txs } for details.
226
+ * @param {string} addressOrScripthash The address or scripthash to check.
227
+ * @returns {Promise<Array<RawTransactionRest>>} A promise resolving to an array of {@link RawTransactionRest} objects.
228
+ */
229
+ getTxs(addressOrScripthash: string): Promise<Array<RawTransactionRest>>;
230
+ /**
231
+ * Calls getAddressTxs and checks if any funds come back.
232
+ * Toggle if those funds are confirmed.
233
+ * @param {string} addressOrScripthash The address or scripthash to check.
234
+ * @returns {Promise<boolean>} True if the address has any funds, false otherwise.
235
+ */
236
+ isFundedAddress(addressOrScripthash: string): Promise<boolean>;
237
+ /**
238
+ * Get unconfirmed transaction history for the specified address/scripthash.
239
+ * Returns up to 50 transactions (no paging).
240
+ * @param {string} addressOrScripthash The address or scripthash to check.
241
+ * @returns {Promise<Array<RawTransactionRest>>} A promise resolving to an array of {@link RawTransactionRest} objects.
242
+ */
243
+ getTxsMempool(addressOrScripthash: string): Promise<Array<RawTransactionRest>>;
244
+ /**
245
+ * Get information about an address/scripthash.
246
+ * Available fields: address/scripthash, chain_stats and mempool_stats.
247
+ * {chain,mempool}_stats each contain an object with tx_count, funded_txo_count, funded_txo_sum, spent_txo_count and spent_txo_sum.
248
+ * Elements-based chains don't have the {funded,spent}_txo_sum fields.
249
+ * @param {string} addressOrScripthash The address or scripthash to check.
250
+ * @returns {Promise<AddressInfo>} A promise resolving to an {@link AddressInfo} object.
251
+ */
252
+ getInfo(addressOrScripthash: string): Promise<AddressInfo>;
253
+ /**
254
+ * Get confirmed transaction history for the specified address/scripthash, sorted with newest first.
255
+ * Returns 25 transactions per page. More can be requested by specifying the last txid seen by the previous query.
256
+ * @param {string} addressOrScripthash The address or scripthash to check.
257
+ * @param lastSeenTxId The last transaction id seen by the previous query (optional).
258
+ * @returns {Promise<Array<RawTransactionRest>>} A promise resolving to an array of {@link RawTransactionRest} objects.
259
+ */
260
+ getConfirmedTxs(addressOrScripthash: string, lastSeenTxId?: string): Promise<Array<RawTransactionRest>>;
261
+ /**
262
+ * Get the list of unspent transaction outputs associated with the address/scripthash.
263
+ * See {@link https://github.com/Blockstream/esplora/blob/master/API.md#get-addressaddressutxo | Esplora GET /address/:address/utxo } for details.
264
+ * @param {string} addressOrScripthash The address or scripthash to check.
265
+ * @returns {Promise<Array<RawTransactionRest>>} A promise resolving to an array of {@link RawTransactionRest} objects.
266
+ */
267
+ getUtxos(addressOrScripthash: string): Promise<Array<AddressUtxo>>;
268
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rest-client.d.ts","sourceRoot":"","sources":["../../../src/bitcoin/rest-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EACL,aAAa,EAEb,cAAc,EACd,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAI7B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,aAAa,CAAC;CAC3B,CAAC;AAEF,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,IAAI;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AACD,MAAM,WAAW,UAAU;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED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