flash-sdk 10.10.6 → 10.100.2-alpha.0

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.
Files changed (57) hide show
  1. package/dist/CustodyAccount.d.ts +2 -2
  2. package/dist/MarketAccount.d.ts +2 -2
  3. package/dist/MarketAccount.js +1 -1
  4. package/dist/OraclePrice.d.ts +4 -2
  5. package/dist/OraclePrice.js +23 -4
  6. package/dist/OrderAccount.d.ts +1 -1
  7. package/dist/PerpetualsClient.d.ts +385 -4332
  8. package/dist/PerpetualsClient.js +6254 -4927
  9. package/dist/PoolAccount.d.ts +3 -0
  10. package/dist/PoolConfig.d.ts +9 -2
  11. package/dist/PoolConfig.js +67 -4
  12. package/dist/PoolConfig.json +87 -4032
  13. package/dist/PoolDataClient.js +12 -11
  14. package/dist/PositionAccount.d.ts +6 -3
  15. package/dist/TokenStakeAccount.d.ts +24 -4
  16. package/dist/TokenStakeAccount.js +44 -2
  17. package/dist/TokenVaultAccount.d.ts +1 -0
  18. package/dist/ViewHelper.d.ts +2 -1
  19. package/dist/ViewHelper.js +17 -20
  20. package/dist/backupOracle.d.ts +0 -1
  21. package/dist/backupOracle.js +26 -5
  22. package/dist/constants/index.d.ts +1 -0
  23. package/dist/constants/index.js +2 -1
  24. package/dist/idl/perpetuals.d.ts +29203 -11085
  25. package/dist/idl/perpetuals.js +0 -16293
  26. package/dist/idl/perpetuals.json +34411 -0
  27. package/dist/index.d.ts +4 -2
  28. package/dist/index.js +7 -3
  29. package/dist/remoraTokensWithPriceIds.d.ts +13 -0
  30. package/dist/remoraTokensWithPriceIds.js +265 -0
  31. package/dist/testPublkey.d.ts +0 -0
  32. package/dist/testPublkey.js +0 -0
  33. package/dist/testSize.d.ts +0 -0
  34. package/dist/testSize.js +0 -0
  35. package/dist/tsconfig.tsbuildinfo +1 -1
  36. package/dist/types/generated.d.ts +2556 -0
  37. package/dist/types/generated.js +2 -0
  38. package/dist/types/index.d.ts +52 -144
  39. package/dist/types/index.js +22 -4
  40. package/dist/utils/IdlCoder.d.ts +3 -2
  41. package/dist/utils/IdlCoder.js +4 -2
  42. package/dist/utils/anchorCpiEvents.d.ts +1 -2
  43. package/dist/utils/anchorCpiEvents.js +10 -6
  44. package/dist/utils/getReferralAccounts.d.ts +1 -1
  45. package/dist/utils/getReferralAccounts.js +3 -8
  46. package/dist/xstocksTokensWithPriceIds.d.ts +13 -0
  47. package/dist/xstocksTokensWithPriceIds.js +369 -0
  48. package/package.json +9 -5
  49. package/readme.md +37 -3
  50. package/dist/TradingAccount.d.ts +0 -24
  51. package/dist/TradingAccount.js +0 -17
  52. package/dist/idl/fbnft_rewards.d.ts +0 -290
  53. package/dist/idl/fbnft_rewards.js +0 -292
  54. package/dist/idl/perp_composability.d.ts +0 -760
  55. package/dist/idl/perp_composability.js +0 -762
  56. package/dist/idl/reward_distribution.d.ts +0 -347
  57. package/dist/idl/reward_distribution.js +0 -349
@@ -0,0 +1,369 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.XSTOCKS_TOKENS_WITH_PRICE_IDS = void 0;
4
+ exports.XSTOCKS_TOKENS_WITH_PRICE_IDS = [
5
+ {
6
+ "symbol": "SPY",
7
+ "mintKey": "spyuvZbBgdKKQEYJNyYv3kLdF32Bpn6z2eDmfhpwAQA",
8
+ "decimals": 8,
9
+ "usdPrecision": 2,
10
+ "tokenPrecision": 4,
11
+ "isStable": false,
12
+ "isVirtual": false,
13
+ "lazerId": 1398,
14
+ "pythTicker": "Equity.US.SPY/USD",
15
+ "pythPriceId": "0x19e09bb805456ada3979a7d1cbb4b6d63babc3a0f8e8a9509f68afa5c4c11cd5",
16
+ "isToken2022": true
17
+ },
18
+ {
19
+ "symbol": "SPY",
20
+ "mintKey": "spyuvZbBgdKKQEYJNyYv3kLdF32Bpn6z2eDmfhpwAQA",
21
+ "decimals": 8,
22
+ "usdPrecision": 2,
23
+ "tokenPrecision": 4,
24
+ "isStable": false,
25
+ "isVirtual": false,
26
+ "lazerId": -1,
27
+ "pythTicker": "Equity.US.SPY/USD.ON",
28
+ "pythPriceId": "0x05d590e94e9f51abe18ed0421bc302995673156750e914ac1600583fe2e03f99",
29
+ "isToken2022": true
30
+ },
31
+ {
32
+ "symbol": "SPY",
33
+ "mintKey": "spyuvZbBgdKKQEYJNyYv3kLdF32Bpn6z2eDmfhpwAQA",
34
+ "decimals": 8,
35
+ "usdPrecision": 2,
36
+ "tokenPrecision": 4,
37
+ "isStable": false,
38
+ "isVirtual": false,
39
+ "lazerId": -1,
40
+ "pythTicker": "Equity.US.SPY/USD.PRE",
41
+ "pythPriceId": "0x34f6ef70940cb9b6a37e030689612bf454f59f4a2fc5d3e03bdf2b330a088107",
42
+ "isToken2022": true
43
+ },
44
+ {
45
+ "symbol": "SPY",
46
+ "mintKey": "spyuvZbBgdKKQEYJNyYv3kLdF32Bpn6z2eDmfhpwAQA",
47
+ "decimals": 8,
48
+ "usdPrecision": 2,
49
+ "tokenPrecision": 4,
50
+ "isStable": false,
51
+ "isVirtual": false,
52
+ "lazerId": -1,
53
+ "pythTicker": "Equity.US.SPY/USD.POST",
54
+ "pythPriceId": "0x5374a7d76a45ae2443cef351d10482b7bcc6ef5a928e75030d63b5fb3abe7cb5",
55
+ "isToken2022": true
56
+ },
57
+ {
58
+ "symbol": "NVDA",
59
+ "mintKey": "nvdaF6Aboy87YmKQBFvrVGoXSKZdv7ZW1rgrRri1AL5",
60
+ "decimals": 8,
61
+ "usdPrecision": 4,
62
+ "tokenPrecision": 4,
63
+ "isStable": false,
64
+ "isVirtual": true,
65
+ "lazerId": 1314,
66
+ "pythTicker": "Equity.US.NVDA/USD",
67
+ "pythPriceId": "0xb1073854ed24cbc755dc527418f52b7d271f6cc967bbf8d8129112b18860a593",
68
+ "isToken2022": true
69
+ },
70
+ {
71
+ "symbol": "NVDA",
72
+ "mintKey": "nvdaF6Aboy87YmKQBFvrVGoXSKZdv7ZW1rgrRri1AL5",
73
+ "decimals": 8,
74
+ "usdPrecision": 4,
75
+ "tokenPrecision": 4,
76
+ "isStable": false,
77
+ "isVirtual": true,
78
+ "lazerId": -1,
79
+ "pythTicker": "Equity.US.NVDA/USD.ON",
80
+ "pythPriceId": "0xc949a96fd1626e82abc5e1496e6e8d44683ac8ac288015ee90bf37257e3e6bf6",
81
+ "isToken2022": true
82
+ },
83
+ {
84
+ "symbol": "NVDA",
85
+ "mintKey": "nvdaF6Aboy87YmKQBFvrVGoXSKZdv7ZW1rgrRri1AL5",
86
+ "decimals": 8,
87
+ "usdPrecision": 4,
88
+ "tokenPrecision": 4,
89
+ "isStable": false,
90
+ "isVirtual": true,
91
+ "lazerId": -1,
92
+ "pythTicker": "Equity.US.NVDA/USD.PRE",
93
+ "pythPriceId": "0x61c4ca5b9731a79e285a01e24432d57d89f0ecdd4cd7828196ca8992d5eafef6",
94
+ "isToken2022": true
95
+ },
96
+ {
97
+ "symbol": "NVDA",
98
+ "mintKey": "nvdaF6Aboy87YmKQBFvrVGoXSKZdv7ZW1rgrRri1AL5",
99
+ "decimals": 8,
100
+ "usdPrecision": 4,
101
+ "tokenPrecision": 4,
102
+ "isStable": false,
103
+ "isVirtual": true,
104
+ "lazerId": -1,
105
+ "pythTicker": "Equity.US.NVDA/USD.POST",
106
+ "pythPriceId": "0x25719379353a508b1531945f3c466759d6efd866f52fbaeb3631decb70ba381f",
107
+ "isToken2022": true
108
+ },
109
+ {
110
+ "symbol": "TSLA",
111
+ "mintKey": "tsLa7sgn8gcgfDYY9y2zEJkifxBZdSW3rCc3y6zF6sN",
112
+ "decimals": 8,
113
+ "usdPrecision": 2,
114
+ "tokenPrecision": 4,
115
+ "isStable": false,
116
+ "isVirtual": true,
117
+ "lazerId": 1435,
118
+ "pythTicker": "Equity.US.TSLA/USD",
119
+ "pythPriceId": "0x16dad506d7db8da01c87581c87ca897a012a153557d4d578c3b9c9e1bc0632f1",
120
+ "isToken2022": true
121
+ },
122
+ {
123
+ "symbol": "TSLA",
124
+ "mintKey": "tsLa7sgn8gcgfDYY9y2zEJkifxBZdSW3rCc3y6zF6sN",
125
+ "decimals": 8,
126
+ "usdPrecision": 2,
127
+ "tokenPrecision": 4,
128
+ "isStable": false,
129
+ "isVirtual": true,
130
+ "lazerId": -1,
131
+ "pythTicker": "Equity.US.TSLA/USD.ON",
132
+ "pythPriceId": "0x713631e41c06db404e6a5d029f3eebfd5b885c59dce4a19f337c024e26584e26",
133
+ "isToken2022": true
134
+ },
135
+ {
136
+ "symbol": "TSLA",
137
+ "mintKey": "tsLa7sgn8gcgfDYY9y2zEJkifxBZdSW3rCc3y6zF6sN",
138
+ "decimals": 8,
139
+ "usdPrecision": 2,
140
+ "tokenPrecision": 4,
141
+ "isStable": false,
142
+ "isVirtual": true,
143
+ "lazerId": -1,
144
+ "pythTicker": "Equity.US.TSLA/USD.PRE",
145
+ "pythPriceId": "0x42676a595d0099c381687124805c8bb22c75424dffcaa55e3dc6549854ebe20a",
146
+ "isToken2022": true
147
+ },
148
+ {
149
+ "symbol": "TSLA",
150
+ "mintKey": "tsLa7sgn8gcgfDYY9y2zEJkifxBZdSW3rCc3y6zF6sN",
151
+ "decimals": 8,
152
+ "usdPrecision": 2,
153
+ "tokenPrecision": 4,
154
+ "isStable": false,
155
+ "isVirtual": true,
156
+ "lazerId": -1,
157
+ "pythTicker": "Equity.US.TSLA/USD.POST",
158
+ "pythPriceId": "0x2a797e196973b72447e0ab8e841d9f5706c37dc581fe66a0bd21bcd256cdb9b9",
159
+ "isToken2022": true
160
+ },
161
+ {
162
+ "symbol": "AAPL",
163
+ "mintKey": "aapLb8vsHWxU4joELEs3eDWFiQSDm9gxQM4fxsScktF",
164
+ "decimals": 8,
165
+ "usdPrecision": 4,
166
+ "tokenPrecision": 4,
167
+ "isStable": false,
168
+ "isVirtual": true,
169
+ "lazerId": 922,
170
+ "pythTicker": "Equity.US.AAPL/USD",
171
+ "pythPriceId": "0x49f6b65cb1de6b10eaf75e7c03ca029c306d0357e91b5311b175084a5ad55688",
172
+ "isToken2022": true
173
+ },
174
+ {
175
+ "symbol": "AAPL",
176
+ "mintKey": "aapLb8vsHWxU4joELEs3eDWFiQSDm9gxQM4fxsScktF",
177
+ "decimals": 8,
178
+ "usdPrecision": 4,
179
+ "tokenPrecision": 4,
180
+ "isStable": false,
181
+ "isVirtual": true,
182
+ "lazerId": -1,
183
+ "pythTicker": "Equity.US.AAPL/USD.ON",
184
+ "pythPriceId": "0x241b9a5ce1c3e4bfc68e377158328628f1b478afaa796c4b1760bd3713c2d2d2",
185
+ "isToken2022": true
186
+ },
187
+ {
188
+ "symbol": "AAPL",
189
+ "mintKey": "aapLb8vsHWxU4joELEs3eDWFiQSDm9gxQM4fxsScktF",
190
+ "decimals": 8,
191
+ "usdPrecision": 4,
192
+ "tokenPrecision": 4,
193
+ "isStable": false,
194
+ "isVirtual": true,
195
+ "lazerId": -1,
196
+ "pythTicker": "Equity.US.AAPL/USD.PRE",
197
+ "pythPriceId": "0x8c320e4cd87c6cef41513aead15db413cf9253211923fef6e87187a7f6688906",
198
+ "isToken2022": true
199
+ },
200
+ {
201
+ "symbol": "AAPL",
202
+ "mintKey": "aapLb8vsHWxU4joELEs3eDWFiQSDm9gxQM4fxsScktF",
203
+ "decimals": 8,
204
+ "usdPrecision": 4,
205
+ "tokenPrecision": 4,
206
+ "isStable": false,
207
+ "isVirtual": true,
208
+ "lazerId": -1,
209
+ "pythTicker": "Equity.US.AAPL/USD.POST",
210
+ "pythPriceId": "0x5a207c4aa0114baecf852fcd9db9beb8ec715f2db48caa525dbd878fd416fb09",
211
+ "isToken2022": true
212
+ },
213
+ {
214
+ "symbol": "AMD",
215
+ "mintKey": "amdeJcqig8WB7fzMYp8YccbXgQUrLRyeAPKMSZyyJzh",
216
+ "decimals": 8,
217
+ "usdPrecision": 4,
218
+ "tokenPrecision": 4,
219
+ "isStable": false,
220
+ "isVirtual": true,
221
+ "lazerId": 949,
222
+ "pythTicker": "Equity.US.AMD/USD",
223
+ "pythPriceId": "0x3622e381dbca2efd1859253763b1adc63f7f9abb8e76da1aa8e638a57ccde93e",
224
+ "isToken2022": true
225
+ },
226
+ {
227
+ "symbol": "AMD",
228
+ "mintKey": "amdeJcqig8WB7fzMYp8YccbXgQUrLRyeAPKMSZyyJzh",
229
+ "decimals": 8,
230
+ "usdPrecision": 4,
231
+ "tokenPrecision": 4,
232
+ "isStable": false,
233
+ "isVirtual": true,
234
+ "lazerId": -1,
235
+ "pythTicker": "Equity.US.AMD/USD.ON",
236
+ "pythPriceId": "0x7178689d88cdd76574b64438fc57f4e57efaf0bf5f9593ee19c10e46a3c5b5cf",
237
+ "isToken2022": true
238
+ },
239
+ {
240
+ "symbol": "AMD",
241
+ "mintKey": "amdeJcqig8WB7fzMYp8YccbXgQUrLRyeAPKMSZyyJzh",
242
+ "decimals": 8,
243
+ "usdPrecision": 4,
244
+ "tokenPrecision": 4,
245
+ "isStable": false,
246
+ "isVirtual": true,
247
+ "lazerId": -1,
248
+ "pythTicker": "Equity.US.AMD/USD.PRE",
249
+ "pythPriceId": "0x441bc31e56932a8764a3bdb90059ca540e41c669dc0641e38b57b5e0606301ed",
250
+ "isToken2022": true
251
+ },
252
+ {
253
+ "symbol": "AMD",
254
+ "mintKey": "amdeJcqig8WB7fzMYp8YccbXgQUrLRyeAPKMSZyyJzh",
255
+ "decimals": 8,
256
+ "usdPrecision": 4,
257
+ "tokenPrecision": 4,
258
+ "isStable": false,
259
+ "isVirtual": true,
260
+ "lazerId": -1,
261
+ "pythTicker": "Equity.US.AMD/USD.POST",
262
+ "pythPriceId": "0x6969003ef4c5fbb3b57a6be3883102362d05572c2dc7f72b767ad48f4206204b",
263
+ "isToken2022": true
264
+ },
265
+ {
266
+ "symbol": "AMZN",
267
+ "mintKey": "amznH3gG6DBfs9c5F8q7pHd1SRfFfJr5q4hAKvqwUjj",
268
+ "decimals": 8,
269
+ "usdPrecision": 4,
270
+ "tokenPrecision": 4,
271
+ "isStable": false,
272
+ "isVirtual": true,
273
+ "lazerId": 954,
274
+ "pythTicker": "Equity.US.AMZN/USD",
275
+ "pythPriceId": "0xb5d0e0fa58a1f8b81498ae670ce93c872d14434b72c364885d4fa1b257cbb07a",
276
+ "isToken2022": true
277
+ },
278
+ {
279
+ "symbol": "AMZN",
280
+ "mintKey": "amznH3gG6DBfs9c5F8q7pHd1SRfFfJr5q4hAKvqwUjj",
281
+ "decimals": 8,
282
+ "usdPrecision": 4,
283
+ "tokenPrecision": 4,
284
+ "isStable": false,
285
+ "isVirtual": true,
286
+ "lazerId": -1,
287
+ "pythTicker": "Equity.US.AMZN/USD.ON",
288
+ "pythPriceId": "0x4ec1330b56eca05037c6b5a51d05f73db79bf3b4d29899881acd27966af184b4",
289
+ "isToken2022": true
290
+ },
291
+ {
292
+ "symbol": "AMZN",
293
+ "mintKey": "amznH3gG6DBfs9c5F8q7pHd1SRfFfJr5q4hAKvqwUjj",
294
+ "decimals": 8,
295
+ "usdPrecision": 4,
296
+ "tokenPrecision": 4,
297
+ "isStable": false,
298
+ "isVirtual": true,
299
+ "lazerId": -1,
300
+ "pythTicker": "Equity.US.AMZN/USD.PRE",
301
+ "pythPriceId": "0x82c59e36a8e0247e15283748d6cd51f5fa1019d73fbf3ab6d927e17d9e357a7f",
302
+ "isToken2022": true
303
+ },
304
+ {
305
+ "symbol": "AMZN",
306
+ "mintKey": "amznH3gG6DBfs9c5F8q7pHd1SRfFfJr5q4hAKvqwUjj",
307
+ "decimals": 8,
308
+ "usdPrecision": 4,
309
+ "tokenPrecision": 4,
310
+ "isStable": false,
311
+ "isVirtual": true,
312
+ "lazerId": -1,
313
+ "pythTicker": "Equity.US.AMZN/USD.POST",
314
+ "pythPriceId": "0x62731dfcc8b8542e52753f208248c3e73fab2ec15422d6f65c2decda71ccea0d",
315
+ "isToken2022": true
316
+ },
317
+ {
318
+ "symbol": "PLTR",
319
+ "mintKey": "pLtrKwWKNt24HGhdNsVaytZqLjBXvrqt2g1EavxUTru",
320
+ "decimals": 8,
321
+ "usdPrecision": 4,
322
+ "tokenPrecision": 4,
323
+ "isStable": false,
324
+ "isVirtual": true,
325
+ "lazerId": 1346,
326
+ "pythTicker": "Equity.US.PLTR/USD",
327
+ "pythPriceId": "0x11a70634863ddffb71f2b11f2cff29f73f3db8f6d0b78c49f2b5f4ad36e885f0",
328
+ "isToken2022": true
329
+ },
330
+ {
331
+ "symbol": "PLTR",
332
+ "mintKey": "pLtrKwWKNt24HGhdNsVaytZqLjBXvrqt2g1EavxUTru",
333
+ "decimals": 8,
334
+ "usdPrecision": 4,
335
+ "tokenPrecision": 4,
336
+ "isStable": false,
337
+ "isVirtual": true,
338
+ "lazerId": -1,
339
+ "pythTicker": "Equity.US.PLTR/USD.ON",
340
+ "pythPriceId": "0x3a4c922ec7e8cd86a6fa4005827e723a134a16f4ffe836eac91e7820c61f75a1",
341
+ "isToken2022": true
342
+ },
343
+ {
344
+ "symbol": "PLTR",
345
+ "mintKey": "pLtrKwWKNt24HGhdNsVaytZqLjBXvrqt2g1EavxUTru",
346
+ "decimals": 8,
347
+ "usdPrecision": 4,
348
+ "tokenPrecision": 4,
349
+ "isStable": false,
350
+ "isVirtual": true,
351
+ "lazerId": -1,
352
+ "pythTicker": "Equity.US.PLTR/USD.PRE",
353
+ "pythPriceId": "0xbd8a8e449278ad0b6512695b1c558f816309f045d4e3da21dfc19448281840e8",
354
+ "isToken2022": true
355
+ },
356
+ {
357
+ "symbol": "PLTR",
358
+ "mintKey": "pLtrKwWKNt24HGhdNsVaytZqLjBXvrqt2g1EavxUTru",
359
+ "decimals": 8,
360
+ "usdPrecision": 4,
361
+ "tokenPrecision": 4,
362
+ "isStable": false,
363
+ "isVirtual": true,
364
+ "lazerId": -1,
365
+ "pythTicker": "Equity.US.PLTR/USD.POST",
366
+ "pythPriceId": "0xb11610f59456057d9bc82b0795c6d7aea6e2e075fc3e1991abc05e2b2861abb2",
367
+ "isToken2022": true
368
+ }
369
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flash-sdk",
3
- "version": "10.10.6",
3
+ "version": "10.100.2-alpha.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -8,7 +8,10 @@
8
8
  ],
9
9
  "description": "Client to interact with the Flash program on Solana",
10
10
  "license": "MIT",
11
- "repository": "https://github.com/flash-trade/perpetuals-closed.git",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/flash-trade/perpetuals-closed.git"
14
+ },
12
15
  "author": {
13
16
  "name": "Flash Trade",
14
17
  "email": "admin@flash.trade",
@@ -17,12 +20,12 @@
17
20
  "scripts": {
18
21
  "prebuild": "rimraf dist ",
19
22
  "build": "tsc",
23
+ "generate-types": "ts-node scripts/generate-types.ts",
20
24
  "pub": "git add . && git commit -m \"Updates\" && npm version patch && npm run build && npm publish",
21
25
  "doc": "yarn typedoc --out docs src"
22
26
  },
23
27
  "dependencies": {
24
- "@coral-xyz/anchor": "=0.27.0",
25
- "@pythnetwork/client": "^2.19.0",
28
+ "@coral-xyz/anchor": "^0.32.1",
26
29
  "@pythnetwork/price-service-client": "^1.8.2",
27
30
  "@solana/spl-token": "^0.4.13",
28
31
  "@solana/web3.js": "=1.98.2",
@@ -48,5 +51,6 @@
48
51
  "ts-node": "^10.9.1",
49
52
  "typedoc": "^0.25.13",
50
53
  "typescript": "^5.3.3"
51
- }
54
+ },
55
+ "packageManager": "yarn@4.13.0"
52
56
  }
package/readme.md CHANGED
@@ -34,6 +34,7 @@ code : https://github.com/flash-trade/flash-trade-sdk.git
34
34
  });
35
35
  const perpClient = new PerpetualsClient(provider, programId);
36
36
 
37
+ // NOTE: choose the correct POOL_CONFIG based on the pool you want to interact
37
38
  // flp.1
38
39
  const POOL_CONFIG = PoolConfig.fromIdsByName('Crypto.1','mainnet-beta')
39
40
  // flp.2
@@ -42,9 +43,17 @@ code : https://github.com/flash-trade/flash-trade-sdk.git
42
43
  // const POOL_CONFIG = PoolConfig.fromIdsByName('Governance.1','mainnet-beta')
43
44
  // flp.4
44
45
  // const POOL_CONFIG = PoolConfig.fromIdsByName('Community.1','mainnet-beta')
46
+ // flp.5
47
+ // const POOL_CONFIG = PoolConfig.fromIdsByName('Community.2','mainnet-beta')
48
+ // flp.7
49
+ // const POOL_CONFIG = PoolConfig.fromIdsByName('Trump.1','mainnet-beta')
50
+ // flp.8
51
+ // const POOL_CONFIG = PoolConfig.fromIdsByName('Ore.1','mainnet-beta')
52
+ // flp.r
53
+ // const POOL_CONFIG = PoolConfig.fromIdsByName('Remora.1','mainnet-beta')
45
54
 
46
55
  const poolAddress = POOL_CONFIG.poolAddress.toBase58()
47
- const backupOracleData: any = await (await fetch(`https://beast.flash.trade/api/backup-oracle?poolAddress=${poolAddress}`)).json()
56
+ const backupOracleData: any = await (await fetch(`https://flash.trade/api/backup-oracle?poolAddress=${poolAddress}`)).json()
48
57
  const backUpOracleInstruction = new TransactionInstruction({
49
58
  keys: backupOracleData.keys,
50
59
  programId: new PublicKey(backupOracleData.programId),
@@ -73,9 +82,13 @@ code : https://github.com/flash-trade/flash-trade-sdk.git
73
82
  )
74
83
  const setCULimitIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 600_000 })
75
84
 
85
+ let addresslookupTables: AddressLookupTableAccount[] = (
86
+ await flashClient.getOrLoadAddressLookupTable(POOL_CONFIG)
87
+ ).addressLookupTables
88
+
76
89
  const txid = perpClient.sendTransaction([backUpOracleInstruction, setCULimitIx, ...addLiqInstructions ], {
77
90
  addLiqAdditionalSigners,
78
- alts: perpClient.addressLookupTables,
91
+ alts: addresslookupTables,
79
92
  })
80
93
 
81
94
  <!--addCompoundingLiquidity (USDC -> FLP.1 ) -->
@@ -107,9 +120,14 @@ code : https://github.com/flash-trade/flash-trade-sdk.git
107
120
  true
108
121
  )
109
122
  const setCULimitIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 600_000 })
123
+
124
+ let addresslookupTables: AddressLookupTableAccount[] = (
125
+ await flashClient.getOrLoadAddressLookupTable(POOL_CONFIG)
126
+ ).addressLookupTables
127
+
110
128
  const txid = perpClient.sendTransaction([backUpOracleInstruction, setCULimitIx, ...removeCompLiqInstructions ], {
111
129
  removeCompLiqAdditionalSigners,
112
- alts: perpClient.addressLookupTables,
130
+ alts: addresslookupTables,
113
131
  })
114
132
 
115
133
  <!-- remove Liquidity (sFLP -> USDC) -->
@@ -121,6 +139,11 @@ code : https://github.com/flash-trade/flash-trade-sdk.git
121
139
  POOL_CONFIG
122
140
  )
123
141
  const setCULimitIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 600_000 })
142
+
143
+ let addresslookupTables: AddressLookupTableAccount[] = (
144
+ await flashClient.getOrLoadAddressLookupTable(POOL_CONFIG)
145
+ ).addressLookupTables
146
+
124
147
  const txid = perpClient.sendTransaction([backUpOracleInstruction, setCULimitIx, ...removeLiqInstructions ], {
125
148
  removeLiqAdditionalSigners,
126
149
  alts: perpClient.addressLookupTables,
@@ -131,6 +154,9 @@ code : https://github.com/flash-trade/flash-trade-sdk.git
131
154
  const { instructions: depositStakeInstructions, additionalSigners: depositStakeAdditionalSigners } =
132
155
  await perpClient.depositStake(.provider.wallet.publicKey, provider.wallet.publicKey, flpDepositAmount, POOL_CONFIG)
133
156
 
157
+ let addresslookupTables: AddressLookupTableAccount[] = (
158
+ await flashClient.getOrLoadAddressLookupTable(POOL_CONFIG)
159
+ ).addressLookupTables
134
160
  const txid = perpClient.sendTransaction([...depositStakeInstructions ], {
135
161
  depositStakeAdditionalSigners,
136
162
  alts: perpClient.addressLookupTables,
@@ -143,6 +169,10 @@ code : https://github.com/flash-trade/flash-trade-sdk.git
143
169
 
144
170
  const { instructions: withdrawStakeInstructions } = await perpClient.withdrawStake(POOL_CONFIG, false)
145
171
 
172
+ let addresslookupTables: AddressLookupTableAccount[] = (
173
+ await flashClient.getOrLoadAddressLookupTable(POOL_CONFIG)
174
+ ).addressLookupTables
175
+
146
176
  const txid = perpClient.sendTransaction([...unstakeInstantInstructions, ...withdrawStakeInstructions ], {
147
177
  unstakeInstantAdditionalSigners,
148
178
  alts: perpClient.addressLookupTables,
@@ -153,6 +183,10 @@ code : https://github.com/flash-trade/flash-trade-sdk.git
153
183
 
154
184
  const { instructions, additionalSigners } = await perpClient.collectStakeFees('USDC',POOL_CONFIG)
155
185
 
186
+ let addresslookupTables: AddressLookupTableAccount[] = (
187
+ await flashClient.getOrLoadAddressLookupTable(POOL_CONFIG)
188
+ ).addressLookupTables
189
+
156
190
  const txid = perpClient.sendTransaction([...instructions ], {
157
191
  additionalSigners,
158
192
  alts: perpClient.addressLookupTables,
@@ -1,24 +0,0 @@
1
- /// <reference types="bn.js" />
2
- import { BN } from "@coral-xyz/anchor";
3
- import { Trading, VoltageStats } from "./types";
4
- import { PublicKey } from "@solana/web3.js";
5
- export declare class TradingAccount implements Trading {
6
- publicKey: PublicKey;
7
- nftMint: PublicKey;
8
- owner: PublicKey;
9
- delegate: PublicKey;
10
- isInitialized: boolean;
11
- level: number;
12
- bump: number;
13
- voltagePoints: BN;
14
- stats: VoltageStats;
15
- snapshot: VoltageStats;
16
- timestamp: BN;
17
- counter: BN;
18
- tokenStakeAccount: PublicKey;
19
- burnt: boolean;
20
- padding: number[];
21
- constructor(publicKey: PublicKey, parseData: Trading);
22
- static from(publicKey: PublicKey, parseData: Trading): TradingAccount;
23
- updatePoolData(parseData: Trading): void;
24
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TradingAccount = void 0;
4
- var TradingAccount = (function () {
5
- function TradingAccount(publicKey, parseData) {
6
- this.publicKey = publicKey;
7
- Object.assign(this, parseData);
8
- }
9
- TradingAccount.from = function (publicKey, parseData) {
10
- return new TradingAccount(publicKey, parseData);
11
- };
12
- TradingAccount.prototype.updatePoolData = function (parseData) {
13
- Object.assign(this, parseData);
14
- };
15
- return TradingAccount;
16
- }());
17
- exports.TradingAccount = TradingAccount;