var n=Object.defineProperty;var l=(o,e,s)=>e in o?n(o,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[e]=s;var i=(o,e,s)=>(l(o,typeof e!="symbol"?e+"":e,s),s);var a=class{constructor(){i(this,"storageKey","userTokens")}async getTokens(){let e=localStorage.getItem(this.storageKey);return e?JSON.parse(e):[]}async addToken(e){let s=await this.getTokens();s.push(e),localStorage.setItem(this.storageKey,JSON.stringify(s))}async removeToken(e){let s=await this.getTokens();s=s.filter(t=>t.address!==e),localStorage.setItem(this.storageKey,JSON.stringify(s))}async getTokenPrice(e){let s=localStorage.getItem("tokenPrices");return s?JSON.parse(s)[e]:0}async saveTokenPrice(e,s){let t=localStorage.getItem("tokenPrices"),r=t?JSON.parse(t):{};r[e]=s,localStorage.setItem("tokenPrices",JSON.stringify(r))}async updateToken(e){let s=await this.getTokens();s=s.map(t=>t.address===e.address?e:t),localStorage.setItem(this.storageKey,JSON.stringify(s))}async getUserWalletAliases(){throw new Error("Method not implemented.")}async upsertWalletAlias(e,s){throw console.log("upsertWalletAlias",e,s),new Error("Method not implemented.")}};export{a as LocalStorageAdapter};
//# sourceMappingURL=LocalStorageAdapter.mjs.map