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