@reyaxyz/api-sdk 0.126.5 → 0.126.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,5 +6,5 @@
6
6
 
7
7
  | Statements | Branches | Functions | Lines |
8
8
  | --------------------------- | ----------------------- | ------------------------- | ----------------- |
9
- | ![Statements](https://img.shields.io/badge/statements-1.4%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-7.37%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-0.57%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-1.41%25-red.svg?style=flat) |
9
+ | ![Statements](https://img.shields.io/badge/statements-1.39%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-7.37%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-0.57%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-1.4%25-red.svg?style=flat) |
10
10
 
@@ -194,6 +194,17 @@ var AccountClient = /** @class */ (function (_super) {
194
194
  });
195
195
  });
196
196
  };
197
+ AccountClient.prototype.getAccountFeeRebatesHistory = function (params) {
198
+ return __awaiter(this, void 0, void 0, function () {
199
+ var uri;
200
+ return __generator(this, function (_a) {
201
+ uri = "/api/accounts/".concat(params.marginAccountId, "/referral-fee-history");
202
+ return [2 /*return*/, this.get(uri, {
203
+ limit: params.limit,
204
+ })];
205
+ });
206
+ });
207
+ };
197
208
  AccountClient.prototype.getMaxWithdrawBalanceForAccount = function (params) {
198
209
  return __awaiter(this, void 0, void 0, function () {
199
210
  var uri;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,0CAOyB;AAEzB;IAA2C,iCAAU;IAArD;;IAgMA,CAAC;IA/LC;;;;;;;;;;;SAWK;IAEC,yC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CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;oBACf,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;gBAC/C,CAAC;gBACD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;oBAC1C,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;gBAC5C,CAAC;gBAEK,GAAG,GAAG,wBAAiB,MAAM,CAAC,EAAE,UAAO,CAAC;gBAC9C,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,EAAE,EAAE,MAAM,CAAC,EAAE;wBACb,IAAI,EAAE,MAAM,CAAC,IAAI;qBAClB,CAAC,EAAC;;;KACJ;IACK,0CAAkB,GAAxB,UACE,MAAgC;;;;gBAEhC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;oBACf,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;gBAC/C,CAAC;gBAEK,GAAG,GAAG,wBAAiB,MAAM,CAAC,EAAE,WAAQ,CAAC;gBAC/C,sBAAO,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;wBACtB,EAAE,EAAE,MAAM,CAAC,EAAE;qBACd,CAAC,EAAC;;;KACJ;IACH,oBAAC;AAAD,CAAC,AAhMD,CAA2C,mBAAU,GAgMpD","sourcesContent":["import {\n GetMarginAccountParams,\n GetMarginAccountResult,\n GetMarginAccountsParams,\n GetMarginAccountsResult,\n GetMarginAccountTransactionHistoryParams,\n GetMarginAccountTransactionHistoryResult,\n GetMaxOrderSizeAvailableParams,\n GetMaxOrderSizeAvailableResult,\n GetMaxWithdrawBalanceForAccountParams,\n GetMaxWithdrawBalanceForAccountResult,\n GetPositionsForMarginAccountParams,\n GetPositionsForMarginAccountResult,\n GetTransactionSimulationInitialDataParams,\n GetMarginAccountBalanceChartDataParams,\n GetMarginAccountCollateralsBalanceChartDataParams,\n GetAllMarginAccountsBalanceChartDataParams,\n EditMarginAccountParams,\n CloseMarginAccountParams,\n GetAllMarginAccountsSummaryResult,\n GetAllMarginAccountsSummaryParams,\n GetEditCollateralSimulationInitialDataParams,\n EditMarginAccountResult,\n CloseMarginAccountResult,\n GetIsolatedOrderMaxSizeAvailableParams,\n GetIsolatedOrderMaxSizeAvailableResult,\n GetPositionsHistoryForMarginAccountPaginatedParams,\n GetPositionsHistoryForMarginAccountPaginatedResult,\n GetLiquidationHistoryForOwnerAddressResult,\n GetLiquidationHistoryForOwnerAddressParams,\n} from './types';\nimport {\n EditCollateralSimulationState,\n TradeSimulationState,\n GetMarginAccountCollateralsBalanceChartDataResult,\n GetMarginAccountBalanceChartDataResult,\n GetAllMarginAccountsBalanceChartDataResult,\n RestClient,\n} from '@reyaxyz/common';\n\nexport default class AccountClient extends RestClient {\n /**\n * Asynchronously retrieves a list of margin accounts associated with a specific address.\n *\n * This method makes a request to the API endpoint to fetch collateral account data. The data is filtered\n * based on the provided Ethereum address. An optional limit can be specified to control the number of\n * collateral accounts returned in the response.\n *\n * @param {GetMarginAccountsParams} params\n * @returns {Promise<GetMarginAccountsResult>} A promise that resolves to the response containing the margin\n * account data.\n * @memberof account\n * */\n\n async getMarginAccounts(\n params: GetMarginAccountsParams,\n ): Promise<GetMarginAccountsResult> {\n const uri = `/api/accounts/${params.address}`;\n const response: GetMarginAccountsResult = await this.get(uri, {\n limit: params.limit,\n });\n\n return response;\n }\n\n /**\n * Asynchronously retrieves details of a specific collateral account for a given Ethereum address.\n *\n * This method sends a request to the API to obtain detailed information about a specific collateral account\n * associated with the provided Ethereum address. The account is identified using the collateral account number.\n *\n * @param {GetMarginAccountParams} params\n * @returns {Promise<GetMarginAccountResult>} A promise that resolves to the response containing the detailed\n * information of the specified margin account.\n * @memberof account\n */\n\n async getMarginAccount(\n params: GetMarginAccountParams,\n ): Promise<GetMarginAccountResult> {\n const uri = `/api/accounts/${params.address}/marginAccount/${params.marginAccountId}`;\n return this.get(uri);\n }\n\n async getPositionsForMarginAccount(\n params: GetPositionsForMarginAccountParams,\n ): Promise<GetPositionsForMarginAccountResult> {\n const uri = `/api/accounts/${params.address}/marginAccount/${params.marginAccountId}/positions`;\n return this.get(uri, { limit: params.limit });\n }\n\n async getPositionsHistoryForMarginAccountPaginated(\n params: GetPositionsHistoryForMarginAccountPaginatedParams,\n ): Promise<GetPositionsHistoryForMarginAccountPaginatedResult> {\n const uri = `/api/accounts/${params.address}/marginAccount/${params.marginAccountId}/positions/history/paginated`;\n return this.get(uri, {\n type: params.type,\n page: params.page,\n perPage: params.perPage,\n });\n }\n\n async getLiquidationHistoryForOwnerAddress(\n params: GetLiquidationHistoryForOwnerAddressParams,\n ): Promise<GetLiquidationHistoryForOwnerAddressResult> {\n const uri = `/api/accounts/${params.address}/positions/liquidations`;\n return this.get(uri, {\n timestampFromMS: params.timestampFromMS,\n });\n }\n\n async getMaxOrderSizeAvailable(\n params: GetMaxOrderSizeAvailableParams,\n ): Promise<GetMaxOrderSizeAvailableResult> {\n const uri = `/api/accounts/${params.marginAccountId}/max-order-size`;\n return this.get(uri, {\n marketId: params.marketId,\n direction: params.direction,\n });\n }\n\n async getIsolatedOrderMaxSizeAvailable(\n params: GetIsolatedOrderMaxSizeAvailableParams,\n ): Promise<GetIsolatedOrderMaxSizeAvailableResult> {\n const uri = `/api/accounts/${params.marginAccountId}/max-order-size-isolated`;\n return this.get(uri, {\n marketId: params.marketId,\n direction: params.direction,\n });\n }\n\n async getTransactionSimulationInitialData(\n params: GetTransactionSimulationInitialDataParams,\n ): Promise<TradeSimulationState> {\n const uri = `/api/accounts/${params.marginAccountId}/trade-simulation-data`;\n return this.get(uri, {\n marketId: params.marketId,\n });\n }\n\n async getEditCollateralSimulationInitialData(\n params: GetEditCollateralSimulationInitialDataParams,\n ): Promise<EditCollateralSimulationState> {\n const uri = `/api/accounts/${params.marginAccountId}/edit-collateral-simulation-data`;\n return this.get(uri);\n }\n\n async getMarginAccountTransactionHistory(\n params: GetMarginAccountTransactionHistoryParams,\n ): Promise<GetMarginAccountTransactionHistoryResult> {\n const uri = `/api/accounts/${params.marginAccountId}/transaction-history`;\n return this.get(uri, {\n limit: params.limit,\n });\n }\n\n async getMaxWithdrawBalanceForAccount(\n params: GetMaxWithdrawBalanceForAccountParams,\n ): Promise<GetMaxWithdrawBalanceForAccountResult> {\n const uri = `/api/accounts/${params.marginAccountId}/max-withdraw-amount`;\n return this.get(uri, {\n assetAddress: params.tokenAddress,\n });\n }\n\n async getMarginAccountBalanceChartData(\n params: GetMarginAccountBalanceChartDataParams,\n ): Promise<GetMarginAccountBalanceChartDataResult> {\n const uri = `/api/accounts/${params.marginAccountId}/balance-chart-data`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n });\n }\n\n async getMarginAccountCollateralsBalanceChartData(\n params: GetMarginAccountCollateralsBalanceChartDataParams,\n ): Promise<GetMarginAccountCollateralsBalanceChartDataResult> {\n const uri = `/api/accounts/${params.marginAccountId}/collaterals-balance-chart-data`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n });\n }\n\n async getAllMarginAccountsBalanceChart(\n params: GetAllMarginAccountsBalanceChartDataParams,\n ): Promise<GetAllMarginAccountsBalanceChartDataResult> {\n const uri = `/api/accounts/owner/${params.ownerAddress}/balance`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n });\n }\n\n async getAllMarginAccountsSummary(\n params: GetAllMarginAccountsSummaryParams,\n ): Promise<GetAllMarginAccountsSummaryResult> {\n const uri = `/api/accounts/owner/${params.ownerAddress}/summary`;\n return this.get(uri);\n }\n\n // TODO: Milan validate\n async editMarginAccount(\n params: EditMarginAccountParams,\n ): Promise<EditMarginAccountResult> {\n const name = (params.name || '').trim();\n if (!params.id) {\n throw new Error('Missing margin account id');\n }\n if (name.length === 0 || name.length > 25) {\n throw new Error('Max size 25 characters');\n }\n\n const uri = `/api/accounts/${params.id}/edit`;\n return this.put(uri, {\n id: params.id,\n name: params.name,\n });\n }\n async closeMarginAccount(\n params: CloseMarginAccountParams,\n ): Promise<CloseMarginAccountResult> {\n if (!params.id) {\n throw new Error('Missing margin account id');\n }\n\n const uri = `/api/accounts/${params.id}/close`;\n return this.delete(uri, {\n id: params.id,\n });\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,0CAOyB;AAEzB;IAA2C,iCAAU;IAArD;;IAyMA,CAAC;IAxMC;;;;;;;;;;;SAWK;IAEC,yCAAiB,GAAvB,UACE,MAA+B;;;;;;wBAEzB,GAAG,GAAG,wBAAiB,MAAM,CAAC,OAAO,CAAE,CAAC;wBACJ,qBAAM,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;gCAC5D,KAAK,EAAE,MAAM,CAAC,KAAK;6BACpB,CAAC,EAAA;;wBAFI,QAAQ,GAA4B,SAExC;wBAEF,sBAAO,QAAQ,EAAC;;;;KACjB;IAED;;;;;;;;;;OAUG;IAEG,wCAAgB,GAAtB,UACE,MAA8B;;;;gBAExB,GAAG,GAAG,wBAAiB,MAAM,CAAC,OAAO,4BAAkB,MAAM,CAAC,eAAe,CAAE,CAAC;gBACtF,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC;;;KACtB;IAEK,oDAA4B,GAAlC,UACE,MAA0C;;;;gBAEpC,GAAG,GAAG,wBAAiB,MAAM,CAAC,OAAO,4BAAkB,MAAM,CAAC,eAAe,eAAY,CAAC;gBAChG,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,EAAC;;;KAC/C;IAEK,oEAA4C,GAAlD,UACE,MAA0D;;;;gBAEpD,GAAG,GAAG,wBAAiB,MAAM,CAAC,OAAO,4BAAkB,MAAM,CA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AAC,CAAC;gBAC/C,CAAC;gBAEK,GAAG,GAAG,wBAAiB,MAAM,CAAC,EAAE,WAAQ,CAAC;gBAC/C,sBAAO,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;wBACtB,EAAE,EAAE,MAAM,CAAC,EAAE;qBACd,CAAC,EAAC;;;KACJ;IACH,oBAAC;AAAD,CAAC,AAzMD,CAA2C,mBAAU,GAyMpD","sourcesContent":["import {\n GetMarginAccountParams,\n GetMarginAccountResult,\n GetMarginAccountsParams,\n GetMarginAccountsResult,\n GetMarginAccountTransactionHistoryParams,\n GetMarginAccountTransactionHistoryResult,\n GetMaxOrderSizeAvailableParams,\n GetMaxOrderSizeAvailableResult,\n GetMaxWithdrawBalanceForAccountParams,\n GetMaxWithdrawBalanceForAccountResult,\n GetPositionsForMarginAccountParams,\n GetPositionsForMarginAccountResult,\n GetTransactionSimulationInitialDataParams,\n GetMarginAccountBalanceChartDataParams,\n GetMarginAccountCollateralsBalanceChartDataParams,\n GetAllMarginAccountsBalanceChartDataParams,\n EditMarginAccountParams,\n CloseMarginAccountParams,\n GetAllMarginAccountsSummaryResult,\n GetAllMarginAccountsSummaryParams,\n GetEditCollateralSimulationInitialDataParams,\n EditMarginAccountResult,\n CloseMarginAccountResult,\n GetIsolatedOrderMaxSizeAvailableParams,\n GetIsolatedOrderMaxSizeAvailableResult,\n GetPositionsHistoryForMarginAccountPaginatedParams,\n GetPositionsHistoryForMarginAccountPaginatedResult,\n GetLiquidationHistoryForOwnerAddressResult,\n GetLiquidationHistoryForOwnerAddressParams,\n GetAccountFeeRebatesHistoryParams,\n GetAccountFeeRebatesHistoryResult,\n} from './types';\nimport {\n EditCollateralSimulationState,\n TradeSimulationState,\n GetMarginAccountCollateralsBalanceChartDataResult,\n GetMarginAccountBalanceChartDataResult,\n GetAllMarginAccountsBalanceChartDataResult,\n RestClient,\n} from '@reyaxyz/common';\n\nexport default class AccountClient extends RestClient {\n /**\n * Asynchronously retrieves a list of margin accounts associated with a specific address.\n *\n * This method makes a request to the API endpoint to fetch collateral account data. The data is filtered\n * based on the provided Ethereum address. An optional limit can be specified to control the number of\n * collateral accounts returned in the response.\n *\n * @param {GetMarginAccountsParams} params\n * @returns {Promise<GetMarginAccountsResult>} A promise that resolves to the response containing the margin\n * account data.\n * @memberof account\n * */\n\n async getMarginAccounts(\n params: GetMarginAccountsParams,\n ): Promise<GetMarginAccountsResult> {\n const uri = `/api/accounts/${params.address}`;\n const response: GetMarginAccountsResult = await this.get(uri, {\n limit: params.limit,\n });\n\n return response;\n }\n\n /**\n * Asynchronously retrieves details of a specific collateral account for a given Ethereum address.\n *\n * This method sends a request to the API to obtain detailed information about a specific collateral account\n * associated with the provided Ethereum address. The account is identified using the collateral account number.\n *\n * @param {GetMarginAccountParams} params\n * @returns {Promise<GetMarginAccountResult>} A promise that resolves to the response containing the detailed\n * information of the specified margin account.\n * @memberof account\n */\n\n async getMarginAccount(\n params: GetMarginAccountParams,\n ): Promise<GetMarginAccountResult> {\n const uri = `/api/accounts/${params.address}/marginAccount/${params.marginAccountId}`;\n return this.get(uri);\n }\n\n async getPositionsForMarginAccount(\n params: GetPositionsForMarginAccountParams,\n ): Promise<GetPositionsForMarginAccountResult> {\n const uri = `/api/accounts/${params.address}/marginAccount/${params.marginAccountId}/positions`;\n return this.get(uri, { limit: params.limit });\n }\n\n async getPositionsHistoryForMarginAccountPaginated(\n params: GetPositionsHistoryForMarginAccountPaginatedParams,\n ): Promise<GetPositionsHistoryForMarginAccountPaginatedResult> {\n const uri = `/api/accounts/${params.address}/marginAccount/${params.marginAccountId}/positions/history/paginated`;\n return this.get(uri, {\n type: params.type,\n page: params.page,\n perPage: params.perPage,\n });\n }\n\n async getLiquidationHistoryForOwnerAddress(\n params: GetLiquidationHistoryForOwnerAddressParams,\n ): Promise<GetLiquidationHistoryForOwnerAddressResult> {\n const uri = `/api/accounts/${params.address}/positions/liquidations`;\n return this.get(uri, {\n timestampFromMS: params.timestampFromMS,\n });\n }\n\n async getMaxOrderSizeAvailable(\n params: GetMaxOrderSizeAvailableParams,\n ): Promise<GetMaxOrderSizeAvailableResult> {\n const uri = `/api/accounts/${params.marginAccountId}/max-order-size`;\n return this.get(uri, {\n marketId: params.marketId,\n direction: params.direction,\n });\n }\n\n async getIsolatedOrderMaxSizeAvailable(\n params: GetIsolatedOrderMaxSizeAvailableParams,\n ): Promise<GetIsolatedOrderMaxSizeAvailableResult> {\n const uri = `/api/accounts/${params.marginAccountId}/max-order-size-isolated`;\n return this.get(uri, {\n marketId: params.marketId,\n direction: params.direction,\n });\n }\n\n async getTransactionSimulationInitialData(\n params: GetTransactionSimulationInitialDataParams,\n ): Promise<TradeSimulationState> {\n const uri = `/api/accounts/${params.marginAccountId}/trade-simulation-data`;\n return this.get(uri, {\n marketId: params.marketId,\n });\n }\n\n async getEditCollateralSimulationInitialData(\n params: GetEditCollateralSimulationInitialDataParams,\n ): Promise<EditCollateralSimulationState> {\n const uri = `/api/accounts/${params.marginAccountId}/edit-collateral-simulation-data`;\n return this.get(uri);\n }\n\n async getMarginAccountTransactionHistory(\n params: GetMarginAccountTransactionHistoryParams,\n ): Promise<GetMarginAccountTransactionHistoryResult> {\n const uri = `/api/accounts/${params.marginAccountId}/transaction-history`;\n return this.get(uri, {\n limit: params.limit,\n });\n }\n\n async getAccountFeeRebatesHistory(\n params: GetAccountFeeRebatesHistoryParams,\n ): Promise<GetAccountFeeRebatesHistoryResult> {\n const uri = `/api/accounts/${params.marginAccountId}/referral-fee-history`;\n return this.get(uri, {\n limit: params.limit,\n });\n }\n\n async getMaxWithdrawBalanceForAccount(\n params: GetMaxWithdrawBalanceForAccountParams,\n ): Promise<GetMaxWithdrawBalanceForAccountResult> {\n const uri = `/api/accounts/${params.marginAccountId}/max-withdraw-amount`;\n return this.get(uri, {\n assetAddress: params.tokenAddress,\n });\n }\n\n async getMarginAccountBalanceChartData(\n params: GetMarginAccountBalanceChartDataParams,\n ): Promise<GetMarginAccountBalanceChartDataResult> {\n const uri = `/api/accounts/${params.marginAccountId}/balance-chart-data`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n });\n }\n\n async getMarginAccountCollateralsBalanceChartData(\n params: GetMarginAccountCollateralsBalanceChartDataParams,\n ): Promise<GetMarginAccountCollateralsBalanceChartDataResult> {\n const uri = `/api/accounts/${params.marginAccountId}/collaterals-balance-chart-data`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n });\n }\n\n async getAllMarginAccountsBalanceChart(\n params: GetAllMarginAccountsBalanceChartDataParams,\n ): Promise<GetAllMarginAccountsBalanceChartDataResult> {\n const uri = `/api/accounts/owner/${params.ownerAddress}/balance`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n });\n }\n\n async getAllMarginAccountsSummary(\n params: GetAllMarginAccountsSummaryParams,\n ): Promise<GetAllMarginAccountsSummaryResult> {\n const uri = `/api/accounts/owner/${params.ownerAddress}/summary`;\n return this.get(uri);\n }\n\n // TODO: Milan validate\n async editMarginAccount(\n params: EditMarginAccountParams,\n ): Promise<EditMarginAccountResult> {\n const name = (params.name || '').trim();\n if (!params.id) {\n throw new Error('Missing margin account id');\n }\n if (name.length === 0 || name.length > 25) {\n throw new Error('Max size 25 characters');\n }\n\n const uri = `/api/accounts/${params.id}/edit`;\n return this.put(uri, {\n id: params.id,\n name: params.name,\n });\n }\n async closeMarginAccount(\n params: CloseMarginAccountParams,\n ): Promise<CloseMarginAccountResult> {\n if (!params.id) {\n throw new Error('Missing margin account id');\n }\n\n const uri = `/api/accounts/${params.id}/close`;\n return this.delete(uri, {\n id: params.id,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/account/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n MarginAccountEntity,\n MarginAccountTransactionHistoryEntity,\n MarketEntity,\n PositionEntity,\n PositionHistoryEntity,\n} from '@reyaxyz/common';\nimport {\n MarginAccountBalanceGranularity,\n MarginAccountCollateralsBalanceGranularity,\n AllMarginAccountsBalanceGranularity,\n} from '@reyaxyz/common';\nimport { Address } from '@reyaxyz/common';\n\nexport type GetMarginAccountsParams = {\n address: string;\n limit?: number;\n};\n\nexport type GetMarginAccountParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n};\n\nexport type GetPositionsForMarginAccountParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n limit?: number;\n};\n\nexport type GetMarginAccountsResult = MarginAccountEntity[];\n\nexport type GetMarginAccountResult = MarginAccountEntity;\n\n// ---- Transaction History\nexport type GetMarginAccountTransactionHistoryParams = {\n marginAccountId: MarginAccountEntity['id'];\n limit?: number;\n};\n\nexport type GetMarginAccountTransactionHistoryResult =\n MarginAccountTransactionHistoryEntity[];\n// -- Max Order Size --\n\nexport type GetMaxOrderSizeAvailableParams = {\n marketId: MarketEntity['id'];\n marginAccountId: MarginAccountEntity['id'];\n direction: 'long' | 'short';\n};\n\nexport type GetMaxOrderSizeAvailableResult = {\n maxAmountBase: number;\n maxAmountSize: number;\n};\n\n// --- Max Withdraw Balance for Margin Account ---\nexport type GetMaxWithdrawBalanceForAccountParams = {\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: string;\n};\n\nexport type GetMaxWithdrawBalanceForAccountResult = number;\n\nexport type GetPositionsForMarginAccountResult = {\n positions: PositionEntity[];\n totalUnrealizedPNL: number;\n};\n\n// --- Position History ---\n\nexport type GetPositionsHistoryForMarginAccountParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n limit?: number;\n};\nexport type GetPositionsHistoryForMarginAccountPaginatedParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n page: number;\n perPage: number;\n type?: 'order' | 'liquidation';\n};\nexport type GetPositionsHistoryForMarginAccountResult = PositionHistoryEntity[];\nexport type GetPositionsHistoryForMarginAccountPaginatedResult = {\n data: PositionHistoryEntity[];\n totalCount: number;\n};\n\n//--- Liquidation History ---\nexport type GetLiquidationHistoryForOwnerAddressParams = {\n address: Address;\n timestampFromMS: number;\n};\nexport type GetLiquidationHistoryForOwnerAddressResult = {\n data: LiquidationHistoryEntity[];\n};\n\nexport type LiquidationHistoryEntity = {\n id: string;\n action: 'long-liquidation' | 'short-liquidation';\n executionPrice: number;\n fees: number;\n base: number;\n size: number; // price * base (liquidation size)\n timestamp: number;\n baseUnderlyingToken: string;\n marginAccount: {\n id: MarginAccountEntity['id'];\n name: MarginAccountEntity['name'];\n marginRatioPercentage: MarginAccountEntity['marginRatioPercentage'];\n marginRatioHealth: MarginAccountEntity['marginRatioHealth'];\n };\n};\n\n// ---- Transaction Simulation ----\n\nexport type GetTransactionSimulationInitialDataParams = {\n marketId: MarketEntity['id'];\n marginAccountId: MarginAccountEntity['id'];\n};\n\n// ---- Edit Collateral Simulation ----\n\nexport type GetEditCollateralSimulationInitialDataParams = {\n marginAccountId: MarginAccountEntity['id'];\n};\n\nexport type GetMarginAccountBalanceChartDataParams = {\n marginAccountId: MarginAccountEntity['id'];\n filters: {\n timeframeMs: number;\n granularity: MarginAccountBalanceGranularity;\n };\n};\n\nexport type GetMarginAccountCollateralsBalanceChartDataParams = {\n marginAccountId: MarginAccountEntity['id'];\n filters: {\n timeframeMs: number;\n granularity: MarginAccountCollateralsBalanceGranularity;\n };\n};\n\nexport type GetAllMarginAccountsBalanceChartDataParams = {\n ownerAddress: string;\n filters: {\n timeframeMs: number;\n granularity: AllMarginAccountsBalanceGranularity;\n };\n};\n\n// TODO: Milan validate\nexport type EditMarginAccountParams = {\n id: MarginAccountEntity['id'];\n name: MarginAccountEntity['name'];\n};\n// TODO: Milan validate\nexport type EditMarginAccountResult = { success: boolean };\n\n// TODO: Milan validate\nexport type CloseMarginAccountParams = {\n id: MarginAccountEntity['id'];\n};\n\n// TODO: Milan validate\nexport type CloseMarginAccountResult = { success: boolean };\n\nexport type GetAllMarginAccountsSummaryParams = {\n ownerAddress: string;\n};\n\nexport type GetAllMarginAccountsSummaryResult = {\n totalAccountsCount: number;\n totalBalance: number;\n totalBalanceChangePercentage: number;\n totalBalanceUnderlyingAsset: string;\n};\n\nexport type GetIsolatedOrderMaxSizeAvailableParams = {\n marketId: MarketEntity['id'];\n marginAccountId: MarginAccountEntity['id'];\n direction: 'long' | 'short';\n};\n\nexport type GetIsolatedOrderMaxSizeAvailableResult = {\n maxAmountBase: number;\n maxAmountSize: number;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/account/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n MarginAccountEntity,\n MarginAccountTransactionHistoryEntity,\n MarketEntity,\n PositionEntity,\n PositionHistoryEntity,\n} from '@reyaxyz/common';\nimport {\n MarginAccountBalanceGranularity,\n MarginAccountCollateralsBalanceGranularity,\n AllMarginAccountsBalanceGranularity,\n ReferralFeeTransactionHistoryEntity,\n} from '@reyaxyz/common';\nimport { Address } from '@reyaxyz/common';\n\nexport type GetMarginAccountsParams = {\n address: string;\n limit?: number;\n};\n\nexport type GetMarginAccountParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n};\n\nexport type GetPositionsForMarginAccountParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n limit?: number;\n};\n\nexport type GetMarginAccountsResult = MarginAccountEntity[];\n\nexport type GetMarginAccountResult = MarginAccountEntity;\n\n// ---- Transaction History\nexport type GetMarginAccountTransactionHistoryParams = {\n marginAccountId: MarginAccountEntity['id'];\n limit?: number;\n};\n\nexport type GetMarginAccountTransactionHistoryResult =\n MarginAccountTransactionHistoryEntity[];\n\nexport type GetAccountFeeRebatesHistoryParams = {\n marginAccountId: MarginAccountEntity['id'];\n limit?: number;\n};\n\nexport type GetAccountFeeRebatesHistoryResult = {\n result: ReferralFeeTransactionHistoryEntity[];\n};\n// -- Max Order Size --\n\nexport type GetMaxOrderSizeAvailableParams = {\n marketId: MarketEntity['id'];\n marginAccountId: MarginAccountEntity['id'];\n direction: 'long' | 'short';\n};\n\nexport type GetMaxOrderSizeAvailableResult = {\n maxAmountBase: number;\n maxAmountSize: number;\n};\n\n// --- Max Withdraw Balance for Margin Account ---\nexport type GetMaxWithdrawBalanceForAccountParams = {\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: string;\n};\n\nexport type GetMaxWithdrawBalanceForAccountResult = number;\n\nexport type GetPositionsForMarginAccountResult = {\n positions: PositionEntity[];\n totalUnrealizedPNL: number;\n};\n\n// --- Position History ---\n\nexport type GetPositionsHistoryForMarginAccountParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n limit?: number;\n};\nexport type GetPositionsHistoryForMarginAccountPaginatedParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n page: number;\n perPage: number;\n type?: 'order' | 'liquidation';\n};\nexport type GetPositionsHistoryForMarginAccountResult = PositionHistoryEntity[];\nexport type GetPositionsHistoryForMarginAccountPaginatedResult = {\n data: PositionHistoryEntity[];\n totalCount: number;\n};\n\n//--- Liquidation History ---\nexport type GetLiquidationHistoryForOwnerAddressParams = {\n address: Address;\n timestampFromMS: number;\n};\nexport type GetLiquidationHistoryForOwnerAddressResult = {\n data: LiquidationHistoryEntity[];\n};\n\nexport type LiquidationHistoryEntity = {\n id: string;\n action: 'long-liquidation' | 'short-liquidation';\n executionPrice: number;\n fees: number;\n base: number;\n size: number; // price * base (liquidation size)\n timestamp: number;\n baseUnderlyingToken: string;\n marginAccount: {\n id: MarginAccountEntity['id'];\n name: MarginAccountEntity['name'];\n marginRatioPercentage: MarginAccountEntity['marginRatioPercentage'];\n marginRatioHealth: MarginAccountEntity['marginRatioHealth'];\n };\n};\n\n// ---- Transaction Simulation ----\n\nexport type GetTransactionSimulationInitialDataParams = {\n marketId: MarketEntity['id'];\n marginAccountId: MarginAccountEntity['id'];\n};\n\n// ---- Edit Collateral Simulation ----\n\nexport type GetEditCollateralSimulationInitialDataParams = {\n marginAccountId: MarginAccountEntity['id'];\n};\n\nexport type GetMarginAccountBalanceChartDataParams = {\n marginAccountId: MarginAccountEntity['id'];\n filters: {\n timeframeMs: number;\n granularity: MarginAccountBalanceGranularity;\n };\n};\n\nexport type GetMarginAccountCollateralsBalanceChartDataParams = {\n marginAccountId: MarginAccountEntity['id'];\n filters: {\n timeframeMs: number;\n granularity: MarginAccountCollateralsBalanceGranularity;\n };\n};\n\nexport type GetAllMarginAccountsBalanceChartDataParams = {\n ownerAddress: string;\n filters: {\n timeframeMs: number;\n granularity: AllMarginAccountsBalanceGranularity;\n };\n};\n\n// TODO: Milan validate\nexport type EditMarginAccountParams = {\n id: MarginAccountEntity['id'];\n name: MarginAccountEntity['name'];\n};\n// TODO: Milan validate\nexport type EditMarginAccountResult = { success: boolean };\n\n// TODO: Milan validate\nexport type CloseMarginAccountParams = {\n id: MarginAccountEntity['id'];\n};\n\n// TODO: Milan validate\nexport type CloseMarginAccountResult = { success: boolean };\n\nexport type GetAllMarginAccountsSummaryParams = {\n ownerAddress: string;\n};\n\nexport type GetAllMarginAccountsSummaryResult = {\n totalAccountsCount: number;\n totalBalance: number;\n totalBalanceChangePercentage: number;\n totalBalanceUnderlyingAsset: string;\n};\n\nexport type GetIsolatedOrderMaxSizeAvailableParams = {\n marketId: MarketEntity['id'];\n marginAccountId: MarginAccountEntity['id'];\n direction: 'long' | 'short';\n};\n\nexport type GetIsolatedOrderMaxSizeAvailableResult = {\n maxAmountBase: number;\n maxAmountSize: number;\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { GetMarginAccountParams, GetMarginAccountResult, GetMarginAccountsParams, GetMarginAccountsResult, GetMarginAccountTransactionHistoryParams, GetMarginAccountTransactionHistoryResult, GetMaxOrderSizeAvailableParams, GetMaxOrderSizeAvailableResult, GetMaxWithdrawBalanceForAccountParams, GetMaxWithdrawBalanceForAccountResult, GetPositionsForMarginAccountParams, GetPositionsForMarginAccountResult, GetTransactionSimulationInitialDataParams, GetMarginAccountBalanceChartDataParams, GetMarginAccountCollateralsBalanceChartDataParams, GetAllMarginAccountsBalanceChartDataParams, EditMarginAccountParams, CloseMarginAccountParams, GetAllMarginAccountsSummaryResult, GetAllMarginAccountsSummaryParams, GetEditCollateralSimulationInitialDataParams, EditMarginAccountResult, CloseMarginAccountResult, GetIsolatedOrderMaxSizeAvailableParams, GetIsolatedOrderMaxSizeAvailableResult, GetPositionsHistoryForMarginAccountPaginatedParams, GetPositionsHistoryForMarginAccountPaginatedResult, GetLiquidationHistoryForOwnerAddressResult, GetLiquidationHistoryForOwnerAddressParams } from './types';
1
+ import { GetMarginAccountParams, GetMarginAccountResult, GetMarginAccountsParams, GetMarginAccountsResult, GetMarginAccountTransactionHistoryParams, GetMarginAccountTransactionHistoryResult, GetMaxOrderSizeAvailableParams, GetMaxOrderSizeAvailableResult, GetMaxWithdrawBalanceForAccountParams, GetMaxWithdrawBalanceForAccountResult, GetPositionsForMarginAccountParams, GetPositionsForMarginAccountResult, GetTransactionSimulationInitialDataParams, GetMarginAccountBalanceChartDataParams, GetMarginAccountCollateralsBalanceChartDataParams, GetAllMarginAccountsBalanceChartDataParams, EditMarginAccountParams, CloseMarginAccountParams, GetAllMarginAccountsSummaryResult, GetAllMarginAccountsSummaryParams, GetEditCollateralSimulationInitialDataParams, EditMarginAccountResult, CloseMarginAccountResult, GetIsolatedOrderMaxSizeAvailableParams, GetIsolatedOrderMaxSizeAvailableResult, GetPositionsHistoryForMarginAccountPaginatedParams, GetPositionsHistoryForMarginAccountPaginatedResult, GetLiquidationHistoryForOwnerAddressResult, GetLiquidationHistoryForOwnerAddressParams, GetAccountFeeRebatesHistoryParams, GetAccountFeeRebatesHistoryResult } from './types';
2
2
  import { EditCollateralSimulationState, TradeSimulationState, GetMarginAccountCollateralsBalanceChartDataResult, GetMarginAccountBalanceChartDataResult, GetAllMarginAccountsBalanceChartDataResult, RestClient } from '@reyaxyz/common';
3
3
  export default class AccountClient extends RestClient {
4
4
  /**
@@ -34,6 +34,7 @@ export default class AccountClient extends RestClient {
34
34
  getTransactionSimulationInitialData(params: GetTransactionSimulationInitialDataParams): Promise<TradeSimulationState>;
35
35
  getEditCollateralSimulationInitialData(params: GetEditCollateralSimulationInitialDataParams): Promise<EditCollateralSimulationState>;
36
36
  getMarginAccountTransactionHistory(params: GetMarginAccountTransactionHistoryParams): Promise<GetMarginAccountTransactionHistoryResult>;
37
+ getAccountFeeRebatesHistory(params: GetAccountFeeRebatesHistoryParams): Promise<GetAccountFeeRebatesHistoryResult>;
37
38
  getMaxWithdrawBalanceForAccount(params: GetMaxWithdrawBalanceForAccountParams): Promise<GetMaxWithdrawBalanceForAccountResult>;
38
39
  getMarginAccountBalanceChartData(params: GetMarginAccountBalanceChartDataParams): Promise<GetMarginAccountBalanceChartDataResult>;
39
40
  getMarginAccountCollateralsBalanceChartData(params: GetMarginAccountCollateralsBalanceChartDataParams): Promise<GetMarginAccountCollateralsBalanceChartDataResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,wCAAwC,EACxC,wCAAwC,EACxC,8BAA8B,EAC9B,8BAA8B,EAC9B,qCAAqC,EACrC,qCAAqC,EACrC,kCAAkC,EAClC,kCAAkC,EAClC,yCAAyC,EACzC,sCAAsC,EACtC,iDAAiD,EACjD,0CAA0C,EAC1C,uBAAuB,EACvB,wBAAwB,EACxB,iCAAiC,EACjC,iCAAiC,EACjC,4CAA4C,EAC5C,uBAAuB,EACvB,wBAAwB,EACxB,sCAAsC,EACtC,sCAAsC,EACtC,kDAAkD,EAClD,kDAAkD,EAClD,0CAA0C,EAC1C,0CAA0C,EAC3C,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,iDAAiD,EACjD,sCAAsC,EACtC,0CAA0C,EAC1C,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU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,CAAC,uBAAuB,CAAC;IAe7B,kBAAkB,CACtB,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,wBAAwB,CAAC;CAUrC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,wCAAwC,EACxC,wCAAwC,EACxC,8BAA8B,EAC9B,8BAA8B,EAC9B,qCAAqC,EACrC,qCAAqC,EACrC,kCAAkC,EAClC,kCAAkC,EAClC,yCAAyC,EACzC,sCAAsC,EACtC,iDAAiD,EACjD,0CAA0C,EAC1C,uBAAuB,EACvB,wBAAwB,EACxB,iCAAiC,EACjC,iCAAiC,EACjC,4CAA4C,EAC5C,uBAAuB,EACvB,wBAAwB,EACxB,sCAAsC,EACtC,sCAAsC,EACtC,kDAAkD,EAClD,kDAAkD,EAClD,0CAA0C,EAC1C,0CAA0C,EAC1C,iCAAiC,EACjC,iCAAiC,EAClC,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,iDAAiD,EACjD,sCAAsC,EACtC,0CAA0C,EAC1C,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU;IACnD;;;;;;;;;;;SAWK;IAEC,iBAAiB,CACrB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC;IASnC;;;;;;;;;;OAUG;IAEG,gBAAgB,CACpB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAK5B,4BAA4B,CAChC,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,kCAAkC,CAAC;IAKxC,4CAA4C,CAChD,MAAM,EAAE,kDAAkD,GACzD,OAAO,CAAC,kDAAkD,CAAC;IASxD,oCAAoC,CACxC,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC;IAOhD,wBAAwB,CAC5B,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,8BAA8B,CAAC;IAQpC,gCAAgC,CACpC,MAAM,EAAE,sCAAsC,GAC7C,OAAO,CAAC,sCAAsC,CAAC;IAQ5C,mCAAmC,CACvC,MAAM,EAAE,yCAAyC,GAChD,OAAO,CAAC,oBAAoB,CAAC;IAO1B,sCAAsC,CAC1C,MAAM,EAAE,4CAA4C,GACnD,OAAO,CAAC,6BAA6B,CAAC;IAKnC,kCAAkC,CACtC,MAAM,EAAE,wCAAwC,GAC/C,OAAO,CAAC,wCAAwC,CAAC;IAO9C,2BAA2B,CAC/B,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,iCAAiC,CAAC;IAOvC,+BAA+B,CACnC,MAAM,EAAE,qCAAqC,GAC5C,OAAO,CAAC,qCAAqC,CAAC;IAO3C,gCAAgC,CACpC,MAAM,EAAE,sCAAsC,GAC7C,OAAO,CAAC,sCAAsC,CAAC;IAQ5C,2CAA2C,CAC/C,MAAM,EAAE,iDAAiD,GACxD,OAAO,CAAC,iDAAiD,CAAC;IAQvD,gCAAgC,CACpC,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC;IAQhD,2BAA2B,CAC/B,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,iCAAiC,CAAC;IAMvC,iBAAiB,CACrB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC;IAe7B,kBAAkB,CACtB,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,wBAAwB,CAAC;CAUrC"}
@@ -1,5 +1,5 @@
1
1
  import { MarginAccountEntity, MarginAccountTransactionHistoryEntity, MarketEntity, PositionEntity, PositionHistoryEntity } from '@reyaxyz/common';
2
- import { MarginAccountBalanceGranularity, MarginAccountCollateralsBalanceGranularity, AllMarginAccountsBalanceGranularity } from '@reyaxyz/common';
2
+ import { MarginAccountBalanceGranularity, MarginAccountCollateralsBalanceGranularity, AllMarginAccountsBalanceGranularity, ReferralFeeTransactionHistoryEntity } from '@reyaxyz/common';
3
3
  import { Address } from '@reyaxyz/common';
4
4
  export type GetMarginAccountsParams = {
5
5
  address: string;
@@ -21,6 +21,13 @@ export type GetMarginAccountTransactionHistoryParams = {
21
21
  limit?: number;
22
22
  };
23
23
  export type GetMarginAccountTransactionHistoryResult = MarginAccountTransactionHistoryEntity[];
24
+ export type GetAccountFeeRebatesHistoryParams = {
25
+ marginAccountId: MarginAccountEntity['id'];
26
+ limit?: number;
27
+ };
28
+ export type GetAccountFeeRebatesHistoryResult = {
29
+ result: ReferralFeeTransactionHistoryEntity[];
30
+ };
24
31
  export type GetMaxOrderSizeAvailableParams = {
25
32
  marketId: MarketEntity['id'];
26
33
  marginAccountId: MarginAccountEntity['id'];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/account/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,qCAAqC,EACrC,YAAY,EACZ,cAAc,EACd,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,+BAA+B,EAC/B,0CAA0C,EAC1C,mCAAmC,EACpC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM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AC;CAC7B,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG;IACnD,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/api-sdk",
3
- "version": "0.126.5",
3
+ "version": "0.126.6",
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.196.1",
36
+ "@reyaxyz/common": "0.196.2",
37
37
  "@simplewebauthn/browser": "^10.0.0",
38
38
  "@simplewebauthn/types": "^10.0.0",
39
39
  "axios": "^1.6.2",
@@ -43,7 +43,7 @@
43
43
  "ws": "^8.16.0"
44
44
  },
45
45
  "packageManager": "pnpm@8.3.1",
46
- "gitHead": "8b69843162df093f1a0d8132543e5c5323d93548",
46
+ "gitHead": "17dfc90aca92636f509042e8f21559bccf78727c",
47
47
  "devDependencies": {
48
48
  "@types/ws": "8.5.10"
49
49
  }
@@ -28,6 +28,8 @@ import {
28
28
  GetPositionsHistoryForMarginAccountPaginatedResult,
29
29
  GetLiquidationHistoryForOwnerAddressResult,
30
30
  GetLiquidationHistoryForOwnerAddressParams,
31
+ GetAccountFeeRebatesHistoryParams,
32
+ GetAccountFeeRebatesHistoryResult,
31
33
  } from './types';
32
34
  import {
33
35
  EditCollateralSimulationState,
@@ -154,6 +156,15 @@ export default class AccountClient extends RestClient {
154
156
  });
155
157
  }
156
158
 
159
+ async getAccountFeeRebatesHistory(
160
+ params: GetAccountFeeRebatesHistoryParams,
161
+ ): Promise<GetAccountFeeRebatesHistoryResult> {
162
+ const uri = `/api/accounts/${params.marginAccountId}/referral-fee-history`;
163
+ return this.get(uri, {
164
+ limit: params.limit,
165
+ });
166
+ }
167
+
157
168
  async getMaxWithdrawBalanceForAccount(
158
169
  params: GetMaxWithdrawBalanceForAccountParams,
159
170
  ): Promise<GetMaxWithdrawBalanceForAccountResult> {
@@ -9,6 +9,7 @@ import {
9
9
  MarginAccountBalanceGranularity,
10
10
  MarginAccountCollateralsBalanceGranularity,
11
11
  AllMarginAccountsBalanceGranularity,
12
+ ReferralFeeTransactionHistoryEntity,
12
13
  } from '@reyaxyz/common';
13
14
  import { Address } from '@reyaxyz/common';
14
15
 
@@ -40,6 +41,15 @@ export type GetMarginAccountTransactionHistoryParams = {
40
41
 
41
42
  export type GetMarginAccountTransactionHistoryResult =
42
43
  MarginAccountTransactionHistoryEntity[];
44
+
45
+ export type GetAccountFeeRebatesHistoryParams = {
46
+ marginAccountId: MarginAccountEntity['id'];
47
+ limit?: number;
48
+ };
49
+
50
+ export type GetAccountFeeRebatesHistoryResult = {
51
+ result: ReferralFeeTransactionHistoryEntity[];
52
+ };
43
53
  // -- Max Order Size --
44
54
 
45
55
  export type GetMaxOrderSizeAvailableParams = {