@reyaxyz/api-sdk 0.158.0 → 0.160.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clients/modules/account/index.js +21 -5
- package/dist/clients/modules/account/index.js.map +1 -1
- package/dist/clients/modules/account/types.js.map +1 -1
- package/dist/clients/modules/auth/types.js.map +1 -1
- package/dist/clients/modules/conditional-orders/types.js.map +1 -1
- package/dist/clients/modules/deposit-existing-MA.simulation/types.js.map +1 -1
- package/dist/clients/modules/edit-collateral.simulation/types.js.map +1 -1
- package/dist/clients/modules/transfer-MA-Pool.simulation/types.js.map +1 -1
- package/dist/clients/modules/transfer-margin-between-MAs.simulation/types.js.map +1 -1
- package/dist/clients/modules/withdraw-MA.simulation/types.js.map +1 -1
- package/dist/clients/types.js.map +1 -1
- package/dist/types/clients/modules/account/index.d.ts.map +1 -1
- package/dist/types/clients/modules/account/types.d.ts +24 -24
- package/dist/types/clients/modules/account/types.d.ts.map +1 -1
- package/dist/types/clients/modules/auth/types.d.ts +1 -2
- package/dist/types/clients/modules/auth/types.d.ts.map +1 -1
- package/dist/types/clients/modules/conditional-orders/types.d.ts +3 -3
- package/dist/types/clients/modules/conditional-orders/types.d.ts.map +1 -1
- package/dist/types/clients/modules/deposit-existing-MA.simulation/types.d.ts +3 -3
- package/dist/types/clients/modules/deposit-existing-MA.simulation/types.d.ts.map +1 -1
- package/dist/types/clients/modules/edit-collateral.simulation/types.d.ts +4 -4
- package/dist/types/clients/modules/edit-collateral.simulation/types.d.ts.map +1 -1
- package/dist/types/clients/modules/transfer-MA-Pool.simulation/types.d.ts +3 -3
- package/dist/types/clients/modules/transfer-MA-Pool.simulation/types.d.ts.map +1 -1
- package/dist/types/clients/modules/transfer-margin-between-MAs.simulation/types.d.ts +7 -7
- package/dist/types/clients/modules/transfer-margin-between-MAs.simulation/types.d.ts.map +1 -1
- package/dist/types/clients/modules/withdraw-MA.simulation/types.d.ts +3 -3
- package/dist/types/clients/modules/withdraw-MA.simulation/types.d.ts.map +1 -1
- package/dist/types/clients/types.d.ts +1 -1
- package/dist/types/clients/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/clients/modules/account/index.ts +23 -3
- package/src/clients/modules/account/types.ts +25 -24
- package/src/clients/modules/auth/types.ts +1 -2
- package/src/clients/modules/conditional-orders/types.ts +3 -3
- package/src/clients/modules/deposit-existing-MA.simulation/types.ts +3 -3
- package/src/clients/modules/edit-collateral.simulation/types.ts +4 -4
- package/src/clients/modules/transfer-MA-Pool.simulation/types.ts +3 -3
- package/src/clients/modules/transfer-margin-between-MAs.simulation/types.ts +7 -7
- package/src/clients/modules/withdraw-MA.simulation/types.ts +3 -3
- package/src/clients/types.ts +1 -1
|
@@ -71,7 +71,7 @@ var AccountClient = /** @class */ (function (_super) {
|
|
|
71
71
|
* */
|
|
72
72
|
AccountClient.prototype.getMarginAccounts = function (params) {
|
|
73
73
|
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
-
var uri, response;
|
|
74
|
+
var uri, response, strippedResponse;
|
|
75
75
|
return __generator(this, function (_a) {
|
|
76
76
|
switch (_a.label) {
|
|
77
77
|
case 0:
|
|
@@ -82,7 +82,13 @@ var AccountClient = /** @class */ (function (_super) {
|
|
|
82
82
|
})];
|
|
83
83
|
case 1:
|
|
84
84
|
response = _a.sent();
|
|
85
|
-
|
|
85
|
+
strippedResponse = response.map(function (account) {
|
|
86
|
+
return {
|
|
87
|
+
id: account.id,
|
|
88
|
+
name: account.name,
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
return [2 /*return*/, strippedResponse];
|
|
86
92
|
}
|
|
87
93
|
});
|
|
88
94
|
});
|
|
@@ -100,10 +106,20 @@ var AccountClient = /** @class */ (function (_super) {
|
|
|
100
106
|
*/
|
|
101
107
|
AccountClient.prototype.getMarginAccount = function (params) {
|
|
102
108
|
return __awaiter(this, void 0, void 0, function () {
|
|
103
|
-
var uri;
|
|
109
|
+
var uri, response, strippedResponse;
|
|
104
110
|
return __generator(this, function (_a) {
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
switch (_a.label) {
|
|
112
|
+
case 0:
|
|
113
|
+
uri = "/api/accounts/".concat(params.address, "/marginAccount/").concat(params.marginAccountId);
|
|
114
|
+
return [4 /*yield*/, this.get(uri)];
|
|
115
|
+
case 1:
|
|
116
|
+
response = _a.sent();
|
|
117
|
+
strippedResponse = {
|
|
118
|
+
id: response.id,
|
|
119
|
+
name: response.name,
|
|
120
|
+
};
|
|
121
|
+
return [2 /*return*/, strippedResponse];
|
|
122
|
+
}
|
|
107
123
|
});
|
|
108
124
|
});
|
|
109
125
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,0CAA4E;AAE5E;IAA2C,iCAAU;IAArD;;IA2JA,CAAC;IA1JC;;;;;;;;;;;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;gCACnB,gBAAgB,EAAE,KAAK;6BACxB,CAAC,EAAA;;wBAHI,QAAQ,GAA4B,SAGxC;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,6DAAqC,GAA3C,UACE,MAAmD;;;;gBAE7C,GAAG,GAAG,wBAAiB,MAAM,CAAC,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,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;oBAC9D,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;gBACjD,CAAC;gBAEK,GAAG,GAAG,wBAAiB,MAAM,CAAC,SAAS,4BAAkB,MAAM,CAAC,QAAQ,sBAAmB,CAAC;gBAClG,sBAAO,IAAI,CAAC,IAAI,CACd,GAAG,EACH,EAAE,EACF;wBACE,QAAQ,EAAE,MAAM,CAAC,QAAQ;qBAC1B,CACF,EAAC;;;KACH;IACH,oBAAC;AAAD,CAAC,AA3JD,CAA2C,mBAAU,GA2JpD","sourcesContent":["import {\n GetMarginAccountParams,\n GetMarginAccountResult,\n GetMarginAccountsParams,\n GetMarginAccountsResult,\n GetMarginAccountTransactionHistoryParams,\n GetMarginAccountTransactionHistoryResult,\n GetMaxWithdrawBalanceForAccountParams,\n GetMaxWithdrawBalanceForAccountResult,\n EditMarginAccountParams,\n CloseMarginAccountParams,\n GetEditCollateralSimulationInitialDataParams,\n EditMarginAccountResult,\n CloseMarginAccountResult,\n GetMarginAccountOrderHistoryPaginatedParams,\n GetMarginAccountOrderHistoryPaginatedResult,\n GetLiquidationHistoryForOwnerAddressResult,\n GetLiquidationHistoryForOwnerAddressParams,\n GetAccountFeeRebatesHistoryParams,\n GetAccountFeeRebatesHistoryResult,\n GetAutoExchangeHistoryForOwnerAddressResult,\n GetAutoExchangeHistoryForOwnerAddressParams,\n UpdateLeverageForAccountAndMarketParams,\n UpdateLeverageForAccountAndMarketResult,\n} from './types';\nimport { EditCollateralSimulationState, RestClient } 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 includePositions: false,\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 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 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 // 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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CAAC;oBAC9D,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;gBACjD,CAAC;gBAEK,GAAG,GAAG,wBAAiB,MAAM,CAAC,SAAS,4BAAkB,MAAM,CAAC,QAAQ,sBAAmB,CAAC;gBAClG,sBAAO,IAAI,CAAC,IAAI,CACd,GAAG,EACH,EAAE,EACF;wBACE,QAAQ,EAAE,MAAM,CAAC,QAAQ;qBAC1B,CACF,EAAC;;;KACH;IACH,oBAAC;AAAD,CAAC,AA3KD,CAA2C,mBAAU,GA2KpD","sourcesContent":["import {\n GetMarginAccountParams,\n GetMarginAccountResult,\n GetMarginAccountsParams,\n GetMarginAccountsResult,\n GetMarginAccountTransactionHistoryParams,\n GetMarginAccountTransactionHistoryResult,\n GetMaxWithdrawBalanceForAccountParams,\n GetMaxWithdrawBalanceForAccountResult,\n EditMarginAccountParams,\n CloseMarginAccountParams,\n GetEditCollateralSimulationInitialDataParams,\n EditMarginAccountResult,\n CloseMarginAccountResult,\n GetMarginAccountOrderHistoryPaginatedParams,\n GetMarginAccountOrderHistoryPaginatedResult,\n GetLiquidationHistoryForOwnerAddressResult,\n GetLiquidationHistoryForOwnerAddressParams,\n GetAccountFeeRebatesHistoryParams,\n GetAccountFeeRebatesHistoryResult,\n GetAutoExchangeHistoryForOwnerAddressResult,\n GetAutoExchangeHistoryForOwnerAddressParams,\n UpdateLeverageForAccountAndMarketParams,\n UpdateLeverageForAccountAndMarketResult,\n} from './types';\nimport {\n EditCollateralSimulationState,\n RestClient,\n StrippedMarginAccountEntity,\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 includePositions: false,\n });\n\n const strippedResponse = response.map(\n (account): StrippedMarginAccountEntity => {\n return {\n id: account.id,\n name: account.name,\n };\n },\n );\n\n return strippedResponse;\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 const response: GetMarginAccountResult = await this.get(uri);\n\n const strippedResponse = {\n id: response.id,\n name: response.name,\n };\n\n return strippedResponse;\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 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 // 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
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/account/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n MarginAccountTransactionHistoryEntity,\n MarketEntity,\n PositionEntity,\n OrderHistoryEntity,\n MarginRatioHealth,\n StrippedMarginAccountEntity,\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: number;\n};\n\nexport type GetPositionsForMarginAccountParams = {\n address: string;\n marginAccountId: number;\n limit?: number;\n};\n\nexport type GetMarginAccountsResult = StrippedMarginAccountEntity[];\n\nexport type GetMarginAccountResult = StrippedMarginAccountEntity;\n\n// ---- Transaction History\nexport type GetMarginAccountTransactionHistoryParams = {\n marginAccountId: number;\n limit?: number;\n};\n\nexport type GetMarginAccountTransactionHistoryResult =\n MarginAccountTransactionHistoryEntity[];\n\nexport type GetAccountFeeRebatesHistoryParams = {\n marginAccountId: number;\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: number;\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: number;\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: number;\n limit?: number;\n};\nexport type GetMarginAccountOrderHistoryPaginatedParams = {\n address: string;\n marginAccountId: number;\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: number;\n name: string;\n marginRatioPercentage: number;\n marginRatioHealth: 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: number;\n};\n\n// ---- Edit Collateral Simulation ----\n\nexport type GetEditCollateralSimulationInitialDataParams = {\n marginAccountId: number;\n};\n\nexport type GetMarginAccountBalanceChartDataParams = {\n marginAccountId: number;\n filters: {\n timeframeMs: number;\n granularity: MarginAccountBalanceGranularity;\n };\n};\n\nexport type GetMarginAccountCollateralsBalanceChartDataParams = {\n marginAccountId: number;\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: number;\n name: string;\n};\n\nexport type EditMarginAccountResult = { success: boolean };\n\nexport type CloseMarginAccountParams = {\n id: number;\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: number;\n direction: 'long' | 'short';\n};\n\nexport type GetIsolatedOrderMaxSizeAvailableResult = {\n maxAmountBase: number;\n maxAmountSize: number;\n};\n\nexport type UpdateLeverageForAccountAndMarketParams = {\n accountId: number;\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/modules/auth/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport {
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/auth/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport { RegistrationResponseJSON } from '@simplewebauthn/types';\n\nexport type RegisterParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: number;\n attestationResponse: RegistrationResponseJSON;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/conditional-orders/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n ConditionalOrder,\n UnifiedConditionalOrderType,\n ConditionalOrderType,\n} from '@reyaxyz/common';\nimport { Signer, JsonRpcSigner } from 'ethers';\nimport {
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/conditional-orders/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n ConditionalOrder,\n UnifiedConditionalOrderType,\n ConditionalOrderType,\n} from '@reyaxyz/common';\nimport { Signer, JsonRpcSigner } from 'ethers';\nimport { MarketEntity, Address } from '@reyaxyz/common';\n\nexport type CancelConditionalOrderParams = {\n signer: Signer | JsonRpcSigner;\n orderId: string;\n};\n\nexport type CancelConditionalOrderResult = ConditionalOrder;\n\nexport type ConditionalOrderDetails = {\n accountId: number;\n marketId: number;\n exchangeId: number;\n counterpartyAccountIds: number[];\n orderType: number;\n inputs: string;\n signer: string;\n nonce: bigint;\n};\n\nexport type OrderSupportingParams = {\n exchangeId: MarketEntity['orderInfo']['exchangeId'];\n counterpartyAccountIds: MarketEntity['orderInfo']['counterpartyAccountIds'];\n};\n\nexport type RegisterConditionalOrderParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: number;\n triggerPrice: number;\n orderType: ConditionalOrderType;\n marketId: number;\n supportingParams: OrderSupportingParams;\n amountInBase?: number;\n};\n\nexport type UpdateConditionalOrderParams = {\n cancelOrderId: string;\n} & RegisterConditionalOrderParams;\n\nexport type RegisterConditionalOrderResult = ConditionalOrder;\nexport type UpdateConditionalOrderResult = ConditionalOrder;\n\nexport type AlreadyGaveTradePermissionParams = {\n accountId: number;\n};\n\nexport type AlreadyGaveTradePermissionResult = {\n permissionGiven: boolean;\n};\n\nexport type AlreadyGaveTradePermissionToWalletParams = {\n accountId: number;\n targetWalletAddress: Address;\n};\n\nexport type AlreadyGaveTradePermissionToWalletResult = {\n permissionGiven: boolean;\n};\n\n// ---- Conditional Orders History ---\nexport type GetConditionalOrdersHistoryForMarginAccountParams = {\n address: string;\n marginAccountId: number;\n limit?: number;\n};\n\nexport type GetConditionalOrdersHistoryForWalletAddressParams = {\n walletAddress: string;\n limit?: number;\n};\n\nexport type GetConditionalOrdersHistoryForMarginAccountResult =\n UnifiedConditionalOrderType[];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/deposit-existing-MA.simulation/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/deposit-existing-MA.simulation/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n MarginRatioHealth,\n MoneyInOutChainId,\n SocketDepositFees,\n TokenEntity,\n} from '@reyaxyz/common';\nimport { EditCollateralSimulationLoadDataParams } from '../edit-collateral.simulation/types';\n\nexport type DepositExistingMASimulationLoadDataParams =\n EditCollateralSimulationLoadDataParams;\n\nexport type DepositExistingMASimulationSimulateParams = {\n moneyInOutChainId: MoneyInOutChainId;\n amount: number;\n tokenAddress: TokenEntity['address'];\n};\n\nexport type SimulateDepositExistingMAEntity = {\n socketDepositFees: SocketDepositFees;\n bridgeTimeInMS: number;\n marginRatio: number;\n marginRatioHealth: MarginRatioHealth;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/edit-collateral.simulation/types.ts"],"names":[],"mappings":"","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/edit-collateral.simulation/types.ts"],"names":[],"mappings":"","sourcesContent":["import { MarginRatioHealth, TokenEntity } from '@reyaxyz/common';\n\nexport type EditCollateralSimulationLoadDataParams = {\n marginAccountId: number;\n};\n\nexport type EditCollateralSimulationSimulateParams = {\n signedAmount: number; // + for deposit, - for withdraw\n tokenAddress: TokenEntity['address'];\n};\n\nexport type SimulateEditCollateralEntity = {\n marginRatio: number;\n marginRatioHealth: MarginRatioHealth;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/transfer-MA-Pool.simulation/types.ts"],"names":[],"mappings":"","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/transfer-MA-Pool.simulation/types.ts"],"names":[],"mappings":"","sourcesContent":["import { MarginRatioHealth, TokenEntity } from '@reyaxyz/common';\nimport { EditCollateralSimulationLoadDataParams } from '../edit-collateral.simulation/types';\n\nexport type TransferMAPoolSimulationLoadDataParams =\n EditCollateralSimulationLoadDataParams;\n\nexport type TransferMAPoolSimulationSimulateParams = {\n amount: number;\n tokenAddress: TokenEntity['address'];\n};\n\nexport type SimulateTransferMAPoolEntity = {\n marginRatio: number;\n marginRatioHealth: MarginRatioHealth;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/transfer-margin-between-MAs.simulation/types.ts"],"names":[],"mappings":"","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/transfer-margin-between-MAs.simulation/types.ts"],"names":[],"mappings":"","sourcesContent":["import { MarginRatioHealth, TokenEntity } from '@reyaxyz/common';\n\nexport type TransferMarginBetweenMAsSimulationLoadDataParams = {\n fromMarginAccountId: number;\n toMarginAccountId: number;\n};\n\nexport type TransferMarginBetweenMAsSimulationSimulateParams = {\n amount: number;\n tokenAddress: TokenEntity['address'];\n};\n\nexport type SimulateTransferMarginBetweenMAsEntity = {\n fromMarginRatio: number;\n fromMarginRatioHealth: MarginRatioHealth;\n toMarginRatio: number;\n toMarginRatioHealth: MarginRatioHealth;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/withdraw-MA.simulation/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/withdraw-MA.simulation/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n MarginRatioHealth,\n MoneyInOutChainId,\n TokenEntity,\n} from '@reyaxyz/common';\nimport { EditCollateralSimulationLoadDataParams } from '../edit-collateral.simulation/types';\nimport { SocketWithdrawFees } from '@reyaxyz/common';\n\nexport type WithdrawMASimulationLoadDataParams =\n EditCollateralSimulationLoadDataParams;\n\nexport type WithdrawMASimulationSimulateParams = {\n moneyInOutChainId: MoneyInOutChainId;\n amount: number;\n tokenAddress: TokenEntity['address'];\n};\n\nexport type SimulateWithdrawMAEntity = {\n socketWithdrawFees: SocketWithdrawFees;\n bridgeTimeInMS: number;\n marginRatio: number;\n marginRatioHealth: MarginRatioHealth;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,0CA4ByB;AA1BvB,2GAAA,iBAAiB,OAAA;AAYjB,qGAAA,WAAW,OAAA;AACX,2GAAA,iBAAiB,OAAA;AACjB,8GAAA,oBAAoB,OAAA;AACpB,yHAAA,+BAA+B,OAAA;AAE/B,oIAAA,0CAA0C,OAAA;AAG1C,6HAAA,mCAAmC,OAAA;AAEnC,uHAAA,6BAA6B,OAAA;AAG7B,8GAAA,oBAAoB,OAAA;AAEtB,0DAAwC;AACxC,qEAAmD;AACnD,qDAAmC;AACnC,0DAAwC;AACxC,yDAAuC;AACvC,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","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
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,0CA4ByB;AA1BvB,2GAAA,iBAAiB,OAAA;AAYjB,qGAAA,WAAW,OAAA;AACX,2GAAA,iBAAiB,OAAA;AACjB,8GAAA,oBAAoB,OAAA;AACpB,yHAAA,+BAA+B,OAAA;AAE/B,oIAAA,0CAA0C,OAAA;AAG1C,6HAAA,mCAAmC,OAAA;AAEnC,uHAAA,6BAA6B,OAAA;AAG7B,8GAAA,oBAAoB,OAAA;AAEtB,0DAAwC;AACxC,qEAAmD;AACnD,qDAAmC;AACnC,0DAAwC;AACxC,yDAAuC;AACvC,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","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 StrippedMarginAccountEntity,\n LpPositionEntity,\n LpPoolEntity,\n ReyaChainId,\n MoneyInOutChainId,\n LpBalanceGranularity,\n MarginAccountBalanceGranularity,\n GetMarginAccountBalanceChartDataResult,\n MarginAccountCollateralsBalanceGranularity,\n GetMarginAccountCollateralsBalanceChartDataResult,\n GetAllMarginAccountsBalanceChartDataResult,\n AllMarginAccountsBalanceGranularity,\n GetFundingRateChartDataResult,\n FundingRateHistoryGranularity,\n MoneyInOutConfigurationPerTokenName,\n UnifiedConditionalOrderType,\n ConditionalOrderType,\n} from '@reyaxyz/common';\nexport * from './modules/account/types';\nexport * from './modules/conditional-orders/types';\nexport * from './modules/lp/types';\nexport * from './modules/markets/types';\nexport * from './modules/tokens/types';\nexport * from './modules/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';\n"]}
|
|
@@ -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,qCAAqC,EACrC,qCAAqC,EACrC,uBAAuB,EACvB,wBAAwB,EACxB,4CAA4C,EAC5C,uBAAuB,EACvB,wBAAwB,EACxB,2CAA2C,EAC3C,2CAA2C,EAC3C,0CAA0C,EAC1C,0CAA0C,EAC1C,iCAAiC,EACjC,iCAAiC,EACjC,2CAA2C,EAC3C,2CAA2C,EAC3C,uCAAuC,EACvC,uCAAuC,EACxC,MAAM,SAAS,CAAC;AACjB,OAAO,
|
|
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,qCAAqC,EACrC,qCAAqC,EACrC,uBAAuB,EACvB,wBAAwB,EACxB,4CAA4C,EAC5C,uBAAuB,EACvB,wBAAwB,EACxB,2CAA2C,EAC3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}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MarginAccountTransactionHistoryEntity, MarketEntity, PositionEntity, OrderHistoryEntity, MarginRatioHealth, StrippedMarginAccountEntity } 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 = {
|
|
@@ -7,22 +7,22 @@ export type GetMarginAccountsParams = {
|
|
|
7
7
|
};
|
|
8
8
|
export type GetMarginAccountParams = {
|
|
9
9
|
address: string;
|
|
10
|
-
marginAccountId:
|
|
10
|
+
marginAccountId: number;
|
|
11
11
|
};
|
|
12
12
|
export type GetPositionsForMarginAccountParams = {
|
|
13
13
|
address: string;
|
|
14
|
-
marginAccountId:
|
|
14
|
+
marginAccountId: number;
|
|
15
15
|
limit?: number;
|
|
16
16
|
};
|
|
17
|
-
export type GetMarginAccountsResult =
|
|
18
|
-
export type GetMarginAccountResult =
|
|
17
|
+
export type GetMarginAccountsResult = StrippedMarginAccountEntity[];
|
|
18
|
+
export type GetMarginAccountResult = StrippedMarginAccountEntity;
|
|
19
19
|
export type GetMarginAccountTransactionHistoryParams = {
|
|
20
|
-
marginAccountId:
|
|
20
|
+
marginAccountId: number;
|
|
21
21
|
limit?: number;
|
|
22
22
|
};
|
|
23
23
|
export type GetMarginAccountTransactionHistoryResult = MarginAccountTransactionHistoryEntity[];
|
|
24
24
|
export type GetAccountFeeRebatesHistoryParams = {
|
|
25
|
-
marginAccountId:
|
|
25
|
+
marginAccountId: number;
|
|
26
26
|
limit?: number;
|
|
27
27
|
};
|
|
28
28
|
export type GetAccountFeeRebatesHistoryResult = {
|
|
@@ -30,7 +30,7 @@ export type GetAccountFeeRebatesHistoryResult = {
|
|
|
30
30
|
};
|
|
31
31
|
export type GetMaxOrderSizeAvailableParams = {
|
|
32
32
|
marketId: MarketEntity['id'];
|
|
33
|
-
marginAccountId:
|
|
33
|
+
marginAccountId: number;
|
|
34
34
|
direction: 'long' | 'short';
|
|
35
35
|
};
|
|
36
36
|
export type GetMaxOrderSizeAvailableResult = {
|
|
@@ -38,7 +38,7 @@ export type GetMaxOrderSizeAvailableResult = {
|
|
|
38
38
|
maxAmountSize: number;
|
|
39
39
|
};
|
|
40
40
|
export type GetMaxWithdrawBalanceForAccountParams = {
|
|
41
|
-
marginAccountId:
|
|
41
|
+
marginAccountId: number;
|
|
42
42
|
tokenAddress: string;
|
|
43
43
|
};
|
|
44
44
|
export type GetMaxWithdrawBalanceForAccountResult = number;
|
|
@@ -48,12 +48,12 @@ export type GetPositionsForMarginAccountResult = {
|
|
|
48
48
|
};
|
|
49
49
|
export type GetMarginAccountOrderHistoryParams = {
|
|
50
50
|
address: string;
|
|
51
|
-
marginAccountId:
|
|
51
|
+
marginAccountId: number;
|
|
52
52
|
limit?: number;
|
|
53
53
|
};
|
|
54
54
|
export type GetMarginAccountOrderHistoryPaginatedParams = {
|
|
55
55
|
address: string;
|
|
56
|
-
marginAccountId:
|
|
56
|
+
marginAccountId: number;
|
|
57
57
|
page: number;
|
|
58
58
|
perPage: number;
|
|
59
59
|
type?: 'order' | 'liquidation';
|
|
@@ -80,10 +80,10 @@ export type LiquidationHistoryEntity = {
|
|
|
80
80
|
timestamp: number;
|
|
81
81
|
baseUnderlyingToken: string;
|
|
82
82
|
marginAccount: {
|
|
83
|
-
id:
|
|
84
|
-
name:
|
|
85
|
-
marginRatioPercentage:
|
|
86
|
-
marginRatioHealth:
|
|
83
|
+
id: number;
|
|
84
|
+
name: string;
|
|
85
|
+
marginRatioPercentage: number;
|
|
86
|
+
marginRatioHealth: MarginRatioHealth;
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
89
|
export type GetAutoExchangeHistoryForOwnerAddressParams = GetLiquidationHistoryForOwnerAddressParams;
|
|
@@ -92,20 +92,20 @@ export type GetAutoExchangeHistoryForOwnerAddressResult = {
|
|
|
92
92
|
};
|
|
93
93
|
export type GetTransactionSimulationInitialDataParams = {
|
|
94
94
|
marketId: MarketEntity['id'];
|
|
95
|
-
marginAccountId:
|
|
95
|
+
marginAccountId: number;
|
|
96
96
|
};
|
|
97
97
|
export type GetEditCollateralSimulationInitialDataParams = {
|
|
98
|
-
marginAccountId:
|
|
98
|
+
marginAccountId: number;
|
|
99
99
|
};
|
|
100
100
|
export type GetMarginAccountBalanceChartDataParams = {
|
|
101
|
-
marginAccountId:
|
|
101
|
+
marginAccountId: number;
|
|
102
102
|
filters: {
|
|
103
103
|
timeframeMs: number;
|
|
104
104
|
granularity: MarginAccountBalanceGranularity;
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
107
|
export type GetMarginAccountCollateralsBalanceChartDataParams = {
|
|
108
|
-
marginAccountId:
|
|
108
|
+
marginAccountId: number;
|
|
109
109
|
filters: {
|
|
110
110
|
timeframeMs: number;
|
|
111
111
|
granularity: MarginAccountCollateralsBalanceGranularity;
|
|
@@ -119,14 +119,14 @@ export type GetAllMarginAccountsBalanceChartDataParams = {
|
|
|
119
119
|
};
|
|
120
120
|
};
|
|
121
121
|
export type EditMarginAccountParams = {
|
|
122
|
-
id:
|
|
123
|
-
name:
|
|
122
|
+
id: number;
|
|
123
|
+
name: string;
|
|
124
124
|
};
|
|
125
125
|
export type EditMarginAccountResult = {
|
|
126
126
|
success: boolean;
|
|
127
127
|
};
|
|
128
128
|
export type CloseMarginAccountParams = {
|
|
129
|
-
id:
|
|
129
|
+
id: number;
|
|
130
130
|
};
|
|
131
131
|
export type CloseMarginAccountResult = {
|
|
132
132
|
success: boolean;
|
|
@@ -142,7 +142,7 @@ export type GetAllMarginAccountsSummaryResult = {
|
|
|
142
142
|
};
|
|
143
143
|
export type GetIsolatedOrderMaxSizeAvailableParams = {
|
|
144
144
|
marketId: MarketEntity['id'];
|
|
145
|
-
marginAccountId:
|
|
145
|
+
marginAccountId: number;
|
|
146
146
|
direction: 'long' | 'short';
|
|
147
147
|
};
|
|
148
148
|
export type GetIsolatedOrderMaxSizeAvailableResult = {
|
|
@@ -150,7 +150,7 @@ export type GetIsolatedOrderMaxSizeAvailableResult = {
|
|
|
150
150
|
maxAmountSize: number;
|
|
151
151
|
};
|
|
152
152
|
export type UpdateLeverageForAccountAndMarketParams = {
|
|
153
|
-
accountId:
|
|
153
|
+
accountId: number;
|
|
154
154
|
marketId: MarketEntity['id'];
|
|
155
155
|
leverage: number;
|
|
156
156
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/account/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/account/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,+BAA+B,EAC/B,0CAA0C,EAC1C,mCAAmC,EACnC,mCAAmC,EACnC,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,2BAA2B,EAAE,CAAC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,MAAM,MAAM,sCAAsC,GAAG;IACnD,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,uCAAuC,GAAG;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,uCAAuC,GAAG;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { JsonRpcSigner, Signer } from 'ethers';
|
|
2
|
-
import { MarginAccountEntity } from '@reyaxyz/common';
|
|
3
2
|
import { RegistrationResponseJSON } from '@simplewebauthn/types';
|
|
4
3
|
export type RegisterParams = {
|
|
5
4
|
signer: Signer | JsonRpcSigner;
|
|
6
|
-
marginAccountId:
|
|
5
|
+
marginAccountId: number;
|
|
7
6
|
attestationResponse: RegistrationResponseJSON;
|
|
8
7
|
};
|
|
9
8
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,wBAAwB,CAAC;CAC/C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConditionalOrder, UnifiedConditionalOrderType, ConditionalOrderType } from '@reyaxyz/common';
|
|
2
2
|
import { Signer, JsonRpcSigner } from 'ethers';
|
|
3
|
-
import {
|
|
3
|
+
import { MarketEntity, Address } from '@reyaxyz/common';
|
|
4
4
|
export type CancelConditionalOrderParams = {
|
|
5
5
|
signer: Signer | JsonRpcSigner;
|
|
6
6
|
orderId: string;
|
|
@@ -22,7 +22,7 @@ export type OrderSupportingParams = {
|
|
|
22
22
|
};
|
|
23
23
|
export type RegisterConditionalOrderParams = {
|
|
24
24
|
signer: Signer | JsonRpcSigner;
|
|
25
|
-
marginAccountId:
|
|
25
|
+
marginAccountId: number;
|
|
26
26
|
triggerPrice: number;
|
|
27
27
|
orderType: ConditionalOrderType;
|
|
28
28
|
marketId: number;
|
|
@@ -49,7 +49,7 @@ export type AlreadyGaveTradePermissionToWalletResult = {
|
|
|
49
49
|
};
|
|
50
50
|
export type GetConditionalOrdersHistoryForMarginAccountParams = {
|
|
51
51
|
address: string;
|
|
52
|
-
marginAccountId:
|
|
52
|
+
marginAccountId: number;
|
|
53
53
|
limit?: number;
|
|
54
54
|
};
|
|
55
55
|
export type GetConditionalOrdersHistoryForWalletAddressParams = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/conditional-orders/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/conditional-orders/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,oBAAoB,EACrB,MAAM,iBAA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AAgB,CAAC;AAE5D,MAAM,MAAM,gCAAgC,GAAG;IAC7C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,wCAAwC,GAAG;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,wCAAwC,GAAG;IACrD,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAGF,MAAM,MAAM,iDAAiD,GAAG;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iDAAiD,GAAG;IAC9D,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iDAAiD,GAC3D,2BAA2B,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MarginRatioHealth, MoneyInOutChainId, SocketDepositFees, TokenEntity } from '@reyaxyz/common';
|
|
2
2
|
import { EditCollateralSimulationLoadDataParams } from '../edit-collateral.simulation/types';
|
|
3
3
|
export type DepositExistingMASimulationLoadDataParams = EditCollateralSimulationLoadDataParams;
|
|
4
4
|
export type DepositExistingMASimulationSimulateParams = {
|
|
@@ -9,7 +9,7 @@ export type DepositExistingMASimulationSimulateParams = {
|
|
|
9
9
|
export type SimulateDepositExistingMAEntity = {
|
|
10
10
|
socketDepositFees: SocketDepositFees;
|
|
11
11
|
bridgeTimeInMS: number;
|
|
12
|
-
marginRatio:
|
|
13
|
-
marginRatioHealth:
|
|
12
|
+
marginRatio: number;
|
|
13
|
+
marginRatioHealth: MarginRatioHealth;
|
|
14
14
|
};
|
|
15
15
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/deposit-existing-MA.simulation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/deposit-existing-MA.simulation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,sCAAsC,EAAE,MAAM,qCAAqC,CAAC;AAE7F,MAAM,MAAM,yCAAyC,GACnD,sCAAsC,CAAC;AAEzC,MAAM,MAAM,yCAAyC,GAAG;IACtD,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MarginRatioHealth, TokenEntity } from '@reyaxyz/common';
|
|
2
2
|
export type EditCollateralSimulationLoadDataParams = {
|
|
3
|
-
marginAccountId:
|
|
3
|
+
marginAccountId: number;
|
|
4
4
|
};
|
|
5
5
|
export type EditCollateralSimulationSimulateParams = {
|
|
6
6
|
signedAmount: number;
|
|
7
7
|
tokenAddress: TokenEntity['address'];
|
|
8
8
|
};
|
|
9
9
|
export type SimulateEditCollateralEntity = {
|
|
10
|
-
marginRatio:
|
|
11
|
-
marginRatioHealth:
|
|
10
|
+
marginRatio: number;
|
|
11
|
+
marginRatioHealth: MarginRatioHealth;
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/edit-collateral.simulation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/edit-collateral.simulation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEjE,MAAM,MAAM,sCAAsC,GAAG;IACnD,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MarginRatioHealth, TokenEntity } from '@reyaxyz/common';
|
|
2
2
|
import { EditCollateralSimulationLoadDataParams } from '../edit-collateral.simulation/types';
|
|
3
3
|
export type TransferMAPoolSimulationLoadDataParams = EditCollateralSimulationLoadDataParams;
|
|
4
4
|
export type TransferMAPoolSimulationSimulateParams = {
|
|
@@ -6,7 +6,7 @@ export type TransferMAPoolSimulationSimulateParams = {
|
|
|
6
6
|
tokenAddress: TokenEntity['address'];
|
|
7
7
|
};
|
|
8
8
|
export type SimulateTransferMAPoolEntity = {
|
|
9
|
-
marginRatio:
|
|
10
|
-
marginRatioHealth:
|
|
9
|
+
marginRatio: number;
|
|
10
|
+
marginRatioHealth: MarginRatioHealth;
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/transfer-MA-Pool.simulation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/transfer-MA-Pool.simulation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,sCAAsC,EAAE,MAAM,qCAAqC,CAAC;AAE7F,MAAM,MAAM,sCAAsC,GAChD,sCAAsC,CAAC;AAEzC,MAAM,MAAM,sCAAsC,GAAG;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MarginRatioHealth, TokenEntity } from '@reyaxyz/common';
|
|
2
2
|
export type TransferMarginBetweenMAsSimulationLoadDataParams = {
|
|
3
|
-
fromMarginAccountId:
|
|
4
|
-
toMarginAccountId:
|
|
3
|
+
fromMarginAccountId: number;
|
|
4
|
+
toMarginAccountId: number;
|
|
5
5
|
};
|
|
6
6
|
export type TransferMarginBetweenMAsSimulationSimulateParams = {
|
|
7
7
|
amount: number;
|
|
8
8
|
tokenAddress: TokenEntity['address'];
|
|
9
9
|
};
|
|
10
10
|
export type SimulateTransferMarginBetweenMAsEntity = {
|
|
11
|
-
fromMarginRatio:
|
|
12
|
-
fromMarginRatioHealth:
|
|
13
|
-
toMarginRatio:
|
|
14
|
-
toMarginRatioHealth:
|
|
11
|
+
fromMarginRatio: number;
|
|
12
|
+
fromMarginRatioHealth: MarginRatioHealth;
|
|
13
|
+
toMarginRatio: number;
|
|
14
|
+
toMarginRatioHealth: MarginRatioHealth;
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/transfer-margin-between-MAs.simulation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/transfer-margin-between-MAs.simulation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEjE,MAAM,MAAM,gDAAgD,GAAG;IAC7D,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,gDAAgD,GAAG;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG;IACnD,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,iBAAiB,CAAC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,iBAAiB,CAAC;CACxC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MarginRatioHealth, MoneyInOutChainId, TokenEntity } from '@reyaxyz/common';
|
|
2
2
|
import { EditCollateralSimulationLoadDataParams } from '../edit-collateral.simulation/types';
|
|
3
3
|
import { SocketWithdrawFees } from '@reyaxyz/common';
|
|
4
4
|
export type WithdrawMASimulationLoadDataParams = EditCollateralSimulationLoadDataParams;
|
|
@@ -10,7 +10,7 @@ export type WithdrawMASimulationSimulateParams = {
|
|
|
10
10
|
export type SimulateWithdrawMAEntity = {
|
|
11
11
|
socketWithdrawFees: SocketWithdrawFees;
|
|
12
12
|
bridgeTimeInMS: number;
|
|
13
|
-
marginRatio:
|
|
14
|
-
marginRatioHealth:
|
|
13
|
+
marginRatio: number;
|
|
14
|
+
marginRatioHealth: MarginRatioHealth;
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/withdraw-MA.simulation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/withdraw-MA.simulation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,sCAAsC,EAAE,MAAM,qCAAqC,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,kCAAkC,GAC5C,sCAAsC,CAAC;AAEzC,MAAM,MAAM,kCAAkC,GAAG;IAC/C,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Candle, CandlesResolution, MarketEntity, LpTransactionHistoryEntity, TradingHistoryEntity, OrderHistoryEntity, PositionEntity, TransactionHistoryType, MarginAccountTransactionHistoryType, MarginAccountTransactionHistoryEntity,
|
|
1
|
+
export { Candle, CandlesResolution, MarketEntity, LpTransactionHistoryEntity, TradingHistoryEntity, OrderHistoryEntity, PositionEntity, TransactionHistoryType, MarginAccountTransactionHistoryType, MarginAccountTransactionHistoryEntity, StrippedMarginAccountEntity, LpPositionEntity, LpPoolEntity, ReyaChainId, MoneyInOutChainId, 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,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,mCAAmC,EACnC,qCAAqC,EACrC,
|
|
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,2BAA2B,EAC3B,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,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,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/api-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.160.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"generate:coverage-badges": "npx istanbul-badges-readme --silent"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@reyaxyz/common": "0.
|
|
36
|
+
"@reyaxyz/common": "0.313.0",
|
|
37
37
|
"@simplewebauthn/types": "10.0.0",
|
|
38
38
|
"bignumber.js": "9.1.2",
|
|
39
39
|
"ethers": "6.9.0",
|
|
40
40
|
"isomorphic-ws": "5.0.0"
|
|
41
41
|
},
|
|
42
42
|
"packageManager": "pnpm@8.3.1",
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "249943954846e5be8503d04742c9597d25707dd1",
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@reyaxyz/database": "0.149.
|
|
45
|
+
"@reyaxyz/database": "0.149.8"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -23,7 +23,11 @@ import {
|
|
|
23
23
|
UpdateLeverageForAccountAndMarketParams,
|
|
24
24
|
UpdateLeverageForAccountAndMarketResult,
|
|
25
25
|
} from './types';
|
|
26
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
EditCollateralSimulationState,
|
|
28
|
+
RestClient,
|
|
29
|
+
StrippedMarginAccountEntity,
|
|
30
|
+
} from '@reyaxyz/common';
|
|
27
31
|
|
|
28
32
|
export default class AccountClient extends RestClient {
|
|
29
33
|
/**
|
|
@@ -48,7 +52,16 @@ export default class AccountClient extends RestClient {
|
|
|
48
52
|
includePositions: false,
|
|
49
53
|
});
|
|
50
54
|
|
|
51
|
-
|
|
55
|
+
const strippedResponse = response.map(
|
|
56
|
+
(account): StrippedMarginAccountEntity => {
|
|
57
|
+
return {
|
|
58
|
+
id: account.id,
|
|
59
|
+
name: account.name,
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return strippedResponse;
|
|
52
65
|
}
|
|
53
66
|
|
|
54
67
|
/**
|
|
@@ -67,7 +80,14 @@ export default class AccountClient extends RestClient {
|
|
|
67
80
|
params: GetMarginAccountParams,
|
|
68
81
|
): Promise<GetMarginAccountResult> {
|
|
69
82
|
const uri = `/api/accounts/${params.address}/marginAccount/${params.marginAccountId}`;
|
|
70
|
-
|
|
83
|
+
const response: GetMarginAccountResult = await this.get(uri);
|
|
84
|
+
|
|
85
|
+
const strippedResponse = {
|
|
86
|
+
id: response.id,
|
|
87
|
+
name: response.name,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return strippedResponse;
|
|
71
91
|
}
|
|
72
92
|
|
|
73
93
|
async getMarginAccountOrderHistoryPaginated(
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
MarginAccountEntity,
|
|
3
2
|
MarginAccountTransactionHistoryEntity,
|
|
4
3
|
MarketEntity,
|
|
5
4
|
PositionEntity,
|
|
6
5
|
OrderHistoryEntity,
|
|
6
|
+
MarginRatioHealth,
|
|
7
|
+
StrippedMarginAccountEntity,
|
|
7
8
|
} from '@reyaxyz/common';
|
|
8
9
|
import {
|
|
9
10
|
MarginAccountBalanceGranularity,
|
|
@@ -21,22 +22,22 @@ export type GetMarginAccountsParams = {
|
|
|
21
22
|
|
|
22
23
|
export type GetMarginAccountParams = {
|
|
23
24
|
address: string;
|
|
24
|
-
marginAccountId:
|
|
25
|
+
marginAccountId: number;
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
export type GetPositionsForMarginAccountParams = {
|
|
28
29
|
address: string;
|
|
29
|
-
marginAccountId:
|
|
30
|
+
marginAccountId: number;
|
|
30
31
|
limit?: number;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
|
-
export type GetMarginAccountsResult =
|
|
34
|
+
export type GetMarginAccountsResult = StrippedMarginAccountEntity[];
|
|
34
35
|
|
|
35
|
-
export type GetMarginAccountResult =
|
|
36
|
+
export type GetMarginAccountResult = StrippedMarginAccountEntity;
|
|
36
37
|
|
|
37
38
|
// ---- Transaction History
|
|
38
39
|
export type GetMarginAccountTransactionHistoryParams = {
|
|
39
|
-
marginAccountId:
|
|
40
|
+
marginAccountId: number;
|
|
40
41
|
limit?: number;
|
|
41
42
|
};
|
|
42
43
|
|
|
@@ -44,7 +45,7 @@ export type GetMarginAccountTransactionHistoryResult =
|
|
|
44
45
|
MarginAccountTransactionHistoryEntity[];
|
|
45
46
|
|
|
46
47
|
export type GetAccountFeeRebatesHistoryParams = {
|
|
47
|
-
marginAccountId:
|
|
48
|
+
marginAccountId: number;
|
|
48
49
|
limit?: number;
|
|
49
50
|
};
|
|
50
51
|
|
|
@@ -55,7 +56,7 @@ export type GetAccountFeeRebatesHistoryResult = {
|
|
|
55
56
|
|
|
56
57
|
export type GetMaxOrderSizeAvailableParams = {
|
|
57
58
|
marketId: MarketEntity['id'];
|
|
58
|
-
marginAccountId:
|
|
59
|
+
marginAccountId: number;
|
|
59
60
|
direction: 'long' | 'short';
|
|
60
61
|
};
|
|
61
62
|
|
|
@@ -66,7 +67,7 @@ export type GetMaxOrderSizeAvailableResult = {
|
|
|
66
67
|
|
|
67
68
|
// --- Max Withdraw Balance for Margin Account ---
|
|
68
69
|
export type GetMaxWithdrawBalanceForAccountParams = {
|
|
69
|
-
marginAccountId:
|
|
70
|
+
marginAccountId: number;
|
|
70
71
|
tokenAddress: string;
|
|
71
72
|
};
|
|
72
73
|
|
|
@@ -81,12 +82,12 @@ export type GetPositionsForMarginAccountResult = {
|
|
|
81
82
|
|
|
82
83
|
export type GetMarginAccountOrderHistoryParams = {
|
|
83
84
|
address: string;
|
|
84
|
-
marginAccountId:
|
|
85
|
+
marginAccountId: number;
|
|
85
86
|
limit?: number;
|
|
86
87
|
};
|
|
87
88
|
export type GetMarginAccountOrderHistoryPaginatedParams = {
|
|
88
89
|
address: string;
|
|
89
|
-
marginAccountId:
|
|
90
|
+
marginAccountId: number;
|
|
90
91
|
page: number;
|
|
91
92
|
perPage: number;
|
|
92
93
|
type?: 'order' | 'liquidation';
|
|
@@ -116,10 +117,10 @@ export type LiquidationHistoryEntity = {
|
|
|
116
117
|
timestamp: number;
|
|
117
118
|
baseUnderlyingToken: string;
|
|
118
119
|
marginAccount: {
|
|
119
|
-
id:
|
|
120
|
-
name:
|
|
121
|
-
marginRatioPercentage:
|
|
122
|
-
marginRatioHealth:
|
|
120
|
+
id: number;
|
|
121
|
+
name: string;
|
|
122
|
+
marginRatioPercentage: number;
|
|
123
|
+
marginRatioHealth: MarginRatioHealth;
|
|
123
124
|
};
|
|
124
125
|
};
|
|
125
126
|
|
|
@@ -133,17 +134,17 @@ export type GetAutoExchangeHistoryForOwnerAddressResult = {
|
|
|
133
134
|
|
|
134
135
|
export type GetTransactionSimulationInitialDataParams = {
|
|
135
136
|
marketId: MarketEntity['id'];
|
|
136
|
-
marginAccountId:
|
|
137
|
+
marginAccountId: number;
|
|
137
138
|
};
|
|
138
139
|
|
|
139
140
|
// ---- Edit Collateral Simulation ----
|
|
140
141
|
|
|
141
142
|
export type GetEditCollateralSimulationInitialDataParams = {
|
|
142
|
-
marginAccountId:
|
|
143
|
+
marginAccountId: number;
|
|
143
144
|
};
|
|
144
145
|
|
|
145
146
|
export type GetMarginAccountBalanceChartDataParams = {
|
|
146
|
-
marginAccountId:
|
|
147
|
+
marginAccountId: number;
|
|
147
148
|
filters: {
|
|
148
149
|
timeframeMs: number;
|
|
149
150
|
granularity: MarginAccountBalanceGranularity;
|
|
@@ -151,7 +152,7 @@ export type GetMarginAccountBalanceChartDataParams = {
|
|
|
151
152
|
};
|
|
152
153
|
|
|
153
154
|
export type GetMarginAccountCollateralsBalanceChartDataParams = {
|
|
154
|
-
marginAccountId:
|
|
155
|
+
marginAccountId: number;
|
|
155
156
|
filters: {
|
|
156
157
|
timeframeMs: number;
|
|
157
158
|
granularity: MarginAccountCollateralsBalanceGranularity;
|
|
@@ -167,14 +168,14 @@ export type GetAllMarginAccountsBalanceChartDataParams = {
|
|
|
167
168
|
};
|
|
168
169
|
|
|
169
170
|
export type EditMarginAccountParams = {
|
|
170
|
-
id:
|
|
171
|
-
name:
|
|
171
|
+
id: number;
|
|
172
|
+
name: string;
|
|
172
173
|
};
|
|
173
174
|
|
|
174
175
|
export type EditMarginAccountResult = { success: boolean };
|
|
175
176
|
|
|
176
177
|
export type CloseMarginAccountParams = {
|
|
177
|
-
id:
|
|
178
|
+
id: number;
|
|
178
179
|
};
|
|
179
180
|
|
|
180
181
|
export type CloseMarginAccountResult = { success: boolean };
|
|
@@ -192,7 +193,7 @@ export type GetAllMarginAccountsSummaryResult = {
|
|
|
192
193
|
|
|
193
194
|
export type GetIsolatedOrderMaxSizeAvailableParams = {
|
|
194
195
|
marketId: MarketEntity['id'];
|
|
195
|
-
marginAccountId:
|
|
196
|
+
marginAccountId: number;
|
|
196
197
|
direction: 'long' | 'short';
|
|
197
198
|
};
|
|
198
199
|
|
|
@@ -202,7 +203,7 @@ export type GetIsolatedOrderMaxSizeAvailableResult = {
|
|
|
202
203
|
};
|
|
203
204
|
|
|
204
205
|
export type UpdateLeverageForAccountAndMarketParams = {
|
|
205
|
-
accountId:
|
|
206
|
+
accountId: number;
|
|
206
207
|
marketId: MarketEntity['id'];
|
|
207
208
|
leverage: number;
|
|
208
209
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { JsonRpcSigner, Signer } from 'ethers';
|
|
2
|
-
import { MarginAccountEntity } from '@reyaxyz/common';
|
|
3
2
|
import { RegistrationResponseJSON } from '@simplewebauthn/types';
|
|
4
3
|
|
|
5
4
|
export type RegisterParams = {
|
|
6
5
|
signer: Signer | JsonRpcSigner;
|
|
7
|
-
marginAccountId:
|
|
6
|
+
marginAccountId: number;
|
|
8
7
|
attestationResponse: RegistrationResponseJSON;
|
|
9
8
|
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ConditionalOrderType,
|
|
5
5
|
} from '@reyaxyz/common';
|
|
6
6
|
import { Signer, JsonRpcSigner } from 'ethers';
|
|
7
|
-
import {
|
|
7
|
+
import { MarketEntity, Address } from '@reyaxyz/common';
|
|
8
8
|
|
|
9
9
|
export type CancelConditionalOrderParams = {
|
|
10
10
|
signer: Signer | JsonRpcSigner;
|
|
@@ -31,7 +31,7 @@ export type OrderSupportingParams = {
|
|
|
31
31
|
|
|
32
32
|
export type RegisterConditionalOrderParams = {
|
|
33
33
|
signer: Signer | JsonRpcSigner;
|
|
34
|
-
marginAccountId:
|
|
34
|
+
marginAccountId: number;
|
|
35
35
|
triggerPrice: number;
|
|
36
36
|
orderType: ConditionalOrderType;
|
|
37
37
|
marketId: number;
|
|
@@ -66,7 +66,7 @@ export type AlreadyGaveTradePermissionToWalletResult = {
|
|
|
66
66
|
// ---- Conditional Orders History ---
|
|
67
67
|
export type GetConditionalOrdersHistoryForMarginAccountParams = {
|
|
68
68
|
address: string;
|
|
69
|
-
marginAccountId:
|
|
69
|
+
marginAccountId: number;
|
|
70
70
|
limit?: number;
|
|
71
71
|
};
|
|
72
72
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
MarginRatioHealth,
|
|
3
3
|
MoneyInOutChainId,
|
|
4
4
|
SocketDepositFees,
|
|
5
5
|
TokenEntity,
|
|
@@ -18,6 +18,6 @@ export type DepositExistingMASimulationSimulateParams = {
|
|
|
18
18
|
export type SimulateDepositExistingMAEntity = {
|
|
19
19
|
socketDepositFees: SocketDepositFees;
|
|
20
20
|
bridgeTimeInMS: number;
|
|
21
|
-
marginRatio:
|
|
22
|
-
marginRatioHealth:
|
|
21
|
+
marginRatio: number;
|
|
22
|
+
marginRatioHealth: MarginRatioHealth;
|
|
23
23
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MarginRatioHealth, TokenEntity } from '@reyaxyz/common';
|
|
2
2
|
|
|
3
3
|
export type EditCollateralSimulationLoadDataParams = {
|
|
4
|
-
marginAccountId:
|
|
4
|
+
marginAccountId: number;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
export type EditCollateralSimulationSimulateParams = {
|
|
@@ -10,6 +10,6 @@ export type EditCollateralSimulationSimulateParams = {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export type SimulateEditCollateralEntity = {
|
|
13
|
-
marginRatio:
|
|
14
|
-
marginRatioHealth:
|
|
13
|
+
marginRatio: number;
|
|
14
|
+
marginRatioHealth: MarginRatioHealth;
|
|
15
15
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MarginRatioHealth, TokenEntity } from '@reyaxyz/common';
|
|
2
2
|
import { EditCollateralSimulationLoadDataParams } from '../edit-collateral.simulation/types';
|
|
3
3
|
|
|
4
4
|
export type TransferMAPoolSimulationLoadDataParams =
|
|
@@ -10,6 +10,6 @@ export type TransferMAPoolSimulationSimulateParams = {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export type SimulateTransferMAPoolEntity = {
|
|
13
|
-
marginRatio:
|
|
14
|
-
marginRatioHealth:
|
|
13
|
+
marginRatio: number;
|
|
14
|
+
marginRatioHealth: MarginRatioHealth;
|
|
15
15
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MarginRatioHealth, TokenEntity } from '@reyaxyz/common';
|
|
2
2
|
|
|
3
3
|
export type TransferMarginBetweenMAsSimulationLoadDataParams = {
|
|
4
|
-
fromMarginAccountId:
|
|
5
|
-
toMarginAccountId:
|
|
4
|
+
fromMarginAccountId: number;
|
|
5
|
+
toMarginAccountId: number;
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export type TransferMarginBetweenMAsSimulationSimulateParams = {
|
|
@@ -11,8 +11,8 @@ export type TransferMarginBetweenMAsSimulationSimulateParams = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export type SimulateTransferMarginBetweenMAsEntity = {
|
|
14
|
-
fromMarginRatio:
|
|
15
|
-
fromMarginRatioHealth:
|
|
16
|
-
toMarginRatio:
|
|
17
|
-
toMarginRatioHealth:
|
|
14
|
+
fromMarginRatio: number;
|
|
15
|
+
fromMarginRatioHealth: MarginRatioHealth;
|
|
16
|
+
toMarginRatio: number;
|
|
17
|
+
toMarginRatioHealth: MarginRatioHealth;
|
|
18
18
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
MarginRatioHealth,
|
|
3
3
|
MoneyInOutChainId,
|
|
4
4
|
TokenEntity,
|
|
5
5
|
} from '@reyaxyz/common';
|
|
@@ -18,6 +18,6 @@ export type WithdrawMASimulationSimulateParams = {
|
|
|
18
18
|
export type SimulateWithdrawMAEntity = {
|
|
19
19
|
socketWithdrawFees: SocketWithdrawFees;
|
|
20
20
|
bridgeTimeInMS: number;
|
|
21
|
-
marginRatio:
|
|
22
|
-
marginRatioHealth:
|
|
21
|
+
marginRatio: number;
|
|
22
|
+
marginRatioHealth: MarginRatioHealth;
|
|
23
23
|
};
|
package/src/clients/types.ts
CHANGED