-
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
1 parent
479abdd
commit 727872a
Showing
1 changed file
with
16 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,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" } |