(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[3985],{30634(t,i,s){"use strict";s.d(i,{j$:()=>f}),s(797809);var r=s(973594),e=s(298495),h=s(206422),n=s(170210),a=s(859340);function o(t){return t?.__esModule?t.default:t}s(916794).Buffer,o(e),o(h),o(n);let{memoize:m}=a;Error("timeout"),m(function(t){if("string"!=typeof t)return t;let i=(0,r.mu)(t);if(!(0,r.Lo)(i))return i;try{return(0,r.IV)(i)}catch(t){if(t instanceof Error&&"Invalid hex address."===t.message)return i;throw t}}),m(function(t,{allowNonPrefixed:i=!0}={}){let s=i?(0,r.mu)(t):t;return!!(0,r.Ky)(s)&&(0,r.vw)(s)},(t,{allowNonPrefixed:i=!0}={})=>`${t}-${i}`);class f extends Error{constructor(t,i){super(i??`Fetch failed with status '${t}'`),this.httpStatus=t}}},493067(t,i,s){"use strict";s.d(i,{d:()=>m});var r=s(718282),e=s(30634),h=s(448967),n=s(290266);let a=["fetchHistoricalPricesV3"],o=(0,n.NW)({prices:(0,n.YO)((0,n.PV)([(0,n.ai)(),(0,n.ai)()])),marketCaps:(0,n.lq)((0,n.YO)((0,n.PV)([(0,n.ai)(),(0,n.ai)()]))),totalVolumes:(0,n.lq)((0,n.YO)((0,n.PV)([(0,n.ai)(),(0,n.ai)()])))});class m extends r.L{constructor({messenger:t,queryClientConfig:i={},policyOptions:s={}}){super({name:"PriceApiService",messenger:t,queryClientConfig:i,policyOptions:s}),this.messenger.registerMethodActionHandlers(this,a)}async fetchHistoricalPricesV3({params:t={},options:{currency:i,timePeriod:s,from:r,to:n,interval:a}={}}){let m;t&&(m=new URL(`/v3/historical-prices/${t.chainId}/${t.assetType}`,"https://price.api.cx.metamask.io"),i&&m.searchParams.append("vsCurrency",i),s&&m.searchParams.append("timePeriod",s),r&&m.searchParams.append("from",r.toString()),n&&m.searchParams.append("to",n.toString()),a&&m.searchParams.append("to",a));let f=[`${this.name}:fetchHistoricalPricesV3`];t?f.push(t):f.push("disabled");let c=await this.fetchQuery({queryKey:f,queryFn:async({signal:t})=>{if(m){let i=await fetch(m,{signal:t});if(!i.ok)throw new e.j$(i.status,`Price API failed with status '${i.status}'`);return i.json()}return{prices:[]}},staleTime:3e4});if(!(0,h.is)(c,o))throw Error("Malformed response received from Price API");return c}}},760322(module,__unused_webpack_exports,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";var t=function(t){t==undefined&&(t=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=0x9908b0df,this.UPPER_MASK=0x80000000,this.LOWER_MASK=0x7fffffff,this.mt=new Array(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};t.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((t&0xffff0000)>>>16)*0x6c078965<<16)+(t&65535)*0x6c078965+this.mti,this.mt[this.mti]>>>=0}},t.prototype.init_by_array=function(t,i){var s,r,e;for(this.init_seed(0x12bd6aa),s=1,r=0,e=this.N>i?this.N:i;e;e--){var h=this.mt[s-1]^this.mt[s-1]>>>30;this.mt[s]=(this.mt[s]^(((h&0xffff0000)>>>16)*1664525<<16)+(h&65535)*1664525)+t[r]+r,this.mt[s]>>>=0,s++,r++,s>=this.N&&(this.mt[0]=this.mt[this.N-1],s=1),r>=i&&(r=0)}for(e=this.N-1;e;e--){var h=this.mt[s-1]^this.mt[s-1]>>>30;this.mt[s]=(this.mt[s]^(((h&0xffff0000)>>>16)*0x5d588b65<<16)+(h&65535)*0x5d588b65)-s,this.mt[s]>>>=0,++s>=this.N&&(this.mt[0]=this.mt[this.N-1],s=1)}this.mt[0]=0x80000000},t.prototype.random_int=function(){var t;var i=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var s;for(this.mti==this.N+1&&this.init_seed(5489),s=0;s<this.N-this.M;s++)t=this.mt[s]&this.UPPER_MASK|this.mt[s+1]&this.LOWER_MASK,this.mt[s]=this.mt[s+this.M]^t>>>1^i[t&1];for(;s<this.N-1;s++)t=this.mt[s]&this.UPPER_MASK|this.mt[s+1]&this.LOWER_MASK,this.mt[s]=this.mt[s+(this.M-this.N)]^t>>>1^i[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^i[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&0x9d2c5680,t^=t<<15&0xefc60000,(t^=t>>>18)>>>0},t.prototype.random_int31=function(){return this.random_int()>>>1},t.prototype.random_incl=function(){return this.random_int()*(1/0xffffffff)},t.prototype.random=function(){return this.random_int()*(1/0x100000000)},t.prototype.random_excl=function(){return(this.random_int()+.5)*(1/0x100000000)},t.prototype.random_long=function(){return((this.random_int()>>>5)*0x4000000+(this.random_int()>>>6))*(1/0x20000000000000)},module.exports=t}}).call(__webpack_require__._LM_("@metamask/jazzicon>mersenne-twister",{module,__webpack_require__}))()}}]);