@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: {
@@ -29535,7 +29803,6 @@ __webpack_require__.r(__webpack_exports__);
29535
29803
  /* harmony export */ Horizon: () => (/* reexport module object */ _horizon__WEBPACK_IMPORTED_MODULE_7__),
29536
29804
  /* harmony export */ NetworkError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_0__.Dr),
29537
29805
  /* harmony export */ NotFoundError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_0__.m_),
29538
- /* harmony export */ SorobanRpc: () => (/* reexport module object */ _rpc__WEBPACK_IMPORTED_MODULE_8__),
29539
29806
  /* harmony export */ StellarToml: () => (/* reexport module object */ _stellartoml__WEBPACK_IMPORTED_MODULE_3__),
29540
29807
  /* harmony export */ Utils: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_2__.A),
29541
29808
  /* harmony export */ WebAuth: () => (/* reexport module object */ _webauth__WEBPACK_IMPORTED_MODULE_5__),
@@ -29550,13 +29817,13 @@ __webpack_require__.r(__webpack_exports__);
29550
29817
  /* harmony import */ var _federation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7600);
29551
29818
  /* harmony import */ var _webauth__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5479);
29552
29819
  /* harmony import */ var _friendbot__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8242);
29553
- /* harmony import */ var _horizon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2731);
29820
+ /* harmony import */ var _horizon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8733);
29554
29821
  /* harmony import */ var _rpc__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3496);
29555
29822
  /* harmony import */ var _contract__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(6299);
29556
29823
  /* harmony import */ var _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(356);
29557
29824
  /* harmony import */ var _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__);
29558
29825
  /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
29559
- /* 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__]
29826
+ /* 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__]
29560
29827
  /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
29561
29828
  /* module decorator */ module = __webpack_require__.hmd(module);
29562
29829
 
@@ -29577,8 +29844,6 @@ __webpack_require__.r(__webpack_exports__);
29577
29844
 
29578
29845
 
29579
29846
 
29580
-
29581
-
29582
29847
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (module.exports);
29583
29848
  if (typeof __webpack_require__.g.__USE_AXIOS__ === 'undefined') {
29584
29849
  __webpack_require__.g.__USE_AXIOS__ = true;
@@ -29636,7 +29901,9 @@ __webpack_require__.r(__webpack_exports__);
29636
29901
  __webpack_require__.d(__webpack_exports__, {
29637
29902
  Api: () => (/* reexport */ api/* Api */.j),
29638
29903
  AxiosClient: () => (/* reexport */ axios),
29904
+ BasicSleepStrategy: () => (/* reexport */ BasicSleepStrategy),
29639
29905
  Durability: () => (/* reexport */ Durability),
29906
+ LinearSleepStrategy: () => (/* reexport */ LinearSleepStrategy),
29640
29907
  Server: () => (/* reexport */ RpcServer),
29641
29908
  assembleTransaction: () => (/* reexport */ transaction/* assembleTransaction */.X),
29642
29909
  "default": () => (/* binding */ rpc),
@@ -29655,7 +29922,7 @@ var lib = __webpack_require__(356);
29655
29922
  var http_client = __webpack_require__(6371);
29656
29923
  ;// ./src/rpc/axios.ts
29657
29924
 
29658
- var version = "13.0.0-beta.1";
29925
+ var version = "13.0.0-rc.2";
29659
29926
  var AxiosClient = (0,http_client/* create */.vt)({
29660
29927
  headers: {
29661
29928
  'X-Client-Name': 'js-soroban-client',
@@ -29713,6 +29980,8 @@ function _postObject() {
29713
29980
  var transaction = __webpack_require__(8680);
29714
29981
  // EXTERNAL MODULE: ./src/rpc/parsers.ts
29715
29982
  var parsers = __webpack_require__(784);
29983
+ // EXTERNAL MODULE: ./src/utils.ts
29984
+ var utils = __webpack_require__(3121);
29716
29985
  ;// ./src/rpc/server.ts
29717
29986
  /* provided dependency */ var Buffer = __webpack_require__(8287)["Buffer"];
29718
29987
  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); }
@@ -29734,12 +30003,20 @@ function _toPrimitive(t, r) { if ("object" != server_typeof(t) || !t) return t;
29734
30003
 
29735
30004
 
29736
30005
 
30006
+
29737
30007
  var SUBMIT_TRANSACTION_TIMEOUT = (/* unused pure expression or super */ null && (60 * 1000));
29738
30008
  var Durability = function (Durability) {
29739
30009
  Durability["Temporary"] = "temporary";
29740
30010
  Durability["Persistent"] = "persistent";
29741
30011
  return Durability;
29742
30012
  }({});
30013
+ var DEFAULT_GET_TRANSACTION_TIMEOUT = 30;
30014
+ var BasicSleepStrategy = function BasicSleepStrategy(_iter) {
30015
+ return 1000;
30016
+ };
30017
+ var LinearSleepStrategy = function LinearSleepStrategy(iter) {
30018
+ return 1000 * iter;
30019
+ };
29743
30020
  function findCreatedAccountSequenceInTransactionMeta(meta) {
29744
30021
  var _operations$flatMap$f;
29745
30022
  var operations = [];
@@ -30044,19 +30321,65 @@ var RpcServer = function () {
30044
30321
  return _getLedgerEntries;
30045
30322
  }()
30046
30323
  }, {
30047
- key: "getTransaction",
30324
+ key: "pollTransaction",
30048
30325
  value: (function () {
30049
- var _getTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee8(hash) {
30326
+ var _pollTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee8(hash, opts) {
30327
+ var _opts$attempts, _opts$attempts2;
30328
+ var maxAttempts, foundInfo, attempt, _opts$sleepStrategy;
30050
30329
  return server_regeneratorRuntime().wrap(function _callee8$(_context8) {
30051
30330
  while (1) switch (_context8.prev = _context8.next) {
30052
30331
  case 0:
30053
- return _context8.abrupt("return", this._getTransaction(hash).then(function (raw) {
30332
+ 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;
30333
+ attempt = 1;
30334
+ case 2:
30335
+ if (!(attempt < maxAttempts)) {
30336
+ _context8.next = 13;
30337
+ break;
30338
+ }
30339
+ _context8.next = 5;
30340
+ return this.getTransaction(hash);
30341
+ case 5:
30342
+ foundInfo = _context8.sent;
30343
+ if (!(foundInfo.status !== api/* Api */.j.GetTransactionStatus.NOT_FOUND)) {
30344
+ _context8.next = 8;
30345
+ break;
30346
+ }
30347
+ return _context8.abrupt("return", foundInfo);
30348
+ case 8:
30349
+ _context8.next = 10;
30350
+ 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));
30351
+ case 10:
30352
+ attempt++;
30353
+ _context8.next = 2;
30354
+ break;
30355
+ case 13:
30356
+ return _context8.abrupt("return", foundInfo);
30357
+ case 14:
30358
+ case "end":
30359
+ return _context8.stop();
30360
+ }
30361
+ }, _callee8, this);
30362
+ }));
30363
+ function pollTransaction(_x6, _x7) {
30364
+ return _pollTransaction.apply(this, arguments);
30365
+ }
30366
+ return pollTransaction;
30367
+ }())
30368
+ }, {
30369
+ key: "getTransaction",
30370
+ value: (function () {
30371
+ var _getTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee9(hash) {
30372
+ return server_regeneratorRuntime().wrap(function _callee9$(_context9) {
30373
+ while (1) switch (_context9.prev = _context9.next) {
30374
+ case 0:
30375
+ return _context9.abrupt("return", this._getTransaction(hash).then(function (raw) {
30054
30376
  var foundInfo = {};
30055
30377
  if (raw.status !== api/* Api */.j.GetTransactionStatus.NOT_FOUND) {
30056
30378
  Object.assign(foundInfo, (0,parsers/* parseTransactionInfo */.WC)(raw));
30057
30379
  }
30058
30380
  var result = _objectSpread({
30059
30381
  status: raw.status,
30382
+ txHash: hash,
30060
30383
  latestLedger: raw.latestLedger,
30061
30384
  latestLedgerCloseTime: raw.latestLedgerCloseTime,
30062
30385
  oldestLedger: raw.oldestLedger,
@@ -30066,11 +30389,11 @@ var RpcServer = function () {
30066
30389
  }));
30067
30390
  case 1:
30068
30391
  case "end":
30069
- return _context8.stop();
30392
+ return _context9.stop();
30070
30393
  }
30071
- }, _callee8, this);
30394
+ }, _callee9, this);
30072
30395
  }));
30073
- function getTransaction(_x6) {
30396
+ function getTransaction(_x8) {
30074
30397
  return _getTransaction2.apply(this, arguments);
30075
30398
  }
30076
30399
  return getTransaction;
@@ -30078,20 +30401,20 @@ var RpcServer = function () {
30078
30401
  }, {
30079
30402
  key: "_getTransaction",
30080
30403
  value: function () {
30081
- var _getTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee9(hash) {
30082
- return server_regeneratorRuntime().wrap(function _callee9$(_context9) {
30083
- while (1) switch (_context9.prev = _context9.next) {
30404
+ var _getTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee10(hash) {
30405
+ return server_regeneratorRuntime().wrap(function _callee10$(_context10) {
30406
+ while (1) switch (_context10.prev = _context10.next) {
30084
30407
  case 0:
30085
- return _context9.abrupt("return", postObject(this.serverURL.toString(), 'getTransaction', {
30408
+ return _context10.abrupt("return", postObject(this.serverURL.toString(), 'getTransaction', {
30086
30409
  hash: hash
30087
30410
  }));
30088
30411
  case 1:
30089
30412
  case "end":
30090
- return _context9.stop();
30413
+ return _context10.stop();
30091
30414
  }
30092
- }, _callee9, this);
30415
+ }, _callee10, this);
30093
30416
  }));
30094
- function _getTransaction(_x7) {
30417
+ function _getTransaction(_x9) {
30095
30418
  return _getTransaction3.apply(this, arguments);
30096
30419
  }
30097
30420
  return _getTransaction;
@@ -30099,11 +30422,11 @@ var RpcServer = function () {
30099
30422
  }, {
30100
30423
  key: "getTransactions",
30101
30424
  value: (function () {
30102
- var _getTransactions2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee10(request) {
30103
- return server_regeneratorRuntime().wrap(function _callee10$(_context10) {
30104
- while (1) switch (_context10.prev = _context10.next) {
30425
+ var _getTransactions2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee11(request) {
30426
+ return server_regeneratorRuntime().wrap(function _callee11$(_context11) {
30427
+ while (1) switch (_context11.prev = _context11.next) {
30105
30428
  case 0:
30106
- return _context10.abrupt("return", this._getTransactions(request).then(function (raw) {
30429
+ return _context11.abrupt("return", this._getTransactions(request).then(function (raw) {
30107
30430
  var result = {
30108
30431
  transactions: raw.transactions.map(parsers/* parseRawTransactions */.tR),
30109
30432
  latestLedger: raw.latestLedger,
@@ -30116,11 +30439,11 @@ var RpcServer = function () {
30116
30439
  }));
30117
30440
  case 1:
30118
30441
  case "end":
30119
- return _context10.stop();
30442
+ return _context11.stop();
30120
30443
  }
30121
- }, _callee10, this);
30444
+ }, _callee11, this);
30122
30445
  }));
30123
- function getTransactions(_x8) {
30446
+ function getTransactions(_x10) {
30124
30447
  return _getTransactions2.apply(this, arguments);
30125
30448
  }
30126
30449
  return getTransactions;
@@ -30128,18 +30451,18 @@ var RpcServer = function () {
30128
30451
  }, {
30129
30452
  key: "_getTransactions",
30130
30453
  value: function () {
30131
- var _getTransactions3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee11(request) {
30132
- return server_regeneratorRuntime().wrap(function _callee11$(_context11) {
30133
- while (1) switch (_context11.prev = _context11.next) {
30454
+ var _getTransactions3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee12(request) {
30455
+ return server_regeneratorRuntime().wrap(function _callee12$(_context12) {
30456
+ while (1) switch (_context12.prev = _context12.next) {
30134
30457
  case 0:
30135
- return _context11.abrupt("return", postObject(this.serverURL.toString(), 'getTransactions', request));
30458
+ return _context12.abrupt("return", postObject(this.serverURL.toString(), 'getTransactions', request));
30136
30459
  case 1:
30137
30460
  case "end":
30138
- return _context11.stop();
30461
+ return _context12.stop();
30139
30462
  }
30140
- }, _callee11, this);
30463
+ }, _callee12, this);
30141
30464
  }));
30142
- function _getTransactions(_x9) {
30465
+ function _getTransactions(_x11) {
30143
30466
  return _getTransactions3.apply(this, arguments);
30144
30467
  }
30145
30468
  return _getTransactions;
@@ -30147,18 +30470,18 @@ var RpcServer = function () {
30147
30470
  }, {
30148
30471
  key: "getEvents",
30149
30472
  value: (function () {
30150
- var _getEvents2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee12(request) {
30151
- return server_regeneratorRuntime().wrap(function _callee12$(_context12) {
30152
- while (1) switch (_context12.prev = _context12.next) {
30473
+ var _getEvents2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee13(request) {
30474
+ return server_regeneratorRuntime().wrap(function _callee13$(_context13) {
30475
+ while (1) switch (_context13.prev = _context13.next) {
30153
30476
  case 0:
30154
- return _context12.abrupt("return", this._getEvents(request).then(parsers/* parseRawEvents */.fG));
30477
+ return _context13.abrupt("return", this._getEvents(request).then(parsers/* parseRawEvents */.fG));
30155
30478
  case 1:
30156
30479
  case "end":
30157
- return _context12.stop();
30480
+ return _context13.stop();
30158
30481
  }
30159
- }, _callee12, this);
30482
+ }, _callee13, this);
30160
30483
  }));
30161
- function getEvents(_x10) {
30484
+ function getEvents(_x12) {
30162
30485
  return _getEvents2.apply(this, arguments);
30163
30486
  }
30164
30487
  return getEvents;
@@ -30166,12 +30489,12 @@ var RpcServer = function () {
30166
30489
  }, {
30167
30490
  key: "_getEvents",
30168
30491
  value: function () {
30169
- var _getEvents3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee13(request) {
30492
+ var _getEvents3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee14(request) {
30170
30493
  var _request$filters;
30171
- return server_regeneratorRuntime().wrap(function _callee13$(_context13) {
30172
- while (1) switch (_context13.prev = _context13.next) {
30494
+ return server_regeneratorRuntime().wrap(function _callee14$(_context14) {
30495
+ while (1) switch (_context14.prev = _context14.next) {
30173
30496
  case 0:
30174
- return _context13.abrupt("return", postObject(this.serverURL.toString(), 'getEvents', _objectSpread(_objectSpread({
30497
+ return _context14.abrupt("return", postObject(this.serverURL.toString(), 'getEvents', _objectSpread(_objectSpread({
30175
30498
  filters: (_request$filters = request.filters) !== null && _request$filters !== void 0 ? _request$filters : [],
30176
30499
  pagination: _objectSpread(_objectSpread({}, request.cursor && {
30177
30500
  cursor: request.cursor
@@ -30185,11 +30508,11 @@ var RpcServer = function () {
30185
30508
  })));
30186
30509
  case 1:
30187
30510
  case "end":
30188
- return _context13.stop();
30511
+ return _context14.stop();
30189
30512
  }
30190
- }, _callee13, this);
30513
+ }, _callee14, this);
30191
30514
  }));
30192
- function _getEvents(_x11) {
30515
+ function _getEvents(_x13) {
30193
30516
  return _getEvents3.apply(this, arguments);
30194
30517
  }
30195
30518
  return _getEvents;
@@ -30197,16 +30520,16 @@ var RpcServer = function () {
30197
30520
  }, {
30198
30521
  key: "getNetwork",
30199
30522
  value: (function () {
30200
- var _getNetwork = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee14() {
30201
- return server_regeneratorRuntime().wrap(function _callee14$(_context14) {
30202
- while (1) switch (_context14.prev = _context14.next) {
30523
+ var _getNetwork = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee15() {
30524
+ return server_regeneratorRuntime().wrap(function _callee15$(_context15) {
30525
+ while (1) switch (_context15.prev = _context15.next) {
30203
30526
  case 0:
30204
- return _context14.abrupt("return", postObject(this.serverURL.toString(), 'getNetwork'));
30527
+ return _context15.abrupt("return", postObject(this.serverURL.toString(), 'getNetwork'));
30205
30528
  case 1:
30206
30529
  case "end":
30207
- return _context14.stop();
30530
+ return _context15.stop();
30208
30531
  }
30209
- }, _callee14, this);
30532
+ }, _callee15, this);
30210
30533
  }));
30211
30534
  function getNetwork() {
30212
30535
  return _getNetwork.apply(this, arguments);
@@ -30216,16 +30539,16 @@ var RpcServer = function () {
30216
30539
  }, {
30217
30540
  key: "getLatestLedger",
30218
30541
  value: (function () {
30219
- var _getLatestLedger = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee15() {
30220
- return server_regeneratorRuntime().wrap(function _callee15$(_context15) {
30221
- while (1) switch (_context15.prev = _context15.next) {
30542
+ var _getLatestLedger = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee16() {
30543
+ return server_regeneratorRuntime().wrap(function _callee16$(_context16) {
30544
+ while (1) switch (_context16.prev = _context16.next) {
30222
30545
  case 0:
30223
- return _context15.abrupt("return", postObject(this.serverURL.toString(), 'getLatestLedger'));
30546
+ return _context16.abrupt("return", postObject(this.serverURL.toString(), 'getLatestLedger'));
30224
30547
  case 1:
30225
30548
  case "end":
30226
- return _context15.stop();
30549
+ return _context16.stop();
30227
30550
  }
30228
- }, _callee15, this);
30551
+ }, _callee16, this);
30229
30552
  }));
30230
30553
  function getLatestLedger() {
30231
30554
  return _getLatestLedger.apply(this, arguments);
@@ -30235,18 +30558,18 @@ var RpcServer = function () {
30235
30558
  }, {
30236
30559
  key: "simulateTransaction",
30237
30560
  value: (function () {
30238
- var _simulateTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee16(tx, addlResources) {
30239
- return server_regeneratorRuntime().wrap(function _callee16$(_context16) {
30240
- while (1) switch (_context16.prev = _context16.next) {
30561
+ var _simulateTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee17(tx, addlResources) {
30562
+ return server_regeneratorRuntime().wrap(function _callee17$(_context17) {
30563
+ while (1) switch (_context17.prev = _context17.next) {
30241
30564
  case 0:
30242
- return _context16.abrupt("return", this._simulateTransaction(tx, addlResources).then(parsers/* parseRawSimulation */.jr));
30565
+ return _context17.abrupt("return", this._simulateTransaction(tx, addlResources).then(parsers/* parseRawSimulation */.jr));
30243
30566
  case 1:
30244
30567
  case "end":
30245
- return _context16.stop();
30568
+ return _context17.stop();
30246
30569
  }
30247
- }, _callee16, this);
30570
+ }, _callee17, this);
30248
30571
  }));
30249
- function simulateTransaction(_x12, _x13) {
30572
+ function simulateTransaction(_x14, _x15) {
30250
30573
  return _simulateTransaction2.apply(this, arguments);
30251
30574
  }
30252
30575
  return simulateTransaction;
@@ -30254,11 +30577,11 @@ var RpcServer = function () {
30254
30577
  }, {
30255
30578
  key: "_simulateTransaction",
30256
30579
  value: function () {
30257
- var _simulateTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee17(transaction, addlResources) {
30258
- return server_regeneratorRuntime().wrap(function _callee17$(_context17) {
30259
- while (1) switch (_context17.prev = _context17.next) {
30580
+ var _simulateTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee18(transaction, addlResources) {
30581
+ return server_regeneratorRuntime().wrap(function _callee18$(_context18) {
30582
+ while (1) switch (_context18.prev = _context18.next) {
30260
30583
  case 0:
30261
- return _context17.abrupt("return", postObject(this.serverURL.toString(), 'simulateTransaction', _objectSpread({
30584
+ return _context18.abrupt("return", postObject(this.serverURL.toString(), 'simulateTransaction', _objectSpread({
30262
30585
  transaction: transaction.toXDR()
30263
30586
  }, addlResources !== undefined && {
30264
30587
  resourceConfig: {
@@ -30267,11 +30590,11 @@ var RpcServer = function () {
30267
30590
  })));
30268
30591
  case 1:
30269
30592
  case "end":
30270
- return _context17.stop();
30593
+ return _context18.stop();
30271
30594
  }
30272
- }, _callee17, this);
30595
+ }, _callee18, this);
30273
30596
  }));
30274
- function _simulateTransaction(_x14, _x15) {
30597
+ function _simulateTransaction(_x16, _x17) {
30275
30598
  return _simulateTransaction3.apply(this, arguments);
30276
30599
  }
30277
30600
  return _simulateTransaction;
@@ -30279,29 +30602,29 @@ var RpcServer = function () {
30279
30602
  }, {
30280
30603
  key: "prepareTransaction",
30281
30604
  value: (function () {
30282
- var _prepareTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee18(tx) {
30605
+ var _prepareTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee19(tx) {
30283
30606
  var simResponse;
30284
- return server_regeneratorRuntime().wrap(function _callee18$(_context18) {
30285
- while (1) switch (_context18.prev = _context18.next) {
30607
+ return server_regeneratorRuntime().wrap(function _callee19$(_context19) {
30608
+ while (1) switch (_context19.prev = _context19.next) {
30286
30609
  case 0:
30287
- _context18.next = 2;
30610
+ _context19.next = 2;
30288
30611
  return this.simulateTransaction(tx);
30289
30612
  case 2:
30290
- simResponse = _context18.sent;
30613
+ simResponse = _context19.sent;
30291
30614
  if (!api/* Api */.j.isSimulationError(simResponse)) {
30292
- _context18.next = 5;
30615
+ _context19.next = 5;
30293
30616
  break;
30294
30617
  }
30295
30618
  throw new Error(simResponse.error);
30296
30619
  case 5:
30297
- return _context18.abrupt("return", (0,transaction/* assembleTransaction */.X)(tx, simResponse).build());
30620
+ return _context19.abrupt("return", (0,transaction/* assembleTransaction */.X)(tx, simResponse).build());
30298
30621
  case 6:
30299
30622
  case "end":
30300
- return _context18.stop();
30623
+ return _context19.stop();
30301
30624
  }
30302
- }, _callee18, this);
30625
+ }, _callee19, this);
30303
30626
  }));
30304
- function prepareTransaction(_x16) {
30627
+ function prepareTransaction(_x18) {
30305
30628
  return _prepareTransaction.apply(this, arguments);
30306
30629
  }
30307
30630
  return prepareTransaction;
@@ -30309,18 +30632,18 @@ var RpcServer = function () {
30309
30632
  }, {
30310
30633
  key: "sendTransaction",
30311
30634
  value: (function () {
30312
- var _sendTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee19(transaction) {
30313
- return server_regeneratorRuntime().wrap(function _callee19$(_context19) {
30314
- while (1) switch (_context19.prev = _context19.next) {
30635
+ var _sendTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee20(transaction) {
30636
+ return server_regeneratorRuntime().wrap(function _callee20$(_context20) {
30637
+ while (1) switch (_context20.prev = _context20.next) {
30315
30638
  case 0:
30316
- return _context19.abrupt("return", this._sendTransaction(transaction).then(parsers/* parseRawSendTransaction */.Af));
30639
+ return _context20.abrupt("return", this._sendTransaction(transaction).then(parsers/* parseRawSendTransaction */.Af));
30317
30640
  case 1:
30318
30641
  case "end":
30319
- return _context19.stop();
30642
+ return _context20.stop();
30320
30643
  }
30321
- }, _callee19, this);
30644
+ }, _callee20, this);
30322
30645
  }));
30323
- function sendTransaction(_x17) {
30646
+ function sendTransaction(_x19) {
30324
30647
  return _sendTransaction2.apply(this, arguments);
30325
30648
  }
30326
30649
  return sendTransaction;
@@ -30328,20 +30651,20 @@ var RpcServer = function () {
30328
30651
  }, {
30329
30652
  key: "_sendTransaction",
30330
30653
  value: function () {
30331
- var _sendTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee20(transaction) {
30332
- return server_regeneratorRuntime().wrap(function _callee20$(_context20) {
30333
- while (1) switch (_context20.prev = _context20.next) {
30654
+ var _sendTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee21(transaction) {
30655
+ return server_regeneratorRuntime().wrap(function _callee21$(_context21) {
30656
+ while (1) switch (_context21.prev = _context21.next) {
30334
30657
  case 0:
30335
- return _context20.abrupt("return", postObject(this.serverURL.toString(), 'sendTransaction', {
30658
+ return _context21.abrupt("return", postObject(this.serverURL.toString(), 'sendTransaction', {
30336
30659
  transaction: transaction.toXDR()
30337
30660
  }));
30338
30661
  case 1:
30339
30662
  case "end":
30340
- return _context20.stop();
30663
+ return _context21.stop();
30341
30664
  }
30342
- }, _callee20, this);
30665
+ }, _callee21, this);
30343
30666
  }));
30344
- function _sendTransaction(_x18) {
30667
+ function _sendTransaction(_x20) {
30345
30668
  return _sendTransaction3.apply(this, arguments);
30346
30669
  }
30347
30670
  return _sendTransaction;
@@ -30349,58 +30672,58 @@ var RpcServer = function () {
30349
30672
  }, {
30350
30673
  key: "requestAirdrop",
30351
30674
  value: (function () {
30352
- var _requestAirdrop = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee21(address, friendbotUrl) {
30675
+ var _requestAirdrop = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee22(address, friendbotUrl) {
30353
30676
  var account, response, meta, sequence, _error$response, _error$response$detai;
30354
- return server_regeneratorRuntime().wrap(function _callee21$(_context21) {
30355
- while (1) switch (_context21.prev = _context21.next) {
30677
+ return server_regeneratorRuntime().wrap(function _callee22$(_context22) {
30678
+ while (1) switch (_context22.prev = _context22.next) {
30356
30679
  case 0:
30357
30680
  account = typeof address === 'string' ? address : address.accountId();
30358
- _context21.t0 = friendbotUrl;
30359
- if (_context21.t0) {
30360
- _context21.next = 6;
30681
+ _context22.t0 = friendbotUrl;
30682
+ if (_context22.t0) {
30683
+ _context22.next = 6;
30361
30684
  break;
30362
30685
  }
30363
- _context21.next = 5;
30686
+ _context22.next = 5;
30364
30687
  return this.getNetwork();
30365
30688
  case 5:
30366
- _context21.t0 = _context21.sent.friendbotUrl;
30689
+ _context22.t0 = _context22.sent.friendbotUrl;
30367
30690
  case 6:
30368
- friendbotUrl = _context21.t0;
30691
+ friendbotUrl = _context22.t0;
30369
30692
  if (friendbotUrl) {
30370
- _context21.next = 9;
30693
+ _context22.next = 9;
30371
30694
  break;
30372
30695
  }
30373
30696
  throw new Error('No friendbot URL configured for current network');
30374
30697
  case 9:
30375
- _context21.prev = 9;
30376
- _context21.next = 12;
30698
+ _context22.prev = 9;
30699
+ _context22.next = 12;
30377
30700
  return axios.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account)));
30378
30701
  case 12:
30379
- response = _context21.sent;
30702
+ response = _context22.sent;
30380
30703
  meta = lib.xdr.TransactionMeta.fromXDR(response.data.result_meta_xdr, 'base64');
30381
30704
  sequence = findCreatedAccountSequenceInTransactionMeta(meta);
30382
- return _context21.abrupt("return", new lib.Account(account, sequence));
30705
+ return _context22.abrupt("return", new lib.Account(account, sequence));
30383
30706
  case 18:
30384
- _context21.prev = 18;
30385
- _context21.t1 = _context21["catch"](9);
30386
- if (!(((_error$response = _context21.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) {
30387
- _context21.next = 23;
30707
+ _context22.prev = 18;
30708
+ _context22.t1 = _context22["catch"](9);
30709
+ if (!(((_error$response = _context22.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) {
30710
+ _context22.next = 23;
30388
30711
  break;
30389
30712
  }
30390
- if (!((_error$response$detai = _context21.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes('createAccountAlreadyExist'))) {
30391
- _context21.next = 23;
30713
+ if (!((_error$response$detai = _context22.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes('createAccountAlreadyExist'))) {
30714
+ _context22.next = 23;
30392
30715
  break;
30393
30716
  }
30394
- return _context21.abrupt("return", this.getAccount(account));
30717
+ return _context22.abrupt("return", this.getAccount(account));
30395
30718
  case 23:
30396
- throw _context21.t1;
30719
+ throw _context22.t1;
30397
30720
  case 24:
30398
30721
  case "end":
30399
- return _context21.stop();
30722
+ return _context22.stop();
30400
30723
  }
30401
- }, _callee21, this, [[9, 18]]);
30724
+ }, _callee22, this, [[9, 18]]);
30402
30725
  }));
30403
- function requestAirdrop(_x19, _x20) {
30726
+ function requestAirdrop(_x21, _x22) {
30404
30727
  return _requestAirdrop.apply(this, arguments);
30405
30728
  }
30406
30729
  return requestAirdrop;
@@ -30408,16 +30731,16 @@ var RpcServer = function () {
30408
30731
  }, {
30409
30732
  key: "getFeeStats",
30410
30733
  value: (function () {
30411
- var _getFeeStats = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee22() {
30412
- return server_regeneratorRuntime().wrap(function _callee22$(_context22) {
30413
- while (1) switch (_context22.prev = _context22.next) {
30734
+ var _getFeeStats = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee23() {
30735
+ return server_regeneratorRuntime().wrap(function _callee23$(_context23) {
30736
+ while (1) switch (_context23.prev = _context23.next) {
30414
30737
  case 0:
30415
- return _context22.abrupt("return", postObject(this.serverURL.toString(), 'getFeeStats'));
30738
+ return _context23.abrupt("return", postObject(this.serverURL.toString(), 'getFeeStats'));
30416
30739
  case 1:
30417
30740
  case "end":
30418
- return _context22.stop();
30741
+ return _context23.stop();
30419
30742
  }
30420
- }, _callee22, this);
30743
+ }, _callee23, this);
30421
30744
  }));
30422
30745
  function getFeeStats() {
30423
30746
  return _getFeeStats.apply(this, arguments);
@@ -30427,16 +30750,16 @@ var RpcServer = function () {
30427
30750
  }, {
30428
30751
  key: "getVersionInfo",
30429
30752
  value: (function () {
30430
- var _getVersionInfo = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee23() {
30431
- return server_regeneratorRuntime().wrap(function _callee23$(_context23) {
30432
- while (1) switch (_context23.prev = _context23.next) {
30753
+ var _getVersionInfo = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee24() {
30754
+ return server_regeneratorRuntime().wrap(function _callee24$(_context24) {
30755
+ while (1) switch (_context24.prev = _context24.next) {
30433
30756
  case 0:
30434
- return _context23.abrupt("return", postObject(this.serverURL.toString(), 'getVersionInfo'));
30757
+ return _context24.abrupt("return", postObject(this.serverURL.toString(), 'getVersionInfo'));
30435
30758
  case 1:
30436
30759
  case "end":
30437
- return _context23.stop();
30760
+ return _context24.stop();
30438
30761
  }
30439
- }, _callee23, this);
30762
+ }, _callee24, this);
30440
30763
  }));
30441
30764
  function getVersionInfo() {
30442
30765
  return _getVersionInfo.apply(this, arguments);
@@ -30446,33 +30769,33 @@ var RpcServer = function () {
30446
30769
  }, {
30447
30770
  key: "getSACBalance",
30448
30771
  value: (function () {
30449
- var _getSACBalance = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee24(contractId, sac, networkPassphrase) {
30772
+ var _getSACBalance = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee25(contractId, sac, networkPassphrase) {
30450
30773
  var passphrase, sacId, key, ledgerKey, response, _response$entries$2, lastModifiedLedgerSeq, liveUntilLedgerSeq, val, entry;
30451
- return server_regeneratorRuntime().wrap(function _callee24$(_context24) {
30452
- while (1) switch (_context24.prev = _context24.next) {
30774
+ return server_regeneratorRuntime().wrap(function _callee25$(_context25) {
30775
+ while (1) switch (_context25.prev = _context25.next) {
30453
30776
  case 0:
30454
30777
  if (lib.StrKey.isValidContract(contractId)) {
30455
- _context24.next = 2;
30778
+ _context25.next = 2;
30456
30779
  break;
30457
30780
  }
30458
30781
  throw new TypeError("expected contract ID, got ".concat(contractId));
30459
30782
  case 2:
30460
30783
  if (!(networkPassphrase !== null && networkPassphrase !== void 0)) {
30461
- _context24.next = 6;
30784
+ _context25.next = 6;
30462
30785
  break;
30463
30786
  }
30464
- _context24.t0 = networkPassphrase;
30465
- _context24.next = 9;
30787
+ _context25.t0 = networkPassphrase;
30788
+ _context25.next = 9;
30466
30789
  break;
30467
30790
  case 6:
30468
- _context24.next = 8;
30791
+ _context25.next = 8;
30469
30792
  return this.getNetwork().then(function (n) {
30470
30793
  return n.passphrase;
30471
30794
  });
30472
30795
  case 8:
30473
- _context24.t0 = _context24.sent;
30796
+ _context25.t0 = _context25.sent;
30474
30797
  case 9:
30475
- passphrase = _context24.t0;
30798
+ passphrase = _context25.t0;
30476
30799
  sacId = sac.contractId(passphrase);
30477
30800
  key = lib.xdr.ScVal.scvVec([(0,lib.nativeToScVal)("Balance", {
30478
30801
  type: "symbol"
@@ -30484,29 +30807,29 @@ var RpcServer = function () {
30484
30807
  durability: lib.xdr.ContractDataDurability.persistent(),
30485
30808
  key: key
30486
30809
  }));
30487
- _context24.next = 15;
30810
+ _context25.next = 15;
30488
30811
  return this.getLedgerEntries(ledgerKey);
30489
30812
  case 15:
30490
- response = _context24.sent;
30813
+ response = _context25.sent;
30491
30814
  if (!(response.entries.length === 0)) {
30492
- _context24.next = 18;
30815
+ _context25.next = 18;
30493
30816
  break;
30494
30817
  }
30495
- return _context24.abrupt("return", {
30818
+ return _context25.abrupt("return", {
30496
30819
  latestLedger: response.latestLedger
30497
30820
  });
30498
30821
  case 18:
30499
30822
  _response$entries$2 = response.entries[0], lastModifiedLedgerSeq = _response$entries$2.lastModifiedLedgerSeq, liveUntilLedgerSeq = _response$entries$2.liveUntilLedgerSeq, val = _response$entries$2.val;
30500
30823
  if (!(val.switch().value !== lib.xdr.LedgerEntryType.contractData().value)) {
30501
- _context24.next = 21;
30824
+ _context25.next = 21;
30502
30825
  break;
30503
30826
  }
30504
- return _context24.abrupt("return", {
30827
+ return _context25.abrupt("return", {
30505
30828
  latestLedger: response.latestLedger
30506
30829
  });
30507
30830
  case 21:
30508
30831
  entry = (0,lib.scValToNative)(val.contractData().val());
30509
- return _context24.abrupt("return", {
30832
+ return _context25.abrupt("return", {
30510
30833
  latestLedger: response.latestLedger,
30511
30834
  balanceEntry: {
30512
30835
  liveUntilLedgerSeq: liveUntilLedgerSeq,
@@ -30518,11 +30841,11 @@ var RpcServer = function () {
30518
30841
  });
30519
30842
  case 23:
30520
30843
  case "end":
30521
- return _context24.stop();
30844
+ return _context25.stop();
30522
30845
  }
30523
- }, _callee24, this);
30846
+ }, _callee25, this);
30524
30847
  }));
30525
- function getSACBalance(_x21, _x22, _x23) {
30848
+ function getSACBalance(_x23, _x24, _x25) {
30526
30849
  return _getSACBalance.apply(this, arguments);
30527
30850
  }
30528
30851
  return getSACBalance;
@@ -30603,7 +30926,8 @@ function parseTransactionInfo(raw) {
30603
30926
  }
30604
30927
  function parseRawTransactions(r) {
30605
30928
  return _objectSpread({
30606
- status: r.status
30929
+ status: r.status,
30930
+ txHash: r.txHash
30607
30931
  }, parseTransactionInfo(r));
30608
30932
  }
30609
30933
  function parseRawEvents(raw) {
@@ -30646,8 +30970,7 @@ function parseSuccessful(sim, partial) {
30646
30970
  var _sim$results$length, _sim$results, _sim$stateChanges$len, _sim$stateChanges, _sim$stateChanges2;
30647
30971
  var success = _objectSpread(_objectSpread(_objectSpread({}, partial), {}, {
30648
30972
  transactionData: new _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_0__.SorobanDataBuilder(sim.transactionData),
30649
- minResourceFee: sim.minResourceFee,
30650
- cost: sim.cost
30973
+ minResourceFee: sim.minResourceFee
30651
30974
  }, ((_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) && {
30652
30975
  result: sim.results.map(function (row) {
30653
30976
  var _row$auth;
@@ -30799,6 +31122,7 @@ var Resolver = function () {
30799
31122
  key: "resolve",
30800
31123
  value: (function () {
30801
31124
  var _resolve = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(domain) {
31125
+ var _opts$allowedRedirect;
30802
31126
  var opts,
30803
31127
  allowHttp,
30804
31128
  timeout,
@@ -30812,6 +31136,7 @@ var Resolver = function () {
30812
31136
  timeout = typeof opts.timeout === "undefined" ? _config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.getTimeout() : opts.timeout;
30813
31137
  protocol = allowHttp ? "http" : "https";
30814
31138
  return _context.abrupt("return", _http_client__WEBPACK_IMPORTED_MODULE_1__/* .httpClient */ .ok.get("".concat(protocol, "://").concat(domain, "/.well-known/stellar.toml"), {
31139
+ maxRedirects: (_opts$allowedRedirect = opts.allowedRedirects) !== null && _opts$allowedRedirect !== void 0 ? _opts$allowedRedirect : 0,
30815
31140
  maxContentLength: STELLAR_TOML_MAX_SIZE,
30816
31141
  cancelToken: timeout ? new CancelToken(function (cancel) {
30817
31142
  return setTimeout(function () {
@@ -30880,6 +31205,13 @@ var Utils = function () {
30880
31205
  maxTime = _transaction$timeBoun.maxTime;
30881
31206
  return now >= Number.parseInt(minTime, 10) - gracePeriod && now <= Number.parseInt(maxTime, 10) + gracePeriod;
30882
31207
  }
31208
+ }, {
31209
+ key: "sleep",
31210
+ value: function sleep(ms) {
31211
+ return new Promise(function (resolve) {
31212
+ return setTimeout(resolve, ms);
31213
+ });
31214
+ }
30883
31215
  }]);
30884
31216
  }();
30885
31217