@stellar/stellar-sdk 12.0.0-rc.2 → 12.0.0-rc.3

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 (50) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +1 -1
  3. package/dist/stellar-sdk.js +1643 -466
  4. package/dist/stellar-sdk.min.js +1 -1
  5. package/lib/{contract_client → contract}/assembled_transaction.d.ts +59 -40
  6. package/lib/{contract_client → contract}/assembled_transaction.js +128 -146
  7. package/lib/{contract_client → contract}/basic_node_signer.d.ts +2 -2
  8. package/lib/{contract_client → contract}/basic_node_signer.js +3 -3
  9. package/lib/contract/client.d.ts +51 -0
  10. package/lib/contract/client.js +177 -0
  11. package/lib/contract/index.d.ts +7 -0
  12. package/lib/{contract_client → contract}/index.js +19 -8
  13. package/lib/{contract_client → contract}/sent_transaction.d.ts +21 -10
  14. package/lib/{contract_client → contract}/sent_transaction.js +27 -13
  15. package/lib/{contract_spec.d.ts → contract/spec.d.ts} +3 -3
  16. package/lib/{contract_spec.js → contract/spec.js} +160 -160
  17. package/lib/{contract_client → contract}/types.d.ts +10 -8
  18. package/lib/contract/utils.d.ts +40 -0
  19. package/lib/{contract_client → contract}/utils.js +12 -2
  20. package/lib/index.d.ts +26 -2
  21. package/lib/index.js +10 -16
  22. package/lib/rpc/index.d.ts +7 -0
  23. package/lib/{soroban → rpc}/server.d.ts +49 -0
  24. package/lib/{soroban → rpc}/server.js +199 -118
  25. package/package.json +20 -3
  26. package/lib/contract_client/client.d.ts +0 -17
  27. package/lib/contract_client/client.js +0 -57
  28. package/lib/contract_client/index.d.ts +0 -6
  29. package/lib/contract_client/utils.d.ts +0 -23
  30. package/lib/rust_types/index.d.ts +0 -1
  31. package/lib/rust_types/index.js +0 -16
  32. package/lib/soroban/index.d.ts +0 -7
  33. /package/lib/{rust_types/result.d.ts → contract/rust_result.d.ts} +0 -0
  34. /package/lib/{rust_types/result.js → contract/rust_result.js} +0 -0
  35. /package/lib/{contract_client → contract}/types.js +0 -0
  36. /package/lib/{soroban → rpc}/api.d.ts +0 -0
  37. /package/lib/{soroban → rpc}/api.js +0 -0
  38. /package/lib/{soroban → rpc}/axios.d.ts +0 -0
  39. /package/lib/{soroban → rpc}/axios.js +0 -0
  40. /package/lib/{soroban → rpc}/browser.d.ts +0 -0
  41. /package/lib/{soroban → rpc}/browser.js +0 -0
  42. /package/lib/{soroban → rpc}/index.js +0 -0
  43. /package/lib/{soroban → rpc}/jsonrpc.d.ts +0 -0
  44. /package/lib/{soroban → rpc}/jsonrpc.js +0 -0
  45. /package/lib/{soroban → rpc}/parsers.d.ts +0 -0
  46. /package/lib/{soroban → rpc}/parsers.js +0 -0
  47. /package/lib/{soroban → rpc}/transaction.d.ts +0 -0
  48. /package/lib/{soroban → rpc}/transaction.js +0 -0
  49. /package/lib/{soroban → rpc}/utils.d.ts +0 -0
  50. /package/lib/{soroban → rpc}/utils.js +0 -0
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ContractSpec = void 0;
7
- var _2 = require(".");
8
- var _rust_types = require("./rust_types");
6
+ exports.Spec = void 0;
7
+ var _stellarBase = require("@stellar/stellar-base");
8
+ var _rust_result = require("./rust_result");
9
9
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10
10
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
11
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
@@ -35,9 +35,9 @@ function readObj(args, input) {
35
35
  }
36
36
  return entry[1];
37
37
  }
38
- var ContractSpec = exports.ContractSpec = function () {
39
- function ContractSpec(entries) {
40
- _classCallCheck(this, ContractSpec);
38
+ var Spec = exports.Spec = function () {
39
+ function Spec(entries) {
40
+ _classCallCheck(this, Spec);
41
41
  _defineProperty(this, "entries", []);
42
42
  if (entries.length == 0) {
43
43
  throw new Error("Contract spec must have at least one entry");
@@ -45,17 +45,17 @@ var ContractSpec = exports.ContractSpec = function () {
45
45
  var entry = entries[0];
46
46
  if (typeof entry === "string") {
47
47
  this.entries = entries.map(function (s) {
48
- return _2.xdr.ScSpecEntry.fromXDR(s, "base64");
48
+ return _stellarBase.xdr.ScSpecEntry.fromXDR(s, "base64");
49
49
  });
50
50
  } else {
51
51
  this.entries = entries;
52
52
  }
53
53
  }
54
- return _createClass(ContractSpec, [{
54
+ return _createClass(Spec, [{
55
55
  key: "funcs",
56
56
  value: function funcs() {
57
57
  return this.entries.filter(function (entry) {
58
- return entry.switch().value === _2.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value;
58
+ return entry.switch().value === _stellarBase.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value;
59
59
  }).map(function (entry) {
60
60
  return entry.functionV0();
61
61
  });
@@ -64,7 +64,7 @@ var ContractSpec = exports.ContractSpec = function () {
64
64
  key: "getFunc",
65
65
  value: function getFunc(name) {
66
66
  var entry = this.findEntry(name);
67
- if (entry.switch().value !== _2.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value) {
67
+ if (entry.switch().value !== _stellarBase.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value) {
68
68
  throw new Error("".concat(name, " is not a function"));
69
69
  }
70
70
  return entry.functionV0();
@@ -81,12 +81,12 @@ var ContractSpec = exports.ContractSpec = function () {
81
81
  }, {
82
82
  key: "funcResToNative",
83
83
  value: function funcResToNative(name, val_or_base64) {
84
- var val = typeof val_or_base64 === "string" ? _2.xdr.ScVal.fromXDR(val_or_base64, "base64") : val_or_base64;
84
+ var val = typeof val_or_base64 === "string" ? _stellarBase.xdr.ScVal.fromXDR(val_or_base64, "base64") : val_or_base64;
85
85
  var func = this.getFunc(name);
86
86
  var outputs = func.outputs();
87
87
  if (outputs.length === 0) {
88
88
  var type = val.switch();
89
- if (type.value !== _2.xdr.ScValType.scvVoid().value) {
89
+ if (type.value !== _stellarBase.xdr.ScValType.scvVoid().value) {
90
90
  throw new Error("Expected void, got ".concat(type.name));
91
91
  }
92
92
  return null;
@@ -95,8 +95,8 @@ var ContractSpec = exports.ContractSpec = function () {
95
95
  throw new Error("Multiple outputs not supported");
96
96
  }
97
97
  var output = outputs[0];
98
- if (output.switch().value === _2.xdr.ScSpecType.scSpecTypeResult().value) {
99
- return new _rust_types.Ok(this.scValToNative(val, output.result().okType()));
98
+ if (output.switch().value === _stellarBase.xdr.ScSpecType.scSpecTypeResult().value) {
99
+ return new _rust_result.Ok(this.scValToNative(val, output.result().okType()));
100
100
  }
101
101
  return this.scValToNative(val, output);
102
102
  }
@@ -117,14 +117,14 @@ var ContractSpec = exports.ContractSpec = function () {
117
117
  var _this2 = this;
118
118
  var t = ty.switch();
119
119
  var value = t.value;
120
- if (t.value === _2.xdr.ScSpecType.scSpecTypeUdt().value) {
120
+ if (t.value === _stellarBase.xdr.ScSpecType.scSpecTypeUdt().value) {
121
121
  var udt = ty.udt();
122
122
  return this.nativeToUdt(val, udt.name().toString());
123
123
  }
124
- if (value === _2.xdr.ScSpecType.scSpecTypeOption().value) {
124
+ if (value === _stellarBase.xdr.ScSpecType.scSpecTypeOption().value) {
125
125
  var opt = ty.option();
126
126
  if (val === undefined) {
127
- return _2.xdr.ScVal.scvVoid();
127
+ return _stellarBase.xdr.ScVal.scvVoid();
128
128
  }
129
129
  return this.nativeToScVal(val, opt.valueType());
130
130
  }
@@ -134,23 +134,23 @@ var ContractSpec = exports.ContractSpec = function () {
134
134
  var _val$constructor$name, _val$constructor;
135
135
  if (val === null) {
136
136
  switch (value) {
137
- case _2.xdr.ScSpecType.scSpecTypeVoid().value:
138
- return _2.xdr.ScVal.scvVoid();
137
+ case _stellarBase.xdr.ScSpecType.scSpecTypeVoid().value:
138
+ return _stellarBase.xdr.ScVal.scvVoid();
139
139
  default:
140
140
  throw new TypeError("Type ".concat(ty, " was not void, but value was null"));
141
141
  }
142
142
  }
143
- if (val instanceof _2.xdr.ScVal) {
143
+ if (val instanceof _stellarBase.xdr.ScVal) {
144
144
  return val;
145
145
  }
146
- if (val instanceof _2.Address) {
147
- if (ty.switch().value !== _2.xdr.ScSpecType.scSpecTypeAddress().value) {
146
+ if (val instanceof _stellarBase.Address) {
147
+ if (ty.switch().value !== _stellarBase.xdr.ScSpecType.scSpecTypeAddress().value) {
148
148
  throw new TypeError("Type ".concat(ty, " was not address, but value was Address"));
149
149
  }
150
150
  return val.toScVal();
151
151
  }
152
- if (val instanceof _2.Contract) {
153
- if (ty.switch().value !== _2.xdr.ScSpecType.scSpecTypeAddress().value) {
152
+ if (val instanceof _stellarBase.Contract) {
153
+ if (ty.switch().value !== _stellarBase.xdr.ScSpecType.scSpecTypeAddress().value) {
154
154
  throw new TypeError("Type ".concat(ty, " was not address, but value was Address"));
155
155
  }
156
156
  return val.address().toScVal();
@@ -158,50 +158,50 @@ var ContractSpec = exports.ContractSpec = function () {
158
158
  if (val instanceof Uint8Array || Buffer.isBuffer(val)) {
159
159
  var copy = Uint8Array.from(val);
160
160
  switch (value) {
161
- case _2.xdr.ScSpecType.scSpecTypeBytesN().value:
161
+ case _stellarBase.xdr.ScSpecType.scSpecTypeBytesN().value:
162
162
  {
163
163
  var bytes_n = ty.bytesN();
164
164
  if (copy.length !== bytes_n.n()) {
165
165
  throw new TypeError("expected ".concat(bytes_n.n(), " bytes, but got ").concat(copy.length));
166
166
  }
167
- return _2.xdr.ScVal.scvBytes(copy);
167
+ return _stellarBase.xdr.ScVal.scvBytes(copy);
168
168
  }
169
- case _2.xdr.ScSpecType.scSpecTypeBytes().value:
170
- return _2.xdr.ScVal.scvBytes(copy);
169
+ case _stellarBase.xdr.ScSpecType.scSpecTypeBytes().value:
170
+ return _stellarBase.xdr.ScVal.scvBytes(copy);
171
171
  default:
172
172
  throw new TypeError("invalid type (".concat(ty, ") specified for Bytes and BytesN"));
173
173
  }
174
174
  }
175
175
  if (Array.isArray(val)) {
176
176
  switch (value) {
177
- case _2.xdr.ScSpecType.scSpecTypeVec().value:
177
+ case _stellarBase.xdr.ScSpecType.scSpecTypeVec().value:
178
178
  {
179
179
  var vec = ty.vec();
180
180
  var elementType = vec.elementType();
181
- return _2.xdr.ScVal.scvVec(val.map(function (v) {
181
+ return _stellarBase.xdr.ScVal.scvVec(val.map(function (v) {
182
182
  return _this2.nativeToScVal(v, elementType);
183
183
  }));
184
184
  }
185
- case _2.xdr.ScSpecType.scSpecTypeTuple().value:
185
+ case _stellarBase.xdr.ScSpecType.scSpecTypeTuple().value:
186
186
  {
187
187
  var tup = ty.tuple();
188
188
  var valTypes = tup.valueTypes();
189
189
  if (val.length !== valTypes.length) {
190
190
  throw new TypeError("Tuple expects ".concat(valTypes.length, " values, but ").concat(val.length, " were provided"));
191
191
  }
192
- return _2.xdr.ScVal.scvVec(val.map(function (v, i) {
192
+ return _stellarBase.xdr.ScVal.scvVec(val.map(function (v, i) {
193
193
  return _this2.nativeToScVal(v, valTypes[i]);
194
194
  }));
195
195
  }
196
- case _2.xdr.ScSpecType.scSpecTypeMap().value:
196
+ case _stellarBase.xdr.ScSpecType.scSpecTypeMap().value:
197
197
  {
198
198
  var map = ty.map();
199
199
  var keyType = map.keyType();
200
200
  var valueType = map.valueType();
201
- return _2.xdr.ScVal.scvMap(val.map(function (entry) {
201
+ return _stellarBase.xdr.ScVal.scvMap(val.map(function (entry) {
202
202
  var key = _this2.nativeToScVal(entry[0], keyType);
203
203
  var val = _this2.nativeToScVal(entry[1], valueType);
204
- return new _2.xdr.ScMapEntry({
204
+ return new _stellarBase.xdr.ScMapEntry({
205
205
  key: key,
206
206
  val: val
207
207
  });
@@ -212,7 +212,7 @@ var ContractSpec = exports.ContractSpec = function () {
212
212
  }
213
213
  }
214
214
  if (val.constructor === Map) {
215
- if (value !== _2.xdr.ScSpecType.scSpecTypeMap().value) {
215
+ if (value !== _stellarBase.xdr.ScSpecType.scSpecTypeMap().value) {
216
216
  throw new TypeError("Type ".concat(ty, " was not map, but value was Map"));
217
217
  }
218
218
  var scMap = ty.map();
@@ -226,13 +226,13 @@ var ContractSpec = exports.ContractSpec = function () {
226
226
  v = _res$value[1];
227
227
  var key = this.nativeToScVal(k, scMap.keyType());
228
228
  var _val = this.nativeToScVal(v, scMap.valueType());
229
- entries.push(new _2.xdr.ScMapEntry({
229
+ entries.push(new _stellarBase.xdr.ScMapEntry({
230
230
  key: key,
231
231
  val: _val
232
232
  }));
233
233
  res = values.next();
234
234
  }
235
- return _2.xdr.ScVal.scvMap(entries);
235
+ return _stellarBase.xdr.ScVal.scvMap(entries);
236
236
  }
237
237
  if (((_val$constructor$name = (_val$constructor = val.constructor) === null || _val$constructor === void 0 ? void 0 : _val$constructor.name) !== null && _val$constructor$name !== void 0 ? _val$constructor$name : "") !== "Object") {
238
238
  var _val$constructor2;
@@ -244,19 +244,19 @@ var ContractSpec = exports.ContractSpec = function () {
244
244
  case "bigint":
245
245
  {
246
246
  switch (value) {
247
- case _2.xdr.ScSpecType.scSpecTypeU32().value:
248
- return _2.xdr.ScVal.scvU32(val);
249
- case _2.xdr.ScSpecType.scSpecTypeI32().value:
250
- return _2.xdr.ScVal.scvI32(val);
251
- case _2.xdr.ScSpecType.scSpecTypeU64().value:
252
- case _2.xdr.ScSpecType.scSpecTypeI64().value:
253
- case _2.xdr.ScSpecType.scSpecTypeU128().value:
254
- case _2.xdr.ScSpecType.scSpecTypeI128().value:
255
- case _2.xdr.ScSpecType.scSpecTypeU256().value:
256
- case _2.xdr.ScSpecType.scSpecTypeI256().value:
247
+ case _stellarBase.xdr.ScSpecType.scSpecTypeU32().value:
248
+ return _stellarBase.xdr.ScVal.scvU32(val);
249
+ case _stellarBase.xdr.ScSpecType.scSpecTypeI32().value:
250
+ return _stellarBase.xdr.ScVal.scvI32(val);
251
+ case _stellarBase.xdr.ScSpecType.scSpecTypeU64().value:
252
+ case _stellarBase.xdr.ScSpecType.scSpecTypeI64().value:
253
+ case _stellarBase.xdr.ScSpecType.scSpecTypeU128().value:
254
+ case _stellarBase.xdr.ScSpecType.scSpecTypeI128().value:
255
+ case _stellarBase.xdr.ScSpecType.scSpecTypeU256().value:
256
+ case _stellarBase.xdr.ScSpecType.scSpecTypeI256().value:
257
257
  {
258
258
  var intType = t.name.substring(10).toLowerCase();
259
- return new _2.XdrLargeInt(intType, val).toScVal();
259
+ return new _stellarBase.XdrLargeInt(intType, val).toScVal();
260
260
  }
261
261
  default:
262
262
  throw new TypeError("invalid type (".concat(ty, ") specified for integer"));
@@ -266,20 +266,20 @@ var ContractSpec = exports.ContractSpec = function () {
266
266
  return stringToScVal(val, t);
267
267
  case "boolean":
268
268
  {
269
- if (value !== _2.xdr.ScSpecType.scSpecTypeBool().value) {
269
+ if (value !== _stellarBase.xdr.ScSpecType.scSpecTypeBool().value) {
270
270
  throw TypeError("Type ".concat(ty, " was not bool, but value was bool"));
271
271
  }
272
- return _2.xdr.ScVal.scvBool(val);
272
+ return _stellarBase.xdr.ScVal.scvBool(val);
273
273
  }
274
274
  case "undefined":
275
275
  {
276
276
  if (!ty) {
277
- return _2.xdr.ScVal.scvVoid();
277
+ return _stellarBase.xdr.ScVal.scvVoid();
278
278
  }
279
279
  switch (value) {
280
- case _2.xdr.ScSpecType.scSpecTypeVoid().value:
281
- case _2.xdr.ScSpecType.scSpecTypeOption().value:
282
- return _2.xdr.ScVal.scvVoid();
280
+ case _stellarBase.xdr.ScSpecType.scSpecTypeVoid().value:
281
+ case _stellarBase.xdr.ScSpecType.scSpecTypeOption().value:
282
+ return _stellarBase.xdr.ScVal.scvVoid();
283
283
  default:
284
284
  throw new TypeError("Type ".concat(ty, " was not void, but value was undefined"));
285
285
  }
@@ -295,14 +295,14 @@ var ContractSpec = exports.ContractSpec = function () {
295
295
  value: function nativeToUdt(val, name) {
296
296
  var entry = this.findEntry(name);
297
297
  switch (entry.switch()) {
298
- case _2.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():
298
+ case _stellarBase.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():
299
299
  if (typeof val !== "number") {
300
300
  throw new TypeError("expected number for enum ".concat(name, ", but got ").concat(_typeof(val)));
301
301
  }
302
302
  return this.nativeToEnum(val, entry.udtEnumV0());
303
- case _2.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():
303
+ case _stellarBase.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():
304
304
  return this.nativeToStruct(val, entry.udtStructV0());
305
- case _2.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():
305
+ case _stellarBase.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():
306
306
  return this.nativeToUnion(val, entry.udtUnionV0());
307
307
  default:
308
308
  throw new Error("failed to parse udt ".concat(name));
@@ -320,13 +320,13 @@ var ContractSpec = exports.ContractSpec = function () {
320
320
  if (!case_) {
321
321
  throw new TypeError("no such enum entry: ".concat(entry_name, " in ").concat(union_));
322
322
  }
323
- var key = _2.xdr.ScVal.scvSymbol(entry_name);
323
+ var key = _stellarBase.xdr.ScVal.scvSymbol(entry_name);
324
324
  switch (case_.switch()) {
325
- case _2.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0():
325
+ case _stellarBase.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0():
326
326
  {
327
- return _2.xdr.ScVal.scvVec([key]);
327
+ return _stellarBase.xdr.ScVal.scvVec([key]);
328
328
  }
329
- case _2.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0():
329
+ case _stellarBase.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0():
330
330
  {
331
331
  var types = case_.tupleCase().type();
332
332
  if (Array.isArray(val.values)) {
@@ -337,7 +337,7 @@ var ContractSpec = exports.ContractSpec = function () {
337
337
  return _this3.nativeToScVal(v, types[i]);
338
338
  });
339
339
  scvals.unshift(key);
340
- return _2.xdr.ScVal.scvVec(scvals);
340
+ return _stellarBase.xdr.ScVal.scvVec(scvals);
341
341
  }
342
342
  throw new Error("failed to parse union case ".concat(case_, " with ").concat(val));
343
343
  }
@@ -354,14 +354,14 @@ var ContractSpec = exports.ContractSpec = function () {
354
354
  if (!fields.every(isNumeric)) {
355
355
  throw new Error("mixed numeric and non-numeric field names are not allowed");
356
356
  }
357
- return _2.xdr.ScVal.scvVec(fields.map(function (_, i) {
357
+ return _stellarBase.xdr.ScVal.scvVec(fields.map(function (_, i) {
358
358
  return _this4.nativeToScVal(val[i], fields[i].type());
359
359
  }));
360
360
  }
361
- return _2.xdr.ScVal.scvMap(fields.map(function (field) {
361
+ return _stellarBase.xdr.ScVal.scvMap(fields.map(function (field) {
362
362
  var name = field.name().toString();
363
- return new _2.xdr.ScMapEntry({
364
- key: _this4.nativeToScVal(name, _2.xdr.ScSpecTypeDef.scSpecTypeSymbol()),
363
+ return new _stellarBase.xdr.ScMapEntry({
364
+ key: _this4.nativeToScVal(name, _stellarBase.xdr.ScSpecTypeDef.scSpecTypeSymbol()),
365
365
  val: _this4.nativeToScVal(val[name], field.type())
366
366
  });
367
367
  }));
@@ -372,14 +372,14 @@ var ContractSpec = exports.ContractSpec = function () {
372
372
  if (enum_.cases().some(function (entry) {
373
373
  return entry.value() === val;
374
374
  })) {
375
- return _2.xdr.ScVal.scvU32(val);
375
+ return _stellarBase.xdr.ScVal.scvU32(val);
376
376
  }
377
377
  throw new TypeError("no such enum entry: ".concat(val, " in ").concat(enum_));
378
378
  }
379
379
  }, {
380
380
  key: "scValStrToNative",
381
381
  value: function scValStrToNative(scv, typeDef) {
382
- return this.scValToNative(_2.xdr.ScVal.fromXDR(scv, "base64"), typeDef);
382
+ return this.scValToNative(_stellarBase.xdr.ScVal.fromXDR(scv, "base64"), typeDef);
383
383
  }
384
384
  }, {
385
385
  key: "scValToNative",
@@ -387,28 +387,28 @@ var ContractSpec = exports.ContractSpec = function () {
387
387
  var _this5 = this;
388
388
  var t = typeDef.switch();
389
389
  var value = t.value;
390
- if (value === _2.xdr.ScSpecType.scSpecTypeUdt().value) {
390
+ if (value === _stellarBase.xdr.ScSpecType.scSpecTypeUdt().value) {
391
391
  return this.scValUdtToNative(scv, typeDef.udt());
392
392
  }
393
393
  switch (scv.switch().value) {
394
- case _2.xdr.ScValType.scvVoid().value:
394
+ case _stellarBase.xdr.ScValType.scvVoid().value:
395
395
  return void 0;
396
- case _2.xdr.ScValType.scvU64().value:
397
- case _2.xdr.ScValType.scvI64().value:
398
- case _2.xdr.ScValType.scvU128().value:
399
- case _2.xdr.ScValType.scvI128().value:
400
- case _2.xdr.ScValType.scvU256().value:
401
- case _2.xdr.ScValType.scvI256().value:
402
- return (0, _2.scValToBigInt)(scv);
403
- case _2.xdr.ScValType.scvVec().value:
396
+ case _stellarBase.xdr.ScValType.scvU64().value:
397
+ case _stellarBase.xdr.ScValType.scvI64().value:
398
+ case _stellarBase.xdr.ScValType.scvU128().value:
399
+ case _stellarBase.xdr.ScValType.scvI128().value:
400
+ case _stellarBase.xdr.ScValType.scvU256().value:
401
+ case _stellarBase.xdr.ScValType.scvI256().value:
402
+ return (0, _stellarBase.scValToBigInt)(scv);
403
+ case _stellarBase.xdr.ScValType.scvVec().value:
404
404
  {
405
- if (value == _2.xdr.ScSpecType.scSpecTypeVec().value) {
405
+ if (value == _stellarBase.xdr.ScSpecType.scSpecTypeVec().value) {
406
406
  var _scv$vec;
407
407
  var vec = typeDef.vec();
408
408
  return ((_scv$vec = scv.vec()) !== null && _scv$vec !== void 0 ? _scv$vec : []).map(function (elm) {
409
409
  return _this5.scValToNative(elm, vec.elementType());
410
410
  });
411
- } else if (value == _2.xdr.ScSpecType.scSpecTypeTuple().value) {
411
+ } else if (value == _stellarBase.xdr.ScSpecType.scSpecTypeTuple().value) {
412
412
  var _scv$vec2;
413
413
  var tuple = typeDef.tuple();
414
414
  var valTypes = tuple.valueTypes();
@@ -418,13 +418,13 @@ var ContractSpec = exports.ContractSpec = function () {
418
418
  }
419
419
  throw new TypeError("Type ".concat(typeDef, " was not vec, but ").concat(scv, " is"));
420
420
  }
421
- case _2.xdr.ScValType.scvAddress().value:
422
- return _2.Address.fromScVal(scv).toString();
423
- case _2.xdr.ScValType.scvMap().value:
421
+ case _stellarBase.xdr.ScValType.scvAddress().value:
422
+ return _stellarBase.Address.fromScVal(scv).toString();
423
+ case _stellarBase.xdr.ScValType.scvMap().value:
424
424
  {
425
425
  var _scv$map;
426
426
  var map = (_scv$map = scv.map()) !== null && _scv$map !== void 0 ? _scv$map : [];
427
- if (value == _2.xdr.ScSpecType.scSpecTypeMap().value) {
427
+ if (value == _stellarBase.xdr.ScSpecType.scSpecTypeMap().value) {
428
428
  var type_ = typeDef.map();
429
429
  var keyType = type_.keyType();
430
430
  var valueType = type_.valueType();
@@ -435,23 +435,23 @@ var ContractSpec = exports.ContractSpec = function () {
435
435
  }
436
436
  throw new TypeError("ScSpecType ".concat(t.name, " was not map, but ").concat(JSON.stringify(scv, null, 2), " is"));
437
437
  }
438
- case _2.xdr.ScValType.scvBool().value:
439
- case _2.xdr.ScValType.scvU32().value:
440
- case _2.xdr.ScValType.scvI32().value:
441
- case _2.xdr.ScValType.scvBytes().value:
438
+ case _stellarBase.xdr.ScValType.scvBool().value:
439
+ case _stellarBase.xdr.ScValType.scvU32().value:
440
+ case _stellarBase.xdr.ScValType.scvI32().value:
441
+ case _stellarBase.xdr.ScValType.scvBytes().value:
442
442
  return scv.value();
443
- case _2.xdr.ScValType.scvString().value:
444
- case _2.xdr.ScValType.scvSymbol().value:
443
+ case _stellarBase.xdr.ScValType.scvString().value:
444
+ case _stellarBase.xdr.ScValType.scvSymbol().value:
445
445
  {
446
446
  var _scv$value;
447
- if (value !== _2.xdr.ScSpecType.scSpecTypeString().value && value !== _2.xdr.ScSpecType.scSpecTypeSymbol().value) {
447
+ if (value !== _stellarBase.xdr.ScSpecType.scSpecTypeString().value && value !== _stellarBase.xdr.ScSpecType.scSpecTypeSymbol().value) {
448
448
  throw new Error("ScSpecType ".concat(t.name, " was not string or symbol, but ").concat(JSON.stringify(scv, null, 2), " is"));
449
449
  }
450
450
  return (_scv$value = scv.value()) === null || _scv$value === void 0 ? void 0 : _scv$value.toString();
451
451
  }
452
- case _2.xdr.ScValType.scvTimepoint().value:
453
- case _2.xdr.ScValType.scvDuration().value:
454
- return (0, _2.scValToBigInt)(_2.xdr.ScVal.scvU64(scv.u64()));
452
+ case _stellarBase.xdr.ScValType.scvTimepoint().value:
453
+ case _stellarBase.xdr.ScValType.scvDuration().value:
454
+ return (0, _stellarBase.scValToBigInt)(_stellarBase.xdr.ScVal.scvU64(scv.u64()));
455
455
  default:
456
456
  throw new TypeError("failed to convert ".concat(JSON.stringify(scv, null, 2), " to native type from type ").concat(t.name));
457
457
  }
@@ -461,11 +461,11 @@ var ContractSpec = exports.ContractSpec = function () {
461
461
  value: function scValUdtToNative(scv, udt) {
462
462
  var entry = this.findEntry(udt.name().toString());
463
463
  switch (entry.switch()) {
464
- case _2.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():
464
+ case _stellarBase.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():
465
465
  return this.enumToNative(scv);
466
- case _2.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():
466
+ case _stellarBase.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():
467
467
  return this.structToNative(scv, entry.udtStructV0());
468
- case _2.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():
468
+ case _stellarBase.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():
469
469
  return this.unionToNative(scv, entry.udtUnionV0());
470
470
  default:
471
471
  throw new Error("failed to parse udt ".concat(udt.name().toString(), ": ").concat(entry));
@@ -483,7 +483,7 @@ var ContractSpec = exports.ContractSpec = function () {
483
483
  throw new Error("".concat(val, " has length 0, but the there are at least one case in the union"));
484
484
  }
485
485
  var name = vec[0].sym().toString();
486
- if (vec[0].switch().value != _2.xdr.ScValType.scvSymbol().value) {
486
+ if (vec[0].switch().value != _stellarBase.xdr.ScValType.scvSymbol().value) {
487
487
  throw new Error("{vec[0]} is not a symbol");
488
488
  }
489
489
  var entry = udt.cases().find(findCase(name));
@@ -493,7 +493,7 @@ var ContractSpec = exports.ContractSpec = function () {
493
493
  var res = {
494
494
  tag: name
495
495
  };
496
- if (entry.switch().value === _2.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value) {
496
+ if (entry.switch().value === _stellarBase.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value) {
497
497
  var tuple = entry.tupleCase();
498
498
  var ty = tuple.type();
499
499
  var values = ty.map(function (entry, i) {
@@ -526,7 +526,7 @@ var ContractSpec = exports.ContractSpec = function () {
526
526
  }, {
527
527
  key: "enumToNative",
528
528
  value: function enumToNative(scv) {
529
- if (scv.switch().value !== _2.xdr.ScValType.scvU32().value) {
529
+ if (scv.switch().value !== _stellarBase.xdr.ScValType.scvU32().value) {
530
530
  throw new Error("Enum must have a u32 value");
531
531
  }
532
532
  var num = scv.u32();
@@ -536,7 +536,7 @@ var ContractSpec = exports.ContractSpec = function () {
536
536
  key: "errorCases",
537
537
  value: function errorCases() {
538
538
  return this.entries.filter(function (entry) {
539
- return entry.switch().value === _2.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0().value;
539
+ return entry.switch().value === _stellarBase.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0().value;
540
540
  }).flatMap(function (entry) {
541
541
  return entry.value().cases();
542
542
  });
@@ -551,23 +551,23 @@ var ContractSpec = exports.ContractSpec = function () {
551
551
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
552
552
  var entry = _step.value;
553
553
  switch (entry.switch().value) {
554
- case _2.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0().value:
554
+ case _stellarBase.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0().value:
555
555
  {
556
556
  var _udt = entry.udtEnumV0();
557
557
  definitions[_udt.name().toString()] = enumToJsonSchema(_udt);
558
558
  break;
559
559
  }
560
- case _2.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0().value:
560
+ case _stellarBase.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0().value:
561
561
  {
562
562
  var _udt2 = entry.udtStructV0();
563
563
  definitions[_udt2.name().toString()] = structToJsonSchema(_udt2);
564
564
  break;
565
565
  }
566
- case _2.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0().value:
566
+ case _stellarBase.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0().value:
567
567
  var udt = entry.udtUnionV0();
568
568
  definitions[udt.name().toString()] = unionToJsonSchema(udt);
569
569
  break;
570
- case _2.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value:
570
+ case _stellarBase.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value:
571
571
  {
572
572
  var fn = entry.functionV0();
573
573
  var fnName = fn.name().toString();
@@ -576,7 +576,7 @@ var ContractSpec = exports.ContractSpec = function () {
576
576
  definitions[fnName] = input;
577
577
  break;
578
578
  }
579
- case _2.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0().value:
579
+ case _stellarBase.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0().value:
580
580
  {}
581
581
  }
582
582
  }
@@ -598,30 +598,30 @@ var ContractSpec = exports.ContractSpec = function () {
598
598
  }();
599
599
  function stringToScVal(str, ty) {
600
600
  switch (ty.value) {
601
- case _2.xdr.ScSpecType.scSpecTypeString().value:
602
- return _2.xdr.ScVal.scvString(str);
603
- case _2.xdr.ScSpecType.scSpecTypeSymbol().value:
604
- return _2.xdr.ScVal.scvSymbol(str);
605
- case _2.xdr.ScSpecType.scSpecTypeAddress().value:
601
+ case _stellarBase.xdr.ScSpecType.scSpecTypeString().value:
602
+ return _stellarBase.xdr.ScVal.scvString(str);
603
+ case _stellarBase.xdr.ScSpecType.scSpecTypeSymbol().value:
604
+ return _stellarBase.xdr.ScVal.scvSymbol(str);
605
+ case _stellarBase.xdr.ScSpecType.scSpecTypeAddress().value:
606
606
  {
607
- var addr = _2.Address.fromString(str);
608
- return _2.xdr.ScVal.scvAddress(addr.toScAddress());
607
+ var addr = _stellarBase.Address.fromString(str);
608
+ return _stellarBase.xdr.ScVal.scvAddress(addr.toScAddress());
609
609
  }
610
- case _2.xdr.ScSpecType.scSpecTypeU64().value:
611
- return new _2.XdrLargeInt("u64", str).toScVal();
612
- case _2.xdr.ScSpecType.scSpecTypeI64().value:
613
- return new _2.XdrLargeInt("i64", str).toScVal();
614
- case _2.xdr.ScSpecType.scSpecTypeU128().value:
615
- return new _2.XdrLargeInt("u128", str).toScVal();
616
- case _2.xdr.ScSpecType.scSpecTypeI128().value:
617
- return new _2.XdrLargeInt("i128", str).toScVal();
618
- case _2.xdr.ScSpecType.scSpecTypeU256().value:
619
- return new _2.XdrLargeInt("u256", str).toScVal();
620
- case _2.xdr.ScSpecType.scSpecTypeI256().value:
621
- return new _2.XdrLargeInt("i256", str).toScVal();
622
- case _2.xdr.ScSpecType.scSpecTypeBytes().value:
623
- case _2.xdr.ScSpecType.scSpecTypeBytesN().value:
624
- return _2.xdr.ScVal.scvBytes(Buffer.from(str, "base64"));
610
+ case _stellarBase.xdr.ScSpecType.scSpecTypeU64().value:
611
+ return new _stellarBase.XdrLargeInt("u64", str).toScVal();
612
+ case _stellarBase.xdr.ScSpecType.scSpecTypeI64().value:
613
+ return new _stellarBase.XdrLargeInt("i64", str).toScVal();
614
+ case _stellarBase.xdr.ScSpecType.scSpecTypeU128().value:
615
+ return new _stellarBase.XdrLargeInt("u128", str).toScVal();
616
+ case _stellarBase.xdr.ScSpecType.scSpecTypeI128().value:
617
+ return new _stellarBase.XdrLargeInt("i128", str).toScVal();
618
+ case _stellarBase.xdr.ScSpecType.scSpecTypeU256().value:
619
+ return new _stellarBase.XdrLargeInt("u256", str).toScVal();
620
+ case _stellarBase.xdr.ScSpecType.scSpecTypeI256().value:
621
+ return new _stellarBase.XdrLargeInt("i256", str).toScVal();
622
+ case _stellarBase.xdr.ScSpecType.scSpecTypeBytes().value:
623
+ case _stellarBase.xdr.ScSpecType.scSpecTypeBytesN().value:
624
+ return _stellarBase.xdr.ScVal.scvBytes(Buffer.from(str, "base64"));
625
625
  default:
626
626
  throw new TypeError("invalid type ".concat(ty.name, " specified for string value"));
627
627
  }
@@ -632,12 +632,12 @@ function isNumeric(field) {
632
632
  function findCase(name) {
633
633
  return function matches(entry) {
634
634
  switch (entry.switch().value) {
635
- case _2.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:
635
+ case _stellarBase.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:
636
636
  {
637
637
  var tuple = entry.tupleCase();
638
638
  return tuple.name().toString() === name;
639
639
  }
640
- case _2.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:
640
+ case _stellarBase.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:
641
641
  {
642
642
  var void_case = entry.voidCase();
643
643
  return void_case.name().toString() === name;
@@ -717,110 +717,110 @@ function typeRef(typeDef) {
717
717
  var value = t.value;
718
718
  var ref;
719
719
  switch (value) {
720
- case _2.xdr.ScSpecType.scSpecTypeVal().value:
720
+ case _stellarBase.xdr.ScSpecType.scSpecTypeVal().value:
721
721
  {
722
722
  ref = "Val";
723
723
  break;
724
724
  }
725
- case _2.xdr.ScSpecType.scSpecTypeBool().value:
725
+ case _stellarBase.xdr.ScSpecType.scSpecTypeBool().value:
726
726
  {
727
727
  return {
728
728
  type: "boolean"
729
729
  };
730
730
  }
731
- case _2.xdr.ScSpecType.scSpecTypeVoid().value:
731
+ case _stellarBase.xdr.ScSpecType.scSpecTypeVoid().value:
732
732
  {
733
733
  return {
734
734
  type: "null"
735
735
  };
736
736
  }
737
- case _2.xdr.ScSpecType.scSpecTypeError().value:
737
+ case _stellarBase.xdr.ScSpecType.scSpecTypeError().value:
738
738
  {
739
739
  ref = "Error";
740
740
  break;
741
741
  }
742
- case _2.xdr.ScSpecType.scSpecTypeU32().value:
742
+ case _stellarBase.xdr.ScSpecType.scSpecTypeU32().value:
743
743
  {
744
744
  ref = "U32";
745
745
  break;
746
746
  }
747
- case _2.xdr.ScSpecType.scSpecTypeI32().value:
747
+ case _stellarBase.xdr.ScSpecType.scSpecTypeI32().value:
748
748
  {
749
749
  ref = "I32";
750
750
  break;
751
751
  }
752
- case _2.xdr.ScSpecType.scSpecTypeU64().value:
752
+ case _stellarBase.xdr.ScSpecType.scSpecTypeU64().value:
753
753
  {
754
754
  ref = "U64";
755
755
  break;
756
756
  }
757
- case _2.xdr.ScSpecType.scSpecTypeI64().value:
757
+ case _stellarBase.xdr.ScSpecType.scSpecTypeI64().value:
758
758
  {
759
759
  ref = "I64";
760
760
  break;
761
761
  }
762
- case _2.xdr.ScSpecType.scSpecTypeTimepoint().value:
762
+ case _stellarBase.xdr.ScSpecType.scSpecTypeTimepoint().value:
763
763
  {
764
764
  throw new Error("Timepoint type not supported");
765
765
  ref = "Timepoint";
766
766
  break;
767
767
  }
768
- case _2.xdr.ScSpecType.scSpecTypeDuration().value:
768
+ case _stellarBase.xdr.ScSpecType.scSpecTypeDuration().value:
769
769
  {
770
770
  throw new Error("Duration not supported");
771
771
  ref = "Duration";
772
772
  break;
773
773
  }
774
- case _2.xdr.ScSpecType.scSpecTypeU128().value:
774
+ case _stellarBase.xdr.ScSpecType.scSpecTypeU128().value:
775
775
  {
776
776
  ref = "U128";
777
777
  break;
778
778
  }
779
- case _2.xdr.ScSpecType.scSpecTypeI128().value:
779
+ case _stellarBase.xdr.ScSpecType.scSpecTypeI128().value:
780
780
  {
781
781
  ref = "I128";
782
782
  break;
783
783
  }
784
- case _2.xdr.ScSpecType.scSpecTypeU256().value:
784
+ case _stellarBase.xdr.ScSpecType.scSpecTypeU256().value:
785
785
  {
786
786
  ref = "U256";
787
787
  break;
788
788
  }
789
- case _2.xdr.ScSpecType.scSpecTypeI256().value:
789
+ case _stellarBase.xdr.ScSpecType.scSpecTypeI256().value:
790
790
  {
791
791
  ref = "I256";
792
792
  break;
793
793
  }
794
- case _2.xdr.ScSpecType.scSpecTypeBytes().value:
794
+ case _stellarBase.xdr.ScSpecType.scSpecTypeBytes().value:
795
795
  {
796
796
  ref = "DataUrl";
797
797
  break;
798
798
  }
799
- case _2.xdr.ScSpecType.scSpecTypeString().value:
799
+ case _stellarBase.xdr.ScSpecType.scSpecTypeString().value:
800
800
  {
801
801
  ref = "ScString";
802
802
  break;
803
803
  }
804
- case _2.xdr.ScSpecType.scSpecTypeSymbol().value:
804
+ case _stellarBase.xdr.ScSpecType.scSpecTypeSymbol().value:
805
805
  {
806
806
  ref = "ScSymbol";
807
807
  break;
808
808
  }
809
- case _2.xdr.ScSpecType.scSpecTypeAddress().value:
809
+ case _stellarBase.xdr.ScSpecType.scSpecTypeAddress().value:
810
810
  {
811
811
  ref = "Address";
812
812
  break;
813
813
  }
814
- case _2.xdr.ScSpecType.scSpecTypeOption().value:
814
+ case _stellarBase.xdr.ScSpecType.scSpecTypeOption().value:
815
815
  {
816
816
  var opt = typeDef.option();
817
817
  return typeRef(opt.valueType());
818
818
  }
819
- case _2.xdr.ScSpecType.scSpecTypeResult().value:
819
+ case _stellarBase.xdr.ScSpecType.scSpecTypeResult().value:
820
820
  {
821
821
  break;
822
822
  }
823
- case _2.xdr.ScSpecType.scSpecTypeVec().value:
823
+ case _stellarBase.xdr.ScSpecType.scSpecTypeVec().value:
824
824
  {
825
825
  var arr = typeDef.vec();
826
826
  var _ref3 = typeRef(arr.elementType());
@@ -829,7 +829,7 @@ function typeRef(typeDef) {
829
829
  items: _ref3
830
830
  };
831
831
  }
832
- case _2.xdr.ScSpecType.scSpecTypeMap().value:
832
+ case _stellarBase.xdr.ScSpecType.scSpecTypeMap().value:
833
833
  {
834
834
  var map = typeDef.map();
835
835
  var items = [typeRef(map.keyType()), typeRef(map.valueType())];
@@ -843,7 +843,7 @@ function typeRef(typeDef) {
843
843
  }
844
844
  };
845
845
  }
846
- case _2.xdr.ScSpecType.scSpecTypeTuple().value:
846
+ case _stellarBase.xdr.ScSpecType.scSpecTypeTuple().value:
847
847
  {
848
848
  var tuple = typeDef.tuple();
849
849
  var minItems = tuple.valueTypes().length;
@@ -856,7 +856,7 @@ function typeRef(typeDef) {
856
856
  maxItems: maxItems
857
857
  };
858
858
  }
859
- case _2.xdr.ScSpecType.scSpecTypeBytesN().value:
859
+ case _stellarBase.xdr.ScSpecType.scSpecTypeBytesN().value:
860
860
  {
861
861
  var _arr = typeDef.bytesN();
862
862
  return {
@@ -864,7 +864,7 @@ function typeRef(typeDef) {
864
864
  maxLength: _arr.n()
865
865
  };
866
866
  }
867
- case _2.xdr.ScSpecType.scSpecTypeUdt().value:
867
+ case _stellarBase.xdr.ScSpecType.scSpecTypeUdt().value:
868
868
  {
869
869
  var udt = typeDef.udt();
870
870
  ref = udt.name().toString();
@@ -876,7 +876,7 @@ function typeRef(typeDef) {
876
876
  };
877
877
  }
878
878
  function isRequired(typeDef) {
879
- return typeDef.switch().value != _2.xdr.ScSpecType.scSpecTypeOption().value;
879
+ return typeDef.switch().value != _stellarBase.xdr.ScSpecType.scSpecTypeOption().value;
880
880
  }
881
881
  function structToJsonSchema(udt) {
882
882
  var fields = udt.fields();
@@ -952,7 +952,7 @@ function functionToJsonSchema(func) {
952
952
  }
953
953
  };
954
954
  var outputs = func.outputs();
955
- var output = outputs.length > 0 ? typeRef(outputs[0]) : typeRef(_2.xdr.ScSpecTypeDef.scSpecTypeVoid());
955
+ var output = outputs.length > 0 ? typeRef(outputs[0]) : typeRef(_stellarBase.xdr.ScSpecTypeDef.scSpecTypeVoid());
956
956
  var description = func.doc().toString();
957
957
  if (description.length > 0) {
958
958
  input.description = description;
@@ -974,7 +974,7 @@ function unionToJsonSchema(udt) {
974
974
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
975
975
  var case_ = _step3.value;
976
976
  switch (case_.switch().value) {
977
- case _2.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:
977
+ case _stellarBase.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:
978
978
  {
979
979
  var c = case_.voidCase();
980
980
  var title = c.name().toString();
@@ -989,7 +989,7 @@ function unionToJsonSchema(udt) {
989
989
  });
990
990
  break;
991
991
  }
992
- case _2.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:
992
+ case _stellarBase.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:
993
993
  {
994
994
  var _c = case_.tupleCase();
995
995
  var _title = _c.name().toString();