@sui-tracker/shared 1.0.76 → 1.0.78
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/account-grpc.service.d.ts +2 -1
- package/dist/modules/grpc-services/account-grpc.service.js +17 -0
- package/dist/modules/grpc-services/account-grpc.service.js.map +1 -1
- package/dist/modules/interfaces/account.interface.d.ts +21 -1
- package/dist/modules/interfaces/swap-order.interface.d.ts +34 -9
- package/dist/modules/interfaces/swap-order.interface.js.map +1 -1
- package/dist/protos/account.proto +34 -5
- package/dist/protos/swap-order.proto +44 -17
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClientGrpc } from "@nestjs/microservices";
|
|
2
|
-
import { LoginRequest, LoginResponse, CreateSwapRequest, CreateSwapResponse, GetSwapByIdRequest, GetSwapByIdResponse, GetUserSwapsRequest, GetUserSwapsResponse, GetTransactionStatsRequest, GetTransactionStatsResponse, GetTokenTransactionsRequest, GetTokenTransactionsResponse, GetWalletByIdRequest, GetWalletByIdResponse, CreateWalletRequest, CreateWalletResponse, ValidateTokenResponse, MeResponse, GetUserWalletsResponse, GetSwapHistoryRequest } from "../interfaces/account.interface";
|
|
2
|
+
import { LoginRequest, LoginResponse, CreateSwapRequest, CreateSwapResponse, GetSwapByIdRequest, GetSwapByIdResponse, GetUserSwapsRequest, GetUserSwapsResponse, GetWalletSwapsRequest, GetWalletSwapsResponse, GetTransactionStatsRequest, GetTransactionStatsResponse, GetTokenTransactionsRequest, GetTokenTransactionsResponse, GetWalletByIdRequest, GetWalletByIdResponse, CreateWalletRequest, CreateWalletResponse, ValidateTokenResponse, MeResponse, GetUserWalletsResponse, GetSwapHistoryRequest } from "../interfaces/account.interface";
|
|
3
3
|
import { GrpcMetadataService } from "./grpc-metadata.service";
|
|
4
4
|
export declare class AccountGrpcService {
|
|
5
5
|
private grpcClient;
|
|
@@ -11,6 +11,7 @@ export declare class AccountGrpcService {
|
|
|
11
11
|
validateToken(token: string): Promise<ValidateTokenResponse>;
|
|
12
12
|
createSwap(data: CreateSwapRequest): Promise<CreateSwapResponse>;
|
|
13
13
|
getUserSwaps(data: GetUserSwapsRequest): Promise<GetUserSwapsResponse>;
|
|
14
|
+
getWalletSwaps(data: GetWalletSwapsRequest): Promise<GetWalletSwapsResponse>;
|
|
14
15
|
getTransactionStats(data: GetTransactionStatsRequest): Promise<GetTransactionStatsResponse>;
|
|
15
16
|
getTokenTransactions(data: GetTokenTransactionsRequest): Promise<GetTokenTransactionsResponse>;
|
|
16
17
|
getWalletById(data: GetWalletByIdRequest): Promise<GetWalletByIdResponse>;
|
|
@@ -111,6 +111,23 @@ let AccountGrpcService = AccountGrpcService_1 = class AccountGrpcService {
|
|
|
111
111
|
}
|
|
112
112
|
return res;
|
|
113
113
|
}
|
|
114
|
+
async getWalletSwaps(data) {
|
|
115
|
+
const swapService = this.grpcClient.getService("SwapService");
|
|
116
|
+
const res = await new Promise((resolve, reject) => {
|
|
117
|
+
swapService
|
|
118
|
+
.getWalletSwaps(data, this.grpcMetadataService.createMetadata("accounts", [
|
|
119
|
+
"get:wallet-swaps",
|
|
120
|
+
]))
|
|
121
|
+
.subscribe({
|
|
122
|
+
next: (response) => resolve(response),
|
|
123
|
+
error: (error) => reject(error),
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
if (!res.success) {
|
|
127
|
+
throw new Error(res.message);
|
|
128
|
+
}
|
|
129
|
+
return res;
|
|
130
|
+
}
|
|
114
131
|
async getTransactionStats(data) {
|
|
115
132
|
const swapService = this.grpcClient.getService("SwapService");
|
|
116
133
|
const res = await new Promise((resolve, reject) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-grpc.service.js","sourceRoot":"","sources":["../../../src/modules/grpc-services/account-grpc.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAkE;
|
|
1
|
+
{"version":3,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GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAc,aAAa,CAAC,CAAA;QAC7E,MAAM,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAA;QAC1F,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAEjB,MAAM,GAAG,GAAG,MAAM,IAAI,OAAO,CAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrD,cAAc,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,SAAS,CAAC;gBACtD,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC;gBACrC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CACf,MAAM,CAAC;oBACL,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE,KAAK,CAAC,OAAO;oBACtB,IAAI,EAAE,IAAI;iBACX,CAAC;aACL,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAC9B,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;CAWF,CAAA;AAnXY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,eAAM,EAAC,SAAS,CAAC,CAAA;6CAEW,2CAAmB;GANvC,kBAAkB,CAmX9B"}
|
|
@@ -39,9 +39,12 @@ export interface Swap {
|
|
|
39
39
|
walletId: string;
|
|
40
40
|
fromToken: string;
|
|
41
41
|
toToken: string;
|
|
42
|
-
|
|
42
|
+
amountIn: string;
|
|
43
|
+
amountOut: string;
|
|
43
44
|
status: string;
|
|
44
45
|
dexId: string;
|
|
46
|
+
pool: string;
|
|
47
|
+
txDigest: string;
|
|
45
48
|
createdAt: string;
|
|
46
49
|
updatedAt: string;
|
|
47
50
|
}
|
|
@@ -136,6 +139,22 @@ export interface GetUserSwapsResponse extends BaseResponse {
|
|
|
136
139
|
pagination: Pagination;
|
|
137
140
|
};
|
|
138
141
|
}
|
|
142
|
+
export interface GetWalletSwapsRequest {
|
|
143
|
+
walletId: string;
|
|
144
|
+
page: number;
|
|
145
|
+
limit: number;
|
|
146
|
+
fromToken?: string;
|
|
147
|
+
toToken?: string;
|
|
148
|
+
pool?: string;
|
|
149
|
+
search?: string;
|
|
150
|
+
status?: string;
|
|
151
|
+
}
|
|
152
|
+
export interface GetWalletSwapsResponse extends BaseResponse {
|
|
153
|
+
data: {
|
|
154
|
+
swaps: Swap[];
|
|
155
|
+
pagination: Pagination;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
139
158
|
export interface GetTransactionStatsRequest {
|
|
140
159
|
userId: string;
|
|
141
160
|
walletId: string;
|
|
@@ -167,6 +186,7 @@ export interface SwapService {
|
|
|
167
186
|
createSwap(request: CreateSwapRequest, metadata: Metadata): Observable<CreateSwapResponse>;
|
|
168
187
|
getSwapById(request: GetSwapByIdRequest, metadata: Metadata): Observable<GetSwapByIdResponse>;
|
|
169
188
|
getUserSwaps(request: GetUserSwapsRequest, metadata: Metadata): Observable<GetUserSwapsResponse>;
|
|
189
|
+
getWalletSwaps(request: GetWalletSwapsRequest, metadata: Metadata): Observable<GetWalletSwapsResponse>;
|
|
170
190
|
getTransactionStats(request: GetTransactionStatsRequest, metadata: Metadata): Observable<GetTransactionStatsResponse>;
|
|
171
191
|
getTokenTransactions(request: GetTokenTransactionsRequest, metadata: Metadata): Observable<GetTokenTransactionsResponse>;
|
|
172
192
|
getSwapHistory(request: GetSwapHistoryRequest, metadata: Metadata): Observable<GetSwapHistoryResponse>;
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
import { BaseResponse } from "./base-request.interface";
|
|
3
|
-
import { TradeType } from "src/interfaces/ISwapOrder.type";
|
|
3
|
+
import { TradeType, DexType } from "src/interfaces/ISwapOrder.type";
|
|
4
|
+
export interface GetListPoolsFilter {
|
|
5
|
+
minMaker?: number;
|
|
6
|
+
maxMaker?: number;
|
|
7
|
+
minTx?: number;
|
|
8
|
+
maxTx?: number;
|
|
9
|
+
minVolume?: number;
|
|
10
|
+
maxVolume?: number;
|
|
11
|
+
minPriceChange5m?: number;
|
|
12
|
+
maxPriceChange5m?: number;
|
|
13
|
+
minPriceChange60m?: number;
|
|
14
|
+
maxPriceChange60m?: number;
|
|
15
|
+
minPriceChange360m?: number;
|
|
16
|
+
maxPriceChange360m?: number;
|
|
17
|
+
minPriceChange1440m?: number;
|
|
18
|
+
maxPriceChange1440m?: number;
|
|
19
|
+
maxPriceChange?: number;
|
|
20
|
+
minMarketCap?: number;
|
|
21
|
+
maxMarketCap?: number;
|
|
22
|
+
minAge?: number;
|
|
23
|
+
maxAge?: number;
|
|
24
|
+
dex?: DexType[];
|
|
25
|
+
}
|
|
4
26
|
export interface TokenData {
|
|
5
27
|
id: string;
|
|
6
28
|
name?: string | null;
|
|
@@ -36,6 +58,12 @@ export interface PoolDataDetail {
|
|
|
36
58
|
tokenB: TokenData;
|
|
37
59
|
pool: string;
|
|
38
60
|
aIsBase: boolean;
|
|
61
|
+
stats: {
|
|
62
|
+
[key: number]: IPoolStats;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface IPoolStats {
|
|
66
|
+
priceChange: number;
|
|
39
67
|
totalVolume: number;
|
|
40
68
|
totalTx: number;
|
|
41
69
|
totalA2b: number;
|
|
@@ -45,10 +73,6 @@ export interface PoolDataDetail {
|
|
|
45
73
|
makerB2a: number;
|
|
46
74
|
totalVolumeA2b: number;
|
|
47
75
|
totalVolumeB2a: number;
|
|
48
|
-
price5mAgo: number;
|
|
49
|
-
price60mAgo: number;
|
|
50
|
-
price360mAgo: number;
|
|
51
|
-
price1440mAgo: number;
|
|
52
76
|
}
|
|
53
77
|
export interface CandleData {
|
|
54
78
|
t: string;
|
|
@@ -63,6 +87,7 @@ export interface GetListPoolsRequest {
|
|
|
63
87
|
label: 5 | 60 | 360 | 1440;
|
|
64
88
|
page?: number;
|
|
65
89
|
limit?: number;
|
|
90
|
+
filter?: GetListPoolsFilter;
|
|
66
91
|
}
|
|
67
92
|
export interface GetPoolRequest {
|
|
68
93
|
id: string;
|
|
@@ -95,10 +120,10 @@ export interface ListPool {
|
|
|
95
120
|
priceA: number;
|
|
96
121
|
priceB: number;
|
|
97
122
|
dex: string;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
123
|
+
priceChange5m: number;
|
|
124
|
+
priceChange60m: number;
|
|
125
|
+
priceChange360m: number;
|
|
126
|
+
priceChange1440m: number;
|
|
102
127
|
aIsBase: boolean;
|
|
103
128
|
}
|
|
104
129
|
export interface GetListPoolsResponse extends BaseResponse {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap-order.interface.js","sourceRoot":"","sources":["../../../src/modules/interfaces/swap-order.interface.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"swap-order.interface.js","sourceRoot":"","sources":["../../../src/modules/interfaces/swap-order.interface.ts"],"names":[],"mappings":";;AA0IC,EAAE,CAAA"}
|
|
@@ -23,6 +23,8 @@ service SwapService {
|
|
|
23
23
|
rpc GetSwapById(GetSwapByIdRequest) returns (GetSwapByIdResponse);
|
|
24
24
|
// Get user swaps with pagination and filters
|
|
25
25
|
rpc GetUserSwaps(GetUserSwapsRequest) returns (GetUserSwapsResponse);
|
|
26
|
+
// Get wallet swaps with pagination and filters
|
|
27
|
+
rpc GetWalletSwaps(GetWalletSwapsRequest) returns (GetWalletSwapsResponse);
|
|
26
28
|
// Get transaction statistics for a user and wallet on a specific date
|
|
27
29
|
rpc GetTransactionStats(GetTransactionStatsRequest) returns (GetTransactionStatsResponse);
|
|
28
30
|
// Get token transactions with pagination and filters
|
|
@@ -92,11 +94,14 @@ message Swap {
|
|
|
92
94
|
string walletId = 3;
|
|
93
95
|
string fromToken = 4;
|
|
94
96
|
string toToken = 5;
|
|
95
|
-
string
|
|
96
|
-
string
|
|
97
|
-
string
|
|
98
|
-
string
|
|
99
|
-
string
|
|
97
|
+
string amountIn = 6;
|
|
98
|
+
string amountOut = 7;
|
|
99
|
+
string status = 8;
|
|
100
|
+
string dexId = 9;
|
|
101
|
+
string pool = 10;
|
|
102
|
+
string txDigest = 11;
|
|
103
|
+
string createdAt = 12;
|
|
104
|
+
string updatedAt = 13;
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
// Transaction statistics
|
|
@@ -245,6 +250,30 @@ message GetUserSwapsResponseData {
|
|
|
245
250
|
Pagination pagination = 2;
|
|
246
251
|
}
|
|
247
252
|
|
|
253
|
+
// Get wallet swaps request with filters and pagination
|
|
254
|
+
message GetWalletSwapsRequest {
|
|
255
|
+
string walletId = 1;
|
|
256
|
+
int32 page = 2;
|
|
257
|
+
int32 limit = 3;
|
|
258
|
+
string fromToken = 4;
|
|
259
|
+
string toToken = 5;
|
|
260
|
+
string pool = 6;
|
|
261
|
+
string search = 7;
|
|
262
|
+
string status = 8;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Get wallet swaps response with swaps and pagination, extends BaseResponse
|
|
266
|
+
message GetWalletSwapsResponse {
|
|
267
|
+
bool success = 1;
|
|
268
|
+
string message = 2;
|
|
269
|
+
GetWalletSwapsResponseData data = 3;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
message GetWalletSwapsResponseData {
|
|
273
|
+
repeated Swap swaps = 1;
|
|
274
|
+
Pagination pagination = 2;
|
|
275
|
+
}
|
|
276
|
+
|
|
248
277
|
// Get transaction stats request
|
|
249
278
|
message GetTransactionStatsRequest {
|
|
250
279
|
string userId = 1;
|
|
@@ -49,6 +49,20 @@ message PoolData {
|
|
|
49
49
|
string currentPrice = 10;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
// Pool stats structure matching IPoolStats interface
|
|
53
|
+
message IPoolStats {
|
|
54
|
+
double priceChange = 1;
|
|
55
|
+
double totalVolume = 2;
|
|
56
|
+
int32 totalTx = 3;
|
|
57
|
+
double totalA2b = 4;
|
|
58
|
+
double totalB2a = 5;
|
|
59
|
+
double totalMaker = 6;
|
|
60
|
+
double makerA2b = 7;
|
|
61
|
+
double makerB2a = 8;
|
|
62
|
+
double totalVolumeA2b = 9;
|
|
63
|
+
double totalVolumeB2a = 10;
|
|
64
|
+
}
|
|
65
|
+
|
|
52
66
|
// Pool data detail structure matching PoolDataDetail interface
|
|
53
67
|
message PoolDataDetail {
|
|
54
68
|
double priceA = 1;
|
|
@@ -59,19 +73,7 @@ message PoolDataDetail {
|
|
|
59
73
|
TokenData tokenB = 6;
|
|
60
74
|
string pool = 7;
|
|
61
75
|
bool aIsBase = 8;
|
|
62
|
-
|
|
63
|
-
int32 totalTx = 10;
|
|
64
|
-
double totalA2b = 11;
|
|
65
|
-
double totalB2a = 12;
|
|
66
|
-
double totalMaker = 13;
|
|
67
|
-
double makerA2b = 14;
|
|
68
|
-
double makerB2a = 15;
|
|
69
|
-
double price5mAgo = 16;
|
|
70
|
-
double price60mAgo = 17;
|
|
71
|
-
double price360mAgo = 18;
|
|
72
|
-
double price1440mAgo = 19;
|
|
73
|
-
double totalVolumeA2b = 20;
|
|
74
|
-
double totalVolumeB2a = 21;
|
|
76
|
+
map<int32, IPoolStats> stats = 9;
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
// List pool structure matching ListPool interface
|
|
@@ -95,10 +97,10 @@ message ListPool {
|
|
|
95
97
|
double priceA = 17;
|
|
96
98
|
double priceB = 18;
|
|
97
99
|
string dex = 19;
|
|
98
|
-
double
|
|
99
|
-
double
|
|
100
|
-
double
|
|
101
|
-
double
|
|
100
|
+
double priceChange5m = 20;
|
|
101
|
+
double priceChange60m = 21;
|
|
102
|
+
double priceChange360m = 22;
|
|
103
|
+
double priceChange1440m = 23;
|
|
102
104
|
bool aIsBase = 24;
|
|
103
105
|
}
|
|
104
106
|
|
|
@@ -147,12 +149,37 @@ message TrendingTokenData {
|
|
|
147
149
|
string score = 14;
|
|
148
150
|
}
|
|
149
151
|
|
|
152
|
+
// Filter message for GetListPoolsRequest
|
|
153
|
+
message GetListPoolsFilter {
|
|
154
|
+
optional double minMaker = 1;
|
|
155
|
+
optional double maxMaker = 2;
|
|
156
|
+
optional int32 minTx = 3;
|
|
157
|
+
optional int32 maxTx = 4;
|
|
158
|
+
optional double minVolume = 5;
|
|
159
|
+
optional double maxVolume = 6;
|
|
160
|
+
optional double minPriceChange5m = 7;
|
|
161
|
+
optional double maxPriceChange5m = 8;
|
|
162
|
+
optional double minPriceChange60m = 9;
|
|
163
|
+
optional double maxPriceChange60m = 10;
|
|
164
|
+
optional double minPriceChange360m = 11;
|
|
165
|
+
optional double maxPriceChange360m = 12;
|
|
166
|
+
optional double minPriceChange1440m = 13;
|
|
167
|
+
optional double maxPriceChange1440m = 14;
|
|
168
|
+
optional double maxPriceChange = 15;
|
|
169
|
+
optional double minMarketCap = 16;
|
|
170
|
+
optional double maxMarketCap = 17;
|
|
171
|
+
optional int32 minAge = 18;
|
|
172
|
+
optional int32 maxAge = 19;
|
|
173
|
+
repeated string dex = 20;
|
|
174
|
+
}
|
|
175
|
+
|
|
150
176
|
// Request messages matching TypeScript interfaces
|
|
151
177
|
message GetListPoolsRequest {
|
|
152
178
|
string type = 1; // 'trending' | 'top-volume' | 'new-pools'
|
|
153
179
|
int32 label = 2; // 5 | 60 | 360 | 1440
|
|
154
180
|
optional int32 page = 3;
|
|
155
181
|
optional int32 limit = 4;
|
|
182
|
+
optional GetListPoolsFilter filter = 5;
|
|
156
183
|
}
|
|
157
184
|
|
|
158
185
|
message GetNewPoolsRequest {
|