@kontor/kontor-sdk 1.0.0-alpha.1 → 1.0.0-alpha.11

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 (286) hide show
  1. package/dist/cjs/sdk/actions/kontor/wallet/sign-reveal.js +10 -14
  2. package/dist/cjs/sdk/actions/kontor/wallet/sign-reveal.js.map +1 -1
  3. package/dist/cjs/sdk/actions/public/test-mempool-accept.js +10 -0
  4. package/dist/cjs/sdk/actions/public/test-mempool-accept.js.map +1 -1
  5. package/dist/cjs/sdk/clients/decorators/public.js +2 -0
  6. package/dist/cjs/sdk/clients/decorators/public.js.map +1 -1
  7. package/dist/cjs/sdk/clients/transports/custom.js.map +1 -1
  8. package/dist/cjs/sdk/utils/build-rpc-request.js +1 -0
  9. package/dist/cjs/sdk/utils/build-rpc-request.js.map +1 -1
  10. package/dist/cjs/tsconfig.build.tsbuildinfo +1 -1
  11. package/dist/esm/sdk/actions/kontor/wallet/sign-reveal.js +37 -23
  12. package/dist/esm/sdk/actions/kontor/wallet/sign-reveal.js.map +1 -1
  13. package/dist/esm/sdk/actions/public/test-mempool-accept.js +8 -32
  14. package/dist/esm/sdk/actions/public/test-mempool-accept.js.map +1 -1
  15. package/dist/esm/sdk/clients/decorators/public.js +2 -0
  16. package/dist/esm/sdk/clients/decorators/public.js.map +1 -1
  17. package/dist/esm/sdk/clients/transports/custom.js.map +1 -1
  18. package/dist/esm/sdk/utils/build-rpc-request.js +1 -0
  19. package/dist/esm/sdk/utils/build-rpc-request.js.map +1 -1
  20. package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
  21. package/dist/src/sdk/actions/kontor/public/build-compose-call.js +5 -6
  22. package/dist/src/sdk/actions/kontor/public/build-compose-call.js.map +1 -1
  23. package/dist/src/sdk/actions/kontor/public/build-compose-query.js +30 -0
  24. package/dist/src/sdk/actions/kontor/public/build-compose-query.js.map +1 -0
  25. package/dist/src/sdk/actions/kontor/public/build-instruction-query.js +45 -0
  26. package/dist/src/sdk/actions/kontor/public/build-instruction-query.js.map +1 -0
  27. package/dist/src/sdk/actions/kontor/public/build-instruction.js +13 -16
  28. package/dist/src/sdk/actions/kontor/public/build-instruction.js.map +1 -1
  29. package/dist/src/sdk/actions/kontor/public/call-compose.js +38 -0
  30. package/dist/src/sdk/actions/kontor/public/call-compose.js.map +1 -0
  31. package/dist/src/sdk/actions/kontor/public/call-proc.js +6 -2
  32. package/dist/src/sdk/actions/kontor/public/call-proc.js.map +1 -1
  33. package/dist/src/sdk/actions/kontor/public/proc-contract.js +8 -5
  34. package/dist/src/sdk/actions/kontor/public/proc-contract.js.map +1 -1
  35. package/dist/src/sdk/actions/kontor/wallet/sign-reveal.js +37 -25
  36. package/dist/src/sdk/actions/kontor/wallet/sign-reveal.js.map +1 -1
  37. package/dist/src/sdk/clients/decorators/kontor/public.js +6 -6
  38. package/dist/src/sdk/clients/decorators/kontor/public.js.map +1 -1
  39. package/dist/src/sdk/types/kontor.js +27 -1
  40. package/dist/src/sdk/types/kontor.js.map +1 -1
  41. package/dist/tsconfig.tsbuildinfo +1 -1
  42. package/dist/types/sdk/actions/kontor/wallet/sign-reveal.d.ts.map +1 -1
  43. package/dist/types/sdk/actions/public/test-mempool-accept.d.ts +14 -1
  44. package/dist/types/sdk/actions/public/test-mempool-accept.d.ts.map +1 -1
  45. package/dist/types/sdk/clients/decorators/public.d.ts +2 -0
  46. package/dist/types/sdk/clients/decorators/public.d.ts.map +1 -1
  47. package/dist/types/sdk/clients/transports/custom.d.ts.map +1 -1
  48. package/dist/types/sdk/types/btc-rpc.d.ts +9 -1
  49. package/dist/types/sdk/types/btc-rpc.d.ts.map +1 -1
  50. package/dist/types/sdk/utils/build-rpc-request.d.ts.map +1 -1
  51. package/package.json +6 -2
  52. package/src/sdk/actions/kontor/public/{build-compose-call.ts → build-compose-query.ts} +15 -25
  53. package/src/sdk/actions/kontor/public/{build-instruction.ts → build-instruction-query.ts} +35 -29
  54. package/src/sdk/actions/kontor/public/{call-proc.ts → call-compose.ts} +16 -19
  55. package/src/sdk/actions/kontor/public/proc-contract.ts +9 -6
  56. package/src/sdk/actions/kontor/wallet/sign-reveal.ts +49 -28
  57. package/src/sdk/actions/public/test-mempool-accept.ts +34 -31
  58. package/src/sdk/clients/decorators/kontor/public.ts +23 -23
  59. package/src/sdk/clients/decorators/public.ts +11 -0
  60. package/src/sdk/test/e2e.test.ts +193 -15
  61. package/src/sdk/types/btc-rpc.ts +12 -11
  62. package/src/sdk/types/kontor.ts +38 -0
  63. package/dist/src/exports/index.test.js +0 -10
  64. package/dist/src/exports/index.test.js.map +0 -1
  65. package/dist/src/sdk/accounts/hd-key-to-account.js +0 -20
  66. package/dist/src/sdk/accounts/hd-key-to-account.js.map +0 -1
  67. package/dist/src/sdk/accounts/mnemonic-to-account.js +0 -16
  68. package/dist/src/sdk/accounts/mnemonic-to-account.js.map +0 -1
  69. package/dist/src/sdk/accounts/mnemonic-to-account.test.js +0 -96
  70. package/dist/src/sdk/accounts/mnemonic-to-account.test.js.map +0 -1
  71. package/dist/src/sdk/accounts/to-local-account.js +0 -28
  72. package/dist/src/sdk/accounts/to-local-account.js.map +0 -1
  73. package/dist/src/sdk/accounts/types.js +0 -2
  74. package/dist/src/sdk/accounts/types.js.map +0 -1
  75. package/dist/src/sdk/accounts/utils/parse-account.js +0 -10
  76. package/dist/src/sdk/accounts/utils/parse-account.js.map +0 -1
  77. package/dist/src/sdk/accounts/utils/public-key-to-p2tr-payment.js +0 -14
  78. package/dist/src/sdk/accounts/utils/public-key-to-p2tr-payment.js.map +0 -1
  79. package/dist/src/sdk/accounts/utils/sign-psbt.js +0 -17
  80. package/dist/src/sdk/accounts/utils/sign-psbt.js.map +0 -1
  81. package/dist/src/sdk/actions/kontor/wallet/sign-commit.js +0 -34
  82. package/dist/src/sdk/actions/kontor/wallet/sign-commit.js.map +0 -1
  83. package/dist/src/sdk/actions/public/send-raw-transaction.js +0 -7
  84. package/dist/src/sdk/actions/public/send-raw-transaction.js.map +0 -1
  85. package/dist/src/sdk/actions/public/test-mempool-accept.js +0 -44
  86. package/dist/src/sdk/actions/public/test-mempool-accept.js.map +0 -1
  87. package/dist/src/sdk/chains/definitions/index.js +0 -2
  88. package/dist/src/sdk/chains/definitions/index.js.map +0 -1
  89. package/dist/src/sdk/chains/definitions/signet.js +0 -36
  90. package/dist/src/sdk/chains/definitions/signet.js.map +0 -1
  91. package/dist/src/sdk/clients/base/create-rpc-client.test.js +0 -145
  92. package/dist/src/sdk/clients/base/create-rpc-client.test.js.map +0 -1
  93. package/dist/src/sdk/clients/create-public-client.test.js +0 -113
  94. package/dist/src/sdk/clients/create-public-client.test.js.map +0 -1
  95. package/dist/src/sdk/clients/decorators/kontor/wallet.js +0 -13
  96. package/dist/src/sdk/clients/decorators/kontor/wallet.js.map +0 -1
  97. package/dist/src/sdk/clients/decorators/public.js +0 -7
  98. package/dist/src/sdk/clients/decorators/public.js.map +0 -1
  99. package/dist/src/sdk/clients/decorators/wallet.js +0 -9
  100. package/dist/src/sdk/clients/decorators/wallet.js.map +0 -1
  101. package/dist/src/sdk/clients/kontor/create-public-client.test.js +0 -44
  102. package/dist/src/sdk/clients/kontor/create-public-client.test.js.map +0 -1
  103. package/dist/src/sdk/clients/kontor/create-wallet-client.js +0 -14
  104. package/dist/src/sdk/clients/kontor/create-wallet-client.js.map +0 -1
  105. package/dist/src/sdk/clients/transports/create-http-transport.js +0 -25
  106. package/dist/src/sdk/clients/transports/create-http-transport.js.map +0 -1
  107. package/dist/src/sdk/clients/transports/create-rpc-transport.test.js +0 -58
  108. package/dist/src/sdk/clients/transports/create-rpc-transport.test.js.map +0 -1
  109. package/dist/src/sdk/clients/transports/custom.js +0 -14
  110. package/dist/src/sdk/clients/transports/custom.js.map +0 -1
  111. package/dist/src/sdk/clients/transports/http-rpc.js +0 -84
  112. package/dist/src/sdk/clients/transports/http-rpc.js.map +0 -1
  113. package/dist/src/sdk/clients/transports/http-rpc.test.js +0 -147
  114. package/dist/src/sdk/clients/transports/http-rpc.test.js.map +0 -1
  115. package/dist/src/sdk/clients/transports/http.js +0 -45
  116. package/dist/src/sdk/clients/transports/http.js.map +0 -1
  117. package/dist/src/sdk/contracts/wits.js +0 -26
  118. package/dist/src/sdk/contracts/wits.js.map +0 -1
  119. package/dist/src/sdk/errors/address.js +0 -13
  120. package/dist/src/sdk/errors/address.js.map +0 -1
  121. package/dist/src/sdk/errors/base.js +0 -92
  122. package/dist/src/sdk/errors/base.js.map +0 -1
  123. package/dist/src/sdk/errors/request.js +0 -100
  124. package/dist/src/sdk/errors/request.js.map +0 -1
  125. package/dist/src/sdk/errors/rpc.js +0 -30
  126. package/dist/src/sdk/errors/rpc.js.map +0 -1
  127. package/dist/src/sdk/errors/transport.js +0 -10
  128. package/dist/src/sdk/errors/transport.js.map +0 -1
  129. package/dist/src/sdk/errors/utils.js +0 -2
  130. package/dist/src/sdk/errors/utils.js.map +0 -1
  131. package/dist/src/sdk/errors/version.js +0 -2
  132. package/dist/src/sdk/errors/version.js.map +0 -1
  133. package/dist/src/sdk/errors/wit.js +0 -19
  134. package/dist/src/sdk/errors/wit.js.map +0 -1
  135. package/dist/src/sdk/test/e2e.test.js +0 -75
  136. package/dist/src/sdk/test/e2e.test.js.map +0 -1
  137. package/dist/src/sdk/types/account.js +0 -2
  138. package/dist/src/sdk/types/account.js.map +0 -1
  139. package/dist/src/sdk/types/btc-rpc.js +0 -2
  140. package/dist/src/sdk/types/btc-rpc.js.map +0 -1
  141. package/dist/src/sdk/types/contract.test-d.js +0 -35
  142. package/dist/src/sdk/types/contract.test-d.js.map +0 -1
  143. package/dist/src/sdk/types/http-schema.test-d.js +0 -133
  144. package/dist/src/sdk/types/http-schema.test-d.js.map +0 -1
  145. package/dist/src/sdk/types/misc.js +0 -2
  146. package/dist/src/sdk/types/misc.js.map +0 -1
  147. package/dist/src/sdk/types/rpc.js +0 -19
  148. package/dist/src/sdk/types/rpc.js.map +0 -1
  149. package/dist/src/sdk/types/utils.js +0 -2
  150. package/dist/src/sdk/types/utils.js.map +0 -1
  151. package/dist/src/sdk/types/wbip001.js +0 -3
  152. package/dist/src/sdk/types/wbip001.js.map +0 -1
  153. package/dist/src/sdk/utils/build-http-request.js +0 -55
  154. package/dist/src/sdk/utils/build-http-request.js.map +0 -1
  155. package/dist/src/sdk/utils/build-request.js +0 -35
  156. package/dist/src/sdk/utils/build-request.js.map +0 -1
  157. package/dist/src/sdk/utils/build-rpc-request.js +0 -84
  158. package/dist/src/sdk/utils/build-rpc-request.js.map +0 -1
  159. package/dist/src/sdk/utils/encoding/to-hex.js +0 -23
  160. package/dist/src/sdk/utils/encoding/to-hex.js.map +0 -1
  161. package/dist/src/sdk/utils/get-action.js +0 -27
  162. package/dist/src/sdk/utils/get-action.js.map +0 -1
  163. package/dist/src/sdk/utils/http.js +0 -137
  164. package/dist/src/sdk/utils/http.js.map +0 -1
  165. package/dist/src/sdk/utils/lru.js +0 -35
  166. package/dist/src/sdk/utils/lru.js.map +0 -1
  167. package/dist/src/sdk/utils/promise/create-batch-scheduler.js +0 -49
  168. package/dist/src/sdk/utils/promise/create-batch-scheduler.js.map +0 -1
  169. package/dist/src/sdk/utils/promise/with-dedupe.js +0 -14
  170. package/dist/src/sdk/utils/promise/with-dedupe.js.map +0 -1
  171. package/dist/src/sdk/utils/promise/with-resolvers.js +0 -10
  172. package/dist/src/sdk/utils/promise/with-resolvers.js.map +0 -1
  173. package/dist/src/sdk/utils/promise/with-retry.js +0 -25
  174. package/dist/src/sdk/utils/promise/with-retry.js.map +0 -1
  175. package/dist/src/sdk/utils/promise/with-timeout.js +0 -30
  176. package/dist/src/sdk/utils/promise/with-timeout.js.map +0 -1
  177. package/dist/src/sdk/utils/rpc/http.js +0 -86
  178. package/dist/src/sdk/utils/rpc/http.js.map +0 -1
  179. package/dist/src/sdk/utils/rpc/id.js +0 -13
  180. package/dist/src/sdk/utils/rpc/id.js.map +0 -1
  181. package/dist/src/sdk/utils/stringify.js +0 -5
  182. package/dist/src/sdk/utils/stringify.js.map +0 -1
  183. package/dist/src/sdk/utils/uid.js +0 -14
  184. package/dist/src/sdk/utils/uid.js.map +0 -1
  185. package/dist/src/sdk/utils/wait.js +0 -4
  186. package/dist/src/sdk/utils/wait.js.map +0 -1
  187. package/dist/src/sdk/utils/wit/codecs/decimal.js +0 -165
  188. package/dist/src/sdk/utils/wit/codecs/decimal.js.map +0 -1
  189. package/dist/src/sdk/utils/wit/codecs/enum.js +0 -104
  190. package/dist/src/sdk/utils/wit/codecs/enum.js.map +0 -1
  191. package/dist/src/sdk/utils/wit/codecs/integer.js +0 -167
  192. package/dist/src/sdk/utils/wit/codecs/integer.js.map +0 -1
  193. package/dist/src/sdk/utils/wit/codecs/list.js +0 -117
  194. package/dist/src/sdk/utils/wit/codecs/list.js.map +0 -1
  195. package/dist/src/sdk/utils/wit/codecs/option.js +0 -91
  196. package/dist/src/sdk/utils/wit/codecs/option.js.map +0 -1
  197. package/dist/src/sdk/utils/wit/codecs/string.js +0 -27
  198. package/dist/src/sdk/utils/wit/codecs/string.js.map +0 -1
  199. package/dist/src/sdk/utils/wit/codecs/types.js +0 -45
  200. package/dist/src/sdk/utils/wit/codecs/types.js.map +0 -1
  201. package/dist/src/sdk/utils/wit/codecs/unit.js +0 -22
  202. package/dist/src/sdk/utils/wit/codecs/unit.js.map +0 -1
  203. package/dist/src/sdk/utils/wit/decode-function-result.js +0 -36
  204. package/dist/src/sdk/utils/wit/decode-function-result.js.map +0 -1
  205. package/dist/src/sdk/utils/wit/decode-wit-parameter.js +0 -286
  206. package/dist/src/sdk/utils/wit/decode-wit-parameter.js.map +0 -1
  207. package/dist/src/sdk/utils/wit/decode-wit-parameter.test.js +0 -75
  208. package/dist/src/sdk/utils/wit/decode-wit-parameter.test.js.map +0 -1
  209. package/dist/src/sdk/utils/wit/encode-function-data.js +0 -17
  210. package/dist/src/sdk/utils/wit/encode-function-data.js.map +0 -1
  211. package/dist/src/sdk/utils/wit/encode-function-data.test-d.js +0 -21
  212. package/dist/src/sdk/utils/wit/encode-function-data.test-d.js.map +0 -1
  213. package/dist/src/sdk/utils/wit/encode-function-data.test.js +0 -91
  214. package/dist/src/sdk/utils/wit/encode-function-data.test.js.map +0 -1
  215. package/dist/src/sdk/utils/wit/encode-wit-parameters.js +0 -250
  216. package/dist/src/sdk/utils/wit/encode-wit-parameters.js.map +0 -1
  217. package/dist/src/sdk/utils/wit/encode-wit-parameters.test.js +0 -62
  218. package/dist/src/sdk/utils/wit/encode-wit-parameters.test.js.map +0 -1
  219. package/dist/src/sdk/utils/wit/get-wit-item.js +0 -15
  220. package/dist/src/sdk/utils/wit/get-wit-item.js.map +0 -1
  221. package/dist/src/sdk/utils/wit/get-wit-item.test.js +0 -118
  222. package/dist/src/sdk/utils/wit/get-wit-item.test.js.map +0 -1
  223. package/dist/src/sdk/utils/wit/prepare-encode-function-data.js +0 -24
  224. package/dist/src/sdk/utils/wit/prepare-encode-function-data.js.map +0 -1
  225. package/dist/src/wit/error.js +0 -59
  226. package/dist/src/wit/error.js.map +0 -1
  227. package/dist/src/wit/narrow.js +0 -14
  228. package/dist/src/wit/narrow.js.map +0 -1
  229. package/dist/src/wit/regex.js +0 -6
  230. package/dist/src/wit/regex.js.map +0 -1
  231. package/dist/src/wit/register.js +0 -2
  232. package/dist/src/wit/register.js.map +0 -1
  233. package/dist/src/wit/type-utils.js +0 -2
  234. package/dist/src/wit/type-utils.js.map +0 -1
  235. package/dist/src/wit/utils.js +0 -2
  236. package/dist/src/wit/utils.js.map +0 -1
  237. package/dist/src/wit/utils.test-d.js +0 -16
  238. package/dist/src/wit/utils.test-d.js.map +0 -1
  239. package/dist/src/wit/version.js +0 -2
  240. package/dist/src/wit/version.js.map +0 -1
  241. package/dist/src/wit/wit-parser/core/errors/signature.js +0 -42
  242. package/dist/src/wit/wit-parser/core/errors/signature.js.map +0 -1
  243. package/dist/src/wit/wit-parser/core/errors/splitParameters.js +0 -18
  244. package/dist/src/wit/wit-parser/core/errors/splitParameters.js.map +0 -1
  245. package/dist/src/wit/wit-parser/core/errors/wit-parameter.js +0 -29
  246. package/dist/src/wit/wit-parser/core/errors/wit-parameter.js.map +0 -1
  247. package/dist/src/wit/wit-parser/core/records.js +0 -73
  248. package/dist/src/wit/wit-parser/core/records.js.map +0 -1
  249. package/dist/src/wit/wit-parser/core/records.test.js +0 -53
  250. package/dist/src/wit/wit-parser/core/records.test.js.map +0 -1
  251. package/dist/src/wit/wit-parser/core/signatures.js +0 -32
  252. package/dist/src/wit/wit-parser/core/signatures.js.map +0 -1
  253. package/dist/src/wit/wit-parser/core/signatures.test.js +0 -54
  254. package/dist/src/wit/wit-parser/core/signatures.test.js.map +0 -1
  255. package/dist/src/wit/wit-parser/core/types/records.js +0 -2
  256. package/dist/src/wit/wit-parser/core/types/records.js.map +0 -1
  257. package/dist/src/wit/wit-parser/core/types/records.test-d.js +0 -19
  258. package/dist/src/wit/wit-parser/core/types/records.test-d.js.map +0 -1
  259. package/dist/src/wit/wit-parser/core/types/signatures.js +0 -3
  260. package/dist/src/wit/wit-parser/core/types/signatures.js.map +0 -1
  261. package/dist/src/wit/wit-parser/core/types/signatures.test-d.js +0 -18
  262. package/dist/src/wit/wit-parser/core/types/signatures.test-d.js.map +0 -1
  263. package/dist/src/wit/wit-parser/core/types/utils.js +0 -2
  264. package/dist/src/wit/wit-parser/core/types/utils.js.map +0 -1
  265. package/dist/src/wit/wit-parser/core/types/utils.test-d.js +0 -138
  266. package/dist/src/wit/wit-parser/core/types/utils.test-d.js.map +0 -1
  267. package/dist/src/wit/wit-parser/core/utils.js +0 -212
  268. package/dist/src/wit/wit-parser/core/utils.js.map +0 -1
  269. package/dist/src/wit/wit-parser/core/utils.test.js +0 -302
  270. package/dist/src/wit/wit-parser/core/utils.test.js.map +0 -1
  271. package/dist/src/wit/wit-parser/parse-wit-parameter.js +0 -26
  272. package/dist/src/wit/wit-parser/parse-wit-parameter.js.map +0 -1
  273. package/dist/src/wit/wit-parser/parse-wit-parameter.test.js +0 -77
  274. package/dist/src/wit/wit-parser/parse-wit-parameter.test.js.map +0 -1
  275. package/dist/src/wit/wit-parser/parse-wit.js +0 -16
  276. package/dist/src/wit/wit-parser/parse-wit.js.map +0 -1
  277. package/dist/src/wit/wit-parser/parse-wit.test.js +0 -78
  278. package/dist/src/wit/wit-parser/parse-wit.test.js.map +0 -1
  279. package/dist/src/wit/wit.js +0 -2
  280. package/dist/src/wit/wit.js.map +0 -1
  281. package/dist/src/wit/wit.test.js +0 -6
  282. package/dist/src/wit/wit.test.js.map +0 -1
  283. package/dist/test/globalSetup.js +0 -14
  284. package/dist/test/globalSetup.js.map +0 -1
  285. package/dist/test/src/wits.js +0 -21
  286. package/dist/test/src/wits.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sign-reveal.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/actions/kontor/wallet/sign-reveal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACxF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGxE,OAAO,EAA2B,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,MAAM,oBAAoB,CAC9B,KAAK,SAAS,KAAK,GAAG,SAAS,EAC/B,OAAO,SAAS,OAAO,GAAG,SAAS,IACjC,mBAAmB,CAAC,OAAO,CAAC,GAE9B,iBAAiB,CAAC,KAAK,CAAC,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,kBAAkB,EAAE,CAAC;CACxC,CAAC;AAEJ,MAAM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AE,kBAAkB,CAAC,YAAY,EAAE,KAAK,EAAE,OAAO,CAAC,EACxD,UAAU,EAAE,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,GAC/C,OAAO,CAAC,oBAAoB,CAAC,CAwH/B"}
@@ -1,2 +1,15 @@
1
- export {};
1
+ import type { Chain } from "../../types/chain.js";
2
+ import type { RpcTransport } from "../../clients/transports/create-rpc-transport.js";
3
+ import type { PublicClient } from "../../clients/create-public-client.js";
4
+ import type { Account } from "../../accounts/types.js";
5
+ export type TestMempoolAcceptOptions = {
6
+ /** Max feerate in BTC/kvB. If omitted, Core uses default relay feerate. */
7
+ maxfeerate?: string | number;
8
+ };
9
+ export interface TestMempoolAcceptParams {
10
+ rawtx: string | string[];
11
+ options: TestMempoolAcceptOptions;
12
+ }
13
+ export type TestMempoolAcceptReturnType = any;
14
+ export declare function testMempoolAccept<chain extends Chain | undefined, account extends Account | undefined = Account | undefined>(client: PublicClient<RpcTransport, chain, account>, { rawtx, options }: TestMempoolAcceptParams): Promise<TestMempoolAcceptReturnType>;
2
15
  //# sourceMappingURL=test-mempool-accept.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"test-mempool-accept.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/actions/public/test-mempool-accept.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"test-mempool-accept.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/actions/public/test-mempool-accept.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,MAAM,wBAAwB,GAAG;IACrC,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,wBAAwB,CAAC;CACnC;AAED,MAAM,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE9C,wBAAsB,iBAAiB,CACrC,KAAK,SAAS,KAAK,GAAG,SAAS,EAC/B,OAAO,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,EAEzD,MAAM,EAAE,YAAY,CAAC,YAAY,EAAE,KAAK,EAAE,OAAO,CAAC,EAClD,EAAE,KAAK,EAAE,OAAY,EAAE,EAAE,uBAAuB,GAC/C,OAAO,CAAC,2BAA2B,CAAC,CAStC"}
@@ -3,9 +3,11 @@ import type { Chain } from "../../types/chain.js";
3
3
  import type { Address, XOnlyPubKey } from "../../types/misc.js";
4
4
  import type { RpcTransport } from "../transports/create-rpc-transport.js";
5
5
  import { type SendRawTransactionParams, type SendRawTransactionReturnType } from "../../actions/public/send-raw-transaction.js";
6
+ import { type TestMempoolAcceptParams, type TestMempoolAcceptReturnType } from "../../actions/public/test-mempool-accept.js";
6
7
  import type { PublicClient as PublicClient } from "../create-public-client.js";
7
8
  export type PublicActions<_chain extends Chain | undefined = Chain | undefined, _account extends Account | [Address, XOnlyPubKey] | undefined = Account | [Address, XOnlyPubKey] | undefined> = {
8
9
  sendRawTransaction: (parameters: SendRawTransactionParams) => Promise<SendRawTransactionReturnType>;
10
+ testMempoolAccept: (parameters: TestMempoolAcceptParams) => Promise<TestMempoolAcceptReturnType>;
9
11
  };
10
12
  export declare function publicActions<transport extends RpcTransport = RpcTransport, chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined>(client: PublicClient<transport, chain, account>): PublicActions<chain, account>;
11
13
  //# sourceMappingURL=public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/public.ts"],"names":[],"mappings":"AAAA,OAA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AA2B,CAAC;AAEnC,KAAK,eAAe,GAAG;IAAE,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAAG;IAClC,gCAAgC;IAChC,GAAG,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IAC5C,iEAAiE;IACjE,OAAO,CAAC,EAAE,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IACpD,iCAAiC;IACjC,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAC9C,wCAAwC;IACxC,UAAU,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;IAC1D,8CAA8C;IAC9C,UAAU,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;CAC3D,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,YAAY,CACxC,QAAQ,EACR,EAAE,EACF,aAAa,CAEd,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,2BAA2B,GAAG,SAAS,CAAC;AAE/E,wBAAgB,MAAM,CAAC,QAAQ,SAAS,eAAe,EACrD,QAAQ,EAAE,QAAQ,EAClB,MAAM,GAAE,qBAA0B,GACjC,eAAe,CAiBjB"}
@@ -7,8 +7,16 @@ export type SendRawTransactionParams = [
7
7
  export interface SendRawTransactionReturnType {
8
8
  txid: string;
9
9
  }
10
+ export type TestMempoolAcceptParams = [
11
+ txs: string[],
12
+ opts?: {
13
+ maxFeeRate: number | string;
14
+ }
15
+ ];
16
+ export type TestMempoolAcceptReturnType = any;
10
17
  export type BtcRpcSchema = readonly [
11
- RpcSchemaEntry<"sendrawtransaction", SendRawTransactionParams, SendRawTransactionReturnType>
18
+ RpcSchemaEntry<"sendrawtransaction", SendRawTransactionParams, SendRawTransactionReturnType>,
19
+ RpcSchemaEntry<"testmempoolaccept", TestMempoolAcceptParams, TestMempoolAcceptReturnType>
12
20
  ];
13
21
  export type BtcNodeRequestFn<Schema extends RpcSchema | undefined = BtcRpcSchema> = RpcRequestFn<Schema>;
14
22
  export type BtcNodeProvider = Prettify<{
@@ -1 +1 @@
1
- {"version":3,"file":"btc-rpc.d.ts","sourceRoot":"","sources":["../../../../src/sdk/types/btc-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAOxD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE/E,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,EAAE,MAAM;IACX,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM;CAC7B,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,YAAY,GAAG,SAAS;IAClC,cAAc,CACZ,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,CAC7B;CAOF,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAC1B,MAAM,SAAS,SAAS,GAAG,SAAS,GAAG,YAAY,IACjD,YAAY,CAAC,MAAM,CAAC,CAAC;AAEzB,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,OAAO,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;CACzC,CAAC,CAAC"}
1
+ {"version":3,"file":"btc-rpc.d.ts","sourceRoot":"","sources":["../../../../src/sdk/types/btc-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE/E,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,EAAE,MAAM;IACX,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM;CAC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AY,CAAC,SAAS,CAAC,CA0C5E;AAGD,gBAAgB;AAChB,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,WA2BvC"}
1
+ {"version":3,"file":"build-rpc-request.d.ts","sourceRoot":"","sources":["../../../../src/sdk/utils/build-rpc-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG,oBAAoB,CAAC;AAE5E,wBAAgB,eAAe,CAC7B,OAAO,SAAS,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,EAC3C,SAAS,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,EACnD,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,iBAAsB,GAAG,YAAY,CAAC,SAAS,CAAC,CA6C5E;AAGD,gBAAgB;AAChB,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,WA2BvC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontor/kontor-sdk",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.11",
4
4
  "author": "Unspendable Labs <dev@unspendablelabs.com>",
5
5
  "description": "The official SDK to the Kontor Bitcoin metaprotocol",
6
6
  "repository": {
@@ -65,5 +65,9 @@
65
65
  "micro-packed": "^0.8.0",
66
66
  "sats-connect": "^4.2.1",
67
67
  "zod": "^4.1.12"
68
- }
68
+ },
69
+ "workspaces": [
70
+ ".",
71
+ "demo"
72
+ ]
69
73
  }
@@ -1,44 +1,35 @@
1
- import type { ResolvedRegister } from "../../../../wit/register.js";
1
+ // import type { ResolvedRegister } from "../../../../wit/register.js";
2
2
  import type { KontorPublicClient } from "../../../clients/kontor/create-public-client.js";
3
3
  import type { HttpTransport } from "../../../clients/transports/create-http-transport.js";
4
4
  import type { Chain } from "../../../types/chain.js";
5
5
  import type { Address, UtxoId, XOnlyPubKey } from "../../../types/misc.js";
6
- import {
7
- buildInstruction,
8
- type BuildInstructionReturnType,
9
- } from "./build-instruction.js";
6
+ import { buildInstructionQuery } from "./build-instruction-query.js";
10
7
  import { getKontorAction } from "../../../utils/get-action.js";
8
+ import type { ComposeQuery } from "@kontor/kontor-ts";
9
+ import type { Inst } from "src/sdk/types/kontor.js";
11
10
 
12
- export type BuildComposeCallParameters<
11
+ export type BuildComposeQueryParameters<
13
12
  _chain extends Chain | undefined = Chain | undefined,
14
13
  > = {
14
+ instruction: Inst;
15
15
  address?: Address;
16
16
  xOnlyPubKey?: XOnlyPubKey; // TODO: maybe this should be wrapped in a single object
17
17
  utxos: UtxoId[];
18
- contractAddress: ResolvedRegister["contractAddress"];
19
- wave: string;
20
- gas: bigint;
21
18
  satsPerVByte: number;
22
19
  };
23
20
 
24
- export type BuildComposeCallReturnType = {
25
- instructions: BuildInstructionReturnType[];
26
- // TODO: this should be changed upstream or encoded in a formatter
27
- sat_per_vbyte: number;
28
- };
21
+ export type BuildComposeQueryReturnType = ComposeQuery;
29
22
 
30
- export async function buildComposeCall<
23
+ export async function buildComposeQuery<
31
24
  chain extends Chain | undefined = Chain | undefined,
32
25
  >(
33
26
  client: KontorPublicClient<HttpTransport, chain>,
34
- params: BuildComposeCallParameters<chain>,
35
- ): Promise<BuildComposeCallReturnType> {
27
+ params: BuildComposeQueryParameters<chain>,
28
+ ): Promise<BuildComposeQueryReturnType> {
36
29
  const account = client.account;
37
30
 
38
31
  const {
39
- contractAddress,
40
- wave,
41
- gas,
32
+ instruction: inst,
42
33
  utxos,
43
34
  address = account?.address,
44
35
  xOnlyPubKey = account?.xOnlyPubKey,
@@ -61,12 +52,10 @@ export async function buildComposeCall<
61
52
 
62
53
  const instruction = await getKontorAction(
63
54
  client,
64
- buildInstruction,
65
- "buildInstruction",
55
+ buildInstructionQuery,
56
+ "buildInstructionQuery",
66
57
  )({
67
- contractAddress,
68
- wave,
69
- gas,
58
+ instruction: inst,
70
59
  utxos,
71
60
  xOnlyPubKey,
72
61
  address,
@@ -75,5 +64,6 @@ export async function buildComposeCall<
75
64
  return {
76
65
  instructions: [instruction],
77
66
  sat_per_vbyte: params.satsPerVByte,
67
+ envelope: null,
78
68
  };
79
69
  }
@@ -1,24 +1,35 @@
1
- import type { InstructionQuery } from "../../../types/kontor.js";
2
- import type { ResolvedRegister } from "../../../../wit/register.js";
1
+ import type { Inst, InstructionQuery } from "../../../types/kontor.js";
3
2
  import type { KontorPublicClient } from "../../../clients/kontor/create-public-client.js";
4
3
  import type { HttpTransport } from "../../../clients/transports/create-http-transport.js";
5
4
  import type { Chain } from "../../../types/chain.js";
6
5
  import type { Address, UtxoId, XOnlyPubKey } from "../../../types/misc.js";
7
6
 
8
- export type BuildInstructionParameters<
7
+ // If InstructionQuery already uses this Inst shape internally, you don't need to touch it.
8
+ // Otherwise you can make InstructionQuery generic over Inst and plug this in.
9
+ export type BuildInstructionQueryReturnType = InstructionQuery;
10
+
11
+ export type BuildInstructionQueryParameters<
9
12
  _chain extends Chain | undefined = Chain | undefined,
10
13
  > = {
11
14
  address?: Address;
12
15
  xOnlyPubKey?: XOnlyPubKey; // TODO: maybe this should be wrapped in a single object
13
16
  utxos: UtxoId[];
14
- contractAddress: ResolvedRegister["contractAddress"];
15
- wave: string;
16
- gas: bigint;
17
+ /**
18
+ * The concrete instruction to send (Publish | Call | Issuance).
19
+ * Example:
20
+ * { Call: { gas_limit: 100000, contract: "addr", expr: "balance(...)" } }
21
+ * { Publish: { gas_limit: 100000, name: "token", bytes: [0,1,2,...] } }
22
+ * "Issuance"
23
+ */
24
+ instruction: Inst;
25
+ /**
26
+ * Optional chained instruction if you want to send two instructions atomically.
27
+ */
28
+ chainedInstruction?: Inst | null;
17
29
  };
18
30
 
19
- export type BuildInstructionReturnType = InstructionQuery;
31
+ // ------------------ helpers ------------------
20
32
 
21
- // TODO: these normalize methods probably belong somewhere else
22
33
  function normalizeXOnly(pub: string): string {
23
34
  if (!/^[0-9a-fA-F]{64}$/.test(pub)) {
24
35
  throw new Error(
@@ -40,19 +51,20 @@ function normalizeUtxoIds(u: UtxoId | UtxoId[]): string[] {
40
51
  return Array.isArray(u) ? u.map(normalizeUtxoId) : [normalizeUtxoId(u)];
41
52
  }
42
53
 
43
- export async function buildInstruction<
54
+ // ------------------ main builder ------------------
55
+
56
+ export async function buildInstructionQuery<
44
57
  chain extends Chain | undefined = Chain | undefined,
45
58
  >(
46
59
  client: KontorPublicClient<HttpTransport, chain>,
47
- params: BuildInstructionParameters<chain>,
48
- ): Promise<BuildInstructionReturnType> {
60
+ params: BuildInstructionQueryParameters<chain>,
61
+ ): Promise<BuildInstructionQueryReturnType> {
49
62
  const account = client.account;
50
63
 
51
64
  const {
52
- contractAddress,
53
- wave,
54
- gas,
55
65
  utxos,
66
+ instruction,
67
+ chainedInstruction = null,
56
68
  address = account?.address,
57
69
  xOnlyPubKey = account?.xOnlyPubKey,
58
70
  } = params;
@@ -62,6 +74,11 @@ export async function buildInstruction<
62
74
  throw new Error("x_only_public_key is required");
63
75
  }
64
76
 
77
+ if (!address) {
78
+ // TODO: add custom error
79
+ throw new Error("address is required");
80
+ }
81
+
65
82
  if (utxos.length === 0) {
66
83
  // TODO: add custom error
67
84
  throw new Error("at least one funding UTXO is required");
@@ -70,22 +87,11 @@ export async function buildInstruction<
70
87
  const xOnly = normalizeXOnly(xOnlyPubKey);
71
88
  const fundingIds = normalizeUtxoIds(utxos);
72
89
 
73
- // const sciptData = buildCallScriptDataBytes(contractAddress, wave, gas);
74
-
75
90
  return {
76
- address: address!,
91
+ address,
77
92
  x_only_public_key: xOnly,
78
- funding_utxo_ids:
79
- fundingIds.length === 1
80
- ? (fundingIds[0] as string)
81
- : fundingIds.join(","),
82
- instruction: {
83
- Call: {
84
- gas_limit: Number(gas), // TODO: refine type
85
- contract: contractAddress,
86
- expr: wave,
87
- },
88
- },
89
- chained_instruction: null,
93
+ funding_utxo_ids: fundingIds.join(","),
94
+ instruction,
95
+ chained_instruction: chainedInstruction ?? null,
90
96
  };
91
97
  }
@@ -1,4 +1,3 @@
1
- import type { ResolvedRegister } from "../../../../wit/register.js";
2
1
  import type { KontorPublicClient } from "../../../clients/kontor/create-public-client.js";
3
2
  import type { HttpTransport } from "../../../clients/transports/create-http-transport.js";
4
3
  import type { Chain } from "../../../types/chain.js";
@@ -9,20 +8,22 @@ import type {
9
8
  XOnlyPubKey,
10
9
  } from "../../../types/misc.js";
11
10
 
12
- import { buildComposeCall } from "./build-compose-call.js";
11
+ import { buildComposeQuery } from "./build-compose-query.js";
13
12
  import { getKontorAction } from "../../../utils/get-action.js";
14
- import type { ComposeOutputs, ResultResponse } from "../../../types/kontor.js";
13
+ import {
14
+ type ComposeOutputs,
15
+ type Inst,
16
+ type ResultResponse,
17
+ } from "../../../types/kontor.js";
15
18
 
16
- export type CallProcParameters<
19
+ export type CallComposeParameters<
17
20
  _chain extends Chain | undefined = Chain | undefined,
18
21
  > = {
19
22
  address?: Address;
20
23
  xOnlyPubKey?: XOnlyPubKey; // TODO: maybe this should be wrapped in a single object
21
24
  utxos: UtxoId[];
22
- contractAddress: ResolvedRegister["contractAddress"];
23
- wave: string;
24
- gas: bigint;
25
25
  satsPerVByte: number;
26
+ instruction: Inst;
26
27
  };
27
28
 
28
29
  // TODO: organize these types or just refernece direc
@@ -32,24 +33,22 @@ export interface TapLeafScript {
32
33
  controlBlock: number[];
33
34
  }
34
35
 
35
- export type CallProcReturnType = ResultResponse<ComposeOutputs>;
36
+ export type CallComposeReturnType = ResultResponse<ComposeOutputs>;
36
37
 
37
- export async function callProc<
38
+ export async function callCompose<
38
39
  chain extends Chain | undefined = Chain | undefined,
39
40
  >(
40
41
  client: KontorPublicClient<HttpTransport, chain>,
41
- params: CallProcParameters<chain>,
42
- ): Promise<CallProcReturnType> {
42
+ params: CallComposeParameters<chain>,
43
+ ): Promise<CallComposeReturnType> {
43
44
  const account = client.account;
44
45
 
45
46
  const {
46
- contractAddress,
47
- wave,
48
- gas,
49
47
  utxos,
50
48
  address = account?.address,
51
49
  xOnlyPubKey = account?.xOnlyPubKey,
52
50
  satsPerVByte,
51
+ instruction,
53
52
  } = params;
54
53
 
55
54
  if (!xOnlyPubKey) {
@@ -70,12 +69,10 @@ export async function callProc<
70
69
 
71
70
  const composeCall = await getKontorAction(
72
71
  client,
73
- buildComposeCall,
74
- "buildComposeCall",
72
+ buildComposeQuery,
73
+ "buildComposeQuery",
75
74
  )({
76
- contractAddress,
77
- wave,
78
- gas,
75
+ instruction,
79
76
  utxos,
80
77
  xOnlyPubKey,
81
78
  address,
@@ -1,3 +1,4 @@
1
+ import { Instruction } from "../../../../sdk/types/kontor.js";
1
2
  import type { Wit } from "../../../../wit/wit.js";
2
3
  import type { KontorPublicClient } from "../../../clients/kontor/create-public-client.js";
3
4
  import type { HttpTransport } from "../../../clients/transports/create-http-transport.js";
@@ -13,7 +14,7 @@ import {
13
14
  encodeFunctionData,
14
15
  type EncodeFunctionDataParameters,
15
16
  } from "../../../utils/wit/encode-function-data.js";
16
- import { callProc, type CallProcReturnType } from "./call-proc.js";
17
+ import { callCompose, type CallComposeReturnType } from "./call-compose.js";
17
18
 
18
19
  export type ProcContractParameters<
19
20
  wit extends Wit | readonly unknown[] = Wit,
@@ -34,7 +35,7 @@ export type ProcContractParameters<
34
35
  satsPerVByte: number;
35
36
  };
36
37
 
37
- export type ProcContractReturnType = CallProcReturnType;
38
+ export type ProcContractReturnType = CallComposeReturnType;
38
39
 
39
40
  export async function procContract<
40
41
  // chain exhttps://viem.sh/tends Chain | undefined,
@@ -85,16 +86,18 @@ export async function procContract<
85
86
  try {
86
87
  const response = await getKontorAction(
87
88
  client,
88
- callProc,
89
+ callCompose,
89
90
  "callProc",
90
91
  )({
91
- contractAddress: contractAddress,
92
- wave: wave,
93
92
  utxos,
94
93
  satsPerVByte,
95
94
  address,
96
95
  xOnlyPubKey,
97
- gas,
96
+ instruction: Instruction.call({
97
+ contract: contractAddress,
98
+ gasLimit: gas,
99
+ expr: wave,
100
+ }),
98
101
  });
99
102
 
100
103
  return response;
@@ -7,7 +7,11 @@ import type { GetAccountParameter } from "../../../types/account.js";
7
7
  import type { Chain, GetChainParameter } from "../../../types/chain.js";
8
8
  import { getAction } from "../../../utils/get-action.js";
9
9
  import { signPsbt } from "../../wallet/sign-psbt.js";
10
- import { p2tr, taprootListToTree, Transaction } from "@scure/btc-signer";
10
+ import {
11
+ TaprootControlBlock,
12
+ Transaction,
13
+ utils as u,
14
+ } from "@scure/btc-signer";
11
15
  import { hex } from "@scure/base";
12
16
  import type { ParticipantScripts } from "@kontor/kontor-ts";
13
17
 
@@ -51,30 +55,22 @@ export async function signReveal<
51
55
  for (let i = 0; i < params.parcipantScripts.length; i++) {
52
56
  const { commit_tap_leaf_script } = params.parcipantScripts[i]!;
53
57
 
54
- const tree = taprootListToTree([
55
- {
56
- // TODO: fix this type error
57
- // @ts-ignore
58
- script: hex.decode(commit_tap_leaf_script.script),
59
- leafVersion: commit_tap_leaf_script.leafVersion,
60
- },
61
- ]);
62
-
63
- const payment = p2tr(
64
- // @ts-ignore
65
- undefined,
66
- tree,
67
- // TODO: must assert chain or default to mainnet
68
- chain!.networkConfig,
69
- true,
58
+ const scriptBytes = hex.decode(commit_tap_leaf_script.script);
59
+ const controlBlockBytes = hex.decode(commit_tap_leaf_script.controlBlock);
60
+ const leafVersion = commit_tap_leaf_script.leafVersion;
61
+
62
+ // scure expects script || leafVersion as one buffer
63
+ const scriptWithVersion = u.concatBytes(
64
+ scriptBytes,
65
+ new Uint8Array([leafVersion]),
70
66
  );
71
67
 
68
+ const controlBlockStruct = TaprootControlBlock.decode(controlBlockBytes);
69
+
72
70
  tx.updateInput(
73
71
  i,
74
72
  {
75
- tapLeafScript: payment.tapLeafScript!,
76
- tapInternalKey: payment.tapInternalKey,
77
- tapMerkleRoot: payment.tapMerkleRoot,
73
+ tapLeafScript: [[controlBlockStruct, scriptWithVersion]],
78
74
  },
79
75
  true,
80
76
  );
@@ -111,24 +107,49 @@ export async function signReveal<
111
107
  allowUnknownInputs: true,
112
108
  });
113
109
 
114
- // this is technically unnecessary as scure/btc-signer
115
- // will product this witness by default
110
+ // for (let i = 0; i < signedTx.inputsLength; i++) {
111
+ // const input = signedTx.getInput(i);
112
+ // if (input.tapLeafScript && input.tapLeafScript.length > 0) {
113
+ // const [cbStruct, scriptWithVersion] = input.tapLeafScript[0]!;
114
+ // console.log("SIGNED TAPLEAF", i, {
115
+ // cbStruct,
116
+ // cbEncoded: hex.encode(TaprootControlBlock.encode(cbStruct)),
117
+ // scriptWithVersion: hex.encode(scriptWithVersion),
118
+ // });
119
+ // }
120
+ // }
121
+ //
122
+ //
123
+
124
+ // finalize
116
125
  for (let i = 0; i < params.parcipantScripts.length; i++) {
117
126
  const input = signedTx.getInput(i);
118
127
  const p = params.parcipantScripts[i]!;
119
- console.log({ input, tapscriptsig: input.tapScriptSig });
128
+
129
+ const scriptHex = p.commit_tap_leaf_script.script;
130
+ const cbHex = p.commit_tap_leaf_script.controlBlock;
131
+
132
+ // console.log("USING SCRIPT/CB", {
133
+ // scriptHex,
134
+ // cbHex,
135
+ // cbDecodedRoundtrip: hex.encode(hex.decode(cbHex)),
136
+ // });
137
+
120
138
  signedTx.updateInput(i, {
121
139
  finalScriptWitness: [
122
140
  input.tapScriptSig![0]![1],
123
- // @ts-ignore
124
- hex.decode(p.commit_tap_leaf_script.script),
125
- // @ts-ignore
126
- hex.decode(p.commit_tap_leaf_script.controlBlock),
141
+ hex.decode(scriptHex),
142
+ hex.decode(cbHex),
127
143
  ],
128
144
  });
129
145
  }
130
146
 
131
- signedTx.finalize();
147
+ // for (let i = 0; i < signedTx.inputsLength; i++) {
148
+ // const input = signedTx.getInput(i);
149
+ // console.log("FINAL INPUT", i, {
150
+ // finalScriptWitness: input.finalScriptWitness?.map((w) => hex.encode(w)),
151
+ // });
152
+ // }
132
153
 
133
154
  return signedTx;
134
155
  }
@@ -1,34 +1,37 @@
1
- // import type { Chain } from "../../types/chain.js";
2
- //
3
- // import type { RpcTransport } from "../../clients/transports/create-rpc-transport.js";
4
- // import type { PublicClient } from "../../clients/create-public-client.js";
5
- // import type { Account } from "../../accounts/types.js";
6
- //
7
- // export type TestMempoolAcceptOptions = {
8
- // /** Max feerate in BTC/kvB. If omitted, Core uses default relay feerate. */
9
- // maxfeerate?: string | number;
10
- // };
11
- //
12
- // export interface TestMempoolAcceptParams {
13
- // rawtx: string | string[];
14
- // options: TestMempoolAcceptOptions;
15
- // }
16
- // export type TestMempoolAcceptReturnType = any;
17
- //
18
- // export async function testMempoolAccept<
19
- // chain extends Chain | undefined,
20
- // account extends Account | undefined = Account | undefined,
21
- // >(
22
- // client: PublicClient<RpcTransport, chain, account>,
23
- // { rawtx, options = {} }: TestMempoolAcceptParams,
24
- // ): Promise<TestMempoolAcceptReturnType> {
25
- // const txs = Array.isArray(rawtx) ? rawtx : [rawtx];
26
- //
27
- // return client.request({
28
- // method: "testmempoolaccept",
29
- // params: [txs],
30
- // });
31
- // }
1
+ import type { Chain } from "../../types/chain.js";
2
+
3
+ import type { RpcTransport } from "../../clients/transports/create-rpc-transport.js";
4
+ import type { PublicClient } from "../../clients/create-public-client.js";
5
+ import type { Account } from "../../accounts/types.js";
6
+
7
+ export type TestMempoolAcceptOptions = {
8
+ /** Max feerate in BTC/kvB. If omitted, Core uses default relay feerate. */
9
+ maxfeerate?: string | number;
10
+ };
11
+
12
+ export interface TestMempoolAcceptParams {
13
+ rawtx: string | string[];
14
+ options: TestMempoolAcceptOptions;
15
+ }
16
+
17
+ export type TestMempoolAcceptReturnType = any;
18
+
19
+ export async function testMempoolAccept<
20
+ chain extends Chain | undefined,
21
+ account extends Account | undefined = Account | undefined,
22
+ >(
23
+ client: PublicClient<RpcTransport, chain, account>,
24
+ { rawtx, options = {} }: TestMempoolAcceptParams,
25
+ ): Promise<TestMempoolAcceptReturnType> {
26
+ const txs = Array.isArray(rawtx) ? rawtx : [rawtx];
27
+
28
+ const params = options.maxfeerate !== undefined ? [txs, options] : [txs];
29
+
30
+ return client.request({
31
+ method: "testmempoolaccept",
32
+ params: params as any,
33
+ });
34
+ }
32
35
 
33
36
  // export async function testMempoolAccept(
34
37
  // rawtx: string | string[],