0xtrails 0.17.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -109,7 +109,7 @@ function Qne(e){let t=Wp,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=Big
109
109
  `}));function Fle(e){let t=typeof e==`string`?Dc(e):typeof e.raw==`string`?e.raw:Tc(e.raw);return Su([Dc(`${Nle}${ks(t)}`),t])}var Ile=o((()=>{Ple(),wu(),As(),Ac()}));function Lle(e,t){return tu(Fle(e),t)}var Dg=o((()=>{nu(),Ile()})),Rle,zle,Ble,Vle=o((()=>{Od(),Fs(),Rle=class extends Ps{constructor({domain:e}){super(`Invalid domain "${Dd(e)}".`,{metaMessages:[`Must be a valid EIP-712 domain.`]})}},zle=class extends Ps{constructor({primaryType:e,types:t}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(t))}\`.`,{docsPath:`/api/glossary/Errors#typeddatainvalidprimarytypeerror`,metaMessages:["Check that the primary type is a key in `types`."]})}},Ble=class extends Ps{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:[`Struct type must not be a Solidity type.`],name:`InvalidStructTypeError`})}}}));function Hle(e){let{domain:t,message:n,primaryType:r,types:i}=e,a=(e,t)=>{let n={...t};for(let t of e){let{name:e,type:r}=t;r===`address`&&(n[e]=n[e].toLowerCase())}return n};return Dd({domain:!i.EIP712Domain||!t?{}:a(i.EIP712Domain,t),message:(()=>{if(r!==`EIP712Domain`)return a(i[r],n)})(),primaryType:r,types:i})}function Ule(e){let{domain:t,message:n,primaryType:r,types:i}=e,a=(e,t)=>{for(let n of e){let{name:e,type:r}=n,o=t[e],s=r.match(Mu);if(s&&(typeof o==`number`||typeof o==`bigint`)){let[e,t,n]=s;Ec(o,{signed:t===`int`,size:Number.parseInt(n,10)/8})}if(r===`address`&&typeof o==`string`&&!yu(o))throw new du({address:o});let c=r.match(ju);if(c){let[e,t]=c;if(t&&ks(o)!==Number.parseInt(t,10))throw new Bee({expectedSize:Number.parseInt(t,10),givenSize:ks(o)})}let l=i[r];l&&(Kle(r),a(l,o))}};if(i.EIP712Domain&&t){if(typeof t!=`object`)throw new Rle({domain:t});a(i.EIP712Domain,t)}if(r!==`EIP712Domain`)if(i[r])a(i[r],n);else throw new zle({primaryType:r,types:i})}function Wle({domain:e}){return[typeof e?.name==`string`&&{name:`name`,type:`string`},e?.version&&{name:`version`,type:`string`},(typeof e?.chainId==`number`||typeof e?.chainId==`bigint`)&&{name:`chainId`,type:`uint256`},e?.verifyingContract&&{name:`verifyingContract`,type:`address`},e?.salt&&{name:`salt`,type:`bytes32`}].filter(Boolean)}function Gle({domain:e}){return Jle({domain:e,types:{EIP712Domain:Wle({domain:e})}})}function Kle(e){if(e===`address`||e===`bool`||e===`string`||e.startsWith(`bytes`)||e.startsWith(`uint`)||e.startsWith(`int`))throw new Ble({type:e})}var Og=o((()=>{rc(),fu(),Vle(),xu(),As(),Ac(),Nu(),kg(),Od()}));function qle(e){let{domain:t={},message:n,primaryType:r}=e,i={EIP712Domain:Wle({domain:t}),...e.types};Ule({domain:t,message:n,primaryType:r,types:i});let a=[`0x1901`];return t&&a.push(Jle({domain:t,types:i})),r!==`EIP712Domain`&&a.push(Yle({data:n,primaryType:r,types:i})),tu(Su(a))}function Jle({domain:e,types:t}){return Yle({data:e,primaryType:`EIP712Domain`,types:t})}function Yle({data:e,primaryType:t,types:n}){return tu(Xle({data:e,primaryType:t,types:n}))}function Xle({data:e,primaryType:t,types:n}){let r=[{type:`bytes32`}],i=[Zle({primaryType:t,types:n})];for(let a of n[t]){let[t,o]=eue({types:n,name:a.name,type:a.type,value:e[a.name]});r.push(t),i.push(o)}return Pu(r,i)}function Zle({primaryType:e,types:t}){return tu(Cc(Qle({primaryType:e,types:t})))}function Qle({primaryType:e,types:t}){let n=``,r=$le({primaryType:e,types:t});r.delete(e);let i=[e,...Array.from(r).sort()];for(let e of i)n+=`${e}(${t[e].map(({name:e,type:t})=>`${t} ${e}`).join(`,`)})`;return n}function $le({primaryType:e,types:t},n=new Set){let r=e.match(/^\w*/u)?.[0];if(n.has(r)||t[r]===void 0)return n;n.add(r);for(let e of t[r])$le({primaryType:e.type,types:t},n);return n}function eue({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:`bytes32`},tu(Xle({data:r,primaryType:n,types:e}))];if(n===`bytes`)return[{type:`bytes32`},tu(r)];if(n===`string`)return[{type:`bytes32`},tu(Cc(r))];if(n.lastIndexOf(`]`)===n.length-1){let i=n.slice(0,n.lastIndexOf(`[`)),a=r.map(n=>eue({name:t,type:i,types:e,value:n}));return[{type:`bytes32`},tu(Pu(a.map(([e])=>e),a.map(([,e])=>e)))]}return[{type:n},r]}var kg=o((()=>{Hu(),wu(),Ac(),nu(),Og()})),tue,nue=o((()=>{tue=`1.2.4`})),Ag,jg=o((()=>{nue(),Ag=class e extends Error{constructor(t,n={}){let r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,i=n.cause instanceof e&&n.cause.docsPath||n.docsPath,a=[t||`An error occurred.`,``,...n.metaMessages?[...n.metaMessages,``]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${tue}`].join(`
110
110
  `);super(a),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,"name",{enumerable:!0,configurable:!0,writable:!0,value:`AbiTypeError`}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=t}}}));function Mg(e,t){return e.exec(t)?.groups}var rue,iue,aue,Ng=o((()=>{rue=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,iue=/^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)?$/,aue=/^\(.+?\).*?$/}));function oue(e){let t=e.type;if(sue.test(e.type)&&`components`in e){t=`(`;let n=e.components.length;for(let r=0;r<n;r++){let i=e.components[r];t+=oue(i),r<n-1&&(t+=`, `)}let r=Mg(sue,e.type);return t+=`)${r?.array||``}`,oue({...e,type:t})}return`indexed`in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}var sue,cue=o((()=>{Ng(),sue=/^tuple(?<array>(\[(\d*)\])*)$/}));function Pg(e){let t=``,n=e.length;for(let r=0;r<n;r++){let i=e[r];t+=oue(i),r!==n-1&&(t+=`, `)}return t}var lue=o((()=>{cue()}));function Fg(e){return e.type===`function`?`function ${e.name}(${Pg(e.inputs)})${e.stateMutability&&e.stateMutability!==`nonpayable`?` ${e.stateMutability}`:``}${e.outputs?.length?` returns (${Pg(e.outputs)})`:``}`:e.type===`event`?`event ${e.name}(${Pg(e.inputs)})`:e.type===`error`?`error ${e.name}(${Pg(e.inputs)})`:e.type===`constructor`?`constructor(${Pg(e.inputs)})${e.stateMutability===`payable`?` payable`:``}`:e.type===`fallback`?`fallback() external${e.stateMutability===`payable`?` payable`:``}`:`receive() external payable`}var uue=o((()=>{lue()}));function due(e){return Cue.test(e)}function fue(e){return Mg(Cue,e)}function pue(e){return wue.test(e)}function mue(e){return Mg(wue,e)}function hue(e){return Tue.test(e)}function gue(e){return Mg(Tue,e)}function Ig(e){return Eue.test(e)}function _ue(e){return Mg(Eue,e)}function vue(e){return Due.test(e)}function yue(e){return Mg(Due,e)}function bue(e){return Oue.test(e)}function xue(e){return Mg(Oue,e)}function Sue(e){return kue.test(e)}var Cue,wue,Tue,Eue,Due,Oue,kue,Aue,jue,Lg,Rg=o((()=>{Ng(),Cue=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/,wue=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/,Tue=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/,Eue=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/,Due=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/,Oue=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/,kue=/^receive\(\) external payable$/,Aue=new Set([`memory`,`indexed`,`storage`,`calldata`]),jue=new Set([`indexed`]),Lg=new Set([`calldata`,`memory`,`storage`])})),Mue,Nue,Pue,zg=o((()=>{jg(),Mue=class extends Ag{constructor({signature:e}){super(`Failed to parse ABI item.`,{details:`parseAbiItem(${JSON.stringify(e,null,2)})`,docsPath:`/api/human#parseabiitem-1`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`InvalidAbiItemError`})}},Nue=class extends Ag{constructor({type:e}){super(`Unknown type.`,{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`UnknownTypeError`})}},Pue=class extends Ag{constructor({type:e}){super(`Unknown type.`,{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`UnknownSolidityTypeError`})}}})),Fue,Iue,Lue,Rue,zue,Bue,Bg=o((()=>{jg(),Fue=class extends Ag{constructor({params:e}){super(`Failed to parse ABI parameters.`,{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:`/api/human#parseabiparameters-1`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`InvalidAbiParametersError`})}},Iue=class extends Ag{constructor({param:e}){super(`Invalid ABI parameter.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`InvalidParameterError`})}},Lue=class extends Ag{constructor({param:e,name:t}){super(`Invalid ABI parameter.`,{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`SolidityProtectedKeywordError`})}},Rue=class extends Ag{constructor({param:e,type:t,modifier:n}){super(`Invalid ABI parameter.`,{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:``}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`InvalidModifierError`})}},zue=class extends Ag{constructor({param:e,type:t,modifier:n}){super(`Invalid ABI parameter.`,{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:``}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`InvalidFunctionModifierError`})}},Bue=class extends Ag{constructor({abiParameter:e}){super(`Invalid ABI parameter.`,{details:JSON.stringify(e,null,2),metaMessages:[`ABI parameter type is invalid.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`InvalidAbiTypeParameterError`})}}})),Vg,Vue,Hue,Uue=o((()=>{jg(),Vg=class extends Ag{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`InvalidSignatureError`})}},Vue=class extends Ag{constructor({signature:e}){super(`Unknown signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`UnknownSignatureError`})}},Hue=class extends Ag{constructor({signature:e}){super(`Invalid struct signature.`,{details:e,metaMessages:[`No properties exist.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`InvalidStructSignatureError`})}}})),Wue,Gue=o((()=>{jg(),Wue=class extends Ag{constructor({type:e}){super(`Circular reference detected.`,{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`CircularReferenceError`})}}})),Kue,que=o((()=>{jg(),Kue=class extends Ag{constructor({current:e,depth:t}){super(`Unbalanced parentheses.`,{metaMessages:[`"${e.trim()}" has too many ${t>0?`opening`:`closing`} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`InvalidParenthesisError`})}}}));function Jue(e,t,n){let r=``;if(n)for(let e of Object.entries(n)){if(!e)continue;let t=``;for(let n of e[1])t+=`[${n.type}${n.name?`:${n.name}`:``}]`;r+=`(${e[0]}{${t}})`}return t?`${t}:${e}${r}`:`${e}${r}`}var Hg,Yue=o((()=>{Hg=new Map([[`address`,{type:`address`}],[`bool`,{type:`bool`}],[`bytes`,{type:`bytes`}],[`bytes32`,{type:`bytes32`}],[`int`,{type:`int256`}],[`int256`,{type:`int256`}],[`string`,{type:`string`}],[`uint`,{type:`uint256`}],[`uint8`,{type:`uint8`}],[`uint16`,{type:`uint16`}],[`uint24`,{type:`uint24`}],[`uint32`,{type:`uint32`}],[`uint64`,{type:`uint64`}],[`uint96`,{type:`uint96`}],[`uint112`,{type:`uint112`}],[`uint160`,{type:`uint160`}],[`uint192`,{type:`uint192`}],[`uint256`,{type:`uint256`}],[`address owner`,{type:`address`,name:`owner`}],[`address to`,{type:`address`,name:`to`}],[`bool approved`,{type:`bool`,name:`approved`}],[`bytes _data`,{type:`bytes`,name:`_data`}],[`bytes data`,{type:`bytes`,name:`data`}],[`bytes signature`,{type:`bytes`,name:`signature`}],[`bytes32 hash`,{type:`bytes32`,name:`hash`}],[`bytes32 r`,{type:`bytes32`,name:`r`}],[`bytes32 root`,{type:`bytes32`,name:`root`}],[`bytes32 s`,{type:`bytes32`,name:`s`}],[`string name`,{type:`string`,name:`name`}],[`string symbol`,{type:`string`,name:`symbol`}],[`string tokenURI`,{type:`string`,name:`tokenURI`}],[`uint tokenId`,{type:`uint256`,name:`tokenId`}],[`uint8 v`,{type:`uint8`,name:`v`}],[`uint256 balance`,{type:`uint256`,name:`balance`}],[`uint256 tokenId`,{type:`uint256`,name:`tokenId`}],[`uint256 value`,{type:`uint256`,name:`value`}],[`event:address indexed from`,{type:`address`,name:`from`,indexed:!0}],[`event:address indexed to`,{type:`address`,name:`to`,indexed:!0}],[`event:uint indexed tokenId`,{type:`uint256`,name:`tokenId`,indexed:!0}],[`event:uint256 indexed tokenId`,{type:`uint256`,name:`tokenId`,indexed:!0}]])}));function Xue(e,t={}){if(hue(e))return Zue(e,t);if(pue(e))return Que(e,t);if(due(e))return $ue(e,t);if(vue(e))return ede(e,t);if(bue(e))return tde(e);if(Sue(e))return{type:`receive`,stateMutability:`payable`};throw new Vue({signature:e})}function Zue(e,t={}){let n=gue(e);if(!n)throw new Vg({signature:e,type:`function`});let r=Wg(n.parameters),i=[],a=r.length;for(let e=0;e<a;e++)i.push(Ug(r[e],{modifiers:Lg,structs:t,type:`function`}));let o=[];if(n.returns){let e=Wg(n.returns),r=e.length;for(let n=0;n<r;n++)o.push(Ug(e[n],{modifiers:Lg,structs:t,type:`function`}))}return{name:n.name,type:`function`,stateMutability:n.stateMutability??`nonpayable`,inputs:i,outputs:o}}function Que(e,t={}){let n=mue(e);if(!n)throw new Vg({signature:e,type:`event`});let r=Wg(n.parameters),i=[],a=r.length;for(let e=0;e<a;e++)i.push(Ug(r[e],{modifiers:jue,structs:t,type:`event`}));return{name:n.name,type:`event`,inputs:i}}function $ue(e,t={}){let n=fue(e);if(!n)throw new Vg({signature:e,type:`error`});let r=Wg(n.parameters),i=[],a=r.length;for(let e=0;e<a;e++)i.push(Ug(r[e],{structs:t,type:`error`}));return{name:n.name,type:`error`,inputs:i}}function ede(e,t={}){let n=yue(e);if(!n)throw new Vg({signature:e,type:`constructor`});let r=Wg(n.parameters),i=[],a=r.length;for(let e=0;e<a;e++)i.push(Ug(r[e],{structs:t,type:`constructor`}));return{type:`constructor`,stateMutability:n.stateMutability??`nonpayable`,inputs:i}}function tde(e){let t=xue(e);if(!t)throw new Vg({signature:e,type:`fallback`});return{type:`fallback`,stateMutability:t.stateMutability??`nonpayable`}}function Ug(e,t){let n=Jue(e,t?.type,t?.structs);if(Hg.has(n))return Hg.get(n);let r=aue.test(e),i=Mg(r?ode:ade,e);if(!i)throw new Iue({param:e});if(i.name&&rde(i.name))throw new Lue({param:e,name:i.name});let a=i.name?{name:i.name}:{},o=i.modifier===`indexed`?{indexed:!0}:{},s=t?.structs??{},c,l={};if(r){c=`tuple`;let e=Wg(i.type),t=[],n=e.length;for(let r=0;r<n;r++)t.push(Ug(e[r],{structs:s}));l={components:t}}else if(i.type in s)c=`tuple`,l={components:s[i.type]};else if(sde.test(i.type))c=`${i.type}256`;else if(i.type===`address payable`)c=`address`;else if(c=i.type,t?.type!==`struct`&&!nde(c))throw new Pue({type:c});if(i.modifier){if(!t?.modifiers?.has?.(i.modifier))throw new Rue({param:e,type:t?.type,modifier:i.modifier});if(Lg.has(i.modifier)&&!ide(c,!!i.array))throw new zue({param:e,type:t?.type,modifier:i.modifier})}let u={type:`${c}${i.array??``}`,...a,...o,...l};return Hg.set(n,u),u}function Wg(e,t=[],n=``,r=0){let i=e.trim().length;for(let a=0;a<i;a++){let i=e[a],o=e.slice(a+1);switch(i){case`,`:return r===0?Wg(o,[...t,n.trim()]):Wg(o,t,`${n}${i}`,r);case`(`:return Wg(o,t,`${n}${i}`,r+1);case`)`:return Wg(o,t,`${n}${i}`,r-1);default:return Wg(o,t,`${n}${i}`,r)}}if(n===``)return t;if(r!==0)throw new Kue({current:n,depth:r});return t.push(n.trim()),t}function nde(e){return e===`address`||e===`bool`||e===`function`||e===`string`||rue.test(e)||iue.test(e)}function rde(e){return e===`address`||e===`bool`||e===`function`||e===`string`||e===`tuple`||rue.test(e)||iue.test(e)||cde.test(e)}function ide(e,t){return t||e===`bytes`||e===`string`||e===`tuple`}var ade,ode,sde,cde,Gg=o((()=>{Ng(),zg(),Bg(),Uue(),que(),Yue(),Rg(),ade=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,ode=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,sde=/^u?int$/,cde=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/}));function lde(e){let t={},n=e.length;for(let r=0;r<n;r++){let n=e[r];if(!Ig(n))continue;let i=_ue(n);if(!i)throw new Vg({signature:n,type:`struct`});let a=i.properties.split(`;`),o=[],s=a.length;for(let e=0;e<s;e++){let t=a[e].trim();if(!t)continue;let n=Ug(t,{type:`struct`});o.push(n)}if(!o.length)throw new Hue({signature:n});t[i.name]=o}let r={},i=Object.entries(t),a=i.length;for(let e=0;e<a;e++){let[n,a]=i[e];r[n]=ude(a,t)}return r}function ude(e=[],t={},n=new Set){let r=[],i=e.length;for(let a=0;a<i;a++){let i=e[a];if(aue.test(i.type))r.push(i);else{let e=Mg(dde,i.type);if(!e?.type)throw new Bue({abiParameter:i});let{array:a,type:o}=e;if(o in t){if(n.has(o))throw new Wue({type:o});r.push({...i,type:`tuple${a??``}`,components:ude(t[o],t,new Set([...n,o]))})}else if(nde(o))r.push(i);else throw new Nue({type:o})}}return r}var dde,Kg=o((()=>{Ng(),zg(),Bg(),Uue(),Gue(),Rg(),Gg(),dde=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/}));function fde(e){let t=lde(e),n=[],r=e.length;for(let i=0;i<r;i++){let r=e[i];Ig(r)||n.push(Xue(r,t))}return n}var pde=o((()=>{Rg(),Kg(),Gg()}));function mde(e){let t;if(typeof e==`string`)t=Xue(e);else{let n=lde(e),r=e.length;for(let i=0;i<r;i++){let r=e[i];if(!Ig(r)){t=Xue(r,n);break}}}if(!t)throw new Mue({signature:e});return t}var hde=o((()=>{zg(),Rg(),Kg(),Gg()}));function gde(e){let t=[];if(typeof e==`string`){let n=Wg(e),r=n.length;for(let e=0;e<r;e++)t.push(Ug(n[e],{modifiers:Aue}))}else{let n=lde(e),r=e.length;for(let i=0;i<r;i++){let r=e[i];if(Ig(r))continue;let a=Wg(r),o=a.length;for(let e=0;e<o;e++)t.push(Ug(a[e],{modifiers:Aue,structs:n}))}}if(t.length===0)throw new Fue({params:e});return t}var _de=o((()=>{Bg(),Rg(),Kg(),Gg()})),qg=o((()=>{jg(),uue(),cue(),lue(),pde(),hde(),Bg(),Rg(),Kg(),Gg(),_de(),zg(),Uue(),que(),Gue()})),vde,yde=o((()=>{vde=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&t!==void 0&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}})),bde,Jg,xde=o((()=>{yde(),bde={checksum:new vde(8192)},Jg=bde.checksum}));function Sde(e,t={}){let{as:n=typeof e==`string`?`Hex`:`Bytes`}=t,r=$l(yae(e));return n===`Bytes`?r:sh(r)}var Cde=o((()=>{eu(),ah(),ph()}));function Yg(e,t={}){let{strict:n=!0}=t;if(!Ede.test(e))throw new Dde({address:e,cause:new Ode});if(n){if(e.toLowerCase()===e)return;if(wde(e)!==e)throw new Dde({address:e,cause:new kde})}}function wde(e){if(Jg.has(e))return Jg.get(e);Yg(e,{strict:!1});let t=e.substring(2).toLowerCase(),n=Sde(Sae(t),{as:`Bytes`}),r=t.split(``);for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&r[e]&&(r[e]=r[e].toUpperCase()),(n[e>>1]&15)>=8&&r[e+1]&&(r[e+1]=r[e+1].toUpperCase());let i=`0x${r.join(``)}`;return Jg.set(e,i),i}function Tde(e,t={}){let{strict:n=!0}=t??{};try{return Yg(e,{strict:n}),!0}catch{return!1}}var Ede,Dde,Ode,kde,Xg=o((()=>{ah(),xde(),Qm(),Cde(),Ede=/^0x[a-fA-F0-9]{40}$/,Dde=class extends Zm{constructor({address:e,cause:t}){super(`Address "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`Address.InvalidAddressError`})}},Ode=class extends Zm{constructor(){super(`Address is not a 20 byte (40 hexadecimal character) value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`Address.InvalidInputError`})}},kde=class extends Zm{constructor(){super(`Address does not match its checksum counterpart.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`Address.InvalidChecksumError`})}}})),Ade,jde,Mde,Nde,Pde=o((()=>{Ade=/^(.*)\[([0-9]*)\]$/,jde=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Mde=/^(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)?$/,2n**(8n-1n)-1n,2n**(16n-1n)-1n,2n**(24n-1n)-1n,2n**(32n-1n)-1n,2n**(40n-1n)-1n,2n**(48n-1n)-1n,2n**(56n-1n)-1n,2n**(64n-1n)-1n,2n**(72n-1n)-1n,2n**(80n-1n)-1n,2n**(88n-1n)-1n,2n**(96n-1n)-1n,2n**(104n-1n)-1n,2n**(112n-1n)-1n,2n**(120n-1n)-1n,2n**(128n-1n)-1n,2n**(136n-1n)-1n,2n**(144n-1n)-1n,2n**(152n-1n)-1n,2n**(160n-1n)-1n,2n**(168n-1n)-1n,2n**(176n-1n)-1n,2n**(184n-1n)-1n,2n**(192n-1n)-1n,2n**(200n-1n)-1n,2n**(208n-1n)-1n,2n**(216n-1n)-1n,2n**(224n-1n)-1n,2n**(232n-1n)-1n,2n**(240n-1n)-1n,2n**(248n-1n)-1n,2n**(256n-1n)-1n,-(2n**(8n-1n)),-(2n**(16n-1n)),-(2n**(24n-1n)),-(2n**(32n-1n)),-(2n**(40n-1n)),-(2n**(48n-1n)),-(2n**(56n-1n)),-(2n**(64n-1n)),-(2n**(72n-1n)),-(2n**(80n-1n)),-(2n**(88n-1n)),-(2n**(96n-1n)),-(2n**(104n-1n)),-(2n**(112n-1n)),-(2n**(120n-1n)),-(2n**(128n-1n)),-(2n**(136n-1n)),-(2n**(144n-1n)),-(2n**(152n-1n)),-(2n**(160n-1n)),-(2n**(168n-1n)),-(2n**(176n-1n)),-(2n**(184n-1n)),-(2n**(192n-1n)),-(2n**(200n-1n)),-(2n**(208n-1n)),-(2n**(216n-1n)),-(2n**(224n-1n)),-(2n**(232n-1n)),-(2n**(240n-1n)),-(2n**(248n-1n)),-(2n**(256n-1n)),Nde=2n**256n-1n}));function Zg(e,t,n){let{checksumAddress:r,staticPosition:i}=n,a=Qde(t.type);if(a){let[n,o]=a;return Ide(e,{...t,type:o},{checksumAddress:r,length:n,staticPosition:i})}if(t.type===`tuple`)return Bde(e,t,{checksumAddress:r,staticPosition:i});if(t.type===`address`)return Fde(e,{checksum:r});if(t.type===`bool`)return Lde(e);if(t.type.startsWith(`bytes`))return Rde(e,t,{staticPosition:i});if(t.type.startsWith(`uint`)||t.type.startsWith(`int`))return zde(e,t);if(t.type===`string`)return Vde(e,{staticPosition:i});throw new e_(t.type)}function Fde(e,t={}){let{checksum:n=!1}=t;return[(e=>n?wde(e):e)(sh(wae(e.readBytes(32),-20))),32]}function Ide(e,t,n){let{checksumAddress:r,length:i,staticPosition:a}=n;if(!i){let n=a+ih(e.readBytes($g)),i=n+$de;e.setPosition(n);let o=ih(e.readBytes($de)),s=Qg(t),c=0,l=[];for(let n=0;n<o;++n){e.setPosition(i+(s?n*32:c));let[a,o]=Zg(e,t,{checksumAddress:r,staticPosition:i});c+=o,l.push(a)}return e.setPosition(a+32),[l,32]}if(Qg(t)){let n=a+ih(e.readBytes($g)),o=[];for(let a=0;a<i;++a){e.setPosition(n+a*32);let[i]=Zg(e,t,{checksumAddress:r,staticPosition:n});o.push(i)}return e.setPosition(a+32),[o,32]}let o=0,s=[];for(let n=0;n<i;++n){let[n,i]=Zg(e,t,{checksumAddress:r,staticPosition:a+o});o+=i,s.push(n)}return[s,o]}function Lde(e){return[Eae(e.readBytes(32),{size:32}),32]}function Rde(e,t,{staticPosition:n}){let[r,i]=t.type.split(`bytes`);if(!i){let t=ih(e.readBytes(32));e.setPosition(n+t);let r=ih(e.readBytes(32));if(r===0)return e.setPosition(n+32),[`0x`,32];let i=e.readBytes(r);return e.setPosition(n+32),[sh(i),32]}return[sh(e.readBytes(Number.parseInt(i,10),32)),32]}function zde(e,t){let n=t.type.startsWith(`int`),r=Number.parseInt(t.type.split(`int`)[1]||`256`,10),i=e.readBytes(32);return[r>48?Tae(i,{signed:n}):ih(i,{signed:n}),32]}function Bde(e,t,n){let{checksumAddress:r,staticPosition:i}=n,a=t.components.length===0||t.components.some(({name:e})=>!e),o=a?[]:{},s=0;if(Qg(t)){let n=i+ih(e.readBytes($g));for(let i=0;i<t.components.length;++i){let c=t.components[i];e.setPosition(n+s);let[l,u]=Zg(e,c,{checksumAddress:r,staticPosition:n});s+=u,o[a?i:c?.name]=l}return e.setPosition(i+32),[o,32]}for(let n=0;n<t.components.length;++n){let c=t.components[n],[l,u]=Zg(e,c,{checksumAddress:r,staticPosition:i});o[a?n:c?.name]=l,s+=u}return[o,s]}function Vde(e,{staticPosition:t}){let n=t+ih(e.readBytes(32));e.setPosition(n);let r=ih(e.readBytes(32));if(r===0)return e.setPosition(t+32),[``,32];let i=Dae(Oae(e.readBytes(r,32)));return e.setPosition(t+32),[i,32]}function Hde({checksumAddress:e,parameters:t,values:n}){let r=[];for(let i=0;i<t.length;i++)r.push(Ude({checksumAddress:e,parameter:t[i],value:n[i]}));return r}function Ude({checksumAddress:e=!1,parameter:t,value:n}){let r=t,i=Qde(r.type);if(i){let[t,a]=i;return Kde(n,{checksumAddress:e,length:t,parameter:{...r,type:a}})}if(r.type===`tuple`)return Zde(n,{checksumAddress:e,parameter:r});if(r.type===`address`)return Gde(n,{checksum:e});if(r.type===`bool`)return Jde(n);if(r.type.startsWith(`uint`)||r.type.startsWith(`int`)){let e=r.type.startsWith(`int`),[,,t=`256`]=Mde.exec(r.type)??[];return Yde(n,{signed:e,size:Number(t)})}if(r.type.startsWith(`bytes`))return qde(n,{type:r.type});if(r.type===`string`)return Xde(n);throw new e_(r.type)}function Wde(e){let t=0;for(let n=0;n<e.length;n++){let{dynamic:r,encoded:i}=e[n];r?t+=32:t+=fh(i)}let n=[],r=[],i=0;for(let a=0;a<e.length;a++){let{dynamic:o,encoded:s}=e[a];o?(n.push(ch(t+i,{size:32})),r.push(s),i+=fh(s)):n.push(s)}return oh(...n,...r)}function Gde(e,t){let{checksum:n=!1}=t;return Yg(e,{strict:n}),{dynamic:!1,encoded:lh(e.toLowerCase())}}function Kde(e,t){let{checksumAddress:n,length:r,parameter:i}=t,a=r===null;if(!Array.isArray(e))throw new gfe(e);if(!a&&e.length!==r)throw new pfe({expectedLength:r,givenLength:e.length,type:`${i.type}[${r}]`});let o=!1,s=[];for(let t=0;t<e.length;t++){let r=Ude({checksumAddress:n,parameter:i,value:e[t]});r.dynamic&&(o=!0),s.push(r)}if(a||o){let e=Wde(s);if(a){let t=ch(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?oh(t,e):t}}if(o)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:oh(...s.map(({encoded:e})=>e))}}function qde(e,{type:t}){let[,n]=t.split(`bytes`),r=fh(e);if(!n){let t=e;return r%32!=0&&(t=uh(t,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:oh(lh(ch(r,{size:32})),t)}}if(r!==Number.parseInt(n,10))throw new mfe({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:uh(e)}}function Jde(e){if(typeof e!=`boolean`)throw new Zm(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:lh(Rae(e))}}function Yde(e,{signed:t,size:n}){if(typeof n==`number`){let r=2n**(BigInt(n)-(t?1n:0n))-1n,i=t?-r-1n:0n;if(e>r||e<i)throw new Gae({max:r.toString(),min:i.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:ch(e,{size:32,signed:t})}}function Xde(e){let t=zae(e),n=Math.ceil(fh(t)/32),r=[];for(let e=0;e<n;e++)r.push(uh(dh(t,e*32,(e+1)*32)));return{dynamic:!0,encoded:oh(uh(ch(fh(t),{size:32})),...r)}}function Zde(e,t){let{checksumAddress:n,parameter:r}=t,i=!1,a=[];for(let t=0;t<r.components.length;t++){let o=r.components[t],s=Ude({checksumAddress:n,parameter:o,value:e[Array.isArray(e)?t:o.name]});a.push(s),s.dynamic&&(i=!0)}return{dynamic:i,encoded:i?Wde(a):oh(...a.map(({encoded:e})=>e))}}function Qde(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Qg(e){let{type:t}=e;if(t===`string`||t===`bytes`||t.endsWith(`[]`))return!0;if(t===`tuple`)return e.components?.some(Qg);let n=Qde(e.type);return!!(n&&Qg({...e,type:n[1]}))}var $de,$g,efe=o((()=>{t_(),Xg(),ah(),Qm(),ph(),Pde(),$de=32,$g=32}));function tfe(e,{recursiveReadLimit:t=8192}={}){let n=Object.create(nfe);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}var nfe,rfe,ife,afe,ofe=o((()=>{Qm(),nfe={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new afe({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new ife({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new rfe({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 rfe({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 n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+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 n=this.inspectBytes(e);return this.position+=t??e,n},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===1/0)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}},rfe=class extends Zm{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`Cursor.NegativeOffsetError`})}},ife=class extends Zm{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`Cursor.PositionOutOfBoundsError`})}},afe=class extends Zm{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`Cursor.RecursiveReadLimitExceededError`})}}}));function sfe(e,t,n={}){let{as:r=`Array`,checksumAddress:i=!1}=n,a=typeof t==`string`?xae(t):t,o=tfe(a);if(rh(a)===0&&e.length>0)throw new ffe;if(rh(a)&&rh(a)<32)throw new dfe({data:typeof t==`string`?t:sh(t),parameters:e,size:rh(a)});let s=0,c=r===`Array`?[]:{};for(let t=0;t<e.length;++t){let n=e[t];o.setPosition(s);let[a,l]=Zg(o,n,{checksumAddress:i,staticPosition:0});s+=l,r===`Array`?c.push(a):c[n.name??t]=a}return c}function cfe(e,t,n){let{checksumAddress:r=!1}=n??{};if(e.length!==t.length)throw new hfe({expectedLength:e.length,givenLength:t.length});let i=Wde(Hde({checksumAddress:r,parameters:e,values:t}));return i.length===0?`0x`:i}function lfe(e,t){if(e.length!==t.length)throw new hfe({expectedLength:e.length,givenLength:t.length});let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r];n.push(lfe.encode(i,a))}return oh(...n)}function ufe(e){return Array.isArray(e)&&typeof e[0]==`string`||typeof e==`string`?gde(e):e}var dfe,ffe,pfe,mfe,hfe,gfe,e_,t_=o((()=>{qg(),Xg(),ah(),Qm(),ph(),efe(),ofe(),Pde(),(function(e){function t(e,n,r=!1){if(e===`address`){let e=n;return Yg(e),lh(e.toLowerCase(),r?32:0)}if(e===`string`)return zae(n);if(e===`bytes`)return n;if(e===`bool`)return lh(Rae(n),r?32:1);let i=e.match(Mde);if(i){let[e,t,a=`256`]=i,o=Number.parseInt(a,10)/8;return ch(n,{size:r?32:o,signed:t===`int`})}let a=e.match(jde);if(a){let[e,t]=a;if(Number.parseInt(t,10)!==(n.length-2)/2)throw new mfe({expectedSize:Number.parseInt(t,10),value:n});return uh(n,r?32:0)}let o=e.match(Ade);if(o&&Array.isArray(n)){let[e,r]=o,i=[];for(let e=0;e<n.length;e++)i.push(t(r,n[e],!0));return i.length===0?`0x`:oh(...i)}throw new e_(e)}e.encode=t})(lfe||(lfe={})),dfe=class extends Zm{constructor({data:e,parameters:t,size:n}){super(`Data size of ${n} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Pg(t)})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`AbiParameters.DataSizeTooSmallError`})}},ffe=class extends Zm{constructor(){super(`Cannot decode zero data ("0x") with ABI parameters.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`AbiParameters.ZeroDataError`})}},pfe=class extends Zm{constructor({expectedLength:e,givenLength:t,type:n}){super(`Array length mismatch for type \`${n}\`. Expected: \`${e}\`. Given: \`${t}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`AbiParameters.ArrayLengthMismatchError`})}},mfe=class extends Zm{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${fh(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`AbiParameters.BytesSizeMismatchError`})}},hfe=class extends Zm{constructor({expectedLength:e,givenLength:t}){super([`ABI encoding parameters/values length mismatch.`,`Expected length (parameters): ${e}`,`Given length (values): ${t}`].join(`
111
111
  `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`AbiParameters.LengthMismatchError`})}},gfe=class extends Zm{constructor(e){super(`Value \`${e}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`AbiParameters.InvalidArrayError`})}},e_=class extends Zm{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`AbiParameters.InvalidTypeError`})}}}));function _fe(e,t={}){let{recovered:n}=t;if(e.r===void 0||e.s===void 0||n&&e.yParity===void 0)throw new Efe({signature:e});if(e.r<0n||e.r>Nde)throw new Dfe({value:e.r});if(e.s<0n||e.s>Nde)throw new Ofe({value:e.s});if(typeof e.yParity==`number`&&e.yParity!==0&&e.yParity!==1)throw new n_({value:e.yParity})}function vfe(e){return yfe(sh(e))}function yfe(e){if(e.length!==130&&e.length!==132)throw new Tfe({signature:e});let t=BigInt(dh(e,0,32)),n=BigInt(dh(e,32,64)),r=(()=>{let t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{return wfe(t)}catch{throw new n_({value:t})}})();return r===void 0?{r:t,s:n}:{r:t,s:n,yParity:r}}function bfe(e){if(e.r!==void 0&&e.s!==void 0)return xfe(e)}function xfe(e){let t=typeof e==`string`?yfe(e):e instanceof Uint8Array?vfe(e):typeof e.r==`string`?Cfe(e):e.v?Sfe(e):{r:e.r,s:e.s,...e.yParity===void 0?{}:{yParity:e.yParity}};return _fe(t),t}function Sfe(e){return{r:e.r,s:e.s,yParity:wfe(e.v)}}function Cfe(e){let t=(()=>{let t=e.v?Number(e.v):void 0,n=e.yParity?Number(e.yParity):void 0;if(typeof t==`number`&&typeof n!=`number`&&(n=wfe(t)),typeof n!=`number`)throw new n_({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function wfe(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return+(e%2==0);throw new kfe({value:e})}var Tfe,Efe,Dfe,Ofe,n_,kfe,Afe=o((()=>{Qm(),ph(),nh(),Pde(),Tfe=class extends Zm{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:[`Expected: 64 bytes or 65 bytes.`,`Received ${fh(Lae(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`Signature.InvalidSerializedSizeError`})}},Efe=class extends Zm{constructor({signature:e}){super(`Signature \`${_ae(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`Signature.MissingPropertiesError`})}},Dfe=class extends Zm{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`Signature.InvalidRError`})}},Ofe=class extends Zm{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`Signature.InvalidSError`})}},n_=class extends Zm{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`Signature.InvalidYParityError`})}},kfe=class extends Zm{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`Signature.InvalidVError`})}}}));function jfe(e,t={}){return typeof e.chainId==`string`?Mfe(e):{...e,...t.signature}}function Mfe(e){let{address:t,chainId:n,nonce:r}=e,i=bfe(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...i}}var Nfe=o((()=>{Afe()}));function Pfe(e){if(typeof e==`string`){if(dh(e,-32)!==`0x8010801080108010801080108010801080108010801080108010801080108010`)throw new Rfe(e)}else _fe(e.authorization)}function Ffe(e){Pfe(e);let t=Vae(dh(e,-64,-32)),n=dh(e,-t-64,-64),r=dh(e,0,-t-64),[i,a,o]=sfe(Lfe,n);return{authorization:jfe({address:i.delegation,chainId:Number(i.chainId),nonce:i.nonce,yParity:i.yParity,r:i.r,s:i.s}),signature:r,...o&&o!==`0x`?{data:o,to:a}:{}}}function Ife(e){try{return Pfe(e),!0}catch{return!1}}var Lfe,Rfe,zfe=o((()=>{t_(),Nfe(),Qm(),ph(),Afe(),Lfe=ufe(`(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data`),Rfe=class extends Zm{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`SignatureErc8010.InvalidWrappedSignatureError`})}}})),Bfe=o((()=>{zfe()})),Vfe,Hfe=o((()=>{Fs(),Vfe=class extends Ps{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:`InvalidDecimalNumberError`})}}}));function r_(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new Vfe({value:e});let[n,r=`0`]=e.split(`.`),i=n.startsWith(`-`);if(i&&(n=n.slice(1)),r=r.replace(/(0+)$/,``),t===0)Math.round(Number(`.${r}`))===1&&(n=`${BigInt(n)+1n}`),r=``;else if(r.length>t){let[e,i,a]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],o=Math.round(Number(`${i}.${a}`));r=o>9?`${BigInt(e)+BigInt(1)}0`.padStart(e.length+1,`0`):`${e}${o}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,`0`);return BigInt(`${i?`-`:``}${n}${r}`)}var Ufe=o((()=>{Hfe()}));function Wfe(e,t=`wei`){return r_(e,Ad[t])}var Gfe=o((()=>{jd(),Ufe()})),Kfe=o((()=>{bs(),Ate(),wd(),Ed(),Km(),Toe(),Xm(),Hu(),wh(),Doe(),Xu(),od(),koe(),rc(),fu(),xu(),fc(),Ac(),Nu(),Es(),bte(),qu(),qm(),vu(),Au(),Rc(),em(),nu(),Hm(),Are(),tm(),ele(),nle(),cle(),Loe(),_h(),ld(),uf(),Mh(),Qh(),Eh(),As(),mte(),Sc(),Fs(),gc(),md(),Dh(),Hf(),Wre(),sm(),Pm(),ym(),vm(),sg(),dm(),wle(),km(),cu(),uu(),ou(),Wu(),wm(),mu(),Mle(),kh(),Ele(),kle(),Dg(),kg(),Bfe(),wre(),Sre(),Od(),hm(),_g(),Jd(),Mm(),jm(),yg(),xg(),Og(),Fd(),Ld(),Gfe(),jd(),Ufe()}));function qfe(e){return e.map(e=>({...e,value:BigInt(e.value)}))}function Jfe(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?xc(e.nonce):void 0,storageProof:e.storageProof?qfe(e.storageProof):void 0}}var Yfe=o((()=>{Kfe()}));async function Xfe(e,{address:t,blockHash:n,blockNumber:r,blockTag:i=`latest`,requireCanonical:a,storageKeys:o}){let s=Sm({blockHash:n,blockNumber:r,blockTag:i,requireCanonical:a});return Jfe(await e.request({method:`eth_getProof`,params:[t,o,s]}))}var Zfe=o((()=>{Cm(),Yfe()}));async function Qfe(e,{address:t,blockHash:n,blockNumber:r,blockTag:i=`latest`,requireCanonical:a,slot:o}){let s=Sm({blockHash:n,blockNumber:r,blockTag:i,requireCanonical:a});return await e.request({method:`eth_getStorageAt`,params:[t,o,s]})}var $fe=o((()=>{Cm()}));async function epe(e,{blockHash:t,blockNumber:n,blockTag:r,hash:i,index:a,sender:o,nonce:s}){let c=r||`latest`,l=n===void 0?void 0:Ec(n),u=null;if(i?u=await e.request({method:`eth_getTransactionByHash`,params:[i]},{dedupe:!0}):t?u=await e.request({method:`eth_getTransactionByBlockHashAndIndex`,params:[t,Ec(a)]},{dedupe:!0}):(l||c)&&typeof a==`number`?u=await e.request({method:`eth_getTransactionByBlockNumberAndIndex`,params:[l||c,Ec(a)]},{dedupe:!!l}):o&&typeof s==`number`&&(u=await e.request({method:`eth_getTransactionBySenderAndNonce`,params:[o,Ec(s)]},{dedupe:!0})),!u)throw new Wd({blockHash:t,blockNumber:n,blockTag:c,hash:i,index:a});return(e.chain?.formatters?.transaction?.format||_m)(u,`getTransaction`)}var tpe=o((()=>{Jd(),Ac(),vm()}));async function npe(e,{hash:t,transactionReceipt:n}){let[r,i]=await Promise.all([xs(e,Uh,`getBlockNumber`)({}),t?xs(e,epe,`getTransaction`)({hash:t}):void 0]),a=n?.blockNumber||i?.blockNumber;return a?r-a+1n:0n}var rpe=o((()=>{Ss(),Wh(),tpe()}));async function i_(e,{hash:t}){let n=await e.request({method:`eth_getTransactionReceipt`,params:[t]},{dedupe:!0});if(!n)throw new Gd({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||og)(n,`getTransactionReceipt`)}var ipe=o((()=>{Jd(),sg()}));async function ape(e,t){let{account:n,authorizationList:r,allowFailure:i=!0,blockHash:a,blockNumber:o,blockOverrides:s,blockTag:c,requireCanonical:l,stateOverride:u}=t,d=t.contracts,{batchSize:f=t.batchSize??1024,deployless:p=t.deployless??!1}=typeof e.batch?.multicall==`object`?e.batch.multicall:{},m=(()=>{if(t.multicallAddress)return t.multicallAddress;if(p)return null;if(e.chain)return Th({blockNumber:o,chain:e.chain,contract:`multicall3`});throw Error(`client chain not configured. multicallAddress is required.`)})(),h=[[]],g=0,_=0;for(let e=0;e<d.length;e++){let{abi:t,address:r,args:a,functionName:o}=d[e];try{let e=ad({abi:t,args:a,functionName:o});_+=(e.length-2)/2,f>0&&_>f&&h[g].length>0&&(g++,_=(e.length-2)/2,h[g]=[]),h[g]=[...h[g],{allowFailure:!0,callData:e,target:r}]}catch(e){let s=Vf(e,{abi:t,address:r,args:a,docsPath:`/docs/contract/multicall`,functionName:o,sender:n});if(!i)throw s;h[g]=[...h[g],{allowFailure:!0,callData:`0x`,target:r}]}}let v=await Promise.allSettled(h.map(t=>xs(e,Fh,`readContract`)({...m===null?{code:vh}:{address:m},abi:mh,account:n,args:[t],authorizationList:r,blockHash:a,blockNumber:o,blockOverrides:s,blockTag:c,functionName:`aggregate3`,requireCanonical:l,stateOverride:u}))),y=[];for(let e=0;e<v.length;e++){let t=v[e];if(t.status===`rejected`){if(!i)throw t.reason;for(let n=0;n<h[e].length;n++)y.push({status:`failure`,error:t.reason,result:void 0});continue}let n=t.value;for(let t=0;t<n.length;t++){let{returnData:r,success:a}=n[t],{callData:o}=h[e][t],{abi:s,address:c,functionName:l,args:u}=d[y.length];try{if(o===`0x`)throw new zs;if(!a)throw new af({data:r});let e=Jm({abi:s,args:u,data:r,functionName:l});y.push(i?{result:e,status:`success`}:e)}catch(e){let t=Vf(e,{abi:s,address:c,args:u,docsPath:`/docs/contract/multicall`,functionName:l});if(!i)throw t;y.push({error:t,result:void 0,status:`failure`})}}}if(y.length!==d.length)throw new Ps(`multicall results mismatch`);return y}var ope=o((()=>{_h(),yh(),rc(),Fs(),of(),Xm(),od(),Eh(),Hf(),Ss(),Ih()}));async function spe(e,t){let{blockNumber:n,blockTag:r=e.experimental_blockTag??`latest`,blocks:i,returnFullTransactions:a,traceTransfers:o,validation:s}=t;try{let t=[];for(let e of i){let n=e.blockOverrides?$ae(e.blockOverrides):void 0,r=e.calls.map(e=>{let t=e,n=t.account?td(t.account):void 0,r=t.abi?ad(t):t.data,i={...t,account:n,data:t.dataSuffix?Su([r||`0x`,t.dataSuffix]):r,from:t.from??n?.address};return mm(i),um(i)}),i=e.stateOverrides?Qre(e.stateOverrides):void 0;t.push({blockOverrides:n,calls:r,stateOverrides:i})}let c=(typeof n==`bigint`?Ec(n):void 0)||r;return(await e.request({method:`eth_simulateV1`,params:[{blockStateCalls:t,returnFullTransactions:a,traceTransfers:o,validation:s},c]})).map((e,t)=>({...lie(e),calls:e.calls.map((e,n)=>{let{abi:r,args:a,functionName:o,to:s}=i[t].calls[n],c=e.error?.data??e.returnData,l=BigInt(e.gasUsed),u=e.logs?.map(e=>Um(e)),d=e.status===`0x1`?`success`:`failure`,f=r&&d===`success`&&c!==`0x`?Jm({abi:r,data:c,functionName:o}):null,p=(()=>{if(d===`success`)return;let e;if(c===`0x`?e=new zs:c&&(e=new af({data:c})),e)return Vf(e,{abi:r??[],address:s??`0x`,args:a,functionName:o??`<unknown>`})})();return{data:c,gasUsed:l,logs:u,status:d,...d===`success`?{result:f}:{error:p}}})}))}catch(e){let t=e,n=Hre(t,{});throw n instanceof am?t:n}}var cpe=o((()=>{eoe(),nd(),rc(),of(),om(),Xm(),od(),wu(),Ac(),Hf(),sm(),ym(),Wm(),dm(),$re(),hm()}));function lpe(e){let t=!0,n=``,r=0,i=``,a=!1;for(let o=0;o<e.length;o++){let s=e[o];if([`(`,`)`,`,`].includes(s)&&(t=!0),s===`(`&&r++,s===`)`&&r--,t){if(r===0){if(s===` `&&[`event`,`function`,`error`,``].includes(i))i=``;else if(i+=s,s===`)`){a=!0;break}continue}if(s===` `){e[o-1]!==`,`&&n!==`,`&&n!==`,(`&&(n=``,t=!1);continue}i+=s,n+=s}}if(!a)throw new Zm(`Unable to normalize signature.`);return i}function upe(e,t){let n=typeof e,r=t.type;switch(r){case`address`:return Tde(e,{strict:!1});case`bool`:return n===`boolean`;case`function`:return n===`string`;case`string`:return n===`string`;default:return r===`tuple`&&`components`in t?Object.values(t.components).every((t,n)=>upe(Object.values(e)[n],t)):/^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)?n===`number`||n===`bigint`:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n===`string`||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(e=>upe(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,``)})):!1}}function dpe(e,t,n){for(let r in e){let i=e[r],a=t[r];if(i.type===`tuple`&&a.type===`tuple`&&`components`in i&&`components`in a)return dpe(i.components,a.components,n[r]);let o=[i.type,a.type];if(o.includes(`address`)&&o.includes(`bytes20`)||(o.includes(`address`)&&o.includes(`string`)||o.includes(`address`)&&o.includes(`bytes`))&&Tde(n[r],{strict:!1}))return o}}var fpe=o((()=>{Xg(),Qm()}));function ppe(e,t={}){let{prepare:n=!0}=t,r=Array.isArray(e)||typeof e==`string`?mde(e):e;return{...r,...n?{hash:o_(r)}:{}}}function a_(e,t,n){let{args:r=[],prepare:i=!0}=n??{},a=Hae(t,{strict:!1}),o=e.filter(e=>a?e.type===`function`||e.type===`error`?mpe(e)===dh(t,0,4):e.type===`event`?o_(e)===t:!1:`name`in e&&e.name===t);if(o.length===0)throw new s_({name:t});if(o.length===1)return{...o[0],...i?{hash:o_(o[0])}:{}};let s;for(let e of o)if(`inputs`in e){if(!r||r.length===0){if(!e.inputs||e.inputs.length===0)return{...e,...i?{hash:o_(e)}:{}};continue}if(e.inputs&&e.inputs.length!==0&&e.inputs.length===r.length&&r.every((t,n)=>{let r=`inputs`in e&&e.inputs[n];return r?upe(t,r):!1})){if(s&&`inputs`in s&&s.inputs){let t=dpe(e.inputs,s.inputs,r);if(t)throw new gpe({abiItem:e,type:t[0]},{abiItem:s,type:t[1]})}s=e}}let c=(()=>{if(s)return s;let[e,...t]=o;return{...e,overloads:t}})();if(!c)throw new s_({name:t});return{...c,...i?{hash:o_(c)}:{}}}function mpe(...e){return dh(o_((()=>{if(Array.isArray(e[0])){let[t,n]=e;return a_(t,n)}return e[0]})()),0,4)}function hpe(...e){let t=(()=>{if(Array.isArray(e[0])){let[t,n]=e;return a_(t,n)}return e[0]})();return lpe(typeof t==`string`?t:Fg(t))}function o_(...e){let t=(()=>{if(Array.isArray(e[0])){let[t,n]=e;return a_(t,n)}return e[0]})();return typeof t!=`string`&&`hash`in t&&t.hash?t.hash:Sde(zae(hpe(t)))}var gpe,s_,_pe=o((()=>{qg(),Qm(),Cde(),ph(),fpe(),gpe=class extends Zm{constructor(e,t){super(`Found ambiguous types in overloaded ABI Items.`,{metaMessages:[`\`${e.type}\` in \`${lpe(Fg(e.abiItem))}\`, and`,`\`${t.type}\` in \`${lpe(Fg(t.abiItem))}\``,``,`These types encode differently and cannot be distinguished at runtime.`,`Remove one of the ambiguous items in the ABI.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`AbiItem.AmbiguityError`})}},s_=class extends Zm{constructor({name:e,data:t,type:n=`item`}){let r=e?` with name "${e}"`:t?` with data "${t}"`:``;super(`ABI ${n}${r} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`AbiItem.NotFoundError`})}}}));function vpe(...e){let[t,n]=(()=>{if(Array.isArray(e[0])){let[t,n]=e;return[bpe(t),n]}return e})(),{bytecode:r,args:i}=n;return oh(r,t.inputs?.length&&i?.length?cfe(t.inputs,i):`0x`)}function ype(e){return ppe(e)}function bpe(e){let t=e.find(e=>e.type===`constructor`);if(!t)throw new s_({name:`constructor`});return t}var xpe=o((()=>{_pe(),t_(),ph()}));function Spe(...e){let[t,n=[]]=(()=>{if(Array.isArray(e[0])){let[t,n,r]=e;return[Cpe(t,n,{args:r}),r]}let[t,n]=e;return[t,n]})(),{overloads:r}=t,i=r?Cpe([t,...r],t.name,{args:n}):t,a=wpe(i),o=n.length>0?cfe(i.inputs,n):void 0;return o?oh(a,o):a}function c_(e,t={}){return ppe(e,t)}function Cpe(e,t,n){let r=a_(e,t,n);if(r.type!==`function`)throw new s_({name:t,type:`function`});return r}function wpe(e){return mpe(e)}var Tpe=o((()=>{_pe(),t_(),ph()})),Epe,l_,Dpe=o((()=>{Epe=`0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`,l_=`0x0000000000000000000000000000000000000000`}));async function Ope(e,t){let{blockNumber:n,blockTag:r,calls:i,stateOverrides:a,traceAssetChanges:o,traceTransfers:s,validation:c}=t,l=t.account?td(t.account):void 0;if(o&&!l)throw new Ps("`account` is required when `traceAssetChanges` is true");let u=l?vpe(ype(`constructor(bytes, bytes)`),{bytecode:loe,args:[kpe,Spe(c_(`function getBalance(address)`),[l.address])]}):void 0,d=o?await Promise.all(t.calls.map(async t=>{if(!t.data&&!t.abi)return;let{accessList:n}=await pce(e,{account:l.address,...t,data:t.abi?ad(t):t.data});return n.map(({address:e,storageKeys:t})=>t.length>0?e:null)})).then(e=>e.flat().filter(Boolean)):[],f=await spe(e,{blockNumber:n,blockTag:r,blocks:[...o?[{calls:[{data:u}],stateOverrides:a},{calls:d.map((e,t)=>({abi:[c_(`function balanceOf(address) returns (uint256)`)],functionName:`balanceOf`,args:[l.address],to:e,from:l_,nonce:t})),stateOverrides:[{address:l_,nonce:0}]}]:[],{calls:[...i,{to:l_}].map(e=>({...e,from:l?.address})),stateOverrides:a},...o?[{calls:[{data:u}]},{calls:d.map((e,t)=>({abi:[c_(`function balanceOf(address) returns (uint256)`)],functionName:`balanceOf`,args:[l.address],to:e,from:l_,nonce:t})),stateOverrides:[{address:l_,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[c_(`function decimals() returns (uint256)`)],functionName:`decimals`,from:l_,nonce:t})),stateOverrides:[{address:l_,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[c_(`function tokenURI(uint256) returns (string)`)],functionName:`tokenURI`,args:[0n],from:l_,nonce:t})),stateOverrides:[{address:l_,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[c_(`function symbol() returns (string)`)],functionName:`symbol`,from:l_,nonce:t})),stateOverrides:[{address:l_,nonce:0}]}]:[]],traceTransfers:s,validation:c}),p=o?f[2]:f[0],[m,h,,g,_,v,y,b]=o?f:[],{calls:x,...S}=p,C=x.slice(0,-1)??[],w=m?.calls??[],T=h?.calls??[],E=[...w,...T].map(e=>e.status===`success`?bc(e.data):null),D=g?.calls??[],O=_?.calls??[],k=[...D,...O].map(e=>e.status===`success`?bc(e.data):null),A=(v?.calls??[]).map(e=>e.status===`success`?e.result:null),j=(b?.calls??[]).map(e=>e.status===`success`?e.result:null),M=(y?.calls??[]).map(e=>e.status===`success`?e.result:null),N=[];for(let[e,t]of k.entries()){let n=E[e];if(typeof t!=`bigint`||typeof n!=`bigint`)continue;let r=A[e-1],i=j[e-1],a=M[e-1],o=e===0?{address:Epe,decimals:18,symbol:`ETH`}:{address:d[e-1],decimals:a||r?Number(r??1):void 0,symbol:i??void 0};N.some(e=>e.token.address===o.address)||N.push({token:o,value:{pre:n,post:t,diff:t-n}})}return{assetChanges:N,block:S,results:C}}var kpe,Ape=o((()=>{xpe(),Tpe(),nd(),Dpe(),yh(),Fs(),od(),Kfe(),mce(),cpe(),kpe=`0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033`}));function jpe(e){if(dh(e,-32)!==`0x6492649264926492649264926492649264926492649264926492649264926492`)throw new Fpe(e)}function Mpe(e){let{data:t,signature:n,to:r}=e;return oh(cfe(ufe(`address, bytes, bytes`),[r,t,n]),Ppe)}function Npe(e){try{return jpe(e),!0}catch{return!1}}var Ppe,Fpe,Ipe=o((()=>{t_(),Qm(),ph(),Ppe=`0x6492649264926492649264926492649264926492649264926492649264926492`,Fpe=class extends Zm{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:`SignatureErc6492.InvalidWrappedSignatureError`})}}})),Lpe=o((()=>{Ipe()}));function Rpe({r:e,s:t,to:n=`hex`,v:r,yParity:i}){let a=(()=>{if(i===0||i===1)return i;if(r&&(r===27n||r===28n||r>=35n))return+(r%2n==0n);throw Error("Invalid `v` or `yParity` value")})(),o=`0x${new Yp.Signature(bc(e),bc(t)).toCompactHex()}${a===0?`1b`:`1c`}`;return n===`hex`?o:Pc(o)}var zpe=o((()=>{Qp(),Sc(),Rc()}));async function u_(e,t){let{address:n,chain:r=e.chain,hash:i,erc6492VerifierAddress:a=t.universalSignatureVerifierAddress??r?.contracts?.erc6492Verifier?.address,multicallAddress:o=t.multicallAddress??r?.contracts?.multicall3?.address,mode:s=`auto`}=t;if(r?.verifyHash)return await r.verifyHash(e,t);let c=(()=>{let e=t.signature;return Ds(e)?e:typeof e==`object`&&`r`in e&&`s`in e?Rpe(e):Tc(e)})();try{if(s===`eoa`)try{if(Vm(gu(n),await Cre({hash:i,signature:c})))return!0}catch{}return Ife(c)?await Bpe(e,{...t,multicallAddress:o,signature:c}):await Vpe(e,{...t,verifierAddress:a,signature:c})}catch(e){if(s!==`eoa`)try{if(Vm(gu(n),await Cre({hash:i,signature:c})))return!0}catch{}if(e instanceof d_)return!1;throw e}}async function Bpe(e,t){let{address:n,blockNumber:r,blockTag:i,hash:a,multicallAddress:o}=t,{authorization:s,data:c,signature:l,to:u}=Ffe(t.signature);if(await hg(e,{address:n,blockNumber:r,blockTag:i})===Cu([`0xef0100`,s.address]))return await Hpe(e,{address:n,blockNumber:r,blockTag:i,hash:a,signature:l});let d={address:s.address,chainId:Number(s.chainId),nonce:Number(s.nonce),r:Ec(s.r,{size:32}),s:Ec(s.s,{size:32}),yParity:s.yParity};if(!await tle({address:n,authorization:d}))throw new d_;let f=await xs(e,Fh,`readContract`)({...o?{address:o}:{code:vh},authorizationList:[d],abi:mh,blockNumber:r,blockTag:`pending`,functionName:`aggregate3`,args:[[...c?[{allowFailure:!0,target:u??n,callData:c}]:[],{allowFailure:!0,target:n,callData:ad({abi:ooe,functionName:`isValidSignature`,args:[a,l]})}]]});if((f[f.length-1]?.returnData)?.startsWith(`0x1626ba7e`))return!0;throw new d_}async function Vpe(e,t){let{address:n,factory:r,factoryData:i,hash:a,signature:o,verifierAddress:s,...c}=t,l=await(async()=>!r&&!i||Npe(o)?o:Mpe({data:i,signature:o,to:r}))(),u=s?{to:s,data:ad({abi:soe,functionName:`isValidSig`,args:[n,a,l]}),...c}:{data:Ch({abi:soe,args:[n,a,l],bytecode:doe}),...c},{data:d}=await xs(e,Nh,`call`)(u).catch(e=>{throw e instanceof ef?new d_:e});if(Wee(d??`0x0`))return!0;throw new d_}async function Hpe(e,t){let{address:n,blockNumber:r,blockTag:i,hash:a,signature:o}=t;if((await xs(e,Fh,`readContract`)({address:n,abi:ooe,args:[a,o],blockNumber:r,blockTag:i,functionName:`isValidSignature`}).catch(e=>{throw e instanceof tf?new d_:e})).startsWith(`0x1626ba7e`))return!0;throw new d_}var d_,f_=o((()=>{Lpe(),Bfe(),_h(),yh(),of(),wh(),od(),vu(),Hm(),nle(),wu(),Os(),Sc(),Ac(),Ss(),wre(),zpe(),Ph(),gg(),Ih(),d_=class extends Error{}}));async function Upe(e,{address:t,message:n,factory:r,factoryData:i,signature:a,...o}){let s=Lle(n);return xs(e,u_,`verifyHash`)({address:t,factory:r,factoryData:i,hash:s,signature:a,...o})}var Wpe=o((()=>{Ss(),Dg(),f_()}));async function Gpe(e,t){let{address:n,factory:r,factoryData:i,signature:a,message:o,primaryType:s,types:c,domain:l,...u}=t,d=qle({message:o,primaryType:s,types:c,domain:l});return xs(e,u_,`verifyHash`)({address:n,factory:r,factoryData:i,hash:d,signature:a,...u})}var Kpe=o((()=>{Ss(),kg(),f_()}));function qpe(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:i,poll:a,pollingInterval:o=e.pollingInterval}){let s=a===void 0?!(e.transport.type===`webSocket`||e.transport.type===`ipc`||e.transport.type===`fallback`&&(e.transport.transports[0].config.type===`webSocket`||e.transport.transports[0].config.type===`ipc`)):a,c;return s?Lh(Dd([`watchBlockNumber`,e.uid,t,n,o]),{onBlockNumber:r,onError:i},r=>Vh(async()=>{try{let t=await xs(e,Uh,`getBlockNumber`)({cacheTime:0});if(c!==void 0){if(t===c)return;if(t-c>1&&n)for(let e=c+1n;e<t;e++)r.onBlockNumber(e,c),c=e}(c===void 0||t>c)&&(r.onBlockNumber(t,c),c=t)}catch(e){r.onError?.(e)}},{emitOnBegin:t,interval:o})):Lh(Dd([`watchBlockNumber`,e.uid,t,n]),{onBlockNumber:r,onError:i},t=>{let n=!0,r=()=>n=!1;return(async()=>{try{let{unsubscribe:i}=await(()=>{if(e.transport.type===`fallback`){let t=e.transport.transports.find(e=>e.config.type===`webSocket`||e.config.type===`ipc`);return t?t.value:e.transport}return e.transport})().subscribe({params:[`newHeads`],onData(e){if(!n)return;let r=bc(e.result?.number);t.onBlockNumber(r,c),c=r},onError(e){t.onError?.(e)}});r=i,n||r()}catch(e){i?.(e)}})(),()=>r()})}var Jpe=o((()=>{Sc(),Ss(),Bh(),Hh(),Od(),Wh()}));async function Ype(e,t){let{checkReplacement:n=!0,confirmations:r=1,hash:i,onReplaced:a,retryCount:o=6,retryDelay:s=({count:e})=>~~(1<<e)*200,timeout:c=18e4}=t,l=Dd([`waitForTransactionReceipt`,e.uid,i]),u=t.pollingInterval?t.pollingInterval:e.chain?.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval,d,f,p,m=!1,h,g,{promise:_,resolve:v,reject:y}=_oe(),b=c?setTimeout(()=>{g?.(),h?.(),y(new qd({hash:i}))},c):void 0;return h=Lh(l,{onReplaced:a,resolve:v,reject:y},async t=>{if(p=await xs(e,i_,`getTransactionReceipt`)({hash:i}).catch(()=>void 0),p&&r<=1){clearTimeout(b),t.resolve(p),h?.();return}g=xs(e,qpe,`watchBlockNumber`)({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(a){let c=e=>{clearTimeout(b),g?.(),e(),h?.()},l=a;if(!m)try{if(p){if(r>1&&(!p.blockNumber||l-p.blockNumber+1n<r))return;c(()=>t.resolve(p));return}if(n&&!d&&(m=!0,await ig(async()=>{d=await xs(e,epe,`getTransaction`)({hash:i}),d.blockNumber&&(l=d.blockNumber)},{delay:s,retryCount:o}),m=!1),p=await xs(e,i_,`getTransactionReceipt`)({hash:i}),r>1&&(!p.blockNumber||l-p.blockNumber+1n<r))return;c(()=>t.resolve(p))}catch(n){if(n instanceof Wd||n instanceof Gd){if(!d){m=!1;return}try{f=d,m=!0;let n=await ig(()=>xs(e,bm,`getBlock`)({blockNumber:l,includeTransactions:!0}),{delay:s,retryCount:o,shouldRetry:({error:e})=>e instanceof iie});m=!1;let i=n.transactions.find(({from:e,nonce:t})=>e===f.from&&t===f.nonce);if(!i||(p=await xs(e,i_,`getTransactionReceipt`)({hash:i.hash}),r>1&&(!p.blockNumber||l-p.blockNumber+1n<r)))return;let a=`replaced`;i.to===f.to&&i.value===f.value&&i.input===f.input?a=`repriced`:i.from===i.to&&i.value===0n&&(a=`cancelled`),c(()=>{t.onReplaced?.({reason:a,replacedTransaction:f,transaction:i,transactionReceipt:p}),t.resolve(p)})}catch(e){c(()=>t.reject(e))}}else c(()=>t.reject(n))}}})}),_}var Xpe=o((()=>{aie(),Jd(),Ss(),Bh(),voe(),ag(),Od(),xm(),tpe(),ipe(),Jpe()}));function Zpe(e,{blockTag:t=e.experimental_blockTag??`latest`,emitMissed:n=!1,emitOnBegin:r=!1,onBlock:i,onError:a,includeTransactions:o,poll:s,pollingInterval:c=e.pollingInterval}){let l=s===void 0?!(e.transport.type===`webSocket`||e.transport.type===`ipc`||e.transport.type===`fallback`&&(e.transport.transports[0].config.type===`webSocket`||e.transport.transports[0].config.type===`ipc`)):s,u=o??!1,d;return l?Lh(Dd([`watchBlocks`,e.uid,t,n,r,u,c]),{onBlock:i,onError:a},i=>Vh(async()=>{try{let r=await xs(e,bm,`getBlock`)({blockTag:t,includeTransactions:u});if(r.number!==null&&d?.number!=null){if(r.number===d.number)return;if(r.number-d.number>1&&n)for(let t=d?.number+1n;t<r.number;t++){let n=await xs(e,bm,`getBlock`)({blockNumber:t,includeTransactions:u});i.onBlock(n,d),d=n}}(d?.number==null||t===`pending`&&r?.number==null||r.number!==null&&r.number>d.number)&&(i.onBlock(r,d),d=r)}catch(e){i.onError?.(e)}},{emitOnBegin:r,interval:c})):(()=>{let n=!0,o=!0,s=()=>n=!1;return(async()=>{try{r&&xs(e,bm,`getBlock`)({blockTag:t,includeTransactions:u}).then(e=>{n&&o&&(i(e,void 0),o=!1)}).catch(a);let{unsubscribe:c}=await(()=>{if(e.transport.type===`fallback`){let t=e.transport.transports.find(e=>e.config.type===`webSocket`||e.config.type===`ipc`);return t?t.value:e.transport}return e.transport})().subscribe({params:[`newHeads`],async onData(t){if(!n)return;let r=await xs(e,bm,`getBlock`)({blockNumber:t.result?.number,includeTransactions:u}).catch(()=>{});n&&(i(r,d),o=!1,d=r)},onError(e){a?.(e)}});s=c,n||s()}catch(e){a?.(e)}})(),()=>s()})()}var Qpe=o((()=>{Ss(),Bh(),Hh(),Od(),xm()}));function $pe(e,{address:t,args:n,batch:r=!0,event:i,events:a,fromBlock:o,onError:s,onLogs:c,poll:l,pollingInterval:u=e.pollingInterval,strict:d}){let f=l===void 0?typeof o==`bigint`?!0:!(e.transport.type===`webSocket`||e.transport.type===`ipc`||e.transport.type===`fallback`&&(e.transport.transports[0].config.type===`webSocket`||e.transport.transports[0].config.type===`ipc`)):l,p=d??!1;return f?Lh(Dd([`watchEvent`,t,n,r,e.uid,i,u,o]),{onLogs:c,onError:s},s=>{let c;o!==void 0&&(c=o-1n);let l,d=!1,f=Vh(async()=>{if(!d){try{l=await xs(e,_ce,`createEventFilter`)({address:t,args:n,event:i,events:a,strict:p,fromBlock:o})}catch{}d=!0;return}try{let o;if(l)o=await xs(e,Gh,`getFilterChanges`)({filter:l});else{let r=await xs(e,Uh,`getBlockNumber`)({});o=c&&c!==r?await xs(e,Qie,`getLogs`)({address:t,args:n,event:i,events:a,fromBlock:c+1n,toBlock:r}):[],c=r}if(o.length===0)return;if(r)s.onLogs(o);else for(let e of o)s.onLogs([e])}catch(e){l&&e instanceof yf&&(d=!1),s.onError?.(e)}},{emitOnBegin:!0,interval:u});return async()=>{l&&await xs(e,qh,`uninstallFilter`)({filter:l}),f()}}):(()=>{let r=!0,o=()=>r=!1;return(async()=>{try{let l=(()=>{if(e.transport.type===`fallback`){let t=e.transport.transports.find(e=>e.config.type===`webSocket`||e.config.type===`ipc`);return t?t.value:e.transport}return e.transport})(),u=a??(i?[i]:void 0),f=[];u&&(f=[u.flatMap(e=>Ju({abi:[e],eventName:e.name,args:n}))],i&&(f=f[0]));let{unsubscribe:m}=await l.subscribe({params:[`logs`,{address:t,topics:f}],onData(e){if(!r)return;let t=e.result;try{let{eventName:e,args:n}=Gm({abi:u??[],data:t.data,topics:t.topics,strict:p});c([Um(t,{args:n,eventName:e})])}catch(e){let n,r;if(e instanceof Qs||e instanceof $s){if(d)return;n=e.abiItem.name,r=e.abiItem.inputs?.some(e=>!(`name`in e&&e.name))}c([Um(t,{args:r?[]:{},eventName:n})])}},onError(e){s?.(e)}});o=m,r||o()}catch(e){s?.(e)}})(),()=>o()})()}var eme=o((()=>{rc(),Bf(),Km(),Xu(),Wm(),Ss(),Bh(),Hh(),Od(),vce(),Wh(),Kh(),$ie(),Jh()}));function tme(e,{batch:t=!0,onError:n,onTransactions:r,poll:i,pollingInterval:a=e.pollingInterval}){return(i===void 0?e.transport.type!==`webSocket`&&e.transport.type!==`ipc`:i)?Lh(Dd([`watchPendingTransactions`,e.uid,t,a]),{onTransactions:r,onError:n},n=>{let r,i=Vh(async()=>{try{if(!r)try{r=await xs(e,yce,`createPendingTransactionFilter`)({});return}catch(e){throw i(),e}let a=await xs(e,Gh,`getFilterChanges`)({filter:r});if(a.length===0)return;if(t)n.onTransactions(a);else for(let e of a)n.onTransactions([e])}catch(e){n.onError?.(e)}},{emitOnBegin:!0,interval:a});return async()=>{r&&await xs(e,qh,`uninstallFilter`)({filter:r}),i()}}):(()=>{let t=!0,i=()=>t=!1;return(async()=>{try{let{unsubscribe:a}=await e.transport.subscribe({params:[`newPendingTransactions`],onData(e){if(!t)return;let n=e.result;r([n])},onError(e){n?.(e)}});i=a,t||i()}catch(e){n?.(e)}})(),()=>i()})()}var nme=o((()=>{Ss(),Bh(),Hh(),Od(),bce(),Kh(),Jh()}));function rme(e){let{scheme:t,statement:n,...r}=e.match(ime)?.groups??{},{chainId:i,expirationTime:a,issuedAt:o,notBefore:s,requestId:c,...l}=e.match(ame)?.groups??{},u=e.split(`Resources:`)[1]?.split(`
112
- - `).slice(1);return{...r,...l,...i?{chainId:Number(i)}:{},...a?{expirationTime:new Date(a)}:{},...o?{issuedAt:new Date(o)}:{},...s?{notBefore:new Date(s)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}var ime,ame,ome=o((()=>{ime=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,ame=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/}));function sme(e){let{address:t,domain:n,message:r,nonce:i,scheme:a,time:o=new Date}=e;if(n&&r.domain!==n||i&&r.nonce!==i||a&&r.scheme!==a||r.expirationTime&&o>=r.expirationTime||r.notBefore&&o<r.notBefore)return!1;try{if(!r.address||!yu(r.address,{strict:!1})||t&&!Vm(r.address,t))return!1}catch{return!1}return!0}var cme=o((()=>{xu(),Hm()}));async function lme(e,t){let{address:n,domain:r,message:i,nonce:a,scheme:o,signature:s,time:c=new Date,...l}=t,u=rme(i);if(!u.address||!sme({address:n,domain:r,message:u,nonce:a,scheme:o,time:c}))return!1;let d=Lle(i);return u_(e,{address:u.address,hash:d,signature:s,...l})}var ume=o((()=>{Dg(),ome(),cme(),f_()}));async function dme(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){let i=await e.request({method:`eth_sendRawTransactionSync`,params:r?[t,r]:[t]},{retryCount:0}),a=(e.chain?.formatters?.transactionReceipt?.format||og)(i);if(a.status===`reverted`&&n)throw new Kd({receipt:a});return a}var fme=o((()=>{Jd(),sg()}));function pme(e){return{call:t=>Nh(e,t),createAccessList:t=>pce(e,t),createBlockFilter:()=>hce(e),createContractEventFilter:t=>$u(e,t),createEventFilter:t=>_ce(e,t),createPendingTransactionFilter:()=>yce(e),estimateContractGas:t=>Kie(e,t),estimateGas:t=>Wie(e,t),getBalance:t=>xce(e,t),getBlobBaseFee:()=>Cce(e),getBlock:t=>bm(e,t),getBlockNumber:t=>Uh(e,t),getBlockReceipts:t=>Tce(e,t),getBlockTransactionCount:t=>Dce(e,t),getBytecode:t=>hg(e,t),getChainId:()=>Fm(e),getCode:t=>hg(e,t),getContractEvents:t=>eae(e,t),getDelegation:t=>kce(e,t),getEip712Domain:t=>Nce(e,t),getEnsAddress:t=>Lse(e,t),getEnsAvatar:t=>sce(e,t),getEnsName:t=>lce(e,t),getEnsResolver:t=>dce(e,t),getEnsText:t=>ace(e,t),getFeeHistory:t=>Rce(e,t),estimateFeesPerGas:t=>gie(e,t),getFilterChanges:t=>Gh(e,t),getFilterLogs:t=>Bce(e,t),getGasPrice:()=>die(e),getLogs:t=>Qie(e,t),getProof:t=>Xfe(e,t),estimateMaxPriorityFeePerGas:t=>pie(e,t),fillTransaction:t=>Vie(e,t),getStorageAt:t=>Qfe(e,t),getTransaction:t=>epe(e,t),getTransactionConfirmations:t=>npe(e,t),getTransactionCount:t=>yie(e,t),getTransactionReceipt:t=>i_(e,t),multicall:t=>ape(e,t),prepareTransactionRequest:t=>Lm(e,t),readContract:t=>Fh(e,t),sendRawTransaction:t=>cse(e,t),sendRawTransactionSync:t=>dme(e,t),simulate:t=>spe(e,t),simulateBlocks:t=>spe(e,t),simulateCalls:t=>Ope(e,t),simulateContract:t=>Joe(e,t),verifyHash:t=>u_(e,t),verifyMessage:t=>Upe(e,t),verifySiweMessage:t=>lme(e,t),verifyTypedData:t=>Gpe(e,t),uninstallFilter:t=>qh(e,t),waitForTransactionReceipt:t=>Ype(e,t),watchBlocks:t=>Zpe(e,t),watchBlockNumber:t=>qpe(e,t),watchContractEvent:t=>ase(e,t),watchEvent:t=>$pe(e,t),watchPendingTransactions:t=>tme(e,t)}}var mme=o((()=>{zse(),cce(),uce(),fce(),oce(),Ph(),mce(),gce(),ed(),vce(),bce(),qie(),vie(),Gie(),hie(),Hie(),Sce(),wce(),xm(),Wh(),Ece(),Oce(),Im(),gg(),tae(),Ace(),Fce(),zce(),Kh(),Vce(),fie(),$ie(),Zfe(),$fe(),tpe(),rpe(),wm(),ipe(),ope(),Ih(),cpe(),Ape(),Yoe(),Jh(),f_(),Wpe(),Kpe(),Xpe(),Jpe(),Qpe(),ose(),eme(),nme(),ume(),Bm(),lse(),fme()}));function hme(e){let{key:t=`public`,name:n=`Public Client`}=e;return Tse({...e,key:t,name:n,type:`publicClient`}).extend(pme)}var gme=o((()=>{Ese(),mme()}));async function _me(e,{chain:t}){let{id:n,name:r,nativeCurrency:i,rpcUrls:a,blockExplorers:o}=t;await e.request({method:`wallet_addEthereumChain`,params:[{chainId:Ec(n),chainName:r,nativeCurrency:i,rpcUrls:a.default.http,blockExplorerUrls:o?Object.values(o).map(({url:e})=>e):void 0}]},{dedupe:!0,retryCount:0})}var vme=o((()=>{Ac()}));function yme(e,t){let{abi:n,args:r,bytecode:i,...a}=t,o=Ch({abi:n,args:r,bytecode:i});return $h(e,{...a,...a.authorizationList?{to:null}:{},data:o})}var bme=o((()=>{wh(),tg()}));async function xme(e){return e.account?.type===`local`?[e.account.address]:(await e.request({method:`eth_accounts`},{dedupe:!0})).map(e=>hu(e))}var Sme=o((()=>{vu()}));async function Cme(e,t={}){let{account:n=e.account,chainId:r}=t,i=n?td(n):void 0,a=r?[i?.address,[Ec(r)]]:[i?.address],o=await e.request({method:`wallet_getCapabilities`,params:a}),s={};for(let[e,t]of Object.entries(o)){s[Number(e)]={};for(let[n,r]of Object.entries(t))n===`addSubAccount`&&(n=`unstable_addSubAccount`),s[Number(e)][n]=r}return typeof r==`number`?s[r]:s}var wme=o((()=>{nd(),Ac()}));async function Tme(e){return await e.request({method:`wallet_getPermissions`},{dedupe:!0})}var Eme=o((()=>{}));async function Dme(e,t){let{account:n=e.account,chainId:r,nonce:i}=t;if(!n)throw new Yh({docsPath:`/docs/eip7702/prepareAuthorization`});let a=td(n),o=(()=>{if(t.executor)return t.executor===`self`?t.executor:td(t.executor)})(),s={address:t.contractAddress??t.address,chainId:r,nonce:i};return s.chainId===void 0&&(s.chainId=e.chain?.id??await xs(e,Fm,`getChainId`)({})),s.nonce===void 0&&(s.nonce=await xs(e,yie,`getTransactionCount`)({address:a.address,blockTag:`pending`}),(o===`self`||o?.address&&Vm(o.address,a.address))&&(s.nonce+=1)),s}var Ome=o((()=>{nd(),Zh(),Hm(),Ss(),Im(),wm()}));async function kme(e){return(await e.request({method:`eth_requestAccounts`},{dedupe:!0,retryCount:0})).map(e=>gu(e))}var Ame=o((()=>{vu()}));async function jme(e,t){return e.request({method:`wallet_requestPermissions`,params:[t]},{retryCount:0})}var Mme=o((()=>{}));async function Nme(e,t){let{chain:n=e.chain}=t,r=t.timeout??Math.max((n?.blockTime??0)*3,5e3),i=await xs(e,mse,`sendCalls`)(t);return await xs(e,bse,`waitForCallsStatus`)({...t,id:i.id,timeout:r})}var Pme=o((()=>{Ss(),_se(),Sse()}));async function Fme(e,t){let{account:n=e.account,assertChainId:r=!0,chain:i=e.chain,accessList:a,authorizationList:o,blobs:s,data:c,dataSuffix:l=typeof e.dataSuffix==`string`?e.dataSuffix:e.dataSuffix?.value,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:m,nonce:h,pollingInterval:g,throwOnReceiptRevert:_,type:v,value:y,...b}=t,x=t.timeout??Math.max((i?.blockTime??0)*3,5e3);if(n===void 0)throw new Yh({docsPath:`/docs/actions/wallet/sendTransactionSync`});let S=n?td(n):null,C;try{mm(t);let n=await(async()=>{if(t.to)return t.to;if(t.to!==null&&o&&o.length>0)return await jre({authorization:o[0]}).catch(()=>{throw new Ps("`to` is required. Could not infer from `authorizationList`.")})})();if(S?.type===`json-rpc`||S===null){let t;i!==null&&(t=await xs(e,Fm,`getChainId`)({}),r&&sse({currentChainId:t,chain:i}));let C=e.chain?.formatters?.transactionRequest?.format,w=(C||um)({...cm(b,{format:C}),accessList:a,account:S,authorizationList:o,blobs:s,chainId:t,data:l?Su([c??`0x`,l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:m,nonce:h,to:n,type:v,value:y},`sendTransaction`),T=p_.get(e.uid),E=T?`wallet_sendTransaction`:`eth_sendTransaction`,D=await(async()=>{try{return await e.request({method:E,params:[w]},{retryCount:0})}catch(t){if(T===!1)throw t;let n=t;if(n.name===`InvalidInputRpcError`||n.name===`InvalidParamsRpcError`||n.name===`MethodNotFoundRpcError`||n.name===`MethodNotSupportedRpcError`)return await e.request({method:`wallet_sendTransaction`,params:[w]},{retryCount:0}).then(t=>(p_.set(e.uid,!0),t)).catch(t=>{let r=t;throw r.name===`MethodNotFoundRpcError`||r.name===`MethodNotSupportedRpcError`?(p_.set(e.uid,!1),n):r});throw n}})(),O=await xs(e,Ype,`waitForTransactionReceipt`)({checkReplacement:!1,hash:D,pollingInterval:g,timeout:x});if(_&&O.status===`reverted`)throw new Kd({receipt:O});return O}if(S?.type===`local`){if(S.nonceManager&&h===void 0){let t=b.chainId,n=await(async()=>typeof t==`number`?t:i?i.id:xs(e,Fm,`getChainId`)({}))();C={address:S.address,chainId:n}}let r=await xs(e,Lm,`prepareTransactionRequest`)({account:S,accessList:a,authorizationList:o,blobs:s,chain:i,data:l?Su([c??`0x`,l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:m,nonce:h,nonceManager:S.nonceManager,parameters:[...Rm,`sidecars`],type:v,value:y,...b,to:n}),g=i?.serializers?.transaction,x=await S.signTransaction(r,{serializer:g});return await xs(e,dme,`sendRawTransactionSync`)({serializedTransaction:x,throwOnReceiptRevert:_,timeout:t.timeout})}throw S?.type===`smart`?new Xh({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:`/docs/actions/bundler/sendUserOperation`,type:`smart`}):new Xh({docsPath:`/docs/actions/wallet/sendTransactionSync`,type:S?.type})}catch(e){throw e instanceof Xh?e:(C&&!(e instanceof Kd)&&S?.nonceManager?.reset(C),Nm(e,{...t,account:S,chain:t.chain||void 0}))}}var p_,Ime=o((()=>{nd(),Zh(),Fs(),Jd(),tm(),Qh(),wu(),Pm(),lm(),dm(),Ss(),mu(),hm(),Im(),Xpe(),Bm(),fme(),p_=new pu(128)}));async function Lme(e,t){let{id:n}=t;await e.request({method:`wallet_showCallsStatus`,params:[n]})}var Rme=o((()=>{}));async function zme(e,t){let{account:n=e.account}=t;if(!n)throw new Yh({docsPath:`/docs/eip7702/signAuthorization`});let r=td(n);if(!r.signAuthorization)throw new Xh({docsPath:`/docs/eip7702/signAuthorization`,metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:r.type});let i=await Dme(e,t);return r.signAuthorization(i)}var Bme=o((()=>{nd(),Zh(),Ome()}));async function Vme(e,{account:t=e.account,message:n}){if(!t)throw new Yh({docsPath:`/docs/actions/wallet/signMessage`});let r=td(t);if(r.signMessage)return r.signMessage({message:n});let i=typeof n==`string`?Dc(n):n.raw instanceof Uint8Array?Cc(n.raw):n.raw;return e.request({method:`personal_sign`,params:[i,r.address]},{retryCount:0})}var Hme=o((()=>{nd(),Zh(),Ac()}));async function Ume(e,t){let{account:n=e.account,chain:r=e.chain,...i}=t;if(!n)throw new Yh({docsPath:`/docs/actions/wallet/signTransaction`});let a=td(n);mm({account:a,...t});let o=await xs(e,Fm,`getChainId`)({});r!==null&&sse({currentChainId:o,chain:r});let s=(r?.formatters||e.chain?.formatters)?.transactionRequest?.format||um;return a.signTransaction?a.signTransaction({...i,account:a,chainId:o},{serializer:e.chain?.serializers?.transaction}):await e.request({method:`eth_signTransaction`,params:[{...s({...i,account:a},`signTransaction`),chainId:Ec(o),from:a.address}]},{retryCount:0})}var Wme=o((()=>{nd(),Zh(),Qh(),Ac(),dm(),Ss(),hm(),Im()}));async function Gme(e,t){let{account:n=e.account,domain:r,message:i,primaryType:a}=t;if(!n)throw new Yh({docsPath:`/docs/actions/wallet/signTypedData`});let o=td(n),s={EIP712Domain:Wle({domain:r}),...t.types};if(Ule({domain:r,message:i,primaryType:a,types:s}),o.signTypedData)return o.signTypedData({domain:r,message:i,primaryType:a,types:s});let c=Hle({domain:r,message:i,primaryType:a,types:s});return e.request({method:`eth_signTypedData_v4`,params:[o.address,c]},{retryCount:0})}var Kme=o((()=>{nd(),Zh(),Og()}));async function qme(e,{id:t}){await e.request({method:`wallet_switchEthereumChain`,params:[{chainId:Ec(t)}]},{retryCount:0})}var Jme=o((()=>{Ac()}));async function Yme(e,t){return await e.request({method:`wallet_watchAsset`,params:t},{retryCount:0})}var Xme=o((()=>{}));async function Zme(e,t){return ng.internal(e,Fme,`sendTransactionSync`,t)}var Qme=o((()=>{Ime(),rg()}));function $me(e){return{addChain:t=>_me(e,t),deployContract:t=>yme(e,t),fillTransaction:t=>Vie(e,t),getAddresses:()=>xme(e),getCallsStatus:t=>vse(e,t),getCapabilities:t=>Cme(e,t),getChainId:()=>Fm(e),getPermissions:()=>Tme(e),prepareAuthorization:t=>Dme(e,t),prepareTransactionRequest:t=>Lm(e,t),requestAddresses:()=>kme(e),requestPermissions:t=>jme(e,t),sendCalls:t=>mse(e,t),sendCallsSync:t=>Nme(e,t),sendRawTransaction:t=>cse(e,t),sendRawTransactionSync:t=>dme(e,t),sendTransaction:t=>$h(e,t),sendTransactionSync:t=>Fme(e,t),showCallsStatus:t=>Lme(e,t),signAuthorization:t=>zme(e,t),signMessage:t=>Vme(e,t),signTransaction:t=>Ume(e,t),signTypedData:t=>Gme(e,t),switchChain:t=>qme(e,t),waitForCallsStatus:t=>bse(e,t),watchAsset:t=>Yme(e,t),writeContract:t=>ng(e,t),writeContractSync:t=>Zme(e,t)}}var ehe=o((()=>{Hie(),Im(),vme(),bme(),Sme(),yse(),wme(),Eme(),Ome(),Bm(),Ame(),Mme(),_se(),Pme(),lse(),fme(),tg(),Ime(),Rme(),Bme(),Hme(),Wme(),Kme(),Jme(),Sse(),Xme(),rg(),Qme()}));function the(e){let{key:t=`wallet`,name:n=`Wallet Client`,transport:r}=e;return Tse({...e,key:t,name:n,transport:r,type:`walletClient`}).extend($me)}var nhe=o((()=>{Ese(),ehe()}));function rhe({key:e,methods:t,name:n,request:r,retryCount:i=3,retryDelay:a=150,timeout:o,type:s},c){let l=Cse();return{config:{key:e,methods:t,name:n,request:r,retryCount:i,retryDelay:a,timeout:o,type:s},request:ale(r,{methods:t,retryCount:i,retryDelay:a,uid:l}),value:c}}var ihe=o((()=>{cle(),wse()}));function ahe(e,t={}){let{key:n=`custom`,methods:r,name:i=`Custom Provider`,retryDelay:a}=t;return({retryCount:o})=>rhe({key:n,methods:r,name:i,request:e.request.bind(e),retryCount:t.retryCount??o,retryDelay:a,type:`custom`})}var ohe=o((()=>{ihe()})),she,che=o((()=>{Fs(),she=class extends Ps{constructor(){super(`No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.`,{docsPath:`/docs/clients/intro`,name:`UrlRequiredError`})}}}));function lhe(e){if(!e)return`default`;let t=fhe.get(e);if(t!==void 0)return t;let n=dhe++;return fhe.set(e,n),n}function uhe(e,t={}){let{batch:n,fetchFn:r,fetchOptions:i,key:a=`http`,methods:o,name:s=`HTTP JSON-RPC`,onFetchRequest:c,onFetchResponse:l,retryDelay:u,raw:d}=t;return({chain:f,retryCount:p,timeout:m})=>{let{batchSize:h=1e3,wait:g=0}=typeof n==`object`?n:{},_=t.retryCount??p,v=m??t.timeout??1e4,y=e||f?.rpcUrls.default.http[0];if(!y)throw new she;let b=Ale(y,{fetchFn:r,fetchOptions:i,onRequest:c,onResponse:l,timeout:v});return rhe({key:a,methods:o,name:s,async request({method:e,params:t},r){let i={method:e,params:t},a=r?.signal?{signal:r.signal}:void 0,{schedule:o}=yoe({id:`${y}.${lhe(r?.signal)}`,wait:g,shouldSplitBatch(e){return e.length>h},fn:e=>b.request({body:e,fetchOptions:a}),sort:(e,t)=>e.id-t.id}),[{error:s,result:c}]=await(async e=>n?o(e):[await b.request({body:e,fetchOptions:a})])(i);if(d)return{error:s,result:c};if(s)throw new cf({body:i,error:s,url:y});return c},retryCount:_,retryDelay:u,timeout:v,type:`http`},{fetchOptions:i,url:y})}}var dhe,fhe,phe=o((()=>{uf(),che(),kh(),Mle(),ihe(),dhe=0,fhe=new WeakMap})),m_=o((()=>{bs(),ed(),qie(),tae(),Ih(),Yoe(),ose(),rg(),Sse(),Ese(),gme(),Sc(),Ac(),dm(),nhe(),mme(),ehe(),ihe(),ohe(),om(),Bf(),Qoe(),phe(),uf(),che(),Mle(),kh(),Ele(),kle(),_h(),Dpe(),yh(),pm(),Ple(),jd(),rc(),fu(),Fs(),aie(),dse(),Sh(),of(),cc(),gc(),Hse(),Nre(),gm(),ic(),zd(),Jd(),Vle(),Hfe(),wd(),Ed(),Km(),Toe(),Xm(),Hu(),wh(),Doe(),Xu(),od(),koe(),xu(),fc(),Nu(),qu(),qm(),id(),vu(),Au(),Rc(),em(),nu(),Hm(),Tm(),Em(),Eie(),wie(),md(),jm(),Rie(),Loe(),ld(),Mh(),Qh(),wg(),Eh(),As(),mte(),Fse(),dg(),Hf(),ym(),vm(),sg(),wle(),km(),cu(),uu(),ou(),Wu(),wm(),mu(),rse(),ag(),Dg(),kg(),Bfe(),Qp(),wre(),Sre(),_g(),xg(),zpe(),Ile(),Od(),hm(),Mm(),yg(),Og(),Fd(),Ld(),Nd(),Gfe(),Ufe()})),mhe,h_,g_=o((()=>{zr(),F(),mhe={queries:{staleTime:5*w,gcTime:5*T,retry:2,retryDelay:N,refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,refetchOnReconnect:!0}},h_=new Qn({defaultOptions:mhe})})),hhe=o((()=>{})),ghe=o((()=>{}));function _he({storage:e,buster:t=``,maxAge:n=1e3*60*60*24,serialize:r=JSON.stringify,deserialize:i=JSON.parse,prefix:a=vhe,refetchOnRestore:o=!0,filters:s}){function c(e){if(e.state.dataUpdatedAt){let r=Date.now()-e.state.dataUpdatedAt>n,i=e.buster!==t;return!!(r||i)}return!0}async function l(t,n){if(e!=null){let r=`${a}-${t}`;try{let t=await e.getItem(r);if(t){let a;try{a=await i(t)}catch{await e.removeItem(r);return}if(c(a))await e.removeItem(r);else return n&&Ye.schedule(()=>n(a)),a.state.data}}catch{await e.removeItem(r)}}}async function u(t,n){if(e!=null){let e=n.getQueryCache().find({queryKey:t});e&&await d(e)}}async function d(n){if(e!=null){let i=`${a}-${n.queryHash}`;e.setItem(i,await r({state:n.state,queryKey:n.queryKey,queryHash:n.queryHash,buster:t}))}}async function f(t,n,r){let i=s?Se(s,r):!0;if(i&&r.state.data===void 0&&e!=null){let e=await l(r.queryHash,e=>{r.setState({dataUpdatedAt:e.state.dataUpdatedAt,errorUpdatedAt:e.state.errorUpdatedAt}),(o===`always`||o===!0&&r.isStale())&&r.fetch()});if(e!==void 0)return Promise.resolve(e)}let a=await t(n);return i&&e!=null&&Ye.schedule(()=>{d(r)}),Promise.resolve(a)}async function p(){if(e?.entries){let t=`${a}-`,n=await e.entries();for(let[r,a]of n)if(r.startsWith(t)){let t;try{t=await i(a)}catch{await e.removeItem(r);continue}c(t)&&await e.removeItem(r)}}}async function m(t,n={}){let{exact:r,queryKey:o}=n;if(e?.entries){let n=`${a}-`,s=await e.entries();for(let[a,l]of s)if(a.startsWith(n)){let n;try{n=await i(l)}catch{await e.removeItem(a);continue}if(c(n)){await e.removeItem(a);continue}if(o){if(r){if(n.queryHash!==Te(o))continue}else if(!Ee(n.queryKey,o))continue}t.setQueryData(n.queryKey,n.state.data,{updatedAt:n.state.dataUpdatedAt})}}}async function h(t={}){let{exact:n,queryKey:r}=t;if(e?.entries){let t=await e.entries(),o=`${a}-`;for(let[a,s]of t)if(a.startsWith(o)){if(!r){await e.removeItem(a);continue}let t;try{t=await i(s)}catch{await e.removeItem(a);continue}if(n){if(t.queryHash!==Te(r))continue}else if(!Ee(t.queryKey,r))continue;await e.removeItem(a)}}}return{persisterFn:f,persistQuery:d,persistQueryByKey:u,retrieveQuery:l,persisterGc:p,restoreQueries:m,removeQueries:h}}var vhe,yhe=o((()=>{tr(),vhe=`tanstack-query`})),bhe=o((()=>{hhe(),ghe(),yhe()}));function xhe(e){return!!(e&&typeof e==`object`&&`__type`in e&&`value`in e&&e.__type===whe)}function She(e){return JSON.stringify(e,(e,t)=>typeof t==`bigint`?{__type:whe,value:t.toString()}:t)}function Che(e){return JSON.parse(e,(e,t)=>xhe(t)?BigInt(t.value):t)}var whe,The=o((()=>{whe=`__trails_bigint__`})),__,v_=o((()=>{bhe(),The(),F(),__=_he({storage:typeof window<`u`?window.localStorage:void 0,maxAge:D,prefix:`trails-query`,serialize:She,deserialize:Che})})),Ehe,Dhe,Ohe,khe,Ahe,jhe,Mhe=o((()=>{Ehe=`https://nodes.sequence.app`,Dhe=`https://indexer.sequence.app`,Ohe=`https://metadata.sequence.app`,khe=`https://trails-api.sequence.app`,Ahe=`10c5ac56159da00924d110c07c3f6e3a`,jhe=`0.05`}));function Nhe(){return Ihe}function Phe(e){Object.assign(x_,e)}function y_(e){return e?x_[e]:x_}function Fhe(){let e=b_(`CF_PAGES_COMMIT_SHA`),t=b_(`VITE_COMMIT_SHA`);return e&&console.log(`[trails-sdk][config] commit hash from CF_PAGES_COMMIT_SHA: ${e}`),t&&console.log(`[trails-sdk][config] commit hash from VITE_COMMIT_SHA: ${t}`),e||t}function b_(e){if({}.env){let t={}.env[`VITE_${e}`];if(t!==void 0&&t!==``)return t;let n={}.env[e];if(n!==void 0&&n!==``)return n}if(typeof process<`u`){let t={}[e];if(t!==void 0&&t!==``)return t}}var x_,Ihe,S_=o((()=>{Mhe(),x_={trailsApiKey:``,sequenceIndexerUrl:Dhe,sequenceNodeGatewayUrl:Ehe,sequenceMetadataUrl:Ohe,trailsApiUrl:khe,walletConnectProjectId:Ahe,slippageTolerance:jhe,debug:!1,commitHash:void 0},x_.commitHash=Fhe(),Ihe=!1}));function C_(e){return e===Hhe}function Lhe(e){let t=e.toLowerCase();return t===`0x0000000000000000000000000000000000000000`||t===`0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`}function Rhe(e){let t=e.trim();return t===`11111111111111111111111111111111`||t===`So11111111111111111111111111111111111111112`}function w_(e){return C_(e)?B_:l_}function T_(e,t){if(!e)return!1;let n=e.trim();return t!=null&&C_(t)?Rhe(n):t!=null&&!C_(t)?Lhe(n):Lhe(n)?!0:Nhe()&&Rhe(n)}function E_(e,t){return!e||!t?!1:e.toLowerCase()===t.toLowerCase()}function zhe(e,t){return!e||!t?!1:e.trim()===t.trim()}function D_(e,t,n){return!e||!t?!1:n!=null&&C_(n)?zhe(e,t):E_(e,t)}function O_(e){return e?E_(e,l_):!1}function k_(e){return/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e)}function Bhe(e){return yu(e)}function Vhe(e){let t=e.trim();return Bhe(t)||k_(t)}function A_(e,t){if(!e||!t)return!1;let n=e.trim(),r=t.trim(),i=k_(n),a=k_(r);return i||a?i===a?n===r:!1:E_(n,r)}function j_(e,t=6,n=4){if(!e)return``;let r=e;try{r=gu(e)}catch{r=e}return`${r.slice(0,t)}…${r.slice(-n)}`}var Hhe,M_,N_=o((()=>{m_(),S_(),U_(),Hhe=101,M_=e=>(e??``).toLowerCase()}));function P_(e){return e===101}function Uhe(e){return e===101||e===792703809}function Whe(e,t){return e?t===F_.SOLANA?/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e):yu(e):!1}var F_,Ghe,I_=o((()=>{m_(),F_={EVM:`EVM`,SOLANA:`SOLANA`},Ghe=`0x0000000000000000000000000000000000000000`,F_.EVM,F_.SOLANA,F_.EVM,F_.SOLANA}));function Khe(e){let t=e.trim();return H_.find(e=>zhe(e.mint,t))}function qhe(e){return{symbol:e.symbol,name:e.name,decimals:e.decimals,contractAddress:e.mint,chainId:101,chainName:Yhe,tokenId:e.tokenId,imageUrl:e.imageUrl,isNativeToken:e.isNativeToken||void 0}}function L_(e){let t=Khe(e);return t?qhe(t):null}function R_(){return H_.map(e=>qhe(e))}function z_(e){return e?Khe(e)?.isStablecoin??!1:!1}function Jhe(e){if(!T_(e.contractAddress,e.chainId))return z_(e.contractAddress)?1:void 0}var Yhe,B_,Xhe,Zhe,Qhe,$he,V_,H_,ege=o((()=>{I_(),N_(),Yhe=`Solana`,B_=`11111111111111111111111111111111`,Xhe=`EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`,Zhe=`Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB`,Qhe=`2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo`,$he={chainId:1,tokenAddress:`0xD31a59c85AE9D8edEFeC411D448f90841571b89c`},V_={SOL:`https://assets.coingecko.com/coins/images/4128/standard/solana.png?1718769756`,USDC:`https://assets.sequence.info/images/tokens/large/1/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.webp`,USDT:`https://assets.sequence.info/images/tokens/large/1/0xdac17f958d2ee523a2206206994597c13d831ec7.webp`,PYUSD:`https://assets.coingecko.com/coins/images/31212/standard/PYUSD_Logo_%282x%29.png`},H_=[{mint:B_,symbol:`SOL`,name:`Solana`,decimals:9,tokenId:`SOL-solana`,imageUrl:V_.SOL,isNativeToken:!0,isStablecoin:!1},{mint:Xhe,symbol:`USDC`,name:`USD Coin`,decimals:6,tokenId:`USDC-solana`,imageUrl:V_.USDC,isNativeToken:!1,isStablecoin:!0},{mint:Zhe,symbol:`USDT`,name:`USDT`,decimals:6,tokenId:`USDT-solana`,imageUrl:V_.USDT,isNativeToken:!1,isStablecoin:!0},{mint:Qhe,symbol:`PYUSD`,name:`PayPal USD`,decimals:6,tokenId:`PYUSD-solana`,imageUrl:V_.PYUSD,isNativeToken:!1,isStablecoin:!0}]})),tge,U_=o((()=>{ege(),tge=792703809}));function W_(e){try{return typeof window>`u`?null:new URLSearchParams(window.location.search).get(e)}catch{return null}}var nge=o((()=>{})),G_=o((()=>{S_()}));function rge(e){q_!==e&&(q_=e)}function ige(){return q_||W_(`debug`)===`true`}function K_(){let e=b_(`TEST_LOG_CONSOLE`);return e&&e in J_?J_[e]:W_(`log`)===`true`||ige()?J_.trace:-1}var q_,J_,K,age=o((()=>{nge(),G_(),q_=!1,J_={error:0,warn:1,info:2,log:3,debug:4,trace:5},K={get _enabled(){return W_(`log`)===`true`||ige()},console:{log:(...e)=>{K_()<J_.log||console.log(...e)},error:(...e)=>{K_()<J_.error||console.error(...e)},warn:(...e)=>{K_()<J_.warn||console.warn(...e)},info:(...e)=>{K_()<J_.info||console.info(...e)},debug:(...e)=>{K_()<J_.debug||console.debug(...e)},trace:(...e)=>{K_()<J_.trace||console.trace(...e)},time:(...e)=>{K_()<J_.log||console.time(...e)},timeEnd:(...e)=>{K_()<J_.log||console.timeEnd(...e)}}}})),Y_=o((()=>{age()}));function oge(e){return{token:{chainId:e.chainId,tokenAddress:e.tokenAddress,tokenSymbol:e.tokenSymbol},priceUsd:1,updatedAt:new Date().toISOString()}}function X_(e){return{chainId:e.chainId,tokenAddress:e.tokenAddress||e.contractAddress||`0x0000000000000000000000000000000000000000`,tokenSymbol:e.tokenSymbol||e.tokenId||e.tokenID||e.symbol}}function Z_(e){let t=Number(e.chainId||0),n=e.tokenAddress||`0x0000000000000000000000000000000000000000`;return`${P_(t)?n:n.toLowerCase()}-${t}-${(e.tokenSymbol||``).toUpperCase()}`}function sge(e){return P_(Number(e.chainId))&&T_(e.tokenAddress||`0x0000000000000000000000000000000000000000`,e.chainId)}function cge(e){return{chainId:dge,tokenAddress:fge,tokenSymbol:e.tokenSymbol||`SOL`}}function lge(e,t){let n=X_(e.token);return Number(n.chainId)===dge&&n.tokenAddress.toLowerCase()===fge.toLowerCase()?{...e,token:{chainId:t.chainId,tokenAddress:t.tokenAddress,tokenSymbol:t.tokenSymbol||e.token.tokenSymbol}}:e}async function uge(e,t){if(!e)throw Error(`Trails client is required`);if(t.length===0)return[];let n=[],r=[];for(let e of t)P_(Number(e.chainId))&&z_(e.tokenAddress)?n.push(oge(e)):r.push(e);if(r.length===0)return n;try{let t=r.find(sge),i=t?r.map(e=>sge(e)?cge(e):e):r,a=(await e.getTokenPrices({tokens:i}))?.tokenPrices||[],o=t?a.map(e=>lge(e,t)):a;return[...n,...o]}catch(e){throw K.console.error(`[trails-sdk] Failed to fetch token prices:`,e),e}}var dge,fge,pge=o((()=>{m_(),U_(),Y_(),I_(),N_(),dge=$he.chainId,fge=$he.tokenAddress}));function mge(e){let t=new Map;for(let n of e){let e=X_(n),r=Z_(e);t.has(r)||t.set(r,e)}return Array.from(t.values()).sort((e,t)=>Z_(e).localeCompare(Z_(t)))}function hge(e){return typeof e==`object`&&!!e&&`chainId`in e&&typeof e.chainId==`number`&&`tokenAddress`in e&&typeof e.tokenAddress==`string`&&(!(`tokenSymbol`in e)||typeof e.tokenSymbol==`string`)}function gge(e){if(e[0]!==wge||e[1]!==Tge)return null;let t=e[2];return!Array.isArray(t)||!t.every(hge)?null:[...t]}function _ge(e){return e?Date.now()-e<$_:!1}function vge(e,t){if(e)return e.find(e=>Z_(X_(e.token))===t)??null}function yge(e,t){return e.getQueryCache().findAll({queryKey:ev.batch()}).flatMap(e=>{let n=gge(e.queryKey);return n?.some(e=>Z_(e)===t)?[{queryKey:e.queryKey,tokens:n,data:Array.isArray(e.state.data)?e.state.data:void 0,dataUpdatedAt:e.state.dataUpdatedAt,fetchStatus:e.state.fetchStatus}]:[]})}function bge({queryClient:e,trailsClient:t,tokens:n,prices:r}){let i=new Map(r.map(e=>[Z_(X_(e.token)),e]));for(let r of n){let n=Z_(r);e.setQueryData(ev.byToken(r,t,e).queryKey,i.get(n)??null)}}function xge(e,t){if(!t)return{price:void 0,updatedAt:void 0};let n=Z_(X_(t)),r=yge(e,n).filter(e=>e.data!==void 0).sort((e,t)=>t.dataUpdatedAt-e.dataUpdatedAt)[0];return r?.data?{price:vge(r.data,n),updatedAt:r.dataUpdatedAt||void 0}:{price:void 0,updatedAt:void 0}}async function Sge({queryClient:e,trailsClient:t,token:n}){let r=Z_(n),i=yge(e,r).filter(e=>e.fetchStatus===`fetching`).sort((e,t)=>e.tokens.length-t.tokens.length)[0];if(i)try{return vge(await e.fetchQuery(ev.byTokens(i.tokens,t,e)),r)??null}catch{}let a=yge(e,r).filter(e=>e.data!==void 0&&_ge(e.dataUpdatedAt)).sort((e,t)=>t.dataUpdatedAt-e.dataUpdatedAt)[0];return a?.data?vge(a.data,r)??null:(await uge(t,[n]))[0]??null}async function Cge(e,t){return h_.ensureQueryData(ev.byToken(t,e,h_))}async function Q_(e,t){return t.length===0?[]:h_.ensureQueryData(ev.byTokens(t,e,h_))}var wge,Tge,Ege,$_,Dge,ev,tv=o((()=>{zr(),F(),g_(),Gr(),v_(),pge(),wge=`tokenPrices`,Tge=`batch`,Ege=`single`,$_=90*w,Dge=90*w,ev={all:[wge],batch:()=>[...ev.all,Tge],single:()=>[...ev.all,Ege],byTokens:(e,t,n=h_)=>{let r=mge(e),i=r.length>0&&!!t;return Nr({queryKey:[...ev.batch(),r],queryFn:i?async()=>{if(!t)throw Error(`Trails client is required`);let e=await uge(t,r);return bge({queryClient:n,trailsClient:t,tokens:r,prices:e}),e}:Ve,staleTime:$_,gcTime:Dge,retry:Ur(2),retryDelay:N,persister:__.persisterFn})},byToken:(e,t,n=h_)=>{let r=e?X_(e):null,i=r?Z_(r):null,a=!!r&&!!t;return Nr({queryKey:[...ev.single(),i],queryFn:a?async()=>{if(!r||!t)throw Error(`Token price query requires a token and Trails client`);return Sge({queryClient:n,trailsClient:t,token:r})}:Ve,staleTime:$_,gcTime:Dge,retry:Ur(2),retryDelay:N,persister:__.persisterFn})}}})),nv,rv,iv,av,ov,sv,Oge,cv,kge,Age,jge,lv,Mge,Nge,Pge,Fge,Ige,Lge,Rge,zge,Bge,Vge,Hge,Uge,Wge,Gge,Kge,qge,Jge,Yge,Xge,Zge,Qge,$ge,e_e,t_e,n_e,r_e,i_e,a_e,o_e,s_e,c_e,l_e,u_e,d_e,f_e,p_e,m_e,h_e,g_e,__e,v_e,y_e,b_e=o((()=>{Zr(),nv=class{constructor(e,t){G(this,`hostname`,void 0),G(this,`fetch`,void 0),G(this,`path`,`/rpc/TrailsOnramp/`),G(this,`queryKey`,{getMeldServiceProviders:e=>[`TrailsOnramp`,`getMeldServiceProviders`,e],getMeldCountryDefaults:e=>[`TrailsOnramp`,`getMeldCountryDefaults`,e],getMeldFiatCurrencies:e=>[`TrailsOnramp`,`getMeldFiatCurrencies`,e],getMeldPaymentMethods:e=>[`TrailsOnramp`,`getMeldPaymentMethods`,e],getMeldCryptoCurrencies:e=>[`TrailsOnramp`,`getMeldCryptoCurrencies`,e],getMeldPurchaseLimits:e=>[`TrailsOnramp`,`getMeldPurchaseLimits`,e],getMeldQuote:e=>[`TrailsOnramp`,`getMeldQuote`,e],createMeldWidgetSession:e=>[`TrailsOnramp`,`createMeldWidgetSession`,e],getMeldTransaction:e=>[`TrailsOnramp`,`getMeldTransaction`,e],searchMeldTransactions:e=>[`TrailsOnramp`,`searchMeldTransactions`,e],createMeldBankLinkingConnection:e=>[`TrailsOnramp`,`createMeldBankLinkingConnection`,e],getMeshIntegrations:e=>[`TrailsOnramp`,`getMeshIntegrations`,e],getMeshSupportedTokens:e=>[`TrailsOnramp`,`getMeshSupportedTokens`,e],createMeshLinkToken:e=>[`TrailsOnramp`,`createMeshLinkToken`,e],getBluvoClientConfig:e=>[`TrailsOnramp`,`getBluvoClientConfig`,e],getBluvoExchanges:e=>[`TrailsOnramp`,`getBluvoExchanges`,e],getBluvoOAuthURL:e=>[`TrailsOnramp`,`getBluvoOAuthURL`,e],getBluvoWallet:e=>[`TrailsOnramp`,`getBluvoWallet`,e],pingBluvoWallet:e=>[`TrailsOnramp`,`pingBluvoWallet`,e],getBluvoWithdrawBalances:e=>[`TrailsOnramp`,`getBluvoWithdrawBalances`,e],createBluvoWithdrawalQuote:e=>[`TrailsOnramp`,`createBluvoWithdrawalQuote`,e],executeBluvoWithdrawal:e=>[`TrailsOnramp`,`executeBluvoWithdrawal`,e],getBluvoTransaction:e=>[`TrailsOnramp`,`getBluvoTransaction`,e],deleteBluvoWallet:e=>[`TrailsOnramp`,`deleteBluvoWallet`,e]}),G(this,`getMeldServiceProviders`,(e,t,n)=>this.fetch(this.url(`GetMeldServiceProviders`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldServiceProvidersResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldCountryDefaults`,(e,t,n)=>this.fetch(this.url(`GetMeldCountryDefaults`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldCountryDefaultsResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldFiatCurrencies`,(e,t,n)=>this.fetch(this.url(`GetMeldFiatCurrencies`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldFiatCurrenciesResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldPaymentMethods`,(e,t,n)=>this.fetch(this.url(`GetMeldPaymentMethods`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldPaymentMethodsResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldCryptoCurrencies`,(e,t,n)=>this.fetch(this.url(`GetMeldCryptoCurrencies`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldCryptoCurrenciesResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldPurchaseLimits`,(e,t,n)=>this.fetch(this.url(`GetMeldPurchaseLimits`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldPurchaseLimitsResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldQuote`,(e,t,n)=>this.fetch(this.url(`GetMeldQuote`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldQuoteResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`createMeldWidgetSession`,(e,t,n)=>this.fetch(this.url(`CreateMeldWidgetSession`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`CreateMeldWidgetSessionResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldTransaction`,(e,t,n)=>this.fetch(this.url(`GetMeldTransaction`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldTransactionResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`searchMeldTransactions`,(e,t,n)=>this.fetch(this.url(`SearchMeldTransactions`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`SearchMeldTransactionsResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`createMeldBankLinkingConnection`,(e,t,n)=>this.fetch(this.url(`CreateMeldBankLinkingConnection`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`CreateMeldBankLinkingConnectionResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeshIntegrations`,(e,t,n)=>this.fetch(this.url(`GetMeshIntegrations`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeshIntegrationsResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeshSupportedTokens`,(e,t,n)=>this.fetch(this.url(`GetMeshSupportedTokens`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeshSupportedTokensResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`createMeshLinkToken`,(e,t,n)=>this.fetch(this.url(`CreateMeshLinkToken`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`CreateMeshLinkTokenResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getBluvoClientConfig`,(e,t,n)=>this.fetch(this.url(`GetBluvoClientConfig`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetBluvoClientConfigResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getBluvoExchanges`,(e,t,n)=>this.fetch(this.url(`GetBluvoExchanges`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetBluvoExchangesResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getBluvoOAuthURL`,(e,t,n)=>this.fetch(this.url(`GetBluvoOAuthURL`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetBluvoOAuthURLResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getBluvoWallet`,(e,t,n)=>this.fetch(this.url(`GetBluvoWallet`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetBluvoWalletResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`pingBluvoWallet`,(e,t,n)=>this.fetch(this.url(`PingBluvoWallet`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`PingBluvoWalletResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getBluvoWithdrawBalances`,(e,t,n)=>this.fetch(this.url(`GetBluvoWithdrawBalances`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetBluvoWithdrawBalancesResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`createBluvoWithdrawalQuote`,(e,t,n)=>this.fetch(this.url(`CreateBluvoWithdrawalQuote`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`CreateBluvoWithdrawalQuoteResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`executeBluvoWithdrawal`,(e,t,n)=>this.fetch(this.url(`ExecuteBluvoWithdrawal`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`ExecuteBluvoWithdrawalResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getBluvoTransaction`,(e,t,n)=>this.fetch(this.url(`GetBluvoTransaction`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetBluvoTransactionResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`deleteBluvoWallet`,(e,t,n)=>this.fetch(this.url(`DeleteBluvoWallet`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`DeleteBluvoWalletResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),this.hostname=e.replace(/\/*$/,``),this.fetch=(e,n)=>t(e,n)}url(e){return this.hostname+this.path+e}},rv=(e=`{}`,t={},n=null)=>({method:`POST`,headers:{...t,"Content-Type":`application/json`,[v_e]:y_e},body:e,signal:n}),iv=e=>e.text().then(t=>{let n;try{n=JSON.parse(t)}catch(n){throw lv.new({status:e.status,cause:`JSON.parse(): ${n instanceof Error?n.message:String(n)}: response text: ${t}`})}if(!e.ok){let e=typeof n.code==`number`?n.code:0;throw(__e[e]||sv).new(n)}return n}),av=e=>JSON.stringify(e),ov=(e,t=``)=>{let n=e;if(typeof e==`string`)try{n=JSON.parse(e)}catch(e){throw lv.new({cause:`JsonDecode: JSON.parse failed: ${e.message}`})}return n},sv=class e extends Error{constructor(t={}){super(t.message),G(this,`code`,void 0),G(this,`status`,void 0),this.name=t.name||`WebrpcEndpointError`,this.code=typeof t.code==`number`?t.code:0,this.message=t.message||`endpoint error`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}static new(e){return new this({message:e.message,code:e.code,status:e.status,cause:e.cause})}},Oge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcEndpoint`,this.code=typeof t.code==`number`?t.code:0,this.message=t.message||`endpoint error`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},cv=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcRequestFailed`,this.code=typeof t.code==`number`?t.code:-1,this.message=t.message||`request failed`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},kge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadRoute`,this.code=typeof t.code==`number`?t.code:-2,this.message=t.message||`bad route`,this.status=typeof t.status==`number`?t.status:404,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Age=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadMethod`,this.code=typeof t.code==`number`?t.code:-3,this.message=t.message||`bad method`,this.status=typeof t.status==`number`?t.status:405,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},jge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadRequest`,this.code=typeof t.code==`number`?t.code:-4,this.message=t.message||`bad request`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},lv=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadResponse`,this.code=typeof t.code==`number`?t.code:-5,this.message=t.message||`bad response`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Mge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcServerPanic`,this.code=typeof t.code==`number`?t.code:-6,this.message=t.message||`server panic`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Nge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcInternalError`,this.code=typeof t.code==`number`?t.code:-7,this.message=t.message||`internal error`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Pge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcClientAborted`,this.code=typeof t.code==`number`?t.code:-8,this.message=t.message||`request aborted by client`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Fge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcStreamLost`,this.code=typeof t.code==`number`?t.code:-9,this.message=t.message||`stream lost`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Ige=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcStreamFinished`,this.code=typeof t.code==`number`?t.code:-10,this.message=t.message||`stream finished`,this.status=typeof t.status==`number`?t.status:200,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Lge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`Unauthorized`,this.code=typeof t.code==`number`?t.code:1e3,this.message=t.message||`Unauthorized access`,this.status=typeof t.status==`number`?t.status:401,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Rge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`PermissionDenied`,this.code=typeof t.code==`number`?t.code:1001,this.message=t.message||`Permission denied`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},zge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`SessionExpired`,this.code=typeof t.code==`number`?t.code:1002,this.message=t.message||`Session expired`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Bge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`MethodNotFound`,this.code=typeof t.code==`number`?t.code:1003,this.message=t.message||`Method not found`,this.status=typeof t.status==`number`?t.status:404,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Vge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`RequestConflict`,this.code=typeof t.code==`number`?t.code:1004,this.message=t.message||`Conflict with target resource`,this.status=typeof t.status==`number`?t.status:409,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Hge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`Aborted`,this.code=typeof t.code==`number`?t.code:1005,this.message=t.message||`Request aborted`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Uge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`Geoblocked`,this.code=typeof t.code==`number`?t.code:1006,this.message=t.message||`Geoblocked region`,this.status=typeof t.status==`number`?t.status:451,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Wge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`RateLimited`,this.code=typeof t.code==`number`?t.code:1007,this.message=t.message||`Rate-limited. Please slow down.`,this.status=typeof t.status==`number`?t.status:429,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Gge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`ProjectNotFound`,this.code=typeof t.code==`number`?t.code:1008,this.message=t.message||`Project not found`,this.status=typeof t.status==`number`?t.status:401,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Kge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`AccessKeyNotFound`,this.code=typeof t.code==`number`?t.code:1101,this.message=t.message||`Access key not found`,this.status=typeof t.status==`number`?t.status:401,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},qge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`AccessKeyMismatch`,this.code=typeof t.code==`number`?t.code:1102,this.message=t.message||`Access key mismatch`,this.status=typeof t.status==`number`?t.status:409,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Jge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`InvalidOrigin`,this.code=typeof t.code==`number`?t.code:1103,this.message=t.message||`Invalid origin for Access Key`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Yge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`InvalidService`,this.code=typeof t.code==`number`?t.code:1104,this.message=t.message||`Service not enabled for Access key`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Xge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`UnauthorizedUser`,this.code=typeof t.code==`number`?t.code:1105,this.message=t.message||`Unauthorized user`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Zge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`QuotaExceeded`,this.code=typeof t.code==`number`?t.code:1200,this.message=t.message||`Quota request exceeded`,this.status=typeof t.status==`number`?t.status:429,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Qge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`QuotaRateLimit`,this.code=typeof t.code==`number`?t.code:1201,this.message=t.message||`Quota rate limit exceeded`,this.status=typeof t.status==`number`?t.status:429,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},$ge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`NoDefaultKey`,this.code=typeof t.code==`number`?t.code:1300,this.message=t.message||`No default access key found`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},e_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`MaxAccessKeys`,this.code=typeof t.code==`number`?t.code:1301,this.message=t.message||`Access keys limit reached`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},t_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`AtLeastOneKey`,this.code=typeof t.code==`number`?t.code:1302,this.message=t.message||`You need at least one Access Key`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},n_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`Timeout`,this.code=typeof t.code==`number`?t.code:1900,this.message=t.message||`Request timed out`,this.status=typeof t.status==`number`?t.status:408,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},r_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`InvalidArgument`,this.code=typeof t.code==`number`?t.code:2e3,this.message=t.message||`Invalid argument`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},i_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`Unexpected`,this.code=typeof t.code==`number`?t.code:2001,this.message=t.message||`Unexpected server error`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},a_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`Unavailable`,this.code=typeof t.code==`number`?t.code:2002,this.message=t.message||`Unavailable resource`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},o_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`QueryFailed`,this.code=typeof t.code==`number`?t.code:2003,this.message=t.message||`Query failed`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},s_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`IntentStatus`,this.code=typeof t.code==`number`?t.code:2004,this.message=t.message||`Invalid intent status`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},c_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`IntentProtocolDeprecated`,this.code=typeof t.code==`number`?t.code:3e3,this.message=t.message||`Requested intent protocol version is outdated/deprecated. Please upgrade your Trails SDK, see https://docs.sequence.build for more information.`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},l_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`NotFound`,this.code=typeof t.code==`number`?t.code:8e3,this.message=t.message||`Resource not found`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},u_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`UnsupportedNetwork`,this.code=typeof t.code==`number`?t.code:8008,this.message=t.message||`Unsupported network`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},d_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`ClientOutdated`,this.code=typeof t.code==`number`?t.code:8009,this.message=t.message||`Client is outdated`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},f_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`IntentsSkipped`,this.code=typeof t.code==`number`?t.code:7e3,this.message=t.message||`Intents skipped as client is attempting a transaction that does not require intents`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},p_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`QuoteExpired`,this.code=typeof t.code==`number`?t.code:7001,this.message=t.message||`Intent quote has expired. Please try again.`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},m_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`HighPriceImpact`,this.code=typeof t.code==`number`?t.code:7002,this.message=t.message||`Quote unavailable due to high price impact`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},h_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`IntentsDisabled`,this.code=typeof t.code==`number`?t.code:9e3,this.message=t.message||`Intents service is currently unavailable`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},g_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`ChainNodeHealth`,this.code=typeof t.code==`number`?t.code:9001,this.message=t.message||`Intent quote is unavailable due to interrupted chain node access`,this.status=typeof t.status==`number`?t.status:503,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},__e={0:Oge,[-1]:cv,[-2]:kge,[-3]:Age,[-4]:jge,[-5]:lv,[-6]:Mge,[-7]:Nge,[-8]:Pge,[-9]:Fge,[-10]:Ige,1e3:Lge,1001:Rge,1002:zge,1003:Bge,1004:Vge,1005:Hge,1006:Uge,1007:Wge,1008:Gge,1101:Kge,1102:qge,1103:Jge,1104:Yge,1105:Xge,1200:Zge,1201:Qge,1300:$ge,1301:e_e,1302:t_e,1900:n_e,2e3:r_e,2001:i_e,2002:a_e,2003:o_e,2004:s_e,3e3:c_e,8e3:l_e,8008:u_e,8009:d_e,7e3:f_e,7001:p_e,7002:m_e,9e3:h_e,9001:g_e},v_e=`Webrpc`,y_e=`webrpc@v0.38.0;gen-typescript@v0.29.0;trails-api@v1-26.6.23-2459f503`})),x_e=o((()=>{b_e()}));function uv(e,t){if(typeof t!=`object`||!t)return t;let n=w_e[e]||[];if(!n.length)return t;for(let e of n){if(Array.isArray(e)){let[n,r]=e;if(n.endsWith(`[]`)){let e=t[n.slice(0,-2)];if(Array.isArray(e))for(let t=0;t<e.length;t++)e[t]=uv(r,e[t])}else if(t[n])if(r.endsWith(`[]`)){let e=r.slice(0,-2),i=t[n];if(Array.isArray(i))for(let t=0;t<i.length;t++)i[t]=uv(e,i[t])}else t[n]=uv(r,t[n]);continue}if(e.endsWith(`[]`)){let n=e.slice(0,-2),r=t[n];if(Array.isArray(r))for(let e=0;e<r.length;e++){let t=r[e];if(typeof t==`string`)try{r[e]=BigInt(t)}catch{throw Ev.new({cause:`Invalid bigint value for ${n}[${e}]: ${t}`})}}continue}let n=t[e];if(typeof n==`string`)try{t[e]=BigInt(n)}catch{throw Ev.new({cause:`Invalid bigint value for ${e}: ${n}`})}}return t}var dv,fv,pv,mv,hv,gv,_v,vv,yv,S_e,C_e,bv,xv,w_e,Sv,Cv,wv,T_e,Tv,E_e,D_e,O_e,Ev,k_e,A_e,j_e,M_e,N_e,P_e,F_e,I_e,L_e,R_e,z_e,B_e,V_e,H_e,U_e,W_e,G_e,K_e,q_e,J_e,Y_e,X_e,Z_e,Q_e,$_e,eve,tve,nve,rve,ive,ave,ove,sve,cve,lve,uve,dve,fve,pve,mve,hve,gve,_ve=o((()=>{Zr(),dv={SWAP:`SWAP`,FUND:`FUND`,EARN:`EARN`,PAY:`PAY`,WITHDRAW:`WITHDRAW`},fv={EXACT_INPUT:`EXACT_INPUT`,EXACT_OUTPUT:`EXACT_OUTPUT`},pv={AUTO:`AUTO`,CCTP:`CCTP`,GASZIP:`GASZIP`,HYPERLANE:`HYPERLANE`,LIFI:`LIFI`,LZ_OFT:`LZ_OFT`,LZ_TRANSFER:`LZ_TRANSFER`,OIF:`OIF`,RELAY:`RELAY`,SOMNIA_EXCHANGE:`SOMNIA_EXCHANGE`,SOMNIA_SWAP:`SOMNIA_SWAP`,SUSHI:`SUSHI`,WETH:`WETH`,ZEROX:`ZEROX`},mv={WALLET:`WALLET`,DIRECT_TRANSFER:`DIRECT_TRANSFER`,ONRAMP_MESH:`ONRAMP_MESH`,ONRAMP_MELD:`ONRAMP_MELD`,ONRAMP_BLUVO:`ONRAMP_BLUVO`},hv={SOLANA:`SOLANA`,TRON:`TRON`},gv={ORIGIN:`ORIGIN`,DESTINATION:`DESTINATION`},_v={PENDING:`PENDING`,DEPOSITED:`DEPOSITED`,FILLED:`FILLED`,REFUNDED:`REFUNDED`,FAILED:`FAILED`},vv={v1:`v1`,v1_5:`v1.5`},yv={QUOTED:`QUOTED`,COMMITTED:`COMMITTED`,EXECUTING:`EXECUTING`,FAILED:`FAILED`,SUCCEEDED:`SUCCEEDED`,ABORTED:`ABORTED`,REFUNDED:`REFUNDED`,INVALID:`INVALID`},S_e={UNKNOWN:`UNKNOWN`,ON_HOLD:`ON_HOLD`,PENDING:`PENDING`,RELAYING:`RELAYING`,SENT:`SENT`,ERRORED:`ERRORED`,MINING:`MINING`,SUCCEEDED:`SUCCEEDED`,FAILED:`FAILED`,ABORTED:`ABORTED`,REVERTED:`REVERTED`},C_e=class{constructor(e,t){G(this,`hostname`,void 0),G(this,`fetch`,void 0),G(this,`path`,`/rpc/Trails/`),G(this,`queryKey`,{ping:()=>[`Trails`,`ping`],runtimeStatus:()=>[`Trails`,`runtimeStatus`],clock:()=>[`Trails`,`clock`],quoteIntent:e=>[`Trails`,`quoteIntent`,e],quoteIntentEdge:e=>[`Trails`,`quoteIntentEdge`,e],getEdgeStatus:e=>[`Trails`,`getEdgeStatus`,e],getEdges:()=>[`Trails`,`getEdges`],commitIntent:e=>[`Trails`,`commitIntent`,e],executeIntent:e=>[`Trails`,`executeIntent`,e],retryIntent:e=>[`Trails`,`retryIntent`,e],waitIntentReceipt:e=>[`Trails`,`waitIntentReceipt`,e],getIntentReceipt:e=>[`Trails`,`getIntentReceipt`,e],getIntent:e=>[`Trails`,`getIntent`,e],searchIntents:e=>[`Trails`,`searchIntents`,e],getIntentHistory:e=>[`Trails`,`getIntentHistory`,e],abortIntent:e=>[`Trails`,`abortIntent`,e],prepareIntentRecovery:e=>[`Trails`,`prepareIntentRecovery`,e],buildIntentRecoveryTransaction:e=>[`Trails`,`buildIntentRecoveryTransaction`,e],buildOIFRefundTransaction:e=>[`Trails`,`buildOIFRefundTransaction`,e],getChains:e=>[`Trails`,`getChains`,e],getExactOutputRoutes:e=>[`Trails`,`getExactOutputRoutes`,e],getExactInputRoutes:e=>[`Trails`,`getExactInputRoutes`,e],getTokenList:e=>[`Trails`,`getTokenList`,e],getTokenPrices:e=>[`Trails`,`getTokenPrices`,e],getExchangeRate:e=>[`Trails`,`getExchangeRate`,e],getCountryList:()=>[`Trails`,`getCountryList`],getTrailsContracts:()=>[`Trails`,`getTrailsContracts`],getProtocolContracts:e=>[`Trails`,`getProtocolContracts`,e],getSupportedIntentProtocols:()=>[`Trails`,`getSupportedIntentProtocols`],getDefaultIntentProtocol:()=>[`Trails`,`getDefaultIntentProtocol`],getEarnPools:e=>[`Trails`,`getEarnPools`,e],yieldGetProviders:e=>[`Trails`,`yieldGetProviders`,e],yieldGetProvider:e=>[`Trails`,`yieldGetProvider`,e],yieldGetNetworks:e=>[`Trails`,`yieldGetNetworks`,e],yieldGetMarkets:e=>[`Trails`,`yieldGetMarkets`,e],yieldGetMarketById:e=>[`Trails`,`yieldGetMarketById`,e],yieldGetAggregateBalances:e=>[`Trails`,`yieldGetAggregateBalances`,e],yieldCreateEnterAction:e=>[`Trails`,`yieldCreateEnterAction`,e],yieldCreateExitAction:e=>[`Trails`,`yieldCreateExitAction`,e],getFiatCurrencyList:()=>[`Trails`,`getFiatCurrencyList`],getIntentTransactionHistory:e=>[`Trails`,`getIntentTransactionHistory`,e]}),G(this,`ping`,(e,t)=>this.fetch(this.url(`Ping`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`PingResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`runtimeStatus`,(e,t)=>this.fetch(this.url(`RuntimeStatus`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`RuntimeStatusResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`clock`,(e,t)=>this.fetch(this.url(`Clock`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`ClockResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`quoteIntent`,(e,t,n)=>this.fetch(this.url(`QuoteIntent`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`QuoteIntentResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`quoteIntentEdge`,(e,t,n)=>this.fetch(this.url(`QuoteIntentEdge`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`QuoteIntentEdgeResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getEdgeStatus`,(e,t,n)=>this.fetch(this.url(`GetEdgeStatus`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetEdgeStatusResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getEdges`,(e,t)=>this.fetch(this.url(`GetEdges`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`GetEdgesResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`commitIntent`,(e,t,n)=>this.fetch(this.url(`CommitIntent`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`CommitIntentResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`executeIntent`,(e,t,n)=>this.fetch(this.url(`ExecuteIntent`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`ExecuteIntentResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`retryIntent`,(e,t,n)=>this.fetch(this.url(`RetryIntent`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`RetryIntentResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`waitIntentReceipt`,(e,t,n)=>this.fetch(this.url(`WaitIntentReceipt`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`WaitIntentReceiptResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getIntentReceipt`,(e,t,n)=>this.fetch(this.url(`GetIntentReceipt`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetIntentReceiptResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getIntent`,(e,t,n)=>this.fetch(this.url(`GetIntent`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetIntentResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`searchIntents`,(e,t,n)=>this.fetch(this.url(`SearchIntents`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`SearchIntentsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getIntentHistory`,(e,t,n)=>this.fetch(this.url(`GetIntentHistory`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetIntentHistoryResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`abortIntent`,(e,t,n)=>this.fetch(this.url(`AbortIntent`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`AbortIntentResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`prepareIntentRecovery`,(e,t,n)=>this.fetch(this.url(`PrepareIntentRecovery`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`PrepareIntentRecoveryResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`buildIntentRecoveryTransaction`,(e,t,n)=>this.fetch(this.url(`BuildIntentRecoveryTransaction`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`BuildIntentRecoveryTransactionResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`buildOIFRefundTransaction`,(e,t,n)=>this.fetch(this.url(`BuildOIFRefundTransaction`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`BuildOIFRefundTransactionResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getChains`,(e,t,n)=>this.fetch(this.url(`GetChains`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetChainsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getExactOutputRoutes`,(e,t,n)=>this.fetch(this.url(`GetExactOutputRoutes`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetExactOutputRoutesResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getExactInputRoutes`,(e,t,n)=>this.fetch(this.url(`GetExactInputRoutes`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetExactInputRoutesResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getTokenList`,(e,t,n)=>this.fetch(this.url(`GetTokenList`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetTokenListResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getTokenPrices`,(e,t,n)=>this.fetch(this.url(`GetTokenPrices`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetTokenPricesResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getExchangeRate`,(e,t,n)=>this.fetch(this.url(`GetExchangeRate`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetExchangeRateResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getCountryList`,(e,t)=>this.fetch(this.url(`GetCountryList`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`GetCountryListResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getTrailsContracts`,(e,t)=>this.fetch(this.url(`GetTrailsContracts`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`GetTrailsContractsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getProtocolContracts`,(e,t,n)=>this.fetch(this.url(`GetProtocolContracts`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetProtocolContractsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getSupportedIntentProtocols`,(e,t)=>this.fetch(this.url(`GetSupportedIntentProtocols`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`GetSupportedIntentProtocolsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getDefaultIntentProtocol`,(e,t)=>this.fetch(this.url(`GetDefaultIntentProtocol`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`GetDefaultIntentProtocolResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getEarnPools`,(e,t,n)=>this.fetch(this.url(`GetEarnPools`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetEarnPoolsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldGetProviders`,(e,t,n)=>this.fetch(this.url(`YieldGetProviders`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetYieldProvidersResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldGetProvider`,(e,t,n)=>this.fetch(this.url(`YieldGetProvider`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetYieldProviderResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldGetNetworks`,(e,t,n)=>this.fetch(this.url(`YieldGetNetworks`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetYieldNetworksResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldGetMarkets`,(e,t,n)=>this.fetch(this.url(`YieldGetMarkets`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetYieldMarketsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldGetMarketById`,(e,t,n)=>this.fetch(this.url(`YieldGetMarketById`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetYieldMarketByIdResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldGetAggregateBalances`,(e,t,n)=>this.fetch(this.url(`YieldGetAggregateBalances`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetYieldAggregateBalancesResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldCreateEnterAction`,(e,t,n)=>this.fetch(this.url(`YieldCreateEnterAction`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`CreateYieldActionResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldCreateExitAction`,(e,t,n)=>this.fetch(this.url(`YieldCreateExitAction`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`CreateYieldActionResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getFiatCurrencyList`,(e,t)=>this.fetch(this.url(`GetFiatCurrencyList`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`GetFiatCurrencyListResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getIntentTransactionHistory`,(e,t,n)=>this.fetch(this.url(`GetIntentTransactionHistory`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetIntentTransactionHistoryResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),this.hostname=e.replace(/\/*$/,``),this.fetch=(e,n)=>t(e,n)}url(e){return this.hostname+this.path+e}},bv=(e=`{}`,t={},n=null)=>({method:`POST`,headers:{...t,"Content-Type":`application/json`,[hve]:gve},body:e,signal:n}),xv=e=>e.text().then(t=>{let n;try{n=JSON.parse(t)}catch(n){throw Ev.new({status:e.status,cause:`JSON.parse(): ${n instanceof Error?n.message:String(n)}: response text: ${t}`})}if(!e.ok){let e=typeof n.code==`number`?n.code:0;throw(mve[e]||wv).new(n)}return n}),w_e={CommitIntentRequest:[[`intent`,`Intent`]],DepositIntentEntry:[`permitAmount`],DepositSignature:[`permitAmount`,[`selectedGasFeeOption`,`FeeOption`]],DepositTransaction:[`amount`,`value`],EdgeHandoff:[`amount`],EdgeQuoteRequest:[`originTokenAmount`],EdgeQuoteResponse:[`originTokenAmount`,[`handoff`,`EdgeHandoff`]],ExecuteIntentRequest:[[`depositSignature`,`DepositSignature`]],FeeOption:[`amount`],GasFeeOptions:[[`feeOptions`,`FeeOption[]`]],GetIntentHistoryResponse:[[`intents`,`IntentHistory[]`]],GetIntentReceiptResponse:[[`intentReceipt`,`IntentReceipt`]],GetIntentResponse:[[`intent`,`Intent`]],GetIntentTransactionHistoryResponse:[[`intents`,`IntentSummary[]`]],Intent:[[`quoteRequest`,`QuoteIntentRequest`],`salt`,[`depositTransaction`,`DepositTransaction`],[`edge`,`IntentEdgeMetadata`],[`originCalls`,`IntentCalls`],[`destinationCalls`,`IntentCalls`],[`originPrecondition`,`TransactionPrecondition`],[`destinationPrecondition`,`TransactionPrecondition`],[`originMetaTxn`,`MetaTxn`],[`destinationMetaTxn`,`MetaTxn`],[`quote`,`IntentProviderQuote`],[`fees`,`IntentFees`],[`gasFeeOptions`,`GasFeeOptions`]],IntentCalls:[`space`,`nonce`,[`calls`,`TransactionCall[]`]],IntentEdgeMetadata:[`edgeTokenAmount`],IntentFees:[[`originGas`,`IntentTransactionGasFee`],[`destinationGas`,`IntentTransactionGasFee`],[`provider`,`IntentProviderFees`],`feeTokenAmount`,`feeTokenTotal`,`gasFeeTotal`,`trailsFeeTotal`,`collectorFeeTotal`,`providerFeeTotal`,`totalFeeAmount`],IntentHistory:[[`receipt`,`IntentReceipt`]],IntentProviderFees:[`quoteProviderFee`,`trailsFee`,`quoteProviderWithTrailsFee`,`totalFeeAmount`],IntentProviderQuote:[`fromAmount`,`fromAmountMin`,`toAmount`,`toAmountMin`],IntentReceipt:[[`depositTransaction`,`IntentTransaction`],[`originTransaction`,`IntentTransaction`],[`destinationTransaction`,`IntentTransaction`],[`refundTransaction`,`IntentTransaction`],[`summary`,`IntentReceiptSummary`],[`edge`,`IntentEdgeMetadata`]],IntentReceiptSummary:[`originTokenAmount`,`quotedOriginTokenAmount`,`destinationTokenAmount`,`quotedDestinationTokenAmount`,[`edge`,`IntentEdgeMetadata`]],IntentSummary:[`originTokenAmount`,`quotedOriginTokenAmount`,`destinationTokenAmount`,`quotedDestinationTokenAmount`],IntentTransaction:[`tokenAmount`,`bridgeGas`,[`precondition`,`TransactionPrecondition`],[`depositIntentEntry`,`DepositIntentEntry`]],IntentTransactionGasFee:[`totalGasLimit`,`gasPrice`,`totalFeeAmount`,[`metaTxnFeeDetails`,`MetaTxnFeeDetails`]],MetaTxn:[`bridgeGas`],MetaTxnFeeDetails:[`estimatedGasLimit`,`feeNative`],PassThroughTransaction:[`amount`,`value`],PassthroughInfo:[[`passthroughTransaction`,`PassThroughTransaction`],[`quote`,`IntentProviderQuote`],[`fees`,`IntentFees`]],QuoteIntentEdgeRequest:[[`intent`,`QuoteIntentRequest`],[`edge`,`EdgeQuoteRequest`]],QuoteIntentEdgeResponse:[[`intent`,`Intent`],[`gasFeeOptions`,`GasFeeOptions`],[`passthrough`,`PassthroughInfo`],[`edge`,`EdgeQuoteResponse`]],QuoteIntentRequest:[`destinationCallValue`,`originTokenAmount`,`destinationTokenAmount`],QuoteIntentResponse:[[`intent`,`Intent`],[`gasFeeOptions`,`GasFeeOptions`],[`passthrough`,`PassthroughInfo`]],SearchIntentsResponse:[[`intents`,`Intent[]`]],TransactionCall:[`value`,`gasLimit`],TransactionPrecondition:[`minAmount`],WaitIntentReceiptResponse:[[`intentReceipt`,`IntentReceipt`]]},Sv=e=>JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t),Cv=(e,t=``)=>{let n=e;if(typeof e==`string`)try{n=JSON.parse(e)}catch(e){throw Ev.new({cause:`JsonDecode: JSON.parse failed: ${e.message}`})}return uv(t,n)},wv=class e extends Error{constructor(t={}){super(t.message),G(this,`code`,void 0),G(this,`status`,void 0),this.name=t.name||`WebrpcEndpointError`,this.code=typeof t.code==`number`?t.code:0,this.message=t.message||`endpoint error`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}static new(e){return new this({message:e.message,code:e.code,status:e.status,cause:e.cause})}},T_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcEndpoint`,this.code=typeof t.code==`number`?t.code:0,this.message=t.message||`endpoint error`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Tv=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcRequestFailed`,this.code=typeof t.code==`number`?t.code:-1,this.message=t.message||`request failed`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},E_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadRoute`,this.code=typeof t.code==`number`?t.code:-2,this.message=t.message||`bad route`,this.status=typeof t.status==`number`?t.status:404,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},D_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadMethod`,this.code=typeof t.code==`number`?t.code:-3,this.message=t.message||`bad method`,this.status=typeof t.status==`number`?t.status:405,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},O_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadRequest`,this.code=typeof t.code==`number`?t.code:-4,this.message=t.message||`bad request`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Ev=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadResponse`,this.code=typeof t.code==`number`?t.code:-5,this.message=t.message||`bad response`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},k_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcServerPanic`,this.code=typeof t.code==`number`?t.code:-6,this.message=t.message||`server panic`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},A_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcInternalError`,this.code=typeof t.code==`number`?t.code:-7,this.message=t.message||`internal error`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},j_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcClientAborted`,this.code=typeof t.code==`number`?t.code:-8,this.message=t.message||`request aborted by client`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},M_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcStreamLost`,this.code=typeof t.code==`number`?t.code:-9,this.message=t.message||`stream lost`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},N_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcStreamFinished`,this.code=typeof t.code==`number`?t.code:-10,this.message=t.message||`stream finished`,this.status=typeof t.status==`number`?t.status:200,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},P_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`Unauthorized`,this.code=typeof t.code==`number`?t.code:1e3,this.message=t.message||`Unauthorized access`,this.status=typeof t.status==`number`?t.status:401,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},F_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`PermissionDenied`,this.code=typeof t.code==`number`?t.code:1001,this.message=t.message||`Permission denied`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},I_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`SessionExpired`,this.code=typeof t.code==`number`?t.code:1002,this.message=t.message||`Session expired`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},L_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`MethodNotFound`,this.code=typeof t.code==`number`?t.code:1003,this.message=t.message||`Method not found`,this.status=typeof t.status==`number`?t.status:404,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},R_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`RequestConflict`,this.code=typeof t.code==`number`?t.code:1004,this.message=t.message||`Conflict with target resource`,this.status=typeof t.status==`number`?t.status:409,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},z_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`Aborted`,this.code=typeof t.code==`number`?t.code:1005,this.message=t.message||`Request aborted`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},B_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`Geoblocked`,this.code=typeof t.code==`number`?t.code:1006,this.message=t.message||`Geoblocked region`,this.status=typeof t.status==`number`?t.status:451,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},V_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`RateLimited`,this.code=typeof t.code==`number`?t.code:1007,this.message=t.message||`Rate-limited. Please slow down.`,this.status=typeof t.status==`number`?t.status:429,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},H_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`ProjectNotFound`,this.code=typeof t.code==`number`?t.code:1008,this.message=t.message||`Project not found`,this.status=typeof t.status==`number`?t.status:401,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},U_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`AccessKeyNotFound`,this.code=typeof t.code==`number`?t.code:1101,this.message=t.message||`Access key not found`,this.status=typeof t.status==`number`?t.status:401,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},W_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`AccessKeyMismatch`,this.code=typeof t.code==`number`?t.code:1102,this.message=t.message||`Access key mismatch`,this.status=typeof t.status==`number`?t.status:409,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},G_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`InvalidOrigin`,this.code=typeof t.code==`number`?t.code:1103,this.message=t.message||`Invalid origin for Access Key`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},K_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`InvalidService`,this.code=typeof t.code==`number`?t.code:1104,this.message=t.message||`Service not enabled for Access key`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},q_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`UnauthorizedUser`,this.code=typeof t.code==`number`?t.code:1105,this.message=t.message||`Unauthorized user`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},J_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`QuotaExceeded`,this.code=typeof t.code==`number`?t.code:1200,this.message=t.message||`Quota request exceeded`,this.status=typeof t.status==`number`?t.status:429,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Y_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`QuotaRateLimit`,this.code=typeof t.code==`number`?t.code:1201,this.message=t.message||`Quota rate limit exceeded`,this.status=typeof t.status==`number`?t.status:429,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},X_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`NoDefaultKey`,this.code=typeof t.code==`number`?t.code:1300,this.message=t.message||`No default access key found`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Z_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`MaxAccessKeys`,this.code=typeof t.code==`number`?t.code:1301,this.message=t.message||`Access keys limit reached`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Q_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`AtLeastOneKey`,this.code=typeof t.code==`number`?t.code:1302,this.message=t.message||`You need at least one Access Key`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},$_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`Timeout`,this.code=typeof t.code==`number`?t.code:1900,this.message=t.message||`Request timed out`,this.status=typeof t.status==`number`?t.status:408,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},eve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`InvalidArgument`,this.code=typeof t.code==`number`?t.code:2e3,this.message=t.message||`Invalid argument`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},tve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`Unexpected`,this.code=typeof t.code==`number`?t.code:2001,this.message=t.message||`Unexpected server error`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},nve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`Unavailable`,this.code=typeof t.code==`number`?t.code:2002,this.message=t.message||`Unavailable resource`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},rve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`QueryFailed`,this.code=typeof t.code==`number`?t.code:2003,this.message=t.message||`Query failed`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},ive=class e extends wv{constructor(t={}){super(t),this.name=t.name||`IntentStatus`,this.code=typeof t.code==`number`?t.code:2004,this.message=t.message||`Invalid intent status`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},ave=class e extends wv{constructor(t={}){super(t),this.name=t.name||`IntentProtocolDeprecated`,this.code=typeof t.code==`number`?t.code:3e3,this.message=t.message||`Requested intent protocol version is outdated/deprecated. Please upgrade your Trails SDK, see https://docs.sequence.build for more information.`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},ove=class e extends wv{constructor(t={}){super(t),this.name=t.name||`NotFound`,this.code=typeof t.code==`number`?t.code:8e3,this.message=t.message||`Resource not found`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},sve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`UnsupportedNetwork`,this.code=typeof t.code==`number`?t.code:8008,this.message=t.message||`Unsupported network`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},cve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`ClientOutdated`,this.code=typeof t.code==`number`?t.code:8009,this.message=t.message||`Client is outdated`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},lve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`IntentsSkipped`,this.code=typeof t.code==`number`?t.code:7e3,this.message=t.message||`Intents skipped as client is attempting a transaction that does not require intents`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},uve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`QuoteExpired`,this.code=typeof t.code==`number`?t.code:7001,this.message=t.message||`Intent quote has expired. Please try again.`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},dve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`HighPriceImpact`,this.code=typeof t.code==`number`?t.code:7002,this.message=t.message||`Quote unavailable due to high price impact`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},fve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`IntentsDisabled`,this.code=typeof t.code==`number`?t.code:9e3,this.message=t.message||`Intents service is currently unavailable`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},pve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`ChainNodeHealth`,this.code=typeof t.code==`number`?t.code:9001,this.message=t.message||`Intent quote is unavailable due to interrupted chain node access`,this.status=typeof t.status==`number`?t.status:503,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},mve={0:T_e,[-1]:Tv,[-2]:E_e,[-3]:D_e,[-4]:O_e,[-5]:Ev,[-6]:k_e,[-7]:A_e,[-8]:j_e,[-9]:M_e,[-10]:N_e,1e3:P_e,1001:F_e,1002:I_e,1003:L_e,1004:R_e,1005:z_e,1006:B_e,1007:V_e,1008:H_e,1101:U_e,1102:W_e,1103:G_e,1104:K_e,1105:q_e,1200:J_e,1201:Y_e,1300:X_e,1301:Z_e,1302:Q_e,1900:$_e,2e3:eve,2001:tve,2002:nve,2003:rve,2004:ive,3e3:ave,8e3:ove,8008:sve,8009:cve,7e3:lve,7001:uve,7002:dve,9e3:fve,9001:pve},hve=`Webrpc`,gve=`webrpc@v0.38.0;gen-typescript@v0.29.0;trails-api@v1-26.6.23-2459f503`})),vve,Dv=o((()=>{x_e(),_ve(),_ve(),vve=class extends C_e{constructor(e,t){let n=(n,r)=>{let i={};return t?.jwt&&t?.jwt.length>0&&(i.Authorization=`BEARER ${t?.jwt}`),e&&e.length>0&&(i[`X-Access-Key`]=e),r=r||{},r.headers={...r.headers,...i},fetch(n,r)},r=t?.hostname&&t?.hostname.length>0?t?.hostname:`https://trails-api.sequence.app`,i=r.endsWith(`/`)?r.slice(0,-1):r;super(i,n)}getHostname(){return this.hostname}getFetch(){return this.fetch}}})),yve,bve,Ov=o((()=>{pm(),yve=50000n,bve=eie*32n})),xve,Sve=o((()=>{Sc(),Rc(),Ac(),ym(),Wm(),vm(),sg(),dm(),Ov(),xve={block:uie({format(e){let t=e.transactions?.map(e=>{if(typeof e==`string`)return e;let t=xve.transaction?.format(e);return t.typeHex===`0x71`?t.type=`eip712`:t.typeHex===`0xff`&&(t.type=`priority`),t});return{l1BatchNumber:e.l1BatchNumber?bc(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?bc(e.l1BatchTimestamp):null,transactions:t}}}),transaction:cie({format(e){let t={};return e.type===`0x71`?t.type=`eip712`:e.type===`0xff`&&(t.type=`priority`),{...t,l1BatchNumber:e.l1BatchNumber?bc(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?bc(e.l1BatchTxIndex):null}}}),transactionReceipt:pse({format(e){return{l1BatchNumber:e.l1BatchNumber?bc(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?bc(e.l1BatchTxIndex):null,logs:e.logs.map(e=>({...Um(e),l1BatchNumber:e.l1BatchNumber?bc(e.l1BatchNumber):null,transactionLogIndex:xc(e.transactionLogIndex),logType:e.logType})),l2ToL1Logs:e.l2ToL1Logs.map(e=>({blockNumber:bc(e.blockHash),blockHash:e.blockHash,l1BatchNumber:e.l1BatchNumber?bc(e.l1BatchNumber):null,transactionIndex:bc(e.transactionIndex),shardId:bc(e.shardId),isService:e.isService,sender:e.sender,key:e.key,value:e.value,transactionHash:e.transactionHash,logIndex:bc(e.logIndex)}))}}}),transactionRequest:Yre({exclude:[`customSignature`,`factoryDeps`,`gasPerPubdata`,`paymaster`,`paymasterInput`],format(e){return e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:Cc(e.gasPerPubdata)}:{gasPerPubdata:Cc(yve)},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(Pc(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps.map(e=>Array.from(Pc(e)))}:{},...e.customSignature?{customSignature:Array.from(Pc(e.customSignature))}:{}},type:`0x71`}:{}}})}})),Cve,wve=o((()=>{Fs(),Cve=class extends Ps{constructor(){super([`Transaction is not an EIP712 transaction.`,``,`Transaction must:`,' - include `type: "eip712"`'," - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`"].join(`
112
+ - `).slice(1);return{...r,...l,...i?{chainId:Number(i)}:{},...a?{expirationTime:new Date(a)}:{},...o?{issuedAt:new Date(o)}:{},...s?{notBefore:new Date(s)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}var ime,ame,ome=o((()=>{ime=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,ame=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/}));function sme(e){let{address:t,domain:n,message:r,nonce:i,scheme:a,time:o=new Date}=e;if(n&&r.domain!==n||i&&r.nonce!==i||a&&r.scheme!==a||r.expirationTime&&o>=r.expirationTime||r.notBefore&&o<r.notBefore)return!1;try{if(!r.address||!yu(r.address,{strict:!1})||t&&!Vm(r.address,t))return!1}catch{return!1}return!0}var cme=o((()=>{xu(),Hm()}));async function lme(e,t){let{address:n,domain:r,message:i,nonce:a,scheme:o,signature:s,time:c=new Date,...l}=t,u=rme(i);if(!u.address||!sme({address:n,domain:r,message:u,nonce:a,scheme:o,time:c}))return!1;let d=Lle(i);return u_(e,{address:u.address,hash:d,signature:s,...l})}var ume=o((()=>{Dg(),ome(),cme(),f_()}));async function dme(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){let i=await e.request({method:`eth_sendRawTransactionSync`,params:r?[t,r]:[t]},{retryCount:0}),a=(e.chain?.formatters?.transactionReceipt?.format||og)(i);if(a.status===`reverted`&&n)throw new Kd({receipt:a});return a}var fme=o((()=>{Jd(),sg()}));function pme(e){return{call:t=>Nh(e,t),createAccessList:t=>pce(e,t),createBlockFilter:()=>hce(e),createContractEventFilter:t=>$u(e,t),createEventFilter:t=>_ce(e,t),createPendingTransactionFilter:()=>yce(e),estimateContractGas:t=>Kie(e,t),estimateGas:t=>Wie(e,t),getBalance:t=>xce(e,t),getBlobBaseFee:()=>Cce(e),getBlock:t=>bm(e,t),getBlockNumber:t=>Uh(e,t),getBlockReceipts:t=>Tce(e,t),getBlockTransactionCount:t=>Dce(e,t),getBytecode:t=>hg(e,t),getChainId:()=>Fm(e),getCode:t=>hg(e,t),getContractEvents:t=>eae(e,t),getDelegation:t=>kce(e,t),getEip712Domain:t=>Nce(e,t),getEnsAddress:t=>Lse(e,t),getEnsAvatar:t=>sce(e,t),getEnsName:t=>lce(e,t),getEnsResolver:t=>dce(e,t),getEnsText:t=>ace(e,t),getFeeHistory:t=>Rce(e,t),estimateFeesPerGas:t=>gie(e,t),getFilterChanges:t=>Gh(e,t),getFilterLogs:t=>Bce(e,t),getGasPrice:()=>die(e),getLogs:t=>Qie(e,t),getProof:t=>Xfe(e,t),estimateMaxPriorityFeePerGas:t=>pie(e,t),fillTransaction:t=>Vie(e,t),getStorageAt:t=>Qfe(e,t),getTransaction:t=>epe(e,t),getTransactionConfirmations:t=>npe(e,t),getTransactionCount:t=>yie(e,t),getTransactionReceipt:t=>i_(e,t),multicall:t=>ape(e,t),prepareTransactionRequest:t=>Lm(e,t),readContract:t=>Fh(e,t),sendRawTransaction:t=>cse(e,t),sendRawTransactionSync:t=>dme(e,t),simulate:t=>spe(e,t),simulateBlocks:t=>spe(e,t),simulateCalls:t=>Ope(e,t),simulateContract:t=>Joe(e,t),verifyHash:t=>u_(e,t),verifyMessage:t=>Upe(e,t),verifySiweMessage:t=>lme(e,t),verifyTypedData:t=>Gpe(e,t),uninstallFilter:t=>qh(e,t),waitForTransactionReceipt:t=>Ype(e,t),watchBlocks:t=>Zpe(e,t),watchBlockNumber:t=>qpe(e,t),watchContractEvent:t=>ase(e,t),watchEvent:t=>$pe(e,t),watchPendingTransactions:t=>tme(e,t)}}var mme=o((()=>{zse(),cce(),uce(),fce(),oce(),Ph(),mce(),gce(),ed(),vce(),bce(),qie(),vie(),Gie(),hie(),Hie(),Sce(),wce(),xm(),Wh(),Ece(),Oce(),Im(),gg(),tae(),Ace(),Fce(),zce(),Kh(),Vce(),fie(),$ie(),Zfe(),$fe(),tpe(),rpe(),wm(),ipe(),ope(),Ih(),cpe(),Ape(),Yoe(),Jh(),f_(),Wpe(),Kpe(),Xpe(),Jpe(),Qpe(),ose(),eme(),nme(),ume(),Bm(),lse(),fme()}));function hme(e){let{key:t=`public`,name:n=`Public Client`}=e;return Tse({...e,key:t,name:n,type:`publicClient`}).extend(pme)}var gme=o((()=>{Ese(),mme()}));async function _me(e,{chain:t}){let{id:n,name:r,nativeCurrency:i,rpcUrls:a,blockExplorers:o}=t;await e.request({method:`wallet_addEthereumChain`,params:[{chainId:Ec(n),chainName:r,nativeCurrency:i,rpcUrls:a.default.http,blockExplorerUrls:o?Object.values(o).map(({url:e})=>e):void 0}]},{dedupe:!0,retryCount:0})}var vme=o((()=>{Ac()}));function yme(e,t){let{abi:n,args:r,bytecode:i,...a}=t,o=Ch({abi:n,args:r,bytecode:i});return $h(e,{...a,...a.authorizationList?{to:null}:{},data:o})}var bme=o((()=>{wh(),tg()}));async function xme(e){return e.account?.type===`local`?[e.account.address]:(await e.request({method:`eth_accounts`},{dedupe:!0})).map(e=>hu(e))}var Sme=o((()=>{vu()}));async function Cme(e,t={}){let{account:n=e.account,chainId:r}=t,i=n?td(n):void 0,a=r?[i?.address,[Ec(r)]]:[i?.address],o=await e.request({method:`wallet_getCapabilities`,params:a}),s={};for(let[e,t]of Object.entries(o)){s[Number(e)]={};for(let[n,r]of Object.entries(t))n===`addSubAccount`&&(n=`unstable_addSubAccount`),s[Number(e)][n]=r}return typeof r==`number`?s[r]:s}var wme=o((()=>{nd(),Ac()}));async function Tme(e){return await e.request({method:`wallet_getPermissions`},{dedupe:!0})}var Eme=o((()=>{}));async function Dme(e,t){let{account:n=e.account,chainId:r,nonce:i}=t;if(!n)throw new Yh({docsPath:`/docs/eip7702/prepareAuthorization`});let a=td(n),o=(()=>{if(t.executor)return t.executor===`self`?t.executor:td(t.executor)})(),s={address:t.contractAddress??t.address,chainId:r,nonce:i};return s.chainId===void 0&&(s.chainId=e.chain?.id??await xs(e,Fm,`getChainId`)({})),s.nonce===void 0&&(s.nonce=await xs(e,yie,`getTransactionCount`)({address:a.address,blockTag:`pending`}),(o===`self`||o?.address&&Vm(o.address,a.address))&&(s.nonce+=1)),s}var Ome=o((()=>{nd(),Zh(),Hm(),Ss(),Im(),wm()}));async function kme(e){return(await e.request({method:`eth_requestAccounts`},{dedupe:!0,retryCount:0})).map(e=>gu(e))}var Ame=o((()=>{vu()}));async function jme(e,t){return e.request({method:`wallet_requestPermissions`,params:[t]},{retryCount:0})}var Mme=o((()=>{}));async function Nme(e,t){let{chain:n=e.chain}=t,r=t.timeout??Math.max((n?.blockTime??0)*3,5e3),i=await xs(e,mse,`sendCalls`)(t);return await xs(e,bse,`waitForCallsStatus`)({...t,id:i.id,timeout:r})}var Pme=o((()=>{Ss(),_se(),Sse()}));async function Fme(e,t){let{account:n=e.account,assertChainId:r=!0,chain:i=e.chain,accessList:a,authorizationList:o,blobs:s,data:c,dataSuffix:l=typeof e.dataSuffix==`string`?e.dataSuffix:e.dataSuffix?.value,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:m,nonce:h,pollingInterval:g,throwOnReceiptRevert:_,type:v,value:y,...b}=t,x=t.timeout??Math.max((i?.blockTime??0)*3,5e3);if(n===void 0)throw new Yh({docsPath:`/docs/actions/wallet/sendTransactionSync`});let S=n?td(n):null,C;try{mm(t);let n=await(async()=>{if(t.to)return t.to;if(t.to!==null&&o&&o.length>0)return await jre({authorization:o[0]}).catch(()=>{throw new Ps("`to` is required. Could not infer from `authorizationList`.")})})();if(S?.type===`json-rpc`||S===null){let t;i!==null&&(t=await xs(e,Fm,`getChainId`)({}),r&&sse({currentChainId:t,chain:i}));let C=e.chain?.formatters?.transactionRequest?.format,w=(C||um)({...cm(b,{format:C}),accessList:a,account:S,authorizationList:o,blobs:s,chainId:t,data:l?Su([c??`0x`,l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:m,nonce:h,to:n,type:v,value:y},`sendTransaction`),T=p_.get(e.uid),E=T?`wallet_sendTransaction`:`eth_sendTransaction`,D=await(async()=>{try{return await e.request({method:E,params:[w]},{retryCount:0})}catch(t){if(T===!1)throw t;let n=t;if(n.name===`InvalidInputRpcError`||n.name===`InvalidParamsRpcError`||n.name===`MethodNotFoundRpcError`||n.name===`MethodNotSupportedRpcError`)return await e.request({method:`wallet_sendTransaction`,params:[w]},{retryCount:0}).then(t=>(p_.set(e.uid,!0),t)).catch(t=>{let r=t;throw r.name===`MethodNotFoundRpcError`||r.name===`MethodNotSupportedRpcError`?(p_.set(e.uid,!1),n):r});throw n}})(),O=await xs(e,Ype,`waitForTransactionReceipt`)({checkReplacement:!1,hash:D,pollingInterval:g,timeout:x});if(_&&O.status===`reverted`)throw new Kd({receipt:O});return O}if(S?.type===`local`){if(S.nonceManager&&h===void 0){let t=b.chainId,n=await(async()=>typeof t==`number`?t:i?i.id:xs(e,Fm,`getChainId`)({}))();C={address:S.address,chainId:n}}let r=await xs(e,Lm,`prepareTransactionRequest`)({account:S,accessList:a,authorizationList:o,blobs:s,chain:i,data:l?Su([c??`0x`,l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:m,nonce:h,nonceManager:S.nonceManager,parameters:[...Rm,`sidecars`],type:v,value:y,...b,to:n}),g=i?.serializers?.transaction,x=await S.signTransaction(r,{serializer:g});return await xs(e,dme,`sendRawTransactionSync`)({serializedTransaction:x,throwOnReceiptRevert:_,timeout:t.timeout})}throw S?.type===`smart`?new Xh({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:`/docs/actions/bundler/sendUserOperation`,type:`smart`}):new Xh({docsPath:`/docs/actions/wallet/sendTransactionSync`,type:S?.type})}catch(e){throw e instanceof Xh?e:(C&&!(e instanceof Kd)&&S?.nonceManager?.reset(C),Nm(e,{...t,account:S,chain:t.chain||void 0}))}}var p_,Ime=o((()=>{nd(),Zh(),Fs(),Jd(),tm(),Qh(),wu(),Pm(),lm(),dm(),Ss(),mu(),hm(),Im(),Xpe(),Bm(),fme(),p_=new pu(128)}));async function Lme(e,t){let{id:n}=t;await e.request({method:`wallet_showCallsStatus`,params:[n]})}var Rme=o((()=>{}));async function zme(e,t){let{account:n=e.account}=t;if(!n)throw new Yh({docsPath:`/docs/eip7702/signAuthorization`});let r=td(n);if(!r.signAuthorization)throw new Xh({docsPath:`/docs/eip7702/signAuthorization`,metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:r.type});let i=await Dme(e,t);return r.signAuthorization(i)}var Bme=o((()=>{nd(),Zh(),Ome()}));async function Vme(e,{account:t=e.account,message:n}){if(!t)throw new Yh({docsPath:`/docs/actions/wallet/signMessage`});let r=td(t);if(r.signMessage)return r.signMessage({message:n});let i=typeof n==`string`?Dc(n):n.raw instanceof Uint8Array?Cc(n.raw):n.raw;return e.request({method:`personal_sign`,params:[i,r.address]},{retryCount:0})}var Hme=o((()=>{nd(),Zh(),Ac()}));async function Ume(e,t){let{account:n=e.account,chain:r=e.chain,...i}=t;if(!n)throw new Yh({docsPath:`/docs/actions/wallet/signTransaction`});let a=td(n);mm({account:a,...t});let o=await xs(e,Fm,`getChainId`)({});r!==null&&sse({currentChainId:o,chain:r});let s=(r?.formatters||e.chain?.formatters)?.transactionRequest?.format||um;return a.signTransaction?a.signTransaction({...i,account:a,chainId:o},{serializer:e.chain?.serializers?.transaction}):await e.request({method:`eth_signTransaction`,params:[{...s({...i,account:a},`signTransaction`),chainId:Ec(o),from:a.address}]},{retryCount:0})}var Wme=o((()=>{nd(),Zh(),Qh(),Ac(),dm(),Ss(),hm(),Im()}));async function Gme(e,t){let{account:n=e.account,domain:r,message:i,primaryType:a}=t;if(!n)throw new Yh({docsPath:`/docs/actions/wallet/signTypedData`});let o=td(n),s={EIP712Domain:Wle({domain:r}),...t.types};if(Ule({domain:r,message:i,primaryType:a,types:s}),o.signTypedData)return o.signTypedData({domain:r,message:i,primaryType:a,types:s});let c=Hle({domain:r,message:i,primaryType:a,types:s});return e.request({method:`eth_signTypedData_v4`,params:[o.address,c]},{retryCount:0})}var Kme=o((()=>{nd(),Zh(),Og()}));async function qme(e,{id:t}){await e.request({method:`wallet_switchEthereumChain`,params:[{chainId:Ec(t)}]},{retryCount:0})}var Jme=o((()=>{Ac()}));async function Yme(e,t){return await e.request({method:`wallet_watchAsset`,params:t},{retryCount:0})}var Xme=o((()=>{}));async function Zme(e,t){return ng.internal(e,Fme,`sendTransactionSync`,t)}var Qme=o((()=>{Ime(),rg()}));function $me(e){return{addChain:t=>_me(e,t),deployContract:t=>yme(e,t),fillTransaction:t=>Vie(e,t),getAddresses:()=>xme(e),getCallsStatus:t=>vse(e,t),getCapabilities:t=>Cme(e,t),getChainId:()=>Fm(e),getPermissions:()=>Tme(e),prepareAuthorization:t=>Dme(e,t),prepareTransactionRequest:t=>Lm(e,t),requestAddresses:()=>kme(e),requestPermissions:t=>jme(e,t),sendCalls:t=>mse(e,t),sendCallsSync:t=>Nme(e,t),sendRawTransaction:t=>cse(e,t),sendRawTransactionSync:t=>dme(e,t),sendTransaction:t=>$h(e,t),sendTransactionSync:t=>Fme(e,t),showCallsStatus:t=>Lme(e,t),signAuthorization:t=>zme(e,t),signMessage:t=>Vme(e,t),signTransaction:t=>Ume(e,t),signTypedData:t=>Gme(e,t),switchChain:t=>qme(e,t),waitForCallsStatus:t=>bse(e,t),watchAsset:t=>Yme(e,t),writeContract:t=>ng(e,t),writeContractSync:t=>Zme(e,t)}}var ehe=o((()=>{Hie(),Im(),vme(),bme(),Sme(),yse(),wme(),Eme(),Ome(),Bm(),Ame(),Mme(),_se(),Pme(),lse(),fme(),tg(),Ime(),Rme(),Bme(),Hme(),Wme(),Kme(),Jme(),Sse(),Xme(),rg(),Qme()}));function the(e){let{key:t=`wallet`,name:n=`Wallet Client`,transport:r}=e;return Tse({...e,key:t,name:n,transport:r,type:`walletClient`}).extend($me)}var nhe=o((()=>{Ese(),ehe()}));function rhe({key:e,methods:t,name:n,request:r,retryCount:i=3,retryDelay:a=150,timeout:o,type:s},c){let l=Cse();return{config:{key:e,methods:t,name:n,request:r,retryCount:i,retryDelay:a,timeout:o,type:s},request:ale(r,{methods:t,retryCount:i,retryDelay:a,uid:l}),value:c}}var ihe=o((()=>{cle(),wse()}));function ahe(e,t={}){let{key:n=`custom`,methods:r,name:i=`Custom Provider`,retryDelay:a}=t;return({retryCount:o})=>rhe({key:n,methods:r,name:i,request:e.request.bind(e),retryCount:t.retryCount??o,retryDelay:a,type:`custom`})}var ohe=o((()=>{ihe()})),she,che=o((()=>{Fs(),she=class extends Ps{constructor(){super(`No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.`,{docsPath:`/docs/clients/intro`,name:`UrlRequiredError`})}}}));function lhe(e){if(!e)return`default`;let t=fhe.get(e);if(t!==void 0)return t;let n=dhe++;return fhe.set(e,n),n}function uhe(e,t={}){let{batch:n,fetchFn:r,fetchOptions:i,key:a=`http`,methods:o,name:s=`HTTP JSON-RPC`,onFetchRequest:c,onFetchResponse:l,retryDelay:u,raw:d}=t;return({chain:f,retryCount:p,timeout:m})=>{let{batchSize:h=1e3,wait:g=0}=typeof n==`object`?n:{},_=t.retryCount??p,v=m??t.timeout??1e4,y=e||f?.rpcUrls.default.http[0];if(!y)throw new she;let b=Ale(y,{fetchFn:r,fetchOptions:i,onRequest:c,onResponse:l,timeout:v});return rhe({key:a,methods:o,name:s,async request({method:e,params:t},r){let i={method:e,params:t},a=r?.signal?{signal:r.signal}:void 0,{schedule:o}=yoe({id:`${y}.${lhe(r?.signal)}`,wait:g,shouldSplitBatch(e){return e.length>h},fn:e=>b.request({body:e,fetchOptions:a}),sort:(e,t)=>e.id-t.id}),[{error:s,result:c}]=await(async e=>n?o(e):[await b.request({body:e,fetchOptions:a})])(i);if(d)return{error:s,result:c};if(s)throw new cf({body:i,error:s,url:y});return c},retryCount:_,retryDelay:u,timeout:v,type:`http`},{fetchOptions:i,url:y})}}var dhe,fhe,phe=o((()=>{uf(),che(),kh(),Mle(),ihe(),dhe=0,fhe=new WeakMap})),m_=o((()=>{bs(),ed(),qie(),tae(),Ih(),Yoe(),ose(),rg(),Sse(),Ese(),gme(),Sc(),Ac(),dm(),nhe(),mme(),ehe(),ihe(),ohe(),om(),Bf(),Qoe(),phe(),uf(),che(),Mle(),kh(),Ele(),kle(),_h(),Dpe(),yh(),pm(),Ple(),jd(),rc(),fu(),Fs(),aie(),dse(),Sh(),of(),cc(),gc(),Hse(),Nre(),gm(),ic(),zd(),Jd(),Vle(),Hfe(),wd(),Ed(),Km(),Toe(),Xm(),Hu(),wh(),Doe(),Xu(),od(),koe(),xu(),fc(),Nu(),qu(),qm(),id(),vu(),Au(),Rc(),em(),nu(),Hm(),Tm(),Em(),Eie(),wie(),md(),jm(),Rie(),Loe(),ld(),Mh(),Qh(),wg(),Eh(),As(),mte(),Fse(),dg(),Hf(),ym(),vm(),sg(),wle(),km(),cu(),uu(),ou(),Wu(),wm(),mu(),rse(),ag(),Dg(),kg(),Bfe(),Qp(),wre(),Sre(),_g(),xg(),zpe(),Ile(),Od(),hm(),Mm(),yg(),Og(),Fd(),Ld(),Nd(),Gfe(),Ufe()})),mhe,h_,g_=o((()=>{zr(),F(),mhe={queries:{staleTime:5*w,gcTime:5*T,retry:2,retryDelay:N,refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,refetchOnReconnect:!0}},h_=new Qn({defaultOptions:mhe})})),hhe=o((()=>{})),ghe=o((()=>{}));function _he({storage:e,buster:t=``,maxAge:n=1e3*60*60*24,serialize:r=JSON.stringify,deserialize:i=JSON.parse,prefix:a=vhe,refetchOnRestore:o=!0,filters:s}){function c(e){if(e.state.dataUpdatedAt){let r=Date.now()-e.state.dataUpdatedAt>n,i=e.buster!==t;return!!(r||i)}return!0}async function l(t,n){if(e!=null){let r=`${a}-${t}`;try{let t=await e.getItem(r);if(t){let a;try{a=await i(t)}catch{await e.removeItem(r);return}if(c(a))await e.removeItem(r);else return n&&Ye.schedule(()=>n(a)),a.state.data}}catch{await e.removeItem(r)}}}async function u(t,n){if(e!=null){let e=n.getQueryCache().find({queryKey:t});e&&await d(e)}}async function d(n){if(e!=null){let i=`${a}-${n.queryHash}`;e.setItem(i,await r({state:n.state,queryKey:n.queryKey,queryHash:n.queryHash,buster:t}))}}async function f(t,n,r){let i=s?Se(s,r):!0;if(i&&r.state.data===void 0&&e!=null){let e=await l(r.queryHash,e=>{r.setState({dataUpdatedAt:e.state.dataUpdatedAt,errorUpdatedAt:e.state.errorUpdatedAt}),(o===`always`||o===!0&&r.isStale())&&r.fetch()});if(e!==void 0)return Promise.resolve(e)}let a=await t(n);return i&&e!=null&&Ye.schedule(()=>{d(r)}),Promise.resolve(a)}async function p(){if(e?.entries){let t=`${a}-`,n=await e.entries();for(let[r,a]of n)if(r.startsWith(t)){let t;try{t=await i(a)}catch{await e.removeItem(r);continue}c(t)&&await e.removeItem(r)}}}async function m(t,n={}){let{exact:r,queryKey:o}=n;if(e?.entries){let n=`${a}-`,s=await e.entries();for(let[a,l]of s)if(a.startsWith(n)){let n;try{n=await i(l)}catch{await e.removeItem(a);continue}if(c(n)){await e.removeItem(a);continue}if(o){if(r){if(n.queryHash!==Te(o))continue}else if(!Ee(n.queryKey,o))continue}t.setQueryData(n.queryKey,n.state.data,{updatedAt:n.state.dataUpdatedAt})}}}async function h(t={}){let{exact:n,queryKey:r}=t;if(e?.entries){let t=await e.entries(),o=`${a}-`;for(let[a,s]of t)if(a.startsWith(o)){if(!r){await e.removeItem(a);continue}let t;try{t=await i(s)}catch{await e.removeItem(a);continue}if(n){if(t.queryHash!==Te(r))continue}else if(!Ee(t.queryKey,r))continue;await e.removeItem(a)}}}return{persisterFn:f,persistQuery:d,persistQueryByKey:u,retrieveQuery:l,persisterGc:p,restoreQueries:m,removeQueries:h}}var vhe,yhe=o((()=>{tr(),vhe=`tanstack-query`})),bhe=o((()=>{hhe(),ghe(),yhe()}));function xhe(e){return!!(e&&typeof e==`object`&&`__type`in e&&`value`in e&&e.__type===whe)}function She(e){return JSON.stringify(e,(e,t)=>typeof t==`bigint`?{__type:whe,value:t.toString()}:t)}function Che(e){return JSON.parse(e,(e,t)=>xhe(t)?BigInt(t.value):t)}var whe,The=o((()=>{whe=`__trails_bigint__`})),__,v_=o((()=>{bhe(),The(),F(),__=_he({storage:typeof window<`u`?window.localStorage:void 0,maxAge:D,prefix:`trails-query`,serialize:She,deserialize:Che})})),Ehe,Dhe,Ohe,khe,Ahe,jhe,Mhe=o((()=>{Ehe=`https://nodes.sequence.app`,Dhe=`https://indexer.sequence.app`,Ohe=`https://metadata.sequence.app`,khe=`https://trails-api.sequence.app`,Ahe=`10c5ac56159da00924d110c07c3f6e3a`,jhe=`0.05`}));function Nhe(){return Ihe}function Phe(e){Object.assign(x_,e)}function y_(e){return e?x_[e]:x_}function Fhe(){let e=b_(`CF_PAGES_COMMIT_SHA`),t=b_(`VITE_COMMIT_SHA`);return e&&console.log(`[trails-sdk][config] commit hash from CF_PAGES_COMMIT_SHA: ${e}`),t&&console.log(`[trails-sdk][config] commit hash from VITE_COMMIT_SHA: ${t}`),e||t}function b_(e){if({}.env){let t={}.env[`VITE_${e}`];if(t!==void 0&&t!==``)return t;let n={}.env[e];if(n!==void 0&&n!==``)return n}if(typeof process<`u`){let t={}[e];if(t!==void 0&&t!==``)return t}}var x_,Ihe,S_=o((()=>{Mhe(),x_={trailsApiKey:``,sequenceIndexerUrl:Dhe,sequenceNodeGatewayUrl:Ehe,sequenceMetadataUrl:Ohe,trailsApiUrl:khe,walletConnectProjectId:Ahe,slippageTolerance:jhe,debug:!1,commitHash:void 0},x_.commitHash=Fhe(),Ihe=!1}));function C_(e){return e===Hhe}function Lhe(e){let t=e.toLowerCase();return t===`0x0000000000000000000000000000000000000000`||t===`0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`}function Rhe(e){let t=e.trim();return t===`11111111111111111111111111111111`||t===`So11111111111111111111111111111111111111112`}function w_(e){return C_(e)?B_:l_}function T_(e,t){if(!e)return!1;let n=e.trim();return t!=null&&C_(t)?Rhe(n):t!=null&&!C_(t)?Lhe(n):Lhe(n)?!0:Nhe()&&Rhe(n)}function E_(e,t){return!e||!t?!1:e.toLowerCase()===t.toLowerCase()}function zhe(e,t){return!e||!t?!1:e.trim()===t.trim()}function D_(e,t,n){return!e||!t?!1:n!=null&&C_(n)?zhe(e,t):E_(e,t)}function O_(e){return e?E_(e,l_):!1}function k_(e){return/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e)}function Bhe(e){return yu(e)}function Vhe(e){let t=e.trim();return Bhe(t)||k_(t)}function A_(e,t){if(!e||!t)return!1;let n=e.trim(),r=t.trim(),i=k_(n),a=k_(r);return i||a?i===a?n===r:!1:E_(n,r)}function j_(e,t=6,n=4){if(!e)return``;let r=e;try{r=gu(e)}catch{r=e}return`${r.slice(0,t)}…${r.slice(-n)}`}var Hhe,M_,N_=o((()=>{m_(),S_(),U_(),Hhe=101,M_=e=>(e??``).toLowerCase()}));function P_(e){return e===101}function Uhe(e){return e===101||e===792703809}function Whe(e,t){return e?t===F_.SOLANA?/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e):yu(e):!1}var F_,Ghe,I_=o((()=>{m_(),F_={EVM:`EVM`,SOLANA:`SOLANA`},Ghe=`0x0000000000000000000000000000000000000000`,F_.EVM,F_.SOLANA,F_.EVM,F_.SOLANA}));function Khe(e){let t=e.trim();return H_.find(e=>zhe(e.mint,t))}function qhe(e){return{symbol:e.symbol,name:e.name,decimals:e.decimals,contractAddress:e.mint,chainId:101,chainName:Yhe,tokenId:e.tokenId,imageUrl:e.imageUrl,isNativeToken:e.isNativeToken||void 0}}function L_(e){let t=Khe(e);return t?qhe(t):null}function R_(){return H_.map(e=>qhe(e))}function z_(e){return e?Khe(e)?.isStablecoin??!1:!1}function Jhe(e){if(!T_(e.contractAddress,e.chainId))return z_(e.contractAddress)?1:void 0}var Yhe,B_,Xhe,Zhe,Qhe,$he,V_,H_,ege=o((()=>{I_(),N_(),Yhe=`Solana`,B_=`11111111111111111111111111111111`,Xhe=`EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`,Zhe=`Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB`,Qhe=`2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo`,$he={chainId:1,tokenAddress:`0xD31a59c85AE9D8edEFeC411D448f90841571b89c`},V_={SOL:`https://assets.coingecko.com/coins/images/4128/standard/solana.png?1718769756`,USDC:`https://assets.sequence.info/images/tokens/large/1/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.webp`,USDT:`https://assets.sequence.info/images/tokens/large/1/0xdac17f958d2ee523a2206206994597c13d831ec7.webp`,PYUSD:`https://assets.coingecko.com/coins/images/31212/standard/PYUSD_Logo_%282x%29.png`},H_=[{mint:B_,symbol:`SOL`,name:`Solana`,decimals:9,tokenId:`SOL-solana`,imageUrl:V_.SOL,isNativeToken:!0,isStablecoin:!1},{mint:Xhe,symbol:`USDC`,name:`USD Coin`,decimals:6,tokenId:`USDC-solana`,imageUrl:V_.USDC,isNativeToken:!1,isStablecoin:!0},{mint:Zhe,symbol:`USDT`,name:`USDT`,decimals:6,tokenId:`USDT-solana`,imageUrl:V_.USDT,isNativeToken:!1,isStablecoin:!0},{mint:Qhe,symbol:`PYUSD`,name:`PayPal USD`,decimals:6,tokenId:`PYUSD-solana`,imageUrl:V_.PYUSD,isNativeToken:!1,isStablecoin:!0}]})),tge,U_=o((()=>{ege(),tge=792703809}));function W_(e){try{return typeof window>`u`?null:new URLSearchParams(window.location.search).get(e)}catch{return null}}var nge=o((()=>{})),G_=o((()=>{S_()}));function rge(e){q_!==e&&(q_=e)}function ige(){return q_||W_(`debug`)===`true`}function K_(){let e=b_(`TEST_LOG_CONSOLE`);return e&&e in J_?J_[e]:W_(`log`)===`true`||ige()?J_.trace:-1}var q_,J_,K,age=o((()=>{nge(),G_(),q_=!1,J_={error:0,warn:1,info:2,log:3,debug:4,trace:5},K={get _enabled(){return W_(`log`)===`true`||ige()},console:{log:(...e)=>{K_()<J_.log||console.log(...e)},error:(...e)=>{K_()<J_.error||console.error(...e)},warn:(...e)=>{K_()<J_.warn||console.warn(...e)},info:(...e)=>{K_()<J_.info||console.info(...e)},debug:(...e)=>{K_()<J_.debug||console.debug(...e)},trace:(...e)=>{K_()<J_.trace||console.trace(...e)},time:(...e)=>{K_()<J_.log||console.time(...e)},timeEnd:(...e)=>{K_()<J_.log||console.timeEnd(...e)}}}})),Y_=o((()=>{age()}));function oge(e){return{token:{chainId:e.chainId,tokenAddress:e.tokenAddress,tokenSymbol:e.tokenSymbol},priceUsd:1,updatedAt:new Date().toISOString()}}function X_(e){return{chainId:e.chainId,tokenAddress:e.tokenAddress||e.contractAddress||`0x0000000000000000000000000000000000000000`,tokenSymbol:e.tokenSymbol||e.tokenId||e.tokenID||e.symbol}}function Z_(e){let t=Number(e.chainId||0),n=e.tokenAddress||`0x0000000000000000000000000000000000000000`;return`${P_(t)?n:n.toLowerCase()}-${t}-${(e.tokenSymbol||``).toUpperCase()}`}function sge(e){return P_(Number(e.chainId))&&T_(e.tokenAddress||`0x0000000000000000000000000000000000000000`,e.chainId)}function cge(e){return{chainId:dge,tokenAddress:fge,tokenSymbol:e.tokenSymbol||`SOL`}}function lge(e,t){let n=X_(e.token);return Number(n.chainId)===dge&&n.tokenAddress.toLowerCase()===fge.toLowerCase()?{...e,token:{chainId:t.chainId,tokenAddress:t.tokenAddress,tokenSymbol:t.tokenSymbol||e.token.tokenSymbol}}:e}async function uge(e,t){if(!e)throw Error(`Trails client is required`);if(t.length===0)return[];let n=[],r=[];for(let e of t)P_(Number(e.chainId))&&z_(e.tokenAddress)?n.push(oge(e)):r.push(e);if(r.length===0)return n;try{let t=r.find(sge),i=t?r.map(e=>sge(e)?cge(e):e):r,a=(await e.getTokenPrices({tokens:i}))?.tokenPrices||[],o=t?a.map(e=>lge(e,t)):a;return[...n,...o]}catch(e){throw K.console.error(`[trails-sdk] Failed to fetch token prices:`,e),e}}var dge,fge,pge=o((()=>{m_(),U_(),Y_(),I_(),N_(),dge=$he.chainId,fge=$he.tokenAddress}));function mge(e){let t=new Map;for(let n of e){let e=X_(n),r=Z_(e);t.has(r)||t.set(r,e)}return Array.from(t.values()).sort((e,t)=>Z_(e).localeCompare(Z_(t)))}function hge(e){return typeof e==`object`&&!!e&&`chainId`in e&&typeof e.chainId==`number`&&`tokenAddress`in e&&typeof e.tokenAddress==`string`&&(!(`tokenSymbol`in e)||typeof e.tokenSymbol==`string`)}function gge(e){if(e[0]!==wge||e[1]!==Tge)return null;let t=e[2];return!Array.isArray(t)||!t.every(hge)?null:[...t]}function _ge(e){return e?Date.now()-e<$_:!1}function vge(e,t){if(e)return e.find(e=>Z_(X_(e.token))===t)??null}function yge(e,t){return e.getQueryCache().findAll({queryKey:ev.batch()}).flatMap(e=>{let n=gge(e.queryKey);return n?.some(e=>Z_(e)===t)?[{queryKey:e.queryKey,tokens:n,data:Array.isArray(e.state.data)?e.state.data:void 0,dataUpdatedAt:e.state.dataUpdatedAt,fetchStatus:e.state.fetchStatus}]:[]})}function bge({queryClient:e,trailsClient:t,tokens:n,prices:r}){let i=new Map(r.map(e=>[Z_(X_(e.token)),e]));for(let r of n){let n=Z_(r);e.setQueryData(ev.byToken(r,t,e).queryKey,i.get(n)??null)}}function xge(e,t){if(!t)return{price:void 0,updatedAt:void 0};let n=Z_(X_(t)),r=yge(e,n).filter(e=>e.data!==void 0).sort((e,t)=>t.dataUpdatedAt-e.dataUpdatedAt)[0];return r?.data?{price:vge(r.data,n),updatedAt:r.dataUpdatedAt||void 0}:{price:void 0,updatedAt:void 0}}async function Sge({queryClient:e,trailsClient:t,token:n}){let r=Z_(n),i=yge(e,r).filter(e=>e.fetchStatus===`fetching`).sort((e,t)=>e.tokens.length-t.tokens.length)[0];if(i)try{return vge(await e.fetchQuery(ev.byTokens(i.tokens,t,e)),r)??null}catch{}let a=yge(e,r).filter(e=>e.data!==void 0&&_ge(e.dataUpdatedAt)).sort((e,t)=>t.dataUpdatedAt-e.dataUpdatedAt)[0];return a?.data?vge(a.data,r)??null:(await uge(t,[n]))[0]??null}async function Cge(e,t){return h_.ensureQueryData(ev.byToken(t,e,h_))}async function Q_(e,t){return t.length===0?[]:h_.ensureQueryData(ev.byTokens(t,e,h_))}var wge,Tge,Ege,$_,Dge,ev,tv=o((()=>{zr(),F(),g_(),Gr(),v_(),pge(),wge=`tokenPrices`,Tge=`batch`,Ege=`single`,$_=90*w,Dge=90*w,ev={all:[wge],batch:()=>[...ev.all,Tge],single:()=>[...ev.all,Ege],byTokens:(e,t,n=h_)=>{let r=mge(e),i=r.length>0&&!!t;return Nr({queryKey:[...ev.batch(),r],queryFn:i?async()=>{if(!t)throw Error(`Trails client is required`);let e=await uge(t,r);return bge({queryClient:n,trailsClient:t,tokens:r,prices:e}),e}:Ve,staleTime:$_,gcTime:Dge,retry:Ur(2),retryDelay:N,persister:__.persisterFn})},byToken:(e,t,n=h_)=>{let r=e?X_(e):null,i=r?Z_(r):null,a=!!r&&!!t;return Nr({queryKey:[...ev.single(),i],queryFn:a?async()=>{if(!r||!t)throw Error(`Token price query requires a token and Trails client`);return Sge({queryClient:n,trailsClient:t,token:r})}:Ve,staleTime:$_,gcTime:Dge,retry:Ur(2),retryDelay:N,persister:__.persisterFn})}}})),nv,rv,iv,av,ov,sv,Oge,cv,kge,Age,jge,lv,Mge,Nge,Pge,Fge,Ige,Lge,Rge,zge,Bge,Vge,Hge,Uge,Wge,Gge,Kge,qge,Jge,Yge,Xge,Zge,Qge,$ge,e_e,t_e,n_e,r_e,i_e,a_e,o_e,s_e,c_e,l_e,u_e,d_e,f_e,p_e,m_e,h_e,g_e,__e,v_e,y_e,b_e=o((()=>{Zr(),nv=class{constructor(e,t){G(this,`hostname`,void 0),G(this,`fetch`,void 0),G(this,`path`,`/rpc/TrailsOnramp/`),G(this,`queryKey`,{getMeldServiceProviders:e=>[`TrailsOnramp`,`getMeldServiceProviders`,e],getMeldCountryDefaults:e=>[`TrailsOnramp`,`getMeldCountryDefaults`,e],getMeldFiatCurrencies:e=>[`TrailsOnramp`,`getMeldFiatCurrencies`,e],getMeldPaymentMethods:e=>[`TrailsOnramp`,`getMeldPaymentMethods`,e],getMeldCryptoCurrencies:e=>[`TrailsOnramp`,`getMeldCryptoCurrencies`,e],getMeldPurchaseLimits:e=>[`TrailsOnramp`,`getMeldPurchaseLimits`,e],getMeldQuote:e=>[`TrailsOnramp`,`getMeldQuote`,e],createMeldWidgetSession:e=>[`TrailsOnramp`,`createMeldWidgetSession`,e],getMeldTransaction:e=>[`TrailsOnramp`,`getMeldTransaction`,e],searchMeldTransactions:e=>[`TrailsOnramp`,`searchMeldTransactions`,e],createMeldBankLinkingConnection:e=>[`TrailsOnramp`,`createMeldBankLinkingConnection`,e],getMeshIntegrations:e=>[`TrailsOnramp`,`getMeshIntegrations`,e],getMeshSupportedTokens:e=>[`TrailsOnramp`,`getMeshSupportedTokens`,e],createMeshLinkToken:e=>[`TrailsOnramp`,`createMeshLinkToken`,e],getBluvoClientConfig:e=>[`TrailsOnramp`,`getBluvoClientConfig`,e],getBluvoExchanges:e=>[`TrailsOnramp`,`getBluvoExchanges`,e],getBluvoOAuthURL:e=>[`TrailsOnramp`,`getBluvoOAuthURL`,e],getBluvoWallet:e=>[`TrailsOnramp`,`getBluvoWallet`,e],pingBluvoWallet:e=>[`TrailsOnramp`,`pingBluvoWallet`,e],getBluvoWithdrawBalances:e=>[`TrailsOnramp`,`getBluvoWithdrawBalances`,e],createBluvoWithdrawalQuote:e=>[`TrailsOnramp`,`createBluvoWithdrawalQuote`,e],executeBluvoWithdrawal:e=>[`TrailsOnramp`,`executeBluvoWithdrawal`,e],getBluvoTransaction:e=>[`TrailsOnramp`,`getBluvoTransaction`,e],deleteBluvoWallet:e=>[`TrailsOnramp`,`deleteBluvoWallet`,e]}),G(this,`getMeldServiceProviders`,(e,t,n)=>this.fetch(this.url(`GetMeldServiceProviders`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldServiceProvidersResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldCountryDefaults`,(e,t,n)=>this.fetch(this.url(`GetMeldCountryDefaults`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldCountryDefaultsResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldFiatCurrencies`,(e,t,n)=>this.fetch(this.url(`GetMeldFiatCurrencies`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldFiatCurrenciesResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldPaymentMethods`,(e,t,n)=>this.fetch(this.url(`GetMeldPaymentMethods`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldPaymentMethodsResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldCryptoCurrencies`,(e,t,n)=>this.fetch(this.url(`GetMeldCryptoCurrencies`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldCryptoCurrenciesResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldPurchaseLimits`,(e,t,n)=>this.fetch(this.url(`GetMeldPurchaseLimits`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldPurchaseLimitsResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldQuote`,(e,t,n)=>this.fetch(this.url(`GetMeldQuote`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldQuoteResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`createMeldWidgetSession`,(e,t,n)=>this.fetch(this.url(`CreateMeldWidgetSession`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`CreateMeldWidgetSessionResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeldTransaction`,(e,t,n)=>this.fetch(this.url(`GetMeldTransaction`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeldTransactionResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`searchMeldTransactions`,(e,t,n)=>this.fetch(this.url(`SearchMeldTransactions`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`SearchMeldTransactionsResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`createMeldBankLinkingConnection`,(e,t,n)=>this.fetch(this.url(`CreateMeldBankLinkingConnection`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`CreateMeldBankLinkingConnectionResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeshIntegrations`,(e,t,n)=>this.fetch(this.url(`GetMeshIntegrations`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeshIntegrationsResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getMeshSupportedTokens`,(e,t,n)=>this.fetch(this.url(`GetMeshSupportedTokens`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetMeshSupportedTokensResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`createMeshLinkToken`,(e,t,n)=>this.fetch(this.url(`CreateMeshLinkToken`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`CreateMeshLinkTokenResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getBluvoClientConfig`,(e,t,n)=>this.fetch(this.url(`GetBluvoClientConfig`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetBluvoClientConfigResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getBluvoExchanges`,(e,t,n)=>this.fetch(this.url(`GetBluvoExchanges`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetBluvoExchangesResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getBluvoOAuthURL`,(e,t,n)=>this.fetch(this.url(`GetBluvoOAuthURL`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetBluvoOAuthURLResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getBluvoWallet`,(e,t,n)=>this.fetch(this.url(`GetBluvoWallet`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetBluvoWalletResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`pingBluvoWallet`,(e,t,n)=>this.fetch(this.url(`PingBluvoWallet`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`PingBluvoWalletResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getBluvoWithdrawBalances`,(e,t,n)=>this.fetch(this.url(`GetBluvoWithdrawBalances`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetBluvoWithdrawBalancesResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`createBluvoWithdrawalQuote`,(e,t,n)=>this.fetch(this.url(`CreateBluvoWithdrawalQuote`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`CreateBluvoWithdrawalQuoteResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`executeBluvoWithdrawal`,(e,t,n)=>this.fetch(this.url(`ExecuteBluvoWithdrawal`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`ExecuteBluvoWithdrawalResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getBluvoTransaction`,(e,t,n)=>this.fetch(this.url(`GetBluvoTransaction`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`GetBluvoTransactionResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`deleteBluvoWallet`,(e,t,n)=>this.fetch(this.url(`DeleteBluvoWallet`),rv(av(e),t,n)).then(e=>iv(e).then(e=>ov(e,`DeleteBluvoWalletResponse`)),e=>{throw cv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),this.hostname=e.replace(/\/*$/,``),this.fetch=(e,n)=>t(e,n)}url(e){return this.hostname+this.path+e}},rv=(e=`{}`,t={},n=null)=>({method:`POST`,headers:{...t,"Content-Type":`application/json`,[v_e]:y_e},body:e,signal:n}),iv=e=>e.text().then(t=>{let n;try{n=JSON.parse(t)}catch(n){throw lv.new({status:e.status,cause:`JSON.parse(): ${n instanceof Error?n.message:String(n)}: response text: ${t}`})}if(!e.ok){let e=typeof n.code==`number`?n.code:0;throw(__e[e]||sv).new(n)}return n}),av=e=>JSON.stringify(e),ov=(e,t=``)=>{let n=e;if(typeof e==`string`)try{n=JSON.parse(e)}catch(e){throw lv.new({cause:`JsonDecode: JSON.parse failed: ${e.message}`})}return n},sv=class e extends Error{constructor(t={}){super(t.message),G(this,`code`,void 0),G(this,`status`,void 0),this.name=t.name||`WebrpcEndpointError`,this.code=typeof t.code==`number`?t.code:0,this.message=t.message||`endpoint error`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}static new(e){return new this({message:e.message,code:e.code,status:e.status,cause:e.cause})}},Oge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcEndpoint`,this.code=typeof t.code==`number`?t.code:0,this.message=t.message||`endpoint error`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},cv=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcRequestFailed`,this.code=typeof t.code==`number`?t.code:-1,this.message=t.message||`request failed`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},kge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadRoute`,this.code=typeof t.code==`number`?t.code:-2,this.message=t.message||`bad route`,this.status=typeof t.status==`number`?t.status:404,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Age=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadMethod`,this.code=typeof t.code==`number`?t.code:-3,this.message=t.message||`bad method`,this.status=typeof t.status==`number`?t.status:405,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},jge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadRequest`,this.code=typeof t.code==`number`?t.code:-4,this.message=t.message||`bad request`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},lv=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadResponse`,this.code=typeof t.code==`number`?t.code:-5,this.message=t.message||`bad response`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Mge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcServerPanic`,this.code=typeof t.code==`number`?t.code:-6,this.message=t.message||`server panic`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Nge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcInternalError`,this.code=typeof t.code==`number`?t.code:-7,this.message=t.message||`internal error`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Pge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcClientAborted`,this.code=typeof t.code==`number`?t.code:-8,this.message=t.message||`request aborted by client`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Fge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcStreamLost`,this.code=typeof t.code==`number`?t.code:-9,this.message=t.message||`stream lost`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Ige=class e extends sv{constructor(t={}){super(t),this.name=t.name||`WebrpcStreamFinished`,this.code=typeof t.code==`number`?t.code:-10,this.message=t.message||`stream finished`,this.status=typeof t.status==`number`?t.status:200,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Lge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`Unauthorized`,this.code=typeof t.code==`number`?t.code:1e3,this.message=t.message||`Unauthorized access`,this.status=typeof t.status==`number`?t.status:401,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Rge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`PermissionDenied`,this.code=typeof t.code==`number`?t.code:1001,this.message=t.message||`Permission denied`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},zge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`SessionExpired`,this.code=typeof t.code==`number`?t.code:1002,this.message=t.message||`Session expired`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Bge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`MethodNotFound`,this.code=typeof t.code==`number`?t.code:1003,this.message=t.message||`Method not found`,this.status=typeof t.status==`number`?t.status:404,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Vge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`RequestConflict`,this.code=typeof t.code==`number`?t.code:1004,this.message=t.message||`Conflict with target resource`,this.status=typeof t.status==`number`?t.status:409,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Hge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`Aborted`,this.code=typeof t.code==`number`?t.code:1005,this.message=t.message||`Request aborted`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Uge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`Geoblocked`,this.code=typeof t.code==`number`?t.code:1006,this.message=t.message||`Geoblocked region`,this.status=typeof t.status==`number`?t.status:451,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Wge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`RateLimited`,this.code=typeof t.code==`number`?t.code:1007,this.message=t.message||`Rate-limited. Please slow down.`,this.status=typeof t.status==`number`?t.status:429,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Gge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`ProjectNotFound`,this.code=typeof t.code==`number`?t.code:1008,this.message=t.message||`Project not found`,this.status=typeof t.status==`number`?t.status:401,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Kge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`AccessKeyNotFound`,this.code=typeof t.code==`number`?t.code:1101,this.message=t.message||`Access key not found`,this.status=typeof t.status==`number`?t.status:401,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},qge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`AccessKeyMismatch`,this.code=typeof t.code==`number`?t.code:1102,this.message=t.message||`Access key mismatch`,this.status=typeof t.status==`number`?t.status:409,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Jge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`InvalidOrigin`,this.code=typeof t.code==`number`?t.code:1103,this.message=t.message||`Invalid origin for Access Key`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Yge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`InvalidService`,this.code=typeof t.code==`number`?t.code:1104,this.message=t.message||`Service not enabled for Access key`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Xge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`UnauthorizedUser`,this.code=typeof t.code==`number`?t.code:1105,this.message=t.message||`Unauthorized user`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Zge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`QuotaExceeded`,this.code=typeof t.code==`number`?t.code:1200,this.message=t.message||`Quota request exceeded`,this.status=typeof t.status==`number`?t.status:429,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Qge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`QuotaRateLimit`,this.code=typeof t.code==`number`?t.code:1201,this.message=t.message||`Quota rate limit exceeded`,this.status=typeof t.status==`number`?t.status:429,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},$ge=class e extends sv{constructor(t={}){super(t),this.name=t.name||`NoDefaultKey`,this.code=typeof t.code==`number`?t.code:1300,this.message=t.message||`No default access key found`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},e_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`MaxAccessKeys`,this.code=typeof t.code==`number`?t.code:1301,this.message=t.message||`Access keys limit reached`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},t_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`AtLeastOneKey`,this.code=typeof t.code==`number`?t.code:1302,this.message=t.message||`You need at least one Access Key`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},n_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`Timeout`,this.code=typeof t.code==`number`?t.code:1900,this.message=t.message||`Request timed out`,this.status=typeof t.status==`number`?t.status:408,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},r_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`InvalidArgument`,this.code=typeof t.code==`number`?t.code:2e3,this.message=t.message||`Invalid argument`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},i_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`Unexpected`,this.code=typeof t.code==`number`?t.code:2001,this.message=t.message||`Unexpected server error`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},a_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`Unavailable`,this.code=typeof t.code==`number`?t.code:2002,this.message=t.message||`Unavailable resource`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},o_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`QueryFailed`,this.code=typeof t.code==`number`?t.code:2003,this.message=t.message||`Query failed`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},s_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`IntentStatus`,this.code=typeof t.code==`number`?t.code:2004,this.message=t.message||`Invalid intent status`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},c_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`IntentProtocolDeprecated`,this.code=typeof t.code==`number`?t.code:3e3,this.message=t.message||`Requested intent protocol version is outdated/deprecated. Please upgrade your Trails SDK, see https://docs.sequence.build for more information.`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},l_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`NotFound`,this.code=typeof t.code==`number`?t.code:8e3,this.message=t.message||`Resource not found`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},u_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`UnsupportedNetwork`,this.code=typeof t.code==`number`?t.code:8008,this.message=t.message||`Unsupported network`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},d_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`ClientOutdated`,this.code=typeof t.code==`number`?t.code:8009,this.message=t.message||`Client is outdated`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},f_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`IntentsSkipped`,this.code=typeof t.code==`number`?t.code:7e3,this.message=t.message||`Intents skipped as client is attempting a transaction that does not require intents`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},p_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`QuoteExpired`,this.code=typeof t.code==`number`?t.code:7001,this.message=t.message||`Intent quote has expired. Please try again.`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},m_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`HighPriceImpact`,this.code=typeof t.code==`number`?t.code:7002,this.message=t.message||`Quote unavailable due to high price impact`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},h_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`IntentsDisabled`,this.code=typeof t.code==`number`?t.code:9e3,this.message=t.message||`Intents service is currently unavailable`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},g_e=class e extends sv{constructor(t={}){super(t),this.name=t.name||`ChainNodeHealth`,this.code=typeof t.code==`number`?t.code:9001,this.message=t.message||`Intent quote is unavailable due to interrupted chain node access`,this.status=typeof t.status==`number`?t.status:503,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},__e={0:Oge,[-1]:cv,[-2]:kge,[-3]:Age,[-4]:jge,[-5]:lv,[-6]:Mge,[-7]:Nge,[-8]:Pge,[-9]:Fge,[-10]:Ige,1e3:Lge,1001:Rge,1002:zge,1003:Bge,1004:Vge,1005:Hge,1006:Uge,1007:Wge,1008:Gge,1101:Kge,1102:qge,1103:Jge,1104:Yge,1105:Xge,1200:Zge,1201:Qge,1300:$ge,1301:e_e,1302:t_e,1900:n_e,2e3:r_e,2001:i_e,2002:a_e,2003:o_e,2004:s_e,3e3:c_e,8e3:l_e,8008:u_e,8009:d_e,7e3:f_e,7001:p_e,7002:m_e,9e3:h_e,9001:g_e},v_e=`Webrpc`,y_e=`webrpc@v0.38.0;gen-typescript@v0.29.0;trails-api@v1-26.6.23-2459f503`})),x_e=o((()=>{b_e()}));function uv(e,t){if(typeof t!=`object`||!t)return t;let n=w_e[e]||[];if(!n.length)return t;for(let e of n){if(Array.isArray(e)){let[n,r]=e;if(n.endsWith(`[]`)){let e=t[n.slice(0,-2)];if(Array.isArray(e))for(let t=0;t<e.length;t++)e[t]=uv(r,e[t])}else if(t[n])if(r.endsWith(`[]`)){let e=r.slice(0,-2),i=t[n];if(Array.isArray(i))for(let t=0;t<i.length;t++)i[t]=uv(e,i[t])}else t[n]=uv(r,t[n]);continue}if(e.endsWith(`[]`)){let n=e.slice(0,-2),r=t[n];if(Array.isArray(r))for(let e=0;e<r.length;e++){let t=r[e];if(typeof t==`string`)try{r[e]=BigInt(t)}catch{throw Ev.new({cause:`Invalid bigint value for ${n}[${e}]: ${t}`})}}continue}let n=t[e];if(typeof n==`string`)try{t[e]=BigInt(n)}catch{throw Ev.new({cause:`Invalid bigint value for ${e}: ${n}`})}}return t}var dv,fv,pv,mv,hv,gv,_v,vv,yv,S_e,C_e,bv,xv,w_e,Sv,Cv,wv,T_e,Tv,E_e,D_e,O_e,Ev,k_e,A_e,j_e,M_e,N_e,P_e,F_e,I_e,L_e,R_e,z_e,B_e,V_e,H_e,U_e,W_e,G_e,K_e,q_e,J_e,Y_e,X_e,Z_e,Q_e,$_e,eve,tve,nve,rve,ive,ave,ove,sve,cve,lve,uve,dve,fve,pve,mve,hve,gve,_ve=o((()=>{Zr(),dv={SWAP:`SWAP`,FUND:`FUND`,EARN:`EARN`,PAY:`PAY`,WITHDRAW:`WITHDRAW`},fv={EXACT_INPUT:`EXACT_INPUT`,EXACT_OUTPUT:`EXACT_OUTPUT`},pv={AUTO:`AUTO`,CCTP:`CCTP`,EVERLONG:`EVERLONG`,GASZIP:`GASZIP`,HYPERLANE:`HYPERLANE`,LIFI:`LIFI`,LZ_OFT:`LZ_OFT`,LZ_TRANSFER:`LZ_TRANSFER`,OIF:`OIF`,RELAY:`RELAY`,SOMNIA_EXCHANGE:`SOMNIA_EXCHANGE`,SOMNIA_SWAP:`SOMNIA_SWAP`,SUSHI:`SUSHI`,WETH:`WETH`,ZEROX:`ZEROX`},mv={WALLET:`WALLET`,DIRECT_TRANSFER:`DIRECT_TRANSFER`,ONRAMP_MESH:`ONRAMP_MESH`,ONRAMP_MELD:`ONRAMP_MELD`,ONRAMP_BLUVO:`ONRAMP_BLUVO`},hv={SOLANA:`SOLANA`,TRON:`TRON`},gv={ORIGIN:`ORIGIN`,DESTINATION:`DESTINATION`},_v={PENDING:`PENDING`,DEPOSITED:`DEPOSITED`,FILLED:`FILLED`,REFUNDED:`REFUNDED`,FAILED:`FAILED`},vv={v1:`v1`,v1_5:`v1.5`},yv={QUOTED:`QUOTED`,COMMITTED:`COMMITTED`,EXECUTING:`EXECUTING`,FAILED:`FAILED`,SUCCEEDED:`SUCCEEDED`,ABORTED:`ABORTED`,REFUNDED:`REFUNDED`,INVALID:`INVALID`},S_e={UNKNOWN:`UNKNOWN`,ON_HOLD:`ON_HOLD`,PENDING:`PENDING`,RELAYING:`RELAYING`,SENT:`SENT`,ERRORED:`ERRORED`,MINING:`MINING`,SUCCEEDED:`SUCCEEDED`,FAILED:`FAILED`,ABORTED:`ABORTED`,REVERTED:`REVERTED`},C_e=class{constructor(e,t){G(this,`hostname`,void 0),G(this,`fetch`,void 0),G(this,`path`,`/rpc/Trails/`),G(this,`queryKey`,{ping:()=>[`Trails`,`ping`],runtimeStatus:()=>[`Trails`,`runtimeStatus`],clock:()=>[`Trails`,`clock`],quoteIntent:e=>[`Trails`,`quoteIntent`,e],quoteIntentEdge:e=>[`Trails`,`quoteIntentEdge`,e],getEdgeStatus:e=>[`Trails`,`getEdgeStatus`,e],getEdges:()=>[`Trails`,`getEdges`],commitIntent:e=>[`Trails`,`commitIntent`,e],executeIntent:e=>[`Trails`,`executeIntent`,e],retryIntent:e=>[`Trails`,`retryIntent`,e],waitIntentReceipt:e=>[`Trails`,`waitIntentReceipt`,e],getIntentReceipt:e=>[`Trails`,`getIntentReceipt`,e],getIntent:e=>[`Trails`,`getIntent`,e],searchIntents:e=>[`Trails`,`searchIntents`,e],getIntentHistory:e=>[`Trails`,`getIntentHistory`,e],abortIntent:e=>[`Trails`,`abortIntent`,e],prepareIntentRecovery:e=>[`Trails`,`prepareIntentRecovery`,e],buildIntentRecoveryTransaction:e=>[`Trails`,`buildIntentRecoveryTransaction`,e],buildOIFRefundTransaction:e=>[`Trails`,`buildOIFRefundTransaction`,e],getChains:e=>[`Trails`,`getChains`,e],getExactOutputRoutes:e=>[`Trails`,`getExactOutputRoutes`,e],getExactInputRoutes:e=>[`Trails`,`getExactInputRoutes`,e],getTokenList:e=>[`Trails`,`getTokenList`,e],getTokenPrices:e=>[`Trails`,`getTokenPrices`,e],getExchangeRate:e=>[`Trails`,`getExchangeRate`,e],getCountryList:()=>[`Trails`,`getCountryList`],getTrailsContracts:()=>[`Trails`,`getTrailsContracts`],getProtocolContracts:e=>[`Trails`,`getProtocolContracts`,e],getSupportedIntentProtocols:()=>[`Trails`,`getSupportedIntentProtocols`],getDefaultIntentProtocol:()=>[`Trails`,`getDefaultIntentProtocol`],getEarnPools:e=>[`Trails`,`getEarnPools`,e],yieldGetProviders:e=>[`Trails`,`yieldGetProviders`,e],yieldGetProvider:e=>[`Trails`,`yieldGetProvider`,e],yieldGetNetworks:e=>[`Trails`,`yieldGetNetworks`,e],yieldGetMarkets:e=>[`Trails`,`yieldGetMarkets`,e],yieldGetMarketById:e=>[`Trails`,`yieldGetMarketById`,e],yieldGetAggregateBalances:e=>[`Trails`,`yieldGetAggregateBalances`,e],yieldCreateEnterAction:e=>[`Trails`,`yieldCreateEnterAction`,e],yieldCreateExitAction:e=>[`Trails`,`yieldCreateExitAction`,e],getFiatCurrencyList:()=>[`Trails`,`getFiatCurrencyList`],getIntentTransactionHistory:e=>[`Trails`,`getIntentTransactionHistory`,e]}),G(this,`ping`,(e,t)=>this.fetch(this.url(`Ping`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`PingResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`runtimeStatus`,(e,t)=>this.fetch(this.url(`RuntimeStatus`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`RuntimeStatusResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`clock`,(e,t)=>this.fetch(this.url(`Clock`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`ClockResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`quoteIntent`,(e,t,n)=>this.fetch(this.url(`QuoteIntent`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`QuoteIntentResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`quoteIntentEdge`,(e,t,n)=>this.fetch(this.url(`QuoteIntentEdge`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`QuoteIntentEdgeResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getEdgeStatus`,(e,t,n)=>this.fetch(this.url(`GetEdgeStatus`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetEdgeStatusResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getEdges`,(e,t)=>this.fetch(this.url(`GetEdges`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`GetEdgesResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`commitIntent`,(e,t,n)=>this.fetch(this.url(`CommitIntent`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`CommitIntentResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`executeIntent`,(e,t,n)=>this.fetch(this.url(`ExecuteIntent`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`ExecuteIntentResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`retryIntent`,(e,t,n)=>this.fetch(this.url(`RetryIntent`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`RetryIntentResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`waitIntentReceipt`,(e,t,n)=>this.fetch(this.url(`WaitIntentReceipt`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`WaitIntentReceiptResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getIntentReceipt`,(e,t,n)=>this.fetch(this.url(`GetIntentReceipt`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetIntentReceiptResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getIntent`,(e,t,n)=>this.fetch(this.url(`GetIntent`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetIntentResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`searchIntents`,(e,t,n)=>this.fetch(this.url(`SearchIntents`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`SearchIntentsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getIntentHistory`,(e,t,n)=>this.fetch(this.url(`GetIntentHistory`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetIntentHistoryResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`abortIntent`,(e,t,n)=>this.fetch(this.url(`AbortIntent`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`AbortIntentResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`prepareIntentRecovery`,(e,t,n)=>this.fetch(this.url(`PrepareIntentRecovery`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`PrepareIntentRecoveryResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`buildIntentRecoveryTransaction`,(e,t,n)=>this.fetch(this.url(`BuildIntentRecoveryTransaction`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`BuildIntentRecoveryTransactionResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`buildOIFRefundTransaction`,(e,t,n)=>this.fetch(this.url(`BuildOIFRefundTransaction`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`BuildOIFRefundTransactionResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getChains`,(e,t,n)=>this.fetch(this.url(`GetChains`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetChainsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getExactOutputRoutes`,(e,t,n)=>this.fetch(this.url(`GetExactOutputRoutes`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetExactOutputRoutesResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getExactInputRoutes`,(e,t,n)=>this.fetch(this.url(`GetExactInputRoutes`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetExactInputRoutesResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getTokenList`,(e,t,n)=>this.fetch(this.url(`GetTokenList`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetTokenListResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getTokenPrices`,(e,t,n)=>this.fetch(this.url(`GetTokenPrices`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetTokenPricesResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getExchangeRate`,(e,t,n)=>this.fetch(this.url(`GetExchangeRate`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetExchangeRateResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getCountryList`,(e,t)=>this.fetch(this.url(`GetCountryList`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`GetCountryListResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getTrailsContracts`,(e,t)=>this.fetch(this.url(`GetTrailsContracts`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`GetTrailsContractsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getProtocolContracts`,(e,t,n)=>this.fetch(this.url(`GetProtocolContracts`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetProtocolContractsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getSupportedIntentProtocols`,(e,t)=>this.fetch(this.url(`GetSupportedIntentProtocols`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`GetSupportedIntentProtocolsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getDefaultIntentProtocol`,(e,t)=>this.fetch(this.url(`GetDefaultIntentProtocol`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`GetDefaultIntentProtocolResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getEarnPools`,(e,t,n)=>this.fetch(this.url(`GetEarnPools`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetEarnPoolsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldGetProviders`,(e,t,n)=>this.fetch(this.url(`YieldGetProviders`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetYieldProvidersResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldGetProvider`,(e,t,n)=>this.fetch(this.url(`YieldGetProvider`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetYieldProviderResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldGetNetworks`,(e,t,n)=>this.fetch(this.url(`YieldGetNetworks`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetYieldNetworksResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldGetMarkets`,(e,t,n)=>this.fetch(this.url(`YieldGetMarkets`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetYieldMarketsResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldGetMarketById`,(e,t,n)=>this.fetch(this.url(`YieldGetMarketById`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetYieldMarketByIdResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldGetAggregateBalances`,(e,t,n)=>this.fetch(this.url(`YieldGetAggregateBalances`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetYieldAggregateBalancesResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldCreateEnterAction`,(e,t,n)=>this.fetch(this.url(`YieldCreateEnterAction`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`CreateYieldActionResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`yieldCreateExitAction`,(e,t,n)=>this.fetch(this.url(`YieldCreateExitAction`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`CreateYieldActionResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getFiatCurrencyList`,(e,t)=>this.fetch(this.url(`GetFiatCurrencyList`),bv(`{}`,e,t)).then(e=>xv(e).then(e=>Cv(e,`GetFiatCurrencyListResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),G(this,`getIntentTransactionHistory`,(e,t,n)=>this.fetch(this.url(`GetIntentTransactionHistory`),bv(Sv(e),t,n)).then(e=>xv(e).then(e=>Cv(e,`GetIntentTransactionHistoryResponse`)),e=>{throw Tv.new({cause:`fetch(): ${e instanceof Error?e.message:String(e)}`})})),this.hostname=e.replace(/\/*$/,``),this.fetch=(e,n)=>t(e,n)}url(e){return this.hostname+this.path+e}},bv=(e=`{}`,t={},n=null)=>({method:`POST`,headers:{...t,"Content-Type":`application/json`,[hve]:gve},body:e,signal:n}),xv=e=>e.text().then(t=>{let n;try{n=JSON.parse(t)}catch(n){throw Ev.new({status:e.status,cause:`JSON.parse(): ${n instanceof Error?n.message:String(n)}: response text: ${t}`})}if(!e.ok){let e=typeof n.code==`number`?n.code:0;throw(mve[e]||wv).new(n)}return n}),w_e={CommitIntentRequest:[[`intent`,`Intent`]],DepositIntentEntry:[`permitAmount`],DepositSignature:[`permitAmount`,[`selectedGasFeeOption`,`FeeOption`]],DepositTransaction:[`amount`,`value`],EdgeHandoff:[`amount`],EdgeQuoteRequest:[`originTokenAmount`],EdgeQuoteResponse:[`originTokenAmount`,[`handoff`,`EdgeHandoff`]],ExecuteIntentRequest:[[`depositSignature`,`DepositSignature`]],FeeOption:[`amount`],GasFeeOptions:[[`feeOptions`,`FeeOption[]`]],GetIntentHistoryResponse:[[`intents`,`IntentHistory[]`]],GetIntentReceiptResponse:[[`intentReceipt`,`IntentReceipt`]],GetIntentResponse:[[`intent`,`Intent`]],GetIntentTransactionHistoryResponse:[[`intents`,`IntentSummary[]`]],Intent:[[`quoteRequest`,`QuoteIntentRequest`],`salt`,[`depositTransaction`,`DepositTransaction`],[`edge`,`IntentEdgeMetadata`],[`originCalls`,`IntentCalls`],[`destinationCalls`,`IntentCalls`],[`originPrecondition`,`TransactionPrecondition`],[`destinationPrecondition`,`TransactionPrecondition`],[`originMetaTxn`,`MetaTxn`],[`destinationMetaTxn`,`MetaTxn`],[`quote`,`IntentProviderQuote`],[`fees`,`IntentFees`],[`gasFeeOptions`,`GasFeeOptions`]],IntentCalls:[`space`,`nonce`,[`calls`,`TransactionCall[]`]],IntentEdgeMetadata:[`edgeTokenAmount`],IntentFees:[[`originGas`,`IntentTransactionGasFee`],[`destinationGas`,`IntentTransactionGasFee`],[`provider`,`IntentProviderFees`],`feeTokenAmount`,`feeTokenTotal`,`gasFeeTotal`,`trailsFeeTotal`,`collectorFeeTotal`,`providerFeeTotal`,`totalFeeAmount`],IntentHistory:[[`receipt`,`IntentReceipt`]],IntentProviderFees:[`quoteProviderFee`,`trailsFee`,`quoteProviderWithTrailsFee`,`totalFeeAmount`],IntentProviderQuote:[`fromAmount`,`fromAmountMin`,`toAmount`,`toAmountMin`],IntentReceipt:[[`depositTransaction`,`IntentTransaction`],[`originTransaction`,`IntentTransaction`],[`destinationTransaction`,`IntentTransaction`],[`refundTransaction`,`IntentTransaction`],[`summary`,`IntentReceiptSummary`],[`edge`,`IntentEdgeMetadata`]],IntentReceiptSummary:[`originTokenAmount`,`quotedOriginTokenAmount`,`destinationTokenAmount`,`quotedDestinationTokenAmount`,[`edge`,`IntentEdgeMetadata`]],IntentSummary:[`originTokenAmount`,`quotedOriginTokenAmount`,`destinationTokenAmount`,`quotedDestinationTokenAmount`],IntentTransaction:[`tokenAmount`,`bridgeGas`,[`precondition`,`TransactionPrecondition`],[`depositIntentEntry`,`DepositIntentEntry`]],IntentTransactionGasFee:[`totalGasLimit`,`gasPrice`,`totalFeeAmount`,[`metaTxnFeeDetails`,`MetaTxnFeeDetails`]],MetaTxn:[`bridgeGas`],MetaTxnFeeDetails:[`estimatedGasLimit`,`feeNative`],PassThroughTransaction:[`amount`,`value`],PassthroughInfo:[[`passthroughTransaction`,`PassThroughTransaction`],[`quote`,`IntentProviderQuote`],[`fees`,`IntentFees`]],QuoteIntentEdgeRequest:[[`intent`,`QuoteIntentRequest`],[`edge`,`EdgeQuoteRequest`]],QuoteIntentEdgeResponse:[[`intent`,`Intent`],[`gasFeeOptions`,`GasFeeOptions`],[`passthrough`,`PassthroughInfo`],[`edge`,`EdgeQuoteResponse`]],QuoteIntentRequest:[`destinationCallValue`,`originTokenAmount`,`destinationTokenAmount`],QuoteIntentResponse:[[`intent`,`Intent`],[`gasFeeOptions`,`GasFeeOptions`],[`passthrough`,`PassthroughInfo`]],SearchIntentsResponse:[[`intents`,`Intent[]`]],TransactionCall:[`value`,`gasLimit`],TransactionPrecondition:[`minAmount`],WaitIntentReceiptResponse:[[`intentReceipt`,`IntentReceipt`]]},Sv=e=>JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t),Cv=(e,t=``)=>{let n=e;if(typeof e==`string`)try{n=JSON.parse(e)}catch(e){throw Ev.new({cause:`JsonDecode: JSON.parse failed: ${e.message}`})}return uv(t,n)},wv=class e extends Error{constructor(t={}){super(t.message),G(this,`code`,void 0),G(this,`status`,void 0),this.name=t.name||`WebrpcEndpointError`,this.code=typeof t.code==`number`?t.code:0,this.message=t.message||`endpoint error`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}static new(e){return new this({message:e.message,code:e.code,status:e.status,cause:e.cause})}},T_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcEndpoint`,this.code=typeof t.code==`number`?t.code:0,this.message=t.message||`endpoint error`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Tv=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcRequestFailed`,this.code=typeof t.code==`number`?t.code:-1,this.message=t.message||`request failed`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},E_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadRoute`,this.code=typeof t.code==`number`?t.code:-2,this.message=t.message||`bad route`,this.status=typeof t.status==`number`?t.status:404,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},D_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadMethod`,this.code=typeof t.code==`number`?t.code:-3,this.message=t.message||`bad method`,this.status=typeof t.status==`number`?t.status:405,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},O_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadRequest`,this.code=typeof t.code==`number`?t.code:-4,this.message=t.message||`bad request`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Ev=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcBadResponse`,this.code=typeof t.code==`number`?t.code:-5,this.message=t.message||`bad response`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},k_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcServerPanic`,this.code=typeof t.code==`number`?t.code:-6,this.message=t.message||`server panic`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},A_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcInternalError`,this.code=typeof t.code==`number`?t.code:-7,this.message=t.message||`internal error`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},j_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcClientAborted`,this.code=typeof t.code==`number`?t.code:-8,this.message=t.message||`request aborted by client`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},M_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcStreamLost`,this.code=typeof t.code==`number`?t.code:-9,this.message=t.message||`stream lost`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},N_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`WebrpcStreamFinished`,this.code=typeof t.code==`number`?t.code:-10,this.message=t.message||`stream finished`,this.status=typeof t.status==`number`?t.status:200,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},P_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`Unauthorized`,this.code=typeof t.code==`number`?t.code:1e3,this.message=t.message||`Unauthorized access`,this.status=typeof t.status==`number`?t.status:401,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},F_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`PermissionDenied`,this.code=typeof t.code==`number`?t.code:1001,this.message=t.message||`Permission denied`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},I_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`SessionExpired`,this.code=typeof t.code==`number`?t.code:1002,this.message=t.message||`Session expired`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},L_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`MethodNotFound`,this.code=typeof t.code==`number`?t.code:1003,this.message=t.message||`Method not found`,this.status=typeof t.status==`number`?t.status:404,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},R_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`RequestConflict`,this.code=typeof t.code==`number`?t.code:1004,this.message=t.message||`Conflict with target resource`,this.status=typeof t.status==`number`?t.status:409,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},z_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`Aborted`,this.code=typeof t.code==`number`?t.code:1005,this.message=t.message||`Request aborted`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},B_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`Geoblocked`,this.code=typeof t.code==`number`?t.code:1006,this.message=t.message||`Geoblocked region`,this.status=typeof t.status==`number`?t.status:451,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},V_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`RateLimited`,this.code=typeof t.code==`number`?t.code:1007,this.message=t.message||`Rate-limited. Please slow down.`,this.status=typeof t.status==`number`?t.status:429,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},H_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`ProjectNotFound`,this.code=typeof t.code==`number`?t.code:1008,this.message=t.message||`Project not found`,this.status=typeof t.status==`number`?t.status:401,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},U_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`AccessKeyNotFound`,this.code=typeof t.code==`number`?t.code:1101,this.message=t.message||`Access key not found`,this.status=typeof t.status==`number`?t.status:401,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},W_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`AccessKeyMismatch`,this.code=typeof t.code==`number`?t.code:1102,this.message=t.message||`Access key mismatch`,this.status=typeof t.status==`number`?t.status:409,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},G_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`InvalidOrigin`,this.code=typeof t.code==`number`?t.code:1103,this.message=t.message||`Invalid origin for Access Key`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},K_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`InvalidService`,this.code=typeof t.code==`number`?t.code:1104,this.message=t.message||`Service not enabled for Access key`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},q_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`UnauthorizedUser`,this.code=typeof t.code==`number`?t.code:1105,this.message=t.message||`Unauthorized user`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},J_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`QuotaExceeded`,this.code=typeof t.code==`number`?t.code:1200,this.message=t.message||`Quota request exceeded`,this.status=typeof t.status==`number`?t.status:429,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Y_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`QuotaRateLimit`,this.code=typeof t.code==`number`?t.code:1201,this.message=t.message||`Quota rate limit exceeded`,this.status=typeof t.status==`number`?t.status:429,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},X_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`NoDefaultKey`,this.code=typeof t.code==`number`?t.code:1300,this.message=t.message||`No default access key found`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Z_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`MaxAccessKeys`,this.code=typeof t.code==`number`?t.code:1301,this.message=t.message||`Access keys limit reached`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},Q_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`AtLeastOneKey`,this.code=typeof t.code==`number`?t.code:1302,this.message=t.message||`You need at least one Access Key`,this.status=typeof t.status==`number`?t.status:403,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},$_e=class e extends wv{constructor(t={}){super(t),this.name=t.name||`Timeout`,this.code=typeof t.code==`number`?t.code:1900,this.message=t.message||`Request timed out`,this.status=typeof t.status==`number`?t.status:408,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},eve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`InvalidArgument`,this.code=typeof t.code==`number`?t.code:2e3,this.message=t.message||`Invalid argument`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},tve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`Unexpected`,this.code=typeof t.code==`number`?t.code:2001,this.message=t.message||`Unexpected server error`,this.status=typeof t.status==`number`?t.status:500,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},nve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`Unavailable`,this.code=typeof t.code==`number`?t.code:2002,this.message=t.message||`Unavailable resource`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},rve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`QueryFailed`,this.code=typeof t.code==`number`?t.code:2003,this.message=t.message||`Query failed`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},ive=class e extends wv{constructor(t={}){super(t),this.name=t.name||`IntentStatus`,this.code=typeof t.code==`number`?t.code:2004,this.message=t.message||`Invalid intent status`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},ave=class e extends wv{constructor(t={}){super(t),this.name=t.name||`IntentProtocolDeprecated`,this.code=typeof t.code==`number`?t.code:3e3,this.message=t.message||`Requested intent protocol version is outdated/deprecated. Please upgrade your Trails SDK, see https://docs.sequence.build for more information.`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},ove=class e extends wv{constructor(t={}){super(t),this.name=t.name||`NotFound`,this.code=typeof t.code==`number`?t.code:8e3,this.message=t.message||`Resource not found`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},sve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`UnsupportedNetwork`,this.code=typeof t.code==`number`?t.code:8008,this.message=t.message||`Unsupported network`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},cve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`ClientOutdated`,this.code=typeof t.code==`number`?t.code:8009,this.message=t.message||`Client is outdated`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},lve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`IntentsSkipped`,this.code=typeof t.code==`number`?t.code:7e3,this.message=t.message||`Intents skipped as client is attempting a transaction that does not require intents`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},uve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`QuoteExpired`,this.code=typeof t.code==`number`?t.code:7001,this.message=t.message||`Intent quote has expired. Please try again.`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},dve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`HighPriceImpact`,this.code=typeof t.code==`number`?t.code:7002,this.message=t.message||`Quote unavailable due to high price impact`,this.status=typeof t.status==`number`?t.status:422,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},fve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`IntentsDisabled`,this.code=typeof t.code==`number`?t.code:9e3,this.message=t.message||`Intents service is currently unavailable`,this.status=typeof t.status==`number`?t.status:400,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},pve=class e extends wv{constructor(t={}){super(t),this.name=t.name||`ChainNodeHealth`,this.code=typeof t.code==`number`?t.code:9001,this.message=t.message||`Intent quote is unavailable due to interrupted chain node access`,this.status=typeof t.status==`number`?t.status:503,t.cause!==void 0&&(this.cause=t.cause),Object.setPrototypeOf(this,e.prototype)}},mve={0:T_e,[-1]:Tv,[-2]:E_e,[-3]:D_e,[-4]:O_e,[-5]:Ev,[-6]:k_e,[-7]:A_e,[-8]:j_e,[-9]:M_e,[-10]:N_e,1e3:P_e,1001:F_e,1002:I_e,1003:L_e,1004:R_e,1005:z_e,1006:B_e,1007:V_e,1008:H_e,1101:U_e,1102:W_e,1103:G_e,1104:K_e,1105:q_e,1200:J_e,1201:Y_e,1300:X_e,1301:Z_e,1302:Q_e,1900:$_e,2e3:eve,2001:tve,2002:nve,2003:rve,2004:ive,3e3:ave,8e3:ove,8008:sve,8009:cve,7e3:lve,7001:uve,7002:dve,9e3:fve,9001:pve},hve=`Webrpc`,gve=`webrpc@v0.38.0;gen-typescript@v0.29.0;trails-api@v1-26.6.23-2459f503`})),vve,Dv=o((()=>{x_e(),_ve(),_ve(),vve=class extends C_e{constructor(e,t){let n=(n,r)=>{let i={};return t?.jwt&&t?.jwt.length>0&&(i.Authorization=`BEARER ${t?.jwt}`),e&&e.length>0&&(i[`X-Access-Key`]=e),r=r||{},r.headers={...r.headers,...i},fetch(n,r)},r=t?.hostname&&t?.hostname.length>0?t?.hostname:`https://trails-api.sequence.app`,i=r.endsWith(`/`)?r.slice(0,-1):r;super(i,n)}getHostname(){return this.hostname}getFetch(){return this.fetch}}})),yve,bve,Ov=o((()=>{pm(),yve=50000n,bve=eie*32n})),xve,Sve=o((()=>{Sc(),Rc(),Ac(),ym(),Wm(),vm(),sg(),dm(),Ov(),xve={block:uie({format(e){let t=e.transactions?.map(e=>{if(typeof e==`string`)return e;let t=xve.transaction?.format(e);return t.typeHex===`0x71`?t.type=`eip712`:t.typeHex===`0xff`&&(t.type=`priority`),t});return{l1BatchNumber:e.l1BatchNumber?bc(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?bc(e.l1BatchTimestamp):null,transactions:t}}}),transaction:cie({format(e){let t={};return e.type===`0x71`?t.type=`eip712`:e.type===`0xff`&&(t.type=`priority`),{...t,l1BatchNumber:e.l1BatchNumber?bc(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?bc(e.l1BatchTxIndex):null}}}),transactionReceipt:pse({format(e){return{l1BatchNumber:e.l1BatchNumber?bc(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?bc(e.l1BatchTxIndex):null,logs:e.logs.map(e=>({...Um(e),l1BatchNumber:e.l1BatchNumber?bc(e.l1BatchNumber):null,transactionLogIndex:xc(e.transactionLogIndex),logType:e.logType})),l2ToL1Logs:e.l2ToL1Logs.map(e=>({blockNumber:bc(e.blockHash),blockHash:e.blockHash,l1BatchNumber:e.l1BatchNumber?bc(e.l1BatchNumber):null,transactionIndex:bc(e.transactionIndex),shardId:bc(e.shardId),isService:e.isService,sender:e.sender,key:e.key,value:e.value,transactionHash:e.transactionHash,logIndex:bc(e.logIndex)}))}}}),transactionRequest:Yre({exclude:[`customSignature`,`factoryDeps`,`gasPerPubdata`,`paymaster`,`paymasterInput`],format(e){return e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:Cc(e.gasPerPubdata)}:{gasPerPubdata:Cc(yve)},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(Pc(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps.map(e=>Array.from(Pc(e)))}:{},...e.customSignature?{customSignature:Array.from(Pc(e.customSignature))}:{}},type:`0x71`}:{}}})}})),Cve,wve=o((()=>{Fs(),Cve=class extends Ps{constructor(){super([`Transaction is not an EIP712 transaction.`,``,`Transaction must:`,' - include `type: "eip712"`'," - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`"].join(`
113
113
  `),{name:`InvalidEip712TransactionError`})}}}));function Tve(e){return!!(e.type===`eip712`||`customSignature`in e&&e.customSignature||`paymaster`in e&&e.paymaster||`paymasterInput`in e&&e.paymasterInput||`gasPerPubdata`in e&&typeof e.gasPerPubdata==`bigint`||`factoryDeps`in e&&e.factoryDeps)}var Eve=o((()=>{}));function Dve(e){let{chainId:t,to:n,from:r,paymaster:i,paymasterInput:a}=e;if(!Tve(e))throw new Cve;if(!t||t<=0)throw new xh({chainId:t});if(n&&!yu(n))throw new du({address:n});if(r&&!yu(r))throw new du({address:r});if(i&&!yu(i))throw new du({address:i});if(i&&!a)throw new Ps("`paymasterInput` must be provided when `paymaster` is defined");if(!i&&a)throw new Ps("`paymaster` must be provided when `paymasterInput` is defined")}var Ove=o((()=>{fu(),Fs(),Sh(),xu(),wve(),Eve()}));function kve(e,t){return Tve(e)?Ave(e):qce(e,t)}function Ave(e){let{chainId:t,gas:n,nonce:r,to:i,from:a,value:o,maxFeePerGas:s,maxPriorityFeePerGas:c,customSignature:l,factoryDeps:u,paymaster:d,paymasterInput:f,gasPerPubdata:p,data:m}=e;return Dve(e),Cu([`0x71`,$p([r?Cc(r):`0x`,c?Cc(c):`0x`,s?Cc(s):`0x`,n?Cc(n):`0x`,i??`0x`,o?Cc(o):`0x`,m??`0x`,Cc(t),Cc(``),Cc(``),Cc(t),a??`0x`,Cc(p||yve),u??[],l??`0x`,d&&f?[d,f]:[]])])}var jve,Mve=o((()=>{wu(),Ac(),em(),xg(),Ov(),Ove(),Eve(),jve={transaction:kve}})),Nve,Pve,Fve,Ive=o((()=>{Fs(),Nve=class extends Ps{constructor({givenLength:e,maxBytecodeSize:t}){super(`Bytecode cannot be longer than ${t} bytes. Given length: ${e}`,{name:`BytecodeLengthExceedsMaxSizeError`})}},Pve=class extends Ps{constructor({givenLengthInWords:e}){super(`Bytecode length in 32-byte words must be odd. Given length in words: ${e}`,{name:`BytecodeLengthInWordsMustBeOddError`})}},Fve=class extends Ps{constructor({givenLength:e}){super(`The bytecode length in bytes must be divisible by 32. Given length: ${e}`,{name:`BytecodeLengthMustBeDivisibleBy32Error`})}}}));function Lve(e){let t=jc(e);if(t.length%32!=0)throw new Fve({givenLength:t.length});if(t.length>bve)throw new Nve({givenLength:t.length,maxBytecodeSize:bve});let n=jc(Sie(t)),r=t.length/32;if(r%2==0)throw new Pve({givenLengthInWords:r});let i=lc(jc(r),{size:2}),a=new Uint8Array([1,0]);return n.set(a,0),n.set(i,2),n}var Rve=o((()=>{fc(),Rc(),km(),Ov(),Ive()}));function zve(e){let{gas:t,nonce:n,to:r,from:i,value:a,maxFeePerGas:o,maxPriorityFeePerGas:s,factoryDeps:c,paymaster:l,paymasterInput:u,gasPerPubdata:d,data:f}=e;return{txType:113n,from:BigInt(i),to:r?BigInt(r):0n,gasLimit:t??0n,gasPerPubdataByteLimit:d??50000n,maxFeePerGas:o??0n,maxPriorityFeePerGas:s??0n,paymaster:l?BigInt(l):0n,nonce:n?BigInt(n):0n,value:a??0n,data:f??`0x`,factoryDeps:c?.map(e=>Cc(Lve(e)))??[],paymasterInput:u||`0x`}}var Bve,Vve=o((()=>{Ac(),Ov(),Ove(),Rve(),Bve=e=>{Dve(e);let t=zve(e);return{domain:{name:`zkSync`,version:`2`,chainId:e.chainId},types:{Transaction:[{name:`txType`,type:`uint256`},{name:`from`,type:`uint256`},{name:`to`,type:`uint256`},{name:`gasLimit`,type:`uint256`},{name:`gasPerPubdataByteLimit`,type:`uint256`},{name:`maxFeePerGas`,type:`uint256`},{name:`maxPriorityFeePerGas`,type:`uint256`},{name:`paymaster`,type:`uint256`},{name:`nonce`,type:`uint256`},{name:`value`,type:`uint256`},{name:`data`,type:`bytes`},{name:`factoryDeps`,type:`bytes32[]`},{name:`paymasterInput`,type:`bytes`}]},primaryType:`Transaction`,message:t}}})),Hve,Uve=o((()=>{Sve(),Mve(),Vve(),Hve={blockTime:1e3,formatters:xve,serializers:jve,custom:{getEip712Domain:Bve}}})),Wve,Gve=o((()=>{Wve={gasPriceOracle:{address:`0x420000000000000000000000000000000000000F`},l1Block:{address:`0x4200000000000000000000000000000000000015`},l2CrossDomainMessenger:{address:`0x4200000000000000000000000000000000000007`},l2Erc721Bridge:{address:`0x4200000000000000000000000000000000000014`},l2StandardBridge:{address:`0x4200000000000000000000000000000000000010`},l2ToL1MessagePasser:{address:`0x4200000000000000000000000000000000000016`}}})),Kve,qve=o((()=>{Sc(),ym(),vm(),sg(),Kve={block:uie({format(e){return{transactions:e.transactions?.map(e=>{if(typeof e==`string`)return e;let t=_m(e);return t.typeHex===`0x7e`&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?bc(e.mint):void 0,t.sourceHash=e.sourceHash,t.type=`deposit`),t}),stateRoot:e.stateRoot}}}),transaction:cie({format(e){let t={};return e.type===`0x7e`&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?bc(e.mint):void 0,t.sourceHash=e.sourceHash,t.type=`deposit`),t}}),transactionReceipt:pse({format(e){return{l1GasPrice:e.l1GasPrice?bc(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?bc(e.l1GasUsed):null,l1Fee:e.l1Fee?bc(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})}}));function Jve(e,t){return Xve(e)?Yve(e):qce(e,t)}function Yve(e){Zve(e);let{sourceHash:t,data:n,from:r,gas:i,isSystemTx:a,mint:o,to:s,value:c}=e;return Cu([`0x7e`,$p([t,r,s??`0x`,o?Cc(o):`0x`,c?Cc(c):`0x`,i?Cc(i):`0x`,a?`0x1`:`0x`,n??`0x`])])}function Xve(e){return e.type===`deposit`||e.sourceHash!==void 0}function Zve(e){let{from:t,to:n}=e;if(t&&!yu(t))throw new du({address:t});if(n&&!yu(n))throw new du({address:n})}var Qve,$ve=o((()=>{fu(),xu(),wu(),Ac(),em(),xg(),Qve={transaction:Jve}})),kv,Av=o((()=>{Gve(),qve(),$ve(),kv={blockTime:2e3,contracts:Wve,formatters:Kve,serializers:Qve}})),eye,jv,tye=o((()=>{wg(),eye=42161,jv=Cg({id:33139,name:`ApeChain`,nativeCurrency:{name:`ApeCoin`,symbol:`APE`,decimals:18},rpcUrls:{default:{http:[`https://rpc.apechain.com/http`],webSocket:[`wss://rpc.apechain.com/ws`]}},blockExplorers:{default:{name:`Apescan`,url:`https://apescan.io`,apiUrl:`https://api.apescan.io/api`}},contracts:{multicall3:{address:`0xcA11bde05977b3631167028862bE2a173976CA11`,blockCreated:20889}},sourceId:eye})})),Mv,nye=o((()=>{wg(),Mv=Cg({id:42161,name:`Arbitrum One`,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},blockTime:250,rpcUrls:{default:{http:[`https://arb1.arbitrum.io/rpc`]}},blockExplorers:{default:{name:`Arbiscan`,url:`https://arbiscan.io`,apiUrl:`https://api.arbiscan.io/api`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:7654707}}})})),Nv,rye=o((()=>{wg(),Nv=Cg({id:42170,name:`Arbitrum Nova`,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://nova.arbitrum.io/rpc`]}},blockExplorers:{default:{name:`Arbiscan`,url:`https://nova.arbiscan.io`,apiUrl:`https://api-nova.arbiscan.io/api`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:1746963}}})})),Pv,iye=o((()=>{wg(),Pv=Cg({id:421614,name:`Arbitrum Sepolia`,blockTime:250,nativeCurrency:{name:`Arbitrum Sepolia Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://sepolia-rollup.arbitrum.io/rpc`]}},blockExplorers:{default:{name:`Arbiscan`,url:`https://sepolia.arbiscan.io`,apiUrl:`https://api-sepolia.arbiscan.io/api`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:81930}},testnet:!0})})),Fv,aye=o((()=>{wg(),Fv=Cg({id:43114,name:`Avalanche`,blockTime:1700,nativeCurrency:{decimals:18,name:`Avalanche`,symbol:`AVAX`},rpcUrls:{default:{http:[`https://api.avax.network/ext/bc/C/rpc`]}},blockExplorers:{default:{name:`SnowTrace`,url:`https://snowtrace.io`,apiUrl:`https://api.snowtrace.io`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:11907934}}})})),Iv,oye=o((()=>{wg(),Iv=Cg({id:43113,name:`Avalanche Fuji`,nativeCurrency:{decimals:18,name:`Avalanche Fuji`,symbol:`AVAX`},rpcUrls:{default:{http:[`https://api.avax-test.network/ext/bc/C/rpc`]}},blockExplorers:{default:{name:`SnowTrace`,url:`https://testnet.snowtrace.io`,apiUrl:`https://api-testnet.snowtrace.io`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:7096959}},testnet:!0})})),sye,Lv,cye=o((()=>{wg(),sye=8453,Lv=Cg({id:8333,name:`B3`,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://mainnet-rpc.b3.fun/http`]}},blockExplorers:{default:{name:`Blockscout`,url:`https://explorer.b3.fun`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:0}},sourceId:sye})})),lye,Rv,uye=o((()=>{wg(),lye=168587773,Rv=Cg({id:1993,name:`B3 Sepolia`,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://sepolia.b3.fun/http`]}},blockExplorers:{default:{name:`Blockscout`,url:`https://sepolia.explorer.b3.fun`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:0}},testnet:!0,sourceId:lye})})),zv,Bv,dye=o((()=>{Av(),wg(),zv=1,Bv=Cg({...kv,id:8453,name:`Base`,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://mainnet.base.org`]}},blockExplorers:{default:{name:`Basescan`,url:`https://basescan.org`,apiUrl:`https://api.basescan.org/api`}},contracts:{...kv.contracts,disputeGameFactory:{[zv]:{address:`0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e`}},l2OutputOracle:{[zv]:{address:`0x56315b90c40730925ec5485cf004d835058518A0`}},multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:5022},portal:{[zv]:{address:`0x49048044D57e1C92A77f79988d21Fa8fAF74E97e`,blockCreated:17482143}},l1StandardBridge:{[zv]:{address:`0x3154Cf16ccdb4C6d922629664174b904d80F2C35`,blockCreated:17482143}}},sourceId:zv}),{...Bv}})),Vv,Hv,fye=o((()=>{Av(),wg(),Vv=11155111,Hv=Cg({...kv,id:84532,network:`base-sepolia`,name:`Base Sepolia`,nativeCurrency:{name:`Sepolia Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://sepolia.base.org`]}},blockExplorers:{default:{name:`Basescan`,url:`https://sepolia.basescan.org`,apiUrl:`https://api-sepolia.basescan.org/api`}},contracts:{...kv.contracts,disputeGameFactory:{[Vv]:{address:`0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1`}},l2OutputOracle:{[Vv]:{address:`0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254`}},portal:{[Vv]:{address:`0x49f53e41452c74589e85ca1677426ba426459e85`,blockCreated:4446677}},l1StandardBridge:{[Vv]:{address:`0xfd0Bf71F60660E2f608ed56e1659C450eB113120`,blockCreated:4446677}},multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:1059647}},testnet:!0,sourceId:Vv}),{...Hv}})),Uv,pye=o((()=>{wg(),Uv=Cg({id:80094,name:`Berachain`,blockTime:2e3,nativeCurrency:{decimals:18,name:`BERA Token`,symbol:`BERA`},contracts:{multicall3:{address:`0xcA11bde05977b3631167028862bE2a173976CA11`,blockCreated:0},ensRegistry:{address:`0x5b22280886a2f5e09a49bea7e320eab0e5320e28`,blockCreated:877007},ensUniversalResolver:{address:`0x4D41762915F83c76EcaF6776d9b08076aA32b492`,blockCreated:9310021}},rpcUrls:{default:{http:[`https://rpc.berachain.com`]}},blockExplorers:{default:{name:`Berascan`,url:`https://berascan.com`}},ensTlds:[`.bera`],testnet:!1})})),Wv,mye=o((()=>{wg(),Wv=Cg({id:80069,blockTime:2e3,name:`Berachain Bepolia`,nativeCurrency:{decimals:18,name:`BERA Token`,symbol:`BERA`},contracts:{multicall3:{address:`0xcA11bde05977b3631167028862bE2a173976CA11`,blockCreated:0}},rpcUrls:{default:{http:[`https://bepolia.rpc.berachain.com`]}},blockExplorers:{default:{name:`Berascan`,url:`https://bepolia.beratrail.io`}},testnet:!0})})),hye,Gv,gye=o((()=>{wg(),hye=11155111,Gv=Cg({id:168587773,name:`Blast Sepolia`,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://sepolia.blast.io`]}},blockExplorers:{default:{name:`Blastscan`,url:`https://sepolia.blastscan.io`,apiUrl:`https://api-sepolia.blastscan.io/api`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:756690}},testnet:!0,sourceId:hye})})),Kv,_ye=o((()=>{wg(),Kv=Cg({id:56,name:`BNB Smart Chain`,blockTime:750,nativeCurrency:{decimals:18,name:`BNB`,symbol:`BNB`},rpcUrls:{default:{http:[`https://56.rpc.thirdweb.com`]}},blockExplorers:{default:{name:`BscScan`,url:`https://bscscan.com`,apiUrl:`https://api.bscscan.com/api`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:15921452}}})})),qv,vye=o((()=>{wg(),qv=Cg({id:97,name:`BNB Smart Chain Testnet`,nativeCurrency:{decimals:18,name:`BNB`,symbol:`tBNB`},rpcUrls:{default:{http:[`https://data-seed-prebsc-1-s1.bnbchain.org:8545`]}},blockExplorers:{default:{name:`BscScan`,url:`https://testnet.bscscan.com`,apiUrl:`https://api-testnet.bscscan.com/api`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:17422483}},testnet:!0})})),Jv,yye=o((()=>{wg(),Jv=Cg({id:42793,name:`Etherlink`,blockTime:4830,nativeCurrency:{decimals:18,name:`Tez`,symbol:`XTZ`},rpcUrls:{default:{http:[`https://node.mainnet.etherlink.com`]}},blockExplorers:{default:{name:`Etherlink`,url:`https://explorer.etherlink.com`}},contracts:{multicall3:{address:`0xcA11bde05977b3631167028862bE2a173976CA11`,blockCreated:33899}}})})),Yv,bye=o((()=>{wg(),Yv=Cg({id:128123,name:`Etherlink Testnet`,nativeCurrency:{decimals:18,name:`Tez`,symbol:`XTZ`},rpcUrls:{default:{http:[`https://node.ghostnet.etherlink.com`]}},blockExplorers:{default:{name:`Etherlink Testnet`,url:`https://testnet.explorer.etherlink.com`}},testnet:!0})})),xye,Sye=o((()=>{wg(),xye=Cg({id:250,name:`Fantom`,nativeCurrency:{decimals:18,name:`Fantom`,symbol:`FTM`},rpcUrls:{default:{http:[`https://250.rpc.thirdweb.com`]}},blockExplorers:{default:{name:`FTMScan`,url:`https://ftmscan.com`,apiUrl:`https://api.ftmscan.com/api`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:33001987}}})})),Xv,Cye=o((()=>{wg(),Xv=Cg({id:100,name:`Gnosis`,nativeCurrency:{decimals:18,name:`xDAI`,symbol:`XDAI`},blockTime:5e3,rpcUrls:{default:{http:[`https://rpc.gnosischain.com`],webSocket:[`wss://rpc.gnosischain.com/wss`]}},blockExplorers:{default:{name:`Gnosisscan`,url:`https://gnosisscan.io`,apiUrl:`https://api.gnosisscan.io/api`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:21022491}}})})),Zv,wye=o((()=>{wg(),Zv=Cg({id:10200,name:`Gnosis Chiado`,nativeCurrency:{decimals:18,name:`Gnosis`,symbol:`xDAI`},blockTime:5e3,rpcUrls:{default:{http:[`https://rpc.chiadochain.net`],webSocket:[`wss://rpc.chiadochain.net/wss`]}},blockExplorers:{default:{name:`Blockscout`,url:`https://blockscout.chiadochain.net`,apiUrl:`https://blockscout.chiadochain.net/api`}},contracts:{multicall3:{address:`0xcA11bde05977b3631167028862bE2a173976CA11`,blockCreated:4967313}},testnet:!0})})),Qv,Tye=o((()=>{wg(),Qv=Cg({id:999,name:`HyperEVM`,nativeCurrency:{name:`HYPE`,symbol:`HYPE`,decimals:18},blockExplorers:{default:{name:`HyperEVMScan`,url:`https://hyperevmscan.io`}},contracts:{multicall3:{address:`0xcA11bde05977b3631167028862bE2a173976CA11`,blockCreated:13051}},rpcUrls:{default:{http:[`https://rpc.hyperliquid.xyz/evm`]}},testnet:!1})})),$v,Eye=o((()=>{wg(),$v=Cg({id:998,name:`Hyperliquid EVM Testnet`,nativeCurrency:{name:`HYPE`,symbol:`HYPE`,decimals:18},rpcUrls:{default:{http:[`https://rpc.hyperliquid-testnet.xyz/evm`]}},testnet:!0})})),ey,Dye,Oye=o((()=>{Av(),wg(),ey=1,Dye=Cg({...kv,id:57073,name:`Ink`,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://rpc-gel.inkonchain.com`,`https://rpc-qnd.inkonchain.com`],webSocket:[`wss://rpc-gel.inkonchain.com`,`wss://rpc-qnd.inkonchain.com`]}},blockExplorers:{default:{name:`Blockscout`,url:`https://explorer.inkonchain.com`,apiUrl:`https://explorer.inkonchain.com/api/v2`}},contracts:{multicall3:{address:`0xcA11bde05977b3631167028862bE2a173976CA11`,blockCreated:0},...kv.contracts,disputeGameFactory:{[ey]:{address:`0x10d7b35078d3baabb96dd45a9143b94be65b12cd`}},portal:{[ey]:{address:`0x5d66c1782664115999c47c9fa5cd031f495d3e4f`}},l1StandardBridge:{[ey]:{address:`0x88ff1e5b602916615391f55854588efcbb7663f0`}}},testnet:!1,sourceId:ey})})),ty,kye=o((()=>{wg(),ty=Cg({id:747474,name:`Katana`,network:`katana`,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://rpc.katana.network`]}},blockExplorers:{default:{name:`katana explorer`,url:`https://katanascan.com`}},contracts:{multicall3:{address:`0xcA11bde05977b3631167028862bE2a173976CA11`,blockCreated:0}},testnet:!1})}));async function Aye(e,t){let{account:n=e.account}=t;if(!n)throw new Yh;let r=td(n);try{let{accessList:n,blockNumber:i,blockTag:a,data:o,gas:s,gasPrice:c,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:d,to:f,value:p,...m}=t,h=(typeof i==`bigint`?Ec(i):void 0)||a;mm(t);let g=e.chain?.formatters?.transactionRequest?.format,_=(g||um)({...cm(m,{format:g}),account:r,accessList:n,data:o,gas:s,gasPrice:c,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:d,to:f,value:p},`estimateGas`),{baseFeePerGas:v,gasLimit:y,priorityFeePerGas:b}=await e.request({method:`linea_estimateGas`,params:h?[_,h]:[_]});return{baseFeePerGas:BigInt(v),gasLimit:BigInt(y),priorityFeePerGas:BigInt(b)}}catch(n){throw goe(n,{...t,account:r,chain:e.chain})}}var jye=o((()=>{nd(),Zh(),Ac(),Dh(),lm(),dm(),hm()}));async function Mye({client:e,multiply:t,request:n,type:r}){try{let i=await Aye(e,{...n,account:n?.account}),{priorityFeePerGas:a}=i,o=t(BigInt(i.baseFeePerGas))+a;return r===`legacy`?{gasPrice:o}:{maxFeePerGas:o,maxPriorityFeePerGas:a}}catch{return null}}var Nye,Pye=o((()=>{jye(),Nye={fees:{estimateFeesPerGas:Mye,async maxPriorityFeePerGas({block:e,client:t,request:n}){let r=await Mye({block:e,client:t,multiply:e=>e,request:n,type:`eip1559`});return r?.maxPriorityFeePerGas?r.maxPriorityFeePerGas:null}}}})),ny,Fye=o((()=>{Pye(),wg(),ny=Cg({...Nye,id:59144,name:`Linea Mainnet`,blockTime:2e3,nativeCurrency:{name:`Linea Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://rpc.linea.build`],webSocket:[`wss://rpc.linea.build`]}},blockExplorers:{default:{name:`Etherscan`,url:`https://lineascan.build`,apiUrl:`https://api.lineascan.build/api`}},contracts:{multicall3:{address:`0xcA11bde05977b3631167028862bE2a173976CA11`,blockCreated:42},ensRegistry:{address:`0x50130b669B28C339991d8676FA73CF122a121267`,blockCreated:6682888},ensUniversalResolver:{address:`0x4D41762915F83c76EcaF6776d9b08076aA32b492`,blockCreated:22222151}},ensTlds:[`.linea.eth`],testnet:!1})})),ry,Iye=o((()=>{wg(),ry=Cg({id:1,name:`Ethereum`,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},blockTime:12e3,rpcUrls:{default:{http:[`https://eth.merkle.io`]}},blockExplorers:{default:{name:`Etherscan`,url:`https://etherscan.io`,apiUrl:`https://api.etherscan.io/api`}},contracts:{ensUniversalResolver:{address:`0xeeeeeeee14d718c2b47d9923deab1335e144eeee`,blockCreated:23085558},multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:14353601}}})})),iy,Lye=o((()=>{wg(),iy=Cg({id:143,name:`Monad`,blockTime:400,nativeCurrency:{name:`Monad`,symbol:`MON`,decimals:18},rpcUrls:{default:{http:[`https://rpc.monad.xyz`,`https://rpc1.monad.xyz`],webSocket:[`wss://rpc.monad.xyz`,`wss://rpc1.monad.xyz`]}},blockExplorers:{default:{name:`MonadVision`,url:`https://monadvision.com`},monadscan:{name:`Monadscan`,url:`https://monadscan.com`,apiUrl:`https://api.monadscan.com/api`}},testnet:!1,contracts:{multicall3:{address:`0xcA11bde05977b3631167028862bE2a173976CA11`,blockCreated:9248132}}})})),ay,Rye=o((()=>{wg(),ay=Cg({id:10143,name:`Monad Testnet`,blockTime:400,nativeCurrency:{name:`Testnet MON Token`,symbol:`MON`,decimals:18},rpcUrls:{default:{http:[`https://testnet-rpc.monad.xyz`]}},blockExplorers:{default:{name:`Monad Testnet explorer`,url:`https://testnet.monadexplorer.com`}},contracts:{multicall3:{address:`0xcA11bde05977b3631167028862bE2a173976CA11`,blockCreated:251449}},testnet:!0})})),oy,sy,zye=o((()=>{Av(),wg(),oy=1,sy=Cg({...kv,id:10,name:`OP Mainnet`,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://mainnet.optimism.io`]}},blockExplorers:{default:{name:`Optimism Explorer`,url:`https://optimistic.etherscan.io`,apiUrl:`https://api-optimistic.etherscan.io/api`}},contracts:{...kv.contracts,disputeGameFactory:{[oy]:{address:`0xe5965Ab5962eDc7477C8520243A95517CD252fA9`}},l2OutputOracle:{[oy]:{address:`0xdfe97868233d1aa22e815a266982f2cf17685a27`}},multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:4286263},portal:{[oy]:{address:`0xbEb5Fc579115071764c7423A4f12eDde41f106Ed`}},l1StandardBridge:{[oy]:{address:`0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1`}}},sourceId:oy})})),cy,ly,Bye=o((()=>{Av(),wg(),cy=11155111,ly=Cg({...kv,id:11155420,name:`OP Sepolia`,nativeCurrency:{name:`Sepolia Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://sepolia.optimism.io`]}},blockExplorers:{default:{name:`Blockscout`,url:`https://optimism-sepolia.blockscout.com`,apiUrl:`https://optimism-sepolia.blockscout.com/api`}},contracts:{...kv.contracts,disputeGameFactory:{[cy]:{address:`0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1`}},l2OutputOracle:{[cy]:{address:`0x90E9c4f8a994a250F6aEfd61CAFb4F2e895D458F`}},multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:1620204},portal:{[cy]:{address:`0x16Fc5058F25648194471939df75CF27A2fdC48BC`}},l1StandardBridge:{[cy]:{address:`0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1`}}},testnet:!0,sourceId:cy})})),uy,Vye=o((()=>{wg(),uy=Cg({id:137,name:`Polygon`,blockTime:2e3,nativeCurrency:{name:`POL`,symbol:`POL`,decimals:18},rpcUrls:{default:{http:[`https://polygon.drpc.org`]}},blockExplorers:{default:{name:`PolygonScan`,url:`https://polygonscan.com`,apiUrl:`https://api.etherscan.io/v2/api`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:25770160}}})})),dy,Hye=o((()=>{wg(),dy=Cg({id:80002,name:`Polygon Amoy`,nativeCurrency:{name:`POL`,symbol:`POL`,decimals:18},rpcUrls:{default:{http:[`https://rpc-amoy.polygon.technology`]}},blockExplorers:{default:{name:`PolygonScan`,url:`https://amoy.polygonscan.com`,apiUrl:`https://api.etherscan.io/v2/api`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:3127388}},testnet:!0})})),Uye,Wye=o((()=>{wg(),Uye=Cg({id:534352,name:`Scroll`,blockTime:3e3,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://rpc.scroll.io`],webSocket:[`wss://wss-rpc.scroll.io/ws`]}},blockExplorers:{default:{name:`Scrollscan`,url:`https://scrollscan.com`,apiUrl:`https://api.scrollscan.com/api`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:14}},testnet:!1})})),fy,Gye=o((()=>{wg(),fy=Cg({id:11155111,name:`Sepolia`,nativeCurrency:{name:`Sepolia Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://11155111.rpc.thirdweb.com`]}},blockExplorers:{default:{name:`Etherscan`,url:`https://sepolia.etherscan.io`,apiUrl:`https://api-sepolia.etherscan.io/api`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:751532},ensUniversalResolver:{address:`0xeeeeeeee14d718c2b47d9923deab1335e144eeee`,blockCreated:8928790}},testnet:!0})})),py,Kye=o((()=>{wg(),py=Cg({id:50312,name:`Somnia Testnet`,nativeCurrency:{name:`STT`,symbol:`STT`,decimals:18},blockTime:100,rpcUrls:{default:{http:[`https://api.infra.testnet.somnia.network`]}},blockExplorers:{default:{name:`Somnia Testnet Explorer`,url:`https://shannon-explorer.somnia.network`,apiUrl:`https://shannon-explorer.somnia.network/api`}},contracts:{multicall3:{address:`0x841b8199E6d3Db3C6f264f6C2bd8848b3cA64223`,blockCreated:71314235}},testnet:!0})})),my,hy,qye=o((()=>{Av(),wg(),my=1,hy=Cg({...kv,id:1868,name:`Soneium Mainnet`,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://rpc.soneium.org`]}},blockExplorers:{default:{name:`Blockscout`,url:`https://soneium.blockscout.com`,apiUrl:`https://soneium.blockscout.com/api`}},contracts:{...kv.contracts,disputeGameFactory:{[my]:{address:`0x512a3d2c7a43bd9261d2b8e8c9c70d4bd4d503c0`}},l2OutputOracle:{[my]:{address:`0x0000000000000000000000000000000000000000`}},portal:{[my]:{address:`0x88e529a6ccd302c948689cd5156c83d4614fae92`,blockCreated:7061266}},l1StandardBridge:{[my]:{address:`0xeb9bf100225c214efc3e7c651ebbadcf85177607`,blockCreated:7061266}},multicall3:{address:`0xcA11bde05977b3631167028862bE2a173976CA11`,blockCreated:1}},sourceId:my})})),gy,_y,Jye=o((()=>{Av(),wg(),gy=11155111,_y=Cg({...kv,id:1946,name:`Soneium Minato Testnet`,nativeCurrency:{name:`Sepolia Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://rpc.minato.soneium.org`]}},blockExplorers:{default:{name:`Blockscout`,url:`https://soneium-minato.blockscout.com`,apiUrl:`https://soneium-minato.blockscout.com/api`}},contracts:{...kv.contracts,disputeGameFactory:{[gy]:{address:`0xB3Ad2c38E6e0640d7ce6aA952AB3A60E81bf7a01`}},l2OutputOracle:{[gy]:{address:`0x710e5286C746eC38beeB7538d0146f60D27be343`}},portal:{[gy]:{address:`0x65ea1489741A5D72fFdD8e6485B216bBdcC15Af3`,blockCreated:6466136}},l1StandardBridge:{[gy]:{address:`0x5f5a404A5edabcDD80DB05E8e54A78c9EBF000C2`,blockCreated:6466136}},multicall3:{address:`0xcA11bde05977b3631167028862bE2a173976CA11`,blockCreated:1}},testnet:!0,sourceId:gy})})),vy,Yye=o((()=>{wg(),vy=Cg({id:146,name:`Sonic`,blockTime:630,nativeCurrency:{decimals:18,name:`Sonic`,symbol:`S`},rpcUrls:{default:{http:[`https://rpc.soniclabs.com`]}},blockExplorers:{default:{name:`Sonic Explorer`,url:`https://sonicscan.org`}},contracts:{multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:60}},testnet:!1})})),yy,Xye=o((()=>{wg(),yy=Cg({id:64165,name:`Sonic Testnet`,nativeCurrency:{decimals:18,name:`Sonic`,symbol:`S`},rpcUrls:{default:{http:[`https://rpc.testnet.soniclabs.com`]}},blockExplorers:{default:{name:`Sonic Testnet Explorer`,url:`https://testnet.soniclabs.com/`}},testnet:!0})})),by,xy,Zye=o((()=>{Av(),wg(),by=1,xy=Cg({...kv,id:130,name:`Unichain`,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},blockTime:1e3,rpcUrls:{default:{http:[`https://mainnet.unichain.org/`]}},blockExplorers:{default:{name:`Uniscan`,url:`https://uniscan.xyz`,apiUrl:`https://api.uniscan.xyz/api`}},contracts:{...kv.contracts,multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:0},disputeGameFactory:{[by]:{address:`0x2F12d621a16e2d3285929C9996f478508951dFe4`}},portal:{[by]:{address:`0x0bd48f6B86a26D3a217d0Fa6FfE2B491B956A7a2`}},l1StandardBridge:{[by]:{address:`0x81014F44b0a345033bB2b3B21C7a1A308B35fEeA`}}},sourceId:by})})),Sy,Cy,Qye=o((()=>{Av(),wg(),Sy=1,Cy=Cg({...kv,id:480,name:`World Chain`,network:`worldchain`,nativeCurrency:{name:`Ether`,symbol:`ETH`,decimals:18},rpcUrls:{default:{http:[`https://worldchain-mainnet.g.alchemy.com/public`]}},blockExplorers:{default:{name:`Worldscan`,url:`https://worldscan.org`,apiUrl:`https://api.worldscan.org/api`},blockscout:{name:`Blockscout`,url:`https://worldchain-mainnet.explorer.alchemy.com`,apiUrl:`https://worldchain-mainnet.explorer.alchemy.com/api`}},contracts:{...kv.contracts,multicall3:{address:`0xca11bde05977b3631167028862be2a173976ca11`,blockCreated:0},disputeGameFactory:{[Sy]:{address:`0x069c4c579671f8c120b1327a73217D01Ea2EC5ea`}},l2OutputOracle:{[Sy]:{address:`0x19A6d1E9034596196295CF148509796978343c5D`}},portal:{[Sy]:{address:`0xd5ec14a83B7d95BE1E2Ac12523e2dEE12Cbeea6C`}},l1StandardBridge:{[Sy]:{address:`0x470458C91978D2d929704489Ad730DC3E3001113`}}},testnet:!1,sourceId:Sy})})),wy,$ye=o((()=>{wg(),wy=Cg({id:37714555429,name:`Xai Testnet`,nativeCurrency:{name:`sXai`,symbol:`sXAI`,decimals:18},rpcUrls:{default:{http:[`https://testnet-v2.xai-chain.net/rpc`]}},blockExplorers:{default:{name:`Blockscout`,url:`https://testnet-explorer-v2.xai-chain.net`}},testnet:!0})})),ebe,tbe=o((()=>{wg(),Uve(),ebe=Cg({...Hve,blockTime:200,id:324,name:`ZKsync Era`,network:`zksync-era`,nativeCurrency:{decimals:18,name:`Ether`,symbol:`ETH`},rpcUrls:{default:{http:[`https://mainnet.era.zksync.io`],webSocket:[`wss://mainnet.era.zksync.io/ws`]}},blockExplorers:{default:{name:`ZKsync Explorer`,url:`https://explorer.zksync.io/`,apiUrl:`https://block-explorer-api.mainnet.zksync.io/api`}},contracts:{multicall3:{address:`0xF9cda624FBC7e059355ce98a31693d299FACd963`,blockCreated:3908235},erc6492Verifier:{address:`0xfB688330379976DA81eB64Fe4BF50d7401763B9C`,blockCreated:45659388}}})})),Ty=o((()=>{Uve(),Av(),tye(),nye(),rye(),iye(),aye(),oye(),cye(),uye(),dye(),fye(),pye(),mye(),gye(),_ye(),vye(),Gve(),Sc(),ym(),vm(),dm(),pm(),fu(),Fs(),Sh(),om(),$ve(),xu(),Ac(),em(),yg(),xg(),Qh(),Eh(),yye(),bye(),Sye(),Cye(),wye(),Tye(),Eye(),Oye(),kye(),Fye(),Pye(),Iye(),Lye(),Rye(),zye(),Bye(),qve(),Vye(),Hye(),Wye(),Gye(),Kye(),qye(),Jye(),Yye(),Xye(),ph(),Cde(),ah(),Qm(),ofe(),Xg(),nh(),Up(),ep(),Bp(),kp(),zp(),Qp(),Afe(),t_(),_pe(),qg(),aae(),Nfe(),eu(),gg(),f_(),Hm(),sg(),nu(),Ih(),ose(),tg(),Ime(),rg(),Qme(),qm(),Are(),Dg(),kg(),Mm(),Jd(),jm(),fc(),gc(),md(),Rc(),As(),_g(),Au(),Kfe(),Zye(),Qye(),$ye(),tbe()})),Ey,Dy=o((()=>{Ey={id:5031,name:`Somnia`,nativeCurrency:{decimals:18,name:`SOMI`,symbol:`SOMI`},rpcUrls:{default:{http:[`https://api.infra.mainnet.somnia.network`]},public:{http:[`https://api.infra.mainnet.somnia.network`]}},blockExplorers:{default:{name:`Somnia Explorer`,url:`https://explorer.somnia.network/`}}}}));function Oy(){return nbe}var nbe,ky=o((()=>{Ty(),Dy(),nbe=[Mv,Bv,ry,sy,Xv,uy,hy,Ey,jv,Nv,Fv,Lv,Kv,ty,Jv,Uv,Qv,vy,Pv,Iv,Rv,Hv,Gv,qv,fy,Zv,dy,ly,_y,wy,Yv,py,iy,ay,Wv,yy,$v]}));function Ay(e,t){return`${t}/${e}`}function rbe(e){return{42161:Ay(`arbitrum`,e),8453:Ay(`base`,e),1:Ay(`mainnet`,e),10:Ay(`optimism`,e),100:Ay(`gnosis`,e),137:Ay(`polygon`,e),1868:Ay(`soneium`,e),5031:Ay(`somnia`,e),33139:Ay(`apechain`,e),42170:Ay(`arbitrum-nova`,e),43114:Ay(`avalanche`,e),8333:Ay(`b3`,e),56:Ay(`bsc`,e),747474:Ay(`katana`,e),42793:Ay(`etherlink`,e),143:Ay(`monad`,e),80094:Ay(`berachain`,e),999:Ay(`hyperevm`,e),146:Ay(`sonic`,e)}}function ibe(e,t,n,r){let i=r===void 0?cbe:{...cbe,retryCount:r};if(t&&n){let r=sbe(e,t,n);if(r)return uhe(r,i)}return uhe(void 0,i)}function abe(e,t,n){let r=t??y_();return ibe(e,r.trailsApiKey,r.sequenceNodeGatewayUrl,n)}function obe(e){return Oy().find(t=>t.id===e)??null}function jy(e,t,n=obe(e)){return hme(n?{chain:n,transport:abe(e,void 0,t)}:{transport:abe(e,void 0,t)})}var sbe,cbe,lbe=o((()=>{m_(),ky(),S_(),F(),sbe=(e,t,n)=>{let r=rbe(n);return r[e]?`${r[e]}/${t}`:null},cbe={retryCount:5,retryDelay:w,timeout:30*w}}));function My(e){let t=H_.find(t=>t.mint===e);if(!t)throw Error(`Unknown Solana registry mint: ${e}`);return qhe(t)}function ube(e){return fbe[e]??null}var Ny,dbe,Py,fbe,Fy=o((()=>{m_(),Ty(),Dy(),ege(),Ny={ETH:`https://assets.sequence.info/images/tokens/large/1/0x0000000000000000000000000000000000000000.webp`,WETH:`https://assets.sequence.info/images/tokens/large/1/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.webp`,POL:`https://assets.sequence.info/images/tokens/large/137/0x0000000000000000000000000000000000000000.webp`,MATIC:`https://assets.sequence.info/images/tokens/large/137/0x0000000000000000000000000000000000000000.webp`,USDC:`https://assets.sequence.info/images/tokens/large/1/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.webp`,USDT:`https://assets.sequence.info/images/tokens/large/1/0xdac17f958d2ee523a2206206994597c13d831ec7.webp`,DAI:`https://assets.sequence.info/images/tokens/large/1/0x6b175474e89094c44da98b954eedeac495271d0f.webp`,WBTC:`https://assets.sequence.info/images/tokens/large/1/0x2260fac5e5542a773aa44fbcfedf7c193bc2c599.webp`,BAT:`https://assets.sequence.info/images/tokens/large/1/0x0d8775f648430679a709e98d2b0cb6250d2887ef.webp`,ARB:`https://assets.sequence.info/images/tokens/large/42161/0x912ce59144191c1204e64559fe8253a0e49e6548.webp`,LINK:`https://assets.sequence.info/images/tokens/large/1/0x514910771af9ca656af840dff83e8264ecf986ca.webp`,XTZ:`https://assets.sequence.info/images/tokens/large/42793/0x0000000000000000000000000000000000000000.webp`,BNB:`https://assets.sequence.info/images/tokens/large/56/0x0000000000000000000000000000000000000000.webp`,WXTZ:`https://assets.coingecko.com/coins/images/976/standard/Tezos-logo.png?1696502091`,SOMI:`https://raw.githubusercontent.com/0xsequence/token-directory/master/index/somnia/logos/somi.png`,XAI:`https://assets.coingecko.com/coins/images/34258/large/round_icon_2048_px.png?1719523838`,APE:`https://assets.sequence.info/images/tokens/large/33139/0x0000000000000000000000000000000000000000.webp`,ANIME:`https://assets.coingecko.com/coins/images/53575/large/anime.jpg?1736748703`,AVAX:`https://assets.sequence.info/images/tokens/large/43114/0x0000000000000000000000000000000000000000.webp`,SOL:`https://assets.coingecko.com/coins/images/4128/standard/solana.png?1718769756`,MON:`https://assets.sequence.info/images/tokens/large/143/0x0000000000000000000000000000000000000000.webp`,USDT0:`https://assets.coingecko.com/coins/images/53705/standard/usdt0.jpg?1737086183`,AUSD:`https://assets.coingecko.com/coins/images/39284/standard/Circle_Agora_White_on_Olive_1080px.png?1722961274`},dbe={ETH:`ETH`,cbETH:`ETH`,POL:`POL`,WPOL:`POL`,USDC:`USDC`,"USDC.e":`USDC`,USDT:`USDT`,DAI:`DAI`,xDAI:`DAI`,XDAI:`DAI`,WBTC:`WBTC`,cbBTC:`WBTC`,BAT:`BAT`,ARB:`ARB`,LINK:`LINK`,SOL:`SOL`,MON:`MON`,WMON:`MON`,aBasUSDC:`USDC`,steakUSDC:`USDC`},Py=[{tokenId:`ETH-ethereum`,symbol:`ETH`,name:`Ethereum`,contractAddress:l_,decimals:18,chainId:ry.id,chainName:ry.name,imageUrl:Ny.ETH,isNativeToken:!0},{tokenId:`ETH-arbitrum`,symbol:`ETH`,name:`ETH Arbitrum`,contractAddress:l_,decimals:18,chainId:Mv.id,chainName:Mv.name,imageUrl:Ny.ETH,isNativeToken:!0},{tokenId:`ETH-optimism`,symbol:`ETH`,name:`ETH Optimism`,contractAddress:l_,decimals:18,chainId:sy.id,chainName:sy.name,imageUrl:Ny.ETH,isNativeToken:!0},{tokenId:`ETH-base`,symbol:`ETH`,name:`ETH Base`,contractAddress:l_,decimals:18,chainId:Bv.id,chainName:Bv.name,imageUrl:Ny.ETH,isNativeToken:!0},{tokenId:`POL-polygon`,symbol:`POL`,name:`Polygon`,contractAddress:l_,decimals:18,chainId:uy.id,chainName:uy.name,imageUrl:Ny.POL,isNativeToken:!0},My(B_),{tokenId:`USDC-ethereum`,symbol:`USDC`,name:`USDC`,contractAddress:`0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`,decimals:6,chainId:ry.id,chainName:ry.name,imageUrl:Ny.USDC},{tokenId:`USDC-arbitrum`,symbol:`USDC`,name:`USDC Arbitrum`,contractAddress:`0xaf88d065e77c8cC2239327C5EDb3A432268e5831`,decimals:6,chainId:Mv.id,chainName:Mv.name,imageUrl:Ny.USDC},{tokenId:`USDC-avalanche`,symbol:`USDC`,name:`USDC Avalanche`,contractAddress:`0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E`,decimals:6,chainId:Fv.id,chainName:Fv.name,imageUrl:Ny.USDC},{tokenId:`USDC-base`,symbol:`USDC`,name:`USDC Base`,contractAddress:`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`,decimals:6,chainId:Bv.id,chainName:Bv.name,imageUrl:Ny.USDC},My(Xhe),My(Zhe),My(Qhe),{tokenId:`USDC-linea`,symbol:`USDC`,name:`USDC Linea`,contractAddress:`0x176211869cA2b568f2A7D4EE941E073a821EE1ff`,decimals:6,chainId:ny.id,chainName:ny.name,imageUrl:Ny.USDC},{tokenId:`USDC-optimism`,symbol:`USDC`,name:`USDC Optimism`,contractAddress:`0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85`,decimals:6,chainId:sy.id,chainName:sy.name,imageUrl:Ny.USDC},{tokenId:`USDC-polygon`,symbol:`USDC`,name:`USDC Polygon`,contractAddress:`0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359`,decimals:6,chainId:uy.id,chainName:uy.name,imageUrl:Ny.USDC},{tokenId:`USDC-unichain`,symbol:`USDC`,name:`USDC Unichain`,contractAddress:`0x078D782b760474a361dDA0AF3839290b0EF57AD6`,decimals:6,chainId:xy.id,chainName:xy.name,imageUrl:Ny.USDC},{tokenId:`USDC-worldchain`,symbol:`USDC`,name:`USDC WorldChain`,contractAddress:`0x79A02482A880bCe3F13E09da970dC34dB4cD24D1`,decimals:6,chainId:Cy.id,chainName:Cy.name,imageUrl:Ny.USDC},{tokenId:`USDC-monad`,symbol:`USDC`,name:`USDC`,contractAddress:`0x754704Bc059F8C67012fEd69BC8A327a5aafb603`,decimals:6,chainId:iy.id,chainName:iy.name,imageUrl:Ny.USDC},{tokenId:`USDC-katana`,symbol:`USDC`,name:`USDC`,contractAddress:`0x203a662b0bd271a6ed5a60edfbd04bfce608fd36`,decimals:6,chainId:ty.id,chainName:ty.name,imageUrl:Ny.USDC},{tokenId:`BAT-ethereum`,symbol:`BAT`,name:`Basic Attention Token`,contractAddress:`0x0D8775F648430679A709E98d2b0Cb6250d2887EF`,decimals:18,chainId:ry.id,chainName:ry.name,imageUrl:Ny.BAT},{tokenId:`BAT-polygon`,symbol:`BAT`,name:`Basic Attention Token`,contractAddress:`0x3Cef98bb43d732E2F285eE605a8158cDE967D219`,decimals:18,chainId:uy.id,chainName:uy.name,imageUrl:Ny.BAT},{tokenId:`BAT-avalanche`,symbol:`BAT`,name:`Basic Attention Token`,contractAddress:`0x98443B96EA4b0858FDF3219Cd13e98C7A4690588`,decimals:18,chainId:Fv.id,chainName:Fv.name,imageUrl:Ny.BAT},{tokenId:`ARB-arbitrum`,symbol:`ARB`,name:`Arbitrum`,contractAddress:`0x912CE59144191C1204E64559FE8253a0e49E6548`,decimals:18,chainId:Mv.id,chainName:Mv.name,imageUrl:Ny.ARB},{tokenId:`LINK-ethereum`,symbol:`LINK`,name:`Chainlink`,contractAddress:`0x514910771AF9Ca656af840dff83E8264EcF986CA`,decimals:18,chainId:ry.id,chainName:ry.name,imageUrl:Ny.LINK},{tokenId:`USDT-ethereum`,symbol:`USDT`,name:`Tether USD`,contractAddress:`0xdAC17F958D2ee523a2206206994597C13D831ec7`,decimals:6,chainId:ry.id,chainName:ry.name,imageUrl:Ny.USDT},{tokenId:`USDT-polygon`,symbol:`USDT`,name:`Tether USD`,contractAddress:`0xc2132D05D31c914a87C6611C10748AEb04B58e8F`,decimals:6,chainId:uy.id,chainName:uy.name,imageUrl:Ny.USDT},{tokenId:`USDT-arbitrum`,symbol:`USDT`,name:`Tether USD`,contractAddress:`0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9`,decimals:6,chainId:Mv.id,chainName:Mv.name,imageUrl:Ny.USDT},{tokenId:`USDT-optimism`,symbol:`USDT`,name:`Tether USD`,contractAddress:`0x94b008aA00579c1307B0EF2c499aD98a8ce58e58`,decimals:6,chainId:sy.id,chainName:sy.name,imageUrl:Ny.USDT},{tokenId:`USDT-avalanche`,symbol:`USDT`,name:`Tether USD`,contractAddress:`0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7`,decimals:6,chainId:Fv.id,chainName:Fv.name,imageUrl:Ny.USDT},{tokenId:`DAI-ethereum`,symbol:`DAI`,name:`Dai Stablecoin`,contractAddress:`0x6B175474E89094C44Da98b954EedeAC495271d0F`,decimals:18,chainId:ry.id,chainName:ry.name,imageUrl:Ny.DAI},{tokenId:`DAI-polygon`,symbol:`DAI`,name:`Dai Stablecoin`,contractAddress:`0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063`,decimals:18,chainId:uy.id,chainName:uy.name,imageUrl:Ny.DAI},{tokenId:`DAI-arbitrum`,symbol:`DAI`,name:`Dai Stablecoin`,contractAddress:`0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1`,decimals:18,chainId:Mv.id,chainName:Mv.name,imageUrl:Ny.DAI},{tokenId:`DAI-optimism`,symbol:`DAI`,name:`Dai Stablecoin`,contractAddress:`0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1`,decimals:18,chainId:sy.id,chainName:sy.name,imageUrl:Ny.DAI},{tokenId:`MATIC-ethereum`,symbol:`MATIC`,name:`Matic Token`,contractAddress:`0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0`,decimals:18,chainId:ry.id,chainName:ry.name,imageUrl:Ny.MATIC},{tokenId:`WETH-ethereum`,symbol:`WETH`,name:`Wrapped Ether`,contractAddress:`0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2`,decimals:18,chainId:ry.id,chainName:ry.name,imageUrl:Ny.WETH},{tokenId:`WETH-optimism`,symbol:`WETH`,name:`Wrapped Ether`,contractAddress:`0x4200000000000000000000000000000000000006`,decimals:18,chainId:sy.id,chainName:sy.name,imageUrl:Ny.WETH},{tokenId:`WETH-polygon`,symbol:`WETH`,name:`Wrapped Ether`,contractAddress:`0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619`,decimals:18,chainId:uy.id,chainName:uy.name,imageUrl:Ny.WETH},{tokenId:`WETH-base`,symbol:`WETH`,name:`Wrapped Ether`,contractAddress:`0x4200000000000000000000000000000000000006`,decimals:18,chainId:Bv.id,chainName:Bv.name,imageUrl:Ny.WETH},{tokenId:`WETH-arbitrum`,symbol:`WETH`,name:`Wrapped Ether`,contractAddress:`0x82aF49447D8a07e3bd95BD0d56f35241523fBab1`,decimals:18,chainId:Mv.id,chainName:Mv.name,imageUrl:Ny.WETH},{tokenId:`WETH.e-avalanche`,symbol:`WETH.e`,name:`Wrapped Ether (Bridged)`,contractAddress:`0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB`,decimals:18,chainId:Fv.id,chainName:Fv.name,imageUrl:Ny.WETH},{tokenId:`XTZ-etherlink`,symbol:`XTZ`,name:`Tezos`,contractAddress:l_,decimals:18,chainId:Jv.id,chainName:Jv.name,imageUrl:Ny.XTZ,isNativeToken:!0},{tokenId:`WXTZ-etherlink`,symbol:`WXTZ`,name:`Wrapped XTZ`,contractAddress:`0xc9B53AB2679f573e480d01e0f49e2B5CFB7a3EAb`,decimals:18,chainId:Jv.id,chainName:Jv.name,imageUrl:Ny.WXTZ},{tokenId:`USDC-etherlink`,symbol:`USDC`,name:`USD Coin`,contractAddress:`0x796Ea11Fa2dD751eD01b53C372fFDB4AAa8f00F9`,decimals:6,chainId:Jv.id,chainName:Jv.name,imageUrl:Ny.USDC},{tokenId:`WETH-etherlink`,symbol:`WETH`,name:`Wrapped ETH`,contractAddress:`0xfc24f770F94edBca6D6f885E12d4317320BcB401`,decimals:18,chainId:Jv.id,chainName:Jv.name,imageUrl:Ny.WETH},{tokenId:`USDT-etherlink`,symbol:`USDT`,name:`Bridged USDT`,contractAddress:`0x2C03058C8AFC06713be23e58D2febC8337dbfE6A`,decimals:6,chainId:Jv.id,chainName:Jv.name,imageUrl:Ny.USDT},{tokenId:`USDT-bsc`,symbol:`USDT`,name:`Tether USD`,contractAddress:`0x55d398326f99059ff775485246999027b3197955`,decimals:18,chainId:Kv.id,chainName:Kv.name,imageUrl:Ny.USDT},{tokenId:`USDC-bsc`,symbol:`USDC`,name:`USDC`,contractAddress:`0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d`,decimals:18,chainId:Kv.id,chainName:Kv.name,imageUrl:Ny.USDC},{tokenId:`DAI-bsc`,symbol:`DAI`,name:`Dai Stablecoin`,contractAddress:`0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3`,decimals:18,chainId:Kv.id,chainName:Kv.name,imageUrl:Ny.DAI},{tokenId:`BNB-bsc`,symbol:`BNB`,name:`BNB`,contractAddress:l_,decimals:18,chainId:Kv.id,chainName:Kv.name,imageUrl:Ny.BNB,isNativeToken:!0},{tokenId:`AVAX-bsc`,symbol:`AVAX`,name:`Avalanche Token`,contractAddress:`0x1ce0c2827e2ef14d5c4f29a091d735a204794041`,decimals:18,chainId:Kv.id,chainName:Kv.name,imageUrl:Ny.AVAX},{tokenId:`SOMI-somnia`,symbol:`SOMI`,name:`Somnia`,contractAddress:l_,decimals:18,chainId:Ey.id,chainName:Ey.name,imageUrl:Ny.SOMI,isNativeToken:!0},{tokenId:`MON-monad`,symbol:`MON`,name:`Monad`,contractAddress:l_,decimals:18,chainId:iy.id,chainName:iy.name,imageUrl:Ny.MON,isNativeToken:!0},{tokenId:`WMON-monad`,symbol:`WMON`,name:`Wrapped MON`,contractAddress:`0x3bd359c1119da7da1d913d1c4d2b7c461115433a`,decimals:18,chainId:iy.id,chainName:iy.name,imageUrl:Ny.MON}],fbe={[ry.id]:`0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2`,[sy.id]:`0x4200000000000000000000000000000000000006`,[Kv.id]:`0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c`,[Xv.id]:`0xe91d153e0b41518a2ce8dd3d7944fa863463a97d`,[xy.id]:`0x4200000000000000000000000000000000000006`,[Bv.id]:`0x4200000000000000000000000000000000000006`,[vy.id]:`0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38`,[xye.id]:`0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83`,[ebe.id]:`0x5aea5775959fbc2557cc8789bc1bf90a239d9a91`,[Cy.id]:`0x4200000000000000000000000000000000000006`,[Qv.id]:`0x5555555555555555555555555555555555555555`,[uy.id]:`0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270`,[Dye.id]:`0x4200000000000000000000000000000000000006`,[ny.id]:`0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f`,[Mv.id]:`0x82af49447d8a07e3bd95bd0d56f35241523fbab1`,[Fv.id]:`0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7`,[Uye.id]:`0x5300000000000000000000000000000000000004`,[ty.id]:`0xee7d8bcfb72bc1880d0cf19822eb0a2e6577ab62`,[Uv.id]:`0x6969696969696969696969696969696969696969`,[Jv.id]:`0xc9B53AB2679f573e480d01e0f49e2B5CFB7a3EAb`,[iy.id]:`0x3bd359c1119da7da1d913d1c4d2b7c461115433a`}}));function pbe(e){let t=vbe(e.map(gbe).filter(e=>e!==null));if(t.length===0)throw Error(`[trails-sdk] getChains mapped to zero supported chains`);return t}function mbe(e){return Uhe(e)?Ny.SOL:`https://assets.sequence.info/images/networks/large/${e}.webp`}function Iy(e,t){if(P_(e))throw Error(`[trails-sdk] getChainRpcClient(${e}): Solana is not EVM; use Solana JSON-RPC and SPL helpers instead of viem against Solana HTTP RPCs.`);let n=Ly(e);return n?jy(e,t,n):(K.console.warn(`[trails-sdk] Chain ${e} not found. Falling back to a generic public client.`),jy(e,t,null))}async function hbe(e){let t=y_(),n={trailsApiUrl:e?.trailsApiUrl??t.trailsApiUrl,trailsApiKey:e?.trailsApiKey??t.trailsApiKey},r=(await new vve(n.trailsApiKey||``,{hostname:n.trailsApiUrl}).getChains({}))?.chains||[];if(r.length===0)throw Error(`[trails-sdk] getChains returned no supported chains`);return pbe(r)}function gbe(e){let t=Ly(e.id);if(!t)return K.console.warn(`[trails-sdk] chain ${e.id} from GetChains is not mapped in SDK, skipping`),null;let n=e.nativeCurrency?.name||t.nativeCurrency.name,r=e.nativeCurrency?.symbol||t.nativeCurrency.symbol,i=e.nativeCurrency?.decimals||t.nativeCurrency.decimals,a=e.blockExplorer?.url||t.blockExplorers?.default?.url,o=e.blockExplorer?.name||t.blockExplorers?.default?.name||`Explorer`;return{...t,name:e.name||t.name,nativeCurrency:{...t.nativeCurrency,name:n,symbol:r,decimals:i},blockExplorers:a?{default:{name:o,url:a}}:t.blockExplorers}}function Ly(e,t){if(!e)return null;if(Uhe(e))return{id:e,name:`Solana`,imageUrl:mbe(e),nativeCurrency:{name:`Solana`,symbol:`SOL`,decimals:9},rpcUrls:{default:{http:[]},public:{http:[]}},blockExplorers:{default:{name:`Solana Explorer`,url:`https://explorer.solana.com`}}};let n=Oy().find(t=>t.id===e)||null;if(!n)return null;let r={...n,rpcUrls:{default:{...n.rpcUrls.default},public:n.rpcUrls.public?{...n.rpcUrls.public}:{...n.rpcUrls.default}},blockExplorers:n.blockExplorers?{...n.blockExplorers}:void 0};if(!t?.usePublicRpc&&t?.sequenceProjectAccessKey&&t?.sequenceNodeGatewayUrl){let n=sbe(e,t.sequenceProjectAccessKey,t.sequenceNodeGatewayUrl);n&&(r.rpcUrls={default:{...r.rpcUrls.default,http:[n]},public:{...r.rpcUrls.public,http:[n]}})}e===ty.id&&(r.blockExplorers={default:{name:`Katanascan`,url:`https://katanascan.com`}});let i=_be(e,r?.name||``),a=mbe(e);return{...r,name:i,imageUrl:a}}function _be(e,t){return{[Mv.id]:`Arbitrum`,[Kv.id]:`BSC`,[sy.id]:`Optimism`,[hy.id]:`Soneium`}[e]||t||``}function vbe(e){return e.sort((e,t)=>{let n=bbe.indexOf(e.id),r=bbe.indexOf(t.id);return n!==-1&&r!==-1?n-r:n===-1?r===-1?e.name.localeCompare(t.name):1:-1})}async function ybe(e){return vbe(await hbe(e))}function Ry(e){return Ly(e)?.name??`Chain ${e}`}var zy,bbe,By=o((()=>{Dv(),Y_(),G_(),lbe(),ky(),Fy(),Ty(),Dy(),I_(),zy={chainId:101,name:`Solana`,imageUrl:Ny.SOL},Pv.id,Ly(Pv.id),Iv.id,Ly(Iv.id),Rv.id,Ly(Rv.id),Hv.id,Ly(Hv.id),Gv.id,Ly(Gv.id),qv.id,Ly(qv.id),fy.id,Ly(fy.id),Zv.id,Ly(Zv.id),dy.id,Ly(dy.id),ly.id,Ly(ly.id),_y.id,Ly(_y.id),wy.id,Ly(wy.id),Yv.id,Ly(Yv.id),py.id,Ly(py.id),ay.id,Ly(ay.id),Wv.id,Ly(Wv.id),yy.id,Ly(yy.id),$v.id,Ly($v.id),Mv.id,Fv.id,Bv.id,Xv.id,sy.id,uy.id,ry.id,hy.id,Lv.id,Kv.id,Nv.id,jv.id,Jv.id,Ey.id,iy.id,Uv.id,vy.id,Qv.id,bbe=[ry.id,Bv.id,Mv.id,uy.id,ty.id,Kv.id,sy.id,Fv.id,Nv.id,Jv.id,Xv.id,Lv.id,jv.id,hy.id,Ey.id,iy.id,Uv.id,Qv.id,vy.id]}));function Vy(e,t){return`${e}:${P_(e)?(t??``).trim():M_(t)}`}function Hy(e){return Vy(e.chainId||0,e.contractAddress)}function Uy(e,t,n){return!e||!t?null:e.find(e=>{let r=n==null?A_(e.contractAddress,t):D_(e.contractAddress,t,n),i=n!=null&&T_(t,n)&&(T_(e.contractAddress,n)||e.isNativeToken===!0),a=r||i;return n==null?a:a&&e.chainId===n})??null}function Wy(e,t,n){let r=t?.trim().toUpperCase();return!e||!r?null:e.find(e=>{let t=e.symbol?.trim().toUpperCase()===r;return n==null?t:t&&e.chainId===n})??null}function Gy(e,t,n){let r=t?.trim();return r?n!=null&&P_(n)&&k_(r)||yu(r)?Uy(e,r,n):Wy(e,r,n):null}function xbe(e,t,n){let r=e?.trim();if(!r)return null;let i=n.length>0?n:Py;if(P_(t)){if(k_(r))return{address:r,token:Uy(i,r,t)};let e=Wy(i,r,t);return e?{address:e.contractAddress,token:e}:null}if(yu(r))return{address:r,token:Uy(n,r,t)};let a=r.toUpperCase();if(Oy().find(e=>e.id===t)?.nativeCurrency?.symbol?.toUpperCase()===a){let e=w_(t);return{address:e,token:Uy(n,e,t)}}let o=Wy(i,r,t);return o?{address:o.contractAddress,token:o}:null}var Ky=o((()=>{m_(),ky(),Fy(),I_(),N_()}));function qy(e){let t=[],n=new WeakSet,r=e=>{e&&t[t.length-1]!==e&&t.push(e)},i=e;for(;i;){if(Jy(i)){if(n.has(i))break;n.add(i)}typeof i==`string`&&r(i),Jy(i)&&typeof i.message==`string`&&r(i.message),i=Jy(i)?i.cause??i.originalError??i.error??null:null}return t.join(` | Caused by: `)}function Jy(e){return typeof e==`object`&&!!e}function Sbe(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}function Cbe(e){return Sbe(e.replace(/^Webrpc/,``))}function Yy(e){return e instanceof nb}function wbe(e){return Jy(e)&&typeof e.name==`string`&&typeof e.message==`string`&&typeof e.code==`number`&&typeof e.status==`number`}function Tbe(e){return Yy(e)&&e.boundary?e.boundary:null}function Xy(e){return Yy(e)&&e.code?e.code:wbe(e)?Cbe(e.name):null}function Ebe(e){return e?{contextBoundary:e.boundary,contextCode:e.code}:{}}function Dbe(e){if(!Yy(e))return null;let t=e.details?.apiBoundary;return t===`trails-api`||t===`onramp-api`?t:null}function Obe(e,t){let n={...t.apiBoundary?{apiBoundary:t.apiBoundary}:{},...t.method?{method:t.method}:{},...Ebe(t.context),...t.details,...e.details};return Object.keys(n).length>0&&(e.details=n),e}function kbe(e){let t=qy(e).toLowerCase();return t.includes(`timeout`)||t.includes(`timed out`)||t.includes(`etimedout`)?`timeout`:`request-failed`}function Abe(e){return typeof e==`string`?e:typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`&&e.message.length>0?e.message:qy(e)||`Unknown error`}function jbe(e,t){let n={...e??{},...t??{}};return Object.keys(n).length>0?n:void 0}function Zy(e,t){if(Yy(e))return e;let n=t.message??Abe(e);return new nb(n,{boundary:t.boundary,code:t.code,cause:e,details:t.details})}function Mbe(e,t){return Yy(e)?new nb(t.message??e.message,{boundary:t.boundary,code:t.code,cause:e,details:jbe(e.details,t.details)}):Zy(e,t)}function Nbe(e,t){let n=t.message??Abe(e);return new Zbe(n,{boundary:t.boundary,code:Cbe(e.name),cause:e,details:{...t.method?{method:t.method}:{},...t.details,...Ebe(t.context)},apiName:e.name,apiCode:e.code,apiStatus:e.status})}function Pbe(e){if(Jy(e)&&e.name===`AbortError`)return!0;let t=qy(e).toLowerCase();return t.includes(`failed to fetch`)||t.includes(`fetch failed`)||t.includes(`http request failed`)||t.includes(`network request failed`)||t.includes(`timeout`)||t.includes(`timed out`)||t.includes(`etimedout`)||t.includes(`econnrefused`)||t.includes(`enotfound`)||t.includes(`eai_again`)||t.includes(`network error`)||t.includes(`networkerror`)||t.includes(`err_network`)||t.includes(`aborterror`)||t.includes(`connection error`)}function Qy(e,t){return Yy(e)?Obe(e,{apiBoundary:t.apiBoundary,details:t.details,context:t.apiBoundary?{boundary:t.boundary,code:t.code}:void 0}):t.apiBoundary&&wbe(e)?Nbe(e,{boundary:t.apiBoundary,message:t.message,details:t.details,context:{boundary:t.boundary,code:t.code}}):t.apiBoundary&&Pbe(e)?Zy(e,{boundary:`network`,code:kbe(e),message:t.message,details:{apiBoundary:t.apiBoundary,...Ebe({boundary:t.boundary,code:t.code}),...t.details}}):Zy(e,t)}function Fbe(e){return e instanceof Error?e.message:e?.toString()??``}function Ibe(e){return qy(e).includes(`EXECUTING`)}function Lbe(e){return qy(e).match(/status=(COMMITTED|EXECUTING|SUCCEEDED|FAILED|REFUNDED|ABORTED|INVALID)/)?.[1]??null}function $y(e){if(Xy(e)===`wallet.user-rejected`||Jy(e)&&e.code===4001||e instanceof $be||e instanceof Error&&e.name===`UserRejectionError`)return!0;let t=qy(e).toLowerCase();return/rejected|denied|user rejected|transaction cancelled|transaction canceled|request cancelled|request canceled|user cancelled|user canceled|cancelled user|canceled user|cancelled by user|canceled by user|denied transaction signature|user denied transaction|user denied the request/i.test(t)}function Rbe(e){return Xy(e)===`balance.insufficient`?!0:/have enough balance|not enough balance|insufficient balance|insufficient funds|not enough funds|too low/gi.test(qy(e).toLowerCase())}function zbe(e){let t=Tbe(e);return t===`trails-api`||t===`onramp-api`||Dbe(e)||wbe(e)?!0:/request aborted|not deployed/gi.test(qy(e).toLowerCase())}function Bbe(e){let t=Xy(e);return t===`rate-limited`||t===`quota-rate-limit`?!0:/slow down|request rate|rate limit/gi.test(qy(e).toLowerCase())}function Vbe(e){return/exceeds user-specified maximum/gi.test(qy(e).toLowerCase())}function Hbe(e){return/no available quotes|failed to get quote from any provider/gi.test(qy(e).toLowerCase())}function Ube(e){return Xy(e)===`query-failed`?!0:/GetIntentsQuote failed/gi.test(qy(e).toLowerCase())}function Wbe(e){return/requires destination token to be USDC|Token or chain not found/gi.test(qy(e).toLowerCase())}function Gbe(e){if(Xy(e)===`invalid-argument`){let t=qy(e).toLowerCase();if(/origintokenamount must be greater than zero|trails fee is greater than the origin token amount|insufficient origin amount|fees exceed the provided amount|amount_too_low/.test(t))return!0}return/Invalid input or output currency|originTokenAmount must be greater than zero|trails fee is greater than the origin token amount|insufficient origin amount|fees exceed the provided amount/gi.test(qy(e).toLowerCase())}function Kbe(e){return/HighPriceImpact|high price impact/gi.test(qy(e))}function qbe(e){if(Xy(e)===`invalid-argument`){let t=qy(e).toLowerCase();if(/insufficient liquidity|higher than the available liquidity/.test(t))return!0}return/insufficient liquidity|higher than the available liquidity/gi.test(qy(e).toLowerCase())}function Jbe(e){return/Connector already connected/gi.test(qy(e).toLowerCase())}function Ybe(e){let t=Tbe(e),n=Xy(e);if(t===`network`||n===`request-failed`||n===`timeout`)return!0;let r=qy(e).toLowerCase();return r.includes(`failed to fetch`)||r.includes(`fetch failed`)||r.includes(`http request failed`)||r.includes(`network request failed`)||r.includes(`request failed`)||r.includes(`timeout`)||r.includes(`etimedout`)||r.includes(`econnrefused`)||r.includes(`enotfound`)||r.includes(`eai_again`)||r.includes(`network error`)||r.includes(`networkerror`)||r.includes(`err_network`)||r.includes(`aborterror`)||r.includes(`connection error`)}function Xbe(e){let t=qy(e).toLowerCase();return/meld: source amount is below the minimum allowed|invalid_amount_too_low|amount.*too low.*minimum/gi.test(t)}function eb(e,t=``){let n=qy(e),r=n.toLowerCase(),i=Xy(e);if(i===`quote.timeout`||r.includes(`no route available`)||r.includes(`no edge landing route found`)||r.includes(`edge candidate miss`))return`No route available`;if(i===`quote-expired`)return`This quote expired. Try again to fetch a fresh quote.`;if(i===`rate-limited`||i===`quota-rate-limit`)return`Too many requests. Please try again shortly.`;if(i===`unsupported-network`)return`The selected network is not supported. Please try again on a supported network.`;if(i===`client-outdated`)return`This version of Trails is outdated. Please update and try again.`;if(i===`chain-node-health`||i===`unavailable`)return`The service is temporarily unavailable. Please try again later.`;if(i===`timeout`&&zbe(e))return`The service took too long to respond. Please try again.`;if(i===`request-failed`&&Ybe(e))return`A network error occurred. Please check your connection and try again.`;if(Vbe(e))return`The requested amount is too low to retrieve a quote or the account has insufficient funds to meet the required amount. Try again with a higher amount or make sure you have enough funds.`;if(qbe(e))return`The requested amount is too high to retrieve a quote. Try again with a lower amount.`;if(Hbe(e))return`No quote found for the selected pair and/or amount. Try again with a different pair and/or amount.`;if(Wbe(e))return`The selected token is not supported. Please try again with a different token.`;if(Gbe(e))return`No quote found for the input amount. Try again with a higher amount.`;if(Ube(e))return`No quote found for the selected pair and amount.`;if(zbe(e))return`An API error occurred. Please try again later.`;if($y(e))return`The wallet rejected the request. Please try again.`;if(Jbe(e))return`The wallet is already connected`;if(r.includes(`invalid intent signature`))return`The transaction signature was invalid. Please try again.`;if(r.includes(`transaction aborted`))return`The transaction was aborted. Please try again.`;if(Kbe(e))return`This quote is unavailable due to high price impact (>30%) on a large transfer. Try a smaller amount.`;if(r.includes(`solana origin must use quoteintentedge`))return`Origin chain and wallet do not match. Use a Solana wallet for Solana tokens, or choose an EVM token.`;if(Xbe(e)){let e=n.match(/minimum allowed.*?is ([\d.]+\s*[A-Z]{3})/i),t=e?e[1]:null;return t?`The requested amount is too low. The minimum amount is ${t}. Please try again with a higher amount.`:`The requested amount is too low to retrieve a quote. Try again with a higher amount.`}return t}var tb,nb,Zbe,Qbe,$be,rb=o((()=>{Zr(),tb=class extends Error{constructor(e=`Transaction superseded before fee selection completed`,t){super(e,t),this.name=`TransactionSupersededError`}},nb=class extends Error{constructor(e,t={}){super(e,t.cause===void 0?void 0:{cause:t.cause}),G(this,`boundary`,void 0),G(this,`code`,void 0),G(this,`details`,void 0),this.name=`TrailsError`,this.boundary=t.boundary,this.code=t.code,this.details=t.details}},Zbe=class extends nb{constructor(e,t){super(e,t),G(this,`apiName`,void 0),G(this,`apiCode`,void 0),G(this,`apiStatus`,void 0),this.name=`TrailsApiClientError`,this.boundary=t.boundary,this.apiName=t.apiName,this.apiCode=t.apiCode,this.apiStatus=t.apiStatus}},Qbe=class extends nb{constructor(e,t={}){super(e,{...t,boundary:t.boundary??`sdk`,code:t.code??`balance.insufficient`}),this.name=`InsufficientBalanceError`}},$be=class extends nb{constructor(e,t={}){super(e,{...t,boundary:t.boundary??`wallet`,code:t.code??`wallet.user-rejected`}),this.name=`UserRejectionError`}}}));function exe(e){return e instanceof ib}var ib,txe=o((()=>{Zr(),ib=class extends Error{constructor(e,t,n){super(t,n),G(this,`code`,void 0),this.name=`TrailsWalletError`,this.code=e,Object.setPrototypeOf(this,new.target.prototype)}}}));function nxe(e){return new ib(`context.runtime_missing`,`${e} must be used within a supported wallet runtime or <WalletProvider>.`)}var rxe=o((()=>{txe()}));function ixe(e){return Object.freeze({sessionAdapter:e})}function axe(){return oxe}var oxe,sxe=o((()=>{oxe=ixe(null)}));function cxe(){return(0,ab.useContext)(uxe)}function lxe(){let e=cxe(),t=(0,ab.useCallback)(t=>e?e.subscribe(t):()=>{},[e]),n=(0,ab.useCallback)(()=>e?e.getSnapshot():axe(),[e]),r=(0,ab.useSyncExternalStore)(t,n,n);return e?r:null}var ab,uxe,dxe=o((()=>{ab=d(m(),1),sxe(),uxe=(0,ab.createContext)(null)}));function fxe(){return lxe()?.sessionAdapter??null}var pxe=o((()=>{dxe()}));function mxe(){return fxe()?.connectOptions??null}var hxe=o((()=>{pxe()}));function gxe(){return lxe()?.sessionAdapter?.session??null}var _xe=o((()=>{dxe()})),vxe=o((()=>{rxe(),pxe(),hxe(),_xe()}));function yxe(){return typeof window>`u`?!1:/android/i.test(window.navigator.userAgent)}function ob(e,t){return yxe()?e:`${t}${encodeURIComponent(e)}`}function bxe(){return typeof window<`u`?window.location.href:``}function xxe(){return[...cb]}function Sxe(e){if(e)return jxe[e.toLowerCase()]}function Cxe(e){let t=Sxe(e);if(t)return Axe[t]}function wxe(e){let t=Cxe(e);return t?[t.id,...t.aliases??[]]:e?[e]:[]}function Txe(){return cb.filter(e=>e.embedded).map(e=>e.id)}function Exe(){return cb.filter(e=>typeof e.solanaOrder==`number`).toSorted((e,t)=>(e.solanaOrder??2**53-1)-(t.solanaOrder??2**53-1)).map(e=>({id:e.solanaId??e.id,installUrl:e.installUrl,name:e.solanaName??e.name}))}var Dxe,sb,Oxe,kxe,Axe,cb,jxe,Mxe=o((()=>{Dxe=`sequence`,sb=`sequence-waas`,Oxe=`sequence-embedded`,kxe={injected:{id:`injected`,name:`Browser Wallet`,namespaces:[`eip155`],iconKey:`injected`},walletconnect:{id:`walletconnect`,aliases:[`walletConnect`,`wallet-connect`],name:`WalletConnect`,namespaces:[`eip155`],iconKey:`walletconnect`,featuredOrder:1,primaryOrder:1,native:{explicitConnector:`walletconnect`,order:1},walletConnect:{enabled:!0,nativeOrder:1}},metamask:{id:`metamask`,aliases:[`metamask-wallet`],name:`MetaMask`,namespaces:[`eip155`,`solana`],iconKey:`metamask`,installUrl:`https://metamask.io/download/`,rdns:[`io.metamask`],featuredOrder:0,primaryOrder:0,solanaOrder:6,native:{order:0},qrCode:{label:`MetaMask`,usesEip681:!0,order:0},getWalletConnectDeepLink:e=>ob(e,`https://metamask.app.link/wc?uri=`),injected:{selectors:[e=>e.isMetaMask===!0&&e.isRabby!==!0]},walletConnect:{fallback:!0,nativeOrder:0}},baseAccount:{id:`baseAccount`,aliases:[`base`,`base-account`],name:`Base`,namespaces:[`eip155`],iconKey:`baseAccount`},safe:{id:`safe`,aliases:[`safe-wallet`],name:`Safe`,namespaces:[`eip155`],iconKey:`safe`,getWalletConnectDeepLink:e=>ob(e,`https://gnosis-safe.io/wc?uri=`)},rainbow:{id:`rainbow`,aliases:[`rainbow-wallet`],name:`Rainbow`,namespaces:[`eip155`],iconKey:`rainbow`,rdns:[`me.rainbow`],featuredOrder:3,native:{order:4},qrCode:{label:`Rainbow`,usesEip681:!1,order:4},getWalletConnectDeepLink:e=>ob(e,`https://rnbwapp.com/wc?uri=`),injected:{selectors:[e=>e.isRainbow===!0],windowPaths:[`rainbow`]},walletConnect:{fallback:!0,nativeOrder:4}},trust:{id:`trust`,aliases:[`trust-wallet`,`trustwallet`],name:`Trust`,namespaces:[`eip155`,`solana`],iconKey:`trust`,installUrl:`https://trustwallet.com/browser-extension`,rdns:[`com.trustwallet.app`],solanaId:`trust-wallet`,solanaName:`Trust Wallet`,solanaOrder:4,native:{order:5},qrCode:{label:`Trust Wallet`,usesEip681:!1,order:2},getWalletConnectDeepLink:e=>ob(e,`https://link.trustwallet.com/wc?uri=`),injected:{windowPaths:[`trustwallet`]},walletConnect:{fallback:!0,nativeOrder:5}},ambire:{id:`ambire`,aliases:[`ambire-wallet`],name:`Ambire Wallet`,namespaces:[`eip155`],iconKey:`ambire`,rdns:[`xyz.ambire`],native:{order:9},injected:{windowPaths:[`ambire`]},walletConnect:{fallback:!0,nativeOrder:9}},argent:{id:`argent`,aliases:[`argent-wallet`],name:`Argent`,namespaces:[`eip155`],iconKey:`argent`,getWalletConnectDeepLink:e=>ob(e,`https://argent.link/app/wc?uri=`)},binance:{id:`binance`,aliases:[`binance-wallet`,`binancewallet`],name:`Binance Wallet`,namespaces:[`eip155`],iconKey:`binance`},okx:{id:`okx`,aliases:[`okx-wallet`,`okxwallet`],name:`OKX Wallet`,namespaces:[`eip155`],iconKey:`okx`,rdns:[`io.okx.wallet`],native:{order:7},injected:{windowPaths:[`okxwallet`]},walletConnect:{fallback:!0,nativeOrder:7}},zerion:{id:`zerion`,aliases:[`zerion-wallet`],name:`Zerion`,namespaces:[`eip155`],iconKey:`zerion`,rdns:[`app.zerion`,`io.zerion`],native:{order:8},getWalletConnectDeepLink:e=>ob(e,`https://app.zerion.io/wc?uri=`),injected:{windowPaths:[`zerionWallet`]},walletConnect:{fallback:!0,nativeOrder:8}},phantom:{id:`phantom`,aliases:[`phantom-wallet`],name:`Phantom`,namespaces:[`eip155`,`solana`],iconKey:`phantom`,installUrl:`https://phantom.com/download`,rdns:[`app.phantom`],featuredOrder:4,solanaOrder:0,native:{order:6},qrCode:{label:`Phantom`,usesEip681:!1,order:5},getWalletConnectDeepLink:()=>`https://phantom.app/ul/browse/${encodeURIComponent(bxe())}`,injected:{windowPaths:[[`phantom`,`ethereum`]]},walletConnect:{fallback:!0,nativeOrder:6}},coinbase:{id:`coinbase`,aliases:[`coinbase-wallet`,`coinbasewallet`],name:`Coinbase Wallet`,namespaces:[`eip155`],iconKey:`coinbase`,rdns:[`com.coinbase.wallet`],featuredOrder:2,native:{order:2},qrCode:{label:`CB Wallet`,usesEip681:!1,order:1},getWalletConnectDeepLink:e=>`https://go.cb-w.com/wc?uri=${encodeURIComponent(e)}`,injected:{selectors:[e=>e.isCoinbaseWallet===!0],windowPaths:[`coinbaseWalletExtension`]},walletConnect:{fallback:!0,nativeOrder:2}},rabby:{id:`rabby`,aliases:[`rabby-wallet`],name:`Rabby`,namespaces:[`eip155`],iconKey:`rabby`,installUrl:`https://rabby.io/`,rdns:[`io.rabby`],native:{order:3},qrCode:{label:`Rabby`,usesEip681:!1,order:3},injected:{selectors:[e=>e.isRabby===!0]},walletConnect:{fallback:!0,nativeOrder:3}},privy:{id:`privy`,name:`Privy`,namespaces:[`eip155`],iconKey:`privy`,embedded:!0},gemini:{id:`gemini`,aliases:[`gemini-wallet`],name:`Gemini`,namespaces:[`eip155`],iconKey:`gemini`},sequence:{id:Dxe,aliases:[`sequence-wallet`],name:`Sequence`,namespaces:[`eip155`],iconKey:`sequence`},[sb]:{id:sb,aliases:[Oxe],name:`Sequence Embedded`,namespaces:[`eip155`],iconKey:`sequence`,embedded:!0},bitget:{id:`bitget`,aliases:[`bitget-wallet`],name:`Bitget Wallet`,namespaces:[`eip155`],iconKey:`bitget`,rdns:[`world.bitget`]},"1inch":{id:`1inch`,aliases:[`1inch-wallet`],name:`1inch Wallet`,namespaces:[`eip155`],iconKey:`1inch`,rdns:[`io.1inch.wallet`]},brave:{id:`brave`,aliases:[`brave-wallet`],name:`Brave Wallet`,namespaces:[`eip155`],iconKey:`brave`,rdns:[`com.brave.wallet`]},solflare:{id:`solflare`,aliases:[`solflare-wallet`],name:`Solflare`,namespaces:[`solana`],iconKey:`solflare`,installUrl:`https://solflare.com/connect/`,solanaOrder:1},jupiter:{id:`jupiter`,aliases:[`jupiter-wallet`],name:`Jupiter`,namespaces:[`solana`],iconKey:`jupiter`,installUrl:`https://docs.jup.ag/user-docs/manage/extension-wallet`,solanaOrder:2},exodus:{id:`exodus`,aliases:[`exodus-wallet`],name:`Exodus`,namespaces:[`solana`],iconKey:`exodus`,installUrl:`https://www.exodus.com/browser-extension/`,solanaOrder:3},backpack:{id:`backpack`,aliases:[`backpack-wallet`],name:`Backpack`,namespaces:[`solana`],iconKey:`backpack`,installUrl:`https://backpack.app/download`,solanaOrder:5}},Axe=kxe,cb=Object.values(kxe),jxe=cb.reduce((e,t)=>{e[t.id.toLowerCase()]=t.id;for(let n of t.aliases??[])e[n.toLowerCase()]=t.id;return e},{})}));function lb(e){if(e)return Sxe(e)??e}function Nxe(e){let t=lb(e);return t?wxe(t):[]}function ub(e,t){let n=lb(e),r=lb(t);return!n||!r?!1:n===r}function db(e){return lb(e)===sb}function Pxe(e){let t=lb(e);return!!t&&Lxe.has(t.toLowerCase())}function Fxe(e){let t=lb(e);return t===`sequence`||t===`sequence-waas`}var Ixe,Lxe,fb=o((()=>{Mxe(),Ixe=[`omswallet`],Lxe=new Set([...Txe().map(e=>e.toLowerCase()),...Ixe])}));function Rxe(e){let t=lb(e),n=Fxe(t),r=Pxe(t),i=db(t);return{walletId:t??e,isSequenceWallet:n,isEmbeddedWallet:r,requiresFeeOptions:i,requiresNativeGasFee:n,supportsGaslessDeposit:!i,suppressesContractRefundWarning:n}}var zxe=o((()=>{fb()}));function Bxe(e){return{id:e.id,groupId:e.groupId,namespace:e.namespace,name:e.name,icon:e.icon,tags:e.tags}}function Vxe(e){return{...Bxe(e),flow:e.flow??`direct`,placement:e.placement??Yxe(e),discovered:e.discovered??!1,connected:e.connected??!1,explicitOrder:e.explicitOrder,getWalletConnectDeepLink:e.getWalletConnectDeepLink}}function Hxe(e){let t=e.accounts.map(t=>({address:t.address,namespace:t.namespace??e.namespace,chainId:t.chainId??e.chainId,label:t.label}));return{id:e.id,namespace:e.namespace,walletId:e.walletId,walletGroupId:e.walletGroupId,walletName:e.walletName,walletBehavior:Rxe(e.walletId),accounts:t,activeAccount:e.activeAccount?{address:e.activeAccount.address,namespace:e.activeAccount.namespace??e.namespace,chainId:e.activeAccount.chainId??e.chainId??t[0]?.chainId,label:e.activeAccount.label}:t[0],showDisconnect:e.showDisconnect??e.ui?.showDisconnect??!db(e.walletId),ui:{showDisconnect:e.showDisconnect??e.ui?.showDisconnect??!db(e.walletId)}}}function Uxe({status:e,wallets:t,connections:n,activeConnectionId:r,activeAccountAddress:i,defaultNamespace:a=`eip155`}){let o=n.map(Hxe),s=t.map(e=>Vxe({...e,connected:e.connected??o.some(t=>t.walletId===e.id)})),c=s.map(qxe),l=r?o.find(e=>e.id===r):o[0],u=l?.accounts.find(e=>e.address.toLowerCase()===i?.toLowerCase())??l?.activeAccount;return Gxe({namespace:l?.namespace??u?.namespace??s[0]?.namespace??c[0]?.namespace??a,namespaces:Xxe({defaultNamespace:a,connections:o,wallets:c}),status:e,wallets:c,connections:o,activeConnection:l,activeAccount:u},s)}function Wxe({session:e,connectOptions:t,actions:n}){let r=Kxe(e);return{namespace:e.namespace,session:e,connectOptions:(t?[...t]:void 0)??r??e.wallets.map(t=>Jxe(t,e.connections)),...n}}function Gxe(e,t){return Object.defineProperty(e,Zxe,{value:[...t],enumerable:!1,configurable:!1,writable:!1}),e}function Kxe(e){return e[Zxe]}function qxe(e){return{id:e.id,groupId:e.groupId,namespace:e.namespace,name:e.name,icon:e.icon,tags:e.tags}}function Jxe(e,t){return{...e,flow:`direct`,placement:`list`,discovered:!1,connected:t.some(t=>t.walletId===e.id)}}function Yxe(e){return e.flow===`walletconnect`||e.id===`walletconnect`?`flow`:e.discovered&&!e.connected?`detected`:`list`}function Xxe({defaultNamespace:e,connections:t,wallets:n}){let r=new Set;for(let e of t)r.add(e.namespace);for(let e of n)r.add(e.namespace);return r.size===0&&r.add(e),[...r]}var Zxe,Qxe=o((()=>{zxe(),fb(),Zxe=Symbol(`sessionConnectOptions`)}));function $xe(e){return Hxe({...e,namespace:`eip155`,accounts:e.accounts.map(e=>({...e,namespace:`eip155`})),activeAccount:e.activeAccount?{...e.activeAccount,namespace:`eip155`}:void 0})}function eSe({status:e,wallets:t,connections:n,activeConnectionId:r,activeAccountAddress:i}){return Uxe({status:e,defaultNamespace:`eip155`,wallets:t.map(e=>({...e,namespace:`eip155`})),connections:n.map(e=>({...e,namespace:`eip155`,accounts:e.accounts.map(e=>({...e,namespace:`eip155`})),activeAccount:e.activeAccount?{...e.activeAccount,namespace:`eip155`}:void 0,managedBy:e.managedBy,showDisconnect:e.showDisconnect,ui:e.ui})),activeConnectionId:r,activeAccountAddress:i})}function tSe({session:e,connectOptions:t,actions:n}){return Wxe({session:e,connectOptions:t,actions:n})}var nSe=o((()=>{Qxe()})),rSe=o((()=>{dxe(),sxe()})),pb=o((()=>{vxe(),Qxe(),nSe(),rSe(),sxe(),zxe()}));function iSe(e){return new ib(`input.invalid`,e)}function aSe(e){return new ib(`connection.invalid`,e)}function oSe(e){return new ib(`connector.unknown`,`Unknown wallet connector: ${e}`)}function sSe(e){return new ib(`provider.no_accounts`,`${e} returned no accounts.`)}function cSe(e){return new ib(`provider.connection_lost`,`Wallet connection lost. Please reconnect your wallet and try again.`,e)}function lSe(e){return new ib(`transport.invalid`,`Invalid wallet transport`,e)}function uSe(){return new ib(`transport.chain_id_invalid`,`Wallet transport returned an invalid chain ID`)}function dSe(e){return new ib(`chain.switch_failed`,`Failed to switch wallet chain to ${e}`)}function fSe(){return new ib(`walletconnect.unavailable`,`WalletConnect connector not available`)}function pSe(e){return new ib(`walletconnect.rejected`,`Wallet connection request was rejected.`,e)}function mSe(e){return new ib(`walletconnect.reset`,`Wallet connection request was reset. Please try again.`,e)}var mb=o((()=>{txe()}));function hSe(e,t){return e?.chain??t?.chain??void 0}var gSe,_Se=o((()=>{gSe={namespace:`eip155`,namespaces:[`eip155`],status:`disconnected`,wallets:[],connections:[]}}));function hb(){return(0,ySe.useContext)(bSe)}function vSe(){return hb()!==null}function gb(){let e=hb();return(0,ySe.useSyncExternalStore)(e?.subscribe??SSe,e?.getSnapshot??CSe,e?.getSnapshot??CSe)}var ySe,bSe,xSe,SSe,CSe,_b=o((()=>{ySe=d(m(),1),bSe=(0,ySe.createContext)(null),xSe=()=>{},SSe=()=>xSe,CSe=()=>null}));function wSe(){let e=vb();if(!e)throw nxe(`useWalletSession`);return e}function vb(){let e=gb(),t=gxe();return e?.session??t}var yb=o((()=>{pb(),rxe(),_b()}));function TSe({connection:e,snapshot:t}){return e.namespace??t?.session.connections.find(t=>t.id===e.id)?.namespace??e.connector?.namespace??t?.namespace??`eip155`}function ESe(e){return(e?.runtimeConnections??[]).map(t=>{let n=TSe({connection:t,snapshot:e});return Object.assign({},t,{namespace:n,connector:Object.assign({},t.connector,{namespace:n})})})}function DSe(){let e=gb();return(0,OSe.useMemo)(()=>ESe(e),[e])}var OSe,kSe=o((()=>{OSe=d(m(),1),_b()}));function ASe(){let e=DSe(),t=vb();return(0,jSe.useMemo)(()=>t?.activeConnection?.id?e.find(e=>e.id===t.activeConnection?.id)??null:null,[e,t?.activeConnection?.id])}var jSe,MSe=o((()=>{jSe=d(m(),1),yb(),kSe()}));function NSe(e){return e?.capabilities??null}function PSe(e){return(e?.runtimeConnections??[]).map(t=>{let n=t.namespace??e?.session.connections.find(e=>e.id===t.id)?.namespace??e?.namespace??`eip155`;return Object.assign({},t,{namespace:n})})}function FSe(e,t){return e?.namespace===`eip155`?e?.evm?.walletClient??t:e?.evm?.walletClient??null}function ISe(e){return e?.namespace===`eip155`?e?.evm?.publicClient??null:null}function LSe(e){let{activeRuntimeConnection:t,capabilities:n,snapshot:r,walletClient:i}=e;return r?.namespace!==`eip155`&&r?.session.activeConnection?.namespace!==`eip155`&&n?.namespace!==`eip155`&&t?.namespace!==`eip155`&&r?.session.activeAccount?.namespace!==`eip155`?0:r?.chainId??i?.chain?.id??n?.evm?.chainId??t?.chainId??r?.session.activeAccount?.chainId??0}function RSe(e){let t=e?.session.activeConnection?.id;return t?PSe(e).find(n=>n.id===t&&(n.namespace??e?.namespace)===`eip155`)??null:null}var zSe=o((()=>{}));function BSe(){return NSe(gb())}var VSe=o((()=>{_b(),zSe()}));function HSe(){let e=gb(),t=BSe();return LSe({activeRuntimeConnection:RSe(e),capabilities:t,snapshot:e,walletClient:FSe(t,null)})}var USe=o((()=>{_b(),zSe(),VSe()}));
114
114
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
115
115
  function bb(e,t=``){if(typeof e!=`boolean`){let n=t&&`"${t}"`;throw Error(n+`expected boolean, got type=`+typeof e)}return e}function xb(e,t,n=``){let r=dl(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`;throw Error(o+`expected Uint8Array`+s+`, got `+c)}return e}function WSe(e){let t=e.toString(16);return t.length&1?`0`+t:t}function GSe(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);return e===``?tCe:BigInt(`0x`+e)}function KSe(e){return GSe(Cl(e))}function Sb(e){return pl(e),GSe(Cl(Uint8Array.from(e).reverse()))}function qSe(e,t){return Tl(e.toString(16).padStart(t*2,`0`))}function JSe(e,t){return qSe(e,t).reverse()}function Cb(e,t,n){let r;if(typeof t==`string`)try{r=Tl(t)}catch(t){throw Error(e+` must be hex string or Uint8Array, cause: `+t)}else if(dl(t))r=Uint8Array.from(t);else throw Error(e+` must be hex string or Uint8Array`);let i=r.length;if(typeof n==`number`&&i!==n)throw Error(e+` of length `+n+` expected, got `+i);return r}function YSe(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function XSe(e){return Uint8Array.from(e)}function ZSe(e,t,n){return rCe(e)&&rCe(t)&&rCe(n)&&t<=e&&e<n}function wb(e,t,n,r){if(!ZSe(t,n,r))throw Error(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function QSe(e){let t;for(t=0;e>tCe;e>>=nCe,t+=1);return t}function $Se(e,t,n){if(typeof e!=`number`||e<2)throw Error(`hashLen must be a number`);if(typeof t!=`number`||t<2)throw Error(`qByteLen must be a number`);if(typeof n!=`function`)throw Error(`hmacFn must be a function`);let r=e=>new Uint8Array(e),i=e=>Uint8Array.of(e),a=r(e),o=r(e),s=0,c=()=>{a.fill(1),o.fill(0),s=0},l=(...e)=>n(o,a,...e),u=(e=r(0))=>{o=l(i(0),e),a=l(),e.length!==0&&(o=l(i(1),e),a=l())},d=()=>{if(s++>=1e3)throw Error(`drbg: tried 1000 values`);let e=0,n=[];for(;e<t;){a=l();let t=a.slice();n.push(t),e+=a.length}return Dl(...n)};return(e,t)=>{c(),u(e);let n;for(;!(n=t(d()));)u();return c(),n}}function Tb(e,t,n={}){if(!e||typeof e!=`object`)throw Error(`expected valid options object`);function r(t,n,r){let i=e[t];if(r&&i===void 0)return;let a=typeof i;if(a!==n||i===null)throw Error(`param "${t}" is invalid: expected ${n}, got ${a}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))}function eCe(e){let t=new WeakMap;return(n,...r)=>{let i=t.get(n);if(i!==void 0)return i;let a=e(n,...r);return t.set(n,a),a}}var tCe,nCe,rCe,Eb,iCe,Db=o((()=>{Ll(),tCe=BigInt(0),nCe=BigInt(1),rCe=e=>typeof e==`bigint`&&tCe<=e,Eb=e=>(nCe<<BigInt(e))-nCe,iCe=()=>{throw Error(`not implemented`)}}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "0xtrails",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "description": "SDK for Trails",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -33,8 +33,8 @@
33
33
  "lucide-react": "1.23.0",
34
34
  "ox": "0.14.29",
35
35
  "qrcode": "1.5.4",
36
- "@0xtrails/wallet": "0.17.0",
37
- "@0xtrails/api": "0.17.0"
36
+ "@0xtrails/wallet": "0.17.1",
37
+ "@0xtrails/api": "0.17.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@tailwindcss/postcss": "^4.3.0",