@stellar/stellar-sdk 12.0.0 → 12.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +98 -1
- package/README.md +1 -1
- package/dist/stellar-sdk.js +2796 -1194
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/browser.js +1 -1
- package/lib/config.js +3 -3
- package/lib/{contract_client → contract}/assembled_transaction.d.ts +74 -54
- package/lib/{contract_client → contract}/assembled_transaction.js +149 -167
- package/lib/{contract_client → contract}/basic_node_signer.d.ts +2 -2
- package/lib/{contract_client → contract}/basic_node_signer.js +5 -5
- package/lib/contract/client.d.ts +52 -0
- package/lib/contract/client.js +177 -0
- package/lib/contract/index.d.ts +7 -0
- package/lib/{contract_client → contract}/index.js +19 -8
- package/lib/{rust_types/result.js → contract/rust_result.js} +3 -3
- package/lib/{contract_client → contract}/sent_transaction.d.ts +26 -14
- package/lib/{contract_client → contract}/sent_transaction.js +51 -32
- package/lib/{contract_spec.d.ts → contract/spec.d.ts} +3 -3
- package/lib/{contract_spec.js → contract/spec.js} +169 -169
- package/lib/{contract_client → contract}/types.d.ts +10 -8
- package/lib/contract/utils.d.ts +41 -0
- package/lib/{contract_client → contract}/utils.js +15 -5
- package/lib/errors.js +10 -10
- package/lib/federation/server.js +10 -10
- package/lib/horizon/account_call_builder.d.ts +1 -0
- package/lib/horizon/account_call_builder.js +8 -8
- package/lib/horizon/account_response.js +7 -7
- package/lib/horizon/assets_call_builder.d.ts +1 -0
- package/lib/horizon/assets_call_builder.js +8 -8
- package/lib/horizon/call_builder.js +6 -6
- package/lib/horizon/claimable_balances_call_builder.d.ts +1 -0
- package/lib/horizon/claimable_balances_call_builder.js +8 -8
- package/lib/horizon/effect_call_builder.d.ts +1 -0
- package/lib/horizon/effect_call_builder.js +8 -8
- package/lib/horizon/friendbot_builder.d.ts +1 -0
- package/lib/horizon/friendbot_builder.js +8 -8
- package/lib/horizon/horizon_api.d.ts +1 -0
- package/lib/horizon/horizon_axios_client.js +1 -1
- package/lib/horizon/ledger_call_builder.d.ts +1 -0
- package/lib/horizon/ledger_call_builder.js +8 -8
- package/lib/horizon/liquidity_pool_call_builder.d.ts +1 -0
- package/lib/horizon/liquidity_pool_call_builder.js +8 -8
- package/lib/horizon/offer_call_builder.d.ts +1 -0
- package/lib/horizon/offer_call_builder.js +8 -8
- package/lib/horizon/operation_call_builder.d.ts +1 -0
- package/lib/horizon/operation_call_builder.js +8 -8
- package/lib/horizon/orderbook_call_builder.d.ts +1 -0
- package/lib/horizon/orderbook_call_builder.js +8 -8
- package/lib/horizon/path_call_builder.d.ts +1 -0
- package/lib/horizon/path_call_builder.js +8 -8
- package/lib/horizon/payment_call_builder.d.ts +1 -0
- package/lib/horizon/payment_call_builder.js +8 -8
- package/lib/horizon/server.js +6 -6
- package/lib/horizon/strict_receive_path_call_builder.d.ts +1 -0
- package/lib/horizon/strict_receive_path_call_builder.js +8 -8
- package/lib/horizon/strict_send_path_call_builder.d.ts +1 -0
- package/lib/horizon/strict_send_path_call_builder.js +8 -8
- package/lib/horizon/trade_aggregation_call_builder.d.ts +1 -0
- package/lib/horizon/trade_aggregation_call_builder.js +8 -8
- package/lib/horizon/trades_call_builder.d.ts +1 -0
- package/lib/horizon/trades_call_builder.js +8 -8
- package/lib/horizon/transaction_call_builder.d.ts +1 -0
- package/lib/horizon/transaction_call_builder.js +8 -8
- package/lib/index.d.ts +27 -2
- package/lib/index.js +10 -16
- package/lib/{soroban → rpc}/api.d.ts +25 -10
- package/lib/{soroban → rpc}/axios.js +1 -1
- package/lib/{soroban → rpc}/browser.js +1 -1
- package/lib/rpc/index.d.ts +8 -0
- package/lib/{soroban → rpc}/index.js +1 -1
- package/lib/{soroban → rpc}/jsonrpc.js +3 -3
- package/lib/{soroban → rpc}/parsers.js +12 -3
- package/lib/{soroban → rpc}/server.d.ts +50 -0
- package/lib/{soroban → rpc}/server.js +209 -128
- package/lib/stellartoml/index.js +6 -6
- package/lib/utils.js +3 -3
- package/lib/webauth/errors.js +10 -10
- package/lib/webauth/utils.js +9 -9
- package/package.json +32 -15
- package/lib/contract_client/client.d.ts +0 -17
- package/lib/contract_client/client.js +0 -57
- package/lib/contract_client/index.d.ts +0 -6
- package/lib/contract_client/utils.d.ts +0 -23
- package/lib/rust_types/index.d.ts +0 -1
- package/lib/rust_types/index.js +0 -16
- package/lib/soroban/index.d.ts +0 -7
- /package/lib/{rust_types/result.d.ts → contract/rust_result.d.ts} +0 -0
- /package/lib/{contract_client → contract}/types.js +0 -0
- /package/lib/{soroban → rpc}/api.js +0 -0
- /package/lib/{soroban → rpc}/axios.d.ts +0 -0
- /package/lib/{soroban → rpc}/browser.d.ts +0 -0
- /package/lib/{soroban → rpc}/jsonrpc.d.ts +0 -0
- /package/lib/{soroban → rpc}/parsers.d.ts +0 -0
- /package/lib/{soroban → rpc}/transaction.d.ts +0 -0
- /package/lib/{soroban → rpc}/transaction.js +0 -0
- /package/lib/{soroban → rpc}/utils.d.ts +0 -0
- /package/lib/{soroban → rpc}/utils.js +0 -0
package/lib/stellartoml/index.js
CHANGED
|
@@ -7,14 +7,14 @@ exports.STELLAR_TOML_MAX_SIZE = exports.Resolver = exports.Api = void 0;
|
|
|
7
7
|
var _axios = _interopRequireDefault(require("axios"));
|
|
8
8
|
var _toml = _interopRequireDefault(require("toml"));
|
|
9
9
|
var _config = require("../config");
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
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); }
|
|
12
12
|
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; }
|
|
13
|
-
function asyncGeneratorStep(
|
|
14
|
-
function _asyncToGenerator(
|
|
15
|
-
function _classCallCheck(
|
|
16
|
-
function _defineProperties(
|
|
17
|
-
function _createClass(
|
|
13
|
+
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); }
|
|
14
|
+
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); }); }; }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
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); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
19
|
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); }
|
|
20
20
|
var STELLAR_TOML_MAX_SIZE = exports.STELLAR_TOML_MAX_SIZE = 100 * 1024;
|
package/lib/utils.js
CHANGED
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Utils = void 0;
|
|
7
7
|
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); }
|
|
8
|
-
function _classCallCheck(
|
|
9
|
-
function _defineProperties(
|
|
10
|
-
function _createClass(
|
|
8
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
9
|
+
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); } }
|
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
12
|
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); }
|
|
13
13
|
var Utils = exports.Utils = function () {
|
package/lib/webauth/errors.js
CHANGED
|
@@ -5,21 +5,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.InvalidChallengeError = void 0;
|
|
8
|
-
function _defineProperties(
|
|
9
|
-
function _createClass(
|
|
8
|
+
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); } }
|
|
9
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
10
10
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
11
11
|
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); }
|
|
12
|
-
function _classCallCheck(
|
|
12
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
13
13
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
|
-
function _possibleConstructorReturn(
|
|
15
|
-
function _assertThisInitialized(
|
|
16
|
-
function _inherits(
|
|
17
|
-
function _wrapNativeSuper(
|
|
14
|
+
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); }
|
|
15
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
16
|
+
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); }
|
|
17
|
+
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); }
|
|
18
18
|
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; }
|
|
19
19
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
|
-
function _isNativeFunction(
|
|
21
|
-
function _setPrototypeOf(
|
|
22
|
-
function _getPrototypeOf(
|
|
20
|
+
function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } }
|
|
21
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
22
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
23
23
|
var InvalidChallengeError = exports.InvalidChallengeError = function (_Error) {
|
|
24
24
|
function InvalidChallengeError(message) {
|
|
25
25
|
var _this;
|
package/lib/webauth/utils.js
CHANGED
|
@@ -13,18 +13,18 @@ var _randombytes = _interopRequireDefault(require("randombytes"));
|
|
|
13
13
|
var _stellarBase = require("@stellar/stellar-base");
|
|
14
14
|
var _utils = require("../utils");
|
|
15
15
|
var _errors = require("./errors");
|
|
16
|
-
function _interopRequireDefault(
|
|
17
|
-
function _toConsumableArray(
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
18
18
|
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."); }
|
|
19
|
-
function _arrayWithoutHoles(
|
|
20
|
-
function _createForOfIteratorHelper(
|
|
19
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
20
|
+
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; } } }; }
|
|
21
21
|
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 _toArray(
|
|
22
|
+
function _toArray(r) { return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest(); }
|
|
23
23
|
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
|
-
function _unsupportedIterableToArray(
|
|
25
|
-
function _arrayLikeToArray(
|
|
26
|
-
function _iterableToArray(
|
|
27
|
-
function _arrayWithHoles(
|
|
24
|
+
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; } }
|
|
25
|
+
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; }
|
|
26
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
27
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
28
28
|
function buildChallengeTx(serverKeypair, clientAccountID, homeDomain) {
|
|
29
29
|
var timeout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 300;
|
|
30
30
|
var networkPassphrase = arguments.length > 4 ? arguments[4] : undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stellar/stellar-sdk",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.1",
|
|
4
4
|
"description": "A library for working with the Stellar network, including communication with the Horizon and Soroban RPC servers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stellar"
|
|
@@ -23,6 +23,21 @@
|
|
|
23
23
|
"/lib",
|
|
24
24
|
"/dist"
|
|
25
25
|
],
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"browser": "./dist/stellar-sdk.min.js",
|
|
29
|
+
"types": "./lib/index.d.ts",
|
|
30
|
+
"default": "./lib/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./contract": {
|
|
33
|
+
"types": "./lib/contract/index.d.ts",
|
|
34
|
+
"default": "./lib/contract/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./rpc": {
|
|
37
|
+
"types": "./lib/rpc/index.d.ts",
|
|
38
|
+
"default": "./lib/rpc/index.js"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
26
41
|
"scripts": {
|
|
27
42
|
"build": "cross-env NODE_ENV=development yarn _build",
|
|
28
43
|
"build:prod": "cross-env NODE_ENV=production yarn _build",
|
|
@@ -39,7 +54,7 @@
|
|
|
39
54
|
"test:integration": "yarn _nyc mocha --recursive 'test/integration/**/*.js'",
|
|
40
55
|
"test:browser": "karma start config/karma.conf.js",
|
|
41
56
|
"fmt": "yarn eslint -c .eslintrc.js src/ --fix && yarn _prettier",
|
|
42
|
-
"preversion": "yarn clean && yarn
|
|
57
|
+
"preversion": "yarn clean && yarn _prettier && yarn build:prod && yarn test",
|
|
43
58
|
"prepare": "yarn build:prod",
|
|
44
59
|
"_build": "yarn build:node && yarn build:test && yarn build:browser",
|
|
45
60
|
"_babel": "babel --extensions '.ts' --out-dir lib/ src/",
|
|
@@ -77,12 +92,12 @@
|
|
|
77
92
|
]
|
|
78
93
|
},
|
|
79
94
|
"devDependencies": {
|
|
80
|
-
"@babel/cli": "^7.24.
|
|
81
|
-
"@babel/core": "^7.24.
|
|
82
|
-
"@babel/eslint-plugin": "^7.
|
|
83
|
-
"@babel/preset-env": "^7.24.
|
|
84
|
-
"@babel/preset-typescript": "^7.24.
|
|
85
|
-
"@babel/register": "^7.
|
|
95
|
+
"@babel/cli": "^7.24.6",
|
|
96
|
+
"@babel/core": "^7.24.6",
|
|
97
|
+
"@babel/eslint-plugin": "^7.24.6",
|
|
98
|
+
"@babel/preset-env": "^7.24.6",
|
|
99
|
+
"@babel/preset-typescript": "^7.24.6",
|
|
100
|
+
"@babel/register": "^7.24.6",
|
|
86
101
|
"@definitelytyped/dtslint": "^0.2.20",
|
|
87
102
|
"@istanbuljs/nyc-config-babel": "3.0.0",
|
|
88
103
|
"@stellar/tsconfig": "^1.0.2",
|
|
@@ -90,13 +105,13 @@
|
|
|
90
105
|
"@types/detect-node": "^2.0.0",
|
|
91
106
|
"@types/eventsource": "^1.1.12",
|
|
92
107
|
"@types/json-schema": "^7.0.15",
|
|
93
|
-
"@types/lodash": "^4.17.
|
|
108
|
+
"@types/lodash": "^4.17.4",
|
|
94
109
|
"@types/mocha": "^10.0.2",
|
|
95
|
-
"@types/node": "^20.
|
|
110
|
+
"@types/node": "^20.12.13",
|
|
96
111
|
"@types/randombytes": "^2.0.1",
|
|
97
112
|
"@types/sinon": "^17.0.2",
|
|
98
113
|
"@types/urijs": "^1.19.20",
|
|
99
|
-
"@typescript-eslint/parser": "^7.
|
|
114
|
+
"@typescript-eslint/parser": "^7.11.0",
|
|
100
115
|
"ava": "^5.3.1",
|
|
101
116
|
"axios-mock-adapter": "^1.22.0",
|
|
102
117
|
"babel-loader": "^9.1.3",
|
|
@@ -109,12 +124,14 @@
|
|
|
109
124
|
"dotenv": "^16.4.5",
|
|
110
125
|
"eslint": "^8.57.0",
|
|
111
126
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
127
|
+
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
112
128
|
"eslint-config-prettier": "^9.0.0",
|
|
113
129
|
"eslint-plugin-import": "^2.29.1",
|
|
130
|
+
"eslint-plugin-jsdoc": "^48.2.7",
|
|
114
131
|
"eslint-plugin-node": "^11.1.0",
|
|
115
132
|
"eslint-plugin-prefer-import": "^0.0.1",
|
|
116
133
|
"eslint-plugin-prettier": "^5.1.2",
|
|
117
|
-
"eslint-webpack-plugin": "^4.
|
|
134
|
+
"eslint-webpack-plugin": "^4.2.0",
|
|
118
135
|
"ghooks": "^2.0.4",
|
|
119
136
|
"husky": "^9.0.11",
|
|
120
137
|
"jsdoc": "^4.0.2",
|
|
@@ -127,7 +144,7 @@
|
|
|
127
144
|
"karma-mocha": "^2.0.0",
|
|
128
145
|
"karma-sinon-chai": "^2.0.2",
|
|
129
146
|
"karma-webpack": "^5.0.1",
|
|
130
|
-
"lint-staged": "^15.2.
|
|
147
|
+
"lint-staged": "^15.2.5",
|
|
131
148
|
"lodash": "^4.17.21",
|
|
132
149
|
"minami": "^1.1.1",
|
|
133
150
|
"mocha": "^10.3.0",
|
|
@@ -145,8 +162,8 @@
|
|
|
145
162
|
"webpack-cli": "^5.0.1"
|
|
146
163
|
},
|
|
147
164
|
"dependencies": {
|
|
148
|
-
"@stellar/stellar-base": "^
|
|
149
|
-
"axios": "^1.
|
|
165
|
+
"@stellar/stellar-base": "^12.0.0",
|
|
166
|
+
"axios": "^1.7.2",
|
|
150
167
|
"bignumber.js": "^9.1.2",
|
|
151
168
|
"eventsource": "^2.0.2",
|
|
152
169
|
"randombytes": "^2.1.0",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ContractSpec } from "..";
|
|
2
|
-
import { AssembledTransaction } from "./assembled_transaction";
|
|
3
|
-
import type { ContractClientOptions } from "./types";
|
|
4
|
-
export declare class ContractClient {
|
|
5
|
-
readonly spec: ContractSpec;
|
|
6
|
-
readonly options: ContractClientOptions;
|
|
7
|
-
/**
|
|
8
|
-
* Generate a class from the contract spec that where each contract method
|
|
9
|
-
* gets included with an identical name.
|
|
10
|
-
*
|
|
11
|
-
* Each method returns an {@link AssembledTransaction} that can be used to
|
|
12
|
-
* modify, simulate, decode results, and possibly sign, & submit the
|
|
13
|
-
* transaction.
|
|
14
|
-
*/
|
|
15
|
-
constructor(spec: ContractSpec, options: ContractClientOptions);
|
|
16
|
-
txFromJSON: <T>(json: string) => AssembledTransaction<T>;
|
|
17
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ContractClient = void 0;
|
|
7
|
-
var _assembled_transaction = require("./assembled_transaction");
|
|
8
|
-
var _excluded = ["method"];
|
|
9
|
-
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); }
|
|
10
|
-
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; }
|
|
11
|
-
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; }
|
|
12
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
13
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
|
14
|
-
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); } }
|
|
15
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
-
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; }
|
|
18
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
-
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); }
|
|
20
|
-
var ContractClient = exports.ContractClient = _createClass(function ContractClient(spec, options) {
|
|
21
|
-
var _this = this;
|
|
22
|
-
_classCallCheck(this, ContractClient);
|
|
23
|
-
_defineProperty(this, "txFromJSON", function (json) {
|
|
24
|
-
var _JSON$parse = JSON.parse(json),
|
|
25
|
-
method = _JSON$parse.method,
|
|
26
|
-
tx = _objectWithoutProperties(_JSON$parse, _excluded);
|
|
27
|
-
return _assembled_transaction.AssembledTransaction.fromJSON(_objectSpread(_objectSpread({}, _this.options), {}, {
|
|
28
|
-
method: method,
|
|
29
|
-
parseResultXdr: function parseResultXdr(result) {
|
|
30
|
-
return _this.spec.funcResToNative(method, result);
|
|
31
|
-
}
|
|
32
|
-
}), tx);
|
|
33
|
-
});
|
|
34
|
-
this.spec = spec;
|
|
35
|
-
this.options = options;
|
|
36
|
-
this.spec.funcs().forEach(function (xdrFn) {
|
|
37
|
-
var method = xdrFn.name().toString();
|
|
38
|
-
var assembleTransaction = function assembleTransaction(args, methodOptions) {
|
|
39
|
-
return _assembled_transaction.AssembledTransaction.build(_objectSpread(_objectSpread(_objectSpread({
|
|
40
|
-
method: method,
|
|
41
|
-
args: args && spec.funcArgsToScVals(method, args)
|
|
42
|
-
}, options), methodOptions), {}, {
|
|
43
|
-
errorTypes: spec.errorCases().reduce(function (acc, curr) {
|
|
44
|
-
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, curr.value(), {
|
|
45
|
-
message: curr.doc().toString()
|
|
46
|
-
}));
|
|
47
|
-
}, {}),
|
|
48
|
-
parseResultXdr: function parseResultXdr(result) {
|
|
49
|
-
return spec.funcResToNative(method, result);
|
|
50
|
-
}
|
|
51
|
-
}));
|
|
52
|
-
};
|
|
53
|
-
_this[method] = spec.getFunc(method).inputs().length === 0 ? function (opts) {
|
|
54
|
-
return assembleTransaction(undefined, opts);
|
|
55
|
-
} : assembleTransaction;
|
|
56
|
-
});
|
|
57
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The default timeout for waiting for a transaction to be included in a block.
|
|
3
|
-
*/
|
|
4
|
-
export declare const DEFAULT_TIMEOUT = 10;
|
|
5
|
-
/**
|
|
6
|
-
* Keep calling a `fn` for `timeoutInSeconds` seconds, if `keepWaitingIf` is true.
|
|
7
|
-
* Returns an array of all attempts to call the function.
|
|
8
|
-
*/
|
|
9
|
-
export declare function withExponentialBackoff<T>(fn: (previousFailure?: T) => Promise<T>, keepWaitingIf: (result: T) => boolean, timeoutInSeconds: number, exponentialFactor?: number, verbose?: boolean): Promise<T[]>;
|
|
10
|
-
/**
|
|
11
|
-
* If contracts are implemented using the `#[contracterror]` macro, then the
|
|
12
|
-
* errors get included in the on-chain XDR that also describes your contract's
|
|
13
|
-
* methods. Each error will have a specific number. This Regular Expression
|
|
14
|
-
* matches these "expected error types" that a contract may throw, and helps
|
|
15
|
-
* @{link AssembledTransaction} parse these errors.
|
|
16
|
-
*/
|
|
17
|
-
export declare const contractErrorPattern: RegExp;
|
|
18
|
-
/**
|
|
19
|
-
* A TypeScript type guard that checks if an object has a `toString` method.
|
|
20
|
-
*/
|
|
21
|
-
export declare function implementsToString(obj: unknown): obj is {
|
|
22
|
-
toString(): string;
|
|
23
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./result";
|
package/lib/rust_types/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _result = require("./result");
|
|
7
|
-
Object.keys(_result).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _result[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _result[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
package/lib/soroban/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from './api';
|
|
2
|
-
export { Server, Durability } from './server';
|
|
3
|
-
export { default as AxiosClient } from './axios';
|
|
4
|
-
export { parseRawSimulation, parseRawEvents } from './parsers';
|
|
5
|
-
export * from './transaction';
|
|
6
|
-
declare const _default: any;
|
|
7
|
-
export default _default;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|