@dodoex/wallet-web3 0.0.29-3 → 0.0.29-4

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.
Files changed (72) hide show
  1. package/dist/__node-resolve_empty-9c0fe235.js +1 -0
  2. package/dist/__tslib-8d197f50.js +1 -0
  3. package/dist/{blocto-81feb681.js → blocto-6a8a2342.js} +1 -1
  4. package/dist/{bn-6112a089.js → bn-b39718d7.js} +1 -1
  5. package/dist/{browser-ponyfill-561fcb2e.js → browser-ponyfill-7992d3d0.js} +1 -1
  6. package/dist/cjs/{__node-resolve_empty-7e18e37f.cjs → __node-resolve_empty-71310b0b.cjs} +1 -1
  7. package/dist/cjs/__tslib-e8ae5da7.cjs +1 -0
  8. package/dist/cjs/{blocto-dc48a1ad.cjs → blocto-06fd57f6.cjs} +1 -1
  9. package/dist/cjs/{bn-f53db394.cjs → bn-9dd9a29f.cjs} +1 -1
  10. package/dist/cjs/{browser-ponyfill-0731a4ed.cjs → browser-ponyfill-71e323cb.cjs} +1 -1
  11. package/dist/cjs/{ethers-4e66d72a.cjs → ethers-bab3724b.cjs} +1 -1
  12. package/dist/cjs/{id-8a644c33.cjs → id-d7130594.cjs} +1 -1
  13. package/dist/cjs/{index-a06b11a5.cjs → index-0d0e0a26.cjs} +1 -1
  14. package/dist/cjs/index-269c7834.cjs +1 -0
  15. package/dist/cjs/{index-d6d65bef.cjs → index-270bac6a.cjs} +1 -1
  16. package/dist/cjs/{index-ea466b80.cjs → index-2e2cf060.cjs} +1 -1
  17. package/dist/cjs/{index-4a570b13.cjs → index-5077c64e.cjs} +1 -1
  18. package/dist/cjs/{index-1466df1b.cjs → index-5f82d59c.cjs} +1 -1
  19. package/dist/cjs/index-6286567d.cjs +66 -0
  20. package/dist/cjs/{index-4b4d2602.cjs → index-6867dc10.cjs} +1 -1
  21. package/dist/cjs/{index-cc9917b7.cjs → index-79a671ea.cjs} +1 -1
  22. package/dist/cjs/{index-55ec09dc.cjs → index-8e09ff75.cjs} +1 -1
  23. package/dist/cjs/{index-815203b8.cjs → index-e3acb1db.cjs} +1 -1
  24. package/dist/cjs/{index-2bdefe92.cjs → index-e51dad87.cjs} +1 -1
  25. package/dist/cjs/index.cjs +1 -1
  26. package/dist/cjs/index.es-f9ac36f5.cjs +9 -0
  27. package/dist/cjs/{interface-225981df.cjs → interface-c44121d8.cjs} +1 -1
  28. package/dist/cjs/{portis-3fafbe79.cjs → portis-84ad4e3c.cjs} +1 -1
  29. package/dist/cjs/{provider-a262028d.cjs → provider-69ecf3d5.cjs} +1 -1
  30. package/dist/cjs/{rainbow-b604cbf7.cjs → rainbow-4e6702b8.cjs} +1 -1
  31. package/dist/cjs/{typed-data-c4ecf952.cjs → typed-data-8c267c11.cjs} +1 -1
  32. package/dist/cjs/{uAuth-f1305031.cjs → uAuth-6885948a.cjs} +1 -1
  33. package/dist/cjs/{walletConnect-a53f336c.cjs → walletConnect-d4959518.cjs} +1 -1
  34. package/dist/cjs/walletLink-c6edc88a.cjs +1 -0
  35. package/dist/{ethers-acfbf5c9.js → ethers-8181a73b.js} +1 -1
  36. package/dist/{id-bc5c09f7.js → id-6d8573d3.js} +1 -1
  37. package/dist/{index-cc5a134a.js → index-15483c83.js} +1 -1
  38. package/dist/{index-9d00f201.js → index-472a33f8.js} +1 -1
  39. package/dist/{index-030da250.js → index-6168470a.js} +1 -1
  40. package/dist/{index-f14e5faf.js → index-6c5eabc0.js} +1 -1
  41. package/dist/{index-e0d3617a.js → index-71e104e3.js} +1 -1
  42. package/dist/{index-9006cf1c.js → index-9a2fe895.js} +1 -1
  43. package/dist/{index-a22d40f4.js → index-9c184c63.js} +1 -1
  44. package/dist/{index-f419935b.js → index-a799f96f.js} +1 -1
  45. package/dist/index-aa70a2b2.js +66 -0
  46. package/dist/index-caf37db5.js +1 -0
  47. package/dist/{index-48b745cb.js → index-d1677b7f.js} +1 -1
  48. package/dist/{index-fe8f3b3c.js → index-f80f2892.js} +1 -1
  49. package/dist/index.es-2660d81c.js +9 -0
  50. package/dist/index.js +1 -1
  51. package/dist/{interface-0a756904.js → interface-04b0d44b.js} +1 -1
  52. package/dist/{portis-115bb575.js → portis-be0e0b07.js} +1 -1
  53. package/dist/{provider-a182bcd5.js → provider-bafb9c6b.js} +1 -1
  54. package/dist/rainbow-7b3f336e.js +1 -0
  55. package/dist/{typed-data-a195e004.js → typed-data-e96f6ed3.js} +1 -1
  56. package/dist/{uAuth-cf583f8b.js → uAuth-01120919.js} +1 -1
  57. package/dist/walletConnect-b5c5df2e.js +1 -0
  58. package/dist/walletLink-59d4a764.js +1 -0
  59. package/package.json +2 -3
  60. package/dist/__node-resolve_empty-abf9d05c.js +0 -1
  61. package/dist/__tslib-2cf47e60.js +0 -1
  62. package/dist/cjs/__tslib-ea7958de.cjs +0 -1
  63. package/dist/cjs/index-df8e5839.cjs +0 -1
  64. package/dist/cjs/index-eb09e54d.cjs +0 -60
  65. package/dist/cjs/index.es-21cc8770.cjs +0 -9
  66. package/dist/cjs/walletLink-df159d74.cjs +0 -1
  67. package/dist/index-0ee5ef8d.js +0 -60
  68. package/dist/index-7c8bbc42.js +0 -1
  69. package/dist/index.es-0f31065d.js +0 -9
  70. package/dist/rainbow-f5118874.js +0 -1
  71. package/dist/walletConnect-49aee65f.js +0 -1
  72. package/dist/walletLink-fbbe6e77.js +0 -1
@@ -1 +1 @@
1
- import{hexlify as r,arrayify as t,isBytesLike as o}from"@ethersproject/bytes";import{L as e}from"./id-bc5c09f7.js";const n=new e("rlp/5.7.0");function s(r){const t=[];for(;r;)t.unshift(255&r),r>>=8;return t}function c(r,t,o){let e=0;for(let n=0;n<o;n++)e=256*e+r[t+n];return e}function h(r){if(Array.isArray(r)){let t=[];if(r.forEach((function(r){t=t.concat(h(r))})),t.length<=55)return t.unshift(192+t.length),t;const o=s(t.length);return o.unshift(247+o.length),o.concat(t)}o(r)||n.throwArgumentError("RLP object must be BytesLike","object",r);const e=Array.prototype.slice.call(t(r));if(1===e.length&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const c=s(e.length);return c.unshift(183+c.length),c.concat(e)}function u(t){return r(h(t))}function a(r,t,o,s){const c=[];for(;o<t+1+s;){const h=l(r,o);c.push(h.result),(o+=h.consumed)>t+1+s&&n.throwError("child data too short",e.errors.BUFFER_OVERRUN,{})}return{consumed:1+s,result:c}}function l(t,o){if(0===t.length&&n.throwError("data too short",e.errors.BUFFER_OVERRUN,{}),t[o]>=248){const r=t[o]-247;o+1+r>t.length&&n.throwError("data short segment too short",e.errors.BUFFER_OVERRUN,{});const s=c(t,o+1,r);return o+1+r+s>t.length&&n.throwError("data long segment too short",e.errors.BUFFER_OVERRUN,{}),a(t,o,o+1+r,r+s)}if(t[o]>=192){const r=t[o]-192;return o+1+r>t.length&&n.throwError("data array too short",e.errors.BUFFER_OVERRUN,{}),a(t,o,o+1,r)}if(t[o]>=184){const s=t[o]-183;o+1+s>t.length&&n.throwError("data array too short",e.errors.BUFFER_OVERRUN,{});const h=c(t,o+1,s);o+1+s+h>t.length&&n.throwError("data array too short",e.errors.BUFFER_OVERRUN,{});return{consumed:1+s+h,result:r(t.slice(o+1+s,o+1+s+h))}}if(t[o]>=128){const s=t[o]-128;o+1+s>t.length&&n.throwError("data too short",e.errors.BUFFER_OVERRUN,{});return{consumed:1+s,result:r(t.slice(o+1,o+1+s))}}return{consumed:1,result:r(t[o])}}function i(r){const o=t(r),e=l(o,0);return e.consumed!==o.length&&n.throwArgumentError("invalid rlp data","data",r),e.result}var f=Object.freeze({__proto__:null,encode:u,decode:i});export{i as d,u as e,f as l};
1
+ import{hexlify as r,arrayify as t,isBytesLike as o}from"@ethersproject/bytes";import{L as e}from"./id-6d8573d3.js";const n=new e("rlp/5.7.0");function s(r){const t=[];for(;r;)t.unshift(255&r),r>>=8;return t}function c(r,t,o){let e=0;for(let n=0;n<o;n++)e=256*e+r[t+n];return e}function h(r){if(Array.isArray(r)){let t=[];if(r.forEach((function(r){t=t.concat(h(r))})),t.length<=55)return t.unshift(192+t.length),t;const o=s(t.length);return o.unshift(247+o.length),o.concat(t)}o(r)||n.throwArgumentError("RLP object must be BytesLike","object",r);const e=Array.prototype.slice.call(t(r));if(1===e.length&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const c=s(e.length);return c.unshift(183+c.length),c.concat(e)}function u(t){return r(h(t))}function a(r,t,o,s){const c=[];for(;o<t+1+s;){const h=l(r,o);c.push(h.result),(o+=h.consumed)>t+1+s&&n.throwError("child data too short",e.errors.BUFFER_OVERRUN,{})}return{consumed:1+s,result:c}}function l(t,o){if(0===t.length&&n.throwError("data too short",e.errors.BUFFER_OVERRUN,{}),t[o]>=248){const r=t[o]-247;o+1+r>t.length&&n.throwError("data short segment too short",e.errors.BUFFER_OVERRUN,{});const s=c(t,o+1,r);return o+1+r+s>t.length&&n.throwError("data long segment too short",e.errors.BUFFER_OVERRUN,{}),a(t,o,o+1+r,r+s)}if(t[o]>=192){const r=t[o]-192;return o+1+r>t.length&&n.throwError("data array too short",e.errors.BUFFER_OVERRUN,{}),a(t,o,o+1,r)}if(t[o]>=184){const s=t[o]-183;o+1+s>t.length&&n.throwError("data array too short",e.errors.BUFFER_OVERRUN,{});const h=c(t,o+1,s);o+1+s+h>t.length&&n.throwError("data array too short",e.errors.BUFFER_OVERRUN,{});return{consumed:1+s+h,result:r(t.slice(o+1+s,o+1+s+h))}}if(t[o]>=128){const s=t[o]-128;o+1+s>t.length&&n.throwError("data too short",e.errors.BUFFER_OVERRUN,{});return{consumed:1+s,result:r(t.slice(o+1,o+1+s))}}return{consumed:1,result:r(t[o])}}function i(r){const o=t(r),e=l(o,0);return e.consumed!==o.length&&n.throwArgumentError("invalid rlp data","data",r),e.result}var f=Object.freeze({__proto__:null,encode:u,decode:i});export{i as d,u as e,f as l};
@@ -1 +1 @@
1
- const e=Symbol(),t=Object.getPrototypeOf,s=new WeakMap,o=o=>(e=>e&&(s.has(e)?s.get(e):t(e)===Object.prototype||t(e)===Array.prototype))(o)&&o[e]||null,n=(e,t=!0)=>{s.set(e,t)},a=e=>"object"==typeof e&&null!==e,r=new WeakMap,i=new WeakSet,[l]=((e=Object.is,t=((e,t)=>new Proxy(e,t)),s=(e=>a(e)&&!i.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)),l=(e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}}),c=new WeakMap,d=((e,t,s=l)=>{const o=c.get(e);if((null==o?void 0:o[0])===t)return o[1];const a=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return n(a,!0),c.set(e,[t,a]),Reflect.ownKeys(e).forEach((t=>{if(Object.getOwnPropertyDescriptor(a,t))return;const o=Reflect.get(e,t),l={value:o,enumerable:!0,configurable:!0};if(i.has(o))n(o,!1);else if(o instanceof Promise)delete l.value,l.get=()=>s(o);else if(r.has(o)){const[e,t]=r.get(o);l.value=d(e,t(),s)}Object.defineProperty(a,t,l)})),Object.preventExtensions(a)}),p=new WeakMap,u=[1,1],m=(n=>{if(!a(n))throw new Error("object required");const l=p.get(n);if(l)return l;let c=u[0];const g=new Set,h=(e,t=++u[0])=>{c!==t&&(c=t,g.forEach((s=>s(e,t))))};let f=u[1];const v=e=>(t,s)=>{const o=[...t];o[1]=[e,...o[1]],h(o,s)},b=new Map,y=e=>{var t;const s=b.get(e);s&&(b.delete(e),null==(t=s[1])||t.call(s))},w=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),I=t(w,{deleteProperty(e,t){const s=Reflect.get(e,t);y(t);const o=Reflect.deleteProperty(e,t);return o&&h(["delete",[t],s]),o},set(t,n,l,c){const d=Reflect.has(t,n),u=Reflect.get(t,n,c);if(d&&(e(u,l)||p.has(l)&&e(u,p.get(l))))return!0;y(n),a(l)&&(l=o(l)||l);let f=l;if(l instanceof Promise)l.then((e=>{l.status="fulfilled",l.value=e,h(["resolve",[n],e])})).catch((e=>{l.status="rejected",l.reason=e,h(["reject",[n],e])}));else{!r.has(l)&&s(l)&&(f=m(l));const e=!i.has(f)&&r.get(f);e&&((e,t)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&b.has(e))throw new Error("prop listener already exists");if(g.size){const s=t[3](v(e));b.set(e,[t,s])}else b.set(e,[t])})(n,e)}return Reflect.set(t,n,f,c),h(["set",[n],l,u]),!0}});p.set(n,I);const C=[w,(e=++u[1])=>(f===e||g.size||(f=e,b.forEach((([t])=>{const s=t[1](e);s>c&&(c=s)}))),c),d,e=>{g.add(e),1===g.size&&b.forEach((([e,t],s)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&t)throw new Error("remove already exists");const o=e[3](v(s));b.set(s,[e,o])}));return()=>{g.delete(e),0===g.size&&b.forEach((([e,t],s)=>{t&&(t(),b.set(s,[e]))}))}}];return r.set(I,C),Reflect.ownKeys(n).forEach((e=>{const t=Object.getOwnPropertyDescriptor(n,e);"value"in t&&(I[e]=n[e],delete t.value,delete t.writable),Object.defineProperty(w,e,t)})),I}))=>[m,r,i,e,t,s,l,c,d,p,u])();function c(e={}){return l(e)}function d(e,t,s){const o=r.get(e);let n;"production"===(import.meta.env?import.meta.env.MODE:void 0)||o||console.warn("Please use proxy object");const a=[],i=o[3];let l=!1;const c=i((e=>{a.push(e),s?t(a.splice(0)):n||(n=Promise.resolve().then((()=>{n=void 0,l&&t(a.splice(0))})))}));return l=!0,()=>{l=!1,c()}}const p=c({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),u={state:p,subscribe:e=>d(p,(()=>e(p))),push(e,t){e!==p.view&&(p.view=e,t&&(p.data=t),p.history.push(e))},reset(e){p.view=e,p.history=[e]},replace(e){p.history.length>1&&(p.history[p.history.length-1]=e,p.view=e)},goBack(){if(p.history.length>1){p.history.pop();const[e]=p.history.slice(-1);p.view=e}},setData(e){p.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile:()=>typeof window<"u"&&Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)),isAndroid:()=>m.isMobile()&&navigator.userAgent.toLowerCase().includes("android"),isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),isArray:e=>Array.isArray(e)&&e.length>0,formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let o=e;o.includes("://")||(o=e.replaceAll("/","").replaceAll(":",""),o=`${o}://`),o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);return`${o}wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let o=e;o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);return`${o}wc?uri=${encodeURIComponent(t)}`},wait:async e=>new Promise((t=>{setTimeout(t,e)})),openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.6.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=null==(e=u.state.data)?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},g=c({enabled:typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),userSessionId:"",events:[],connectedWalletId:void 0}),h={state:g,subscribe:e=>d(g.events,(()=>e(function(e,t){const s=r.get(e);"production"===(import.meta.env?import.meta.env.MODE:void 0)||s||console.warn("Please use proxy object");const[o,n,a]=s;return a(o,n(),t)}(g.events[g.events.length-1])))),initialize(){g.enabled&&typeof(null==crypto?void 0:crypto.randomUUID)<"u"&&(g.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){g.connectedWalletId=e},click(e){if(g.enabled){const t={type:"CLICK",name:e.name,userSessionId:g.userSessionId,timestamp:Date.now(),data:e};g.events.push(t)}},track(e){if(g.enabled){const t={type:"TRACK",name:e.name,userSessionId:g.userSessionId,timestamp:Date.now(),data:e};g.events.push(t)}},view(e){if(g.enabled){const t={type:"VIEW",name:e.name,userSessionId:g.userSessionId,timestamp:Date.now(),data:e};g.events.push(t)}}},f=c({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),v={state:f,subscribe:e=>d(f,(()=>e(f))),setChains(e){f.chains=e},setWalletConnectUri(e){f.walletConnectUri=e},setIsCustomDesktop(e){f.isCustomDesktop=e},setIsCustomMobile(e){f.isCustomMobile=e},setIsDataLoaded(e){f.isDataLoaded=e},setIsUiLoaded(e){f.isUiLoaded=e},setIsAuth(e){f.isAuth=e}},b=c({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),y={state:b,subscribe:e=>d(b,(()=>e(b))),setConfig(e){var t,s;h.initialize(),v.setChains(e.chains),v.setIsAuth(Boolean(e.enableAuthMode)),v.setIsCustomMobile(Boolean(null==(t=e.mobileWallets)?void 0:t.length)),v.setIsCustomDesktop(Boolean(null==(s=e.desktopWallets)?void 0:s.length)),m.setModalVersionInStorage(),Object.assign(b,e)}},w="https://explorer-api.walletconnect.com";async function I(e,t){const s=new URL(e,w);return s.searchParams.append("projectId",y.state.projectId),Object.entries(t).forEach((([e,t])=>{t&&s.searchParams.append(e,String(t))})),(await fetch(s)).json()}const C={getDesktopListings:async e=>I("/w3m/v1/getDesktopListings",e),getMobileListings:async e=>I("/w3m/v1/getMobileListings",e),getInjectedListings:async e=>I("/w3m/v1/getInjectedListings",e),getAllListings:async e=>I("/w3m/v1/getAllListings",e),getWalletImageUrl:e=>`${w}/w3m/v1/getWalletImage/${e}?projectId=${y.state.projectId}`,getAssetImageUrl:e=>`${w}/w3m/v1/getAssetImage/${e}?projectId=${y.state.projectId}`};var W=Object.defineProperty,E=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,A=(e,t,s)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;const j=m.isMobile(),M=c({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),U={state:M,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=y.state;if("NONE"===e||"ALL"===t&&!e)return M.recomendedWallets;if(m.isArray(e)){const t={recommendedIds:e.join(",")},{listings:s}=await C.getAllListings(t),o=Object.values(s);o.sort(((t,s)=>e.indexOf(t.id)-e.indexOf(s.id))),M.recomendedWallets=o}else{const{chains:e,isAuth:s}=v.state,o=e?.join(","),n=m.isArray(t),a={page:1,sdks:s?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:o,version:2,excludedIds:n?t.join(","):void 0},{listings:r}=j?await C.getMobileListings(a):await C.getDesktopListings(a);M.recomendedWallets=Object.values(r)}return M.recomendedWallets},async getWallets(e){const t=((e,t)=>{for(var s in t||(t={}))O.call(t,s)&&A(e,s,t[s]);if(E)for(var s of E(t))L.call(t,s)&&A(e,s,t[s]);return e})({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:o}=y.state,{recomendedWallets:n}=M;if("ALL"===o)return M.wallets;n.length?t.excludedIds=n.map((e=>e.id)).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(o)&&(t.excludedIds=[t.excludedIds,o].filter(Boolean).join(",")),v.state.isAuth&&(t.sdks="auth_v1");const{page:a,search:r}=e,{listings:i,total:l}=j?await C.getMobileListings(t):await C.getDesktopListings(t),c=Object.values(i),d=r?"search":"wallets";return M[d]={listings:[...M[d].listings,...c],total:l,page:a??1},{listings:c,total:l}},getWalletImageUrl:e=>C.getWalletImageUrl(e),getAssetImageUrl:e=>C.getAssetImageUrl(e),resetSearch(){M.search={listings:[],total:0,page:1}}},D=c({open:!1}),P={state:D,subscribe:e=>d(D,(()=>e(D))),open:async e=>new Promise((t=>{const{isUiLoaded:s,isDataLoaded:o}=v.state;if(v.setWalletConnectUri(e?.uri),v.setChains(e?.chains),u.reset("ConnectWallet"),s&&o)D.open=!0,t();else{const e=setInterval((()=>{const s=v.state;s.isUiLoaded&&s.isDataLoaded&&(clearInterval(e),D.open=!0,t())}),200)}})),close(){D.open=!1}};var k=Object.defineProperty,S=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,R=(e,t,s)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;const _=c({themeMode:typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}),T={state:_,subscribe:e=>d(_,(()=>e(_))),setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(_.themeMode=t),s&&(_.themeVariables=((e,t)=>{for(var s in t||(t={}))N.call(t,s)&&R(e,s,t[s]);if(S)for(var s of S(t))x.call(t,s)&&R(e,s,t[s]);return e})({},s))}},$=c({open:!1,message:"",variant:"success"}),B={state:$,subscribe:e=>d($,(()=>e($))),openToast(e,t){$.open=!0,$.message=e,$.variant=t},closeToast(){$.open=!1}};var H=Object.freeze({__proto__:null,WalletConnectModal:class{constructor(e){this.openModal=P.open,this.closeModal=P.close,this.subscribeModal=P.subscribe,this.setTheme=T.setThemeConfig,T.setThemeConfig(e),y.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await import("./index-0ee5ef8d.js");const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),v.setIsUiLoaded(!0)}}}});export{P as F,T as G,u as N,B as Q,h as T,H as a,v as d,y as f,m as i,U as q};
1
+ const e=Symbol(),t=Object.getPrototypeOf,s=new WeakMap,o=o=>(e=>e&&(s.has(e)?s.get(e):t(e)===Object.prototype||t(e)===Array.prototype))(o)&&o[e]||null,n=(e,t=!0)=>{s.set(e,t)},a=e=>"object"==typeof e&&null!==e,r=new WeakMap,i=new WeakSet,[l]=((e=Object.is,t=((e,t)=>new Proxy(e,t)),s=(e=>a(e)&&!i.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)),l=(e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}}),c=new WeakMap,d=((e,t,s=l)=>{const o=c.get(e);if((null==o?void 0:o[0])===t)return o[1];const a=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return n(a,!0),c.set(e,[t,a]),Reflect.ownKeys(e).forEach((t=>{if(Object.getOwnPropertyDescriptor(a,t))return;const o=Reflect.get(e,t),l={value:o,enumerable:!0,configurable:!0};if(i.has(o))n(o,!1);else if(o instanceof Promise)delete l.value,l.get=()=>s(o);else if(r.has(o)){const[e,t]=r.get(o);l.value=d(e,t(),s)}Object.defineProperty(a,t,l)})),Object.preventExtensions(a)}),p=new WeakMap,u=[1,1],m=(n=>{if(!a(n))throw new Error("object required");const l=p.get(n);if(l)return l;let c=u[0];const g=new Set,h=(e,t=++u[0])=>{c!==t&&(c=t,g.forEach((s=>s(e,t))))};let f=u[1];const b=e=>(t,s)=>{const o=[...t];o[1]=[e,...o[1]],h(o,s)},v=new Map,y=e=>{var t;const s=v.get(e);s&&(v.delete(e),null==(t=s[1])||t.call(s))},w=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),I=t(w,{deleteProperty(e,t){const s=Reflect.get(e,t);y(t);const o=Reflect.deleteProperty(e,t);return o&&h(["delete",[t],s]),o},set(t,n,l,c){const d=Reflect.has(t,n),u=Reflect.get(t,n,c);if(d&&(e(u,l)||p.has(l)&&e(u,p.get(l))))return!0;y(n),a(l)&&(l=o(l)||l);let f=l;if(l instanceof Promise)l.then((e=>{l.status="fulfilled",l.value=e,h(["resolve",[n],e])})).catch((e=>{l.status="rejected",l.reason=e,h(["reject",[n],e])}));else{!r.has(l)&&s(l)&&(f=m(l));const e=!i.has(f)&&r.get(f);e&&((e,t)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&v.has(e))throw new Error("prop listener already exists");if(g.size){const s=t[3](b(e));v.set(e,[t,s])}else v.set(e,[t])})(n,e)}return Reflect.set(t,n,f,c),h(["set",[n],l,u]),!0}});p.set(n,I);const O=[w,(e=++u[1])=>(f===e||g.size||(f=e,v.forEach((([t])=>{const s=t[1](e);s>c&&(c=s)}))),c),d,e=>{g.add(e),1===g.size&&v.forEach((([e,t],s)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&t)throw new Error("remove already exists");const o=e[3](b(s));v.set(s,[e,o])}));return()=>{g.delete(e),0===g.size&&v.forEach((([e,t],s)=>{t&&(t(),v.set(s,[e]))}))}}];return r.set(I,O),Reflect.ownKeys(n).forEach((e=>{const t=Object.getOwnPropertyDescriptor(n,e);"value"in t&&(I[e]=n[e],delete t.value,delete t.writable),Object.defineProperty(w,e,t)})),I}))=>[m,r,i,e,t,s,l,c,d,p,u])();function c(e={}){return l(e)}function d(e,t,s){const o=r.get(e);let n;"production"===(import.meta.env?import.meta.env.MODE:void 0)||o||console.warn("Please use proxy object");const a=[],i=o[3];let l=!1;const c=i((e=>{a.push(e),s?t(a.splice(0)):n||(n=Promise.resolve().then((()=>{n=void 0,l&&t(a.splice(0))})))}));return l=!0,()=>{l=!1,c()}}const p=c({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),u={state:p,subscribe:e=>d(p,(()=>e(p))),push(e,t){e!==p.view&&(p.view=e,t&&(p.data=t),p.history.push(e))},reset(e){p.view=e,p.history=[e]},replace(e){p.history.length>1&&(p.history[p.history.length-1]=e,p.view=e)},goBack(){if(p.history.length>1){p.history.pop();const[e]=p.history.slice(-1);p.view=e}},setData(e){p.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile:()=>typeof window<"u"&&Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)),isAndroid:()=>m.isMobile()&&navigator.userAgent.toLowerCase().includes("android"),isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),isArray:e=>Array.isArray(e)&&e.length>0,formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let o=e;o.includes("://")||(o=e.replaceAll("/","").replaceAll(":",""),o=`${o}://`),o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);return`${o}wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let o=e;o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);return`${o}wc?uri=${encodeURIComponent(t)}`},wait:async e=>new Promise((t=>{setTimeout(t,e)})),openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=null==(e=u.state.data)?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},g=c({enabled:typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),userSessionId:"",events:[],connectedWalletId:void 0}),h={state:g,subscribe:e=>d(g.events,(()=>e(function(e,t){const s=r.get(e);"production"===(import.meta.env?import.meta.env.MODE:void 0)||s||console.warn("Please use proxy object");const[o,n,a]=s;return a(o,n(),t)}(g.events[g.events.length-1])))),initialize(){g.enabled&&typeof(null==crypto?void 0:crypto.randomUUID)<"u"&&(g.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){g.connectedWalletId=e},click(e){if(g.enabled){const t={type:"CLICK",name:e.name,userSessionId:g.userSessionId,timestamp:Date.now(),data:e};g.events.push(t)}},track(e){if(g.enabled){const t={type:"TRACK",name:e.name,userSessionId:g.userSessionId,timestamp:Date.now(),data:e};g.events.push(t)}},view(e){if(g.enabled){const t={type:"VIEW",name:e.name,userSessionId:g.userSessionId,timestamp:Date.now(),data:e};g.events.push(t)}}},f=c({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),b={state:f,subscribe:e=>d(f,(()=>e(f))),setChains(e){f.chains=e},setWalletConnectUri(e){f.walletConnectUri=e},setIsCustomDesktop(e){f.isCustomDesktop=e},setIsCustomMobile(e){f.isCustomMobile=e},setIsDataLoaded(e){f.isDataLoaded=e},setIsUiLoaded(e){f.isUiLoaded=e},setIsAuth(e){f.isAuth=e}},v=c({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),y={state:v,subscribe:e=>d(v,(()=>e(v))),setConfig(e){var t,s;h.initialize(),b.setChains(e.chains),b.setIsAuth(Boolean(e.enableAuthMode)),b.setIsCustomMobile(Boolean(null==(t=e.mobileWallets)?void 0:t.length)),b.setIsCustomDesktop(Boolean(null==(s=e.desktopWallets)?void 0:s.length)),m.setModalVersionInStorage(),Object.assign(v,e)}};var w=Object.defineProperty,I=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,W=(e,t,s)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;const E="https://explorer-api.walletconnect.com",L="wcm",j="js-2.6.2";async function A(e,t){const s=((e,t)=>{for(var s in t||(t={}))O.call(t,s)&&W(e,s,t[s]);if(I)for(var s of I(t))C.call(t,s)&&W(e,s,t[s]);return e})({sdkType:L,sdkVersion:j},t),o=new URL(e,E);return o.searchParams.append("projectId",y.state.projectId),Object.entries(s).forEach((([e,t])=>{t&&o.searchParams.append(e,String(t))})),(await fetch(o)).json()}const M={getDesktopListings:async e=>A("/w3m/v1/getDesktopListings",e),getMobileListings:async e=>A("/w3m/v1/getMobileListings",e),getInjectedListings:async e=>A("/w3m/v1/getInjectedListings",e),getAllListings:async e=>A("/w3m/v1/getAllListings",e),getWalletImageUrl:e=>`${E}/w3m/v1/getWalletImage/${e}?projectId=${y.state.projectId}&sdkType=${L}&sdkVersion=${j}`,getAssetImageUrl:e=>`${E}/w3m/v1/getAssetImage/${e}?projectId=${y.state.projectId}&sdkType=${L}&sdkVersion=${j}`};var D=Object.defineProperty,U=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,S=(e,t,s)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;const N=m.isMobile(),x=c({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),T={state:x,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=y.state;if("NONE"===e||"ALL"===t&&!e)return x.recomendedWallets;if(m.isArray(e)){const t={recommendedIds:e.join(",")},{listings:s}=await M.getAllListings(t),o=Object.values(s);o.sort(((t,s)=>e.indexOf(t.id)-e.indexOf(s.id))),x.recomendedWallets=o}else{const{chains:e,isAuth:s}=b.state,o=e?.join(","),n=m.isArray(t),a={page:1,sdks:s?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:o,version:2,excludedIds:n?t.join(","):void 0},{listings:r}=N?await M.getMobileListings(a):await M.getDesktopListings(a);x.recomendedWallets=Object.values(r)}return x.recomendedWallets},async getWallets(e){const t=((e,t)=>{for(var s in t||(t={}))k.call(t,s)&&S(e,s,t[s]);if(U)for(var s of U(t))P.call(t,s)&&S(e,s,t[s]);return e})({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:o}=y.state,{recomendedWallets:n}=x;if("ALL"===o)return x.wallets;n.length?t.excludedIds=n.map((e=>e.id)).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(o)&&(t.excludedIds=[t.excludedIds,o].filter(Boolean).join(",")),b.state.isAuth&&(t.sdks="auth_v1");const{page:a,search:r}=e,{listings:i,total:l}=N?await M.getMobileListings(t):await M.getDesktopListings(t),c=Object.values(i),d=r?"search":"wallets";return x[d]={listings:[...x[d].listings,...c],total:l,page:a??1},{listings:c,total:l}},getWalletImageUrl:e=>M.getWalletImageUrl(e),getAssetImageUrl:e=>M.getAssetImageUrl(e),resetSearch(){x.search={listings:[],total:0,page:1}}},R=c({open:!1}),_={state:R,subscribe:e=>d(R,(()=>e(R))),open:async e=>new Promise((t=>{const{isUiLoaded:s,isDataLoaded:o}=b.state;if(m.removeWalletConnectDeepLink(),b.setWalletConnectUri(e?.uri),b.setChains(e?.chains),u.reset("ConnectWallet"),s&&o)R.open=!0,t();else{const e=setInterval((()=>{const s=b.state;s.isUiLoaded&&s.isDataLoaded&&(clearInterval(e),R.open=!0,t())}),200)}})),close(){R.open=!1}};var $=Object.defineProperty,V=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,K=(e,t,s)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;const z=c({themeMode:typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}),J={state:z,subscribe:e=>d(z,(()=>e(z))),setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(z.themeMode=t),s&&(z.themeVariables=((e,t)=>{for(var s in t||(t={}))B.call(t,s)&&K(e,s,t[s]);if(V)for(var s of V(t))H.call(t,s)&&K(e,s,t[s]);return e})({},s))}},q=c({open:!1,message:"",variant:"success"}),F={state:q,subscribe:e=>d(q,(()=>e(q))),openToast(e,t){q.open=!0,q.message=e,q.variant=t},closeToast(){q.open=!1}};var G=Object.freeze({__proto__:null,WalletConnectModal:class{constructor(e){this.openModal=_.open,this.closeModal=_.close,this.subscribeModal=_.subscribe,this.setTheme=J.setThemeConfig,J.setThemeConfig(e),y.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await import("./index-aa70a2b2.js");const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),b.setIsUiLoaded(!0)}}}});export{h as R,u as T,m as a,G as i,J as n,F as o,b as p,_ as s,T as t,y};