Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

85.8 KB
Raw Blame
/* hood-pay checkout widget | MIT | https://github.com/nirholas/hood-pay */
"use strict";(()=>{var on=Object.defineProperty;var rn=(e,t,o)=>t in e?on(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var d=(e,t)=>()=>(e&&(t=e(e=0)),t);var ae=(e,t,o)=>rn(e,typeof t!="symbol"?t+"":t,o);function io(e,t){return e.exec(t)?.groups}var ao=d(()=>{});function ke(e){let t=e.type;if(so.test(e.type)&&"components"in e){t="(";let o=e.components.length;for(let n=0;n<o;n++){let i=e.components[n];t+=ke(i),n<o-1&&(t+=", ")}let r=io(so,e.type);return t+=`)${r?.array||""}`,ke({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}var so,co=d(()=>{ao();so=/^tuple(?<array>(\[(\d*)\])*)$/});function V(e){let t="",o=e.length;for(let r=0;r<o;r++){let n=e[r];t+=ke(n),r!==o-1&&(t+=", ")}return t}var po=d(()=>{co()});function ct(e){return e.type==="function"?`function ${e.name}(${V(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${V(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${V(e.inputs)})`:e.type==="error"?`error ${e.name}(${V(e.inputs)})`:e.type==="constructor"?`constructor(${V(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}var uo=d(()=>{po()});var mo=d(()=>{uo()});function se(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Se(e.type);return`${e.name}(${Ce(e.inputs,{includeName:t})})`}function Ce(e,{includeName:t=!1}={}){return e?e.map(o=>nn(o,{includeName:t})).join(t?", ":","):""}function nn(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Ce(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}var pt=d(()=>{O()});function k(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}var W=d(()=>{});function g(e){return k(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var X=d(()=>{W()});var dt,fo=d(()=>{dt="2.55.2"});function lo(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?lo(e.cause,t):t?null:e}var ut,x,C=d(()=>{fo();ut={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:o})=>t?`${e??"https://viem.sh"}${t}${o?`#${o}`:""}`:void 0,version:`viem@${dt}`},x=class e extends Error{constructor(t,o={}){let r=o.cause instanceof e?o.cause.details:o.cause?.message?o.cause.message:o.details,n=o.cause instanceof e&&o.cause.docsPath||o.docsPath,i=ut.getDocsUrl?.({...o,docsPath:n}),a=[t||"An error occurred.","",...o.metaMessages?[...o.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...ut.version?[`Version: ${ut.version}`]:[]].join(`
`);super(a,o.cause?{cause:o.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=o.metaMessages,this.name=o.name??this.name,this.shortMessage=t,this.version=dt}walk(t){return lo(this,t)}}});var Ie,De,Be,Re,Fe,P,Me,Ue,Ne,Pe,$e,Se,O=d(()=>{pt();X();C();Ie=class extends x{constructor({data:t,params:o,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
`),{metaMessages:[`Params: (${Ce(o,{includeName:!0})})`,`Data:   ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=o,this.size=r}},De=class extends x{constructor({cause:t}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:t})}},Be=class extends x{constructor({expectedLength:t,givenLength:o,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${o}`].join(`
`),{name:"AbiEncodingArrayLengthMismatchError"})}},Re=class extends x{constructor({expectedSize:t,value:o}){super(`Size of bytes "${o}" (bytes${g(o)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}},Fe=class extends x{constructor({expectedLength:t,givenLength:o}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${o}`].join(`
`),{name:"AbiEncodingLengthMismatchError"})}},P=class extends x{constructor(t,{docsPath:o}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:o,name:"AbiFunctionNotFoundError"})}},Me=class extends x{constructor(t,{docsPath:o}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:o,name:"AbiFunctionOutputsNotFoundError"})}},Ue=class extends x{constructor(t,o){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${se(t.abiItem)}\`, and`,`\`${o.type}\` in \`${se(o.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}},Ne=class extends x{constructor(t,{docsPath:o}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:o,name:"InvalidAbiEncodingType"})}},Pe=class extends x{constructor(t,{docsPath:o}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:o,name:"InvalidAbiDecodingType"})}},$e=class extends x{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
`),{name:"InvalidArrayError"})}},Se=class extends x{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
`),{name:"InvalidDefinitionTypeError"})}}});var ce,pe,mt=d(()=>{C();ce=class extends x{constructor({offset:t,position:o,size:r}){super(`Slice ${o==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},pe=class extends x{constructor({size:t,targetSize:o,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${o}).`,{name:"SizeExceedsPaddingSizeError"})}}});function $(e,{dir:t,size:o=32}={}){return typeof e=="string"?D(e,{dir:t,size:o}):an(e,{dir:t,size:o})}function D(e,{dir:t,size:o=32}={}){if(o===null)return e;let r=e.replace("0x","");if(r.length>o*2)throw new pe({size:Math.ceil(r.length/2),targetSize:o,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](o*2,"0")}`}function an(e,{dir:t,size:o=32}={}){if(o===null)return e;if(e.length>o)throw new pe({size:e.length,targetSize:o,type:"bytes"});let r=new Uint8Array(o);for(let n=0;n<o;n++){let i=t==="right";r[i?n:o-n-1]=e[i?n:e.length-n-1]}return r}var Le=d(()=>{mt()});var L,ze,He,de=d(()=>{C();L=class extends x{constructor({max:t,min:o,signed:r,size:n,value:i}){super(`Number "${i}" is not in safe ${n?`${n*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${o} to ${t})`:`(above ${o})`}`,{name:"IntegerOutOfRangeError"})}},ze=class extends x{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}},He=class extends x{constructor({givenSize:t,maxSize:o}){super(`Size cannot exceed ${o} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}});function ue(e,{dir:t="left"}={}){let o=typeof e=="string"?e.replace("0x",""):e,r=0;for(let n=0;n<o.length-1&&o[t==="left"?n:o.length-n-1].toString()==="0";n++)r++;return o=t==="left"?o.slice(r):o.slice(0,o.length-r),typeof e=="string"?(o.length===1&&t==="right"&&(o=`${o}0`),`0x${o.length%2===1?`0${o}`:o}`):o}var ft=d(()=>{});function A(e,{size:t}){if(g(e)>t)throw new He({givenSize:g(e),maxSize:t})}function lt(e,t={}){let{signed:o}=t;t.size&&A(e,{size:t.size});let r=BigInt(e);if(!o)return r;let n=(e.length-2)/2,i=(1n<<BigInt(n)*8n-1n)-1n;return r<=i?r:r-BigInt(`0x${"f".padStart(n*2,"f")}`)-1n}function xo(e,t={}){let o=lt(e,t),r=Number(o);if(!Number.isSafeInteger(r))throw new L({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${o}n`});return r}var Ge=d(()=>{de();X()});function ho(e,t={}){return typeof e=="number"||typeof e=="bigint"?B(e,t):typeof e=="string"?ht(e,t):typeof e=="boolean"?xt(e,t):S(e,t)}function xt(e,t={}){let o=`0x${Number(e)}`;return typeof t.size=="number"?(A(o,{size:t.size}),$(o,{size:t.size})):o}function S(e,t={}){let o="";for(let n=0;n<e.length;n++)o+=sn[e[n]];let r=`0x${o}`;return typeof t.size=="number"?(A(r,{size:t.size}),$(r,{dir:"right",size:t.size})):r}function B(e,t={}){let{signed:o,size:r}=t,n=BigInt(e),i;r?o?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let a=typeof i=="bigint"&&o?-i-1n:0;if(i&&n>i||n<a){let c=typeof e=="bigint"?"n":"";throw new L({max:i?`${i}${c}`:void 0,min:`${a}${c}`,signed:o,size:r,value:`${e}${c}`})}let s=`0x${(o&&n<0?(1n<<BigInt(r*8))+BigInt(n):n).toString(16)}`;return r?$(s,{size:r}):s}function ht(e,t={}){let o=cn.encode(e);return S(o,t)}var sn,cn,K=d(()=>{de();Le();Ge();sn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));cn=new TextEncoder});function Oe(e,t={}){return typeof e=="number"||typeof e=="bigint"?un(e,t):typeof e=="boolean"?dn(e,t):k(e)?_e(e,t):yt(e,t)}function dn(e,t={}){let o=new Uint8Array(1);return o[0]=Number(e),typeof t.size=="number"?(A(o,{size:t.size}),$(o,{size:t.size})):o}function yo(e){if(e>=R.zero&&e<=R.nine)return e-R.zero;if(e>=R.A&&e<=R.F)return e-(R.A-10);if(e>=R.a&&e<=R.f)return e-(R.a-10)}function _e(e,t={}){let o=e;t.size&&(A(o,{size:t.size}),o=$(o,{dir:"right",size:t.size}));let r=o.slice(2);r.length%2&&(r=`0${r}`);let n=r.length/2,i=new Uint8Array(n);for(let a=0,s=0;a<n;a++){let c=yo(r.charCodeAt(s++)),p=yo(r.charCodeAt(s++));if(c===void 0||p===void 0)throw new x(`Invalid byte sequence ("${r[s-2]}${r[s-1]}" in "${r}").`);i[a]=c*16+p}return i}function un(e,t){let o=B(e,t);return _e(o)}function yt(e,t={}){let o=pn.encode(e);return typeof t.size=="number"?(A(o,{size:t.size}),$(o,{dir:"right",size:t.size})):o}var pn,R,me=d(()=>{C();W();Le();Ge();K();pn=new TextEncoder;R={zero:48,nine:57,A:65,F:70,a:97,f:102}});function mn(e,t=!1){return t?{h:Number(e&je),l:Number(e>>bo&je)}:{h:Number(e>>bo&je)|0,l:Number(e&je)|0}}function go(e,t=!1){let o=e.length,r=new Uint32Array(o),n=new Uint32Array(o);for(let i=0;i<o;i++){let{h:a,l:s}=mn(e[i],t);[r[i],n[i]]=[a,s]}return[r,n]}var je,bo,Eo,Ao,wo,To,vo=d(()=>{je=BigInt(4294967295),bo=BigInt(32);Eo=(e,t,o)=>e<<o|t>>>32-o,Ao=(e,t,o)=>t<<o|e>>>32-o,wo=(e,t,o)=>t<<o-32|e>>>64-o,To=(e,t,o)=>e<<o-32|t>>>64-o});function fn(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function bt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function fe(e,...t){if(!fn(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function gt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function ko(e,t){fe(e);let o=t.outputLen;if(e.length<o)throw new Error("digestInto() expects output buffer of length at least "+o)}function Co(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Et(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function xn(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function hn(e){for(let t=0;t<e.length;t++)e[t]=xn(e[t]);return e}function yn(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function wt(e){return typeof e=="string"&&(e=yn(e)),fe(e),e}function So(e){let t=r=>e().update(wt(r)).digest(),o=e();return t.outputLen=o.outputLen,t.blockLen=o.blockLen,t.create=()=>e(),t}var ln,At,qe,Io=d(()=>{ln=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;At=ln?e=>e:hn;qe=class{}});function kn(e,t=24){let o=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let a=0;a<10;a++)o[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){let s=(a+8)%10,c=(a+2)%10,p=o[c],y=o[c+1],h=Do(p,y,1)^o[s],T=Bo(p,y,1)^o[s+1];for(let u=0;u<50;u+=10)e[a+u]^=h,e[a+u+1]^=T}let n=e[2],i=e[3];for(let a=0;a<24;a++){let s=Fo[a],c=Do(n,i,s),p=Bo(n,i,s),y=Ro[a];n=e[y],i=e[y+1],e[y]=c,e[y+1]=p}for(let a=0;a<50;a+=10){for(let s=0;s<10;s++)o[s]=e[a+s];for(let s=0;s<10;s++)e[a+s]^=~o[(s+2)%10]&o[(s+4)%10]}e[0]^=Tn[r],e[1]^=vn[r]}Et(o)}var bn,le,gn,En,An,wn,Ro,Fo,Mo,Uo,Tn,vn,Do,Bo,Tt,Cn,No,Po=d(()=>{vo();Io();bn=BigInt(0),le=BigInt(1),gn=BigInt(2),En=BigInt(7),An=BigInt(256),wn=BigInt(113),Ro=[],Fo=[],Mo=[];for(let e=0,t=le,o=1,r=0;e<24;e++){[o,r]=[r,(2*o+3*r)%5],Ro.push(2*(5*r+o)),Fo.push((e+1)*(e+2)/2%64);let n=bn;for(let i=0;i<7;i++)t=(t<<le^(t>>En)*wn)%An,t&gn&&(n^=le<<(le<<BigInt(i))-le);Mo.push(n)}Uo=go(Mo,!0),Tn=Uo[0],vn=Uo[1],Do=(e,t,o)=>o>32?wo(e,t,o):Eo(e,t,o),Bo=(e,t,o)=>o>32?To(e,t,o):Ao(e,t,o);Tt=class e extends qe{constructor(t,o,r,n=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=o,this.outputLen=r,this.enableXOF=n,this.rounds=i,bt(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Co(this.state)}clone(){return this._cloneInto()}keccak(){At(this.state32),kn(this.state32,this.rounds),At(this.state32),this.posOut=0,this.pos=0}update(t){gt(this),t=wt(t),fe(t);let{blockLen:o,state:r}=this,n=t.length;for(let i=0;i<n;){let a=Math.min(o-this.pos,n-i);for(let s=0;s<a;s++)r[this.pos++]^=t[i++];this.pos===o&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:o,pos:r,blockLen:n}=this;t[r]^=o,(o&128)!==0&&r===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){gt(this,!1),fe(t),this.finish();let o=this.state,{blockLen:r}=this;for(let n=0,i=t.length;n<i;){this.posOut>=r&&this.keccak();let a=Math.min(r-this.posOut,i-n);t.set(o.subarray(this.posOut,this.posOut+a),n),this.posOut+=a,n+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return bt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ko(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Et(this.state)}_cloneInto(t){let{blockLen:o,suffix:r,outputLen:n,rounds:i,enableXOF:a}=this;return t||(t=new e(o,r,n,a,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=n,t.enableXOF=a,t.destroyed=this.destroyed,t}},Cn=(e,t,o)=>So(()=>new Tt(t,e,o)),No=Cn(1,136,256/8)});function Ve(e,t){let o=t||"hex",r=No(k(e,{strict:!1})?Oe(e):e);return o==="bytes"?r:ho(r)}var vt=d(()=>{Po();W();me();K()});function $o(e){return Sn(e)}var Sn,Lo=d(()=>{me();vt();Sn=e=>Ve(Oe(e))});function zo(e){let t=!0,o="",r=0,n="",i=!1;for(let a=0;a<e.length;a++){let s=e[a];if(["(",")",","].includes(s)&&(t=!0),s==="("&&r++,s===")"&&r--,!!t){if(r===0){if(s===" "&&["event","function",""].includes(n))n="";else if(n+=s,s===")"){i=!0;break}continue}if(s===" "){e[a-1]!==","&&o!==","&&o!==",("&&(o="",t=!1);continue}n+=s,o+=s}}if(!i)throw new x("Unable to normalize signature.");return n}var Ho=d(()=>{C()});var Go,Oo=d(()=>{mo();Ho();Go=e=>{let t=typeof e=="string"?e:ct(e);return zo(t)}});function We(e){return $o(Go(e))}var kt=d(()=>{Lo();Oo()});var _o,jo=d(()=>{kt();_o=We});var Q,Ct=d(()=>{C();Q=class extends x{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var Y,St=d(()=>{Y=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let o=super.get(t);return super.has(t)&&(super.delete(t),super.set(t,o)),o}set(t,o){if(super.has(t)&&super.delete(t),super.set(t,o),this.maxSize&&this.size>this.maxSize){let r=super.keys().next().value;r!==void 0&&super.delete(r)}return this}}});function Z(e,t){if(It.has(`${e}.${t}`))return It.get(`${e}.${t}`);let o=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=Ve(yt(o),"bytes"),n=(t?o.substring(`${t}0x`.length):o).split("");for(let a=0;a<40;a+=2)r[a>>1]>>4>=8&&n[a]&&(n[a]=n[a].toUpperCase()),(r[a>>1]&15)>=8&&n[a+1]&&(n[a+1]=n[a+1].toUpperCase());let i=`0x${n.join("")}`;return It.set(`${e}.${t}`,i),i}function xe(e,t){if(!w(e,{strict:!1}))throw new Q({address:e});return Z(e,t)}var It,Xe=d(()=>{Ct();me();vt();St();he();It=new Y(8192)});function w(e,t){let{strict:o=!0}=t??{},r=`${e}.${o}`;if(Dt.has(r))return Dt.get(r);let n=In.test(e)?e.toLowerCase()===e?!0:o?Z(e)===e:!0:!1;return Dt.set(r,n),n}var In,Dt,he=d(()=>{St();Xe();In=/^0x[a-fA-F0-9]{40}$/,Dt=new Y(8192)});function F(e){return`0x${e.reduce((t,o)=>t+o.replace("0x",""),"")}`}var Bt=d(()=>{});function Ke(e,t,o,{strict:r}={}){return k(e,{strict:!1})?Dn(e,t,o,{strict:r}):Rt(e,t,o,{strict:r})}function qo(e,t){if(typeof t=="number"&&t>0&&t>g(e)-1)throw new ce({offset:t,position:"start",size:g(e)})}function Vo(e,t,o){if(typeof t=="number"&&typeof o=="number"&&g(e)!==o-t)throw new ce({offset:o,position:"end",size:g(e)})}function Rt(e,t,o,{strict:r}={}){qo(e,t);let n=e.slice(t,o);return r&&Vo(n,t,o),n}function Dn(e,t,o,{strict:r}={}){qo(e,t);let n=`0x${e.replace("0x","").slice((t??0)*2,(o??e.length)*2)}`;return r&&Vo(n,t,o),n}var Qe=d(()=>{mt();W();X()});var Wo,Xo=d(()=>{Wo=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/});function Ko(e,t){if(e.length!==t.length)throw new Fe({expectedLength:e.length,givenLength:t.length});let o=Bn({params:e,values:t});return Ut(o)}function Bn({params:e,values:t}){let o=[];for(let r=0;r<e.length;r++)o.push(Mt({param:e[r],value:t[r]}));return o}function Mt({param:e,value:t}){let o=ye(e.type);if(o){let[r,n]=o;return Fn(t,{length:r,param:{...e,type:n}})}if(e.type==="tuple")return $n(t,{param:e});if(e.type==="address")return Rn(t);if(e.type==="bool")return Un(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){let r=e.type.startsWith("int"),[,,n="256"]=Wo.exec(e.type)??[];return Nn(t,{signed:r,size:Number(n)})}if(e.type.startsWith("bytes"))return Mn(t,{param:e});if(e.type==="string")return Pn(t);throw new Ne(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Ut(e){let t=0;for(let i=0;i<e.length;i++){let{dynamic:a,encoded:s}=e[i];a?t+=32:t+=g(s)}let o=[],r=[],n=0;for(let i=0;i<e.length;i++){let{dynamic:a,encoded:s}=e[i];a?(o.push(B(t+n,{size:32})),r.push(s),n+=g(s)):o.push(s)}return F([...o,...r])}function Rn(e){if(!w(e))throw new Q({address:e});return{dynamic:!1,encoded:D(e.toLowerCase())}}function Fn(e,{length:t,param:o}){let r=t===null;if(!Array.isArray(e))throw new $e(e);if(!r&&e.length!==t)throw new Be({expectedLength:t,givenLength:e.length,type:`${o.type}[${t}]`});let n=e.length===0&&Ft(o),i=[];for(let a=0;a<e.length;a++){let s=Mt({param:o,value:e[a]});s.dynamic&&(n=!0),i.push(s)}if(r||n){let a=Ut(i);if(r){let s=B(i.length,{size:32});return{dynamic:!0,encoded:F([s,a])}}if(n)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:F(i.map(({encoded:a})=>a))}}function Mn(e,{param:t}){let[,o]=t.type.split("bytes"),r=g(e);if(!o){let n=e;return r%32!==0&&(n=D(n,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:F([D(B(r,{size:32})),n])}}if(r!==Number.parseInt(o,10))throw new Re({expectedSize:Number.parseInt(o,10),value:e});return{dynamic:!1,encoded:D(e,{dir:"right"})}}function Un(e){if(typeof e!="boolean")throw new x(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:D(xt(e))}}function Nn(e,{signed:t,size:o=256}){if(typeof o=="number"){let r=2n**(BigInt(o)-(t?1n:0n))-1n,n=t?-r-1n:0n;if(e>r||e<n)throw new L({max:r.toString(),min:n.toString(),signed:t,size:o/8,value:e.toString()})}return{dynamic:!1,encoded:B(e,{size:32,signed:t})}}function Pn(e){let t=ht(e),o=Math.ceil(g(t)/32),r=[];for(let n=0;n<o;n++)r.push(D(Ke(t,n*32,(n+1)*32),{dir:"right"}));return{dynamic:!0,encoded:F([D(B(g(t),{size:32})),...r])}}function $n(e,{param:t}){let o=!1,r=[];for(let n=0;n<t.components.length;n++){let i=t.components[n],a=Array.isArray(e)?n:i.name,s=Mt({param:i,value:e[a]});r.push(s),s.dynamic&&(o=!0)}return{dynamic:o,encoded:o?Ut(r):F(r.map(({encoded:n})=>n))}}function ye(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Ft(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components.some(Ft);let o=ye(t);return o?Ft({...e,type:o[1]}):!1}var Nt=d(()=>{O();Ct();C();de();he();Bt();Le();X();Qe();K();Xo()});var Ye,Pt=d(()=>{Qe();kt();Ye=e=>Ke(We(e),0,4)});function Ze(e){let{abi:t,args:o=[],name:r}=e,n=k(r,{strict:!1}),i=t.filter(s=>n?s.type==="function"?Ye(s)===r:s.type==="event"?_o(s)===r:!1:"name"in s&&s.name===r);if(i.length===0)return;if(i.length===1)return i[0];let a;for(let s of i){if(!("inputs"in s))continue;if(!o||o.length===0){if(!s.inputs||s.inputs.length===0)return s;continue}if(!s.inputs||s.inputs.length===0||s.inputs.length!==o.length)continue;if(o.every((p,y)=>{let h="inputs"in s&&s.inputs[y];return h?$t(p,h):!1})){if(a&&"inputs"in a&&a.inputs){let p=Qo(s.inputs,a.inputs,o);if(p)throw new Ue({abiItem:s,type:p[0]},{abiItem:a,type:p[1]})}a=s}}return a||i[0]}function $t(e,t){let o=typeof e,r=t.type;switch(r){case"address":return w(e,{strict:!1});case"bool":return o==="boolean";case"function":return o==="string";case"string":return o==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((n,i)=>o==="object"&&$t(Object.values(e)[i],n)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?o==="number"||o==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?o==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(n=>$t(n,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Qo(e,t,o){for(let r in e){let n=e[r],i=t[r];if(n.type==="tuple"&&i.type==="tuple"&&"components"in n&&"components"in i)return Qo(n.components,i.components,o[r]);let a=[n.type,i.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?w(o[r],{strict:!1}):a.includes("address")&&a.includes("bytes")?w(o[r],{strict:!1}):!1)return a}}var Lt=d(()=>{O();W();he();jo();Pt()});function Zo(e){let{abi:t,args:o,functionName:r}=e,n=t[0];if(r){let i=Ze({abi:t,args:o,name:r});if(!i)throw new P(r,{docsPath:Yo});n=i}if(n.type!=="function")throw new P(void 0,{docsPath:Yo});return{abi:[n],functionName:Ye(se(n))}}var Yo,Jo=d(()=>{O();Pt();pt();Lt();Yo="/docs/contract/encodeFunctionData"});function z(e){let{args:t}=e,{abi:o,functionName:r}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:Zo(e),n=o[0],i=r,a="inputs"in n&&n.inputs?Ko(n.inputs,t??[]):void 0;return F([i,a??"0x"])}var er=d(()=>{Bt();Nt();Jo()});var be,Je,et,tr=d(()=>{C();be=class extends x{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},Je=class extends x{constructor({length:t,position:o}){super(`Position \`${o}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},et=class extends x{constructor({count:t,limit:o}){super(`Recursive read limit of \`${o}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}});function or(e,{recursiveReadLimit:t=8192}={}){let o=Object.create(Ln);return o.bytes=e,o.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),o.positionReadCount=new Map,o.recursiveReadLimit=t,o}var Ln,rr=d(()=>{tr();Ln={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new et({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Je({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new be({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new be({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let o=t??this.position;return this.assertPosition(o+e-1),this.bytes.subarray(o,o+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let o=this.inspectBytes(e);return this.position+=t??e,o},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}}});function nr(e,t={}){typeof t.size<"u"&&A(e,{size:t.size});let o=S(e,t);return lt(o,t)}function ir(e,t={}){let o=e;if(typeof t.size<"u"&&(A(o,{size:t.size}),o=ue(o)),o.length>1||o[0]>1)throw new ze(o);return!!o[0]}function I(e,t={}){typeof t.size<"u"&&A(e,{size:t.size});let o=S(e,t);return xo(o,t)}function ar(e,t={}){let o=e;return typeof t.size<"u"&&(A(o,{size:t.size}),o=ue(o,{dir:"right"})),new TextDecoder().decode(o)}var sr=d(()=>{de();ft();Ge();K()});function pr(e,t){let o=typeof t=="string"?_e(t):t,r=or(o);if(g(o)===0&&e.length>0)throw new De;if(g(t)&&g(t)<32)throw new Ie({data:typeof t=="string"?t:S(t),params:e,size:g(t)});let n=0,i=[];for(let a=0;a<e.length;++a){let s=e[a];n<o.length&&r.setPosition(n);let[c,p]=J(r,s,{staticPosition:0});n+=p,i.push(c)}return i}function J(e,t,{staticPosition:o}){let r=ye(t.type);if(r){let[n,i]=r;return Hn(e,{...t,type:i},{length:n,staticPosition:o})}if(t.type==="tuple")return jn(e,t,{staticPosition:o});if(t.type==="address")return zn(e);if(t.type==="bool")return Gn(e);if(t.type.startsWith("bytes"))return On(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return _n(e,t);if(t.type==="string")return qn(e,{staticPosition:o});throw new Pe(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function zn(e){let t=e.readBytes(32);return[Z(S(Rt(t,-20))),32]}function Hn(e,t,{length:o,staticPosition:r}){if(o===null){let a=I(e.readBytes(zt)),s=r+a,c=s+cr;e.setPosition(s);let p=I(e.readBytes(cr)),y=ge(t),h=0,T=[];for(let u=0;u<p;++u){e.setPosition(c+(y?u*32:h));let[U,ne]=J(e,t,{staticPosition:c});h+=ne,T.push(U),ne===0&&(e.assertReadLimit(),e._touch())}return e.setPosition(r+32),[T,32]}if(ge(t)){let a=I(e.readBytes(zt)),s=r+a,c=[];for(let p=0;p<o;++p){e.setPosition(s+p*32);let[y]=J(e,t,{staticPosition:s});c.push(y)}return e.setPosition(r+32),[c,32]}let n=0,i=[];for(let a=0;a<o;++a){let[s,c]=J(e,t,{staticPosition:r+n});n+=c,i.push(s),c===0&&(e.assertReadLimit(),e._touch())}return[i,n]}function Gn(e){return[ir(e.readBytes(32),{size:32}),32]}function On(e,t,{staticPosition:o}){let[r,n]=t.type.split("bytes");if(!n){let a=I(e.readBytes(32));e.setPosition(o+a);let s=I(e.readBytes(32));if(s===0)return e.setPosition(o+32),["0x",32];let c=e.readBytes(s);return e.setPosition(o+32),[S(c),32]}return[S(e.readBytes(Number.parseInt(n,10),32)),32]}function _n(e,t){let o=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),n=e.readBytes(32);return[r>48?nr(n,{signed:o}):I(n,{signed:o}),32]}function jn(e,t,{staticPosition:o}){let r=t.components.length===0||t.components.some(({name:a})=>!a),n=r?[]:{},i=0;if(ge(t)){let a=I(e.readBytes(zt)),s=o+a;for(let c=0;c<t.components.length;++c){let p=t.components[c];e.setPosition(s+i);let[y,h]=J(e,p,{staticPosition:s});i+=h,n[r?c:p?.name]=y}return e.setPosition(o+32),[n,32]}for(let a=0;a<t.components.length;++a){let s=t.components[a],[c,p]=J(e,s,{staticPosition:o});n[r?a:s?.name]=c,i+=p}return[n,i]}function qn(e,{staticPosition:t}){let o=I(e.readBytes(32)),r=t+o;e.setPosition(r);let n=I(e.readBytes(32));if(n===0)return e.setPosition(t+32),["",32];let i=e.readBytes(n,32),a=ar(ue(i));return e.setPosition(t+32),[a,32]}function ge(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(ge);let o=ye(e.type);return!!(o&&ge({...e,type:o[1]}))}var cr,zt,dr=d(()=>{O();Xe();rr();X();Qe();ft();sr();me();K();Nt();cr=32,zt=32});function ee(e,t){let o=e.toString(),r=o.startsWith("-");r&&(o=o.slice(1)),o=o.padStart(t,"0");let[n,i]=[o.slice(0,o.length-t),o.slice(o.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${n||"0"}${i?`.${i}`:""}`}var ur=d(()=>{});function Gt(e){let{abi:t,args:o,functionName:r,data:n}=e,i=t[0];if(r){let s=Ze({abi:t,args:o,name:r});if(!s)throw new P(r,{docsPath:Ht});i=s}if(i.type!=="function")throw new P(void 0,{docsPath:Ht});if(!i.outputs)throw new Me(i.name,{docsPath:Ht});let a=pr(i.outputs,n);if(a&&a.length>1)return a;if(a&&a.length===1)return a[0]}var Ht,mr=d(()=>{O();dr();Lt();Ht="/docs/contract/decodeFunctionResult"});var Vt,wr=d(()=>{Vt="2.55.2"});function Tr(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Tr(e.cause,t):t?null:e}var Wt,oe,Xt=d(()=>{wr();Wt={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:o})=>t?`${e??"https://viem.sh"}${t}${o?`#${o}`:""}`:void 0,version:`viem@${Vt}`},oe=class e extends Error{constructor(t,o={}){let r=o.cause instanceof e?o.cause.details:o.cause?.message?o.cause.message:o.details,n=o.cause instanceof e&&o.cause.docsPath||o.docsPath,i=Wt.getDocsUrl?.({...o,docsPath:n}),a=[t||"An error occurred.","",...o.metaMessages?[...o.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...Wt.version?[`Version: ${Wt.version}`]:[]].join(`
`);super(a,o.cause?{cause:o.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=o.metaMessages,this.name=o.name??this.name,this.shortMessage=t,this.version=Vt}walk(t){return Tr(this,t)}}});var Ee,vr=d(()=>{Xt();Ee=class extends oe{constructor({size:t,targetSize:o,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${o}).`,{name:"SizeExceedsPaddingSizeError"})}}});function kr(e,{dir:t,size:o=32}={}){return typeof e=="string"?Jn(e,{dir:t,size:o}):ei(e,{dir:t,size:o})}function Jn(e,{dir:t,size:o=32}={}){if(o===null)return e;let r=e.replace("0x","");if(r.length>o*2)throw new Ee({size:Math.ceil(r.length/2),targetSize:o,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](o*2,"0")}`}function ei(e,{dir:t,size:o=32}={}){if(o===null)return e;if(e.length>o)throw new Ee({size:e.length,targetSize:o,type:"bytes"});let r=new Uint8Array(o);for(let n=0;n<o;n++){let i=t==="right";r[i?n:o-n-1]=e[i?n:e.length-n-1]}return r}var Cr=d(()=>{vr()});var rt,Sr=d(()=>{Xt();rt=class extends oe{constructor({max:t,min:o,signed:r,size:n,value:i}){super(`Number "${i}" is not in safe ${n?`${n*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${o} to ${t})`:`(above ${o})`}`,{name:"IntegerOutOfRangeError"})}}});function Ae(e,t={}){let{signed:o,size:r}=t,n=BigInt(e),i;r?o?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let a=typeof i=="bigint"&&o?-i-1n:0;if(i&&n>i||n<a){let c=typeof e=="bigint"?"n":"";throw new rt({max:i?`${i}${c}`:void 0,min:`${a}${c}`,signed:o,size:r,value:`${e}${c}`})}let s=`0x${(o&&n<0?(1n<<BigInt(r*8))+BigInt(n):n).toString(16)}`;return r?kr(s,{size:r}):s}var Ir=d(()=>{Sr();Cr()});C();var tt=class extends x{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}};function te(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new tt({value:e});let[o,r="0"]=e.split("."),n=o.startsWith("-");if(n&&(o=o.slice(1)),r=r.replace(/(0+)$/,""),t===0)Math.round(+`.${r}`)===1&&(o=`${BigInt(o)+1n}`),r="";else if(r.length>t){let[i,a,s]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],c=Math.round(+`${a}.${s}`);c>9?r=`${BigInt(i)+BigInt(1)}0`.padStart(i.length+1,"0"):r=`${i}${c}`,r.length>t&&(r=r.slice(1),o=`${BigInt(o)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${n?"-":""}${o}${r}`)}mr();er();Xe();he();ur();var fr={usdg:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",weth:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",uniswapV3Factory:"0x1f7d7550B1b028f7571E69A784071F0205FD2EfA",quoterV2:"0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7",swapRouter02:"0xCaf681a66D020601342297493863E78C959E5cb2",universalRouter:"0x53BF6B0684Ec7eF91e1387Da3D1a1769bC5A6F77",nonfungiblePositionManager:"0x73991a25C818Bf1f1128dEAaB1492D45638DE0D3",multicall3:"0xca11bde05977b3631167028862be2a173976ca11"},lr={usdg:"0x7E955252E15c84f5768B83c41a71F9eba181802F",weth:"0x7943e237c7F95DA44E0301572D358911207852Fa",uniswapV3Factory:"0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865",quoterV2:"0xcf05Fc31A6B693DD0bEB76e958ae4BCD490dc985",swapRouter:"0x1b81D678ffb9C0263b24A97847620C99d213eB14",nonfungiblePositionManager:"0x46A15B0b27311cedF172AB29E4f4766fbE7F4364",multicall3:"0xca11bde05977b3631167028862be2a173976ca11"};var _t=6;var Vn={$schema:"./stock-tokens.schema.json",chainId:4663,generatedAtBlock:7690522,sources:{discovery:'https://robinhoodchain.blockscout.com/api/v2/tokens?q=Robinhood Token (canonical name pattern "<Name> \u2022 Robinhood Token")',feeds:"https://reference-data-directory.vercel.app/feeds-robinhood-mainnet.json",verification:"on-chain via public RPC: shared beacon slot, symbol/name/decimals/uiMultiplier multicall, feed latestRoundData"},stockBeacon:"0xe10b6f6B275de231345c20D14Ab812db62151b00",tokenCount:95,feedCount:34,tokens:[{address:"0x521Cf887E6531c6F667b5BC4D896E5d9bfE8EB2E",symbol:"AAOI",name:"Applied Optoelectronics \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9",symbol:"AAPL",name:"Apple \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x6B22A786bAa607d76728168703a39Ea9C99f2cD0",feedDecimals:8,feedAnswerAtGeneration:"31550000000",feedUpdatedAtGeneration:1783710274},{address:"0x36046893810a7E7fCE501229d57dc3FC8c8716d0",symbol:"AMAT",name:"Applied Materials \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x86923f96303D656E4aa86D9d42D1e57ad2023fdC",symbol:"AMD",name:"AMD \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x943A29E7ae51A4798823ca9eEd2ed533B2A22C72",feedDecimals:8,feedAnswerAtGeneration:"55821015000",feedUpdatedAtGeneration:1783713346},{address:"0x12f190a9F9d7D37a250758b26824B97CE941bF54",symbol:"AMZN",name:"Amazon \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xD5a1508ceD74c084eBf3cBe853e2C968fB2a651C",feedDecimals:8,feedAnswerAtGeneration:"24556770000",feedUpdatedAtGeneration:1783692103},{address:"0xb8DBf92F9741c9ac1c32115E78581f23509916FD",symbol:"APLD",name:"Applied Digital \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x47F93d52cBeC7C6D2CfC080e154002370a60dAEA",symbol:"ASML",name:"ASML Holding NV \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xB4106147E8cce40b7d46124090d373A71b70f87D",feedDecimals:8,feedAnswerAtGeneration:"179758755000",feedUpdatedAtGeneration:1783710661},{address:"0x1AF6446f07eb1d97c546AFC8c9544cBDF3AD5137",symbol:"ASTS",name:"AST SpaceMobile \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x156E175DD063a8cE274C50654eF40e0032b3fbcF",symbol:"AVGO",name:"Broadcom \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x4D21483a44Bf67a86b77E3dA301411880797D452",symbol:"BA",name:"Boeing \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xad25Ac6C84D497db898fa1E8387bf6Af3532a1c4",symbol:"BABA",name:"Alibaba \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x62Cc8F9b5f56a33c9C8A60c8B92779f523c4E984",feedDecimals:8,feedAnswerAtGeneration:"11219500000",feedUpdatedAtGeneration:1783707523},{address:"0x822CC93fFD030293E9842c30BBD678F530701867",symbol:"BE",name:"Bloom Energy \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x5c90450Bbb4273D7b2f17CF6917AEB237A569679",symbol:"CBRS",name:"Cerebras Systems \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x9651342CeA770aE9a2969Ba2A52611523146aef9",symbol:"CCL",name:"Carnival Corporation \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x8cF07C5A878945185d327aAa6e33FAa95F95e7bF",symbol:"CELH",name:"Celsius \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xcBB95BBF36099d34dA091dc6Fa6F49EfA257Cee3",symbol:"CLSK",name:"CleanSpark \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x810c12D3a554Bc47fd39597Fe3b3AAC4941F50eF",feedDecimals:8,feedAnswerAtGeneration:"1286499999",feedUpdatedAtGeneration:1783713313},{address:"0x6330D8C3178a418788dF01a47479c0ce7CCF450b",symbol:"COIN",name:"Coinbase \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xA3a468A452940B7D6b69991207B508c609a98Ef2",feedDecimals:8,feedAnswerAtGeneration:"15943135000",feedUpdatedAtGeneration:1783703473},{address:"0x4EA005168D7F09a7A0Ba9D1DEf21a479950E44C2",symbol:"COST",name:"Costco \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xdF0992E440dD0be65BD8439b609d6D4366bf1CB5",symbol:"CRCL",name:"Circle Internet Group \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x6652eDf64bA3731C4F2D3ce821A0Fb1f1f6b482a",feedDecimals:8,feedAnswerAtGeneration:"6634635000",feedUpdatedAtGeneration:1783717360},{address:"0x5f10A1C971B69e47e059e1dC91901B59b3fB49C3",symbol:"CRWV",name:"CoreWeave \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xe1b3aABCAFAd1c94708dc1367dcfF8Aa4407487C",feedDecimals:8,feedAnswerAtGeneration:"8883970000",feedUpdatedAtGeneration:1783711393},{address:"0x27c99fBde9D0d2AA4f4Bfb4943f237843DdF6958",symbol:"DDOG",name:"Datadog \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x941AE714EC6D8130c7B75d67160Ca08f1e7d11Dd",symbol:"DELL",name:"Dell \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x39EC44Bee4F6A116c6F9B8De566848a985C53C60",symbol:"ELF",name:"e.l.f. Beauty \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x7f0aBeF0C07280F82c6a08ead09dEd6BAE2C13Fc",symbol:"EWY",name:"iShares MSCI South Korea fund \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xEFdf54610B62A7753Ec30bDc380847c12D32e1D1",feedDecimals:8,feedAnswerAtGeneration:"18377499999",feedUpdatedAtGeneration:1783705547},{address:"0x25C288E6D899b9BC30160965aD9644c67e73bE0C",symbol:"F",name:"Ford Motor \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x282e87451E10fA6679BC7D76C69BE44cD3fC777C",symbol:"FLNC",name:"Fluence Energy \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xeB30663bDFf0622Ef4e4E5cBb4E975F19f33f51D",symbol:"FUTU",name:"Futu Holdings \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x7c04E6A3368F2A1DE3874f0e80d2e0A1a9915da6",symbol:"GLW",name:"Corning \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x1b0E319c6A659F002271B69dB8A7df2F911c153E",symbol:"GME",name:"GameStop \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x27C71df6A64fB476468EdF256CF72c038baB5B67",feedDecimals:8,feedAnswerAtGeneration:"2176125000",feedUpdatedAtGeneration:1783694006},{address:"0x2e0847E8910a9732eB3fb1bb4b70a580ADAD4FE3",symbol:"GOOGL",name:"Alphabet Class A \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xF6f373a037c30F0e5010d854385cA89185AE638b",feedDecimals:8,feedAnswerAtGeneration:"35672000000",feedUpdatedAtGeneration:1783711606},{address:"0xf1953DAB6FaD537488d5A022361FfAa8B4c95eC6",symbol:"INOD",name:"Innodata \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",symbol:"INTC",name:"Intel \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x3f390C5C24628Ac7C489515402235FeAD71D1913",feedDecimals:8,feedAnswerAtGeneration:"10965095000",feedUpdatedAtGeneration:1783712771},{address:"0x56d23beE5f41A7120170b0c603Dae30128e460e9",symbol:"INTU",name:"Intuit \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x558378E000D634A36593E338eBacdd6207640EfE",symbol:"IONQ",name:"IonQ \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x22EfeC4919baf55F360E0EDee4AbEB26DE4971eb",feedDecimals:8,feedAnswerAtGeneration:"4308000000",feedUpdatedAtGeneration:1783711226},{address:"0xF0AB0c93bE6F41369d302e55db1A96b3c430212D",symbol:"IREN",name:"IREN Limited \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x8eF20885F94e3D9bc7eB3080279188Bd5ED7c08C",symbol:"LITE",name:"Lumentum \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x8005d266423c7ea827372c9c864491e5786600ea",symbol:"LLY",name:"Eli Lilly \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x4e62068525Ab11FE768e29dfD00ef909B9803016",symbol:"LULU",name:"Lululemon \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xa5D4968421bA94814Be3B136b15cf422101aC1a3",symbol:"LUNR",name:"Intuitive Machines \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xDdf2266b79abf0B48898959B0ed6E6adf512be74",symbol:"MDB",name:"MongoDB \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xc0D6457C16Cc70d6790Dd43521C899C87ce02f35",symbol:"META",name:"Meta Platforms \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x7C38C00C30BEe9378381E7B6135d7283356D71b1",feedDecimals:8,feedAnswerAtGeneration:"67067485000",feedUpdatedAtGeneration:1783713401},{address:"0x62fd0668e10D8B72339BE2DCF7643001688ff13B",symbol:"MRVL",name:"Marvell Technology \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xe93237C50D904957Cf27E7B1133b510C669c2e74",symbol:"MSFT",name:"Microsoft \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x45C3C877C15E6BA2EBB19eA114Ea508d14C1Af2E",feedDecimals:8,feedAnswerAtGeneration:"38469000000",feedUpdatedAtGeneration:1783697881},{address:"0xec262a75e413fAfD0dF80480274532C79D42da09",symbol:"MSTR",name:"Strategy Inc. \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x396118bdFB181e6240E74D243F266B061c0edc3D",feedDecimals:8,feedAnswerAtGeneration:"9469500000",feedUpdatedAtGeneration:1783712395},{address:"0xfF080c8ce2E5feadaCa0Da81314Ae59D232d4afD",symbol:"MU",name:"Micron Technology \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x425EEFdCf05ed6526C3cE61Af99429A228a6d596",feedDecimals:8,feedAnswerAtGeneration:"97854340000",feedUpdatedAtGeneration:1783713684},{address:"0x48961813349333209994750ffA89b3c5C22eC969",symbol:"MXL",name:"MaxLinear \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x9D9c6684F596F66a64C030B93A886D51Fd4D7931",symbol:"NBIS",name:"Nebius Group \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xE1D87B116Ba0fe898998f1D140339D1fA1E09705",feedDecimals:8,feedAnswerAtGeneration:"21923750000",feedUpdatedAtGeneration:1783713491},{address:"0xE0444EF8BF4eD74f74FD73686e2ddF4C1c5591E8",symbol:"NFLX",name:"Netflix \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xBEF75684C43c4ea7BD18Dd532a2244674Ee8b926",symbol:"NNE",name:"Nano Nuclear Energy \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x0C3260aF4B8f13a69c4c2dFb84fD667890CDFa14",symbol:"NOW",name:"ServiceNow \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x408c14038a04f7bD235329E26d2bf569ee20e250",symbol:"NU",name:"Nu \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",symbol:"NVDA",name:"NVIDIA \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x379EC4f7C378F34a1B47E4F3cbeBCbAC3E8E9F15",feedDecimals:8,feedAnswerAtGeneration:"21019000000",feedUpdatedAtGeneration:1783700623},{address:"0xbE6702d7b70315376dC48a3293f24f0982F86386",symbol:"NVTS",name:"Navitas Semiconductor \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xb0992820E760d836549ba69BC7598b4af75dEE03",symbol:"ORCL",name:"Oracle \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x0e6a64a2B58A6693a531E6c555f3A5d042eEA844",feedDecimals:8,feedAnswerAtGeneration:"14108370000",feedUpdatedAtGeneration:1783709137},{address:"0x1Cdad396DB64BDa184d5182A97Dd9B3C62100b7D",symbol:"P",name:"Everpure \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x9b23573b156B52565012F5cE02CDF60AFBaa70Be",symbol:"PENG",name:"Penguin Solutions \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x894E1EC2D74FFE5AEF8Dc8A9e84686acCB964F2A",symbol:"PLTR",name:"Palantir Technologies \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x820ABedFF239034956B7A9d2F0a331f9F075eB4c",feedDecimals:8,feedAnswerAtGeneration:"12656140000",feedUpdatedAtGeneration:1783714557},{address:"0xcf6B2D875361be807EAfa57458c80f28521F9333",symbol:"POET",name:"POET Technologies \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x4189F0c66EBBB0bfeF1C31f763131361EF32f77C",symbol:"PR",name:"Permian Resources \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xC583c60aeF9Dc401Da72cEC1B404743a93cea1Cc",symbol:"QBTS",name:"D-Wave Quantum \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x0f17206447090e464C277571124dD2688E48AEA9",symbol:"QCOM",name:"Qualcomm \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xD5f3879160bc7c32ebb4dC785F8a4F505888de68",symbol:"QQQ",name:"Invesco QQQ \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x80901d846d5D7B030F26B480776EE3b29374C2ae",feedDecimals:8,feedAnswerAtGeneration:"72545060000",feedUpdatedAtGeneration:1783702260},{address:"0x59818904ab4cE163b3cE4FfB64f2D6Ca02c434B4",symbol:"QUBT",name:"Quantum Computing \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xF0C4BF4C582cb3836e98394b1d4e7B7281101bE8",symbol:"RBLX",name:"Roblox \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x05b37Fb53A299a1b874A619e1c4C404D52C36F4C",symbol:"RDDT",name:"Reddit \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x92Ef19E82bD8fF36661DE838D5eaE7e5CEF0EfFE",symbol:"RDW",name:"Redwire \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x284358abc07F9359f19f4b5b4aC91901Be2597Ba",symbol:"RGTI",name:"Rigetti Computing \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x2A045cF1C49c61c166C036d2f06FA2D2d984f765",feedDecimals:8,feedAnswerAtGeneration:"1657150813",feedUpdatedAtGeneration:1783713654},{address:"0xB1BF26c1D20ff267A4f93550d1E0d06ac40a114B",symbol:"RIVN",name:"Rivian Automotive \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x3b14C39E89D60D627b42a1A4CA45b5bb45Fc12e2",symbol:"RKLB",name:"Rocket Lab Corporation \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x045477BF65Aef6f4F2386ad0164579e48381CC74",feedDecimals:8,feedAnswerAtGeneration:"8128970000",feedUpdatedAtGeneration:1783726597},{address:"0x95052ddcd5DC25641657424A8Cf04834997E1730",symbol:"SATS",name:"EchoStar \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x92FD66527192E3e61d4DDd13322Aa222DE86F9B5",symbol:"SGOV",name:"iShares 0-3 Month Treasury Bond \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000957519890990718",feed:"0xa0DF4ee0fFf975306345875E3548Fcc519577A11",feedDecimals:8,feedAnswerAtGeneration:"10060428845",feedUpdatedAtGeneration:1783728100},{address:"0xF53F66751B1Eff985311b693531E3290F600c410",symbol:"SHOP",name:"Shopify \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x411eFb0E7f985935DAec3D4C3ebaEa0d0AD7D89f",symbol:"SLV",name:"iShares Silver Trust \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x209b73908e92Ae021826eD79609845451Ecba2ce",feedDecimals:8,feedAnswerAtGeneration:"5416490000",feedUpdatedAtGeneration:1783719808},{address:"0xc01aA1fECeC0605b13bc84874ff7256C0f5F562a",symbol:"SMCI",name:"Super Micro Computer \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xB90A19fF0Af67f7779afF50A882A9CfF42446400",symbol:"SNDK",name:"Sandisk Corporation \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xfb133Fa4B7b385802B693a293606682Df47109A3",feedDecimals:8,feedAnswerAtGeneration:"193162665000",feedUpdatedAtGeneration:1783727430},{address:"0x98E75885157C80992A8D41b696D8c9C6Fb30A926",symbol:"SOFI",name:"SoFi Technologies \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x75742c18BC1f1C5c5f448f4C9D9C6F66dafAAa38",symbol:"SOXX",name:"iShares Semiconductor ETF \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x4a0E65A3EcceC6dBe60AE065F2e7bb85Fae35eEa",symbol:"SPCX",name:"Space Exploration Technologies Corp. Class A Common Stock \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xB265810950ba6c5C0Ff821c9963014a56fD8Bffb",feedDecimals:8,feedAnswerAtGeneration:"14572500000",feedUpdatedAtGeneration:1783713430},{address:"0xAd622320e520de39e72d41EF07438C3Fd3354875",symbol:"SPMO",name:"Invesco S&P 500 Momentum ETF \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",symbol:"SPY",name:"SPDR S&P 500 ETF Trust \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x319724394D3A0e3669269846abE664Cd621f9f6A",feedDecimals:8,feedAnswerAtGeneration:"75361500000",feedUpdatedAtGeneration:1783700203},{address:"0x89776d4Cd68193597A2fC132cfaC1fDe36CCeA8a",symbol:"TSEM",name:"Tower Semiconductor \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x322F0929c4625eD5bAd873c95208D54E1c003b2d",symbol:"TSLA",name:"Tesla \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x4A1166a659A55625345e9515b32adECea5547C38",feedDecimals:8,feedAnswerAtGeneration:"40782500000",feedUpdatedAtGeneration:1783713215},{address:"0x58FfE4a942d3885bAa22D7520691F611EF09e7AA",symbol:"TSM",name:"Taiwan Semiconductor Manufacturing \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x874cF94aa8eC88Fd9560094dD065f2fB3E41Fc2F",feedDecimals:8,feedAnswerAtGeneration:"43437150000",feedUpdatedAtGeneration:1783713983},{address:"0x5e81213613b6B86EaB4c6c50d718d34359459786",symbol:"TTWO",name:"Take-Two Interactive Software \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x0E6e67Ba88e7b5d9B67636A215c76779B948dE79",symbol:"UMC",name:"United Microelectronics \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xf23250dac154D05Bb671CB0d0eBEf3c635c79CE2",symbol:"UPS",name:"UPS \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xd917B029C761D264c6A312BBbcDA868658eF86a6",symbol:"USAR",name:"USA Rare Earth \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0xA994d3684e8400A6c8078226925779FdeE682DD9",feedDecimals:8,feedAnswerAtGeneration:"1853505000",feedUpdatedAtGeneration:1783709442},{address:"0xa30FA36Db767ad9eD3f7a60fC79526fB4d56D344",symbol:"USO",name:"United States Oil Fund \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:"0x75a9c76Ef439e2C7c2E5a34Ab105EcFe3766431c",feedDecimals:8,feedAnswerAtGeneration:"10868500000",feedUpdatedAtGeneration:1783708312},{address:"0x82DA4646242e1D962e96e932269Dc644c94a9CaA",symbol:"WDAY",name:"Workday \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xc93a8c440CEa26D7445dF01729f193b27965099f",symbol:"WEEK",name:"Roundhill Weekly T-Bill ETF \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"2006182524271844660",feed:null,feedDecimals:null},{address:"0x15Cd20759CE7F3285c29A319dE2D1A2e098c6f43",symbol:"XLK",name:"State Street Technology Select Sector SPDR ETF \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xA8eB3BCcbf2017eE7CBfb652eB51CF2E1B153289",symbol:"XNDU",name:"Xanadu Quantum \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0xf9B46d3D1B22199D4D1025a9cEDB540A33F1a2d5",symbol:"XOM",name:"ExxonMobil Holdings Corporation \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x44c4F142009036cF477eD2d09932051843137CF1",symbol:"ZM",name:"Zoom \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null},{address:"0x7dc013eB55e436f30d7ED1AFE4E36d6e45e3c3f7",symbol:"ZS",name:"Zscaler \u2022 Robinhood Token",decimals:18,uiMultiplierAtGeneration:"1000000000000000000",feed:null,feedDecimals:null}]},xr=Vn,tc=new Map(xr.tokens.map(e=>[e.symbol.toUpperCase(),e])),oc=new Map(xr.tokens.map(e=>[e.address.toLowerCase(),e]));var hr=[{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"event",name:"Transfer",inputs:[{name:"from",type:"address",indexed:!0},{name:"to",type:"address",indexed:!0},{name:"value",type:"uint256",indexed:!1}]},{type:"event",name:"Approval",inputs:[{name:"owner",type:"address",indexed:!0},{name:"spender",type:"address",indexed:!0},{name:"value",type:"uint256",indexed:!1}]}],rc=[...hr,{type:"function",name:"uiMultiplier",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"newUIMultiplier",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"effectiveAt",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"balanceOfUI",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"totalSupplyUI",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"paused",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{type:"function",name:"tokenPaused",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{type:"function",name:"oraclePaused",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{type:"function",name:"terms",stateMutability:"pure",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"uid",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"nonces",stateMutability:"view",inputs:[{name:"owner",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"permit",stateMutability:"nonpayable",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"deadline",type:"uint256"},{name:"v",type:"uint8"},{name:"r",type:"bytes32"},{name:"s",type:"bytes32"}],outputs:[]}];var nc=[...hr,{type:"function",name:"deposit",stateMutability:"payable",inputs:[],outputs:[]},{type:"function",name:"withdraw",stateMutability:"nonpayable",inputs:[{name:"wad",type:"uint256"}],outputs:[]}];var ic=4320*60;var Ot={bondingCurveFactory:"0xEb3FeeD2716cF0eEAda05B22e67424794e1f5a80",reflectionFactory:"0x6Ce85c4b7cE12903E5867652C265bCcce57f935F",instantFactory:"0xD7601cEe401306fdea5833c6898181D9c770F800",robinLock:"0x5B41D59Fa0ce65750bc64e06D85bC999084493CD",legacyFactory:"0xAf9f3ce1d34909F59E88c23027f89d5807B0F915"};var ac=[Ot.bondingCurveFactory,Ot.reflectionFactory,Ot.instantFactory];var Wn={network:"mainnet",chainId:4663,rpcUrl:"https://rpc.mainnet.chain.robinhood.com",explorerUrl:"https://robinhoodchain.blockscout.com",usdg:{address:fr.usdg,symbol:"USDG",decimals:_t}},Xn={network:"testnet",chainId:46630,rpcUrl:"https://rpc.testnet.chain.robinhood.com",explorerUrl:"https://explorer.testnet.chain.robinhood.com",usdg:{address:lr.usdg,symbol:"USDG",decimals:_t}};function _(e="mainnet"){if(e!=="mainnet"&&e!=="testnet")throw new RangeError(`Unknown hood-pay network "${String(e)}" (use "mainnet" or "testnet")`);return e==="testnet"?Xn:Wn}function yr(e,t){return`${_(e).explorerUrl}/tx/${t}`}var uc=10n**BigInt(4);function br(e){return typeof e=="string"&&/^0x[0-9a-fA-F]{64}$/.test(e)}var Kn=280,Qn=/^(0|[1-9]\d{0,11})(\.\d{1,18})?$/;function ot(e){if(typeof e!="object"||e===null)throw new TypeError("payment request must be an object");let t=e;if(t.v!==1&&t.v!==void 0)throw new RangeError(`unsupported payment request version ${String(t.v)}`);let o=t.network??"mainnet";if(_(o),typeof t.payTo!="string"||!w(t.payTo,{strict:!0}))throw new TypeError("payTo must be a 0x-prefixed 20-byte address with a valid EIP-55 checksum");let r=xe(t.payTo);if(typeof t.amount!="string")throw new TypeError('amount must be a string (decimal or "dynamic")');let n=t.amount.trim();if(n!=="dynamic"&&!Qn.test(n))throw new RangeError(`amount "${n}" is not a plain decimal string (or "dynamic")`);let i;if(t.token!==void 0){let h=t.token;if(typeof h!="object"||h===null)throw new TypeError("token must be an object");if(typeof h.address!="string"||!w(h.address,{strict:!0}))throw new TypeError("token.address must be a 0x-prefixed 20-byte address with a valid EIP-55 checksum");if(typeof h.symbol!="string"||h.symbol.length===0||h.symbol.length>20)throw new TypeError("token.symbol must be a 1-20 character string");if(typeof h.decimals!="number"||!Number.isInteger(h.decimals)||h.decimals<0||h.decimals>36)throw new RangeError("token.decimals must be an integer in [0, 36]");i={address:xe(h.address),symbol:h.symbol,decimals:h.decimals}}let a=i?.decimals??_(o).usdg.decimals;if(n!=="dynamic"){if(te(n,a)<=0n)throw new RangeError("amount must be greater than zero");if((n.split(".")[1]??"").length>a)throw new RangeError(`amount "${n}" has more decimal places than the token's ${a}`)}let s;if(t.memo!==void 0){if(typeof t.memo!="string")throw new TypeError("memo must be a string");s=t.memo.slice(0,Kn)}let c,p;if(t.reference!==void 0){if(!br(t.reference))throw new TypeError("reference must be a 0x-prefixed 32-byte hex string");if(c=t.reference.toLowerCase(),typeof t.router!="string"||!w(t.router,{strict:!0}))throw new TypeError('router-mode requests (reference set) must carry a checksummed HoodPayRouter address in "router"');p=xe(t.router)}else if(t.router!==void 0)throw new TypeError('"router" is only valid together with "reference"');let y={v:1,network:o,payTo:r,amount:n};return i&&(y.token=i),s!==void 0&&(y.memo=s),c&&(y.reference=c),p&&(y.router=p),y}function jt(e){return e.token??_(e.network).usdg}function gr(e){if(e.amount==="dynamic")throw new RangeError("dynamic-amount requests have no fixed raw amount");return te(e.amount,jt(e).decimals)}function Yn(e){let t=new TextEncoder().encode(e),o="";for(let r of t)o+=String.fromCharCode(r);return btoa(o).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function Zn(e){let t=e.replaceAll("-","+").replaceAll("_","/"),o=atob(t),r=new Uint8Array(o.length);for(let n=0;n<o.length;n++)r[n]=o.charCodeAt(n);return new TextDecoder().decode(r)}function qt(e){let t=ot(e);return`1.${Yn(JSON.stringify(t))}`}function Er(e){let t=e.startsWith("#")?e.slice(1):e,o=t.indexOf(".");if(o===-1)throw new TypeError("malformed payment link (missing version prefix)");let r=t.slice(0,o);if(r!=="1")throw new RangeError(`unsupported payment link version "${r}"`);let n;try{n=JSON.parse(Zn(t.slice(o+1)))}catch{throw new TypeError("malformed payment link (payload is not base64url JSON)")}return ot(n)}function Ar(e,t="https://nirholas.github.io/hood-pay/pay.html"){return`${t}#${qt(e)}`}function nt(e){let t={formatters:void 0,fees:void 0,serializers:void 0,...e};function o(r){return n=>{let i=typeof n=="function"?n(r):n,a={...r,...i};return Object.assign(a,{extend:o(a)})}}return Object.assign(t,{extend:o(t)})}Ir();var we=nt({id:4663,name:"Robinhood Chain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.chain.robinhood.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://robinhoodchain.blockscout.com",apiUrl:"https://robinhoodchain.blockscout.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"}}});var Te=nt({id:46630,name:"Robinhood Chain Testnet",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.chain.robinhood.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.testnet.chain.robinhood.com",apiUrl:"https://explorer.testnet.chain.robinhood.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"}},testnet:!0});var H=class extends Error{constructor(t,o={}){super(t,o.cause===void 0?void 0:{cause:o.cause});ae(this,"code");this.name="HoodConnectError",this.code=o.code}};var Rr=class extends H{constructor(e){super("Wallet connection was rejected in the wallet.",{code:4001,cause:e}),this.name="ConnectionRejectedError"}},j=class extends H{constructor(t,o={}){super(t,o);ae(this,"rejectedByUser");this.name="ChainSwitchRejectedError",this.rejectedByUser=o.code===4001}},Kt=class extends H{constructor(t,o={}){super(t,o);ae(this,"rejectedByUser");this.name="ChainAddRejectedError",this.rejectedByUser=o.code===4001}};function M(e){if(typeof e!="object"||e===null)return;let t=e,o=t.data,r=o?.originalError?.code??o?.code;if(typeof r=="number"&&r!==-32603)return r;if(typeof t.code=="number"&&t.code!==-32603)return t.code;if(t.cause!==void 0&&t.cause!==e){let n=M(t.cause);if(n!==void 0)return n}return typeof t.code=="number"?t.code:void 0}function at(e){return M(e)===4001}function Fr(e){if(M(e)===4902)return!0;let o=e instanceof Error?e.message:String(e);return/unrecognized chain|4902|first add|wallet_addEthereumChain/i.test(o)}function re(e){return e instanceof Error&&e.message?e.message:String(e)}var ti=we.id,oi=Te.id;function Yt(e="mainnet"){return e==="testnet"?Te:we}function Mr(e){let t=e.blockExplorers?.default?.url,o={chainId:Ae(e.id),chainName:e.name,nativeCurrency:e.nativeCurrency,rpcUrls:e.rpcUrls.default.http};return t&&(o.blockExplorerUrls=[t]),o}async function Ur(e,t={}){let o=t.chain??Yt(t.network);try{await e.request({method:"wallet_addEthereumChain",params:[Mr(o)]})}catch(r){throw at(r)?new Kt(`Adding ${o.name} was rejected in the wallet.`,{code:4001,cause:r}):new Kt(`The wallet could not add ${o.name}: ${re(r)}`,{code:M(r),cause:r})}}async function it(e){let t=await e.request({method:"eth_chainId"});return Number.parseInt(t,16)}var Dr="eip6963:announceProvider",ri="eip6963:requestProvider",Qt="injected.window.ethereum",ni="data:image/svg+xml;base64,"+(typeof btoa=="function"?btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><rect width="24" height="24" rx="6" fill="#1f2328"/><path d="M6 9.5a2.5 2.5 0 0 1 2.5-2.5h7A2.5 2.5 0 0 1 18 9.5v5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 6 14.5v-5Z" stroke="#00c805" stroke-width="1.5"/><circle cx="14.5" cy="12" r="1.25" fill="#00c805"/></svg>'):"");function ii(){return typeof window>"u"?void 0:window}function Nr(){if(typeof window>"u")return;let e=window.ethereum;return e&&typeof e.request=="function"?e:void 0}function Pr(){let e=Nr();if(e)return{info:{uuid:Qt,name:"Injected wallet",icon:ni,rdns:Qt},provider:e}}function $r(e,t={}){let o=t.target??ii();if(!o)return()=>{};let r=new Map,n=i=>{let a=i.detail;!a?.info?.uuid||!a.provider||typeof a.provider.request!="function"||r.has(a.info.uuid)||(r.set(a.info.uuid,Object.freeze({info:{...a.info},provider:a.provider})),e([...r.values()]))};return o.addEventListener(Dr,n),o.dispatchEvent(new Event(ri)),()=>o.removeEventListener(Dr,n)}async function Zt(e={}){let t=e.timeoutMs??300,o=e.includeLegacyFallback??!0,r=[],n=$r(i=>{r=i},e);if(await new Promise(i=>setTimeout(i,t)),n(),r.length===0&&o){let i=Pr();if(i)return[i]}return r}async function ai(e){let t;try{t=await e.request({method:"eth_requestAccounts"})}catch(r){throw at(r)?new Rr(r):new H(`Wallet connection failed: ${re(r)}`,{code:M(r),cause:r})}let o=Array.isArray(t)?t[0]:void 0;if(!o)throw new H("The wallet returned no accounts.");return o}async function Br(e,t){try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:Ae(t.id)}]})}catch(o){throw at(o)?new j(`Switching to ${t.name} was rejected in the wallet.`,{code:4001,cause:o}):o}}async function Jt(e,t={}){let o=t.chain??Yt(t.network),r=t.onState??(()=>{});try{r({status:"connecting"});let n=await ai(e),i=await it(e);if(i!==o.id){r({status:"switching",chainId:o.id});try{await Br(e,o)}catch(s){if(s instanceof j)throw s;if(!Fr(s))throw new j(`The wallet could not switch to ${o.name}: ${re(s)}`,{code:M(s),cause:s});if(r({status:"adding",chainId:o.id}),await Ur(e,{chain:o}),i=await it(e),i!==o.id){r({status:"switching",chainId:o.id});try{await Br(e,o)}catch(c){throw c instanceof j?c:new j(`The wallet added ${o.name} but could not switch to it: ${re(c)}`,{code:M(c),cause:c})}}}if(i=await it(e),i!==o.id)throw new j(`The wallet reported success but is on chain ${i}, not ${o.id} (${o.name}).`)}let a={address:n,chainId:o.id};return r({status:"connected",...a}),a}catch(n){let i=n instanceof H?n:new H(re(n),{code:M(n),cause:n});throw r({status:"error",error:i}),i}}var q=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"owner",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"event",name:"Transfer",inputs:[{name:"from",type:"address",indexed:!0},{name:"to",type:"address",indexed:!0},{name:"value",type:"uint256",indexed:!1}]}],Lr=[{type:"function",name:"pay",stateMutability:"nonpayable",inputs:[{name:"token",type:"address"},{name:"payTo",type:"address"},{name:"amount",type:"uint256"},{name:"ref",type:"bytes32"}],outputs:[]},{type:"event",name:"PaymentReceived",inputs:[{name:"ref",type:"bytes32",indexed:!0},{name:"payer",type:"address",indexed:!0},{name:"payTo",type:"address",indexed:!0},{name:"token",type:"address",indexed:!1},{name:"amount",type:"uint256",indexed:!1}]}];function zr(e,t,o){return{to:e,data:z({abi:q,functionName:"transfer",args:[t,o]}),value:0n}}function Hr(e,t,o){return{to:e,data:z({abi:q,functionName:"approve",args:[t,o]}),value:0n}}function Gr(e,t,o,r,n){return{to:e,data:z({abi:Lr,functionName:"pay",args:[t,o,r,n]}),value:0n}}var si=`
.hoodpay{--hp-bg:#0b0e12;--hp-panel:#12161d;--hp-line:#232a35;--hp-text:#e8edf4;--hp-dim:#8b96a5;
--hp-accent:#00c805;--hp-accent2:#00e5a0;--hp-danger:#ff5c5c;--hp-warn:#ffb454;--hp-radius:14px;
font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
color:var(--hp-text);background:var(--hp-bg);border:1px solid var(--hp-line);border-radius:var(--hp-radius);
max-width:420px;width:100%;box-sizing:border-box;padding:20px;line-height:1.45;font-size:15px}
.hoodpay *{box-sizing:border-box;margin:0}
.hoodpay-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:14px}
.hoodpay-brand{font-weight:700;letter-spacing:-.02em;font-size:14px;color:var(--hp-dim)}
.hoodpay-brand b{background:linear-gradient(90deg,var(--hp-accent),var(--hp-accent2));
-webkit-background-clip:text;background-clip:text;color:transparent}
.hoodpay-net{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--hp-dim);
border:1px solid var(--hp-line);border-radius:999px;padding:3px 9px}
.hoodpay-net[data-net="testnet"]{color:var(--hp-warn);border-color:rgba(255,180,84,.4)}
.hoodpay-amount{font-size:34px;font-weight:700;letter-spacing:-.03em;margin:2px 0 4px}
.hoodpay-amount small{font-size:16px;font-weight:600;color:var(--hp-dim);margin-left:6px}
.hoodpay-memo{color:var(--hp-dim);font-size:14px;margin-bottom:14px;overflow-wrap:anywhere}
.hoodpay-row{display:flex;justify-content:space-between;gap:12px;padding:9px 0;
border-top:1px solid var(--hp-line);font-size:13px}
.hoodpay-row dt{color:var(--hp-dim)}.hoodpay-row dd{font-variant-numeric:tabular-nums;text-align:right;overflow-wrap:anywhere}
.hoodpay-btn{appearance:none;width:100%;border:0;border-radius:10px;padding:13px 16px;margin-top:14px;
font:inherit;font-weight:600;cursor:pointer;color:#04110a;
background:linear-gradient(90deg,var(--hp-accent),var(--hp-accent2));
transition:transform .12s ease,filter .12s ease,opacity .12s ease}
.hoodpay-btn:hover{filter:brightness(1.08)}
.hoodpay-btn:active{transform:translateY(1px) scale(.995)}
.hoodpay-btn:focus-visible,.hoodpay a:focus-visible,.hoodpay-wallet:focus-visible,.hoodpay-input:focus-visible{
outline:2px solid var(--hp-accent2);outline-offset:2px}
.hoodpay-btn[disabled]{opacity:.55;cursor:not-allowed}
.hoodpay-btn.secondary{background:transparent;color:var(--hp-text);border:1px solid var(--hp-line)}
.hoodpay-btn.secondary:hover{border-color:var(--hp-dim)}
.hoodpay-input{width:100%;padding:12px 14px;border-radius:10px;border:1px solid var(--hp-line);
background:var(--hp-panel);color:var(--hp-text);font:inherit;font-size:22px;font-weight:600;margin:6px 0 2px}
.hoodpay-input:hover{border-color:var(--hp-dim)}
.hoodpay-label{font-size:12px;color:var(--hp-dim);text-transform:uppercase;letter-spacing:.07em}
.hoodpay-wallets{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.hoodpay-wallet{display:flex;align-items:center;gap:12px;width:100%;padding:11px 13px;border-radius:10px;
border:1px solid var(--hp-line);background:var(--hp-panel);color:var(--hp-text);font:inherit;font-weight:600;
cursor:pointer;transition:border-color .12s ease,background .12s ease}
.hoodpay-wallet:hover{border-color:var(--hp-accent2)}
.hoodpay-wallet:active{background:#161c25}
.hoodpay-wallet img{width:26px;height:26px;border-radius:6px}
.hoodpay-status{display:flex;align-items:center;gap:12px;padding:14px;border-radius:10px;
background:var(--hp-panel);border:1px solid var(--hp-line);margin-top:14px;font-size:14px}
.hoodpay-spin{width:18px;height:18px;flex:none;border-radius:50%;border:2px solid var(--hp-line);
border-top-color:var(--hp-accent2);animation:hoodpay-spin .8s linear infinite}
@keyframes hoodpay-spin{to{transform:rotate(360deg)}}
.hoodpay-ok{color:var(--hp-accent2)}.hoodpay-err{color:var(--hp-danger)}.hoodpay-warnc{color:var(--hp-warn)}
.hoodpay-check{width:44px;height:44px;border-radius:50%;flex:none;display:grid;place-items:center;
background:rgba(0,229,160,.12);color:var(--hp-accent2);font-size:22px;animation:hoodpay-pop .25s ease}
@keyframes hoodpay-pop{from{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}
.hoodpay a{color:var(--hp-accent2);text-decoration:none;border-bottom:1px solid rgba(0,229,160,.35)}
.hoodpay a:hover{border-bottom-color:var(--hp-accent2)}
.hoodpay-fine{font-size:12px;color:var(--hp-dim);margin-top:12px;text-align:center}
.hoodpay-err-box{border-color:rgba(255,92,92,.45)}
@media (max-width:360px){.hoodpay{padding:14px}.hoodpay-amount{font-size:28px}}
@media (prefers-reduced-motion:reduce){.hoodpay-spin,.hoodpay-check{animation:none}}
`,Or=!1;function _r(e=document){if(Or&&e.querySelector("style[data-hood-pay]"))return;let t=e.createElement("style");t.setAttribute("data-hood-pay",""),t.textContent=si,e.head.appendChild(t),Or=!0}function eo(e){if(typeof e!="object"||e===null)throw new TypeError("checkout config must be an object");let t=e;for(let n of["onSuccess","onError","onStateChange"])if(t[n]!==void 0&&typeof t[n]!="function")throw new TypeError(`${n} must be a function`);let r={request:ot({v:1,network:t.network??"mainnet",payTo:t.payTo,amount:t.amount,token:t.token,memo:t.memo,reference:t.reference,router:t.router})};return t.onSuccess&&(r.onSuccess=t.onSuccess),t.onError&&(r.onError=t.onError),t.onStateChange&&(r.onStateChange=t.onStateChange),r}function jr(e){return`${e.slice(0,6)}\u2026${e.slice(-4)}`}async function qr(e,t,o,r){let n=await e.request({method:"eth_call",params:[{to:t,data:o},"latest"]});return Gt({abi:q,functionName:r,data:n})}async function Vr(e,t,o){return await e.request({method:"eth_sendTransaction",params:[{from:t,to:o.to,data:o.data,value:"0x0"}]})}async function Wr(e,t,o=12e4){let r=Date.now();for(;;){let n=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(n?.blockNumber)return n;if(Date.now()-r>o)throw new Error("timed out waiting for the transaction to mine");await new Promise(i=>setTimeout(i,700))}}function Xr(e){if(typeof e=="object"&&e!==null){if(e.code===4001)return"You rejected the request in your wallet.";let o=e.message;if(typeof o=="string"&&o.length>0)return o.split(`
`)[0].slice(0,200)}return String(e)}function to(e,t){let o=typeof e=="string"?document.querySelector(e):e;if(!o)throw new TypeError(`mountCheckout: no element matches ${String(e)}`);let{request:r,onSuccess:n,onError:i,onStateChange:a}=eo(t),s=_(r.network),c=jt(r);_r(o.ownerDocument);let p=o.ownerDocument.createElement("div");p.className="hoodpay",o.replaceChildren(p);let y=!1,h="",T=m=>{y||a?.(m)},u=(m,f,l)=>{let b=o.ownerDocument.createElement(m);return f&&(b.className=f),l!==void 0&&(b.textContent=l),b},U=()=>{let m=u("div","hoodpay-head"),f=u("span","hoodpay-brand");f.append("hood",Object.assign(u("b"),{textContent:"pay"}));let l=u("span","hoodpay-net",r.network==="testnet"?"testnet 46630":"chain 4663");return l.dataset.net=r.network,m.append(f,l),m},ne=()=>{let m=u("dl"),f=(l,b)=>{let E=u("div","hoodpay-row");return E.append(u("dt",void 0,l),u("dd",void 0,b)),E};return m.append(f("To",jr(r.payTo)),f("Token",`${c.symbol} (${c.decimals} decimals)`)),r.reference&&m.append(f("Reference",jr(r.reference))),m},Qr=(m,f)=>{let l=u("div","hoodpay-status");return f&&l.append(u("span","hoodpay-spin")),l.append(u("span",void 0,m)),l};function ve(){if(p.replaceChildren(U()),r.amount==="dynamic"){p.append(u("span","hoodpay-label",`Amount (${c.symbol})`));let f=u("input","hoodpay-input");f.type="text",f.inputMode="decimal",f.placeholder="10.00",f.value=h,f.setAttribute("aria-label",`Amount in ${c.symbol}`),f.addEventListener("input",()=>{h=f.value.trim()}),p.append(f)}else{let f=u("div","hoodpay-amount",r.amount);f.append(Object.assign(u("small"),{textContent:c.symbol})),p.append(f)}r.memo&&p.append(u("p","hoodpay-memo",r.memo)),p.append(ne());let m=u("button","hoodpay-btn",r.amount==="dynamic"?"Pay":`Pay ${r.amount} ${c.symbol}`);m.type="button",m.addEventListener("click",()=>void en()),p.append(m),p.append(u("p","hoodpay-fine","Non-custodial. Your wallet signs; funds go straight to the merchant.")),T({step:"review"})}function Yr(m){p.replaceChildren(U(),u("p","hoodpay-memo","Choose a wallet to pay with"));let f=u("div","hoodpay-wallets");f.setAttribute("role","list");for(let b of m){let E=u("button","hoodpay-wallet");E.type="button";let v=u("img");v.src=b.info.icon,v.alt="",E.append(v,u("span",void 0,b.info.name)),E.addEventListener("click",()=>void ro(b)),f.append(E)}p.append(f);let l=u("button","hoodpay-btn secondary","Back");l.type="button",l.addEventListener("click",ve),p.append(l),T({step:"choose-wallet",wallets:m.length})}function G(m,f){p.replaceChildren(U()),r.memo&&p.append(u("p","hoodpay-memo",r.memo)),p.append(Qr(m,!0)),T(f)}function Zr(m,f){let l=ee(m,c.decimals),b=ee(f,c.decimals);p.replaceChildren(U());let E=u("div","hoodpay-status hoodpay-err-box");E.append(u("span","hoodpay-warnc","!"),u("span",void 0,`Not enough ${c.symbol}: you hold ${l}, this payment needs ${b}.`)),p.append(E);let v=u("p","hoodpay-fine");if(r.network==="testnet"){let ie=u("a",void 0,"Get testnet funds from the faucet");ie.setAttribute("href","https://faucet.testnet.chain.robinhood.com/"),ie.setAttribute("target","_blank"),ie.setAttribute("rel","noopener noreferrer"),v.append(ie)}else v.textContent="Fund your wallet with USDG on Robinhood Chain, then try again.";p.append(v);let N=u("button","hoodpay-btn secondary","Try again");N.type="button",N.addEventListener("click",ve),p.append(N),T({step:"insufficient",balance:l,needed:b})}function st(m,f=!0){p.replaceChildren(U());let l=u("div","hoodpay-status hoodpay-err-box");if(l.append(u("span","hoodpay-err","\xD7"),u("span",void 0,m)),p.append(l),f){let b=u("button","hoodpay-btn secondary","Try again");b.type="button",b.addEventListener("click",ve),p.append(b)}T({step:"error",message:m,recoverable:f}),i?.(new Error(m))}function Jr(m){p.replaceChildren(U());let f=u("div","hoodpay-status");f.append(u("span","hoodpay-check","\u2713"));let l=u("div");l.append(u("div","hoodpay-ok",`Paid ${m.amount} ${m.tokenSymbol}`));let b=u("a",void 0,"View receipt on Blockscout");b.setAttribute("href",m.explorerUrl),b.setAttribute("target","_blank"),b.setAttribute("rel","noopener noreferrer"),l.append(b),f.append(l),p.append(f,ne()),T({step:"success",receipt:m}),n?.(m)}function oo(){if(r.amount!=="dynamic")return gr(r);if(!/^(0|[1-9]\d{0,11})(\.\d{1,18})?$/.test(h))throw new RangeError("Enter the amount as a plain decimal, e.g. 10.00");let m=te(h,c.decimals);if(m<=0n)throw new RangeError("Amount must be greater than zero");return m}async function en(){let m;try{m=oo()}catch(l){st(Xr(l));return}G("Looking for wallets\u2026",{step:"discovering"});let f=await Zt();if(!y){if(f.length===0){st("No wallet found. Install an EIP-6963 wallet (MetaMask, Rabby, \u2026) and reload.",!0);return}f.length===1?ro(f[0],m):Yr(f)}}async function ro(m,f){try{let l=f??oo();G(`Connecting ${m.info.name}\u2026`,{step:"connecting",wallet:m.info.name});let{address:b}=await Jt(m.provider,{network:r.network});if(y)return;let E=await qr(m.provider,c.address,z({abi:q,functionName:"balanceOf",args:[b]}),"balanceOf");if(E<l){Zr(E,l);return}let v;if(r.reference&&r.router){if(await qr(m.provider,c.address,z({abi:q,functionName:"allowance",args:[b,r.router]}),"allowance")<l){G(`Approve ${c.symbol} in your wallet (1 of 2)\u2026`,{step:"approving"});let tn=await Vr(m.provider,b,Hr(c.address,r.router,l));if(G("Waiting for the approval to mine\u2026",{step:"approving"}),(await Wr(m.provider,tn)).status!=="0x1")throw new Error("The approval transaction reverted.")}v=Gr(r.router,c.address,r.payTo,l,r.reference),G("Confirm the payment in your wallet (2 of 2)\u2026",{step:"paying"})}else v=zr(c.address,r.payTo,l),G("Confirm the payment in your wallet\u2026",{step:"paying"});let N=await Vr(m.provider,b,v);if(G("Payment sent - waiting for confirmation\u2026",{step:"confirming",txHash:N}),(await Wr(m.provider,N)).status!=="0x1")throw new Error("The payment transaction reverted.");let no={txHash:N,payer:b,amountRaw:l.toString(),amount:ee(l,c.decimals),tokenSymbol:c.symbol,network:r.network,explorerUrl:yr(r.network,N)};r.reference&&(no.reference=r.reference),Jr(no)}catch(l){y||st(Xr(l))}}return ve(),{request:r,destroy(){y=!0,p.remove()}}}function ci(e){let t=e.dataset,o={payTo:t.payTo??"",amount:t.amount??""};return(t.network==="mainnet"||t.network==="testnet")&&(o.network=t.network),t.memo&&(o.memo=t.memo),t.reference&&(o.reference=t.reference),t.router&&(o.router=t.router),t.tokenAddress&&t.tokenSymbol&&t.tokenDecimals&&(o.token={address:t.tokenAddress,symbol:t.tokenSymbol,decimals:Number(t.tokenDecimals)}),o}function Kr(){for(let e of Array.from(document.querySelectorAll("[data-hoodpay]")))if(e.dataset.hoodpayMounted!=="true"){e.dataset.hoodpayMounted="true";try{to(e,ci(e))}catch(t){e.textContent=`hood-pay: ${t instanceof Error?t.message:String(t)}`}}}var pi={version:"0.1.0",mount:to,validateConfig:eo,decodePaymentRequest:Er,encodePaymentRequest:qt,paymentLinkUrl:Ar};window.HoodPay=pi;document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Kr,{once:!0}):Kr();})();