Skip to content

Commit

Permalink
bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
waynebruce0x committed Aug 27, 2024
1 parent 869146a commit 1538a39
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions projects/osmosis-ibc/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { get } = require('../helper/http')
const { PromisePool } = require('@supercharge/promise-pool')

async function tvl(api) {
const res = await get(
`https://raw.githubusercontent.com/osmosis-labs/assetlists/main/osmosis-1/generated/chain_registry/assetlist.json`
)

await PromisePool.withConcurrency(10)
.for(res.assets)
.process(async (c) => {
const { base: address } = c;
if (!address.startsWith("ibc/")) return;
const res = await get(`https://lcd.osmosis.zone/cosmos/bank/v1beta1/supply/by_denom?denom=${address}`)
if (res && res.amount) api.add(address, res.amount.amount, { skipChain: true })
})
}

module.exports = {
cosmos: { tvl }
}

0 comments on commit 1538a39

Please sign in to comment.