@dhedge/backend-flatcoin-core 0.2.32 → 0.2.33
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.
|
@@ -16,6 +16,7 @@ export declare class GraphQueryService {
|
|
|
16
16
|
getDepositsByTimestampFrom(timestampFrom: number): Promise<DepositEvent[]>;
|
|
17
17
|
getDepositsByDepositorAddress(account: string, blockFrom: number): Promise<DepositEvent[]>;
|
|
18
18
|
getWithdraws(blockFrom: number): Promise<WithdrawEvent[]>;
|
|
19
|
+
getWithdrawsByTimestampFrom(timestampFrom: number): Promise<WithdrawEvent[]>;
|
|
19
20
|
getWithdrawsByWithdrawerAddress(account: string, blockFrom: number): Promise<WithdrawEvent[]>;
|
|
20
21
|
getLimitOrderAnnounceds(blockNumberFrom: number): Promise<AnnouncedLimitOrder[]>;
|
|
21
22
|
getLimitOrderExecutedsByTimestampFrom(timestampFrom: number): Promise<LeverageAdjust[]>;
|
|
@@ -34,6 +35,7 @@ export declare const getDepositsQuery: string;
|
|
|
34
35
|
export declare const getDepositsByTimestampFromQuery: string;
|
|
35
36
|
export declare const getDepositsByDepositorAddressQuery: string;
|
|
36
37
|
export declare const getWithdrawsQuery: string;
|
|
38
|
+
export declare const getWithdrawsByTimestampFromQuery: string;
|
|
37
39
|
export declare const getWithdrawsByWithdrawerAddressQuery: string;
|
|
38
40
|
export declare const getLimitOrderAnnouncedsQuery: string;
|
|
39
41
|
export declare const getLimitOrderExecutedsByTimestampFromQuery: string;
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getClosedPositionsQuery = exports.getOpenPositionsQuery = exports.getLimitOrderExecutedsByTimestampFromQuery = exports.getLimitOrderAnnouncedsQuery = exports.getWithdrawsByWithdrawerAddressQuery = exports.getWithdrawsQuery = exports.getDepositsByDepositorAddressQuery = exports.getDepositsByTimestampFromQuery = exports.getDepositsQuery = exports.getPositionLiquidatedsQuery = exports.getLeverageAdjustsByTimestampFromQuery = exports.getLeverageClosesByTimestampFromQuery = exports.getLeverageClosesQuery = exports.getLeverageOpensByTimestampFromQuery = exports.getLeverageOpensQuery = exports.getAnnouncedOrdersQuery = exports.GraphQueryService = void 0;
|
|
12
|
+
exports.getClosedPositionsQuery = exports.getOpenPositionsQuery = exports.getLimitOrderExecutedsByTimestampFromQuery = exports.getLimitOrderAnnouncedsQuery = exports.getWithdrawsByWithdrawerAddressQuery = exports.getWithdrawsByTimestampFromQuery = exports.getWithdrawsQuery = exports.getDepositsByDepositorAddressQuery = exports.getDepositsByTimestampFromQuery = exports.getDepositsQuery = exports.getPositionLiquidatedsQuery = exports.getLeverageAdjustsByTimestampFromQuery = exports.getLeverageClosesByTimestampFromQuery = exports.getLeverageClosesQuery = exports.getLeverageOpensByTimestampFromQuery = exports.getLeverageOpensQuery = exports.getAnnouncedOrdersQuery = exports.GraphQueryService = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const graphql_request_1 = require("graphql-request");
|
|
15
15
|
const constants_1 = require("../constants");
|
|
@@ -155,6 +155,18 @@ let GraphQueryService = class GraphQueryService {
|
|
|
155
155
|
throw error;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
+
async getWithdrawsByTimestampFrom(timestampFrom) {
|
|
159
|
+
const variables = { blockTimestamp: timestampFrom };
|
|
160
|
+
try {
|
|
161
|
+
const response = await this.graphQLClient.request(exports.getWithdrawsByTimestampFromQuery, variables);
|
|
162
|
+
this.logger.log(`Fetched ${response.withdraws.length} withdraws events from the graph from timestamp: ${timestampFrom}`);
|
|
163
|
+
return response.withdraws;
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
this.logger.error('Error fetching withdraws events from the graph by timestamp from:', error);
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
158
170
|
async getWithdrawsByWithdrawerAddress(account, blockFrom) {
|
|
159
171
|
const variables = { account: account, fromBlock: blockFrom };
|
|
160
172
|
try {
|
|
@@ -357,6 +369,19 @@ exports.getWithdrawsQuery = (0, graphql_request_1.gql) `
|
|
|
357
369
|
}
|
|
358
370
|
}
|
|
359
371
|
`;
|
|
372
|
+
exports.getWithdrawsByTimestampFromQuery = (0, graphql_request_1.gql) `
|
|
373
|
+
query GetWithdraws($timestampFrom: Int) {
|
|
374
|
+
withdraws(where: { blockTimestamp_gt: $timestampFrom }, orderBy: blockTimestamp, orderDirection: asc, first: 1000) {
|
|
375
|
+
blockNumber
|
|
376
|
+
withdrawer
|
|
377
|
+
withdrawAmount
|
|
378
|
+
burnedAmount
|
|
379
|
+
blockTimestamp
|
|
380
|
+
transactionHash
|
|
381
|
+
executedBy
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
`;
|
|
360
385
|
exports.getWithdrawsByWithdrawerAddressQuery = (0, graphql_request_1.gql) `
|
|
361
386
|
query GetWithdraws($account: String, $fromBlock: Int) {
|
|
362
387
|
withdraws(
|