@helios-lang/contract-utils 0.1.32 → 0.1.33

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/cast/Cast.js +3 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helios-lang/contract-utils",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "description": "Convenience and type-safety utilities for using Helios validators from within Typescript",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
package/src/cast/Cast.js CHANGED
@@ -99,6 +99,7 @@ function schemaToUplc(schema, x) {
99
99
  return DatumHash.fromAlike(x).toUplcData()
100
100
  case "DCert":
101
101
  return x.toUplcData()
102
+ case "Duration":
102
103
  case "Int":
103
104
  return new IntData(x)
104
105
  case "MintingPolicyHash":
@@ -211,6 +212,7 @@ function uplcToSchema(schema, data) {
211
212
  return decodeBoolData(data, true)
212
213
  case "ByteArray":
213
214
  return ByteArrayData.expect(data).bytes
215
+ case "SpendingCredential":
214
216
  case "Credential":
215
217
  return SpendingCredential.fromUplcData(data)
216
218
  case "Data":
@@ -219,6 +221,7 @@ function uplcToSchema(schema, data) {
219
221
  throw new Error(
220
222
  "can't convert UplcData back into DCert (significant loss of information)"
221
223
  )
224
+ case "Duration":
222
225
  case "Int":
223
226
  return IntData.expect(data).value
224
227
  case "MintingPolicyHash":