@dcl/auth-site 5.0.0 → 5.0.1-30557310176.commit-43aed9a

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 (119) hide show
  1. package/assets/{ConstantsUtil-Dg0DgKPJ.js → ConstantsUtil-CW_FX9qi.js} +1 -1
  2. package/assets/{ContentfulRichText-DfW2Q0q7.js → ContentfulRichText-Be9wKqQH.js} +1 -1
  3. package/assets/{ExchangeController-CYA8JgbM.js → ExchangeController-DDaZCpF1.js} +1 -1
  4. package/assets/{HelpersUtil-dxZVQuN-.js → HelpersUtil-CrSZhlVw.js} +1 -1
  5. package/assets/LoginPage-Bjdq6ZqI.js +1 -0
  6. package/assets/{NetworkUtil-Cdd9AsyN.js → NetworkUtil-WCrLHdwO.js} +1 -1
  7. package/assets/{SwapController-BlcGzBYp.js → SwapController-CwyVTffy.js} +1 -1
  8. package/assets/{W3MFrameProviderSingleton-DszZRKRh.js → W3MFrameProviderSingleton-qDXCgbqI.js} +3 -3
  9. package/assets/{biconomy-DMDB2WCq.js → biconomy-CoudTigT.js} +1 -1
  10. package/assets/{browser-CDS4yNuG.js → browser-D4zEQSFR.js} +1 -1
  11. package/assets/browser-ponyfill-2EUAsSeC.js +1 -0
  12. package/assets/{ccip-CfOrstq6.js → ccip-858gpOKL.js} +1 -1
  13. package/assets/{ccip-SMYalGhL.js → ccip-DGJoWvY9.js} +1 -1
  14. package/assets/{chains-BSD1mUUF.js → chains-DHLaTukf.js} +1 -1
  15. package/assets/{common-BpnpH7bs.js → common-gpP-5cyL.js} +1 -1
  16. package/assets/{controller-B_OTdDKf.js → controller-XQ9v7IKM.js} +2 -2
  17. package/assets/{data-capture-BhiDpJ8l.js → data-capture-BbkXcCGE.js} +1 -1
  18. package/assets/{email-Dz_1RIun.js → email-B267H7qU.js} +1 -1
  19. package/assets/{embedded-wallet-Vq8AAsxz.js → embedded-wallet-DIR2qI2M.js} +1 -1
  20. package/assets/{engine-CUXu1pAJ.js → engine-DDOEF5rb.js} +1 -1
  21. package/assets/{estimate-l1-fee-BbYg2jnm.js → estimate-l1-fee-BNIidE0E.js} +1 -1
  22. package/assets/{ethereum-DLnWj0TT.js → ethereum-BOfYJ1rX.js} +1 -1
  23. package/assets/{extractIPFS-E6dbI5B3.js → extractIPFS-CMyxqmG0.js} +1 -1
  24. package/assets/{features-B5VCvl8a.js → features-CJq0Om2-.js} +1 -1
  25. package/assets/{fetchTokenMetadata-_TSiSql-.js → fetchTokenMetadata-CsDpZHvS.js} +1 -1
  26. package/assets/{fortmatic-DeD4v7Wq.js → fortmatic-CiGgILEB.js} +1 -1
  27. package/assets/{get-ecosystem-wallet-info-BfODWfKc.js → get-ecosystem-wallet-info-fUavYXLe.js} +1 -1
  28. package/assets/{getBalance-CpIjM2cg.js → getBalance-CRn4S80H.js} +1 -1
  29. package/assets/{getInstalledModules-C7OExu07.js → getInstalledModules-uOtAH4oh.js} +1 -1
  30. package/assets/{getNFT-NGH_lUB-.js → getNFT-C1M4KDNP.js} +1 -1
  31. package/assets/{getNFT-DUZCgW_v.js → getNFT-_C89lHJ0.js} +2 -2
  32. package/assets/{if-defined-B-CxqoOy.js → if-defined-BwPjC2Sk.js} +1 -1
  33. package/assets/{in-app-Dr0XnxnC.js → in-app-DUCRQ2qh.js} +2 -2
  34. package/assets/{in-app-wallet-calls-CVnjwSXD.js → in-app-wallet-calls-RFoJ8RPZ.js} +1 -1
  35. package/assets/{index-CyefDYRY.js → index-01F6Becn.js} +1 -1
  36. package/assets/{index-jb4OCwoq.js → index-2JVBPe4G.js} +1 -1
  37. package/assets/{index-Dgqfdyrb.js → index-9lxP1eji.js} +1 -1
  38. package/assets/{index-B4XpHOJV.js → index-B4syUFPn.js} +3 -3
  39. package/assets/{index-C8sFl9y_.js → index-BAu8OvU-.js} +1 -1
  40. package/assets/index-BFLVmIL3.js +2 -0
  41. package/assets/{index-DgBqViSr.js → index-BFcbLGKM.js} +1 -1
  42. package/assets/{index-CMurtdVK.js → index-B_sxUPMR.js} +1 -1
  43. package/assets/{index-BVRqITf-.js → index-BaRmF2jw.js} +60 -60
  44. package/assets/{index-B-AvExe7.js → index-Bb_BfO1W.js} +1 -1
  45. package/assets/{index-B71s3Unl.js → index-BgeasCa6.js} +1 -1
  46. package/assets/{index-CQTx6uje.js → index-Blaq9UPb.js} +1 -1
  47. package/assets/{index-BQjhRxEw.js → index-Bz2f_SjA.js} +1 -1
  48. package/assets/{index-zguct6tW.js → index-CGFMuLJP.js} +1 -1
  49. package/assets/{index-CguhMBVV.js → index-CHrPbdIp.js} +1 -1
  50. package/assets/{index-CFQ5zLHq.js → index-CL77oDun.js} +1 -1
  51. package/assets/{index-bgIfRIh2.js → index-CLnHQxzz.js} +1 -1
  52. package/assets/{index-orYhT9Ul.js → index-COB-mh-H.js} +1 -1
  53. package/assets/{index-CU7LDmTm.js → index-CQL2QU8C.js} +3 -3
  54. package/assets/{index-BMV5TwLV.js → index-CYZFwcV6.js} +3 -3
  55. package/assets/{index-AtWUrs5K.js → index-CYaCt5K9.js} +1 -1
  56. package/assets/{index-CsWu1J5q.js → index-CZDACdX3.js} +1 -1
  57. package/assets/{index-CVaRPgqk.js → index-Cd-Gn0f-.js} +2 -2
  58. package/assets/{index-_3_jX9RC.js → index-Ckx1XGW_.js} +2 -2
  59. package/assets/{index-CFOjd25G.js → index-Co2jXQdv.js} +1 -1
  60. package/assets/{index-CajP97ih.js → index-CoHMkZKL.js} +1 -1
  61. package/assets/{index-Bbp98Yo4.js → index-CpryA9uy.js} +1 -1
  62. package/assets/{index-DGDq3kyy.js → index-Cqamrz-G.js} +1 -1
  63. package/assets/{index-CtSjOT3C.js → index-CsUFT47Q.js} +1 -1
  64. package/assets/{index-DhlyurbW.js → index-Ct6ydyiV.js} +1 -1
  65. package/assets/{index-BOTjRb-A.js → index-CyCpPSV8.js} +1 -1
  66. package/assets/{index-U_AZIOYs.js → index-CzlOlL8a.js} +1 -1
  67. package/assets/{index-DoM5bFDD.js → index-D-IPbTeX.js} +1 -1
  68. package/assets/{index-CRTrW1Cr.js → index-D3_9yAJu.js} +1 -1
  69. package/assets/{index-BWA7Dnf9.js → index-DJ6vuujr.js} +1 -1
  70. package/assets/{index-CiRr_FQj.js → index-DKkBhmh4.js} +1 -1
  71. package/assets/index-D_a4yOb4.css +1 -0
  72. package/assets/{index-By4Ejenx.js → index-DgD6IjSN.js} +1 -1
  73. package/assets/{index-CIwcdVXz.js → index-Dn5916Na.js} +1 -1
  74. package/assets/{index-DndmGjQP.js → index-DqEYzi0E.js} +1 -1
  75. package/assets/{index-C8qBmpOs.js → index-Dy7vBfMa.js} +1 -1
  76. package/assets/{index-B17222Rk.js → index-Fev2rBPj.js} +1 -1
  77. package/assets/{index-DnAI-Tby.js → index-HeMv2jmV.js} +1 -1
  78. package/assets/{index-BHr-h4IK.js → index-JJc4W_7G.js} +1 -1
  79. package/assets/{index-DTAN6EG4.js → index-NRTLoD7p.js} +1 -1
  80. package/assets/{index-GhmakdXN.js → index-Uz2HCbLC.js} +1 -1
  81. package/assets/{index-CGK33Zf3.js → index-iNVMC2aJ.js} +1 -1
  82. package/assets/{index-BTCFHuS2.js → index-nkUxBrDq.js} +1 -1
  83. package/assets/{index-D0-rCtUz.js → index-sAfKGhJ4.js} +1 -1
  84. package/assets/{index.es-thRfdo4b.js → index.es-DDcifHGD.js} +1 -1
  85. package/assets/{index.es-BK3z8yc7.js → index.es-DyvhuFpN.js} +1 -1
  86. package/assets/{linkAccount-CYbxngjz.js → linkAccount-DUKamzN4.js} +1 -1
  87. package/assets/{native-yw_E6q3K.js → native-BSFy1NUq.js} +1 -1
  88. package/assets/{networks-DvPy11h-.js → networks-DYqPSRUX.js} +3 -3
  89. package/assets/{onramp-C7JCWSIA.js → onramp-fOaYGLaD.js} +1 -1
  90. package/assets/{openzeppelin-3-DVb04n.js → openzeppelin-BMxyIB8N.js} +1 -1
  91. package/assets/{ownerOf-CXNoFK7Y.js → ownerOf-DNFjo4Xs.js} +1 -1
  92. package/assets/{parseNft-CkkgeIH7.js → parseNft-D0kJ0eqi.js} +2 -2
  93. package/assets/{pay-with-exchange-Cp4dkwE4.js → pay-with-exchange-iyufI0LO.js} +1 -1
  94. package/assets/{qr-overlay-DrtFZGBr.js → qr-overlay-zGX3-rQs.js} +3 -3
  95. package/assets/{receive-4Qe7X8hw.js → receive-Dg2SrbIP.js} +1 -1
  96. package/assets/{ref-BJe9DjD9.js → ref-CjAIZ7sj.js} +1 -1
  97. package/assets/{resolveImplementation-CS9w_uBz.js → resolveImplementation-BNTF89LV.js} +1 -1
  98. package/assets/{secp256k1-DELqHfAP.js → secp256k1-Br1rmyDj.js} +1 -1
  99. package/assets/{send-CleviGUZ.js → send-CQwXbZNW.js} +1 -1
  100. package/assets/{send-eip712-transaction-DfSGlPyc.js → send-eip712-transaction-CkYHxr0f.js} +1 -1
  101. package/assets/{send-gasless-transaction-D2DAF9mu.js → send-gasless-transaction-C-31agYS.js} +2 -2
  102. package/assets/{session-proposal-CWVQUxfA.js → session-proposal-DYwo3Fgq.js} +1 -1
  103. package/assets/{session-request-BZyaz0LP.js → session-request-DGS9G5Mg.js} +2 -2
  104. package/assets/{socials-B-OKk3wj.js → socials-BrBXa0fM.js} +1 -1
  105. package/assets/{swaps-DZCBL8Az.js → swaps-Bkrt5ZYH.js} +1 -1
  106. package/assets/{thirdweb-C3CcAvH8.js → thirdweb-LoT4DY8m.js} +5 -5
  107. package/assets/{totalSupply-igQJxRMC.js → totalSupply-8anXJ3NP.js} +1 -1
  108. package/assets/{transactions-D1wgMN3m.js → transactions-Dc_xUGir.js} +1 -1
  109. package/assets/{ui-vxy66sX5.js → ui-BPcBj3pV.js} +5 -5
  110. package/assets/{vendor-D1-TDtn2.js → vendor-DsSOwujw.js} +1 -1
  111. package/assets/{w3m-modal-DVVcPj5A.js → w3m-modal-Ch5z3J8M.js} +1 -1
  112. package/assets/{wallets-DBk4wc49.js → wallets-D1J-5Orv.js} +4 -4
  113. package/assets/{web-connector-C3XptM8L.js → web-connector-C-hx8T2R.js} +3 -3
  114. package/index.html +5 -5
  115. package/package.json +3 -3
  116. package/assets/LoginPage-8RP9Q8et.js +0 -1
  117. package/assets/browser-ponyfill-jVOY3rKN.js +0 -1
  118. package/assets/index-BSlDJ2rE.js +0 -2
  119. package/assets/index-CrsgkHzi.css +0 -1
@@ -1,4 +1,4 @@
1
- import{d as h,r as f,i as u,h as v}from"./index-CU7LDmTm.js";import{n as d,c as m,U as p}from"./index-BWA7Dnf9.js";import"./index-BTCFHuS2.js";const g=h`
1
+ import{d as h,r as f,i as u,h as v}from"./index-CQL2QU8C.js";import{n as d,c as m,U as p}from"./index-DJ6vuujr.js";import"./index-nkUxBrDq.js";const g=h`
2
2
  :host {
3
3
  display: block;
4
4
  width: var(--local-width);
@@ -1,4 +1,4 @@
1
- import{d as h,r as m,e as g,i as y,h as d}from"./index-CU7LDmTm.js";import{n as i,c as b}from"./index-BWA7Dnf9.js";import{o as c}from"./if-defined-B-CxqoOy.js";import"./index-C8sFl9y_.js";const f=h`
1
+ import{d as h,r as m,e as g,i as y,h as d}from"./index-CQL2QU8C.js";import{n as i,c as b}from"./index-DJ6vuujr.js";import{o as c}from"./if-defined-BwPjC2Sk.js";import"./index-BAu8OvU-.js";const f=h`
2
2
  :host {
3
3
  width: 100%;
4
4
  }
@@ -1,4 +1,4 @@
1
- import{d as U,r as Ie,e as ve,i as _,h as l,v as Se,j as ke}from"./index-CU7LDmTm.js";import{n as b,c as C,r as h,U as _e,b as Ne}from"./index-BWA7Dnf9.js";import{o as f}from"./if-defined-B-CxqoOy.js";import"./index-CRTrW1Cr.js";import"./index-Dgqfdyrb.js";import"./index-BTCFHuS2.js";import"./index-B71s3Unl.js";import"./index-C8sFl9y_.js";import"./index-CguhMBVV.js";import"./index-By4Ejenx.js";import{P as Ce,d as v,K as $e,L as y,a as O,Q as Re,U as N,O as ce,N as A,V as me,C as m,p as Oe,j as T,E as M,S as R,h as Ue,M as G,s as Le,c as qe,i as P,R as z}from"./W3MFrameProviderSingleton-DszZRKRh.js";import{C as I}from"./NetworkUtil-Cdd9AsyN.js";import"./index-B17222Rk.js";import{M as ge}from"./MathUtil-BGCe3rZ3.js";const De=U`
1
+ import{d as U,r as Ie,e as ve,i as _,h as l,v as Se,j as ke}from"./index-CQL2QU8C.js";import{n as b,c as C,r as h,U as _e,b as Ne}from"./index-DJ6vuujr.js";import{o as f}from"./if-defined-BwPjC2Sk.js";import"./index-D3_9yAJu.js";import"./index-9lxP1eji.js";import"./index-nkUxBrDq.js";import"./index-BgeasCa6.js";import"./index-BAu8OvU-.js";import"./index-CHrPbdIp.js";import"./index-DgD6IjSN.js";import{P as Ce,d as v,K as $e,L as y,a as O,Q as Re,U as N,O as ce,N as A,V as me,C as m,p as Oe,j as T,E as M,S as R,h as Ue,M as G,s as Le,c as qe,i as P,R as z}from"./W3MFrameProviderSingleton-qDXCgbqI.js";import{C as I}from"./NetworkUtil-WCrLHdwO.js";import"./index-Fev2rBPj.js";import{M as ge}from"./MathUtil-BGCe3rZ3.js";const De=U`
2
2
  :host {
3
3
  position: relative;
4
4
  }
@@ -1 +1 @@
1
- import{r as T}from"./index-CpWZ5dtQ.js";import{b3 as y,b4 as k,b5 as I}from"./index-BVRqITf-.js";import"./thirdweb-C3CcAvH8.js";import"./ui-vxy66sX5.js";import"./vendor-D1-TDtn2.js";const q=()=>"9.1.0",v=t=>t.toString(16).padStart(2,"0"),C=t=>{const e=new Uint8Array(t/2);return window.crypto.getRandomValues(e),Array.from(e,v).join("")},R=()=>typeof window<"u"?C(10):new Date().getTime().toString(36);class g{}g.makeRequest=(t,e)=>({id:R(),method:t,params:e,env:{sdkVersion:q()}});g.makeResponse=(t,e,s)=>({id:t,success:!0,version:s,data:e});g.makeErrorResponse=(t,e,s)=>({id:t,success:!1,error:e,version:s});var r;(function(t){t.sendTransactions="sendTransactions",t.rpcCall="rpcCall",t.getChainInfo="getChainInfo",t.getSafeInfo="getSafeInfo",t.getTxBySafeTxHash="getTxBySafeTxHash",t.getSafeBalances="getSafeBalances",t.signMessage="signMessage",t.signTypedMessage="signTypedMessage",t.getEnvironmentInfo="getEnvironmentInfo",t.getOffChainSignature="getOffChainSignature",t.requestAddressBook="requestAddressBook",t.wallet_getPermissions="wallet_getPermissions",t.wallet_requestPermissions="wallet_requestPermissions"})(r||(r={}));var m;(function(t){t.requestAddressBook="requestAddressBook"})(m||(m={}));class H{constructor(e=null,s=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:a,data:n,source:i})=>{const o=!n,l=!this.isServer&&i===window.parent,u=typeof n.version<"u"&&parseInt(n.version.split(".")[0]),B=typeof u=="number"&&u>=1;let p=!0;return Array.isArray(this.allowedOrigins)&&(p=this.allowedOrigins.find(P=>P.test(a))!==void 0),!o&&l&&B&&p},this.logIncomingMessage=a=>{console.info(`Safe Apps SDK v1: A message was received from origin ${a.origin}. `,a.data)},this.onParentMessage=a=>{this.isValidMessage(a)&&(this.debugMode&&this.logIncomingMessage(a),this.handleIncomingMessage(a.data))},this.handleIncomingMessage=a=>{const{id:n}=a,i=this.callbacks.get(n);i&&(i(a),this.callbacks.delete(n))},this.send=(a,n)=>{const i=g.makeRequest(a,n);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(i,"*"),new Promise((o,l)=>{this.callbacks.set(i.id,u=>{if(!u.success){l(new Error(u.error));return}o(u)})})},this.allowedOrigins=e,this.debugMode=s,this.isServer||window.addEventListener("message",this.onParentMessage)}}const b=t=>typeof t=="object"&&t!=null&&"domain"in t&&"types"in t&&"message"in t;T();class E{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw new Error("Invalid safeTxHash");return(await this.communicator.send(r.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){const s={message:e};return(await this.communicator.send(r.signMessage,s)).data}async signTypedMessage(e){if(!b(e))throw new Error("Invalid typed data");return(await this.communicator.send(r.signTypedMessage,{typedData:e})).data}async send({txs:e,params:s}){if(!e||!e.length)throw new Error("No transactions were passed");const a={txs:e,params:s};return(await this.communicator.send(r.sendTransactions,a)).data}}const c={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"},h={defaultBlockParam:(t="latest")=>t,returnFullTxObjectParam:(t=!1)=>t,blockNumberToHex:t=>Number.isInteger(t)?`0x${t.toString(16)}`:t};class A{constructor(e){this.communicator=e,this.call=this.buildRequest({call:c.eth_call,formatters:[null,h.defaultBlockParam]}),this.getBalance=this.buildRequest({call:c.eth_getBalance,formatters:[null,h.defaultBlockParam]}),this.getCode=this.buildRequest({call:c.eth_getCode,formatters:[null,h.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:c.eth_getStorageAt,formatters:[null,h.blockNumberToHex,h.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:c.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:c.eth_getBlockByHash,formatters:[null,h.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:c.eth_getBlockByNumber,formatters:[h.blockNumberToHex,h.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:c.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:c.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:c.eth_getTransactionCount,formatters:[null,h.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:c.eth_gasPrice}),this.getEstimateGas=s=>this.buildRequest({call:c.eth_estimateGas})([s]),this.setSafeSettings=this.buildRequest({call:c.safe_setSettings})}buildRequest(e){const{call:s,formatters:a}=e;return async n=>{a&&Array.isArray(n)&&a.forEach((l,u)=>{l&&(n[u]=l(n[u]))});const i={call:s,params:n||[]};return(await this.communicator.send(r.rpcCall,i)).data}}}const x="0x1626ba7e",O="0x20c13b0b",f=4001;class d extends Error{constructor(e,s,a){super(e),this.code=s,this.data=a,Object.setPrototypeOf(this,d.prototype)}}class S{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(r.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new d("Permissions request is invalid",f);try{return(await this.communicator.send(r.wallet_requestPermissions,e)).data}catch{throw new d("Permissions rejected",f)}}isPermissionRequestValid(e){return e.every(s=>typeof s=="object"?Object.keys(s).every(a=>!!Object.values(m).includes(a)):!1)}}const w=(t,e)=>e.some(s=>s.parentCapability===t),V=()=>(t,e,s)=>{const a=s.value;return s.value=async function(){const n=new S(this.communicator);let i=await n.getPermissions();if(w(e,i)||(i=await n.requestPermissions([{[e]:{}}])),!w(e,i))throw new d("Permissions rejected",f);return a.apply(this)},s};var M=function(t,e,s,a){var n=arguments.length,i=n<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,s):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,s,a);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(i=(n<3?o(i):n>3?o(e,s,i):o(e,s))||i);return n>3&&i&&Object.defineProperty(e,s,i),i};class _{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(r.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(r.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e="usd"}={}){return(await this.communicator.send(r.getSafeBalances,{currency:e})).data}async check1271Signature(e,s="0x"){const a=await this.getInfo(),n=y({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===x}catch{return!1}}async check1271SignatureBytes(e,s="0x"){const a=await this.getInfo(),n=y({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===O}catch{return!1}}calculateMessageHash(e){return k(e)}calculateTypedMessageHash(e){const s=typeof e.domain.chainId=="object"?e.domain.chainId.toNumber():Number(e.domain.chainId);let a=e.primaryType;if(!a){const n=Object.values(e.types),i=Object.keys(e.types).filter(o=>n.every(l=>l.every(({type:u})=>u.replace("[","").replace("]","")!==o)));if(i.length===0||i.length>1)throw new Error("Please specify primaryType");a=i[0]}return I({message:e.message,domain:{...e.domain,chainId:s,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt},types:e.types,primaryType:a})}async getOffChainSignature(e){return(await this.communicator.send(r.getOffChainSignature,e)).data}async isMessageSigned(e,s="0x"){let a;if(typeof e=="string"&&(a=async()=>{const n=this.calculateMessageHash(e);return await this.isMessageHashSigned(n,s)}),b(e)&&(a=async()=>{const n=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(n,s)}),a)return await a();throw new Error("Invalid message type")}async isMessageHashSigned(e,s="0x"){const a=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const n of a)if(await n(e,s))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(r.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(r.requestAddressBook,void 0)).data}}M([V()],_.prototype,"requestAddressBook",null);class G{constructor(e={}){const{allowedDomains:s=null,debug:a=!1}=e;this.communicator=new H(s,a),this.eth=new A(this.communicator),this.txs=new E(this.communicator),this.safe=new _(this.communicator),this.wallet=new S(this.communicator)}}export{g as MessageFormatter,r as Methods,c as RPC_CALLS,m as RestrictedMethods,G as default,q as getSDKVersion,b as isObjectEIP712TypedData};
1
+ import{r as T}from"./index-CpWZ5dtQ.js";import{b2 as y,b3 as k,b4 as I}from"./index-BaRmF2jw.js";import"./thirdweb-LoT4DY8m.js";import"./ui-BPcBj3pV.js";import"./vendor-DsSOwujw.js";const q=()=>"9.1.0",v=t=>t.toString(16).padStart(2,"0"),C=t=>{const e=new Uint8Array(t/2);return window.crypto.getRandomValues(e),Array.from(e,v).join("")},R=()=>typeof window<"u"?C(10):new Date().getTime().toString(36);class g{}g.makeRequest=(t,e)=>({id:R(),method:t,params:e,env:{sdkVersion:q()}});g.makeResponse=(t,e,s)=>({id:t,success:!0,version:s,data:e});g.makeErrorResponse=(t,e,s)=>({id:t,success:!1,error:e,version:s});var r;(function(t){t.sendTransactions="sendTransactions",t.rpcCall="rpcCall",t.getChainInfo="getChainInfo",t.getSafeInfo="getSafeInfo",t.getTxBySafeTxHash="getTxBySafeTxHash",t.getSafeBalances="getSafeBalances",t.signMessage="signMessage",t.signTypedMessage="signTypedMessage",t.getEnvironmentInfo="getEnvironmentInfo",t.getOffChainSignature="getOffChainSignature",t.requestAddressBook="requestAddressBook",t.wallet_getPermissions="wallet_getPermissions",t.wallet_requestPermissions="wallet_requestPermissions"})(r||(r={}));var m;(function(t){t.requestAddressBook="requestAddressBook"})(m||(m={}));class H{constructor(e=null,s=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:a,data:n,source:i})=>{const o=!n,l=!this.isServer&&i===window.parent,u=typeof n.version<"u"&&parseInt(n.version.split(".")[0]),B=typeof u=="number"&&u>=1;let p=!0;return Array.isArray(this.allowedOrigins)&&(p=this.allowedOrigins.find(P=>P.test(a))!==void 0),!o&&l&&B&&p},this.logIncomingMessage=a=>{console.info(`Safe Apps SDK v1: A message was received from origin ${a.origin}. `,a.data)},this.onParentMessage=a=>{this.isValidMessage(a)&&(this.debugMode&&this.logIncomingMessage(a),this.handleIncomingMessage(a.data))},this.handleIncomingMessage=a=>{const{id:n}=a,i=this.callbacks.get(n);i&&(i(a),this.callbacks.delete(n))},this.send=(a,n)=>{const i=g.makeRequest(a,n);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(i,"*"),new Promise((o,l)=>{this.callbacks.set(i.id,u=>{if(!u.success){l(new Error(u.error));return}o(u)})})},this.allowedOrigins=e,this.debugMode=s,this.isServer||window.addEventListener("message",this.onParentMessage)}}const b=t=>typeof t=="object"&&t!=null&&"domain"in t&&"types"in t&&"message"in t;T();class E{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw new Error("Invalid safeTxHash");return(await this.communicator.send(r.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){const s={message:e};return(await this.communicator.send(r.signMessage,s)).data}async signTypedMessage(e){if(!b(e))throw new Error("Invalid typed data");return(await this.communicator.send(r.signTypedMessage,{typedData:e})).data}async send({txs:e,params:s}){if(!e||!e.length)throw new Error("No transactions were passed");const a={txs:e,params:s};return(await this.communicator.send(r.sendTransactions,a)).data}}const c={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"},h={defaultBlockParam:(t="latest")=>t,returnFullTxObjectParam:(t=!1)=>t,blockNumberToHex:t=>Number.isInteger(t)?`0x${t.toString(16)}`:t};class A{constructor(e){this.communicator=e,this.call=this.buildRequest({call:c.eth_call,formatters:[null,h.defaultBlockParam]}),this.getBalance=this.buildRequest({call:c.eth_getBalance,formatters:[null,h.defaultBlockParam]}),this.getCode=this.buildRequest({call:c.eth_getCode,formatters:[null,h.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:c.eth_getStorageAt,formatters:[null,h.blockNumberToHex,h.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:c.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:c.eth_getBlockByHash,formatters:[null,h.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:c.eth_getBlockByNumber,formatters:[h.blockNumberToHex,h.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:c.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:c.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:c.eth_getTransactionCount,formatters:[null,h.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:c.eth_gasPrice}),this.getEstimateGas=s=>this.buildRequest({call:c.eth_estimateGas})([s]),this.setSafeSettings=this.buildRequest({call:c.safe_setSettings})}buildRequest(e){const{call:s,formatters:a}=e;return async n=>{a&&Array.isArray(n)&&a.forEach((l,u)=>{l&&(n[u]=l(n[u]))});const i={call:s,params:n||[]};return(await this.communicator.send(r.rpcCall,i)).data}}}const x="0x1626ba7e",O="0x20c13b0b",f=4001;class d extends Error{constructor(e,s,a){super(e),this.code=s,this.data=a,Object.setPrototypeOf(this,d.prototype)}}class S{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(r.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new d("Permissions request is invalid",f);try{return(await this.communicator.send(r.wallet_requestPermissions,e)).data}catch{throw new d("Permissions rejected",f)}}isPermissionRequestValid(e){return e.every(s=>typeof s=="object"?Object.keys(s).every(a=>!!Object.values(m).includes(a)):!1)}}const w=(t,e)=>e.some(s=>s.parentCapability===t),V=()=>(t,e,s)=>{const a=s.value;return s.value=async function(){const n=new S(this.communicator);let i=await n.getPermissions();if(w(e,i)||(i=await n.requestPermissions([{[e]:{}}])),!w(e,i))throw new d("Permissions rejected",f);return a.apply(this)},s};var M=function(t,e,s,a){var n=arguments.length,i=n<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,s):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,s,a);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(i=(n<3?o(i):n>3?o(e,s,i):o(e,s))||i);return n>3&&i&&Object.defineProperty(e,s,i),i};class _{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(r.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(r.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e="usd"}={}){return(await this.communicator.send(r.getSafeBalances,{currency:e})).data}async check1271Signature(e,s="0x"){const a=await this.getInfo(),n=y({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===x}catch{return!1}}async check1271SignatureBytes(e,s="0x"){const a=await this.getInfo(),n=y({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,s]}),i={call:c.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(r.rpcCall,i)).data.slice(0,10).toLowerCase()===O}catch{return!1}}calculateMessageHash(e){return k(e)}calculateTypedMessageHash(e){const s=typeof e.domain.chainId=="object"?e.domain.chainId.toNumber():Number(e.domain.chainId);let a=e.primaryType;if(!a){const n=Object.values(e.types),i=Object.keys(e.types).filter(o=>n.every(l=>l.every(({type:u})=>u.replace("[","").replace("]","")!==o)));if(i.length===0||i.length>1)throw new Error("Please specify primaryType");a=i[0]}return I({message:e.message,domain:{...e.domain,chainId:s,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt},types:e.types,primaryType:a})}async getOffChainSignature(e){return(await this.communicator.send(r.getOffChainSignature,e)).data}async isMessageSigned(e,s="0x"){let a;if(typeof e=="string"&&(a=async()=>{const n=this.calculateMessageHash(e);return await this.isMessageHashSigned(n,s)}),b(e)&&(a=async()=>{const n=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(n,s)}),a)return await a();throw new Error("Invalid message type")}async isMessageHashSigned(e,s="0x"){const a=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const n of a)if(await n(e,s))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(r.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(r.requestAddressBook,void 0)).data}}M([V()],_.prototype,"requestAddressBook",null);class G{constructor(e={}){const{allowedDomains:s=null,debug:a=!1}=e;this.communicator=new H(s,a),this.eth=new A(this.communicator),this.txs=new E(this.communicator),this.safe=new _(this.communicator),this.wallet=new S(this.communicator)}}export{g as MessageFormatter,r as Methods,c as RPC_CALLS,m as RestrictedMethods,G as default,q as getSDKVersion,b as isObjectEIP712TypedData};
@@ -1,4 +1,4 @@
1
- import{C as l,E as g,R as h,i as m,S as w,a as c,r as E,k as _}from"./W3MFrameProviderSingleton-DszZRKRh.js";import{C as R}from"./NetworkUtil-Cdd9AsyN.js";import{d as y,r as b,i as C,h as v,e as O}from"./index-CU7LDmTm.js";import{n as d,c as S}from"./index-BWA7Dnf9.js";import{o as $}from"./if-defined-B-CxqoOy.js";function I(){try{return c.returnOpenHref(`${R.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes")}catch{throw new Error("Could not open social popup")}}async function L(){h.push("ConnectingFarcaster");const e=m.getAuthConnector();if(e){const o=l.getAccountData();if(!(o!=null&&o.farcasterUrl))try{const{url:t}=await e.provider.getFarcasterUri();l.setAccountProp("farcasterUrl",t,l.state.activeChain)}catch(t){h.goBack(),w.showError(t)}}}async function T(e){h.push("ConnectingSocial");const o=m.getAuthConnector();let t=null;try{const i=setTimeout(()=>{throw new Error("Social login timed out. Please try again.")},45e3);if(o&&e){if(c.isTelegram()||(t=I()),t)l.setAccountProp("socialWindow",E(t),l.state.activeChain);else if(!c.isTelegram())throw new Error("Could not create social popup");const{uri:n}=await o.provider.getSocialRedirectUri({provider:e});if(!n)throw t==null||t.close(),new Error("Could not fetch the social redirect uri");if(t&&(t.location.href=n),c.isTelegram()){_.setTelegramSocialProvider(e);const r=c.formatTelegramSocialLoginUrl(n);c.openHref(r,"_top")}clearTimeout(i)}}catch(i){t==null||t.close();const n=c.parseError(i);w.showError(n),g.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:e,message:n}})}}async function F(e){l.setAccountProp("socialProvider",e,l.state.activeChain),g.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}}),e==="farcaster"?await L():await T(e)}const U=y`
1
+ import{C as l,E as g,R as h,i as m,S as w,a as c,r as E,k as _}from"./W3MFrameProviderSingleton-qDXCgbqI.js";import{C as R}from"./NetworkUtil-WCrLHdwO.js";import{d as y,r as b,i as C,h as v,e as O}from"./index-CQL2QU8C.js";import{n as d,c as S}from"./index-DJ6vuujr.js";import{o as $}from"./if-defined-BwPjC2Sk.js";function I(){try{return c.returnOpenHref(`${R.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes")}catch{throw new Error("Could not open social popup")}}async function L(){h.push("ConnectingFarcaster");const e=m.getAuthConnector();if(e){const o=l.getAccountData();if(!(o!=null&&o.farcasterUrl))try{const{url:t}=await e.provider.getFarcasterUri();l.setAccountProp("farcasterUrl",t,l.state.activeChain)}catch(t){h.goBack(),w.showError(t)}}}async function T(e){h.push("ConnectingSocial");const o=m.getAuthConnector();let t=null;try{const i=setTimeout(()=>{throw new Error("Social login timed out. Please try again.")},45e3);if(o&&e){if(c.isTelegram()||(t=I()),t)l.setAccountProp("socialWindow",E(t),l.state.activeChain);else if(!c.isTelegram())throw new Error("Could not create social popup");const{uri:n}=await o.provider.getSocialRedirectUri({provider:e});if(!n)throw t==null||t.close(),new Error("Could not fetch the social redirect uri");if(t&&(t.location.href=n),c.isTelegram()){_.setTelegramSocialProvider(e);const r=c.formatTelegramSocialLoginUrl(n);c.openHref(r,"_top")}clearTimeout(i)}}catch(i){t==null||t.close();const n=c.parseError(i);w.showError(n),g.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:e,message:n}})}}async function F(e){l.setAccountProp("socialProvider",e,l.state.activeChain),g.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}}),e==="farcaster"?await L():await T(e)}const U=y`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{w as f,d as w,r as v,i as b,h as l,e as y}from"./index-CU7LDmTm.js";import{n as o,c as x,U as $}from"./index-BWA7Dnf9.js";import"./index-BTCFHuS2.js";import"./index-DgBqViSr.js";import{o as z}from"./if-defined-B-CxqoOy.js";const S=f`<svg width="86" height="96" fill="none">
1
+ import{w as f,d as w,r as v,i as b,h as l,e as y}from"./index-CQL2QU8C.js";import{n as o,c as x,U as $}from"./index-DJ6vuujr.js";import"./index-nkUxBrDq.js";import"./index-BFcbLGKM.js";import{o as z}from"./if-defined-BwPjC2Sk.js";const S=f`<svg width="86" height="96" fill="none">
2
2
  <path
3
3
  d="M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z"
4
4
  />