@stellar/stellar-sdk 13.0.0 → 13.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +14 -4
  2. package/README.md +1 -1
  3. package/dist/stellar-sdk-minimal.js +426 -71
  4. package/dist/stellar-sdk-minimal.min.js +1 -1
  5. package/dist/stellar-sdk-no-axios.js +1022 -228
  6. package/dist/stellar-sdk-no-axios.min.js +1 -1
  7. package/dist/stellar-sdk-no-eventsource.js +149 -142
  8. package/dist/stellar-sdk-no-eventsource.min.js +1 -1
  9. package/dist/stellar-sdk.js +745 -299
  10. package/dist/stellar-sdk.min.js +1 -1
  11. package/lib/friendbot/index.d.ts +1 -0
  12. package/lib/horizon/call_builder.d.ts +1 -1
  13. package/lib/horizon/horizon_api.d.ts +13 -0
  14. package/lib/horizon/horizon_axios_client.js +1 -1
  15. package/lib/horizon/server.d.ts +5 -0
  16. package/lib/horizon/server.js +80 -59
  17. package/lib/minimal/friendbot/index.d.ts +1 -0
  18. package/lib/minimal/horizon/call_builder.d.ts +1 -1
  19. package/lib/minimal/horizon/horizon_api.d.ts +13 -0
  20. package/lib/minimal/horizon/horizon_axios_client.js +1 -1
  21. package/lib/minimal/horizon/server.d.ts +5 -0
  22. package/lib/minimal/horizon/server.js +80 -59
  23. package/lib/minimal/rpc/api.d.ts +2 -1
  24. package/lib/minimal/rpc/axios.js +1 -1
  25. package/lib/minimal/rpc/parsers.js +1 -0
  26. package/lib/minimal/rpc/server.js +27 -8
  27. package/lib/no-axios/friendbot/index.d.ts +1 -0
  28. package/lib/no-axios/horizon/call_builder.d.ts +1 -1
  29. package/lib/no-axios/horizon/horizon_api.d.ts +13 -0
  30. package/lib/no-axios/horizon/horizon_axios_client.js +1 -1
  31. package/lib/no-axios/horizon/server.d.ts +5 -0
  32. package/lib/no-axios/horizon/server.js +80 -59
  33. package/lib/no-axios/rpc/api.d.ts +2 -1
  34. package/lib/no-axios/rpc/axios.js +1 -1
  35. package/lib/no-axios/rpc/parsers.js +1 -0
  36. package/lib/no-axios/rpc/server.js +27 -8
  37. package/lib/no-eventsource/friendbot/index.d.ts +1 -0
  38. package/lib/no-eventsource/horizon/call_builder.d.ts +1 -1
  39. package/lib/no-eventsource/horizon/horizon_api.d.ts +13 -0
  40. package/lib/no-eventsource/horizon/horizon_axios_client.js +1 -1
  41. package/lib/no-eventsource/horizon/server.d.ts +5 -0
  42. package/lib/no-eventsource/horizon/server.js +80 -59
  43. package/lib/no-eventsource/rpc/api.d.ts +2 -1
  44. package/lib/no-eventsource/rpc/axios.js +1 -1
  45. package/lib/no-eventsource/rpc/parsers.js +1 -0
  46. package/lib/no-eventsource/rpc/server.js +27 -8
  47. package/lib/rpc/api.d.ts +2 -1
  48. package/lib/rpc/axios.js +1 -1
  49. package/lib/rpc/parsers.js +1 -0
  50. package/lib/rpc/server.js +27 -8
  51. package/package.json +10 -10
@@ -27730,7 +27730,7 @@ var http_client = __webpack_require__(9983);
27730
27730
  function horizon_axios_client_typeof(o) { "@babel/helpers - typeof"; return horizon_axios_client_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; }, horizon_axios_client_typeof(o); }
27731
27731
 
27732
27732
 
27733
- var version = "13.0.0";
27733
+ var version = "13.1.0";
27734
27734
  var SERVER_TIME_MAP = {};
27735
27735
  var AxiosClient = (0,http_client/* create */.vt)({
27736
27736
  headers: {
@@ -29113,28 +29113,49 @@ var HorizonServer = function () {
29113
29113
  }
29114
29114
  return feeStats;
29115
29115
  }())
29116
+ }, {
29117
+ key: "root",
29118
+ value: (function () {
29119
+ var _root = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee4() {
29120
+ var cb;
29121
+ return server_regeneratorRuntime().wrap(function _callee4$(_context4) {
29122
+ while (1) switch (_context4.prev = _context4.next) {
29123
+ case 0:
29124
+ cb = new CallBuilder(URI_default()(this.serverURL));
29125
+ return _context4.abrupt("return", cb.call());
29126
+ case 2:
29127
+ case "end":
29128
+ return _context4.stop();
29129
+ }
29130
+ }, _callee4, this);
29131
+ }));
29132
+ function root() {
29133
+ return _root.apply(this, arguments);
29134
+ }
29135
+ return root;
29136
+ }())
29116
29137
  }, {
29117
29138
  key: "submitTransaction",
29118
29139
  value: (function () {
29119
- var _submitTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee4(transaction) {
29140
+ var _submitTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee5(transaction) {
29120
29141
  var opts,
29121
29142
  tx,
29122
- _args4 = arguments;
29123
- return server_regeneratorRuntime().wrap(function _callee4$(_context4) {
29124
- while (1) switch (_context4.prev = _context4.next) {
29143
+ _args5 = arguments;
29144
+ return server_regeneratorRuntime().wrap(function _callee5$(_context5) {
29145
+ while (1) switch (_context5.prev = _context5.next) {
29125
29146
  case 0:
29126
- opts = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {
29147
+ opts = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {
29127
29148
  skipMemoRequiredCheck: false
29128
29149
  };
29129
29150
  if (opts.skipMemoRequiredCheck) {
29130
- _context4.next = 4;
29151
+ _context5.next = 4;
29131
29152
  break;
29132
29153
  }
29133
- _context4.next = 4;
29154
+ _context5.next = 4;
29134
29155
  return this.checkMemoRequired(transaction);
29135
29156
  case 4:
29136
29157
  tx = encodeURIComponent(transaction.toEnvelope().toXDR().toString("base64"));
29137
- return _context4.abrupt("return", horizon_axios_client.post(URI_default()(this.serverURL).segment("transactions").toString(), "tx=".concat(tx), {
29158
+ return _context5.abrupt("return", horizon_axios_client.post(URI_default()(this.serverURL).segment("transactions").toString(), "tx=".concat(tx), {
29138
29159
  timeout: SUBMIT_TRANSACTION_TIMEOUT
29139
29160
  }).then(function (response) {
29140
29161
  if (!response.data.result_xdr) {
@@ -29245,9 +29266,9 @@ var HorizonServer = function () {
29245
29266
  }));
29246
29267
  case 6:
29247
29268
  case "end":
29248
- return _context4.stop();
29269
+ return _context5.stop();
29249
29270
  }
29250
- }, _callee4, this);
29271
+ }, _callee5, this);
29251
29272
  }));
29252
29273
  function submitTransaction(_x2) {
29253
29274
  return _submitTransaction.apply(this, arguments);
@@ -29257,25 +29278,25 @@ var HorizonServer = function () {
29257
29278
  }, {
29258
29279
  key: "submitAsyncTransaction",
29259
29280
  value: (function () {
29260
- var _submitAsyncTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee5(transaction) {
29281
+ var _submitAsyncTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee6(transaction) {
29261
29282
  var opts,
29262
29283
  tx,
29263
- _args5 = arguments;
29264
- return server_regeneratorRuntime().wrap(function _callee5$(_context5) {
29265
- while (1) switch (_context5.prev = _context5.next) {
29284
+ _args6 = arguments;
29285
+ return server_regeneratorRuntime().wrap(function _callee6$(_context6) {
29286
+ while (1) switch (_context6.prev = _context6.next) {
29266
29287
  case 0:
29267
- opts = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {
29288
+ opts = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {
29268
29289
  skipMemoRequiredCheck: false
29269
29290
  };
29270
29291
  if (opts.skipMemoRequiredCheck) {
29271
- _context5.next = 4;
29292
+ _context6.next = 4;
29272
29293
  break;
29273
29294
  }
29274
- _context5.next = 4;
29295
+ _context6.next = 4;
29275
29296
  return this.checkMemoRequired(transaction);
29276
29297
  case 4:
29277
29298
  tx = encodeURIComponent(transaction.toEnvelope().toXDR().toString("base64"));
29278
- return _context5.abrupt("return", horizon_axios_client.post(URI_default()(this.serverURL).segment("transactions_async").toString(), "tx=".concat(tx)).then(function (response) {
29299
+ return _context6.abrupt("return", horizon_axios_client.post(URI_default()(this.serverURL).segment("transactions_async").toString(), "tx=".concat(tx)).then(function (response) {
29279
29300
  return response.data;
29280
29301
  }).catch(function (response) {
29281
29302
  if (response instanceof Error) {
@@ -29285,9 +29306,9 @@ var HorizonServer = function () {
29285
29306
  }));
29286
29307
  case 6:
29287
29308
  case "end":
29288
- return _context5.stop();
29309
+ return _context6.stop();
29289
29310
  }
29290
- }, _callee5, this);
29311
+ }, _callee6, this);
29291
29312
  }));
29292
29313
  function submitAsyncTransaction(_x3) {
29293
29314
  return _submitAsyncTransaction.apply(this, arguments);
@@ -29372,21 +29393,21 @@ var HorizonServer = function () {
29372
29393
  }, {
29373
29394
  key: "loadAccount",
29374
29395
  value: (function () {
29375
- var _loadAccount = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee6(accountId) {
29396
+ var _loadAccount = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee7(accountId) {
29376
29397
  var res;
29377
- return server_regeneratorRuntime().wrap(function _callee6$(_context6) {
29378
- while (1) switch (_context6.prev = _context6.next) {
29398
+ return server_regeneratorRuntime().wrap(function _callee7$(_context7) {
29399
+ while (1) switch (_context7.prev = _context7.next) {
29379
29400
  case 0:
29380
- _context6.next = 2;
29401
+ _context7.next = 2;
29381
29402
  return this.accounts().accountId(accountId).call();
29382
29403
  case 2:
29383
- res = _context6.sent;
29384
- return _context6.abrupt("return", new AccountResponse(res));
29404
+ res = _context7.sent;
29405
+ return _context7.abrupt("return", new AccountResponse(res));
29385
29406
  case 4:
29386
29407
  case "end":
29387
- return _context6.stop();
29408
+ return _context7.stop();
29388
29409
  }
29389
- }, _callee6, this);
29410
+ }, _callee7, this);
29390
29411
  }));
29391
29412
  function loadAccount(_x4) {
29392
29413
  return _loadAccount.apply(this, arguments);
@@ -29401,88 +29422,88 @@ var HorizonServer = function () {
29401
29422
  }, {
29402
29423
  key: "checkMemoRequired",
29403
29424
  value: (function () {
29404
- var _checkMemoRequired = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee7(transaction) {
29425
+ var _checkMemoRequired = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee8(transaction) {
29405
29426
  var destinations, i, operation, destination, account;
29406
- return server_regeneratorRuntime().wrap(function _callee7$(_context7) {
29407
- while (1) switch (_context7.prev = _context7.next) {
29427
+ return server_regeneratorRuntime().wrap(function _callee8$(_context8) {
29428
+ while (1) switch (_context8.prev = _context8.next) {
29408
29429
  case 0:
29409
29430
  if (transaction instanceof lib.FeeBumpTransaction) {
29410
29431
  transaction = transaction.innerTransaction;
29411
29432
  }
29412
29433
  if (!(transaction.memo.type !== "none")) {
29413
- _context7.next = 3;
29434
+ _context8.next = 3;
29414
29435
  break;
29415
29436
  }
29416
- return _context7.abrupt("return");
29437
+ return _context8.abrupt("return");
29417
29438
  case 3:
29418
29439
  destinations = new Set();
29419
29440
  i = 0;
29420
29441
  case 5:
29421
29442
  if (!(i < transaction.operations.length)) {
29422
- _context7.next = 36;
29443
+ _context8.next = 36;
29423
29444
  break;
29424
29445
  }
29425
29446
  operation = transaction.operations[i];
29426
- _context7.t0 = operation.type;
29427
- _context7.next = _context7.t0 === "payment" ? 10 : _context7.t0 === "pathPaymentStrictReceive" ? 10 : _context7.t0 === "pathPaymentStrictSend" ? 10 : _context7.t0 === "accountMerge" ? 10 : 11;
29447
+ _context8.t0 = operation.type;
29448
+ _context8.next = _context8.t0 === "payment" ? 10 : _context8.t0 === "pathPaymentStrictReceive" ? 10 : _context8.t0 === "pathPaymentStrictSend" ? 10 : _context8.t0 === "accountMerge" ? 10 : 11;
29428
29449
  break;
29429
29450
  case 10:
29430
- return _context7.abrupt("break", 12);
29451
+ return _context8.abrupt("break", 12);
29431
29452
  case 11:
29432
- return _context7.abrupt("continue", 33);
29453
+ return _context8.abrupt("continue", 33);
29433
29454
  case 12:
29434
29455
  destination = operation.destination;
29435
29456
  if (!destinations.has(destination)) {
29436
- _context7.next = 15;
29457
+ _context8.next = 15;
29437
29458
  break;
29438
29459
  }
29439
- return _context7.abrupt("continue", 33);
29460
+ return _context8.abrupt("continue", 33);
29440
29461
  case 15:
29441
29462
  destinations.add(destination);
29442
29463
  if (!destination.startsWith("M")) {
29443
- _context7.next = 18;
29464
+ _context8.next = 18;
29444
29465
  break;
29445
29466
  }
29446
- return _context7.abrupt("continue", 33);
29467
+ return _context8.abrupt("continue", 33);
29447
29468
  case 18:
29448
- _context7.prev = 18;
29449
- _context7.next = 21;
29469
+ _context8.prev = 18;
29470
+ _context8.next = 21;
29450
29471
  return this.loadAccount(destination);
29451
29472
  case 21:
29452
- account = _context7.sent;
29473
+ account = _context8.sent;
29453
29474
  if (!(account.data_attr["config.memo_required"] === ACCOUNT_REQUIRES_MEMO)) {
29454
- _context7.next = 24;
29475
+ _context8.next = 24;
29455
29476
  break;
29456
29477
  }
29457
29478
  throw new errors/* AccountRequiresMemoError */.Cu("account requires memo", destination, i);
29458
29479
  case 24:
29459
- _context7.next = 33;
29480
+ _context8.next = 33;
29460
29481
  break;
29461
29482
  case 26:
29462
- _context7.prev = 26;
29463
- _context7.t1 = _context7["catch"](18);
29464
- if (!(_context7.t1 instanceof errors/* AccountRequiresMemoError */.Cu)) {
29465
- _context7.next = 30;
29483
+ _context8.prev = 26;
29484
+ _context8.t1 = _context8["catch"](18);
29485
+ if (!(_context8.t1 instanceof errors/* AccountRequiresMemoError */.Cu)) {
29486
+ _context8.next = 30;
29466
29487
  break;
29467
29488
  }
29468
- throw _context7.t1;
29489
+ throw _context8.t1;
29469
29490
  case 30:
29470
- if (_context7.t1 instanceof errors/* NotFoundError */.m_) {
29471
- _context7.next = 32;
29491
+ if (_context8.t1 instanceof errors/* NotFoundError */.m_) {
29492
+ _context8.next = 32;
29472
29493
  break;
29473
29494
  }
29474
- throw _context7.t1;
29495
+ throw _context8.t1;
29475
29496
  case 32:
29476
- return _context7.abrupt("continue", 33);
29497
+ return _context8.abrupt("continue", 33);
29477
29498
  case 33:
29478
29499
  i += 1;
29479
- _context7.next = 5;
29500
+ _context8.next = 5;
29480
29501
  break;
29481
29502
  case 36:
29482
29503
  case "end":
29483
- return _context7.stop();
29504
+ return _context8.stop();
29484
29505
  }
29485
- }, _callee7, this, [[18, 26]]);
29506
+ }, _callee8, this, [[18, 26]]);
29486
29507
  }));
29487
29508
  function checkMemoRequired(_x5) {
29488
29509
  return _checkMemoRequired.apply(this, arguments);
@@ -30717,7 +30738,7 @@ function buildURL_encode(val) {
30717
30738
  *
30718
30739
  * @param {string} url The base of the url (e.g., http://www.google.com)
30719
30740
  * @param {object} [params] The params to be appended
30720
- * @param {?object} options
30741
+ * @param {?(object|Function)} options
30721
30742
  *
30722
30743
  * @returns {string} The formatted url
30723
30744
  */
@@ -30729,6 +30750,12 @@ function buildURL(url, params, options) {
30729
30750
 
30730
30751
  const _encode = options && options.encode || buildURL_encode;
30731
30752
 
30753
+ if (utils.isFunction(options)) {
30754
+ options = {
30755
+ serialize: options
30756
+ };
30757
+ }
30758
+
30732
30759
  const serializeFn = options && options.serialize;
30733
30760
 
30734
30761
  let serializedParams;
@@ -31816,71 +31843,18 @@ const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));
31816
31843
  ;// ./node_modules/axios/lib/helpers/isURLSameOrigin.js
31817
31844
 
31818
31845
 
31846
+ /* harmony default export */ const isURLSameOrigin = (platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
31847
+ url = new URL(url, platform.origin);
31819
31848
 
31820
-
31821
-
31822
- /* harmony default export */ const isURLSameOrigin = (platform.hasStandardBrowserEnv ?
31823
-
31824
- // Standard browser envs have full support of the APIs needed to test
31825
- // whether the request URL is of the same origin as current location.
31826
- (function standardBrowserEnv() {
31827
- const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent);
31828
- const urlParsingNode = document.createElement('a');
31829
- let originURL;
31830
-
31831
- /**
31832
- * Parse a URL to discover its components
31833
- *
31834
- * @param {String} url The URL to be parsed
31835
- * @returns {Object}
31836
- */
31837
- function resolveURL(url) {
31838
- let href = url;
31839
-
31840
- if (msie) {
31841
- // IE needs attribute set twice to normalize properties
31842
- urlParsingNode.setAttribute('href', href);
31843
- href = urlParsingNode.href;
31844
- }
31845
-
31846
- urlParsingNode.setAttribute('href', href);
31847
-
31848
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
31849
- return {
31850
- href: urlParsingNode.href,
31851
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
31852
- host: urlParsingNode.host,
31853
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
31854
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
31855
- hostname: urlParsingNode.hostname,
31856
- port: urlParsingNode.port,
31857
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
31858
- urlParsingNode.pathname :
31859
- '/' + urlParsingNode.pathname
31860
- };
31861
- }
31862
-
31863
- originURL = resolveURL(window.location.href);
31864
-
31865
- /**
31866
- * Determine if a URL shares the same origin as the current location
31867
- *
31868
- * @param {String} requestURL The URL to test
31869
- * @returns {boolean} True if URL shares the same origin, otherwise false
31870
- */
31871
- return function isURLSameOrigin(requestURL) {
31872
- const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
31873
- return (parsed.protocol === originURL.protocol &&
31874
- parsed.host === originURL.host);
31875
- };
31876
- })() :
31877
-
31878
- // Non standard browser envs (web workers, react-native) lack needed support.
31879
- (function nonStandardBrowserEnv() {
31880
- return function isURLSameOrigin() {
31881
- return true;
31882
- };
31883
- })());
31849
+ return (
31850
+ origin.protocol === url.protocol &&
31851
+ origin.host === url.host &&
31852
+ (isMSIE || origin.port === url.port)
31853
+ );
31854
+ })(
31855
+ new URL(platform.origin),
31856
+ platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
31857
+ ) : () => true);
31884
31858
 
31885
31859
  ;// ./node_modules/axios/lib/helpers/cookies.js
31886
31860
 
@@ -32005,7 +31979,7 @@ function mergeConfig(config1, config2) {
32005
31979
  config2 = config2 || {};
32006
31980
  const config = {};
32007
31981
 
32008
- function getMergedValue(target, source, caseless) {
31982
+ function getMergedValue(target, source, prop, caseless) {
32009
31983
  if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
32010
31984
  return utils.merge.call({caseless}, target, source);
32011
31985
  } else if (utils.isPlainObject(source)) {
@@ -32017,11 +31991,11 @@ function mergeConfig(config1, config2) {
32017
31991
  }
32018
31992
 
32019
31993
  // eslint-disable-next-line consistent-return
32020
- function mergeDeepProperties(a, b, caseless) {
31994
+ function mergeDeepProperties(a, b, prop , caseless) {
32021
31995
  if (!utils.isUndefined(b)) {
32022
- return getMergedValue(a, b, caseless);
31996
+ return getMergedValue(a, b, prop , caseless);
32023
31997
  } else if (!utils.isUndefined(a)) {
32024
- return getMergedValue(undefined, a, caseless);
31998
+ return getMergedValue(undefined, a, prop , caseless);
32025
31999
  }
32026
32000
  }
32027
32001
 
@@ -32079,7 +32053,7 @@ function mergeConfig(config1, config2) {
32079
32053
  socketPath: defaultToConfig2,
32080
32054
  responseEncoding: defaultToConfig2,
32081
32055
  validateStatus: mergeDirectKeys,
32082
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
32056
+ headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
32083
32057
  };
32084
32058
 
32085
32059
  utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
@@ -32884,7 +32858,7 @@ function dispatchRequest(config) {
32884
32858
  }
32885
32859
 
32886
32860
  ;// ./node_modules/axios/lib/env/data.js
32887
- const VERSION = "1.7.7";
32861
+ const VERSION = "1.7.9";
32888
32862
  ;// ./node_modules/axios/lib/helpers/validator.js
32889
32863
 
32890
32864
 
@@ -32940,6 +32914,14 @@ validators.transitional = function transitional(validator, version, message) {
32940
32914
  };
32941
32915
  };
32942
32916
 
32917
+ validators.spelling = function spelling(correctSpelling) {
32918
+ return (value, opt) => {
32919
+ // eslint-disable-next-line no-console
32920
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
32921
+ return true;
32922
+ }
32923
+ };
32924
+
32943
32925
  /**
32944
32926
  * Assert object's properties type
32945
32927
  *
@@ -33021,9 +33003,9 @@ class Axios {
33021
33003
  return await this._request(configOrUrl, config);
33022
33004
  } catch (err) {
33023
33005
  if (err instanceof Error) {
33024
- let dummy;
33006
+ let dummy = {};
33025
33007
 
33026
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
33008
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
33027
33009
 
33028
33010
  // slice off the Error: ... line
33029
33011
  const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
@@ -33078,6 +33060,11 @@ class Axios {
33078
33060
  }
33079
33061
  }
33080
33062
 
33063
+ validator.assertOptions(config, {
33064
+ baseUrl: Axios_validators.spelling('baseURL'),
33065
+ withXsrfToken: Axios_validators.spelling('withXSRFToken')
33066
+ }, true);
33067
+
33081
33068
  // Set config.method
33082
33069
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
33083
33070
 
@@ -33751,7 +33738,7 @@ var lib = __webpack_require__(356);
33751
33738
  var http_client = __webpack_require__(9983);
33752
33739
  ;// ./src/rpc/axios.ts
33753
33740
 
33754
- var version = "13.0.0";
33741
+ var version = "13.1.0";
33755
33742
  var AxiosClient = (0,http_client/* create */.vt)({
33756
33743
  headers: {
33757
33744
  'X-Client-Name': 'js-soroban-client',
@@ -34502,7 +34489,7 @@ var RpcServer = function () {
34502
34489
  key: "requestAirdrop",
34503
34490
  value: (function () {
34504
34491
  var _requestAirdrop = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee22(address, friendbotUrl) {
34505
- var account, response, meta, sequence, _error$response, _error$response$detai;
34492
+ var account, response, meta, txMeta, sequence, _error$response, _error$response$detai;
34506
34493
  return server_regeneratorRuntime().wrap(function _callee22$(_context22) {
34507
34494
  while (1) switch (_context22.prev = _context22.next) {
34508
34495
  case 0:
@@ -34529,28 +34516,47 @@ var RpcServer = function () {
34529
34516
  return axios.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account)));
34530
34517
  case 12:
34531
34518
  response = _context22.sent;
34519
+ if (response.data.result_meta_xdr) {
34520
+ _context22.next = 22;
34521
+ break;
34522
+ }
34523
+ _context22.next = 16;
34524
+ return this.getTransaction(response.data.hash);
34525
+ case 16:
34526
+ txMeta = _context22.sent;
34527
+ if (!(txMeta.status !== api/* Api */.j.GetTransactionStatus.SUCCESS)) {
34528
+ _context22.next = 19;
34529
+ break;
34530
+ }
34531
+ throw new Error("Funding account ".concat(address, " failed"));
34532
+ case 19:
34533
+ meta = txMeta.resultMetaXdr;
34534
+ _context22.next = 23;
34535
+ break;
34536
+ case 22:
34532
34537
  meta = lib.xdr.TransactionMeta.fromXDR(response.data.result_meta_xdr, 'base64');
34538
+ case 23:
34533
34539
  sequence = findCreatedAccountSequenceInTransactionMeta(meta);
34534
34540
  return _context22.abrupt("return", new lib.Account(account, sequence));
34535
- case 18:
34536
- _context22.prev = 18;
34541
+ case 27:
34542
+ _context22.prev = 27;
34537
34543
  _context22.t1 = _context22["catch"](9);
34538
34544
  if (!(((_error$response = _context22.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) {
34539
- _context22.next = 23;
34545
+ _context22.next = 32;
34540
34546
  break;
34541
34547
  }
34542
34548
  if (!((_error$response$detai = _context22.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes('createAccountAlreadyExist'))) {
34543
- _context22.next = 23;
34549
+ _context22.next = 32;
34544
34550
  break;
34545
34551
  }
34546
34552
  return _context22.abrupt("return", this.getAccount(account));
34547
- case 23:
34553
+ case 32:
34548
34554
  throw _context22.t1;
34549
- case 24:
34555
+ case 33:
34550
34556
  case "end":
34551
34557
  return _context22.stop();
34552
34558
  }
34553
- }, _callee22, this, [[9, 18]]);
34559
+ }, _callee22, this, [[9, 27]]);
34554
34560
  }));
34555
34561
  function requestAirdrop(_x21, _x22) {
34556
34562
  return _requestAirdrop.apply(this, arguments);
@@ -34763,6 +34769,7 @@ function parseRawEvents(raw) {
34763
34769
  var _raw$events;
34764
34770
  return {
34765
34771
  latestLedger: raw.latestLedger,
34772
+ cursor: raw.cursor,
34766
34773
  events: ((_raw$events = raw.events) !== null && _raw$events !== void 0 ? _raw$events : []).map(function (evt) {
34767
34774
  var clone = _objectSpread({}, evt);
34768
34775
  delete clone.contractId;