-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
relly
committed
Aug 9, 2024
1 parent
0a2d111
commit 8d46ded
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const ADDRESSES = require('../helper/coreAssets.json') | ||
const sdk = require("@defillama/sdk"); | ||
const { staking } = require("../helper/staking"); | ||
const { sumTokensAndLPsSharedOwners } = require("../helper/unwrapLPs"); | ||
const { request, gql } = require("graphql-request"); | ||
const { getBlock } = require('../helper/http') | ||
const { transformBalances } = require("../helper/portedTokens"); | ||
|
||
const graphUrl = 'https://main-api.flow.movefuns.xyz/' | ||
const graphQuery = gql` | ||
query ExampleQuery { | ||
tvl { | ||
coin_type | ||
lock_amount | ||
} | ||
}` | ||
async function getTokenAmount() { | ||
const data = await request( | ||
graphUrl, | ||
graphQuery, | ||
{}, | ||
{ | ||
"x-auth-info":"123" | ||
} | ||
); | ||
console.log("data.tvl",data.tvl); | ||
return data.tvl | ||
} | ||
|
||
async function aptosTvl(api) { | ||
const coinContainers = await getTokenAmount(); | ||
|
||
coinContainers.map((item)=>{ | ||
api.add(item.coin_type, parseInt(item.lock_amount)); | ||
}) | ||
} | ||
|
||
|
||
|
||
|
||
module.exports = { | ||
aptos: { | ||
tvl: aptosTvl, | ||
}, | ||
|
||
}; |