Skip to content

Commit 727872a

Browse files
committed
zoth
1 parent 479abdd commit 727872a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

projects/zoth/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const vaultManagers = {
2+
ethereum: "0x2f52C3664Ff2b12A1A8Bc7B6020C7E92DBa781aE",
3+
}
4+
5+
Object.keys(vaultManagers).forEach(chain => {
6+
module.exports[chain] = {
7+
tvl: async (api) => {
8+
const { details } = await api.call({ abi, target: vaultManagers[chain], })
9+
details.map(({ collateralAddress, subVaultAddress }) => {
10+
api.add(collateralAddress, subVaultAddress)
11+
})
12+
}
13+
}
14+
})
15+
16+
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 commit comments

Comments
 (0)