UNPKG

@molecularlabs/nucleus-frontend

Version:
54 lines 1.24 kB
import { erc20Abi } from "viem"; import { AccountantAbi } from "../contracts/accountant-abi"; import { TellerAbi } from "../contracts/teller-abi"; import { getClient } from "../lib/client"; const getRateInQuoteWithAssetDecimals = async ({ assetAddress, accountantAddress, chainId }) => { const client = await getClient(chainId); const results = await client.multicall({ contracts: [ { abi: erc20Abi, address: assetAddress, functionName: "decimals" }, { abi: AccountantAbi, address: accountantAddress, functionName: "getRateInQuote", args: [assetAddress] } ] }); return results; }; const getPausedStates = async ({ accountantAddress, tellerAddress, chainId }) => { const client = await getClient(chainId); const results = await client.multicall({ contracts: [ { abi: TellerAbi, address: tellerAddress, functionName: "isPaused" }, { abi: AccountantAbi, address: accountantAddress, functionName: "accountantState" } ] }); return results; }; export { getPausedStates, getRateInQuoteWithAssetDecimals }; //# sourceMappingURL=multi-call.mjs.map