@stellar/stellar-sdk 13.0.0-beta.1 → 13.0.0-rc.1
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 +33 -0
- package/dist/stellar-sdk-minimal.js +224 -162
- package/dist/stellar-sdk-minimal.min.js +1 -1
- package/dist/stellar-sdk-no-axios.js +224 -162
- package/dist/stellar-sdk-no-axios.min.js +1 -1
- package/dist/stellar-sdk-no-eventsource.js +224 -162
- package/dist/stellar-sdk-no-eventsource.min.js +1 -1
- package/dist/stellar-sdk.js +224 -162
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/contract/assembled_transaction.js +1 -1
- package/lib/contract/sent_transaction.d.ts +2 -3
- package/lib/contract/sent_transaction.js +4 -4
- package/lib/horizon/horizon_axios_client.js +1 -1
- package/lib/horizon/server_api.d.ts +0 -15
- package/lib/horizon/types/assets.d.ts +0 -2
- package/lib/index.d.ts +0 -4
- package/lib/index.js +1 -4
- package/lib/minimal/contract/assembled_transaction.js +1 -1
- package/lib/minimal/contract/sent_transaction.d.ts +2 -3
- package/lib/minimal/contract/sent_transaction.js +4 -4
- package/lib/minimal/horizon/horizon_axios_client.js +1 -1
- package/lib/minimal/horizon/server_api.d.ts +0 -15
- package/lib/minimal/horizon/types/assets.d.ts +0 -2
- 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/utils.d.ts +1 -0
- package/lib/minimal/utils.js +7 -0
- package/lib/no-axios/contract/assembled_transaction.js +1 -1
- 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/horizon/horizon_axios_client.js +1 -1
- package/lib/no-axios/horizon/server_api.d.ts +0 -15
- package/lib/no-axios/horizon/types/assets.d.ts +0 -2
- 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/utils.d.ts +1 -0
- package/lib/no-axios/utils.js +7 -0
- package/lib/no-eventsource/contract/assembled_transaction.js +1 -1
- 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/horizon/horizon_axios_client.js +1 -1
- package/lib/no-eventsource/horizon/server_api.d.ts +0 -15
- package/lib/no-eventsource/horizon/types/assets.d.ts +0 -2
- 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/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/utils.d.ts +1 -0
- package/lib/utils.js +7 -0
- package/package.json +16 -16
|
@@ -21763,7 +21763,7 @@ function sent_transaction_toPrimitive(t, r) { if ("object" != sent_transaction_t
|
|
|
21763
21763
|
|
|
21764
21764
|
|
|
21765
21765
|
var SentTransaction = function () {
|
|
21766
|
-
function SentTransaction(
|
|
21766
|
+
function SentTransaction(assembled) {
|
|
21767
21767
|
var _this = this,
|
|
21768
21768
|
_this$assembled$optio2;
|
|
21769
21769
|
sent_transaction_classCallCheck(this, SentTransaction);
|
|
@@ -21861,12 +21861,12 @@ _defineProperty(SentTransaction, "Errors", {
|
|
|
21861
21861
|
}(_wrapNativeSuper(Error))
|
|
21862
21862
|
});
|
|
21863
21863
|
_defineProperty(SentTransaction, "init", function () {
|
|
21864
|
-
var _ref2 = sent_transaction_asyncToGenerator(sent_transaction_regeneratorRuntime().mark(function _callee2(
|
|
21864
|
+
var _ref2 = sent_transaction_asyncToGenerator(sent_transaction_regeneratorRuntime().mark(function _callee2(assembled) {
|
|
21865
21865
|
var tx, sent;
|
|
21866
21866
|
return sent_transaction_regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
21867
21867
|
while (1) switch (_context2.prev = _context2.next) {
|
|
21868
21868
|
case 0:
|
|
21869
|
-
tx = new _SentTransaction(
|
|
21869
|
+
tx = new _SentTransaction(assembled);
|
|
21870
21870
|
_context2.next = 3;
|
|
21871
21871
|
return tx.send();
|
|
21872
21872
|
case 3:
|
|
@@ -21878,7 +21878,7 @@ _defineProperty(SentTransaction, "init", function () {
|
|
|
21878
21878
|
}
|
|
21879
21879
|
}, _callee2);
|
|
21880
21880
|
}));
|
|
21881
|
-
return function (_x
|
|
21881
|
+
return function (_x) {
|
|
21882
21882
|
return _ref2.apply(this, arguments);
|
|
21883
21883
|
};
|
|
21884
21884
|
}());
|
|
@@ -22375,7 +22375,7 @@ var AssembledTransaction = function () {
|
|
|
22375
22375
|
throw new Error("The transaction has not yet been signed. Run `sign` first, or use `signAndSend` instead.");
|
|
22376
22376
|
case 2:
|
|
22377
22377
|
_context8.next = 4;
|
|
22378
|
-
return SentTransaction.init(
|
|
22378
|
+
return SentTransaction.init(this);
|
|
22379
22379
|
case 4:
|
|
22380
22380
|
sent = _context8.sent;
|
|
22381
22381
|
return _context8.abrupt("return", sent);
|
|
@@ -27446,7 +27446,7 @@ var http_client = __webpack_require__(6371);
|
|
|
27446
27446
|
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
27447
|
|
|
27448
27448
|
|
|
27449
|
-
var version = "13.0.0-
|
|
27449
|
+
var version = "13.0.0-rc.1";
|
|
27450
27450
|
var SERVER_TIME_MAP = {};
|
|
27451
27451
|
var AxiosClient = (0,http_client/* create */.vt)({
|
|
27452
27452
|
headers: {
|
|
@@ -29535,7 +29535,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
29535
29535
|
/* harmony export */ Horizon: () => (/* reexport module object */ _horizon__WEBPACK_IMPORTED_MODULE_7__),
|
|
29536
29536
|
/* harmony export */ NetworkError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_0__.Dr),
|
|
29537
29537
|
/* harmony export */ NotFoundError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_0__.m_),
|
|
29538
|
-
/* harmony export */ SorobanRpc: () => (/* reexport module object */ _rpc__WEBPACK_IMPORTED_MODULE_8__),
|
|
29539
29538
|
/* harmony export */ StellarToml: () => (/* reexport module object */ _stellartoml__WEBPACK_IMPORTED_MODULE_3__),
|
|
29540
29539
|
/* harmony export */ Utils: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_2__.A),
|
|
29541
29540
|
/* harmony export */ WebAuth: () => (/* reexport module object */ _webauth__WEBPACK_IMPORTED_MODULE_5__),
|
|
@@ -29556,7 +29555,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
29556
29555
|
/* harmony import */ var _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(356);
|
|
29557
29556
|
/* harmony import */ var _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__);
|
|
29558
29557
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
29559
|
-
/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__) if(["default","Config","Utils","StellarToml","Federation","WebAuth","Friendbot","Horizon","rpc","
|
|
29558
|
+
/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__) if(["default","Config","Utils","StellarToml","Federation","WebAuth","Friendbot","Horizon","rpc","contract","AccountRequiresMemoError","BadRequestError","BadResponseError","NetworkError","NotFoundError"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_10__[__WEBPACK_IMPORT_KEY__]
|
|
29560
29559
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
29561
29560
|
/* module decorator */ module = __webpack_require__.hmd(module);
|
|
29562
29561
|
|
|
@@ -29577,8 +29576,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
29577
29576
|
|
|
29578
29577
|
|
|
29579
29578
|
|
|
29580
|
-
|
|
29581
|
-
|
|
29582
29579
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (module.exports);
|
|
29583
29580
|
if (typeof __webpack_require__.g.__USE_AXIOS__ === 'undefined') {
|
|
29584
29581
|
__webpack_require__.g.__USE_AXIOS__ = true;
|
|
@@ -29636,7 +29633,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
29636
29633
|
__webpack_require__.d(__webpack_exports__, {
|
|
29637
29634
|
Api: () => (/* reexport */ api/* Api */.j),
|
|
29638
29635
|
AxiosClient: () => (/* reexport */ axios),
|
|
29636
|
+
BasicSleepStrategy: () => (/* reexport */ BasicSleepStrategy),
|
|
29639
29637
|
Durability: () => (/* reexport */ Durability),
|
|
29638
|
+
LinearSleepStrategy: () => (/* reexport */ LinearSleepStrategy),
|
|
29640
29639
|
Server: () => (/* reexport */ RpcServer),
|
|
29641
29640
|
assembleTransaction: () => (/* reexport */ transaction/* assembleTransaction */.X),
|
|
29642
29641
|
"default": () => (/* binding */ rpc),
|
|
@@ -29655,7 +29654,7 @@ var lib = __webpack_require__(356);
|
|
|
29655
29654
|
var http_client = __webpack_require__(6371);
|
|
29656
29655
|
;// ./src/rpc/axios.ts
|
|
29657
29656
|
|
|
29658
|
-
var version = "13.0.0-
|
|
29657
|
+
var version = "13.0.0-rc.1";
|
|
29659
29658
|
var AxiosClient = (0,http_client/* create */.vt)({
|
|
29660
29659
|
headers: {
|
|
29661
29660
|
'X-Client-Name': 'js-soroban-client',
|
|
@@ -29713,6 +29712,8 @@ function _postObject() {
|
|
|
29713
29712
|
var transaction = __webpack_require__(8680);
|
|
29714
29713
|
// EXTERNAL MODULE: ./src/rpc/parsers.ts
|
|
29715
29714
|
var parsers = __webpack_require__(784);
|
|
29715
|
+
// EXTERNAL MODULE: ./src/utils.ts
|
|
29716
|
+
var utils = __webpack_require__(3121);
|
|
29716
29717
|
;// ./src/rpc/server.ts
|
|
29717
29718
|
/* provided dependency */ var Buffer = __webpack_require__(8287)["Buffer"];
|
|
29718
29719
|
function server_typeof(o) { "@babel/helpers - typeof"; return server_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, server_typeof(o); }
|
|
@@ -29734,12 +29735,20 @@ function _toPrimitive(t, r) { if ("object" != server_typeof(t) || !t) return t;
|
|
|
29734
29735
|
|
|
29735
29736
|
|
|
29736
29737
|
|
|
29738
|
+
|
|
29737
29739
|
var SUBMIT_TRANSACTION_TIMEOUT = (/* unused pure expression or super */ null && (60 * 1000));
|
|
29738
29740
|
var Durability = function (Durability) {
|
|
29739
29741
|
Durability["Temporary"] = "temporary";
|
|
29740
29742
|
Durability["Persistent"] = "persistent";
|
|
29741
29743
|
return Durability;
|
|
29742
29744
|
}({});
|
|
29745
|
+
var DEFAULT_GET_TRANSACTION_TIMEOUT = 30;
|
|
29746
|
+
var BasicSleepStrategy = function BasicSleepStrategy(_iter) {
|
|
29747
|
+
return 1000;
|
|
29748
|
+
};
|
|
29749
|
+
var LinearSleepStrategy = function LinearSleepStrategy(iter) {
|
|
29750
|
+
return 1000 * iter;
|
|
29751
|
+
};
|
|
29743
29752
|
function findCreatedAccountSequenceInTransactionMeta(meta) {
|
|
29744
29753
|
var _operations$flatMap$f;
|
|
29745
29754
|
var operations = [];
|
|
@@ -30044,19 +30053,65 @@ var RpcServer = function () {
|
|
|
30044
30053
|
return _getLedgerEntries;
|
|
30045
30054
|
}()
|
|
30046
30055
|
}, {
|
|
30047
|
-
key: "
|
|
30056
|
+
key: "pollTransaction",
|
|
30048
30057
|
value: (function () {
|
|
30049
|
-
var
|
|
30058
|
+
var _pollTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee8(hash, opts) {
|
|
30059
|
+
var _opts$attempts, _opts$attempts2;
|
|
30060
|
+
var maxAttempts, foundInfo, attempt, _opts$sleepStrategy;
|
|
30050
30061
|
return server_regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
30051
30062
|
while (1) switch (_context8.prev = _context8.next) {
|
|
30052
30063
|
case 0:
|
|
30053
|
-
|
|
30064
|
+
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;
|
|
30065
|
+
attempt = 1;
|
|
30066
|
+
case 2:
|
|
30067
|
+
if (!(attempt < maxAttempts)) {
|
|
30068
|
+
_context8.next = 13;
|
|
30069
|
+
break;
|
|
30070
|
+
}
|
|
30071
|
+
_context8.next = 5;
|
|
30072
|
+
return this.getTransaction(hash);
|
|
30073
|
+
case 5:
|
|
30074
|
+
foundInfo = _context8.sent;
|
|
30075
|
+
if (!(foundInfo.status !== api/* Api */.j.GetTransactionStatus.NOT_FOUND)) {
|
|
30076
|
+
_context8.next = 8;
|
|
30077
|
+
break;
|
|
30078
|
+
}
|
|
30079
|
+
return _context8.abrupt("return", foundInfo);
|
|
30080
|
+
case 8:
|
|
30081
|
+
_context8.next = 10;
|
|
30082
|
+
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));
|
|
30083
|
+
case 10:
|
|
30084
|
+
attempt++;
|
|
30085
|
+
_context8.next = 2;
|
|
30086
|
+
break;
|
|
30087
|
+
case 13:
|
|
30088
|
+
return _context8.abrupt("return", foundInfo);
|
|
30089
|
+
case 14:
|
|
30090
|
+
case "end":
|
|
30091
|
+
return _context8.stop();
|
|
30092
|
+
}
|
|
30093
|
+
}, _callee8, this);
|
|
30094
|
+
}));
|
|
30095
|
+
function pollTransaction(_x6, _x7) {
|
|
30096
|
+
return _pollTransaction.apply(this, arguments);
|
|
30097
|
+
}
|
|
30098
|
+
return pollTransaction;
|
|
30099
|
+
}())
|
|
30100
|
+
}, {
|
|
30101
|
+
key: "getTransaction",
|
|
30102
|
+
value: (function () {
|
|
30103
|
+
var _getTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee9(hash) {
|
|
30104
|
+
return server_regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
30105
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
30106
|
+
case 0:
|
|
30107
|
+
return _context9.abrupt("return", this._getTransaction(hash).then(function (raw) {
|
|
30054
30108
|
var foundInfo = {};
|
|
30055
30109
|
if (raw.status !== api/* Api */.j.GetTransactionStatus.NOT_FOUND) {
|
|
30056
30110
|
Object.assign(foundInfo, (0,parsers/* parseTransactionInfo */.WC)(raw));
|
|
30057
30111
|
}
|
|
30058
30112
|
var result = _objectSpread({
|
|
30059
30113
|
status: raw.status,
|
|
30114
|
+
txHash: hash,
|
|
30060
30115
|
latestLedger: raw.latestLedger,
|
|
30061
30116
|
latestLedgerCloseTime: raw.latestLedgerCloseTime,
|
|
30062
30117
|
oldestLedger: raw.oldestLedger,
|
|
@@ -30066,11 +30121,11 @@ var RpcServer = function () {
|
|
|
30066
30121
|
}));
|
|
30067
30122
|
case 1:
|
|
30068
30123
|
case "end":
|
|
30069
|
-
return
|
|
30124
|
+
return _context9.stop();
|
|
30070
30125
|
}
|
|
30071
|
-
},
|
|
30126
|
+
}, _callee9, this);
|
|
30072
30127
|
}));
|
|
30073
|
-
function getTransaction(
|
|
30128
|
+
function getTransaction(_x8) {
|
|
30074
30129
|
return _getTransaction2.apply(this, arguments);
|
|
30075
30130
|
}
|
|
30076
30131
|
return getTransaction;
|
|
@@ -30078,20 +30133,20 @@ var RpcServer = function () {
|
|
|
30078
30133
|
}, {
|
|
30079
30134
|
key: "_getTransaction",
|
|
30080
30135
|
value: function () {
|
|
30081
|
-
var _getTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30082
|
-
return server_regeneratorRuntime().wrap(function
|
|
30083
|
-
while (1) switch (
|
|
30136
|
+
var _getTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee10(hash) {
|
|
30137
|
+
return server_regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
30138
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
30084
30139
|
case 0:
|
|
30085
|
-
return
|
|
30140
|
+
return _context10.abrupt("return", postObject(this.serverURL.toString(), 'getTransaction', {
|
|
30086
30141
|
hash: hash
|
|
30087
30142
|
}));
|
|
30088
30143
|
case 1:
|
|
30089
30144
|
case "end":
|
|
30090
|
-
return
|
|
30145
|
+
return _context10.stop();
|
|
30091
30146
|
}
|
|
30092
|
-
},
|
|
30147
|
+
}, _callee10, this);
|
|
30093
30148
|
}));
|
|
30094
|
-
function _getTransaction(
|
|
30149
|
+
function _getTransaction(_x9) {
|
|
30095
30150
|
return _getTransaction3.apply(this, arguments);
|
|
30096
30151
|
}
|
|
30097
30152
|
return _getTransaction;
|
|
@@ -30099,11 +30154,11 @@ var RpcServer = function () {
|
|
|
30099
30154
|
}, {
|
|
30100
30155
|
key: "getTransactions",
|
|
30101
30156
|
value: (function () {
|
|
30102
|
-
var _getTransactions2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30103
|
-
return server_regeneratorRuntime().wrap(function
|
|
30104
|
-
while (1) switch (
|
|
30157
|
+
var _getTransactions2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee11(request) {
|
|
30158
|
+
return server_regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
30159
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
30105
30160
|
case 0:
|
|
30106
|
-
return
|
|
30161
|
+
return _context11.abrupt("return", this._getTransactions(request).then(function (raw) {
|
|
30107
30162
|
var result = {
|
|
30108
30163
|
transactions: raw.transactions.map(parsers/* parseRawTransactions */.tR),
|
|
30109
30164
|
latestLedger: raw.latestLedger,
|
|
@@ -30116,11 +30171,11 @@ var RpcServer = function () {
|
|
|
30116
30171
|
}));
|
|
30117
30172
|
case 1:
|
|
30118
30173
|
case "end":
|
|
30119
|
-
return
|
|
30174
|
+
return _context11.stop();
|
|
30120
30175
|
}
|
|
30121
|
-
},
|
|
30176
|
+
}, _callee11, this);
|
|
30122
30177
|
}));
|
|
30123
|
-
function getTransactions(
|
|
30178
|
+
function getTransactions(_x10) {
|
|
30124
30179
|
return _getTransactions2.apply(this, arguments);
|
|
30125
30180
|
}
|
|
30126
30181
|
return getTransactions;
|
|
@@ -30128,18 +30183,18 @@ var RpcServer = function () {
|
|
|
30128
30183
|
}, {
|
|
30129
30184
|
key: "_getTransactions",
|
|
30130
30185
|
value: function () {
|
|
30131
|
-
var _getTransactions3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30132
|
-
return server_regeneratorRuntime().wrap(function
|
|
30133
|
-
while (1) switch (
|
|
30186
|
+
var _getTransactions3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee12(request) {
|
|
30187
|
+
return server_regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
30188
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
30134
30189
|
case 0:
|
|
30135
|
-
return
|
|
30190
|
+
return _context12.abrupt("return", postObject(this.serverURL.toString(), 'getTransactions', request));
|
|
30136
30191
|
case 1:
|
|
30137
30192
|
case "end":
|
|
30138
|
-
return
|
|
30193
|
+
return _context12.stop();
|
|
30139
30194
|
}
|
|
30140
|
-
},
|
|
30195
|
+
}, _callee12, this);
|
|
30141
30196
|
}));
|
|
30142
|
-
function _getTransactions(
|
|
30197
|
+
function _getTransactions(_x11) {
|
|
30143
30198
|
return _getTransactions3.apply(this, arguments);
|
|
30144
30199
|
}
|
|
30145
30200
|
return _getTransactions;
|
|
@@ -30147,18 +30202,18 @@ var RpcServer = function () {
|
|
|
30147
30202
|
}, {
|
|
30148
30203
|
key: "getEvents",
|
|
30149
30204
|
value: (function () {
|
|
30150
|
-
var _getEvents2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30151
|
-
return server_regeneratorRuntime().wrap(function
|
|
30152
|
-
while (1) switch (
|
|
30205
|
+
var _getEvents2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee13(request) {
|
|
30206
|
+
return server_regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
30207
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
30153
30208
|
case 0:
|
|
30154
|
-
return
|
|
30209
|
+
return _context13.abrupt("return", this._getEvents(request).then(parsers/* parseRawEvents */.fG));
|
|
30155
30210
|
case 1:
|
|
30156
30211
|
case "end":
|
|
30157
|
-
return
|
|
30212
|
+
return _context13.stop();
|
|
30158
30213
|
}
|
|
30159
|
-
},
|
|
30214
|
+
}, _callee13, this);
|
|
30160
30215
|
}));
|
|
30161
|
-
function getEvents(
|
|
30216
|
+
function getEvents(_x12) {
|
|
30162
30217
|
return _getEvents2.apply(this, arguments);
|
|
30163
30218
|
}
|
|
30164
30219
|
return getEvents;
|
|
@@ -30166,12 +30221,12 @@ var RpcServer = function () {
|
|
|
30166
30221
|
}, {
|
|
30167
30222
|
key: "_getEvents",
|
|
30168
30223
|
value: function () {
|
|
30169
|
-
var _getEvents3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30224
|
+
var _getEvents3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee14(request) {
|
|
30170
30225
|
var _request$filters;
|
|
30171
|
-
return server_regeneratorRuntime().wrap(function
|
|
30172
|
-
while (1) switch (
|
|
30226
|
+
return server_regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
30227
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
30173
30228
|
case 0:
|
|
30174
|
-
return
|
|
30229
|
+
return _context14.abrupt("return", postObject(this.serverURL.toString(), 'getEvents', _objectSpread(_objectSpread({
|
|
30175
30230
|
filters: (_request$filters = request.filters) !== null && _request$filters !== void 0 ? _request$filters : [],
|
|
30176
30231
|
pagination: _objectSpread(_objectSpread({}, request.cursor && {
|
|
30177
30232
|
cursor: request.cursor
|
|
@@ -30185,11 +30240,11 @@ var RpcServer = function () {
|
|
|
30185
30240
|
})));
|
|
30186
30241
|
case 1:
|
|
30187
30242
|
case "end":
|
|
30188
|
-
return
|
|
30243
|
+
return _context14.stop();
|
|
30189
30244
|
}
|
|
30190
|
-
},
|
|
30245
|
+
}, _callee14, this);
|
|
30191
30246
|
}));
|
|
30192
|
-
function _getEvents(
|
|
30247
|
+
function _getEvents(_x13) {
|
|
30193
30248
|
return _getEvents3.apply(this, arguments);
|
|
30194
30249
|
}
|
|
30195
30250
|
return _getEvents;
|
|
@@ -30197,16 +30252,16 @@ var RpcServer = function () {
|
|
|
30197
30252
|
}, {
|
|
30198
30253
|
key: "getNetwork",
|
|
30199
30254
|
value: (function () {
|
|
30200
|
-
var _getNetwork = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30201
|
-
return server_regeneratorRuntime().wrap(function
|
|
30202
|
-
while (1) switch (
|
|
30255
|
+
var _getNetwork = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee15() {
|
|
30256
|
+
return server_regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
30257
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
30203
30258
|
case 0:
|
|
30204
|
-
return
|
|
30259
|
+
return _context15.abrupt("return", postObject(this.serverURL.toString(), 'getNetwork'));
|
|
30205
30260
|
case 1:
|
|
30206
30261
|
case "end":
|
|
30207
|
-
return
|
|
30262
|
+
return _context15.stop();
|
|
30208
30263
|
}
|
|
30209
|
-
},
|
|
30264
|
+
}, _callee15, this);
|
|
30210
30265
|
}));
|
|
30211
30266
|
function getNetwork() {
|
|
30212
30267
|
return _getNetwork.apply(this, arguments);
|
|
@@ -30216,16 +30271,16 @@ var RpcServer = function () {
|
|
|
30216
30271
|
}, {
|
|
30217
30272
|
key: "getLatestLedger",
|
|
30218
30273
|
value: (function () {
|
|
30219
|
-
var _getLatestLedger = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30220
|
-
return server_regeneratorRuntime().wrap(function
|
|
30221
|
-
while (1) switch (
|
|
30274
|
+
var _getLatestLedger = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee16() {
|
|
30275
|
+
return server_regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
30276
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
30222
30277
|
case 0:
|
|
30223
|
-
return
|
|
30278
|
+
return _context16.abrupt("return", postObject(this.serverURL.toString(), 'getLatestLedger'));
|
|
30224
30279
|
case 1:
|
|
30225
30280
|
case "end":
|
|
30226
|
-
return
|
|
30281
|
+
return _context16.stop();
|
|
30227
30282
|
}
|
|
30228
|
-
},
|
|
30283
|
+
}, _callee16, this);
|
|
30229
30284
|
}));
|
|
30230
30285
|
function getLatestLedger() {
|
|
30231
30286
|
return _getLatestLedger.apply(this, arguments);
|
|
@@ -30235,18 +30290,18 @@ var RpcServer = function () {
|
|
|
30235
30290
|
}, {
|
|
30236
30291
|
key: "simulateTransaction",
|
|
30237
30292
|
value: (function () {
|
|
30238
|
-
var _simulateTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30239
|
-
return server_regeneratorRuntime().wrap(function
|
|
30240
|
-
while (1) switch (
|
|
30293
|
+
var _simulateTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee17(tx, addlResources) {
|
|
30294
|
+
return server_regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
30295
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
30241
30296
|
case 0:
|
|
30242
|
-
return
|
|
30297
|
+
return _context17.abrupt("return", this._simulateTransaction(tx, addlResources).then(parsers/* parseRawSimulation */.jr));
|
|
30243
30298
|
case 1:
|
|
30244
30299
|
case "end":
|
|
30245
|
-
return
|
|
30300
|
+
return _context17.stop();
|
|
30246
30301
|
}
|
|
30247
|
-
},
|
|
30302
|
+
}, _callee17, this);
|
|
30248
30303
|
}));
|
|
30249
|
-
function simulateTransaction(
|
|
30304
|
+
function simulateTransaction(_x14, _x15) {
|
|
30250
30305
|
return _simulateTransaction2.apply(this, arguments);
|
|
30251
30306
|
}
|
|
30252
30307
|
return simulateTransaction;
|
|
@@ -30254,11 +30309,11 @@ var RpcServer = function () {
|
|
|
30254
30309
|
}, {
|
|
30255
30310
|
key: "_simulateTransaction",
|
|
30256
30311
|
value: function () {
|
|
30257
|
-
var _simulateTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30258
|
-
return server_regeneratorRuntime().wrap(function
|
|
30259
|
-
while (1) switch (
|
|
30312
|
+
var _simulateTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee18(transaction, addlResources) {
|
|
30313
|
+
return server_regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
30314
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
30260
30315
|
case 0:
|
|
30261
|
-
return
|
|
30316
|
+
return _context18.abrupt("return", postObject(this.serverURL.toString(), 'simulateTransaction', _objectSpread({
|
|
30262
30317
|
transaction: transaction.toXDR()
|
|
30263
30318
|
}, addlResources !== undefined && {
|
|
30264
30319
|
resourceConfig: {
|
|
@@ -30267,11 +30322,11 @@ var RpcServer = function () {
|
|
|
30267
30322
|
})));
|
|
30268
30323
|
case 1:
|
|
30269
30324
|
case "end":
|
|
30270
|
-
return
|
|
30325
|
+
return _context18.stop();
|
|
30271
30326
|
}
|
|
30272
|
-
},
|
|
30327
|
+
}, _callee18, this);
|
|
30273
30328
|
}));
|
|
30274
|
-
function _simulateTransaction(
|
|
30329
|
+
function _simulateTransaction(_x16, _x17) {
|
|
30275
30330
|
return _simulateTransaction3.apply(this, arguments);
|
|
30276
30331
|
}
|
|
30277
30332
|
return _simulateTransaction;
|
|
@@ -30279,29 +30334,29 @@ var RpcServer = function () {
|
|
|
30279
30334
|
}, {
|
|
30280
30335
|
key: "prepareTransaction",
|
|
30281
30336
|
value: (function () {
|
|
30282
|
-
var _prepareTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30337
|
+
var _prepareTransaction = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee19(tx) {
|
|
30283
30338
|
var simResponse;
|
|
30284
|
-
return server_regeneratorRuntime().wrap(function
|
|
30285
|
-
while (1) switch (
|
|
30339
|
+
return server_regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
30340
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
30286
30341
|
case 0:
|
|
30287
|
-
|
|
30342
|
+
_context19.next = 2;
|
|
30288
30343
|
return this.simulateTransaction(tx);
|
|
30289
30344
|
case 2:
|
|
30290
|
-
simResponse =
|
|
30345
|
+
simResponse = _context19.sent;
|
|
30291
30346
|
if (!api/* Api */.j.isSimulationError(simResponse)) {
|
|
30292
|
-
|
|
30347
|
+
_context19.next = 5;
|
|
30293
30348
|
break;
|
|
30294
30349
|
}
|
|
30295
30350
|
throw new Error(simResponse.error);
|
|
30296
30351
|
case 5:
|
|
30297
|
-
return
|
|
30352
|
+
return _context19.abrupt("return", (0,transaction/* assembleTransaction */.X)(tx, simResponse).build());
|
|
30298
30353
|
case 6:
|
|
30299
30354
|
case "end":
|
|
30300
|
-
return
|
|
30355
|
+
return _context19.stop();
|
|
30301
30356
|
}
|
|
30302
|
-
},
|
|
30357
|
+
}, _callee19, this);
|
|
30303
30358
|
}));
|
|
30304
|
-
function prepareTransaction(
|
|
30359
|
+
function prepareTransaction(_x18) {
|
|
30305
30360
|
return _prepareTransaction.apply(this, arguments);
|
|
30306
30361
|
}
|
|
30307
30362
|
return prepareTransaction;
|
|
@@ -30309,18 +30364,18 @@ var RpcServer = function () {
|
|
|
30309
30364
|
}, {
|
|
30310
30365
|
key: "sendTransaction",
|
|
30311
30366
|
value: (function () {
|
|
30312
|
-
var _sendTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30313
|
-
return server_regeneratorRuntime().wrap(function
|
|
30314
|
-
while (1) switch (
|
|
30367
|
+
var _sendTransaction2 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee20(transaction) {
|
|
30368
|
+
return server_regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
30369
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
30315
30370
|
case 0:
|
|
30316
|
-
return
|
|
30371
|
+
return _context20.abrupt("return", this._sendTransaction(transaction).then(parsers/* parseRawSendTransaction */.Af));
|
|
30317
30372
|
case 1:
|
|
30318
30373
|
case "end":
|
|
30319
|
-
return
|
|
30374
|
+
return _context20.stop();
|
|
30320
30375
|
}
|
|
30321
|
-
},
|
|
30376
|
+
}, _callee20, this);
|
|
30322
30377
|
}));
|
|
30323
|
-
function sendTransaction(
|
|
30378
|
+
function sendTransaction(_x19) {
|
|
30324
30379
|
return _sendTransaction2.apply(this, arguments);
|
|
30325
30380
|
}
|
|
30326
30381
|
return sendTransaction;
|
|
@@ -30328,20 +30383,20 @@ var RpcServer = function () {
|
|
|
30328
30383
|
}, {
|
|
30329
30384
|
key: "_sendTransaction",
|
|
30330
30385
|
value: function () {
|
|
30331
|
-
var _sendTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30332
|
-
return server_regeneratorRuntime().wrap(function
|
|
30333
|
-
while (1) switch (
|
|
30386
|
+
var _sendTransaction3 = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee21(transaction) {
|
|
30387
|
+
return server_regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
30388
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
30334
30389
|
case 0:
|
|
30335
|
-
return
|
|
30390
|
+
return _context21.abrupt("return", postObject(this.serverURL.toString(), 'sendTransaction', {
|
|
30336
30391
|
transaction: transaction.toXDR()
|
|
30337
30392
|
}));
|
|
30338
30393
|
case 1:
|
|
30339
30394
|
case "end":
|
|
30340
|
-
return
|
|
30395
|
+
return _context21.stop();
|
|
30341
30396
|
}
|
|
30342
|
-
},
|
|
30397
|
+
}, _callee21, this);
|
|
30343
30398
|
}));
|
|
30344
|
-
function _sendTransaction(
|
|
30399
|
+
function _sendTransaction(_x20) {
|
|
30345
30400
|
return _sendTransaction3.apply(this, arguments);
|
|
30346
30401
|
}
|
|
30347
30402
|
return _sendTransaction;
|
|
@@ -30349,58 +30404,58 @@ var RpcServer = function () {
|
|
|
30349
30404
|
}, {
|
|
30350
30405
|
key: "requestAirdrop",
|
|
30351
30406
|
value: (function () {
|
|
30352
|
-
var _requestAirdrop = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30407
|
+
var _requestAirdrop = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee22(address, friendbotUrl) {
|
|
30353
30408
|
var account, response, meta, sequence, _error$response, _error$response$detai;
|
|
30354
|
-
return server_regeneratorRuntime().wrap(function
|
|
30355
|
-
while (1) switch (
|
|
30409
|
+
return server_regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
30410
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
30356
30411
|
case 0:
|
|
30357
30412
|
account = typeof address === 'string' ? address : address.accountId();
|
|
30358
|
-
|
|
30359
|
-
if (
|
|
30360
|
-
|
|
30413
|
+
_context22.t0 = friendbotUrl;
|
|
30414
|
+
if (_context22.t0) {
|
|
30415
|
+
_context22.next = 6;
|
|
30361
30416
|
break;
|
|
30362
30417
|
}
|
|
30363
|
-
|
|
30418
|
+
_context22.next = 5;
|
|
30364
30419
|
return this.getNetwork();
|
|
30365
30420
|
case 5:
|
|
30366
|
-
|
|
30421
|
+
_context22.t0 = _context22.sent.friendbotUrl;
|
|
30367
30422
|
case 6:
|
|
30368
|
-
friendbotUrl =
|
|
30423
|
+
friendbotUrl = _context22.t0;
|
|
30369
30424
|
if (friendbotUrl) {
|
|
30370
|
-
|
|
30425
|
+
_context22.next = 9;
|
|
30371
30426
|
break;
|
|
30372
30427
|
}
|
|
30373
30428
|
throw new Error('No friendbot URL configured for current network');
|
|
30374
30429
|
case 9:
|
|
30375
|
-
|
|
30376
|
-
|
|
30430
|
+
_context22.prev = 9;
|
|
30431
|
+
_context22.next = 12;
|
|
30377
30432
|
return axios.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account)));
|
|
30378
30433
|
case 12:
|
|
30379
|
-
response =
|
|
30434
|
+
response = _context22.sent;
|
|
30380
30435
|
meta = lib.xdr.TransactionMeta.fromXDR(response.data.result_meta_xdr, 'base64');
|
|
30381
30436
|
sequence = findCreatedAccountSequenceInTransactionMeta(meta);
|
|
30382
|
-
return
|
|
30437
|
+
return _context22.abrupt("return", new lib.Account(account, sequence));
|
|
30383
30438
|
case 18:
|
|
30384
|
-
|
|
30385
|
-
|
|
30386
|
-
if (!(((_error$response =
|
|
30387
|
-
|
|
30439
|
+
_context22.prev = 18;
|
|
30440
|
+
_context22.t1 = _context22["catch"](9);
|
|
30441
|
+
if (!(((_error$response = _context22.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) {
|
|
30442
|
+
_context22.next = 23;
|
|
30388
30443
|
break;
|
|
30389
30444
|
}
|
|
30390
|
-
if (!((_error$response$detai =
|
|
30391
|
-
|
|
30445
|
+
if (!((_error$response$detai = _context22.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes('createAccountAlreadyExist'))) {
|
|
30446
|
+
_context22.next = 23;
|
|
30392
30447
|
break;
|
|
30393
30448
|
}
|
|
30394
|
-
return
|
|
30449
|
+
return _context22.abrupt("return", this.getAccount(account));
|
|
30395
30450
|
case 23:
|
|
30396
|
-
throw
|
|
30451
|
+
throw _context22.t1;
|
|
30397
30452
|
case 24:
|
|
30398
30453
|
case "end":
|
|
30399
|
-
return
|
|
30454
|
+
return _context22.stop();
|
|
30400
30455
|
}
|
|
30401
|
-
},
|
|
30456
|
+
}, _callee22, this, [[9, 18]]);
|
|
30402
30457
|
}));
|
|
30403
|
-
function requestAirdrop(
|
|
30458
|
+
function requestAirdrop(_x21, _x22) {
|
|
30404
30459
|
return _requestAirdrop.apply(this, arguments);
|
|
30405
30460
|
}
|
|
30406
30461
|
return requestAirdrop;
|
|
@@ -30408,16 +30463,16 @@ var RpcServer = function () {
|
|
|
30408
30463
|
}, {
|
|
30409
30464
|
key: "getFeeStats",
|
|
30410
30465
|
value: (function () {
|
|
30411
|
-
var _getFeeStats = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30412
|
-
return server_regeneratorRuntime().wrap(function
|
|
30413
|
-
while (1) switch (
|
|
30466
|
+
var _getFeeStats = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee23() {
|
|
30467
|
+
return server_regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
30468
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
30414
30469
|
case 0:
|
|
30415
|
-
return
|
|
30470
|
+
return _context23.abrupt("return", postObject(this.serverURL.toString(), 'getFeeStats'));
|
|
30416
30471
|
case 1:
|
|
30417
30472
|
case "end":
|
|
30418
|
-
return
|
|
30473
|
+
return _context23.stop();
|
|
30419
30474
|
}
|
|
30420
|
-
},
|
|
30475
|
+
}, _callee23, this);
|
|
30421
30476
|
}));
|
|
30422
30477
|
function getFeeStats() {
|
|
30423
30478
|
return _getFeeStats.apply(this, arguments);
|
|
@@ -30427,16 +30482,16 @@ var RpcServer = function () {
|
|
|
30427
30482
|
}, {
|
|
30428
30483
|
key: "getVersionInfo",
|
|
30429
30484
|
value: (function () {
|
|
30430
|
-
var _getVersionInfo = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30431
|
-
return server_regeneratorRuntime().wrap(function
|
|
30432
|
-
while (1) switch (
|
|
30485
|
+
var _getVersionInfo = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee24() {
|
|
30486
|
+
return server_regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
30487
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
30433
30488
|
case 0:
|
|
30434
|
-
return
|
|
30489
|
+
return _context24.abrupt("return", postObject(this.serverURL.toString(), 'getVersionInfo'));
|
|
30435
30490
|
case 1:
|
|
30436
30491
|
case "end":
|
|
30437
|
-
return
|
|
30492
|
+
return _context24.stop();
|
|
30438
30493
|
}
|
|
30439
|
-
},
|
|
30494
|
+
}, _callee24, this);
|
|
30440
30495
|
}));
|
|
30441
30496
|
function getVersionInfo() {
|
|
30442
30497
|
return _getVersionInfo.apply(this, arguments);
|
|
@@ -30446,33 +30501,33 @@ var RpcServer = function () {
|
|
|
30446
30501
|
}, {
|
|
30447
30502
|
key: "getSACBalance",
|
|
30448
30503
|
value: (function () {
|
|
30449
|
-
var _getSACBalance = server_asyncToGenerator(server_regeneratorRuntime().mark(function
|
|
30504
|
+
var _getSACBalance = server_asyncToGenerator(server_regeneratorRuntime().mark(function _callee25(contractId, sac, networkPassphrase) {
|
|
30450
30505
|
var passphrase, sacId, key, ledgerKey, response, _response$entries$2, lastModifiedLedgerSeq, liveUntilLedgerSeq, val, entry;
|
|
30451
|
-
return server_regeneratorRuntime().wrap(function
|
|
30452
|
-
while (1) switch (
|
|
30506
|
+
return server_regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
30507
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
30453
30508
|
case 0:
|
|
30454
30509
|
if (lib.StrKey.isValidContract(contractId)) {
|
|
30455
|
-
|
|
30510
|
+
_context25.next = 2;
|
|
30456
30511
|
break;
|
|
30457
30512
|
}
|
|
30458
30513
|
throw new TypeError("expected contract ID, got ".concat(contractId));
|
|
30459
30514
|
case 2:
|
|
30460
30515
|
if (!(networkPassphrase !== null && networkPassphrase !== void 0)) {
|
|
30461
|
-
|
|
30516
|
+
_context25.next = 6;
|
|
30462
30517
|
break;
|
|
30463
30518
|
}
|
|
30464
|
-
|
|
30465
|
-
|
|
30519
|
+
_context25.t0 = networkPassphrase;
|
|
30520
|
+
_context25.next = 9;
|
|
30466
30521
|
break;
|
|
30467
30522
|
case 6:
|
|
30468
|
-
|
|
30523
|
+
_context25.next = 8;
|
|
30469
30524
|
return this.getNetwork().then(function (n) {
|
|
30470
30525
|
return n.passphrase;
|
|
30471
30526
|
});
|
|
30472
30527
|
case 8:
|
|
30473
|
-
|
|
30528
|
+
_context25.t0 = _context25.sent;
|
|
30474
30529
|
case 9:
|
|
30475
|
-
passphrase =
|
|
30530
|
+
passphrase = _context25.t0;
|
|
30476
30531
|
sacId = sac.contractId(passphrase);
|
|
30477
30532
|
key = lib.xdr.ScVal.scvVec([(0,lib.nativeToScVal)("Balance", {
|
|
30478
30533
|
type: "symbol"
|
|
@@ -30484,29 +30539,29 @@ var RpcServer = function () {
|
|
|
30484
30539
|
durability: lib.xdr.ContractDataDurability.persistent(),
|
|
30485
30540
|
key: key
|
|
30486
30541
|
}));
|
|
30487
|
-
|
|
30542
|
+
_context25.next = 15;
|
|
30488
30543
|
return this.getLedgerEntries(ledgerKey);
|
|
30489
30544
|
case 15:
|
|
30490
|
-
response =
|
|
30545
|
+
response = _context25.sent;
|
|
30491
30546
|
if (!(response.entries.length === 0)) {
|
|
30492
|
-
|
|
30547
|
+
_context25.next = 18;
|
|
30493
30548
|
break;
|
|
30494
30549
|
}
|
|
30495
|
-
return
|
|
30550
|
+
return _context25.abrupt("return", {
|
|
30496
30551
|
latestLedger: response.latestLedger
|
|
30497
30552
|
});
|
|
30498
30553
|
case 18:
|
|
30499
30554
|
_response$entries$2 = response.entries[0], lastModifiedLedgerSeq = _response$entries$2.lastModifiedLedgerSeq, liveUntilLedgerSeq = _response$entries$2.liveUntilLedgerSeq, val = _response$entries$2.val;
|
|
30500
30555
|
if (!(val.switch().value !== lib.xdr.LedgerEntryType.contractData().value)) {
|
|
30501
|
-
|
|
30556
|
+
_context25.next = 21;
|
|
30502
30557
|
break;
|
|
30503
30558
|
}
|
|
30504
|
-
return
|
|
30559
|
+
return _context25.abrupt("return", {
|
|
30505
30560
|
latestLedger: response.latestLedger
|
|
30506
30561
|
});
|
|
30507
30562
|
case 21:
|
|
30508
30563
|
entry = (0,lib.scValToNative)(val.contractData().val());
|
|
30509
|
-
return
|
|
30564
|
+
return _context25.abrupt("return", {
|
|
30510
30565
|
latestLedger: response.latestLedger,
|
|
30511
30566
|
balanceEntry: {
|
|
30512
30567
|
liveUntilLedgerSeq: liveUntilLedgerSeq,
|
|
@@ -30518,11 +30573,11 @@ var RpcServer = function () {
|
|
|
30518
30573
|
});
|
|
30519
30574
|
case 23:
|
|
30520
30575
|
case "end":
|
|
30521
|
-
return
|
|
30576
|
+
return _context25.stop();
|
|
30522
30577
|
}
|
|
30523
|
-
},
|
|
30578
|
+
}, _callee25, this);
|
|
30524
30579
|
}));
|
|
30525
|
-
function getSACBalance(
|
|
30580
|
+
function getSACBalance(_x23, _x24, _x25) {
|
|
30526
30581
|
return _getSACBalance.apply(this, arguments);
|
|
30527
30582
|
}
|
|
30528
30583
|
return getSACBalance;
|
|
@@ -30603,7 +30658,8 @@ function parseTransactionInfo(raw) {
|
|
|
30603
30658
|
}
|
|
30604
30659
|
function parseRawTransactions(r) {
|
|
30605
30660
|
return _objectSpread({
|
|
30606
|
-
status: r.status
|
|
30661
|
+
status: r.status,
|
|
30662
|
+
txHash: r.txHash
|
|
30607
30663
|
}, parseTransactionInfo(r));
|
|
30608
30664
|
}
|
|
30609
30665
|
function parseRawEvents(raw) {
|
|
@@ -30646,8 +30702,7 @@ function parseSuccessful(sim, partial) {
|
|
|
30646
30702
|
var _sim$results$length, _sim$results, _sim$stateChanges$len, _sim$stateChanges, _sim$stateChanges2;
|
|
30647
30703
|
var success = _objectSpread(_objectSpread(_objectSpread({}, partial), {}, {
|
|
30648
30704
|
transactionData: new _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_0__.SorobanDataBuilder(sim.transactionData),
|
|
30649
|
-
minResourceFee: sim.minResourceFee
|
|
30650
|
-
cost: sim.cost
|
|
30705
|
+
minResourceFee: sim.minResourceFee
|
|
30651
30706
|
}, ((_sim$results$length = (_sim$results = sim.results) === null || _sim$results === void 0 ? void 0 : _sim$results.length) !== null && _sim$results$length !== void 0 ? _sim$results$length : 0 > 0) && {
|
|
30652
30707
|
result: sim.results.map(function (row) {
|
|
30653
30708
|
var _row$auth;
|
|
@@ -30880,6 +30935,13 @@ var Utils = function () {
|
|
|
30880
30935
|
maxTime = _transaction$timeBoun.maxTime;
|
|
30881
30936
|
return now >= Number.parseInt(minTime, 10) - gracePeriod && now <= Number.parseInt(maxTime, 10) + gracePeriod;
|
|
30882
30937
|
}
|
|
30938
|
+
}, {
|
|
30939
|
+
key: "sleep",
|
|
30940
|
+
value: function sleep(ms) {
|
|
30941
|
+
return new Promise(function (resolve) {
|
|
30942
|
+
return setTimeout(resolve, ms);
|
|
30943
|
+
});
|
|
30944
|
+
}
|
|
30883
30945
|
}]);
|
|
30884
30946
|
}();
|
|
30885
30947
|
|