@opcat-labs/scrypt-ts-opcat 1.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 (537) hide show
  1. package/assets/.templates/smart-contract/builtin-libs/TxHashPreimageUtils.scrypt.map +1 -0
  2. package/assets/.templates/smart-contract/builtin-libs/TxHashPreimageUtils.scrypt.tpl +18 -0
  3. package/assets/.templates/smart-contract/builtin-libs/TxHashPreimageUtils.transformer.json +7 -0
  4. package/assets/.templates/smart-contract/builtin-libs/backtrace.scrypt.map +1 -0
  5. package/assets/.templates/smart-contract/builtin-libs/backtrace.scrypt.tpl +36 -0
  6. package/assets/.templates/smart-contract/builtin-libs/backtrace.transformer.json +7 -0
  7. package/assets/.templates/smart-contract/builtin-libs/byteStringReader.scrypt.map +1 -0
  8. package/assets/.templates/smart-contract/builtin-libs/byteStringReader.scrypt.tpl +64 -0
  9. package/assets/.templates/smart-contract/builtin-libs/byteStringReader.transformer.json +7 -0
  10. package/assets/.templates/smart-contract/builtin-libs/byteStringWriter.scrypt.map +1 -0
  11. package/assets/.templates/smart-contract/builtin-libs/byteStringWriter.scrypt.tpl +48 -0
  12. package/assets/.templates/smart-contract/builtin-libs/byteStringWriter.transformer.json +7 -0
  13. package/assets/.templates/smart-contract/builtin-libs/contextUtils.scrypt.map +1 -0
  14. package/assets/.templates/smart-contract/builtin-libs/contextUtils.scrypt.tpl +101 -0
  15. package/assets/.templates/smart-contract/builtin-libs/contextUtils.transformer.json +7 -0
  16. package/assets/.templates/smart-contract/builtin-libs/p2pk.scrypt.map +1 -0
  17. package/assets/.templates/smart-contract/builtin-libs/p2pk.scrypt.tpl +7 -0
  18. package/assets/.templates/smart-contract/builtin-libs/p2pk.transformer.json +7 -0
  19. package/assets/.templates/smart-contract/builtin-libs/p2pkh.scrypt.map +1 -0
  20. package/assets/.templates/smart-contract/builtin-libs/p2pkh.scrypt.tpl +8 -0
  21. package/assets/.templates/smart-contract/builtin-libs/p2pkh.transformer.json +7 -0
  22. package/assets/.templates/smart-contract/builtin-libs/stateLib.scrypt.map +1 -0
  23. package/assets/.templates/smart-contract/builtin-libs/stateLib.scrypt.tpl +3 -0
  24. package/assets/.templates/smart-contract/builtin-libs/stateLib.transformer.json +7 -0
  25. package/assets/.templates/smart-contract/builtin-libs/stateUtils.scrypt.map +1 -0
  26. package/assets/.templates/smart-contract/builtin-libs/stateUtils.scrypt.tpl +7 -0
  27. package/assets/.templates/smart-contract/builtin-libs/stateUtils.transformer.json +7 -0
  28. package/assets/.templates/smart-contract/builtin-libs/stdUtils.scrypt.map +1 -0
  29. package/assets/.templates/smart-contract/builtin-libs/stdUtils.scrypt.tpl +89 -0
  30. package/assets/.templates/smart-contract/builtin-libs/stdUtils.transformer.json +7 -0
  31. package/assets/.templates/smart-contract/builtin-libs/txUtils.scrypt.map +1 -0
  32. package/assets/.templates/smart-contract/builtin-libs/txUtils.scrypt.tpl +42 -0
  33. package/assets/.templates/smart-contract/builtin-libs/txUtils.transformer.json +7 -0
  34. package/assets/.templates/smart-contract/types/structs.scrypt.map +1 -0
  35. package/assets/.templates/smart-contract/types/structs.scrypt.tpl +48 -0
  36. package/assets/.templates/smart-contract/types/structs.transformer.json +7 -0
  37. package/assets/smart-contract/builtin-libs/TxHashPreimageUtils.scrypt +20 -0
  38. package/assets/smart-contract/builtin-libs/backtrace.scrypt +38 -0
  39. package/assets/smart-contract/builtin-libs/byteStringReader.scrypt +66 -0
  40. package/assets/smart-contract/builtin-libs/byteStringWriter.scrypt +50 -0
  41. package/assets/smart-contract/builtin-libs/contextUtils.scrypt +103 -0
  42. package/assets/smart-contract/builtin-libs/p2pk.scrypt +9 -0
  43. package/assets/smart-contract/builtin-libs/p2pkh.scrypt +10 -0
  44. package/assets/smart-contract/builtin-libs/stateLib.scrypt +5 -0
  45. package/assets/smart-contract/builtin-libs/stateUtils.scrypt +9 -0
  46. package/assets/smart-contract/builtin-libs/stdUtils.scrypt +91 -0
  47. package/assets/smart-contract/builtin-libs/txUtils.scrypt +44 -0
  48. package/assets/smart-contract/types/structs.scrypt +50 -0
  49. package/dist/cjs/features/call.cjs +38 -0
  50. package/dist/cjs/features/call.js.map +1 -0
  51. package/dist/cjs/features/deploy.cjs +33 -0
  52. package/dist/cjs/features/deploy.js.map +1 -0
  53. package/dist/cjs/features/index.cjs +8 -0
  54. package/dist/cjs/features/index.js.map +1 -0
  55. package/dist/cjs/globalTypes.cjs +3 -0
  56. package/dist/cjs/globalTypes.js.map +1 -0
  57. package/dist/cjs/index.cjs +55 -0
  58. package/dist/cjs/index.js.map +1 -0
  59. package/dist/cjs/networks.cjs +69 -0
  60. package/dist/cjs/networks.js.map +1 -0
  61. package/dist/cjs/providers/chainProvider.cjs +3 -0
  62. package/dist/cjs/providers/chainProvider.js.map +1 -0
  63. package/dist/cjs/providers/dummyProvider.cjs +87 -0
  64. package/dist/cjs/providers/dummyProvider.js.map +1 -0
  65. package/dist/cjs/providers/index.cjs +13 -0
  66. package/dist/cjs/providers/index.js.map +1 -0
  67. package/dist/cjs/providers/mempoolProvider.cjs +207 -0
  68. package/dist/cjs/providers/mempoolProvider.js.map +1 -0
  69. package/dist/cjs/providers/rpcProvider.cjs +296 -0
  70. package/dist/cjs/providers/rpcProvider.js.map +1 -0
  71. package/dist/cjs/providers/utxoProvider.cjs +18 -0
  72. package/dist/cjs/providers/utxoProvider.js.map +1 -0
  73. package/dist/cjs/psbt/bip66.cjs +182 -0
  74. package/dist/cjs/psbt/bip66.js.map +1 -0
  75. package/dist/cjs/psbt/bufferutils.cjs +186 -0
  76. package/dist/cjs/psbt/bufferutils.js.map +1 -0
  77. package/dist/cjs/psbt/contextProvider.cjs +111 -0
  78. package/dist/cjs/psbt/contextProvider.js.map +1 -0
  79. package/dist/cjs/psbt/extPsbt.cjs +589 -0
  80. package/dist/cjs/psbt/extPsbt.js.map +1 -0
  81. package/dist/cjs/psbt/psbt.cjs +973 -0
  82. package/dist/cjs/psbt/psbt.js.map +1 -0
  83. package/dist/cjs/psbt/psbtutils.cjs +140 -0
  84. package/dist/cjs/psbt/psbtutils.js.map +1 -0
  85. package/dist/cjs/psbt/signatureutils.cjs +230 -0
  86. package/dist/cjs/psbt/signatureutils.js.map +1 -0
  87. package/dist/cjs/psbt/types.cjs +3 -0
  88. package/dist/cjs/psbt/types.js.map +1 -0
  89. package/dist/cjs/signer.cjs +3 -0
  90. package/dist/cjs/signer.js.map +1 -0
  91. package/dist/cjs/signers/defaultSigner.cjs +68 -0
  92. package/dist/cjs/signers/defaultSigner.js.map +1 -0
  93. package/dist/cjs/signers/index.cjs +8 -0
  94. package/dist/cjs/signers/index.js.map +1 -0
  95. package/dist/cjs/signers/unisatSigner.cjs +38 -0
  96. package/dist/cjs/signers/unisatSigner.js.map +1 -0
  97. package/dist/cjs/smart-contract/abi.cjs +380 -0
  98. package/dist/cjs/smart-contract/abi.js.map +1 -0
  99. package/dist/cjs/smart-contract/abiutils.cjs +183 -0
  100. package/dist/cjs/smart-contract/abiutils.js.map +1 -0
  101. package/dist/cjs/smart-contract/abstractContract.cjs +25 -0
  102. package/dist/cjs/smart-contract/abstractContract.js.map +1 -0
  103. package/dist/cjs/smart-contract/builtin-libs/backtrace.cjs +102 -0
  104. package/dist/cjs/smart-contract/builtin-libs/backtrace.js.map +1 -0
  105. package/dist/cjs/smart-contract/builtin-libs/byteStringReader.cjs +138 -0
  106. package/dist/cjs/smart-contract/builtin-libs/byteStringReader.js.map +1 -0
  107. package/dist/cjs/smart-contract/builtin-libs/byteStringWriter.cjs +109 -0
  108. package/dist/cjs/smart-contract/builtin-libs/byteStringWriter.js.map +1 -0
  109. package/dist/cjs/smart-contract/builtin-libs/contextUtils.cjs +304 -0
  110. package/dist/cjs/smart-contract/builtin-libs/contextUtils.js.map +1 -0
  111. package/dist/cjs/smart-contract/builtin-libs/index.cjs +18 -0
  112. package/dist/cjs/smart-contract/builtin-libs/index.js.map +1 -0
  113. package/dist/cjs/smart-contract/builtin-libs/p2pk.cjs +74 -0
  114. package/dist/cjs/smart-contract/builtin-libs/p2pk.js.map +1 -0
  115. package/dist/cjs/smart-contract/builtin-libs/p2pkh.cjs +80 -0
  116. package/dist/cjs/smart-contract/builtin-libs/p2pkh.js.map +1 -0
  117. package/dist/cjs/smart-contract/builtin-libs/stateLib.cjs +65 -0
  118. package/dist/cjs/smart-contract/builtin-libs/stateLib.js.map +1 -0
  119. package/dist/cjs/smart-contract/builtin-libs/stateUtils.cjs +42 -0
  120. package/dist/cjs/smart-contract/builtin-libs/stateUtils.js.map +1 -0
  121. package/dist/cjs/smart-contract/builtin-libs/stdUtils.cjs +192 -0
  122. package/dist/cjs/smart-contract/builtin-libs/stdUtils.js.map +1 -0
  123. package/dist/cjs/smart-contract/builtin-libs/txHashPreimageUtils.cjs +56 -0
  124. package/dist/cjs/smart-contract/builtin-libs/txHashPreimageUtils.js.map +1 -0
  125. package/dist/cjs/smart-contract/builtin-libs/txUtils.cjs +183 -0
  126. package/dist/cjs/smart-contract/builtin-libs/txUtils.js.map +1 -0
  127. package/dist/cjs/smart-contract/consts.cjs +100 -0
  128. package/dist/cjs/smart-contract/consts.js.map +1 -0
  129. package/dist/cjs/smart-contract/decorators.cjs +83 -0
  130. package/dist/cjs/smart-contract/decorators.js.map +1 -0
  131. package/dist/cjs/smart-contract/fns/assert.cjs +17 -0
  132. package/dist/cjs/smart-contract/fns/assert.js.map +1 -0
  133. package/dist/cjs/smart-contract/fns/bitwise.cjs +141 -0
  134. package/dist/cjs/smart-contract/fns/bitwise.js.map +1 -0
  135. package/dist/cjs/smart-contract/fns/byteString.cjs +106 -0
  136. package/dist/cjs/smart-contract/fns/byteString.js.map +1 -0
  137. package/dist/cjs/smart-contract/fns/equals.cjs +66 -0
  138. package/dist/cjs/smart-contract/fns/equals.js.map +1 -0
  139. package/dist/cjs/smart-contract/fns/fill.cjs +19 -0
  140. package/dist/cjs/smart-contract/fns/fill.js.map +1 -0
  141. package/dist/cjs/smart-contract/fns/hashes.cjs +81 -0
  142. package/dist/cjs/smart-contract/fns/hashes.js.map +1 -0
  143. package/dist/cjs/smart-contract/fns/index.cjs +37 -0
  144. package/dist/cjs/smart-contract/fns/index.js.map +1 -0
  145. package/dist/cjs/smart-contract/fns/math.cjs +52 -0
  146. package/dist/cjs/smart-contract/fns/math.js.map +1 -0
  147. package/dist/cjs/smart-contract/fns/pubKey2Addr.cjs +17 -0
  148. package/dist/cjs/smart-contract/fns/pubKey2Addr.js.map +1 -0
  149. package/dist/cjs/smart-contract/methods/backtraceToGenensis.cjs +41 -0
  150. package/dist/cjs/smart-contract/methods/backtraceToGenensis.js.map +1 -0
  151. package/dist/cjs/smart-contract/methods/buildOutput.cjs +41 -0
  152. package/dist/cjs/smart-contract/methods/buildOutput.js.map +1 -0
  153. package/dist/cjs/smart-contract/methods/checkCtx.cjs +58 -0
  154. package/dist/cjs/smart-contract/methods/checkCtx.js.map +1 -0
  155. package/dist/cjs/smart-contract/methods/checkInputState.cjs +16 -0
  156. package/dist/cjs/smart-contract/methods/checkInputState.js.map +1 -0
  157. package/dist/cjs/smart-contract/methods/checkInputStateHashes.cjs +16 -0
  158. package/dist/cjs/smart-contract/methods/checkInputStateHashes.js.map +1 -0
  159. package/dist/cjs/smart-contract/methods/checkSHPreimage.cjs +17 -0
  160. package/dist/cjs/smart-contract/methods/checkSHPreimage.js.map +1 -0
  161. package/dist/cjs/smart-contract/methods/checkSig.cjs +77 -0
  162. package/dist/cjs/smart-contract/methods/checkSig.js.map +1 -0
  163. package/dist/cjs/smart-contract/serializer.cjs +145 -0
  164. package/dist/cjs/smart-contract/serializer.js.map +1 -0
  165. package/dist/cjs/smart-contract/smartContract.cjs +568 -0
  166. package/dist/cjs/smart-contract/smartContract.js.map +1 -0
  167. package/dist/cjs/smart-contract/smartContractLib.cjs +46 -0
  168. package/dist/cjs/smart-contract/smartContractLib.js.map +1 -0
  169. package/dist/cjs/smart-contract/stateSerializer.cjs +134 -0
  170. package/dist/cjs/smart-contract/stateSerializer.js.map +1 -0
  171. package/dist/cjs/smart-contract/types/abi.cjs +69 -0
  172. package/dist/cjs/smart-contract/types/abi.js.map +1 -0
  173. package/dist/cjs/smart-contract/types/artifact.cjs +16 -0
  174. package/dist/cjs/smart-contract/types/artifact.js.map +1 -0
  175. package/dist/cjs/smart-contract/types/bn.cjs +117 -0
  176. package/dist/cjs/smart-contract/types/bn.js.map +1 -0
  177. package/dist/cjs/smart-contract/types/context.cjs +3 -0
  178. package/dist/cjs/smart-contract/types/context.js.map +1 -0
  179. package/dist/cjs/smart-contract/types/index.cjs +16 -0
  180. package/dist/cjs/smart-contract/types/index.js.map +1 -0
  181. package/dist/cjs/smart-contract/types/opCode.cjs +754 -0
  182. package/dist/cjs/smart-contract/types/opCode.js.map +1 -0
  183. package/dist/cjs/smart-contract/types/primitives.cjs +108 -0
  184. package/dist/cjs/smart-contract/types/primitives.js.map +1 -0
  185. package/dist/cjs/smart-contract/types/script.cjs +43 -0
  186. package/dist/cjs/smart-contract/types/script.js.map +1 -0
  187. package/dist/cjs/smart-contract/types/structs.cjs +3 -0
  188. package/dist/cjs/smart-contract/types/structs.js.map +1 -0
  189. package/dist/cjs/smart-contract/types/utils.cjs +21 -0
  190. package/dist/cjs/smart-contract/types/utils.js.map +1 -0
  191. package/dist/cjs/utils/bvm.cjs +30 -0
  192. package/dist/cjs/utils/bvm.js.map +1 -0
  193. package/dist/cjs/utils/checkIntegrity.cjs +49 -0
  194. package/dist/cjs/utils/checkIntegrity.js.map +1 -0
  195. package/dist/cjs/utils/common.cjs +228 -0
  196. package/dist/cjs/utils/common.js.map +1 -0
  197. package/dist/cjs/utils/constants.cjs +5 -0
  198. package/dist/cjs/utils/constants.js.map +1 -0
  199. package/dist/cjs/utils/index.cjs +45 -0
  200. package/dist/cjs/utils/index.js.map +1 -0
  201. package/dist/cjs/utils/preimage.cjs +93 -0
  202. package/dist/cjs/utils/preimage.js.map +1 -0
  203. package/dist/cjs/utils/proof.cjs +110 -0
  204. package/dist/cjs/utils/proof.js.map +1 -0
  205. package/dist/cjs/utils/script_number.cjs +107 -0
  206. package/dist/cjs/utils/script_number.js.map +1 -0
  207. package/dist/esm/features/call.js +34 -0
  208. package/dist/esm/features/call.js.map +1 -0
  209. package/dist/esm/features/deploy.js +29 -0
  210. package/dist/esm/features/deploy.js.map +1 -0
  211. package/dist/esm/features/index.js +3 -0
  212. package/dist/esm/features/index.js.map +1 -0
  213. package/dist/esm/globalTypes.js +2 -0
  214. package/dist/esm/globalTypes.js.map +1 -0
  215. package/dist/esm/index.js +23 -0
  216. package/dist/esm/index.js.map +1 -0
  217. package/dist/esm/networks.js +41 -0
  218. package/dist/esm/networks.js.map +1 -0
  219. package/dist/esm/providers/chainProvider.js +2 -0
  220. package/dist/esm/providers/chainProvider.js.map +1 -0
  221. package/dist/esm/providers/dummyProvider.js +60 -0
  222. package/dist/esm/providers/dummyProvider.js.map +1 -0
  223. package/dist/esm/providers/index.js +5 -0
  224. package/dist/esm/providers/index.js.map +1 -0
  225. package/dist/esm/providers/mempoolProvider.js +200 -0
  226. package/dist/esm/providers/mempoolProvider.js.map +1 -0
  227. package/dist/esm/providers/rpcProvider.js +266 -0
  228. package/dist/esm/providers/rpcProvider.js.map +1 -0
  229. package/dist/esm/providers/utxoProvider.js +13 -0
  230. package/dist/esm/providers/utxoProvider.js.map +1 -0
  231. package/dist/esm/psbt/bip66.js +175 -0
  232. package/dist/esm/psbt/bip66.js.map +1 -0
  233. package/dist/esm/psbt/bufferutils.js +156 -0
  234. package/dist/esm/psbt/bufferutils.js.map +1 -0
  235. package/dist/esm/psbt/contextProvider.js +84 -0
  236. package/dist/esm/psbt/contextProvider.js.map +1 -0
  237. package/dist/esm/psbt/extPsbt.js +562 -0
  238. package/dist/esm/psbt/extPsbt.js.map +1 -0
  239. package/dist/esm/psbt/psbt.js +945 -0
  240. package/dist/esm/psbt/psbt.js.map +1 -0
  241. package/dist/esm/psbt/psbtutils.js +110 -0
  242. package/dist/esm/psbt/psbtutils.js.map +1 -0
  243. package/dist/esm/psbt/signatureutils.js +199 -0
  244. package/dist/esm/psbt/signatureutils.js.map +1 -0
  245. package/dist/esm/psbt/types.js +2 -0
  246. package/dist/esm/psbt/types.js.map +1 -0
  247. package/dist/esm/signer.js +2 -0
  248. package/dist/esm/signer.js.map +1 -0
  249. package/dist/esm/signers/defaultSigner.js +63 -0
  250. package/dist/esm/signers/defaultSigner.js.map +1 -0
  251. package/dist/esm/signers/index.js +3 -0
  252. package/dist/esm/signers/index.js.map +1 -0
  253. package/dist/esm/signers/unisatSigner.js +34 -0
  254. package/dist/esm/signers/unisatSigner.js.map +1 -0
  255. package/dist/esm/smart-contract/abi.js +373 -0
  256. package/dist/esm/smart-contract/abi.js.map +1 -0
  257. package/dist/esm/smart-contract/abiutils.js +171 -0
  258. package/dist/esm/smart-contract/abiutils.js.map +1 -0
  259. package/dist/esm/smart-contract/abstractContract.js +21 -0
  260. package/dist/esm/smart-contract/abstractContract.js.map +1 -0
  261. package/dist/esm/smart-contract/builtin-libs/backtrace.js +98 -0
  262. package/dist/esm/smart-contract/builtin-libs/backtrace.js.map +1 -0
  263. package/dist/esm/smart-contract/builtin-libs/byteStringReader.js +134 -0
  264. package/dist/esm/smart-contract/builtin-libs/byteStringReader.js.map +1 -0
  265. package/dist/esm/smart-contract/builtin-libs/byteStringWriter.js +105 -0
  266. package/dist/esm/smart-contract/builtin-libs/byteStringWriter.js.map +1 -0
  267. package/dist/esm/smart-contract/builtin-libs/contextUtils.js +300 -0
  268. package/dist/esm/smart-contract/builtin-libs/contextUtils.js.map +1 -0
  269. package/dist/esm/smart-contract/builtin-libs/index.js +8 -0
  270. package/dist/esm/smart-contract/builtin-libs/index.js.map +1 -0
  271. package/dist/esm/smart-contract/builtin-libs/p2pk.js +70 -0
  272. package/dist/esm/smart-contract/builtin-libs/p2pk.js.map +1 -0
  273. package/dist/esm/smart-contract/builtin-libs/p2pkh.js +76 -0
  274. package/dist/esm/smart-contract/builtin-libs/p2pkh.js.map +1 -0
  275. package/dist/esm/smart-contract/builtin-libs/stateLib.js +61 -0
  276. package/dist/esm/smart-contract/builtin-libs/stateLib.js.map +1 -0
  277. package/dist/esm/smart-contract/builtin-libs/stateUtils.js +38 -0
  278. package/dist/esm/smart-contract/builtin-libs/stateUtils.js.map +1 -0
  279. package/dist/esm/smart-contract/builtin-libs/stdUtils.js +188 -0
  280. package/dist/esm/smart-contract/builtin-libs/stdUtils.js.map +1 -0
  281. package/dist/esm/smart-contract/builtin-libs/txHashPreimageUtils.js +52 -0
  282. package/dist/esm/smart-contract/builtin-libs/txHashPreimageUtils.js.map +1 -0
  283. package/dist/esm/smart-contract/builtin-libs/txUtils.js +179 -0
  284. package/dist/esm/smart-contract/builtin-libs/txUtils.js.map +1 -0
  285. package/dist/esm/smart-contract/consts.js +97 -0
  286. package/dist/esm/smart-contract/consts.js.map +1 -0
  287. package/dist/esm/smart-contract/decorators.js +78 -0
  288. package/dist/esm/smart-contract/decorators.js.map +1 -0
  289. package/dist/esm/smart-contract/fns/assert.js +13 -0
  290. package/dist/esm/smart-contract/fns/assert.js.map +1 -0
  291. package/dist/esm/smart-contract/fns/bitwise.js +109 -0
  292. package/dist/esm/smart-contract/fns/bitwise.js.map +1 -0
  293. package/dist/esm/smart-contract/fns/byteString.js +97 -0
  294. package/dist/esm/smart-contract/fns/byteString.js.map +1 -0
  295. package/dist/esm/smart-contract/fns/equals.js +62 -0
  296. package/dist/esm/smart-contract/fns/equals.js.map +1 -0
  297. package/dist/esm/smart-contract/fns/fill.js +15 -0
  298. package/dist/esm/smart-contract/fns/fill.js.map +1 -0
  299. package/dist/esm/smart-contract/fns/hashes.js +73 -0
  300. package/dist/esm/smart-contract/fns/hashes.js.map +1 -0
  301. package/dist/esm/smart-contract/fns/index.js +9 -0
  302. package/dist/esm/smart-contract/fns/index.js.map +1 -0
  303. package/dist/esm/smart-contract/fns/math.js +45 -0
  304. package/dist/esm/smart-contract/fns/math.js.map +1 -0
  305. package/dist/esm/smart-contract/fns/pubKey2Addr.js +13 -0
  306. package/dist/esm/smart-contract/fns/pubKey2Addr.js.map +1 -0
  307. package/dist/esm/smart-contract/methods/backtraceToGenensis.js +36 -0
  308. package/dist/esm/smart-contract/methods/backtraceToGenensis.js.map +1 -0
  309. package/dist/esm/smart-contract/methods/buildOutput.js +36 -0
  310. package/dist/esm/smart-contract/methods/buildOutput.js.map +1 -0
  311. package/dist/esm/smart-contract/methods/checkCtx.js +31 -0
  312. package/dist/esm/smart-contract/methods/checkCtx.js.map +1 -0
  313. package/dist/esm/smart-contract/methods/checkInputState.js +12 -0
  314. package/dist/esm/smart-contract/methods/checkInputState.js.map +1 -0
  315. package/dist/esm/smart-contract/methods/checkInputStateHashes.js +12 -0
  316. package/dist/esm/smart-contract/methods/checkInputStateHashes.js.map +1 -0
  317. package/dist/esm/smart-contract/methods/checkSHPreimage.js +13 -0
  318. package/dist/esm/smart-contract/methods/checkSHPreimage.js.map +1 -0
  319. package/dist/esm/smart-contract/methods/checkSig.js +73 -0
  320. package/dist/esm/smart-contract/methods/checkSig.js.map +1 -0
  321. package/dist/esm/smart-contract/serializer.js +112 -0
  322. package/dist/esm/smart-contract/serializer.js.map +1 -0
  323. package/dist/esm/smart-contract/smartContract.js +564 -0
  324. package/dist/esm/smart-contract/smartContract.js.map +1 -0
  325. package/dist/esm/smart-contract/smartContractLib.js +42 -0
  326. package/dist/esm/smart-contract/smartContractLib.js.map +1 -0
  327. package/dist/esm/smart-contract/stateSerializer.js +129 -0
  328. package/dist/esm/smart-contract/stateSerializer.js.map +1 -0
  329. package/dist/esm/smart-contract/types/abi.js +63 -0
  330. package/dist/esm/smart-contract/types/abi.js.map +1 -0
  331. package/dist/esm/smart-contract/types/artifact.js +13 -0
  332. package/dist/esm/smart-contract/types/artifact.js.map +1 -0
  333. package/dist/esm/smart-contract/types/bn.js +89 -0
  334. package/dist/esm/smart-contract/types/bn.js.map +1 -0
  335. package/dist/esm/smart-contract/types/context.js +2 -0
  336. package/dist/esm/smart-contract/types/context.js.map +1 -0
  337. package/dist/esm/smart-contract/types/index.js +3 -0
  338. package/dist/esm/smart-contract/types/index.js.map +1 -0
  339. package/dist/esm/smart-contract/types/opCode.js +750 -0
  340. package/dist/esm/smart-contract/types/opCode.js.map +1 -0
  341. package/dist/esm/smart-contract/types/primitives.js +95 -0
  342. package/dist/esm/smart-contract/types/primitives.js.map +1 -0
  343. package/dist/esm/smart-contract/types/script.js +16 -0
  344. package/dist/esm/smart-contract/types/script.js.map +1 -0
  345. package/dist/esm/smart-contract/types/structs.js +2 -0
  346. package/dist/esm/smart-contract/types/structs.js.map +1 -0
  347. package/dist/esm/smart-contract/types/utils.js +17 -0
  348. package/dist/esm/smart-contract/types/utils.js.map +1 -0
  349. package/dist/esm/utils/bvm.js +26 -0
  350. package/dist/esm/utils/bvm.js.map +1 -0
  351. package/dist/esm/utils/checkIntegrity.js +41 -0
  352. package/dist/esm/utils/checkIntegrity.js.map +1 -0
  353. package/dist/esm/utils/common.js +188 -0
  354. package/dist/esm/utils/common.js.map +1 -0
  355. package/dist/esm/utils/constants.js +2 -0
  356. package/dist/esm/utils/constants.js.map +1 -0
  357. package/dist/esm/utils/index.js +7 -0
  358. package/dist/esm/utils/index.js.map +1 -0
  359. package/dist/esm/utils/preimage.js +65 -0
  360. package/dist/esm/utils/preimage.js.map +1 -0
  361. package/dist/esm/utils/proof.js +98 -0
  362. package/dist/esm/utils/proof.js.map +1 -0
  363. package/dist/esm/utils/script_number.js +79 -0
  364. package/dist/esm/utils/script_number.js.map +1 -0
  365. package/dist/types/features/call.d.ts +21 -0
  366. package/dist/types/features/call.d.ts.map +1 -0
  367. package/dist/types/features/deploy.d.ts +16 -0
  368. package/dist/types/features/deploy.d.ts.map +1 -0
  369. package/dist/types/features/index.d.ts +3 -0
  370. package/dist/types/features/index.d.ts.map +1 -0
  371. package/dist/types/globalTypes.d.ts +37 -0
  372. package/dist/types/globalTypes.d.ts.map +1 -0
  373. package/dist/types/index.d.ts +18 -0
  374. package/dist/types/index.d.ts.map +1 -0
  375. package/dist/types/networks.d.ts +19 -0
  376. package/dist/types/networks.d.ts.map +1 -0
  377. package/dist/types/providers/chainProvider.d.ts +31 -0
  378. package/dist/types/providers/chainProvider.d.ts.map +1 -0
  379. package/dist/types/providers/dummyProvider.d.ts +23 -0
  380. package/dist/types/providers/dummyProvider.d.ts.map +1 -0
  381. package/dist/types/providers/index.d.ts +6 -0
  382. package/dist/types/providers/index.d.ts.map +1 -0
  383. package/dist/types/providers/mempoolProvider.d.ts +28 -0
  384. package/dist/types/providers/mempoolProvider.d.ts.map +1 -0
  385. package/dist/types/providers/rpcProvider.d.ts +34 -0
  386. package/dist/types/providers/rpcProvider.d.ts.map +1 -0
  387. package/dist/types/providers/utxoProvider.d.ts +43 -0
  388. package/dist/types/providers/utxoProvider.d.ts.map +1 -0
  389. package/dist/types/psbt/bip66.d.ts +28 -0
  390. package/dist/types/psbt/bip66.d.ts.map +1 -0
  391. package/dist/types/psbt/bufferutils.d.ts +47 -0
  392. package/dist/types/psbt/bufferutils.d.ts.map +1 -0
  393. package/dist/types/psbt/contextProvider.d.ts +15 -0
  394. package/dist/types/psbt/contextProvider.d.ts.map +1 -0
  395. package/dist/types/psbt/extPsbt.d.ts +131 -0
  396. package/dist/types/psbt/extPsbt.d.ts.map +1 -0
  397. package/dist/types/psbt/psbt.d.ts +194 -0
  398. package/dist/types/psbt/psbt.d.ts.map +1 -0
  399. package/dist/types/psbt/psbtutils.d.ts +37 -0
  400. package/dist/types/psbt/psbtutils.d.ts.map +1 -0
  401. package/dist/types/psbt/signatureutils.d.ts +52 -0
  402. package/dist/types/psbt/signatureutils.d.ts.map +1 -0
  403. package/dist/types/psbt/types.d.ts +63 -0
  404. package/dist/types/psbt/types.d.ts.map +1 -0
  405. package/dist/types/signer.d.ts +48 -0
  406. package/dist/types/signer.d.ts.map +1 -0
  407. package/dist/types/signers/defaultSigner.d.ts +30 -0
  408. package/dist/types/signers/defaultSigner.d.ts.map +1 -0
  409. package/dist/types/signers/index.d.ts +4 -0
  410. package/dist/types/signers/index.d.ts.map +1 -0
  411. package/dist/types/signers/unisatSigner.d.ts +32 -0
  412. package/dist/types/signers/unisatSigner.d.ts.map +1 -0
  413. package/dist/types/smart-contract/abi.d.ts +43 -0
  414. package/dist/types/smart-contract/abi.d.ts.map +1 -0
  415. package/dist/types/smart-contract/abiutils.d.ts +51 -0
  416. package/dist/types/smart-contract/abiutils.d.ts.map +1 -0
  417. package/dist/types/smart-contract/abstractContract.d.ts +115 -0
  418. package/dist/types/smart-contract/abstractContract.d.ts.map +1 -0
  419. package/dist/types/smart-contract/builtin-libs/backtrace.d.ts +43 -0
  420. package/dist/types/smart-contract/builtin-libs/backtrace.d.ts.map +1 -0
  421. package/dist/types/smart-contract/builtin-libs/byteStringReader.d.ts +32 -0
  422. package/dist/types/smart-contract/builtin-libs/byteStringReader.d.ts.map +1 -0
  423. package/dist/types/smart-contract/builtin-libs/byteStringWriter.d.ts +29 -0
  424. package/dist/types/smart-contract/builtin-libs/byteStringWriter.d.ts.map +1 -0
  425. package/dist/types/smart-contract/builtin-libs/contextUtils.d.ts +53 -0
  426. package/dist/types/smart-contract/builtin-libs/contextUtils.d.ts.map +1 -0
  427. package/dist/types/smart-contract/builtin-libs/index.d.ts +8 -0
  428. package/dist/types/smart-contract/builtin-libs/index.d.ts.map +1 -0
  429. package/dist/types/smart-contract/builtin-libs/p2pk.d.ts +8 -0
  430. package/dist/types/smart-contract/builtin-libs/p2pk.d.ts.map +1 -0
  431. package/dist/types/smart-contract/builtin-libs/p2pkh.d.ts +8 -0
  432. package/dist/types/smart-contract/builtin-libs/p2pkh.d.ts.map +1 -0
  433. package/dist/types/smart-contract/builtin-libs/stateLib.d.ts +27 -0
  434. package/dist/types/smart-contract/builtin-libs/stateLib.d.ts.map +1 -0
  435. package/dist/types/smart-contract/builtin-libs/stateUtils.d.ts +18 -0
  436. package/dist/types/smart-contract/builtin-libs/stateUtils.d.ts.map +1 -0
  437. package/dist/types/smart-contract/builtin-libs/stdUtils.d.ts +44 -0
  438. package/dist/types/smart-contract/builtin-libs/stdUtils.d.ts.map +1 -0
  439. package/dist/types/smart-contract/builtin-libs/txHashPreimageUtils.d.ts +8 -0
  440. package/dist/types/smart-contract/builtin-libs/txHashPreimageUtils.d.ts.map +1 -0
  441. package/dist/types/smart-contract/builtin-libs/txUtils.d.ts +69 -0
  442. package/dist/types/smart-contract/builtin-libs/txUtils.d.ts.map +1 -0
  443. package/dist/types/smart-contract/consts.d.ts +97 -0
  444. package/dist/types/smart-contract/consts.d.ts.map +1 -0
  445. package/dist/types/smart-contract/decorators.d.ts +40 -0
  446. package/dist/types/smart-contract/decorators.d.ts.map +1 -0
  447. package/dist/types/smart-contract/fns/assert.d.ts +8 -0
  448. package/dist/types/smart-contract/fns/assert.d.ts.map +1 -0
  449. package/dist/types/smart-contract/fns/bitwise.d.ts +50 -0
  450. package/dist/types/smart-contract/fns/bitwise.d.ts.map +1 -0
  451. package/dist/types/smart-contract/fns/byteString.d.ts +56 -0
  452. package/dist/types/smart-contract/fns/byteString.d.ts.map +1 -0
  453. package/dist/types/smart-contract/fns/equals.d.ts +8 -0
  454. package/dist/types/smart-contract/fns/equals.d.ts.map +1 -0
  455. package/dist/types/smart-contract/fns/fill.d.ts +11 -0
  456. package/dist/types/smart-contract/fns/fill.d.ts.map +1 -0
  457. package/dist/types/smart-contract/fns/hashes.d.ts +60 -0
  458. package/dist/types/smart-contract/fns/hashes.d.ts.map +1 -0
  459. package/dist/types/smart-contract/fns/index.d.ts +9 -0
  460. package/dist/types/smart-contract/fns/index.d.ts.map +1 -0
  461. package/dist/types/smart-contract/fns/math.d.ts +38 -0
  462. package/dist/types/smart-contract/fns/math.d.ts.map +1 -0
  463. package/dist/types/smart-contract/fns/pubKey2Addr.d.ts +11 -0
  464. package/dist/types/smart-contract/fns/pubKey2Addr.d.ts.map +1 -0
  465. package/dist/types/smart-contract/methods/backtraceToGenensis.d.ts +20 -0
  466. package/dist/types/smart-contract/methods/backtraceToGenensis.d.ts.map +1 -0
  467. package/dist/types/smart-contract/methods/buildOutput.d.ts +25 -0
  468. package/dist/types/smart-contract/methods/buildOutput.d.ts.map +1 -0
  469. package/dist/types/smart-contract/methods/checkCtx.d.ts +18 -0
  470. package/dist/types/smart-contract/methods/checkCtx.d.ts.map +1 -0
  471. package/dist/types/smart-contract/methods/checkInputState.d.ts +9 -0
  472. package/dist/types/smart-contract/methods/checkInputState.d.ts.map +1 -0
  473. package/dist/types/smart-contract/methods/checkInputStateHashes.d.ts +10 -0
  474. package/dist/types/smart-contract/methods/checkInputStateHashes.d.ts.map +1 -0
  475. package/dist/types/smart-contract/methods/checkSHPreimage.d.ts +10 -0
  476. package/dist/types/smart-contract/methods/checkSHPreimage.d.ts.map +1 -0
  477. package/dist/types/smart-contract/methods/checkSig.d.ts +11 -0
  478. package/dist/types/smart-contract/methods/checkSig.d.ts.map +1 -0
  479. package/dist/types/smart-contract/serializer.d.ts +48 -0
  480. package/dist/types/smart-contract/serializer.d.ts.map +1 -0
  481. package/dist/types/smart-contract/smartContract.d.ts +274 -0
  482. package/dist/types/smart-contract/smartContract.d.ts.map +1 -0
  483. package/dist/types/smart-contract/smartContractLib.d.ts +26 -0
  484. package/dist/types/smart-contract/smartContractLib.d.ts.map +1 -0
  485. package/dist/types/smart-contract/stateSerializer.d.ts +8 -0
  486. package/dist/types/smart-contract/stateSerializer.d.ts.map +1 -0
  487. package/dist/types/smart-contract/types/abi.d.ts +55 -0
  488. package/dist/types/smart-contract/types/abi.d.ts.map +1 -0
  489. package/dist/types/smart-contract/types/artifact.d.ts +108 -0
  490. package/dist/types/smart-contract/types/artifact.d.ts.map +1 -0
  491. package/dist/types/smart-contract/types/bn.d.ts +3 -0
  492. package/dist/types/smart-contract/types/bn.d.ts.map +1 -0
  493. package/dist/types/smart-contract/types/context.d.ts +126 -0
  494. package/dist/types/smart-contract/types/context.d.ts.map +1 -0
  495. package/dist/types/smart-contract/types/index.d.ts +4 -0
  496. package/dist/types/smart-contract/types/index.d.ts.map +1 -0
  497. package/dist/types/smart-contract/types/opCode.d.ts +747 -0
  498. package/dist/types/smart-contract/types/opCode.d.ts.map +1 -0
  499. package/dist/types/smart-contract/types/primitives.d.ts +217 -0
  500. package/dist/types/smart-contract/types/primitives.d.ts.map +1 -0
  501. package/dist/types/smart-contract/types/script.d.ts +14 -0
  502. package/dist/types/smart-contract/types/script.d.ts.map +1 -0
  503. package/dist/types/smart-contract/types/structs.d.ts +206 -0
  504. package/dist/types/smart-contract/types/structs.d.ts.map +1 -0
  505. package/dist/types/smart-contract/types/utils.d.ts +5 -0
  506. package/dist/types/smart-contract/types/utils.d.ts.map +1 -0
  507. package/dist/types/utils/bvm.d.ts +9 -0
  508. package/dist/types/utils/bvm.d.ts.map +1 -0
  509. package/dist/types/utils/checkIntegrity.d.ts +46 -0
  510. package/dist/types/utils/checkIntegrity.d.ts.map +1 -0
  511. package/dist/types/utils/common.d.ts +61 -0
  512. package/dist/types/utils/common.d.ts.map +1 -0
  513. package/dist/types/utils/constants.d.ts +3 -0
  514. package/dist/types/utils/constants.d.ts.map +1 -0
  515. package/dist/types/utils/index.d.ts +7 -0
  516. package/dist/types/utils/index.d.ts.map +1 -0
  517. package/dist/types/utils/preimage.d.ts +31 -0
  518. package/dist/types/utils/preimage.d.ts.map +1 -0
  519. package/dist/types/utils/proof.d.ts +31 -0
  520. package/dist/types/utils/proof.d.ts.map +1 -0
  521. package/dist/types/utils/script_number.d.ts +19 -0
  522. package/dist/types/utils/script_number.d.ts.map +1 -0
  523. package/package.json +79 -0
  524. package/scrypt.index.json +85 -0
  525. package/src/smart-contract/builtin-libs/backtrace.ts +116 -0
  526. package/src/smart-contract/builtin-libs/byteStringReader.ts +111 -0
  527. package/src/smart-contract/builtin-libs/byteStringWriter.ts +86 -0
  528. package/src/smart-contract/builtin-libs/contextUtils.ts +270 -0
  529. package/src/smart-contract/builtin-libs/index.ts +7 -0
  530. package/src/smart-contract/builtin-libs/p2pk.ts +58 -0
  531. package/src/smart-contract/builtin-libs/p2pkh.ts +67 -0
  532. package/src/smart-contract/builtin-libs/stateLib.ts +82 -0
  533. package/src/smart-contract/builtin-libs/stateUtils.ts +37 -0
  534. package/src/smart-contract/builtin-libs/stdUtils.ts +156 -0
  535. package/src/smart-contract/builtin-libs/txHashPreimageUtils.ts +34 -0
  536. package/src/smart-contract/builtin-libs/txUtils.ts +152 -0
  537. package/src/smart-contract/types/structs.ts +244 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opCode.d.ts","sourceRoot":"","sources":["../../../../src/smart-contract/types/opCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C;;;;;GAKG;AACH,qBAAa,MAAM;IACjB;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAoB;IACpD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAoB;IACxD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAoB;IAC5D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAoB;IAC5D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAoB;IAC5D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAoB;IAC1D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAoB;IAC3D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAoB;IACpD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAoB;IACvD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAoB;IACpD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAoB;IACpD;;;;OAIG;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,UAAU,CAAoB;IAC7D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAoB;IACzD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAoB;CACjE"}
@@ -0,0 +1,217 @@
1
+ import { Flavor } from '../../globalTypes.js';
2
+ /**
3
+ * A ByteString represents a byte array in hex format.
4
+ * @category Types
5
+ * @onchain
6
+ */
7
+ export type ByteString = Flavor<string, 'bytes'>;
8
+ /**
9
+ * A Int32 represents a number.
10
+ * @category Types
11
+ * @onchain
12
+ */
13
+ export type Int32 = Flavor<bigint, 'int'>;
14
+ export type UInt32 = Flavor<bigint, 'int'>;
15
+ export type UInt64 = Flavor<bigint, 'int'>;
16
+ export type SigHashPreimage = ByteString & {
17
+ __type: 'SigHashPreimage';
18
+ };
19
+ export declare function SigHashPreimage(b: ByteString): SigHashPreimage;
20
+ /**
21
+ * A Bool represents a boolean. A simple value true or false.
22
+ * @category Types
23
+ * @onchain
24
+ */
25
+ export type Bool = Flavor<boolean, 'bool'>;
26
+ /**
27
+ * A domain specific subtype of `Int32`, representing a private key.
28
+ * @category Types
29
+ * @onchain
30
+ */
31
+ export type PrivKey = Int32 & {
32
+ __type: 'PrivKey';
33
+ };
34
+ /**
35
+ * Creates a `PrivKey` instance from a `Int32`.
36
+ * @category Global Function
37
+ * @onchain
38
+ * @param key - Input Int32.
39
+ * @returns - A domain specific private key representation.
40
+ */
41
+ export declare function PrivKey(n: Int32): PrivKey;
42
+ /**
43
+ * A domain specific subtype of `ByteString`, representing a public key.
44
+ * @category Types
45
+ * @onchain
46
+ */
47
+ export type PubKey = ByteString & {
48
+ __type: 'PubKey';
49
+ };
50
+ /**
51
+ * Creates a `PubKey` instance from a `ByteString`.
52
+ * @category Global Function
53
+ * @onchain
54
+ * @param b - Input ByteString.
55
+ * @returns - A domain specific public key representation.
56
+ */
57
+ export declare function PubKey(b: ByteString): PubKey;
58
+ /**
59
+ * A domain specific subtype of `ByteString`, representing a signature.
60
+ * @category Types
61
+ * @onchain
62
+ */
63
+ export type Sig = ByteString & {
64
+ __type: 'Sig';
65
+ };
66
+ /**
67
+ * Creates a `Sig` instance from a `ByteString`.
68
+ * @category Global Function
69
+ * @onchain
70
+ * @param b - Input ByteString.
71
+ * @returns - A domain specific digital signature representation.
72
+ */
73
+ export declare function Sig(b: ByteString): Sig;
74
+ /**
75
+ * A domain specific subtype of `ByteString`, representing a RIPEMD-160 hash.
76
+ * @category Types
77
+ * @onchain
78
+ */
79
+ export type Ripemd160 = ByteString & {
80
+ __type: 'Ripemd160';
81
+ };
82
+ /**
83
+ * Creates a `Ripemd160` instance from a `ByteString`.
84
+ * @category Global Function
85
+ * @onchain
86
+ * @param b - Input ByteString.
87
+ * @returns - A domain specific RIPEMD-160 hash representation.
88
+ */
89
+ export declare function Ripemd160(b: ByteString): Ripemd160;
90
+ /**
91
+ * A domain specific subtype of `ByteString`, representing an address.
92
+ * @category Types
93
+ * @onchain
94
+ */
95
+ export type PubKeyHash = Ripemd160;
96
+ /**
97
+ * Creates a `PubKeyHash` instance from a `ByteString`.
98
+ * @category Global Function
99
+ * @onchain
100
+ * @param b - Input ByteString.
101
+ * @returns - A domain specific address representation.
102
+ */
103
+ export declare function PubKeyHash(b: ByteString): PubKeyHash;
104
+ /**
105
+ * A domain specific subtype of `ByteString`, representing an address.
106
+ * @category Types
107
+ * @onchain
108
+ */
109
+ export type Addr = PubKeyHash;
110
+ /**
111
+ * Creates an `Addr` instance from a `ByteString`.
112
+ * @category Global Function
113
+ * @onchain
114
+ * @param b - Input ByteString.
115
+ * @returns - A domain specific address representation.
116
+ */
117
+ export declare function Addr(b: ByteString): Addr;
118
+ /**
119
+ * A domain specific subtype of `ByteString`, representing a SHA-1 hash.
120
+ * @category Types
121
+ * @onchain
122
+ */
123
+ export type Sha1 = ByteString & {
124
+ __type: 'Sha1';
125
+ };
126
+ /**
127
+ * Creates a `Sha1` instance from a `ByteString`.
128
+ * @category Global Function
129
+ * @onchain
130
+ * @param b - Input ByteString.
131
+ * @returns - A domain specific SHA-1 hash representation.
132
+ */
133
+ export declare function Sha1(b: ByteString): Sha1;
134
+ /**
135
+ * A domain specific subtype of `ByteString`, representing a SHA-256 hash.
136
+ * @category Types
137
+ * @onchain
138
+ */
139
+ export type Sha256 = ByteString & {
140
+ __type: 'Sha256';
141
+ };
142
+ /**
143
+ * Creates a `Sha256` instance from a `ByteString`.
144
+ * @category Global Function
145
+ * @onchain
146
+ * @param b - Input ByteString.
147
+ * @returns - A domain specific SHA-256 hash representation.
148
+ */
149
+ export declare function Sha256(b: ByteString): Sha256;
150
+ /**
151
+ * An array is a fixed-size list of values of the same basic type.
152
+ * When you declare an array you have to declare it like this:
153
+ * @category Types
154
+ * @onchain
155
+ * @example
156
+ * ```ts
157
+ * let aaa: FixedArray<bigint, 3> = [1n, 3n, 3n];
158
+ *
159
+ * let abb: FixedArray<FixedArray<bigint, 2>, 3> = [[1n, 3n], [1n, 3n], [1n, 3n]];
160
+ *
161
+ * let bbb: FixedArray<FixedArray<FixedArray<bigint, 1>, 2>, 3> = [[[1n], [1n]], [[1n], [1n]], [[1n], [1n]]];
162
+ * ```
163
+ */
164
+ export type FixedArray<T, N extends number> = Array<T> & {
165
+ length: N;
166
+ };
167
+ /**
168
+ * A domain specific subtype of `ByteString`, representing a signature hash type.
169
+ * @category Types
170
+ * @onchain
171
+ * ref https://github.com/bitcoin/bitcoin/blob/c288c790cd9abe91e53164aba5d975ef1e26ee3f/src/script/interpreter.h#L30-L33
172
+ */
173
+ export declare const enum SigHashType {
174
+ ALL = 1,
175
+ NONE = 2,
176
+ SINGLE = 3,
177
+ ANYONECANPAY = 128,
178
+ ANYONECANPAY_ALL = 129,
179
+ ANYONECANPAY_NONE = 130,
180
+ ANYONECANPAY_SINGLE = 131
181
+ }
182
+ /**
183
+ * A domain specific subtype of `ByteString`, representing a Script word.
184
+ * @category Types
185
+ * @onchain
186
+ */
187
+ export type OpCodeType = ByteString & {
188
+ __type: 'OpCodeType';
189
+ };
190
+ /**
191
+ * Creates a `OpCodeType` from a `ByteString`.
192
+ * @category Global Function
193
+ * @onchain
194
+ * @param b - Input ByteString.
195
+ * @returns - A domain specific OpCodeType representation.
196
+ */
197
+ export declare function OpCodeType(b: ByteString): OpCodeType;
198
+ /**
199
+ * @ignore
200
+ */
201
+ export type PrimitiveTypes = Int32 | Bool | ByteString | PrivKey | PubKey | Sig | Sha256 | Sha1 | Ripemd160 | OpCodeType;
202
+ /**
203
+ * @ignore
204
+ */
205
+ export type SubBytes = PubKey | Sig | Sha256 | Sha1 | SigHashType | Ripemd160 | OpCodeType;
206
+ /**
207
+ * @ignore
208
+ */
209
+ export interface StructObject {
210
+ [key: string]: SupportedParamType;
211
+ }
212
+ /**
213
+ * @ignore
214
+ */
215
+ export type SupportedParamType = PrimitiveTypes | StructObject | SupportedParamType[];
216
+ export type OpcatState = StructObject | undefined;
217
+ //# sourceMappingURL=primitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../src/smart-contract/types/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE1C,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAC3C,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG;IAAC,MAAM,EAAE,iBAAiB,CAAA;CAAC,CAAC;AACvE,wBAAgB,eAAe,CAAC,CAAC,EAAE,UAAU,GAAG,eAAe,CAE9D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CAAA"}
@@ -0,0 +1,14 @@
1
+ import * as opcat from '@opcat-labs/opcat';
2
+ /**
3
+ * A bitcoin transaction script. Each transaction's inputs and outputs
4
+ * has a script that is evaluated to validate it's spending.
5
+ *
6
+ * See https://en.bitcoin.it/wiki/Script
7
+ *
8
+ * @constructor
9
+ * @param {Uint8Array} from data to populate script
10
+ */
11
+ export declare class Script extends opcat.Script {
12
+ constructor(rawBytes: Uint8Array);
13
+ }
14
+ //# sourceMappingURL=script.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../../src/smart-contract/types/script.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAA;AAC1C;;;;;;;;GAQG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,MAAM;gBAC1B,QAAQ,EAAE,UAAU;CAGjC"}
@@ -0,0 +1,206 @@
1
+ import { ByteString, Int32, UInt32, UInt64 } from './primitives.js';
2
+ /**
3
+ * The structure used to refer to a particular transaction output
4
+ * @category Types
5
+ * @onchain
6
+ */
7
+ export type Outpoint = {
8
+ /**
9
+ * The transaction hash, which is the reverse order of bytes of the `txId`.
10
+ */
11
+ txHash: ByteString;
12
+ /**
13
+ * The index of the output in the transaction.
14
+ */
15
+ outputIndex: UInt32;
16
+ };
17
+ /**
18
+ * A structure representing a transaction output
19
+ * @category Types
20
+ * @onchain
21
+ */
22
+ export type TxOut = {
23
+ scriptHash: ByteString;
24
+ dataHash: ByteString;
25
+ satoshis: UInt64;
26
+ };
27
+ /**
28
+ * A structure representing the transaction input, excluding witnesses
29
+ * @category Types
30
+ * @onchain
31
+ */
32
+ export type TxIn = {
33
+ /**
34
+ * 32 bytes.
35
+ * input's prevout transaction hash
36
+ */
37
+ prevTxHash: ByteString;
38
+ /**
39
+ * 4 bytes little endian.
40
+ * input's prevout output index
41
+ */
42
+ prevOutputIndex: UInt32;
43
+ /**
44
+ * 4 bytes little endian.
45
+ * input's sequence number
46
+ */
47
+ sequence: UInt32;
48
+ /**
49
+ * 32 bytes.
50
+ * input's unlocking script hash
51
+ */
52
+ scriptHash: ByteString;
53
+ };
54
+ /**
55
+ * transaction digest for signature verification, @see {@link https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#signature-validation-rules | BIP341}
56
+ * @category Types
57
+ * @onchain
58
+ */
59
+ export type SHPreimage = {
60
+ /**
61
+ * 4 bytes.
62
+ * version number of the transaction
63
+ */
64
+ nVersion: ByteString;
65
+ /**
66
+ * 32 bytes.
67
+ * hash256(Prevouts)
68
+ */
69
+ hashPrevouts: ByteString;
70
+ /**
71
+ * 32 bytes.
72
+ * current input's prevout script hash
73
+ */
74
+ spentScriptHash: ByteString;
75
+ /**
76
+ * 32 bytes.
77
+ * current input's prevout data hash
78
+ */
79
+ spentDataHash: ByteString;
80
+ /**
81
+ * 8 bytes little endian. spent amount;
82
+ */
83
+ value: UInt64;
84
+ /**
85
+ * 4 bytes little endian.
86
+ */
87
+ nSequence: ByteString;
88
+ /**
89
+ * 32 bytes.
90
+ * hash256(SpentAmounts)
91
+ */
92
+ hashSpentAmounts: ByteString;
93
+ /**
94
+ * 32 bytes.
95
+ * hash256(SpentScriptHashes)
96
+ */
97
+ hashSpentScriptHashes: ByteString;
98
+ /**
99
+ * 32 bytes.
100
+ * hash256(SpentDataHashes)
101
+ */
102
+ hashSpentDataHashes: ByteString;
103
+ /**
104
+ * 32 bytes.
105
+ * hash256(SpentSequences)
106
+ */
107
+ hashSequences: ByteString;
108
+ /**
109
+ * 32 bytes.
110
+ * hash256(Outputs)
111
+ */
112
+ hashOutputs: ByteString;
113
+ /**
114
+ * 4 bytes little endian.
115
+ */
116
+ inputIndex: UInt32;
117
+ /**
118
+ * 4 bytes little endian.
119
+ */
120
+ nLockTime: UInt32;
121
+ /**
122
+ * 4 bytes little endian.
123
+ */
124
+ sigHashType: UInt32;
125
+ };
126
+ /**
127
+ * An bytestring refers to the outputs from previous transactions that are being spent as inputs in the current transaction.
128
+ * prevout = prevTxHash(32 bytes) + prevOutputIndex(4 bytes)
129
+ * prevouts1 + prevouts2 + ... + prevoutsN
130
+ * @category Types
131
+ * @onchain
132
+ */
133
+ export type Prevouts = ByteString;
134
+ /**
135
+ * The context of the spent scripts.
136
+ * spentScriptHash = scriptHash(32 bytes)
137
+ * spentScriptHash1 + spentScriptHash2 + ... + spentScriptHashN
138
+ * @category Types
139
+ * @onchain
140
+ */
141
+ export type SpentScriptHashes = ByteString;
142
+ /**
143
+ * The context of the spent data hashes.
144
+ * spentDataHash = dataHash(32 bytes)
145
+ * spentDataHash1 + spentDataHash2 + ... + spentDataHashN
146
+ * @category Types
147
+ * @onchain
148
+ */
149
+ export type SpentDataHashes = ByteString;
150
+ /**
151
+ * The context of the spent amounts.
152
+ * spentAmount = amount(8 bytes)
153
+ * spentAmount1 + spentAmount2 + ... + spentAmountN
154
+ * @category Types
155
+ * @onchain
156
+ */
157
+ export type SpentAmounts = ByteString;
158
+ /**
159
+ * The digest data used to calculate the Traditional Transaction ID (txid) consists of the transaction's
160
+ * core components (inputs, outputs) without the witness information.
161
+ * @category Types
162
+ * @onchain
163
+ */
164
+ export type TxHashPreimage = {
165
+ /**
166
+ * 4 bytes little endian.
167
+ */
168
+ version: ByteString;
169
+ /**
170
+ * input = prevout(36 bytes) + unlockScriptHash(32 bytes) + sequence(4 bytes)
171
+ * input1 + input2 + ... + inputN
172
+ */
173
+ inputList: ByteString;
174
+ /**
175
+ * output = amount(8 bytes) + lockingScriptHash(32 bytes) + dataHash(32 bytes)
176
+ * output1 + output2 + ... + outputN
177
+ */
178
+ outputList: ByteString;
179
+ /**
180
+ * 4 bytes little endian.
181
+ */
182
+ nLockTime: ByteString;
183
+ };
184
+ /**
185
+ * Used for contract traceability to ensure that the spent contract comes from a unique outpoint
186
+ * @category Types
187
+ * @onchain
188
+ */
189
+ export type BacktraceInfo = {
190
+ /**
191
+ * @type {TxIn}
192
+ * the traceable input in the previous transaction
193
+ */
194
+ prevTxInput: TxIn;
195
+ /**
196
+ * @type {Int32}
197
+ * the index of the traceable input in the previous transaction
198
+ */
199
+ prevTxInputIndex: Int32;
200
+ /**
201
+ * @type {TxHashPreimage}
202
+ * the preimage of the previous previous transaction
203
+ */
204
+ prevPrevTxPreimage: TxHashPreimage;
205
+ };
206
+ //# sourceMappingURL=structs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.d.ts","sourceRoot":"","sources":["../../../../src/smart-contract/types/structs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEpE;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;IAEnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,UAAU,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,IAAI,GAAG;IACjB;;;OAGG;IACH,UAAU,EAAE,UAAU,CAAC;IAEvB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB;;;OAGG;IACH,QAAQ,EAAE,UAAU,CAAC;IAErB;;;OAGG;IACH,YAAY,EAAE,UAAU,CAAC;IAEzB;;;OAGG;IACH,eAAe,EAAE,UAAU,CAAA;IAE3B;;;OAGG;IACH,aAAa,EAAE,UAAU,CAAC;IAE1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,UAAU,CAAC;IAEtB;;;OAGG;IACH,gBAAgB,EAAE,UAAU,CAAC;IAE7B;;;OAGG;IACH,qBAAqB,EAAE,UAAU,CAAC;IAElC;;;OAGG;IACH,mBAAmB,EAAE,UAAU,CAAC;IAEhC;;;OAGG;IACH,aAAa,EAAE,UAAU,CAAC;IAE1B;;;OAGG;IACH,WAAW,EAAE,UAAU,CAAC;IAExB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAGnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;CACpB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC;AAItC;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,OAAO,EAAE,UAAU,CAAC;IAEpB;;;OAGG;IACH,SAAS,EAAE,UAAU,CAAC;IAEtB;;;OAGG;IACH,UAAU,EAAE,UAAU,CAAC;IAEvB;;OAEG;IACH,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC;AAIF;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,WAAW,EAAE,IAAI,CAAC;IAElB;;;OAGG;IACH,gBAAgB,EAAE,KAAK,CAAC;IAExB;;;OAGG;IACH,kBAAkB,EAAE,cAAc,CAAC;CACpC,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @ignore
3
+ */
4
+ export declare function getValidatedHexString(hex: string, allowEmpty?: boolean): string;
5
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/smart-contract/types/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,UAAO,GAAG,MAAM,CAgB5E"}
@@ -0,0 +1,9 @@
1
+ import { ExtPsbt } from '../psbt/extPsbt.js';
2
+ /**
3
+ * Verify that an input of `ExtPsbt` can be unlocked correctly. The extPsbt should be finalized.
4
+ * @param extPsbt
5
+ * @param inputIndex
6
+ * @returns true if success
7
+ */
8
+ export declare function bvmVerify(extPsbt: ExtPsbt, inputIndex?: number): true | string;
9
+ //# sourceMappingURL=bvm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bvm.d.ts","sourceRoot":"","sources":["../../../src/utils/bvm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,GAAE,MAAU,GAAG,IAAI,GAAG,MAAM,CA+BjF"}
@@ -0,0 +1,46 @@
1
+ import { SmartContract } from '../smart-contract/smartContract.js';
2
+ import { SmartContractLib } from '../smart-contract/smartContractLib.js';
3
+ /**
4
+ * @ignore
5
+ * The scrypt.index.json file generated by @scrypt-inc/cli-btc
6
+ */
7
+ export type ScryptIndexJson = {
8
+ scryptBase: string;
9
+ bindings: {
10
+ /**
11
+ * The symbol of the binding, contract name or library name
12
+ */
13
+ symbol: string;
14
+ /**
15
+ * The path of the .scrypt file
16
+ */
17
+ path: string;
18
+ /**
19
+ * The md5 of lockingScript
20
+ * exist when the file is a contract
21
+ */
22
+ md5?: string;
23
+ /**
24
+ * The state type of the contract
25
+ * exist when the file is a stateful contract
26
+ */
27
+ stateType?: string;
28
+ }[];
29
+ };
30
+ type ContractOrLib = new (...args: any[]) => SmartContract<any> | SmartContractLib;
31
+ /** @ignore */
32
+ export declare function calcArtifactHexMD5(artifactHex: string): string;
33
+ /**
34
+ * Check the integrity of the contracts:
35
+ *
36
+ * When compiling the contract, @scrypt-inc/cli-btc will generate the scrypt.index.json file, we will use this file to check the the artifact files are consistent with the scrypt.index.json file.
37
+ * You should add the scrypt.index.json file to version control tools like git.
38
+ *
39
+ * @note: make sure you have call loadArtifacts() before calling this function.
40
+ * @ignore
41
+ * @param scryptIndexJson The scrypt.index.json file content generated by @scrypt-inc/cli-btc
42
+ * @param contractClasses The contract classes to check
43
+ */
44
+ export declare function checkIntegrity(scryptIndexJson: ScryptIndexJson, contractClasses: ContractOrLib[]): void;
45
+ export {};
46
+ //# sourceMappingURL=checkIntegrity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkIntegrity.d.ts","sourceRoot":"","sources":["../../../src/utils/checkIntegrity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAGzE;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE;QACR;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;QAEf;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;;WAGG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;QAEb;;;WAGG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;CACL,CAAC;AAGF,KAAK,aAAa,GAAG,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,aAAa,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC;AAEnF,cAAc;AACd,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,QA2BhG"}
@@ -0,0 +1,61 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { Transaction } from '@opcat-labs/opcat';
4
+ import { ByteString, FixedArray } from '../smart-contract/types/index.js';
5
+ /**
6
+ * Converts a Uint8Array to a hexadecimal string.
7
+ * @param {Uint8Array} bytes - The input array of bytes.
8
+ * @returns {string} The hexadecimal representation of the input bytes.
9
+ */
10
+ export declare function uint8ArrayToHex(bytes: Uint8Array): string;
11
+ /**
12
+ * Converts a hexadecimal string to a Uint8Array.
13
+ * @param {string} hex - The hexadecimal string.
14
+ * @returns {Uint8Array} The resulting Uint8Array.
15
+ */
16
+ export declare function hexToUint8Array(hex: string): Uint8Array;
17
+ /**
18
+ * create a FixedArray and fill it with initial value
19
+ * @param value
20
+ * @param len
21
+ * @returns
22
+ */
23
+ export declare function fillFixedArray<T, Length extends number>(value: T, len: Length): FixedArray<T, Length>;
24
+ /**
25
+ * create a empty ByteString
26
+ * @returns a empty ByteString
27
+ */
28
+ export declare function emptyByteString(): ByteString;
29
+ /** @ignore */
30
+ export declare function requireTrue(res: boolean, message: string): void;
31
+ /** @ignore */
32
+ export declare function getTxId(input: Transaction.Input): string;
33
+ /**
34
+ * create StateHashes with empty value
35
+ * @returns
36
+ */
37
+ export declare function emptyStateHashes(): any;
38
+ /** @ignore */
39
+ export declare function cloneDeep<T>(obj: T, hash?: WeakMap<WeakKey, any>): T;
40
+ /**
41
+ * convert a ByteString to bigint.
42
+ * @param a
43
+ * @returns
44
+ */
45
+ export declare function byteStringToBigInt(a: ByteString): bigint;
46
+ /**
47
+ * convert satoshi to hex in little-endian order
48
+ * @param value
49
+ * @returns
50
+ */
51
+ export declare function satoshiToHex(value: bigint): string;
52
+ /**
53
+ * convert utf8 text to hex string
54
+ * @param text
55
+ * @returns
56
+ */
57
+ export declare function textToHex(text: string): string;
58
+ export declare function duplicateFilter<T>(uniqueFn: (item: T) => any): (value: T, index: number, arr: T[]) => boolean;
59
+ export declare function isFinal(sequenceNumber: number): boolean;
60
+ export declare function toHex(val: Buffer | string | Uint8Array): string;
61
+ //# sourceMapp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K,GAAG,WACnC,CAAC,SAAS,MAAM,OAAO,CAAC,EAAE,aAKnD;AAID,wBAAgB,OAAO,CAAC,cAAc,EAAE,MAAM,WAE7C;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAQ/D"}
@@ -0,0 +1,3 @@
1
+ import { SupportedNetwork } from '../globalTypes.js';
2
+ export declare const DEFAULT_NETWORK: SupportedNetwork;
3
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,eAAe,EAAE,gBAAkC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { uint8ArrayToHex, hexToUint8Array, textToHex, fillFixedArray, cloneDeep, isFinal, toHex, } from './common.js';
2
+ export { getValidatedHexString } from '../smart-contract/types/utils.js';
3
+ export { bvmVerify } from './bvm.js';
4
+ export { checkIntegrity, calcArtifactHexMD5 } from './checkIntegrity.js';
5
+ export { getBackTraceInfo } from './proof.js';
6
+ export * as scriptNumber from './script_number.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EACf,SAAS,EACT,cAAc,EACd,SAAS,EACT,OAAO,EACP,KAAK,GACN,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG9C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { ByteString, SHPreimage } from '../smart-contract/types/index.js';
2
+ /**
3
+ * Decodes a serialized SHPreimage from a Uint8Array.
4
+ *
5
+ * @param preimage - The serialized preimage data as a Uint8Array
6
+ * @returns The decoded SHPreimage object containing:
7
+ * - Version number
8
+ * - Hash of previous outputs
9
+ * - Spent script hash
10
+ * - Spent data hash
11
+ * - Spent amount
12
+ * - Sequence number
13
+ * - Hash of spent amounts
14
+ * - Hash of spent scripts
15
+ * - Hash of spent datas
16
+ * - Hash of sequences
17
+ * - Hash of outputs
18
+ * - Input index
19
+ * - Lock time
20
+ * - Sighash type
21
+ */
22
+ export declare function decodeSHPreimage(preimage: Uint8Array): SHPreimage;
23
+ /**
24
+ * Encodes a SHPreimage object into a ByteString by concatenating its fields.
25
+ * Each field is converted to a ByteString with appropriate formatting.
26
+ *
27
+ * @param shPreimage - The SHPreimage object containing all required fields
28
+ * @returns The concatenated ByteString representation of the SHPreimage
29
+ */
30
+ export declare function encodeSHPreimage(shPreimage: SHPreimage): ByteString;
31
+ //# sourceMappingURL=preimage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preimage.d.ts","sourceRoot":"","sources":["../../../src/utils/preimage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAK1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAiBjE;AAGD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAiBnE"}