@stellar/stellar-sdk 12.0.0 → 12.1.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 (97) hide show
  1. package/CHANGELOG.md +116 -1
  2. package/README.md +1 -1
  3. package/dist/stellar-sdk.js +3089 -1219
  4. package/dist/stellar-sdk.min.js +1 -1
  5. package/lib/browser.js +1 -1
  6. package/lib/config.js +3 -3
  7. package/lib/{contract_client → contract}/assembled_transaction.d.ts +154 -59
  8. package/lib/{contract_client → contract}/assembled_transaction.js +403 -187
  9. package/lib/{contract_client → contract}/basic_node_signer.d.ts +2 -2
  10. package/lib/{contract_client → contract}/basic_node_signer.js +5 -5
  11. package/lib/contract/client.d.ts +53 -0
  12. package/lib/contract/client.js +180 -0
  13. package/lib/contract/index.d.ts +8 -0
  14. package/lib/{contract_client → contract}/index.js +37 -9
  15. package/lib/{rust_types/result.js → contract/rust_result.js} +3 -3
  16. package/lib/{contract_client → contract}/sent_transaction.d.ts +27 -18
  17. package/lib/{contract_client → contract}/sent_transaction.js +49 -47
  18. package/lib/{contract_spec.d.ts → contract/spec.d.ts} +3 -3
  19. package/lib/{contract_spec.js → contract/spec.js} +169 -169
  20. package/lib/{contract_client → contract}/types.d.ts +15 -8
  21. package/lib/contract/utils.d.ts +44 -0
  22. package/lib/{contract_client → contract}/utils.js +47 -5
  23. package/lib/errors.js +10 -10
  24. package/lib/federation/server.js +10 -10
  25. package/lib/horizon/account_call_builder.d.ts +1 -0
  26. package/lib/horizon/account_call_builder.js +8 -8
  27. package/lib/horizon/account_response.js +7 -7
  28. package/lib/horizon/assets_call_builder.d.ts +1 -0
  29. package/lib/horizon/assets_call_builder.js +8 -8
  30. package/lib/horizon/call_builder.js +6 -6
  31. package/lib/horizon/claimable_balances_call_builder.d.ts +1 -0
  32. package/lib/horizon/claimable_balances_call_builder.js +8 -8
  33. package/lib/horizon/effect_call_builder.d.ts +1 -0
  34. package/lib/horizon/effect_call_builder.js +8 -8
  35. package/lib/horizon/friendbot_builder.d.ts +1 -0
  36. package/lib/horizon/friendbot_builder.js +8 -8
  37. package/lib/horizon/horizon_api.d.ts +1 -0
  38. package/lib/horizon/horizon_axios_client.js +1 -1
  39. package/lib/horizon/ledger_call_builder.d.ts +1 -0
  40. package/lib/horizon/ledger_call_builder.js +8 -8
  41. package/lib/horizon/liquidity_pool_call_builder.d.ts +1 -0
  42. package/lib/horizon/liquidity_pool_call_builder.js +8 -8
  43. package/lib/horizon/offer_call_builder.d.ts +1 -0
  44. package/lib/horizon/offer_call_builder.js +8 -8
  45. package/lib/horizon/operation_call_builder.d.ts +1 -0
  46. package/lib/horizon/operation_call_builder.js +8 -8
  47. package/lib/horizon/orderbook_call_builder.d.ts +1 -0
  48. package/lib/horizon/orderbook_call_builder.js +8 -8
  49. package/lib/horizon/path_call_builder.d.ts +1 -0
  50. package/lib/horizon/path_call_builder.js +8 -8
  51. package/lib/horizon/payment_call_builder.d.ts +1 -0
  52. package/lib/horizon/payment_call_builder.js +8 -8
  53. package/lib/horizon/server.js +6 -6
  54. package/lib/horizon/strict_receive_path_call_builder.d.ts +1 -0
  55. package/lib/horizon/strict_receive_path_call_builder.js +8 -8
  56. package/lib/horizon/strict_send_path_call_builder.d.ts +1 -0
  57. package/lib/horizon/strict_send_path_call_builder.js +8 -8
  58. package/lib/horizon/trade_aggregation_call_builder.d.ts +1 -0
  59. package/lib/horizon/trade_aggregation_call_builder.js +8 -8
  60. package/lib/horizon/trades_call_builder.d.ts +1 -0
  61. package/lib/horizon/trades_call_builder.js +8 -8
  62. package/lib/horizon/transaction_call_builder.d.ts +1 -0
  63. package/lib/horizon/transaction_call_builder.js +8 -8
  64. package/lib/index.d.ts +27 -2
  65. package/lib/index.js +10 -16
  66. package/lib/{soroban → rpc}/api.d.ts +25 -10
  67. package/lib/{soroban → rpc}/axios.js +1 -1
  68. package/lib/{soroban → rpc}/browser.js +1 -1
  69. package/lib/rpc/index.d.ts +8 -0
  70. package/lib/{soroban → rpc}/index.js +1 -1
  71. package/lib/{soroban → rpc}/jsonrpc.js +3 -3
  72. package/lib/{soroban → rpc}/parsers.js +12 -3
  73. package/lib/{soroban → rpc}/server.d.ts +50 -0
  74. package/lib/{soroban → rpc}/server.js +209 -128
  75. package/lib/stellartoml/index.js +6 -6
  76. package/lib/utils.js +3 -3
  77. package/lib/webauth/errors.js +10 -10
  78. package/lib/webauth/utils.js +9 -9
  79. package/package.json +38 -30
  80. package/lib/contract_client/client.d.ts +0 -17
  81. package/lib/contract_client/client.js +0 -57
  82. package/lib/contract_client/index.d.ts +0 -6
  83. package/lib/contract_client/utils.d.ts +0 -23
  84. package/lib/rust_types/index.d.ts +0 -1
  85. package/lib/rust_types/index.js +0 -16
  86. package/lib/soroban/index.d.ts +0 -7
  87. /package/lib/{rust_types/result.d.ts → contract/rust_result.d.ts} +0 -0
  88. /package/lib/{contract_client → contract}/types.js +0 -0
  89. /package/lib/{soroban → rpc}/api.js +0 -0
  90. /package/lib/{soroban → rpc}/axios.d.ts +0 -0
  91. /package/lib/{soroban → rpc}/browser.d.ts +0 -0
  92. /package/lib/{soroban → rpc}/jsonrpc.d.ts +0 -0
  93. /package/lib/{soroban → rpc}/parsers.d.ts +0 -0
  94. /package/lib/{soroban → rpc}/transaction.d.ts +0 -0
  95. /package/lib/{soroban → rpc}/transaction.js +0 -0
  96. /package/lib/{soroban → rpc}/utils.d.ts +0 -0
  97. /package/lib/{soroban → rpc}/utils.js +0 -0
@@ -4,39 +4,44 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.NULL_ACCOUNT = exports.AssembledTransaction = void 0;
7
- var _ = require("..");
8
- var _rust_types = require("../rust_types");
7
+ var _stellarBase = require("@stellar/stellar-base");
8
+ var _server = require("../rpc/server");
9
+ var _api = require("../rpc/api");
10
+ var _transaction = require("../rpc/transaction");
11
+ var _rust_result = require("./rust_result");
9
12
  var _utils = require("./utils");
10
13
  var _sent_transaction = require("./sent_transaction");
11
14
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
12
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
13
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
14
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
15
- function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
15
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
16
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
17
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
18
+ function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }
16
19
  function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }
17
20
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
- function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
19
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
20
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21
+ function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } }
22
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
23
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
21
24
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
22
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
25
+ 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; }
26
+ 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; }
27
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
23
28
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24
29
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
25
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
26
- 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; } } }; }
27
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
28
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
29
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
30
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
31
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
32
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
30
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
31
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
33
32
  function _regeneratorRuntime() { "use strict"; _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
34
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
35
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
36
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
37
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
38
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
39
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
34
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
35
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
36
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
37
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
38
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
39
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
40
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
41
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
42
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
43
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
44
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
40
45
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
41
46
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
42
47
  var NULL_ACCOUNT = exports.NULL_ACCOUNT = "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";
@@ -47,42 +52,91 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
47
52
  _this$options$allowHt;
48
53
  _classCallCheck(this, AssembledTransaction);
49
54
  _defineProperty(this, "simulate", _asyncToGenerator(_regeneratorRuntime().mark(function _callee() {
55
+ var _restore;
56
+ var _ref2,
57
+ restore,
58
+ account,
59
+ result,
60
+ _this$options$fee,
61
+ _this$options$args,
62
+ _this$options$timeout,
63
+ contract,
64
+ _args = arguments;
50
65
  return _regeneratorRuntime().wrap(function _callee$(_context) {
51
66
  while (1) switch (_context.prev = _context.next) {
52
67
  case 0:
68
+ _ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, restore = _ref2.restore;
69
+ if (_this.built) {
70
+ _context.next = 5;
71
+ break;
72
+ }
53
73
  if (_this.raw) {
54
- _context.next = 2;
74
+ _context.next = 4;
55
75
  break;
56
76
  }
57
- throw new Error('Transaction has not yet been assembled; ' + 'call `AssembledTransaction.build` first.');
58
- case 2:
77
+ throw new Error("Transaction has not yet been assembled; " + "call `AssembledTransaction.build` first.");
78
+ case 4:
59
79
  _this.built = _this.raw.build();
60
- _context.next = 5;
61
- return _this.server.simulateTransaction(_this.built);
62
80
  case 5:
81
+ restore = (_restore = restore) !== null && _restore !== void 0 ? _restore : _this.options.restore;
82
+ delete _this.simulationResult;
83
+ delete _this.simulationTransactionData;
84
+ _context.next = 10;
85
+ return _this.server.simulateTransaction(_this.built);
86
+ case 10:
63
87
  _this.simulation = _context.sent;
64
- if (_.SorobanRpc.Api.isSimulationSuccess(_this.simulation)) {
65
- _this.built = _.SorobanRpc.assembleTransaction(_this.built, _this.simulation).build();
88
+ if (!(restore && _api.Api.isSimulationRestore(_this.simulation))) {
89
+ _context.next = 25;
90
+ break;
91
+ }
92
+ _context.next = 14;
93
+ return (0, _utils.getAccount)(_this.options, _this.server);
94
+ case 14:
95
+ account = _context.sent;
96
+ _context.next = 17;
97
+ return _this.restoreFootprint(_this.simulation.restorePreamble, account);
98
+ case 17:
99
+ result = _context.sent;
100
+ if (!(result.status === _api.Api.GetTransactionStatus.SUCCESS)) {
101
+ _context.next = 24;
102
+ break;
66
103
  }
104
+ contract = new _stellarBase.Contract(_this.options.contractId);
105
+ _this.raw = new _stellarBase.TransactionBuilder(account, {
106
+ fee: (_this$options$fee = _this.options.fee) !== null && _this$options$fee !== void 0 ? _this$options$fee : _stellarBase.BASE_FEE,
107
+ networkPassphrase: _this.options.networkPassphrase
108
+ }).addOperation(contract.call.apply(contract, [_this.options.method].concat(_toConsumableArray((_this$options$args = _this.options.args) !== null && _this$options$args !== void 0 ? _this$options$args : [])))).setTimeout((_this$options$timeout = _this.options.timeoutInSeconds) !== null && _this$options$timeout !== void 0 ? _this$options$timeout : _utils.DEFAULT_TIMEOUT);
109
+ _context.next = 23;
110
+ return _this.simulate();
111
+ case 23:
67
112
  return _context.abrupt("return", _this);
68
- case 8:
113
+ case 24:
114
+ throw new AssembledTransaction.Errors.RestorationFailure("Automatic restore failed! You set 'restore: true' but the attempted restore did not work. Result:\n".concat(JSON.stringify(result)));
115
+ case 25:
116
+ if (_api.Api.isSimulationSuccess(_this.simulation)) {
117
+ _this.built = (0, _transaction.assembleTransaction)(_this.built, _this.simulation).build();
118
+ }
119
+ return _context.abrupt("return", _this);
120
+ case 27:
69
121
  case "end":
70
122
  return _context.stop();
71
123
  }
72
124
  }, _callee);
73
125
  })));
74
- _defineProperty(this, "signAndSend", _asyncToGenerator(_regeneratorRuntime().mark(function _callee2() {
75
- var _ref3,
76
- _ref3$force,
126
+ _defineProperty(this, "sign", _asyncToGenerator(_regeneratorRuntime().mark(function _callee2() {
127
+ var _this$options$timeout2;
128
+ var _ref4,
129
+ _ref4$force,
77
130
  force,
78
- _ref3$signTransaction,
131
+ _ref4$signTransaction,
79
132
  signTransaction,
80
- typeChecked,
133
+ timeoutInSeconds,
134
+ signature,
81
135
  _args2 = arguments;
82
136
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
83
137
  while (1) switch (_context2.prev = _context2.next) {
84
138
  case 0:
85
- _ref3 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, _ref3$force = _ref3.force, force = _ref3$force === void 0 ? false : _ref3$force, _ref3$signTransaction = _ref3.signTransaction, signTransaction = _ref3$signTransaction === void 0 ? _this.options.signTransaction : _ref3$signTransaction;
139
+ _ref4 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, _ref4$force = _ref4.force, force = _ref4$force === void 0 ? false : _ref4$force, _ref4$signTransaction = _ref4.signTransaction, signTransaction = _ref4$signTransaction === void 0 ? _this.options.signTransaction : _ref4$signTransaction;
86
140
  if (_this.built) {
87
141
  _context2.next = 3;
88
142
  break;
@@ -99,93 +153,109 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
99
153
  _context2.next = 7;
100
154
  break;
101
155
  }
102
- throw new AssembledTransaction.Errors.NoSigner("You must provide a signTransaction function, either when calling " + "`signAndSend` or when initializing your ContractClient");
156
+ throw new AssembledTransaction.Errors.NoSigner("You must provide a signTransaction function, either when calling " + "`signAndSend` or when initializing your Client");
103
157
  case 7:
104
- _context2.next = 9;
105
- return _this.needsNonInvokerSigningBy();
106
- case 9:
107
- if (!_context2.sent.length) {
108
- _context2.next = 11;
158
+ if (!_this.needsNonInvokerSigningBy().length) {
159
+ _context2.next = 9;
109
160
  break;
110
161
  }
111
162
  throw new AssembledTransaction.Errors.NeedsMoreSignatures("Transaction requires more signatures. " + "See `needsNonInvokerSigningBy` for details.");
112
- case 11:
113
- typeChecked = _this;
114
- _context2.next = 14;
115
- return _sent_transaction.SentTransaction.init(signTransaction, typeChecked);
116
- case 14:
117
- return _context2.abrupt("return", _context2.sent);
163
+ case 9:
164
+ timeoutInSeconds = (_this$options$timeout2 = _this.options.timeoutInSeconds) !== null && _this$options$timeout2 !== void 0 ? _this$options$timeout2 : _utils.DEFAULT_TIMEOUT;
165
+ _this.built = _stellarBase.TransactionBuilder.cloneFrom(_this.built, {
166
+ fee: _this.built.fee,
167
+ timebounds: undefined,
168
+ sorobanData: _this.simulationData.transactionData
169
+ }).setTimeout(timeoutInSeconds).build();
170
+ _context2.next = 13;
171
+ return signTransaction(_this.built.toXDR(), {
172
+ networkPassphrase: _this.options.networkPassphrase
173
+ });
174
+ case 13:
175
+ signature = _context2.sent;
176
+ _this.signed = _stellarBase.TransactionBuilder.fromXDR(signature, _this.options.networkPassphrase);
118
177
  case 15:
119
178
  case "end":
120
179
  return _context2.stop();
121
180
  }
122
181
  }, _callee2);
123
182
  })));
124
- _defineProperty(this, "getStorageExpiration", _asyncToGenerator(_regeneratorRuntime().mark(function _callee3() {
125
- var entryRes;
183
+ _defineProperty(this, "signAndSend", _asyncToGenerator(_regeneratorRuntime().mark(function _callee3() {
184
+ var _ref6,
185
+ _ref6$force,
186
+ force,
187
+ _ref6$signTransaction,
188
+ signTransaction,
189
+ _args3 = arguments;
126
190
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
127
191
  while (1) switch (_context3.prev = _context3.next) {
128
192
  case 0:
129
- _context3.next = 2;
130
- return _this.server.getLedgerEntries(new _.Contract(_this.options.contractId).getFootprint());
131
- case 2:
132
- entryRes = _context3.sent;
133
- if (!(!entryRes.entries || !entryRes.entries.length || !entryRes.entries[0].liveUntilLedgerSeq)) {
134
- _context3.next = 5;
193
+ _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, _ref6$force = _ref6.force, force = _ref6$force === void 0 ? false : _ref6$force, _ref6$signTransaction = _ref6.signTransaction, signTransaction = _ref6$signTransaction === void 0 ? _this.options.signTransaction : _ref6$signTransaction;
194
+ if (_this.signed) {
195
+ _context3.next = 4;
135
196
  break;
136
197
  }
137
- throw new Error("failed to get ledger entry");
198
+ _context3.next = 4;
199
+ return _this.sign({
200
+ force: force,
201
+ signTransaction: signTransaction
202
+ });
203
+ case 4:
204
+ return _context3.abrupt("return", _this.send());
138
205
  case 5:
139
- return _context3.abrupt("return", entryRes.entries[0].liveUntilLedgerSeq);
140
- case 6:
141
206
  case "end":
142
207
  return _context3.stop();
143
208
  }
144
209
  }, _callee3);
145
210
  })));
146
- _defineProperty(this, "needsNonInvokerSigningBy", _asyncToGenerator(_regeneratorRuntime().mark(function _callee4() {
147
- var _rawInvokeHostFunctio;
148
- var _ref6,
149
- _ref6$includeAlreadyS,
150
- includeAlreadySigned,
151
- rawInvokeHostFunctionOp,
152
- _args4 = arguments;
211
+ _defineProperty(this, "getStorageExpiration", _asyncToGenerator(_regeneratorRuntime().mark(function _callee4() {
212
+ var entryRes;
153
213
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
154
214
  while (1) switch (_context4.prev = _context4.next) {
155
215
  case 0:
156
- _ref6 = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, _ref6$includeAlreadyS = _ref6.includeAlreadySigned, includeAlreadySigned = _ref6$includeAlreadyS === void 0 ? false : _ref6$includeAlreadyS;
157
- if (_this.built) {
158
- _context4.next = 3;
159
- break;
160
- }
161
- throw new Error("Transaction has not yet been simulated");
162
- case 3:
163
- if ("operations" in _this.built) {
216
+ _context4.next = 2;
217
+ return _this.server.getLedgerEntries(new _stellarBase.Contract(_this.options.contractId).getFootprint());
218
+ case 2:
219
+ entryRes = _context4.sent;
220
+ if (!(!entryRes.entries || !entryRes.entries.length || !entryRes.entries[0].liveUntilLedgerSeq)) {
164
221
  _context4.next = 5;
165
222
  break;
166
223
  }
167
- throw new Error("Unexpected Transaction type; no operations: ".concat(JSON.stringify(_this.built)));
224
+ throw new Error("failed to get ledger entry");
168
225
  case 5:
169
- rawInvokeHostFunctionOp = _this.built.operations[0];
170
- return _context4.abrupt("return", _toConsumableArray(new Set(((_rawInvokeHostFunctio = rawInvokeHostFunctionOp.auth) !== null && _rawInvokeHostFunctio !== void 0 ? _rawInvokeHostFunctio : []).filter(function (entry) {
171
- return entry.credentials().switch() === _.xdr.SorobanCredentialsType.sorobanCredentialsAddress() && (includeAlreadySigned || entry.credentials().address().signature().switch().name === "scvVoid");
172
- }).map(function (entry) {
173
- return _.StrKey.encodeEd25519PublicKey(entry.credentials().address().address().accountId().ed25519());
174
- }))));
175
- case 7:
226
+ return _context4.abrupt("return", entryRes.entries[0].liveUntilLedgerSeq);
227
+ case 6:
176
228
  case "end":
177
229
  return _context4.stop();
178
230
  }
179
231
  }, _callee4);
180
232
  })));
233
+ _defineProperty(this, "needsNonInvokerSigningBy", function () {
234
+ var _rawInvokeHostFunctio;
235
+ var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
236
+ _ref8$includeAlreadyS = _ref8.includeAlreadySigned,
237
+ includeAlreadySigned = _ref8$includeAlreadyS === void 0 ? false : _ref8$includeAlreadyS;
238
+ if (!_this.built) {
239
+ throw new Error("Transaction has not yet been simulated");
240
+ }
241
+ if (!("operations" in _this.built)) {
242
+ throw new Error("Unexpected Transaction type; no operations: ".concat(JSON.stringify(_this.built)));
243
+ }
244
+ var rawInvokeHostFunctionOp = _this.built.operations[0];
245
+ return _toConsumableArray(new Set(((_rawInvokeHostFunctio = rawInvokeHostFunctionOp.auth) !== null && _rawInvokeHostFunctio !== void 0 ? _rawInvokeHostFunctio : []).filter(function (entry) {
246
+ return entry.credentials().switch() === _stellarBase.xdr.SorobanCredentialsType.sorobanCredentialsAddress() && (includeAlreadySigned || entry.credentials().address().signature().switch().name === "scvVoid");
247
+ }).map(function (entry) {
248
+ return _stellarBase.StrKey.encodeEd25519PublicKey(entry.credentials().address().address().accountId().ed25519());
249
+ })));
250
+ });
181
251
  _defineProperty(this, "signAuthEntries", _asyncToGenerator(_regeneratorRuntime().mark(function _callee6() {
182
252
  var _rawInvokeHostFunctio2;
183
- var _ref8,
184
- _ref8$expiration,
253
+ var _ref10,
254
+ _ref10$expiration,
185
255
  expiration,
186
- _ref8$signAuthEntry,
256
+ _ref10$signAuthEntry,
187
257
  signAuthEntry,
188
- _ref8$publicKey,
258
+ _ref10$publicKey,
189
259
  publicKey,
190
260
  needsNonInvokerSigningBy,
191
261
  rawInvokeHostFunctionOp,
@@ -200,63 +270,60 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
200
270
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
201
271
  while (1) switch (_context6.prev = _context6.next) {
202
272
  case 0:
203
- _ref8 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, _ref8$expiration = _ref8.expiration, expiration = _ref8$expiration === void 0 ? _this.getStorageExpiration() : _ref8$expiration, _ref8$signAuthEntry = _ref8.signAuthEntry, signAuthEntry = _ref8$signAuthEntry === void 0 ? _this.options.signAuthEntry : _ref8$signAuthEntry, _ref8$publicKey = _ref8.publicKey, publicKey = _ref8$publicKey === void 0 ? _this.options.publicKey : _ref8$publicKey;
273
+ _ref10 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, _ref10$expiration = _ref10.expiration, expiration = _ref10$expiration === void 0 ? _this.getStorageExpiration() : _ref10$expiration, _ref10$signAuthEntry = _ref10.signAuthEntry, signAuthEntry = _ref10$signAuthEntry === void 0 ? _this.options.signAuthEntry : _ref10$signAuthEntry, _ref10$publicKey = _ref10.publicKey, publicKey = _ref10$publicKey === void 0 ? _this.options.publicKey : _ref10$publicKey;
204
274
  if (_this.built) {
205
275
  _context6.next = 3;
206
276
  break;
207
277
  }
208
278
  throw new Error("Transaction has not yet been assembled or simulated");
209
279
  case 3:
210
- _context6.next = 5;
211
- return _this.needsNonInvokerSigningBy();
212
- case 5:
213
- needsNonInvokerSigningBy = _context6.sent;
280
+ needsNonInvokerSigningBy = _this.needsNonInvokerSigningBy();
214
281
  if (needsNonInvokerSigningBy) {
215
- _context6.next = 8;
282
+ _context6.next = 6;
216
283
  break;
217
284
  }
218
285
  throw new AssembledTransaction.Errors.NoUnsignedNonInvokerAuthEntries("No unsigned non-invoker auth entries; maybe you already signed?");
219
- case 8:
220
- if (!(needsNonInvokerSigningBy.indexOf(publicKey !== null && publicKey !== void 0 ? publicKey : '') === -1)) {
221
- _context6.next = 10;
286
+ case 6:
287
+ if (!(needsNonInvokerSigningBy.indexOf(publicKey !== null && publicKey !== void 0 ? publicKey : "") === -1)) {
288
+ _context6.next = 8;
222
289
  break;
223
290
  }
224
291
  throw new AssembledTransaction.Errors.NoSignatureNeeded("No auth entries for public key \"".concat(publicKey, "\""));
225
- case 10:
292
+ case 8:
226
293
  if (signAuthEntry) {
227
- _context6.next = 12;
294
+ _context6.next = 10;
228
295
  break;
229
296
  }
230
- throw new AssembledTransaction.Errors.NoSigner('You must provide `signAuthEntry` when calling `signAuthEntries`, ' + 'or when constructing the `ContractClient` or `AssembledTransaction`');
231
- case 12:
297
+ throw new AssembledTransaction.Errors.NoSigner("You must provide `signAuthEntry` when calling `signAuthEntries`, " + "or when constructing the `Client` or `AssembledTransaction`");
298
+ case 10:
232
299
  rawInvokeHostFunctionOp = _this.built.operations[0];
233
300
  authEntries = (_rawInvokeHostFunctio2 = rawInvokeHostFunctionOp.auth) !== null && _rawInvokeHostFunctio2 !== void 0 ? _rawInvokeHostFunctio2 : [];
234
301
  _iterator = _createForOfIteratorHelper(authEntries.entries());
235
- _context6.prev = 15;
302
+ _context6.prev = 13;
236
303
  _iterator.s();
237
- case 17:
304
+ case 15:
238
305
  if ((_step = _iterator.n()).done) {
239
- _context6.next = 36;
306
+ _context6.next = 34;
240
307
  break;
241
308
  }
242
309
  _step$value = _slicedToArray(_step.value, 2), i = _step$value[0], entry = _step$value[1];
243
- if (!(entry.credentials().switch() !== _.xdr.SorobanCredentialsType.sorobanCredentialsAddress())) {
244
- _context6.next = 21;
310
+ if (!(entry.credentials().switch() !== _stellarBase.xdr.SorobanCredentialsType.sorobanCredentialsAddress())) {
311
+ _context6.next = 19;
245
312
  break;
246
313
  }
247
- return _context6.abrupt("continue", 34);
248
- case 21:
249
- pk = _.StrKey.encodeEd25519PublicKey(entry.credentials().address().address().accountId().ed25519());
314
+ return _context6.abrupt("continue", 32);
315
+ case 19:
316
+ pk = _stellarBase.StrKey.encodeEd25519PublicKey(entry.credentials().address().address().accountId().ed25519());
250
317
  if (!(pk !== publicKey)) {
251
- _context6.next = 24;
318
+ _context6.next = 22;
252
319
  break;
253
320
  }
254
- return _context6.abrupt("continue", 34);
255
- case 24:
256
- _context6.t0 = _.authorizeEntry;
321
+ return _context6.abrupt("continue", 32);
322
+ case 22:
323
+ _context6.t0 = _stellarBase.authorizeEntry;
257
324
  _context6.t1 = entry;
258
325
  _context6.t2 = function () {
259
- var _ref9 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee5(preimage) {
326
+ var _ref11 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee5(preimage) {
260
327
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
261
328
  while (1) switch (_context5.prev = _context5.next) {
262
329
  case 0:
@@ -273,41 +340,41 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
273
340
  }, _callee5);
274
341
  }));
275
342
  return function (_x) {
276
- return _ref9.apply(this, arguments);
343
+ return _ref11.apply(this, arguments);
277
344
  };
278
345
  }();
279
- _context6.next = 29;
346
+ _context6.next = 27;
280
347
  return expiration;
281
- case 29:
348
+ case 27:
282
349
  _context6.t3 = _context6.sent;
283
350
  _context6.t4 = _this.options.networkPassphrase;
284
- _context6.next = 33;
351
+ _context6.next = 31;
285
352
  return (0, _context6.t0)(_context6.t1, _context6.t2, _context6.t3, _context6.t4);
286
- case 33:
353
+ case 31:
287
354
  authEntries[i] = _context6.sent;
355
+ case 32:
356
+ _context6.next = 15;
357
+ break;
288
358
  case 34:
289
- _context6.next = 17;
359
+ _context6.next = 39;
290
360
  break;
291
361
  case 36:
292
- _context6.next = 41;
293
- break;
294
- case 38:
295
- _context6.prev = 38;
296
- _context6.t5 = _context6["catch"](15);
362
+ _context6.prev = 36;
363
+ _context6.t5 = _context6["catch"](13);
297
364
  _iterator.e(_context6.t5);
298
- case 41:
299
- _context6.prev = 41;
365
+ case 39:
366
+ _context6.prev = 39;
300
367
  _iterator.f();
301
- return _context6.finish(41);
302
- case 44:
368
+ return _context6.finish(39);
369
+ case 42:
303
370
  case "end":
304
371
  return _context6.stop();
305
372
  }
306
- }, _callee6, null, [[15, 38, 41, 44]]);
373
+ }, _callee6, null, [[13, 36, 39, 42]]);
307
374
  })));
308
375
  this.options = options;
309
376
  this.options.simulate = (_this$options$simulat = this.options.simulate) !== null && _this$options$simulat !== void 0 ? _this$options$simulat : true;
310
- this.server = new _.SorobanRpc.Server(this.options.rpcUrl, {
377
+ this.server = new _server.Server(this.options.rpcUrl, {
311
378
  allowHttp: (_this$options$allowHt = this.options.allowHttp) !== null && _this$options$allowHt !== void 0 ? _this$options$allowHt : false
312
379
  });
313
380
  }
@@ -327,9 +394,17 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
327
394
  simulationTransactionData: this.simulationData.transactionData.toXDR("base64")
328
395
  });
329
396
  }
397
+ }, {
398
+ key: "toXDR",
399
+ value: function toXDR() {
400
+ var _this$built2;
401
+ if (!this.built) throw new Error("Transaction has not yet been simulated; " + "call `AssembledTransaction.simulate` first.");
402
+ return (_this$built2 = this.built) === null || _this$built2 === void 0 ? void 0 : _this$built2.toEnvelope().toXDR('base64');
403
+ }
330
404
  }, {
331
405
  key: "simulationData",
332
406
  get: function get() {
407
+ var _simulation$result;
333
408
  if (this.simulationResult && this.simulationTransactionData) {
334
409
  return {
335
410
  result: this.simulationResult,
@@ -340,16 +415,16 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
340
415
  if (!simulation) {
341
416
  throw new AssembledTransaction.Errors.NotYetSimulated("Transaction has not yet been simulated");
342
417
  }
343
- if (_.SorobanRpc.Api.isSimulationError(simulation)) {
418
+ if (_api.Api.isSimulationError(simulation)) {
344
419
  throw new Error("Transaction simulation failed: \"".concat(simulation.error, "\""));
345
420
  }
346
- if (_.SorobanRpc.Api.isSimulationRestore(simulation)) {
347
- throw new AssembledTransaction.Errors.ExpiredState("You need to restore some contract state before you can invoke this method. ".concat(JSON.stringify(simulation, null, 2)));
348
- }
349
- if (!simulation.result) {
350
- throw new Error("Expected an invocation simulation, but got no 'result' field. Simulation: ".concat(JSON.stringify(simulation, null, 2)));
421
+ if (_api.Api.isSimulationRestore(simulation)) {
422
+ throw new AssembledTransaction.Errors.ExpiredState("You need to restore some contract state before you can invoke this method.\n" + 'You can set `restore` to true in the method options in order to ' + 'automatically restore the contract state when needed.');
351
423
  }
352
- this.simulationResult = simulation.result;
424
+ this.simulationResult = (_simulation$result = simulation.result) !== null && _simulation$result !== void 0 ? _simulation$result : {
425
+ auth: [],
426
+ retval: _stellarBase.xdr.ScVal.scvVoid()
427
+ };
353
428
  this.simulationTransactionData = simulation.transactionData.build();
354
429
  return {
355
430
  result: this.simulationResult,
@@ -360,6 +435,9 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
360
435
  key: "result",
361
436
  get: function get() {
362
437
  try {
438
+ if (!this.simulationData.result) {
439
+ throw new Error("No simulation result!");
440
+ }
363
441
  return this.options.parseResultXdr(this.simulationData.result.retval);
364
442
  } catch (e) {
365
443
  if (!(0, _utils.implementsToString)(e)) throw e;
@@ -377,8 +455,38 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
377
455
  var i = parseInt(match[1], 10);
378
456
  var err = this.options.errorTypes[i];
379
457
  if (!err) return undefined;
380
- return new _rust_types.Err(err);
458
+ return new _rust_result.Err(err);
381
459
  }
460
+ }, {
461
+ key: "send",
462
+ value: (function () {
463
+ var _send = _asyncToGenerator(_regeneratorRuntime().mark(function _callee7() {
464
+ var sent;
465
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
466
+ while (1) switch (_context7.prev = _context7.next) {
467
+ case 0:
468
+ if (this.signed) {
469
+ _context7.next = 2;
470
+ break;
471
+ }
472
+ throw new Error("The transaction has not yet been signed. Run `sign` first, or use `signAndSend` instead.");
473
+ case 2:
474
+ _context7.next = 4;
475
+ return _sent_transaction.SentTransaction.init(undefined, this);
476
+ case 4:
477
+ sent = _context7.sent;
478
+ return _context7.abrupt("return", sent);
479
+ case 6:
480
+ case "end":
481
+ return _context7.stop();
482
+ }
483
+ }, _callee7, this);
484
+ }));
485
+ function send() {
486
+ return _send.apply(this, arguments);
487
+ }
488
+ return send;
489
+ }())
382
490
  }, {
383
491
  key: "isReadCall",
384
492
  get: function get() {
@@ -386,71 +494,171 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
386
494
  var writeLength = this.simulationData.transactionData.resources().footprint().readWrite().length;
387
495
  return authsCount === 0 && writeLength === 0;
388
496
  }
497
+ }, {
498
+ key: "restoreFootprint",
499
+ value: (function () {
500
+ var _restoreFootprint = _asyncToGenerator(_regeneratorRuntime().mark(function _callee8(restorePreamble, account) {
501
+ var _account;
502
+ var restoreTx, sentTransaction;
503
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
504
+ while (1) switch (_context8.prev = _context8.next) {
505
+ case 0:
506
+ if (this.options.signTransaction) {
507
+ _context8.next = 2;
508
+ break;
509
+ }
510
+ throw new Error("For automatic restore to work you must provide a signTransaction function when initializing your Client");
511
+ case 2:
512
+ if (!((_account = account) !== null && _account !== void 0)) {
513
+ _context8.next = 6;
514
+ break;
515
+ }
516
+ _context8.t0 = _account;
517
+ _context8.next = 9;
518
+ break;
519
+ case 6:
520
+ _context8.next = 8;
521
+ return (0, _utils.getAccount)(this.options, this.server);
522
+ case 8:
523
+ _context8.t0 = _context8.sent;
524
+ case 9:
525
+ account = _context8.t0;
526
+ _context8.next = 12;
527
+ return AssembledTransaction.buildFootprintRestoreTransaction(_objectSpread({}, this.options), restorePreamble.transactionData, account, restorePreamble.minResourceFee);
528
+ case 12:
529
+ restoreTx = _context8.sent;
530
+ _context8.next = 15;
531
+ return restoreTx.signAndSend();
532
+ case 15:
533
+ sentTransaction = _context8.sent;
534
+ if (sentTransaction.getTransactionResponse) {
535
+ _context8.next = 18;
536
+ break;
537
+ }
538
+ throw new AssembledTransaction.Errors.RestorationFailure("The attempt at automatic restore failed. \n".concat(JSON.stringify(sentTransaction)));
539
+ case 18:
540
+ return _context8.abrupt("return", sentTransaction.getTransactionResponse);
541
+ case 19:
542
+ case "end":
543
+ return _context8.stop();
544
+ }
545
+ }, _callee8, this);
546
+ }));
547
+ function restoreFootprint(_x2, _x3) {
548
+ return _restoreFootprint.apply(this, arguments);
549
+ }
550
+ return restoreFootprint;
551
+ }())
389
552
  }], [{
390
553
  key: "fromJSON",
391
- value: function fromJSON(options, _ref10) {
392
- var tx = _ref10.tx,
393
- simulationResult = _ref10.simulationResult,
394
- simulationTransactionData = _ref10.simulationTransactionData;
554
+ value: function fromJSON(options, _ref12) {
555
+ var tx = _ref12.tx,
556
+ simulationResult = _ref12.simulationResult,
557
+ simulationTransactionData = _ref12.simulationTransactionData;
395
558
  var txn = new AssembledTransaction(options);
396
- txn.built = _.TransactionBuilder.fromXDR(tx, options.networkPassphrase);
559
+ txn.built = _stellarBase.TransactionBuilder.fromXDR(tx, options.networkPassphrase);
397
560
  txn.simulationResult = {
398
561
  auth: simulationResult.auth.map(function (a) {
399
- return _.xdr.SorobanAuthorizationEntry.fromXDR(a, "base64");
562
+ return _stellarBase.xdr.SorobanAuthorizationEntry.fromXDR(a, "base64");
400
563
  }),
401
- retval: _.xdr.ScVal.fromXDR(simulationResult.retval, "base64")
564
+ retval: _stellarBase.xdr.ScVal.fromXDR(simulationResult.retval, "base64")
402
565
  };
403
- txn.simulationTransactionData = _.xdr.SorobanTransactionData.fromXDR(simulationTransactionData, "base64");
566
+ txn.simulationTransactionData = _stellarBase.xdr.SorobanTransactionData.fromXDR(simulationTransactionData, "base64");
567
+ return txn;
568
+ }
569
+ }, {
570
+ key: "fromXDR",
571
+ value: function fromXDR(options, encodedXDR, spec) {
572
+ var _operation$func;
573
+ var envelope = _stellarBase.xdr.TransactionEnvelope.fromXDR(encodedXDR, "base64");
574
+ var built = _stellarBase.TransactionBuilder.fromXDR(envelope, options.networkPassphrase);
575
+ var operation = built.operations[0];
576
+ if (!(operation !== null && operation !== void 0 && (_operation$func = operation.func) !== null && _operation$func !== void 0 && _operation$func.value) || typeof operation.func.value !== 'function') {
577
+ throw new Error("Could not extract the method from the transaction envelope.");
578
+ }
579
+ var invokeContractArgs = operation.func.value();
580
+ if (!(invokeContractArgs !== null && invokeContractArgs !== void 0 && invokeContractArgs.functionName)) {
581
+ throw new Error("Could not extract the method name from the transaction envelope.");
582
+ }
583
+ var method = invokeContractArgs.functionName().toString('utf-8');
584
+ var txn = new AssembledTransaction(_objectSpread(_objectSpread({}, options), {}, {
585
+ method: method,
586
+ parseResultXdr: function parseResultXdr(result) {
587
+ return spec.funcResToNative(method, result);
588
+ }
589
+ }));
590
+ txn.built = built;
404
591
  return txn;
405
592
  }
406
593
  }, {
407
594
  key: "build",
408
595
  value: (function () {
409
- var _build = _asyncToGenerator(_regeneratorRuntime().mark(function _callee7(options) {
596
+ var _build = _asyncToGenerator(_regeneratorRuntime().mark(function _callee9(options) {
410
597
  var _options$fee, _options$args, _options$timeoutInSec;
411
598
  var tx, contract, account;
412
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
413
- while (1) switch (_context7.prev = _context7.next) {
599
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
600
+ while (1) switch (_context9.prev = _context9.next) {
414
601
  case 0:
415
602
  tx = new AssembledTransaction(options);
416
- contract = new _.Contract(options.contractId);
417
- if (!options.publicKey) {
418
- _context7.next = 8;
419
- break;
420
- }
421
- _context7.next = 5;
422
- return tx.server.getAccount(options.publicKey);
423
- case 5:
424
- _context7.t0 = _context7.sent;
425
- _context7.next = 9;
426
- break;
427
- case 8:
428
- _context7.t0 = new _.Account(NULL_ACCOUNT, "0");
429
- case 9:
430
- account = _context7.t0;
431
- tx.raw = new _.TransactionBuilder(account, {
432
- fee: (_options$fee = options.fee) !== null && _options$fee !== void 0 ? _options$fee : _.BASE_FEE,
603
+ contract = new _stellarBase.Contract(options.contractId);
604
+ _context9.next = 4;
605
+ return (0, _utils.getAccount)(options, tx.server);
606
+ case 4:
607
+ account = _context9.sent;
608
+ tx.raw = new _stellarBase.TransactionBuilder(account, {
609
+ fee: (_options$fee = options.fee) !== null && _options$fee !== void 0 ? _options$fee : _stellarBase.BASE_FEE,
433
610
  networkPassphrase: options.networkPassphrase
434
611
  }).addOperation(contract.call.apply(contract, [options.method].concat(_toConsumableArray((_options$args = options.args) !== null && _options$args !== void 0 ? _options$args : [])))).setTimeout((_options$timeoutInSec = options.timeoutInSeconds) !== null && _options$timeoutInSec !== void 0 ? _options$timeoutInSec : _utils.DEFAULT_TIMEOUT);
435
612
  if (!options.simulate) {
436
- _context7.next = 14;
613
+ _context9.next = 9;
437
614
  break;
438
615
  }
439
- _context7.next = 14;
616
+ _context9.next = 9;
440
617
  return tx.simulate();
441
- case 14:
442
- return _context7.abrupt("return", tx);
443
- case 15:
618
+ case 9:
619
+ return _context9.abrupt("return", tx);
620
+ case 10:
444
621
  case "end":
445
- return _context7.stop();
622
+ return _context9.stop();
446
623
  }
447
- }, _callee7);
624
+ }, _callee9);
448
625
  }));
449
- function build(_x2) {
626
+ function build(_x4) {
450
627
  return _build.apply(this, arguments);
451
628
  }
452
629
  return build;
453
630
  }())
631
+ }, {
632
+ key: "buildFootprintRestoreTransaction",
633
+ value: function () {
634
+ var _buildFootprintRestoreTransaction = _asyncToGenerator(_regeneratorRuntime().mark(function _callee10(options, sorobanData, account, fee) {
635
+ var _options$timeoutInSec2;
636
+ var tx;
637
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
638
+ while (1) switch (_context10.prev = _context10.next) {
639
+ case 0:
640
+ tx = new AssembledTransaction(options);
641
+ tx.raw = new _stellarBase.TransactionBuilder(account, {
642
+ fee: fee,
643
+ networkPassphrase: options.networkPassphrase
644
+ }).setSorobanData(sorobanData instanceof _stellarBase.SorobanDataBuilder ? sorobanData.build() : sorobanData).addOperation(_stellarBase.Operation.restoreFootprint({})).setTimeout((_options$timeoutInSec2 = options.timeoutInSeconds) !== null && _options$timeoutInSec2 !== void 0 ? _options$timeoutInSec2 : _utils.DEFAULT_TIMEOUT);
645
+ _context10.next = 4;
646
+ return tx.simulate({
647
+ restore: false
648
+ });
649
+ case 4:
650
+ return _context10.abrupt("return", tx);
651
+ case 5:
652
+ case "end":
653
+ return _context10.stop();
654
+ }
655
+ }, _callee10);
656
+ }));
657
+ function buildFootprintRestoreTransaction(_x5, _x6, _x7, _x8) {
658
+ return _buildFootprintRestoreTransaction.apply(this, arguments);
659
+ }
660
+ return buildFootprintRestoreTransaction;
661
+ }()
454
662
  }]);
455
663
  }();
456
664
  _defineProperty(AssembledTransaction, "Errors", {
@@ -462,52 +670,60 @@ _defineProperty(AssembledTransaction, "Errors", {
462
670
  _inherits(ExpiredStateError, _Error);
463
671
  return _createClass(ExpiredStateError);
464
672
  }(_wrapNativeSuper(Error)),
465
- NeedsMoreSignatures: function (_Error2) {
673
+ RestorationFailure: function (_Error2) {
674
+ function RestoreFailureError() {
675
+ _classCallCheck(this, RestoreFailureError);
676
+ return _callSuper(this, RestoreFailureError, arguments);
677
+ }
678
+ _inherits(RestoreFailureError, _Error2);
679
+ return _createClass(RestoreFailureError);
680
+ }(_wrapNativeSuper(Error)),
681
+ NeedsMoreSignatures: function (_Error3) {
466
682
  function NeedsMoreSignaturesError() {
467
683
  _classCallCheck(this, NeedsMoreSignaturesError);
468
684
  return _callSuper(this, NeedsMoreSignaturesError, arguments);
469
685
  }
470
- _inherits(NeedsMoreSignaturesError, _Error2);
686
+ _inherits(NeedsMoreSignaturesError, _Error3);
471
687
  return _createClass(NeedsMoreSignaturesError);
472
688
  }(_wrapNativeSuper(Error)),
473
- NoSignatureNeeded: function (_Error3) {
689
+ NoSignatureNeeded: function (_Error4) {
474
690
  function NoSignatureNeededError() {
475
691
  _classCallCheck(this, NoSignatureNeededError);
476
692
  return _callSuper(this, NoSignatureNeededError, arguments);
477
693
  }
478
- _inherits(NoSignatureNeededError, _Error3);
694
+ _inherits(NoSignatureNeededError, _Error4);
479
695
  return _createClass(NoSignatureNeededError);
480
696
  }(_wrapNativeSuper(Error)),
481
- NoUnsignedNonInvokerAuthEntries: function (_Error4) {
697
+ NoUnsignedNonInvokerAuthEntries: function (_Error5) {
482
698
  function NoUnsignedNonInvokerAuthEntriesError() {
483
699
  _classCallCheck(this, NoUnsignedNonInvokerAuthEntriesError);
484
700
  return _callSuper(this, NoUnsignedNonInvokerAuthEntriesError, arguments);
485
701
  }
486
- _inherits(NoUnsignedNonInvokerAuthEntriesError, _Error4);
702
+ _inherits(NoUnsignedNonInvokerAuthEntriesError, _Error5);
487
703
  return _createClass(NoUnsignedNonInvokerAuthEntriesError);
488
704
  }(_wrapNativeSuper(Error)),
489
- NoSigner: function (_Error5) {
705
+ NoSigner: function (_Error6) {
490
706
  function NoSignerError() {
491
707
  _classCallCheck(this, NoSignerError);
492
708
  return _callSuper(this, NoSignerError, arguments);
493
709
  }
494
- _inherits(NoSignerError, _Error5);
710
+ _inherits(NoSignerError, _Error6);
495
711
  return _createClass(NoSignerError);
496
712
  }(_wrapNativeSuper(Error)),
497
- NotYetSimulated: function (_Error6) {
713
+ NotYetSimulated: function (_Error7) {
498
714
  function NotYetSimulatedError() {
499
715
  _classCallCheck(this, NotYetSimulatedError);
500
716
  return _callSuper(this, NotYetSimulatedError, arguments);
501
717
  }
502
- _inherits(NotYetSimulatedError, _Error6);
718
+ _inherits(NotYetSimulatedError, _Error7);
503
719
  return _createClass(NotYetSimulatedError);
504
720
  }(_wrapNativeSuper(Error)),
505
- FakeAccount: function (_Error7) {
721
+ FakeAccount: function (_Error8) {
506
722
  function FakeAccountError() {
507
723
  _classCallCheck(this, FakeAccountError);
508
724
  return _callSuper(this, FakeAccountError, arguments);
509
725
  }
510
- _inherits(FakeAccountError, _Error7);
726
+ _inherits(FakeAccountError, _Error8);
511
727
  return _createClass(FakeAccountError);
512
728
  }(_wrapNativeSuper(Error))
513
729
  });