@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.
- package/CHANGELOG.md +63 -0
- package/dist/stellar-sdk-minimal.js +585 -253
- package/dist/stellar-sdk-minimal.min.js +1 -1
- package/dist/stellar-sdk-no-axios.js +602 -256
- package/dist/stellar-sdk-no-axios.min.js +1 -1
- package/dist/stellar-sdk-no-eventsource.js +585 -253
- package/dist/stellar-sdk-no-eventsource.min.js +1 -1
- package/dist/stellar-sdk.js +602 -256
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/contract/assembled_transaction.d.ts +75 -3
- package/lib/contract/assembled_transaction.js +124 -35
- package/lib/contract/basic_node_signer.d.ts +3 -2
- package/lib/contract/basic_node_signer.js +16 -8
- package/lib/contract/client.d.ts +13 -1
- package/lib/contract/client.js +159 -48
- package/lib/contract/sent_transaction.d.ts +2 -3
- package/lib/contract/sent_transaction.js +4 -4
- package/lib/contract/types.d.ts +72 -8
- package/lib/contract/types.js +1 -0
- package/lib/horizon/call_builder.d.ts +1 -1
- package/lib/horizon/horizon_axios_client.js +1 -1
- package/lib/horizon/server_api.d.ts +1 -15
- package/lib/horizon/server_api.js +5 -0
- package/lib/horizon/types/assets.d.ts +0 -2
- package/lib/horizon/types/effects.d.ts +51 -51
- package/lib/horizon/types/trade.d.ts +3 -2
- package/lib/http-client/types.d.ts +1 -0
- package/lib/index.d.ts +0 -4
- package/lib/index.js +1 -4
- package/lib/minimal/contract/assembled_transaction.d.ts +75 -3
- package/lib/minimal/contract/assembled_transaction.js +124 -35
- package/lib/minimal/contract/basic_node_signer.d.ts +3 -2
- package/lib/minimal/contract/basic_node_signer.js +16 -8
- package/lib/minimal/contract/client.d.ts +13 -1
- package/lib/minimal/contract/client.js +159 -48
- package/lib/minimal/contract/sent_transaction.d.ts +2 -3
- package/lib/minimal/contract/sent_transaction.js +4 -4
- package/lib/minimal/contract/types.d.ts +72 -8
- package/lib/minimal/contract/types.js +1 -0
- package/lib/minimal/horizon/call_builder.d.ts +1 -1
- package/lib/minimal/horizon/horizon_axios_client.js +1 -1
- package/lib/minimal/horizon/server_api.d.ts +1 -15
- package/lib/minimal/horizon/server_api.js +5 -0
- package/lib/minimal/horizon/types/assets.d.ts +0 -2
- package/lib/minimal/horizon/types/effects.d.ts +51 -51
- package/lib/minimal/horizon/types/trade.d.ts +3 -2
- package/lib/minimal/http-client/types.d.ts +1 -0
- package/lib/minimal/index.d.ts +0 -4
- package/lib/minimal/index.js +1 -4
- package/lib/minimal/rpc/api.d.ts +12 -9
- package/lib/minimal/rpc/axios.js +1 -1
- package/lib/minimal/rpc/index.d.ts +1 -1
- package/lib/minimal/rpc/index.js +14 -0
- package/lib/minimal/rpc/parsers.d.ts +1 -1
- package/lib/minimal/rpc/parsers.js +3 -3
- package/lib/minimal/rpc/server.d.ts +41 -3
- package/lib/minimal/rpc/server.js +203 -149
- package/lib/minimal/stellartoml/index.d.ts +1 -0
- package/lib/minimal/stellartoml/index.js +2 -0
- package/lib/minimal/utils.d.ts +1 -0
- package/lib/minimal/utils.js +7 -0
- package/lib/no-axios/contract/assembled_transaction.d.ts +75 -3
- package/lib/no-axios/contract/assembled_transaction.js +124 -35
- package/lib/no-axios/contract/basic_node_signer.d.ts +3 -2
- package/lib/no-axios/contract/basic_node_signer.js +16 -8
- package/lib/no-axios/contract/client.d.ts +13 -1
- package/lib/no-axios/contract/client.js +159 -48
- package/lib/no-axios/contract/sent_transaction.d.ts +2 -3
- package/lib/no-axios/contract/sent_transaction.js +4 -4
- package/lib/no-axios/contract/types.d.ts +72 -8
- package/lib/no-axios/contract/types.js +1 -0
- package/lib/no-axios/horizon/call_builder.d.ts +1 -1
- package/lib/no-axios/horizon/horizon_axios_client.js +1 -1
- package/lib/no-axios/horizon/server_api.d.ts +1 -15
- package/lib/no-axios/horizon/server_api.js +5 -0
- package/lib/no-axios/horizon/types/assets.d.ts +0 -2
- package/lib/no-axios/horizon/types/effects.d.ts +51 -51
- package/lib/no-axios/horizon/types/trade.d.ts +3 -2
- package/lib/no-axios/http-client/types.d.ts +1 -0
- package/lib/no-axios/index.d.ts +0 -4
- package/lib/no-axios/index.js +1 -4
- package/lib/no-axios/rpc/api.d.ts +12 -9
- package/lib/no-axios/rpc/axios.js +1 -1
- package/lib/no-axios/rpc/index.d.ts +1 -1
- package/lib/no-axios/rpc/index.js +14 -0
- package/lib/no-axios/rpc/parsers.d.ts +1 -1
- package/lib/no-axios/rpc/parsers.js +3 -3
- package/lib/no-axios/rpc/server.d.ts +41 -3
- package/lib/no-axios/rpc/server.js +203 -149
- package/lib/no-axios/stellartoml/index.d.ts +1 -0
- package/lib/no-axios/stellartoml/index.js +2 -0
- package/lib/no-axios/utils.d.ts +1 -0
- package/lib/no-axios/utils.js +7 -0
- package/lib/no-eventsource/contract/assembled_transaction.d.ts +75 -3
- package/lib/no-eventsource/contract/assembled_transaction.js +124 -35
- package/lib/no-eventsource/contract/basic_node_signer.d.ts +3 -2
- package/lib/no-eventsource/contract/basic_node_signer.js +16 -8
- package/lib/no-eventsource/contract/client.d.ts +13 -1
- package/lib/no-eventsource/contract/client.js +159 -48
- package/lib/no-eventsource/contract/sent_transaction.d.ts +2 -3
- package/lib/no-eventsource/contract/sent_transaction.js +4 -4
- package/lib/no-eventsource/contract/types.d.ts +72 -8
- package/lib/no-eventsource/contract/types.js +1 -0
- package/lib/no-eventsource/horizon/call_builder.d.ts +1 -1
- package/lib/no-eventsource/horizon/horizon_axios_client.js +1 -1
- package/lib/no-eventsource/horizon/server_api.d.ts +1 -15
- package/lib/no-eventsource/horizon/server_api.js +5 -0
- package/lib/no-eventsource/horizon/types/assets.d.ts +0 -2
- package/lib/no-eventsource/horizon/types/effects.d.ts +51 -51
- package/lib/no-eventsource/horizon/types/trade.d.ts +3 -2
- package/lib/no-eventsource/http-client/types.d.ts +1 -0
- package/lib/no-eventsource/index.d.ts +0 -4
- package/lib/no-eventsource/index.js +1 -4
- package/lib/no-eventsource/rpc/api.d.ts +12 -9
- package/lib/no-eventsource/rpc/axios.js +1 -1
- package/lib/no-eventsource/rpc/index.d.ts +1 -1
- package/lib/no-eventsource/rpc/index.js +14 -0
- package/lib/no-eventsource/rpc/parsers.d.ts +1 -1
- package/lib/no-eventsource/rpc/parsers.js +3 -3
- package/lib/no-eventsource/rpc/server.d.ts +41 -3
- package/lib/no-eventsource/rpc/server.js +203 -149
- package/lib/no-eventsource/stellartoml/index.d.ts +1 -0
- package/lib/no-eventsource/stellartoml/index.js +2 -0
- package/lib/no-eventsource/utils.d.ts +1 -0
- package/lib/no-eventsource/utils.js +7 -0
- package/lib/rpc/api.d.ts +12 -9
- package/lib/rpc/axios.js +1 -1
- package/lib/rpc/index.d.ts +1 -1
- package/lib/rpc/index.js +14 -0
- package/lib/rpc/parsers.d.ts +1 -1
- package/lib/rpc/parsers.js +3 -3
- package/lib/rpc/server.d.ts +41 -3
- package/lib/rpc/server.js +203 -149
- package/lib/stellartoml/index.d.ts +1 -0
- package/lib/stellartoml/index.js +2 -0
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +7 -0
- package/package.json +16 -16
package/dist/stellar-sdk.js
CHANGED
|
@@ -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(
|
|
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(
|
|
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(
|
|
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
|
|
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
|
-
|
|
22055
|
-
return signTransaction(_this.built.toXDR(), {
|
|
22058
|
+
signOpts = {
|
|
22056
22059
|
networkPassphrase: _this.options.networkPassphrase
|
|
22057
|
-
}
|
|
22058
|
-
|
|
22059
|
-
|
|
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
|
|
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 =
|
|
22091
|
+
_context3.next = 10;
|
|
22080
22092
|
break;
|
|
22081
22093
|
}
|
|
22082
|
-
|
|
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
|
|
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
|
|
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.
|
|
22212
|
-
_context5.next = 3;
|
|
22233
|
+
_context5.next = 2;
|
|
22213
22234
|
return sign(preimage.toXDR("base64"), {
|
|
22214
|
-
|
|
22235
|
+
address: address
|
|
22215
22236
|
});
|
|
22216
|
-
case
|
|
22217
|
-
|
|
22218
|
-
|
|
22219
|
-
|
|
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
|
|
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(
|
|
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
|
|
22500
|
-
var _options$fee, _options$
|
|
22501
|
-
var tx,
|
|
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
|
-
|
|
22507
|
-
_context10.next = 4;
|
|
22557
|
+
_context10.next = 3;
|
|
22508
22558
|
return getAccount(options, tx.server);
|
|
22509
|
-
case
|
|
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
|
-
}).
|
|
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 =
|
|
22566
|
+
_context10.next = 8;
|
|
22517
22567
|
break;
|
|
22518
22568
|
}
|
|
22519
|
-
_context10.next =
|
|
22569
|
+
_context10.next = 8;
|
|
22520
22570
|
return tx.simulate();
|
|
22521
|
-
case
|
|
22571
|
+
case 8:
|
|
22522
22572
|
return _context10.abrupt("return", tx);
|
|
22523
|
-
case
|
|
22573
|
+
case 9:
|
|
22524
22574
|
case "end":
|
|
22525
22575
|
return _context10.stop();
|
|
22526
22576
|
}
|
|
22527
22577
|
}, _callee9);
|
|
22528
22578
|
}));
|
|
22529
|
-
function
|
|
22530
|
-
return
|
|
22579
|
+
function buildWithOp(_x4, _x5) {
|
|
22580
|
+
return _buildWithOp.apply(this, arguments);
|
|
22531
22581
|
}
|
|
22532
|
-
return
|
|
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(
|
|
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(
|
|
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(
|
|
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",
|
|
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(
|
|
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
|
-
|
|
22668
|
-
|
|
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(
|
|
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
|
|
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
|
-
|
|
23771
|
-
return client_regeneratorRuntime().wrap(function
|
|
23772
|
-
while (1) switch (
|
|
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 =
|
|
23993
|
+
format = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : "hex";
|
|
23775
23994
|
if (!(!options || !options.rpcUrl)) {
|
|
23776
|
-
|
|
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
|
-
|
|
24005
|
+
_context2.next = 8;
|
|
23787
24006
|
return server.getContractWasmByHash(wasmHash, format);
|
|
23788
24007
|
case 8:
|
|
23789
|
-
wasm =
|
|
23790
|
-
return
|
|
24008
|
+
wasm = _context2.sent;
|
|
24009
|
+
return _context2.abrupt("return", Client.fromWasm(wasm, options));
|
|
23791
24010
|
case 10:
|
|
23792
24011
|
case "end":
|
|
23793
|
-
return
|
|
24012
|
+
return _context2.stop();
|
|
23794
24013
|
}
|
|
23795
|
-
},
|
|
24014
|
+
}, _callee2);
|
|
23796
24015
|
}));
|
|
23797
|
-
function fromWasmHash(
|
|
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
|
|
23806
|
-
var
|
|
23807
|
-
return client_regeneratorRuntime().wrap(function
|
|
23808
|
-
while (1) switch (
|
|
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
|
-
|
|
23811
|
-
return
|
|
24029
|
+
_context3.next = 2;
|
|
24030
|
+
return specFromWasm(wasm);
|
|
23812
24031
|
case 2:
|
|
23813
|
-
|
|
23814
|
-
|
|
23815
|
-
|
|
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
|
|
24036
|
+
return _context3.stop();
|
|
23828
24037
|
}
|
|
23829
|
-
},
|
|
24038
|
+
}, _callee3);
|
|
23830
24039
|
}));
|
|
23831
|
-
function fromWasm(
|
|
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
|
|
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
|
|
23842
|
-
while (1) switch (
|
|
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
|
-
|
|
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
|
-
|
|
24064
|
+
_context4.next = 7;
|
|
23856
24065
|
return server.getContractWasmByContractId(contractId);
|
|
23857
24066
|
case 7:
|
|
23858
|
-
wasm =
|
|
23859
|
-
return
|
|
24067
|
+
wasm = _context4.sent;
|
|
24068
|
+
return _context4.abrupt("return", Client.fromWasm(wasm, options));
|
|
23860
24069
|
case 9:
|
|
23861
24070
|
case "end":
|
|
23862
|
-
return
|
|
24071
|
+
return _context4.stop();
|
|
23863
24072
|
}
|
|
23864
|
-
},
|
|
24073
|
+
}, _callee4);
|
|
23865
24074
|
}));
|
|
23866
|
-
function from(
|
|
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
|
-
/***/
|
|
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-
|
|
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: {
|
|
@@ -33351,7 +33619,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33351
33619
|
/* harmony export */ Horizon: () => (/* reexport module object */ _horizon__WEBPACK_IMPORTED_MODULE_7__),
|
|
33352
33620
|
/* harmony export */ NetworkError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_0__.Dr),
|
|
33353
33621
|
/* harmony export */ NotFoundError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_0__.m_),
|
|
33354
|
-
/* harmony export */ SorobanRpc: () => (/* reexport module object */ _rpc__WEBPACK_IMPORTED_MODULE_8__),
|
|
33355
33622
|
/* harmony export */ StellarToml: () => (/* reexport module object */ _stellartoml__WEBPACK_IMPORTED_MODULE_3__),
|
|
33356
33623
|
/* harmony export */ Utils: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_2__.A),
|
|
33357
33624
|
/* harmony export */ WebAuth: () => (/* reexport module object */ _webauth__WEBPACK_IMPORTED_MODULE_5__),
|
|
@@ -33366,13 +33633,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33366
33633
|
/* harmony import */ var _federation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7600);
|
|
33367
33634
|
/* harmony import */ var _webauth__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5479);
|
|
33368
33635
|
/* harmony import */ var _friendbot__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8242);
|
|
33369
|
-
/* harmony import */ var _horizon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
|
|
33636
|
+
/* harmony import */ var _horizon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8733);
|
|
33370
33637
|
/* harmony import */ var _rpc__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3496);
|
|
33371
33638
|
/* harmony import */ var _contract__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(6299);
|
|
33372
33639
|
/* harmony import */ var _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(356);
|
|
33373
33640
|
/* harmony import */ var _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__);
|
|
33374
33641
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
33375
|
-
/* 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","
|
|
33642
|
+
/* 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__]
|
|
33376
33643
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
33377
33644
|
/* module decorator */ module = __webpack_require__.hmd(module);
|
|
33378
33645
|
|
|
@@ -33393,8 +33660,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33393
33660
|
|
|
33394
33661
|
|
|
33395
33662
|
|
|
33396
|
-
|
|
33397
|
-
|
|
33398
33663
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (module.exports);
|
|
33399
33664
|
if (typeof __webpack_require__.g.__USE_AXIOS__ === 'undefined') {
|
|
33400
33665
|
__webpack_require__.g.__USE_AXIOS__ = true;
|
|
@@ -33452,7 +33717,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33452
33717
|
__webpack_require__.d(__webpack_exports__, {
|
|
33453
33718
|
Api: () => (/* reexport */ api/* Api */.j),
|
|
33454
33719
|
AxiosClient: () => (/* reexport */ axios),
|
|
33720
|
+
BasicSleepStrategy: () => (/* reexport */ BasicSleepStrategy),
|
|
33455
33721
|
Durability: () => (/* reexport */ Durability),
|
|
33722
|
+
LinearSleepStrategy: () => (/* reexport */ LinearSleepStrategy),
|
|
33456
33723
|
Server: () => (/* reexport */ RpcServer),
|
|
33457
33724
|
assembleTransaction: () => (/* reexport */ transaction/* assembleTransaction */.X),
|
|
33458
33725
|
"default": () => (/* binding */ rpc),
|
|
@@ -33471,7 +33738,7 @@ var lib = __webpack_require__(356);
|
|
|
33471
33738
|
var http_client = __webpack_require__(9983);
|
|
33472
33739
|
;// ./src/rpc/axios.ts
|
|
33473
33740
|
|
|
33474
|
-
var version = "13.0.0-
|
|
33741
|
+
var version = "13.0.0-rc.2";
|
|
33475
33742
|
var AxiosClient = (0,http_client/* create */.vt)({
|
|
33476
33743
|
headers: {
|
|
33477
33744
|
'X-Client-Name': 'js-soroban-client',
|
|
@@ -33529,6 +33796,8 @@ function _postObject() {
|
|
|
33529
33796
|
var transaction = __webpack_require__(8680);
|
|
33530
33797
|
// EXTERNAL MODULE: ./src/rpc/parsers.ts
|
|
33531
33798
|
var parsers = __webpack_require__(784);
|
|
33799
|
+
// EXTERNAL MODULE: ./src/utils.ts
|
|
33800
|
+
var utils = __webpack_require__(3121);
|
|
33532
33801
|
;// ./src/rpc/server.ts
|
|
33533
33802
|
/* provided dependency */ var Buffer = __webpack_require__(8287)["Buffer"];
|
|
33534
33803
|
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); }
|
|
@@ -33550,12 +33819,20 @@ function _toPrimitive(t, r) { if ("object" != server_typeof(t) || !t) return t;
|
|
|
33550
33819
|
|
|
33551
33820
|
|
|
33552
33821
|
|
|
33822
|
+
|
|
33553
33823
|
var SUBMIT_TRANSACTION_TIMEOUT = (/* unused pure expression or super */ null && (60 * 1000));
|
|
33554
33824
|
var Durability = function (Durability) {
|
|
33555
33825
|
Durability["Temporary"] = "temporary";
|
|
33556
33826
|
Durability["Persistent"] = "persistent";
|
|
33557
33827
|
return Durability;
|
|
33558
33828
|
}({});
|
|
33829
|
+
var DEFAULT_GET_TRANSACTION_TIMEOUT = 30;
|
|
33830
|
+
var BasicSleepStrategy = function BasicSleepStrategy(_iter) {
|
|
33831
|
+
return 1000;
|
|
33832
|
+
};
|
|
33833
|
+
var LinearSleepStrategy = function LinearSleepStrategy(iter) {
|
|
33834
|
+
return 1000 * iter;
|
|
33835
|
+
};
|
|
33559
33836
|
function findCreatedAccountSequenceInTransactionMeta(meta) {
|
|
33560
33837
|
var _operations$flatMap$f;
|
|
33561
33838
|
var operations = [];
|
|
@@ -33860,19 +34137,65 @@ var RpcServer = function () {
|
|
|
33860
34137
|
return _getLedgerEntries;
|
|
33861
34138
|
}()
|
|
33862
34139
|
}, {
|
|
33863
|
-
key: "
|
|
34140
|
+
key: "pollTransaction",
|
|
33864
34141
|
value: (function () {
|
|
33865
|
-
var
|
|
34142
|
+
var _pollTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee8(hash, opts) {
|
|
34143
|
+
var _opts$attempts, _opts$attempts2;
|
|
34144
|
+
var maxAttempts, foundInfo, attempt, _opts$sleepStrategy;
|
|
33866
34145
|
return server_regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
33867
34146
|
while (1) switch (_context8.prev = _context8.next) {
|
|
33868
34147
|
case 0:
|
|
33869
|
-
|
|
34148
|
+
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;
|
|
34149
|
+
attempt = 1;
|
|
34150
|
+
case 2:
|
|
34151
|
+
if (!(attempt < maxAttempts)) {
|
|
34152
|
+
_context8.next = 13;
|
|
34153
|
+
break;
|
|
34154
|
+
}
|
|
34155
|
+
_context8.next = 5;
|
|
34156
|
+
return this.getTransaction(hash);
|
|
34157
|
+
case 5:
|
|
34158
|
+
foundInfo = _context8.sent;
|
|
34159
|
+
if (!(foundInfo.status !== api/* Api */.j.GetTransactionStatus.NOT_FOUND)) {
|
|
34160
|
+
_context8.next = 8;
|
|
34161
|
+
break;
|
|
34162
|
+
}
|
|
34163
|
+
return _context8.abrupt("return", foundInfo);
|
|
34164
|
+
case 8:
|
|
34165
|
+
_context8.next = 10;
|
|
34166
|
+
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));
|
|
34167
|
+
case 10:
|
|
34168
|
+
attempt++;
|
|
34169
|
+
_context8.next = 2;
|
|
34170
|
+
break;
|
|
34171
|
+
case 13:
|
|
34172
|
+
return _context8.abrupt("return", foundInfo);
|
|
34173
|
+
case 14:
|
|
34174
|
+
case "end":
|
|
34175
|
+
return _context8.stop();
|
|
34176
|
+
}
|
|
34177
|
+
}, _callee8, this);
|
|
34178
|
+
}));
|
|
34179
|
+
function pollTransaction(_x6, _x7) {
|
|
34180
|
+
return _pollTransaction.apply(this, arguments);
|
|
34181
|
+
}
|
|
34182
|
+
return pollTransaction;
|
|
34183
|
+
}())
|
|
34184
|
+
}, {
|
|
34185
|
+
key: "getTransaction",
|
|
34186
|
+
value: (function () {
|
|
34187
|
+
var _getTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee9(hash) {
|
|
34188
|
+
return server_regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
34189
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
34190
|
+
case 0:
|
|
34191
|
+
return _context9.abrupt("return", this._getTransaction(hash).then(function (raw) {
|
|
33870
34192
|
var foundInfo = {};
|
|
33871
34193
|
if (raw.status !== api/* Api */.j.GetTransactionStatus.NOT_FOUND) {
|
|
33872
34194
|
Object.assign(foundInfo, (0,parsers/* parseTransactionInfo */.WC)(raw));
|
|
33873
34195
|
}
|
|
33874
34196
|
var result = _objectSpread({
|
|
33875
34197
|
status: raw.status,
|
|
34198
|
+
txHash: hash,
|
|
33876
34199
|
latestLedger: raw.latestLedger,
|
|
33877
34200
|
latestLedgerCloseTime: raw.latestLedgerCloseTime,
|
|
33878
34201
|
oldestLedger: raw.oldestLedger,
|
|
@@ -33882,11 +34205,11 @@ var RpcServer = function () {
|
|
|
33882
34205
|
}));
|
|
33883
34206
|
case 1:
|
|
33884
34207
|
case "end":
|
|
33885
|
-
return
|
|
34208
|
+
return _context9.stop();
|
|
33886
34209
|
}
|
|
33887
|
-
},
|
|
34210
|
+
}, _callee9, this);
|
|
33888
34211
|
}));
|
|
33889
|
-
function getTransaction(
|
|
34212
|
+
function getTransaction(_x8) {
|
|
33890
34213
|
return _getTransaction2.apply(this, arguments);
|
|
33891
34214
|
}
|
|
33892
34215
|
return getTransaction;
|
|
@@ -33894,20 +34217,20 @@ var RpcServer = function () {
|
|
|
33894
34217
|
}, {
|
|
33895
34218
|
key: "_getTransaction",
|
|
33896
34219
|
value: function () {
|
|
33897
|
-
var _getTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
33898
|
-
return server_regeneratorRuntime().wrap(function
|
|
33899
|
-
while (1) switch (
|
|
34220
|
+
var _getTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee10(hash) {
|
|
34221
|
+
return server_regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
34222
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
33900
34223
|
case 0:
|
|
33901
|
-
return
|
|
34224
|
+
return _context10.abrupt("return", postObject(this.serverURL.toString(), 'getTransaction', {
|
|
33902
34225
|
hash: hash
|
|
33903
34226
|
}));
|
|
33904
34227
|
case 1:
|
|
33905
34228
|
case "end":
|
|
33906
|
-
return
|
|
34229
|
+
return _context10.stop();
|
|
33907
34230
|
}
|
|
33908
|
-
},
|
|
34231
|
+
}, _callee10, this);
|
|
33909
34232
|
}));
|
|
33910
|
-
function _getTransaction(
|
|
34233
|
+
function _getTransaction(_x9) {
|
|
33911
34234
|
return _getTransaction3.apply(this, arguments);
|
|
33912
34235
|
}
|
|
33913
34236
|
return _getTransaction;
|
|
@@ -33915,11 +34238,11 @@ var RpcServer = function () {
|
|
|
33915
34238
|
}, {
|
|
33916
34239
|
key: "getTransactions",
|
|
33917
34240
|
value: (function () {
|
|
33918
|
-
var _getTransactions2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
33919
|
-
return server_regeneratorRuntime().wrap(function
|
|
33920
|
-
while (1) switch (
|
|
34241
|
+
var _getTransactions2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee11(request) {
|
|
34242
|
+
return server_regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
34243
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
33921
34244
|
case 0:
|
|
33922
|
-
return
|
|
34245
|
+
return _context11.abrupt("return", this._getTransactions(request).then(function (raw) {
|
|
33923
34246
|
var result = {
|
|
33924
34247
|
transactions: raw.transactions.map(parsers/* parseRawTransactions */.tR),
|
|
33925
34248
|
latestLedger: raw.latestLedger,
|
|
@@ -33932,11 +34255,11 @@ var RpcServer = function () {
|
|
|
33932
34255
|
}));
|
|
33933
34256
|
case 1:
|
|
33934
34257
|
case "end":
|
|
33935
|
-
return
|
|
34258
|
+
return _context11.stop();
|
|
33936
34259
|
}
|
|
33937
|
-
},
|
|
34260
|
+
}, _callee11, this);
|
|
33938
34261
|
}));
|
|
33939
|
-
function getTransactions(
|
|
34262
|
+
function getTransactions(_x10) {
|
|
33940
34263
|
return _getTransactions2.apply(this, arguments);
|
|
33941
34264
|
}
|
|
33942
34265
|
return getTransactions;
|
|
@@ -33944,18 +34267,18 @@ var RpcServer = function () {
|
|
|
33944
34267
|
}, {
|
|
33945
34268
|
key: "_getTransactions",
|
|
33946
34269
|
value: function () {
|
|
33947
|
-
var _getTransactions3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
33948
|
-
return server_regeneratorRuntime().wrap(function
|
|
33949
|
-
while (1) switch (
|
|
34270
|
+
var _getTransactions3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee12(request) {
|
|
34271
|
+
return server_regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
34272
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
33950
34273
|
case 0:
|
|
33951
|
-
return
|
|
34274
|
+
return _context12.abrupt("return", postObject(this.serverURL.toString(), 'getTransactions', request));
|
|
33952
34275
|
case 1:
|
|
33953
34276
|
case "end":
|
|
33954
|
-
return
|
|
34277
|
+
return _context12.stop();
|
|
33955
34278
|
}
|
|
33956
|
-
},
|
|
34279
|
+
}, _callee12, this);
|
|
33957
34280
|
}));
|
|
33958
|
-
function _getTransactions(
|
|
34281
|
+
function _getTransactions(_x11) {
|
|
33959
34282
|
return _getTransactions3.apply(this, arguments);
|
|
33960
34283
|
}
|
|
33961
34284
|
return _getTransactions;
|
|
@@ -33963,18 +34286,18 @@ var RpcServer = function () {
|
|
|
33963
34286
|
}, {
|
|
33964
34287
|
key: "getEvents",
|
|
33965
34288
|
value: (function () {
|
|
33966
|
-
var _getEvents2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
33967
|
-
return server_regeneratorRuntime().wrap(function
|
|
33968
|
-
while (1) switch (
|
|
34289
|
+
var _getEvents2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee13(request) {
|
|
34290
|
+
return server_regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
34291
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
33969
34292
|
case 0:
|
|
33970
|
-
return
|
|
34293
|
+
return _context13.abrupt("return", this._getEvents(request).then(parsers/* parseRawEvents */.fG));
|
|
33971
34294
|
case 1:
|
|
33972
34295
|
case "end":
|
|
33973
|
-
return
|
|
34296
|
+
return _context13.stop();
|
|
33974
34297
|
}
|
|
33975
|
-
},
|
|
34298
|
+
}, _callee13, this);
|
|
33976
34299
|
}));
|
|
33977
|
-
function getEvents(
|
|
34300
|
+
function getEvents(_x12) {
|
|
33978
34301
|
return _getEvents2.apply(this, arguments);
|
|
33979
34302
|
}
|
|
33980
34303
|
return getEvents;
|
|
@@ -33982,12 +34305,12 @@ var RpcServer = function () {
|
|
|
33982
34305
|
}, {
|
|
33983
34306
|
key: "_getEvents",
|
|
33984
34307
|
value: function () {
|
|
33985
|
-
var _getEvents3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
34308
|
+
var _getEvents3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee14(request) {
|
|
33986
34309
|
var _request$filters;
|
|
33987
|
-
return server_regeneratorRuntime().wrap(function
|
|
33988
|
-
while (1) switch (
|
|
34310
|
+
return server_regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
34311
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
33989
34312
|
case 0:
|
|
33990
|
-
return
|
|
34313
|
+
return _context14.abrupt("return", postObject(this.serverURL.toString(), 'getEvents', _objectSpread(_objectSpread({
|
|
33991
34314
|
filters: (_request$filters = request.filters) !== null && _request$filters !== void 0 ? _request$filters : [],
|
|
33992
34315
|
pagination: _objectSpread(_objectSpread({}, request.cursor && {
|
|
33993
34316
|
cursor: request.cursor
|
|
@@ -34001,11 +34324,11 @@ var RpcServer = function () {
|
|
|
34001
34324
|
})));
|
|
34002
34325
|
case 1:
|
|
34003
34326
|
case "end":
|
|
34004
|
-
return
|
|
34327
|
+
return _context14.stop();
|
|
34005
34328
|
}
|
|
34006
|
-
},
|
|
34329
|
+
}, _callee14, this);
|
|
34007
34330
|
}));
|
|
34008
|
-
function _getEvents(
|
|
34331
|
+
function _getEvents(_x13) {
|
|
34009
34332
|
return _getEvents3.apply(this, arguments);
|
|
34010
34333
|
}
|
|
34011
34334
|
return _getEvents;
|
|
@@ -34013,16 +34336,16 @@ var RpcServer = function () {
|
|
|
34013
34336
|
}, {
|
|
34014
34337
|
key: "getNetwork",
|
|
34015
34338
|
value: (function () {
|
|
34016
|
-
var _getNetwork = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
34017
|
-
return server_regeneratorRuntime().wrap(function
|
|
34018
|
-
while (1) switch (
|
|
34339
|
+
var _getNetwork = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee15() {
|
|
34340
|
+
return server_regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
34341
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
34019
34342
|
case 0:
|
|
34020
|
-
return
|
|
34343
|
+
return _context15.abrupt("return", postObject(this.serverURL.toString(), 'getNetwork'));
|
|
34021
34344
|
case 1:
|
|
34022
34345
|
case "end":
|
|
34023
|
-
return
|
|
34346
|
+
return _context15.stop();
|
|
34024
34347
|
}
|
|
34025
|
-
},
|
|
34348
|
+
}, _callee15, this);
|
|
34026
34349
|
}));
|
|
34027
34350
|
function getNetwork() {
|
|
34028
34351
|
return _getNetwork.apply(this, arguments);
|
|
@@ -34032,16 +34355,16 @@ var RpcServer = function () {
|
|
|
34032
34355
|
}, {
|
|
34033
34356
|
key: "getLatestLedger",
|
|
34034
34357
|
value: (function () {
|
|
34035
|
-
var _getLatestLedger = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
34036
|
-
return server_regeneratorRuntime().wrap(function
|
|
34037
|
-
while (1) switch (
|
|
34358
|
+
var _getLatestLedger = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee16() {
|
|
34359
|
+
return server_regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
34360
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
34038
34361
|
case 0:
|
|
34039
|
-
return
|
|
34362
|
+
return _context16.abrupt("return", postObject(this.serverURL.toString(), 'getLatestLedger'));
|
|
34040
34363
|
case 1:
|
|
34041
34364
|
case "end":
|
|
34042
|
-
return
|
|
34365
|
+
return _context16.stop();
|
|
34043
34366
|
}
|
|
34044
|
-
},
|
|
34367
|
+
}, _callee16, this);
|
|
34045
34368
|
}));
|
|
34046
34369
|
function getLatestLedger() {
|
|
34047
34370
|
return _getLatestLedger.apply(this, arguments);
|
|
@@ -34051,18 +34374,18 @@ var RpcServer = function () {
|
|
|
34051
34374
|
}, {
|
|
34052
34375
|
key: "simulateTransaction",
|
|
34053
34376
|
value: (function () {
|
|
34054
|
-
var _simulateTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
34055
|
-
return server_regeneratorRuntime().wrap(function
|
|
34056
|
-
while (1) switch (
|
|
34377
|
+
var _simulateTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee17(tx, addlResources) {
|
|
34378
|
+
return server_regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
34379
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
34057
34380
|
case 0:
|
|
34058
|
-
return
|
|
34381
|
+
return _context17.abrupt("return", this._simulateTransaction(tx, addlResources).then(parsers/* parseRawSimulation */.jr));
|
|
34059
34382
|
case 1:
|
|
34060
34383
|
case "end":
|
|
34061
|
-
return
|
|
34384
|
+
return _context17.stop();
|
|
34062
34385
|
}
|
|
34063
|
-
},
|
|
34386
|
+
}, _callee17, this);
|
|
34064
34387
|
}));
|
|
34065
|
-
function simulateTransaction(
|
|
34388
|
+
function simulateTransaction(_x14, _x15) {
|
|
34066
34389
|
return _simulateTransaction2.apply(this, arguments);
|
|
34067
34390
|
}
|
|
34068
34391
|
return simulateTransaction;
|
|
@@ -34070,11 +34393,11 @@ var RpcServer = function () {
|
|
|
34070
34393
|
}, {
|
|
34071
34394
|
key: "_simulateTransaction",
|
|
34072
34395
|
value: function () {
|
|
34073
|
-
var _simulateTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
34074
|
-
return server_regeneratorRuntime().wrap(function
|
|
34075
|
-
while (1) switch (
|
|
34396
|
+
var _simulateTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee18(transaction, addlResources) {
|
|
34397
|
+
return server_regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
34398
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
34076
34399
|
case 0:
|
|
34077
|
-
return
|
|
34400
|
+
return _context18.abrupt("return", postObject(this.serverURL.toString(), 'simulateTransaction', _objectSpread({
|
|
34078
34401
|
transaction: transaction.toXDR()
|
|
34079
34402
|
}, addlResources !== undefined && {
|
|
34080
34403
|
resourceConfig: {
|
|
@@ -34083,11 +34406,11 @@ var RpcServer = function () {
|
|
|
34083
34406
|
})));
|
|
34084
34407
|
case 1:
|
|
34085
34408
|
case "end":
|
|
34086
|
-
return
|
|
34409
|
+
return _context18.stop();
|
|
34087
34410
|
}
|
|
34088
|
-
},
|
|
34411
|
+
}, _callee18, this);
|
|
34089
34412
|
}));
|
|
34090
|
-
function _simulateTransaction(
|
|
34413
|
+
function _simulateTransaction(_x16, _x17) {
|
|
34091
34414
|
return _simulateTransaction3.apply(this, arguments);
|
|
34092
34415
|
}
|
|
34093
34416
|
return _simulateTransaction;
|
|
@@ -34095,29 +34418,29 @@ var RpcServer = function () {
|
|
|
34095
34418
|
}, {
|
|
34096
34419
|
key: "prepareTransaction",
|
|
34097
34420
|
value: (function () {
|
|
34098
|
-
var _prepareTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
34421
|
+
var _prepareTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee19(tx) {
|
|
34099
34422
|
var simResponse;
|
|
34100
|
-
return server_regeneratorRuntime().wrap(function
|
|
34101
|
-
while (1) switch (
|
|
34423
|
+
return server_regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
34424
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
34102
34425
|
case 0:
|
|
34103
|
-
|
|
34426
|
+
_context19.next = 2;
|
|
34104
34427
|
return this.simulateTransaction(tx);
|
|
34105
34428
|
case 2:
|
|
34106
|
-
simResponse =
|
|
34429
|
+
simResponse = _context19.sent;
|
|
34107
34430
|
if (!api/* Api */.j.isSimulationError(simResponse)) {
|
|
34108
|
-
|
|
34431
|
+
_context19.next = 5;
|
|
34109
34432
|
break;
|
|
34110
34433
|
}
|
|
34111
34434
|
throw new Error(simResponse.error);
|
|
34112
34435
|
case 5:
|
|
34113
|
-
return
|
|
34436
|
+
return _context19.abrupt("return", (0,transaction/* assembleTransaction */.X)(tx, simResponse).build());
|
|
34114
34437
|
case 6:
|
|
34115
34438
|
case "end":
|
|
34116
|
-
return
|
|
34439
|
+
return _context19.stop();
|
|
34117
34440
|
}
|
|
34118
|
-
},
|
|
34441
|
+
}, _callee19, this);
|
|
34119
34442
|
}));
|
|
34120
|
-
function prepareTransaction(
|
|
34443
|
+
function prepareTransaction(_x18) {
|
|
34121
34444
|
return _prepareTransaction.apply(this, arguments);
|
|
34122
34445
|
}
|
|
34123
34446
|
return prepareTransaction;
|
|
@@ -34125,18 +34448,18 @@ var RpcServer = function () {
|
|
|
34125
34448
|
}, {
|
|
34126
34449
|
key: "sendTransaction",
|
|
34127
34450
|
value: (function () {
|
|
34128
|
-
var _sendTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
34129
|
-
return server_regeneratorRuntime().wrap(function
|
|
34130
|
-
while (1) switch (
|
|
34451
|
+
var _sendTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee20(transaction) {
|
|
34452
|
+
return server_regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
34453
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
34131
34454
|
case 0:
|
|
34132
|
-
return
|
|
34455
|
+
return _context20.abrupt("return", this._sendTransaction(transaction).then(parsers/* parseRawSendTransaction */.Af));
|
|
34133
34456
|
case 1:
|
|
34134
34457
|
case "end":
|
|
34135
|
-
return
|
|
34458
|
+
return _context20.stop();
|
|
34136
34459
|
}
|
|
34137
|
-
},
|
|
34460
|
+
}, _callee20, this);
|
|
34138
34461
|
}));
|
|
34139
|
-
function sendTransaction(
|
|
34462
|
+
function sendTransaction(_x19) {
|
|
34140
34463
|
return _sendTransaction2.apply(this, arguments);
|
|
34141
34464
|
}
|
|
34142
34465
|
return sendTransaction;
|
|
@@ -34144,20 +34467,20 @@ var RpcServer = function () {
|
|
|
34144
34467
|
}, {
|
|
34145
34468
|
key: "_sendTransaction",
|
|
34146
34469
|
value: function () {
|
|
34147
|
-
var _sendTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
34148
|
-
return server_regeneratorRuntime().wrap(function
|
|
34149
|
-
while (1) switch (
|
|
34470
|
+
var _sendTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee21(transaction) {
|
|
34471
|
+
return server_regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
34472
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
34150
34473
|
case 0:
|
|
34151
|
-
return
|
|
34474
|
+
return _context21.abrupt("return", postObject(this.serverURL.toString(), 'sendTransaction', {
|
|
34152
34475
|
transaction: transaction.toXDR()
|
|
34153
34476
|
}));
|
|
34154
34477
|
case 1:
|
|
34155
34478
|
case "end":
|
|
34156
|
-
return
|
|
34479
|
+
return _context21.stop();
|
|
34157
34480
|
}
|
|
34158
|
-
},
|
|
34481
|
+
}, _callee21, this);
|
|
34159
34482
|
}));
|
|
34160
|
-
function _sendTransaction(
|
|
34483
|
+
function _sendTransaction(_x20) {
|
|
34161
34484
|
return _sendTransaction3.apply(this, arguments);
|
|
34162
34485
|
}
|
|
34163
34486
|
return _sendTransaction;
|
|
@@ -34165,58 +34488,58 @@ var RpcServer = function () {
|
|
|
34165
34488
|
}, {
|
|
34166
34489
|
key: "requestAirdrop",
|
|
34167
34490
|
value: (function () {
|
|
34168
|
-
var _requestAirdrop = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
34491
|
+
var _requestAirdrop = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee22(address, friendbotUrl) {
|
|
34169
34492
|
var account, response, meta, sequence, _error$response, _error$response$detai;
|
|
34170
|
-
return server_regeneratorRuntime().wrap(function
|
|
34171
|
-
while (1) switch (
|
|
34493
|
+
return server_regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
34494
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
34172
34495
|
case 0:
|
|
34173
34496
|
account = typeof address === 'string' ? address : address.accountId();
|
|
34174
|
-
|
|
34175
|
-
if (
|
|
34176
|
-
|
|
34497
|
+
_context22.t0 = friendbotUrl;
|
|
34498
|
+
if (_context22.t0) {
|
|
34499
|
+
_context22.next = 6;
|
|
34177
34500
|
break;
|
|
34178
34501
|
}
|
|
34179
|
-
|
|
34502
|
+
_context22.next = 5;
|
|
34180
34503
|
return this.getNetwork();
|
|
34181
34504
|
case 5:
|
|
34182
|
-
|
|
34505
|
+
_context22.t0 = _context22.sent.friendbotUrl;
|
|
34183
34506
|
case 6:
|
|
34184
|
-
friendbotUrl =
|
|
34507
|
+
friendbotUrl = _context22.t0;
|
|
34185
34508
|
if (friendbotUrl) {
|
|
34186
|
-
|
|
34509
|
+
_context22.next = 9;
|
|
34187
34510
|
break;
|
|
34188
34511
|
}
|
|
34189
34512
|
throw new Error('No friendbot URL configured for current network');
|
|
34190
34513
|
case 9:
|
|
34191
|
-
|
|
34192
|
-
|
|
34514
|
+
_context22.prev = 9;
|
|
34515
|
+
_context22.next = 12;
|
|
34193
34516
|
return axios.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account)));
|
|
34194
34517
|
case 12:
|
|
34195
|
-
response =
|
|
34518
|
+
response = _context22.sent;
|
|
34196
34519
|
meta = lib.xdr.TransactionMeta.fromXDR(response.data.result_meta_xdr, 'base64');
|
|
34197
34520
|
sequence = findCreatedAccountSequenceInTransactionMeta(meta);
|
|
34198
|
-
return
|
|
34521
|
+
return _context22.abrupt("return", new lib.Account(account, sequence));
|
|
34199
34522
|
case 18:
|
|
34200
|
-
|
|
34201
|
-
|
|
34202
|
-
if (!(((_error$response =
|
|
34203
|
-
|
|
34523
|
+
_context22.prev = 18;
|
|
34524
|
+
_context22.t1 = _context22["catch"](9);
|
|
34525
|
+
if (!(((_error$response = _context22.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) {
|
|
34526
|
+
_context22.next = 23;
|
|
34204
34527
|
break;
|
|
34205
34528
|
}
|
|
34206
|
-
if (!((_error$response$detai =
|
|
34207
|
-
|
|
34529
|
+
if (!((_error$response$detai = _context22.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes('createAccountAlreadyExist'))) {
|
|
34530
|
+
_context22.next = 23;
|
|
34208
34531
|
break;
|
|
34209
34532
|
}
|
|
34210
|
-
return
|
|
34533
|
+
return _context22.abrupt("return", this.getAccount(account));
|
|
34211
34534
|
case 23:
|
|
34212
|
-
throw
|
|
34535
|
+
throw _context22.t1;
|
|
34213
34536
|
case 24:
|
|
34214
34537
|
case "end":
|
|
34215
|
-
return
|
|
34538
|
+
return _context22.stop();
|
|
34216
34539
|
}
|
|
34217
|
-
},
|
|
34540
|
+
}, _callee22, this, [[9, 18]]);
|
|
34218
34541
|
}));
|
|
34219
|
-
function requestAirdrop(
|
|
34542
|
+
function requestAirdrop(_x21, _x22) {
|
|
34220
34543
|
return _requestAirdrop.apply(this, arguments);
|
|
34221
34544
|
}
|
|
34222
34545
|
return requestAirdrop;
|
|
@@ -34224,16 +34547,16 @@ var RpcServer = function () {
|
|
|
34224
34547
|
}, {
|
|
34225
34548
|
key: "getFeeStats",
|
|
34226
34549
|
value: (function () {
|
|
34227
|
-
var _getFeeStats = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
34228
|
-
return server_regeneratorRuntime().wrap(function
|
|
34229
|
-
while (1) switch (
|
|
34550
|
+
var _getFeeStats = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee23() {
|
|
34551
|
+
return server_regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
34552
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
34230
34553
|
case 0:
|
|
34231
|
-
return
|
|
34554
|
+
return _context23.abrupt("return", postObject(this.serverURL.toString(), 'getFeeStats'));
|
|
34232
34555
|
case 1:
|
|
34233
34556
|
case "end":
|
|
34234
|
-
return
|
|
34557
|
+
return _context23.stop();
|
|
34235
34558
|
}
|
|
34236
|
-
},
|
|
34559
|
+
}, _callee23, this);
|
|
34237
34560
|
}));
|
|
34238
34561
|
function getFeeStats() {
|
|
34239
34562
|
return _getFeeStats.apply(this, arguments);
|
|
@@ -34243,16 +34566,16 @@ var RpcServer = function () {
|
|
|
34243
34566
|
}, {
|
|
34244
34567
|
key: "getVersionInfo",
|
|
34245
34568
|
value: (function () {
|
|
34246
|
-
var _getVersionInfo = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
34247
|
-
return server_regeneratorRuntime().wrap(function
|
|
34248
|
-
while (1) switch (
|
|
34569
|
+
var _getVersionInfo = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee24() {
|
|
34570
|
+
return server_regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
34571
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
34249
34572
|
case 0:
|
|
34250
|
-
return
|
|
34573
|
+
return _context24.abrupt("return", postObject(this.serverURL.toString(), 'getVersionInfo'));
|
|
34251
34574
|
case 1:
|
|
34252
34575
|
case "end":
|
|
34253
|
-
return
|
|
34576
|
+
return _context24.stop();
|
|
34254
34577
|
}
|
|
34255
|
-
},
|
|
34578
|
+
}, _callee24, this);
|
|
34256
34579
|
}));
|
|
34257
34580
|
function getVersionInfo() {
|
|
34258
34581
|
return _getVersionInfo.apply(this, arguments);
|
|
@@ -34262,33 +34585,33 @@ var RpcServer = function () {
|
|
|
34262
34585
|
}, {
|
|
34263
34586
|
key: "getSACBalance",
|
|
34264
34587
|
value: (function () {
|
|
34265
|
-
var _getSACBalance = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
34588
|
+
var _getSACBalance = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee25(contractId, sac, networkPassphrase) {
|
|
34266
34589
|
var passphrase, sacId, key, ledgerKey, response, _response$entries$2, lastModifiedLedgerSeq, liveUntilLedgerSeq, val, entry;
|
|
34267
|
-
return server_regeneratorRuntime().wrap(function
|
|
34268
|
-
while (1) switch (
|
|
34590
|
+
return server_regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
34591
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
34269
34592
|
case 0:
|
|
34270
34593
|
if (lib.StrKey.isValidContract(contractId)) {
|
|
34271
|
-
|
|
34594
|
+
_context25.next = 2;
|
|
34272
34595
|
break;
|
|
34273
34596
|
}
|
|
34274
34597
|
throw new TypeError("expected contract ID, got ".concat(contractId));
|
|
34275
34598
|
case 2:
|
|
34276
34599
|
if (!(networkPassphrase !== null && networkPassphrase !== void 0)) {
|
|
34277
|
-
|
|
34600
|
+
_context25.next = 6;
|
|
34278
34601
|
break;
|
|
34279
34602
|
}
|
|
34280
|
-
|
|
34281
|
-
|
|
34603
|
+
_context25.t0 = networkPassphrase;
|
|
34604
|
+
_context25.next = 9;
|
|
34282
34605
|
break;
|
|
34283
34606
|
case 6:
|
|
34284
|
-
|
|
34607
|
+
_context25.next = 8;
|
|
34285
34608
|
return this.getNetwork().then(function (n) {
|
|
34286
34609
|
return n.passphrase;
|
|
34287
34610
|
});
|
|
34288
34611
|
case 8:
|
|
34289
|
-
|
|
34612
|
+
_context25.t0 = _context25.sent;
|
|
34290
34613
|
case 9:
|
|
34291
|
-
passphrase =
|
|
34614
|
+
passphrase = _context25.t0;
|
|
34292
34615
|
sacId = sac.contractId(passphrase);
|
|
34293
34616
|
key = lib.xdr.ScVal.scvVec([(0,lib.nativeToScVal)("Balance", {
|
|
34294
34617
|
type: "symbol"
|
|
@@ -34300,29 +34623,29 @@ var RpcServer = function () {
|
|
|
34300
34623
|
durability: lib.xdr.ContractDataDurability.persistent(),
|
|
34301
34624
|
key: key
|
|
34302
34625
|
}));
|
|
34303
|
-
|
|
34626
|
+
_context25.next = 15;
|
|
34304
34627
|
return this.getLedgerEntries(ledgerKey);
|
|
34305
34628
|
case 15:
|
|
34306
|
-
response =
|
|
34629
|
+
response = _context25.sent;
|
|
34307
34630
|
if (!(response.entries.length === 0)) {
|
|
34308
|
-
|
|
34631
|
+
_context25.next = 18;
|
|
34309
34632
|
break;
|
|
34310
34633
|
}
|
|
34311
|
-
return
|
|
34634
|
+
return _context25.abrupt("return", {
|
|
34312
34635
|
latestLedger: response.latestLedger
|
|
34313
34636
|
});
|
|
34314
34637
|
case 18:
|
|
34315
34638
|
_response$entries$2 = response.entries[0], lastModifiedLedgerSeq = _response$entries$2.lastModifiedLedgerSeq, liveUntilLedgerSeq = _response$entries$2.liveUntilLedgerSeq, val = _response$entries$2.val;
|
|
34316
34639
|
if (!(val.switch().value !== lib.xdr.LedgerEntryType.contractData().value)) {
|
|
34317
|
-
|
|
34640
|
+
_context25.next = 21;
|
|
34318
34641
|
break;
|
|
34319
34642
|
}
|
|
34320
|
-
return
|
|
34643
|
+
return _context25.abrupt("return", {
|
|
34321
34644
|
latestLedger: response.latestLedger
|
|
34322
34645
|
});
|
|
34323
34646
|
case 21:
|
|
34324
34647
|
entry = (0,lib.scValToNative)(val.contractData().val());
|
|
34325
|
-
return
|
|
34648
|
+
return _context25.abrupt("return", {
|
|
34326
34649
|
latestLedger: response.latestLedger,
|
|
34327
34650
|
balanceEntry: {
|
|
34328
34651
|
liveUntilLedgerSeq: liveUntilLedgerSeq,
|
|
@@ -34334,11 +34657,11 @@ var RpcServer = function () {
|
|
|
34334
34657
|
});
|
|
34335
34658
|
case 23:
|
|
34336
34659
|
case "end":
|
|
34337
|
-
return
|
|
34660
|
+
return _context25.stop();
|
|
34338
34661
|
}
|
|
34339
|
-
},
|
|
34662
|
+
}, _callee25, this);
|
|
34340
34663
|
}));
|
|
34341
|
-
function getSACBalance(
|
|
34664
|
+
function getSACBalance(_x23, _x24, _x25) {
|
|
34342
34665
|
return _getSACBalance.apply(this, arguments);
|
|
34343
34666
|
}
|
|
34344
34667
|
return getSACBalance;
|
|
@@ -34419,7 +34742,8 @@ function parseTransactionInfo(raw) {
|
|
|
34419
34742
|
}
|
|
34420
34743
|
function parseRawTransactions(r) {
|
|
34421
34744
|
return _objectSpread({
|
|
34422
|
-
status: r.status
|
|
34745
|
+
status: r.status,
|
|
34746
|
+
txHash: r.txHash
|
|
34423
34747
|
}, parseTransactionInfo(r));
|
|
34424
34748
|
}
|
|
34425
34749
|
function parseRawEvents(raw) {
|
|
@@ -34462,8 +34786,7 @@ function parseSuccessful(sim, partial) {
|
|
|
34462
34786
|
var _sim$results$length, _sim$results, _sim$stateChanges$len, _sim$stateChanges, _sim$stateChanges2;
|
|
34463
34787
|
var success = _objectSpread(_objectSpread(_objectSpread({}, partial), {}, {
|
|
34464
34788
|
transactionData: new _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_0__.SorobanDataBuilder(sim.transactionData),
|
|
34465
|
-
minResourceFee: sim.minResourceFee
|
|
34466
|
-
cost: sim.cost
|
|
34789
|
+
minResourceFee: sim.minResourceFee
|
|
34467
34790
|
}, ((_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) && {
|
|
34468
34791
|
result: sim.results.map(function (row) {
|
|
34469
34792
|
var _row$auth;
|
|
@@ -34615,6 +34938,7 @@ var Resolver = function () {
|
|
|
34615
34938
|
key: "resolve",
|
|
34616
34939
|
value: (function () {
|
|
34617
34940
|
var _resolve = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(domain) {
|
|
34941
|
+
var _opts$allowedRedirect;
|
|
34618
34942
|
var opts,
|
|
34619
34943
|
allowHttp,
|
|
34620
34944
|
timeout,
|
|
@@ -34628,6 +34952,7 @@ var Resolver = function () {
|
|
|
34628
34952
|
timeout = typeof opts.timeout === "undefined" ? _config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.getTimeout() : opts.timeout;
|
|
34629
34953
|
protocol = allowHttp ? "http" : "https";
|
|
34630
34954
|
return _context.abrupt("return", _http_client__WEBPACK_IMPORTED_MODULE_1__/* .httpClient */ .ok.get("".concat(protocol, "://").concat(domain, "/.well-known/stellar.toml"), {
|
|
34955
|
+
maxRedirects: (_opts$allowedRedirect = opts.allowedRedirects) !== null && _opts$allowedRedirect !== void 0 ? _opts$allowedRedirect : 0,
|
|
34631
34956
|
maxContentLength: STELLAR_TOML_MAX_SIZE,
|
|
34632
34957
|
cancelToken: timeout ? new CancelToken(function (cancel) {
|
|
34633
34958
|
return setTimeout(function () {
|
|
@@ -34696,6 +35021,13 @@ var Utils = function () {
|
|
|
34696
35021
|
maxTime = _transaction$timeBoun.maxTime;
|
|
34697
35022
|
return now >= Number.parseInt(minTime, 10) - gracePeriod && now <= Number.parseInt(maxTime, 10) + gracePeriod;
|
|
34698
35023
|
}
|
|
35024
|
+
}, {
|
|
35025
|
+
key: "sleep",
|
|
35026
|
+
value: function sleep(ms) {
|
|
35027
|
+
return new Promise(function (resolve) {
|
|
35028
|
+
return setTimeout(resolve, ms);
|
|
35029
|
+
});
|
|
35030
|
+
}
|
|
34699
35031
|
}]);
|
|
34700
35032
|
}();
|
|
34701
35033
|
|
|
@@ -43086,10 +43418,21 @@ var utilInspect = __webpack_require__(2634);
|
|
|
43086
43418
|
var inspectCustom = utilInspect.custom;
|
|
43087
43419
|
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
43088
43420
|
|
|
43421
|
+
var quotes = {
|
|
43422
|
+
__proto__: null,
|
|
43423
|
+
'double': '"',
|
|
43424
|
+
single: "'"
|
|
43425
|
+
};
|
|
43426
|
+
var quoteREs = {
|
|
43427
|
+
__proto__: null,
|
|
43428
|
+
'double': /(["\\])/g,
|
|
43429
|
+
single: /(['\\])/g
|
|
43430
|
+
};
|
|
43431
|
+
|
|
43089
43432
|
module.exports = function inspect_(obj, options, depth, seen) {
|
|
43090
43433
|
var opts = options || {};
|
|
43091
43434
|
|
|
43092
|
-
if (has(opts, 'quoteStyle') && (
|
|
43435
|
+
if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {
|
|
43093
43436
|
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
43094
43437
|
}
|
|
43095
43438
|
if (
|
|
@@ -43284,7 +43627,8 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
43284
43627
|
};
|
|
43285
43628
|
|
|
43286
43629
|
function wrapQuotes(s, defaultStyle, opts) {
|
|
43287
|
-
var
|
|
43630
|
+
var style = opts.quoteStyle || defaultStyle;
|
|
43631
|
+
var quoteChar = quotes[style];
|
|
43288
43632
|
return quoteChar + s + quoteChar;
|
|
43289
43633
|
}
|
|
43290
43634
|
|
|
@@ -43442,8 +43786,10 @@ function inspectString(str, opts) {
|
|
|
43442
43786
|
var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
|
|
43443
43787
|
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
|
|
43444
43788
|
}
|
|
43789
|
+
var quoteRE = quoteREs[opts.quoteStyle || 'single'];
|
|
43790
|
+
quoteRE.lastIndex = 0;
|
|
43445
43791
|
// eslint-disable-next-line no-control-regex
|
|
43446
|
-
var s = $replace.call($replace.call(str,
|
|
43792
|
+
var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte);
|
|
43447
43793
|
return wrapQuotes(s, 'single', opts);
|
|
43448
43794
|
}
|
|
43449
43795
|
|