@sui-tracker/shared 1.0.61 → 1.0.62
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/modules/grpc-services/swap-order-grpc.service.d.ts +2 -2
- package/dist/modules/grpc-services/swap-order-grpc.service.js +2 -2
- package/dist/modules/grpc-services/swap-order-grpc.service.js.map +1 -1
- package/dist/modules/interfaces/swap-order.interface.d.ts +7 -5
- package/dist/protos/swap-order.proto +12 -10
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ClientGrpc } from "@nestjs/microservices";
|
|
2
|
-
import {
|
|
2
|
+
import { GetNewPoolsRequest, GetNewPoolsResponse, GetPoolRequest, GetPoolResponse, GetCandleChartRequest, GetCandleChartResponse, GetLastSwapOrderResponse, GetLastSwapOrderRequest, GetListPoolsRequest, GetListPoolsResponse } from "../interfaces/swap-order.interface";
|
|
3
3
|
export declare class SwapOrderGrpcService {
|
|
4
4
|
private grpcClient;
|
|
5
5
|
private readonly logger;
|
|
6
6
|
constructor(grpcClient: ClientGrpc);
|
|
7
|
-
|
|
7
|
+
GetListPools(data: GetListPoolsRequest): Promise<GetListPoolsResponse>;
|
|
8
8
|
getNewPools(data: GetNewPoolsRequest): Promise<GetNewPoolsResponse>;
|
|
9
9
|
getPool(data: GetPoolRequest): Promise<GetPoolResponse>;
|
|
10
10
|
getCandleChart(data: GetCandleChartRequest): Promise<GetCandleChartResponse>;
|
|
@@ -20,10 +20,10 @@ let SwapOrderGrpcService = SwapOrderGrpcService_1 = class SwapOrderGrpcService {
|
|
|
20
20
|
this.grpcClient = grpcClient;
|
|
21
21
|
this.logger = new common_1.Logger(SwapOrderGrpcService_1.name);
|
|
22
22
|
}
|
|
23
|
-
async
|
|
23
|
+
async GetListPools(data) {
|
|
24
24
|
const swapOrderService = this.grpcClient.getService("SwapOrderService");
|
|
25
25
|
const res = await new Promise((resolve, reject) => {
|
|
26
|
-
swapOrderService.
|
|
26
|
+
swapOrderService.GetListPools(data).subscribe({
|
|
27
27
|
next: (response) => resolve(response),
|
|
28
28
|
error: (error) => reject(error),
|
|
29
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap-order-grpc.service.js","sourceRoot":"","sources":["../../../src/modules/grpc-services/swap-order-grpc.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA0E;AAkBnE,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAG/B,YAAkC,UAA8B;QAAtB,eAAU,GAAV,UAAU,CAAY;QAF/C,WAAM,GAAG,IAAI,eAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAEI,CAAC;IAGrE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"swap-order-grpc.service.js","sourceRoot":"","sources":["../../../src/modules/grpc-services/swap-order-grpc.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA0E;AAkBnE,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAG/B,YAAkC,UAA8B;QAAtB,eAAU,GAAV,UAAU,CAAY;QAF/C,WAAM,GAAG,IAAI,eAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAEI,CAAC;IAGrE,KAAK,CAAC,YAAY,CAChB,IAAyB;QAEzB,MAAM,gBAAgB,GACpB,IAAI,CAAC,UAAU,CAAC,UAAU,CAAmB,kBAAkB,CAAC,CAAC;QAEnE,MAAM,GAAG,GAAG,MAAM,IAAI,OAAO,CAC3B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAClB,gBAAgB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC;gBAC5C,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC;gBACrC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;aAChC,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,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;aAChC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;CACF,CAAA;AA1GY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAIE,WAAA,IAAA,eAAM,EAAC,YAAY,CAAC,CAAA;;GAHtB,oBAAoB,CA0GhC"}
|
|
@@ -34,7 +34,8 @@ export interface PoolDataDetail {
|
|
|
34
34
|
aIsBase: boolean;
|
|
35
35
|
reserveA?: number;
|
|
36
36
|
reserveB?: number;
|
|
37
|
-
|
|
37
|
+
priceA: number;
|
|
38
|
+
priceB: number;
|
|
38
39
|
poolCreatedTime?: Date;
|
|
39
40
|
dex: string;
|
|
40
41
|
statsData: {
|
|
@@ -63,8 +64,9 @@ export interface CandleData {
|
|
|
63
64
|
c: string;
|
|
64
65
|
v: string;
|
|
65
66
|
}
|
|
66
|
-
export interface
|
|
67
|
-
|
|
67
|
+
export interface GetListPoolsRequest {
|
|
68
|
+
type: 'trending' | 'top-volume' | 'new-pools';
|
|
69
|
+
label: 5 | 60 | 360 | 1440;
|
|
68
70
|
page?: number;
|
|
69
71
|
limit?: number;
|
|
70
72
|
}
|
|
@@ -84,7 +86,7 @@ export interface GetCandleChartRequest {
|
|
|
84
86
|
timestamp?: string;
|
|
85
87
|
type?: 'usd' | 'token';
|
|
86
88
|
}
|
|
87
|
-
export interface
|
|
89
|
+
export interface GetListPoolsResponse extends BaseResponse {
|
|
88
90
|
data: PoolDataDetail[];
|
|
89
91
|
}
|
|
90
92
|
export interface GetNewPoolsResponse extends BaseResponse {
|
|
@@ -155,7 +157,7 @@ export interface GetTokensRequest {
|
|
|
155
157
|
addresses: string[];
|
|
156
158
|
}
|
|
157
159
|
export interface SwapOrderService {
|
|
158
|
-
|
|
160
|
+
GetListPools(request: GetListPoolsRequest): Observable<GetListPoolsResponse>;
|
|
159
161
|
getNewPools(request: GetNewPoolsRequest): Observable<GetNewPoolsResponse>;
|
|
160
162
|
getPool(request: GetPoolRequest): Observable<GetPoolResponse>;
|
|
161
163
|
getCandleChart(request: GetCandleChartRequest): Observable<GetCandleChartResponse>;
|
|
@@ -4,7 +4,7 @@ package swap_order;
|
|
|
4
4
|
|
|
5
5
|
// SwapOrderService defines the available RPC endpoints for swap order operations.
|
|
6
6
|
service SwapOrderService {
|
|
7
|
-
rpc
|
|
7
|
+
rpc GetListPools (GetListPoolsRequest) returns (GetListPoolsResponse);
|
|
8
8
|
rpc GetNewPools (GetNewPoolsRequest) returns (GetNewPoolsResponse);
|
|
9
9
|
rpc GetPool (GetPoolRequest) returns (GetPoolResponse);
|
|
10
10
|
rpc GetCandleChart (GetCandleChartRequest) returns (GetCandleChartResponse);
|
|
@@ -61,10 +61,11 @@ message PoolDataDetail {
|
|
|
61
61
|
bool aIsBase = 4;
|
|
62
62
|
optional double reserveA = 5;
|
|
63
63
|
optional double reserveB = 6;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
string
|
|
67
|
-
|
|
64
|
+
double priceA = 7;
|
|
65
|
+
double priceB = 8;
|
|
66
|
+
string poolCreatedTime = 9;
|
|
67
|
+
string dex = 10;
|
|
68
|
+
StatsData statsData = 11;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
// Candle data structure matching CandleData interface
|
|
@@ -113,10 +114,11 @@ message TrendingTokenData {
|
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
// Request messages matching TypeScript interfaces
|
|
116
|
-
message
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
optional int32
|
|
117
|
+
message GetListPoolsRequest {
|
|
118
|
+
string type = 1; // 'trending' | 'top-volume' | 'new-pools'
|
|
119
|
+
int32 label = 2; // 5 | 60 | 360 | 1440
|
|
120
|
+
optional int32 page = 3;
|
|
121
|
+
optional int32 limit = 4;
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
message GetNewPoolsRequest {
|
|
@@ -160,7 +162,7 @@ message GetTokensRequest {
|
|
|
160
162
|
}
|
|
161
163
|
|
|
162
164
|
// Response messages matching TypeScript interfaces with BaseResponse structure
|
|
163
|
-
message
|
|
165
|
+
message GetListPoolsResponse {
|
|
164
166
|
bool success = 1;
|
|
165
167
|
string message = 2;
|
|
166
168
|
repeated PoolDataDetail data = 3;
|