@sui-tracker/shared 1.0.60 → 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 +14 -7
- package/dist/protos/swap-order.proto +16 -9
- 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,9 @@ export interface PoolDataDetail {
|
|
|
34
34
|
aIsBase: boolean;
|
|
35
35
|
reserveA?: number;
|
|
36
36
|
reserveB?: number;
|
|
37
|
-
|
|
37
|
+
priceA: number;
|
|
38
|
+
priceB: number;
|
|
39
|
+
poolCreatedTime?: Date;
|
|
38
40
|
dex: string;
|
|
39
41
|
statsData: {
|
|
40
42
|
volume: {
|
|
@@ -62,11 +64,16 @@ export interface CandleData {
|
|
|
62
64
|
c: string;
|
|
63
65
|
v: string;
|
|
64
66
|
}
|
|
65
|
-
export interface
|
|
66
|
-
|
|
67
|
+
export interface GetListPoolsRequest {
|
|
68
|
+
type: 'trending' | 'top-volume' | 'new-pools';
|
|
69
|
+
label: 5 | 60 | 360 | 1440;
|
|
70
|
+
page?: number;
|
|
71
|
+
limit?: number;
|
|
67
72
|
}
|
|
68
73
|
export interface GetNewPoolsRequest {
|
|
69
74
|
label: number;
|
|
75
|
+
page?: number;
|
|
76
|
+
limit?: number;
|
|
70
77
|
}
|
|
71
78
|
export interface GetPoolRequest {
|
|
72
79
|
id: string;
|
|
@@ -79,11 +86,11 @@ export interface GetCandleChartRequest {
|
|
|
79
86
|
timestamp?: string;
|
|
80
87
|
type?: 'usd' | 'token';
|
|
81
88
|
}
|
|
82
|
-
export interface
|
|
83
|
-
data:
|
|
89
|
+
export interface GetListPoolsResponse extends BaseResponse {
|
|
90
|
+
data: PoolDataDetail[];
|
|
84
91
|
}
|
|
85
92
|
export interface GetNewPoolsResponse extends BaseResponse {
|
|
86
|
-
data:
|
|
93
|
+
data: PoolDataDetail[];
|
|
87
94
|
}
|
|
88
95
|
export interface GetPoolResponse extends BaseResponse {
|
|
89
96
|
data: PoolDataDetail | null;
|
|
@@ -150,7 +157,7 @@ export interface GetTokensRequest {
|
|
|
150
157
|
addresses: string[];
|
|
151
158
|
}
|
|
152
159
|
export interface SwapOrderService {
|
|
153
|
-
|
|
160
|
+
GetListPools(request: GetListPoolsRequest): Observable<GetListPoolsResponse>;
|
|
154
161
|
getNewPools(request: GetNewPoolsRequest): Observable<GetNewPoolsResponse>;
|
|
155
162
|
getPool(request: GetPoolRequest): Observable<GetPoolResponse>;
|
|
156
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,9 +61,11 @@ message PoolDataDetail {
|
|
|
61
61
|
bool aIsBase = 4;
|
|
62
62
|
optional double reserveA = 5;
|
|
63
63
|
optional double reserveB = 6;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
double priceA = 7;
|
|
65
|
+
double priceB = 8;
|
|
66
|
+
string poolCreatedTime = 9;
|
|
67
|
+
string dex = 10;
|
|
68
|
+
StatsData statsData = 11;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
// Candle data structure matching CandleData interface
|
|
@@ -112,12 +114,17 @@ message TrendingTokenData {
|
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
// Request messages matching TypeScript interfaces
|
|
115
|
-
message
|
|
116
|
-
|
|
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;
|
|
117
122
|
}
|
|
118
123
|
|
|
119
124
|
message GetNewPoolsRequest {
|
|
120
125
|
int32 label = 1; // 5 | 60 | 360 | 1440
|
|
126
|
+
optional int32 page = 2;
|
|
127
|
+
optional int32 limit = 3;
|
|
121
128
|
}
|
|
122
129
|
|
|
123
130
|
message GetPoolRequest {
|
|
@@ -155,16 +162,16 @@ message GetTokensRequest {
|
|
|
155
162
|
}
|
|
156
163
|
|
|
157
164
|
// Response messages matching TypeScript interfaces with BaseResponse structure
|
|
158
|
-
message
|
|
165
|
+
message GetListPoolsResponse {
|
|
159
166
|
bool success = 1;
|
|
160
167
|
string message = 2;
|
|
161
|
-
repeated
|
|
168
|
+
repeated PoolDataDetail data = 3;
|
|
162
169
|
}
|
|
163
170
|
|
|
164
171
|
message GetNewPoolsResponse {
|
|
165
172
|
bool success = 1;
|
|
166
173
|
string message = 2;
|
|
167
|
-
repeated
|
|
174
|
+
repeated PoolDataDetail data = 3;
|
|
168
175
|
}
|
|
169
176
|
|
|
170
177
|
message GetPoolResponse {
|