@stellar-expert/contract-wasm-interface-parser 1.0.0 → 1.0.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellar-expert/contract-wasm-interface-parser",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Contract interface metadata parser for binary WASM",
5
5
  "main": "index.js",
6
6
  "module": "./index.js",
@@ -47,13 +47,7 @@ export function parseSpec(entries) {
47
47
  name: parseStructName(value),
48
48
  cases: value.cases().reduce((agg, c) => {
49
49
  const value = c.value()
50
- const caseType = {
51
- name: value.name().toString()
52
- }
53
- if (value.type) {
54
- caseType.type = value.type().map(parseParameterType)
55
- }
56
- agg[c.switch().name.replace('scSpecUdtUnionCase', '')] = caseType
50
+ agg[value.name().toString()] = value.type ? parseParameterType(value.type()[0]) : 'void'
57
51
  return agg
58
52
  }, {})
59
53
  })
@@ -95,7 +89,7 @@ function parseParameterType(type) {
95
89
  const typeName = type.switch().name
96
90
  switch (typeName) {
97
91
  case 'scSpecTypeOption':
98
- return `option<${parseParameterType(type.valueType())}>`
92
+ return `option<${parseParameterType(type.value().valueType())}>`
99
93
  case 'scSpecTypeBytesN':
100
94
  return `bytesn<${type.value().n()}>`
101
95
  case 'scSpecTypeVec':