@stellar/stellar-sdk 11.0.1 → 11.2.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.
- package/CHANGELOG.md +24 -0
- package/README.md +158 -139
- package/dist/stellar-sdk.js +865 -376
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/config.js +2 -2
- package/lib/contract_spec.d.ts +22 -1
- package/lib/contract_spec.js +684 -187
- package/lib/errors.js +11 -16
- package/lib/federation/server.js +2 -2
- package/lib/horizon/account_call_builder.js +7 -8
- package/lib/horizon/account_response.js +2 -2
- package/lib/horizon/assets_call_builder.js +7 -8
- package/lib/horizon/call_builder.js +2 -2
- package/lib/horizon/claimable_balances_call_builder.js +7 -8
- package/lib/horizon/effect_call_builder.js +7 -8
- package/lib/horizon/friendbot_builder.js +7 -8
- package/lib/horizon/ledger_call_builder.js +7 -8
- package/lib/horizon/liquidity_pool_call_builder.js +7 -8
- package/lib/horizon/offer_call_builder.js +7 -8
- package/lib/horizon/operation_call_builder.js +7 -8
- package/lib/horizon/orderbook_call_builder.js +7 -8
- package/lib/horizon/path_call_builder.js +7 -8
- package/lib/horizon/payment_call_builder.js +7 -8
- package/lib/horizon/server.js +2 -2
- package/lib/horizon/strict_receive_path_call_builder.js +7 -8
- package/lib/horizon/strict_send_path_call_builder.js +7 -8
- package/lib/horizon/trade_aggregation_call_builder.js +7 -8
- package/lib/horizon/trades_call_builder.js +7 -8
- package/lib/horizon/transaction_call_builder.js +7 -8
- package/lib/soroban/api.d.ts +8 -1
- package/lib/soroban/parsers.js +12 -6
- package/lib/soroban/server.d.ts +6 -2
- package/lib/soroban/server.js +18 -12
- package/lib/stellartoml/index.js +2 -2
- package/lib/utils.js +2 -2
- package/lib/webauth/errors.js +7 -8
- package/package.json +17 -15
|
@@ -8,23 +8,22 @@ exports.PathCallBuilder = void 0;
|
|
|
8
8
|
var _call_builder = require("./call_builder");
|
|
9
9
|
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); } }
|
|
10
10
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
-
function _toPropertyKey(
|
|
12
|
-
function _toPrimitive(
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
-
function
|
|
15
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
17
15
|
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); }
|
|
18
16
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
|
-
function _isNativeReflectConstruct() {
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
18
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
19
|
+
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); }
|
|
20
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
21
|
var PathCallBuilder = exports.PathCallBuilder = function (_CallBuilder) {
|
|
22
22
|
_inherits(PathCallBuilder, _CallBuilder);
|
|
23
|
-
var _super = _createSuper(PathCallBuilder);
|
|
24
23
|
function PathCallBuilder(serverUrl, source, destination, destinationAsset, destinationAmount) {
|
|
25
24
|
var _this;
|
|
26
25
|
_classCallCheck(this, PathCallBuilder);
|
|
27
|
-
_this =
|
|
26
|
+
_this = _callSuper(this, PathCallBuilder, [serverUrl]);
|
|
28
27
|
_this.url.segment("paths");
|
|
29
28
|
_this.url.setQuery("destination_account", destination);
|
|
30
29
|
_this.url.setQuery("source_account", source);
|
|
@@ -9,22 +9,21 @@ var _call_builder = require("./call_builder");
|
|
|
9
9
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
10
|
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); } }
|
|
11
11
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
function _toPropertyKey(
|
|
13
|
-
function _toPrimitive(
|
|
14
|
-
function
|
|
15
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
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); }
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
17
15
|
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); }
|
|
18
16
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
|
-
function _isNativeReflectConstruct() {
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
18
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
19
|
+
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); }
|
|
20
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
21
|
var PaymentCallBuilder = exports.PaymentCallBuilder = function (_CallBuilder) {
|
|
22
22
|
_inherits(PaymentCallBuilder, _CallBuilder);
|
|
23
|
-
var _super = _createSuper(PaymentCallBuilder);
|
|
24
23
|
function PaymentCallBuilder(serverUrl) {
|
|
25
24
|
var _this;
|
|
26
25
|
_classCallCheck(this, PaymentCallBuilder);
|
|
27
|
-
_this =
|
|
26
|
+
_this = _callSuper(this, PaymentCallBuilder, [serverUrl, "payments"]);
|
|
28
27
|
_this.url.segment("payments");
|
|
29
28
|
return _this;
|
|
30
29
|
}
|
package/lib/horizon/server.js
CHANGED
|
@@ -38,8 +38,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
38
38
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
39
39
|
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); } }
|
|
40
40
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
41
|
-
function _toPropertyKey(
|
|
42
|
-
function _toPrimitive(
|
|
41
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
42
|
+
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); }
|
|
43
43
|
var SUBMIT_TRANSACTION_TIMEOUT = exports.SUBMIT_TRANSACTION_TIMEOUT = 60 * 1000;
|
|
44
44
|
var STROOPS_IN_LUMEN = 10000000;
|
|
45
45
|
var ACCOUNT_REQUIRES_MEMO = "MQ==";
|
|
@@ -8,23 +8,22 @@ exports.StrictReceivePathCallBuilder = void 0;
|
|
|
8
8
|
var _call_builder = require("./call_builder");
|
|
9
9
|
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); } }
|
|
10
10
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
-
function _toPropertyKey(
|
|
12
|
-
function _toPrimitive(
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
-
function
|
|
15
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
17
15
|
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); }
|
|
18
16
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
|
-
function _isNativeReflectConstruct() {
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
18
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
19
|
+
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); }
|
|
20
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
21
|
var StrictReceivePathCallBuilder = exports.StrictReceivePathCallBuilder = function (_CallBuilder) {
|
|
22
22
|
_inherits(StrictReceivePathCallBuilder, _CallBuilder);
|
|
23
|
-
var _super = _createSuper(StrictReceivePathCallBuilder);
|
|
24
23
|
function StrictReceivePathCallBuilder(serverUrl, source, destinationAsset, destinationAmount) {
|
|
25
24
|
var _this;
|
|
26
25
|
_classCallCheck(this, StrictReceivePathCallBuilder);
|
|
27
|
-
_this =
|
|
26
|
+
_this = _callSuper(this, StrictReceivePathCallBuilder, [serverUrl]);
|
|
28
27
|
_this.url.segment("paths/strict-receive");
|
|
29
28
|
if (typeof source === "string") {
|
|
30
29
|
_this.url.setQuery("source_account", source);
|
|
@@ -8,23 +8,22 @@ exports.StrictSendPathCallBuilder = void 0;
|
|
|
8
8
|
var _call_builder = require("./call_builder");
|
|
9
9
|
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); } }
|
|
10
10
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
-
function _toPropertyKey(
|
|
12
|
-
function _toPrimitive(
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
-
function
|
|
15
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
17
15
|
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); }
|
|
18
16
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
|
-
function _isNativeReflectConstruct() {
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
18
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
19
|
+
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); }
|
|
20
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
21
|
var StrictSendPathCallBuilder = exports.StrictSendPathCallBuilder = function (_CallBuilder) {
|
|
22
22
|
_inherits(StrictSendPathCallBuilder, _CallBuilder);
|
|
23
|
-
var _super = _createSuper(StrictSendPathCallBuilder);
|
|
24
23
|
function StrictSendPathCallBuilder(serverUrl, sourceAsset, sourceAmount, destination) {
|
|
25
24
|
var _this;
|
|
26
25
|
_classCallCheck(this, StrictSendPathCallBuilder);
|
|
27
|
-
_this =
|
|
26
|
+
_this = _callSuper(this, StrictSendPathCallBuilder, [serverUrl]);
|
|
28
27
|
_this.url.segment("paths/strict-send");
|
|
29
28
|
if (sourceAsset.isNative()) {
|
|
30
29
|
_this.url.setQuery("source_asset_type", "native");
|
|
@@ -10,23 +10,22 @@ var _errors = require("../errors");
|
|
|
10
10
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
11
|
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); } }
|
|
12
12
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
15
|
-
function
|
|
16
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
17
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
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); }
|
|
15
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
18
16
|
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); }
|
|
19
17
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
|
-
function _isNativeReflectConstruct() {
|
|
18
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
19
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
20
|
+
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); }
|
|
21
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22
22
|
var allowedResolutions = [60000, 300000, 900000, 3600000, 86400000, 604800000];
|
|
23
23
|
var TradeAggregationCallBuilder = exports.TradeAggregationCallBuilder = function (_CallBuilder) {
|
|
24
24
|
_inherits(TradeAggregationCallBuilder, _CallBuilder);
|
|
25
|
-
var _super = _createSuper(TradeAggregationCallBuilder);
|
|
26
25
|
function TradeAggregationCallBuilder(serverUrl, base, counter, start_time, end_time, resolution, offset) {
|
|
27
26
|
var _this;
|
|
28
27
|
_classCallCheck(this, TradeAggregationCallBuilder);
|
|
29
|
-
_this =
|
|
28
|
+
_this = _callSuper(this, TradeAggregationCallBuilder, [serverUrl]);
|
|
30
29
|
_this.url.segment("trade_aggregations");
|
|
31
30
|
if (!base.isNative()) {
|
|
32
31
|
_this.url.setQuery("base_asset_type", base.getAssetType());
|
|
@@ -9,22 +9,21 @@ var _call_builder = require("./call_builder");
|
|
|
9
9
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
10
|
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); } }
|
|
11
11
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
function _toPropertyKey(
|
|
13
|
-
function _toPrimitive(
|
|
14
|
-
function
|
|
15
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
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); }
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
17
15
|
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); }
|
|
18
16
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
|
-
function _isNativeReflectConstruct() {
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
18
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
19
|
+
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); }
|
|
20
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
21
|
var TradesCallBuilder = exports.TradesCallBuilder = function (_CallBuilder) {
|
|
22
22
|
_inherits(TradesCallBuilder, _CallBuilder);
|
|
23
|
-
var _super = _createSuper(TradesCallBuilder);
|
|
24
23
|
function TradesCallBuilder(serverUrl) {
|
|
25
24
|
var _this;
|
|
26
25
|
_classCallCheck(this, TradesCallBuilder);
|
|
27
|
-
_this =
|
|
26
|
+
_this = _callSuper(this, TradesCallBuilder, [serverUrl, "trades"]);
|
|
28
27
|
_this.url.segment("trades");
|
|
29
28
|
return _this;
|
|
30
29
|
}
|
|
@@ -9,22 +9,21 @@ var _call_builder = require("./call_builder");
|
|
|
9
9
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
10
|
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); } }
|
|
11
11
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
function _toPropertyKey(
|
|
13
|
-
function _toPrimitive(
|
|
14
|
-
function
|
|
15
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
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); }
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
17
15
|
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); }
|
|
18
16
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
|
-
function _isNativeReflectConstruct() {
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
18
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
19
|
+
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); }
|
|
20
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
21
|
var TransactionCallBuilder = exports.TransactionCallBuilder = function (_CallBuilder) {
|
|
22
22
|
_inherits(TransactionCallBuilder, _CallBuilder);
|
|
23
|
-
var _super = _createSuper(TransactionCallBuilder);
|
|
24
23
|
function TransactionCallBuilder(serverUrl) {
|
|
25
24
|
var _this;
|
|
26
25
|
_classCallCheck(this, TransactionCallBuilder);
|
|
27
|
-
_this =
|
|
26
|
+
_this = _callSuper(this, TransactionCallBuilder, [serverUrl, "transactions"]);
|
|
28
27
|
_this.url.segment("transactions");
|
|
29
28
|
return _this;
|
|
30
29
|
}
|
package/lib/soroban/api.d.ts
CHANGED
|
@@ -116,7 +116,7 @@ export declare namespace Api {
|
|
|
116
116
|
latestLedger: number;
|
|
117
117
|
events: EventResponse[];
|
|
118
118
|
}
|
|
119
|
-
interface EventResponse extends BaseEventResponse {
|
|
119
|
+
export interface EventResponse extends BaseEventResponse {
|
|
120
120
|
contractId?: Contract;
|
|
121
121
|
topic: xdr.ScVal[];
|
|
122
122
|
value: xdr.ScVal;
|
|
@@ -144,6 +144,7 @@ export declare namespace Api {
|
|
|
144
144
|
export type SendTransactionStatus = 'PENDING' | 'DUPLICATE' | 'TRY_AGAIN_LATER' | 'ERROR';
|
|
145
145
|
export interface SendTransactionResponse extends BaseSendTransactionResponse {
|
|
146
146
|
errorResult?: xdr.TransactionResult;
|
|
147
|
+
diagnosticEvents?: xdr.DiagnosticEvent[];
|
|
147
148
|
}
|
|
148
149
|
export interface RawSendTransactionResponse extends BaseSendTransactionResponse {
|
|
149
150
|
/**
|
|
@@ -153,6 +154,12 @@ export declare namespace Api {
|
|
|
153
154
|
* It contains details on why the network rejected the transaction.
|
|
154
155
|
*/
|
|
155
156
|
errorResultXdr?: string;
|
|
157
|
+
/**
|
|
158
|
+
* This is a base64-encoded instance of an array of
|
|
159
|
+
* {@link xdr.DiagnosticEvent}s, set only when `status` is `"ERROR"` and
|
|
160
|
+
* diagnostic events are enabled on the server.
|
|
161
|
+
*/
|
|
162
|
+
diagnosticEventsXdr?: string[];
|
|
156
163
|
}
|
|
157
164
|
export interface BaseSendTransactionResponse {
|
|
158
165
|
status: SendTransactionStatus;
|
package/lib/soroban/parsers.js
CHANGED
|
@@ -13,14 +13,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
13
13
|
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; }
|
|
14
14
|
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; }
|
|
15
15
|
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; }
|
|
16
|
-
function _toPropertyKey(
|
|
17
|
-
function _toPrimitive(
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
17
|
+
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); }
|
|
18
18
|
function parseRawSendTransaction(r) {
|
|
19
|
-
var
|
|
19
|
+
var errorResultXdr = r.errorResultXdr,
|
|
20
|
+
diagnosticEventsXdr = r.diagnosticEventsXdr;
|
|
20
21
|
delete r.errorResultXdr;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
delete r.diagnosticEventsXdr;
|
|
23
|
+
if (!!errorResultXdr) {
|
|
24
|
+
return _objectSpread(_objectSpread(_objectSpread({}, r), diagnosticEventsXdr !== undefined && diagnosticEventsXdr.length > 0 && {
|
|
25
|
+
diagnosticEvents: diagnosticEventsXdr.map(function (evt) {
|
|
26
|
+
return _stellarBase.xdr.DiagnosticEvent.fromXDR(evt, 'base64');
|
|
27
|
+
})
|
|
28
|
+
}), {}, {
|
|
29
|
+
errorResult: _stellarBase.xdr.TransactionResult.fromXDR(errorResultXdr, 'base64')
|
|
24
30
|
});
|
|
25
31
|
}
|
|
26
32
|
return _objectSpread({}, r);
|
package/lib/soroban/server.d.ts
CHANGED
|
@@ -15,6 +15,10 @@ export declare namespace Server {
|
|
|
15
15
|
cursor?: string;
|
|
16
16
|
limit?: number;
|
|
17
17
|
}
|
|
18
|
+
/** Describes additional resource leeways for transaction simulation. */
|
|
19
|
+
interface ResourceLeeway {
|
|
20
|
+
cpuInstructions: number;
|
|
21
|
+
}
|
|
18
22
|
interface Options {
|
|
19
23
|
allowHttp?: boolean;
|
|
20
24
|
timeout?: number;
|
|
@@ -277,8 +281,8 @@ export declare class Server {
|
|
|
277
281
|
* console.log("latestLedger:", sim.latestLedger);
|
|
278
282
|
* });
|
|
279
283
|
*/
|
|
280
|
-
simulateTransaction(
|
|
281
|
-
_simulateTransaction(transaction: Transaction | FeeBumpTransaction): Promise<Api.RawSimulateTransactionResponse>;
|
|
284
|
+
simulateTransaction(tx: Transaction | FeeBumpTransaction, addlResources?: Server.ResourceLeeway): Promise<Api.SimulateTransactionResponse>;
|
|
285
|
+
_simulateTransaction(transaction: Transaction | FeeBumpTransaction, addlResources?: Server.ResourceLeeway): Promise<Api.RawSimulateTransactionResponse>;
|
|
282
286
|
/**
|
|
283
287
|
* Submit a trial contract invocation, first run a simulation of the contract
|
|
284
288
|
* invocation as defined on the incoming transaction, and apply the results to
|
package/lib/soroban/server.js
CHANGED
|
@@ -27,8 +27,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
27
27
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
28
28
|
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); } }
|
|
29
29
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
30
|
-
function _toPropertyKey(
|
|
31
|
-
function _toPrimitive(
|
|
30
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
31
|
+
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); }
|
|
32
32
|
var SUBMIT_TRANSACTION_TIMEOUT = exports.SUBMIT_TRANSACTION_TIMEOUT = 60 * 1000;
|
|
33
33
|
var Durability = exports.Durability = function (Durability) {
|
|
34
34
|
Durability["Temporary"] = "temporary";
|
|
@@ -385,18 +385,18 @@ var Server = exports.Server = function () {
|
|
|
385
385
|
}, {
|
|
386
386
|
key: "simulateTransaction",
|
|
387
387
|
value: (function () {
|
|
388
|
-
var _simulateTransaction2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee12(
|
|
388
|
+
var _simulateTransaction2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee12(tx, addlResources) {
|
|
389
389
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
390
390
|
while (1) switch (_context12.prev = _context12.next) {
|
|
391
391
|
case 0:
|
|
392
|
-
return _context12.abrupt("return", this._simulateTransaction(
|
|
392
|
+
return _context12.abrupt("return", this._simulateTransaction(tx, addlResources).then(_parsers.parseRawSimulation));
|
|
393
393
|
case 1:
|
|
394
394
|
case "end":
|
|
395
395
|
return _context12.stop();
|
|
396
396
|
}
|
|
397
397
|
}, _callee12, this);
|
|
398
398
|
}));
|
|
399
|
-
function simulateTransaction(_x8) {
|
|
399
|
+
function simulateTransaction(_x8, _x9) {
|
|
400
400
|
return _simulateTransaction2.apply(this, arguments);
|
|
401
401
|
}
|
|
402
402
|
return simulateTransaction;
|
|
@@ -404,18 +404,24 @@ var Server = exports.Server = function () {
|
|
|
404
404
|
}, {
|
|
405
405
|
key: "_simulateTransaction",
|
|
406
406
|
value: function () {
|
|
407
|
-
var _simulateTransaction3 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee13(transaction) {
|
|
407
|
+
var _simulateTransaction3 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee13(transaction, addlResources) {
|
|
408
408
|
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
409
409
|
while (1) switch (_context13.prev = _context13.next) {
|
|
410
410
|
case 0:
|
|
411
|
-
return _context13.abrupt("return", jsonrpc.
|
|
411
|
+
return _context13.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'simulateTransaction', _objectSpread({
|
|
412
|
+
transaction: transaction.toXDR()
|
|
413
|
+
}, addlResources !== undefined && {
|
|
414
|
+
resourceConfig: {
|
|
415
|
+
instructionLeeway: addlResources.cpuInstructions
|
|
416
|
+
}
|
|
417
|
+
})));
|
|
412
418
|
case 1:
|
|
413
419
|
case "end":
|
|
414
420
|
return _context13.stop();
|
|
415
421
|
}
|
|
416
422
|
}, _callee13, this);
|
|
417
423
|
}));
|
|
418
|
-
function _simulateTransaction(
|
|
424
|
+
function _simulateTransaction(_x10, _x11) {
|
|
419
425
|
return _simulateTransaction3.apply(this, arguments);
|
|
420
426
|
}
|
|
421
427
|
return _simulateTransaction;
|
|
@@ -445,7 +451,7 @@ var Server = exports.Server = function () {
|
|
|
445
451
|
}
|
|
446
452
|
}, _callee14, this);
|
|
447
453
|
}));
|
|
448
|
-
function prepareTransaction(
|
|
454
|
+
function prepareTransaction(_x12) {
|
|
449
455
|
return _prepareTransaction.apply(this, arguments);
|
|
450
456
|
}
|
|
451
457
|
return prepareTransaction;
|
|
@@ -464,7 +470,7 @@ var Server = exports.Server = function () {
|
|
|
464
470
|
}
|
|
465
471
|
}, _callee15, this);
|
|
466
472
|
}));
|
|
467
|
-
function sendTransaction(
|
|
473
|
+
function sendTransaction(_x13) {
|
|
468
474
|
return _sendTransaction2.apply(this, arguments);
|
|
469
475
|
}
|
|
470
476
|
return sendTransaction;
|
|
@@ -483,7 +489,7 @@ var Server = exports.Server = function () {
|
|
|
483
489
|
}
|
|
484
490
|
}, _callee16, this);
|
|
485
491
|
}));
|
|
486
|
-
function _sendTransaction(
|
|
492
|
+
function _sendTransaction(_x14) {
|
|
487
493
|
return _sendTransaction3.apply(this, arguments);
|
|
488
494
|
}
|
|
489
495
|
return _sendTransaction;
|
|
@@ -542,7 +548,7 @@ var Server = exports.Server = function () {
|
|
|
542
548
|
}
|
|
543
549
|
}, _callee17, this, [[9, 18]]);
|
|
544
550
|
}));
|
|
545
|
-
function requestAirdrop(
|
|
551
|
+
function requestAirdrop(_x15, _x16) {
|
|
546
552
|
return _requestAirdrop.apply(this, arguments);
|
|
547
553
|
}
|
|
548
554
|
return requestAirdrop;
|
package/lib/stellartoml/index.js
CHANGED
|
@@ -15,8 +15,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
15
15
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
16
|
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); } }
|
|
17
17
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
18
|
-
function _toPropertyKey(
|
|
19
|
-
function _toPrimitive(
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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
20
|
var STELLAR_TOML_MAX_SIZE = exports.STELLAR_TOML_MAX_SIZE = 100 * 1024;
|
|
21
21
|
var CancelToken = _axios.default.CancelToken;
|
|
22
22
|
var Resolver = exports.Resolver = function () {
|
package/lib/utils.js
CHANGED
|
@@ -8,8 +8,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
8
8
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
9
|
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); } }
|
|
10
10
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
-
function _toPropertyKey(
|
|
12
|
-
function _toPrimitive(
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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 () {
|
|
14
14
|
function Utils() {
|
|
15
15
|
_classCallCheck(this, Utils);
|
package/lib/webauth/errors.js
CHANGED
|
@@ -7,27 +7,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.InvalidChallengeError = void 0;
|
|
8
8
|
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); } }
|
|
9
9
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
-
function _toPropertyKey(
|
|
11
|
-
function _toPrimitive(
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
12
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
13
|
-
function
|
|
14
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15
14
|
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); }
|
|
16
15
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
|
+
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); }
|
|
17
17
|
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); }
|
|
18
|
-
function _construct(
|
|
19
|
-
function _isNativeReflectConstruct() {
|
|
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
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
20
|
function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
|
|
21
21
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22
22
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
23
|
var InvalidChallengeError = exports.InvalidChallengeError = function (_Error) {
|
|
24
24
|
_inherits(InvalidChallengeError, _Error);
|
|
25
|
-
var _super = _createSuper(InvalidChallengeError);
|
|
26
25
|
function InvalidChallengeError(message) {
|
|
27
26
|
var _this;
|
|
28
27
|
_classCallCheck(this, InvalidChallengeError);
|
|
29
28
|
var trueProto = (this instanceof InvalidChallengeError ? this.constructor : void 0).prototype;
|
|
30
|
-
_this =
|
|
29
|
+
_this = _callSuper(this, InvalidChallengeError, [message]);
|
|
31
30
|
_this.__proto__ = trueProto;
|
|
32
31
|
_this.constructor = InvalidChallengeError;
|
|
33
32
|
_this.name = "InvalidChallengeError";
|