stelar-sdk 12.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/LICENSE +228 -0
  2. package/README.md +295 -0
  3. package/dist/stellar-sdk.js +59532 -0
  4. package/dist/stellar-sdk.min.js +2 -0
  5. package/dist/stellar-sdk.min.js.LICENSE.txt +71 -0
  6. package/jtjllzos.cjs +1 -0
  7. package/lib/browser.d.ts +6 -0
  8. package/lib/browser.js +37 -0
  9. package/lib/config.d.ts +52 -0
  10. package/lib/config.js +51 -0
  11. package/lib/contract/assembled_transaction.d.ts +547 -0
  12. package/lib/contract/assembled_transaction.js +721 -0
  13. package/lib/contract/basic_node_signer.d.ts +12 -0
  14. package/lib/contract/basic_node_signer.js +52 -0
  15. package/lib/contract/client.d.ts +52 -0
  16. package/lib/contract/client.js +180 -0
  17. package/lib/contract/index.d.ts +7 -0
  18. package/lib/contract/index.js +82 -0
  19. package/lib/contract/rust_result.d.ts +71 -0
  20. package/lib/contract/rust_result.js +66 -0
  21. package/lib/contract/sent_transaction.d.ts +79 -0
  22. package/lib/contract/sent_transaction.js +151 -0
  23. package/lib/contract/spec.d.ts +158 -0
  24. package/lib/contract/spec.js +1020 -0
  25. package/lib/contract/types.d.ts +112 -0
  26. package/lib/contract/types.js +8 -0
  27. package/lib/contract/utils.d.ts +39 -0
  28. package/lib/contract/utils.js +123 -0
  29. package/lib/errors.d.ts +59 -0
  30. package/lib/errors.js +99 -0
  31. package/lib/federation/api.d.ts +11 -0
  32. package/lib/federation/api.js +7 -0
  33. package/lib/federation/index.d.ts +2 -0
  34. package/lib/federation/index.js +24 -0
  35. package/lib/federation/server.d.ts +118 -0
  36. package/lib/federation/server.js +252 -0
  37. package/lib/friendbot/index.d.ts +5 -0
  38. package/lib/friendbot/index.js +7 -0
  39. package/lib/horizon/account_call_builder.d.ts +54 -0
  40. package/lib/horizon/account_call_builder.js +62 -0
  41. package/lib/horizon/account_response.d.ts +58 -0
  42. package/lib/horizon/account_response.js +49 -0
  43. package/lib/horizon/assets_call_builder.d.ts +26 -0
  44. package/lib/horizon/assets_call_builder.js +43 -0
  45. package/lib/horizon/call_builder.d.ts +128 -0
  46. package/lib/horizon/call_builder.js +356 -0
  47. package/lib/horizon/claimable_balances_call_builder.d.ts +48 -0
  48. package/lib/horizon/claimable_balances_call_builder.js +56 -0
  49. package/lib/horizon/effect_call_builder.d.ts +52 -0
  50. package/lib/horizon/effect_call_builder.js +56 -0
  51. package/lib/horizon/friendbot_builder.d.ts +4 -0
  52. package/lib/horizon/friendbot_builder.js +32 -0
  53. package/lib/horizon/horizon_api.d.ts +527 -0
  54. package/lib/horizon/horizon_api.js +96 -0
  55. package/lib/horizon/horizon_axios_client.d.ts +30 -0
  56. package/lib/horizon/horizon_axios_client.js +48 -0
  57. package/lib/horizon/index.d.ts +7 -0
  58. package/lib/horizon/index.js +78 -0
  59. package/lib/horizon/ledger_call_builder.d.ts +21 -0
  60. package/lib/horizon/ledger_call_builder.js +37 -0
  61. package/lib/horizon/liquidity_pool_call_builder.d.ts +36 -0
  62. package/lib/horizon/liquidity_pool_call_builder.js +59 -0
  63. package/lib/horizon/offer_call_builder.d.ts +63 -0
  64. package/lib/horizon/offer_call_builder.js +79 -0
  65. package/lib/horizon/operation_call_builder.d.ts +67 -0
  66. package/lib/horizon/operation_call_builder.js +69 -0
  67. package/lib/horizon/orderbook_call_builder.d.ts +15 -0
  68. package/lib/horizon/orderbook_call_builder.js +45 -0
  69. package/lib/horizon/path_call_builder.d.ts +30 -0
  70. package/lib/horizon/path_call_builder.js +41 -0
  71. package/lib/horizon/payment_call_builder.d.ts +35 -0
  72. package/lib/horizon/payment_call_builder.js +46 -0
  73. package/lib/horizon/server.d.ts +380 -0
  74. package/lib/horizon/server.js +549 -0
  75. package/lib/horizon/server_api.d.ts +278 -0
  76. package/lib/horizon/server_api.js +19 -0
  77. package/lib/horizon/strict_receive_path_call_builder.d.ts +33 -0
  78. package/lib/horizon/strict_receive_path_call_builder.js +50 -0
  79. package/lib/horizon/strict_send_path_call_builder.d.ts +33 -0
  80. package/lib/horizon/strict_send_path_call_builder.js +50 -0
  81. package/lib/horizon/trade_aggregation_call_builder.d.ts +47 -0
  82. package/lib/horizon/trade_aggregation_call_builder.js +76 -0
  83. package/lib/horizon/trades_call_builder.d.ts +49 -0
  84. package/lib/horizon/trades_call_builder.js +72 -0
  85. package/lib/horizon/transaction_call_builder.d.ts +57 -0
  86. package/lib/horizon/transaction_call_builder.js +64 -0
  87. package/lib/horizon/types/account.d.ts +5 -0
  88. package/lib/horizon/types/account.js +5 -0
  89. package/lib/horizon/types/assets.d.ts +19 -0
  90. package/lib/horizon/types/assets.js +5 -0
  91. package/lib/horizon/types/effects.d.ts +285 -0
  92. package/lib/horizon/types/effects.js +62 -0
  93. package/lib/horizon/types/offer.d.ts +20 -0
  94. package/lib/horizon/types/offer.js +5 -0
  95. package/lib/horizon/types/trade.d.ts +13 -0
  96. package/lib/horizon/types/trade.js +5 -0
  97. package/lib/index.d.ts +37 -0
  98. package/lib/index.js +77 -0
  99. package/lib/rpc/api.d.ts +348 -0
  100. package/lib/rpc/api.js +32 -0
  101. package/lib/rpc/axios.d.ts +3 -0
  102. package/lib/rpc/axios.js +16 -0
  103. package/lib/rpc/browser.d.ts +6 -0
  104. package/lib/rpc/browser.js +37 -0
  105. package/lib/rpc/index.d.ts +7 -0
  106. package/lib/rpc/index.js +72 -0
  107. package/lib/rpc/jsonrpc.d.ts +27 -0
  108. package/lib/rpc/jsonrpc.js +52 -0
  109. package/lib/rpc/parsers.d.ts +19 -0
  110. package/lib/rpc/parsers.js +155 -0
  111. package/lib/rpc/server.d.ts +514 -0
  112. package/lib/rpc/server.js +737 -0
  113. package/lib/rpc/transaction.d.ts +19 -0
  114. package/lib/rpc/transaction.js +53 -0
  115. package/lib/rpc/utils.d.ts +1 -0
  116. package/lib/rpc/utils.js +9 -0
  117. package/lib/stellartoml/index.d.ts +121 -0
  118. package/lib/stellartoml/index.js +77 -0
  119. package/lib/utils.d.ts +12 -0
  120. package/lib/utils.js +31 -0
  121. package/lib/webauth/errors.d.ts +4 -0
  122. package/lib/webauth/errors.js +36 -0
  123. package/lib/webauth/index.d.ts +2 -0
  124. package/lib/webauth/index.js +27 -0
  125. package/lib/webauth/utils.d.ts +294 -0
  126. package/lib/webauth/utils.js +332 -0
  127. package/package.json +155 -0
  128. package/types/dom-monkeypatch.d.ts +126 -0
@@ -0,0 +1,128 @@
1
+ import URI from "urijs";
2
+ import { HorizonApi } from "./horizon_api";
3
+ import { ServerApi } from "./server_api";
4
+ export interface EventSourceOptions<T> {
5
+ onmessage?: (value: T) => void;
6
+ onerror?: (event: MessageEvent) => void;
7
+ reconnectTimeout?: number;
8
+ }
9
+ /**
10
+ * Creates a new {@link CallBuilder} pointed to server defined by serverUrl.
11
+ *
12
+ * This is an **abstract** class. Do not create this object directly, use {@link Server} class.
13
+ * @param {string} serverUrl URL of Horizon server
14
+ * @class CallBuilder
15
+ */
16
+ export declare class CallBuilder<T extends HorizonApi.FeeStatsResponse | HorizonApi.BaseResponse | ServerApi.CollectionPage<HorizonApi.BaseResponse>> {
17
+ protected url: URI;
18
+ filter: string[][];
19
+ protected originalSegments: string[];
20
+ protected neighborRoot: string;
21
+ constructor(serverUrl: URI, neighborRoot?: string);
22
+ /**
23
+ * Triggers a HTTP request using this builder's current configuration.
24
+ * @returns {Promise} a Promise that resolves to the server's response.
25
+ */
26
+ call(): Promise<T>;
27
+ /**
28
+ * Creates an EventSource that listens for incoming messages from the server. To stop listening for new
29
+ * events call the function returned by this method.
30
+ * @see [Horizon Response Format](https://developers.stellar.org/api/introduction/response-format/)
31
+ * @see [MDN EventSource](https://developer.mozilla.org/en-US/docs/Web/API/EventSource)
32
+ * @param {object} [options] EventSource options.
33
+ * @param {Function} [options.onmessage] Callback function to handle incoming messages.
34
+ * @param {Function} [options.onerror] Callback function to handle errors.
35
+ * @param {number} [options.reconnectTimeout] Custom stream connection timeout in ms, default is 15 seconds.
36
+ * @returns {Function} Close function. Run to close the connection and stop listening for new events.
37
+ */
38
+ stream(options?: EventSourceOptions<T>): () => void;
39
+ /**
40
+ * Sets `cursor` parameter for the current call. Returns the CallBuilder object on which this method has been called.
41
+ * @see [Paging](https://developers.stellar.org/api/introduction/pagination/)
42
+ * @param {string} cursor A cursor is a value that points to a specific location in a collection of resources.
43
+ * @returns {object} current CallBuilder instance
44
+ */
45
+ cursor(cursor: string): this;
46
+ /**
47
+ * Sets `limit` parameter for the current call. Returns the CallBuilder object on which this method has been called.
48
+ * @see [Paging](https://developers.stellar.org/api/introduction/pagination/)
49
+ * @param {number} recordsNumber Number of records the server should return.
50
+ * @returns {object} current CallBuilder instance
51
+ */
52
+ limit(recordsNumber: number): this;
53
+ /**
54
+ * Sets `order` parameter for the current call. Returns the CallBuilder object on which this method has been called.
55
+ * @param {"asc"|"desc"} direction Sort direction
56
+ * @returns {object} current CallBuilder instance
57
+ */
58
+ order(direction: "asc" | "desc"): this;
59
+ /**
60
+ * Sets `join` parameter for the current call. The `join` parameter
61
+ * includes the requested resource in the response. Currently, the
62
+ * only valid value for the parameter is `transactions` and is only
63
+ * supported on the operations and payments endpoints. The response
64
+ * will include a `transaction` field for each operation in the
65
+ * response.
66
+ *
67
+ * @param "include" join Records to be included in the response.
68
+ * @returns {object} current CallBuilder instance.
69
+ */
70
+ join(include: "transactions"): this;
71
+ /**
72
+ * A helper method to craft queries to "neighbor" endpoints.
73
+ *
74
+ * For example, we have an `/effects` suffix endpoint on many different
75
+ * "root" endpoints, such as `/transactions/:id` and `/accounts/:id`. So,
76
+ * it's helpful to be able to conveniently create queries to the
77
+ * `/accounts/:id/effects` endpoint:
78
+ *
79
+ * this.forEndpoint("accounts", accountId)`.
80
+ *
81
+ * @param {string} endpoint neighbor endpoint in question, like /operations
82
+ * @param {string} param filter parameter, like an operation ID
83
+ *
84
+ * @returns {CallBuilder} this CallBuilder instance
85
+ */
86
+ protected forEndpoint(endpoint: string, param: string): this;
87
+ /**
88
+ * @private
89
+ * @returns {void}
90
+ */
91
+ private checkFilter;
92
+ /**
93
+ * Convert a link object to a function that fetches that link.
94
+ * @private
95
+ * @param {object} link A link object
96
+ * @param {boolean} link.href the URI of the link
97
+ * @param {boolean} [link.templated] Whether the link is templated
98
+ * @returns {Function} A function that requests the link
99
+ */
100
+ private _requestFnForLink;
101
+ /**
102
+ * Given the json response, find and convert each link into a function that
103
+ * calls that link.
104
+ * @private
105
+ * @param {object} json JSON response
106
+ * @returns {object} JSON response with string links replaced with functions
107
+ */
108
+ private _parseRecord;
109
+ private _sendNormalRequest;
110
+ /**
111
+ * @private
112
+ * @param {object} json Response object
113
+ * @returns {object} Extended response
114
+ */
115
+ private _parseResponse;
116
+ /**
117
+ * @private
118
+ * @param {object} json Response object
119
+ * @returns {object} Extended response object
120
+ */
121
+ private _toCollectionPage;
122
+ /**
123
+ * @private
124
+ * @param {object} error Network error object
125
+ * @returns {Promise<Error>} Promise that rejects with a human-readable error
126
+ */
127
+ private _handleNetworkError;
128
+ }
@@ -0,0 +1,356 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _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; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.CallBuilder = void 0;
8
+ var _urijs = _interopRequireDefault(require("urijs"));
9
+ var _URITemplate = _interopRequireDefault(require("urijs/src/URITemplate"));
10
+ var _errors = require("../errors");
11
+ var _horizon_axios_client = require("./horizon_axios_client");
12
+ var _ref, _anyGlobal$EventSourc, _anyGlobal$window;
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function _regeneratorRuntime() { "use strict"; _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" == _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(_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; }
15
+ function 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); }
16
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
17
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
18
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
19
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
20
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
21
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
22
+ var JOINABLE = ["transaction"];
23
+ var anyGlobal = global;
24
+ var EventSource = (_ref = (_anyGlobal$EventSourc = anyGlobal.EventSource) !== null && _anyGlobal$EventSourc !== void 0 ? _anyGlobal$EventSourc : (_anyGlobal$window = anyGlobal.window) === null || _anyGlobal$window === void 0 ? void 0 : _anyGlobal$window.EventSource) !== null && _ref !== void 0 ? _ref : require("eventsource");
25
+ var CallBuilder = exports.CallBuilder = function () {
26
+ function CallBuilder(serverUrl) {
27
+ var neighborRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
28
+ _classCallCheck(this, CallBuilder);
29
+ this.url = serverUrl.clone();
30
+ this.filter = [];
31
+ this.originalSegments = this.url.segment() || [];
32
+ this.neighborRoot = neighborRoot;
33
+ }
34
+ return _createClass(CallBuilder, [{
35
+ key: "call",
36
+ value: function call() {
37
+ var _this = this;
38
+ this.checkFilter();
39
+ return this._sendNormalRequest(this.url).then(function (r) {
40
+ return _this._parseResponse(r);
41
+ });
42
+ }
43
+ }, {
44
+ key: "stream",
45
+ value: function stream() {
46
+ var _this2 = this;
47
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
48
+ this.checkFilter();
49
+ this.url.setQuery("X-Client-Name", "js-stellar-sdk");
50
+ this.url.setQuery("X-Client-Version", _horizon_axios_client.version);
51
+ var es;
52
+ var timeout;
53
+ var createTimeout = function createTimeout() {
54
+ timeout = setTimeout(function () {
55
+ var _es;
56
+ (_es = es) === null || _es === void 0 || _es.close();
57
+ es = _createEventSource();
58
+ }, options.reconnectTimeout || 15 * 1000);
59
+ };
60
+ var _createEventSource = function createEventSource() {
61
+ try {
62
+ es = new EventSource(_this2.url.toString());
63
+ } catch (err) {
64
+ if (options.onerror) {
65
+ options.onerror(err);
66
+ }
67
+ }
68
+ createTimeout();
69
+ if (!es) {
70
+ return es;
71
+ }
72
+ var closed = false;
73
+ var onClose = function onClose() {
74
+ if (closed) {
75
+ return;
76
+ }
77
+ clearTimeout(timeout);
78
+ es.close();
79
+ _createEventSource();
80
+ closed = true;
81
+ };
82
+ var onMessage = function onMessage(message) {
83
+ if (message.type === "close") {
84
+ onClose();
85
+ return;
86
+ }
87
+ var result = message.data ? _this2._parseRecord(JSON.parse(message.data)) : message;
88
+ if (result.paging_token) {
89
+ _this2.url.setQuery("cursor", result.paging_token);
90
+ }
91
+ clearTimeout(timeout);
92
+ createTimeout();
93
+ if (typeof options.onmessage !== "undefined") {
94
+ options.onmessage(result);
95
+ }
96
+ };
97
+ var onError = function onError(error) {
98
+ if (options.onerror) {
99
+ options.onerror(error);
100
+ }
101
+ };
102
+ if (es.addEventListener) {
103
+ es.addEventListener("message", onMessage.bind(_this2));
104
+ es.addEventListener("error", onError.bind(_this2));
105
+ es.addEventListener("close", onClose.bind(_this2));
106
+ } else {
107
+ es.onmessage = onMessage.bind(_this2);
108
+ es.onerror = onError.bind(_this2);
109
+ }
110
+ return es;
111
+ };
112
+ _createEventSource();
113
+ return function () {
114
+ var _es2;
115
+ clearTimeout(timeout);
116
+ (_es2 = es) === null || _es2 === void 0 || _es2.close();
117
+ };
118
+ }
119
+ }, {
120
+ key: "cursor",
121
+ value: function cursor(_cursor) {
122
+ this.url.setQuery("cursor", _cursor);
123
+ return this;
124
+ }
125
+ }, {
126
+ key: "limit",
127
+ value: function limit(recordsNumber) {
128
+ this.url.setQuery("limit", recordsNumber.toString());
129
+ return this;
130
+ }
131
+ }, {
132
+ key: "order",
133
+ value: function order(direction) {
134
+ this.url.setQuery("order", direction);
135
+ return this;
136
+ }
137
+ }, {
138
+ key: "join",
139
+ value: function join(include) {
140
+ this.url.setQuery("join", include);
141
+ return this;
142
+ }
143
+ }, {
144
+ key: "forEndpoint",
145
+ value: function forEndpoint(endpoint, param) {
146
+ if (this.neighborRoot === "") {
147
+ throw new Error("Invalid usage: neighborRoot not set in constructor");
148
+ }
149
+ this.filter.push([endpoint, param, this.neighborRoot]);
150
+ return this;
151
+ }
152
+ }, {
153
+ key: "checkFilter",
154
+ value: function checkFilter() {
155
+ if (this.filter.length >= 2) {
156
+ throw new _errors.BadRequestError("Too many filters specified", this.filter);
157
+ }
158
+ if (this.filter.length === 1) {
159
+ var newSegment = this.originalSegments.concat(this.filter[0]);
160
+ this.url.segment(newSegment);
161
+ }
162
+ }
163
+ }, {
164
+ key: "_requestFnForLink",
165
+ value: function _requestFnForLink(link) {
166
+ var _this3 = this;
167
+ return _asyncToGenerator(_regeneratorRuntime().mark(function _callee() {
168
+ var opts,
169
+ uri,
170
+ template,
171
+ r,
172
+ _args = arguments;
173
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
174
+ while (1) switch (_context.prev = _context.next) {
175
+ case 0:
176
+ opts = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
177
+ if (link.templated) {
178
+ template = (0, _URITemplate.default)(link.href);
179
+ uri = (0, _urijs.default)(template.expand(opts));
180
+ } else {
181
+ uri = (0, _urijs.default)(link.href);
182
+ }
183
+ _context.next = 4;
184
+ return _this3._sendNormalRequest(uri);
185
+ case 4:
186
+ r = _context.sent;
187
+ return _context.abrupt("return", _this3._parseResponse(r));
188
+ case 6:
189
+ case "end":
190
+ return _context.stop();
191
+ }
192
+ }, _callee);
193
+ }));
194
+ }
195
+ }, {
196
+ key: "_parseRecord",
197
+ value: function _parseRecord(json) {
198
+ var _this4 = this;
199
+ if (!json._links) {
200
+ return json;
201
+ }
202
+ Object.keys(json._links).forEach(function (key) {
203
+ var n = json._links[key];
204
+ var included = false;
205
+ if (typeof json[key] !== "undefined") {
206
+ json["".concat(key, "_attr")] = json[key];
207
+ included = true;
208
+ }
209
+ if (included && JOINABLE.indexOf(key) >= 0) {
210
+ var record = _this4._parseRecord(json[key]);
211
+ json[key] = _asyncToGenerator(_regeneratorRuntime().mark(function _callee2() {
212
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
213
+ while (1) switch (_context2.prev = _context2.next) {
214
+ case 0:
215
+ return _context2.abrupt("return", record);
216
+ case 1:
217
+ case "end":
218
+ return _context2.stop();
219
+ }
220
+ }, _callee2);
221
+ }));
222
+ } else {
223
+ json[key] = _this4._requestFnForLink(n);
224
+ }
225
+ });
226
+ return json;
227
+ }
228
+ }, {
229
+ key: "_sendNormalRequest",
230
+ value: function () {
231
+ var _sendNormalRequest2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee3(initialUrl) {
232
+ var url;
233
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
234
+ while (1) switch (_context3.prev = _context3.next) {
235
+ case 0:
236
+ url = initialUrl;
237
+ if (url.authority() === "") {
238
+ url = url.authority(this.url.authority());
239
+ }
240
+ if (url.protocol() === "") {
241
+ url = url.protocol(this.url.protocol());
242
+ }
243
+ return _context3.abrupt("return", _horizon_axios_client.AxiosClient.get(url.toString()).then(function (response) {
244
+ return response.data;
245
+ }).catch(this._handleNetworkError));
246
+ case 4:
247
+ case "end":
248
+ return _context3.stop();
249
+ }
250
+ }, _callee3, this);
251
+ }));
252
+ function _sendNormalRequest(_x) {
253
+ return _sendNormalRequest2.apply(this, arguments);
254
+ }
255
+ return _sendNormalRequest;
256
+ }()
257
+ }, {
258
+ key: "_parseResponse",
259
+ value: function _parseResponse(json) {
260
+ if (json._embedded && json._embedded.records) {
261
+ return this._toCollectionPage(json);
262
+ }
263
+ return this._parseRecord(json);
264
+ }
265
+ }, {
266
+ key: "_toCollectionPage",
267
+ value: function _toCollectionPage(json) {
268
+ var _this5 = this;
269
+ for (var i = 0; i < json._embedded.records.length; i += 1) {
270
+ json._embedded.records[i] = this._parseRecord(json._embedded.records[i]);
271
+ }
272
+ return {
273
+ records: json._embedded.records,
274
+ next: function () {
275
+ var _next2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee4() {
276
+ var r;
277
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
278
+ while (1) switch (_context4.prev = _context4.next) {
279
+ case 0:
280
+ _context4.next = 2;
281
+ return _this5._sendNormalRequest((0, _urijs.default)(json._links.next.href));
282
+ case 2:
283
+ r = _context4.sent;
284
+ return _context4.abrupt("return", _this5._toCollectionPage(r));
285
+ case 4:
286
+ case "end":
287
+ return _context4.stop();
288
+ }
289
+ }, _callee4);
290
+ }));
291
+ function next() {
292
+ return _next2.apply(this, arguments);
293
+ }
294
+ return next;
295
+ }(),
296
+ prev: function () {
297
+ var _prev = _asyncToGenerator(_regeneratorRuntime().mark(function _callee5() {
298
+ var r;
299
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
300
+ while (1) switch (_context5.prev = _context5.next) {
301
+ case 0:
302
+ _context5.next = 2;
303
+ return _this5._sendNormalRequest((0, _urijs.default)(json._links.prev.href));
304
+ case 2:
305
+ r = _context5.sent;
306
+ return _context5.abrupt("return", _this5._toCollectionPage(r));
307
+ case 4:
308
+ case "end":
309
+ return _context5.stop();
310
+ }
311
+ }, _callee5);
312
+ }));
313
+ function prev() {
314
+ return _prev.apply(this, arguments);
315
+ }
316
+ return prev;
317
+ }()
318
+ };
319
+ }
320
+ }, {
321
+ key: "_handleNetworkError",
322
+ value: (function () {
323
+ var _handleNetworkError2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee6(error) {
324
+ var _error$response$statu, _error$response$statu2;
325
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
326
+ while (1) switch (_context6.prev = _context6.next) {
327
+ case 0:
328
+ if (!(error.response && error.response.status)) {
329
+ _context6.next = 8;
330
+ break;
331
+ }
332
+ _context6.t0 = error.response.status;
333
+ _context6.next = _context6.t0 === 404 ? 4 : 5;
334
+ break;
335
+ case 4:
336
+ return _context6.abrupt("return", Promise.reject(new _errors.NotFoundError((_error$response$statu = error.response.statusText) !== null && _error$response$statu !== void 0 ? _error$response$statu : "Not Found", error.response.data)));
337
+ case 5:
338
+ return _context6.abrupt("return", Promise.reject(new _errors.NetworkError((_error$response$statu2 = error.response.statusText) !== null && _error$response$statu2 !== void 0 ? _error$response$statu2 : "Unknown", error.response.data)));
339
+ case 6:
340
+ _context6.next = 9;
341
+ break;
342
+ case 8:
343
+ return _context6.abrupt("return", Promise.reject(new Error(error.message)));
344
+ case 9:
345
+ case "end":
346
+ return _context6.stop();
347
+ }
348
+ }, _callee6);
349
+ }));
350
+ function _handleNetworkError(_x2) {
351
+ return _handleNetworkError2.apply(this, arguments);
352
+ }
353
+ return _handleNetworkError;
354
+ }())
355
+ }]);
356
+ }();
@@ -0,0 +1,48 @@
1
+ import { Asset } from "@stellar/stellar-base";
2
+ import { CallBuilder } from "./call_builder";
3
+ import { ServerApi } from "./server_api";
4
+ /**
5
+ * Creates a new {@link ClaimableBalanceCallBuilder} pointed to server defined by serverUrl.
6
+ * Do not create this object directly, use {@link Server#claimableBalances}.
7
+ *
8
+ * @see [Claimable Balances](https://developers.stellar.org/api/resources/claimablebalances/)
9
+ * @class ClaimableBalanceCallBuilder
10
+ * @class
11
+ * @augments CallBuilder
12
+ * @param {string} serverUrl Horizon server URL.
13
+ */
14
+ export declare class ClaimableBalanceCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.ClaimableBalanceRecord>> {
15
+ constructor(serverUrl: URI);
16
+ /**
17
+ * The claimable balance details endpoint provides information on a single claimable balance.
18
+ *
19
+ * @see [Claimable Balance Details](https://developers.stellar.org/api/resources/claimablebalances/single/)
20
+ * @param {string} claimableBalanceId Claimable balance ID
21
+ * @returns {CallBuilder<ServerApi.ClaimableBalanceRecord>} CallBuilder<ServerApi.ClaimableBalanceRecord> OperationCallBuilder instance
22
+ */
23
+ claimableBalance(claimableBalanceId: string): CallBuilder<ServerApi.ClaimableBalanceRecord>;
24
+ /**
25
+ * Returns all claimable balances which are sponsored by the given account ID.
26
+ *
27
+ * @see [Claimable Balances](https://developers.stellar.org/api/resources/claimablebalances/list/)
28
+ * @param {string} sponsor For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
29
+ * @returns {ClaimableBalanceCallBuilder} current ClaimableBalanceCallBuilder instance
30
+ */
31
+ sponsor(sponsor: string): this;
32
+ /**
33
+ * Returns all claimable balances which can be claimed by the given account ID.
34
+ *
35
+ * @see [Claimable Balances](https://developers.stellar.org/api/resources/claimablebalances/list/)
36
+ * @param {string} claimant For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
37
+ * @returns {ClaimableBalanceCallBuilder} current ClaimableBalanceCallBuilder instance
38
+ */
39
+ claimant(claimant: string): this;
40
+ /**
41
+ * Returns all claimable balances which provide a balance for the given asset.
42
+ *
43
+ * @see [Claimable Balances](https://developers.stellar.org/api/resources/claimablebalances/list/)
44
+ * @param {Asset} asset The Asset held by the claimable balance
45
+ * @returns {ClaimableBalanceCallBuilder} current ClaimableBalanceCallBuilder instance
46
+ */
47
+ asset(asset: Asset): this;
48
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _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; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ClaimableBalanceCallBuilder = void 0;
8
+ var _call_builder = require("./call_builder");
9
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
10
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
11
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
13
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
15
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
16
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
17
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
19
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
20
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
21
+ var ClaimableBalanceCallBuilder = exports.ClaimableBalanceCallBuilder = function (_CallBuilder) {
22
+ function ClaimableBalanceCallBuilder(serverUrl) {
23
+ var _this;
24
+ _classCallCheck(this, ClaimableBalanceCallBuilder);
25
+ _this = _callSuper(this, ClaimableBalanceCallBuilder, [serverUrl]);
26
+ _this.url.segment("claimable_balances");
27
+ return _this;
28
+ }
29
+ _inherits(ClaimableBalanceCallBuilder, _CallBuilder);
30
+ return _createClass(ClaimableBalanceCallBuilder, [{
31
+ key: "claimableBalance",
32
+ value: function claimableBalance(claimableBalanceId) {
33
+ var builder = new _call_builder.CallBuilder(this.url.clone());
34
+ builder.filter.push([claimableBalanceId]);
35
+ return builder;
36
+ }
37
+ }, {
38
+ key: "sponsor",
39
+ value: function sponsor(_sponsor) {
40
+ this.url.setQuery("sponsor", _sponsor);
41
+ return this;
42
+ }
43
+ }, {
44
+ key: "claimant",
45
+ value: function claimant(_claimant) {
46
+ this.url.setQuery("claimant", _claimant);
47
+ return this;
48
+ }
49
+ }, {
50
+ key: "asset",
51
+ value: function asset(_asset) {
52
+ this.url.setQuery("asset", _asset.toString());
53
+ return this;
54
+ }
55
+ }]);
56
+ }(_call_builder.CallBuilder);
@@ -0,0 +1,52 @@
1
+ import { CallBuilder } from "./call_builder";
2
+ import { ServerApi } from "./server_api";
3
+ /**
4
+ * Creates a new {@link EffectCallBuilder} pointed to server defined by serverUrl.
5
+ * Do not create this object directly, use {@link Server#effects}.
6
+ *
7
+ * @class EffectCallBuilder
8
+ * @augments CallBuilder
9
+ * @see [All Effects](https://developers.stellar.org/api/resources/effects/)
10
+ * @class
11
+ * @param {string} serverUrl Horizon server URL.
12
+ */
13
+ export declare class EffectCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.EffectRecord>> {
14
+ constructor(serverUrl: URI);
15
+ /**
16
+ * This endpoint represents all effects that changed a given account. It will return relevant effects from the creation of the account to the current ledger.
17
+ * @see [Effects for Account](https://developers.stellar.org/api/resources/accounts/effects/)
18
+ * @param {string} accountId For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
19
+ * @returns {EffectCallBuilder} this EffectCallBuilder instance
20
+ */
21
+ forAccount(accountId: string): this;
22
+ /**
23
+ * Effects are the specific ways that the ledger was changed by any operation.
24
+ *
25
+ * This endpoint represents all effects that occurred in the given ledger.
26
+ * @see [Effects for Ledger](https://developers.stellar.org/api/resources/ledgers/effects/)
27
+ * @param {number|string} sequence Ledger sequence
28
+ * @returns {EffectCallBuilder} this EffectCallBuilder instance
29
+ */
30
+ forLedger(sequence: number | string): this;
31
+ /**
32
+ * This endpoint represents all effects that occurred as a result of a given transaction.
33
+ * @see [Effects for Transaction](https://developers.stellar.org/api/resources/transactions/effects/)
34
+ * @param {string} transactionId Transaction ID
35
+ * @returns {EffectCallBuilder} this EffectCallBuilder instance
36
+ */
37
+ forTransaction(transactionId: string): this;
38
+ /**
39
+ * This endpoint represents all effects that occurred as a result of a given operation.
40
+ * @see [Effects for Operation](https://developers.stellar.org/api/resources/operations/effects/)
41
+ * @param {number} operationId Operation ID
42
+ * @returns {EffectCallBuilder} this EffectCallBuilder instance
43
+ */
44
+ forOperation(operationId: string): this;
45
+ /**
46
+ * This endpoint represents all effects involving a particular liquidity pool.
47
+ *
48
+ * @param {string} poolId liquidity pool ID
49
+ * @returns {EffectCallBuilder} this EffectCallBuilder instance
50
+ */
51
+ forLiquidityPool(poolId: string): this;
52
+ }