@reyaxyz/api-sdk 0.145.2 → 0.145.4

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.
@@ -115,7 +115,7 @@ var AccountClient = /** @class */ (function (_super) {
115
115
  });
116
116
  });
117
117
  };
118
- AccountClient.prototype.getPositionsHistoryForMarginAccountPaginated = function (params) {
118
+ AccountClient.prototype.getMarginAccountOrderHistoryPaginated = function (params) {
119
119
  return __awaiter(this, void 0, void 0, function () {
120
120
  var uri;
121
121
  return __generator(this, function (_a) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,0CAOyB;AAEzB;IAA2C,iCAAU;IAArD;;IA4OA,CAAC;IA3OC;;;;;;;;;;;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,EA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AAD,CAAC,AA5OD,CAA2C,mBAAU,GA4OpD","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 GetAutoExchangeHistoryForOwnerAddressResult,\n GetAutoExchangeHistoryForOwnerAddressParams,\n UpdateLeverageForAccountAndMarketParams,\n UpdateLeverageForAccountAndMarketResult,\n GetSwapHistoryForWalletAddressResult,\n GetSwapHistoryForWalletAddressParams,\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 getAutoExchangeHistoryForOwnerAddress(\n params: GetAutoExchangeHistoryForOwnerAddressParams,\n ): Promise<GetAutoExchangeHistoryForOwnerAddressResult> {\n const uri = `/api/accounts/${params.address}/positions/auto-exchange`;\n return this.get(uri, {\n timestampFromMS: params.timestampFromMS,\n });\n }\n\n async getSwapHistoryForWalletAddress(\n params: GetSwapHistoryForWalletAddressParams,\n ): Promise<GetSwapHistoryForWalletAddressResult> {\n const uri = `/api/accounts/${params.address}/swaps/history`;\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 async updateLeverageForAccountAndMarket(\n params: UpdateLeverageForAccountAndMarketParams,\n ): Promise<UpdateLeverageForAccountAndMarketResult> {\n if (!params.accountId || !params.marketId || !params.leverage) {\n throw new Error('Missing required parameters');\n }\n\n const uri = `/api/accounts/${params.accountId}/marginAccount/${params.marketId}/set-max-leverage`;\n return this.post(\n uri,\n {},\n {\n leverage: params.leverage,\n },\n );\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,0CAOyB;AAEzB;IAA2C,iCAAU;IAArD;;IA4OA,CAAC;IA3OC;;;;;;;;;;;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,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;AAAD,CAAC,AA5OD,CAA2C,mBAAU,GA4OpD","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 GetMarginAccountOrderHistoryPaginatedParams,\n GetMarginAccountOrderHistoryPaginatedResult,\n GetLiquidationHistoryForOwnerAddressResult,\n GetLiquidationHistoryForOwnerAddressParams,\n GetAccountFeeRebatesHistoryParams,\n GetAccountFeeRebatesHistoryResult,\n GetAutoExchangeHistoryForOwnerAddressResult,\n GetAutoExchangeHistoryForOwnerAddressParams,\n UpdateLeverageForAccountAndMarketParams,\n UpdateLeverageForAccountAndMarketResult,\n GetSwapHistoryForWalletAddressResult,\n GetSwapHistoryForWalletAddressParams,\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 getMarginAccountOrderHistoryPaginated(\n params: GetMarginAccountOrderHistoryPaginatedParams,\n ): Promise<GetMarginAccountOrderHistoryPaginatedResult> {\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 getAutoExchangeHistoryForOwnerAddress(\n params: GetAutoExchangeHistoryForOwnerAddressParams,\n ): Promise<GetAutoExchangeHistoryForOwnerAddressResult> {\n const uri = `/api/accounts/${params.address}/positions/auto-exchange`;\n return this.get(uri, {\n timestampFromMS: params.timestampFromMS,\n });\n }\n\n async getSwapHistoryForWalletAddress(\n params: GetSwapHistoryForWalletAddressParams,\n ): Promise<GetSwapHistoryForWalletAddressResult> {\n const uri = `/api/accounts/${params.address}/swaps/history`;\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 async updateLeverageForAccountAndMarket(\n params: UpdateLeverageForAccountAndMarketParams,\n ): Promise<UpdateLeverageForAccountAndMarketResult> {\n if (!params.accountId || !params.marketId || !params.leverage) {\n throw new Error('Missing required parameters');\n }\n\n const uri = `/api/accounts/${params.accountId}/marginAccount/${params.marketId}/set-max-leverage`;\n return this.post(\n uri,\n {},\n {\n leverage: params.leverage,\n },\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 ReferralFeeTransactionHistoryEntity,\n AutoExchangeEvent,\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\nexport type GetAutoExchangeHistoryForOwnerAddressParams =\n GetLiquidationHistoryForOwnerAddressParams;\nexport type GetAutoExchangeHistoryForOwnerAddressResult = {\n data: AutoExchangeEvent[];\n};\n\nexport type SwapHistoryEntity = {\n id: string;\n tokenFrom: string;\n tokenTo: string;\n amountIn: number;\n amountOut: number;\n blockTimestamp: number;\n transactionHash: string;\n};\n\nexport type GetSwapHistoryForWalletAddressParams = {\n address: string;\n timestampFromMS: number;\n};\nexport type GetSwapHistoryForWalletAddressResult = {\n data: SwapHistoryEntity[];\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\nexport type EditMarginAccountParams = {\n id: MarginAccountEntity['id'];\n name: MarginAccountEntity['name'];\n};\n\nexport type EditMarginAccountResult = { success: boolean };\n\nexport type CloseMarginAccountParams = {\n id: MarginAccountEntity['id'];\n};\n\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\nexport type UpdateLeverageForAccountAndMarketParams = {\n accountId: MarginAccountEntity['id'];\n marketId: MarketEntity['id'];\n leverage: number;\n};\n\nexport type UpdateLeverageForAccountAndMarketResult = {\n successful: boolean;\n leverage: 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 OrderHistoryEntity,\n} from '@reyaxyz/common';\nimport {\n MarginAccountBalanceGranularity,\n MarginAccountCollateralsBalanceGranularity,\n AllMarginAccountsBalanceGranularity,\n ReferralFeeTransactionHistoryEntity,\n AutoExchangeEvent,\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// --- Order History ---\n\nexport type GetMarginAccountOrderHistoryParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n limit?: number;\n};\nexport type GetMarginAccountOrderHistoryPaginatedParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n page: number;\n perPage: number;\n type?: 'order' | 'liquidation';\n};\nexport type GetMarginAccountOrderHistoryResult = OrderHistoryEntity[];\nexport type GetMarginAccountOrderHistoryPaginatedResult = {\n data: OrderHistoryEntity[];\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\nexport type GetAutoExchangeHistoryForOwnerAddressParams =\n GetLiquidationHistoryForOwnerAddressParams;\nexport type GetAutoExchangeHistoryForOwnerAddressResult = {\n data: AutoExchangeEvent[];\n};\n\nexport type SwapHistoryEntity = {\n id: string;\n tokenFrom: string;\n tokenTo: string;\n amountIn: number;\n amountOut: number;\n blockTimestamp: number;\n transactionHash: string;\n};\n\nexport type GetSwapHistoryForWalletAddressParams = {\n address: string;\n timestampFromMS: number;\n};\nexport type GetSwapHistoryForWalletAddressResult = {\n data: SwapHistoryEntity[];\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\nexport type EditMarginAccountParams = {\n id: MarginAccountEntity['id'];\n name: MarginAccountEntity['name'];\n};\n\nexport type EditMarginAccountResult = { success: boolean };\n\nexport type CloseMarginAccountParams = {\n id: MarginAccountEntity['id'];\n};\n\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\nexport type UpdateLeverageForAccountAndMarketParams = {\n accountId: MarginAccountEntity['id'];\n marketId: MarketEntity['id'];\n leverage: number;\n};\n\nexport type UpdateLeverageForAccountAndMarketResult = {\n successful: boolean;\n leverage: number;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,0CA8ByB;AA5BvB,2GAAA,iBAAiB,OAAA;AAYjB,qGAAA,WAAW,OAAA;AACX,2GAAA,iBAAiB,OAAA;AAGjB,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 PositionHistoryEntity,\n PositionEntity,\n TransactionHistoryType,\n MarginAccountTransactionHistoryType,\n MarginAccountTransactionHistoryEntity,\n MarginAccountEntity,\n LpPositionEntity,\n LpPoolEntity,\n ReyaChainId,\n MoneyInOutChainId,\n GetLpPoolPerformanceChartDataResult,\n GetLpPoolBalanceChartDataResult,\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,0CA8ByB;AA5BvB,2GAAA,iBAAiB,OAAA;AAYjB,qGAAA,WAAW,OAAA;AACX,2GAAA,iBAAiB,OAAA;AAGjB,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 GetLpPoolPerformanceChartDataResult,\n GetLpPoolBalanceChartDataResult,\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,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, GetAccountFeeRebatesHistoryParams, GetAccountFeeRebatesHistoryResult, GetAutoExchangeHistoryForOwnerAddressResult, GetAutoExchangeHistoryForOwnerAddressParams, UpdateLeverageForAccountAndMarketParams, UpdateLeverageForAccountAndMarketResult, GetSwapHistoryForWalletAddressResult, GetSwapHistoryForWalletAddressParams } 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, GetMarginAccountOrderHistoryPaginatedParams, GetMarginAccountOrderHistoryPaginatedResult, GetLiquidationHistoryForOwnerAddressResult, GetLiquidationHistoryForOwnerAddressParams, GetAccountFeeRebatesHistoryParams, GetAccountFeeRebatesHistoryResult, GetAutoExchangeHistoryForOwnerAddressResult, GetAutoExchangeHistoryForOwnerAddressParams, UpdateLeverageForAccountAndMarketParams, UpdateLeverageForAccountAndMarketResult, GetSwapHistoryForWalletAddressResult, GetSwapHistoryForWalletAddressParams } from './types';
2
2
  import { EditCollateralSimulationState, TradeSimulationState, GetMarginAccountCollateralsBalanceChartDataResult, GetMarginAccountBalanceChartDataResult, GetAllMarginAccountsBalanceChartDataResult, RestClient } from '@reyaxyz/common';
3
3
  export default class AccountClient extends RestClient {
4
4
  /**
@@ -27,7 +27,7 @@ export default class AccountClient extends RestClient {
27
27
  */
28
28
  getMarginAccount(params: GetMarginAccountParams): Promise<GetMarginAccountResult>;
29
29
  getPositionsForMarginAccount(params: GetPositionsForMarginAccountParams): Promise<GetPositionsForMarginAccountResult>;
30
- getPositionsHistoryForMarginAccountPaginated(params: GetPositionsHistoryForMarginAccountPaginatedParams): Promise<GetPositionsHistoryForMarginAccountPaginatedResult>;
30
+ getMarginAccountOrderHistoryPaginated(params: GetMarginAccountOrderHistoryPaginatedParams): Promise<GetMarginAccountOrderHistoryPaginatedResult>;
31
31
  getLiquidationHistoryForOwnerAddress(params: GetLiquidationHistoryForOwnerAddressParams): Promise<GetLiquidationHistoryForOwnerAddressResult>;
32
32
  getAutoExchangeHistoryForOwnerAddress(params: GetAutoExchangeHistoryForOwnerAddressParams): Promise<GetAutoExchangeHistoryForOwnerAddressResult>;
33
33
  getSwapHistoryForWalletAddress(params: GetSwapHistoryForWalletAddressParams): Promise<GetSwapHistoryForWalletAddressResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":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ountEntity, MarginAccountTransactionHistoryEntity, MarketEntity, PositionEntity, PositionHistoryEntity } from '@reyaxyz/common';
1
+ import { MarginAccountEntity, MarginAccountTransactionHistoryEntity, MarketEntity, PositionEntity, OrderHistoryEntity } from '@reyaxyz/common';
2
2
  import { MarginAccountBalanceGranularity, MarginAccountCollateralsBalanceGranularity, AllMarginAccountsBalanceGranularity, ReferralFeeTransactionHistoryEntity, AutoExchangeEvent } from '@reyaxyz/common';
3
3
  import { Address } from '@reyaxyz/common';
4
4
  export type GetMarginAccountsParams = {
@@ -46,21 +46,21 @@ export type GetPositionsForMarginAccountResult = {
46
46
  positions: PositionEntity[];
47
47
  totalUnrealizedPNL: number;
48
48
  };
49
- export type GetPositionsHistoryForMarginAccountParams = {
49
+ export type GetMarginAccountOrderHistoryParams = {
50
50
  address: string;
51
51
  marginAccountId: MarginAccountEntity['id'];
52
52
  limit?: number;
53
53
  };
54
- export type GetPositionsHistoryForMarginAccountPaginatedParams = {
54
+ export type GetMarginAccountOrderHistoryPaginatedParams = {
55
55
  address: string;
56
56
  marginAccountId: MarginAccountEntity['id'];
57
57
  page: number;
58
58
  perPage: number;
59
59
  type?: 'order' | 'liquidation';
60
60
  };
61
- export type GetPositionsHistoryForMarginAccountResult = PositionHistoryEntity[];
62
- export type GetPositionsHistoryForMarginAccountPaginatedResult = {
63
- data: PositionHistoryEntity[];
61
+ export type GetMarginAccountOrderHistoryResult = OrderHistoryEntity[];
62
+ export type GetMarginAccountOrderHistoryPaginatedResult = {
63
+ data: OrderHistoryEntity[];
64
64
  totalCount: number;
65
65
  };
66
66
  export type GetLiquidationHistoryForOwnerAddressParams = {
@@ -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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CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,uCAAuC,GAAG;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
@@ -1,4 +1,4 @@
1
- export { Candle, CandlesResolution, MarketEntity, LpTransactionHistoryEntity, TradingHistoryEntity, PositionHistoryEntity, PositionEntity, TransactionHistoryType, MarginAccountTransactionHistoryType, MarginAccountTransactionHistoryEntity, MarginAccountEntity, LpPositionEntity, LpPoolEntity, ReyaChainId, MoneyInOutChainId, GetLpPoolPerformanceChartDataResult, GetLpPoolBalanceChartDataResult, LpBalanceGranularity, MarginAccountBalanceGranularity, GetMarginAccountBalanceChartDataResult, MarginAccountCollateralsBalanceGranularity, GetMarginAccountCollateralsBalanceChartDataResult, GetAllMarginAccountsBalanceChartDataResult, AllMarginAccountsBalanceGranularity, GetFundingRateChartDataResult, FundingRateHistoryGranularity, MoneyInOutConfigurationPerTokenName, UnifiedConditionalOrderType, ConditionalOrderType, } from '@reyaxyz/common';
1
+ export { Candle, CandlesResolution, MarketEntity, LpTransactionHistoryEntity, TradingHistoryEntity, OrderHistoryEntity, PositionEntity, TransactionHistoryType, MarginAccountTransactionHistoryType, MarginAccountTransactionHistoryEntity, MarginAccountEntity, LpPositionEntity, LpPoolEntity, ReyaChainId, MoneyInOutChainId, GetLpPoolPerformanceChartDataResult, GetLpPoolBalanceChartDataResult, LpBalanceGranularity, MarginAccountBalanceGranularity, GetMarginAccountBalanceChartDataResult, MarginAccountCollateralsBalanceGranularity, GetMarginAccountCollateralsBalanceChartDataResult, GetAllMarginAccountsBalanceChartDataResult, AllMarginAccountsBalanceGranularity, GetFundingRateChartDataResult, FundingRateHistoryGranularity, MoneyInOutConfigurationPerTokenName, UnifiedConditionalOrderType, ConditionalOrderType, } from '@reyaxyz/common';
2
2
  export * from './modules/account/types';
3
3
  export * from './modules/conditional-orders/types';
4
4
  export * from './modules/lp/types';
@@ -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,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,mCAAmC,EACnC,qCAAqC,EACrC,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,mCAAmC,EACnC,+BAA+B,EAC/B,oBAAoB,EACpB,+BAA+B,EAC/B,sCAAsC,EACtC,0CAA0C,EAC1C,iDAAiD,EACjD,0CAA0C,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;AAC3C,cAAc,yBAAyB,CAAC"}
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,EACtB,mCAAmC,EACnC,qCAAqC,EACrC,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,mCAAmC,EACnC,+BAA+B,EAC/B,oBAAoB,EACpB,+BAA+B,EAC/B,sCAAsC,EACtC,0CAA0C,EAC1C,iDAAiD,EACjD,0CAA0C,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;AAC3C,cAAc,yBAAyB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/api-sdk",
3
- "version": "0.145.2",
3
+ "version": "0.145.4",
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.237.0",
36
+ "@reyaxyz/common": "0.238.1",
37
37
  "@simplewebauthn/types": "^10.0.0",
38
38
  "axios": "^1.6.2",
39
39
  "bignumber.js": "^9.1.2",
@@ -42,7 +42,7 @@
42
42
  "ws": "^8.16.0"
43
43
  },
44
44
  "packageManager": "pnpm@8.3.1",
45
- "gitHead": "4f4448e3139f2b9186f35fccc0c530ff9ea8439a",
45
+ "gitHead": "eac178dba12dffdd2e847a00c1aeea674f9a81f0",
46
46
  "devDependencies": {
47
47
  "@types/ws": "8.5.10"
48
48
  }
@@ -24,8 +24,8 @@ import {
24
24
  CloseMarginAccountResult,
25
25
  GetIsolatedOrderMaxSizeAvailableParams,
26
26
  GetIsolatedOrderMaxSizeAvailableResult,
27
- GetPositionsHistoryForMarginAccountPaginatedParams,
28
- GetPositionsHistoryForMarginAccountPaginatedResult,
27
+ GetMarginAccountOrderHistoryPaginatedParams,
28
+ GetMarginAccountOrderHistoryPaginatedResult,
29
29
  GetLiquidationHistoryForOwnerAddressResult,
30
30
  GetLiquidationHistoryForOwnerAddressParams,
31
31
  GetAccountFeeRebatesHistoryParams,
@@ -97,9 +97,9 @@ export default class AccountClient extends RestClient {
97
97
  return this.get(uri, { limit: params.limit });
98
98
  }
99
99
 
100
- async getPositionsHistoryForMarginAccountPaginated(
101
- params: GetPositionsHistoryForMarginAccountPaginatedParams,
102
- ): Promise<GetPositionsHistoryForMarginAccountPaginatedResult> {
100
+ async getMarginAccountOrderHistoryPaginated(
101
+ params: GetMarginAccountOrderHistoryPaginatedParams,
102
+ ): Promise<GetMarginAccountOrderHistoryPaginatedResult> {
103
103
  const uri = `/api/accounts/${params.address}/marginAccount/${params.marginAccountId}/positions/history/paginated`;
104
104
  return this.get(uri, {
105
105
  type: params.type,
@@ -3,7 +3,7 @@ import {
3
3
  MarginAccountTransactionHistoryEntity,
4
4
  MarketEntity,
5
5
  PositionEntity,
6
- PositionHistoryEntity,
6
+ OrderHistoryEntity,
7
7
  } from '@reyaxyz/common';
8
8
  import {
9
9
  MarginAccountBalanceGranularity,
@@ -77,23 +77,23 @@ export type GetPositionsForMarginAccountResult = {
77
77
  totalUnrealizedPNL: number;
78
78
  };
79
79
 
80
- // --- Position History ---
80
+ // --- Order History ---
81
81
 
82
- export type GetPositionsHistoryForMarginAccountParams = {
82
+ export type GetMarginAccountOrderHistoryParams = {
83
83
  address: string;
84
84
  marginAccountId: MarginAccountEntity['id'];
85
85
  limit?: number;
86
86
  };
87
- export type GetPositionsHistoryForMarginAccountPaginatedParams = {
87
+ export type GetMarginAccountOrderHistoryPaginatedParams = {
88
88
  address: string;
89
89
  marginAccountId: MarginAccountEntity['id'];
90
90
  page: number;
91
91
  perPage: number;
92
92
  type?: 'order' | 'liquidation';
93
93
  };
94
- export type GetPositionsHistoryForMarginAccountResult = PositionHistoryEntity[];
95
- export type GetPositionsHistoryForMarginAccountPaginatedResult = {
96
- data: PositionHistoryEntity[];
94
+ export type GetMarginAccountOrderHistoryResult = OrderHistoryEntity[];
95
+ export type GetMarginAccountOrderHistoryPaginatedResult = {
96
+ data: OrderHistoryEntity[];
97
97
  totalCount: number;
98
98
  };
99
99
 
@@ -5,7 +5,7 @@ export {
5
5
  MarketEntity,
6
6
  LpTransactionHistoryEntity,
7
7
  TradingHistoryEntity,
8
- PositionHistoryEntity,
8
+ OrderHistoryEntity,
9
9
  PositionEntity,
10
10
  TransactionHistoryType,
11
11
  MarginAccountTransactionHistoryType,