@stellar/stellar-sdk 13.0.0-beta.1 → 13.0.0-rc.2

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 (138) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/dist/stellar-sdk-minimal.js +585 -253
  3. package/dist/stellar-sdk-minimal.min.js +1 -1
  4. package/dist/stellar-sdk-no-axios.js +602 -256
  5. package/dist/stellar-sdk-no-axios.min.js +1 -1
  6. package/dist/stellar-sdk-no-eventsource.js +585 -253
  7. package/dist/stellar-sdk-no-eventsource.min.js +1 -1
  8. package/dist/stellar-sdk.js +602 -256
  9. package/dist/stellar-sdk.min.js +1 -1
  10. package/lib/contract/assembled_transaction.d.ts +75 -3
  11. package/lib/contract/assembled_transaction.js +124 -35
  12. package/lib/contract/basic_node_signer.d.ts +3 -2
  13. package/lib/contract/basic_node_signer.js +16 -8
  14. package/lib/contract/client.d.ts +13 -1
  15. package/lib/contract/client.js +159 -48
  16. package/lib/contract/sent_transaction.d.ts +2 -3
  17. package/lib/contract/sent_transaction.js +4 -4
  18. package/lib/contract/types.d.ts +72 -8
  19. package/lib/contract/types.js +1 -0
  20. package/lib/horizon/call_builder.d.ts +1 -1
  21. package/lib/horizon/horizon_axios_client.js +1 -1
  22. package/lib/horizon/server_api.d.ts +1 -15
  23. package/lib/horizon/server_api.js +5 -0
  24. package/lib/horizon/types/assets.d.ts +0 -2
  25. package/lib/horizon/types/effects.d.ts +51 -51
  26. package/lib/horizon/types/trade.d.ts +3 -2
  27. package/lib/http-client/types.d.ts +1 -0
  28. package/lib/index.d.ts +0 -4
  29. package/lib/index.js +1 -4
  30. package/lib/minimal/contract/assembled_transaction.d.ts +75 -3
  31. package/lib/minimal/contract/assembled_transaction.js +124 -35
  32. package/lib/minimal/contract/basic_node_signer.d.ts +3 -2
  33. package/lib/minimal/contract/basic_node_signer.js +16 -8
  34. package/lib/minimal/contract/client.d.ts +13 -1
  35. package/lib/minimal/contract/client.js +159 -48
  36. package/lib/minimal/contract/sent_transaction.d.ts +2 -3
  37. package/lib/minimal/contract/sent_transaction.js +4 -4
  38. package/lib/minimal/contract/types.d.ts +72 -8
  39. package/lib/minimal/contract/types.js +1 -0
  40. package/lib/minimal/horizon/call_builder.d.ts +1 -1
  41. package/lib/minimal/horizon/horizon_axios_client.js +1 -1
  42. package/lib/minimal/horizon/server_api.d.ts +1 -15
  43. package/lib/minimal/horizon/server_api.js +5 -0
  44. package/lib/minimal/horizon/types/assets.d.ts +0 -2
  45. package/lib/minimal/horizon/types/effects.d.ts +51 -51
  46. package/lib/minimal/horizon/types/trade.d.ts +3 -2
  47. package/lib/minimal/http-client/types.d.ts +1 -0
  48. package/lib/minimal/index.d.ts +0 -4
  49. package/lib/minimal/index.js +1 -4
  50. package/lib/minimal/rpc/api.d.ts +12 -9
  51. package/lib/minimal/rpc/axios.js +1 -1
  52. package/lib/minimal/rpc/index.d.ts +1 -1
  53. package/lib/minimal/rpc/index.js +14 -0
  54. package/lib/minimal/rpc/parsers.d.ts +1 -1
  55. package/lib/minimal/rpc/parsers.js +3 -3
  56. package/lib/minimal/rpc/server.d.ts +41 -3
  57. package/lib/minimal/rpc/server.js +203 -149
  58. package/lib/minimal/stellartoml/index.d.ts +1 -0
  59. package/lib/minimal/stellartoml/index.js +2 -0
  60. package/lib/minimal/utils.d.ts +1 -0
  61. package/lib/minimal/utils.js +7 -0
  62. package/lib/no-axios/contract/assembled_transaction.d.ts +75 -3
  63. package/lib/no-axios/contract/assembled_transaction.js +124 -35
  64. package/lib/no-axios/contract/basic_node_signer.d.ts +3 -2
  65. package/lib/no-axios/contract/basic_node_signer.js +16 -8
  66. package/lib/no-axios/contract/client.d.ts +13 -1
  67. package/lib/no-axios/contract/client.js +159 -48
  68. package/lib/no-axios/contract/sent_transaction.d.ts +2 -3
  69. package/lib/no-axios/contract/sent_transaction.js +4 -4
  70. package/lib/no-axios/contract/types.d.ts +72 -8
  71. package/lib/no-axios/contract/types.js +1 -0
  72. package/lib/no-axios/horizon/call_builder.d.ts +1 -1
  73. package/lib/no-axios/horizon/horizon_axios_client.js +1 -1
  74. package/lib/no-axios/horizon/server_api.d.ts +1 -15
  75. package/lib/no-axios/horizon/server_api.js +5 -0
  76. package/lib/no-axios/horizon/types/assets.d.ts +0 -2
  77. package/lib/no-axios/horizon/types/effects.d.ts +51 -51
  78. package/lib/no-axios/horizon/types/trade.d.ts +3 -2
  79. package/lib/no-axios/http-client/types.d.ts +1 -0
  80. package/lib/no-axios/index.d.ts +0 -4
  81. package/lib/no-axios/index.js +1 -4
  82. package/lib/no-axios/rpc/api.d.ts +12 -9
  83. package/lib/no-axios/rpc/axios.js +1 -1
  84. package/lib/no-axios/rpc/index.d.ts +1 -1
  85. package/lib/no-axios/rpc/index.js +14 -0
  86. package/lib/no-axios/rpc/parsers.d.ts +1 -1
  87. package/lib/no-axios/rpc/parsers.js +3 -3
  88. package/lib/no-axios/rpc/server.d.ts +41 -3
  89. package/lib/no-axios/rpc/server.js +203 -149
  90. package/lib/no-axios/stellartoml/index.d.ts +1 -0
  91. package/lib/no-axios/stellartoml/index.js +2 -0
  92. package/lib/no-axios/utils.d.ts +1 -0
  93. package/lib/no-axios/utils.js +7 -0
  94. package/lib/no-eventsource/contract/assembled_transaction.d.ts +75 -3
  95. package/lib/no-eventsource/contract/assembled_transaction.js +124 -35
  96. package/lib/no-eventsource/contract/basic_node_signer.d.ts +3 -2
  97. package/lib/no-eventsource/contract/basic_node_signer.js +16 -8
  98. package/lib/no-eventsource/contract/client.d.ts +13 -1
  99. package/lib/no-eventsource/contract/client.js +159 -48
  100. package/lib/no-eventsource/contract/sent_transaction.d.ts +2 -3
  101. package/lib/no-eventsource/contract/sent_transaction.js +4 -4
  102. package/lib/no-eventsource/contract/types.d.ts +72 -8
  103. package/lib/no-eventsource/contract/types.js +1 -0
  104. package/lib/no-eventsource/horizon/call_builder.d.ts +1 -1
  105. package/lib/no-eventsource/horizon/horizon_axios_client.js +1 -1
  106. package/lib/no-eventsource/horizon/server_api.d.ts +1 -15
  107. package/lib/no-eventsource/horizon/server_api.js +5 -0
  108. package/lib/no-eventsource/horizon/types/assets.d.ts +0 -2
  109. package/lib/no-eventsource/horizon/types/effects.d.ts +51 -51
  110. package/lib/no-eventsource/horizon/types/trade.d.ts +3 -2
  111. package/lib/no-eventsource/http-client/types.d.ts +1 -0
  112. package/lib/no-eventsource/index.d.ts +0 -4
  113. package/lib/no-eventsource/index.js +1 -4
  114. package/lib/no-eventsource/rpc/api.d.ts +12 -9
  115. package/lib/no-eventsource/rpc/axios.js +1 -1
  116. package/lib/no-eventsource/rpc/index.d.ts +1 -1
  117. package/lib/no-eventsource/rpc/index.js +14 -0
  118. package/lib/no-eventsource/rpc/parsers.d.ts +1 -1
  119. package/lib/no-eventsource/rpc/parsers.js +3 -3
  120. package/lib/no-eventsource/rpc/server.d.ts +41 -3
  121. package/lib/no-eventsource/rpc/server.js +203 -149
  122. package/lib/no-eventsource/stellartoml/index.d.ts +1 -0
  123. package/lib/no-eventsource/stellartoml/index.js +2 -0
  124. package/lib/no-eventsource/utils.d.ts +1 -0
  125. package/lib/no-eventsource/utils.js +7 -0
  126. package/lib/rpc/api.d.ts +12 -9
  127. package/lib/rpc/axios.js +1 -1
  128. package/lib/rpc/index.d.ts +1 -1
  129. package/lib/rpc/index.js +14 -0
  130. package/lib/rpc/parsers.d.ts +1 -1
  131. package/lib/rpc/parsers.js +3 -3
  132. package/lib/rpc/server.d.ts +41 -3
  133. package/lib/rpc/server.js +203 -149
  134. package/lib/stellartoml/index.d.ts +1 -0
  135. package/lib/stellartoml/index.js +2 -0
  136. package/lib/utils.d.ts +1 -0
  137. package/lib/utils.js +7 -0
  138. package/package.json +16 -16
@@ -21620,6 +21620,7 @@ var Err = function () {
21620
21620
  }]);
21621
21621
  }();
21622
21622
  ;// ./src/contract/types.ts
21623
+
21623
21624
  var DEFAULT_TIMEOUT = 5 * 60;
21624
21625
  var NULL_ACCOUNT = "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";
21625
21626
  ;// ./src/contract/utils.ts
@@ -21763,7 +21764,7 @@ function sent_transaction_toPrimitive(t, r) { if ("object" != sent_transaction_t
21763
21764
 
21764
21765
 
21765
21766
  var SentTransaction = function () {
21766
- function SentTransaction(_, assembled) {
21767
+ function SentTransaction(assembled) {
21767
21768
  var _this = this,
21768
21769
  _this$assembled$optio2;
21769
21770
  sent_transaction_classCallCheck(this, SentTransaction);
@@ -21861,12 +21862,12 @@ _defineProperty(SentTransaction, "Errors", {
21861
21862
  }(_wrapNativeSuper(Error))
21862
21863
  });
21863
21864
  _defineProperty(SentTransaction, "init", function () {
21864
- var _ref2 = sent_transaction_asyncToGenerator(sent_transaction_regeneratorRuntime().mark(function _callee2(_, assembled) {
21865
+ var _ref2 = sent_transaction_asyncToGenerator(sent_transaction_regeneratorRuntime().mark(function _callee2(assembled) {
21865
21866
  var tx, sent;
21866
21867
  return sent_transaction_regeneratorRuntime().wrap(function _callee2$(_context2) {
21867
21868
  while (1) switch (_context2.prev = _context2.next) {
21868
21869
  case 0:
21869
- tx = new _SentTransaction(undefined, assembled);
21870
+ tx = new _SentTransaction(assembled);
21870
21871
  _context2.next = 3;
21871
21872
  return tx.send();
21872
21873
  case 3:
@@ -21878,7 +21879,7 @@ _defineProperty(SentTransaction, "init", function () {
21878
21879
  }
21879
21880
  }, _callee2);
21880
21881
  }));
21881
- return function (_x, _x2) {
21882
+ return function (_x) {
21882
21883
  return _ref2.apply(this, arguments);
21883
21884
  };
21884
21885
  }());
@@ -22012,7 +22013,10 @@ var AssembledTransaction = function () {
22012
22013
  signTransaction,
22013
22014
  sigsNeeded,
22014
22015
  timeoutInSeconds,
22016
+ signOpts,
22017
+ _yield$signTransactio,
22015
22018
  signature,
22019
+ error,
22016
22020
  _args2 = arguments;
22017
22021
  return assembled_transaction_regeneratorRuntime().wrap(function _callee2$(_context2) {
22018
22022
  while (1) switch (_context2.prev = _context2.next) {
@@ -22051,14 +22055,21 @@ var AssembledTransaction = function () {
22051
22055
  timebounds: undefined,
22052
22056
  sorobanData: _this.simulationData.transactionData
22053
22057
  }).setTimeout(timeoutInSeconds).build();
22054
- _context2.next = 14;
22055
- return signTransaction(_this.built.toXDR(), {
22058
+ signOpts = {
22056
22059
  networkPassphrase: _this.options.networkPassphrase
22057
- });
22058
- case 14:
22059
- signature = _context2.sent;
22060
+ };
22061
+ if (_this.options.address) signOpts.address = _this.options.address;
22062
+ if (_this.options.submit !== undefined) signOpts.submit = _this.options.submit;
22063
+ if (_this.options.submitUrl) signOpts.submitUrl = _this.options.submitUrl;
22064
+ _context2.next = 18;
22065
+ return signTransaction(_this.built.toXDR(), signOpts);
22066
+ case 18:
22067
+ _yield$signTransactio = _context2.sent;
22068
+ signature = _yield$signTransactio.signedTxXdr;
22069
+ error = _yield$signTransactio.error;
22070
+ _this.handleWalletError(error);
22060
22071
  _this.signed = lib.TransactionBuilder.fromXDR(signature, _this.options.networkPassphrase);
22061
- case 16:
22072
+ case 23:
22062
22073
  case "end":
22063
22074
  return _context2.stop();
22064
22075
  }
@@ -22070,27 +22081,37 @@ var AssembledTransaction = function () {
22070
22081
  force,
22071
22082
  _ref6$signTransaction,
22072
22083
  signTransaction,
22084
+ originalSubmit,
22073
22085
  _args3 = arguments;
22074
22086
  return assembled_transaction_regeneratorRuntime().wrap(function _callee3$(_context3) {
22075
22087
  while (1) switch (_context3.prev = _context3.next) {
22076
22088
  case 0:
22077
22089
  _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, _ref6$force = _ref6.force, force = _ref6$force === void 0 ? false : _ref6$force, _ref6$signTransaction = _ref6.signTransaction, signTransaction = _ref6$signTransaction === void 0 ? _this.options.signTransaction : _ref6$signTransaction;
22078
22090
  if (_this.signed) {
22079
- _context3.next = 4;
22091
+ _context3.next = 10;
22080
22092
  break;
22081
22093
  }
22082
- _context3.next = 4;
22094
+ originalSubmit = _this.options.submit;
22095
+ if (_this.options.submit) {
22096
+ _this.options.submit = false;
22097
+ }
22098
+ _context3.prev = 4;
22099
+ _context3.next = 7;
22083
22100
  return _this.sign({
22084
22101
  force: force,
22085
22102
  signTransaction: signTransaction
22086
22103
  });
22087
- case 4:
22104
+ case 7:
22105
+ _context3.prev = 7;
22106
+ _this.options.submit = originalSubmit;
22107
+ return _context3.finish(7);
22108
+ case 10:
22088
22109
  return _context3.abrupt("return", _this.send());
22089
- case 5:
22110
+ case 11:
22090
22111
  case "end":
22091
22112
  return _context3.stop();
22092
22113
  }
22093
- }, _callee3);
22114
+ }, _callee3, null, [[4,, 7, 10]]);
22094
22115
  })));
22095
22116
  assembled_transaction_defineProperty(this, "needsNonInvokerSigningBy", function () {
22096
22117
  var _rawInvokeHostFunctio;
@@ -22205,18 +22226,21 @@ var AssembledTransaction = function () {
22205
22226
  _context6.t1 = entry;
22206
22227
  _context6.t2 = function () {
22207
22228
  var _ref11 = assembled_transaction_asyncToGenerator(assembled_transaction_regeneratorRuntime().mark(function _callee5(preimage) {
22229
+ var _yield$sign, signedAuthEntry, error;
22208
22230
  return assembled_transaction_regeneratorRuntime().wrap(function _callee5$(_context5) {
22209
22231
  while (1) switch (_context5.prev = _context5.next) {
22210
22232
  case 0:
22211
- _context5.t0 = Buffer;
22212
- _context5.next = 3;
22233
+ _context5.next = 2;
22213
22234
  return sign(preimage.toXDR("base64"), {
22214
- accountToSign: address
22235
+ address: address
22215
22236
  });
22216
- case 3:
22217
- _context5.t1 = _context5.sent;
22218
- return _context5.abrupt("return", _context5.t0.from.call(_context5.t0, _context5.t1, "base64"));
22219
- case 5:
22237
+ case 2:
22238
+ _yield$sign = _context5.sent;
22239
+ signedAuthEntry = _yield$sign.signedAuthEntry;
22240
+ error = _yield$sign.error;
22241
+ _this.handleWalletError(error);
22242
+ return _context5.abrupt("return", Buffer.from(signedAuthEntry, "base64"));
22243
+ case 7:
22220
22244
  case "end":
22221
22245
  return _context5.stop();
22222
22246
  }
@@ -22304,6 +22328,26 @@ var AssembledTransaction = function () {
22304
22328
  if (!this.built) throw new Error("Transaction has not yet been simulated; " + "call `AssembledTransaction.simulate` first.");
22305
22329
  return (_this$built2 = this.built) === null || _this$built2 === void 0 ? void 0 : _this$built2.toEnvelope().toXDR('base64');
22306
22330
  }
22331
+ }, {
22332
+ key: "handleWalletError",
22333
+ value: function handleWalletError(error) {
22334
+ if (!error) return;
22335
+ var message = error.message,
22336
+ code = error.code;
22337
+ var fullMessage = "".concat(message).concat(error.ext ? " (".concat(error.ext.join(', '), ")") : '');
22338
+ switch (code) {
22339
+ case -1:
22340
+ throw new AssembledTransaction.Errors.InternalWalletError(fullMessage);
22341
+ case -2:
22342
+ throw new AssembledTransaction.Errors.ExternalServiceError(fullMessage);
22343
+ case -3:
22344
+ throw new AssembledTransaction.Errors.InvalidClientRequest(fullMessage);
22345
+ case -4:
22346
+ throw new AssembledTransaction.Errors.UserRejected(fullMessage);
22347
+ default:
22348
+ throw new Error("Unhandled error: ".concat(fullMessage));
22349
+ }
22350
+ }
22307
22351
  }, {
22308
22352
  key: "simulationData",
22309
22353
  get: function get() {
@@ -22319,7 +22363,7 @@ var AssembledTransaction = function () {
22319
22363
  throw new AssembledTransaction.Errors.NotYetSimulated("Transaction has not yet been simulated");
22320
22364
  }
22321
22365
  if (api/* Api */.j.isSimulationError(simulation)) {
22322
- throw new Error("Transaction simulation failed: \"".concat(simulation.error, "\""));
22366
+ throw new AssembledTransaction.Errors.SimulationFailed("Transaction simulation failed: \"".concat(simulation.error, "\""));
22323
22367
  }
22324
22368
  if (api/* Api */.j.isSimulationRestore(simulation)) {
22325
22369
  throw new AssembledTransaction.Errors.ExpiredState("You need to restore some contract state before you can invoke this method.\n" + 'You can set `restore` to true in the method options in order to ' + 'automatically restore the contract state when needed.');
@@ -22375,7 +22419,7 @@ var AssembledTransaction = function () {
22375
22419
  throw new Error("The transaction has not yet been signed. Run `sign` first, or use `signAndSend` instead.");
22376
22420
  case 2:
22377
22421
  _context8.next = 4;
22378
- return SentTransaction.init(undefined, this);
22422
+ return SentTransaction.init(this);
22379
22423
  case 4:
22380
22424
  sent = _context8.sent;
22381
22425
  return _context8.abrupt("return", sent);
@@ -22495,41 +22539,47 @@ var AssembledTransaction = function () {
22495
22539
  }
22496
22540
  }, {
22497
22541
  key: "build",
22542
+ value: function build(options) {
22543
+ var _options$args;
22544
+ var contract = new lib.Contract(options.contractId);
22545
+ return AssembledTransaction.buildWithOp(contract.call.apply(contract, [options.method].concat(_toConsumableArray((_options$args = options.args) !== null && _options$args !== void 0 ? _options$args : []))), options);
22546
+ }
22547
+ }, {
22548
+ key: "buildWithOp",
22498
22549
  value: (function () {
22499
- var _build = assembled_transaction_asyncToGenerator(assembled_transaction_regeneratorRuntime().mark(function _callee9(options) {
22500
- var _options$fee, _options$args, _options$timeoutInSec;
22501
- var tx, contract, account;
22550
+ var _buildWithOp = assembled_transaction_asyncToGenerator(assembled_transaction_regeneratorRuntime().mark(function _callee9(operation, options) {
22551
+ var _options$fee, _options$timeoutInSec;
22552
+ var tx, account;
22502
22553
  return assembled_transaction_regeneratorRuntime().wrap(function _callee9$(_context10) {
22503
22554
  while (1) switch (_context10.prev = _context10.next) {
22504
22555
  case 0:
22505
22556
  tx = new AssembledTransaction(options);
22506
- contract = new lib.Contract(options.contractId);
22507
- _context10.next = 4;
22557
+ _context10.next = 3;
22508
22558
  return getAccount(options, tx.server);
22509
- case 4:
22559
+ case 3:
22510
22560
  account = _context10.sent;
22511
22561
  tx.raw = new lib.TransactionBuilder(account, {
22512
22562
  fee: (_options$fee = options.fee) !== null && _options$fee !== void 0 ? _options$fee : lib.BASE_FEE,
22513
22563
  networkPassphrase: options.networkPassphrase
22514
- }).addOperation(contract.call.apply(contract, [options.method].concat(_toConsumableArray((_options$args = options.args) !== null && _options$args !== void 0 ? _options$args : [])))).setTimeout((_options$timeoutInSec = options.timeoutInSeconds) !== null && _options$timeoutInSec !== void 0 ? _options$timeoutInSec : DEFAULT_TIMEOUT);
22564
+ }).setTimeout((_options$timeoutInSec = options.timeoutInSeconds) !== null && _options$timeoutInSec !== void 0 ? _options$timeoutInSec : DEFAULT_TIMEOUT).addOperation(operation);
22515
22565
  if (!options.simulate) {
22516
- _context10.next = 9;
22566
+ _context10.next = 8;
22517
22567
  break;
22518
22568
  }
22519
- _context10.next = 9;
22569
+ _context10.next = 8;
22520
22570
  return tx.simulate();
22521
- case 9:
22571
+ case 8:
22522
22572
  return _context10.abrupt("return", tx);
22523
- case 10:
22573
+ case 9:
22524
22574
  case "end":
22525
22575
  return _context10.stop();
22526
22576
  }
22527
22577
  }, _callee9);
22528
22578
  }));
22529
- function build(_x4) {
22530
- return _build.apply(this, arguments);
22579
+ function buildWithOp(_x4, _x5) {
22580
+ return _buildWithOp.apply(this, arguments);
22531
22581
  }
22532
- return build;
22582
+ return buildWithOp;
22533
22583
  }())
22534
22584
  }, {
22535
22585
  key: "buildFootprintRestoreTransaction",
@@ -22557,7 +22607,7 @@ var AssembledTransaction = function () {
22557
22607
  }
22558
22608
  }, _callee10);
22559
22609
  }));
22560
- function buildFootprintRestoreTransaction(_x5, _x6, _x7, _x8) {
22610
+ function buildFootprintRestoreTransaction(_x6, _x7, _x8, _x9) {
22561
22611
  return _buildFootprintRestoreTransaction.apply(this, arguments);
22562
22612
  }
22563
22613
  return buildFootprintRestoreTransaction;
@@ -22628,6 +22678,46 @@ assembled_transaction_defineProperty(AssembledTransaction, "Errors", {
22628
22678
  }
22629
22679
  assembled_transaction_inherits(FakeAccountError, _Error8);
22630
22680
  return assembled_transaction_createClass(FakeAccountError);
22681
+ }(assembled_transaction_wrapNativeSuper(Error)),
22682
+ SimulationFailed: function (_Error9) {
22683
+ function SimulationFailedError() {
22684
+ assembled_transaction_classCallCheck(this, SimulationFailedError);
22685
+ return assembled_transaction_callSuper(this, SimulationFailedError, arguments);
22686
+ }
22687
+ assembled_transaction_inherits(SimulationFailedError, _Error9);
22688
+ return assembled_transaction_createClass(SimulationFailedError);
22689
+ }(assembled_transaction_wrapNativeSuper(Error)),
22690
+ InternalWalletError: function (_Error10) {
22691
+ function InternalWalletError() {
22692
+ assembled_transaction_classCallCheck(this, InternalWalletError);
22693
+ return assembled_transaction_callSuper(this, InternalWalletError, arguments);
22694
+ }
22695
+ assembled_transaction_inherits(InternalWalletError, _Error10);
22696
+ return assembled_transaction_createClass(InternalWalletError);
22697
+ }(assembled_transaction_wrapNativeSuper(Error)),
22698
+ ExternalServiceError: function (_Error11) {
22699
+ function ExternalServiceError() {
22700
+ assembled_transaction_classCallCheck(this, ExternalServiceError);
22701
+ return assembled_transaction_callSuper(this, ExternalServiceError, arguments);
22702
+ }
22703
+ assembled_transaction_inherits(ExternalServiceError, _Error11);
22704
+ return assembled_transaction_createClass(ExternalServiceError);
22705
+ }(assembled_transaction_wrapNativeSuper(Error)),
22706
+ InvalidClientRequest: function (_Error12) {
22707
+ function InvalidClientRequestError() {
22708
+ assembled_transaction_classCallCheck(this, InvalidClientRequestError);
22709
+ return assembled_transaction_callSuper(this, InvalidClientRequestError, arguments);
22710
+ }
22711
+ assembled_transaction_inherits(InvalidClientRequestError, _Error12);
22712
+ return assembled_transaction_createClass(InvalidClientRequestError);
22713
+ }(assembled_transaction_wrapNativeSuper(Error)),
22714
+ UserRejected: function (_Error13) {
22715
+ function UserRejectedError() {
22716
+ assembled_transaction_classCallCheck(this, UserRejectedError);
22717
+ return assembled_transaction_callSuper(this, UserRejectedError, arguments);
22718
+ }
22719
+ assembled_transaction_inherits(UserRejectedError, _Error13);
22720
+ return assembled_transaction_createClass(UserRejectedError);
22631
22721
  }(assembled_transaction_wrapNativeSuper(Error))
22632
22722
  });
22633
22723
  ;// ./src/contract/basic_node_signer.ts
@@ -22640,38 +22730,46 @@ function basic_node_signer_asyncToGenerator(n) { return function () { var t = th
22640
22730
  var basicNodeSigner = function basicNodeSigner(keypair, networkPassphrase) {
22641
22731
  return {
22642
22732
  signTransaction: function () {
22643
- var _signTransaction = basic_node_signer_asyncToGenerator(basic_node_signer_regeneratorRuntime().mark(function _callee(tx) {
22733
+ var _signTransaction = basic_node_signer_asyncToGenerator(basic_node_signer_regeneratorRuntime().mark(function _callee(xdr, opts) {
22644
22734
  var t;
22645
22735
  return basic_node_signer_regeneratorRuntime().wrap(function _callee$(_context) {
22646
22736
  while (1) switch (_context.prev = _context.next) {
22647
22737
  case 0:
22648
- t = lib.TransactionBuilder.fromXDR(tx, networkPassphrase);
22738
+ t = lib.TransactionBuilder.fromXDR(xdr, (opts === null || opts === void 0 ? void 0 : opts.networkPassphrase) || networkPassphrase);
22649
22739
  t.sign(keypair);
22650
- return _context.abrupt("return", t.toXDR());
22740
+ return _context.abrupt("return", {
22741
+ signedTxXdr: t.toXDR(),
22742
+ signerAddress: keypair.publicKey()
22743
+ });
22651
22744
  case 3:
22652
22745
  case "end":
22653
22746
  return _context.stop();
22654
22747
  }
22655
22748
  }, _callee);
22656
22749
  }));
22657
- function signTransaction(_x) {
22750
+ function signTransaction(_x, _x2) {
22658
22751
  return _signTransaction.apply(this, arguments);
22659
22752
  }
22660
22753
  return signTransaction;
22661
22754
  }(),
22662
22755
  signAuthEntry: function () {
22663
- var _signAuthEntry = basic_node_signer_asyncToGenerator(basic_node_signer_regeneratorRuntime().mark(function _callee2(entryXdr) {
22756
+ var _signAuthEntry = basic_node_signer_asyncToGenerator(basic_node_signer_regeneratorRuntime().mark(function _callee2(authEntry) {
22757
+ var signedAuthEntry;
22664
22758
  return basic_node_signer_regeneratorRuntime().wrap(function _callee2$(_context2) {
22665
22759
  while (1) switch (_context2.prev = _context2.next) {
22666
22760
  case 0:
22667
- return _context2.abrupt("return", keypair.sign((0,lib.hash)(basic_node_signer_Buffer.from(entryXdr, "base64"))).toString("base64"));
22668
- case 1:
22761
+ signedAuthEntry = keypair.sign((0,lib.hash)(basic_node_signer_Buffer.from(authEntry, "base64"))).toString("base64");
22762
+ return _context2.abrupt("return", {
22763
+ signedAuthEntry: signedAuthEntry,
22764
+ signerAddress: keypair.publicKey()
22765
+ });
22766
+ case 2:
22669
22767
  case "end":
22670
22768
  return _context2.stop();
22671
22769
  }
22672
22770
  }, _callee2);
22673
22771
  }));
22674
- function signAuthEntry(_x2) {
22772
+ function signAuthEntry(_x3) {
22675
22773
  return _signAuthEntry.apply(this, arguments);
22676
22774
  }
22677
22775
  return signAuthEntry;
@@ -23696,11 +23794,10 @@ var Spec = function () {
23696
23794
  }();
23697
23795
  ;// ./src/contract/client.ts
23698
23796
  /* provided dependency */ var client_Buffer = __webpack_require__(8287)["Buffer"];
23699
- var _excluded = ["method"];
23700
23797
  function client_typeof(o) { "@babel/helpers - typeof"; return 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; }, client_typeof(o); }
23798
+ var _excluded = ["method"],
23799
+ _excluded2 = ["wasmHash", "salt", "format", "fee", "timeoutInSeconds", "simulate"];
23701
23800
  function client_regeneratorRuntime() { "use strict"; client_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == client_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(client_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
23702
- function client_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
23703
- function client_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { client_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { client_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
23704
23801
  function client_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; }
23705
23802
  function client_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? client_ownKeys(Object(t), !0).forEach(function (r) { client_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : client_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
23706
23803
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
@@ -23711,10 +23808,86 @@ function client_createClass(e, r, t) { return r && client_defineProperties(e.pro
23711
23808
  function client_defineProperty(e, r, t) { return (r = client_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
23712
23809
  function client_toPropertyKey(t) { var i = client_toPrimitive(t, "string"); return "symbol" == client_typeof(i) ? i : i + ""; }
23713
23810
  function client_toPrimitive(t, r) { if ("object" != client_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != client_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
23811
+ function client_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
23812
+ function client_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { client_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { client_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
23714
23813
 
23715
23814
 
23716
23815
 
23717
23816
 
23817
+
23818
+ var CONSTRUCTOR_FUNC = "__constructor";
23819
+ function specFromWasm(_x) {
23820
+ return _specFromWasm.apply(this, arguments);
23821
+ }
23822
+ function _specFromWasm() {
23823
+ _specFromWasm = client_asyncToGenerator(client_regeneratorRuntime().mark(function _callee5(wasm) {
23824
+ var wasmModule, xdrSections, bufferSection, specEntryArray, spec;
23825
+ return client_regeneratorRuntime().wrap(function _callee5$(_context5) {
23826
+ while (1) switch (_context5.prev = _context5.next) {
23827
+ case 0:
23828
+ _context5.next = 2;
23829
+ return WebAssembly.compile(wasm);
23830
+ case 2:
23831
+ wasmModule = _context5.sent;
23832
+ xdrSections = WebAssembly.Module.customSections(wasmModule, "contractspecv0");
23833
+ if (!(xdrSections.length === 0)) {
23834
+ _context5.next = 6;
23835
+ break;
23836
+ }
23837
+ throw new Error("Could not obtain contract spec from wasm");
23838
+ case 6:
23839
+ bufferSection = client_Buffer.from(xdrSections[0]);
23840
+ specEntryArray = processSpecEntryStream(bufferSection);
23841
+ spec = new Spec(specEntryArray);
23842
+ return _context5.abrupt("return", spec);
23843
+ case 10:
23844
+ case "end":
23845
+ return _context5.stop();
23846
+ }
23847
+ }, _callee5);
23848
+ }));
23849
+ return _specFromWasm.apply(this, arguments);
23850
+ }
23851
+ function specFromWasmHash(_x2, _x3) {
23852
+ return _specFromWasmHash.apply(this, arguments);
23853
+ }
23854
+ function _specFromWasmHash() {
23855
+ _specFromWasmHash = client_asyncToGenerator(client_regeneratorRuntime().mark(function _callee6(wasmHash, options) {
23856
+ var format,
23857
+ rpcUrl,
23858
+ allowHttp,
23859
+ serverOpts,
23860
+ server,
23861
+ wasm,
23862
+ _args6 = arguments;
23863
+ return client_regeneratorRuntime().wrap(function _callee6$(_context6) {
23864
+ while (1) switch (_context6.prev = _context6.next) {
23865
+ case 0:
23866
+ format = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : "hex";
23867
+ if (!(!options || !options.rpcUrl)) {
23868
+ _context6.next = 3;
23869
+ break;
23870
+ }
23871
+ throw new TypeError("options must contain rpcUrl");
23872
+ case 3:
23873
+ rpcUrl = options.rpcUrl, allowHttp = options.allowHttp;
23874
+ serverOpts = {
23875
+ allowHttp: allowHttp
23876
+ };
23877
+ server = new rpc.Server(rpcUrl, serverOpts);
23878
+ _context6.next = 8;
23879
+ return server.getContractWasmByHash(wasmHash, format);
23880
+ case 8:
23881
+ wasm = _context6.sent;
23882
+ return _context6.abrupt("return", specFromWasm(wasm));
23883
+ case 10:
23884
+ case "end":
23885
+ return _context6.stop();
23886
+ }
23887
+ }, _callee6);
23888
+ }));
23889
+ return _specFromWasmHash.apply(this, arguments);
23890
+ }
23718
23891
  var Client = function () {
23719
23892
  function Client(spec, options) {
23720
23893
  var _this = this;
@@ -23737,6 +23910,9 @@ var Client = function () {
23737
23910
  this.options = options;
23738
23911
  this.spec.funcs().forEach(function (xdrFn) {
23739
23912
  var method = xdrFn.name().toString();
23913
+ if (method === CONSTRUCTOR_FUNC) {
23914
+ return;
23915
+ }
23740
23916
  var assembleTransaction = function assembleTransaction(args, methodOptions) {
23741
23917
  return AssembledTransaction.build(client_objectSpread(client_objectSpread(client_objectSpread({
23742
23918
  method: method,
@@ -23758,22 +23934,65 @@ var Client = function () {
23758
23934
  });
23759
23935
  }
23760
23936
  return client_createClass(Client, null, [{
23937
+ key: "deploy",
23938
+ value: function () {
23939
+ var _deploy = client_asyncToGenerator(client_regeneratorRuntime().mark(function _callee(args, options) {
23940
+ var wasmHash, salt, format, fee, timeoutInSeconds, simulate, clientOptions, spec, operation;
23941
+ return client_regeneratorRuntime().wrap(function _callee$(_context) {
23942
+ while (1) switch (_context.prev = _context.next) {
23943
+ case 0:
23944
+ wasmHash = options.wasmHash, salt = options.salt, format = options.format, fee = options.fee, timeoutInSeconds = options.timeoutInSeconds, simulate = options.simulate, clientOptions = _objectWithoutProperties(options, _excluded2);
23945
+ _context.next = 3;
23946
+ return specFromWasmHash(wasmHash, clientOptions, format);
23947
+ case 3:
23948
+ spec = _context.sent;
23949
+ operation = lib.Operation.createCustomContract({
23950
+ address: new lib.Address(options.publicKey),
23951
+ wasmHash: typeof wasmHash === "string" ? client_Buffer.from(wasmHash, format !== null && format !== void 0 ? format : "hex") : wasmHash,
23952
+ salt: salt,
23953
+ constructorArgs: args ? spec.funcArgsToScVals(CONSTRUCTOR_FUNC, args) : []
23954
+ });
23955
+ return _context.abrupt("return", AssembledTransaction.buildWithOp(operation, client_objectSpread(client_objectSpread({
23956
+ fee: fee,
23957
+ timeoutInSeconds: timeoutInSeconds,
23958
+ simulate: simulate
23959
+ }, clientOptions), {}, {
23960
+ contractId: "ignored",
23961
+ method: CONSTRUCTOR_FUNC,
23962
+ parseResultXdr: function parseResultXdr(result) {
23963
+ return new Client(spec, client_objectSpread(client_objectSpread({}, clientOptions), {}, {
23964
+ contractId: lib.Address.fromScVal(result).toString()
23965
+ }));
23966
+ }
23967
+ })));
23968
+ case 6:
23969
+ case "end":
23970
+ return _context.stop();
23971
+ }
23972
+ }, _callee);
23973
+ }));
23974
+ function deploy(_x4, _x5) {
23975
+ return _deploy.apply(this, arguments);
23976
+ }
23977
+ return deploy;
23978
+ }()
23979
+ }, {
23761
23980
  key: "fromWasmHash",
23762
23981
  value: (function () {
23763
- var _fromWasmHash = client_asyncToGenerator(client_regeneratorRuntime().mark(function _callee(wasmHash, options) {
23982
+ var _fromWasmHash = client_asyncToGenerator(client_regeneratorRuntime().mark(function _callee2(wasmHash, options) {
23764
23983
  var format,
23765
23984
  rpcUrl,
23766
23985
  allowHttp,
23767
23986
  serverOpts,
23768
23987
  server,
23769
23988
  wasm,
23770
- _args = arguments;
23771
- return client_regeneratorRuntime().wrap(function _callee$(_context) {
23772
- while (1) switch (_context.prev = _context.next) {
23989
+ _args2 = arguments;
23990
+ return client_regeneratorRuntime().wrap(function _callee2$(_context2) {
23991
+ while (1) switch (_context2.prev = _context2.next) {
23773
23992
  case 0:
23774
- format = _args.length > 2 && _args[2] !== undefined ? _args[2] : "hex";
23993
+ format = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : "hex";
23775
23994
  if (!(!options || !options.rpcUrl)) {
23776
- _context.next = 3;
23995
+ _context2.next = 3;
23777
23996
  break;
23778
23997
  }
23779
23998
  throw new TypeError('options must contain rpcUrl');
@@ -23783,18 +24002,18 @@ var Client = function () {
23783
24002
  allowHttp: allowHttp
23784
24003
  };
23785
24004
  server = new rpc.Server(rpcUrl, serverOpts);
23786
- _context.next = 8;
24005
+ _context2.next = 8;
23787
24006
  return server.getContractWasmByHash(wasmHash, format);
23788
24007
  case 8:
23789
- wasm = _context.sent;
23790
- return _context.abrupt("return", Client.fromWasm(wasm, options));
24008
+ wasm = _context2.sent;
24009
+ return _context2.abrupt("return", Client.fromWasm(wasm, options));
23791
24010
  case 10:
23792
24011
  case "end":
23793
- return _context.stop();
24012
+ return _context2.stop();
23794
24013
  }
23795
- }, _callee);
24014
+ }, _callee2);
23796
24015
  }));
23797
- function fromWasmHash(_x, _x2) {
24016
+ function fromWasmHash(_x6, _x7) {
23798
24017
  return _fromWasmHash.apply(this, arguments);
23799
24018
  }
23800
24019
  return fromWasmHash;
@@ -23802,33 +24021,23 @@ var Client = function () {
23802
24021
  }, {
23803
24022
  key: "fromWasm",
23804
24023
  value: (function () {
23805
- var _fromWasm = client_asyncToGenerator(client_regeneratorRuntime().mark(function _callee2(wasm, options) {
23806
- var wasmModule, xdrSections, bufferSection, specEntryArray, spec;
23807
- return client_regeneratorRuntime().wrap(function _callee2$(_context2) {
23808
- while (1) switch (_context2.prev = _context2.next) {
24024
+ var _fromWasm = client_asyncToGenerator(client_regeneratorRuntime().mark(function _callee3(wasm, options) {
24025
+ var spec;
24026
+ return client_regeneratorRuntime().wrap(function _callee3$(_context3) {
24027
+ while (1) switch (_context3.prev = _context3.next) {
23809
24028
  case 0:
23810
- _context2.next = 2;
23811
- return WebAssembly.compile(wasm);
24029
+ _context3.next = 2;
24030
+ return specFromWasm(wasm);
23812
24031
  case 2:
23813
- wasmModule = _context2.sent;
23814
- xdrSections = WebAssembly.Module.customSections(wasmModule, "contractspecv0");
23815
- if (!(xdrSections.length === 0)) {
23816
- _context2.next = 6;
23817
- break;
23818
- }
23819
- throw new Error('Could not obtain contract spec from wasm');
23820
- case 6:
23821
- bufferSection = client_Buffer.from(xdrSections[0]);
23822
- specEntryArray = processSpecEntryStream(bufferSection);
23823
- spec = new Spec(specEntryArray);
23824
- return _context2.abrupt("return", new Client(spec, options));
23825
- case 10:
24032
+ spec = _context3.sent;
24033
+ return _context3.abrupt("return", new Client(spec, options));
24034
+ case 4:
23826
24035
  case "end":
23827
- return _context2.stop();
24036
+ return _context3.stop();
23828
24037
  }
23829
- }, _callee2);
24038
+ }, _callee3);
23830
24039
  }));
23831
- function fromWasm(_x3, _x4) {
24040
+ function fromWasm(_x8, _x9) {
23832
24041
  return _fromWasm.apply(this, arguments);
23833
24042
  }
23834
24043
  return fromWasm;
@@ -23836,13 +24045,13 @@ var Client = function () {
23836
24045
  }, {
23837
24046
  key: "from",
23838
24047
  value: (function () {
23839
- var _from = client_asyncToGenerator(client_regeneratorRuntime().mark(function _callee3(options) {
24048
+ var _from = client_asyncToGenerator(client_regeneratorRuntime().mark(function _callee4(options) {
23840
24049
  var rpcUrl, contractId, allowHttp, serverOpts, server, wasm;
23841
- return client_regeneratorRuntime().wrap(function _callee3$(_context3) {
23842
- while (1) switch (_context3.prev = _context3.next) {
24050
+ return client_regeneratorRuntime().wrap(function _callee4$(_context4) {
24051
+ while (1) switch (_context4.prev = _context4.next) {
23843
24052
  case 0:
23844
24053
  if (!(!options || !options.rpcUrl || !options.contractId)) {
23845
- _context3.next = 2;
24054
+ _context4.next = 2;
23846
24055
  break;
23847
24056
  }
23848
24057
  throw new TypeError('options must contain rpcUrl and contractId');
@@ -23852,18 +24061,18 @@ var Client = function () {
23852
24061
  allowHttp: allowHttp
23853
24062
  };
23854
24063
  server = new rpc.Server(rpcUrl, serverOpts);
23855
- _context3.next = 7;
24064
+ _context4.next = 7;
23856
24065
  return server.getContractWasmByContractId(contractId);
23857
24066
  case 7:
23858
- wasm = _context3.sent;
23859
- return _context3.abrupt("return", Client.fromWasm(wasm, options));
24067
+ wasm = _context4.sent;
24068
+ return _context4.abrupt("return", Client.fromWasm(wasm, options));
23860
24069
  case 9:
23861
24070
  case "end":
23862
- return _context3.stop();
24071
+ return _context4.stop();
23863
24072
  }
23864
- }, _callee3);
24073
+ }, _callee4);
23865
24074
  }));
23866
- function from(_x5) {
24075
+ function from(_x10) {
23867
24076
  return _from.apply(this, arguments);
23868
24077
  }
23869
24078
  return from;
@@ -24353,7 +24562,7 @@ var Api;
24353
24562
 
24354
24563
  /***/ }),
24355
24564
 
24356
- /***/ 2731:
24565
+ /***/ 8733:
24357
24566
  /***/ ((module, __webpack_exports__, __webpack_require__) => {
24358
24567
 
24359
24568
  "use strict";
@@ -24463,10 +24672,69 @@ var HorizonApi;
24463
24672
  }({});
24464
24673
  _HorizonApi.TransactionFailedResultCodes = TransactionFailedResultCodes;
24465
24674
  })(HorizonApi || (HorizonApi = {}));
24675
+ ;// ./src/horizon/types/effects.ts
24676
+ var effects_EffectType = function (EffectType) {
24677
+ EffectType[EffectType["account_created"] = 0] = "account_created";
24678
+ EffectType[EffectType["account_removed"] = 1] = "account_removed";
24679
+ EffectType[EffectType["account_credited"] = 2] = "account_credited";
24680
+ EffectType[EffectType["account_debited"] = 3] = "account_debited";
24681
+ EffectType[EffectType["account_thresholds_updated"] = 4] = "account_thresholds_updated";
24682
+ EffectType[EffectType["account_home_domain_updated"] = 5] = "account_home_domain_updated";
24683
+ EffectType[EffectType["account_flags_updated"] = 6] = "account_flags_updated";
24684
+ EffectType[EffectType["account_inflation_destination_updated"] = 7] = "account_inflation_destination_updated";
24685
+ EffectType[EffectType["signer_created"] = 10] = "signer_created";
24686
+ EffectType[EffectType["signer_removed"] = 11] = "signer_removed";
24687
+ EffectType[EffectType["signer_updated"] = 12] = "signer_updated";
24688
+ EffectType[EffectType["trustline_created"] = 20] = "trustline_created";
24689
+ EffectType[EffectType["trustline_removed"] = 21] = "trustline_removed";
24690
+ EffectType[EffectType["trustline_updated"] = 22] = "trustline_updated";
24691
+ EffectType[EffectType["trustline_authorized"] = 23] = "trustline_authorized";
24692
+ EffectType[EffectType["trustline_deauthorized"] = 24] = "trustline_deauthorized";
24693
+ EffectType[EffectType["trustline_authorized_to_maintain_liabilities"] = 25] = "trustline_authorized_to_maintain_liabilities";
24694
+ EffectType[EffectType["trustline_flags_updated"] = 26] = "trustline_flags_updated";
24695
+ EffectType[EffectType["offer_created"] = 30] = "offer_created";
24696
+ EffectType[EffectType["offer_removed"] = 31] = "offer_removed";
24697
+ EffectType[EffectType["offer_updated"] = 32] = "offer_updated";
24698
+ EffectType[EffectType["trade"] = 33] = "trade";
24699
+ EffectType[EffectType["data_created"] = 40] = "data_created";
24700
+ EffectType[EffectType["data_removed"] = 41] = "data_removed";
24701
+ EffectType[EffectType["data_updated"] = 42] = "data_updated";
24702
+ EffectType[EffectType["sequence_bumped"] = 43] = "sequence_bumped";
24703
+ EffectType[EffectType["claimable_balance_created"] = 50] = "claimable_balance_created";
24704
+ EffectType[EffectType["claimable_balance_claimant_created"] = 51] = "claimable_balance_claimant_created";
24705
+ EffectType[EffectType["claimable_balance_claimed"] = 52] = "claimable_balance_claimed";
24706
+ EffectType[EffectType["account_sponsorship_created"] = 60] = "account_sponsorship_created";
24707
+ EffectType[EffectType["account_sponsorship_updated"] = 61] = "account_sponsorship_updated";
24708
+ EffectType[EffectType["account_sponsorship_removed"] = 62] = "account_sponsorship_removed";
24709
+ EffectType[EffectType["trustline_sponsorship_created"] = 63] = "trustline_sponsorship_created";
24710
+ EffectType[EffectType["trustline_sponsorship_updated"] = 64] = "trustline_sponsorship_updated";
24711
+ EffectType[EffectType["trustline_sponsorship_removed"] = 65] = "trustline_sponsorship_removed";
24712
+ EffectType[EffectType["data_sponsorship_created"] = 66] = "data_sponsorship_created";
24713
+ EffectType[EffectType["data_sponsorship_updated"] = 67] = "data_sponsorship_updated";
24714
+ EffectType[EffectType["data_sponsorship_removed"] = 68] = "data_sponsorship_removed";
24715
+ EffectType[EffectType["claimable_balance_sponsorship_created"] = 69] = "claimable_balance_sponsorship_created";
24716
+ EffectType[EffectType["claimable_balance_sponsorship_updated"] = 70] = "claimable_balance_sponsorship_updated";
24717
+ EffectType[EffectType["claimable_balance_sponsorship_removed"] = 71] = "claimable_balance_sponsorship_removed";
24718
+ EffectType[EffectType["signer_sponsorship_created"] = 72] = "signer_sponsorship_created";
24719
+ EffectType[EffectType["signer_sponsorship_updated"] = 73] = "signer_sponsorship_updated";
24720
+ EffectType[EffectType["signer_sponsorship_removed"] = 74] = "signer_sponsorship_removed";
24721
+ EffectType[EffectType["claimable_balance_clawed_back"] = 80] = "claimable_balance_clawed_back";
24722
+ EffectType[EffectType["liquidity_pool_deposited"] = 90] = "liquidity_pool_deposited";
24723
+ EffectType[EffectType["liquidity_pool_withdrew"] = 91] = "liquidity_pool_withdrew";
24724
+ EffectType[EffectType["liquidity_pool_trade"] = 92] = "liquidity_pool_trade";
24725
+ EffectType[EffectType["liquidity_pool_created"] = 93] = "liquidity_pool_created";
24726
+ EffectType[EffectType["liquidity_pool_removed"] = 94] = "liquidity_pool_removed";
24727
+ EffectType[EffectType["liquidity_pool_revoked"] = 95] = "liquidity_pool_revoked";
24728
+ EffectType[EffectType["contract_credited"] = 96] = "contract_credited";
24729
+ EffectType[EffectType["contract_debited"] = 97] = "contract_debited";
24730
+ return EffectType;
24731
+ }({});
24466
24732
  ;// ./src/horizon/server_api.ts
24467
24733
 
24734
+
24468
24735
  var ServerApi;
24469
24736
  (function (_ServerApi) {
24737
+ var EffectType = _ServerApi.EffectType = effects_EffectType;
24470
24738
  var TradeType = function (TradeType) {
24471
24739
  TradeType["all"] = "all";
24472
24740
  TradeType["liquidityPools"] = "liquidity_pool";
@@ -27446,7 +27714,7 @@ var http_client = __webpack_require__(6371);
27446
27714
  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); }
27447
27715
 
27448
27716
 
27449
- var version = "13.0.0-beta.1";
27717
+ var version = "13.0.0-rc.2";
27450
27718
  var SERVER_TIME_MAP = {};
27451
27719
  var AxiosClient = (0,http_client/* create */.vt)({
27452
27720
  headers: {
@@ -29538,7 +29806,6 @@ __webpack_require__.r(__webpack_exports__);
29538
29806
  /* harmony export */ Horizon: () => (/* reexport module object */ _horizon__WEBPACK_IMPORTED_MODULE_7__),
29539
29807
  /* harmony export */ NetworkError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_0__.Dr),
29540
29808
  /* harmony export */ NotFoundError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_0__.m_),
29541
- /* harmony export */ SorobanRpc: () => (/* reexport module object */ _rpc__WEBPACK_IMPORTED_MODULE_8__),
29542
29809
  /* harmony export */ StellarToml: () => (/* reexport module object */ _stellartoml__WEBPACK_IMPORTED_MODULE_3__),
29543
29810
  /* harmony export */ Utils: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_2__.A),
29544
29811
  /* harmony export */ WebAuth: () => (/* reexport module object */ _webauth__WEBPACK_IMPORTED_MODULE_5__),
@@ -29553,13 +29820,13 @@ __webpack_require__.r(__webpack_exports__);
29553
29820
  /* harmony import */ var _federation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7600);
29554
29821
  /* harmony import */ var _webauth__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5479);
29555
29822
  /* harmony import */ var _friendbot__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8242);
29556
- /* harmony import */ var _horizon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2731);
29823
+ /* harmony import */ var _horizon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8733);
29557
29824
  /* harmony import */ var _rpc__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3496);
29558
29825
  /* harmony import */ var _contract__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(6299);
29559
29826
  /* harmony import */ var _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(356);
29560
29827
  /* harmony import */ var _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__);
29561
29828
  /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
29562
- /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__) if(["default","Config","Utils","StellarToml","Federation","WebAuth","Friendbot","Horizon","rpc","SorobanRpc","contract","AccountRequiresMemoError","BadRequestError","BadResponseError","NetworkError","NotFoundError"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__[__WEBPACK_IMPORT_KEY__]
29829
+ /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__) if(["default","Config","Utils","StellarToml","Federation","WebAuth","Friendbot","Horizon","rpc","contract","AccountRequiresMemoError","BadRequestError","BadResponseError","NetworkError","NotFoundError"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__[__WEBPACK_IMPORT_KEY__]
29563
29830
  /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
29564
29831
  /* module decorator */ module = __webpack_require__.hmd(module);
29565
29832
 
@@ -29580,8 +29847,6 @@ __webpack_require__.r(__webpack_exports__);
29580
29847
 
29581
29848
 
29582
29849
 
29583
-
29584
-
29585
29850
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (module.exports);
29586
29851
  if (typeof __webpack_require__.g.__USE_AXIOS__ === 'undefined') {
29587
29852
  __webpack_require__.g.__USE_AXIOS__ = true;
@@ -29639,7 +29904,9 @@ __webpack_require__.r(__webpack_exports__);
29639
29904
  __webpack_require__.d(__webpack_exports__, {
29640
29905
  Api: () => (/* reexport */ api/* Api */.j),
29641
29906
  AxiosClient: () => (/* reexport */ axios),
29907
+ BasicSleepStrategy: () => (/* reexport */ BasicSleepStrategy),
29642
29908
  Durability: () => (/* reexport */ Durability),
29909
+ LinearSleepStrategy: () => (/* reexport */ LinearSleepStrategy),
29643
29910
  Server: () => (/* reexport */ RpcServer),
29644
29911
  assembleTransaction: () => (/* reexport */ transaction/* assembleTransaction */.X),
29645
29912
  "default": () => (/* binding */ rpc),
@@ -29658,7 +29925,7 @@ var lib = __webpack_require__(356);
29658
29925
  var http_client = __webpack_require__(6371);
29659
29926
  ;// ./src/rpc/axios.ts
29660
29927
 
29661
- var version = "13.0.0-beta.1";
29928
+ var version = "13.0.0-rc.2";
29662
29929
  var AxiosClient = (0,http_client/* create */.vt)({
29663
29930
  headers: {
29664
29931
  'X-Client-Name': 'js-soroban-client',
@@ -29716,6 +29983,8 @@ function _postObject() {
29716
29983
  var transaction = __webpack_require__(8680);
29717
29984
  // EXTERNAL MODULE: ./src/rpc/parsers.ts
29718
29985
  var parsers = __webpack_require__(784);
29986
+ // EXTERNAL MODULE: ./src/utils.ts
29987
+ var utils = __webpack_require__(3121);
29719
29988
  ;// ./src/rpc/server.ts
29720
29989
  /* provided dependency */ var Buffer = __webpack_require__(8287)["Buffer"];
29721
29990
  function server_typeof(o) { "@babel/helpers - typeof"; return server_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; }, server_typeof(o); }
@@ -29737,12 +30006,20 @@ function _toPrimitive(t, r) { if ("object" != server_typeof(t) || !t) return t;
29737
30006
 
29738
30007
 
29739
30008
 
30009
+
29740
30010
  var SUBMIT_TRANSACTION_TIMEOUT = (/* unused pure expression or super */ null && (60 * 1000));
29741
30011
  var Durability = function (Durability) {
29742
30012
  Durability["Temporary"] = "temporary";
29743
30013
  Durability["Persistent"] = "persistent";
29744
30014
  return Durability;
29745
30015
  }({});
30016
+ var DEFAULT_GET_TRANSACTION_TIMEOUT = 30;
30017
+ var BasicSleepStrategy = function BasicSleepStrategy(_iter) {
30018
+ return 1000;
30019
+ };
30020
+ var LinearSleepStrategy = function LinearSleepStrategy(iter) {
30021
+ return 1000 * iter;
30022
+ };
29746
30023
  function findCreatedAccountSequenceInTransactionMeta(meta) {
29747
30024
  var _operations$flatMap$f;
29748
30025
  var operations = [];
@@ -30047,19 +30324,65 @@ var RpcServer = function () {
30047
30324
  return _getLedgerEntries;
30048
30325
  }()
30049
30326
  }, {
30050
- key: "getTransaction",
30327
+ key: "pollTransaction",
30051
30328
  value: (function () {
30052
- var _getTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee8(hash) {
30329
+ var _pollTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee8(hash, opts) {
30330
+ var _opts$attempts, _opts$attempts2;
30331
+ var maxAttempts, foundInfo, attempt, _opts$sleepStrategy;
30053
30332
  return server_regeneratorRuntime().wrap(function _callee8$(_context8) {
30054
30333
  while (1) switch (_context8.prev = _context8.next) {
30055
30334
  case 0:
30056
- return _context8.abrupt("return", this._getTransaction(hash).then(function (raw) {
30335
+ maxAttempts = ((_opts$attempts = opts === null || opts === void 0 ? void 0 : opts.attempts) !== null && _opts$attempts !== void 0 ? _opts$attempts : 0) < 1 ? DEFAULT_GET_TRANSACTION_TIMEOUT : (_opts$attempts2 = opts === null || opts === void 0 ? void 0 : opts.attempts) !== null && _opts$attempts2 !== void 0 ? _opts$attempts2 : DEFAULT_GET_TRANSACTION_TIMEOUT;
30336
+ attempt = 1;
30337
+ case 2:
30338
+ if (!(attempt < maxAttempts)) {
30339
+ _context8.next = 13;
30340
+ break;
30341
+ }
30342
+ _context8.next = 5;
30343
+ return this.getTransaction(hash);
30344
+ case 5:
30345
+ foundInfo = _context8.sent;
30346
+ if (!(foundInfo.status !== api/* Api */.j.GetTransactionStatus.NOT_FOUND)) {
30347
+ _context8.next = 8;
30348
+ break;
30349
+ }
30350
+ return _context8.abrupt("return", foundInfo);
30351
+ case 8:
30352
+ _context8.next = 10;
30353
+ return utils/* Utils */.A.sleep(((_opts$sleepStrategy = opts === null || opts === void 0 ? void 0 : opts.sleepStrategy) !== null && _opts$sleepStrategy !== void 0 ? _opts$sleepStrategy : BasicSleepStrategy)(attempt));
30354
+ case 10:
30355
+ attempt++;
30356
+ _context8.next = 2;
30357
+ break;
30358
+ case 13:
30359
+ return _context8.abrupt("return", foundInfo);
30360
+ case 14:
30361
+ case "end":
30362
+ return _context8.stop();
30363
+ }
30364
+ }, _callee8, this);
30365
+ }));
30366
+ function pollTransaction(_x6, _x7) {
30367
+ return _pollTransaction.apply(this, arguments);
30368
+ }
30369
+ return pollTransaction;
30370
+ }())
30371
+ }, {
30372
+ key: "getTransaction",
30373
+ value: (function () {
30374
+ var _getTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee9(hash) {
30375
+ return server_regeneratorRuntime().wrap(function _callee9$(_context9) {
30376
+ while (1) switch (_context9.prev = _context9.next) {
30377
+ case 0:
30378
+ return _context9.abrupt("return", this._getTransaction(hash).then(function (raw) {
30057
30379
  var foundInfo = {};
30058
30380
  if (raw.status !== api/* Api */.j.GetTransactionStatus.NOT_FOUND) {
30059
30381
  Object.assign(foundInfo, (0,parsers/* parseTransactionInfo */.WC)(raw));
30060
30382
  }
30061
30383
  var result = _objectSpread({
30062
30384
  status: raw.status,
30385
+ txHash: hash,
30063
30386
  latestLedger: raw.latestLedger,
30064
30387
  latestLedgerCloseTime: raw.latestLedgerCloseTime,
30065
30388
  oldestLedger: raw.oldestLedger,
@@ -30069,11 +30392,11 @@ var RpcServer = function () {
30069
30392
  }));
30070
30393
  case 1:
30071
30394
  case "end":
30072
- return _context8.stop();
30395
+ return _context9.stop();
30073
30396
  }
30074
- }, _callee8, this);
30397
+ }, _callee9, this);
30075
30398
  }));
30076
- function getTransaction(_x6) {
30399
+ function getTransaction(_x8) {
30077
30400
  return _getTransaction2.apply(this, arguments);
30078
30401
  }
30079
30402
  return getTransaction;
@@ -30081,20 +30404,20 @@ var RpcServer = function () {
30081
30404
  }, {
30082
30405
  key: "_getTransaction",
30083
30406
  value: function () {
30084
- var _getTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee9(hash) {
30085
- return server_regeneratorRuntime().wrap(function _callee9$(_context9) {
30086
- while (1) switch (_context9.prev = _context9.next) {
30407
+ var _getTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee10(hash) {
30408
+ return server_regeneratorRuntime().wrap(function _callee10$(_context10) {
30409
+ while (1) switch (_context10.prev = _context10.next) {
30087
30410
  case 0:
30088
- return _context9.abrupt("return", postObject(this.serverURL.toString(), 'getTransaction', {
30411
+ return _context10.abrupt("return", postObject(this.serverURL.toString(), 'getTransaction', {
30089
30412
  hash: hash
30090
30413
  }));
30091
30414
  case 1:
30092
30415
  case "end":
30093
- return _context9.stop();
30416
+ return _context10.stop();
30094
30417
  }
30095
- }, _callee9, this);
30418
+ }, _callee10, this);
30096
30419
  }));
30097
- function _getTransaction(_x7) {
30420
+ function _getTransaction(_x9) {
30098
30421
  return _getTransaction3.apply(this, arguments);
30099
30422
  }
30100
30423
  return _getTransaction;
@@ -30102,11 +30425,11 @@ var RpcServer = function () {
30102
30425
  }, {
30103
30426
  key: "getTransactions",
30104
30427
  value: (function () {
30105
- var _getTransactions2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee10(request) {
30106
- return server_regeneratorRuntime().wrap(function _callee10$(_context10) {
30107
- while (1) switch (_context10.prev = _context10.next) {
30428
+ var _getTransactions2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee11(request) {
30429
+ return server_regeneratorRuntime().wrap(function _callee11$(_context11) {
30430
+ while (1) switch (_context11.prev = _context11.next) {
30108
30431
  case 0:
30109
- return _context10.abrupt("return", this._getTransactions(request).then(function (raw) {
30432
+ return _context11.abrupt("return", this._getTransactions(request).then(function (raw) {
30110
30433
  var result = {
30111
30434
  transactions: raw.transactions.map(parsers/* parseRawTransactions */.tR),
30112
30435
  latestLedger: raw.latestLedger,
@@ -30119,11 +30442,11 @@ var RpcServer = function () {
30119
30442
  }));
30120
30443
  case 1:
30121
30444
  case "end":
30122
- return _context10.stop();
30445
+ return _context11.stop();
30123
30446
  }
30124
- }, _callee10, this);
30447
+ }, _callee11, this);
30125
30448
  }));
30126
- function getTransactions(_x8) {
30449
+ function getTransactions(_x10) {
30127
30450
  return _getTransactions2.apply(this, arguments);
30128
30451
  }
30129
30452
  return getTransactions;
@@ -30131,18 +30454,18 @@ var RpcServer = function () {
30131
30454
  }, {
30132
30455
  key: "_getTransactions",
30133
30456
  value: function () {
30134
- var _getTransactions3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee11(request) {
30135
- return server_regeneratorRuntime().wrap(function _callee11$(_context11) {
30136
- while (1) switch (_context11.prev = _context11.next) {
30457
+ var _getTransactions3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee12(request) {
30458
+ return server_regeneratorRuntime().wrap(function _callee12$(_context12) {
30459
+ while (1) switch (_context12.prev = _context12.next) {
30137
30460
  case 0:
30138
- return _context11.abrupt("return", postObject(this.serverURL.toString(), 'getTransactions', request));
30461
+ return _context12.abrupt("return", postObject(this.serverURL.toString(), 'getTransactions', request));
30139
30462
  case 1:
30140
30463
  case "end":
30141
- return _context11.stop();
30464
+ return _context12.stop();
30142
30465
  }
30143
- }, _callee11, this);
30466
+ }, _callee12, this);
30144
30467
  }));
30145
- function _getTransactions(_x9) {
30468
+ function _getTransactions(_x11) {
30146
30469
  return _getTransactions3.apply(this, arguments);
30147
30470
  }
30148
30471
  return _getTransactions;
@@ -30150,18 +30473,18 @@ var RpcServer = function () {
30150
30473
  }, {
30151
30474
  key: "getEvents",
30152
30475
  value: (function () {
30153
- var _getEvents2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee12(request) {
30154
- return server_regeneratorRuntime().wrap(function _callee12$(_context12) {
30155
- while (1) switch (_context12.prev = _context12.next) {
30476
+ var _getEvents2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee13(request) {
30477
+ return server_regeneratorRuntime().wrap(function _callee13$(_context13) {
30478
+ while (1) switch (_context13.prev = _context13.next) {
30156
30479
  case 0:
30157
- return _context12.abrupt("return", this._getEvents(request).then(parsers/* parseRawEvents */.fG));
30480
+ return _context13.abrupt("return", this._getEvents(request).then(parsers/* parseRawEvents */.fG));
30158
30481
  case 1:
30159
30482
  case "end":
30160
- return _context12.stop();
30483
+ return _context13.stop();
30161
30484
  }
30162
- }, _callee12, this);
30485
+ }, _callee13, this);
30163
30486
  }));
30164
- function getEvents(_x10) {
30487
+ function getEvents(_x12) {
30165
30488
  return _getEvents2.apply(this, arguments);
30166
30489
  }
30167
30490
  return getEvents;
@@ -30169,12 +30492,12 @@ var RpcServer = function () {
30169
30492
  }, {
30170
30493
  key: "_getEvents",
30171
30494
  value: function () {
30172
- var _getEvents3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee13(request) {
30495
+ var _getEvents3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee14(request) {
30173
30496
  var _request$filters;
30174
- return server_regeneratorRuntime().wrap(function _callee13$(_context13) {
30175
- while (1) switch (_context13.prev = _context13.next) {
30497
+ return server_regeneratorRuntime().wrap(function _callee14$(_context14) {
30498
+ while (1) switch (_context14.prev = _context14.next) {
30176
30499
  case 0:
30177
- return _context13.abrupt("return", postObject(this.serverURL.toString(), 'getEvents', _objectSpread(_objectSpread({
30500
+ return _context14.abrupt("return", postObject(this.serverURL.toString(), 'getEvents', _objectSpread(_objectSpread({
30178
30501
  filters: (_request$filters = request.filters) !== null && _request$filters !== void 0 ? _request$filters : [],
30179
30502
  pagination: _objectSpread(_objectSpread({}, request.cursor && {
30180
30503
  cursor: request.cursor
@@ -30188,11 +30511,11 @@ var RpcServer = function () {
30188
30511
  })));
30189
30512
  case 1:
30190
30513
  case "end":
30191
- return _context13.stop();
30514
+ return _context14.stop();
30192
30515
  }
30193
- }, _callee13, this);
30516
+ }, _callee14, this);
30194
30517
  }));
30195
- function _getEvents(_x11) {
30518
+ function _getEvents(_x13) {
30196
30519
  return _getEvents3.apply(this, arguments);
30197
30520
  }
30198
30521
  return _getEvents;
@@ -30200,16 +30523,16 @@ var RpcServer = function () {
30200
30523
  }, {
30201
30524
  key: "getNetwork",
30202
30525
  value: (function () {
30203
- var _getNetwork = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee14() {
30204
- return server_regeneratorRuntime().wrap(function _callee14$(_context14) {
30205
- while (1) switch (_context14.prev = _context14.next) {
30526
+ var _getNetwork = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee15() {
30527
+ return server_regeneratorRuntime().wrap(function _callee15$(_context15) {
30528
+ while (1) switch (_context15.prev = _context15.next) {
30206
30529
  case 0:
30207
- return _context14.abrupt("return", postObject(this.serverURL.toString(), 'getNetwork'));
30530
+ return _context15.abrupt("return", postObject(this.serverURL.toString(), 'getNetwork'));
30208
30531
  case 1:
30209
30532
  case "end":
30210
- return _context14.stop();
30533
+ return _context15.stop();
30211
30534
  }
30212
- }, _callee14, this);
30535
+ }, _callee15, this);
30213
30536
  }));
30214
30537
  function getNetwork() {
30215
30538
  return _getNetwork.apply(this, arguments);
@@ -30219,16 +30542,16 @@ var RpcServer = function () {
30219
30542
  }, {
30220
30543
  key: "getLatestLedger",
30221
30544
  value: (function () {
30222
- var _getLatestLedger = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee15() {
30223
- return server_regeneratorRuntime().wrap(function _callee15$(_context15) {
30224
- while (1) switch (_context15.prev = _context15.next) {
30545
+ var _getLatestLedger = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee16() {
30546
+ return server_regeneratorRuntime().wrap(function _callee16$(_context16) {
30547
+ while (1) switch (_context16.prev = _context16.next) {
30225
30548
  case 0:
30226
- return _context15.abrupt("return", postObject(this.serverURL.toString(), 'getLatestLedger'));
30549
+ return _context16.abrupt("return", postObject(this.serverURL.toString(), 'getLatestLedger'));
30227
30550
  case 1:
30228
30551
  case "end":
30229
- return _context15.stop();
30552
+ return _context16.stop();
30230
30553
  }
30231
- }, _callee15, this);
30554
+ }, _callee16, this);
30232
30555
  }));
30233
30556
  function getLatestLedger() {
30234
30557
  return _getLatestLedger.apply(this, arguments);
@@ -30238,18 +30561,18 @@ var RpcServer = function () {
30238
30561
  }, {
30239
30562
  key: "simulateTransaction",
30240
30563
  value: (function () {
30241
- var _simulateTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee16(tx, addlResources) {
30242
- return server_regeneratorRuntime().wrap(function _callee16$(_context16) {
30243
- while (1) switch (_context16.prev = _context16.next) {
30564
+ var _simulateTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee17(tx, addlResources) {
30565
+ return server_regeneratorRuntime().wrap(function _callee17$(_context17) {
30566
+ while (1) switch (_context17.prev = _context17.next) {
30244
30567
  case 0:
30245
- return _context16.abrupt("return", this._simulateTransaction(tx, addlResources).then(parsers/* parseRawSimulation */.jr));
30568
+ return _context17.abrupt("return", this._simulateTransaction(tx, addlResources).then(parsers/* parseRawSimulation */.jr));
30246
30569
  case 1:
30247
30570
  case "end":
30248
- return _context16.stop();
30571
+ return _context17.stop();
30249
30572
  }
30250
- }, _callee16, this);
30573
+ }, _callee17, this);
30251
30574
  }));
30252
- function simulateTransaction(_x12, _x13) {
30575
+ function simulateTransaction(_x14, _x15) {
30253
30576
  return _simulateTransaction2.apply(this, arguments);
30254
30577
  }
30255
30578
  return simulateTransaction;
@@ -30257,11 +30580,11 @@ var RpcServer = function () {
30257
30580
  }, {
30258
30581
  key: "_simulateTransaction",
30259
30582
  value: function () {
30260
- var _simulateTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee17(transaction, addlResources) {
30261
- return server_regeneratorRuntime().wrap(function _callee17$(_context17) {
30262
- while (1) switch (_context17.prev = _context17.next) {
30583
+ var _simulateTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee18(transaction, addlResources) {
30584
+ return server_regeneratorRuntime().wrap(function _callee18$(_context18) {
30585
+ while (1) switch (_context18.prev = _context18.next) {
30263
30586
  case 0:
30264
- return _context17.abrupt("return", postObject(this.serverURL.toString(), 'simulateTransaction', _objectSpread({
30587
+ return _context18.abrupt("return", postObject(this.serverURL.toString(), 'simulateTransaction', _objectSpread({
30265
30588
  transaction: transaction.toXDR()
30266
30589
  }, addlResources !== undefined && {
30267
30590
  resourceConfig: {
@@ -30270,11 +30593,11 @@ var RpcServer = function () {
30270
30593
  })));
30271
30594
  case 1:
30272
30595
  case "end":
30273
- return _context17.stop();
30596
+ return _context18.stop();
30274
30597
  }
30275
- }, _callee17, this);
30598
+ }, _callee18, this);
30276
30599
  }));
30277
- function _simulateTransaction(_x14, _x15) {
30600
+ function _simulateTransaction(_x16, _x17) {
30278
30601
  return _simulateTransaction3.apply(this, arguments);
30279
30602
  }
30280
30603
  return _simulateTransaction;
@@ -30282,29 +30605,29 @@ var RpcServer = function () {
30282
30605
  }, {
30283
30606
  key: "prepareTransaction",
30284
30607
  value: (function () {
30285
- var _prepareTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee18(tx) {
30608
+ var _prepareTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee19(tx) {
30286
30609
  var simResponse;
30287
- return server_regeneratorRuntime().wrap(function _callee18$(_context18) {
30288
- while (1) switch (_context18.prev = _context18.next) {
30610
+ return server_regeneratorRuntime().wrap(function _callee19$(_context19) {
30611
+ while (1) switch (_context19.prev = _context19.next) {
30289
30612
  case 0:
30290
- _context18.next = 2;
30613
+ _context19.next = 2;
30291
30614
  return this.simulateTransaction(tx);
30292
30615
  case 2:
30293
- simResponse = _context18.sent;
30616
+ simResponse = _context19.sent;
30294
30617
  if (!api/* Api */.j.isSimulationError(simResponse)) {
30295
- _context18.next = 5;
30618
+ _context19.next = 5;
30296
30619
  break;
30297
30620
  }
30298
30621
  throw new Error(simResponse.error);
30299
30622
  case 5:
30300
- return _context18.abrupt("return", (0,transaction/* assembleTransaction */.X)(tx, simResponse).build());
30623
+ return _context19.abrupt("return", (0,transaction/* assembleTransaction */.X)(tx, simResponse).build());
30301
30624
  case 6:
30302
30625
  case "end":
30303
- return _context18.stop();
30626
+ return _context19.stop();
30304
30627
  }
30305
- }, _callee18, this);
30628
+ }, _callee19, this);
30306
30629
  }));
30307
- function prepareTransaction(_x16) {
30630
+ function prepareTransaction(_x18) {
30308
30631
  return _prepareTransaction.apply(this, arguments);
30309
30632
  }
30310
30633
  return prepareTransaction;
@@ -30312,18 +30635,18 @@ var RpcServer = function () {
30312
30635
  }, {
30313
30636
  key: "sendTransaction",
30314
30637
  value: (function () {
30315
- var _sendTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee19(transaction) {
30316
- return server_regeneratorRuntime().wrap(function _callee19$(_context19) {
30317
- while (1) switch (_context19.prev = _context19.next) {
30638
+ var _sendTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee20(transaction) {
30639
+ return server_regeneratorRuntime().wrap(function _callee20$(_context20) {
30640
+ while (1) switch (_context20.prev = _context20.next) {
30318
30641
  case 0:
30319
- return _context19.abrupt("return", this._sendTransaction(transaction).then(parsers/* parseRawSendTransaction */.Af));
30642
+ return _context20.abrupt("return", this._sendTransaction(transaction).then(parsers/* parseRawSendTransaction */.Af));
30320
30643
  case 1:
30321
30644
  case "end":
30322
- return _context19.stop();
30645
+ return _context20.stop();
30323
30646
  }
30324
- }, _callee19, this);
30647
+ }, _callee20, this);
30325
30648
  }));
30326
- function sendTransaction(_x17) {
30649
+ function sendTransaction(_x19) {
30327
30650
  return _sendTransaction2.apply(this, arguments);
30328
30651
  }
30329
30652
  return sendTransaction;
@@ -30331,20 +30654,20 @@ var RpcServer = function () {
30331
30654
  }, {
30332
30655
  key: "_sendTransaction",
30333
30656
  value: function () {
30334
- var _sendTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee20(transaction) {
30335
- return server_regeneratorRuntime().wrap(function _callee20$(_context20) {
30336
- while (1) switch (_context20.prev = _context20.next) {
30657
+ var _sendTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee21(transaction) {
30658
+ return server_regeneratorRuntime().wrap(function _callee21$(_context21) {
30659
+ while (1) switch (_context21.prev = _context21.next) {
30337
30660
  case 0:
30338
- return _context20.abrupt("return", postObject(this.serverURL.toString(), 'sendTransaction', {
30661
+ return _context21.abrupt("return", postObject(this.serverURL.toString(), 'sendTransaction', {
30339
30662
  transaction: transaction.toXDR()
30340
30663
  }));
30341
30664
  case 1:
30342
30665
  case "end":
30343
- return _context20.stop();
30666
+ return _context21.stop();
30344
30667
  }
30345
- }, _callee20, this);
30668
+ }, _callee21, this);
30346
30669
  }));
30347
- function _sendTransaction(_x18) {
30670
+ function _sendTransaction(_x20) {
30348
30671
  return _sendTransaction3.apply(this, arguments);
30349
30672
  }
30350
30673
  return _sendTransaction;
@@ -30352,58 +30675,58 @@ var RpcServer = function () {
30352
30675
  }, {
30353
30676
  key: "requestAirdrop",
30354
30677
  value: (function () {
30355
- var _requestAirdrop = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee21(address, friendbotUrl) {
30678
+ var _requestAirdrop = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee22(address, friendbotUrl) {
30356
30679
  var account, response, meta, sequence, _error$response, _error$response$detai;
30357
- return server_regeneratorRuntime().wrap(function _callee21$(_context21) {
30358
- while (1) switch (_context21.prev = _context21.next) {
30680
+ return server_regeneratorRuntime().wrap(function _callee22$(_context22) {
30681
+ while (1) switch (_context22.prev = _context22.next) {
30359
30682
  case 0:
30360
30683
  account = typeof address === 'string' ? address : address.accountId();
30361
- _context21.t0 = friendbotUrl;
30362
- if (_context21.t0) {
30363
- _context21.next = 6;
30684
+ _context22.t0 = friendbotUrl;
30685
+ if (_context22.t0) {
30686
+ _context22.next = 6;
30364
30687
  break;
30365
30688
  }
30366
- _context21.next = 5;
30689
+ _context22.next = 5;
30367
30690
  return this.getNetwork();
30368
30691
  case 5:
30369
- _context21.t0 = _context21.sent.friendbotUrl;
30692
+ _context22.t0 = _context22.sent.friendbotUrl;
30370
30693
  case 6:
30371
- friendbotUrl = _context21.t0;
30694
+ friendbotUrl = _context22.t0;
30372
30695
  if (friendbotUrl) {
30373
- _context21.next = 9;
30696
+ _context22.next = 9;
30374
30697
  break;
30375
30698
  }
30376
30699
  throw new Error('No friendbot URL configured for current network');
30377
30700
  case 9:
30378
- _context21.prev = 9;
30379
- _context21.next = 12;
30701
+ _context22.prev = 9;
30702
+ _context22.next = 12;
30380
30703
  return axios.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account)));
30381
30704
  case 12:
30382
- response = _context21.sent;
30705
+ response = _context22.sent;
30383
30706
  meta = lib.xdr.TransactionMeta.fromXDR(response.data.result_meta_xdr, 'base64');
30384
30707
  sequence = findCreatedAccountSequenceInTransactionMeta(meta);
30385
- return _context21.abrupt("return", new lib.Account(account, sequence));
30708
+ return _context22.abrupt("return", new lib.Account(account, sequence));
30386
30709
  case 18:
30387
- _context21.prev = 18;
30388
- _context21.t1 = _context21["catch"](9);
30389
- if (!(((_error$response = _context21.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) {
30390
- _context21.next = 23;
30710
+ _context22.prev = 18;
30711
+ _context22.t1 = _context22["catch"](9);
30712
+ if (!(((_error$response = _context22.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) {
30713
+ _context22.next = 23;
30391
30714
  break;
30392
30715
  }
30393
- if (!((_error$response$detai = _context21.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes('createAccountAlreadyExist'))) {
30394
- _context21.next = 23;
30716
+ if (!((_error$response$detai = _context22.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes('createAccountAlreadyExist'))) {
30717
+ _context22.next = 23;
30395
30718
  break;
30396
30719
  }
30397
- return _context21.abrupt("return", this.getAccount(account));
30720
+ return _context22.abrupt("return", this.getAccount(account));
30398
30721
  case 23:
30399
- throw _context21.t1;
30722
+ throw _context22.t1;
30400
30723
  case 24:
30401
30724
  case "end":
30402
- return _context21.stop();
30725
+ return _context22.stop();
30403
30726
  }
30404
- }, _callee21, this, [[9, 18]]);
30727
+ }, _callee22, this, [[9, 18]]);
30405
30728
  }));
30406
- function requestAirdrop(_x19, _x20) {
30729
+ function requestAirdrop(_x21, _x22) {
30407
30730
  return _requestAirdrop.apply(this, arguments);
30408
30731
  }
30409
30732
  return requestAirdrop;
@@ -30411,16 +30734,16 @@ var RpcServer = function () {
30411
30734
  }, {
30412
30735
  key: "getFeeStats",
30413
30736
  value: (function () {
30414
- var _getFeeStats = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee22() {
30415
- return server_regeneratorRuntime().wrap(function _callee22$(_context22) {
30416
- while (1) switch (_context22.prev = _context22.next) {
30737
+ var _getFeeStats = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee23() {
30738
+ return server_regeneratorRuntime().wrap(function _callee23$(_context23) {
30739
+ while (1) switch (_context23.prev = _context23.next) {
30417
30740
  case 0:
30418
- return _context22.abrupt("return", postObject(this.serverURL.toString(), 'getFeeStats'));
30741
+ return _context23.abrupt("return", postObject(this.serverURL.toString(), 'getFeeStats'));
30419
30742
  case 1:
30420
30743
  case "end":
30421
- return _context22.stop();
30744
+ return _context23.stop();
30422
30745
  }
30423
- }, _callee22, this);
30746
+ }, _callee23, this);
30424
30747
  }));
30425
30748
  function getFeeStats() {
30426
30749
  return _getFeeStats.apply(this, arguments);
@@ -30430,16 +30753,16 @@ var RpcServer = function () {
30430
30753
  }, {
30431
30754
  key: "getVersionInfo",
30432
30755
  value: (function () {
30433
- var _getVersionInfo = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee23() {
30434
- return server_regeneratorRuntime().wrap(function _callee23$(_context23) {
30435
- while (1) switch (_context23.prev = _context23.next) {
30756
+ var _getVersionInfo = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee24() {
30757
+ return server_regeneratorRuntime().wrap(function _callee24$(_context24) {
30758
+ while (1) switch (_context24.prev = _context24.next) {
30436
30759
  case 0:
30437
- return _context23.abrupt("return", postObject(this.serverURL.toString(), 'getVersionInfo'));
30760
+ return _context24.abrupt("return", postObject(this.serverURL.toString(), 'getVersionInfo'));
30438
30761
  case 1:
30439
30762
  case "end":
30440
- return _context23.stop();
30763
+ return _context24.stop();
30441
30764
  }
30442
- }, _callee23, this);
30765
+ }, _callee24, this);
30443
30766
  }));
30444
30767
  function getVersionInfo() {
30445
30768
  return _getVersionInfo.apply(this, arguments);
@@ -30449,33 +30772,33 @@ var RpcServer = function () {
30449
30772
  }, {
30450
30773
  key: "getSACBalance",
30451
30774
  value: (function () {
30452
- var _getSACBalance = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee24(contractId, sac, networkPassphrase) {
30775
+ var _getSACBalance = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee25(contractId, sac, networkPassphrase) {
30453
30776
  var passphrase, sacId, key, ledgerKey, response, _response$entries$2, lastModifiedLedgerSeq, liveUntilLedgerSeq, val, entry;
30454
- return server_regeneratorRuntime().wrap(function _callee24$(_context24) {
30455
- while (1) switch (_context24.prev = _context24.next) {
30777
+ return server_regeneratorRuntime().wrap(function _callee25$(_context25) {
30778
+ while (1) switch (_context25.prev = _context25.next) {
30456
30779
  case 0:
30457
30780
  if (lib.StrKey.isValidContract(contractId)) {
30458
- _context24.next = 2;
30781
+ _context25.next = 2;
30459
30782
  break;
30460
30783
  }
30461
30784
  throw new TypeError("expected contract ID, got ".concat(contractId));
30462
30785
  case 2:
30463
30786
  if (!(networkPassphrase !== null && networkPassphrase !== void 0)) {
30464
- _context24.next = 6;
30787
+ _context25.next = 6;
30465
30788
  break;
30466
30789
  }
30467
- _context24.t0 = networkPassphrase;
30468
- _context24.next = 9;
30790
+ _context25.t0 = networkPassphrase;
30791
+ _context25.next = 9;
30469
30792
  break;
30470
30793
  case 6:
30471
- _context24.next = 8;
30794
+ _context25.next = 8;
30472
30795
  return this.getNetwork().then(function (n) {
30473
30796
  return n.passphrase;
30474
30797
  });
30475
30798
  case 8:
30476
- _context24.t0 = _context24.sent;
30799
+ _context25.t0 = _context25.sent;
30477
30800
  case 9:
30478
- passphrase = _context24.t0;
30801
+ passphrase = _context25.t0;
30479
30802
  sacId = sac.contractId(passphrase);
30480
30803
  key = lib.xdr.ScVal.scvVec([(0,lib.nativeToScVal)("Balance", {
30481
30804
  type: "symbol"
@@ -30487,29 +30810,29 @@ var RpcServer = function () {
30487
30810
  durability: lib.xdr.ContractDataDurability.persistent(),
30488
30811
  key: key
30489
30812
  }));
30490
- _context24.next = 15;
30813
+ _context25.next = 15;
30491
30814
  return this.getLedgerEntries(ledgerKey);
30492
30815
  case 15:
30493
- response = _context24.sent;
30816
+ response = _context25.sent;
30494
30817
  if (!(response.entries.length === 0)) {
30495
- _context24.next = 18;
30818
+ _context25.next = 18;
30496
30819
  break;
30497
30820
  }
30498
- return _context24.abrupt("return", {
30821
+ return _context25.abrupt("return", {
30499
30822
  latestLedger: response.latestLedger
30500
30823
  });
30501
30824
  case 18:
30502
30825
  _response$entries$2 = response.entries[0], lastModifiedLedgerSeq = _response$entries$2.lastModifiedLedgerSeq, liveUntilLedgerSeq = _response$entries$2.liveUntilLedgerSeq, val = _response$entries$2.val;
30503
30826
  if (!(val.switch().value !== lib.xdr.LedgerEntryType.contractData().value)) {
30504
- _context24.next = 21;
30827
+ _context25.next = 21;
30505
30828
  break;
30506
30829
  }
30507
- return _context24.abrupt("return", {
30830
+ return _context25.abrupt("return", {
30508
30831
  latestLedger: response.latestLedger
30509
30832
  });
30510
30833
  case 21:
30511
30834
  entry = (0,lib.scValToNative)(val.contractData().val());
30512
- return _context24.abrupt("return", {
30835
+ return _context25.abrupt("return", {
30513
30836
  latestLedger: response.latestLedger,
30514
30837
  balanceEntry: {
30515
30838
  liveUntilLedgerSeq: liveUntilLedgerSeq,
@@ -30521,11 +30844,11 @@ var RpcServer = function () {
30521
30844
  });
30522
30845
  case 23:
30523
30846
  case "end":
30524
- return _context24.stop();
30847
+ return _context25.stop();
30525
30848
  }
30526
- }, _callee24, this);
30849
+ }, _callee25, this);
30527
30850
  }));
30528
- function getSACBalance(_x21, _x22, _x23) {
30851
+ function getSACBalance(_x23, _x24, _x25) {
30529
30852
  return _getSACBalance.apply(this, arguments);
30530
30853
  }
30531
30854
  return getSACBalance;
@@ -30606,7 +30929,8 @@ function parseTransactionInfo(raw) {
30606
30929
  }
30607
30930
  function parseRawTransactions(r) {
30608
30931
  return _objectSpread({
30609
- status: r.status
30932
+ status: r.status,
30933
+ txHash: r.txHash
30610
30934
  }, parseTransactionInfo(r));
30611
30935
  }
30612
30936
  function parseRawEvents(raw) {
@@ -30649,8 +30973,7 @@ function parseSuccessful(sim, partial) {
30649
30973
  var _sim$results$length, _sim$results, _sim$stateChanges$len, _sim$stateChanges, _sim$stateChanges2;
30650
30974
  var success = _objectSpread(_objectSpread(_objectSpread({}, partial), {}, {
30651
30975
  transactionData: new _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_0__.SorobanDataBuilder(sim.transactionData),
30652
- minResourceFee: sim.minResourceFee,
30653
- cost: sim.cost
30976
+ minResourceFee: sim.minResourceFee
30654
30977
  }, ((_sim$results$length = (_sim$results = sim.results) === null || _sim$results === void 0 ? void 0 : _sim$results.length) !== null && _sim$results$length !== void 0 ? _sim$results$length : 0 > 0) && {
30655
30978
  result: sim.results.map(function (row) {
30656
30979
  var _row$auth;
@@ -30802,6 +31125,7 @@ var Resolver = function () {
30802
31125
  key: "resolve",
30803
31126
  value: (function () {
30804
31127
  var _resolve = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(domain) {
31128
+ var _opts$allowedRedirect;
30805
31129
  var opts,
30806
31130
  allowHttp,
30807
31131
  timeout,
@@ -30815,6 +31139,7 @@ var Resolver = function () {
30815
31139
  timeout = typeof opts.timeout === "undefined" ? _config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.getTimeout() : opts.timeout;
30816
31140
  protocol = allowHttp ? "http" : "https";
30817
31141
  return _context.abrupt("return", _http_client__WEBPACK_IMPORTED_MODULE_1__/* .httpClient */ .ok.get("".concat(protocol, "://").concat(domain, "/.well-known/stellar.toml"), {
31142
+ maxRedirects: (_opts$allowedRedirect = opts.allowedRedirects) !== null && _opts$allowedRedirect !== void 0 ? _opts$allowedRedirect : 0,
30818
31143
  maxContentLength: STELLAR_TOML_MAX_SIZE,
30819
31144
  cancelToken: timeout ? new CancelToken(function (cancel) {
30820
31145
  return setTimeout(function () {
@@ -30883,6 +31208,13 @@ var Utils = function () {
30883
31208
  maxTime = _transaction$timeBoun.maxTime;
30884
31209
  return now >= Number.parseInt(minTime, 10) - gracePeriod && now <= Number.parseInt(maxTime, 10) + gracePeriod;
30885
31210
  }
31211
+ }, {
31212
+ key: "sleep",
31213
+ value: function sleep(ms) {
31214
+ return new Promise(function (resolve) {
31215
+ return setTimeout(resolve, ms);
31216
+ });
31217
+ }
30886
31218
  }]);
30887
31219
  }();
30888
31220
 
@@ -39273,10 +39605,21 @@ var utilInspect = __webpack_require__(2634);
39273
39605
  var inspectCustom = utilInspect.custom;
39274
39606
  var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
39275
39607
 
39608
+ var quotes = {
39609
+ __proto__: null,
39610
+ 'double': '"',
39611
+ single: "'"
39612
+ };
39613
+ var quoteREs = {
39614
+ __proto__: null,
39615
+ 'double': /(["\\])/g,
39616
+ single: /(['\\])/g
39617
+ };
39618
+
39276
39619
  module.exports = function inspect_(obj, options, depth, seen) {
39277
39620
  var opts = options || {};
39278
39621
 
39279
- if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
39622
+ if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {
39280
39623
  throw new TypeError('option "quoteStyle" must be "single" or "double"');
39281
39624
  }
39282
39625
  if (
@@ -39471,7 +39814,8 @@ module.exports = function inspect_(obj, options, depth, seen) {
39471
39814
  };
39472
39815
 
39473
39816
  function wrapQuotes(s, defaultStyle, opts) {
39474
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
39817
+ var style = opts.quoteStyle || defaultStyle;
39818
+ var quoteChar = quotes[style];
39475
39819
  return quoteChar + s + quoteChar;
39476
39820
  }
39477
39821
 
@@ -39629,8 +39973,10 @@ function inspectString(str, opts) {
39629
39973
  var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
39630
39974
  return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
39631
39975
  }
39976
+ var quoteRE = quoteREs[opts.quoteStyle || 'single'];
39977
+ quoteRE.lastIndex = 0;
39632
39978
  // eslint-disable-next-line no-control-regex
39633
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
39979
+ var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte);
39634
39980
  return wrapQuotes(s, 'single', opts);
39635
39981
  }
39636
39982