export const GET_FUCKED = "not here anymore" ; import { PickleModelJson } from "picklefinance-core" ; import { AssetEnablement , JarDefinition , } from "picklefinance-core/lib/model/PickleModelJson" ; const BALANCER_POOLS = [ "0xc2f082d33b5b8ef3a7e3de30da54efd3114512ac" , "0x64541216bafffeec8ea535bb71fbc927831d0595" , ] ; export const isBalancerPool = ( depositTokenAddress ) => { return BALANCER_POOLS . includes ( depositTokenAddress . toLowerCase ( ) ) ; } ; export const isPUsdcToken = ( jarTokenAddress ) => { return ( jarTokenAddress . toLowerCase ( ) === "0xEB801AB73E9A2A482aA48CaCA13B1954028F4c94" . toLowerCase ( ) ) ; } ; export const isUsdcToken = ( depositTokenAddress ) => { return ( depositTokenAddress . toLowerCase ( ) === "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" . toLowerCase ( ) ) ; } ; export const isYveCrvEthJarToken = ( jarTokenAddress ) => { return ( jarTokenAddress . toLowerCase ( ) === "0x5Eff6d166D66BacBC1BF52E2C54dD391AE6b1f48" . toLowerCase ( ) ) ; } ; export const isQlpQiToken = ( depositTokenAddress ) => { return ( depositTokenAddress . toLowerCase ( ) === "0x7AfcF11F3e2f01e71B7Cc6b8B5e707E42e6Ea397" . toLowerCase ( ) ) ; } ; export const isQlpQiMaticOrUsdcToken = ( depositTokenAddress ) => { return ( depositTokenAddress . toLowerCase ( ) === "0x9A8b2601760814019B7E6eE0052E25f1C623D1E6" . toLowerCase ( ) || depositTokenAddress . toLowerCase ( ) === "0x160532d2536175d65c03b97b0630a9802c274dad" . toLowerCase ( ) ) ; } ; export const isMainnetMimEthJarDepositToken = ( depositToken ) => { return ( depositToken . toLowerCase ( ) === "0x993f35FaF4AEA39e1dfF28f45098429E0c87126C" . toLowerCase ( ) ) ; } ; export const shouldJarBeInUi = ( jar , pfcore ) => { return ( isJarActive ( jar . details . apiKey , pfcore ) || isJarDisabled ( jar . details . apiKey , pfcore ) ) ; } ; param jarApiKey param pfcore returns export const isJarActive = ( jarApiKey , pfcore ) => { return ( checkJarEnablement ( AssetEnablement . ENABLED , jarApiKey , pfcore ) || checkJarEnablement ( AssetEnablement . WITHDRAW_ONLY , jarApiKey , pfcore ) ) ; } ; export const isJarWithdrawOnly = ( jarApiKey , pfcore ) => { return checkJarEnablement ( AssetEnablement . WITHDRAW_ONLY , jarApiKey , pfcore ) ; } ; param jarApiKey param pfcore returns export const isJarDisabled = ( jarApiKey , pfcore ) => { return checkJarEnablement ( AssetEnablement . DISABLED , jarApiKey , pfcore ) ; } ; export const checkJarEnablement = ( desired , jarApiKey , pfcore ) => { if ( ! pfcore ) { return true ; } const found = pfcore . assets . jars . find ( ( x ) => x . details . apiKey === jarApiKey ) ; if ( found ) { if ( found . enablement === desired ) { return true ; } } return false ; } ;