@stellar/stellar-sdk 11.0.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 (112) hide show
  1. package/CHANGELOG.md +1275 -0
  2. package/LICENSE +228 -0
  3. package/README.md +274 -0
  4. package/dist/stellar-sdk.js +56470 -0
  5. package/dist/stellar-sdk.min.js +2 -0
  6. package/dist/stellar-sdk.min.js.LICENSE.txt +71 -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 +49 -0
  11. package/lib/contract_spec.d.ts +130 -0
  12. package/lib/contract_spec.js +549 -0
  13. package/lib/errors.d.ts +59 -0
  14. package/lib/errors.js +105 -0
  15. package/lib/federation/api.d.ts +11 -0
  16. package/lib/federation/api.js +7 -0
  17. package/lib/federation/index.d.ts +2 -0
  18. package/lib/federation/index.js +24 -0
  19. package/lib/federation/server.d.ts +118 -0
  20. package/lib/federation/server.js +253 -0
  21. package/lib/friendbot/index.d.ts +5 -0
  22. package/lib/friendbot/index.js +7 -0
  23. package/lib/horizon/account_call_builder.d.ts +55 -0
  24. package/lib/horizon/account_call_builder.js +64 -0
  25. package/lib/horizon/account_response.d.ts +58 -0
  26. package/lib/horizon/account_response.js +50 -0
  27. package/lib/horizon/assets_call_builder.d.ts +27 -0
  28. package/lib/horizon/assets_call_builder.js +45 -0
  29. package/lib/horizon/call_builder.d.ts +128 -0
  30. package/lib/horizon/call_builder.js +360 -0
  31. package/lib/horizon/claimable_balances_call_builder.d.ts +49 -0
  32. package/lib/horizon/claimable_balances_call_builder.js +58 -0
  33. package/lib/horizon/effect_call_builder.d.ts +53 -0
  34. package/lib/horizon/effect_call_builder.js +58 -0
  35. package/lib/horizon/friendbot_builder.d.ts +5 -0
  36. package/lib/horizon/friendbot_builder.js +33 -0
  37. package/lib/horizon/horizon_api.d.ts +523 -0
  38. package/lib/horizon/horizon_api.js +96 -0
  39. package/lib/horizon/horizon_axios_client.d.ts +30 -0
  40. package/lib/horizon/horizon_axios_client.js +48 -0
  41. package/lib/horizon/index.d.ts +7 -0
  42. package/lib/horizon/index.js +78 -0
  43. package/lib/horizon/ledger_call_builder.d.ts +22 -0
  44. package/lib/horizon/ledger_call_builder.js +39 -0
  45. package/lib/horizon/liquidity_pool_call_builder.d.ts +38 -0
  46. package/lib/horizon/liquidity_pool_call_builder.js +61 -0
  47. package/lib/horizon/offer_call_builder.d.ts +64 -0
  48. package/lib/horizon/offer_call_builder.js +81 -0
  49. package/lib/horizon/operation_call_builder.d.ts +68 -0
  50. package/lib/horizon/operation_call_builder.js +71 -0
  51. package/lib/horizon/orderbook_call_builder.d.ts +16 -0
  52. package/lib/horizon/orderbook_call_builder.js +46 -0
  53. package/lib/horizon/path_call_builder.d.ts +31 -0
  54. package/lib/horizon/path_call_builder.js +42 -0
  55. package/lib/horizon/payment_call_builder.d.ts +36 -0
  56. package/lib/horizon/payment_call_builder.js +48 -0
  57. package/lib/horizon/server.d.ts +361 -0
  58. package/lib/horizon/server.js +507 -0
  59. package/lib/horizon/server_api.d.ts +279 -0
  60. package/lib/horizon/server_api.js +19 -0
  61. package/lib/horizon/strict_receive_path_call_builder.d.ts +34 -0
  62. package/lib/horizon/strict_receive_path_call_builder.js +51 -0
  63. package/lib/horizon/strict_send_path_call_builder.d.ts +34 -0
  64. package/lib/horizon/strict_send_path_call_builder.js +51 -0
  65. package/lib/horizon/trade_aggregation_call_builder.d.ts +48 -0
  66. package/lib/horizon/trade_aggregation_call_builder.js +82 -0
  67. package/lib/horizon/trades_call_builder.d.ts +50 -0
  68. package/lib/horizon/trades_call_builder.js +74 -0
  69. package/lib/horizon/transaction_call_builder.d.ts +58 -0
  70. package/lib/horizon/transaction_call_builder.js +66 -0
  71. package/lib/horizon/types/account.d.ts +5 -0
  72. package/lib/horizon/types/account.js +5 -0
  73. package/lib/horizon/types/assets.d.ts +19 -0
  74. package/lib/horizon/types/assets.js +5 -0
  75. package/lib/horizon/types/effects.d.ts +285 -0
  76. package/lib/horizon/types/effects.js +62 -0
  77. package/lib/horizon/types/offer.d.ts +20 -0
  78. package/lib/horizon/types/offer.js +5 -0
  79. package/lib/horizon/types/trade.d.ts +13 -0
  80. package/lib/horizon/types/trade.js +5 -0
  81. package/lib/index.d.ts +14 -0
  82. package/lib/index.js +79 -0
  83. package/lib/soroban/api.d.ts +247 -0
  84. package/lib/soroban/api.js +32 -0
  85. package/lib/soroban/axios.d.ts +3 -0
  86. package/lib/soroban/axios.js +16 -0
  87. package/lib/soroban/browser.d.ts +6 -0
  88. package/lib/soroban/browser.js +37 -0
  89. package/lib/soroban/index.d.ts +8 -0
  90. package/lib/soroban/index.js +72 -0
  91. package/lib/soroban/jsonrpc.d.ts +33 -0
  92. package/lib/soroban/jsonrpc.js +93 -0
  93. package/lib/soroban/parsers.d.ts +17 -0
  94. package/lib/soroban/parsers.js +111 -0
  95. package/lib/soroban/server.d.ts +427 -0
  96. package/lib/soroban/server.js +598 -0
  97. package/lib/soroban/transaction.d.ts +20 -0
  98. package/lib/soroban/transaction.js +55 -0
  99. package/lib/soroban/utils.d.ts +1 -0
  100. package/lib/soroban/utils.js +9 -0
  101. package/lib/stellartoml/index.d.ts +121 -0
  102. package/lib/stellartoml/index.js +78 -0
  103. package/lib/utils.d.ts +12 -0
  104. package/lib/utils.js +32 -0
  105. package/lib/webauth/errors.d.ts +4 -0
  106. package/lib/webauth/errors.js +37 -0
  107. package/lib/webauth/index.d.ts +2 -0
  108. package/lib/webauth/index.js +27 -0
  109. package/lib/webauth/utils.d.ts +294 -0
  110. package/lib/webauth/utils.js +332 -0
  111. package/package.json +153 -0
  112. package/types/dom-monkeypatch.d.ts +126 -0
@@ -0,0 +1,50 @@
1
+ /// <reference types="urijs" />
2
+ import { Asset } from "@stellar/stellar-base";
3
+ import { CallBuilder } from "./call_builder";
4
+ import { ServerApi } from "./server_api";
5
+ /**
6
+ * Creates a new {@link TradesCallBuilder} pointed to server defined by serverUrl.
7
+ * Do not create this object directly, use {@link Server#trades}.
8
+ *
9
+ * @class TradesCallBuilder
10
+ * @extends CallBuilder
11
+ * @constructor
12
+ * @see [Trades](https://developers.stellar.org/api/resources/trades/)
13
+ * @param {string} serverUrl serverUrl Horizon server URL.
14
+ */
15
+ export declare class TradesCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.TradeRecord>> {
16
+ constructor(serverUrl: URI);
17
+ /**
18
+ * Filter trades for a specific asset pair (orderbook)
19
+ * @param {Asset} base asset
20
+ * @param {Asset} counter asset
21
+ * @returns {TradesCallBuilder} current TradesCallBuilder instance
22
+ */
23
+ forAssetPair(base: Asset, counter: Asset): this;
24
+ /**
25
+ * Filter trades for a specific offer
26
+ * @param {string} offerId ID of the offer
27
+ * @returns {TradesCallBuilder} current TradesCallBuilder instance
28
+ */
29
+ forOffer(offerId: string): this;
30
+ /**
31
+ * Filter trades by a specific type.
32
+ * @param {ServerApi.TradeType} tradeType the trade type to filter by.
33
+ * @returns {TradesCallBuilder} current TradesCallBuilder instance.
34
+ */
35
+ forType(tradeType: ServerApi.TradeType): this;
36
+ /**
37
+ * Filter trades for a specific account
38
+ * @see [Trades for Account](https://developers.stellar.org/api/resources/accounts/trades/)
39
+ * @param {string} accountId For example: `GBYTR4MC5JAX4ALGUBJD7EIKZVM7CUGWKXIUJMRSMK573XH2O7VAK3SR`
40
+ * @returns {TradesCallBuilder} current TradesCallBuilder instance
41
+ */
42
+ forAccount(accountId: string): this;
43
+ /**
44
+ * Filter trades for a specific liquidity pool
45
+ * @see [Trades for Liquidity Pool](https://developers.stellar.org/api/resources/liquiditypools/trades/)
46
+ * @param {string} liquidityPoolId For example: `3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4`
47
+ * @returns {TradesCallBuilder} current TradesCallBuilder instance
48
+ */
49
+ forLiquidityPool(liquidityPoolId: string): this;
50
+ }
@@ -0,0 +1,74 @@
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.TradesCallBuilder = void 0;
8
+ var _call_builder = require("./call_builder");
9
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
11
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
15
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
16
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
17
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
18
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
19
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21
+ var TradesCallBuilder = exports.TradesCallBuilder = function (_CallBuilder) {
22
+ _inherits(TradesCallBuilder, _CallBuilder);
23
+ var _super = _createSuper(TradesCallBuilder);
24
+ function TradesCallBuilder(serverUrl) {
25
+ var _this;
26
+ _classCallCheck(this, TradesCallBuilder);
27
+ _this = _super.call(this, serverUrl, "trades");
28
+ _this.url.segment("trades");
29
+ return _this;
30
+ }
31
+ _createClass(TradesCallBuilder, [{
32
+ key: "forAssetPair",
33
+ value: function forAssetPair(base, counter) {
34
+ if (!base.isNative()) {
35
+ this.url.setQuery("base_asset_type", base.getAssetType());
36
+ this.url.setQuery("base_asset_code", base.getCode());
37
+ this.url.setQuery("base_asset_issuer", base.getIssuer());
38
+ } else {
39
+ this.url.setQuery("base_asset_type", "native");
40
+ }
41
+ if (!counter.isNative()) {
42
+ this.url.setQuery("counter_asset_type", counter.getAssetType());
43
+ this.url.setQuery("counter_asset_code", counter.getCode());
44
+ this.url.setQuery("counter_asset_issuer", counter.getIssuer());
45
+ } else {
46
+ this.url.setQuery("counter_asset_type", "native");
47
+ }
48
+ return this;
49
+ }
50
+ }, {
51
+ key: "forOffer",
52
+ value: function forOffer(offerId) {
53
+ this.url.setQuery("offer_id", offerId);
54
+ return this;
55
+ }
56
+ }, {
57
+ key: "forType",
58
+ value: function forType(tradeType) {
59
+ this.url.setQuery("trade_type", tradeType);
60
+ return this;
61
+ }
62
+ }, {
63
+ key: "forAccount",
64
+ value: function forAccount(accountId) {
65
+ return this.forEndpoint("accounts", accountId);
66
+ }
67
+ }, {
68
+ key: "forLiquidityPool",
69
+ value: function forLiquidityPool(liquidityPoolId) {
70
+ return this.forEndpoint("liquidity_pools", liquidityPoolId);
71
+ }
72
+ }]);
73
+ return TradesCallBuilder;
74
+ }(_call_builder.CallBuilder);
@@ -0,0 +1,58 @@
1
+ /// <reference types="urijs" />
2
+ import { CallBuilder } from "./call_builder";
3
+ import { ServerApi } from "./server_api";
4
+ /**
5
+ * Creates a new {@link TransactionCallBuilder} pointed to server defined by serverUrl.
6
+ * Do not create this object directly, use {@link Server#transactions}.
7
+ *
8
+ * @class TransactionCallBuilder
9
+ * @extends CallBuilder
10
+ * @see [All Transactions](https://developers.stellar.org/api/resources/transactions/)
11
+ * @constructor
12
+ * @param {string} serverUrl Horizon server URL.
13
+ */
14
+ export declare class TransactionCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.TransactionRecord>> {
15
+ constructor(serverUrl: URI);
16
+ /**
17
+ * The transaction details endpoint provides information on a single transaction. The transaction hash provided in the hash argument specifies which transaction to load.
18
+ * @see [Transaction Details](https://developers.stellar.org/api/resources/transactions/single/)
19
+ * @param {string} transactionId Transaction ID
20
+ * @returns {CallBuilder} a CallBuilder instance
21
+ */
22
+ transaction(transactionId: string): CallBuilder<ServerApi.TransactionRecord>;
23
+ /**
24
+ * This endpoint represents all transactions that affected a given account.
25
+ * @see [Transactions for Account](https://developers.stellar.org/api/resources/accounts/transactions/)
26
+ * @param {string} accountId For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
27
+ * @returns {TransactionCallBuilder} current TransactionCallBuilder instance
28
+ */
29
+ forAccount(accountId: string): this;
30
+ /**
31
+ * This endpoint represents all transactions that reference a given claimable_balance.
32
+ * @see [Operations for Claimable Balance](https://developers.stellar.org/api/resources/claimablebalances/transactions/)
33
+ * @param {string} claimableBalanceId Claimable Balance ID
34
+ * @returns {TransactionCallBuilder} this TransactionCallBuilder instance
35
+ */
36
+ forClaimableBalance(claimableBalanceId: string): this;
37
+ /**
38
+ * This endpoint represents all transactions in a given ledger.
39
+ * @see [Transactions for Ledger](https://developers.stellar.org/api/resources/ledgers/transactions/)
40
+ * @param {number|string} sequence Ledger sequence
41
+ * @returns {TransactionCallBuilder} current TransactionCallBuilder instance
42
+ */
43
+ forLedger(sequence: number | string): this;
44
+ /**
45
+ * This endpoint represents all transactions involving a particular liquidity pool.
46
+ *
47
+ * @param {string} poolId liquidity pool ID
48
+ * @returns {TransactionCallBuilder} this TransactionCallBuilder instance
49
+ */
50
+ forLiquidityPool(poolId: string): this;
51
+ /**
52
+ * Adds a parameter defining whether to include failed transactions. By default only successful transactions are
53
+ * returned.
54
+ * @param {bool} value Set to `true` to include failed transactions.
55
+ * @returns {TransactionCallBuilder} current TransactionCallBuilder instance
56
+ */
57
+ includeFailed(value: boolean): this;
58
+ }
@@ -0,0 +1,66 @@
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.TransactionCallBuilder = void 0;
8
+ var _call_builder = require("./call_builder");
9
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
11
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
15
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
16
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
17
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
18
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
19
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21
+ var TransactionCallBuilder = exports.TransactionCallBuilder = function (_CallBuilder) {
22
+ _inherits(TransactionCallBuilder, _CallBuilder);
23
+ var _super = _createSuper(TransactionCallBuilder);
24
+ function TransactionCallBuilder(serverUrl) {
25
+ var _this;
26
+ _classCallCheck(this, TransactionCallBuilder);
27
+ _this = _super.call(this, serverUrl, "transactions");
28
+ _this.url.segment("transactions");
29
+ return _this;
30
+ }
31
+ _createClass(TransactionCallBuilder, [{
32
+ key: "transaction",
33
+ value: function transaction(transactionId) {
34
+ var builder = new _call_builder.CallBuilder(this.url.clone());
35
+ builder.filter.push([transactionId]);
36
+ return builder;
37
+ }
38
+ }, {
39
+ key: "forAccount",
40
+ value: function forAccount(accountId) {
41
+ return this.forEndpoint("accounts", accountId);
42
+ }
43
+ }, {
44
+ key: "forClaimableBalance",
45
+ value: function forClaimableBalance(claimableBalanceId) {
46
+ return this.forEndpoint("claimable_balances", claimableBalanceId);
47
+ }
48
+ }, {
49
+ key: "forLedger",
50
+ value: function forLedger(sequence) {
51
+ return this.forEndpoint("ledgers", sequence.toString());
52
+ }
53
+ }, {
54
+ key: "forLiquidityPool",
55
+ value: function forLiquidityPool(poolId) {
56
+ return this.forEndpoint("liquidity_pools", poolId);
57
+ }
58
+ }, {
59
+ key: "includeFailed",
60
+ value: function includeFailed(value) {
61
+ this.url.setQuery("include_failed", value.toString());
62
+ return this;
63
+ }
64
+ }]);
65
+ return TransactionCallBuilder;
66
+ }(_call_builder.CallBuilder);
@@ -0,0 +1,5 @@
1
+ export interface AccountRecordSigners {
2
+ key: string;
3
+ weight: number;
4
+ type: string;
5
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,19 @@
1
+ import { AssetType } from "@stellar/stellar-base";
2
+ import { HorizonApi } from "./../horizon_api";
3
+ export interface AssetRecord extends HorizonApi.BaseResponse {
4
+ asset_type: AssetType.credit4 | AssetType.credit12;
5
+ asset_code: string;
6
+ asset_issuer: string;
7
+ paging_token: string;
8
+ accounts: HorizonApi.AssetAccounts;
9
+ balances: HorizonApi.AssetBalances;
10
+ num_claimable_balances: number;
11
+ num_liquidity_pools: number;
12
+ num_contracts: number;
13
+ num_accounts: number;
14
+ amount: string;
15
+ claimable_balances_amount: string;
16
+ liquidity_pools_amount: string;
17
+ contracts_amount: string;
18
+ flags: HorizonApi.Flags;
19
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,285 @@
1
+ import { HorizonApi } from "./../horizon_api";
2
+ import { OfferAsset } from "./offer";
3
+ export declare enum EffectType {
4
+ account_created = 0,
5
+ account_removed = 1,
6
+ account_credited = 2,
7
+ account_debited = 3,
8
+ account_thresholds_updated = 4,
9
+ account_home_domain_updated = 5,
10
+ account_flags_updated = 6,
11
+ account_inflation_destination_updated = 7,
12
+ signer_created = 10,
13
+ signer_removed = 11,
14
+ signer_updated = 12,
15
+ trustline_created = 20,
16
+ trustline_removed = 21,
17
+ trustline_updated = 22,
18
+ trustline_authorized = 23,
19
+ trustline_deauthorized = 24,
20
+ trustline_authorized_to_maintain_liabilities = 25,// deprecated, use trustline_flags_updated
21
+ trustline_flags_updated = 26,
22
+ offer_created = 30,
23
+ offer_removed = 31,
24
+ offer_updated = 32,
25
+ trade = 33,
26
+ data_created = 40,
27
+ data_removed = 41,
28
+ data_updated = 42,
29
+ sequence_bumped = 43,
30
+ claimable_balance_created = 50,
31
+ claimable_balance_claimant_created = 51,
32
+ claimable_balance_claimed = 52,
33
+ account_sponsorship_created = 60,
34
+ account_sponsorship_updated = 61,
35
+ account_sponsorship_removed = 62,
36
+ trustline_sponsorship_created = 63,
37
+ trustline_sponsorship_updated = 64,
38
+ trustline_sponsorship_removed = 65,
39
+ data_sponsorship_created = 66,
40
+ data_sponsorship_updated = 67,
41
+ data_sponsorship_removed = 68,
42
+ claimable_balance_sponsorship_created = 69,
43
+ claimable_balance_sponsorship_updated = 70,
44
+ claimable_balance_sponsorship_removed = 71,
45
+ signer_sponsorship_created = 72,
46
+ signer_sponsorship_updated = 73,
47
+ signer_sponsorship_removed = 74,
48
+ claimable_balance_clawed_back = 80,
49
+ liquidity_pool_deposited = 90,
50
+ liquidity_pool_withdrew = 91,
51
+ liquidity_pool_trade = 92,
52
+ liquidity_pool_created = 93,
53
+ liquidity_pool_removed = 94,
54
+ liquidity_pool_revoked = 95,
55
+ contract_credited = 96,
56
+ contract_debited = 97
57
+ }
58
+ export interface BaseEffectRecord extends HorizonApi.BaseResponse {
59
+ id: string;
60
+ account: string;
61
+ paging_token: string;
62
+ type_i: EffectType;
63
+ type: string;
64
+ created_at: string;
65
+ }
66
+ export interface AccountCreated extends BaseEffectRecord {
67
+ type_i: EffectType.account_created;
68
+ starting_balance: string;
69
+ }
70
+ export interface AccountCredited extends BaseEffectRecord, OfferAsset {
71
+ type_i: EffectType.account_credited;
72
+ amount: string;
73
+ }
74
+ export interface AccountDebited extends BaseEffectRecord {
75
+ type_i: EffectType.account_debited;
76
+ amount: string;
77
+ }
78
+ export interface AccountThresholdsUpdated extends BaseEffectRecord {
79
+ type_i: EffectType.account_thresholds_updated;
80
+ low_threshold: number;
81
+ med_threshold: number;
82
+ high_threshold: number;
83
+ }
84
+ export interface AccountHomeDomainUpdated extends BaseEffectRecord {
85
+ type_i: EffectType.account_home_domain_updated;
86
+ home_domain: string;
87
+ }
88
+ export interface AccountFlagsUpdated extends BaseEffectRecord {
89
+ type_i: EffectType.account_flags_updated;
90
+ auth_required_flag: boolean;
91
+ auth_revokable_flag: boolean;
92
+ }
93
+ interface DataEvents extends BaseEffectRecord {
94
+ name: boolean;
95
+ value: boolean;
96
+ }
97
+ export interface DataCreated extends DataEvents {
98
+ type_i: EffectType.data_created;
99
+ }
100
+ export interface DataUpdated extends DataEvents {
101
+ type_i: EffectType.data_updated;
102
+ }
103
+ export interface DataRemoved extends DataEvents {
104
+ type_i: EffectType.data_removed;
105
+ }
106
+ export interface SequenceBumped extends BaseEffectRecord {
107
+ type_i: EffectType.sequence_bumped;
108
+ new_seq: number | string;
109
+ }
110
+ interface SignerEvents extends BaseEffectRecord {
111
+ weight: number;
112
+ key: string;
113
+ public_key: string;
114
+ }
115
+ export interface SignerCreated extends SignerEvents {
116
+ type_i: EffectType.signer_created;
117
+ }
118
+ export interface SignerRemoved extends SignerEvents {
119
+ type_i: EffectType.signer_removed;
120
+ }
121
+ export interface SignerUpdated extends SignerEvents {
122
+ type_i: EffectType.signer_updated;
123
+ }
124
+ interface TrustlineEvents extends BaseEffectRecord, OfferAsset {
125
+ limit: string;
126
+ liquidity_pool_id?: string;
127
+ }
128
+ export interface TrustlineCreated extends TrustlineEvents {
129
+ type_i: EffectType.trustline_created;
130
+ }
131
+ export interface TrustlineRemoved extends TrustlineEvents {
132
+ type_i: EffectType.trustline_removed;
133
+ }
134
+ export interface TrustlineUpdated extends TrustlineEvents {
135
+ type_i: EffectType.trustline_updated;
136
+ }
137
+ export interface TrustlineAuthorized extends BaseEffectRecord {
138
+ type_i: EffectType.trustline_authorized;
139
+ asset_type: OfferAsset["asset_type"];
140
+ asset_code: OfferAsset["asset_code"];
141
+ trustor: string;
142
+ }
143
+ export interface TrustlineDeauthorized extends Omit<TrustlineAuthorized, "type_i"> {
144
+ type_i: EffectType.trustline_deauthorized;
145
+ }
146
+ export interface TrustlineAuthorizedToMaintainLiabilities extends Omit<TrustlineAuthorized, "type_i"> {
147
+ type_i: EffectType.trustline_authorized_to_maintain_liabilities;
148
+ }
149
+ export interface ClaimableBalanceCreated extends BaseEffectRecord {
150
+ type_i: EffectType.claimable_balance_created;
151
+ amount: string;
152
+ balance_type_i: string;
153
+ asset: string;
154
+ }
155
+ export interface ClaimableBalanceClaimed extends Omit<ClaimableBalanceCreated, "type_i"> {
156
+ type_i: EffectType.claimable_balance_claimed;
157
+ }
158
+ export interface ClaimableBalanceClaimantCreated extends Omit<ClaimableBalanceCreated, "type_i"> {
159
+ type_i: EffectType.claimable_balance_claimant_created;
160
+ }
161
+ interface SponsershipFields {
162
+ sponsor: string;
163
+ new_sponsor: string;
164
+ former_sponsor: string;
165
+ }
166
+ interface AccountSponsorshipEvents extends BaseEffectRecord, SponsershipFields {
167
+ }
168
+ export type AccountSponsorshipCreated = Omit<AccountSponsorshipEvents, "new_sponsor" | "former_sponsor"> & {
169
+ type_i: EffectType.account_sponsorship_created;
170
+ };
171
+ export type AccountSponsorshipUpdated = Omit<AccountSponsorshipEvents, "sponsor"> & {
172
+ type_i: EffectType.account_sponsorship_updated;
173
+ };
174
+ export type AccountSponsorshipRemoved = Omit<AccountSponsorshipEvents, "new_sponsor" | "sponsor"> & {
175
+ type_i: EffectType.account_sponsorship_removed;
176
+ };
177
+ interface TrustlineSponsorshipEvents extends BaseEffectRecord, SponsershipFields {
178
+ asset?: string;
179
+ liquidity_pool_id?: string;
180
+ }
181
+ export type TrustlineSponsorshipCreated = Omit<TrustlineSponsorshipEvents, "new_sponsor" | "former_sponsor"> & {
182
+ type_i: EffectType.trustline_sponsorship_created;
183
+ };
184
+ export type TrustlineSponsorshipUpdated = Omit<TrustlineSponsorshipEvents, "sponsor"> & {
185
+ type_i: EffectType.trustline_sponsorship_updated;
186
+ };
187
+ export type TrustlineSponsorshipRemoved = Omit<TrustlineSponsorshipEvents, "new_sponsor" | "sponsor"> & {
188
+ type_i: EffectType.trustline_sponsorship_removed;
189
+ };
190
+ interface DataSponsorshipEvents extends BaseEffectRecord, SponsershipFields {
191
+ data_name: string;
192
+ }
193
+ export type DateSponsorshipCreated = Omit<DataSponsorshipEvents, "new_sponsor" | "former_sponsor"> & {
194
+ type_i: EffectType.data_sponsorship_created;
195
+ };
196
+ export type DateSponsorshipUpdated = Omit<DataSponsorshipEvents, "sponsor"> & {
197
+ type_i: EffectType.data_sponsorship_updated;
198
+ };
199
+ export type DateSponsorshipRemoved = Omit<DataSponsorshipEvents, "new_sponsor" | "sponsor"> & {
200
+ type_i: EffectType.data_sponsorship_removed;
201
+ };
202
+ interface ClaimableBalanceSponsorshipEvents extends BaseEffectRecord, SponsershipFields {
203
+ balance_type_i: string;
204
+ }
205
+ export type ClaimableBalanceSponsorshipCreated = Omit<ClaimableBalanceSponsorshipEvents, "new_sponsor" | "former_sponsor"> & {
206
+ type_i: EffectType.claimable_balance_sponsorship_created;
207
+ };
208
+ export type ClaimableBalanceSponsorshipUpdated = Omit<ClaimableBalanceSponsorshipEvents, "sponsor"> & {
209
+ type_i: EffectType.claimable_balance_sponsorship_updated;
210
+ };
211
+ export type ClaimableBalanceSponsorshipRemoved = Omit<ClaimableBalanceSponsorshipEvents, "new_sponsor" | "sponsor"> & {
212
+ type_i: EffectType.claimable_balance_sponsorship_removed;
213
+ };
214
+ interface SignerSponsorshipEvents extends BaseEffectRecord, SponsershipFields {
215
+ signer: string;
216
+ }
217
+ export type SignerSponsorshipCreated = Omit<SignerSponsorshipEvents, "new_sponsor" | "former_sponsor"> & {
218
+ type_i: EffectType.signer_sponsorship_created;
219
+ };
220
+ export type SignerSponsorshipUpdated = Omit<SignerSponsorshipEvents, "sponsor"> & {
221
+ type_i: EffectType.signer_sponsorship_updated;
222
+ };
223
+ export type SignerSponsorshipRemoved = Omit<SignerSponsorshipEvents, "new_sponsor" | "sponsor"> & {
224
+ type_i: EffectType.signer_sponsorship_removed;
225
+ };
226
+ export interface ClaimableBalanceClawedBack extends HorizonApi.BaseResponse {
227
+ balance_id: string;
228
+ }
229
+ export interface LiquidityPoolEffectRecord extends HorizonApi.BaseResponse {
230
+ id: string;
231
+ fee_bp: number;
232
+ type: HorizonApi.LiquidityPoolType;
233
+ total_trustlines: string;
234
+ total_shares: string;
235
+ reserves: HorizonApi.Reserve[];
236
+ }
237
+ export interface LiquidityPoolDeposited extends BaseEffectRecord {
238
+ type_i: EffectType.liquidity_pool_deposited;
239
+ liquidity_pool: LiquidityPoolEffectRecord;
240
+ reserves_deposited: HorizonApi.Reserve[];
241
+ shares_received: string;
242
+ }
243
+ export interface LiquidityPoolWithdrew extends BaseEffectRecord {
244
+ type_i: EffectType.liquidity_pool_withdrew;
245
+ liquidity_pool: LiquidityPoolEffectRecord;
246
+ reserves_received: HorizonApi.Reserve[];
247
+ shares_redeemed: string;
248
+ }
249
+ export interface LiquidityPoolTrade extends BaseEffectRecord {
250
+ type_i: EffectType.liquidity_pool_trade;
251
+ liquidity_pool: LiquidityPoolEffectRecord;
252
+ sold: HorizonApi.Reserve;
253
+ bought: HorizonApi.Reserve;
254
+ }
255
+ export interface LiquidityPoolCreated extends BaseEffectRecord {
256
+ type_i: EffectType.liquidity_pool_created;
257
+ liquidity_pool: LiquidityPoolEffectRecord;
258
+ }
259
+ export interface LiquidityPoolRemoved extends BaseEffectRecord {
260
+ type_i: EffectType.liquidity_pool_removed;
261
+ liquidity_pool_id: string;
262
+ }
263
+ export interface LiquidityPoolRevoked extends BaseEffectRecord {
264
+ type_i: EffectType.liquidity_pool_revoked;
265
+ liquidity_pool: LiquidityPoolEffectRecord;
266
+ reserves_revoked: [
267
+ {
268
+ asset: string;
269
+ amount: string;
270
+ claimable_balance_id: string;
271
+ }
272
+ ];
273
+ shares_revoked: string;
274
+ }
275
+ export interface ContractCredited extends BaseEffectRecord, OfferAsset {
276
+ type_i: EffectType.contract_credited;
277
+ contract: string;
278
+ amount: string;
279
+ }
280
+ export interface ContractDebited extends BaseEffectRecord, OfferAsset {
281
+ type_i: EffectType.contract_debited;
282
+ contract: string;
283
+ amount: string;
284
+ }
285
+ export {};
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EffectType = void 0;
7
+ var EffectType = exports.EffectType = function (EffectType) {
8
+ EffectType[EffectType["account_created"] = 0] = "account_created";
9
+ EffectType[EffectType["account_removed"] = 1] = "account_removed";
10
+ EffectType[EffectType["account_credited"] = 2] = "account_credited";
11
+ EffectType[EffectType["account_debited"] = 3] = "account_debited";
12
+ EffectType[EffectType["account_thresholds_updated"] = 4] = "account_thresholds_updated";
13
+ EffectType[EffectType["account_home_domain_updated"] = 5] = "account_home_domain_updated";
14
+ EffectType[EffectType["account_flags_updated"] = 6] = "account_flags_updated";
15
+ EffectType[EffectType["account_inflation_destination_updated"] = 7] = "account_inflation_destination_updated";
16
+ EffectType[EffectType["signer_created"] = 10] = "signer_created";
17
+ EffectType[EffectType["signer_removed"] = 11] = "signer_removed";
18
+ EffectType[EffectType["signer_updated"] = 12] = "signer_updated";
19
+ EffectType[EffectType["trustline_created"] = 20] = "trustline_created";
20
+ EffectType[EffectType["trustline_removed"] = 21] = "trustline_removed";
21
+ EffectType[EffectType["trustline_updated"] = 22] = "trustline_updated";
22
+ EffectType[EffectType["trustline_authorized"] = 23] = "trustline_authorized";
23
+ EffectType[EffectType["trustline_deauthorized"] = 24] = "trustline_deauthorized";
24
+ EffectType[EffectType["trustline_authorized_to_maintain_liabilities"] = 25] = "trustline_authorized_to_maintain_liabilities";
25
+ EffectType[EffectType["trustline_flags_updated"] = 26] = "trustline_flags_updated";
26
+ EffectType[EffectType["offer_created"] = 30] = "offer_created";
27
+ EffectType[EffectType["offer_removed"] = 31] = "offer_removed";
28
+ EffectType[EffectType["offer_updated"] = 32] = "offer_updated";
29
+ EffectType[EffectType["trade"] = 33] = "trade";
30
+ EffectType[EffectType["data_created"] = 40] = "data_created";
31
+ EffectType[EffectType["data_removed"] = 41] = "data_removed";
32
+ EffectType[EffectType["data_updated"] = 42] = "data_updated";
33
+ EffectType[EffectType["sequence_bumped"] = 43] = "sequence_bumped";
34
+ EffectType[EffectType["claimable_balance_created"] = 50] = "claimable_balance_created";
35
+ EffectType[EffectType["claimable_balance_claimant_created"] = 51] = "claimable_balance_claimant_created";
36
+ EffectType[EffectType["claimable_balance_claimed"] = 52] = "claimable_balance_claimed";
37
+ EffectType[EffectType["account_sponsorship_created"] = 60] = "account_sponsorship_created";
38
+ EffectType[EffectType["account_sponsorship_updated"] = 61] = "account_sponsorship_updated";
39
+ EffectType[EffectType["account_sponsorship_removed"] = 62] = "account_sponsorship_removed";
40
+ EffectType[EffectType["trustline_sponsorship_created"] = 63] = "trustline_sponsorship_created";
41
+ EffectType[EffectType["trustline_sponsorship_updated"] = 64] = "trustline_sponsorship_updated";
42
+ EffectType[EffectType["trustline_sponsorship_removed"] = 65] = "trustline_sponsorship_removed";
43
+ EffectType[EffectType["data_sponsorship_created"] = 66] = "data_sponsorship_created";
44
+ EffectType[EffectType["data_sponsorship_updated"] = 67] = "data_sponsorship_updated";
45
+ EffectType[EffectType["data_sponsorship_removed"] = 68] = "data_sponsorship_removed";
46
+ EffectType[EffectType["claimable_balance_sponsorship_created"] = 69] = "claimable_balance_sponsorship_created";
47
+ EffectType[EffectType["claimable_balance_sponsorship_updated"] = 70] = "claimable_balance_sponsorship_updated";
48
+ EffectType[EffectType["claimable_balance_sponsorship_removed"] = 71] = "claimable_balance_sponsorship_removed";
49
+ EffectType[EffectType["signer_sponsorship_created"] = 72] = "signer_sponsorship_created";
50
+ EffectType[EffectType["signer_sponsorship_updated"] = 73] = "signer_sponsorship_updated";
51
+ EffectType[EffectType["signer_sponsorship_removed"] = 74] = "signer_sponsorship_removed";
52
+ EffectType[EffectType["claimable_balance_clawed_back"] = 80] = "claimable_balance_clawed_back";
53
+ EffectType[EffectType["liquidity_pool_deposited"] = 90] = "liquidity_pool_deposited";
54
+ EffectType[EffectType["liquidity_pool_withdrew"] = 91] = "liquidity_pool_withdrew";
55
+ EffectType[EffectType["liquidity_pool_trade"] = 92] = "liquidity_pool_trade";
56
+ EffectType[EffectType["liquidity_pool_created"] = 93] = "liquidity_pool_created";
57
+ EffectType[EffectType["liquidity_pool_removed"] = 94] = "liquidity_pool_removed";
58
+ EffectType[EffectType["liquidity_pool_revoked"] = 95] = "liquidity_pool_revoked";
59
+ EffectType[EffectType["contract_credited"] = 96] = "contract_credited";
60
+ EffectType[EffectType["contract_debited"] = 97] = "contract_debited";
61
+ return EffectType;
62
+ }({});
@@ -0,0 +1,20 @@
1
+ import { AssetType } from "@stellar/stellar-base";
2
+ import { HorizonApi } from "./../horizon_api";
3
+ export interface OfferAsset {
4
+ asset_type: AssetType;
5
+ asset_code?: string;
6
+ asset_issuer?: string;
7
+ }
8
+ export interface OfferRecord extends HorizonApi.BaseResponse {
9
+ id: number | string;
10
+ paging_token: string;
11
+ seller: string;
12
+ selling: OfferAsset;
13
+ buying: OfferAsset;
14
+ amount: string;
15
+ price_r: HorizonApi.PriceRShorthand;
16
+ price: string;
17
+ last_modified_ledger: number;
18
+ last_modified_time: string;
19
+ sponsor?: string;
20
+ }