File tree Expand file tree Collapse file tree 1 file changed +21
-12
lines changed
Expand file tree Collapse file tree 1 file changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -6,19 +6,28 @@ const { bs58 } = require('@project-serum/anchor/dist/cjs/utils/bytes');
66async function tvl ( api ) {
77 const connection = getConnection ( ) ;
88
9- const marketStateAccounts = await connection . getProgramAccounts (
10- new PublicKey ( 'mnCk3moW6q9UszVev3C9JjtE4YoviXgLwiLCnUy3c4D' ) ,
11- {
12- filters : [
13- {
14- memcmp : {
15- offset : 0 ,
16- bytes : bs58 . encode ( crypto . createHash ( 'sha256' ) . update ( "account:MarketState" ) . digest ( ) . slice ( 0 , 8 ) ) ,
9+ const programIds = [
10+ 'mnCk3moW6q9UszVev3C9JjtE4YoviXgLwiLCnUy3c4D' ,
11+ 'mNckKuED6PTxgdQQgnXYLuFQFDjb3urdTfXDSSUwydJ' ,
12+ ] ;
13+ const marketStateAccounts = [ ] ;
14+
15+ for ( const programId of programIds ) {
16+ const accounts = await connection . getProgramAccounts (
17+ new PublicKey ( programId ) ,
18+ {
19+ filters : [
20+ {
21+ memcmp : {
22+ offset : 0 ,
23+ bytes : bs58 . encode ( crypto . createHash ( 'sha256' ) . update ( "account:MarketState" ) . digest ( ) . slice ( 0 , 8 ) ) ,
24+ } ,
1725 } ,
18- } ,
19- ]
20- }
21- ) ;
26+ ]
27+ }
28+ ) ;
29+ marketStateAccounts . push ( ...accounts ) ;
30+ }
2231
2332 const tokenAccounts = [ ]
2433
You can’t perform that action at this time.
0 commit comments