@reyaxyz/api-sdk 0.153.46 → 0.154.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.
@@ -23,7 +23,6 @@ var depth_chart_simulation_1 = __importDefault(require("./modules/depth-chart.si
23
23
  var funding_rate_1 = __importDefault(require("./modules/funding-rate"));
24
24
  var isolated_order_simulation_1 = __importDefault(require("./modules/isolated-order.simulation"));
25
25
  var conditional_orders_1 = __importDefault(require("./modules/conditional-orders"));
26
- var lottery_1 = __importDefault(require("./modules/lottery"));
27
26
  var referral_1 = __importDefault(require("./modules/referral"));
28
27
  var auth_1 = __importDefault(require("./modules/auth"));
29
28
  var rage_trade_1 = __importDefault(require("./modules/rage-trade"));
@@ -52,7 +51,6 @@ var ApiClient = /** @class */ (function () {
52
51
  this._tokens = new tokens_1.default(ApiClient.config.apiEndpoint);
53
52
  this._owner = new owner_1.default(ApiClient.config.apiEndpoint);
54
53
  this._conditionalOrders = new conditional_orders_1.default(ApiClient.network, ApiClient.config.apiEndpoint);
55
- this._lottery = new lottery_1.default(ApiClient.config.environment, ApiClient.config.apiEndpoint);
56
54
  this._referral = new referral_1.default(ApiClient.config.apiEndpoint);
57
55
  this._rageTrade = new rage_trade_1.default(ApiClient.config.apiEndpoint);
58
56
  this._auth = new auth_1.default(ApiClient.config.apiEndpoint);
@@ -391,20 +389,6 @@ var ApiClient = /** @class */ (function () {
391
389
  enumerable: false,
392
390
  configurable: true
393
391
  });
394
- Object.defineProperty(ApiClient, "lottery", {
395
- /**
396
- * Gets the current instance of the LotteryClient from the ApiClient.
397
- *
398
- * This static getter allows access to the LotteryClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the LotteryClient directly, bypassing the need to manually access the internal `_lottery` property of the ApiClient instance.
399
- *
400
- * @returns {LotteryClient} The LotteryClient instance currently held by the ApiClient.
401
- */
402
- get: function () {
403
- return ApiClient.getInstance()._lottery;
404
- },
405
- enumerable: false,
406
- configurable: true
407
- });
408
392
  Object.defineProperty(ApiClient, "referral", {
409
393
  /**
410
394
  * Gets the current instance of the ReferralClient from the ApiClient.
@@ -1 +1 @@
1
- {"version":3,"file":"api-client.js","sourceRoot":"/","sources":["clients/api-client.ts"],"names":[],"mappings":";;;;;;AAAA,0CAIyB;AACzB,8DAA8C;AAC9C,8DAA8C;AAC9C,gFAA+D;AAC/D,oDAAoC;AACpC,4DAA4C;AAC5C,0DAA0C;AAC1C,oGAAkF;AAClF,4GAAyF;AACzF,kGAA+E;AAC/E,8GAA2F;AAC3F,4FAA0E;AAC1E,gHAA6F;AAC7F,4HAAwG;AACxG,sGAAmF;AACnF,4FAA0E;AAC1E,wEAAuD;AACvD,kGAAgF;AAChF,oFAAmE;AACnE,8DAA8C;AAC9C,gEAAgD;AAChD,wDAAwC;AACxC,oEAAmD;AAEnD;;GAEG;AACH;IA0BE;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAa,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAChE,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAa,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAChE,IAAI,CAAC,GAAG,GAAG,IAAI,YAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACtD,IAAI,CAAC,gBAAgB,GAAG,IAAI,0BAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjE,IAAI,CAAC,wBAAwB,GAAG,IAAI,mCAA6B,CAC/D,IAAI,CAAC,QAAQ,CACd,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,IAAI,sBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChE,IAAI,CAAC,yBAAyB,GAAG,IAAI,oCAA8B,CACjE,SAAS,CAAC,OAAO,EACjB,IAAI,CAAC,QAAQ,CACd,CAAC;QACF,IAAI,CAAC,4BAA4B,GAAG,IAAI,wCAAiC,CACvE,IAAI,CAAC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AAC;CAAA,AAjaD,IAiaC;AAjaY,8BAAS","sourcesContent":["import {\n ServiceConfig,\n ReyaChainId,\n getApiClientConfig,\n} from '@reyaxyz/common';\nimport MarketsClient from './modules/markets';\nimport AccountClient from './modules/account';\nimport TradeSimulationClient from './modules/trade.simulation';\nimport LpClient from './modules/lp';\nimport TokensClient from './modules/tokens';\nimport OwnerClient from './modules/owner';\nimport EditCollateralSimulationClient from './modules/edit-collateral.simulation';\nimport DepositExistingMASimulationClient from './modules/deposit-existing-MA.simulation';\nimport DepositNewMASimulationClient from './modules/deposit-new-MA.simulation';\nimport DepositPassivePoolSimulationClient from './modules/deposit-passive-pool.simulation';\nimport WithdrawMASimulationClient from './modules/withdraw-MA.simulation';\nimport WithdrawPassivePoolSimulationClient from './modules/withdraw-passive-pool.simulation';\nimport TransferMarginBetweenMAsSimulationClient from './modules/transfer-margin-between-MAs.simulation';\nimport TransferMAPoolSimulationClient from './modules/transfer-MA-Pool.simulation';\nimport DepthChartSimulationClient from './modules/depth-chart.simulation';\nimport FundingRateClient from './modules/funding-rate';\nimport IsolatedOrderSimulationClient from './modules/isolated-order.simulation';\nimport ConditionalOrdersClient from './modules/conditional-orders';\nimport LotteryClient from './modules/lottery';\nimport ReferralClient from './modules/referral';\nimport AuthClient from './modules/auth';\nimport RageTradeClient from './modules/rage-trade';\n\n/**\n * @description Client for API\n */\nexport class ApiClient {\n private static instance: ApiClient;\n private static config: ServiceConfig = getApiClientConfig('test');\n private readonly _markets: MarketsClient;\n private readonly _account: AccountClient;\n private readonly _lp: LpClient;\n private readonly _tradeSimulation: TradeSimulationClient;\n private readonly _fundingRateHistory: FundingRateClient;\n private readonly _editCollateralSimulation: EditCollateralSimulationClient;\n private readonly _depositExistingMASimulation: DepositExistingMASimulationClient;\n private readonly _depositNewMASimulation: DepositNewMASimulationClient;\n private readonly _depositPassivePoolSimulation: DepositPassivePoolSimulationClient;\n private readonly _withdrawMASimulation: WithdrawMASimulationClient;\n private readonly _withdrawPassivePoolSimulation: WithdrawPassivePoolSimulationClient;\n private readonly _transferMarginBetweenMAsSimulation: TransferMarginBetweenMAsSimulationClient;\n private readonly _transferMAPoolSimulation: TransferMAPoolSimulationClient;\n private readonly _depthSimulation: DepthChartSimulationClient;\n private readonly _isolatedOrderSimulation: IsolatedOrderSimulationClient;\n private readonly _tokens: TokensClient;\n private readonly _owner: OwnerClient;\n private readonly _conditionalOrders: ConditionalOrdersClient;\n private readonly _lottery: LotteryClient;\n private readonly _referral: ReferralClient;\n private readonly _rageTrade: RageTradeClient;\n private readonly _auth: AuthClient;\n\n private constructor() {\n this._markets = new MarketsClient(ApiClient.config.apiEndpoint);\n this._account = new AccountClient(ApiClient.config.apiEndpoint);\n this._lp = new LpClient(ApiClient.config.apiEndpoint);\n this._tradeSimulation = new TradeSimulationClient(this._account);\n this._isolatedOrderSimulation = new IsolatedOrderSimulationClient(\n this._account,\n );\n this._fundingRateHistory = new FundingRateClient(this._markets);\n this._editCollateralSimulation = new EditCollateralSimulationClient(\n ApiClient.network,\n this._account,\n );\n this._depositExistingMASimulation = new DepositExistingMASimulationClient(\n this._editCollateralSimulation,\n ApiClient.config.apiEndpoint,\n );\n this._depositNewMASimulation = new DepositNewMASimulationClient(\n this._depositExistingMASimulation,\n );\n this._depositPassivePoolSimulation = new DepositPassivePoolSimulationClient(\n ApiClient.config.apiEndpoint,\n );\n this._withdrawMASimulation = new WithdrawMASimulationClient(\n this._editCollateralSimulation,\n ApiClient.config.chain,\n ApiClient.config.apiEndpoint,\n );\n this._withdrawPassivePoolSimulation =\n new WithdrawPassivePoolSimulationClient(\n ApiClient.config.chain,\n ApiClient.config.apiEndpoint,\n );\n this._transferMarginBetweenMAsSimulation =\n new TransferMarginBetweenMAsSimulationClient(\n ApiClient.network,\n this._account,\n );\n this._transferMAPoolSimulation = new TransferMAPoolSimulationClient(\n this._editCollateralSimulation,\n );\n\n this._depthSimulation = new DepthChartSimulationClient(this._lp);\n this._tokens = new TokensClient(ApiClient.config.apiEndpoint);\n this._owner = new OwnerClient(ApiClient.config.apiEndpoint);\n this._conditionalOrders = new ConditionalOrdersClient(\n ApiClient.network,\n ApiClient.config.apiEndpoint,\n );\n this._lottery = new LotteryClient(\n ApiClient.config.environment,\n ApiClient.config.apiEndpoint,\n );\n this._referral = new ReferralClient(ApiClient.config.apiEndpoint);\n this._rageTrade = new RageTradeClient(ApiClient.config.apiEndpoint);\n this._auth = new AuthClient(ApiClient.config.apiEndpoint);\n }\n\n public static configure(environment: ServiceConfig['environment']): void {\n ApiClient.config = getApiClientConfig(environment);\n ApiClient.instance = new ApiClient();\n }\n\n private static getInstance(): ApiClient {\n if (!ApiClient.instance) {\n throw new Error(\n 'ApiClient is not configured. Please configure it before using.',\n );\n }\n return ApiClient.instance;\n }\n public static get network(): ReyaChainId {\n if (!ApiClient.config.chain) {\n throw new Error('ApiClient is not configured');\n }\n return ApiClient.config.chain;\n }\n\n /**\n * Provides access to the MarketsClient instance.\n * This getter allows for interacting with market-related API functionalities.\n *\n * @returns {MarketsClient} An instance of MarketsClient for market-related operations.\n * @memberof ApiClient\n */\n public static get markets(): MarketsClient {\n return ApiClient.getInstance()._markets;\n }\n\n /**\n * Provides access to the AccountClient instance.\n * This getter allows for interacting with account-related API functionalities.\n *\n * @returns {AccountClient} An instance of AccountClient for account-related operations.\n * @memberof ApiClient\n */\n public static get account(): AccountClient {\n return ApiClient.getInstance()._account;\n }\n\n /**\n * Provides access to the TradeSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_tradeSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {TradeSimulationClient} An instance of TradeSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the trade simulation client from the ApiClient\n * const tradeSimulationClient = ApiClient.tradeSimulation;\n */\n\n public static get tradeSimulation(): TradeSimulationClient {\n return ApiClient.getInstance()._tradeSimulation;\n }\n\n /**\n * Provides access to the IsolatedOrderSimulationClient instance.\n * This getter allows for interacting with isolatedTrade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_isolatedTradeSimulation` property, ensuring that isolatedTrade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {IsolatedOrderSimulationClient} An instance of IsolatedOrderSimulationClient for isolatedTrade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the isolatedTrade simulation client from the ApiClient\n * const isolatedTradeSimulationClient = ApiClient.isolatedTradeSimulation;\n */\n public static get isolatedSimulation(): IsolatedOrderSimulationClient {\n return ApiClient.getInstance()._isolatedOrderSimulation;\n }\n\n public static get fundingRateHistory(): FundingRateClient {\n return ApiClient.getInstance()._fundingRateHistory;\n }\n\n /**\n * Retrieves the DepthChartSimulationClient instance used for depth simulation.\n * This method provides access to the depth simulation client through the ApiClient.\n * @returns {DepthChartSimulationClient} The DepthChartSimulationClient instance.\n * @static\n * @public\n */\n public static get depthSimulation(): DepthChartSimulationClient {\n return ApiClient.getInstance()._depthSimulation;\n }\n\n /**\n * Provides access to the EditCollateralSimulationClient instance.\n * This getter allows for interacting with edit collateral simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_editCollateralSimulation` property, ensuring that edit collateral simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {EditCollateralSimulationClient} An instance of EditCollateralSimulationClient for edit collateral simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the edit collateral simulation client from the ApiClient\n * const editCollateralSimulationClient = ApiClient.editCollateralSimulation;\n */\n\n public static get editCollateralSimulationClient(): EditCollateralSimulationClient {\n return ApiClient.getInstance()._editCollateralSimulation;\n }\n\n /**\n * Provides access to the DepositExistingMASimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_depositExistingMASimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {DepositExistingMASimulationClient} An instance of DepositExistingMASimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the deposit existing Ma simulation client from the ApiClient\n * const depositExistingMASimulationClient = ApiClient.depositExistingMASimulation;\n */\n\n public static get depositExistingMASimulation(): DepositExistingMASimulationClient {\n return ApiClient.getInstance()._depositExistingMASimulation;\n }\n\n /**\n * Provides access to the DepositNewMASimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_depositNewMASimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {DepositNewMASimulationClient} An instance of DepositNewMASimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the deposit new MA simulation client from the ApiClient\n * const depositNewMASimulationClient = ApiClient.depositNewMASimulation;\n */\n\n public static get depositNewMASimulation(): DepositNewMASimulationClient {\n return ApiClient.getInstance()._depositNewMASimulation;\n }\n\n /**\n * Provides access to the DepositPassivePoolSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_depositPassivePoolSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {DepositPassivePoolSimulationClient} An instance of DepositPassivePoolSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the deposit existing Ma simulation client from the ApiClient\n * const depositPassivePoolSimulationClient = ApiClient.depositPassivePoolSimulation;\n */\n\n public static get depositPassivePoolSimulation(): DepositPassivePoolSimulationClient {\n return ApiClient.getInstance()._depositPassivePoolSimulation;\n }\n\n /**\n * Provides access to the WithdrawMASimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_withdrawMASimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {WithdrawMASimulationClient} An instance of WithdrawMASimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the withdraw MA simulation client from the ApiClient\n * const withdrawMASimulationClient = ApiClient.withdrawMASimulation;\n */\n\n public static get withdrawMASimulation(): WithdrawMASimulationClient {\n return ApiClient.getInstance()._withdrawMASimulation;\n }\n\n /**\n * Provides access to the WithdrawPassivePoolSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_withdrawPassivePoolSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {WithdrawPassivePoolSimulationClient} An instance of WithdrawPassivePoolSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the withdraw MA simulation client from the ApiClient\n * const withdrawPassivePoolSimulationClient = ApiClient.withdrawPassivePoolSimulation;\n */\n\n public static get withdrawPassivePoolSimulation(): WithdrawPassivePoolSimulationClient {\n return ApiClient.getInstance()._withdrawPassivePoolSimulation;\n }\n\n /**\n * Provides access to the TransferMarginBetweenMAsSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_transferMarginBetweenMAsSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {TransferMarginBetweenMAsSimulationClient} An instance of TransferMarginBetweenMAsSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the transfer margin between MAs simulation client from the ApiClient\n * const transferMarginBetweenMAsSimulationClient = ApiClient.transferMarginBetweenMAsSimulation;\n */\n\n public static get transferMarginBetweenMAsSimulation(): TransferMarginBetweenMAsSimulationClient {\n return ApiClient.getInstance()._transferMarginBetweenMAsSimulation;\n }\n\n /**\n * Provides access to the TransferMAPoolSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_TransferMAPoolSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {TransferMAPoolSimulationClient} An instance of TransferMAPoolSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the transfer from MA to Pool simulation client from the ApiClient\n * const transferMAPoolSimulationClient = ApiClient.transferMAPoolSimulation;\n */\n\n public static get transferMAPoolSimulation(): TransferMAPoolSimulationClient {\n return ApiClient.getInstance()._transferMAPoolSimulation;\n }\n\n /**\n * Gets the current instance of the LpClient from the ApiClient.\n *\n * This static getter allows access to the LpClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the LpClient directly, bypassing the need to manually access the internal `_lp` property of the ApiClient instance.\n *\n * @returns {LpClient} The LpClient instance currently held by the ApiClient.\n * @example\n * // Assuming ApiClient and LpClient are properly set up\n * const lpClient = ApiClient.lp;\n */\n public static get lp(): LpClient {\n return ApiClient.getInstance()._lp;\n }\n\n /**\n * Gets the current instance of the TokensClient from the ApiClient.\n *\n * This static getter allows access to the TokensClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the TokensClient directly, bypassing the need to manually access the internal `_tokens` property of the ApiClient instance.\n *\n * @returns {TokensClient} The TokensClient instance currently held by the ApiClient.\n * @example\n * // Assuming ApiClient and TokensClient are properly set up\n * const tokensClient = ApiClient.tokens;\n */\n public static get tokens(): TokensClient {\n return ApiClient.getInstance()._tokens;\n }\n\n /**\n * Gets the current instance of the OwnerClient from the ApiClient.\n *\n * This static getter allows access to the OwnerClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the OwnerClient directly, bypassing the need to manually access the internal `_owner` property of the ApiClient instance.\n *\n * @returns {OwnerClient} The OwnerClient instance currently held by the ApiClient.\n * @example\n * // Assuming ApiClient and OwnerClient are properly set up\n * const ownerClient = ApiClient.tokens;\n */\n public static get owner(): OwnerClient {\n return ApiClient.getInstance()._owner;\n }\n\n /**\n * Gets the current instance of the ConditionalOrdersClient from the ApiClient.\n *\n * This static getter allows access to the ConditionalOrdersClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the ConditionalOrdersClient directly, bypassing the need to manually access the internal `_conditionalOrders` property of the ApiClient instance.\n *\n * @returns {ConditionalOrdersClient} The ConditionalOrdersClient instance currently held by the ApiClient.\n */\n public static get conditionalOrders(): ConditionalOrdersClient {\n return ApiClient.getInstance()._conditionalOrders;\n }\n\n /**\n * Gets the current instance of the LotteryClient from the ApiClient.\n *\n * This static getter allows access to the LotteryClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the LotteryClient directly, bypassing the need to manually access the internal `_lottery` property of the ApiClient instance.\n *\n * @returns {LotteryClient} The LotteryClient instance currently held by the ApiClient.\n */\n public static get lottery(): LotteryClient {\n return ApiClient.getInstance()._lottery;\n }\n\n /**\n * Gets the current instance of the ReferralClient from the ApiClient.\n *\n * This static getter allows access to the ReferralClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the ReferralClient directly, bypassing the need to manually access the internal `_referral` property of the ApiClient instance.\n *\n * @returns {ReferralClient} The ReferralClient instance currently held by the ApiClient.\n */\n public static get referral(): ReferralClient {\n return ApiClient.getInstance()._referral;\n }\n\n /**\n * Gets the current instance of the RageTradeClient from the ApiClient.\n *\n * This static getter allows access to the RageTradeClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the RageTradeClient directly, bypassing the need to manually access the internal `_rageTrade` property of the ApiClient instance.\n *\n * @returns {RageTradeClient} The RageTradeClient instance currently held by the ApiClient.\n */\n\n public static get rageTrade(): RageTradeClient {\n return ApiClient.getInstance()._rageTrade;\n }\n\n /**\n * Gets the current instance of the AuthClient from the ApiClient.\n *\n * This static getter allows access to the AuthClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the AuthClient directly, bypassing the need to manually access the internal `_auth` property of the ApiClient instance.\n *\n * @returns {AuthClient} The AuthClient instance currently held by the ApiClient.\n */\n public static get auth(): AuthClient {\n return ApiClient.getInstance()._auth;\n }\n}\n"]}
1
+ {"version":3,"file":"api-client.js","sourceRoot":"/","sources":["clients/api-client.ts"],"names":[],"mappings":";;;;;;AAAA,0CAIyB;AACzB,8DAA8C;AAC9C,8DAA8C;AAC9C,gFAA+D;AAC/D,oDAAoC;AACpC,4DAA4C;AAC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AAO,CAAC;QACzC,CAAC;;;OAAA;IAYD,sBAAkB,kBAAK;QAVvB;;;;;;;;;WASG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC;QACxC,CAAC;;;OAAA;IASD,sBAAkB,8BAAiB;QAPnC;;;;;;WAMG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,kBAAkB,CAAC;QACpD,CAAC;;;OAAA;IASD,sBAAkB,qBAAQ;QAP1B;;;;;;WAMG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC;QAC3C,CAAC;;;OAAA;IAUD,sBAAkB,sBAAS;QAR3B;;;;;;WAMG;aAEH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC;QAC5C,CAAC;;;OAAA;IASD,sBAAkB,iBAAI;QAPtB;;;;;;WAMG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC;QACvC,CAAC;;;OAAA;IA9Yc,gBAAM,GAAkB,IAAA,2BAAkB,EAAC,MAAM,CAAC,CAAC;IA+YpE,gBAAC;CAAA,AAjZD,IAiZC;AAjZY,8BAAS","sourcesContent":["import {\n ServiceConfig,\n ReyaChainId,\n getApiClientConfig,\n} from '@reyaxyz/common';\nimport MarketsClient from './modules/markets';\nimport AccountClient from './modules/account';\nimport TradeSimulationClient from './modules/trade.simulation';\nimport LpClient from './modules/lp';\nimport TokensClient from './modules/tokens';\nimport OwnerClient from './modules/owner';\nimport EditCollateralSimulationClient from './modules/edit-collateral.simulation';\nimport DepositExistingMASimulationClient from './modules/deposit-existing-MA.simulation';\nimport DepositNewMASimulationClient from './modules/deposit-new-MA.simulation';\nimport DepositPassivePoolSimulationClient from './modules/deposit-passive-pool.simulation';\nimport WithdrawMASimulationClient from './modules/withdraw-MA.simulation';\nimport WithdrawPassivePoolSimulationClient from './modules/withdraw-passive-pool.simulation';\nimport TransferMarginBetweenMAsSimulationClient from './modules/transfer-margin-between-MAs.simulation';\nimport TransferMAPoolSimulationClient from './modules/transfer-MA-Pool.simulation';\nimport DepthChartSimulationClient from './modules/depth-chart.simulation';\nimport FundingRateClient from './modules/funding-rate';\nimport IsolatedOrderSimulationClient from './modules/isolated-order.simulation';\nimport ConditionalOrdersClient from './modules/conditional-orders';\nimport ReferralClient from './modules/referral';\nimport AuthClient from './modules/auth';\nimport RageTradeClient from './modules/rage-trade';\n\n/**\n * @description Client for API\n */\nexport class ApiClient {\n private static instance: ApiClient;\n private static config: ServiceConfig = getApiClientConfig('test');\n private readonly _markets: MarketsClient;\n private readonly _account: AccountClient;\n private readonly _lp: LpClient;\n private readonly _tradeSimulation: TradeSimulationClient;\n private readonly _fundingRateHistory: FundingRateClient;\n private readonly _editCollateralSimulation: EditCollateralSimulationClient;\n private readonly _depositExistingMASimulation: DepositExistingMASimulationClient;\n private readonly _depositNewMASimulation: DepositNewMASimulationClient;\n private readonly _depositPassivePoolSimulation: DepositPassivePoolSimulationClient;\n private readonly _withdrawMASimulation: WithdrawMASimulationClient;\n private readonly _withdrawPassivePoolSimulation: WithdrawPassivePoolSimulationClient;\n private readonly _transferMarginBetweenMAsSimulation: TransferMarginBetweenMAsSimulationClient;\n private readonly _transferMAPoolSimulation: TransferMAPoolSimulationClient;\n private readonly _depthSimulation: DepthChartSimulationClient;\n private readonly _isolatedOrderSimulation: IsolatedOrderSimulationClient;\n private readonly _tokens: TokensClient;\n private readonly _owner: OwnerClient;\n private readonly _conditionalOrders: ConditionalOrdersClient;\n private readonly _referral: ReferralClient;\n private readonly _rageTrade: RageTradeClient;\n private readonly _auth: AuthClient;\n\n private constructor() {\n this._markets = new MarketsClient(ApiClient.config.apiEndpoint);\n this._account = new AccountClient(ApiClient.config.apiEndpoint);\n this._lp = new LpClient(ApiClient.config.apiEndpoint);\n this._tradeSimulation = new TradeSimulationClient(this._account);\n this._isolatedOrderSimulation = new IsolatedOrderSimulationClient(\n this._account,\n );\n this._fundingRateHistory = new FundingRateClient(this._markets);\n this._editCollateralSimulation = new EditCollateralSimulationClient(\n ApiClient.network,\n this._account,\n );\n this._depositExistingMASimulation = new DepositExistingMASimulationClient(\n this._editCollateralSimulation,\n ApiClient.config.apiEndpoint,\n );\n this._depositNewMASimulation = new DepositNewMASimulationClient(\n this._depositExistingMASimulation,\n );\n this._depositPassivePoolSimulation = new DepositPassivePoolSimulationClient(\n ApiClient.config.apiEndpoint,\n );\n this._withdrawMASimulation = new WithdrawMASimulationClient(\n this._editCollateralSimulation,\n ApiClient.config.chain,\n ApiClient.config.apiEndpoint,\n );\n this._withdrawPassivePoolSimulation =\n new WithdrawPassivePoolSimulationClient(\n ApiClient.config.chain,\n ApiClient.config.apiEndpoint,\n );\n this._transferMarginBetweenMAsSimulation =\n new TransferMarginBetweenMAsSimulationClient(\n ApiClient.network,\n this._account,\n );\n this._transferMAPoolSimulation = new TransferMAPoolSimulationClient(\n this._editCollateralSimulation,\n );\n\n this._depthSimulation = new DepthChartSimulationClient(this._lp);\n this._tokens = new TokensClient(ApiClient.config.apiEndpoint);\n this._owner = new OwnerClient(ApiClient.config.apiEndpoint);\n this._conditionalOrders = new ConditionalOrdersClient(\n ApiClient.network,\n ApiClient.config.apiEndpoint,\n );\n this._referral = new ReferralClient(ApiClient.config.apiEndpoint);\n this._rageTrade = new RageTradeClient(ApiClient.config.apiEndpoint);\n this._auth = new AuthClient(ApiClient.config.apiEndpoint);\n }\n\n public static configure(environment: ServiceConfig['environment']): void {\n ApiClient.config = getApiClientConfig(environment);\n ApiClient.instance = new ApiClient();\n }\n\n private static getInstance(): ApiClient {\n if (!ApiClient.instance) {\n throw new Error(\n 'ApiClient is not configured. Please configure it before using.',\n );\n }\n return ApiClient.instance;\n }\n public static get network(): ReyaChainId {\n if (!ApiClient.config.chain) {\n throw new Error('ApiClient is not configured');\n }\n return ApiClient.config.chain;\n }\n\n /**\n * Provides access to the MarketsClient instance.\n * This getter allows for interacting with market-related API functionalities.\n *\n * @returns {MarketsClient} An instance of MarketsClient for market-related operations.\n * @memberof ApiClient\n */\n public static get markets(): MarketsClient {\n return ApiClient.getInstance()._markets;\n }\n\n /**\n * Provides access to the AccountClient instance.\n * This getter allows for interacting with account-related API functionalities.\n *\n * @returns {AccountClient} An instance of AccountClient for account-related operations.\n * @memberof ApiClient\n */\n public static get account(): AccountClient {\n return ApiClient.getInstance()._account;\n }\n\n /**\n * Provides access to the TradeSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_tradeSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {TradeSimulationClient} An instance of TradeSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the trade simulation client from the ApiClient\n * const tradeSimulationClient = ApiClient.tradeSimulation;\n */\n\n public static get tradeSimulation(): TradeSimulationClient {\n return ApiClient.getInstance()._tradeSimulation;\n }\n\n /**\n * Provides access to the IsolatedOrderSimulationClient instance.\n * This getter allows for interacting with isolatedTrade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_isolatedTradeSimulation` property, ensuring that isolatedTrade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {IsolatedOrderSimulationClient} An instance of IsolatedOrderSimulationClient for isolatedTrade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the isolatedTrade simulation client from the ApiClient\n * const isolatedTradeSimulationClient = ApiClient.isolatedTradeSimulation;\n */\n public static get isolatedSimulation(): IsolatedOrderSimulationClient {\n return ApiClient.getInstance()._isolatedOrderSimulation;\n }\n\n public static get fundingRateHistory(): FundingRateClient {\n return ApiClient.getInstance()._fundingRateHistory;\n }\n\n /**\n * Retrieves the DepthChartSimulationClient instance used for depth simulation.\n * This method provides access to the depth simulation client through the ApiClient.\n * @returns {DepthChartSimulationClient} The DepthChartSimulationClient instance.\n * @static\n * @public\n */\n public static get depthSimulation(): DepthChartSimulationClient {\n return ApiClient.getInstance()._depthSimulation;\n }\n\n /**\n * Provides access to the EditCollateralSimulationClient instance.\n * This getter allows for interacting with edit collateral simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_editCollateralSimulation` property, ensuring that edit collateral simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {EditCollateralSimulationClient} An instance of EditCollateralSimulationClient for edit collateral simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the edit collateral simulation client from the ApiClient\n * const editCollateralSimulationClient = ApiClient.editCollateralSimulation;\n */\n\n public static get editCollateralSimulationClient(): EditCollateralSimulationClient {\n return ApiClient.getInstance()._editCollateralSimulation;\n }\n\n /**\n * Provides access to the DepositExistingMASimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_depositExistingMASimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {DepositExistingMASimulationClient} An instance of DepositExistingMASimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the deposit existing Ma simulation client from the ApiClient\n * const depositExistingMASimulationClient = ApiClient.depositExistingMASimulation;\n */\n\n public static get depositExistingMASimulation(): DepositExistingMASimulationClient {\n return ApiClient.getInstance()._depositExistingMASimulation;\n }\n\n /**\n * Provides access to the DepositNewMASimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_depositNewMASimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {DepositNewMASimulationClient} An instance of DepositNewMASimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the deposit new MA simulation client from the ApiClient\n * const depositNewMASimulationClient = ApiClient.depositNewMASimulation;\n */\n\n public static get depositNewMASimulation(): DepositNewMASimulationClient {\n return ApiClient.getInstance()._depositNewMASimulation;\n }\n\n /**\n * Provides access to the DepositPassivePoolSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_depositPassivePoolSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {DepositPassivePoolSimulationClient} An instance of DepositPassivePoolSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the deposit existing Ma simulation client from the ApiClient\n * const depositPassivePoolSimulationClient = ApiClient.depositPassivePoolSimulation;\n */\n\n public static get depositPassivePoolSimulation(): DepositPassivePoolSimulationClient {\n return ApiClient.getInstance()._depositPassivePoolSimulation;\n }\n\n /**\n * Provides access to the WithdrawMASimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_withdrawMASimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {WithdrawMASimulationClient} An instance of WithdrawMASimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the withdraw MA simulation client from the ApiClient\n * const withdrawMASimulationClient = ApiClient.withdrawMASimulation;\n */\n\n public static get withdrawMASimulation(): WithdrawMASimulationClient {\n return ApiClient.getInstance()._withdrawMASimulation;\n }\n\n /**\n * Provides access to the WithdrawPassivePoolSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_withdrawPassivePoolSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {WithdrawPassivePoolSimulationClient} An instance of WithdrawPassivePoolSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the withdraw MA simulation client from the ApiClient\n * const withdrawPassivePoolSimulationClient = ApiClient.withdrawPassivePoolSimulation;\n */\n\n public static get withdrawPassivePoolSimulation(): WithdrawPassivePoolSimulationClient {\n return ApiClient.getInstance()._withdrawPassivePoolSimulation;\n }\n\n /**\n * Provides access to the TransferMarginBetweenMAsSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_transferMarginBetweenMAsSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {TransferMarginBetweenMAsSimulationClient} An instance of TransferMarginBetweenMAsSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the transfer margin between MAs simulation client from the ApiClient\n * const transferMarginBetweenMAsSimulationClient = ApiClient.transferMarginBetweenMAsSimulation;\n */\n\n public static get transferMarginBetweenMAsSimulation(): TransferMarginBetweenMAsSimulationClient {\n return ApiClient.getInstance()._transferMarginBetweenMAsSimulation;\n }\n\n /**\n * Provides access to the TransferMAPoolSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_TransferMAPoolSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {TransferMAPoolSimulationClient} An instance of TransferMAPoolSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the transfer from MA to Pool simulation client from the ApiClient\n * const transferMAPoolSimulationClient = ApiClient.transferMAPoolSimulation;\n */\n\n public static get transferMAPoolSimulation(): TransferMAPoolSimulationClient {\n return ApiClient.getInstance()._transferMAPoolSimulation;\n }\n\n /**\n * Gets the current instance of the LpClient from the ApiClient.\n *\n * This static getter allows access to the LpClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the LpClient directly, bypassing the need to manually access the internal `_lp` property of the ApiClient instance.\n *\n * @returns {LpClient} The LpClient instance currently held by the ApiClient.\n * @example\n * // Assuming ApiClient and LpClient are properly set up\n * const lpClient = ApiClient.lp;\n */\n public static get lp(): LpClient {\n return ApiClient.getInstance()._lp;\n }\n\n /**\n * Gets the current instance of the TokensClient from the ApiClient.\n *\n * This static getter allows access to the TokensClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the TokensClient directly, bypassing the need to manually access the internal `_tokens` property of the ApiClient instance.\n *\n * @returns {TokensClient} The TokensClient instance currently held by the ApiClient.\n * @example\n * // Assuming ApiClient and TokensClient are properly set up\n * const tokensClient = ApiClient.tokens;\n */\n public static get tokens(): TokensClient {\n return ApiClient.getInstance()._tokens;\n }\n\n /**\n * Gets the current instance of the OwnerClient from the ApiClient.\n *\n * This static getter allows access to the OwnerClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the OwnerClient directly, bypassing the need to manually access the internal `_owner` property of the ApiClient instance.\n *\n * @returns {OwnerClient} The OwnerClient instance currently held by the ApiClient.\n * @example\n * // Assuming ApiClient and OwnerClient are properly set up\n * const ownerClient = ApiClient.tokens;\n */\n public static get owner(): OwnerClient {\n return ApiClient.getInstance()._owner;\n }\n\n /**\n * Gets the current instance of the ConditionalOrdersClient from the ApiClient.\n *\n * This static getter allows access to the ConditionalOrdersClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the ConditionalOrdersClient directly, bypassing the need to manually access the internal `_conditionalOrders` property of the ApiClient instance.\n *\n * @returns {ConditionalOrdersClient} The ConditionalOrdersClient instance currently held by the ApiClient.\n */\n public static get conditionalOrders(): ConditionalOrdersClient {\n return ApiClient.getInstance()._conditionalOrders;\n }\n\n /**\n * Gets the current instance of the ReferralClient from the ApiClient.\n *\n * This static getter allows access to the ReferralClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the ReferralClient directly, bypassing the need to manually access the internal `_referral` property of the ApiClient instance.\n *\n * @returns {ReferralClient} The ReferralClient instance currently held by the ApiClient.\n */\n public static get referral(): ReferralClient {\n return ApiClient.getInstance()._referral;\n }\n\n /**\n * Gets the current instance of the RageTradeClient from the ApiClient.\n *\n * This static getter allows access to the RageTradeClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the RageTradeClient directly, bypassing the need to manually access the internal `_rageTrade` property of the ApiClient instance.\n *\n * @returns {RageTradeClient} The RageTradeClient instance currently held by the ApiClient.\n */\n\n public static get rageTrade(): RageTradeClient {\n return ApiClient.getInstance()._rageTrade;\n }\n\n /**\n * Gets the current instance of the AuthClient from the ApiClient.\n *\n * This static getter allows access to the AuthClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the AuthClient directly, bypassing the need to manually access the internal `_auth` property of the ApiClient instance.\n *\n * @returns {AuthClient} The AuthClient instance currently held by the ApiClient.\n */\n public static get auth(): AuthClient {\n return ApiClient.getInstance()._auth;\n }\n}\n"]}
@@ -46,5 +46,4 @@ __exportStar(require("./modules/depth-chart.simulation/types"), exports);
46
46
  __exportStar(require("./modules/deposit-passive-pool.simulation/types"), exports);
47
47
  __exportStar(require("./modules/isolated-order.simulation/types"), exports);
48
48
  __exportStar(require("./modules/rage-trade/types"), exports);
49
- __exportStar(require("./modules/lottery/types"), exports);
50
49
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,0CA4ByB;AA1BvB,2GAAA,iBAAiB,OAAA;AAYjB,qGAAA,WAAW,OAAA;AACX,2GAAA,iBAAiB,OAAA;AACjB,8GAAA,oBAAoB,OAAA;AACpB,yHAAA,+BAA+B,OAAA;AAE/B,oIAAA,0CAA0C,OAAA;AAG1C,6HAAA,mCAAmC,OAAA;AAEnC,uHAAA,6BAA6B,OAAA;AAG7B,8GAAA,oBAAoB,OAAA;AAEtB,0DAAwC;AACxC,qEAAmD;AACnD,qDAAmC;AACnC,0DAAwC;AACxC,yDAAuC;AACvC,mEAAiD;AACjD,wDAAsC;AACtC,iFAA+D;AAC/D,4EAA0D;AAC1D,kFAAgE;AAChE,6EAA2D;AAC3D,yEAAuD;AACvD,mFAAiE;AACjE,yFAAuE;AACvE,8EAA4D;AAC5D,+DAA6C;AAC7C,yEAAuD;AACvD,kFAAgE;AAChE,4EAA0D;AAC1D,6DAA2C;AAC3C,0DAAwC","sourcesContent":["// reexporting what we want to share with integrators\nexport {\n Candle,\n CandlesResolution,\n MarketEntity,\n LpTransactionHistoryEntity,\n TradingHistoryEntity,\n OrderHistoryEntity,\n PositionEntity,\n TransactionHistoryType,\n MarginAccountTransactionHistoryType,\n MarginAccountTransactionHistoryEntity,\n MarginAccountEntity,\n LpPositionEntity,\n LpPoolEntity,\n ReyaChainId,\n MoneyInOutChainId,\n LpBalanceGranularity,\n MarginAccountBalanceGranularity,\n GetMarginAccountBalanceChartDataResult,\n MarginAccountCollateralsBalanceGranularity,\n GetMarginAccountCollateralsBalanceChartDataResult,\n GetAllMarginAccountsBalanceChartDataResult,\n AllMarginAccountsBalanceGranularity,\n GetFundingRateChartDataResult,\n FundingRateHistoryGranularity,\n MoneyInOutConfigurationPerTokenName,\n UnifiedConditionalOrderType,\n ConditionalOrderType,\n} from '@reyaxyz/common';\nexport * from './modules/account/types';\nexport * from './modules/conditional-orders/types';\nexport * from './modules/lp/types';\nexport * from './modules/markets/types';\nexport * from './modules/tokens/types';\nexport * from './modules/trade.simulation/types';\nexport * from './modules/owner/types';\nexport * from './modules/deposit-existing-MA.simulation/types';\nexport * from './modules/deposit-new-MA.simulation/types';\nexport * from './modules/deposit-passive-pool.simulation/types';\nexport * from './modules/edit-collateral.simulation/types';\nexport * from './modules/withdraw-MA.simulation/types';\nexport * from './modules/withdraw-passive-pool.simulation/types';\nexport * from './modules/transfer-margin-between-MAs.simulation/types';\nexport * from './modules/transfer-MA-Pool.simulation/types';\nexport * from './modules/funding-rate/types';\nexport * from './modules/depth-chart.simulation/types';\nexport * from './modules/deposit-passive-pool.simulation/types';\nexport * from './modules/isolated-order.simulation/types';\nexport * from './modules/rage-trade/types';\nexport * from './modules/lottery/types';\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,0CA4ByB;AA1BvB,2GAAA,iBAAiB,OAAA;AAYjB,qGAAA,WAAW,OAAA;AACX,2GAAA,iBAAiB,OAAA;AACjB,8GAAA,oBAAoB,OAAA;AACpB,yHAAA,+BAA+B,OAAA;AAE/B,oIAAA,0CAA0C,OAAA;AAG1C,6HAAA,mCAAmC,OAAA;AAEnC,uHAAA,6BAA6B,OAAA;AAG7B,8GAAA,oBAAoB,OAAA;AAEtB,0DAAwC;AACxC,qEAAmD;AACnD,qDAAmC;AACnC,0DAAwC;AACxC,yDAAuC;AACvC,mEAAiD;AACjD,wDAAsC;AACtC,iFAA+D;AAC/D,4EAA0D;AAC1D,kFAAgE;AAChE,6EAA2D;AAC3D,yEAAuD;AACvD,mFAAiE;AACjE,yFAAuE;AACvE,8EAA4D;AAC5D,+DAA6C;AAC7C,yEAAuD;AACvD,kFAAgE;AAChE,4EAA0D;AAC1D,6DAA2C","sourcesContent":["// reexporting what we want to share with integrators\nexport {\n Candle,\n CandlesResolution,\n MarketEntity,\n LpTransactionHistoryEntity,\n TradingHistoryEntity,\n OrderHistoryEntity,\n PositionEntity,\n TransactionHistoryType,\n MarginAccountTransactionHistoryType,\n MarginAccountTransactionHistoryEntity,\n MarginAccountEntity,\n LpPositionEntity,\n LpPoolEntity,\n ReyaChainId,\n MoneyInOutChainId,\n LpBalanceGranularity,\n MarginAccountBalanceGranularity,\n GetMarginAccountBalanceChartDataResult,\n MarginAccountCollateralsBalanceGranularity,\n GetMarginAccountCollateralsBalanceChartDataResult,\n GetAllMarginAccountsBalanceChartDataResult,\n AllMarginAccountsBalanceGranularity,\n GetFundingRateChartDataResult,\n FundingRateHistoryGranularity,\n MoneyInOutConfigurationPerTokenName,\n UnifiedConditionalOrderType,\n ConditionalOrderType,\n} from '@reyaxyz/common';\nexport * from './modules/account/types';\nexport * from './modules/conditional-orders/types';\nexport * from './modules/lp/types';\nexport * from './modules/markets/types';\nexport * from './modules/tokens/types';\nexport * from './modules/trade.simulation/types';\nexport * from './modules/owner/types';\nexport * from './modules/deposit-existing-MA.simulation/types';\nexport * from './modules/deposit-new-MA.simulation/types';\nexport * from './modules/deposit-passive-pool.simulation/types';\nexport * from './modules/edit-collateral.simulation/types';\nexport * from './modules/withdraw-MA.simulation/types';\nexport * from './modules/withdraw-passive-pool.simulation/types';\nexport * from './modules/transfer-margin-between-MAs.simulation/types';\nexport * from './modules/transfer-MA-Pool.simulation/types';\nexport * from './modules/funding-rate/types';\nexport * from './modules/depth-chart.simulation/types';\nexport * from './modules/deposit-passive-pool.simulation/types';\nexport * from './modules/isolated-order.simulation/types';\nexport * from './modules/rage-trade/types';\n"]}
@@ -17,7 +17,6 @@ import DepthChartSimulationClient from './modules/depth-chart.simulation';
17
17
  import FundingRateClient from './modules/funding-rate';
18
18
  import IsolatedOrderSimulationClient from './modules/isolated-order.simulation';
19
19
  import ConditionalOrdersClient from './modules/conditional-orders';
20
- import LotteryClient from './modules/lottery';
21
20
  import ReferralClient from './modules/referral';
22
21
  import AuthClient from './modules/auth';
23
22
  import RageTradeClient from './modules/rage-trade';
@@ -45,7 +44,6 @@ export declare class ApiClient {
45
44
  private readonly _tokens;
46
45
  private readonly _owner;
47
46
  private readonly _conditionalOrders;
48
- private readonly _lottery;
49
47
  private readonly _referral;
50
48
  private readonly _rageTrade;
51
49
  private readonly _auth;
@@ -259,14 +257,6 @@ export declare class ApiClient {
259
257
  * @returns {ConditionalOrdersClient} The ConditionalOrdersClient instance currently held by the ApiClient.
260
258
  */
261
259
  static get conditionalOrders(): ConditionalOrdersClient;
262
- /**
263
- * Gets the current instance of the LotteryClient from the ApiClient.
264
- *
265
- * This static getter allows access to the LotteryClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the LotteryClient directly, bypassing the need to manually access the internal `_lottery` property of the ApiClient instance.
266
- *
267
- * @returns {LotteryClient} The LotteryClient instance currently held by the ApiClient.
268
- */
269
- static get lottery(): LotteryClient;
270
260
  /**
271
261
  * Gets the current instance of the ReferralClient from the ApiClient.
272
262
  *
@@ -1 +1 @@
1
- {"version":3,"file":"api-client.d.ts","sourceRoot":"/","sources":["clients/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,WAAW,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,aAAa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G;IAEH,WAAkB,2BAA2B,IAAI,iCAAiC,CAEjF;IAED;;;;;;;;;;;;OAYG;IAEH,WAAkB,sBAAsB,IAAI,4BAA4B,CAEvE;IAED;;;;;;;;;;;;OAYG;IAEH,WAAkB,4BAA4B,IAAI,kCAAkC,CAEnF;IAED;;;;;;;;;;;;OAYG;IAEH,WAAkB,oBAAoB,IAAI,0BAA0B,CAEnE;IAED;;;;;;;;;;;;OAYG;IAEH,WAAkB,6BAA6B,IAAI,mCAAmC,CAErF;IAED;;;;;;;;;;;;OAYG;IAEH,WAAkB,kCAAkC,IAAI,wCAAwC,CAE/F;IAED;;;;;;;;;;;;OAYG;IAEH,WAAkB,wBAAwB,IAAI,8BAA8B,CAE3E;IAED;;;;;;;;;OASG;IACH,WAAkB,EAAE,IAAI,QAAQ,CAE/B;IAED;;;;;;;;;OASG;IACH,WAAkB,MAAM,IAAI,YAAY,CAEvC;IAED;;;;;;;;;OASG;IACH,WAAkB,KAAK,IAAI,WAAW,CAErC;IAED;;;;;;OAMG;IACH,WAAkB,iBAAiB,IAAI,uBAAuB,CAE7D;IAED;;;;;;OAMG;IACH,WAAkB,QAAQ,IAAI,cAAc,CAE3C;IAED;;;;;;OAMG;IAEH,WAAkB,SAAS,IAAI,eAAe,CAE7C;IAED;;;;;;OAMG;IACH,WAAkB,IAAI,IAAI,UAAU,CAEnC;CACF"}
@@ -19,5 +19,4 @@ export * from './modules/depth-chart.simulation/types';
19
19
  export * from './modules/deposit-passive-pool.simulation/types';
20
20
  export * from './modules/isolated-order.simulation/types';
21
21
  export * from './modules/rage-trade/types';
22
- export * from './modules/lottery/types';
23
22
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EAC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,EAC1C,mCAAmC,EACnC,6BAA6B,EAC7B,6BAA6B,EAC7B,mCAAmC,EACnC,2BAA2B,EAC3B,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,gDAAgD,CAAC;AAC/D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iDAAiD,CAAC;AAChE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,kDAAkD,CAAC;AACjE,cAAc,wDAAwD,CAAC;AACvE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4BAA4B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/api-sdk",
3
- "version": "0.153.46",
3
+ "version": "0.154.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -33,7 +33,7 @@
33
33
  "generate:coverage-badges": "npx istanbul-badges-readme --silent"
34
34
  },
35
35
  "dependencies": {
36
- "@reyaxyz/common": "0.295.1",
36
+ "@reyaxyz/common": "0.296.0",
37
37
  "@simplewebauthn/types": "^10.0.0",
38
38
  "axios": "^1.6.2",
39
39
  "bignumber.js": "^9.1.2",
@@ -42,8 +42,8 @@
42
42
  "ws": "^8.16.0"
43
43
  },
44
44
  "packageManager": "pnpm@8.3.1",
45
- "gitHead": "6ae13e419b8e951b20d8e63ed3a8f955f0fa3d52",
45
+ "gitHead": "f6c3754e3b0e4bc328881057d1f0ec69fa9cd68e",
46
46
  "devDependencies": {
47
- "@reyaxyz/database": "0.132.1"
47
+ "@reyaxyz/database": "0.132.2"
48
48
  }
49
49
  }
@@ -21,7 +21,6 @@ import DepthChartSimulationClient from './modules/depth-chart.simulation';
21
21
  import FundingRateClient from './modules/funding-rate';
22
22
  import IsolatedOrderSimulationClient from './modules/isolated-order.simulation';
23
23
  import ConditionalOrdersClient from './modules/conditional-orders';
24
- import LotteryClient from './modules/lottery';
25
24
  import ReferralClient from './modules/referral';
26
25
  import AuthClient from './modules/auth';
27
26
  import RageTradeClient from './modules/rage-trade';
@@ -50,7 +49,6 @@ export class ApiClient {
50
49
  private readonly _tokens: TokensClient;
51
50
  private readonly _owner: OwnerClient;
52
51
  private readonly _conditionalOrders: ConditionalOrdersClient;
53
- private readonly _lottery: LotteryClient;
54
52
  private readonly _referral: ReferralClient;
55
53
  private readonly _rageTrade: RageTradeClient;
56
54
  private readonly _auth: AuthClient;
@@ -104,10 +102,6 @@ export class ApiClient {
104
102
  ApiClient.network,
105
103
  ApiClient.config.apiEndpoint,
106
104
  );
107
- this._lottery = new LotteryClient(
108
- ApiClient.config.environment,
109
- ApiClient.config.apiEndpoint,
110
- );
111
105
  this._referral = new ReferralClient(ApiClient.config.apiEndpoint);
112
106
  this._rageTrade = new RageTradeClient(ApiClient.config.apiEndpoint);
113
107
  this._auth = new AuthClient(ApiClient.config.apiEndpoint);
@@ -402,17 +396,6 @@ export class ApiClient {
402
396
  return ApiClient.getInstance()._conditionalOrders;
403
397
  }
404
398
 
405
- /**
406
- * Gets the current instance of the LotteryClient from the ApiClient.
407
- *
408
- * This static getter allows access to the LotteryClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the LotteryClient directly, bypassing the need to manually access the internal `_lottery` property of the ApiClient instance.
409
- *
410
- * @returns {LotteryClient} The LotteryClient instance currently held by the ApiClient.
411
- */
412
- public static get lottery(): LotteryClient {
413
- return ApiClient.getInstance()._lottery;
414
- }
415
-
416
399
  /**
417
400
  * Gets the current instance of the ReferralClient from the ApiClient.
418
401
  *
@@ -48,4 +48,3 @@ export * from './modules/depth-chart.simulation/types';
48
48
  export * from './modules/deposit-passive-pool.simulation/types';
49
49
  export * from './modules/isolated-order.simulation/types';
50
50
  export * from './modules/rage-trade/types';
51
- export * from './modules/lottery/types';
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LOTTERY_CONFIGS = void 0;
4
- exports.LOTTERY_CONFIGS = {
5
- production: {
6
- address: '0x1Fe50318e5E3165742eDC9c4a15d997bDB935Eb9',
7
- marginAccountId: 20092,
8
- },
9
- staging: {
10
- address: '0x1Fe50318e5E3165742eDC9c4a15d997bDB935Eb9',
11
- marginAccountId: 20092,
12
- },
13
- localmainnet: {
14
- address: '0x1Fe50318e5E3165742eDC9c4a15d997bDB935Eb9',
15
- marginAccountId: 20092,
16
- },
17
- test: {
18
- address: '0xaE173a960084903b1d278Ff9E3A81DeD82275556',
19
- marginAccountId: 6888,
20
- },
21
- localtestnet: {
22
- address: '0xaE173a960084903b1d278Ff9E3A81DeD82275556',
23
- marginAccountId: 6888,
24
- },
25
- };
26
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"/","sources":["clients/modules/lottery/constants.ts"],"names":[],"mappings":";;;AAOa,QAAA,eAAe,GAA8C;IACxE,UAAU,EAAE;QACV,OAAO,EAAE,4CAA4C;QACrD,eAAe,EAAE,KAAK;KACvB;IACD,OAAO,EAAE;QACP,OAAO,EAAE,4CAA4C;QACrD,eAAe,EAAE,KAAK;KACvB;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,4CAA4C;QACrD,eAAe,EAAE,KAAK;KACvB;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,4CAA4C;QACrD,eAAe,EAAE,IAAI;KACtB;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,4CAA4C;QACrD,eAAe,EAAE,IAAI;KACtB;CACF,CAAC","sourcesContent":["import { MarginAccountEntity, ServiceEnvironment } from '@reyaxyz/common';\n\ntype LotteryConfig = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n};\n\nexport const LOTTERY_CONFIGS: Record<ServiceEnvironment, LotteryConfig> = {\n production: {\n address: '0x1Fe50318e5E3165742eDC9c4a15d997bDB935Eb9',\n marginAccountId: 20092,\n },\n staging: {\n address: '0x1Fe50318e5E3165742eDC9c4a15d997bDB935Eb9',\n marginAccountId: 20092,\n },\n localmainnet: {\n address: '0x1Fe50318e5E3165742eDC9c4a15d997bDB935Eb9',\n marginAccountId: 20092,\n },\n test: {\n address: '0xaE173a960084903b1d278Ff9E3A81DeD82275556',\n marginAccountId: 6888,\n },\n localtestnet: {\n address: '0xaE173a960084903b1d278Ff9E3A81DeD82275556',\n marginAccountId: 6888,\n },\n};\n"]}
@@ -1,162 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
- return new (P || (P = Promise))(function (resolve, reject) {
31
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
- step((generator = generator.apply(thisArg, _arguments || [])).next());
35
- });
36
- };
37
- var __generator = (this && this.__generator) || function (thisArg, body) {
38
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
- function verb(n) { return function (v) { return step([n, v]); }; }
41
- function step(op) {
42
- if (f) throw new TypeError("Generator is already executing.");
43
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
44
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
- if (y = 0, t) op = [op[0] & 2, t.value];
46
- switch (op[0]) {
47
- case 0: case 1: t = op; break;
48
- case 4: _.label++; return { value: op[1], done: false };
49
- case 5: _.label++; y = op[1]; op = [0]; continue;
50
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
51
- default:
52
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
53
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
54
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
55
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
56
- if (t[2]) _.ops.pop();
57
- _.trys.pop(); continue;
58
- }
59
- op = body.call(thisArg, _);
60
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
61
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
62
- }
63
- };
64
- Object.defineProperty(exports, "__esModule", { value: true });
65
- var common_1 = require("@reyaxyz/common");
66
- var LotteryClient = /** @class */ (function (_super) {
67
- __extends(LotteryClient, _super);
68
- function LotteryClient(serviceEnvironment, host) {
69
- var _this = _super.call(this, host) || this;
70
- _this.serviceEnvironment = 'test';
71
- _this.serviceEnvironment = serviceEnvironment;
72
- return _this;
73
- }
74
- LotteryClient.prototype.getLotteryPotBalance = function () {
75
- return __awaiter(this, void 0, void 0, function () {
76
- return __generator(this, function (_a) {
77
- // const lotteryPotOwnerAddress: string =
78
- // LOTTERY_CONFIGS[this.serviceEnvironment].address;
79
- // const lotteryPotAccountId: MarginAccountEntity['id'] =
80
- // LOTTERY_CONFIGS[this.serviceEnvironment].marginAccountId;
81
- // const contributionFromReya: number = 20000;
82
- // const uri = `/api/accounts/${lotteryPotOwnerAddress}/marginAccount/${lotteryPotAccountId}`;
83
- // const lotteryPotMarginAccountData: MarginAccountEntity =
84
- // await this.get<MarginAccountEntity>(uri);
85
- // return lotteryPotMarginAccountData.totalBalance + contributionFromReya;
86
- return [2 /*return*/, 23598.637065];
87
- });
88
- });
89
- };
90
- LotteryClient.prototype.getNumberOfLotteryTickets = function (walletAddress) {
91
- return __awaiter(this, void 0, void 0, function () {
92
- return __generator(this, function (_a) {
93
- // todo: p1: add implementation
94
- console.log(walletAddress);
95
- return [2 /*return*/, 1];
96
- });
97
- });
98
- };
99
- LotteryClient.prototype.getEnhancedLotteryWinners = function (lotteryWinners) {
100
- return __awaiter(this, void 0, void 0, function () {
101
- var lotteryPot, amounts, enhancedLotteryWinners;
102
- return __generator(this, function (_a) {
103
- switch (_a.label) {
104
- case 0: return [4 /*yield*/, this.getLotteryPotBalance()];
105
- case 1:
106
- lotteryPot = _a.sent();
107
- amounts = {
108
- 1: lotteryPot * 0.7,
109
- 2: lotteryPot * 0.2,
110
- 3: lotteryPot * 0.1,
111
- };
112
- enhancedLotteryWinners = {
113
- winners: lotteryWinners.winners.map(function (winner) {
114
- return __assign(__assign({}, winner), { amount: amounts[winner.place] });
115
- }),
116
- executor: lotteryWinners.executor,
117
- };
118
- return [2 /*return*/, enhancedLotteryWinners];
119
- }
120
- });
121
- });
122
- };
123
- LotteryClient.prototype.getLotteryWinners = function () {
124
- return __awaiter(this, void 0, void 0, function () {
125
- var uri, lotteryWinners;
126
- return __generator(this, function (_a) {
127
- switch (_a.label) {
128
- case 0:
129
- uri = '/api/xp/lottery/get-winners';
130
- return [4 /*yield*/, this.get(uri)];
131
- case 1:
132
- lotteryWinners = _a.sent();
133
- if (lotteryWinners === null) {
134
- return [2 /*return*/, null];
135
- }
136
- return [2 /*return*/, this.getEnhancedLotteryWinners(lotteryWinners)];
137
- }
138
- });
139
- });
140
- };
141
- LotteryClient.prototype.selectLotteryWinners = function (params) {
142
- return __awaiter(this, void 0, void 0, function () {
143
- var uri, lotteryWinners;
144
- return __generator(this, function (_a) {
145
- switch (_a.label) {
146
- case 0:
147
- uri = "/api/xp/lottery/select-winners/".concat(params.executorAddress);
148
- return [4 /*yield*/, this.get(uri)];
149
- case 1:
150
- lotteryWinners = _a.sent();
151
- if (lotteryWinners === null) {
152
- throw new Error('Unpexpected error while selecting lottery winners');
153
- }
154
- return [2 /*return*/, this.getEnhancedLotteryWinners(lotteryWinners)];
155
- }
156
- });
157
- });
158
- };
159
- return LotteryClient;
160
- }(common_1.RestClient));
161
- exports.default = LotteryClient;
162
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/lottery/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAKyB;AAGzB;IAA2C,iCAAU;IAEnD,uBAAY,kBAAsC,EAAE,IAAY;QAC9D,YAAA,MAAK,YAAC,IAAI,CAAC,SAAC;QAFN,wBAAkB,GAAuB,MAAM,CAAC;QAGtD,KAAI,C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D;IAEK,4CAAoB,GAA1B,UACE,MAAkC;;;;;;wBAE5B,GAAG,GAAG,yCAAkC,MAAM,CAAC,eAAe,CAAE,CAAC;wBAGrE,qBAAM,IAAI,CAAC,GAAG,CAA8B,GAAG,CAAC,EAAA;;wBAD5C,cAAc,GAClB,SAAgD;wBAElD,IAAI,cAAc,KAAK,IAAI,EAAE,CAAC;4BAC5B,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;wBACvE,CAAC;wBAED,sBAAO,IAAI,CAAC,yBAAyB,CAAC,cAAc,CAAC,EAAC;;;;KACvD;IACH,oBAAC;AAAD,CAAC,AA9ED,CAA2C,mBAAU,GA8EpD","sourcesContent":["import {\n RestClient,\n ServiceEnvironment,\n GetLotteryWinnersResult,\n SelectLotteryWinnersParams,\n} from '@reyaxyz/common';\nimport { LotteryWinnersResult } from './types';\n\nexport default class LotteryClient extends RestClient {\n private serviceEnvironment: ServiceEnvironment = 'test';\n constructor(serviceEnvironment: ServiceEnvironment, host: string) {\n super(host);\n this.serviceEnvironment = serviceEnvironment;\n }\n\n async getLotteryPotBalance(): Promise<number> {\n // const lotteryPotOwnerAddress: string =\n // LOTTERY_CONFIGS[this.serviceEnvironment].address;\n // const lotteryPotAccountId: MarginAccountEntity['id'] =\n // LOTTERY_CONFIGS[this.serviceEnvironment].marginAccountId;\n // const contributionFromReya: number = 20000;\n\n // const uri = `/api/accounts/${lotteryPotOwnerAddress}/marginAccount/${lotteryPotAccountId}`;\n // const lotteryPotMarginAccountData: MarginAccountEntity =\n // await this.get<MarginAccountEntity>(uri);\n // return lotteryPotMarginAccountData.totalBalance + contributionFromReya;\n\n return 23598.637065;\n }\n\n async getNumberOfLotteryTickets(walletAddress: string): Promise<number> {\n // todo: p1: add implementation\n console.log(walletAddress);\n return 1;\n }\n\n private async getEnhancedLotteryWinners(\n lotteryWinners: GetLotteryWinnersResult,\n ): Promise<LotteryWinnersResult> {\n const lotteryPot = await this.getLotteryPotBalance();\n const amounts = {\n 1: lotteryPot * 0.7,\n 2: lotteryPot * 0.2,\n 3: lotteryPot * 0.1,\n };\n\n const enhancedLotteryWinners: LotteryWinnersResult = {\n winners: lotteryWinners.winners.map((winner) => {\n return {\n ...winner,\n amount: amounts[winner.place as 1 | 2 | 3],\n };\n }),\n executor: lotteryWinners.executor,\n };\n\n return enhancedLotteryWinners;\n }\n\n async getLotteryWinners(): Promise<LotteryWinnersResult | null> {\n const uri = '/api/xp/lottery/get-winners';\n\n const lotteryWinners: GetLotteryWinnersResult | null =\n await this.get<GetLotteryWinnersResult | null>(uri);\n\n if (lotteryWinners === null) {\n return null;\n }\n\n return this.getEnhancedLotteryWinners(lotteryWinners);\n }\n\n async selectLotteryWinners(\n params: SelectLotteryWinnersParams,\n ): Promise<LotteryWinnersResult> {\n const uri = `/api/xp/lottery/select-winners/${params.executorAddress}`;\n\n const lotteryWinners: LotteryWinnersResult | null =\n await this.get<LotteryWinnersResult | null>(uri);\n\n if (lotteryWinners === null) {\n throw new Error('Unpexpected error while selecting lottery winners');\n }\n\n return this.getEnhancedLotteryWinners(lotteryWinners);\n }\n}\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/lottery/types.ts"],"names":[],"mappings":"","sourcesContent":["import { WinnerData, ExecutorData } from '@reyaxyz/common';\n\nexport type LotteryWinnersResult = {\n winners: WinnerData[];\n executor: ExecutorData;\n};\n"]}
@@ -1,8 +0,0 @@
1
- import { MarginAccountEntity, ServiceEnvironment } from '@reyaxyz/common';
2
- type LotteryConfig = {
3
- address: string;
4
- marginAccountId: MarginAccountEntity['id'];
5
- };
6
- export declare const LOTTERY_CONFIGS: Record<ServiceEnvironment, LotteryConfig>;
7
- export {};
8
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"/","sources":["clients/modules/lottery/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1E,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,kBAAkB,EAAE,aAAa,CAqBrE,CAAC"}
@@ -1,12 +0,0 @@
1
- import { RestClient, ServiceEnvironment, SelectLotteryWinnersParams } from '@reyaxyz/common';
2
- import { LotteryWinnersResult } from './types';
3
- export default class LotteryClient extends RestClient {
4
- private serviceEnvironment;
5
- constructor(serviceEnvironment: ServiceEnvironment, host: string);
6
- getLotteryPotBalance(): Promise<number>;
7
- getNumberOfLotteryTickets(walletAddress: string): Promise<number>;
8
- private getEnhancedLotteryWinners;
9
- getLotteryWinners(): Promise<LotteryWinnersResult | null>;
10
- selectLotteryWinners(params: SelectLotteryWinnersParams): Promise<LotteryWinnersResult>;
11
- }
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/lottery/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,kBAAkB,EAElB,0BAA0B,EAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU;IACnD,OAAO,CAAC,kBAAkB,CAA8B;gBAC5C,kBAAkB,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM;IAK1D,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC;IAevC,yBAAyB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YAMzD,yBAAyB;IAuBjC,iBAAiB,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAazD,oBAAoB,CACxB,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,oBAAoB,CAAC;CAYjC"}
@@ -1,6 +0,0 @@
1
- import { WinnerData, ExecutorData } from '@reyaxyz/common';
2
- export type LotteryWinnersResult = {
3
- winners: WinnerData[];
4
- executor: ExecutorData;
5
- };
6
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/lottery/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAC"}
@@ -1,29 +0,0 @@
1
- import { MarginAccountEntity, ServiceEnvironment } from '@reyaxyz/common';
2
-
3
- type LotteryConfig = {
4
- address: string;
5
- marginAccountId: MarginAccountEntity['id'];
6
- };
7
-
8
- export const LOTTERY_CONFIGS: Record<ServiceEnvironment, LotteryConfig> = {
9
- production: {
10
- address: '0x1Fe50318e5E3165742eDC9c4a15d997bDB935Eb9',
11
- marginAccountId: 20092,
12
- },
13
- staging: {
14
- address: '0x1Fe50318e5E3165742eDC9c4a15d997bDB935Eb9',
15
- marginAccountId: 20092,
16
- },
17
- localmainnet: {
18
- address: '0x1Fe50318e5E3165742eDC9c4a15d997bDB935Eb9',
19
- marginAccountId: 20092,
20
- },
21
- test: {
22
- address: '0xaE173a960084903b1d278Ff9E3A81DeD82275556',
23
- marginAccountId: 6888,
24
- },
25
- localtestnet: {
26
- address: '0xaE173a960084903b1d278Ff9E3A81DeD82275556',
27
- marginAccountId: 6888,
28
- },
29
- };
@@ -1,87 +0,0 @@
1
- import {
2
- RestClient,
3
- ServiceEnvironment,
4
- GetLotteryWinnersResult,
5
- SelectLotteryWinnersParams,
6
- } from '@reyaxyz/common';
7
- import { LotteryWinnersResult } from './types';
8
-
9
- export default class LotteryClient extends RestClient {
10
- private serviceEnvironment: ServiceEnvironment = 'test';
11
- constructor(serviceEnvironment: ServiceEnvironment, host: string) {
12
- super(host);
13
- this.serviceEnvironment = serviceEnvironment;
14
- }
15
-
16
- async getLotteryPotBalance(): Promise<number> {
17
- // const lotteryPotOwnerAddress: string =
18
- // LOTTERY_CONFIGS[this.serviceEnvironment].address;
19
- // const lotteryPotAccountId: MarginAccountEntity['id'] =
20
- // LOTTERY_CONFIGS[this.serviceEnvironment].marginAccountId;
21
- // const contributionFromReya: number = 20000;
22
-
23
- // const uri = `/api/accounts/${lotteryPotOwnerAddress}/marginAccount/${lotteryPotAccountId}`;
24
- // const lotteryPotMarginAccountData: MarginAccountEntity =
25
- // await this.get<MarginAccountEntity>(uri);
26
- // return lotteryPotMarginAccountData.totalBalance + contributionFromReya;
27
-
28
- return 23598.637065;
29
- }
30
-
31
- async getNumberOfLotteryTickets(walletAddress: string): Promise<number> {
32
- // todo: p1: add implementation
33
- console.log(walletAddress);
34
- return 1;
35
- }
36
-
37
- private async getEnhancedLotteryWinners(
38
- lotteryWinners: GetLotteryWinnersResult,
39
- ): Promise<LotteryWinnersResult> {
40
- const lotteryPot = await this.getLotteryPotBalance();
41
- const amounts = {
42
- 1: lotteryPot * 0.7,
43
- 2: lotteryPot * 0.2,
44
- 3: lotteryPot * 0.1,
45
- };
46
-
47
- const enhancedLotteryWinners: LotteryWinnersResult = {
48
- winners: lotteryWinners.winners.map((winner) => {
49
- return {
50
- ...winner,
51
- amount: amounts[winner.place as 1 | 2 | 3],
52
- };
53
- }),
54
- executor: lotteryWinners.executor,
55
- };
56
-
57
- return enhancedLotteryWinners;
58
- }
59
-
60
- async getLotteryWinners(): Promise<LotteryWinnersResult | null> {
61
- const uri = '/api/xp/lottery/get-winners';
62
-
63
- const lotteryWinners: GetLotteryWinnersResult | null =
64
- await this.get<GetLotteryWinnersResult | null>(uri);
65
-
66
- if (lotteryWinners === null) {
67
- return null;
68
- }
69
-
70
- return this.getEnhancedLotteryWinners(lotteryWinners);
71
- }
72
-
73
- async selectLotteryWinners(
74
- params: SelectLotteryWinnersParams,
75
- ): Promise<LotteryWinnersResult> {
76
- const uri = `/api/xp/lottery/select-winners/${params.executorAddress}`;
77
-
78
- const lotteryWinners: LotteryWinnersResult | null =
79
- await this.get<LotteryWinnersResult | null>(uri);
80
-
81
- if (lotteryWinners === null) {
82
- throw new Error('Unpexpected error while selecting lottery winners');
83
- }
84
-
85
- return this.getEnhancedLotteryWinners(lotteryWinners);
86
- }
87
- }
@@ -1,6 +0,0 @@
1
- import { WinnerData, ExecutorData } from '@reyaxyz/common';
2
-
3
- export type LotteryWinnersResult = {
4
- winners: WinnerData[];
5
- executor: ExecutorData;
6
- };