@sonarwatch/portfolio-plugins 0.12.176 → 0.12.177
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1510 -1506
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/elemental/constants.d.ts +6 -0
- package/src/plugins/elemental/constants.js +20 -0
- package/src/plugins/elemental/constants.js.map +1 -0
- package/src/plugins/elemental/depositFetcher.d.ts +5 -0
- package/src/plugins/elemental/depositFetcher.js +96 -0
- package/src/plugins/elemental/depositFetcher.js.map +1 -0
- package/src/plugins/elemental/elementalVaultIDL.d.ts +67 -0
- package/src/plugins/elemental/elementalVaultIDL.js +342 -0
- package/src/plugins/elemental/elementalVaultIDL.js.map +1 -0
- package/src/plugins/elemental/filters.d.ts +3 -0
- package/src/plugins/elemental/filters.js +21 -0
- package/src/plugins/elemental/filters.js.map +1 -0
- package/src/plugins/elemental/helpers.d.ts +5 -0
- package/src/plugins/elemental/helpers.js +29 -0
- package/src/plugins/elemental/helpers.js.map +1 -0
- package/src/plugins/elemental/index.d.ts +6 -0
- package/src/plugins/elemental/index.js +13 -0
- package/src/plugins/elemental/index.js.map +1 -0
- package/src/plugins/elemental/poolsJob.d.ts +3 -0
- package/src/plugins/elemental/poolsJob.js +35 -0
- package/src/plugins/elemental/poolsJob.js.map +1 -0
- package/src/plugins/elemental/structs.d.ts +48 -0
- package/src/plugins/elemental/structs.js +50 -0
- package/src/plugins/elemental/structs.js.map +1 -0
- package/src/plugins/elemental/types.d.ts +37 -0
- package/src/plugins/elemental/types.js +3 -0
- package/src/plugins/elemental/types.js.map +1 -0
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- package/src/utils/elementbuilder/AssetBuilder.d.ts +2 -1
- package/src/utils/elementbuilder/AssetBuilder.js +2 -1
- package/src/utils/elementbuilder/AssetBuilder.js.map +1 -1
- package/src/utils/elementbuilder/PortfolioAssetParams.d.ts +2 -0
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
@@ -0,0 +1,342 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.elementalIDLs = void 0;
|
4
|
+
exports.elementalIDLs = {
|
5
|
+
address: 'ELE5vYY81W7UCpTPs7SyD6Bwm5FwZBntTW8PiGqM5d4A',
|
6
|
+
metadata: {
|
7
|
+
name: 'elemental_vault',
|
8
|
+
version: '2.0.0',
|
9
|
+
spec: '0.1.0',
|
10
|
+
description: 'Created with Anchor',
|
11
|
+
},
|
12
|
+
accounts: [
|
13
|
+
{
|
14
|
+
name: 'Pool',
|
15
|
+
discriminator: [241, 154, 109, 4, 17, 177, 109, 188],
|
16
|
+
},
|
17
|
+
{
|
18
|
+
name: 'Position',
|
19
|
+
discriminator: [170, 188, 143, 228, 122, 64, 247, 208],
|
20
|
+
},
|
21
|
+
],
|
22
|
+
events: [
|
23
|
+
{
|
24
|
+
name: 'PoolUpdatedEvent',
|
25
|
+
discriminator: [128, 39, 94, 221, 230, 222, 127, 141],
|
26
|
+
},
|
27
|
+
{
|
28
|
+
name: 'PositionUpdatedEvent',
|
29
|
+
discriminator: [232, 11, 46, 106, 210, 142, 60, 172],
|
30
|
+
},
|
31
|
+
],
|
32
|
+
errors: [
|
33
|
+
{
|
34
|
+
code: 6000,
|
35
|
+
name: 'EpochDuration',
|
36
|
+
msg: 'Current epoch is not ended',
|
37
|
+
},
|
38
|
+
{
|
39
|
+
code: 6001,
|
40
|
+
name: 'MaxSupply',
|
41
|
+
msg: 'Maximum supply exceeded',
|
42
|
+
},
|
43
|
+
{
|
44
|
+
code: 6002,
|
45
|
+
name: 'MaxDepositAmount',
|
46
|
+
msg: 'Maximum deposit amount exceeded',
|
47
|
+
},
|
48
|
+
{
|
49
|
+
code: 6003,
|
50
|
+
name: 'MinDepositAmount',
|
51
|
+
msg: 'Minimum deposit amount required',
|
52
|
+
},
|
53
|
+
{
|
54
|
+
code: 6004,
|
55
|
+
name: 'Activating',
|
56
|
+
msg: 'Deposit is in progress',
|
57
|
+
},
|
58
|
+
{
|
59
|
+
code: 6005,
|
60
|
+
name: 'Deactivating',
|
61
|
+
msg: 'Withdrawal is in progress',
|
62
|
+
},
|
63
|
+
{
|
64
|
+
code: 6006,
|
65
|
+
name: 'InsufficientBalance',
|
66
|
+
msg: 'Insufficient balance to withdraw',
|
67
|
+
},
|
68
|
+
{
|
69
|
+
code: 6007,
|
70
|
+
name: 'InsufficientFaucet',
|
71
|
+
msg: 'Insufficient balance in faucet',
|
72
|
+
},
|
73
|
+
],
|
74
|
+
types: [
|
75
|
+
{
|
76
|
+
name: 'Pool',
|
77
|
+
type: {
|
78
|
+
kind: 'struct',
|
79
|
+
fields: [
|
80
|
+
{
|
81
|
+
name: 'liquidity_mint',
|
82
|
+
type: 'pubkey',
|
83
|
+
},
|
84
|
+
{
|
85
|
+
name: 'liquidity_holder',
|
86
|
+
type: 'pubkey',
|
87
|
+
},
|
88
|
+
{
|
89
|
+
name: 'per_token_amount',
|
90
|
+
type: 'u64',
|
91
|
+
},
|
92
|
+
{
|
93
|
+
name: 'max_deposit_amount',
|
94
|
+
type: 'u64',
|
95
|
+
},
|
96
|
+
{
|
97
|
+
name: 'min_deposit_amount',
|
98
|
+
type: 'u64',
|
99
|
+
},
|
100
|
+
{
|
101
|
+
name: 'max_supply',
|
102
|
+
type: 'u64',
|
103
|
+
},
|
104
|
+
{
|
105
|
+
name: 'current_supply',
|
106
|
+
type: 'u64',
|
107
|
+
},
|
108
|
+
{
|
109
|
+
name: 'next_supply',
|
110
|
+
type: 'u64',
|
111
|
+
},
|
112
|
+
{
|
113
|
+
name: 'reward_per_token',
|
114
|
+
type: 'u64',
|
115
|
+
},
|
116
|
+
{
|
117
|
+
name: 'reward_annual_rate',
|
118
|
+
type: 'u64',
|
119
|
+
},
|
120
|
+
{
|
121
|
+
name: 'deactivating_amount_n0',
|
122
|
+
type: 'u64',
|
123
|
+
},
|
124
|
+
{
|
125
|
+
name: 'claiming_amount_n0',
|
126
|
+
type: 'u64',
|
127
|
+
},
|
128
|
+
{
|
129
|
+
name: 'deactivating_amount_n1',
|
130
|
+
type: 'u64',
|
131
|
+
},
|
132
|
+
{
|
133
|
+
name: 'claiming_amount_n1',
|
134
|
+
type: 'u64',
|
135
|
+
},
|
136
|
+
{
|
137
|
+
name: 'pending_amount',
|
138
|
+
type: 'u64',
|
139
|
+
},
|
140
|
+
{
|
141
|
+
name: 'epoch_duration',
|
142
|
+
type: 'u32',
|
143
|
+
},
|
144
|
+
{
|
145
|
+
name: 'epoch_index',
|
146
|
+
type: 'u32',
|
147
|
+
},
|
148
|
+
{
|
149
|
+
name: 'epoch_start_time',
|
150
|
+
type: 'u32',
|
151
|
+
},
|
152
|
+
{
|
153
|
+
name: 'authority_bump',
|
154
|
+
type: 'u8',
|
155
|
+
},
|
156
|
+
{
|
157
|
+
name: 'admin',
|
158
|
+
type: 'pubkey',
|
159
|
+
},
|
160
|
+
{
|
161
|
+
name: 'pending_admin',
|
162
|
+
type: {
|
163
|
+
option: 'pubkey',
|
164
|
+
},
|
165
|
+
},
|
166
|
+
],
|
167
|
+
},
|
168
|
+
},
|
169
|
+
{
|
170
|
+
name: 'PoolUpdatedData',
|
171
|
+
type: {
|
172
|
+
kind: 'struct',
|
173
|
+
fields: [
|
174
|
+
{
|
175
|
+
name: 'current_supply',
|
176
|
+
type: 'u64',
|
177
|
+
},
|
178
|
+
{
|
179
|
+
name: 'next_supply',
|
180
|
+
type: 'u64',
|
181
|
+
},
|
182
|
+
{
|
183
|
+
name: 'reward_per_token',
|
184
|
+
type: 'u64',
|
185
|
+
},
|
186
|
+
{
|
187
|
+
name: 'deactivating_amount_n0',
|
188
|
+
type: 'u64',
|
189
|
+
},
|
190
|
+
{
|
191
|
+
name: 'claiming_amount_n0',
|
192
|
+
type: 'u64',
|
193
|
+
},
|
194
|
+
{
|
195
|
+
name: 'deactivating_amount_n1',
|
196
|
+
type: 'u64',
|
197
|
+
},
|
198
|
+
{
|
199
|
+
name: 'claiming_amount_n1',
|
200
|
+
type: 'u64',
|
201
|
+
},
|
202
|
+
{
|
203
|
+
name: 'pending_amount',
|
204
|
+
type: 'u64',
|
205
|
+
},
|
206
|
+
{
|
207
|
+
name: 'epoch_index',
|
208
|
+
type: 'u32',
|
209
|
+
},
|
210
|
+
{
|
211
|
+
name: 'epoch_start_time',
|
212
|
+
type: 'u32',
|
213
|
+
},
|
214
|
+
],
|
215
|
+
},
|
216
|
+
},
|
217
|
+
{
|
218
|
+
name: 'PoolUpdatedEvent',
|
219
|
+
type: {
|
220
|
+
kind: 'struct',
|
221
|
+
fields: [
|
222
|
+
{
|
223
|
+
name: 'pubkey',
|
224
|
+
type: 'pubkey',
|
225
|
+
},
|
226
|
+
{
|
227
|
+
name: 'data',
|
228
|
+
type: {
|
229
|
+
defined: {
|
230
|
+
name: 'PoolUpdatedData',
|
231
|
+
},
|
232
|
+
},
|
233
|
+
},
|
234
|
+
],
|
235
|
+
},
|
236
|
+
},
|
237
|
+
{
|
238
|
+
name: 'Position',
|
239
|
+
repr: {
|
240
|
+
kind: 'c',
|
241
|
+
},
|
242
|
+
type: {
|
243
|
+
kind: 'struct',
|
244
|
+
fields: [
|
245
|
+
{
|
246
|
+
name: 'pool',
|
247
|
+
type: 'pubkey',
|
248
|
+
},
|
249
|
+
{
|
250
|
+
name: 'owner',
|
251
|
+
type: 'pubkey',
|
252
|
+
},
|
253
|
+
{
|
254
|
+
name: 'reward_before_deposit',
|
255
|
+
type: 'u64',
|
256
|
+
},
|
257
|
+
{
|
258
|
+
name: 'reward_earned',
|
259
|
+
type: 'u64',
|
260
|
+
},
|
261
|
+
{
|
262
|
+
name: 'reward_claimed',
|
263
|
+
type: 'u64',
|
264
|
+
},
|
265
|
+
{
|
266
|
+
name: 'amount',
|
267
|
+
type: 'u64',
|
268
|
+
},
|
269
|
+
{
|
270
|
+
name: 'deactivating_amount',
|
271
|
+
type: 'u64',
|
272
|
+
},
|
273
|
+
{
|
274
|
+
name: 'claiming_amount',
|
275
|
+
type: 'u64',
|
276
|
+
},
|
277
|
+
{
|
278
|
+
name: 'last_updated_epoch_index',
|
279
|
+
type: 'u32',
|
280
|
+
},
|
281
|
+
],
|
282
|
+
},
|
283
|
+
},
|
284
|
+
{
|
285
|
+
name: 'PositionUpdatedData',
|
286
|
+
type: {
|
287
|
+
kind: 'struct',
|
288
|
+
fields: [
|
289
|
+
{
|
290
|
+
name: 'reward_before_deposit',
|
291
|
+
type: 'u64',
|
292
|
+
},
|
293
|
+
{
|
294
|
+
name: 'reward_earned',
|
295
|
+
type: 'u64',
|
296
|
+
},
|
297
|
+
{
|
298
|
+
name: 'reward_claimed',
|
299
|
+
type: 'u64',
|
300
|
+
},
|
301
|
+
{
|
302
|
+
name: 'amount',
|
303
|
+
type: 'u64',
|
304
|
+
},
|
305
|
+
{
|
306
|
+
name: 'deactivating_amount',
|
307
|
+
type: 'u64',
|
308
|
+
},
|
309
|
+
{
|
310
|
+
name: 'claiming_amount',
|
311
|
+
type: 'u64',
|
312
|
+
},
|
313
|
+
{
|
314
|
+
name: 'last_updated_epoch_index',
|
315
|
+
type: 'u32',
|
316
|
+
},
|
317
|
+
],
|
318
|
+
},
|
319
|
+
},
|
320
|
+
{
|
321
|
+
name: 'PositionUpdatedEvent',
|
322
|
+
type: {
|
323
|
+
kind: 'struct',
|
324
|
+
fields: [
|
325
|
+
{
|
326
|
+
name: 'pubkey',
|
327
|
+
type: 'pubkey',
|
328
|
+
},
|
329
|
+
{
|
330
|
+
name: 'data',
|
331
|
+
type: {
|
332
|
+
defined: {
|
333
|
+
name: 'PositionUpdatedData',
|
334
|
+
},
|
335
|
+
},
|
336
|
+
},
|
337
|
+
],
|
338
|
+
},
|
339
|
+
},
|
340
|
+
],
|
341
|
+
};
|
342
|
+
//# sourceMappingURL=elementalVaultIDL.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"elementalVaultIDL.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elemental/elementalVaultIDL.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IAC3B,OAAO,EAAE,8CAA8C;IACvD,QAAQ,EAAE;QACR,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,qBAAqB;KACnC;IACD,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,MAAM;YACZ,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;SACrD;QACD;YACE,IAAI,EAAE,UAAU;YAChB,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC;SACvD;KACF;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,kBAAkB;YACxB,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;SACtD;QACD;YACE,IAAI,EAAE,sBAAsB;YAC5B,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC;SACrD;KACF;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,eAAe;YACrB,GAAG,EAAE,4BAA4B;SAClC;QACD;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,WAAW;YACjB,GAAG,EAAE,yBAAyB;SAC/B;QACD;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,kBAAkB;YACxB,GAAG,E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AAE,KAAK;qBACZ;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,uBAAuB;wBAC7B,IAAI,EAAE,KAAK;qBACZ;oBACD;wBACE,IAAI,EAAE,eAAe;wBACrB,IAAI,EAAE,KAAK;qBACZ;oBACD;wBACE,IAAI,EAAE,gBAAgB;wBACtB,IAAI,EAAE,KAAK;qBACZ;oBACD;wBACE,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,KAAK;qBACZ;oBACD;wBACE,IAAI,EAAE,qBAAqB;wBAC3B,IAAI,EAAE,KAAK;qBACZ;oBACD;wBACE,IAAI,EAAE,iBAAiB;wBACvB,IAAI,EAAE,KAAK;qBACZ;oBACD;wBACE,IAAI,EAAE,0BAA0B;wBAChC,IAAI,EAAE,KAAK;qBACZ;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,sBAAsB;YAC5B,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,QAAQ;qBACf;oBACD;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;4BACJ,OAAO,EAAE;gCACP,IAAI,EAAE,qBAAqB;6BAC5B;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.poolFilter = exports.positionFilter = void 0;
|
4
|
+
const positionFilter = (owner) => [
|
5
|
+
{
|
6
|
+
memcmp: {
|
7
|
+
offset: 40,
|
8
|
+
bytes: owner,
|
9
|
+
},
|
10
|
+
},
|
11
|
+
{
|
12
|
+
dataSize: 128,
|
13
|
+
},
|
14
|
+
];
|
15
|
+
exports.positionFilter = positionFilter;
|
16
|
+
exports.poolFilter = [
|
17
|
+
{
|
18
|
+
dataSize: 254,
|
19
|
+
},
|
20
|
+
];
|
21
|
+
//# sourceMappingURL=filters.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elemental/filters.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IAC3E;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,GAAG;KACd;CACF,CAAC;AAVW,QAAA,cAAc,kBAUzB;AAEW,QAAA,UAAU,GAA+B;IACpD;QACE,QAAQ,EAAE,GAAG;KACd;CACF,CAAC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
2
|
+
import { CachedPool } from './types';
|
3
|
+
import { Position } from './structs';
|
4
|
+
export declare function getPositionAddress(poolAddress: string, ownerAddress: string): PublicKey;
|
5
|
+
export declare function getStatus(position: Position, pool: CachedPool): string;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getStatus = exports.getPositionAddress = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
const elementalVaultIDL_1 = require("./elementalVaultIDL");
|
6
|
+
function getPositionAddress(poolAddress, ownerAddress) {
|
7
|
+
return web3_js_1.PublicKey.findProgramAddressSync([
|
8
|
+
Buffer.from('position'),
|
9
|
+
new web3_js_1.PublicKey(ownerAddress).toBuffer(),
|
10
|
+
new web3_js_1.PublicKey(poolAddress).toBuffer(),
|
11
|
+
], new web3_js_1.PublicKey(elementalVaultIDL_1.elementalIDLs.address))[0];
|
12
|
+
}
|
13
|
+
exports.getPositionAddress = getPositionAddress;
|
14
|
+
function getStatus(position, pool) {
|
15
|
+
if (position.deactivating_amount.gt(0)) {
|
16
|
+
if (position.last_updated_epoch_index + 1 < Number(pool.epoch_index))
|
17
|
+
return 'unstaked';
|
18
|
+
return 'unstaking';
|
19
|
+
}
|
20
|
+
if (position.amount.gt(0)) {
|
21
|
+
if (position.last_updated_epoch_index === Number(pool.epoch_index)) {
|
22
|
+
return 'queued';
|
23
|
+
}
|
24
|
+
return 'farming';
|
25
|
+
}
|
26
|
+
return 'inactive';
|
27
|
+
}
|
28
|
+
exports.getStatus = getStatus;
|
29
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elemental/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,2DAAoD;AAIpD,SAAgB,kBAAkB,CAChC,WAAmB,EACnB,YAAoB;IAEpB,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;QACvB,IAAI,mBAAS,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;QACtC,IAAI,mBAAS,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;KACtC,EACD,IAAI,mBAAS,CAAC,iCAAa,CAAC,OAAO,CAAC,CACrC,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AAZD,gDAYC;AAED,SAAgB,SAAS,CAAC,QAAkB,EAAE,IAAgB;IAC5D,IAAI,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,IAAI,QAAQ,CAAC,wBAAwB,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;YAClE,OAAO,UAAU,CAAC;QAEpB,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1B,IAAI,QAAQ,CAAC,wBAAwB,KAAK,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YACnE,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAjBD,8BAiBC"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const poolsJob_1 = __importDefault(require("./poolsJob"));
|
9
|
+
const depositFetcher_1 = __importDefault(require("./depositFetcher"));
|
10
|
+
exports.platforms = [constants_1.platform];
|
11
|
+
exports.jobs = [poolsJob_1.default];
|
12
|
+
exports.fetchers = [depositFetcher_1.default];
|
13
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elemental/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,0DAAkC;AAClC,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,kBAAQ,CAAC,CAAC;AACzB,QAAA,QAAQ,GAAc,CAAC,wBAAc,CAAC,CAAC"}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const web3_js_1 = require("@solana/web3.js");
|
14
|
+
const constants_1 = require("./constants");
|
15
|
+
const clients_1 = require("../../utils/clients");
|
16
|
+
const solana_1 = require("../../utils/solana");
|
17
|
+
const filters_1 = require("./filters");
|
18
|
+
const structs_1 = require("./structs");
|
19
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
20
|
+
const client = (0, clients_1.getClientSolana)();
|
21
|
+
const pools = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.poolStruct, new web3_js_1.PublicKey(constants_1.elementalIdlItem.programId), filters_1.poolFilter);
|
22
|
+
if (pools.length === 0)
|
23
|
+
return;
|
24
|
+
yield cache.setItem(constants_1.poolsCacheKey, pools, {
|
25
|
+
prefix: constants_1.platformId,
|
26
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
27
|
+
});
|
28
|
+
});
|
29
|
+
const job = {
|
30
|
+
id: `${constants_1.platformId}-pools`,
|
31
|
+
executor,
|
32
|
+
label: 'normal',
|
33
|
+
};
|
34
|
+
exports.default = job;
|
35
|
+
//# sourceMappingURL=poolsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elemental/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAG5C,2CAA0E;AAC1E,iDAAsD;AACtD,+CAA8D;AAC9D,uCAAuC;AACvC,uCAAuC;AAEvC,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,KAAK,GAAG,MAAM,IAAA,iCAAwB,EAC1C,MAAM,EACN,oBAAU,EACV,IAAI,mBAAS,CAAC,4BAAgB,CAAC,SAAS,CAAC,EACzC,oBAAU,CACX,CAAC;IAEF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAE/B,MAAM,KAAK,CAAC,OAAO,CAAC,yBAAa,EAAE,KAAK,EAAE;QACxC,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export declare enum State {
|
6
|
+
Uninitialized = 0,
|
7
|
+
StakePool = 1,
|
8
|
+
InactiveStakePool = 2,
|
9
|
+
StakeAccount = 3
|
10
|
+
}
|
11
|
+
export type Pool = {
|
12
|
+
buffer: Buffer;
|
13
|
+
liquidity_mint: PublicKey;
|
14
|
+
liquidity_holder: PublicKey;
|
15
|
+
per_token_amount: BigNumber;
|
16
|
+
max_deposit_amount: BigNumber;
|
17
|
+
min_deposit_amount: BigNumber;
|
18
|
+
max_supply: BigNumber;
|
19
|
+
current_supply: BigNumber;
|
20
|
+
next_supply: BigNumber;
|
21
|
+
reward_per_token: BigNumber;
|
22
|
+
reward_annual_rate: BigNumber;
|
23
|
+
deactivating_amount_n0: BigNumber;
|
24
|
+
claiming_amount_n0: BigNumber;
|
25
|
+
deactivating_amount_n1: BigNumber;
|
26
|
+
claiming_amount_n1: BigNumber;
|
27
|
+
pending_amount: BigNumber;
|
28
|
+
epoch_duration: number;
|
29
|
+
epoch_index: number;
|
30
|
+
epoch_start_time: number;
|
31
|
+
authority_bump: number;
|
32
|
+
admin: PublicKey;
|
33
|
+
pending_admin: PublicKey;
|
34
|
+
};
|
35
|
+
export declare const poolStruct: BeetStruct<Pool, Partial<Pool>>;
|
36
|
+
export type Position = {
|
37
|
+
buffer: Buffer;
|
38
|
+
pool: PublicKey;
|
39
|
+
owner: PublicKey;
|
40
|
+
reward_before_deposit: BigNumber;
|
41
|
+
reward_earned: BigNumber;
|
42
|
+
reward_claimed: BigNumber;
|
43
|
+
amount: BigNumber;
|
44
|
+
deactivating_amount: BigNumber;
|
45
|
+
claiming_amount: BigNumber;
|
46
|
+
last_updated_epoch_index: number;
|
47
|
+
};
|
48
|
+
export declare const positionStruct: BeetStruct<Position, Partial<Position>>;
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.positionStruct = exports.poolStruct = exports.State = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
|
+
const solana_1 = require("../../utils/solana");
|
7
|
+
var State;
|
8
|
+
(function (State) {
|
9
|
+
State[State["Uninitialized"] = 0] = "Uninitialized";
|
10
|
+
State[State["StakePool"] = 1] = "StakePool";
|
11
|
+
State[State["InactiveStakePool"] = 2] = "InactiveStakePool";
|
12
|
+
State[State["StakeAccount"] = 3] = "StakeAccount";
|
13
|
+
})(State || (exports.State = State = {}));
|
14
|
+
exports.poolStruct = new beet_1.BeetStruct([
|
15
|
+
['buffer', (0, solana_1.blob)(8)],
|
16
|
+
['liquidity_mint', beet_solana_1.publicKey],
|
17
|
+
['liquidity_holder', beet_solana_1.publicKey],
|
18
|
+
['per_token_amount', solana_1.u64],
|
19
|
+
['max_deposit_amount', solana_1.u64],
|
20
|
+
['min_deposit_amount', solana_1.u64],
|
21
|
+
['max_supply', solana_1.u64],
|
22
|
+
['current_supply', solana_1.u64],
|
23
|
+
['next_supply', solana_1.u64],
|
24
|
+
['reward_per_token', solana_1.u64],
|
25
|
+
['reward_annual_rate', solana_1.u64],
|
26
|
+
['deactivating_amount_n0', solana_1.u64],
|
27
|
+
['claiming_amount_n0', solana_1.u64],
|
28
|
+
['deactivating_amount_n1', solana_1.u64],
|
29
|
+
['claiming_amount_n1', solana_1.u64],
|
30
|
+
['pending_amount', solana_1.u64],
|
31
|
+
['epoch_duration', beet_1.u32],
|
32
|
+
['epoch_index', beet_1.u32],
|
33
|
+
['epoch_start_time', beet_1.u32],
|
34
|
+
['authority_bump', beet_1.u8],
|
35
|
+
['admin', beet_solana_1.publicKey],
|
36
|
+
['pending_admin', beet_solana_1.publicKey],
|
37
|
+
], (args) => args);
|
38
|
+
exports.positionStruct = new beet_1.BeetStruct([
|
39
|
+
['buffer', (0, solana_1.blob)(8)],
|
40
|
+
['pool', beet_solana_1.publicKey],
|
41
|
+
['owner', beet_solana_1.publicKey],
|
42
|
+
['reward_before_deposit', solana_1.u64],
|
43
|
+
['reward_earned', solana_1.u64],
|
44
|
+
['reward_claimed', solana_1.u64],
|
45
|
+
['amount', solana_1.u64],
|
46
|
+
['deactivating_amount', solana_1.u64],
|
47
|
+
['claiming_amount', solana_1.u64],
|
48
|
+
['last_updated_epoch_index', beet_1.u32],
|
49
|
+
], (args) => args);
|
50
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elemental/structs.ts"],"names":[],"mappings":";;;AAAA,oDAAgE;AAChE,kEAA6D;AAG7D,+CAA+C;AAE/C,IAAY,KAKX;AALD,WAAY,KAAK;IACf,mDAAa,CAAA;IACb,2CAAS,CAAA;IACT,2DAAiB,CAAA;IACjB,iDAAY,CAAA;AACd,CAAC,EALW,KAAK,qBAAL,KAAK,QAKhB;AA2BY,QAAA,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BAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,qBAAqB,EAAE,YAAG,CAAC;IAC5B,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,0BAA0B,EAAE,UAAG,CAAC;CAClC,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC"}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
export type Position = {
|
2
|
+
pool: string;
|
3
|
+
owner: string;
|
4
|
+
reward_before_deposit: string;
|
5
|
+
reward_earned: string;
|
6
|
+
reward_claimed: string;
|
7
|
+
amount: string;
|
8
|
+
deactivating_amount: string;
|
9
|
+
claiming_amount: string;
|
10
|
+
last_updated_epoch_index: string;
|
11
|
+
};
|
12
|
+
export type Pool = {
|
13
|
+
liquidity_mint: string;
|
14
|
+
liquidity_holder: string;
|
15
|
+
per_token_amount: string;
|
16
|
+
max_deposit_amount: string;
|
17
|
+
min_deposit_amount: string;
|
18
|
+
max_supply: string;
|
19
|
+
current_supply: string;
|
20
|
+
next_supply: string;
|
21
|
+
reward_per_token: string;
|
22
|
+
reward_annual_rate: string;
|
23
|
+
deactivating_amount_n0: string;
|
24
|
+
claiming_amount_n0: string;
|
25
|
+
deactivating_amount_n1: string;
|
26
|
+
claiming_amount_n1: string;
|
27
|
+
pending_amount: string;
|
28
|
+
epoch_duration: string;
|
29
|
+
epoch_index: string;
|
30
|
+
epoch_start_time: string;
|
31
|
+
authority_bump: string;
|
32
|
+
admin: string;
|
33
|
+
pending_admin?: string;
|
34
|
+
};
|
35
|
+
export type CachedPool = Pool & {
|
36
|
+
pubkey: string;
|
37
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elemental/types.ts"],"names":[],"mappings":""}
|