@chainstream-io/sdk 0.1.26 → 0.2.2
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/chainstream-BYuhgvxX.d.cts +5539 -0
- package/dist/chainstream-BYuhgvxX.d.ts +5539 -0
- package/dist/chainstream.cjs +2263 -0
- package/dist/chainstream.cjs.map +1 -0
- package/dist/chainstream.d.cts +2 -0
- package/dist/chainstream.d.ts +2 -0
- package/dist/chainstream.mjs +2234 -0
- package/dist/chainstream.mjs.map +1 -0
- package/dist/index.cjs +2626 -7633
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +2462 -7635
- package/dist/index.mjs.map +1 -1
- package/dist/stream/index.cjs +751 -1126
- package/dist/stream/index.cjs.map +1 -1
- package/dist/stream/index.d.cts +2 -2
- package/dist/stream/index.d.ts +2 -2
- package/dist/stream/index.mjs +746 -1121
- package/dist/stream/index.mjs.map +1 -1
- package/package.json +64 -9
- package/README.md +0 -46
- package/dist/WatchlistApi-XN9Rn27y.d.cts +0 -10111
- package/dist/WatchlistApi-XN9Rn27y.d.ts +0 -10111
- package/dist/index-Bp5yAdv7.d.ts +0 -576
- package/dist/index-CA0E_3Hp.d.cts +0 -576
- package/dist/openapi/index.cjs +0 -11164
- package/dist/openapi/index.cjs.map +0 -1
- package/dist/openapi/index.d.cts +0 -135
- package/dist/openapi/index.d.ts +0 -135
- package/dist/openapi/index.mjs +0 -10535
- package/dist/openapi/index.mjs.map +0 -1
package/dist/stream/index.mjs
CHANGED
|
@@ -8,232 +8,248 @@ import { Centrifuge } from "@chainstream-io/centrifuge";
|
|
|
8
8
|
// src/stream/stream.fields.ts
|
|
9
9
|
var CEL_FIELD_MAPPINGS = {
|
|
10
10
|
// Wallet balance subscription fields
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
subscribeWalletBalance: {
|
|
12
|
+
walletAddress: "a",
|
|
13
|
+
tokenAddress: "ta",
|
|
14
|
+
tokenPriceInUsd: "tpiu",
|
|
15
|
+
balance: "b",
|
|
16
|
+
timestamp: "t"
|
|
17
17
|
},
|
|
18
18
|
// Token candles subscription fields
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
subscribeTokenCandles: {
|
|
20
|
+
open: "o",
|
|
21
|
+
close: "c",
|
|
22
|
+
high: "h",
|
|
23
|
+
low: "l",
|
|
24
|
+
volume: "v",
|
|
25
|
+
resolution: "r",
|
|
26
|
+
time: "t",
|
|
27
|
+
number: "n"
|
|
28
28
|
},
|
|
29
29
|
// Token stats subscription fields
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
30
|
+
subscribeTokenStats: {
|
|
31
|
+
address: "a",
|
|
32
|
+
timestamp: "t",
|
|
33
|
+
buys1m: "b1m",
|
|
34
|
+
sells1m: "s1m",
|
|
35
|
+
buyers1m: "be1m",
|
|
36
|
+
sellers1m: "se1m",
|
|
37
|
+
buyVolumeInUsd1m: "bviu1m",
|
|
38
|
+
sellVolumeInUsd1m: "sviu1m",
|
|
39
|
+
price1m: "p1m",
|
|
40
|
+
openInUsd1m: "oiu1m",
|
|
41
|
+
closeInUsd1m: "ciu1m",
|
|
42
|
+
buys5m: "b5m",
|
|
43
|
+
sells5m: "s5m",
|
|
44
|
+
buyers5m: "be5m",
|
|
45
|
+
sellers5m: "se5m",
|
|
46
|
+
buyVolumeInUsd5m: "bviu5m",
|
|
47
|
+
sellVolumeInUsd5m: "sviu5m",
|
|
48
|
+
price5m: "p5m",
|
|
49
|
+
openInUsd5m: "oiu5m",
|
|
50
|
+
closeInUsd5m: "ciu5m",
|
|
51
|
+
buys15m: "b15m",
|
|
52
|
+
sells15m: "s15m",
|
|
53
|
+
buyers15m: "be15m",
|
|
54
|
+
sellers15m: "se15m",
|
|
55
|
+
buyVolumeInUsd15m: "bviu15m",
|
|
56
|
+
sellVolumeInUsd15m: "sviu15m",
|
|
57
|
+
price15m: "p15m",
|
|
58
|
+
openInUsd15m: "oiu15m",
|
|
59
|
+
closeInUsd15m: "ciu15m",
|
|
60
|
+
buys30m: "b30m",
|
|
61
|
+
sells30m: "s30m",
|
|
62
|
+
buyers30m: "be30m",
|
|
63
|
+
sellers30m: "se30m",
|
|
64
|
+
buyVolumeInUsd30m: "bviu30m",
|
|
65
|
+
sellVolumeInUsd30m: "sviu30m",
|
|
66
|
+
price30m: "p30m",
|
|
67
|
+
openInUsd30m: "oiu30m",
|
|
68
|
+
closeInUsd30m: "ciu30m",
|
|
69
|
+
buys1h: "b1h",
|
|
70
|
+
sells1h: "s1h",
|
|
71
|
+
buyers1h: "be1h",
|
|
72
|
+
sellers1h: "se1h",
|
|
73
|
+
buyVolumeInUsd1h: "bviu1h",
|
|
74
|
+
sellVolumeInUsd1h: "sviu1h",
|
|
75
|
+
price1h: "p1h",
|
|
76
|
+
openInUsd1h: "oiu1h",
|
|
77
|
+
closeInUsd1h: "ciu1h",
|
|
78
|
+
buys4h: "b4h",
|
|
79
|
+
sells4h: "s4h",
|
|
80
|
+
buyers4h: "be4h",
|
|
81
|
+
sellers4h: "se4h",
|
|
82
|
+
buyVolumeInUsd4h: "bviu4h",
|
|
83
|
+
sellVolumeInUsd4h: "sviu4h",
|
|
84
|
+
price4h: "p4h",
|
|
85
|
+
openInUsd4h: "oiu4h",
|
|
86
|
+
closeInUsd4h: "ciu4h",
|
|
87
|
+
buys24h: "b24h",
|
|
88
|
+
sells24h: "s24h",
|
|
89
|
+
buyers24h: "be24h",
|
|
90
|
+
sellers24h: "se24h",
|
|
91
|
+
buyVolumeInUsd24h: "bviu24h",
|
|
92
|
+
sellVolumeInUsd24h: "sviu24h",
|
|
93
|
+
price24h: "p24h",
|
|
94
|
+
price: "p",
|
|
95
|
+
openInUsd24h: "oiu24h",
|
|
96
|
+
closeInUsd24h: "ciu24h"
|
|
97
97
|
},
|
|
98
98
|
// Token holder subscription fields
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
99
|
+
subscribeTokenHolders: {
|
|
100
|
+
tokenAddress: "a",
|
|
101
|
+
holders: "h",
|
|
102
|
+
top100HoldersAmount: "t100a",
|
|
103
|
+
top50HoldersAmount: "t50a",
|
|
104
|
+
top10HoldersAmount: "t10a",
|
|
105
|
+
top100Holders: "t100h",
|
|
106
|
+
top50Holders: "t50h",
|
|
107
|
+
top10Holders: "t10h",
|
|
108
|
+
top100HoldersRatio: "t100r",
|
|
109
|
+
top50HoldersRatio: "t50r",
|
|
110
|
+
top10HoldersRatio: "t10r",
|
|
111
|
+
creatorsHolders: "ch",
|
|
112
|
+
creatorsAmount: "ca",
|
|
113
|
+
creatorsRatio: "cr",
|
|
114
|
+
balanceTagFreshHolders: "btfh",
|
|
115
|
+
balanceTagFreshAmount: "btfa",
|
|
116
|
+
balanceTagFreshRatio: "btfr",
|
|
117
|
+
balanceTagSandwichHolders: "btsh",
|
|
118
|
+
balanceTagSandwichAmount: "btsa",
|
|
119
|
+
balanceTagSandwichRatio: "btsr",
|
|
120
|
+
balanceTagBundleHolders: "btbh",
|
|
121
|
+
balanceTagBundleAmount: "btba",
|
|
122
|
+
balanceTagBundleRatio: "btbr",
|
|
123
|
+
balanceTagSniperHolders: "btsnh",
|
|
124
|
+
balanceTagSniperAmount: "btsna",
|
|
125
|
+
balanceTagSniperRatio: "btsnr",
|
|
126
|
+
balanceTagDevHolders: "btdh",
|
|
127
|
+
balanceTagDevAmount: "btda",
|
|
128
|
+
balanceTagDevRatio: "btdr",
|
|
129
|
+
balanceTagProHolders: "btph",
|
|
130
|
+
balanceTagProAmount: "btpa",
|
|
131
|
+
balanceTagProRatio: "btpr",
|
|
132
|
+
balanceTagInsiderHolders: "btih",
|
|
133
|
+
balanceTagInsiderAmount: "btia",
|
|
134
|
+
balanceTagInsiderRatio: "btir",
|
|
135
|
+
balanceTagSmartHolders: "btsmh",
|
|
136
|
+
balanceTagSmartAmount: "btsma",
|
|
137
|
+
balanceTagSmartRatio: "btsmr",
|
|
138
|
+
balanceTagKolHolders: "btkh",
|
|
139
|
+
balanceTagKolAmount: "btka",
|
|
140
|
+
balanceTagKolRatio: "btkr",
|
|
141
|
+
balanceTagPhishingHolders: "btphh",
|
|
142
|
+
balanceTagPhishingAmount: "btpha",
|
|
143
|
+
balanceTagPhishingRatio: "btphr",
|
|
144
|
+
balanceTagBluechipHolders: "btblh",
|
|
145
|
+
balanceTagBluechipAmount: "btbla",
|
|
146
|
+
balanceTagBluechipRatio: "btblr",
|
|
147
|
+
balanceTagRatHolders: "btrh",
|
|
148
|
+
balanceTagRatAmount: "btra",
|
|
149
|
+
balanceTagRatRatio: "btrr",
|
|
150
|
+
timestamp: "ts"
|
|
151
151
|
},
|
|
152
152
|
// New token subscription fields
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
153
|
+
subscribeNewToken: {
|
|
154
|
+
tokenAddress: "a",
|
|
155
|
+
name: "n",
|
|
156
|
+
symbol: "s",
|
|
157
|
+
createdAtMs: "cts"
|
|
158
158
|
},
|
|
159
159
|
// Token supply subscription fields
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
subscribeTokenSupply: {
|
|
161
|
+
tokenAddress: "a",
|
|
162
|
+
supply: "s",
|
|
163
|
+
timestamp: "ts"
|
|
164
164
|
},
|
|
165
165
|
// Dex pool balance subscription fields
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
subscribeDexPoolBalance: {
|
|
167
|
+
poolAddress: "a",
|
|
168
|
+
tokenAAddress: "taa",
|
|
169
|
+
tokenALiquidityInUsd: "taliu",
|
|
170
|
+
tokenBAddress: "tba",
|
|
171
|
+
tokenBLiquidityInUsd: "tbliu"
|
|
172
172
|
},
|
|
173
173
|
// Token liquidity subscription fields
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
subscribeTokenLiquidity: {
|
|
175
|
+
tokenAddress: "a",
|
|
176
|
+
metricType: "t",
|
|
177
|
+
value: "v",
|
|
178
|
+
timestamp: "ts"
|
|
179
179
|
},
|
|
180
180
|
// New token metadata subscription fields
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
181
|
+
subscribeNewTokensMetadata: {
|
|
182
|
+
tokenAddress: "a",
|
|
183
|
+
name: "n",
|
|
184
|
+
symbol: "s",
|
|
185
|
+
imageUrl: "iu",
|
|
186
|
+
description: "de",
|
|
187
|
+
socialMedia: "sm",
|
|
188
|
+
createdAtMs: "cts"
|
|
189
189
|
},
|
|
190
190
|
// Token trades subscription fields
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
191
|
+
subscribeTokenTrades: {
|
|
192
|
+
tokenAddress: "a",
|
|
193
|
+
timestamp: "t",
|
|
194
|
+
kind: "k",
|
|
195
|
+
buyAmount: "ba",
|
|
196
|
+
buyAmountInUsd: "baiu",
|
|
197
|
+
buyTokenAddress: "btma",
|
|
198
|
+
buyTokenName: "btn",
|
|
199
|
+
buyTokenSymbol: "bts",
|
|
200
|
+
buyWalletAddress: "bwa",
|
|
201
|
+
sellAmount: "sa",
|
|
202
|
+
sellAmountInUsd: "saiu",
|
|
203
|
+
sellTokenAddress: "stma",
|
|
204
|
+
sellTokenName: "stn",
|
|
205
|
+
sellTokenSymbol: "sts",
|
|
206
|
+
sellWalletAddress: "swa",
|
|
207
|
+
txHash: "h"
|
|
208
208
|
},
|
|
209
209
|
// Wallet token PnL subscription fields
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
210
|
+
subscribeWalletPnl: {
|
|
211
|
+
walletAddress: "a",
|
|
212
|
+
tokenAddress: "ta",
|
|
213
|
+
tokenPriceInUsd: "tpiu",
|
|
214
|
+
timestamp: "t",
|
|
215
|
+
opentime: "ot",
|
|
216
|
+
lasttime: "lt",
|
|
217
|
+
closetime: "ct",
|
|
218
|
+
buyAmount: "ba",
|
|
219
|
+
buyAmountInUsd: "baiu",
|
|
220
|
+
buyCount: "bs",
|
|
221
|
+
buyCount30d: "bs30d",
|
|
222
|
+
buyCount7d: "bs7d",
|
|
223
|
+
sellAmount: "sa",
|
|
224
|
+
sellAmountInUsd: "saiu",
|
|
225
|
+
sellCount: "ss",
|
|
226
|
+
sellCount30d: "ss30d",
|
|
227
|
+
sellCount7d: "ss7d",
|
|
228
|
+
heldDurationTimestamp: "hdts",
|
|
229
|
+
averageBuyPriceInUsd: "abpiu",
|
|
230
|
+
averageSellPriceInUsd: "aspiu",
|
|
231
|
+
unrealizedProfitInUsd: "upiu",
|
|
232
|
+
unrealizedProfitRatio: "upr",
|
|
233
|
+
realizedProfitInUsd: "rpiu",
|
|
234
|
+
realizedProfitRatio: "rpr",
|
|
235
|
+
totalRealizedProfitInUsd: "trpiu",
|
|
236
|
+
totalRealizedProfitRatio: "trr"
|
|
237
|
+
},
|
|
238
|
+
// Token max liquidity subscription fields
|
|
239
|
+
subscribeTokenMaxLiquidity: {
|
|
240
|
+
tokenAddress: "a",
|
|
241
|
+
poolAddress: "p",
|
|
242
|
+
liquidityInUsd: "liu",
|
|
243
|
+
liquidityInNative: "lin",
|
|
244
|
+
timestamp: "ts"
|
|
245
|
+
},
|
|
246
|
+
// Token total liquidity subscription fields
|
|
247
|
+
subscribeTokenTotalLiquidity: {
|
|
248
|
+
tokenAddress: "a",
|
|
249
|
+
liquidityInUsd: "liu",
|
|
250
|
+
liquidityInNative: "lin",
|
|
251
|
+
poolCount: "pc",
|
|
252
|
+
timestamp: "ts"
|
|
237
253
|
}
|
|
238
254
|
};
|
|
239
255
|
function getFieldMappings(methodName) {
|
|
@@ -371,20 +387,20 @@ var StreamApi = class {
|
|
|
371
387
|
*/
|
|
372
388
|
batchSubscribe(batchFunction) {
|
|
373
389
|
this.startBatching();
|
|
374
|
-
const
|
|
390
|
+
const unsubscribables = batchFunction();
|
|
375
391
|
this.stopBatching();
|
|
376
|
-
return
|
|
392
|
+
return unsubscribables;
|
|
377
393
|
}
|
|
378
394
|
/**
|
|
379
395
|
* Batch unsubscribe method that accepts an array of unsubscribe functions
|
|
380
396
|
* All unsubscribe calls will be executed at once
|
|
381
|
-
* @param
|
|
397
|
+
* @param unsubscribables Array of unsubscribe functions to execute
|
|
382
398
|
*/
|
|
383
|
-
batchUnsubscribe(
|
|
384
|
-
if (!
|
|
399
|
+
batchUnsubscribe(unsubscribables) {
|
|
400
|
+
if (!unsubscribables || unsubscribables.length === 0) {
|
|
385
401
|
return;
|
|
386
402
|
}
|
|
387
|
-
|
|
403
|
+
unsubscribables.forEach((unsub) => {
|
|
388
404
|
if (unsub && typeof unsub.unsubscribe === "function") {
|
|
389
405
|
unsub.unsubscribe();
|
|
390
406
|
}
|
|
@@ -416,7 +432,7 @@ var StreamApi = class {
|
|
|
416
432
|
}).subscribe();
|
|
417
433
|
}
|
|
418
434
|
});
|
|
419
|
-
return new
|
|
435
|
+
return new StreamUnsubscribable(this, channel, fn);
|
|
420
436
|
}
|
|
421
437
|
unsubscribe(channel, fn) {
|
|
422
438
|
const listeners = this.listenersMap.get(channel);
|
|
@@ -455,18 +471,23 @@ var StreamApi = class {
|
|
|
455
471
|
filter
|
|
456
472
|
}) {
|
|
457
473
|
const channel = `dex-candle:${chain}_${tokenAddress}_${resolution}`;
|
|
458
|
-
return this.subscribe(
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
474
|
+
return this.subscribe(
|
|
475
|
+
channel,
|
|
476
|
+
(data) => {
|
|
477
|
+
callback({
|
|
478
|
+
open: data.o,
|
|
479
|
+
close: data.c,
|
|
480
|
+
high: data.h,
|
|
481
|
+
low: data.l,
|
|
482
|
+
volume: data.v,
|
|
483
|
+
resolution: data.r,
|
|
484
|
+
time: data.t,
|
|
485
|
+
number: data.n
|
|
486
|
+
});
|
|
487
|
+
},
|
|
488
|
+
filter,
|
|
489
|
+
"subscribeTokenCandles"
|
|
490
|
+
);
|
|
470
491
|
}
|
|
471
492
|
subscribeTokenStats({
|
|
472
493
|
chain,
|
|
@@ -475,74 +496,79 @@ var StreamApi = class {
|
|
|
475
496
|
filter
|
|
476
497
|
}) {
|
|
477
498
|
const channel = `dex-token-stats:${chain}_${tokenAddress}`;
|
|
478
|
-
return this.subscribe(
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
499
|
+
return this.subscribe(
|
|
500
|
+
channel,
|
|
501
|
+
(data) => callback({
|
|
502
|
+
address: data.a,
|
|
503
|
+
timestamp: data.t,
|
|
504
|
+
buys1m: data.b1m,
|
|
505
|
+
sells1m: data.s1m,
|
|
506
|
+
buyers1m: data.be1m,
|
|
507
|
+
sellers1m: data.se1m,
|
|
508
|
+
buyVolumeInUsd1m: this.formatScientificNotation(data.bviu1m),
|
|
509
|
+
sellVolumeInUsd1m: this.formatScientificNotation(data.sviu1m),
|
|
510
|
+
price1m: this.formatScientificNotation(data.p1m),
|
|
511
|
+
openInUsd1m: this.formatScientificNotation(data.oiu1m),
|
|
512
|
+
closeInUsd1m: this.formatScientificNotation(data.ciu1m),
|
|
513
|
+
buys5m: data.b5m,
|
|
514
|
+
sells5m: data.s5m,
|
|
515
|
+
buyers5m: data.be5m,
|
|
516
|
+
sellers5m: data.se5m,
|
|
517
|
+
buyVolumeInUsd5m: this.formatScientificNotation(data.bviu5m),
|
|
518
|
+
sellVolumeInUsd5m: this.formatScientificNotation(data.sviu5m),
|
|
519
|
+
price5m: this.formatScientificNotation(data.p5m),
|
|
520
|
+
openInUsd5m: this.formatScientificNotation(data.oiu5m),
|
|
521
|
+
closeInUsd5m: this.formatScientificNotation(data.ciu5m),
|
|
522
|
+
buys15m: data.b15m,
|
|
523
|
+
sells15m: data.s15m,
|
|
524
|
+
buyers15m: data.be15m,
|
|
525
|
+
sellers15m: data.se15m,
|
|
526
|
+
buyVolumeInUsd15m: this.formatScientificNotation(data.bviu15m),
|
|
527
|
+
sellVolumeInUsd15m: this.formatScientificNotation(data.sviu15m),
|
|
528
|
+
price15m: this.formatScientificNotation(data.p15m),
|
|
529
|
+
openInUsd15m: this.formatScientificNotation(data.oiu15m),
|
|
530
|
+
closeInUsd15m: this.formatScientificNotation(data.ciu15m),
|
|
531
|
+
buys30m: data.b30m,
|
|
532
|
+
sells30m: data.s30m,
|
|
533
|
+
buyers30m: data.be30m,
|
|
534
|
+
sellers30m: data.se30m,
|
|
535
|
+
buyVolumeInUsd30m: this.formatScientificNotation(data.bviu30m),
|
|
536
|
+
sellVolumeInUsd30m: this.formatScientificNotation(data.sviu30m),
|
|
537
|
+
price30m: this.formatScientificNotation(data.p30m),
|
|
538
|
+
openInUsd30m: this.formatScientificNotation(data.oiu30m),
|
|
539
|
+
closeInUsd30m: this.formatScientificNotation(data.ciu30m),
|
|
540
|
+
buys1h: data.b1h,
|
|
541
|
+
sells1h: data.s1h,
|
|
542
|
+
buyers1h: data.be1h,
|
|
543
|
+
sellers1h: data.se1h,
|
|
544
|
+
buyVolumeInUsd1h: this.formatScientificNotation(data.bviu1h),
|
|
545
|
+
sellVolumeInUsd1h: this.formatScientificNotation(data.sviu1h),
|
|
546
|
+
price1h: this.formatScientificNotation(data.p1h),
|
|
547
|
+
openInUsd1h: this.formatScientificNotation(data.oiu1h),
|
|
548
|
+
closeInUsd1h: this.formatScientificNotation(data.ciu1h),
|
|
549
|
+
buys4h: data.b4h,
|
|
550
|
+
sells4h: data.s4h,
|
|
551
|
+
buyers4h: data.be4h,
|
|
552
|
+
sellers4h: data.se4h,
|
|
553
|
+
buyVolumeInUsd4h: this.formatScientificNotation(data.bviu4h),
|
|
554
|
+
sellVolumeInUsd4h: this.formatScientificNotation(data.sviu4h),
|
|
555
|
+
price4h: this.formatScientificNotation(data.p4h),
|
|
556
|
+
openInUsd4h: this.formatScientificNotation(data.oiu4h),
|
|
557
|
+
closeInUsd4h: this.formatScientificNotation(data.ciu4h),
|
|
558
|
+
buys24h: data.b24h,
|
|
559
|
+
sells24h: data.s24h,
|
|
560
|
+
buyers24h: data.be24h,
|
|
561
|
+
sellers24h: data.se24h,
|
|
562
|
+
buyVolumeInUsd24h: this.formatScientificNotation(data.bviu24h),
|
|
563
|
+
sellVolumeInUsd24h: this.formatScientificNotation(data.sviu24h),
|
|
564
|
+
price24h: this.formatScientificNotation(data.p24h),
|
|
565
|
+
openInUsd24h: this.formatScientificNotation(data.oiu24h),
|
|
566
|
+
closeInUsd24h: this.formatScientificNotation(data.ciu24h),
|
|
567
|
+
price: this.formatScientificNotation(data.p)
|
|
568
|
+
}),
|
|
569
|
+
filter,
|
|
570
|
+
"subscribeTokenStats"
|
|
571
|
+
);
|
|
546
572
|
}
|
|
547
573
|
subscribeTokenHolders({
|
|
548
574
|
chain,
|
|
@@ -551,59 +577,64 @@ var StreamApi = class {
|
|
|
551
577
|
filter
|
|
552
578
|
}) {
|
|
553
579
|
const channel = `dex-token-holding:${chain}_${tokenAddress}`;
|
|
554
|
-
return this.subscribe(
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
580
|
+
return this.subscribe(
|
|
581
|
+
channel,
|
|
582
|
+
(data) => callback({
|
|
583
|
+
tokenAddress: data.a,
|
|
584
|
+
holders: data.h,
|
|
585
|
+
top100HoldersAmount: this.formatScientificNotation(data.t100a),
|
|
586
|
+
top50HoldersAmount: this.formatScientificNotation(data.t50a),
|
|
587
|
+
top10HoldersAmount: this.formatScientificNotation(data.t10a),
|
|
588
|
+
top100Holders: data.t100h,
|
|
589
|
+
top50Holders: data.t50h,
|
|
590
|
+
top10Holders: data.t10h,
|
|
591
|
+
top100HoldersRatio: this.formatScientificNotation(data.t100r),
|
|
592
|
+
top50HoldersRatio: this.formatScientificNotation(data.t50r),
|
|
593
|
+
top10HoldersRatio: this.formatScientificNotation(data.t10r),
|
|
594
|
+
creatorsHolders: data.ch,
|
|
595
|
+
creatorsAmount: this.formatScientificNotation(data.ca),
|
|
596
|
+
creatorsRatio: this.formatScientificNotation(data.cr),
|
|
597
|
+
balanceTagFreshHolders: data.btfh,
|
|
598
|
+
balanceTagFreshAmount: this.formatScientificNotation(data.btfa),
|
|
599
|
+
balanceTagFreshRatio: this.formatScientificNotation(data.btfr),
|
|
600
|
+
balanceTagSandwichHolders: data.btsh,
|
|
601
|
+
balanceTagSandwichAmount: this.formatScientificNotation(data.btsa),
|
|
602
|
+
balanceTagSandwichRatio: this.formatScientificNotation(data.btsr),
|
|
603
|
+
balanceTagBundleHolders: data.btbh,
|
|
604
|
+
balanceTagBundleAmount: this.formatScientificNotation(data.btba),
|
|
605
|
+
balanceTagBundleRatio: this.formatScientificNotation(data.btbr),
|
|
606
|
+
balanceTagSniperHolders: data.btsnh,
|
|
607
|
+
balanceTagSniperAmount: this.formatScientificNotation(data.btsna),
|
|
608
|
+
balanceTagSniperRatio: this.formatScientificNotation(data.btsnr),
|
|
609
|
+
balanceTagDevHolders: data.btdh,
|
|
610
|
+
balanceTagDevAmount: this.formatScientificNotation(data.btda),
|
|
611
|
+
balanceTagDevRatio: this.formatScientificNotation(data.btdr),
|
|
612
|
+
balanceTagProHolders: data.btph,
|
|
613
|
+
balanceTagProAmount: this.formatScientificNotation(data.btpa),
|
|
614
|
+
balanceTagProRatio: this.formatScientificNotation(data.btpr),
|
|
615
|
+
balanceTagInsiderHolders: data.btih,
|
|
616
|
+
balanceTagInsiderAmount: this.formatScientificNotation(data.btia),
|
|
617
|
+
balanceTagInsiderRatio: this.formatScientificNotation(data.btir),
|
|
618
|
+
balanceTagSmartHolders: data.btsmh,
|
|
619
|
+
balanceTagSmartAmount: this.formatScientificNotation(data.btsma),
|
|
620
|
+
balanceTagSmartRatio: this.formatScientificNotation(data.btsmr),
|
|
621
|
+
balanceTagKolHolders: data.btkh,
|
|
622
|
+
balanceTagKolAmount: this.formatScientificNotation(data.btka),
|
|
623
|
+
balanceTagKolRatio: this.formatScientificNotation(data.btkr),
|
|
624
|
+
balanceTagPhishingHolders: data.btphh,
|
|
625
|
+
balanceTagPhishingAmount: this.formatScientificNotation(data.btpha),
|
|
626
|
+
balanceTagPhishingRatio: this.formatScientificNotation(data.btphr),
|
|
627
|
+
balanceTagBluechipHolders: data.btblh,
|
|
628
|
+
balanceTagBluechipAmount: this.formatScientificNotation(data.btbla),
|
|
629
|
+
balanceTagBluechipRatio: this.formatScientificNotation(data.btblr),
|
|
630
|
+
balanceTagRatHolders: data.btrh,
|
|
631
|
+
balanceTagRatAmount: this.formatScientificNotation(data.btra),
|
|
632
|
+
balanceTagRatRatio: this.formatScientificNotation(data.btrr),
|
|
633
|
+
timestamp: data.ts
|
|
634
|
+
}),
|
|
635
|
+
filter,
|
|
636
|
+
"subscribeTokenHolders"
|
|
637
|
+
);
|
|
607
638
|
}
|
|
608
639
|
subscribeNewToken({
|
|
609
640
|
chain,
|
|
@@ -611,30 +642,36 @@ var StreamApi = class {
|
|
|
611
642
|
filter
|
|
612
643
|
}) {
|
|
613
644
|
const channel = `dex-new-token:${chain}`;
|
|
614
|
-
return this.subscribe(
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
result.launchFrom = {};
|
|
626
|
-
if (data.lf.pa) {
|
|
627
|
-
result.launchFrom.programAddress = data.lf.pa;
|
|
628
|
-
}
|
|
629
|
-
if (data.lf.pf) {
|
|
630
|
-
result.launchFrom.protocolFamily = data.lf.pf;
|
|
645
|
+
return this.subscribe(
|
|
646
|
+
channel,
|
|
647
|
+
(data) => {
|
|
648
|
+
const result = {
|
|
649
|
+
tokenAddress: data.a,
|
|
650
|
+
name: data.n,
|
|
651
|
+
symbol: data.s,
|
|
652
|
+
createdAtMs: data.cts
|
|
653
|
+
};
|
|
654
|
+
if (data.dec) {
|
|
655
|
+
result.decimals = data.dec;
|
|
631
656
|
}
|
|
632
|
-
if (data.lf
|
|
633
|
-
|
|
657
|
+
if (data.lf) {
|
|
658
|
+
const lf = data.lf;
|
|
659
|
+
result.launchFrom = {};
|
|
660
|
+
if (lf.pa) {
|
|
661
|
+
result.launchFrom.programAddress = lf.pa;
|
|
662
|
+
}
|
|
663
|
+
if (lf.pf) {
|
|
664
|
+
result.launchFrom.protocolFamily = lf.pf;
|
|
665
|
+
}
|
|
666
|
+
if (lf.pn) {
|
|
667
|
+
result.launchFrom.protocolName = lf.pn;
|
|
668
|
+
}
|
|
634
669
|
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
670
|
+
callback(result);
|
|
671
|
+
},
|
|
672
|
+
filter,
|
|
673
|
+
"subscribeNewToken"
|
|
674
|
+
);
|
|
638
675
|
}
|
|
639
676
|
subscribeNewTokensMetadata({
|
|
640
677
|
chain,
|
|
@@ -644,85 +681,36 @@ var StreamApi = class {
|
|
|
644
681
|
return this.subscribe(
|
|
645
682
|
channel,
|
|
646
683
|
(data) => callback(
|
|
647
|
-
data.map(
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
if (it.sm?.gh) {
|
|
675
|
-
socialMedia.github = it.sm.gh;
|
|
676
|
-
}
|
|
677
|
-
if (it.sm?.ig) {
|
|
678
|
-
socialMedia.instagram = it.sm.ig;
|
|
679
|
-
}
|
|
680
|
-
if (it.sm?.li) {
|
|
681
|
-
socialMedia.linkedin = it.sm.li;
|
|
682
|
-
}
|
|
683
|
-
if (it.sm?.md) {
|
|
684
|
-
socialMedia.medium = it.sm.md;
|
|
685
|
-
}
|
|
686
|
-
if (it.sm?.rd) {
|
|
687
|
-
socialMedia.reddit = it.sm.rd;
|
|
688
|
-
}
|
|
689
|
-
if (it.sm?.yt) {
|
|
690
|
-
socialMedia.youtube = it.sm.yt;
|
|
691
|
-
}
|
|
692
|
-
if (it.sm?.bb) {
|
|
693
|
-
socialMedia.bitbucket = it.sm.bb;
|
|
694
|
-
}
|
|
695
|
-
return socialMedia;
|
|
696
|
-
})(),
|
|
697
|
-
createdAtMs: it.cts
|
|
698
|
-
})
|
|
699
|
-
)
|
|
684
|
+
data.map((it) => ({
|
|
685
|
+
tokenAddress: it.a,
|
|
686
|
+
name: it.n,
|
|
687
|
+
symbol: it.s,
|
|
688
|
+
imageUrl: it.iu,
|
|
689
|
+
description: it.de,
|
|
690
|
+
socialMedia: (() => {
|
|
691
|
+
const sm = it.sm;
|
|
692
|
+
if (!sm) return void 0;
|
|
693
|
+
return {
|
|
694
|
+
twitter: sm.tw,
|
|
695
|
+
telegram: sm.tg,
|
|
696
|
+
website: sm.w,
|
|
697
|
+
tiktok: sm.tt,
|
|
698
|
+
discord: sm.dc,
|
|
699
|
+
facebook: sm.fb,
|
|
700
|
+
github: sm.gh,
|
|
701
|
+
instagram: sm.ig,
|
|
702
|
+
linkedin: sm.li,
|
|
703
|
+
medium: sm.md,
|
|
704
|
+
reddit: sm.rd,
|
|
705
|
+
youtube: sm.yt,
|
|
706
|
+
bitbucket: sm.bb
|
|
707
|
+
};
|
|
708
|
+
})(),
|
|
709
|
+
createdAtMs: it.cts
|
|
710
|
+
}))
|
|
700
711
|
)
|
|
701
712
|
);
|
|
702
713
|
}
|
|
703
|
-
// subscribeNewTokens({
|
|
704
|
-
// chain,
|
|
705
|
-
// callback,
|
|
706
|
-
// }: {
|
|
707
|
-
// chain: string;
|
|
708
|
-
// callback: (data: NewToken[]) => void;
|
|
709
|
-
// }): Unsubscrible {
|
|
710
|
-
// const channel = `dex-new-tokens:${chain}`;
|
|
711
|
-
// return this.subscribe(channel, (data: any[]) =>
|
|
712
|
-
// callback(
|
|
713
|
-
// data.map(
|
|
714
|
-
// (it: any) =>
|
|
715
|
-
// ({
|
|
716
|
-
// tokenAddress: it.a,
|
|
717
|
-
// name: it.n,
|
|
718
|
-
// symbol: it.s,
|
|
719
|
-
// description: it.de,
|
|
720
|
-
// createdAtMs: it.cts,
|
|
721
|
-
// }) as NewToken
|
|
722
|
-
// )
|
|
723
|
-
// )
|
|
724
|
-
// );
|
|
725
|
-
// }
|
|
726
714
|
subscribeTokenSupply({
|
|
727
715
|
chain,
|
|
728
716
|
tokenAddress,
|
|
@@ -730,12 +718,17 @@ var StreamApi = class {
|
|
|
730
718
|
filter
|
|
731
719
|
}) {
|
|
732
720
|
const channel = `dex-token-supply:${chain}_${tokenAddress}`;
|
|
733
|
-
return this.subscribe(
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
721
|
+
return this.subscribe(
|
|
722
|
+
channel,
|
|
723
|
+
(data) => callback({
|
|
724
|
+
tokenAddress: data.a,
|
|
725
|
+
supply: data.s,
|
|
726
|
+
marketCapInUsd: data.mc,
|
|
727
|
+
timestamp: data.ts
|
|
728
|
+
}),
|
|
729
|
+
filter,
|
|
730
|
+
"subscribeTokenSupply"
|
|
731
|
+
);
|
|
739
732
|
}
|
|
740
733
|
subscribeTokenLiquidity({
|
|
741
734
|
chain,
|
|
@@ -744,12 +737,17 @@ var StreamApi = class {
|
|
|
744
737
|
filter
|
|
745
738
|
}) {
|
|
746
739
|
const channel = `dex-token-general-stat-num:${chain}_${tokenAddress}`;
|
|
747
|
-
return this.subscribe(
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
740
|
+
return this.subscribe(
|
|
741
|
+
channel,
|
|
742
|
+
(data) => callback({
|
|
743
|
+
tokenAddress: data.a,
|
|
744
|
+
metricType: data.t,
|
|
745
|
+
value: data.v,
|
|
746
|
+
timestamp: data.ts
|
|
747
|
+
}),
|
|
748
|
+
filter,
|
|
749
|
+
"subscribeTokenLiquidity"
|
|
750
|
+
);
|
|
753
751
|
}
|
|
754
752
|
/**
|
|
755
753
|
* Subscribe to token max liquidity updates
|
|
@@ -763,13 +761,18 @@ var StreamApi = class {
|
|
|
763
761
|
filter
|
|
764
762
|
}) {
|
|
765
763
|
const channel = `dex-token-liquidity:${chain}_${tokenAddress}`;
|
|
766
|
-
return this.subscribe(
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
764
|
+
return this.subscribe(
|
|
765
|
+
channel,
|
|
766
|
+
(data) => callback({
|
|
767
|
+
tokenAddress: data.a,
|
|
768
|
+
poolAddress: data.p,
|
|
769
|
+
liquidityInUsd: data.liu,
|
|
770
|
+
liquidityInNative: data.lin,
|
|
771
|
+
timestamp: data.ts
|
|
772
|
+
}),
|
|
773
|
+
filter,
|
|
774
|
+
"subscribeTokenMaxLiquidity"
|
|
775
|
+
);
|
|
773
776
|
}
|
|
774
777
|
/**
|
|
775
778
|
* Subscribe to token total liquidity updates
|
|
@@ -783,13 +786,18 @@ var StreamApi = class {
|
|
|
783
786
|
filter
|
|
784
787
|
}) {
|
|
785
788
|
const channel = `dex-token-total-liquidity:${chain}_${tokenAddress}`;
|
|
786
|
-
return this.subscribe(
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
789
|
+
return this.subscribe(
|
|
790
|
+
channel,
|
|
791
|
+
(data) => callback({
|
|
792
|
+
tokenAddress: data.a,
|
|
793
|
+
liquidityInUsd: data.liu,
|
|
794
|
+
liquidityInNative: data.lin,
|
|
795
|
+
poolCount: data.pc,
|
|
796
|
+
timestamp: data.ts
|
|
797
|
+
}),
|
|
798
|
+
filter,
|
|
799
|
+
"subscribeTokenTotalLiquidity"
|
|
800
|
+
);
|
|
793
801
|
}
|
|
794
802
|
subscribeRankingTokensLiquidity({
|
|
795
803
|
chain,
|
|
@@ -800,14 +808,12 @@ var StreamApi = class {
|
|
|
800
808
|
return this.subscribe(
|
|
801
809
|
channel,
|
|
802
810
|
(data) => callback(
|
|
803
|
-
data?.map(
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
})
|
|
810
|
-
)
|
|
811
|
+
data?.map((it) => ({
|
|
812
|
+
tokenAddress: it.a,
|
|
813
|
+
metricType: it.t,
|
|
814
|
+
value: it.v,
|
|
815
|
+
timestamp: it.ts
|
|
816
|
+
}))
|
|
811
817
|
)
|
|
812
818
|
);
|
|
813
819
|
}
|
|
@@ -823,465 +829,185 @@ var StreamApi = class {
|
|
|
823
829
|
(data) => callback(
|
|
824
830
|
data?.map((item) => {
|
|
825
831
|
const result = {};
|
|
826
|
-
|
|
832
|
+
const t = item.t;
|
|
833
|
+
const bc = item.bc;
|
|
834
|
+
const h = item.h;
|
|
835
|
+
const s = item.s;
|
|
836
|
+
const ts = item.ts;
|
|
837
|
+
if (t) {
|
|
827
838
|
result.metadata = {
|
|
828
|
-
tokenAddress:
|
|
839
|
+
tokenAddress: t.a
|
|
829
840
|
};
|
|
830
|
-
if (
|
|
831
|
-
result.metadata.name =
|
|
841
|
+
if (t.n) {
|
|
842
|
+
result.metadata.name = t.n;
|
|
832
843
|
}
|
|
833
|
-
if (
|
|
834
|
-
result.metadata.symbol =
|
|
844
|
+
if (t.s) {
|
|
845
|
+
result.metadata.symbol = t.s;
|
|
835
846
|
}
|
|
836
|
-
if (
|
|
837
|
-
result.metadata.imageUrl =
|
|
847
|
+
if (t.iu) {
|
|
848
|
+
result.metadata.imageUrl = t.iu;
|
|
838
849
|
}
|
|
839
|
-
if (
|
|
840
|
-
result.metadata.description =
|
|
850
|
+
if (t.de) {
|
|
851
|
+
result.metadata.description = t.de;
|
|
841
852
|
}
|
|
842
|
-
if (
|
|
843
|
-
result.metadata.decimals =
|
|
853
|
+
if (t.dec) {
|
|
854
|
+
result.metadata.decimals = t.dec;
|
|
844
855
|
}
|
|
845
|
-
if (
|
|
846
|
-
result.metadata.createdAtMs =
|
|
856
|
+
if (t.cts) {
|
|
857
|
+
result.metadata.createdAtMs = t.cts;
|
|
847
858
|
}
|
|
848
|
-
if (
|
|
859
|
+
if (t.lf) {
|
|
860
|
+
const lf = t.lf;
|
|
849
861
|
result.metadata.launchFrom = {};
|
|
850
|
-
if (
|
|
851
|
-
result.metadata.launchFrom.programAddress =
|
|
862
|
+
if (lf.pa) {
|
|
863
|
+
result.metadata.launchFrom.programAddress = lf.pa;
|
|
852
864
|
}
|
|
853
|
-
if (
|
|
854
|
-
result.metadata.launchFrom.protocolFamily =
|
|
865
|
+
if (lf.pf) {
|
|
866
|
+
result.metadata.launchFrom.protocolFamily = lf.pf;
|
|
855
867
|
}
|
|
856
|
-
if (
|
|
857
|
-
result.metadata.launchFrom.protocolName =
|
|
868
|
+
if (lf.pn) {
|
|
869
|
+
result.metadata.launchFrom.protocolName = lf.pn;
|
|
858
870
|
}
|
|
859
871
|
}
|
|
860
|
-
if (
|
|
872
|
+
if (t.mt) {
|
|
873
|
+
const mt = t.mt;
|
|
861
874
|
result.metadata.migratedTo = {};
|
|
862
|
-
if (
|
|
863
|
-
result.metadata.migratedTo.programAddress =
|
|
875
|
+
if (mt.pa) {
|
|
876
|
+
result.metadata.migratedTo.programAddress = mt.pa;
|
|
864
877
|
}
|
|
865
|
-
if (
|
|
866
|
-
result.metadata.migratedTo.protocolFamily =
|
|
878
|
+
if (mt.pf) {
|
|
879
|
+
result.metadata.migratedTo.protocolFamily = mt.pf;
|
|
867
880
|
}
|
|
868
|
-
if (
|
|
869
|
-
result.metadata.migratedTo.protocolName =
|
|
881
|
+
if (mt.pn) {
|
|
882
|
+
result.metadata.migratedTo.protocolName = mt.pn;
|
|
870
883
|
}
|
|
871
884
|
}
|
|
872
|
-
if (
|
|
885
|
+
if (t.sm) {
|
|
886
|
+
const sm = t.sm;
|
|
873
887
|
result.metadata.socialMedia = {};
|
|
874
|
-
if (
|
|
875
|
-
result.metadata.socialMedia.twitter =
|
|
888
|
+
if (sm.tw) {
|
|
889
|
+
result.metadata.socialMedia.twitter = sm.tw;
|
|
876
890
|
}
|
|
877
|
-
if (
|
|
878
|
-
result.metadata.socialMedia.telegram =
|
|
891
|
+
if (sm.tg) {
|
|
892
|
+
result.metadata.socialMedia.telegram = sm.tg;
|
|
879
893
|
}
|
|
880
|
-
if (
|
|
881
|
-
result.metadata.socialMedia.website =
|
|
894
|
+
if (sm.w) {
|
|
895
|
+
result.metadata.socialMedia.website = sm.w;
|
|
882
896
|
}
|
|
883
|
-
if (
|
|
884
|
-
result.metadata.socialMedia.tiktok =
|
|
897
|
+
if (sm.tt) {
|
|
898
|
+
result.metadata.socialMedia.tiktok = sm.tt;
|
|
885
899
|
}
|
|
886
|
-
if (
|
|
887
|
-
result.metadata.socialMedia.discord =
|
|
900
|
+
if (sm.dc) {
|
|
901
|
+
result.metadata.socialMedia.discord = sm.dc;
|
|
888
902
|
}
|
|
889
|
-
if (
|
|
890
|
-
result.metadata.socialMedia.facebook =
|
|
903
|
+
if (sm.fb) {
|
|
904
|
+
result.metadata.socialMedia.facebook = sm.fb;
|
|
891
905
|
}
|
|
892
|
-
if (
|
|
893
|
-
result.metadata.socialMedia.github =
|
|
906
|
+
if (sm.gh) {
|
|
907
|
+
result.metadata.socialMedia.github = sm.gh;
|
|
894
908
|
}
|
|
895
|
-
if (
|
|
896
|
-
result.metadata.socialMedia.instagram =
|
|
909
|
+
if (sm.ig) {
|
|
910
|
+
result.metadata.socialMedia.instagram = sm.ig;
|
|
897
911
|
}
|
|
898
|
-
if (
|
|
899
|
-
result.metadata.socialMedia.linkedin =
|
|
912
|
+
if (sm.li) {
|
|
913
|
+
result.metadata.socialMedia.linkedin = sm.li;
|
|
900
914
|
}
|
|
901
|
-
if (
|
|
902
|
-
result.metadata.socialMedia.medium =
|
|
915
|
+
if (sm.md) {
|
|
916
|
+
result.metadata.socialMedia.medium = sm.md;
|
|
903
917
|
}
|
|
904
|
-
if (
|
|
905
|
-
result.metadata.socialMedia.reddit =
|
|
918
|
+
if (sm.rd) {
|
|
919
|
+
result.metadata.socialMedia.reddit = sm.rd;
|
|
906
920
|
}
|
|
907
|
-
if (
|
|
908
|
-
result.metadata.socialMedia.youtube =
|
|
921
|
+
if (sm.yt) {
|
|
922
|
+
result.metadata.socialMedia.youtube = sm.yt;
|
|
909
923
|
}
|
|
910
|
-
if (
|
|
911
|
-
result.metadata.socialMedia.bitbucket =
|
|
924
|
+
if (sm.bb) {
|
|
925
|
+
result.metadata.socialMedia.bitbucket = sm.bb;
|
|
912
926
|
}
|
|
913
927
|
}
|
|
914
|
-
if (item.t.cts) {
|
|
915
|
-
result.metadata.createdAtMs = item.t.cts;
|
|
916
|
-
}
|
|
917
928
|
}
|
|
918
|
-
if (
|
|
929
|
+
if (bc) {
|
|
919
930
|
result.bondingCurve = {};
|
|
920
|
-
if (
|
|
921
|
-
result.bondingCurve.progressRatio = this.formatScientificNotation(
|
|
931
|
+
if (bc.pr) {
|
|
932
|
+
result.bondingCurve.progressRatio = this.formatScientificNotation(bc.pr);
|
|
922
933
|
}
|
|
923
934
|
}
|
|
924
|
-
if (
|
|
935
|
+
if (h) {
|
|
925
936
|
result.holder = {
|
|
926
|
-
tokenAddress:
|
|
927
|
-
timestamp:
|
|
937
|
+
tokenAddress: h.a,
|
|
938
|
+
timestamp: h.ts || 0
|
|
928
939
|
};
|
|
929
|
-
if (
|
|
930
|
-
result.holder.holders =
|
|
931
|
-
}
|
|
932
|
-
if (item.h.t100a) {
|
|
933
|
-
result.holder.top100HoldersAmount = this.formatScientificNotation(item.h.t100a);
|
|
934
|
-
}
|
|
935
|
-
if (item.h.t50a) {
|
|
936
|
-
result.holder.top50HoldersAmount = this.formatScientificNotation(item.h.t50a);
|
|
937
|
-
}
|
|
938
|
-
if (item.h.t10a) {
|
|
939
|
-
result.holder.top10HoldersAmount = this.formatScientificNotation(item.h.t10a);
|
|
940
|
-
}
|
|
941
|
-
if (item.h.t100h) {
|
|
942
|
-
result.holder.top100Holders = item.h.t100h;
|
|
943
|
-
}
|
|
944
|
-
if (item.h.t50h) {
|
|
945
|
-
result.holder.top50Holders = item.h.t50h;
|
|
946
|
-
}
|
|
947
|
-
if (item.h.t10h) {
|
|
948
|
-
result.holder.top10Holders = item.h.t10h;
|
|
949
|
-
}
|
|
950
|
-
if (item.h.t100r) {
|
|
951
|
-
result.holder.top100HoldersRatio = this.formatScientificNotation(item.h.t100r);
|
|
952
|
-
}
|
|
953
|
-
if (item.h.t50r) {
|
|
954
|
-
result.holder.top50HoldersRatio = this.formatScientificNotation(item.h.t50r);
|
|
955
|
-
}
|
|
956
|
-
if (item.h.t10r) {
|
|
957
|
-
result.holder.top10HoldersRatio = this.formatScientificNotation(item.h.t10r);
|
|
958
|
-
}
|
|
959
|
-
if (item.h.ch) {
|
|
960
|
-
result.holder.creatorsHolders = item.h.ch;
|
|
961
|
-
}
|
|
962
|
-
if (item.h.ca) {
|
|
963
|
-
result.holder.creatorsAmount = this.formatScientificNotation(item.h.ca);
|
|
964
|
-
}
|
|
965
|
-
if (item.h.cr) {
|
|
966
|
-
result.holder.creatorsRatio = this.formatScientificNotation(item.h.cr);
|
|
967
|
-
}
|
|
968
|
-
if (item.h.btfh) {
|
|
969
|
-
result.holder.balanceTagFreshHolders = item.h.btfh;
|
|
970
|
-
}
|
|
971
|
-
if (item.h.btfa) {
|
|
972
|
-
result.holder.balanceTagFreshAmount = this.formatScientificNotation(item.h.btfa);
|
|
973
|
-
}
|
|
974
|
-
if (item.h.btfr) {
|
|
975
|
-
result.holder.balanceTagFreshRatio = this.formatScientificNotation(item.h.btfr);
|
|
976
|
-
}
|
|
977
|
-
if (item.h.btsh) {
|
|
978
|
-
result.holder.balanceTagSandwichHolders = item.h.btsh;
|
|
979
|
-
}
|
|
980
|
-
if (item.h.btsa) {
|
|
981
|
-
result.holder.balanceTagSandwichAmount = this.formatScientificNotation(item.h.btsa);
|
|
982
|
-
}
|
|
983
|
-
if (item.h.btsr) {
|
|
984
|
-
result.holder.balanceTagSandwichRatio = this.formatScientificNotation(item.h.btsr);
|
|
985
|
-
}
|
|
986
|
-
if (item.h.btbh) {
|
|
987
|
-
result.holder.balanceTagBundleHolders = item.h.btbh;
|
|
988
|
-
}
|
|
989
|
-
if (item.h.btba) {
|
|
990
|
-
result.holder.balanceTagBundleAmount = this.formatScientificNotation(item.h.btba);
|
|
991
|
-
}
|
|
992
|
-
if (item.h.btbr) {
|
|
993
|
-
result.holder.balanceTagBundleRatio = this.formatScientificNotation(item.h.btbr);
|
|
994
|
-
}
|
|
995
|
-
if (item.h.btsnh) {
|
|
996
|
-
result.holder.balanceTagSniperHolders = item.h.btsnh;
|
|
997
|
-
}
|
|
998
|
-
if (item.h.btsna) {
|
|
999
|
-
result.holder.balanceTagSniperAmount = this.formatScientificNotation(item.h.btsna);
|
|
1000
|
-
}
|
|
1001
|
-
if (item.h.btsnr) {
|
|
1002
|
-
result.holder.balanceTagSniperRatio = this.formatScientificNotation(item.h.btsnr);
|
|
1003
|
-
}
|
|
1004
|
-
if (item.h.btdh) {
|
|
1005
|
-
result.holder.balanceTagDevHolders = item.h.btdh;
|
|
1006
|
-
}
|
|
1007
|
-
if (item.h.btda) {
|
|
1008
|
-
result.holder.balanceTagDevAmount = this.formatScientificNotation(item.h.btda);
|
|
1009
|
-
}
|
|
1010
|
-
if (item.h.btdr) {
|
|
1011
|
-
result.holder.balanceTagDevRatio = this.formatScientificNotation(item.h.btdr);
|
|
1012
|
-
}
|
|
1013
|
-
if (item.h.btph) {
|
|
1014
|
-
result.holder.balanceTagProHolders = item.h.btph;
|
|
1015
|
-
}
|
|
1016
|
-
if (item.h.btpa) {
|
|
1017
|
-
result.holder.balanceTagProAmount = this.formatScientificNotation(item.h.btpa);
|
|
1018
|
-
}
|
|
1019
|
-
if (item.h.btpr) {
|
|
1020
|
-
result.holder.balanceTagProRatio = this.formatScientificNotation(item.h.btpr);
|
|
940
|
+
if (h.h) {
|
|
941
|
+
result.holder.holders = h.h;
|
|
1021
942
|
}
|
|
1022
|
-
if (
|
|
1023
|
-
result.holder.
|
|
943
|
+
if (h.t100a) {
|
|
944
|
+
result.holder.top100HoldersAmount = this.formatScientificNotation(h.t100a);
|
|
1024
945
|
}
|
|
1025
|
-
if (
|
|
1026
|
-
result.holder.
|
|
946
|
+
if (h.t50a) {
|
|
947
|
+
result.holder.top50HoldersAmount = this.formatScientificNotation(h.t50a);
|
|
1027
948
|
}
|
|
1028
|
-
if (
|
|
1029
|
-
result.holder.
|
|
949
|
+
if (h.t10a) {
|
|
950
|
+
result.holder.top10HoldersAmount = this.formatScientificNotation(h.t10a);
|
|
1030
951
|
}
|
|
1031
|
-
if (
|
|
1032
|
-
result.holder.
|
|
952
|
+
if (h.t100h) {
|
|
953
|
+
result.holder.top100Holders = h.t100h;
|
|
1033
954
|
}
|
|
1034
|
-
if (
|
|
1035
|
-
result.holder.
|
|
955
|
+
if (h.t50h) {
|
|
956
|
+
result.holder.top50Holders = h.t50h;
|
|
1036
957
|
}
|
|
1037
|
-
if (
|
|
1038
|
-
result.holder.
|
|
958
|
+
if (h.t10h) {
|
|
959
|
+
result.holder.top10Holders = h.t10h;
|
|
1039
960
|
}
|
|
1040
|
-
if (
|
|
1041
|
-
result.holder.
|
|
961
|
+
if (h.t100r) {
|
|
962
|
+
result.holder.top100HoldersRatio = this.formatScientificNotation(h.t100r);
|
|
1042
963
|
}
|
|
1043
|
-
if (
|
|
1044
|
-
result.holder.
|
|
964
|
+
if (h.t50r) {
|
|
965
|
+
result.holder.top50HoldersRatio = this.formatScientificNotation(h.t50r);
|
|
1045
966
|
}
|
|
1046
|
-
if (
|
|
1047
|
-
result.holder.
|
|
1048
|
-
}
|
|
1049
|
-
if (item.h.btphh) {
|
|
1050
|
-
result.holder.balanceTagPhishingHolders = item.h.btphh;
|
|
1051
|
-
}
|
|
1052
|
-
if (item.h.btpha) {
|
|
1053
|
-
result.holder.balanceTagPhishingAmount = this.formatScientificNotation(item.h.btpha);
|
|
1054
|
-
}
|
|
1055
|
-
if (item.h.btphr) {
|
|
1056
|
-
result.holder.balanceTagPhishingRatio = this.formatScientificNotation(item.h.btphr);
|
|
1057
|
-
}
|
|
1058
|
-
if (item.h.btblh) {
|
|
1059
|
-
result.holder.balanceTagBluechipHolders = item.h.btblh;
|
|
1060
|
-
}
|
|
1061
|
-
if (item.h.btbla) {
|
|
1062
|
-
result.holder.balanceTagBluechipAmount = this.formatScientificNotation(item.h.btbla);
|
|
1063
|
-
}
|
|
1064
|
-
if (item.h.btblr) {
|
|
1065
|
-
result.holder.balanceTagBluechipRatio = this.formatScientificNotation(item.h.btblr);
|
|
1066
|
-
}
|
|
1067
|
-
if (item.h.btrh) {
|
|
1068
|
-
result.holder.balanceTagRatHolders = item.h.btrh;
|
|
1069
|
-
}
|
|
1070
|
-
if (item.h.btra) {
|
|
1071
|
-
result.holder.balanceTagRatAmount = this.formatScientificNotation(item.h.btra);
|
|
1072
|
-
}
|
|
1073
|
-
if (item.h.btrr) {
|
|
1074
|
-
result.holder.balanceTagRatRatio = this.formatScientificNotation(item.h.btrr);
|
|
967
|
+
if (h.t10r) {
|
|
968
|
+
result.holder.top10HoldersRatio = this.formatScientificNotation(h.t10r);
|
|
1075
969
|
}
|
|
1076
970
|
}
|
|
1077
|
-
if (
|
|
971
|
+
if (s) {
|
|
1078
972
|
result.supply = {
|
|
1079
|
-
tokenAddress:
|
|
1080
|
-
timestamp:
|
|
973
|
+
tokenAddress: s.a,
|
|
974
|
+
timestamp: s.ts || 0
|
|
1081
975
|
};
|
|
1082
|
-
if (
|
|
1083
|
-
result.supply.supply =
|
|
976
|
+
if (s.s) {
|
|
977
|
+
result.supply.supply = s.s;
|
|
1084
978
|
}
|
|
1085
|
-
if (
|
|
1086
|
-
result.supply.marketCapInUsd =
|
|
979
|
+
if (s.mc) {
|
|
980
|
+
result.supply.marketCapInUsd = s.mc;
|
|
1087
981
|
}
|
|
1088
982
|
}
|
|
1089
|
-
if (
|
|
983
|
+
if (ts) {
|
|
1090
984
|
result.stat = {
|
|
1091
|
-
address:
|
|
1092
|
-
timestamp:
|
|
985
|
+
address: ts.a,
|
|
986
|
+
timestamp: ts.t || 0
|
|
1093
987
|
};
|
|
1094
|
-
if (
|
|
1095
|
-
result.stat.buys1m =
|
|
1096
|
-
}
|
|
1097
|
-
if (item.ts.s1m) {
|
|
1098
|
-
result.stat.sells1m = item.ts.s1m;
|
|
1099
|
-
}
|
|
1100
|
-
if (item.ts.be1m) {
|
|
1101
|
-
result.stat.buyers1m = item.ts.be1m;
|
|
1102
|
-
}
|
|
1103
|
-
if (item.ts.se1m) {
|
|
1104
|
-
result.stat.sellers1m = item.ts.se1m;
|
|
1105
|
-
}
|
|
1106
|
-
if (item.ts.bviu1m) {
|
|
1107
|
-
result.stat.buyVolumeInUsd1m = this.formatScientificNotation(item.ts.bviu1m);
|
|
1108
|
-
}
|
|
1109
|
-
if (item.ts.sviu1m) {
|
|
1110
|
-
result.stat.sellVolumeInUsd1m = this.formatScientificNotation(item.ts.sviu1m);
|
|
1111
|
-
}
|
|
1112
|
-
if (item.ts.p1m) {
|
|
1113
|
-
result.stat.price1m = this.formatScientificNotation(item.ts.p1m);
|
|
1114
|
-
}
|
|
1115
|
-
if (item.ts.oiu1m) {
|
|
1116
|
-
result.stat.openInUsd1m = this.formatScientificNotation(item.ts.oiu1m);
|
|
1117
|
-
}
|
|
1118
|
-
if (item.ts.ciu1m) {
|
|
1119
|
-
result.stat.closeInUsd1m = this.formatScientificNotation(item.ts.ciu1m);
|
|
1120
|
-
}
|
|
1121
|
-
if (item.ts.b5m) {
|
|
1122
|
-
result.stat.buys5m = item.ts.b5m;
|
|
1123
|
-
}
|
|
1124
|
-
if (item.ts.s5m) {
|
|
1125
|
-
result.stat.sells5m = item.ts.s5m;
|
|
1126
|
-
}
|
|
1127
|
-
if (item.ts.be5m) {
|
|
1128
|
-
result.stat.buyers5m = item.ts.be5m;
|
|
1129
|
-
}
|
|
1130
|
-
if (item.ts.se5m) {
|
|
1131
|
-
result.stat.sellers5m = item.ts.se5m;
|
|
1132
|
-
}
|
|
1133
|
-
if (item.ts.bviu5m) {
|
|
1134
|
-
result.stat.buyVolumeInUsd5m = this.formatScientificNotation(item.ts.bviu5m);
|
|
1135
|
-
}
|
|
1136
|
-
if (item.ts.sviu5m) {
|
|
1137
|
-
result.stat.sellVolumeInUsd5m = this.formatScientificNotation(item.ts.sviu5m);
|
|
1138
|
-
}
|
|
1139
|
-
if (item.ts.p5m) {
|
|
1140
|
-
result.stat.price5m = this.formatScientificNotation(item.ts.p5m);
|
|
1141
|
-
}
|
|
1142
|
-
if (item.ts.oiu5m) {
|
|
1143
|
-
result.stat.openInUsd5m = this.formatScientificNotation(item.ts.oiu5m);
|
|
1144
|
-
}
|
|
1145
|
-
if (item.ts.ciu5m) {
|
|
1146
|
-
result.stat.closeInUsd5m = this.formatScientificNotation(item.ts.ciu5m);
|
|
1147
|
-
}
|
|
1148
|
-
if (item.ts.b15m) {
|
|
1149
|
-
result.stat.buys15m = item.ts.b15m;
|
|
1150
|
-
}
|
|
1151
|
-
if (item.ts.s15m) {
|
|
1152
|
-
result.stat.sells15m = item.ts.s15m;
|
|
1153
|
-
}
|
|
1154
|
-
if (item.ts.be15m) {
|
|
1155
|
-
result.stat.buyers15m = item.ts.be15m;
|
|
1156
|
-
}
|
|
1157
|
-
if (item.ts.se15m) {
|
|
1158
|
-
result.stat.sellers15m = item.ts.se15m;
|
|
1159
|
-
}
|
|
1160
|
-
if (item.ts.bviu15m) {
|
|
1161
|
-
result.stat.buyVolumeInUsd15m = this.formatScientificNotation(item.ts.bviu15m);
|
|
1162
|
-
}
|
|
1163
|
-
if (item.ts.sviu15m) {
|
|
1164
|
-
result.stat.sellVolumeInUsd15m = this.formatScientificNotation(item.ts.sviu15m);
|
|
1165
|
-
}
|
|
1166
|
-
if (item.ts.p15m) {
|
|
1167
|
-
result.stat.price15m = this.formatScientificNotation(item.ts.p15m);
|
|
1168
|
-
}
|
|
1169
|
-
if (item.ts.oiu15m) {
|
|
1170
|
-
result.stat.openInUsd15m = this.formatScientificNotation(item.ts.oiu15m);
|
|
1171
|
-
}
|
|
1172
|
-
if (item.ts.ciu15m) {
|
|
1173
|
-
result.stat.closeInUsd15m = this.formatScientificNotation(item.ts.ciu15m);
|
|
1174
|
-
}
|
|
1175
|
-
if (item.ts.b30m) {
|
|
1176
|
-
result.stat.buys30m = item.ts.b30m;
|
|
1177
|
-
}
|
|
1178
|
-
if (item.ts.s30m) {
|
|
1179
|
-
result.stat.sells30m = item.ts.s30m;
|
|
1180
|
-
}
|
|
1181
|
-
if (item.ts.be30m) {
|
|
1182
|
-
result.stat.buyers30m = item.ts.be30m;
|
|
1183
|
-
}
|
|
1184
|
-
if (item.ts.se30m) {
|
|
1185
|
-
result.stat.sellers30m = item.ts.se30m;
|
|
1186
|
-
}
|
|
1187
|
-
if (item.ts.bviu30m) {
|
|
1188
|
-
result.stat.buyVolumeInUsd30m = this.formatScientificNotation(item.ts.bviu30m);
|
|
1189
|
-
}
|
|
1190
|
-
if (item.ts.sviu30m) {
|
|
1191
|
-
result.stat.sellVolumeInUsd30m = this.formatScientificNotation(item.ts.sviu30m);
|
|
1192
|
-
}
|
|
1193
|
-
if (item.ts.p30m) {
|
|
1194
|
-
result.stat.price30m = this.formatScientificNotation(item.ts.p30m);
|
|
1195
|
-
}
|
|
1196
|
-
if (item.ts.oiu30m) {
|
|
1197
|
-
result.stat.openInUsd30m = this.formatScientificNotation(item.ts.oiu30m);
|
|
1198
|
-
}
|
|
1199
|
-
if (item.ts.ciu30m) {
|
|
1200
|
-
result.stat.closeInUsd30m = this.formatScientificNotation(item.ts.ciu30m);
|
|
1201
|
-
}
|
|
1202
|
-
if (item.ts.b1h) {
|
|
1203
|
-
result.stat.buys1h = item.ts.b1h;
|
|
1204
|
-
}
|
|
1205
|
-
if (item.ts.s1h) {
|
|
1206
|
-
result.stat.sells1h = item.ts.s1h;
|
|
1207
|
-
}
|
|
1208
|
-
if (item.ts.be1h) {
|
|
1209
|
-
result.stat.buyers1h = item.ts.be1h;
|
|
1210
|
-
}
|
|
1211
|
-
if (item.ts.se1h) {
|
|
1212
|
-
result.stat.sellers1h = item.ts.se1h;
|
|
1213
|
-
}
|
|
1214
|
-
if (item.ts.bviu1h) {
|
|
1215
|
-
result.stat.buyVolumeInUsd1h = this.formatScientificNotation(item.ts.bviu1h);
|
|
1216
|
-
}
|
|
1217
|
-
if (item.ts.sviu1h) {
|
|
1218
|
-
result.stat.sellVolumeInUsd1h = this.formatScientificNotation(item.ts.sviu1h);
|
|
1219
|
-
}
|
|
1220
|
-
if (item.ts.p1h) {
|
|
1221
|
-
result.stat.price1h = this.formatScientificNotation(item.ts.p1h);
|
|
988
|
+
if (ts.b1m) {
|
|
989
|
+
result.stat.buys1m = ts.b1m;
|
|
1222
990
|
}
|
|
1223
|
-
if (
|
|
1224
|
-
result.stat.
|
|
991
|
+
if (ts.s1m) {
|
|
992
|
+
result.stat.sells1m = ts.s1m;
|
|
1225
993
|
}
|
|
1226
|
-
if (
|
|
1227
|
-
result.stat.
|
|
994
|
+
if (ts.be1m) {
|
|
995
|
+
result.stat.buyers1m = ts.be1m;
|
|
1228
996
|
}
|
|
1229
|
-
if (
|
|
1230
|
-
result.stat.
|
|
997
|
+
if (ts.se1m) {
|
|
998
|
+
result.stat.sellers1m = ts.se1m;
|
|
1231
999
|
}
|
|
1232
|
-
if (
|
|
1233
|
-
result.stat.
|
|
1000
|
+
if (ts.bviu1m) {
|
|
1001
|
+
result.stat.buyVolumeInUsd1m = this.formatScientificNotation(ts.bviu1m);
|
|
1234
1002
|
}
|
|
1235
|
-
if (
|
|
1236
|
-
result.stat.
|
|
1003
|
+
if (ts.sviu1m) {
|
|
1004
|
+
result.stat.sellVolumeInUsd1m = this.formatScientificNotation(ts.sviu1m);
|
|
1237
1005
|
}
|
|
1238
|
-
if (
|
|
1239
|
-
result.stat.
|
|
1006
|
+
if (ts.p1m) {
|
|
1007
|
+
result.stat.price1m = this.formatScientificNotation(ts.p1m);
|
|
1240
1008
|
}
|
|
1241
|
-
if (
|
|
1242
|
-
result.stat.
|
|
1243
|
-
}
|
|
1244
|
-
if (item.ts.sviu4h) {
|
|
1245
|
-
result.stat.sellVolumeInUsd4h = this.formatScientificNotation(item.ts.sviu4h);
|
|
1246
|
-
}
|
|
1247
|
-
if (item.ts.p4h) {
|
|
1248
|
-
result.stat.price4h = this.formatScientificNotation(item.ts.p4h);
|
|
1249
|
-
}
|
|
1250
|
-
if (item.ts.oiu4h) {
|
|
1251
|
-
result.stat.openInUsd4h = this.formatScientificNotation(item.ts.oiu4h);
|
|
1252
|
-
}
|
|
1253
|
-
if (item.ts.ciu4h) {
|
|
1254
|
-
result.stat.closeInUsd4h = this.formatScientificNotation(item.ts.ciu4h);
|
|
1255
|
-
}
|
|
1256
|
-
if (item.ts.b24h) {
|
|
1257
|
-
result.stat.buys24h = item.ts.b24h;
|
|
1258
|
-
}
|
|
1259
|
-
if (item.ts.s24h) {
|
|
1260
|
-
result.stat.sells24h = item.ts.s24h;
|
|
1261
|
-
}
|
|
1262
|
-
if (item.ts.be24h) {
|
|
1263
|
-
result.stat.buyers24h = item.ts.be24h;
|
|
1264
|
-
}
|
|
1265
|
-
if (item.ts.se24h) {
|
|
1266
|
-
result.stat.sellers24h = item.ts.se24h;
|
|
1267
|
-
}
|
|
1268
|
-
if (item.ts.bviu24h) {
|
|
1269
|
-
result.stat.buyVolumeInUsd24h = this.formatScientificNotation(item.ts.bviu24h);
|
|
1270
|
-
}
|
|
1271
|
-
if (item.ts.sviu24h) {
|
|
1272
|
-
result.stat.sellVolumeInUsd24h = this.formatScientificNotation(item.ts.sviu24h);
|
|
1273
|
-
}
|
|
1274
|
-
if (item.ts.p24h) {
|
|
1275
|
-
result.stat.price24h = this.formatScientificNotation(item.ts.p24h);
|
|
1276
|
-
}
|
|
1277
|
-
if (item.ts.oiu24h) {
|
|
1278
|
-
result.stat.openInUsd24h = this.formatScientificNotation(item.ts.oiu24h);
|
|
1279
|
-
}
|
|
1280
|
-
if (item.ts.ciu24h) {
|
|
1281
|
-
result.stat.closeInUsd24h = this.formatScientificNotation(item.ts.ciu24h);
|
|
1282
|
-
}
|
|
1283
|
-
if (item.ts.p) {
|
|
1284
|
-
result.stat.price = this.formatScientificNotation(item.ts.p);
|
|
1009
|
+
if (ts.p) {
|
|
1010
|
+
result.stat.price = this.formatScientificNotation(ts.p);
|
|
1285
1011
|
}
|
|
1286
1012
|
}
|
|
1287
1013
|
return result;
|
|
@@ -1320,52 +1046,7 @@ var StreamApi = class {
|
|
|
1320
1046
|
price5m: this.formatScientificNotation(it.p5m),
|
|
1321
1047
|
openInUsd5m: this.formatScientificNotation(it.oiu5m),
|
|
1322
1048
|
closeInUsd5m: this.formatScientificNotation(it.ciu5m),
|
|
1323
|
-
|
|
1324
|
-
sells15m: it.s15m,
|
|
1325
|
-
buyers15m: it.be15m,
|
|
1326
|
-
sellers15m: it.se15m,
|
|
1327
|
-
buyVolumeInUsd15m: this.formatScientificNotation(it.bviu15m),
|
|
1328
|
-
sellVolumeInUsd15m: this.formatScientificNotation(it.sviu15m),
|
|
1329
|
-
price15m: this.formatScientificNotation(it.p15m),
|
|
1330
|
-
openInUsd15m: this.formatScientificNotation(it.oiu15m),
|
|
1331
|
-
closeInUsd15m: this.formatScientificNotation(it.ciu15m),
|
|
1332
|
-
buys30m: it.b30m,
|
|
1333
|
-
sells30m: it.s30m,
|
|
1334
|
-
buyers30m: it.be30m,
|
|
1335
|
-
sellers30m: it.se30m,
|
|
1336
|
-
buyVolumeInUsd30m: this.formatScientificNotation(it.bviu30m),
|
|
1337
|
-
sellVolumeInUsd30m: this.formatScientificNotation(it.sviu30m),
|
|
1338
|
-
price30m: this.formatScientificNotation(it.p30m),
|
|
1339
|
-
openInUsd30m: this.formatScientificNotation(it.oiu30m),
|
|
1340
|
-
closeInUsd30m: this.formatScientificNotation(it.ciu30m),
|
|
1341
|
-
buys1h: it.b1h,
|
|
1342
|
-
sells1h: it.s1h,
|
|
1343
|
-
buyers1h: it.be1h,
|
|
1344
|
-
sellers1h: it.se1h,
|
|
1345
|
-
buyVolumeInUsd1h: this.formatScientificNotation(it.bviu1h),
|
|
1346
|
-
sellVolumeInUsd1h: this.formatScientificNotation(it.sviu1h),
|
|
1347
|
-
price1h: this.formatScientificNotation(it.p1h),
|
|
1348
|
-
openInUsd1h: this.formatScientificNotation(it.oiu1h),
|
|
1349
|
-
closeInUsd1h: this.formatScientificNotation(it.ciu1h),
|
|
1350
|
-
buys4h: it.b4h,
|
|
1351
|
-
sells4h: it.s4h,
|
|
1352
|
-
buyers4h: it.be4h,
|
|
1353
|
-
sellers4h: it.se4h,
|
|
1354
|
-
buyVolumeInUsd4h: this.formatScientificNotation(it.bviu4h),
|
|
1355
|
-
sellVolumeInUsd4h: this.formatScientificNotation(it.sviu4h),
|
|
1356
|
-
price4h: this.formatScientificNotation(it.p4h),
|
|
1357
|
-
openInUsd4h: this.formatScientificNotation(it.oiu4h),
|
|
1358
|
-
closeInUsd4h: this.formatScientificNotation(it.ciu4h),
|
|
1359
|
-
buys24h: it.b24h,
|
|
1360
|
-
sells24h: it.s24h,
|
|
1361
|
-
buyers24h: it.be24h,
|
|
1362
|
-
sellers24h: it.se24h,
|
|
1363
|
-
buyVolumeInUsd24h: this.formatScientificNotation(it.bviu24h),
|
|
1364
|
-
sellVolumeInUsd24h: this.formatScientificNotation(it.sviu24h),
|
|
1365
|
-
price24h: this.formatScientificNotation(it.p24h),
|
|
1366
|
-
price: this.formatScientificNotation(it.p),
|
|
1367
|
-
openInUsd24h: this.formatScientificNotation(it.oiu24h),
|
|
1368
|
-
closeInUsd24h: this.formatScientificNotation(it.ciu24h)
|
|
1049
|
+
price: this.formatScientificNotation(it.p)
|
|
1369
1050
|
})
|
|
1370
1051
|
)
|
|
1371
1052
|
)
|
|
@@ -1393,45 +1074,6 @@ var StreamApi = class {
|
|
|
1393
1074
|
top100HoldersRatio: this.formatScientificNotation(it.t100r),
|
|
1394
1075
|
top50HoldersRatio: this.formatScientificNotation(it.t50r),
|
|
1395
1076
|
top10HoldersRatio: this.formatScientificNotation(it.t10r),
|
|
1396
|
-
creatorsHolders: it.ch,
|
|
1397
|
-
creatorsAmount: this.formatScientificNotation(it.ca),
|
|
1398
|
-
creatorsRatio: this.formatScientificNotation(it.cr),
|
|
1399
|
-
balanceTagFreshHolders: it.btfh,
|
|
1400
|
-
balanceTagFreshAmount: this.formatScientificNotation(it.btfa),
|
|
1401
|
-
balanceTagFreshRatio: this.formatScientificNotation(it.btfr),
|
|
1402
|
-
balanceTagSandwichHolders: it.btsh,
|
|
1403
|
-
balanceTagSandwichAmount: this.formatScientificNotation(it.btsa),
|
|
1404
|
-
balanceTagSandwichRatio: this.formatScientificNotation(it.btsr),
|
|
1405
|
-
balanceTagBundleHolders: it.btbh,
|
|
1406
|
-
balanceTagBundleAmount: this.formatScientificNotation(it.btba),
|
|
1407
|
-
balanceTagBundleRatio: this.formatScientificNotation(it.btbr),
|
|
1408
|
-
balanceTagSniperHolders: it.btsnh,
|
|
1409
|
-
balanceTagSniperAmount: this.formatScientificNotation(it.btsna),
|
|
1410
|
-
balanceTagSniperRatio: this.formatScientificNotation(it.btsnr),
|
|
1411
|
-
balanceTagDevHolders: it.btdh,
|
|
1412
|
-
balanceTagDevAmount: this.formatScientificNotation(it.btda),
|
|
1413
|
-
balanceTagDevRatio: this.formatScientificNotation(it.btdr),
|
|
1414
|
-
balanceTagProHolders: it.btph,
|
|
1415
|
-
balanceTagProAmount: this.formatScientificNotation(it.btpa),
|
|
1416
|
-
balanceTagProRatio: this.formatScientificNotation(it.btpr),
|
|
1417
|
-
balanceTagInsiderHolders: it.btih,
|
|
1418
|
-
balanceTagInsiderAmount: this.formatScientificNotation(it.btia),
|
|
1419
|
-
balanceTagInsiderRatio: this.formatScientificNotation(it.btir),
|
|
1420
|
-
balanceTagSmartHolders: it.btsmh,
|
|
1421
|
-
balanceTagSmartAmount: this.formatScientificNotation(it.btsma),
|
|
1422
|
-
balanceTagSmartRatio: this.formatScientificNotation(it.btsmr),
|
|
1423
|
-
balanceTagKolHolders: it.btkh,
|
|
1424
|
-
balanceTagKolAmount: this.formatScientificNotation(it.btka),
|
|
1425
|
-
balanceTagKolRatio: this.formatScientificNotation(it.btkr),
|
|
1426
|
-
balanceTagPhishingHolders: it.btphh,
|
|
1427
|
-
balanceTagPhishingAmount: this.formatScientificNotation(it.btpha),
|
|
1428
|
-
balanceTagPhishingRatio: this.formatScientificNotation(it.btphr),
|
|
1429
|
-
balanceTagBluechipHolders: it.btblh,
|
|
1430
|
-
balanceTagBluechipAmount: this.formatScientificNotation(it.btbla),
|
|
1431
|
-
balanceTagBluechipRatio: this.formatScientificNotation(it.btblr),
|
|
1432
|
-
balanceTagRatHolders: it.btrh,
|
|
1433
|
-
balanceTagRatAmount: this.formatScientificNotation(it.btra),
|
|
1434
|
-
balanceTagRatRatio: this.formatScientificNotation(it.btrr),
|
|
1435
1077
|
timestamp: it.ts
|
|
1436
1078
|
})
|
|
1437
1079
|
)
|
|
@@ -1447,14 +1089,12 @@ var StreamApi = class {
|
|
|
1447
1089
|
return this.subscribe(
|
|
1448
1090
|
channel,
|
|
1449
1091
|
(data) => callback(
|
|
1450
|
-
data?.map(
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
})
|
|
1457
|
-
)
|
|
1092
|
+
data?.map((it) => ({
|
|
1093
|
+
tokenAddress: it.a,
|
|
1094
|
+
supply: it.s,
|
|
1095
|
+
marketCapInUsd: it.mc,
|
|
1096
|
+
timestamp: it.ts
|
|
1097
|
+
}))
|
|
1458
1098
|
)
|
|
1459
1099
|
);
|
|
1460
1100
|
}
|
|
@@ -1466,48 +1106,13 @@ var StreamApi = class {
|
|
|
1466
1106
|
return this.subscribe(
|
|
1467
1107
|
channel,
|
|
1468
1108
|
(data) => callback(
|
|
1469
|
-
data?.map(
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
})
|
|
1474
|
-
)
|
|
1109
|
+
data?.map((it) => ({
|
|
1110
|
+
tokenAddress: it.a,
|
|
1111
|
+
progressRatio: it.pr
|
|
1112
|
+
}))
|
|
1475
1113
|
)
|
|
1476
1114
|
);
|
|
1477
1115
|
}
|
|
1478
|
-
// subscribeTokenTrades({
|
|
1479
|
-
// chain,
|
|
1480
|
-
// tokenAddress,
|
|
1481
|
-
// callback,
|
|
1482
|
-
// }: {
|
|
1483
|
-
// chain: string;
|
|
1484
|
-
// tokenAddress: string;
|
|
1485
|
-
// callback: (data: TradeEvent[]) => void;
|
|
1486
|
-
// }): Unsubscrible {
|
|
1487
|
-
// const channel = `dex-trades:${chain}_${tokenAddress}`;
|
|
1488
|
-
// return this.subscribe(channel, (data: any[]) =>
|
|
1489
|
-
// callback(
|
|
1490
|
-
// data?.map(
|
|
1491
|
-
// (it: any) =>
|
|
1492
|
-
// ({
|
|
1493
|
-
// maker: it.bwa,
|
|
1494
|
-
// baseAmount: it.ba,
|
|
1495
|
-
// quoteAmount: it.sa,
|
|
1496
|
-
// // quoteSymbol: ,
|
|
1497
|
-
// quoteAddress: it.swa,
|
|
1498
|
-
// amountInUsd: it.baiu,
|
|
1499
|
-
// timestamp: it.t,
|
|
1500
|
-
// event: it.k,
|
|
1501
|
-
// txHash: it.h,
|
|
1502
|
-
// // priceInUsd: ,
|
|
1503
|
-
// // id: ,
|
|
1504
|
-
// // buyCostUsd: it.,
|
|
1505
|
-
// tokenAddress: it.a,
|
|
1506
|
-
// }) as TradeEvent
|
|
1507
|
-
// )
|
|
1508
|
-
// )
|
|
1509
|
-
// );
|
|
1510
|
-
// }
|
|
1511
1116
|
subscribeWalletBalance({
|
|
1512
1117
|
chain,
|
|
1513
1118
|
walletAddress,
|
|
@@ -1515,15 +1120,20 @@ var StreamApi = class {
|
|
|
1515
1120
|
filter
|
|
1516
1121
|
}) {
|
|
1517
1122
|
const channel = `dex-wallet-balance:${chain}_${walletAddress}`;
|
|
1518
|
-
return this.subscribe(
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1123
|
+
return this.subscribe(
|
|
1124
|
+
channel,
|
|
1125
|
+
(data) => callback([
|
|
1126
|
+
{
|
|
1127
|
+
walletAddress: data.a,
|
|
1128
|
+
tokenAddress: data.ta,
|
|
1129
|
+
tokenPriceInUsd: data.tpiu,
|
|
1130
|
+
balance: data.b,
|
|
1131
|
+
timestamp: data.t
|
|
1132
|
+
}
|
|
1133
|
+
]),
|
|
1134
|
+
filter,
|
|
1135
|
+
"subscribeWalletBalance"
|
|
1136
|
+
);
|
|
1527
1137
|
}
|
|
1528
1138
|
subscribeWalletPnl({
|
|
1529
1139
|
chain,
|
|
@@ -1532,34 +1142,39 @@ var StreamApi = class {
|
|
|
1532
1142
|
filter
|
|
1533
1143
|
}) {
|
|
1534
1144
|
const channel = `dex-wallet-token-pnl:${chain}_${walletAddress}`;
|
|
1535
|
-
return this.subscribe(
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1145
|
+
return this.subscribe(
|
|
1146
|
+
channel,
|
|
1147
|
+
(data) => callback({
|
|
1148
|
+
walletAddress: data.a,
|
|
1149
|
+
tokenAddress: data.ta,
|
|
1150
|
+
tokenPriceInUsd: data.tpiu,
|
|
1151
|
+
timestamp: data.t,
|
|
1152
|
+
opentime: data.ot,
|
|
1153
|
+
lasttime: data.lt,
|
|
1154
|
+
closetime: data.ct,
|
|
1155
|
+
buyAmount: data.ba,
|
|
1156
|
+
buyAmountInUsd: data.baiu,
|
|
1157
|
+
buyCount: data.bs,
|
|
1158
|
+
buyCount30d: data.bs30d,
|
|
1159
|
+
buyCount7d: data.bs7d,
|
|
1160
|
+
sellAmount: data.sa,
|
|
1161
|
+
sellAmountInUsd: data.saiu,
|
|
1162
|
+
sellCount: data.ss,
|
|
1163
|
+
sellCount30d: data.ss30d,
|
|
1164
|
+
sellCount7d: data.ss7d,
|
|
1165
|
+
heldDurationTimestamp: data.hdts,
|
|
1166
|
+
averageBuyPriceInUsd: data.abpiu,
|
|
1167
|
+
averageSellPriceInUsd: data.aspiu,
|
|
1168
|
+
unrealizedProfitInUsd: data.upiu,
|
|
1169
|
+
unrealizedProfitRatio: data.upr,
|
|
1170
|
+
realizedProfitInUsd: data.rpiu,
|
|
1171
|
+
realizedProfitRatio: data.rpr,
|
|
1172
|
+
totalRealizedProfitInUsd: data.trpiu,
|
|
1173
|
+
totalRealizedProfitRatio: data.trr
|
|
1174
|
+
}),
|
|
1175
|
+
filter,
|
|
1176
|
+
"subscribeWalletPnl"
|
|
1177
|
+
);
|
|
1563
1178
|
}
|
|
1564
1179
|
subscribeWalletPnlList({
|
|
1565
1180
|
chain,
|
|
@@ -1601,24 +1216,29 @@ var StreamApi = class {
|
|
|
1601
1216
|
filter
|
|
1602
1217
|
}) {
|
|
1603
1218
|
const channel = `dex-trade:${chain}_${tokenAddress}`;
|
|
1604
|
-
return this.subscribe(
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1219
|
+
return this.subscribe(
|
|
1220
|
+
channel,
|
|
1221
|
+
(data) => callback({
|
|
1222
|
+
tokenAddress: data.a,
|
|
1223
|
+
timestamp: data.t,
|
|
1224
|
+
kind: data.k,
|
|
1225
|
+
buyAmount: data.ba,
|
|
1226
|
+
buyAmountInUsd: data.baiu,
|
|
1227
|
+
buyTokenAddress: data.btma,
|
|
1228
|
+
buyTokenName: data.btn,
|
|
1229
|
+
buyTokenSymbol: data.bts,
|
|
1230
|
+
buyWalletAddress: data.bwa,
|
|
1231
|
+
sellAmount: data.sa,
|
|
1232
|
+
sellAmountInUsd: data.saiu,
|
|
1233
|
+
sellTokenAddress: data.stma,
|
|
1234
|
+
sellTokenName: data.stn,
|
|
1235
|
+
sellTokenSymbol: data.sts,
|
|
1236
|
+
sellWalletAddress: data.swa,
|
|
1237
|
+
txHash: data.h
|
|
1238
|
+
}),
|
|
1239
|
+
filter,
|
|
1240
|
+
"subscribeTokenTrades"
|
|
1241
|
+
);
|
|
1622
1242
|
}
|
|
1623
1243
|
subscribeWalletTrade({
|
|
1624
1244
|
chain,
|
|
@@ -1627,24 +1247,29 @@ var StreamApi = class {
|
|
|
1627
1247
|
filter
|
|
1628
1248
|
}) {
|
|
1629
1249
|
const channel = `dex-wallet-trade:${chain}_${walletAddress}`;
|
|
1630
|
-
return this.subscribe(
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1250
|
+
return this.subscribe(
|
|
1251
|
+
channel,
|
|
1252
|
+
(data) => callback({
|
|
1253
|
+
tokenAddress: data.a,
|
|
1254
|
+
timestamp: data.t,
|
|
1255
|
+
kind: data.k,
|
|
1256
|
+
buyAmount: data.ba,
|
|
1257
|
+
buyAmountInUsd: data.baiu,
|
|
1258
|
+
buyTokenAddress: data.btma,
|
|
1259
|
+
buyTokenName: data.btn,
|
|
1260
|
+
buyTokenSymbol: data.bts,
|
|
1261
|
+
buyWalletAddress: data.bwa,
|
|
1262
|
+
sellAmount: data.sa,
|
|
1263
|
+
sellAmountInUsd: data.saiu,
|
|
1264
|
+
sellTokenAddress: data.stma,
|
|
1265
|
+
sellTokenName: data.stn,
|
|
1266
|
+
sellTokenSymbol: data.sts,
|
|
1267
|
+
sellWalletAddress: data.swa,
|
|
1268
|
+
txHash: data.h
|
|
1269
|
+
}),
|
|
1270
|
+
filter,
|
|
1271
|
+
"subscribeTokenTrades"
|
|
1272
|
+
);
|
|
1648
1273
|
}
|
|
1649
1274
|
subscribeDexPoolBalance({
|
|
1650
1275
|
chain,
|
|
@@ -1664,7 +1289,7 @@ var StreamApi = class {
|
|
|
1664
1289
|
);
|
|
1665
1290
|
}
|
|
1666
1291
|
};
|
|
1667
|
-
var
|
|
1292
|
+
var StreamUnsubscribable = class {
|
|
1668
1293
|
constructor(streamApi, channel, fn) {
|
|
1669
1294
|
this.streamApi = streamApi;
|
|
1670
1295
|
this.channel = channel;
|
|
@@ -1676,51 +1301,51 @@ var StreamUnsubscrible = class {
|
|
|
1676
1301
|
};
|
|
1677
1302
|
|
|
1678
1303
|
// src/stream/stream.model.ts
|
|
1679
|
-
var
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
return
|
|
1685
|
-
})(
|
|
1686
|
-
var
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
return
|
|
1693
|
-
})(
|
|
1694
|
-
var
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
return
|
|
1698
|
-
})(
|
|
1699
|
-
var
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
return
|
|
1706
|
-
})(
|
|
1707
|
-
var
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
return
|
|
1715
|
-
})(
|
|
1304
|
+
var WsTokenActivityType = /* @__PURE__ */ ((WsTokenActivityType2) => {
|
|
1305
|
+
WsTokenActivityType2["Sell"] = "sell";
|
|
1306
|
+
WsTokenActivityType2["Buy"] = "buy";
|
|
1307
|
+
WsTokenActivityType2["AddLiquidity"] = "add_liquidity";
|
|
1308
|
+
WsTokenActivityType2["RemoveLiquidity"] = "remove_liquidity";
|
|
1309
|
+
return WsTokenActivityType2;
|
|
1310
|
+
})(WsTokenActivityType || {});
|
|
1311
|
+
var WsChannelType = /* @__PURE__ */ ((WsChannelType2) => {
|
|
1312
|
+
WsChannelType2["New"] = "new";
|
|
1313
|
+
WsChannelType2["HOT"] = "trending";
|
|
1314
|
+
WsChannelType2["US_STOCKS"] = "us_stocks";
|
|
1315
|
+
WsChannelType2["COMPLETED"] = "completed";
|
|
1316
|
+
WsChannelType2["GRADUATED"] = "graduated";
|
|
1317
|
+
return WsChannelType2;
|
|
1318
|
+
})(WsChannelType || {});
|
|
1319
|
+
var WsMetricType = /* @__PURE__ */ ((WsMetricType2) => {
|
|
1320
|
+
WsMetricType2["LIQUIDITY_IN_USD"] = "liquidity_in_usd";
|
|
1321
|
+
WsMetricType2["MIGRATED_RATIO"] = "migrated_ratio";
|
|
1322
|
+
return WsMetricType2;
|
|
1323
|
+
})(WsMetricType || {});
|
|
1324
|
+
var WsRankingType = /* @__PURE__ */ ((WsRankingType2) => {
|
|
1325
|
+
WsRankingType2["NEW"] = "new";
|
|
1326
|
+
WsRankingType2["HOT"] = "trending";
|
|
1327
|
+
WsRankingType2["STOCKS"] = "stocks";
|
|
1328
|
+
WsRankingType2["FINALSTRETCH"] = "completed";
|
|
1329
|
+
WsRankingType2["MIGRATED"] = "graduated";
|
|
1330
|
+
return WsRankingType2;
|
|
1331
|
+
})(WsRankingType || {});
|
|
1332
|
+
var WsDex = /* @__PURE__ */ ((WsDex2) => {
|
|
1333
|
+
WsDex2["PUMP_FUN"] = "pump_fun";
|
|
1334
|
+
WsDex2["RAYDIUM_LAUNCHPAD"] = "raydium_launchpad";
|
|
1335
|
+
WsDex2["METEOR_DYNAMIC_BOUNDING_CURVE"] = "meteora_dynamic_bounding_curve";
|
|
1336
|
+
WsDex2["BONK_FUN"] = "bonk_fun";
|
|
1337
|
+
WsDex2["BOOP_FUN"] = "boop_fun";
|
|
1338
|
+
WsDex2["MOONIT_FUN"] = "moonit_fun";
|
|
1339
|
+
return WsDex2;
|
|
1340
|
+
})(WsDex || {});
|
|
1716
1341
|
export {
|
|
1717
1342
|
CEL_FIELD_MAPPINGS,
|
|
1718
|
-
ChannelType,
|
|
1719
|
-
Dex,
|
|
1720
|
-
MetricType,
|
|
1721
|
-
RankingType,
|
|
1722
1343
|
StreamApi,
|
|
1723
|
-
|
|
1344
|
+
WsChannelType,
|
|
1345
|
+
WsDex,
|
|
1346
|
+
WsMetricType,
|
|
1347
|
+
WsRankingType,
|
|
1348
|
+
WsTokenActivityType,
|
|
1724
1349
|
getAvailableFields,
|
|
1725
1350
|
getFieldMappings,
|
|
1726
1351
|
replaceFilterFields
|