File tree Expand file tree Collapse file tree 1 file changed +41
-8
lines changed Expand file tree Collapse file tree 1 file changed +41
-8
lines changed Original file line number Diff line number Diff line change 1
- const { staking} = require ( "../helper/staking" )
2
-
3
- module . exports = {
4
- ethereum :{
5
- tvl :( ) => ( { } ) ,
6
- staking : staking ( "0xed96E69d54609D9f2cFf8AaCD66CCF83c8A1B470" , "0x423f4e6138e475d85cf7ea071ac92097ed631eea" )
7
- }
8
- }
1
+ const { staking } = require ( "../helper/staking" ) ;
2
+ const { getTokenSupplies } = require ( '../helper/solana' ) ;
3
+
4
+ // --- Ethereum Configuration ---
5
+ const ETH_STAKING_CONTRACT = "0xed96E69d54609D9f2cFf8AaCD66CCF83c8A1B470" ;
6
+ const PONDOX_ETH = "0x423f4e6138e475d85cf7ea071ac92097ed631eea" ;
7
+
8
+ const WPOND_SOLANA_MINT = "3JgFwoYV74f6LwWjQWnr3YDPFnmBdwQfNyubv99jqUoq" ;
9
+
10
+ const COINGECKO_ID = "pond-coin" ;
11
+
12
+ async function solanaTVL ( api ) {
13
+ await getTokenSupplies ( [ WPOND_SOLANA_MINT ] , api ) ;
14
+
15
+ const solanaKey = `solana:${ WPOND_SOLANA_MINT } ` ;
16
+ const rawBalance = api . getBalances ( ) [ solanaKey ] ;
17
+
18
+ if ( rawBalance ) {
19
+ const tokenAmount = Number ( rawBalance ) / 1e3 ;
20
+
21
+ api . addCGToken ( COINGECKO_ID , tokenAmount ) ;
22
+
23
+ delete api . getBalances ( ) [ solanaKey ] ;
24
+ }
25
+ }
26
+
27
+
28
+ module . exports = {
29
+ ethereum : {
30
+ tvl : ( ) => ( { } ) ,
31
+ staking : staking ( ETH_STAKING_CONTRACT , PONDOX_ETH )
32
+ } ,
33
+ solana : {
34
+ tvl : solanaTVL
35
+ }
36
+ } ;
37
+
38
+
39
+
40
+
41
+
You can’t perform that action at this time.
0 commit comments