@helios-lang/effect 0.1.14 → 0.2.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 (387) hide show
  1. package/dist/Cardano/CoinSelection.js +130 -0
  2. package/dist/Cardano/CoinSelection.js.map +1 -0
  3. package/dist/{Ledger → Cardano/Ledger}/Address.js +30 -20
  4. package/dist/Cardano/Ledger/Address.js.map +1 -0
  5. package/dist/{Ledger → Cardano/Ledger}/AssetClass.js +16 -11
  6. package/dist/Cardano/Ledger/AssetClass.js.map +1 -0
  7. package/dist/Cardano/Ledger/Assets.js +235 -0
  8. package/dist/Cardano/Ledger/Assets.js.map +1 -0
  9. package/dist/Cardano/Ledger/Credential.js +53 -0
  10. package/dist/Cardano/Ledger/Credential.js.map +1 -0
  11. package/dist/Cardano/Ledger/DCert.js +117 -0
  12. package/dist/Cardano/Ledger/DCert.js.map +1 -0
  13. package/dist/Cardano/Ledger/DatumHash.js +25 -0
  14. package/dist/Cardano/Ledger/DatumHash.js.map +1 -0
  15. package/dist/Cardano/Ledger/MintingPolicy.js +40 -0
  16. package/dist/Cardano/Ledger/MintingPolicy.js.map +1 -0
  17. package/dist/Cardano/Ledger/NativeScript.js +140 -0
  18. package/dist/Cardano/Ledger/NativeScript.js.map +1 -0
  19. package/dist/Cardano/Ledger/PubKey.js +22 -0
  20. package/dist/Cardano/Ledger/PubKey.js.map +1 -0
  21. package/dist/{Ledger → Cardano/Ledger}/PubKeyHash.js +5 -5
  22. package/dist/Cardano/Ledger/PubKeyHash.js.map +1 -0
  23. package/dist/Cardano/Ledger/Redeemer.js +155 -0
  24. package/dist/Cardano/Ledger/Redeemer.js.map +1 -0
  25. package/dist/Cardano/Ledger/RewardAddress.js +93 -0
  26. package/dist/Cardano/Ledger/RewardAddress.js.map +1 -0
  27. package/dist/Cardano/Ledger/Signature.js +23 -0
  28. package/dist/Cardano/Ledger/Signature.js.map +1 -0
  29. package/dist/Cardano/Ledger/Tx.js +498 -0
  30. package/dist/Cardano/Ledger/Tx.js.map +1 -0
  31. package/dist/Cardano/Ledger/TxHash.js +38 -0
  32. package/dist/Cardano/Ledger/TxHash.js.map +1 -0
  33. package/dist/Cardano/Ledger/TxOutput.js +167 -0
  34. package/dist/Cardano/Ledger/TxOutput.js.map +1 -0
  35. package/dist/{Ledger → Cardano/Ledger}/TxOutputDatum.js +44 -8
  36. package/dist/Cardano/Ledger/TxOutputDatum.js.map +1 -0
  37. package/dist/Cardano/Ledger/UTxO.js +100 -0
  38. package/dist/Cardano/Ledger/UTxO.js.map +1 -0
  39. package/dist/{Ledger → Cardano/Ledger}/UTxORef.js +28 -6
  40. package/dist/Cardano/Ledger/UTxORef.js.map +1 -0
  41. package/dist/{Ledger → Cardano/Ledger}/ValidatorHash.js +5 -5
  42. package/dist/Cardano/Ledger/ValidatorHash.js.map +1 -0
  43. package/dist/{Ledger → Cardano/Ledger}/index.js +5 -0
  44. package/dist/Cardano/Ledger/index.js.map +1 -0
  45. package/dist/Cardano/Network/IsMainnet.js.map +1 -0
  46. package/dist/{Network → Cardano/Network}/Params.js +27 -3
  47. package/dist/Cardano/Network/Params.js.map +1 -0
  48. package/dist/Cardano/Network/UTxO.js +20 -0
  49. package/dist/Cardano/Network/UTxO.js.map +1 -0
  50. package/dist/Cardano/Network/UTxOsAt.js +4 -0
  51. package/dist/Cardano/Network/UTxOsAt.js.map +1 -0
  52. package/dist/Cardano/Network/errors.js +33 -0
  53. package/dist/Cardano/Network/errors.js.map +1 -0
  54. package/dist/{Network → Cardano/Network}/index.js +1 -0
  55. package/dist/Cardano/Network/index.js.map +1 -0
  56. package/dist/Cardano/TxBuilder.js +946 -0
  57. package/dist/Cardano/TxBuilder.js.map +1 -0
  58. package/dist/Cardano/Uplc/Builtins.js +1820 -0
  59. package/dist/Cardano/Uplc/Builtins.js.map +1 -0
  60. package/dist/Cardano/Uplc/Cek.js +716 -0
  61. package/dist/Cardano/Uplc/Cek.js.map +1 -0
  62. package/dist/Cardano/Uplc/Cost.js +956 -0
  63. package/dist/Cardano/Uplc/Cost.js.map +1 -0
  64. package/dist/{Uplc → Cardano/Uplc}/Data.js +143 -22
  65. package/dist/Cardano/Uplc/Data.js.map +1 -0
  66. package/dist/Cardano/Uplc/Script.js +118 -0
  67. package/dist/Cardano/Uplc/Script.js.map +1 -0
  68. package/dist/Cardano/Uplc/ScriptContext.js +259 -0
  69. package/dist/Cardano/Uplc/ScriptContext.js.map +1 -0
  70. package/dist/Cardano/Uplc/Term.js +384 -0
  71. package/dist/Cardano/Uplc/Term.js.map +1 -0
  72. package/dist/Cardano/Uplc/Type.js +131 -0
  73. package/dist/Cardano/Uplc/Type.js.map +1 -0
  74. package/dist/Cardano/Uplc/Value.js +315 -0
  75. package/dist/Cardano/Uplc/Value.js.map +1 -0
  76. package/dist/Cardano/Uplc/index.js +7 -0
  77. package/dist/Cardano/Uplc/index.js.map +1 -0
  78. package/dist/Cardano/index.js +6 -0
  79. package/dist/Cardano/index.js.map +1 -0
  80. package/dist/{internal → Codecs}/Base32.js +2 -2
  81. package/dist/Codecs/Base32.js.map +1 -0
  82. package/dist/{Bech32.js → Codecs/Bech32.js} +2 -2
  83. package/dist/Codecs/Bech32.js.map +1 -0
  84. package/dist/Codecs/BigEndian.js.map +1 -0
  85. package/dist/Codecs/Bits.js.map +1 -0
  86. package/dist/{internal → Codecs}/Bytes.js +23 -12
  87. package/dist/Codecs/Bytes.js.map +1 -0
  88. package/dist/{Cbor.js → Codecs/Cbor.js} +559 -328
  89. package/dist/Codecs/Cbor.js.map +1 -0
  90. package/dist/{internal → Codecs}/Flat.js +16 -0
  91. package/dist/Codecs/Flat.js.map +1 -0
  92. package/dist/Codecs/Float.js.map +1 -0
  93. package/dist/Codecs/LittleEndian.js +27 -0
  94. package/dist/Codecs/LittleEndian.js.map +1 -0
  95. package/dist/Codecs/Uint64.js +89 -0
  96. package/dist/Codecs/Uint64.js.map +1 -0
  97. package/dist/{internal → Codecs}/Utf8.js +7 -2
  98. package/dist/Codecs/Utf8.js.map +1 -0
  99. package/dist/Codecs/ZigZag.js +26 -0
  100. package/dist/Codecs/ZigZag.js.map +1 -0
  101. package/dist/Codecs/index.js +8 -0
  102. package/dist/Codecs/index.js.map +1 -0
  103. package/dist/Crypto/Blake2b.js +156 -0
  104. package/dist/Crypto/Blake2b.js.map +1 -0
  105. package/dist/Crypto/Curve.js +92 -0
  106. package/dist/Crypto/Curve.js.map +1 -0
  107. package/dist/Crypto/Ed25519.js +323 -0
  108. package/dist/Crypto/Ed25519.js.map +1 -0
  109. package/dist/Crypto/EdDSA.js +222 -0
  110. package/dist/Crypto/EdDSA.js.map +1 -0
  111. package/dist/Crypto/Field.js +323 -0
  112. package/dist/Crypto/Field.js.map +1 -0
  113. package/dist/Crypto/Hmac.js +51 -0
  114. package/dist/Crypto/Hmac.js.map +1 -0
  115. package/dist/Crypto/Keccak.js +167 -0
  116. package/dist/Crypto/Keccak.js.map +1 -0
  117. package/dist/Crypto/Pbkdf2.js +45 -0
  118. package/dist/Crypto/Pbkdf2.js.map +1 -0
  119. package/dist/Crypto/Sha2_256.js +200 -0
  120. package/dist/Crypto/Sha2_256.js.map +1 -0
  121. package/dist/Crypto/Sha2_512.js +264 -0
  122. package/dist/Crypto/Sha2_512.js.map +1 -0
  123. package/dist/Crypto/Sha3_256.js +10 -0
  124. package/dist/Crypto/Sha3_256.js.map +1 -0
  125. package/dist/Crypto/errors.js +9 -0
  126. package/dist/Crypto/errors.js.map +1 -0
  127. package/dist/Crypto/index.js +12 -0
  128. package/dist/Crypto/index.js.map +1 -0
  129. package/dist/index.js +3 -5
  130. package/dist/index.js.map +1 -1
  131. package/package.json +24 -6
  132. package/tsconfig.build.json +1 -1
  133. package/tsconfig.build.tsbuildinfo +1 -1
  134. package/tsconfig.tsbuildinfo +1 -1
  135. package/types/Cardano/CoinSelection.d.ts +26 -0
  136. package/types/Cardano/CoinSelection.d.ts.map +1 -0
  137. package/types/{Ledger → Cardano/Ledger}/Address.d.ts +7 -6
  138. package/types/Cardano/Ledger/Address.d.ts.map +1 -0
  139. package/types/{Ledger → Cardano/Ledger}/AssetClass.d.ts +2 -2
  140. package/types/Cardano/Ledger/AssetClass.d.ts.map +1 -0
  141. package/types/Cardano/Ledger/Assets.d.ts +114 -0
  142. package/types/Cardano/Ledger/Assets.d.ts.map +1 -0
  143. package/types/{Ledger → Cardano/Ledger}/Credential.d.ts +10 -4
  144. package/types/Cardano/Ledger/Credential.d.ts.map +1 -0
  145. package/types/Cardano/Ledger/DCert.d.ts +40 -0
  146. package/types/Cardano/Ledger/DCert.d.ts.map +1 -0
  147. package/types/{Ledger → Cardano/Ledger}/DatumHash.d.ts +6 -5
  148. package/types/Cardano/Ledger/DatumHash.d.ts.map +1 -0
  149. package/types/{Ledger → Cardano/Ledger}/MintingPolicy.d.ts +11 -8
  150. package/types/Cardano/Ledger/MintingPolicy.d.ts.map +1 -0
  151. package/types/Cardano/Ledger/NativeScript.d.ts +105 -0
  152. package/types/Cardano/Ledger/NativeScript.d.ts.map +1 -0
  153. package/types/Cardano/Ledger/PubKey.d.ts +41 -0
  154. package/types/Cardano/Ledger/PubKey.d.ts.map +1 -0
  155. package/types/{Ledger → Cardano/Ledger}/PubKeyHash.d.ts +5 -5
  156. package/types/Cardano/Ledger/PubKeyHash.d.ts.map +1 -0
  157. package/types/Cardano/Ledger/Redeemer.d.ts +303 -0
  158. package/types/Cardano/Ledger/Redeemer.d.ts.map +1 -0
  159. package/types/Cardano/Ledger/RewardAddress.d.ts +60 -0
  160. package/types/Cardano/Ledger/RewardAddress.d.ts.map +1 -0
  161. package/types/Cardano/Ledger/Signature.d.ts +13 -0
  162. package/types/Cardano/Ledger/Signature.d.ts.map +1 -0
  163. package/types/Cardano/Ledger/Tx.d.ts +375 -0
  164. package/types/Cardano/Ledger/Tx.d.ts.map +1 -0
  165. package/types/{Ledger → Cardano/Ledger}/TxHash.d.ts +35 -5
  166. package/types/Cardano/Ledger/TxHash.d.ts.map +1 -0
  167. package/types/Cardano/Ledger/TxOutput.d.ts +438 -0
  168. package/types/Cardano/Ledger/TxOutput.d.ts.map +1 -0
  169. package/types/Cardano/Ledger/TxOutputDatum.d.ts +98 -0
  170. package/types/Cardano/Ledger/TxOutputDatum.d.ts.map +1 -0
  171. package/types/Cardano/Ledger/UTxO.d.ts +1420 -0
  172. package/types/Cardano/Ledger/UTxO.d.ts.map +1 -0
  173. package/types/Cardano/Ledger/UTxORef.d.ts +222 -0
  174. package/types/Cardano/Ledger/UTxORef.d.ts.map +1 -0
  175. package/types/{Ledger → Cardano/Ledger}/ValidatorHash.d.ts +5 -5
  176. package/types/Cardano/Ledger/ValidatorHash.d.ts.map +1 -0
  177. package/types/{Ledger → Cardano/Ledger}/index.d.ts +5 -0
  178. package/types/Cardano/Ledger/index.d.ts.map +1 -0
  179. package/types/Cardano/Network/IsMainnet.d.ts.map +1 -0
  180. package/types/{Network → Cardano/Network}/Params.d.ts +32 -4
  181. package/types/Cardano/Network/Params.d.ts.map +1 -0
  182. package/types/Cardano/Network/UTxO.d.ts +15 -0
  183. package/types/Cardano/Network/UTxO.d.ts.map +1 -0
  184. package/types/Cardano/Network/UTxOsAt.d.ts +9 -0
  185. package/types/Cardano/Network/UTxOsAt.d.ts.map +1 -0
  186. package/types/Cardano/Network/errors.d.ts +39 -0
  187. package/types/Cardano/Network/errors.d.ts.map +1 -0
  188. package/types/{Network → Cardano/Network}/index.d.ts +1 -0
  189. package/types/Cardano/Network/index.d.ts.map +1 -0
  190. package/types/Cardano/TxBuilder.d.ts +261 -0
  191. package/types/Cardano/TxBuilder.d.ts.map +1 -0
  192. package/types/Cardano/Uplc/Builtins.d.ts +163 -0
  193. package/types/Cardano/Uplc/Builtins.d.ts.map +1 -0
  194. package/types/Cardano/Uplc/Cek.d.ts +165 -0
  195. package/types/Cardano/Uplc/Cek.d.ts.map +1 -0
  196. package/types/Cardano/Uplc/Cost.d.ts +93 -0
  197. package/types/Cardano/Uplc/Cost.d.ts.map +1 -0
  198. package/types/{Uplc → Cardano/Uplc}/Data.d.ts +149 -15
  199. package/types/Cardano/Uplc/Data.d.ts.map +1 -0
  200. package/types/Cardano/Uplc/Script.d.ts +87 -0
  201. package/types/Cardano/Uplc/Script.d.ts.map +1 -0
  202. package/types/Cardano/Uplc/ScriptContext.d.ts +21 -0
  203. package/types/Cardano/Uplc/ScriptContext.d.ts.map +1 -0
  204. package/types/Cardano/Uplc/Term.d.ts +454 -0
  205. package/types/Cardano/Uplc/Term.d.ts.map +1 -0
  206. package/types/Cardano/Uplc/Type.d.ts +29 -0
  207. package/types/Cardano/Uplc/Type.d.ts.map +1 -0
  208. package/types/Cardano/Uplc/Value.d.ts +152 -0
  209. package/types/Cardano/Uplc/Value.d.ts.map +1 -0
  210. package/types/Cardano/Uplc/index.d.ts +7 -0
  211. package/types/Cardano/Uplc/index.d.ts.map +1 -0
  212. package/types/Cardano/index.d.ts +6 -0
  213. package/types/Cardano/index.d.ts.map +1 -0
  214. package/types/Codecs/Base32.d.ts.map +1 -0
  215. package/types/Codecs/Bech32.d.ts.map +1 -0
  216. package/types/Codecs/BigEndian.d.ts.map +1 -0
  217. package/types/Codecs/Bits.d.ts.map +1 -0
  218. package/types/{internal → Codecs}/Bytes.d.ts +7 -6
  219. package/types/Codecs/Bytes.d.ts.map +1 -0
  220. package/types/{Cbor.d.ts → Codecs/Cbor.d.ts} +77 -55
  221. package/types/Codecs/Cbor.d.ts.map +1 -0
  222. package/types/{internal → Codecs}/Flat.d.ts +2 -0
  223. package/types/Codecs/Flat.d.ts.map +1 -0
  224. package/types/Codecs/Float.d.ts.map +1 -0
  225. package/types/Codecs/LittleEndian.d.ts +18 -0
  226. package/types/Codecs/LittleEndian.d.ts.map +1 -0
  227. package/types/Codecs/Uint64.d.ts +16 -0
  228. package/types/Codecs/Uint64.d.ts.map +1 -0
  229. package/types/{internal → Codecs}/Utf8.d.ts +2 -2
  230. package/types/Codecs/Utf8.d.ts.map +1 -0
  231. package/types/Codecs/ZigZag.d.ts +3 -0
  232. package/types/Codecs/ZigZag.d.ts.map +1 -0
  233. package/types/Codecs/index.d.ts +8 -0
  234. package/types/Codecs/index.d.ts.map +1 -0
  235. package/types/Crypto/Blake2b.d.ts +16 -0
  236. package/types/Crypto/Blake2b.d.ts.map +1 -0
  237. package/types/Crypto/Curve.d.ts +161 -0
  238. package/types/Crypto/Curve.d.ts.map +1 -0
  239. package/types/Crypto/Ed25519.d.ts +155 -0
  240. package/types/Crypto/Ed25519.d.ts.map +1 -0
  241. package/types/Crypto/EdDSA.d.ts +159 -0
  242. package/types/Crypto/EdDSA.d.ts.map +1 -0
  243. package/types/Crypto/Field.d.ts +273 -0
  244. package/types/Crypto/Field.d.ts.map +1 -0
  245. package/types/Crypto/Hmac.d.ts +20 -0
  246. package/types/Crypto/Hmac.d.ts.map +1 -0
  247. package/types/Crypto/Keccak.d.ts +16 -0
  248. package/types/Crypto/Keccak.d.ts.map +1 -0
  249. package/types/Crypto/Pbkdf2.d.ts +15 -0
  250. package/types/Crypto/Pbkdf2.d.ts.map +1 -0
  251. package/types/Crypto/Sha2_256.d.ts +36 -0
  252. package/types/Crypto/Sha2_256.d.ts.map +1 -0
  253. package/types/Crypto/Sha2_512.d.ts +31 -0
  254. package/types/Crypto/Sha2_512.d.ts.map +1 -0
  255. package/types/Crypto/Sha3_256.d.ts +8 -0
  256. package/types/Crypto/Sha3_256.d.ts.map +1 -0
  257. package/types/Crypto/errors.d.ts +10 -0
  258. package/types/Crypto/errors.d.ts.map +1 -0
  259. package/types/Crypto/index.d.ts +12 -0
  260. package/types/Crypto/index.d.ts.map +1 -0
  261. package/types/index.d.ts +3 -5
  262. package/types/index.d.ts.map +1 -1
  263. package/dist/Address.js +0 -13
  264. package/dist/Address.js.map +0 -1
  265. package/dist/Bech32.js.map +0 -1
  266. package/dist/Cbor.js.map +0 -1
  267. package/dist/Ledger/Address.js.map +0 -1
  268. package/dist/Ledger/AssetClass.js.map +0 -1
  269. package/dist/Ledger/Assets.js +0 -120
  270. package/dist/Ledger/Assets.js.map +0 -1
  271. package/dist/Ledger/Credential.js +0 -17
  272. package/dist/Ledger/Credential.js.map +0 -1
  273. package/dist/Ledger/DatumHash.js +0 -21
  274. package/dist/Ledger/DatumHash.js.map +0 -1
  275. package/dist/Ledger/IsMainnet.js +0 -4
  276. package/dist/Ledger/IsMainnet.js.map +0 -1
  277. package/dist/Ledger/MintingPolicy.js +0 -45
  278. package/dist/Ledger/MintingPolicy.js.map +0 -1
  279. package/dist/Ledger/NetworkParams.js +0 -40
  280. package/dist/Ledger/NetworkParams.js.map +0 -1
  281. package/dist/Ledger/PubKeyHash.js.map +0 -1
  282. package/dist/Ledger/TxHash.js +0 -23
  283. package/dist/Ledger/TxHash.js.map +0 -1
  284. package/dist/Ledger/TxId.js +0 -23
  285. package/dist/Ledger/TxId.js.map +0 -1
  286. package/dist/Ledger/TxInput.js +0 -51
  287. package/dist/Ledger/TxInput.js.map +0 -1
  288. package/dist/Ledger/TxOutput.js +0 -118
  289. package/dist/Ledger/TxOutput.js.map +0 -1
  290. package/dist/Ledger/TxOutputDatum.js.map +0 -1
  291. package/dist/Ledger/TxOutputId.js +0 -55
  292. package/dist/Ledger/TxOutputId.js.map +0 -1
  293. package/dist/Ledger/UTxO.js +0 -43
  294. package/dist/Ledger/UTxO.js.map +0 -1
  295. package/dist/Ledger/UTxORef.js.map +0 -1
  296. package/dist/Ledger/ValidatorHash.js.map +0 -1
  297. package/dist/Ledger/index.js.map +0 -1
  298. package/dist/Network/IsMainnet.js.map +0 -1
  299. package/dist/Network/Params.js.map +0 -1
  300. package/dist/Network/UTxOsAt.js +0 -4
  301. package/dist/Network/UTxOsAt.js.map +0 -1
  302. package/dist/Network/errors.js +0 -16
  303. package/dist/Network/errors.js.map +0 -1
  304. package/dist/Network/index.js.map +0 -1
  305. package/dist/Uplc/Cek.js +0 -3
  306. package/dist/Uplc/Cek.js.map +0 -1
  307. package/dist/Uplc/Data.js.map +0 -1
  308. package/dist/Uplc/DataSchema.js +0 -118
  309. package/dist/Uplc/DataSchema.js.map +0 -1
  310. package/dist/Uplc/Primitive.js +0 -23
  311. package/dist/Uplc/Primitive.js.map +0 -1
  312. package/dist/Uplc/index.js +0 -3
  313. package/dist/Uplc/index.js.map +0 -1
  314. package/dist/internal/Base32.js.map +0 -1
  315. package/dist/internal/BigEndian.js.map +0 -1
  316. package/dist/internal/Bits.js.map +0 -1
  317. package/dist/internal/Bytes.js.map +0 -1
  318. package/dist/internal/Flat.js.map +0 -1
  319. package/dist/internal/Float.js.map +0 -1
  320. package/dist/internal/Utf8.js.map +0 -1
  321. package/tsconfig.check.tsbuildinfo +0 -1
  322. package/types/Address.d.ts +0 -5
  323. package/types/Address.d.ts.map +0 -1
  324. package/types/Bech32.d.ts.map +0 -1
  325. package/types/Cbor.d.ts.map +0 -1
  326. package/types/Ledger/Address.d.ts.map +0 -1
  327. package/types/Ledger/AssetClass.d.ts.map +0 -1
  328. package/types/Ledger/Assets.d.ts +0 -70
  329. package/types/Ledger/Assets.d.ts.map +0 -1
  330. package/types/Ledger/Credential.d.ts.map +0 -1
  331. package/types/Ledger/DatumHash.d.ts.map +0 -1
  332. package/types/Ledger/IsMainnet.d.ts +0 -6
  333. package/types/Ledger/IsMainnet.d.ts.map +0 -1
  334. package/types/Ledger/MintingPolicy.d.ts.map +0 -1
  335. package/types/Ledger/NetworkParams.d.ts +0 -40
  336. package/types/Ledger/NetworkParams.d.ts.map +0 -1
  337. package/types/Ledger/PubKeyHash.d.ts.map +0 -1
  338. package/types/Ledger/TxHash.d.ts.map +0 -1
  339. package/types/Ledger/TxId.d.ts +0 -70
  340. package/types/Ledger/TxId.d.ts.map +0 -1
  341. package/types/Ledger/TxInput.d.ts +0 -55
  342. package/types/Ledger/TxInput.d.ts.map +0 -1
  343. package/types/Ledger/TxOutput.d.ts +0 -63
  344. package/types/Ledger/TxOutput.d.ts.map +0 -1
  345. package/types/Ledger/TxOutputDatum.d.ts +0 -41
  346. package/types/Ledger/TxOutputDatum.d.ts.map +0 -1
  347. package/types/Ledger/TxOutputId.d.ts +0 -133
  348. package/types/Ledger/TxOutputId.d.ts.map +0 -1
  349. package/types/Ledger/UTxO.d.ts +0 -55
  350. package/types/Ledger/UTxO.d.ts.map +0 -1
  351. package/types/Ledger/UTxORef.d.ts +0 -133
  352. package/types/Ledger/UTxORef.d.ts.map +0 -1
  353. package/types/Ledger/ValidatorHash.d.ts.map +0 -1
  354. package/types/Ledger/index.d.ts.map +0 -1
  355. package/types/Network/IsMainnet.d.ts.map +0 -1
  356. package/types/Network/Params.d.ts.map +0 -1
  357. package/types/Network/UTxOsAt.d.ts +0 -9
  358. package/types/Network/UTxOsAt.d.ts.map +0 -1
  359. package/types/Network/errors.d.ts +0 -18
  360. package/types/Network/errors.d.ts.map +0 -1
  361. package/types/Network/index.d.ts.map +0 -1
  362. package/types/Uplc/Cek.d.ts +0 -72
  363. package/types/Uplc/Cek.d.ts.map +0 -1
  364. package/types/Uplc/Data.d.ts.map +0 -1
  365. package/types/Uplc/DataSchema.d.ts +0 -227
  366. package/types/Uplc/DataSchema.d.ts.map +0 -1
  367. package/types/Uplc/Primitive.d.ts +0 -26
  368. package/types/Uplc/Primitive.d.ts.map +0 -1
  369. package/types/Uplc/index.d.ts +0 -3
  370. package/types/Uplc/index.d.ts.map +0 -1
  371. package/types/internal/Base32.d.ts.map +0 -1
  372. package/types/internal/BigEndian.d.ts.map +0 -1
  373. package/types/internal/Bits.d.ts.map +0 -1
  374. package/types/internal/Bytes.d.ts.map +0 -1
  375. package/types/internal/Flat.d.ts.map +0 -1
  376. package/types/internal/Float.d.ts.map +0 -1
  377. package/types/internal/Utf8.d.ts.map +0 -1
  378. /package/dist/{Network → Cardano/Network}/IsMainnet.js +0 -0
  379. /package/dist/{internal → Codecs}/BigEndian.js +0 -0
  380. /package/dist/{internal → Codecs}/Bits.js +0 -0
  381. /package/dist/{internal → Codecs}/Float.js +0 -0
  382. /package/types/{Network → Cardano/Network}/IsMainnet.d.ts +0 -0
  383. /package/types/{internal → Codecs}/Base32.d.ts +0 -0
  384. /package/types/{Bech32.d.ts → Codecs/Bech32.d.ts} +0 -0
  385. /package/types/{internal → Codecs}/BigEndian.d.ts +0 -0
  386. /package/types/{internal → Codecs}/Bits.d.ts +0 -0
  387. /package/types/{internal → Codecs}/Float.d.ts +0 -0
@@ -0,0 +1,1820 @@
1
+ import { Data, Either } from "effect";
2
+ import * as Bytes from "../../Codecs/Bytes.js";
3
+ import * as Utf8 from "../../Codecs/Utf8.js";
4
+ import * as Crypto from "../../Crypto";
5
+ import * as Cost from "./Cost.js";
6
+ import { toString as dataToString, encode as encodeData } from "./Data.js";
7
+ import * as Type from "./Type.js";
8
+ import * as Value from "./Value.js";
9
+ export class WrongArgType extends Data.TaggedError("Uplc.Builtins.WrongArgType") {
10
+ constructor(argIndex, expected, actual) {
11
+ super({
12
+ message: `expected ${expected} for arg ${argIndex + 1}, got ${actual}`
13
+ });
14
+ }
15
+ }
16
+ export class DivisionByZero extends Data.TaggedError("Uplc.Builtins.DivisionByZero") {
17
+ constructor(fnName) {
18
+ super({ message: `division by 0 in ${fnName}` });
19
+ }
20
+ }
21
+ export class OutOfRange extends Data.TaggedError("Uplc.Builtins.OutOfRange") {
22
+ constructor(containerSize, index) {
23
+ super({
24
+ message: `index out of range (container has ${containerSize}, but tried to index item ${index})`
25
+ });
26
+ }
27
+ }
28
+ export class InvalidLength extends Data.TaggedError("Uplc.Builtin.InvalidLength") {
29
+ constructor(fnName, argName, expected, actual) {
30
+ super({
31
+ message: `expected arg '${argName}' of '${fnName}' to be ${expected} long, but got ${actual} long`
32
+ });
33
+ }
34
+ }
35
+ export const addIntegerV1 = {
36
+ name: "addInteger",
37
+ forceCount: 0,
38
+ nArgs: 2,
39
+ cpuModel: Cost.Linear(0, 1)(Cost.Max),
40
+ memModel: Cost.Linear(2, 3)(Cost.Max),
41
+ call: ([a, b]) => {
42
+ if (a._tag != "Const") {
43
+ return Either.left(new WrongArgType(0, "Const", a._tag));
44
+ }
45
+ if (typeof a.value != "bigint") {
46
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(a.value)));
47
+ }
48
+ if (b._tag != "Const") {
49
+ return Either.left(new WrongArgType(1, "Const", b._tag));
50
+ }
51
+ if (typeof b.value != "bigint") {
52
+ return Either.left(new WrongArgType(1, "integer", Value.describeType(b.value)));
53
+ }
54
+ return Either.right({
55
+ _tag: "Const",
56
+ value: a.value + b.value
57
+ });
58
+ }
59
+ };
60
+ export const subtractIntegerV1 = {
61
+ name: "subtractInteger",
62
+ forceCount: 0,
63
+ nArgs: 2,
64
+ cpuModel: Cost.Linear(145, 146)(Cost.Max),
65
+ memModel: Cost.Linear(147, 148)(Cost.Max),
66
+ call: ([a, b]) => {
67
+ if (a._tag != "Const") {
68
+ return Either.left(new WrongArgType(0, "Const", a._tag));
69
+ }
70
+ if (typeof a.value != "bigint") {
71
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(a.value)));
72
+ }
73
+ if (b._tag != "Const") {
74
+ return Either.left(new WrongArgType(1, "Const", b._tag));
75
+ }
76
+ if (typeof b.value != "bigint") {
77
+ return Either.left(new WrongArgType(1, "integer", Value.describeType(b.value)));
78
+ }
79
+ return Either.right({
80
+ _tag: "Const",
81
+ value: a.value - b.value
82
+ });
83
+ }
84
+ };
85
+ export const subtractIntegerV2 = {
86
+ ...subtractIntegerV1,
87
+ cpuModel: Cost.Linear(149, 150)(Cost.Max),
88
+ memModel: Cost.Linear(151, 152)(Cost.Max)
89
+ };
90
+ export const subtractIntegerV3 = {
91
+ ...subtractIntegerV1,
92
+ cpuModel: Cost.Linear(167, 168)(Cost.Max),
93
+ memModel: Cost.Linear(169, 170)(Cost.Max)
94
+ };
95
+ export const multiplyIntegerV1 = {
96
+ name: "multiplyInteger",
97
+ forceCount: 0,
98
+ nArgs: 2,
99
+ cpuModel: Cost.Linear(115, 116)(Cost.Sum),
100
+ memModel: Cost.Linear(117, 118)(Cost.Sum),
101
+ call: ([a, b]) => {
102
+ if (a._tag != "Const") {
103
+ return Either.left(new WrongArgType(0, "Const", a._tag));
104
+ }
105
+ if (typeof a.value != "bigint") {
106
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(a.value)));
107
+ }
108
+ if (b._tag != "Const") {
109
+ return Either.left(new WrongArgType(1, "Const", b._tag));
110
+ }
111
+ if (typeof b.value != "bigint") {
112
+ return Either.left(new WrongArgType(1, "integer", Value.describeType(b.value)));
113
+ }
114
+ return Either.right({
115
+ _tag: "Const",
116
+ value: a.value * b.value
117
+ });
118
+ }
119
+ };
120
+ export const multiplyIntegerV2 = {
121
+ ...multiplyIntegerV1,
122
+ cpuModel: Cost.Linear(115, 116)(Cost.Prod),
123
+ memModel: Cost.Linear(117, 118)(Cost.Sum)
124
+ };
125
+ export const multiplyIntegerV3 = {
126
+ ...multiplyIntegerV1,
127
+ cpuModel: Cost.Linear(124, 125)(Cost.Sum),
128
+ memModel: Cost.Linear(126, 127)(Cost.Sum)
129
+ };
130
+ export const divideIntegerV1 = {
131
+ name: "divideInteger",
132
+ forceCount: 0,
133
+ nArgs: 2,
134
+ cpuModel: Cost.ConstantBelowDiag(49)(Cost.Linear(50, 51)(Cost.Prod)),
135
+ memModel: Cost.AtLeast(53)(Cost.Diff),
136
+ call: ([a, b]) => {
137
+ if (a._tag != "Const") {
138
+ return Either.left(new WrongArgType(0, "Const", a._tag));
139
+ }
140
+ if (typeof a.value != "bigint") {
141
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(a.value)));
142
+ }
143
+ if (b._tag != "Const") {
144
+ return Either.left(new WrongArgType(1, "Const", b._tag));
145
+ }
146
+ if (typeof b.value != "bigint") {
147
+ return Either.left(new WrongArgType(1, "integer", Value.describeType(b.value)));
148
+ }
149
+ return evalDivide(a.value, b.value).pipe(Either.map((result) => ({ _tag: "Const", value: result })));
150
+ }
151
+ };
152
+ export function evalDivide(x, y) {
153
+ if (y === 0n) {
154
+ return Either.left(new DivisionByZero("divideInteger"));
155
+ }
156
+ // correctly truncate
157
+ return Either.right(x / y - (x % y != 0n && x < 0n != y < 0n ? 1n : 0n));
158
+ }
159
+ export const divideIntegerV3 = {
160
+ ...divideIntegerV1,
161
+ cpuModel: Cost.ConstantBelowDiag(49)(Cost.AtLeast(56)(Cost.QuadXY({ c00: 50, c01: 51, c02: 52, c10: 53, c11: 54, c20: 55 }))),
162
+ memModel: Cost.AtLeast(58)(Cost.Diff)
163
+ };
164
+ export const quotientIntegerV1 = {
165
+ name: "quotientInteger",
166
+ forceCount: 0,
167
+ nArgs: 2,
168
+ cpuModel: Cost.ConstantBelowDiag(121)(Cost.Linear(122, 123)(Cost.Prod)),
169
+ memModel: Cost.AtLeast(125)(Cost.Diff),
170
+ call: ([a, b]) => {
171
+ if (a._tag != "Const") {
172
+ return Either.left(new WrongArgType(0, "Const", a._tag));
173
+ }
174
+ if (typeof a.value != "bigint") {
175
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(a.value)));
176
+ }
177
+ if (b._tag != "Const") {
178
+ return Either.left(new WrongArgType(1, "Const", b._tag));
179
+ }
180
+ if (typeof b.value != "bigint") {
181
+ return Either.left(new WrongArgType(1, "integer", Value.describeType(b.value)));
182
+ }
183
+ return evalQuotient(a.value, b.value).pipe(Either.map((result) => ({ _tag: "Const", value: result })));
184
+ }
185
+ };
186
+ export function evalQuotient(x, y) {
187
+ if (y === 0n) {
188
+ return Either.left(new DivisionByZero("quotientInteger"));
189
+ }
190
+ return Either.right(x / y);
191
+ }
192
+ export const quotientIntegerV3 = {
193
+ ...quotientIntegerV1,
194
+ cpuModel: Cost.ConstantBelowDiag(130)(Cost.AtLeast(137)(Cost.QuadXY({
195
+ c00: 131,
196
+ c01: 132,
197
+ c02: 133,
198
+ c10: 134,
199
+ c11: 135,
200
+ c20: 136
201
+ }))),
202
+ memModel: Cost.AtLeast(139)(Cost.Diff)
203
+ };
204
+ export const remainderIntegerV1 = {
205
+ name: "remainderInteger",
206
+ forceCount: 0,
207
+ nArgs: 2,
208
+ cpuModel: Cost.ConstantBelowDiag(127)(Cost.Linear(128, 129)(Cost.Prod)),
209
+ memModel: Cost.AtLeast(131)(Cost.Diff),
210
+ call: ([a, b]) => {
211
+ if (a._tag != "Const") {
212
+ return Either.left(new WrongArgType(0, "Const", a._tag));
213
+ }
214
+ if (typeof a.value != "bigint") {
215
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(a.value)));
216
+ }
217
+ if (b._tag != "Const") {
218
+ return Either.left(new WrongArgType(1, "Const", b._tag));
219
+ }
220
+ if (typeof b.value != "bigint") {
221
+ return Either.left(new WrongArgType(1, "integer", Value.describeType(b.value)));
222
+ }
223
+ return evalRemainder(a.value, b.value).pipe(Either.map((result) => ({ _tag: "Const", value: result })));
224
+ }
225
+ };
226
+ export function evalRemainder(x, y) {
227
+ if (y === 0n) {
228
+ return Either.left(new DivisionByZero("remainderInteger"));
229
+ }
230
+ return Either.right(x % y);
231
+ }
232
+ export const remainderIntegerV3 = {
233
+ ...remainderIntegerV1,
234
+ cpuModel: Cost.ConstantBelowDiag(141)(Cost.AtLeast(148)(Cost.QuadXY({
235
+ c00: 142,
236
+ c01: 143,
237
+ c02: 144,
238
+ c10: 145,
239
+ c11: 146,
240
+ c20: 147
241
+ }))),
242
+ memModel: Cost.Linear(149, 150)(Cost.Second)
243
+ };
244
+ export const modIntegerV1 = {
245
+ name: "modInteger",
246
+ forceCount: 0,
247
+ nArgs: 2,
248
+ cpuModel: Cost.ConstantBelowDiag(109)(Cost.Linear(110, 111)(Cost.Prod)),
249
+ memModel: Cost.AtLeast(113)(Cost.Diff),
250
+ call: ([a, b]) => {
251
+ if (a._tag != "Const") {
252
+ return Either.left(new WrongArgType(0, "Const", a._tag));
253
+ }
254
+ if (typeof a.value != "bigint") {
255
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(a.value)));
256
+ }
257
+ if (b._tag != "Const") {
258
+ return Either.left(new WrongArgType(1, "Const", b._tag));
259
+ }
260
+ if (typeof b.value != "bigint") {
261
+ return Either.left(new WrongArgType(1, "integer", Value.describeType(b.value)));
262
+ }
263
+ return evalMod(a.value, b.value).pipe(Either.map((result) => ({ _tag: "Const", value: result })));
264
+ }
265
+ };
266
+ export function evalMod(x, y) {
267
+ if (y === 0n) {
268
+ return Either.left(new DivisionByZero("modInteger"));
269
+ }
270
+ const m = x % y;
271
+ if (y > 0 && m < 0) {
272
+ return Either.right(m + y);
273
+ }
274
+ else if (y < 0 && m > 0) {
275
+ return Either.right(m + y);
276
+ }
277
+ else {
278
+ return Either.right(m);
279
+ }
280
+ }
281
+ export const modIntegerV3 = {
282
+ ...modIntegerV1,
283
+ cpuModel: Cost.ConstantBelowDiag(114)(Cost.AtLeast(121)(Cost.QuadXY({
284
+ c00: 115,
285
+ c01: 116,
286
+ c02: 117,
287
+ c10: 118,
288
+ c11: 119,
289
+ c20: 120
290
+ }))),
291
+ memModel: Cost.Linear(122, 123)(Cost.Second)
292
+ };
293
+ export const equalsIntegerV1 = {
294
+ name: "equalsInteger",
295
+ forceCount: 0,
296
+ nArgs: 2,
297
+ cpuModel: Cost.Linear(66, 67)(Cost.Min),
298
+ memModel: Cost.Constant(68),
299
+ call: ([a, b]) => {
300
+ if (a._tag != "Const") {
301
+ return Either.left(new WrongArgType(0, "Const", a._tag));
302
+ }
303
+ if (typeof a.value != "bigint") {
304
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(a.value)));
305
+ }
306
+ if (b._tag != "Const") {
307
+ return Either.left(new WrongArgType(1, "Const", b._tag));
308
+ }
309
+ if (typeof b.value != "bigint") {
310
+ return Either.left(new WrongArgType(1, "integer", Value.describeType(b.value)));
311
+ }
312
+ return Either.right({
313
+ _tag: "Const",
314
+ value: a.value === b.value
315
+ });
316
+ }
317
+ };
318
+ export const equalsIntegerV3 = {
319
+ ...equalsIntegerV1,
320
+ cpuModel: Cost.Linear(71, 72)(Cost.Min),
321
+ memModel: Cost.Constant(73)
322
+ };
323
+ export const lessThanIntegerV1 = {
324
+ name: "lessThanInteger",
325
+ forceCount: 0,
326
+ nArgs: 2,
327
+ cpuModel: Cost.Linear(94, 95)(Cost.Min),
328
+ memModel: Cost.Constant(96),
329
+ call: ([a, b]) => {
330
+ if (a._tag != "Const") {
331
+ return Either.left(new WrongArgType(0, "Const", a._tag));
332
+ }
333
+ if (typeof a.value != "bigint") {
334
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(a.value)));
335
+ }
336
+ if (b._tag != "Const") {
337
+ return Either.left(new WrongArgType(1, "Const", b._tag));
338
+ }
339
+ if (typeof b.value != "bigint") {
340
+ return Either.left(new WrongArgType(1, "integer", Value.describeType(b.value)));
341
+ }
342
+ return Either.right({
343
+ _tag: "Const",
344
+ value: a.value < b.value
345
+ });
346
+ }
347
+ };
348
+ export const lessThanIntegerV3 = {
349
+ ...lessThanIntegerV1,
350
+ cpuModel: Cost.Linear(99, 100)(Cost.Min),
351
+ memModel: Cost.Constant(101)
352
+ };
353
+ export const lessThanEqualsIntegerV1 = {
354
+ name: "lessThanEqualsInteger",
355
+ forceCount: 0,
356
+ nArgs: 2,
357
+ cpuModel: Cost.Linear(91, 92)(Cost.Min),
358
+ memModel: Cost.Constant(93),
359
+ call: ([a, b]) => {
360
+ if (a._tag != "Const") {
361
+ return Either.left(new WrongArgType(0, "Const", a._tag));
362
+ }
363
+ if (typeof a.value != "bigint") {
364
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(a.value)));
365
+ }
366
+ if (b._tag != "Const") {
367
+ return Either.left(new WrongArgType(1, "Const", b._tag));
368
+ }
369
+ if (typeof b.value != "bigint") {
370
+ return Either.left(new WrongArgType(1, "integer", Value.describeType(b.value)));
371
+ }
372
+ return Either.right({
373
+ _tag: "Const",
374
+ value: a.value <= b.value
375
+ });
376
+ }
377
+ };
378
+ export const lessThanEqualsIntegerV3 = {
379
+ ...lessThanEqualsIntegerV1,
380
+ cpuModel: Cost.Linear(96, 97)(Cost.Min),
381
+ memModel: Cost.Constant(98)
382
+ };
383
+ export const appendByteStringV1 = {
384
+ name: "appendByteString",
385
+ forceCount: 0,
386
+ nArgs: 2,
387
+ cpuModel: Cost.Linear(4, 5)(Cost.Sum),
388
+ memModel: Cost.Linear(6, 7)(Cost.Sum),
389
+ call: ([a, b]) => {
390
+ if (a._tag != "Const") {
391
+ return Either.left(new WrongArgType(0, "Const", a._tag));
392
+ }
393
+ if (!(a.value instanceof Uint8Array)) {
394
+ return Either.left(new WrongArgType(0, "bytes", Value.describeType(a.value)));
395
+ }
396
+ if (b._tag != "Const") {
397
+ return Either.left(new WrongArgType(1, "Const", b._tag));
398
+ }
399
+ if (!(b.value instanceof Uint8Array)) {
400
+ return Either.left(new WrongArgType(1, "bytes", Value.describeType(b.value)));
401
+ }
402
+ return Either.right({
403
+ _tag: "Const",
404
+ value: Bytes.concat(a.value, b.value)
405
+ });
406
+ }
407
+ };
408
+ export const consByteStringV1 = {
409
+ name: "consByteString",
410
+ forceCount: 0,
411
+ nArgs: 2,
412
+ cpuModel: Cost.Linear(39, 40)(Cost.Second),
413
+ memModel: Cost.Linear(41, 42)(Cost.Sum),
414
+ call: ([a, b]) => {
415
+ if (a._tag != "Const") {
416
+ return Either.left(new WrongArgType(0, "Const", a._tag));
417
+ }
418
+ if (typeof a.value != "bigint") {
419
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(a.value)));
420
+ }
421
+ if (b._tag != "Const") {
422
+ return Either.left(new WrongArgType(1, "Const", b._tag));
423
+ }
424
+ if (!(b.value instanceof Uint8Array)) {
425
+ return Either.left(new WrongArgType(1, "bytes", Value.describeType(b.value)));
426
+ }
427
+ return Either.right({
428
+ _tag: "Const",
429
+ value: Bytes.concat([Number(a.value % 256n)], b.value)
430
+ });
431
+ }
432
+ };
433
+ export const sliceByteStringV1 = {
434
+ name: "sliceByteString",
435
+ forceCount: 0,
436
+ nArgs: 3,
437
+ cpuModel: Cost.Linear(139, 140)(Cost.Third),
438
+ memModel: Cost.Linear(141, 142)(Cost.Third),
439
+ call: ([a, b, c]) => {
440
+ if (a._tag != "Const") {
441
+ return Either.left(new WrongArgType(0, "Const", a._tag));
442
+ }
443
+ if (typeof a.value != "bigint") {
444
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(a.value)));
445
+ }
446
+ if (b._tag != "Const") {
447
+ return Either.left(new WrongArgType(1, "Const", b._tag));
448
+ }
449
+ if (typeof b.value != "bigint") {
450
+ return Either.left(new WrongArgType(1, "integer", Value.describeType(b.value)));
451
+ }
452
+ if (c._tag != "Const") {
453
+ return Either.left(new WrongArgType(2, "Const", c._tag));
454
+ }
455
+ if (!(c.value instanceof Uint8Array)) {
456
+ return Either.left(new WrongArgType(2, "bytes", Value.describeType(c.value)));
457
+ }
458
+ const bytes = c.value;
459
+ const start = Math.max(Number(a.value), 0);
460
+ const end = Math.min(start + Number(b.value) - 1, bytes.length - 1);
461
+ const res = end < start ? new Uint8Array([]) : bytes.slice(start, end + 1);
462
+ return Either.right({
463
+ _tag: "Const",
464
+ value: res
465
+ });
466
+ }
467
+ };
468
+ export const sliceByteStringV2 = {
469
+ ...sliceByteStringV1,
470
+ cpuModel: Cost.Linear(143, 144)(Cost.Third),
471
+ memModel: Cost.Linear(145, 146)(Cost.Third)
472
+ };
473
+ export const sliceByteStringV3 = {
474
+ ...sliceByteStringV1,
475
+ cpuModel: Cost.Linear(161, 162)(Cost.Third),
476
+ memModel: Cost.Linear(163, 164)(Cost.Third)
477
+ };
478
+ export const lengthOfByteStringV1 = {
479
+ name: "lengthOfByteString",
480
+ forceCount: 0,
481
+ nArgs: 1,
482
+ cpuModel: Cost.Constant(83),
483
+ memModel: Cost.Constant(84),
484
+ call: ([a]) => {
485
+ if (a._tag != "Const") {
486
+ return Either.left(new WrongArgType(0, "Const", a._tag));
487
+ }
488
+ if (!(a.value instanceof Uint8Array)) {
489
+ return Either.left(new WrongArgType(0, "bytes", Value.describeType(a.value)));
490
+ }
491
+ return Either.right({
492
+ _tag: "Const",
493
+ value: BigInt(a.value.length)
494
+ });
495
+ }
496
+ };
497
+ export const lengthOfByteStringV3 = {
498
+ ...lengthOfByteStringV1,
499
+ cpuModel: Cost.Constant(88),
500
+ memModel: Cost.Constant(89)
501
+ };
502
+ export const indexByteStringV1 = {
503
+ name: "indexByteString",
504
+ forceCount: 0,
505
+ nArgs: 2,
506
+ cpuModel: Cost.Constant(81),
507
+ memModel: Cost.Constant(82),
508
+ call: ([a, b]) => {
509
+ if (a._tag != "Const") {
510
+ return Either.left(new WrongArgType(0, "Const", a._tag));
511
+ }
512
+ if (!(a.value instanceof Uint8Array)) {
513
+ return Either.left(new WrongArgType(0, "bytes", Value.describeType(a.value)));
514
+ }
515
+ if (b._tag != "Const") {
516
+ return Either.left(new WrongArgType(1, "Const", b._tag));
517
+ }
518
+ if (typeof b.value != "bigint") {
519
+ return Either.left(new WrongArgType(1, "integer", Value.describeType(b.value)));
520
+ }
521
+ const bytes = a.value;
522
+ const i = Number(b.value);
523
+ if (i < 0 || i >= bytes.length) {
524
+ return Either.left(new OutOfRange(bytes.length, i));
525
+ }
526
+ return Either.right({
527
+ _tag: "Const",
528
+ value: BigInt(bytes[i])
529
+ });
530
+ }
531
+ };
532
+ export const indexByteStringV3 = {
533
+ ...indexByteStringV1,
534
+ cpuModel: Cost.Constant(86),
535
+ memModel: Cost.Constant(87)
536
+ };
537
+ export const equalsByteStringV1 = {
538
+ name: "equalsByteString",
539
+ forceCount: 0,
540
+ nArgs: 2,
541
+ cpuModel: Cost.ConstantOffDiag(59)(Cost.Linear(60, 61)(Cost.First)),
542
+ memModel: Cost.Constant(62),
543
+ call: ([a, b]) => {
544
+ if (a._tag != "Const") {
545
+ return Either.left(new WrongArgType(0, "Const", a._tag));
546
+ }
547
+ if (!(a.value instanceof Uint8Array)) {
548
+ return Either.left(new WrongArgType(0, "bytes", Value.describeType(a.value)));
549
+ }
550
+ if (b._tag != "Const") {
551
+ return Either.left(new WrongArgType(1, "Const", b._tag));
552
+ }
553
+ if (!(b.value instanceof Uint8Array)) {
554
+ return Either.left(new WrongArgType(1, "bytes", Value.describeType(b.value)));
555
+ }
556
+ return Either.right({
557
+ _tag: "Const",
558
+ value: Bytes.equals(a.value, b.value)
559
+ });
560
+ }
561
+ };
562
+ export const equalsByteStringV3 = {
563
+ ...equalsByteStringV1,
564
+ cpuModel: Cost.ConstantOffDiag(64)(Cost.Linear(65, 66)(Cost.First)),
565
+ memModel: Cost.Constant(67)
566
+ };
567
+ export const lessThanByteStringV1 = {
568
+ name: "lessThanByteString",
569
+ forceCount: 0,
570
+ nArgs: 2,
571
+ cpuModel: Cost.Linear(85, 86)(Cost.Min),
572
+ memModel: Cost.Constant(87),
573
+ call: ([a, b]) => {
574
+ if (a._tag != "Const") {
575
+ return Either.left(new WrongArgType(0, "Const", a._tag));
576
+ }
577
+ if (!(a.value instanceof Uint8Array)) {
578
+ return Either.left(new WrongArgType(0, "bytes", Value.describeType(a.value)));
579
+ }
580
+ if (b._tag != "Const") {
581
+ return Either.left(new WrongArgType(1, "Const", b._tag));
582
+ }
583
+ if (!(b.value instanceof Uint8Array)) {
584
+ return Either.left(new WrongArgType(1, "bytes", Value.describeType(b.value)));
585
+ }
586
+ return Either.right({
587
+ _tag: "Const",
588
+ value: Bytes.compare(a.value, b.value) == -1
589
+ });
590
+ }
591
+ };
592
+ export const lessThanByteStringV3 = {
593
+ ...lessThanByteStringV1,
594
+ cpuModel: Cost.Linear(90, 91)(Cost.Min),
595
+ memModel: Cost.Constant(92)
596
+ };
597
+ export const lessThanEqualsByteStringV1 = {
598
+ name: "lessThanEqualsByteString",
599
+ forceCount: 0,
600
+ nArgs: 2,
601
+ cpuModel: Cost.Linear(88, 89)(Cost.Min),
602
+ memModel: Cost.Constant(90),
603
+ call: ([a, b]) => {
604
+ if (a._tag != "Const") {
605
+ return Either.left(new WrongArgType(0, "Const", a._tag));
606
+ }
607
+ if (!(a.value instanceof Uint8Array)) {
608
+ return Either.left(new WrongArgType(0, "bytes", Value.describeType(a.value)));
609
+ }
610
+ if (b._tag != "Const") {
611
+ return Either.left(new WrongArgType(1, "Const", b._tag));
612
+ }
613
+ if (!(b.value instanceof Uint8Array)) {
614
+ return Either.left(new WrongArgType(1, "bytes", Value.describeType(b.value)));
615
+ }
616
+ return Either.right({
617
+ _tag: "Const",
618
+ value: Bytes.compare(a.value, b.value) <= 0
619
+ });
620
+ }
621
+ };
622
+ export const lessThanEqualsByteStringV3 = {
623
+ ...lessThanEqualsByteStringV1,
624
+ cpuModel: Cost.Linear(90, 91)(Cost.Min),
625
+ memModel: Cost.Constant(92)
626
+ };
627
+ export const sha2_256V1 = {
628
+ name: "sha2_256",
629
+ forceCount: 0,
630
+ nArgs: 1,
631
+ cpuModel: Cost.Linear(133, 134)(Cost.First),
632
+ memModel: Cost.Constant(135),
633
+ call: ([a]) => {
634
+ if (a._tag != "Const") {
635
+ return Either.left(new WrongArgType(0, "Const", a._tag));
636
+ }
637
+ if (!(a.value instanceof Uint8Array)) {
638
+ return Either.left(new WrongArgType(0, "bytes", Value.describeType(a.value)));
639
+ }
640
+ return Either.right({
641
+ _tag: "Const",
642
+ value: Crypto.Sha2_256.hashSync(a.value)
643
+ });
644
+ }
645
+ };
646
+ export const sha2_256V2 = {
647
+ ...sha2_256V1,
648
+ cpuModel: Cost.Linear(137, 138)(Cost.First),
649
+ memModel: Cost.Constant(139)
650
+ };
651
+ export const sha2_256V3 = {
652
+ ...sha2_256V1,
653
+ cpuModel: Cost.Linear(155, 156)(Cost.First),
654
+ memModel: Cost.Constant(157)
655
+ };
656
+ export const sha3_256V1 = {
657
+ name: "sha3_256",
658
+ forceCount: 0,
659
+ nArgs: 1,
660
+ cpuModel: Cost.Linear(136, 137)(Cost.First),
661
+ memModel: Cost.Constant(138),
662
+ call: ([a]) => {
663
+ if (a._tag != "Const") {
664
+ return Either.left(new WrongArgType(0, "Const", a._tag));
665
+ }
666
+ if (!(a.value instanceof Uint8Array)) {
667
+ return Either.left(new WrongArgType(0, "bytes", Value.describeType(a.value)));
668
+ }
669
+ return Either.right({
670
+ _tag: "Const",
671
+ value: Crypto.Sha3_256.hashSync(a.value)
672
+ });
673
+ }
674
+ };
675
+ export const sha3_256V2 = {
676
+ ...sha3_256V1,
677
+ cpuModel: Cost.Linear(140, 141)(Cost.First),
678
+ memModel: Cost.Constant(142)
679
+ };
680
+ export const sha3_256V3 = {
681
+ ...sha3_256V1,
682
+ cpuModel: Cost.Linear(158, 159)(Cost.First),
683
+ memModel: Cost.Constant(160)
684
+ };
685
+ export const blake2b_256V1 = {
686
+ name: "blake2b_256",
687
+ forceCount: 0,
688
+ nArgs: 1,
689
+ cpuModel: Cost.Linear(14, 15)(Cost.First),
690
+ memModel: Cost.Constant(16),
691
+ call: ([a]) => {
692
+ if (a._tag != "Const") {
693
+ return Either.left(new WrongArgType(0, "Const", a._tag));
694
+ }
695
+ if (!(a.value instanceof Uint8Array)) {
696
+ return Either.left(new WrongArgType(0, "bytes", Value.describeType(a.value)));
697
+ }
698
+ return Either.right({
699
+ _tag: "Const",
700
+ value: Crypto.Blake2b.hashSync(a.value)
701
+ });
702
+ }
703
+ };
704
+ export const verifyEd25519SignatureV1 = {
705
+ name: "verifyEd25519Signature",
706
+ forceCount: 0,
707
+ nArgs: 3,
708
+ cpuModel: Cost.Linear(163, 164)(Cost.Third),
709
+ memModel: Cost.Constant(165),
710
+ call: ([pk, message, signature]) => {
711
+ if (pk._tag != "Const") {
712
+ return Either.left(new WrongArgType(0, "Const", pk._tag));
713
+ }
714
+ if (!(pk.value instanceof Uint8Array)) {
715
+ return Either.left(new WrongArgType(0, "bytes", Value.describeType(pk.value)));
716
+ }
717
+ if (pk.value.length != 32) {
718
+ return Either.left(new InvalidLength("verifyEd25519Signature", "publicKey", 32, pk.value.length));
719
+ }
720
+ if (message._tag != "Const") {
721
+ return Either.left(new WrongArgType(1, "Const", message._tag));
722
+ }
723
+ if (!(message.value instanceof Uint8Array)) {
724
+ return Either.left(new WrongArgType(1, "bytes", Value.describeType(message.value)));
725
+ }
726
+ if (signature._tag != "Const") {
727
+ return Either.left(new WrongArgType(1, "Const", signature._tag));
728
+ }
729
+ if (!(signature.value instanceof Uint8Array)) {
730
+ return Either.left(new WrongArgType(1, "bytes", Value.describeType(signature.value)));
731
+ }
732
+ if (signature.value.length != 64) {
733
+ return Either.left(new InvalidLength("verifyEd25519Signature", "signature", 64, pk.value.length));
734
+ }
735
+ // length has been validated above
736
+ const b = Either.getOrThrow(Crypto.Ed25519.verify(signature.value, message.value, pk.value));
737
+ return Either.right({
738
+ _tag: "Const",
739
+ value: b
740
+ });
741
+ }
742
+ };
743
+ export const verifyEd25519SignatureV2 = {
744
+ ...verifyEd25519SignatureV1,
745
+ cpuModel: Cost.Linear(169, 170)(Cost.Second),
746
+ memModel: Cost.Constant(171)
747
+ };
748
+ export const verifyEd25519SignatureV3 = {
749
+ ...verifyEd25519SignatureV1,
750
+ cpuModel: Cost.Linear(187, 188)(Cost.Third),
751
+ memModel: Cost.Constant(189)
752
+ };
753
+ export const appendStringV1 = {
754
+ name: "appendString",
755
+ forceCount: 0,
756
+ nArgs: 2,
757
+ cpuModel: Cost.Linear(8, 9)(Cost.Sum),
758
+ memModel: Cost.Linear(10, 11)(Cost.Sum),
759
+ call: ([a, b]) => {
760
+ if (a._tag != "Const") {
761
+ return Either.left(new WrongArgType(0, "Const", a._tag));
762
+ }
763
+ if (typeof a.value != "string") {
764
+ return Either.left(new WrongArgType(0, "string", Value.describeType(a.value)));
765
+ }
766
+ if (b._tag != "Const") {
767
+ return Either.left(new WrongArgType(1, "Const", b._tag));
768
+ }
769
+ if (typeof b.value != "string") {
770
+ return Either.left(new WrongArgType(1, "string", Value.describeType(b.value)));
771
+ }
772
+ return Either.right({
773
+ _tag: "Const",
774
+ value: a.value + b.value
775
+ });
776
+ }
777
+ };
778
+ export const equalsStringV1 = {
779
+ name: "equalsString",
780
+ forceCount: 0,
781
+ nArgs: 2,
782
+ cpuModel: Cost.ConstantOffDiag(69)(Cost.Linear(70, 71)(Cost.First)),
783
+ memModel: Cost.Constant(72),
784
+ call: ([a, b]) => {
785
+ if (a._tag != "Const") {
786
+ return Either.left(new WrongArgType(0, "Const", a._tag));
787
+ }
788
+ if (typeof a.value != "string") {
789
+ return Either.left(new WrongArgType(0, "string", Value.describeType(a.value)));
790
+ }
791
+ if (b._tag != "Const") {
792
+ return Either.left(new WrongArgType(1, "Const", b._tag));
793
+ }
794
+ if (typeof b.value != "string") {
795
+ return Either.left(new WrongArgType(1, "string", Value.describeType(b.value)));
796
+ }
797
+ return Either.right({
798
+ _tag: "Const",
799
+ value: a.value === b.value
800
+ });
801
+ }
802
+ };
803
+ export const equalsStringV3 = {
804
+ ...equalsStringV1,
805
+ cpuModel: Cost.ConstantOffDiag(74)(Cost.Linear(75, 76)(Cost.First)),
806
+ memModel: Cost.Constant(77)
807
+ };
808
+ export const encodeUtf8V1 = {
809
+ name: "encodeUtf8",
810
+ forceCount: 0,
811
+ nArgs: 1,
812
+ cpuModel: Cost.Linear(55, 56)(Cost.First),
813
+ memModel: Cost.Linear(57, 58)(Cost.First),
814
+ call: ([a]) => {
815
+ if (a._tag != "Const") {
816
+ return Either.left(new WrongArgType(0, "Const", a._tag));
817
+ }
818
+ if (typeof a.value != "string") {
819
+ return Either.left(new WrongArgType(0, "string", Value.describeType(a.value)));
820
+ }
821
+ return Either.right({
822
+ _tag: "Const",
823
+ value: Utf8.encode(a.value)
824
+ });
825
+ }
826
+ };
827
+ export const encodeUtf8V3 = {
828
+ ...encodeUtf8V1,
829
+ cpuModel: Cost.Linear(60, 61)(Cost.First),
830
+ memModel: Cost.Linear(62, 63)(Cost.First)
831
+ };
832
+ export const decodeUtf8V1 = {
833
+ name: "decodeUtf8",
834
+ forceCount: 0,
835
+ nArgs: 1,
836
+ cpuModel: Cost.Linear(45, 46)(Cost.First),
837
+ memModel: Cost.Linear(47, 48)(Cost.First),
838
+ call: ([a]) => {
839
+ if (a._tag != "Const") {
840
+ return Either.left(new WrongArgType(0, "Const", a._tag));
841
+ }
842
+ if (!(a.value instanceof Uint8Array)) {
843
+ return Either.left(new WrongArgType(0, "bytes", Value.describeType(a.value)));
844
+ }
845
+ return Utf8.decode(a.value).pipe(Either.map((s) => ({ _tag: "Const", value: s })));
846
+ }
847
+ };
848
+ export const ifThenElseV1 = {
849
+ name: "ifThenElse",
850
+ forceCount: 1,
851
+ nArgs: 3,
852
+ cpuModel: Cost.Constant(79),
853
+ memModel: Cost.Constant(80),
854
+ call: ([cond, a, b]) => {
855
+ if (cond._tag != "Const") {
856
+ return Either.left(new WrongArgType(0, "Const", cond._tag));
857
+ }
858
+ if (typeof cond.value != "boolean") {
859
+ return Either.left(new WrongArgType(0, "bool", Value.describeType(cond.value)));
860
+ }
861
+ return Either.right(cond.value ? a : b);
862
+ }
863
+ };
864
+ export const ifThenElseV3 = {
865
+ ...ifThenElseV1,
866
+ cpuModel: Cost.Constant(84),
867
+ memModel: Cost.Constant(85)
868
+ };
869
+ export const chooseUnitV1 = {
870
+ name: "chooseUnit",
871
+ forceCount: 1,
872
+ nArgs: 2,
873
+ cpuModel: Cost.Constant(37),
874
+ memModel: Cost.Constant(38),
875
+ call: ([a, b]) => {
876
+ if (a._tag != "Const") {
877
+ return Either.left(new WrongArgType(0, "Const", a._tag));
878
+ }
879
+ if (a.value !== null) {
880
+ return Either.left(new WrongArgType(0, "unit", Value.describeType(a.value)));
881
+ }
882
+ return Either.right(b);
883
+ }
884
+ };
885
+ export const traceV1 = {
886
+ name: "trace",
887
+ forceCount: 1,
888
+ nArgs: 2,
889
+ cpuModel: Cost.Constant(151),
890
+ memModel: Cost.Constant(152),
891
+ call: ([message, after], ctx) => {
892
+ if (message._tag != "Const") {
893
+ return Either.left(new WrongArgType(0, "Const", message._tag));
894
+ }
895
+ if (typeof message.value != "string") {
896
+ return Either.left(new WrongArgType(0, "string", Value.describeType(message.value)));
897
+ }
898
+ ctx.print(message.value);
899
+ return Either.right(after);
900
+ }
901
+ };
902
+ export const traceV2 = {
903
+ ...traceV1,
904
+ cpuModel: Cost.Constant(155),
905
+ memModel: Cost.Constant(156)
906
+ };
907
+ export const traceV3 = {
908
+ ...traceV1,
909
+ cpuModel: Cost.Constant(173),
910
+ memModel: Cost.Constant(174)
911
+ };
912
+ export const fstPairV1 = {
913
+ name: "fstPair",
914
+ forceCount: 2,
915
+ nArgs: 1,
916
+ cpuModel: Cost.Constant(73),
917
+ memModel: Cost.Constant(74),
918
+ call: ([a]) => {
919
+ if (a._tag != "Const") {
920
+ return Either.left(new WrongArgType(0, "Const", a._tag));
921
+ }
922
+ if (!(typeof a.value == "object" && a.value != null && "first" in a.value)) {
923
+ return Either.left(new WrongArgType(0, "pair", Value.describeType(a.value)));
924
+ }
925
+ return Either.right({
926
+ _tag: "Const",
927
+ value: a.value.first
928
+ });
929
+ }
930
+ };
931
+ export const fstPairV3 = {
932
+ ...fstPairV1,
933
+ cpuModel: Cost.Constant(78),
934
+ memModel: Cost.Constant(79)
935
+ };
936
+ export const sndPairV1 = {
937
+ name: "sndPair",
938
+ forceCount: 2,
939
+ nArgs: 1,
940
+ cpuModel: Cost.Constant(143),
941
+ memModel: Cost.Constant(144),
942
+ call: ([a]) => {
943
+ if (a._tag != "Const") {
944
+ return Either.left(new WrongArgType(0, "Const", a._tag));
945
+ }
946
+ if (!(typeof a.value == "object" && a.value != null && "first" in a.value)) {
947
+ return Either.left(new WrongArgType(0, "pair", Value.describeType(a.value)));
948
+ }
949
+ return Either.right({
950
+ _tag: "Const",
951
+ value: a.value.second
952
+ });
953
+ }
954
+ };
955
+ export const sndPairV2 = {
956
+ ...sndPairV1,
957
+ cpuModel: Cost.Constant(147),
958
+ memModel: Cost.Constant(148)
959
+ };
960
+ export const sndPairV3 = {
961
+ ...sndPairV1,
962
+ cpuModel: Cost.Constant(165),
963
+ memModel: Cost.Constant(166)
964
+ };
965
+ export const chooseListV1 = {
966
+ name: "chooseList",
967
+ forceCount: 2,
968
+ nArgs: 3,
969
+ cpuModel: Cost.Constant(35),
970
+ memModel: Cost.Constant(36),
971
+ call: ([lst, a, b]) => {
972
+ if (lst._tag != "Const") {
973
+ return Either.left(new WrongArgType(0, "Const", lst._tag));
974
+ }
975
+ if (!(typeof lst.value == "object" &&
976
+ lst.value != null &&
977
+ "items" in lst.value)) {
978
+ return Either.left(new WrongArgType(0, "list", Value.describeType(lst.value)));
979
+ }
980
+ return Either.right(lst.value.items.length == 0 ? a : b);
981
+ }
982
+ };
983
+ export const mkConsV1 = {
984
+ name: "mkCons",
985
+ forceCount: 1,
986
+ nArgs: 2,
987
+ cpuModel: Cost.Constant(101),
988
+ memModel: Cost.Constant(102),
989
+ call: ([item, list]) => {
990
+ if (list._tag != "Const") {
991
+ return Either.left(new WrongArgType(0, "Const", list._tag));
992
+ }
993
+ if (!(typeof list.value == "object" &&
994
+ list.value != null &&
995
+ "items" in list.value)) {
996
+ return Either.left(new WrongArgType(0, "list", Value.describeType(list.value)));
997
+ }
998
+ if (item._tag != "Const") {
999
+ return Either.left(new WrongArgType(1, "Const", item._tag));
1000
+ }
1001
+ if (Value.toType(item.value) != list.value.itemType) {
1002
+ return Either.left(new WrongArgType(1, Value.describeType(list.value.itemType), Value.describeType(item.value)));
1003
+ }
1004
+ return Either.right({
1005
+ _tag: "Const",
1006
+ value: {
1007
+ itemType: list.value.itemType,
1008
+ items: [item.value].concat(list.value.items)
1009
+ }
1010
+ });
1011
+ }
1012
+ };
1013
+ export const mkConsV3 = {
1014
+ ...mkConsV1,
1015
+ cpuModel: Cost.Constant(106),
1016
+ memModel: Cost.Constant(107)
1017
+ };
1018
+ export const headListV1 = {
1019
+ name: "headList",
1020
+ forceCount: 1,
1021
+ nArgs: 1,
1022
+ cpuModel: Cost.Constant(75),
1023
+ memModel: Cost.Constant(76),
1024
+ call: ([list]) => {
1025
+ if (list._tag != "Const") {
1026
+ return Either.left(new WrongArgType(0, "Const", list._tag));
1027
+ }
1028
+ if (!(typeof list.value == "object" &&
1029
+ list.value != null &&
1030
+ "items" in list.value)) {
1031
+ return Either.left(new WrongArgType(0, "list", Value.describeType(list.value)));
1032
+ }
1033
+ if (list.value.items.length == 0) {
1034
+ return Either.left(new OutOfRange(0, 0));
1035
+ }
1036
+ return Either.right({
1037
+ _tag: "Const",
1038
+ value: list.value.items[0]
1039
+ });
1040
+ }
1041
+ };
1042
+ export const headListV3 = {
1043
+ ...headListV1,
1044
+ cpuModel: Cost.Constant(80),
1045
+ memModel: Cost.Constant(81)
1046
+ };
1047
+ export const tailListV1 = {
1048
+ name: "tailList",
1049
+ forceCount: 1,
1050
+ nArgs: 1,
1051
+ cpuModel: Cost.Constant(149),
1052
+ memModel: Cost.Constant(150),
1053
+ call: ([list]) => {
1054
+ if (list._tag != "Const") {
1055
+ return Either.left(new WrongArgType(0, "Const", list._tag));
1056
+ }
1057
+ if (!(typeof list.value == "object" &&
1058
+ list.value != null &&
1059
+ "items" in list.value)) {
1060
+ return Either.left(new WrongArgType(0, "list", Value.describeType(list.value)));
1061
+ }
1062
+ if (list.value.items.length == 0) {
1063
+ return Either.left(new OutOfRange(0, 0));
1064
+ }
1065
+ return Either.right({
1066
+ _tag: "Const",
1067
+ value: {
1068
+ itemType: list.value.itemType,
1069
+ items: list.value.items.slice(1)
1070
+ }
1071
+ });
1072
+ }
1073
+ };
1074
+ export const tailListV2 = {
1075
+ ...tailListV1,
1076
+ cpuModel: Cost.Constant(153),
1077
+ memModel: Cost.Constant(154)
1078
+ };
1079
+ export const tailListV3 = {
1080
+ ...tailListV1,
1081
+ cpuModel: Cost.Constant(171),
1082
+ memModel: Cost.Constant(172)
1083
+ };
1084
+ export const nullListV1 = {
1085
+ name: "nullList",
1086
+ forceCount: 1,
1087
+ nArgs: 1,
1088
+ cpuModel: Cost.Constant(119),
1089
+ memModel: Cost.Constant(120),
1090
+ call: ([list]) => {
1091
+ if (list._tag != "Const") {
1092
+ return Either.left(new WrongArgType(0, "Const", list._tag));
1093
+ }
1094
+ if (!(typeof list.value == "object" &&
1095
+ list.value != null &&
1096
+ "items" in list.value)) {
1097
+ return Either.left(new WrongArgType(0, "list", Value.describeType(list.value)));
1098
+ }
1099
+ return Either.right({
1100
+ _tag: "Const",
1101
+ value: list.value.items.length == 0
1102
+ });
1103
+ }
1104
+ };
1105
+ export const nullListV3 = {
1106
+ ...nullListV1,
1107
+ cpuModel: Cost.Constant(128),
1108
+ memModel: Cost.Constant(129)
1109
+ };
1110
+ export const chooseDataV1 = {
1111
+ name: "chooseData",
1112
+ forceCount: 1,
1113
+ nArgs: 6,
1114
+ cpuModel: Cost.Constant(33),
1115
+ memModel: Cost.Constant(34),
1116
+ call: ([cond, constrCase, mapCase, listCase, intCase, bytesCase]) => {
1117
+ if (cond._tag != "Const") {
1118
+ return Either.left(new WrongArgType(0, "Const", cond._tag));
1119
+ }
1120
+ if (!(typeof cond.value == "object" &&
1121
+ cond.value != null &&
1122
+ "data" in cond.value)) {
1123
+ return Either.left(new WrongArgType(0, "data", Value.describeType(cond.value)));
1124
+ }
1125
+ if ("fields" in cond.value.data) {
1126
+ return Either.right(constrCase);
1127
+ }
1128
+ else if ("map" in cond.value.data) {
1129
+ return Either.right(mapCase);
1130
+ }
1131
+ else if ("list" in cond.value.data) {
1132
+ return Either.right(listCase);
1133
+ }
1134
+ else if ("int" in cond.value.data) {
1135
+ return Either.right(intCase);
1136
+ }
1137
+ else if ("bytes" in cond.value.data) {
1138
+ return Either.right(bytesCase);
1139
+ }
1140
+ else {
1141
+ // this is a defect
1142
+ throw new Error(`unexpected data format in chooseData (got: ${cond.value.data})`);
1143
+ }
1144
+ }
1145
+ };
1146
+ export const constrDataV1 = {
1147
+ name: "constrData",
1148
+ forceCount: 0,
1149
+ nArgs: 2,
1150
+ cpuModel: Cost.Constant(43),
1151
+ memModel: Cost.Constant(44),
1152
+ call: ([tag, fields]) => {
1153
+ if (tag._tag != "Const") {
1154
+ return Either.left(new WrongArgType(0, "Const", tag._tag));
1155
+ }
1156
+ if (typeof tag.value != "bigint") {
1157
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(tag.value)));
1158
+ }
1159
+ if (fields._tag != "Const") {
1160
+ return Either.left(new WrongArgType(1, "Const", fields._tag));
1161
+ }
1162
+ if (!(Value.isList(fields.value) && fields.value.itemType == Type.Data)) {
1163
+ return Either.left(new WrongArgType(1, "data list", Value.describeType(fields.value)));
1164
+ }
1165
+ return Either.right({
1166
+ _tag: "Const",
1167
+ value: {
1168
+ data: {
1169
+ constructor: Number(tag.value),
1170
+ fields: fields.value.items.map((item) => {
1171
+ if (!Value.isData(item)) {
1172
+ throw new Error("expected only data value fields");
1173
+ }
1174
+ return item.data;
1175
+ })
1176
+ }
1177
+ }
1178
+ });
1179
+ }
1180
+ };
1181
+ export const mapDataV1 = {
1182
+ name: "mapData",
1183
+ forceCount: 0,
1184
+ nArgs: 1,
1185
+ cpuModel: Cost.Constant(99),
1186
+ memModel: Cost.Constant(100),
1187
+ call: ([pairs]) => {
1188
+ if (pairs._tag != "Const") {
1189
+ return Either.left(new WrongArgType(0, "Const", pairs._tag));
1190
+ }
1191
+ if (!(Value.isList(pairs.value) && pairs.value.itemType == Type.DataPair)) {
1192
+ return Either.left(new WrongArgType(0, "data pair list", Value.describeType(pairs.value)));
1193
+ }
1194
+ return Either.right({
1195
+ _tag: "Const",
1196
+ value: {
1197
+ data: {
1198
+ map: pairs.value.items.map((pair) => {
1199
+ if (!Value.isPair(pair)) {
1200
+ // this is a defect
1201
+ throw new Error("expected data pair");
1202
+ }
1203
+ const a = pair.first;
1204
+ const b = pair.second;
1205
+ if (!Value.isData(a)) {
1206
+ throw new Error("unexpected non-data first entry in pair");
1207
+ }
1208
+ if (!Value.isData(b)) {
1209
+ throw new Error("unexpected non-data second entry in pair");
1210
+ }
1211
+ return { k: a.data, v: b.data };
1212
+ })
1213
+ }
1214
+ }
1215
+ });
1216
+ }
1217
+ };
1218
+ export const mapDataV3 = {
1219
+ ...mapDataV1,
1220
+ cpuModel: Cost.Constant(104),
1221
+ memModel: Cost.Constant(105)
1222
+ };
1223
+ export const listDataV1 = {
1224
+ name: "listData",
1225
+ forceCount: 0,
1226
+ nArgs: 1,
1227
+ cpuModel: Cost.Constant(97),
1228
+ memModel: Cost.Constant(98),
1229
+ call: ([list]) => {
1230
+ if (list._tag != "Const") {
1231
+ return Either.left(new WrongArgType(0, "Const", list._tag));
1232
+ }
1233
+ if (!(Value.isList(list.value) && list.value.itemType == Type.Data)) {
1234
+ return Either.left(new WrongArgType(0, "data list", Value.describeType(list.value)));
1235
+ }
1236
+ return Either.right({
1237
+ _tag: "Const",
1238
+ value: {
1239
+ data: {
1240
+ list: list.value.items.map((item) => {
1241
+ if (!Value.isData(item)) {
1242
+ throw new Error("expected data item");
1243
+ }
1244
+ return item.data;
1245
+ })
1246
+ }
1247
+ }
1248
+ });
1249
+ }
1250
+ };
1251
+ export const listDataV3 = {
1252
+ ...listDataV1,
1253
+ cpuModel: Cost.Constant(102),
1254
+ memModel: Cost.Constant(103)
1255
+ };
1256
+ export const iDataV1 = {
1257
+ name: "iData",
1258
+ forceCount: 0,
1259
+ nArgs: 1,
1260
+ cpuModel: Cost.Constant(77),
1261
+ memModel: Cost.Constant(78),
1262
+ call: ([x]) => {
1263
+ if (x._tag != "Const") {
1264
+ return Either.left(new WrongArgType(0, "Const", x._tag));
1265
+ }
1266
+ if (typeof x.value != "bigint") {
1267
+ return Either.left(new WrongArgType(0, "integer", Value.describeType(x.value)));
1268
+ }
1269
+ return Either.right({
1270
+ _tag: "Const",
1271
+ value: {
1272
+ data: {
1273
+ int: x.value
1274
+ }
1275
+ }
1276
+ });
1277
+ }
1278
+ };
1279
+ export const iDataV3 = {
1280
+ ...iDataV1,
1281
+ cpuModel: Cost.Constant(82),
1282
+ memModel: Cost.Constant(83)
1283
+ };
1284
+ export const bDataV1 = {
1285
+ name: "bData",
1286
+ forceCount: 0,
1287
+ nArgs: 1,
1288
+ cpuModel: Cost.Constant(12),
1289
+ memModel: Cost.Constant(13),
1290
+ call: ([b]) => {
1291
+ if (b._tag != "Const") {
1292
+ return Either.left(new WrongArgType(0, "Const", b._tag));
1293
+ }
1294
+ if (!(b.value instanceof Uint8Array)) {
1295
+ return Either.left(new WrongArgType(0, "bytes", Value.describeType(b.value)));
1296
+ }
1297
+ return Either.right({
1298
+ _tag: "Const",
1299
+ value: {
1300
+ data: {
1301
+ bytes: b.value
1302
+ }
1303
+ }
1304
+ });
1305
+ }
1306
+ };
1307
+ export const unConstrDataV1 = {
1308
+ name: "unConstrData",
1309
+ forceCount: 0,
1310
+ nArgs: 1,
1311
+ cpuModel: Cost.Constant(155),
1312
+ memModel: Cost.Constant(156),
1313
+ call: ([data]) => {
1314
+ if (data._tag != "Const") {
1315
+ return Either.left(new WrongArgType(0, "Const", data._tag));
1316
+ }
1317
+ if (!Value.isData(data.value)) {
1318
+ return Either.left(new WrongArgType(0, "data", Value.describeType(data.value)));
1319
+ }
1320
+ if (!("fields" in data.value.data)) {
1321
+ return Either.left(new WrongArgType(0, "constr data", Value.describeType(data.value)));
1322
+ }
1323
+ return Either.right({
1324
+ _tag: "Const",
1325
+ value: {
1326
+ first: BigInt(data.value.data.constructor),
1327
+ second: {
1328
+ itemType: Type.Data,
1329
+ items: data.value.data.fields.map((d) => ({ data: d }))
1330
+ }
1331
+ }
1332
+ });
1333
+ }
1334
+ };
1335
+ export const unConstrDataV2 = {
1336
+ ...unConstrDataV1,
1337
+ cpuModel: Cost.Constant(159),
1338
+ memModel: Cost.Constant(160)
1339
+ };
1340
+ export const unConstrDataV3 = {
1341
+ ...unConstrDataV1,
1342
+ cpuModel: Cost.Constant(177),
1343
+ memModel: Cost.Constant(178)
1344
+ };
1345
+ export const unMapDataV1 = {
1346
+ name: "unMapData",
1347
+ forceCount: 0,
1348
+ nArgs: 1,
1349
+ cpuModel: Cost.Constant(161),
1350
+ memModel: Cost.Constant(162),
1351
+ call: ([data]) => {
1352
+ if (data._tag != "Const") {
1353
+ return Either.left(new WrongArgType(0, "Const", data._tag));
1354
+ }
1355
+ if (!Value.isData(data.value)) {
1356
+ return Either.left(new WrongArgType(0, "data", Value.describeType(data.value)));
1357
+ }
1358
+ if (!("map" in data.value.data)) {
1359
+ return Either.left(new WrongArgType(0, "map data", Value.describeType(data.value)));
1360
+ }
1361
+ return Either.right({
1362
+ _tag: "Const",
1363
+ value: {
1364
+ itemType: Type.Data,
1365
+ items: data.value.data.map.map((d) => ({
1366
+ first: { data: d.k },
1367
+ second: { data: d.v }
1368
+ }))
1369
+ }
1370
+ });
1371
+ }
1372
+ };
1373
+ export const unMapDataV2 = {
1374
+ ...unMapDataV1,
1375
+ cpuModel: Cost.Constant(165),
1376
+ memModel: Cost.Constant(166)
1377
+ };
1378
+ export const unMapDataV3 = {
1379
+ ...unMapDataV1,
1380
+ cpuModel: Cost.Constant(183),
1381
+ memModel: Cost.Constant(184)
1382
+ };
1383
+ export const unListDataV1 = {
1384
+ name: "unListData",
1385
+ forceCount: 0,
1386
+ nArgs: 1,
1387
+ cpuModel: Cost.Constant(159),
1388
+ memModel: Cost.Constant(160),
1389
+ call: ([data]) => {
1390
+ if (data._tag != "Const") {
1391
+ return Either.left(new WrongArgType(0, "Const", data._tag));
1392
+ }
1393
+ if (!Value.isData(data.value)) {
1394
+ return Either.left(new WrongArgType(0, "data", Value.describeType(data.value)));
1395
+ }
1396
+ if (!("list" in data.value.data)) {
1397
+ return Either.left(new WrongArgType(0, "list data", Value.describeType(data.value)));
1398
+ }
1399
+ return Either.right({
1400
+ _tag: "Const",
1401
+ value: {
1402
+ itemType: Type.Data,
1403
+ items: data.value.data.list.map((d) => ({ data: d }))
1404
+ }
1405
+ });
1406
+ }
1407
+ };
1408
+ export const unListDataV2 = {
1409
+ ...unListDataV1,
1410
+ cpuModel: Cost.Constant(163),
1411
+ memModel: Cost.Constant(164)
1412
+ };
1413
+ export const unListDataV3 = {
1414
+ ...unListDataV1,
1415
+ cpuModel: Cost.Constant(181),
1416
+ memModel: Cost.Constant(182)
1417
+ };
1418
+ export const unIDataV1 = {
1419
+ name: "unIData",
1420
+ forceCount: 0,
1421
+ nArgs: 1,
1422
+ cpuModel: Cost.Constant(157),
1423
+ memModel: Cost.Constant(158),
1424
+ call: ([data]) => {
1425
+ if (data._tag != "Const") {
1426
+ return Either.left(new WrongArgType(0, "Const", data._tag));
1427
+ }
1428
+ if (!Value.isData(data.value)) {
1429
+ return Either.left(new WrongArgType(0, "data", Value.describeType(data.value)));
1430
+ }
1431
+ if (!("int" in data.value.data)) {
1432
+ return Either.left(new WrongArgType(0, "int data", Value.describeType(data.value)));
1433
+ }
1434
+ return Either.right({
1435
+ _tag: "Const",
1436
+ value: data.value.data.int
1437
+ });
1438
+ }
1439
+ };
1440
+ export const unIDataV2 = {
1441
+ ...unIDataV1,
1442
+ cpuModel: Cost.Constant(161),
1443
+ memModel: Cost.Constant(162)
1444
+ };
1445
+ export const unIDataV3 = {
1446
+ ...unIDataV1,
1447
+ cpuModel: Cost.Constant(179),
1448
+ memModel: Cost.Constant(180)
1449
+ };
1450
+ export const unBDataV1 = {
1451
+ name: "unBData",
1452
+ forceCount: 0,
1453
+ nArgs: 1,
1454
+ cpuModel: Cost.Constant(153),
1455
+ memModel: Cost.Constant(154),
1456
+ call: ([data]) => {
1457
+ if (data._tag != "Const") {
1458
+ return Either.left(new WrongArgType(0, "Const", data._tag));
1459
+ }
1460
+ if (!Value.isData(data.value)) {
1461
+ return Either.left(new WrongArgType(0, "data", Value.describeType(data.value)));
1462
+ }
1463
+ if (!("bytes" in data.value.data)) {
1464
+ return Either.left(new WrongArgType(0, "byte data", Value.describeType(data.value)));
1465
+ }
1466
+ return Either.right({
1467
+ _tag: "Const",
1468
+ value: data.value.data.bytes
1469
+ });
1470
+ }
1471
+ };
1472
+ export const unBDataV2 = {
1473
+ ...unBDataV1,
1474
+ cpuModel: Cost.Constant(157),
1475
+ memModel: Cost.Constant(158)
1476
+ };
1477
+ export const unBDataV3 = {
1478
+ ...unBDataV1,
1479
+ cpuModel: Cost.Constant(175),
1480
+ memModel: Cost.Constant(176)
1481
+ };
1482
+ export const equalsDataV1 = {
1483
+ name: "equalsData",
1484
+ forceCount: 0,
1485
+ nArgs: 1,
1486
+ cpuModel: Cost.Linear(63, 64)(Cost.Min),
1487
+ memModel: Cost.Constant(65),
1488
+ call: ([a, b]) => {
1489
+ if (a._tag != "Const") {
1490
+ return Either.left(new WrongArgType(0, "Const", a._tag));
1491
+ }
1492
+ if (!Value.isData(a.value)) {
1493
+ return Either.left(new WrongArgType(0, "data", Value.describeType(a.value)));
1494
+ }
1495
+ if (b._tag != "Const") {
1496
+ return Either.left(new WrongArgType(0, "Const", b._tag));
1497
+ }
1498
+ if (!Value.isData(b.value)) {
1499
+ return Either.left(new WrongArgType(0, "data", Value.describeType(b.value)));
1500
+ }
1501
+ return Either.right({
1502
+ _tag: "Const",
1503
+ value: dataToString(a.value.data) == dataToString(b.value.data)
1504
+ });
1505
+ }
1506
+ };
1507
+ export const equalsDataV3 = {
1508
+ ...equalsDataV1,
1509
+ cpuModel: Cost.Linear(68, 69)(Cost.Min),
1510
+ memModel: Cost.Constant(70)
1511
+ };
1512
+ export const mkPairDataV1 = {
1513
+ name: "mkPairData",
1514
+ forceCount: 0,
1515
+ nArgs: 2,
1516
+ cpuModel: Cost.Constant(107),
1517
+ memModel: Cost.Constant(108),
1518
+ call: ([a, b]) => {
1519
+ if (a._tag != "Const") {
1520
+ return Either.left(new WrongArgType(0, "Const", a._tag));
1521
+ }
1522
+ if (!Value.isData(a.value)) {
1523
+ return Either.left(new WrongArgType(0, "data", Value.describeType(a.value)));
1524
+ }
1525
+ if (b._tag != "Const") {
1526
+ return Either.left(new WrongArgType(0, "Const", b._tag));
1527
+ }
1528
+ if (!Value.isData(b.value)) {
1529
+ return Either.left(new WrongArgType(0, "data", Value.describeType(b.value)));
1530
+ }
1531
+ return Either.right({
1532
+ _tag: "Const",
1533
+ value: {
1534
+ first: a.value,
1535
+ second: b.value
1536
+ }
1537
+ });
1538
+ }
1539
+ };
1540
+ export const mkPairDataV3 = {
1541
+ ...mkPairDataV1,
1542
+ cpuModel: Cost.Constant(112),
1543
+ memModel: Cost.Constant(113)
1544
+ };
1545
+ export const mkNilDataV1 = {
1546
+ name: "mkNilData",
1547
+ forceCount: 0,
1548
+ nArgs: 1,
1549
+ cpuModel: Cost.Constant(103),
1550
+ memModel: Cost.Constant(104),
1551
+ call: ([unit]) => {
1552
+ if (unit._tag != "Const") {
1553
+ return Either.left(new WrongArgType(0, "Const", unit._tag));
1554
+ }
1555
+ if (unit.value !== null) {
1556
+ return Either.left(new WrongArgType(0, "null", Value.describeType(unit.value)));
1557
+ }
1558
+ return Either.right({
1559
+ _tag: "Const",
1560
+ value: {
1561
+ itemType: Type.Data,
1562
+ items: []
1563
+ }
1564
+ });
1565
+ }
1566
+ };
1567
+ export const mkNilDataV3 = {
1568
+ ...mkNilDataV1,
1569
+ cpuModel: Cost.Constant(108),
1570
+ memModel: Cost.Constant(109)
1571
+ };
1572
+ export const mkNilPairDataV1 = {
1573
+ name: "mkNilPairData",
1574
+ forceCount: 0,
1575
+ nArgs: 1,
1576
+ cpuModel: Cost.Constant(105),
1577
+ memModel: Cost.Constant(106),
1578
+ call: ([unit]) => {
1579
+ if (unit._tag != "Const") {
1580
+ return Either.left(new WrongArgType(0, "Const", unit._tag));
1581
+ }
1582
+ if (unit.value !== null) {
1583
+ return Either.left(new WrongArgType(0, "null", Value.describeType(unit.value)));
1584
+ }
1585
+ console.log("RETURNING", Type.DataPair);
1586
+ return Either.right({
1587
+ _tag: "Const",
1588
+ value: {
1589
+ itemType: Type.DataPair,
1590
+ items: []
1591
+ }
1592
+ });
1593
+ }
1594
+ };
1595
+ export const mkNilPairDataV3 = {
1596
+ ...mkNilPairDataV1,
1597
+ cpuModel: Cost.Constant(110),
1598
+ memModel: Cost.Constant(111)
1599
+ };
1600
+ export const serialiseDataV2 = {
1601
+ name: "serialiseData",
1602
+ forceCount: 0,
1603
+ nArgs: 1,
1604
+ cpuModel: Cost.Linear(133, 134)(Cost.First),
1605
+ memModel: Cost.Linear(135, 136)(Cost.First),
1606
+ call: ([data]) => {
1607
+ if (data._tag != "Const") {
1608
+ return Either.left(new WrongArgType(0, "Const", data._tag));
1609
+ }
1610
+ if (!Value.isData(data.value)) {
1611
+ return Either.left(new WrongArgType(0, "data", Value.describeType(data.value)));
1612
+ }
1613
+ return Either.right({
1614
+ _tag: "Const",
1615
+ value: Bytes.toUint8Array(encodeData(data.value.data))
1616
+ });
1617
+ }
1618
+ };
1619
+ export const serialiseDataV3 = {
1620
+ ...serialiseDataV2,
1621
+ cpuModel: Cost.Linear(151, 152)(Cost.First),
1622
+ memModel: Cost.Linear(153, 154)(Cost.First)
1623
+ };
1624
+ export const verifyEcdsaSecp256k1SignatureV2 = {
1625
+ name: "verifyEcdsaSecp256k1Signature",
1626
+ forceCount: 0,
1627
+ nArgs: 3,
1628
+ cpuModel: Cost.Constant(167),
1629
+ memModel: Cost.Constant(168),
1630
+ call: () => {
1631
+ throw new Error("not yet implemented");
1632
+ }
1633
+ };
1634
+ export const verifyEcdsaSecp256k1SignatureV3 = {
1635
+ ...verifyEcdsaSecp256k1SignatureV2,
1636
+ cpuModel: Cost.Constant(185),
1637
+ memModel: Cost.Constant(186)
1638
+ };
1639
+ export const verifySchnorrSecp256k1SignatureV2 = {
1640
+ name: "verifySchnorrSecp256k1Signature",
1641
+ forceCount: 0,
1642
+ nArgs: 3,
1643
+ cpuModel: Cost.Linear(172, 173)(Cost.Second),
1644
+ memModel: Cost.Constant(174),
1645
+ call: () => {
1646
+ throw new Error("not yet implemented");
1647
+ }
1648
+ };
1649
+ export const verifySchnorrSecp256k1SignatureV3 = {
1650
+ ...verifyEcdsaSecp256k1SignatureV2,
1651
+ cpuModel: Cost.Linear(190, 191)(Cost.Third),
1652
+ memModel: Cost.Constant(192)
1653
+ };
1654
+ export const V1 = [
1655
+ addIntegerV1, // 0
1656
+ subtractIntegerV1, // 1
1657
+ multiplyIntegerV1, // 2
1658
+ divideIntegerV1, // 3
1659
+ quotientIntegerV1, // 4
1660
+ remainderIntegerV1, // 5
1661
+ modIntegerV1, // 6
1662
+ equalsIntegerV1, // 7
1663
+ lessThanIntegerV1, // 8
1664
+ lessThanEqualsIntegerV1, // 9
1665
+ appendByteStringV1, // 10
1666
+ consByteStringV1, // 11
1667
+ sliceByteStringV1, // 12
1668
+ lengthOfByteStringV1, // 13
1669
+ indexByteStringV1, // 14
1670
+ equalsByteStringV1, // 15
1671
+ lessThanByteStringV1, // 16
1672
+ lessThanEqualsByteStringV1, // 17
1673
+ sha2_256V1, // 18
1674
+ sha3_256V1, // 19
1675
+ blake2b_256V1, // 20
1676
+ verifyEd25519SignatureV1, // 21
1677
+ appendStringV1, // 22
1678
+ equalsStringV1, // 23
1679
+ encodeUtf8V1, // 24
1680
+ decodeUtf8V1, // 25
1681
+ ifThenElseV1, // 26
1682
+ chooseUnitV1, // 27
1683
+ traceV1, // 28
1684
+ fstPairV1, // 29
1685
+ sndPairV1, // 30
1686
+ chooseListV1, // 31
1687
+ mkConsV1, // 32
1688
+ headListV1, // 33
1689
+ tailListV1, // 34
1690
+ nullListV1, // 35
1691
+ chooseDataV1, // 36
1692
+ constrDataV1, // 37
1693
+ mapDataV1, // 38
1694
+ listDataV1, // 39
1695
+ iDataV1, // 40
1696
+ bDataV1, // 41
1697
+ unConstrDataV1, // 42
1698
+ unMapDataV1, // 43
1699
+ unListDataV1, // 44
1700
+ unIDataV1, // 45
1701
+ unBDataV1, // 46
1702
+ equalsDataV1, // 47
1703
+ mkPairDataV1, // 48
1704
+ mkNilDataV1, // 49
1705
+ mkNilPairDataV1 // 50
1706
+ ];
1707
+ export const V2 = [
1708
+ addIntegerV1, // 0
1709
+ subtractIntegerV2, // 1
1710
+ multiplyIntegerV2, // 2
1711
+ divideIntegerV1, // 3
1712
+ quotientIntegerV1, // 4
1713
+ remainderIntegerV1, // 5
1714
+ modIntegerV1, // 6
1715
+ equalsIntegerV1, // 7
1716
+ lessThanIntegerV1, // 8
1717
+ lessThanEqualsIntegerV1, // 9
1718
+ appendByteStringV1, // 10
1719
+ consByteStringV1, // 11
1720
+ sliceByteStringV2, // 12
1721
+ lengthOfByteStringV1, // 13
1722
+ indexByteStringV1, // 14
1723
+ equalsByteStringV1, // 15
1724
+ lessThanByteStringV1, // 16
1725
+ lessThanEqualsByteStringV1, // 17
1726
+ sha2_256V2, // 18
1727
+ sha3_256V2, // 19
1728
+ blake2b_256V1, // 20
1729
+ verifyEd25519SignatureV2, // 21
1730
+ appendStringV1, // 22
1731
+ equalsStringV1, // 23
1732
+ encodeUtf8V1, // 24
1733
+ decodeUtf8V1, // 25
1734
+ ifThenElseV1, // 26
1735
+ chooseUnitV1, // 27
1736
+ traceV2, // 28
1737
+ fstPairV1, // 29
1738
+ sndPairV2, // 30
1739
+ chooseListV1, // 31
1740
+ mkConsV1, // 32
1741
+ headListV1, // 33
1742
+ tailListV2, // 34
1743
+ nullListV1, // 35
1744
+ chooseDataV1, // 36
1745
+ constrDataV1, // 37
1746
+ mapDataV1, // 38
1747
+ listDataV1, // 39
1748
+ iDataV1, // 40
1749
+ bDataV1, // 41
1750
+ unConstrDataV2, // 42
1751
+ unMapDataV2, // 43
1752
+ unListDataV2, // 44
1753
+ unIDataV2, // 45
1754
+ unBDataV2, // 46
1755
+ equalsDataV1, // 47
1756
+ mkPairDataV1, // 48
1757
+ mkNilDataV1, // 49
1758
+ mkNilPairDataV1, // 50
1759
+ serialiseDataV2, // 51
1760
+ verifyEcdsaSecp256k1SignatureV2, // 52
1761
+ verifySchnorrSecp256k1SignatureV2 // 53
1762
+ ];
1763
+ export const V3 = [
1764
+ addIntegerV1, // 0
1765
+ subtractIntegerV3, // 1
1766
+ multiplyIntegerV3, // 2
1767
+ divideIntegerV3, // 3
1768
+ quotientIntegerV3, // 4
1769
+ remainderIntegerV3, // 5
1770
+ modIntegerV3, // 6
1771
+ equalsIntegerV3, // 7
1772
+ lessThanIntegerV3, // 8
1773
+ lessThanEqualsIntegerV3, // 9
1774
+ appendByteStringV1, // 10
1775
+ consByteStringV1, // 11,
1776
+ sliceByteStringV3, // 12
1777
+ lengthOfByteStringV3, // 13
1778
+ indexByteStringV3, // 14
1779
+ equalsByteStringV3, // 15
1780
+ lessThanByteStringV3, // 16
1781
+ lessThanEqualsByteStringV3, // 17
1782
+ sha2_256V3, // 18
1783
+ sha3_256V3, // 19
1784
+ blake2b_256V1, // 20
1785
+ verifyEd25519SignatureV3, // 21
1786
+ appendStringV1, // 22
1787
+ equalsStringV3, // 23
1788
+ encodeUtf8V3, // 24
1789
+ decodeUtf8V1, // 25
1790
+ ifThenElseV3, // 26
1791
+ chooseUnitV1, // 27
1792
+ traceV3, // 28
1793
+ fstPairV3, // 29
1794
+ sndPairV3, // 30
1795
+ chooseListV1, // 31
1796
+ mkConsV3, // 32
1797
+ headListV3, // 33
1798
+ tailListV3, // 34
1799
+ nullListV3, // 35,
1800
+ chooseDataV1, // 36
1801
+ constrDataV1, // 37
1802
+ mapDataV3, // 38
1803
+ listDataV3, // 39
1804
+ iDataV3, // 40
1805
+ bDataV1, // 41
1806
+ unConstrDataV3, // 42
1807
+ unMapDataV3, // 43
1808
+ unListDataV3, // 44
1809
+ unIDataV3, // 45
1810
+ unBDataV3, // 46
1811
+ equalsDataV3, // 47
1812
+ mkPairDataV3, // 48
1813
+ mkNilDataV3, // 49
1814
+ mkNilPairDataV3, // 50
1815
+ serialiseDataV3, // 51
1816
+ verifyEcdsaSecp256k1SignatureV3, // 52
1817
+ verifySchnorrSecp256k1SignatureV3 // 53
1818
+ // TODO: remaining builtins
1819
+ ];
1820
+ //# sourceMappingURL=Builtins.js.map