@reyaxyz/api-sdk 0.126.10 → 0.126.11
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 +1 -1
- package/dist/clients/modules/account/index.js +11 -0
- package/dist/clients/modules/account/index.js.map +1 -1
- package/dist/clients/modules/account/types.js.map +1 -1
- package/dist/clients/modules/owner/index.js +21 -0
- package/dist/clients/modules/owner/index.js.map +1 -1
- package/dist/clients/modules/owner/types.js.map +1 -1
- package/dist/types/clients/modules/account/index.d.ts +1 -0
- package/dist/types/clients/modules/account/index.d.ts.map +1 -1
- package/dist/types/clients/modules/account/types.d.ts +5 -1
- package/dist/types/clients/modules/account/types.d.ts.map +1 -1
- package/dist/types/clients/modules/owner/index.d.ts +3 -1
- package/dist/types/clients/modules/owner/index.d.ts.map +1 -1
- package/dist/types/clients/modules/owner/types.d.ts +13 -0
- package/dist/types/clients/modules/owner/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/clients/modules/account/index.ts +9 -0
- package/src/clients/modules/account/types.ts +7 -0
- package/src/clients/modules/owner/index.ts +25 -0
- package/src/clients/modules/owner/types.ts +17 -0
package/README.md
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
|
|
7
7
|
| Statements | Branches | Functions | Lines |
|
|
8
8
|
| --------------------------- | ----------------------- | ------------------------- | ----------------- |
|
|
9
|
-
|  |  |  |  |
|
|
10
10
|
|
|
@@ -139,6 +139,17 @@ var AccountClient = /** @class */ (function (_super) {
|
|
|
139
139
|
});
|
|
140
140
|
});
|
|
141
141
|
};
|
|
142
|
+
AccountClient.prototype.getAutoExchangeHistoryForOwnerAddress = function (params) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
144
|
+
var uri;
|
|
145
|
+
return __generator(this, function (_a) {
|
|
146
|
+
uri = "/api/accounts/".concat(params.address, "/positions/auto-exchange");
|
|
147
|
+
return [2 /*return*/, this.get(uri, {
|
|
148
|
+
timestampFromMS: params.timestampFromMS,
|
|
149
|
+
})];
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
};
|
|
142
153
|
AccountClient.prototype.getMaxOrderSizeAvailable = function (params) {
|
|
143
154
|
return __awaiter(this, void 0, void 0, function () {
|
|
144
155
|
var uri;
|
|
@@ -1 +1 @@
|
|
|
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,M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AA2B,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,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
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,0CAOyB;AAEzB;IAA2C,iCAAU;IAArD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AM,CAAC,EAAE;qBACd,CAAC,EAAC;;;KACJ;IACH,oBAAC;AAAD,CAAC,AAlND,CAA2C,mBAAU,GAkNpD","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 getAutoExchangeHistoryForOwnerAddress(\n params: GetLiquidationHistoryForOwnerAddressParams,\n ): Promise<GetLiquidationHistoryForOwnerAddressResult> {\n const uri = `/api/accounts/${params.address}/positions/auto-exchange`;\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 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
|
+
{"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\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"]}
|
|
@@ -93,6 +93,27 @@ var OwnerClient = /** @class */ (function (_super) {
|
|
|
93
93
|
});
|
|
94
94
|
});
|
|
95
95
|
};
|
|
96
|
+
OwnerClient.prototype.getOwnerLastSeenNotificationTimestamp = function (params) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
+
var uri;
|
|
99
|
+
return __generator(this, function (_a) {
|
|
100
|
+
uri = "/api/owner/".concat(params.ownerAddress, "/last-seen-notification-timestamp/auto-exchange");
|
|
101
|
+
return [2 /*return*/, this.get(uri)];
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
OwnerClient.prototype.setOwnerLastSeenNotificationTimestamp = function (params) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
107
|
+
var uri;
|
|
108
|
+
return __generator(this, function (_a) {
|
|
109
|
+
uri = "/api/owner/set-last-seen-notification-timestamp/auto-exchange";
|
|
110
|
+
return [2 /*return*/, this.put(uri, {}, {
|
|
111
|
+
address: params.ownerAddress,
|
|
112
|
+
timestampMs: params.timestampMs,
|
|
113
|
+
})];
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
};
|
|
96
117
|
return OwnerClient;
|
|
97
118
|
}(common_1.RestClient));
|
|
98
119
|
exports.default = OwnerClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/owner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/owner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,0CAA6C;AAE7C;IAAyC,+BAAU;IAAnD;;IAiDA,CAAC;IAhDO,sCAAgB,GAAtB,UACE,MAA8B;;;;gBAExB,GAAG,GAAG,qBAAc,MAAM,CAAC,YAAY,cAAW,CAAC;gBACzD,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC;;;KACtB;IAEK,mDAA6B,GAAnC,UACE,MAA2C;;;;gBAErC,GAAG,GAAG,qBAAc,MAAM,CAAC,YAAY,4BAAyB,CAAC;gBACvE,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC;;;KACtB;IAEK,uCAAiB,GAAvB,UACE,MAA+B;;;;gBAEzB,GAAG,GAAG,qBAAc,MAAM,CAAC,YAAY,mCAAgC,CAAC;gBAC9E,sBAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,EAAC;;;KAC1C;IAEK,0CAAoB,GAA1B,UACE,MAAkC;;;;gBAE5B,GAAG,GAAG,qBAAc,MAAM,CAAC,YAAY,mCAAgC,CAAC;gBAC9E,sBAAO,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,EAAC;;;KAC5C;IAEK,2DAAqC,GAA3C,UACE,MAAmD;;;;gBAE7C,GAAG,GAAG,qBAAc,MAAM,CAAC,YAAY,oDAAiD,CAAC;gBAC/F,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC;;;KACtB;IAEK,2DAAqC,GAA3C,UACE,MAAmD;;;;gBAE7C,GAAG,GAAG,+DAA+D,CAAC;gBAC5E,sBAAO,IAAI,CAAC,GAAG,CACb,GAAG,EACH,EAAE,EACF;wBACE,OAAO,EAAE,MAAM,CAAC,YAAY;wBAC5B,WAAW,EAAE,MAAM,CAAC,WAAW;qBAChC,CACF,EAAC;;;KACH;IACH,kBAAC;AAAD,CAAC,AAjDD,CAAyC,mBAAU,GAiDlD","sourcesContent":["import {\n AddFavoriteMarketParams,\n AddFavoriteMarketResult,\n GetOwnerConfigurationSettingsParams,\n GetOwnerConfigurationSettingsResult,\n GetOwnerLastSeenNotificationTimestampParams,\n GetOwnerLastSeenNotificationTimestampResult,\n GetOwnerMetadataParams,\n GetOwnerMetadataResult,\n RemoveFavoriteMarketParams,\n RemoveFavoriteMarketResult,\n SetOwnerLastSeenNotificationTimestampParams,\n SetOwnerLastSeenNotificationTimestampResult,\n} from './types';\nimport { RestClient } from '@reyaxyz/common';\n\nexport default class OwnerClient extends RestClient {\n async getOwnerMetadata(\n params: GetOwnerMetadataParams,\n ): Promise<GetOwnerMetadataResult> {\n const uri = `/api/owner/${params.ownerAddress}/metadata`;\n return this.get(uri);\n }\n\n async getOwnerConfigurationSettings(\n params: GetOwnerConfigurationSettingsParams,\n ): Promise<GetOwnerConfigurationSettingsResult> {\n const uri = `/api/owner/${params.ownerAddress}/configuration/settings`;\n return this.get(uri);\n }\n\n async addFavoriteMarket(\n params: AddFavoriteMarketParams,\n ): Promise<AddFavoriteMarketResult> {\n const uri = `/api/owner/${params.ownerAddress}/configuration/favorite-market`;\n return this.post(uri, undefined, params);\n }\n\n async removeFavoriteMarket(\n params: RemoveFavoriteMarketParams,\n ): Promise<RemoveFavoriteMarketResult> {\n const uri = `/api/owner/${params.ownerAddress}/configuration/favorite-market`;\n return this.delete(uri, undefined, params);\n }\n\n async getOwnerLastSeenNotificationTimestamp(\n params: GetOwnerLastSeenNotificationTimestampParams,\n ): Promise<GetOwnerLastSeenNotificationTimestampResult> {\n const uri = `/api/owner/${params.ownerAddress}/last-seen-notification-timestamp/auto-exchange`;\n return this.get(uri);\n }\n\n async setOwnerLastSeenNotificationTimestamp(\n params: SetOwnerLastSeenNotificationTimestampParams,\n ): Promise<SetOwnerLastSeenNotificationTimestampResult> {\n const uri = `/api/owner/set-last-seen-notification-timestamp/auto-exchange`;\n return this.put(\n uri,\n {},\n {\n address: params.ownerAddress,\n timestampMs: params.timestampMs,\n },\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/owner/types.ts"],"names":[],"mappings":"","sourcesContent":["import { OwnerMetadataEntity } from '@reyaxyz/common';\n\nexport type GetOwnerMetadataParams = {\n ownerAddress: string;\n};\n\nexport type GetOwnerConfigurationSettingsParams = {\n ownerAddress: string;\n};\n\nexport type GetOwnerConfigurationSettingsResult = {\n favoriteMarkets: number[];\n};\n\nexport type AddFavoriteMarketParams = {\n ownerAddress: string;\n marketId: number;\n};\n\nexport type AddFavoriteMarketResult = { success: boolean };\n\nexport type RemoveFavoriteMarketParams = {\n ownerAddress: string;\n marketId: number;\n};\n\nexport type RemoveFavoriteMarketResult = { success: boolean };\n\nexport type GetOwnerMetadataResult = OwnerMetadataEntity;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/owner/types.ts"],"names":[],"mappings":"","sourcesContent":["import { OwnerMetadataEntity } from '@reyaxyz/common';\n\nexport type GetOwnerMetadataParams = {\n ownerAddress: string;\n};\n\nexport type GetOwnerConfigurationSettingsParams = {\n ownerAddress: string;\n};\n\nexport type GetOwnerConfigurationSettingsResult = {\n favoriteMarkets: number[];\n};\n\nexport type AddFavoriteMarketParams = {\n ownerAddress: string;\n marketId: number;\n};\n\nexport type AddFavoriteMarketResult = { success: boolean };\n\nexport type RemoveFavoriteMarketParams = {\n ownerAddress: string;\n marketId: number;\n};\n\nexport type RemoveFavoriteMarketResult = { success: boolean };\n\nexport type GetOwnerMetadataResult = OwnerMetadataEntity;\n\nexport type GetOwnerLastSeenNotificationTimestampParams = {\n ownerAddress: string;\n};\n\nexport type GetOwnerLastSeenNotificationTimestampResult = {\n timestampMs: number;\n};\n\nexport type SetOwnerLastSeenNotificationTimestampParams = {\n ownerAddress: string;\n timestampMs: number;\n};\n\nexport type SetOwnerLastSeenNotificationTimestampResult = {\n timestampMs: number;\n};\n"]}
|
|
@@ -29,6 +29,7 @@ export default class AccountClient extends RestClient {
|
|
|
29
29
|
getPositionsForMarginAccount(params: GetPositionsForMarginAccountParams): Promise<GetPositionsForMarginAccountResult>;
|
|
30
30
|
getPositionsHistoryForMarginAccountPaginated(params: GetPositionsHistoryForMarginAccountPaginatedParams): Promise<GetPositionsHistoryForMarginAccountPaginatedResult>;
|
|
31
31
|
getLiquidationHistoryForOwnerAddress(params: GetLiquidationHistoryForOwnerAddressParams): Promise<GetLiquidationHistoryForOwnerAddressResult>;
|
|
32
|
+
getAutoExchangeHistoryForOwnerAddress(params: GetLiquidationHistoryForOwnerAddressParams): Promise<GetLiquidationHistoryForOwnerAddressResult>;
|
|
32
33
|
getMaxOrderSizeAvailable(params: GetMaxOrderSizeAvailableParams): Promise<GetMaxOrderSizeAvailableResult>;
|
|
33
34
|
getIsolatedOrderMaxSizeAvailable(params: GetIsolatedOrderMaxSizeAvailableParams): Promise<GetIsolatedOrderMaxSizeAvailableResult>;
|
|
34
35
|
getTransactionSimulationInitialData(params: GetTransactionSimulationInitialDataParams): Promise<TradeSimulationState>;
|
|
@@ -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,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;AAEz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AA2B,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
|
+
{"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,kCAAk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@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MarginAccountEntity, MarginAccountTransactionHistoryEntity, MarketEntity, PositionEntity, PositionHistoryEntity } from '@reyaxyz/common';
|
|
2
|
-
import { MarginAccountBalanceGranularity, MarginAccountCollateralsBalanceGranularity, AllMarginAccountsBalanceGranularity, ReferralFeeTransactionHistoryEntity } from '@reyaxyz/common';
|
|
2
|
+
import { MarginAccountBalanceGranularity, MarginAccountCollateralsBalanceGranularity, AllMarginAccountsBalanceGranularity, ReferralFeeTransactionHistoryEntity, AutoExchangeEvent } from '@reyaxyz/common';
|
|
3
3
|
import { Address } from '@reyaxyz/common';
|
|
4
4
|
export type GetMarginAccountsParams = {
|
|
5
5
|
address: string;
|
|
@@ -86,6 +86,10 @@ export type LiquidationHistoryEntity = {
|
|
|
86
86
|
marginRatioHealth: MarginAccountEntity['marginRatioHealth'];
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
+
export type GetAutoExchangeHistoryForOwnerAddressParams = GetLiquidationHistoryForOwnerAddressParams;
|
|
90
|
+
export type GetAutoExchangeHistoryForOwnerAddressResult = {
|
|
91
|
+
data: AutoExchangeEvent[];
|
|
92
|
+
};
|
|
89
93
|
export type GetTransactionSimulationInitialDataParams = {
|
|
90
94
|
marketId: MarketEntity['id'];
|
|
91
95
|
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,EACnC,mCAAmC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/account/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,qCAAqC,E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ddFavoriteMarketResult, GetOwnerConfigurationSettingsParams, GetOwnerConfigurationSettingsResult, GetOwnerMetadataParams, GetOwnerMetadataResult, RemoveFavoriteMarketParams, RemoveFavoriteMarketResult } from './types';
|
|
1
|
+
import { AddFavoriteMarketParams, AddFavoriteMarketResult, GetOwnerConfigurationSettingsParams, GetOwnerConfigurationSettingsResult, GetOwnerLastSeenNotificationTimestampParams, GetOwnerLastSeenNotificationTimestampResult, GetOwnerMetadataParams, GetOwnerMetadataResult, RemoveFavoriteMarketParams, RemoveFavoriteMarketResult, SetOwnerLastSeenNotificationTimestampParams, SetOwnerLastSeenNotificationTimestampResult } from './types';
|
|
2
2
|
import { RestClient } from '@reyaxyz/common';
|
|
3
3
|
export default class OwnerClient extends RestClient {
|
|
4
4
|
getOwnerMetadata(params: GetOwnerMetadataParams): Promise<GetOwnerMetadataResult>;
|
|
5
5
|
getOwnerConfigurationSettings(params: GetOwnerConfigurationSettingsParams): Promise<GetOwnerConfigurationSettingsResult>;
|
|
6
6
|
addFavoriteMarket(params: AddFavoriteMarketParams): Promise<AddFavoriteMarketResult>;
|
|
7
7
|
removeFavoriteMarket(params: RemoveFavoriteMarketParams): Promise<RemoveFavoriteMarketResult>;
|
|
8
|
+
getOwnerLastSeenNotificationTimestamp(params: GetOwnerLastSeenNotificationTimestampParams): Promise<GetOwnerLastSeenNotificationTimestampResult>;
|
|
9
|
+
setOwnerLastSeenNotificationTimestamp(params: SetOwnerLastSeenNotificationTimestampParams): Promise<SetOwnerLastSeenNotificationTimestampResult>;
|
|
8
10
|
}
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/owner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,mCAAmC,EACnC,mCAAmC,EACnC,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/owner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,mCAAmC,EACnC,mCAAmC,EACnC,2CAA2C,EAC3C,2CAA2C,EAC3C,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAC1B,2CAA2C,EAC3C,2CAA2C,EAC5C,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,UAAU;IAC3C,gBAAgB,CACpB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAK5B,6BAA6B,CACjC,MAAM,EAAE,mCAAmC,GAC1C,OAAO,CAAC,mCAAmC,CAAC;IAKzC,iBAAiB,CACrB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC;IAK7B,oBAAoB,CACxB,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,0BAA0B,CAAC;IAKhC,qCAAqC,CACzC,MAAM,EAAE,2CAA2C,GAClD,OAAO,CAAC,2CAA2C,CAAC;IAKjD,qCAAqC,CACzC,MAAM,EAAE,2CAA2C,GAClD,OAAO,CAAC,2CAA2C,CAAC;CAWxD"}
|
|
@@ -23,4 +23,17 @@ export type RemoveFavoriteMarketResult = {
|
|
|
23
23
|
success: boolean;
|
|
24
24
|
};
|
|
25
25
|
export type GetOwnerMetadataResult = OwnerMetadataEntity;
|
|
26
|
+
export type GetOwnerLastSeenNotificationTimestampParams = {
|
|
27
|
+
ownerAddress: string;
|
|
28
|
+
};
|
|
29
|
+
export type GetOwnerLastSeenNotificationTimestampResult = {
|
|
30
|
+
timestampMs: number;
|
|
31
|
+
};
|
|
32
|
+
export type SetOwnerLastSeenNotificationTimestampParams = {
|
|
33
|
+
ownerAddress: string;
|
|
34
|
+
timestampMs: number;
|
|
35
|
+
};
|
|
36
|
+
export type SetOwnerLastSeenNotificationTimestampResult = {
|
|
37
|
+
timestampMs: number;
|
|
38
|
+
};
|
|
26
39
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/owner/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,MAAM,sBAAsB,GAAG;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3D,MAAM,MAAM,0BAA0B,GAAG;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/owner/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,MAAM,sBAAsB,GAAG;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3D,MAAM,MAAM,0BAA0B,GAAG;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAEzD,MAAM,MAAM,2CAA2C,GAAG;IACxD,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,2CAA2C,GAAG;IACxD,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,2CAA2C,GAAG;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,2CAA2C,GAAG;IACxD,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/api-sdk",
|
|
3
|
-
"version": "0.126.
|
|
3
|
+
"version": "0.126.11",
|
|
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.197.
|
|
36
|
+
"@reyaxyz/common": "0.197.3",
|
|
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": "
|
|
46
|
+
"gitHead": "8621ecf740ecd963e66ab9437cde6842f4ce1943",
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/ws": "8.5.10"
|
|
49
49
|
}
|
|
@@ -111,6 +111,15 @@ export default class AccountClient extends RestClient {
|
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
async getAutoExchangeHistoryForOwnerAddress(
|
|
115
|
+
params: GetLiquidationHistoryForOwnerAddressParams,
|
|
116
|
+
): Promise<GetLiquidationHistoryForOwnerAddressResult> {
|
|
117
|
+
const uri = `/api/accounts/${params.address}/positions/auto-exchange`;
|
|
118
|
+
return this.get(uri, {
|
|
119
|
+
timestampFromMS: params.timestampFromMS,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
114
123
|
async getMaxOrderSizeAvailable(
|
|
115
124
|
params: GetMaxOrderSizeAvailableParams,
|
|
116
125
|
): Promise<GetMaxOrderSizeAvailableResult> {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
MarginAccountCollateralsBalanceGranularity,
|
|
11
11
|
AllMarginAccountsBalanceGranularity,
|
|
12
12
|
ReferralFeeTransactionHistoryEntity,
|
|
13
|
+
AutoExchangeEvent,
|
|
13
14
|
} from '@reyaxyz/common';
|
|
14
15
|
import { Address } from '@reyaxyz/common';
|
|
15
16
|
|
|
@@ -122,6 +123,12 @@ export type LiquidationHistoryEntity = {
|
|
|
122
123
|
};
|
|
123
124
|
};
|
|
124
125
|
|
|
126
|
+
export type GetAutoExchangeHistoryForOwnerAddressParams =
|
|
127
|
+
GetLiquidationHistoryForOwnerAddressParams;
|
|
128
|
+
export type GetAutoExchangeHistoryForOwnerAddressResult = {
|
|
129
|
+
data: AutoExchangeEvent[];
|
|
130
|
+
};
|
|
131
|
+
|
|
125
132
|
// ---- Transaction Simulation ----
|
|
126
133
|
|
|
127
134
|
export type GetTransactionSimulationInitialDataParams = {
|
|
@@ -3,10 +3,14 @@ import {
|
|
|
3
3
|
AddFavoriteMarketResult,
|
|
4
4
|
GetOwnerConfigurationSettingsParams,
|
|
5
5
|
GetOwnerConfigurationSettingsResult,
|
|
6
|
+
GetOwnerLastSeenNotificationTimestampParams,
|
|
7
|
+
GetOwnerLastSeenNotificationTimestampResult,
|
|
6
8
|
GetOwnerMetadataParams,
|
|
7
9
|
GetOwnerMetadataResult,
|
|
8
10
|
RemoveFavoriteMarketParams,
|
|
9
11
|
RemoveFavoriteMarketResult,
|
|
12
|
+
SetOwnerLastSeenNotificationTimestampParams,
|
|
13
|
+
SetOwnerLastSeenNotificationTimestampResult,
|
|
10
14
|
} from './types';
|
|
11
15
|
import { RestClient } from '@reyaxyz/common';
|
|
12
16
|
|
|
@@ -38,4 +42,25 @@ export default class OwnerClient extends RestClient {
|
|
|
38
42
|
const uri = `/api/owner/${params.ownerAddress}/configuration/favorite-market`;
|
|
39
43
|
return this.delete(uri, undefined, params);
|
|
40
44
|
}
|
|
45
|
+
|
|
46
|
+
async getOwnerLastSeenNotificationTimestamp(
|
|
47
|
+
params: GetOwnerLastSeenNotificationTimestampParams,
|
|
48
|
+
): Promise<GetOwnerLastSeenNotificationTimestampResult> {
|
|
49
|
+
const uri = `/api/owner/${params.ownerAddress}/last-seen-notification-timestamp/auto-exchange`;
|
|
50
|
+
return this.get(uri);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async setOwnerLastSeenNotificationTimestamp(
|
|
54
|
+
params: SetOwnerLastSeenNotificationTimestampParams,
|
|
55
|
+
): Promise<SetOwnerLastSeenNotificationTimestampResult> {
|
|
56
|
+
const uri = `/api/owner/set-last-seen-notification-timestamp/auto-exchange`;
|
|
57
|
+
return this.put(
|
|
58
|
+
uri,
|
|
59
|
+
{},
|
|
60
|
+
{
|
|
61
|
+
address: params.ownerAddress,
|
|
62
|
+
timestampMs: params.timestampMs,
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
}
|
|
41
66
|
}
|
|
@@ -27,3 +27,20 @@ export type RemoveFavoriteMarketParams = {
|
|
|
27
27
|
export type RemoveFavoriteMarketResult = { success: boolean };
|
|
28
28
|
|
|
29
29
|
export type GetOwnerMetadataResult = OwnerMetadataEntity;
|
|
30
|
+
|
|
31
|
+
export type GetOwnerLastSeenNotificationTimestampParams = {
|
|
32
|
+
ownerAddress: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type GetOwnerLastSeenNotificationTimestampResult = {
|
|
36
|
+
timestampMs: number;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type SetOwnerLastSeenNotificationTimestampParams = {
|
|
40
|
+
ownerAddress: string;
|
|
41
|
+
timestampMs: number;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type SetOwnerLastSeenNotificationTimestampResult = {
|
|
45
|
+
timestampMs: number;
|
|
46
|
+
};
|