Skip to content

Commit

Permalink
zoth
Browse files Browse the repository at this point in the history
  • Loading branch information
waynebruce0x committed Dec 27, 2024
1 parent 479abdd commit 727872a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions projects/zoth/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const vaultManagers = {
ethereum: "0x2f52C3664Ff2b12A1A8Bc7B6020C7E92DBa781aE",
}

Object.keys(vaultManagers).forEach(chain => {
module.exports[chain] = {
tvl: async (api) => {
const { details } = await api.call({ abi, target: vaultManagers[chain], })
details.map(({ collateralAddress, subVaultAddress }) => {
api.add(collateralAddress, subVaultAddress)
})
}
}
})

const abi = { "inputs": [], "name": "getAllSubVaults", "outputs": [{ "internalType": "address[]", "name": "collaterals", "type": "address[]" }, { "components": [{ "internalType": "string", "name": "integrationType", "type": "string" }, { "internalType": "address", "name": "collateralAddress", "type": "address" }, { "internalType": "address", "name": "subVaultAddress", "type": "address" }, { "internalType": "uint256", "name": "price", "type": "uint256" }, { "internalType": "uint256", "name": "ltv", "type": "uint256" }, { "internalType": "bool", "name": "isActive", "type": "bool" }, { "internalType": "uint256", "name": "registeredAt", "type": "uint256" }, { "internalType": "uint256", "name": "lastUpdatedAt", "type": "uint256" }, { "internalType": "enum DataTypes.TokenType", "name": "tokenType", "type": "uint8" }], "internalType": "struct DataTypes.CollateralDetails[]", "name": "details", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }

0 comments on commit 727872a

Please sign in to comment.