@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__(9983);
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: {
@@ -33348,7 +33616,6 @@ __webpack_require__.r(__webpack_exports__);
33348
33616
  /* harmony export */ Horizon: () => (/* reexport module object */ _horizon__WEBPACK_IMPORTED_MODULE_7__),
33349
33617
  /* harmony export */ NetworkError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_0__.Dr),
33350
33618
  /* harmony export */ NotFoundError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_0__.m_),
33351
- /* harmony export */ SorobanRpc: () => (/* reexport module object */ _rpc__WEBPACK_IMPORTED_MODULE_8__),
33352
33619
  /* harmony export */ StellarToml: () => (/* reexport module object */ _stellartoml__WEBPACK_IMPORTED_MODULE_3__),
33353
33620
  /* harmony export */ Utils: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_2__.A),
33354
33621
  /* harmony export */ WebAuth: () => (/* reexport module object */ _webauth__WEBPACK_IMPORTED_MODULE_5__),
@@ -33363,13 +33630,13 @@ __webpack_require__.r(__webpack_exports__);
33363
33630
  /* harmony import */ var _federation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7600);
33364
33631
  /* harmony import */ var _webauth__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5479);
33365
33632
  /* harmony import */ var _friendbot__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8242);
33366
- /* harmony import */ var _horizon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2731);
33633
+ /* harmony import */ var _horizon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8733);
33367
33634
  /* harmony import */ var _rpc__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3496);
33368
33635
  /* harmony import */ var _contract__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(6299);
33369
33636
  /* harmony import */ var _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(356);
33370
33637
  /* harmony import */ var _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__);
33371
33638
  /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
33372
- /* 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__]
33639
+ /* 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__]
33373
33640
  /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
33374
33641
  /* module decorator */ module = __webpack_require__.hmd(module);
33375
33642
 
@@ -33390,8 +33657,6 @@ __webpack_require__.r(__webpack_exports__);
33390
33657
 
33391
33658
 
33392
33659
 
33393
-
33394
-
33395
33660
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (module.exports);
33396
33661
  if (typeof __webpack_require__.g.__USE_AXIOS__ === 'undefined') {
33397
33662
  __webpack_require__.g.__USE_AXIOS__ = true;
@@ -33449,7 +33714,9 @@ __webpack_require__.r(__webpack_exports__);
33449
33714
  __webpack_require__.d(__webpack_exports__, {
33450
33715
  Api: () => (/* reexport */ api/* Api */.j),
33451
33716
  AxiosClient: () => (/* reexport */ axios),
33717
+ BasicSleepStrategy: () => (/* reexport */ BasicSleepStrategy),
33452
33718
  Durability: () => (/* reexport */ Durability),
33719
+ LinearSleepStrategy: () => (/* reexport */ LinearSleepStrategy),
33453
33720
  Server: () => (/* reexport */ RpcServer),
33454
33721
  assembleTransaction: () => (/* reexport */ transaction/* assembleTransaction */.X),
33455
33722
  "default": () => (/* binding */ rpc),
@@ -33468,7 +33735,7 @@ var lib = __webpack_require__(356);
33468
33735
  var http_client = __webpack_require__(9983);
33469
33736
  ;// ./src/rpc/axios.ts
33470
33737
 
33471
- var version = "13.0.0-beta.1";
33738
+ var version = "13.0.0-rc.2";
33472
33739
  var AxiosClient = (0,http_client/* create */.vt)({
33473
33740
  headers: {
33474
33741
  'X-Client-Name': 'js-soroban-client',
@@ -33526,6 +33793,8 @@ function _postObject() {
33526
33793
  var transaction = __webpack_require__(8680);
33527
33794
  // EXTERNAL MODULE: ./src/rpc/parsers.ts
33528
33795
  var parsers = __webpack_require__(784);
33796
+ // EXTERNAL MODULE: ./src/utils.ts
33797
+ var utils = __webpack_require__(3121);
33529
33798
  ;// ./src/rpc/server.ts
33530
33799
  /* provided dependency */ var Buffer = __webpack_require__(8287)["Buffer"];
33531
33800
  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); }
@@ -33547,12 +33816,20 @@ function _toPrimitive(t, r) { if ("object" != server_typeof(t) || !t) return t;
33547
33816
 
33548
33817
 
33549
33818
 
33819
+
33550
33820
  var SUBMIT_TRANSACTION_TIMEOUT = (/* unused pure expression or super */ null && (60 * 1000));
33551
33821
  var Durability = function (Durability) {
33552
33822
  Durability["Temporary"] = "temporary";
33553
33823
  Durability["Persistent"] = "persistent";
33554
33824
  return Durability;
33555
33825
  }({});
33826
+ var DEFAULT_GET_TRANSACTION_TIMEOUT = 30;
33827
+ var BasicSleepStrategy = function BasicSleepStrategy(_iter) {
33828
+ return 1000;
33829
+ };
33830
+ var LinearSleepStrategy = function LinearSleepStrategy(iter) {
33831
+ return 1000 * iter;
33832
+ };
33556
33833
  function findCreatedAccountSequenceInTransactionMeta(meta) {
33557
33834
  var _operations$flatMap$f;
33558
33835
  var operations = [];
@@ -33857,19 +34134,65 @@ var RpcServer = function () {
33857
34134
  return _getLedgerEntries;
33858
34135
  }()
33859
34136
  }, {
33860
- key: "getTransaction",
34137
+ key: "pollTransaction",
33861
34138
  value: (function () {
33862
- var _getTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee8(hash) {
34139
+ var _pollTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee8(hash, opts) {
34140
+ var _opts$attempts, _opts$attempts2;
34141
+ var maxAttempts, foundInfo, attempt, _opts$sleepStrategy;
33863
34142
  return server_regeneratorRuntime().wrap(function _callee8$(_context8) {
33864
34143
  while (1) switch (_context8.prev = _context8.next) {
33865
34144
  case 0:
33866
- return _context8.abrupt("return", this._getTransaction(hash).then(function (raw) {
34145
+ 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;
34146
+ attempt = 1;
34147
+ case 2:
34148
+ if (!(attempt < maxAttempts)) {
34149
+ _context8.next = 13;
34150
+ break;
34151
+ }
34152
+ _context8.next = 5;
34153
+ return this.getTransaction(hash);
34154
+ case 5:
34155
+ foundInfo = _context8.sent;
34156
+ if (!(foundInfo.status !== api/* Api */.j.GetTransactionStatus.NOT_FOUND)) {
34157
+ _context8.next = 8;
34158
+ break;
34159
+ }
34160
+ return _context8.abrupt("return", foundInfo);
34161
+ case 8:
34162
+ _context8.next = 10;
34163
+ 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));
34164
+ case 10:
34165
+ attempt++;
34166
+ _context8.next = 2;
34167
+ break;
34168
+ case 13:
34169
+ return _context8.abrupt("return", foundInfo);
34170
+ case 14:
34171
+ case "end":
34172
+ return _context8.stop();
34173
+ }
34174
+ }, _callee8, this);
34175
+ }));
34176
+ function pollTransaction(_x6, _x7) {
34177
+ return _pollTransaction.apply(this, arguments);
34178
+ }
34179
+ return pollTransaction;
34180
+ }())
34181
+ }, {
34182
+ key: "getTransaction",
34183
+ value: (function () {
34184
+ var _getTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee9(hash) {
34185
+ return server_regeneratorRuntime().wrap(function _callee9$(_context9) {
34186
+ while (1) switch (_context9.prev = _context9.next) {
34187
+ case 0:
34188
+ return _context9.abrupt("return", this._getTransaction(hash).then(function (raw) {
33867
34189
  var foundInfo = {};
33868
34190
  if (raw.status !== api/* Api */.j.GetTransactionStatus.NOT_FOUND) {
33869
34191
  Object.assign(foundInfo, (0,parsers/* parseTransactionInfo */.WC)(raw));
33870
34192
  }
33871
34193
  var result = _objectSpread({
33872
34194
  status: raw.status,
34195
+ txHash: hash,
33873
34196
  latestLedger: raw.latestLedger,
33874
34197
  latestLedgerCloseTime: raw.latestLedgerCloseTime,
33875
34198
  oldestLedger: raw.oldestLedger,
@@ -33879,11 +34202,11 @@ var RpcServer = function () {
33879
34202
  }));
33880
34203
  case 1:
33881
34204
  case "end":
33882
- return _context8.stop();
34205
+ return _context9.stop();
33883
34206
  }
33884
- }, _callee8, this);
34207
+ }, _callee9, this);
33885
34208
  }));
33886
- function getTransaction(_x6) {
34209
+ function getTransaction(_x8) {
33887
34210
  return _getTransaction2.apply(this, arguments);
33888
34211
  }
33889
34212
  return getTransaction;
@@ -33891,20 +34214,20 @@ var RpcServer = function () {
33891
34214
  }, {
33892
34215
  key: "_getTransaction",
33893
34216
  value: function () {
33894
- var _getTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee9(hash) {
33895
- return server_regeneratorRuntime().wrap(function _callee9$(_context9) {
33896
- while (1) switch (_context9.prev = _context9.next) {
34217
+ var _getTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee10(hash) {
34218
+ return server_regeneratorRuntime().wrap(function _callee10$(_context10) {
34219
+ while (1) switch (_context10.prev = _context10.next) {
33897
34220
  case 0:
33898
- return _context9.abrupt("return", postObject(this.serverURL.toString(), 'getTransaction', {
34221
+ return _context10.abrupt("return", postObject(this.serverURL.toString(), 'getTransaction', {
33899
34222
  hash: hash
33900
34223
  }));
33901
34224
  case 1:
33902
34225
  case "end":
33903
- return _context9.stop();
34226
+ return _context10.stop();
33904
34227
  }
33905
- }, _callee9, this);
34228
+ }, _callee10, this);
33906
34229
  }));
33907
- function _getTransaction(_x7) {
34230
+ function _getTransaction(_x9) {
33908
34231
  return _getTransaction3.apply(this, arguments);
33909
34232
  }
33910
34233
  return _getTransaction;
@@ -33912,11 +34235,11 @@ var RpcServer = function () {
33912
34235
  }, {
33913
34236
  key: "getTransactions",
33914
34237
  value: (function () {
33915
- var _getTransactions2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee10(request) {
33916
- return server_regeneratorRuntime().wrap(function _callee10$(_context10) {
33917
- while (1) switch (_context10.prev = _context10.next) {
34238
+ var _getTransactions2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee11(request) {
34239
+ return server_regeneratorRuntime().wrap(function _callee11$(_context11) {
34240
+ while (1) switch (_context11.prev = _context11.next) {
33918
34241
  case 0:
33919
- return _context10.abrupt("return", this._getTransactions(request).then(function (raw) {
34242
+ return _context11.abrupt("return", this._getTransactions(request).then(function (raw) {
33920
34243
  var result = {
33921
34244
  transactions: raw.transactions.map(parsers/* parseRawTransactions */.tR),
33922
34245
  latestLedger: raw.latestLedger,
@@ -33929,11 +34252,11 @@ var RpcServer = function () {
33929
34252
  }));
33930
34253
  case 1:
33931
34254
  case "end":
33932
- return _context10.stop();
34255
+ return _context11.stop();
33933
34256
  }
33934
- }, _callee10, this);
34257
+ }, _callee11, this);
33935
34258
  }));
33936
- function getTransactions(_x8) {
34259
+ function getTransactions(_x10) {
33937
34260
  return _getTransactions2.apply(this, arguments);
33938
34261
  }
33939
34262
  return getTransactions;
@@ -33941,18 +34264,18 @@ var RpcServer = function () {
33941
34264
  }, {
33942
34265
  key: "_getTransactions",
33943
34266
  value: function () {
33944
- var _getTransactions3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee11(request) {
33945
- return server_regeneratorRuntime().wrap(function _callee11$(_context11) {
33946
- while (1) switch (_context11.prev = _context11.next) {
34267
+ var _getTransactions3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee12(request) {
34268
+ return server_regeneratorRuntime().wrap(function _callee12$(_context12) {
34269
+ while (1) switch (_context12.prev = _context12.next) {
33947
34270
  case 0:
33948
- return _context11.abrupt("return", postObject(this.serverURL.toString(), 'getTransactions', request));
34271
+ return _context12.abrupt("return", postObject(this.serverURL.toString(), 'getTransactions', request));
33949
34272
  case 1:
33950
34273
  case "end":
33951
- return _context11.stop();
34274
+ return _context12.stop();
33952
34275
  }
33953
- }, _callee11, this);
34276
+ }, _callee12, this);
33954
34277
  }));
33955
- function _getTransactions(_x9) {
34278
+ function _getTransactions(_x11) {
33956
34279
  return _getTransactions3.apply(this, arguments);
33957
34280
  }
33958
34281
  return _getTransactions;
@@ -33960,18 +34283,18 @@ var RpcServer = function () {
33960
34283
  }, {
33961
34284
  key: "getEvents",
33962
34285
  value: (function () {
33963
- var _getEvents2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee12(request) {
33964
- return server_regeneratorRuntime().wrap(function _callee12$(_context12) {
33965
- while (1) switch (_context12.prev = _context12.next) {
34286
+ var _getEvents2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee13(request) {
34287
+ return server_regeneratorRuntime().wrap(function _callee13$(_context13) {
34288
+ while (1) switch (_context13.prev = _context13.next) {
33966
34289
  case 0:
33967
- return _context12.abrupt("return", this._getEvents(request).then(parsers/* parseRawEvents */.fG));
34290
+ return _context13.abrupt("return", this._getEvents(request).then(parsers/* parseRawEvents */.fG));
33968
34291
  case 1:
33969
34292
  case "end":
33970
- return _context12.stop();
34293
+ return _context13.stop();
33971
34294
  }
33972
- }, _callee12, this);
34295
+ }, _callee13, this);
33973
34296
  }));
33974
- function getEvents(_x10) {
34297
+ function getEvents(_x12) {
33975
34298
  return _getEvents2.apply(this, arguments);
33976
34299
  }
33977
34300
  return getEvents;
@@ -33979,12 +34302,12 @@ var RpcServer = function () {
33979
34302
  }, {
33980
34303
  key: "_getEvents",
33981
34304
  value: function () {
33982
- var _getEvents3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee13(request) {
34305
+ var _getEvents3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee14(request) {
33983
34306
  var _request$filters;
33984
- return server_regeneratorRuntime().wrap(function _callee13$(_context13) {
33985
- while (1) switch (_context13.prev = _context13.next) {
34307
+ return server_regeneratorRuntime().wrap(function _callee14$(_context14) {
34308
+ while (1) switch (_context14.prev = _context14.next) {
33986
34309
  case 0:
33987
- return _context13.abrupt("return", postObject(this.serverURL.toString(), 'getEvents', _objectSpread(_objectSpread({
34310
+ return _context14.abrupt("return", postObject(this.serverURL.toString(), 'getEvents', _objectSpread(_objectSpread({
33988
34311
  filters: (_request$filters = request.filters) !== null && _request$filters !== void 0 ? _request$filters : [],
33989
34312
  pagination: _objectSpread(_objectSpread({}, request.cursor && {
33990
34313
  cursor: request.cursor
@@ -33998,11 +34321,11 @@ var RpcServer = function () {
33998
34321
  })));
33999
34322
  case 1:
34000
34323
  case "end":
34001
- return _context13.stop();
34324
+ return _context14.stop();
34002
34325
  }
34003
- }, _callee13, this);
34326
+ }, _callee14, this);
34004
34327
  }));
34005
- function _getEvents(_x11) {
34328
+ function _getEvents(_x13) {
34006
34329
  return _getEvents3.apply(this, arguments);
34007
34330
  }
34008
34331
  return _getEvents;
@@ -34010,16 +34333,16 @@ var RpcServer = function () {
34010
34333
  }, {
34011
34334
  key: "getNetwork",
34012
34335
  value: (function () {
34013
- var _getNetwork = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee14() {
34014
- return server_regeneratorRuntime().wrap(function _callee14$(_context14) {
34015
- while (1) switch (_context14.prev = _context14.next) {
34336
+ var _getNetwork = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee15() {
34337
+ return server_regeneratorRuntime().wrap(function _callee15$(_context15) {
34338
+ while (1) switch (_context15.prev = _context15.next) {
34016
34339
  case 0:
34017
- return _context14.abrupt("return", postObject(this.serverURL.toString(), 'getNetwork'));
34340
+ return _context15.abrupt("return", postObject(this.serverURL.toString(), 'getNetwork'));
34018
34341
  case 1:
34019
34342
  case "end":
34020
- return _context14.stop();
34343
+ return _context15.stop();
34021
34344
  }
34022
- }, _callee14, this);
34345
+ }, _callee15, this);
34023
34346
  }));
34024
34347
  function getNetwork() {
34025
34348
  return _getNetwork.apply(this, arguments);
@@ -34029,16 +34352,16 @@ var RpcServer = function () {
34029
34352
  }, {
34030
34353
  key: "getLatestLedger",
34031
34354
  value: (function () {
34032
- var _getLatestLedger = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee15() {
34033
- return server_regeneratorRuntime().wrap(function _callee15$(_context15) {
34034
- while (1) switch (_context15.prev = _context15.next) {
34355
+ var _getLatestLedger = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee16() {
34356
+ return server_regeneratorRuntime().wrap(function _callee16$(_context16) {
34357
+ while (1) switch (_context16.prev = _context16.next) {
34035
34358
  case 0:
34036
- return _context15.abrupt("return", postObject(this.serverURL.toString(), 'getLatestLedger'));
34359
+ return _context16.abrupt("return", postObject(this.serverURL.toString(), 'getLatestLedger'));
34037
34360
  case 1:
34038
34361
  case "end":
34039
- return _context15.stop();
34362
+ return _context16.stop();
34040
34363
  }
34041
- }, _callee15, this);
34364
+ }, _callee16, this);
34042
34365
  }));
34043
34366
  function getLatestLedger() {
34044
34367
  return _getLatestLedger.apply(this, arguments);
@@ -34048,18 +34371,18 @@ var RpcServer = function () {
34048
34371
  }, {
34049
34372
  key: "simulateTransaction",
34050
34373
  value: (function () {
34051
- var _simulateTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee16(tx, addlResources) {
34052
- return server_regeneratorRuntime().wrap(function _callee16$(_context16) {
34053
- while (1) switch (_context16.prev = _context16.next) {
34374
+ var _simulateTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee17(tx, addlResources) {
34375
+ return server_regeneratorRuntime().wrap(function _callee17$(_context17) {
34376
+ while (1) switch (_context17.prev = _context17.next) {
34054
34377
  case 0:
34055
- return _context16.abrupt("return", this._simulateTransaction(tx, addlResources).then(parsers/* parseRawSimulation */.jr));
34378
+ return _context17.abrupt("return", this._simulateTransaction(tx, addlResources).then(parsers/* parseRawSimulation */.jr));
34056
34379
  case 1:
34057
34380
  case "end":
34058
- return _context16.stop();
34381
+ return _context17.stop();
34059
34382
  }
34060
- }, _callee16, this);
34383
+ }, _callee17, this);
34061
34384
  }));
34062
- function simulateTransaction(_x12, _x13) {
34385
+ function simulateTransaction(_x14, _x15) {
34063
34386
  return _simulateTransaction2.apply(this, arguments);
34064
34387
  }
34065
34388
  return simulateTransaction;
@@ -34067,11 +34390,11 @@ var RpcServer = function () {
34067
34390
  }, {
34068
34391
  key: "_simulateTransaction",
34069
34392
  value: function () {
34070
- var _simulateTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee17(transaction, addlResources) {
34071
- return server_regeneratorRuntime().wrap(function _callee17$(_context17) {
34072
- while (1) switch (_context17.prev = _context17.next) {
34393
+ var _simulateTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee18(transaction, addlResources) {
34394
+ return server_regeneratorRuntime().wrap(function _callee18$(_context18) {
34395
+ while (1) switch (_context18.prev = _context18.next) {
34073
34396
  case 0:
34074
- return _context17.abrupt("return", postObject(this.serverURL.toString(), 'simulateTransaction', _objectSpread({
34397
+ return _context18.abrupt("return", postObject(this.serverURL.toString(), 'simulateTransaction', _objectSpread({
34075
34398
  transaction: transaction.toXDR()
34076
34399
  }, addlResources !== undefined && {
34077
34400
  resourceConfig: {
@@ -34080,11 +34403,11 @@ var RpcServer = function () {
34080
34403
  })));
34081
34404
  case 1:
34082
34405
  case "end":
34083
- return _context17.stop();
34406
+ return _context18.stop();
34084
34407
  }
34085
- }, _callee17, this);
34408
+ }, _callee18, this);
34086
34409
  }));
34087
- function _simulateTransaction(_x14, _x15) {
34410
+ function _simulateTransaction(_x16, _x17) {
34088
34411
  return _simulateTransaction3.apply(this, arguments);
34089
34412
  }
34090
34413
  return _simulateTransaction;
@@ -34092,29 +34415,29 @@ var RpcServer = function () {
34092
34415
  }, {
34093
34416
  key: "prepareTransaction",
34094
34417
  value: (function () {
34095
- var _prepareTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee18(tx) {
34418
+ var _prepareTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee19(tx) {
34096
34419
  var simResponse;
34097
- return server_regeneratorRuntime().wrap(function _callee18$(_context18) {
34098
- while (1) switch (_context18.prev = _context18.next) {
34420
+ return server_regeneratorRuntime().wrap(function _callee19$(_context19) {
34421
+ while (1) switch (_context19.prev = _context19.next) {
34099
34422
  case 0:
34100
- _context18.next = 2;
34423
+ _context19.next = 2;
34101
34424
  return this.simulateTransaction(tx);
34102
34425
  case 2:
34103
- simResponse = _context18.sent;
34426
+ simResponse = _context19.sent;
34104
34427
  if (!api/* Api */.j.isSimulationError(simResponse)) {
34105
- _context18.next = 5;
34428
+ _context19.next = 5;
34106
34429
  break;
34107
34430
  }
34108
34431
  throw new Error(simResponse.error);
34109
34432
  case 5:
34110
- return _context18.abrupt("return", (0,transaction/* assembleTransaction */.X)(tx, simResponse).build());
34433
+ return _context19.abrupt("return", (0,transaction/* assembleTransaction */.X)(tx, simResponse).build());
34111
34434
  case 6:
34112
34435
  case "end":
34113
- return _context18.stop();
34436
+ return _context19.stop();
34114
34437
  }
34115
- }, _callee18, this);
34438
+ }, _callee19, this);
34116
34439
  }));
34117
- function prepareTransaction(_x16) {
34440
+ function prepareTransaction(_x18) {
34118
34441
  return _prepareTransaction.apply(this, arguments);
34119
34442
  }
34120
34443
  return prepareTransaction;
@@ -34122,18 +34445,18 @@ var RpcServer = function () {
34122
34445
  }, {
34123
34446
  key: "sendTransaction",
34124
34447
  value: (function () {
34125
- var _sendTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee19(transaction) {
34126
- return server_regeneratorRuntime().wrap(function _callee19$(_context19) {
34127
- while (1) switch (_context19.prev = _context19.next) {
34448
+ var _sendTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee20(transaction) {
34449
+ return server_regeneratorRuntime().wrap(function _callee20$(_context20) {
34450
+ while (1) switch (_context20.prev = _context20.next) {
34128
34451
  case 0:
34129
- return _context19.abrupt("return", this._sendTransaction(transaction).then(parsers/* parseRawSendTransaction */.Af));
34452
+ return _context20.abrupt("return", this._sendTransaction(transaction).then(parsers/* parseRawSendTransaction */.Af));
34130
34453
  case 1:
34131
34454
  case "end":
34132
- return _context19.stop();
34455
+ return _context20.stop();
34133
34456
  }
34134
- }, _callee19, this);
34457
+ }, _callee20, this);
34135
34458
  }));
34136
- function sendTransaction(_x17) {
34459
+ function sendTransaction(_x19) {
34137
34460
  return _sendTransaction2.apply(this, arguments);
34138
34461
  }
34139
34462
  return sendTransaction;
@@ -34141,20 +34464,20 @@ var RpcServer = function () {
34141
34464
  }, {
34142
34465
  key: "_sendTransaction",
34143
34466
  value: function () {
34144
- var _sendTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee20(transaction) {
34145
- return server_regeneratorRuntime().wrap(function _callee20$(_context20) {
34146
- while (1) switch (_context20.prev = _context20.next) {
34467
+ var _sendTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee21(transaction) {
34468
+ return server_regeneratorRuntime().wrap(function _callee21$(_context21) {
34469
+ while (1) switch (_context21.prev = _context21.next) {
34147
34470
  case 0:
34148
- return _context20.abrupt("return", postObject(this.serverURL.toString(), 'sendTransaction', {
34471
+ return _context21.abrupt("return", postObject(this.serverURL.toString(), 'sendTransaction', {
34149
34472
  transaction: transaction.toXDR()
34150
34473
  }));
34151
34474
  case 1:
34152
34475
  case "end":
34153
- return _context20.stop();
34476
+ return _context21.stop();
34154
34477
  }
34155
- }, _callee20, this);
34478
+ }, _callee21, this);
34156
34479
  }));
34157
- function _sendTransaction(_x18) {
34480
+ function _sendTransaction(_x20) {
34158
34481
  return _sendTransaction3.apply(this, arguments);
34159
34482
  }
34160
34483
  return _sendTransaction;
@@ -34162,58 +34485,58 @@ var RpcServer = function () {
34162
34485
  }, {
34163
34486
  key: "requestAirdrop",
34164
34487
  value: (function () {
34165
- var _requestAirdrop = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee21(address, friendbotUrl) {
34488
+ var _requestAirdrop = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee22(address, friendbotUrl) {
34166
34489
  var account, response, meta, sequence, _error$response, _error$response$detai;
34167
- return server_regeneratorRuntime().wrap(function _callee21$(_context21) {
34168
- while (1) switch (_context21.prev = _context21.next) {
34490
+ return server_regeneratorRuntime().wrap(function _callee22$(_context22) {
34491
+ while (1) switch (_context22.prev = _context22.next) {
34169
34492
  case 0:
34170
34493
  account = typeof address === 'string' ? address : address.accountId();
34171
- _context21.t0 = friendbotUrl;
34172
- if (_context21.t0) {
34173
- _context21.next = 6;
34494
+ _context22.t0 = friendbotUrl;
34495
+ if (_context22.t0) {
34496
+ _context22.next = 6;
34174
34497
  break;
34175
34498
  }
34176
- _context21.next = 5;
34499
+ _context22.next = 5;
34177
34500
  return this.getNetwork();
34178
34501
  case 5:
34179
- _context21.t0 = _context21.sent.friendbotUrl;
34502
+ _context22.t0 = _context22.sent.friendbotUrl;
34180
34503
  case 6:
34181
- friendbotUrl = _context21.t0;
34504
+ friendbotUrl = _context22.t0;
34182
34505
  if (friendbotUrl) {
34183
- _context21.next = 9;
34506
+ _context22.next = 9;
34184
34507
  break;
34185
34508
  }
34186
34509
  throw new Error('No friendbot URL configured for current network');
34187
34510
  case 9:
34188
- _context21.prev = 9;
34189
- _context21.next = 12;
34511
+ _context22.prev = 9;
34512
+ _context22.next = 12;
34190
34513
  return axios.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account)));
34191
34514
  case 12:
34192
- response = _context21.sent;
34515
+ response = _context22.sent;
34193
34516
  meta = lib.xdr.TransactionMeta.fromXDR(response.data.result_meta_xdr, 'base64');
34194
34517
  sequence = findCreatedAccountSequenceInTransactionMeta(meta);
34195
- return _context21.abrupt("return", new lib.Account(account, sequence));
34518
+ return _context22.abrupt("return", new lib.Account(account, sequence));
34196
34519
  case 18:
34197
- _context21.prev = 18;
34198
- _context21.t1 = _context21["catch"](9);
34199
- if (!(((_error$response = _context21.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) {
34200
- _context21.next = 23;
34520
+ _context22.prev = 18;
34521
+ _context22.t1 = _context22["catch"](9);
34522
+ if (!(((_error$response = _context22.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) {
34523
+ _context22.next = 23;
34201
34524
  break;
34202
34525
  }
34203
- if (!((_error$response$detai = _context21.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes('createAccountAlreadyExist'))) {
34204
- _context21.next = 23;
34526
+ if (!((_error$response$detai = _context22.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes('createAccountAlreadyExist'))) {
34527
+ _context22.next = 23;
34205
34528
  break;
34206
34529
  }
34207
- return _context21.abrupt("return", this.getAccount(account));
34530
+ return _context22.abrupt("return", this.getAccount(account));
34208
34531
  case 23:
34209
- throw _context21.t1;
34532
+ throw _context22.t1;
34210
34533
  case 24:
34211
34534
  case "end":
34212
- return _context21.stop();
34535
+ return _context22.stop();
34213
34536
  }
34214
- }, _callee21, this, [[9, 18]]);
34537
+ }, _callee22, this, [[9, 18]]);
34215
34538
  }));
34216
- function requestAirdrop(_x19, _x20) {
34539
+ function requestAirdrop(_x21, _x22) {
34217
34540
  return _requestAirdrop.apply(this, arguments);
34218
34541
  }
34219
34542
  return requestAirdrop;
@@ -34221,16 +34544,16 @@ var RpcServer = function () {
34221
34544
  }, {
34222
34545
  key: "getFeeStats",
34223
34546
  value: (function () {
34224
- var _getFeeStats = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee22() {
34225
- return server_regeneratorRuntime().wrap(function _callee22$(_context22) {
34226
- while (1) switch (_context22.prev = _context22.next) {
34547
+ var _getFeeStats = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee23() {
34548
+ return server_regeneratorRuntime().wrap(function _callee23$(_context23) {
34549
+ while (1) switch (_context23.prev = _context23.next) {
34227
34550
  case 0:
34228
- return _context22.abrupt("return", postObject(this.serverURL.toString(), 'getFeeStats'));
34551
+ return _context23.abrupt("return", postObject(this.serverURL.toString(), 'getFeeStats'));
34229
34552
  case 1:
34230
34553
  case "end":
34231
- return _context22.stop();
34554
+ return _context23.stop();
34232
34555
  }
34233
- }, _callee22, this);
34556
+ }, _callee23, this);
34234
34557
  }));
34235
34558
  function getFeeStats() {
34236
34559
  return _getFeeStats.apply(this, arguments);
@@ -34240,16 +34563,16 @@ var RpcServer = function () {
34240
34563
  }, {
34241
34564
  key: "getVersionInfo",
34242
34565
  value: (function () {
34243
- var _getVersionInfo = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee23() {
34244
- return server_regeneratorRuntime().wrap(function _callee23$(_context23) {
34245
- while (1) switch (_context23.prev = _context23.next) {
34566
+ var _getVersionInfo = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee24() {
34567
+ return server_regeneratorRuntime().wrap(function _callee24$(_context24) {
34568
+ while (1) switch (_context24.prev = _context24.next) {
34246
34569
  case 0:
34247
- return _context23.abrupt("return", postObject(this.serverURL.toString(), 'getVersionInfo'));
34570
+ return _context24.abrupt("return", postObject(this.serverURL.toString(), 'getVersionInfo'));
34248
34571
  case 1:
34249
34572
  case "end":
34250
- return _context23.stop();
34573
+ return _context24.stop();
34251
34574
  }
34252
- }, _callee23, this);
34575
+ }, _callee24, this);
34253
34576
  }));
34254
34577
  function getVersionInfo() {
34255
34578
  return _getVersionInfo.apply(this, arguments);
@@ -34259,33 +34582,33 @@ var RpcServer = function () {
34259
34582
  }, {
34260
34583
  key: "getSACBalance",
34261
34584
  value: (function () {
34262
- var _getSACBalance = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee24(contractId, sac, networkPassphrase) {
34585
+ var _getSACBalance = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee25(contractId, sac, networkPassphrase) {
34263
34586
  var passphrase, sacId, key, ledgerKey, response, _response$entries$2, lastModifiedLedgerSeq, liveUntilLedgerSeq, val, entry;
34264
- return server_regeneratorRuntime().wrap(function _callee24$(_context24) {
34265
- while (1) switch (_context24.prev = _context24.next) {
34587
+ return server_regeneratorRuntime().wrap(function _callee25$(_context25) {
34588
+ while (1) switch (_context25.prev = _context25.next) {
34266
34589
  case 0:
34267
34590
  if (lib.StrKey.isValidContract(contractId)) {
34268
- _context24.next = 2;
34591
+ _context25.next = 2;
34269
34592
  break;
34270
34593
  }
34271
34594
  throw new TypeError("expected contract ID, got ".concat(contractId));
34272
34595
  case 2:
34273
34596
  if (!(networkPassphrase !== null && networkPassphrase !== void 0)) {
34274
- _context24.next = 6;
34597
+ _context25.next = 6;
34275
34598
  break;
34276
34599
  }
34277
- _context24.t0 = networkPassphrase;
34278
- _context24.next = 9;
34600
+ _context25.t0 = networkPassphrase;
34601
+ _context25.next = 9;
34279
34602
  break;
34280
34603
  case 6:
34281
- _context24.next = 8;
34604
+ _context25.next = 8;
34282
34605
  return this.getNetwork().then(function (n) {
34283
34606
  return n.passphrase;
34284
34607
  });
34285
34608
  case 8:
34286
- _context24.t0 = _context24.sent;
34609
+ _context25.t0 = _context25.sent;
34287
34610
  case 9:
34288
- passphrase = _context24.t0;
34611
+ passphrase = _context25.t0;
34289
34612
  sacId = sac.contractId(passphrase);
34290
34613
  key = lib.xdr.ScVal.scvVec([(0,lib.nativeToScVal)("Balance", {
34291
34614
  type: "symbol"
@@ -34297,29 +34620,29 @@ var RpcServer = function () {
34297
34620
  durability: lib.xdr.ContractDataDurability.persistent(),
34298
34621
  key: key
34299
34622
  }));
34300
- _context24.next = 15;
34623
+ _context25.next = 15;
34301
34624
  return this.getLedgerEntries(ledgerKey);
34302
34625
  case 15:
34303
- response = _context24.sent;
34626
+ response = _context25.sent;
34304
34627
  if (!(response.entries.length === 0)) {
34305
- _context24.next = 18;
34628
+ _context25.next = 18;
34306
34629
  break;
34307
34630
  }
34308
- return _context24.abrupt("return", {
34631
+ return _context25.abrupt("return", {
34309
34632
  latestLedger: response.latestLedger
34310
34633
  });
34311
34634
  case 18:
34312
34635
  _response$entries$2 = response.entries[0], lastModifiedLedgerSeq = _response$entries$2.lastModifiedLedgerSeq, liveUntilLedgerSeq = _response$entries$2.liveUntilLedgerSeq, val = _response$entries$2.val;
34313
34636
  if (!(val.switch().value !== lib.xdr.LedgerEntryType.contractData().value)) {
34314
- _context24.next = 21;
34637
+ _context25.next = 21;
34315
34638
  break;
34316
34639
  }
34317
- return _context24.abrupt("return", {
34640
+ return _context25.abrupt("return", {
34318
34641
  latestLedger: response.latestLedger
34319
34642
  });
34320
34643
  case 21:
34321
34644
  entry = (0,lib.scValToNative)(val.contractData().val());
34322
- return _context24.abrupt("return", {
34645
+ return _context25.abrupt("return", {
34323
34646
  latestLedger: response.latestLedger,
34324
34647
  balanceEntry: {
34325
34648
  liveUntilLedgerSeq: liveUntilLedgerSeq,
@@ -34331,11 +34654,11 @@ var RpcServer = function () {
34331
34654
  });
34332
34655
  case 23:
34333
34656
  case "end":
34334
- return _context24.stop();
34657
+ return _context25.stop();
34335
34658
  }
34336
- }, _callee24, this);
34659
+ }, _callee25, this);
34337
34660
  }));
34338
- function getSACBalance(_x21, _x22, _x23) {
34661
+ function getSACBalance(_x23, _x24, _x25) {
34339
34662
  return _getSACBalance.apply(this, arguments);
34340
34663
  }
34341
34664
  return getSACBalance;
@@ -34416,7 +34739,8 @@ function parseTransactionInfo(raw) {
34416
34739
  }
34417
34740
  function parseRawTransactions(r) {
34418
34741
  return _objectSpread({
34419
- status: r.status
34742
+ status: r.status,
34743
+ txHash: r.txHash
34420
34744
  }, parseTransactionInfo(r));
34421
34745
  }
34422
34746
  function parseRawEvents(raw) {
@@ -34459,8 +34783,7 @@ function parseSuccessful(sim, partial) {
34459
34783
  var _sim$results$length, _sim$results, _sim$stateChanges$len, _sim$stateChanges, _sim$stateChanges2;
34460
34784
  var success = _objectSpread(_objectSpread(_objectSpread({}, partial), {}, {
34461
34785
  transactionData: new _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_0__.SorobanDataBuilder(sim.transactionData),
34462
- minResourceFee: sim.minResourceFee,
34463
- cost: sim.cost
34786
+ minResourceFee: sim.minResourceFee
34464
34787
  }, ((_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) && {
34465
34788
  result: sim.results.map(function (row) {
34466
34789
  var _row$auth;
@@ -34612,6 +34935,7 @@ var Resolver = function () {
34612
34935
  key: "resolve",
34613
34936
  value: (function () {
34614
34937
  var _resolve = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(domain) {
34938
+ var _opts$allowedRedirect;
34615
34939
  var opts,
34616
34940
  allowHttp,
34617
34941
  timeout,
@@ -34625,6 +34949,7 @@ var Resolver = function () {
34625
34949
  timeout = typeof opts.timeout === "undefined" ? _config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.getTimeout() : opts.timeout;
34626
34950
  protocol = allowHttp ? "http" : "https";
34627
34951
  return _context.abrupt("return", _http_client__WEBPACK_IMPORTED_MODULE_1__/* .httpClient */ .ok.get("".concat(protocol, "://").concat(domain, "/.well-known/stellar.toml"), {
34952
+ maxRedirects: (_opts$allowedRedirect = opts.allowedRedirects) !== null && _opts$allowedRedirect !== void 0 ? _opts$allowedRedirect : 0,
34628
34953
  maxContentLength: STELLAR_TOML_MAX_SIZE,
34629
34954
  cancelToken: timeout ? new CancelToken(function (cancel) {
34630
34955
  return setTimeout(function () {
@@ -34693,6 +35018,13 @@ var Utils = function () {
34693
35018
  maxTime = _transaction$timeBoun.maxTime;
34694
35019
  return now >= Number.parseInt(minTime, 10) - gracePeriod && now <= Number.parseInt(maxTime, 10) + gracePeriod;
34695
35020
  }
35021
+ }, {
35022
+ key: "sleep",
35023
+ value: function sleep(ms) {
35024
+ return new Promise(function (resolve) {
35025
+ return setTimeout(resolve, ms);
35026
+ });
35027
+ }
34696
35028
  }]);
34697
35029
  }();
34698
35030