@coinmeca/wallet-sdk
Version:
3 lines (2 loc) • 2.84 kB
JavaScript
import{parse as t,decrypt as e,encrypt as s,format as o}from"./utils.js";import"crypto-js";import"ethereum-cryptography/utils";const i=n;!function(){const t=n,e=c();for(;;)try{if(232211===parseInt(t(425))/1+parseInt(t(431))/2+-parseInt(t(415))/3+parseInt(t(407))/4+parseInt(t(417))/5+-parseInt(t(421))/6+parseInt(t(429))/7*(parseInt(t(433))/8))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();let r=null;const a=(i={},r)=>({set:(t,e)=>{const a=n;t=(r?.[a(418)]||"")+":"+t;const h=s(t,r?.salt);h&&(i[h]=s(o(e),r?.[a(412)]),r?.emit?.(t,e))},get:o=>{const a=n;return t(e(i?.[s((r?.[a(418)]||"")+":"+o,r?.[a(412)])],r?.[a(412)]))},remove:t=>{const e=n;delete i?.[s((r?.codename||"")+":"+t,r?.[e(412)])]},clear:()=>{i={}}});class h{#t={};#e;#s;#o;#i;#r;constructor(t,e,s){const o=n;this.#e=t,this.#o=e,this.#s=s?.[o(418)],this.#i=s?.salt,this.#r=s?.[o(428)],this.#a(this.#e?.[o(430)](this.#o)||{}),window[o(408)](o(413),(()=>this[o(427)]())),window[o(408)]("load",(()=>this.#a(this.#e?.[o(430)](this.#o)))),window[o(408)](o(414),(t=>{const e=o,{key:s,newValue:i}=t;t[e(432)]===this.#e&&s===this.#o?this.#a(i):this.ready()}))}#h(t){const e=n;return!!t&&typeof t===e(426)&&!!t?.[e(410)]}#a(s,o){o&&o!==this.#o||(s=t(e(s,this.#s)),this.#h(s)&&(this.#t=s))}[i(427)](){const t=i;this.#o&&this.#e?.[t(411)](this.#o,s(o(this.#t),this.#s))}[i(406)](t,e){const r=i;t=this.#s+":"+t;const a=s(t,this.#i);a&&(this.#t[a]=s(o(e),this.#i),this.#e?.[r(411)](this.#o,s(o(this.#t),this.#s)),this.#r?.(r(424),{key:t,value:e}))}[i(423)](o){return t(e(this.#t?.[s(this.#s+":"+o,this.#i)],this.#i))}[i(409)](t){const e=i;delete this.#t?.[s(this.#s+":"+t,this.#i)],this.#e?.[e(411)](this.#o,s(o(this.#t),this.#s))}clear(){const t=i;this.#t={},this.#e?.[t(420)](this.#o),this.#r?.(t(419))}[i(422)](t){this.#t=t}[i(416)](){return this.#t}secure(i){return{set:(t,e)=>{const r=n;t=this.#s+":"+t;const a=s(t,i);a&&(this.#t[a]=s(o(e),i),this.#e?.[r(411)](this.#o,s(o(this.#t),this.#s)),this.#r?.(t,e))},get:o=>t(e(this.#t?.[s(this.#s+":"+o,i)],i)),remove:t=>{const e=n;delete this.#t?.[s(this.#s+":"+t,i)],this.#e?.[e(411)](this.#o,s(o(this.#t),this.#s))},clear:()=>{const t=n;this.#t={},this.#e?.removeItem(this.#o),this.#r?.(t(419))}}}}function n(t,e){const s=c();return(n=function(t,e){return s[t-=406]})(t,e)}function c(){const t=["7rOgTna","getItem","90940zLtoAe","storageArea","2181288XukRKL","set","307200LnbZuv","addEventListener","remove","coinmeca:wallet:userId","setItem","salt","beforeunload","storage","853188OGchim","export","175865lcBQcA","codename","storageCleared","removeItem","511488CpsKBG","import","get","storageUpdated","171751DZtHIk","object","ready","emit"];return(c=function(){return t})()}function m(t,...e){return r||(r=new h(t,...e)),r}export{h as CoinmecaSecureStorage,m as getSecureStorage,a as storage};
//# sourceMappingURL=storage.js.map