@stellar/stellar-sdk 13.0.0-rc.2 → 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 +112 -7
  2. package/README.md +1 -1
  3. package/dist/stellar-sdk-minimal.js +448 -77
  4. package/dist/stellar-sdk-minimal.min.js +1 -1
  5. package/dist/stellar-sdk-no-axios.js +1044 -234
  6. package/dist/stellar-sdk-no-axios.min.js +1 -1
  7. package/dist/stellar-sdk-no-eventsource.js +171 -148
  8. package/dist/stellar-sdk-no-eventsource.min.js +1 -1
  9. package/dist/stellar-sdk.js +767 -305
  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 +11 -11
@@ -11063,6 +11063,12 @@ exports.walkInvocationTree = walkInvocationTree;
11063
11063
  var _asset = __webpack_require__(1764);
11064
11064
  var _address = __webpack_require__(1180);
11065
11065
  var _scval = __webpack_require__(7177);
11066
+ 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); }
11067
+ 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; }
11068
+ 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; }
11069
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
11070
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
11071
+ 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); }
11066
11072
  /**
11067
11073
  * @typedef CreateInvocation
11068
11074
  *
@@ -11076,6 +11082,9 @@ var _scval = __webpack_require__(7177);
11076
11082
  * @prop {string} wasm.address contract address of this deployment
11077
11083
  * @prop {string} wasm.salt hex salt that the user consumed when creating
11078
11084
  * this contract (encoded in the resulting address)
11085
+ * @prop {any[]} [wasm.constructorArgs] a list of natively-represented values
11086
+ * (see {@link scValToNative}) that are passed to the constructor when
11087
+ * creating this contract
11079
11088
  */
11080
11089
 
11081
11090
  /**
@@ -11084,8 +11093,8 @@ var _scval = __webpack_require__(7177);
11084
11093
  * @prop {string} source the strkey of the contract (C...) being invoked
11085
11094
  * @prop {string} function the name of the function being invoked
11086
11095
  * @prop {any[]} args the natively-represented parameters to the function
11087
- * invocation (see {@link scValToNative}) for rules on how they're
11088
- * represented a JS types
11096
+ * invocation (see {@link scValToNative} for rules on how they're
11097
+ * represented a JS types)
11089
11098
  */
11090
11099
 
11091
11100
  /**
@@ -11146,7 +11155,7 @@ function buildInvocationTree(root) {
11146
11155
  /** @type {InvocationTree} */
11147
11156
  var output = {};
11148
11157
 
11149
- /** @type {xdr.CreateContractArgs | xdr.InvokeContractArgs} */
11158
+ /** @type {xdr.CreateContractArgs|xdr.CreateContractArgsV2|xdr.InvokeContractArgs} */
11150
11159
  var inner = fn.value();
11151
11160
  switch (fn["switch"]().value) {
11152
11161
  // sorobanAuthorizedFunctionTypeContractFn
@@ -11162,8 +11171,11 @@ function buildInvocationTree(root) {
11162
11171
  break;
11163
11172
 
11164
11173
  // sorobanAuthorizedFunctionTypeCreateContractHostFn
11165
- case 1:
11174
+ // sorobanAuthorizedFunctionTypeCreateContractV2HostFn
11175
+ case 1: // fallthrough: just no ctor args in V1
11176
+ case 2:
11166
11177
  {
11178
+ var createV2 = fn["switch"]().value === 2;
11167
11179
  output.type = 'create';
11168
11180
  output.args = {};
11169
11181
 
@@ -11187,11 +11199,15 @@ function buildInvocationTree(root) {
11187
11199
  /** @type {xdr.ContractIdPreimageFromAddress} */
11188
11200
  var details = preimage.fromAddress();
11189
11201
  output.args.type = 'wasm';
11190
- output.args.wasm = {
11202
+ output.args.wasm = _objectSpread({
11191
11203
  salt: details.salt().toString('hex'),
11192
11204
  hash: exec.wasmHash().toString('hex'),
11193
11205
  address: _address.Address.fromScAddress(details.address()).toString()
11194
- };
11206
+ }, createV2 && {
11207
+ constructorArgs: inner.constructorArgs().map(function (arg) {
11208
+ return (0, _scval.scValToNative)(arg);
11209
+ })
11210
+ });
11195
11211
  break;
11196
11212
  }
11197
11213
 
@@ -27714,7 +27730,7 @@ var http_client = __webpack_require__(9983);
27714
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); }
27715
27731
 
27716
27732
 
27717
- var version = "13.0.0-rc.2";
27733
+ var version = "13.1.0";
27718
27734
  var SERVER_TIME_MAP = {};
27719
27735
  var AxiosClient = (0,http_client/* create */.vt)({
27720
27736
  headers: {
@@ -29097,28 +29113,49 @@ var HorizonServer = function () {
29097
29113
  }
29098
29114
  return feeStats;
29099
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
+ }())
29100
29137
  }, {
29101
29138
  key: "submitTransaction",
29102
29139
  value: (function () {
29103
- var _submitTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee4(transaction) {
29140
+ var _submitTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee5(transaction) {
29104
29141
  var opts,
29105
29142
  tx,
29106
- _args4 = arguments;
29107
- return server_regeneratorRuntime().wrap(function _callee4$(_context4) {
29108
- 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) {
29109
29146
  case 0:
29110
- opts = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {
29147
+ opts = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {
29111
29148
  skipMemoRequiredCheck: false
29112
29149
  };
29113
29150
  if (opts.skipMemoRequiredCheck) {
29114
- _context4.next = 4;
29151
+ _context5.next = 4;
29115
29152
  break;
29116
29153
  }
29117
- _context4.next = 4;
29154
+ _context5.next = 4;
29118
29155
  return this.checkMemoRequired(transaction);
29119
29156
  case 4:
29120
29157
  tx = encodeURIComponent(transaction.toEnvelope().toXDR().toString("base64"));
29121
- 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), {
29122
29159
  timeout: SUBMIT_TRANSACTION_TIMEOUT
29123
29160
  }).then(function (response) {
29124
29161
  if (!response.data.result_xdr) {
@@ -29229,9 +29266,9 @@ var HorizonServer = function () {
29229
29266
  }));
29230
29267
  case 6:
29231
29268
  case "end":
29232
- return _context4.stop();
29269
+ return _context5.stop();
29233
29270
  }
29234
- }, _callee4, this);
29271
+ }, _callee5, this);
29235
29272
  }));
29236
29273
  function submitTransaction(_x2) {
29237
29274
  return _submitTransaction.apply(this, arguments);
@@ -29241,25 +29278,25 @@ var HorizonServer = function () {
29241
29278
  }, {
29242
29279
  key: "submitAsyncTransaction",
29243
29280
  value: (function () {
29244
- var _submitAsyncTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee5(transaction) {
29281
+ var _submitAsyncTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee6(transaction) {
29245
29282
  var opts,
29246
29283
  tx,
29247
- _args5 = arguments;
29248
- return server_regeneratorRuntime().wrap(function _callee5$(_context5) {
29249
- 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) {
29250
29287
  case 0:
29251
- opts = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {
29288
+ opts = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {
29252
29289
  skipMemoRequiredCheck: false
29253
29290
  };
29254
29291
  if (opts.skipMemoRequiredCheck) {
29255
- _context5.next = 4;
29292
+ _context6.next = 4;
29256
29293
  break;
29257
29294
  }
29258
- _context5.next = 4;
29295
+ _context6.next = 4;
29259
29296
  return this.checkMemoRequired(transaction);
29260
29297
  case 4:
29261
29298
  tx = encodeURIComponent(transaction.toEnvelope().toXDR().toString("base64"));
29262
- 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) {
29263
29300
  return response.data;
29264
29301
  }).catch(function (response) {
29265
29302
  if (response instanceof Error) {
@@ -29269,9 +29306,9 @@ var HorizonServer = function () {
29269
29306
  }));
29270
29307
  case 6:
29271
29308
  case "end":
29272
- return _context5.stop();
29309
+ return _context6.stop();
29273
29310
  }
29274
- }, _callee5, this);
29311
+ }, _callee6, this);
29275
29312
  }));
29276
29313
  function submitAsyncTransaction(_x3) {
29277
29314
  return _submitAsyncTransaction.apply(this, arguments);
@@ -29356,21 +29393,21 @@ var HorizonServer = function () {
29356
29393
  }, {
29357
29394
  key: "loadAccount",
29358
29395
  value: (function () {
29359
- var _loadAccount = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee6(accountId) {
29396
+ var _loadAccount = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee7(accountId) {
29360
29397
  var res;
29361
- return server_regeneratorRuntime().wrap(function _callee6$(_context6) {
29362
- while (1) switch (_context6.prev = _context6.next) {
29398
+ return server_regeneratorRuntime().wrap(function _callee7$(_context7) {
29399
+ while (1) switch (_context7.prev = _context7.next) {
29363
29400
  case 0:
29364
- _context6.next = 2;
29401
+ _context7.next = 2;
29365
29402
  return this.accounts().accountId(accountId).call();
29366
29403
  case 2:
29367
- res = _context6.sent;
29368
- return _context6.abrupt("return", new AccountResponse(res));
29404
+ res = _context7.sent;
29405
+ return _context7.abrupt("return", new AccountResponse(res));
29369
29406
  case 4:
29370
29407
  case "end":
29371
- return _context6.stop();
29408
+ return _context7.stop();
29372
29409
  }
29373
- }, _callee6, this);
29410
+ }, _callee7, this);
29374
29411
  }));
29375
29412
  function loadAccount(_x4) {
29376
29413
  return _loadAccount.apply(this, arguments);
@@ -29385,88 +29422,88 @@ var HorizonServer = function () {
29385
29422
  }, {
29386
29423
  key: "checkMemoRequired",
29387
29424
  value: (function () {
29388
- var _checkMemoRequired = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee7(transaction) {
29425
+ var _checkMemoRequired = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee8(transaction) {
29389
29426
  var destinations, i, operation, destination, account;
29390
- return server_regeneratorRuntime().wrap(function _callee7$(_context7) {
29391
- while (1) switch (_context7.prev = _context7.next) {
29427
+ return server_regeneratorRuntime().wrap(function _callee8$(_context8) {
29428
+ while (1) switch (_context8.prev = _context8.next) {
29392
29429
  case 0:
29393
29430
  if (transaction instanceof lib.FeeBumpTransaction) {
29394
29431
  transaction = transaction.innerTransaction;
29395
29432
  }
29396
29433
  if (!(transaction.memo.type !== "none")) {
29397
- _context7.next = 3;
29434
+ _context8.next = 3;
29398
29435
  break;
29399
29436
  }
29400
- return _context7.abrupt("return");
29437
+ return _context8.abrupt("return");
29401
29438
  case 3:
29402
29439
  destinations = new Set();
29403
29440
  i = 0;
29404
29441
  case 5:
29405
29442
  if (!(i < transaction.operations.length)) {
29406
- _context7.next = 36;
29443
+ _context8.next = 36;
29407
29444
  break;
29408
29445
  }
29409
29446
  operation = transaction.operations[i];
29410
- _context7.t0 = operation.type;
29411
- _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;
29412
29449
  break;
29413
29450
  case 10:
29414
- return _context7.abrupt("break", 12);
29451
+ return _context8.abrupt("break", 12);
29415
29452
  case 11:
29416
- return _context7.abrupt("continue", 33);
29453
+ return _context8.abrupt("continue", 33);
29417
29454
  case 12:
29418
29455
  destination = operation.destination;
29419
29456
  if (!destinations.has(destination)) {
29420
- _context7.next = 15;
29457
+ _context8.next = 15;
29421
29458
  break;
29422
29459
  }
29423
- return _context7.abrupt("continue", 33);
29460
+ return _context8.abrupt("continue", 33);
29424
29461
  case 15:
29425
29462
  destinations.add(destination);
29426
29463
  if (!destination.startsWith("M")) {
29427
- _context7.next = 18;
29464
+ _context8.next = 18;
29428
29465
  break;
29429
29466
  }
29430
- return _context7.abrupt("continue", 33);
29467
+ return _context8.abrupt("continue", 33);
29431
29468
  case 18:
29432
- _context7.prev = 18;
29433
- _context7.next = 21;
29469
+ _context8.prev = 18;
29470
+ _context8.next = 21;
29434
29471
  return this.loadAccount(destination);
29435
29472
  case 21:
29436
- account = _context7.sent;
29473
+ account = _context8.sent;
29437
29474
  if (!(account.data_attr["config.memo_required"] === ACCOUNT_REQUIRES_MEMO)) {
29438
- _context7.next = 24;
29475
+ _context8.next = 24;
29439
29476
  break;
29440
29477
  }
29441
29478
  throw new errors/* AccountRequiresMemoError */.Cu("account requires memo", destination, i);
29442
29479
  case 24:
29443
- _context7.next = 33;
29480
+ _context8.next = 33;
29444
29481
  break;
29445
29482
  case 26:
29446
- _context7.prev = 26;
29447
- _context7.t1 = _context7["catch"](18);
29448
- if (!(_context7.t1 instanceof errors/* AccountRequiresMemoError */.Cu)) {
29449
- _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;
29450
29487
  break;
29451
29488
  }
29452
- throw _context7.t1;
29489
+ throw _context8.t1;
29453
29490
  case 30:
29454
- if (_context7.t1 instanceof errors/* NotFoundError */.m_) {
29455
- _context7.next = 32;
29491
+ if (_context8.t1 instanceof errors/* NotFoundError */.m_) {
29492
+ _context8.next = 32;
29456
29493
  break;
29457
29494
  }
29458
- throw _context7.t1;
29495
+ throw _context8.t1;
29459
29496
  case 32:
29460
- return _context7.abrupt("continue", 33);
29497
+ return _context8.abrupt("continue", 33);
29461
29498
  case 33:
29462
29499
  i += 1;
29463
- _context7.next = 5;
29500
+ _context8.next = 5;
29464
29501
  break;
29465
29502
  case 36:
29466
29503
  case "end":
29467
- return _context7.stop();
29504
+ return _context8.stop();
29468
29505
  }
29469
- }, _callee7, this, [[18, 26]]);
29506
+ }, _callee8, this, [[18, 26]]);
29470
29507
  }));
29471
29508
  function checkMemoRequired(_x5) {
29472
29509
  return _checkMemoRequired.apply(this, arguments);
@@ -30701,7 +30738,7 @@ function buildURL_encode(val) {
30701
30738
  *
30702
30739
  * @param {string} url The base of the url (e.g., http://www.google.com)
30703
30740
  * @param {object} [params] The params to be appended
30704
- * @param {?object} options
30741
+ * @param {?(object|Function)} options
30705
30742
  *
30706
30743
  * @returns {string} The formatted url
30707
30744
  */
@@ -30713,6 +30750,12 @@ function buildURL(url, params, options) {
30713
30750
 
30714
30751
  const _encode = options && options.encode || buildURL_encode;
30715
30752
 
30753
+ if (utils.isFunction(options)) {
30754
+ options = {
30755
+ serialize: options
30756
+ };
30757
+ }
30758
+
30716
30759
  const serializeFn = options && options.serialize;
30717
30760
 
30718
30761
  let serializedParams;
@@ -31800,71 +31843,18 @@ const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));
31800
31843
  ;// ./node_modules/axios/lib/helpers/isURLSameOrigin.js
31801
31844
 
31802
31845
 
31846
+ /* harmony default export */ const isURLSameOrigin = (platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
31847
+ url = new URL(url, platform.origin);
31803
31848
 
31804
-
31805
-
31806
- /* harmony default export */ const isURLSameOrigin = (platform.hasStandardBrowserEnv ?
31807
-
31808
- // Standard browser envs have full support of the APIs needed to test
31809
- // whether the request URL is of the same origin as current location.
31810
- (function standardBrowserEnv() {
31811
- const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent);
31812
- const urlParsingNode = document.createElement('a');
31813
- let originURL;
31814
-
31815
- /**
31816
- * Parse a URL to discover its components
31817
- *
31818
- * @param {String} url The URL to be parsed
31819
- * @returns {Object}
31820
- */
31821
- function resolveURL(url) {
31822
- let href = url;
31823
-
31824
- if (msie) {
31825
- // IE needs attribute set twice to normalize properties
31826
- urlParsingNode.setAttribute('href', href);
31827
- href = urlParsingNode.href;
31828
- }
31829
-
31830
- urlParsingNode.setAttribute('href', href);
31831
-
31832
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
31833
- return {
31834
- href: urlParsingNode.href,
31835
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
31836
- host: urlParsingNode.host,
31837
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
31838
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
31839
- hostname: urlParsingNode.hostname,
31840
- port: urlParsingNode.port,
31841
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
31842
- urlParsingNode.pathname :
31843
- '/' + urlParsingNode.pathname
31844
- };
31845
- }
31846
-
31847
- originURL = resolveURL(window.location.href);
31848
-
31849
- /**
31850
- * Determine if a URL shares the same origin as the current location
31851
- *
31852
- * @param {String} requestURL The URL to test
31853
- * @returns {boolean} True if URL shares the same origin, otherwise false
31854
- */
31855
- return function isURLSameOrigin(requestURL) {
31856
- const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
31857
- return (parsed.protocol === originURL.protocol &&
31858
- parsed.host === originURL.host);
31859
- };
31860
- })() :
31861
-
31862
- // Non standard browser envs (web workers, react-native) lack needed support.
31863
- (function nonStandardBrowserEnv() {
31864
- return function isURLSameOrigin() {
31865
- return true;
31866
- };
31867
- })());
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);
31868
31858
 
31869
31859
  ;// ./node_modules/axios/lib/helpers/cookies.js
31870
31860
 
@@ -31989,7 +31979,7 @@ function mergeConfig(config1, config2) {
31989
31979
  config2 = config2 || {};
31990
31980
  const config = {};
31991
31981
 
31992
- function getMergedValue(target, source, caseless) {
31982
+ function getMergedValue(target, source, prop, caseless) {
31993
31983
  if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
31994
31984
  return utils.merge.call({caseless}, target, source);
31995
31985
  } else if (utils.isPlainObject(source)) {
@@ -32001,11 +31991,11 @@ function mergeConfig(config1, config2) {
32001
31991
  }
32002
31992
 
32003
31993
  // eslint-disable-next-line consistent-return
32004
- function mergeDeepProperties(a, b, caseless) {
31994
+ function mergeDeepProperties(a, b, prop , caseless) {
32005
31995
  if (!utils.isUndefined(b)) {
32006
- return getMergedValue(a, b, caseless);
31996
+ return getMergedValue(a, b, prop , caseless);
32007
31997
  } else if (!utils.isUndefined(a)) {
32008
- return getMergedValue(undefined, a, caseless);
31998
+ return getMergedValue(undefined, a, prop , caseless);
32009
31999
  }
32010
32000
  }
32011
32001
 
@@ -32063,7 +32053,7 @@ function mergeConfig(config1, config2) {
32063
32053
  socketPath: defaultToConfig2,
32064
32054
  responseEncoding: defaultToConfig2,
32065
32055
  validateStatus: mergeDirectKeys,
32066
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
32056
+ headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
32067
32057
  };
32068
32058
 
32069
32059
  utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
@@ -32868,7 +32858,7 @@ function dispatchRequest(config) {
32868
32858
  }
32869
32859
 
32870
32860
  ;// ./node_modules/axios/lib/env/data.js
32871
- const VERSION = "1.7.7";
32861
+ const VERSION = "1.7.9";
32872
32862
  ;// ./node_modules/axios/lib/helpers/validator.js
32873
32863
 
32874
32864
 
@@ -32924,6 +32914,14 @@ validators.transitional = function transitional(validator, version, message) {
32924
32914
  };
32925
32915
  };
32926
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
+
32927
32925
  /**
32928
32926
  * Assert object's properties type
32929
32927
  *
@@ -33005,9 +33003,9 @@ class Axios {
33005
33003
  return await this._request(configOrUrl, config);
33006
33004
  } catch (err) {
33007
33005
  if (err instanceof Error) {
33008
- let dummy;
33006
+ let dummy = {};
33009
33007
 
33010
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
33008
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
33011
33009
 
33012
33010
  // slice off the Error: ... line
33013
33011
  const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
@@ -33062,6 +33060,11 @@ class Axios {
33062
33060
  }
33063
33061
  }
33064
33062
 
33063
+ validator.assertOptions(config, {
33064
+ baseUrl: Axios_validators.spelling('baseURL'),
33065
+ withXsrfToken: Axios_validators.spelling('withXSRFToken')
33066
+ }, true);
33067
+
33065
33068
  // Set config.method
33066
33069
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
33067
33070
 
@@ -33735,7 +33738,7 @@ var lib = __webpack_require__(356);
33735
33738
  var http_client = __webpack_require__(9983);
33736
33739
  ;// ./src/rpc/axios.ts
33737
33740
 
33738
- var version = "13.0.0-rc.2";
33741
+ var version = "13.1.0";
33739
33742
  var AxiosClient = (0,http_client/* create */.vt)({
33740
33743
  headers: {
33741
33744
  'X-Client-Name': 'js-soroban-client',
@@ -34486,7 +34489,7 @@ var RpcServer = function () {
34486
34489
  key: "requestAirdrop",
34487
34490
  value: (function () {
34488
34491
  var _requestAirdrop = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee22(address, friendbotUrl) {
34489
- var account, response, meta, sequence, _error$response, _error$response$detai;
34492
+ var account, response, meta, txMeta, sequence, _error$response, _error$response$detai;
34490
34493
  return server_regeneratorRuntime().wrap(function _callee22$(_context22) {
34491
34494
  while (1) switch (_context22.prev = _context22.next) {
34492
34495
  case 0:
@@ -34513,28 +34516,47 @@ var RpcServer = function () {
34513
34516
  return axios.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account)));
34514
34517
  case 12:
34515
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:
34516
34537
  meta = lib.xdr.TransactionMeta.fromXDR(response.data.result_meta_xdr, 'base64');
34538
+ case 23:
34517
34539
  sequence = findCreatedAccountSequenceInTransactionMeta(meta);
34518
34540
  return _context22.abrupt("return", new lib.Account(account, sequence));
34519
- case 18:
34520
- _context22.prev = 18;
34541
+ case 27:
34542
+ _context22.prev = 27;
34521
34543
  _context22.t1 = _context22["catch"](9);
34522
34544
  if (!(((_error$response = _context22.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) {
34523
- _context22.next = 23;
34545
+ _context22.next = 32;
34524
34546
  break;
34525
34547
  }
34526
34548
  if (!((_error$response$detai = _context22.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes('createAccountAlreadyExist'))) {
34527
- _context22.next = 23;
34549
+ _context22.next = 32;
34528
34550
  break;
34529
34551
  }
34530
34552
  return _context22.abrupt("return", this.getAccount(account));
34531
- case 23:
34553
+ case 32:
34532
34554
  throw _context22.t1;
34533
- case 24:
34555
+ case 33:
34534
34556
  case "end":
34535
34557
  return _context22.stop();
34536
34558
  }
34537
- }, _callee22, this, [[9, 18]]);
34559
+ }, _callee22, this, [[9, 27]]);
34538
34560
  }));
34539
34561
  function requestAirdrop(_x21, _x22) {
34540
34562
  return _requestAirdrop.apply(this, arguments);
@@ -34747,6 +34769,7 @@ function parseRawEvents(raw) {
34747
34769
  var _raw$events;
34748
34770
  return {
34749
34771
  latestLedger: raw.latestLedger,
34772
+ cursor: raw.cursor,
34750
34773
  events: ((_raw$events = raw.events) !== null && _raw$events !== void 0 ? _raw$events : []).map(function (evt) {
34751
34774
  var clone = _objectSpread({}, evt);
34752
34775
  delete clone.contractId;