@sui-tracker/shared 1.0.64 → 1.0.66
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/interfaces/IBalanceChange.type.d.ts +3 -6
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/index.js.map +1 -1
- package/dist/modules/grpc-services/account-grpc.service.d.ts +6 -0
- package/dist/modules/grpc-services/account-grpc.service.js +55 -8
- package/dist/modules/grpc-services/account-grpc.service.js.map +1 -1
- package/dist/modules/interfaces/account.interface.d.ts +21 -0
- package/dist/modules/interfaces/swap-order.interface.d.ts +65 -41
- package/dist/modules/interfaces/swap-order.interface.js +1 -0
- package/dist/modules/interfaces/swap-order.interface.js.map +1 -1
- package/dist/protos/account.proto +30 -2
- package/dist/protos/swap-order.proto +81 -48
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/.env +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Buffer } from
|
|
1
|
+
import { Buffer } from "buffer";
|
|
2
2
|
export interface ITokenTransferData {
|
|
3
3
|
coinType: string;
|
|
4
4
|
amount: bigint;
|
|
@@ -8,12 +8,9 @@ export interface ITokenTransferData {
|
|
|
8
8
|
hash: string;
|
|
9
9
|
}
|
|
10
10
|
export interface IBalanceChange {
|
|
11
|
-
amount:
|
|
11
|
+
amount: number;
|
|
12
12
|
coinType: string;
|
|
13
|
-
owner:
|
|
14
|
-
AddressOwner?: string;
|
|
15
|
-
ObjectOwner?: string;
|
|
16
|
-
};
|
|
13
|
+
owner: string;
|
|
17
14
|
tokenAccountHash: Buffer;
|
|
18
15
|
transactionHash: string;
|
|
19
16
|
}
|
package/dist/interfaces/index.js
CHANGED
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./ISwapOrder.type"), exports);
|
|
18
18
|
__exportStar(require("./IBalanceChange.type"), exports);
|
|
19
19
|
__exportStar(require("./IProxy"), exports);
|
|
20
|
+
__exportStar(require("../modules/interfaces/checkpoint.interface"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,wDAAsC;AACtC,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,wDAAsC;AACtC,2CAAyB;AACzB,6EAA2D"}
|
|
@@ -18,4 +18,10 @@ export declare class AccountGrpcService {
|
|
|
18
18
|
getWalletById(data: GetWalletByIdRequest): Promise<GetWalletByIdResponse>;
|
|
19
19
|
createWallet(data: CreateWalletRequest): Promise<CreateWalletResponse>;
|
|
20
20
|
getUserWallets(): Promise<GetUserWalletsResponse>;
|
|
21
|
+
withdraw(data: {
|
|
22
|
+
walletAddress: string;
|
|
23
|
+
toAddress: string;
|
|
24
|
+
coinType: string;
|
|
25
|
+
amount: string;
|
|
26
|
+
}): Promise<any>;
|
|
21
27
|
}
|
|
@@ -39,7 +39,9 @@ let AccountGrpcService = AccountGrpcService_1 = class AccountGrpcService {
|
|
|
39
39
|
}
|
|
40
40
|
async me(userId) {
|
|
41
41
|
const authService = this.grpcClient.getService("AuthService");
|
|
42
|
-
const metadata = this.grpcMetadataService.createMetadata(
|
|
42
|
+
const metadata = this.grpcMetadataService.createMetadata("accounts", [
|
|
43
|
+
"get:me",
|
|
44
|
+
]);
|
|
43
45
|
const res = await new Promise((resolve, reject) => {
|
|
44
46
|
authService.me({ userId }, metadata).subscribe({
|
|
45
47
|
next: (response) => {
|
|
@@ -82,7 +84,9 @@ let AccountGrpcService = AccountGrpcService_1 = class AccountGrpcService {
|
|
|
82
84
|
async createSwap(data) {
|
|
83
85
|
const swapService = this.grpcClient.getService("SwapService");
|
|
84
86
|
const res = await new Promise((resolve, reject) => {
|
|
85
|
-
swapService
|
|
87
|
+
swapService
|
|
88
|
+
.createSwap(data, this.grpcMetadataService.createMetadata("accounts", ["create:swap"]))
|
|
89
|
+
.subscribe({
|
|
86
90
|
next: (response) => resolve(response),
|
|
87
91
|
error: (error) => reject(error),
|
|
88
92
|
});
|
|
@@ -95,7 +99,11 @@ let AccountGrpcService = AccountGrpcService_1 = class AccountGrpcService {
|
|
|
95
99
|
async getUserSwaps(data) {
|
|
96
100
|
const swapService = this.grpcClient.getService("SwapService");
|
|
97
101
|
const res = await new Promise((resolve, reject) => {
|
|
98
|
-
swapService
|
|
102
|
+
swapService
|
|
103
|
+
.getUserSwaps(data, this.grpcMetadataService.createMetadata("accounts", [
|
|
104
|
+
"get:user-swaps",
|
|
105
|
+
]))
|
|
106
|
+
.subscribe({
|
|
99
107
|
next: (response) => resolve(response),
|
|
100
108
|
error: (error) => reject(error),
|
|
101
109
|
});
|
|
@@ -108,7 +116,11 @@ let AccountGrpcService = AccountGrpcService_1 = class AccountGrpcService {
|
|
|
108
116
|
async getTransactionStats(data) {
|
|
109
117
|
const swapService = this.grpcClient.getService("SwapService");
|
|
110
118
|
const res = await new Promise((resolve, reject) => {
|
|
111
|
-
swapService
|
|
119
|
+
swapService
|
|
120
|
+
.getTransactionStats(data, this.grpcMetadataService.createMetadata("accounts", [
|
|
121
|
+
"get:transaction-stats",
|
|
122
|
+
]))
|
|
123
|
+
.subscribe({
|
|
112
124
|
next: (response) => resolve(response),
|
|
113
125
|
error: (error) => reject(error),
|
|
114
126
|
});
|
|
@@ -121,7 +133,11 @@ let AccountGrpcService = AccountGrpcService_1 = class AccountGrpcService {
|
|
|
121
133
|
async getTokenTransactions(data) {
|
|
122
134
|
const swapService = this.grpcClient.getService("SwapService");
|
|
123
135
|
const res = await new Promise((resolve, reject) => {
|
|
124
|
-
swapService
|
|
136
|
+
swapService
|
|
137
|
+
.getTokenTransactions(data, this.grpcMetadataService.createMetadata("accounts", [
|
|
138
|
+
"get:token-transactions",
|
|
139
|
+
]))
|
|
140
|
+
.subscribe({
|
|
125
141
|
next: (response) => resolve(response),
|
|
126
142
|
error: (error) => reject(error),
|
|
127
143
|
});
|
|
@@ -134,7 +150,9 @@ let AccountGrpcService = AccountGrpcService_1 = class AccountGrpcService {
|
|
|
134
150
|
async getWalletById(data) {
|
|
135
151
|
const walletService = this.grpcClient.getService("WalletService");
|
|
136
152
|
const res = await new Promise((resolve, reject) => {
|
|
137
|
-
walletService
|
|
153
|
+
walletService
|
|
154
|
+
.getWalletById(data, this.grpcMetadataService.createMetadata("accounts", ["get:wallet"]))
|
|
155
|
+
.subscribe({
|
|
138
156
|
next: (response) => resolve(response),
|
|
139
157
|
error: (error) => reject(error),
|
|
140
158
|
});
|
|
@@ -147,7 +165,11 @@ let AccountGrpcService = AccountGrpcService_1 = class AccountGrpcService {
|
|
|
147
165
|
async createWallet(data) {
|
|
148
166
|
const walletService = this.grpcClient.getService("WalletService");
|
|
149
167
|
const res = await new Promise((resolve, reject) => {
|
|
150
|
-
walletService
|
|
168
|
+
walletService
|
|
169
|
+
.createWallet(data, this.grpcMetadataService.createMetadata("accounts", [
|
|
170
|
+
"create:wallet",
|
|
171
|
+
]))
|
|
172
|
+
.subscribe({
|
|
151
173
|
next: (response) => resolve(response),
|
|
152
174
|
error: (error) => reject(error),
|
|
153
175
|
});
|
|
@@ -160,7 +182,11 @@ let AccountGrpcService = AccountGrpcService_1 = class AccountGrpcService {
|
|
|
160
182
|
async getUserWallets() {
|
|
161
183
|
const walletService = this.grpcClient.getService("WalletService");
|
|
162
184
|
const res = await new Promise((resolve, reject) => {
|
|
163
|
-
walletService
|
|
185
|
+
walletService
|
|
186
|
+
.getUserWallets({}, this.grpcMetadataService.createMetadata("accounts", [
|
|
187
|
+
"get:user-wallets",
|
|
188
|
+
]))
|
|
189
|
+
.subscribe({
|
|
164
190
|
next: (response) => resolve(response),
|
|
165
191
|
error: (error) => reject(error),
|
|
166
192
|
});
|
|
@@ -170,6 +196,27 @@ let AccountGrpcService = AccountGrpcService_1 = class AccountGrpcService {
|
|
|
170
196
|
}
|
|
171
197
|
return res;
|
|
172
198
|
}
|
|
199
|
+
async withdraw(data) {
|
|
200
|
+
console.log("AccountGrpcService.withdraw called with data:", data);
|
|
201
|
+
const walletService = this.grpcClient.getService("WalletService");
|
|
202
|
+
const res = await new Promise((resolve, reject) => {
|
|
203
|
+
walletService.withdraw(data).subscribe({
|
|
204
|
+
next: (response) => {
|
|
205
|
+
console.log("gRPC withdraw response:", response);
|
|
206
|
+
resolve(response);
|
|
207
|
+
},
|
|
208
|
+
error: (error) => {
|
|
209
|
+
console.log("gRPC withdraw error:", error);
|
|
210
|
+
reject(error);
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
console.log("gRPC withdraw result:", res);
|
|
215
|
+
if (!res.success) {
|
|
216
|
+
throw new Error(res.message);
|
|
217
|
+
}
|
|
218
|
+
return res;
|
|
219
|
+
}
|
|
173
220
|
};
|
|
174
221
|
exports.AccountGrpcService = AccountGrpcService;
|
|
175
222
|
exports.AccountGrpcService = AccountGrpcService = AccountGrpcService_1 = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-grpc.service.js","sourceRoot":"","sources":["../../../src/modules/grpc-services/account-grpc.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"account-grpc.service.js","sourceRoot":"","sources":["../../../src/modules/grpc-services/account-grpc.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA2D;AA2B3D,qFAA+E;AAC/E,mEAA6D;AAGtD,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAG7B,YAEE,UAA8B,EACtB,oBAA0C,EAC1C,mBAAwC;QAFxC,eAAU,GAAV,UAAU,CAAY;QACtB,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,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AAO,EAAE,MAAM,EAAE,EAAE;YACrD,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC;gBACrC,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE;oBACjB,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAA;oBAChD,OAAO,CAAC,QAAQ,CAAC,CAAA;gBACnB,CAAC;gBACD,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;oBACf,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAA;oBAC1C,MAAM,CAAC,KAAK,CAAC,CAAA;gBACf,CAAC;aACF,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAA;QAEzC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAC9B,CAAC;QAED,OAAO,GAAG,CAAA;IACZ,CAAC;CAWF,CAAA;AA9SY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,eAAM,EAAC,SAAS,CAAC,CAAA;6CAEY,6CAAoB;QACrB,2CAAmB;GAPvC,kBAAkB,CA8S9B"}
|
|
@@ -11,6 +11,7 @@ export interface User {
|
|
|
11
11
|
referralCode: string;
|
|
12
12
|
parentId: string;
|
|
13
13
|
role: string;
|
|
14
|
+
mainWalletAddress?: string;
|
|
14
15
|
createdAt: string;
|
|
15
16
|
updatedAt: string;
|
|
16
17
|
}
|
|
@@ -180,8 +181,28 @@ export interface GetUserWalletsResponse extends BaseResponse {
|
|
|
180
181
|
wallets: Wallet[];
|
|
181
182
|
};
|
|
182
183
|
}
|
|
184
|
+
export interface WithdrawRequest {
|
|
185
|
+
walletAddress: string;
|
|
186
|
+
toAddress: string;
|
|
187
|
+
coinType: string;
|
|
188
|
+
amount: string;
|
|
189
|
+
}
|
|
190
|
+
export interface WithdrawResponse extends BaseResponse {
|
|
191
|
+
data: WithdrawResponseData;
|
|
192
|
+
}
|
|
193
|
+
export interface WithdrawResponseData {
|
|
194
|
+
id: string;
|
|
195
|
+
wallet: Wallet;
|
|
196
|
+
address: string;
|
|
197
|
+
coinType: string;
|
|
198
|
+
amount: string;
|
|
199
|
+
status: string;
|
|
200
|
+
createdAt: string;
|
|
201
|
+
updatedAt: string;
|
|
202
|
+
}
|
|
183
203
|
export interface WalletService {
|
|
184
204
|
getUserWallets(request: GetUserWalletsRequest, metadata: Metadata): Observable<GetUserWalletsResponse>;
|
|
185
205
|
getWalletById(request: GetWalletByIdRequest, metadata: Metadata): Observable<GetWalletByIdResponse>;
|
|
186
206
|
createWallet(request: CreateWalletRequest, metadata: Metadata): Observable<CreateWalletResponse>;
|
|
207
|
+
withdraw(request: WithdrawRequest): Observable<WithdrawResponse>;
|
|
187
208
|
}
|
|
@@ -28,33 +28,27 @@ export interface PoolData {
|
|
|
28
28
|
currentPrice: string;
|
|
29
29
|
}
|
|
30
30
|
export interface PoolDataDetail {
|
|
31
|
-
id: string;
|
|
32
|
-
tokenA: TokenData;
|
|
33
|
-
tokenB: TokenData;
|
|
34
|
-
aIsBase: boolean;
|
|
35
|
-
reserveA?: number;
|
|
36
|
-
reserveB?: number;
|
|
37
31
|
priceA: number;
|
|
38
32
|
priceB: number;
|
|
39
|
-
poolCreatedTime?: Date;
|
|
40
33
|
dex: string;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
34
|
+
poolCreatedTime: Date | null;
|
|
35
|
+
tokenA: TokenData;
|
|
36
|
+
tokenB: TokenData;
|
|
37
|
+
pool: string;
|
|
38
|
+
aIsBase: boolean;
|
|
39
|
+
totalVolume: number;
|
|
40
|
+
totalTx: number;
|
|
41
|
+
totalA2b: number;
|
|
42
|
+
totalB2a: number;
|
|
43
|
+
totalMaker: number;
|
|
44
|
+
makerA2b: number;
|
|
45
|
+
makerB2a: number;
|
|
46
|
+
totalVolumeA2b: number;
|
|
47
|
+
totalVolumeB2a: number;
|
|
48
|
+
price5mAgo: number;
|
|
49
|
+
price60mAgo: number;
|
|
50
|
+
price360mAgo: number;
|
|
51
|
+
price1440mAgo: number;
|
|
58
52
|
}
|
|
59
53
|
export interface CandleData {
|
|
60
54
|
t: string;
|
|
@@ -82,15 +76,41 @@ export interface GetPoolRequest {
|
|
|
82
76
|
export interface GetCandleChartRequest {
|
|
83
77
|
pool: string;
|
|
84
78
|
resolution: number;
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
fromTime: number;
|
|
80
|
+
endTime: number;
|
|
87
81
|
type?: 'usd' | 'token';
|
|
88
82
|
}
|
|
83
|
+
export interface ListPool {
|
|
84
|
+
pool: string;
|
|
85
|
+
totalVolume: number;
|
|
86
|
+
totalTx: number;
|
|
87
|
+
totalA2b: number;
|
|
88
|
+
totalB2a: number;
|
|
89
|
+
totalMaker: number;
|
|
90
|
+
makerA2b: number;
|
|
91
|
+
makerB2a: number;
|
|
92
|
+
lastVolume: number;
|
|
93
|
+
lastAmountA: number;
|
|
94
|
+
lastAmountB: number;
|
|
95
|
+
trendingScore: number;
|
|
96
|
+
id: string;
|
|
97
|
+
tokenA: TokenData;
|
|
98
|
+
tokenB: TokenData;
|
|
99
|
+
poolCreatedTime: null;
|
|
100
|
+
priceA: number;
|
|
101
|
+
priceB: number;
|
|
102
|
+
dex: string;
|
|
103
|
+
price5mAgo: number;
|
|
104
|
+
price60mAgo: number;
|
|
105
|
+
price360mAgo: number;
|
|
106
|
+
price1440mAgo: number;
|
|
107
|
+
aIsBase: boolean;
|
|
108
|
+
}
|
|
89
109
|
export interface GetListPoolsResponse extends BaseResponse {
|
|
90
|
-
data:
|
|
110
|
+
data: ListPool;
|
|
91
111
|
}
|
|
92
112
|
export interface GetNewPoolsResponse extends BaseResponse {
|
|
93
|
-
data:
|
|
113
|
+
data: ListPool;
|
|
94
114
|
}
|
|
95
115
|
export interface GetPoolResponse extends BaseResponse {
|
|
96
116
|
data: PoolDataDetail | null;
|
|
@@ -99,27 +119,31 @@ export interface GetCandleChartResponse extends BaseResponse {
|
|
|
99
119
|
data: CandleData[];
|
|
100
120
|
}
|
|
101
121
|
export interface SwapOrderData {
|
|
102
|
-
id: number;
|
|
103
|
-
pool: string;
|
|
104
122
|
trader: string;
|
|
123
|
+
pool: string;
|
|
124
|
+
usdVolume: string;
|
|
125
|
+
usdPrice: string;
|
|
126
|
+
price: string;
|
|
127
|
+
volume: string;
|
|
105
128
|
transactionHash: string;
|
|
129
|
+
swapAt: number;
|
|
130
|
+
type: 'swap' | 'createPool' | 'addLiquidity' | 'removeLiquidity';
|
|
131
|
+
a2b: 'A2B' | 'B2A';
|
|
106
132
|
amountA: string;
|
|
107
133
|
amountB: string;
|
|
108
|
-
|
|
109
|
-
usdPrice: string;
|
|
110
|
-
a2b: boolean;
|
|
111
|
-
type: TradeType;
|
|
112
|
-
liquidity?: string;
|
|
113
|
-
createdAt: string;
|
|
114
|
-
swapAt: string;
|
|
134
|
+
liquidity?: string | null;
|
|
115
135
|
}
|
|
116
136
|
export interface GetLastSwapOrderRequest {
|
|
117
137
|
poolAddress: string;
|
|
118
|
-
|
|
119
|
-
endTime: string;
|
|
138
|
+
toTime: number;
|
|
120
139
|
limit?: number;
|
|
121
|
-
type?:
|
|
122
|
-
|
|
140
|
+
type?: TradeType;
|
|
141
|
+
minAmountA?: number;
|
|
142
|
+
maxAmountA?: number;
|
|
143
|
+
minAmountB?: number;
|
|
144
|
+
maxAmountB?: number;
|
|
145
|
+
minUsdVolume?: number;
|
|
146
|
+
maxUsdVolume?: number;
|
|
123
147
|
}
|
|
124
148
|
export interface GetLastSwapOrderResponse extends BaseResponse {
|
|
125
149
|
data: SwapOrderData[];
|
|
@@ -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":";;AA4HC,EAAE,CAAA"}
|
|
@@ -35,6 +35,8 @@ service WalletService {
|
|
|
35
35
|
rpc CreateWallet(CreateWalletRequest) returns (CreateWalletResponse);
|
|
36
36
|
// Get all wallets for current user
|
|
37
37
|
rpc GetUserWallets(GetUserWalletsRequest) returns (GetUserWalletsResponse);
|
|
38
|
+
// Withdraw from wallet
|
|
39
|
+
rpc Withdraw(WithdrawRequest) returns (WithdrawResponse);
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
// Common Entities
|
|
@@ -50,8 +52,9 @@ message User {
|
|
|
50
52
|
string referralCode = 7;
|
|
51
53
|
string parentId = 8;
|
|
52
54
|
string role = 9;
|
|
53
|
-
string
|
|
54
|
-
string
|
|
55
|
+
string mainWalletAddress = 10;
|
|
56
|
+
string createdAt = 11;
|
|
57
|
+
string updatedAt = 12;
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
// Token payload for authentication
|
|
@@ -312,3 +315,28 @@ message GetUserWalletsResponse {
|
|
|
312
315
|
message GetUserWalletsResponseData {
|
|
313
316
|
repeated Wallet wallets = 1;
|
|
314
317
|
}
|
|
318
|
+
|
|
319
|
+
// Withdraw messages
|
|
320
|
+
message WithdrawRequest {
|
|
321
|
+
string walletAddress = 1;
|
|
322
|
+
string toAddress = 2;
|
|
323
|
+
string coinType = 3;
|
|
324
|
+
string amount = 4;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
message WithdrawResponse {
|
|
328
|
+
bool success = 1;
|
|
329
|
+
string message = 2;
|
|
330
|
+
WithdrawResponseData data = 3;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
message WithdrawResponseData {
|
|
334
|
+
string id = 1;
|
|
335
|
+
Wallet wallet = 2;
|
|
336
|
+
string address = 3;
|
|
337
|
+
string coinType = 4;
|
|
338
|
+
string amount = 5;
|
|
339
|
+
string status = 6;
|
|
340
|
+
string createdAt = 7;
|
|
341
|
+
string updatedAt = 8;
|
|
342
|
+
}
|
|
@@ -32,14 +32,6 @@ message TokenData {
|
|
|
32
32
|
optional string creator = 12;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
// Stats data structure for PoolDataDetail
|
|
36
|
-
message StatsData {
|
|
37
|
-
map<string, string> volume = 1;
|
|
38
|
-
map<string, string> price = 2;
|
|
39
|
-
map<string, string> totalA2b = 3;
|
|
40
|
-
map<string, string> totalTx = 4;
|
|
41
|
-
map<string, string> totalMakers = 5;
|
|
42
|
-
}
|
|
43
35
|
|
|
44
36
|
// Pool data structure matching PoolData interface
|
|
45
37
|
message PoolData {
|
|
@@ -57,17 +49,55 @@ message PoolData {
|
|
|
57
49
|
|
|
58
50
|
// Pool data detail structure matching PoolDataDetail interface
|
|
59
51
|
message PoolDataDetail {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
double priceA = 1;
|
|
53
|
+
double priceB = 2;
|
|
54
|
+
string dex = 3;
|
|
55
|
+
optional string poolCreatedTime = 4;
|
|
56
|
+
TokenData tokenA = 5;
|
|
57
|
+
TokenData tokenB = 6;
|
|
58
|
+
string pool = 7;
|
|
59
|
+
bool aIsBase = 8;
|
|
60
|
+
double totalVolume = 9;
|
|
61
|
+
int32 totalTx = 10;
|
|
62
|
+
double totalA2b = 11;
|
|
63
|
+
double totalB2a = 12;
|
|
64
|
+
double totalMaker = 13;
|
|
65
|
+
double makerA2b = 14;
|
|
66
|
+
double makerB2a = 15;
|
|
67
|
+
double price5mAgo = 16;
|
|
68
|
+
double price60mAgo = 17;
|
|
69
|
+
double price360mAgo = 18;
|
|
70
|
+
double price1440mAgo = 19;
|
|
71
|
+
double totalVolumeA2b = 20;
|
|
72
|
+
double totalVolumeB2a = 21;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// List pool structure matching ListPool interface
|
|
76
|
+
message ListPool {
|
|
77
|
+
string pool = 1;
|
|
78
|
+
double totalVolume = 2;
|
|
79
|
+
int32 totalTx = 3;
|
|
80
|
+
double totalA2b = 4;
|
|
81
|
+
double totalB2a = 5;
|
|
82
|
+
double totalMaker = 6;
|
|
83
|
+
double makerA2b = 7;
|
|
84
|
+
double makerB2a = 8;
|
|
85
|
+
double lastVolume = 9;
|
|
86
|
+
double lastAmountA = 10;
|
|
87
|
+
double lastAmountB = 11;
|
|
88
|
+
double trendingScore = 12;
|
|
89
|
+
string id = 13;
|
|
90
|
+
TokenData tokenA = 14;
|
|
91
|
+
TokenData tokenB = 15;
|
|
92
|
+
optional string poolCreatedTime = 16;
|
|
93
|
+
double priceA = 17;
|
|
94
|
+
double priceB = 18;
|
|
95
|
+
string dex = 19;
|
|
96
|
+
double price5mAgo = 20;
|
|
97
|
+
double price60mAgo = 21;
|
|
98
|
+
double price360mAgo = 22;
|
|
99
|
+
double price1440mAgo = 23;
|
|
100
|
+
bool aIsBase = 24;
|
|
71
101
|
}
|
|
72
102
|
|
|
73
103
|
// Candle data structure matching CandleData interface
|
|
@@ -82,19 +112,19 @@ message CandleData {
|
|
|
82
112
|
|
|
83
113
|
// Swap order data structure matching SwapOrderData interface
|
|
84
114
|
message SwapOrderData {
|
|
85
|
-
|
|
86
|
-
string pool = 2;
|
|
87
|
-
string
|
|
88
|
-
string
|
|
89
|
-
string
|
|
90
|
-
string
|
|
91
|
-
string
|
|
92
|
-
string
|
|
93
|
-
|
|
94
|
-
string
|
|
95
|
-
|
|
96
|
-
string
|
|
97
|
-
string
|
|
115
|
+
string trader = 1; // LowCardinality(String)
|
|
116
|
+
string pool = 2; // LowCardinality(String)
|
|
117
|
+
string usdVolume = 3; // Decimal(18, 9)
|
|
118
|
+
string usdPrice = 4; // Decimal(18, 9)
|
|
119
|
+
string price = 5; // Decimal(18, 9)
|
|
120
|
+
string volume = 6; // Decimal(18, 9)
|
|
121
|
+
string transactionHash = 7; // FixedString(66)
|
|
122
|
+
string swapAt = 8; // DateTime (ISO string)
|
|
123
|
+
string type = 9; // Enum8: 'swap' | 'createPool' | 'addLiquidity' | 'removeLiquidity'
|
|
124
|
+
string a2b = 10; // Enum8: 'A2B' | 'B2A'
|
|
125
|
+
string amountA = 11; // UInt64
|
|
126
|
+
string amountB = 12; // UInt64
|
|
127
|
+
optional string liquidity = 13; // Nullable(UInt64)
|
|
98
128
|
}
|
|
99
129
|
|
|
100
130
|
// Trending token data structure
|
|
@@ -137,18 +167,22 @@ message GetPoolRequest {
|
|
|
137
167
|
message GetCandleChartRequest {
|
|
138
168
|
string pool = 1;
|
|
139
169
|
int32 resolution = 2;
|
|
140
|
-
|
|
141
|
-
|
|
170
|
+
int64 fromTime = 3;
|
|
171
|
+
int64 endTime = 4;
|
|
142
172
|
optional string type = 5; // 'usd' | 'token'
|
|
143
173
|
}
|
|
144
174
|
|
|
145
175
|
message GetLastSwapOrderRequest {
|
|
146
176
|
string poolAddress = 1;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
optional
|
|
150
|
-
optional
|
|
151
|
-
optional
|
|
177
|
+
int32 toTime = 2;
|
|
178
|
+
optional int32 limit = 3;
|
|
179
|
+
optional string type = 4;
|
|
180
|
+
optional double minAmountA = 5;
|
|
181
|
+
optional double maxAmountA = 6;
|
|
182
|
+
optional double minAmountB = 7;
|
|
183
|
+
optional double maxAmountB = 8;
|
|
184
|
+
optional double minUsdVolume = 9;
|
|
185
|
+
optional double maxUsdVolume = 10;
|
|
152
186
|
}
|
|
153
187
|
|
|
154
188
|
message GetTrendingTokensRequest {
|
|
@@ -176,31 +210,30 @@ message GetTopTradersByPoolRequest {
|
|
|
176
210
|
|
|
177
211
|
// Pool trader stats data structure matching PoolTraderStatsData interface
|
|
178
212
|
message PoolTraderStatsData {
|
|
179
|
-
string
|
|
180
|
-
|
|
181
|
-
double
|
|
182
|
-
double
|
|
183
|
-
double
|
|
184
|
-
double totalUsdB2a = 6;
|
|
213
|
+
string trader = 1;
|
|
214
|
+
double totalTxA2b = 2;
|
|
215
|
+
double totalTxB2a = 3;
|
|
216
|
+
double totalUsdA2b = 4;
|
|
217
|
+
double totalUsdB2a = 5;
|
|
185
218
|
}
|
|
186
219
|
|
|
187
220
|
// Response messages matching TypeScript interfaces with BaseResponse structure
|
|
188
221
|
message GetListPoolsResponse {
|
|
189
222
|
bool success = 1;
|
|
190
223
|
string message = 2;
|
|
191
|
-
repeated
|
|
224
|
+
repeated ListPool data = 3;
|
|
192
225
|
}
|
|
193
226
|
|
|
194
227
|
message GetNewPoolsResponse {
|
|
195
228
|
bool success = 1;
|
|
196
229
|
string message = 2;
|
|
197
|
-
repeated
|
|
230
|
+
repeated ListPool data = 3;
|
|
198
231
|
}
|
|
199
232
|
|
|
200
233
|
message GetPoolResponse {
|
|
201
234
|
bool success = 1;
|
|
202
235
|
string message = 2;
|
|
203
|
-
optional PoolDataDetail data = 3;
|
|
236
|
+
optional PoolDataDetail data = 3;
|
|
204
237
|
}
|
|
205
238
|
|
|
206
239
|
message GetCandleChartResponse {
|