const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/string.utils.cjs`),n=require(`./AlchemyPublicTokensDB.cjs`),r=require(`./EventsPublicTokensDB.cjs`),i=require(`./ArcPublicTokensDB.cjs`);var a=class{useAlternativeDB={};async getPublicTokens(a,o){let s=t.getStateKey(o,a);return a===e.chainIds.arcTestnet?i.arcPublicTokensDB.getPublicTokens(o):this.useAlternativeDB[s]?r.eventsPublicTokensDB.getPublicTokens(a,o):n.alchemyPublicTokensDB.getPublicTokens(a,o)}getFetchedTokens(a,o){let s=t.getStateKey(o,a);return a===e.chainIds.arcTestnet?i.arcPublicTokensDB.getFetchedTokens(o):this.useAlternativeDB[s]?r.eventsPublicTokensDB.getFetchedTokens(a,o):n.alchemyPublicTokensDB.getFetchedTokens(a,o)}async fetchAndUpdatePublicTokens(a,o){let s=t.getStateKey(a,o);try{o===e.chainIds.arcTestnet?await i.arcPublicTokensDB.fetchAndUpdatePublicTokens(a):(await n.alchemyPublicTokensDB.fetchAndUpdatePublicTokens(a,o),this.useAlternativeDB[s]=!1)}catch{if(e.isSolanaLike(o))return;await r.eventsPublicTokensDB.fetchAndUpdatePublicTokens(a,o),this.useAlternativeDB[s]=!0}}},o=new a;exports.PublicTokensDB=a,exports.publicTokensDB=o;