@dcl/auth-site 5.1.2-34514490657.commit-8bf1429 → 5.1.2-34524962947.commit-c3b4bf2

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 (117) hide show
  1. package/assets/{ConstantsUtil-FZmgiCZu.js → ConstantsUtil-DP9HKY5D.js} +1 -1
  2. package/assets/{ContentfulRichText-BeoEGtKq.js → ContentfulRichText-BssZV2jG.js} +1 -1
  3. package/assets/{ExchangeController-CSm5uFPi.js → ExchangeController-2-tmrsVo.js} +1 -1
  4. package/assets/{HelpersUtil-LsRFsIhO.js → HelpersUtil-G-ttexgk.js} +1 -1
  5. package/assets/{LoginPage-KhYiEbmb.js → LoginPage-CN969Mzq.js} +1 -1
  6. package/assets/{NetworkUtil-C119Rrm6.js → NetworkUtil-CAbFACGC.js} +1 -1
  7. package/assets/{SwapController-Bg6Mn6yQ.js → SwapController-CBF7_cLL.js} +1 -1
  8. package/assets/{W3MFrameProviderSingleton-DnxzA0kB.js → W3MFrameProviderSingleton-DWYoW4MC.js} +3 -3
  9. package/assets/{biconomy-PuaWQyTt.js → biconomy-D8U0vtA8.js} +1 -1
  10. package/assets/{browser-0hk_vZHL.js → browser-DvDokY9m.js} +1 -1
  11. package/assets/browser-ponyfill-DxSJjNwY.js +1 -0
  12. package/assets/{ccip-CTp1bqmH.js → ccip-BOIGsm1Y.js} +1 -1
  13. package/assets/{ccip-D0ISwJlB.js → ccip-DoW2JhQm.js} +1 -1
  14. package/assets/{chains-C1XxG8q4.js → chains-DwGn4Qhb.js} +1 -1
  15. package/assets/{common-BoaAfB0l.js → common-C3U3NVnW.js} +1 -1
  16. package/assets/{controller-BK2j6bQ7.js → controller-Yskek2X1.js} +2 -2
  17. package/assets/{data-capture-SSTecvrL.js → data-capture-cSp7KxPh.js} +1 -1
  18. package/assets/{email-dY_-0UtQ.js → email-DvzkJPnh.js} +1 -1
  19. package/assets/{embedded-wallet-dm0Qqt1T.js → embedded-wallet-CUWuM-o9.js} +1 -1
  20. package/assets/{engine-DsjskX0_.js → engine-BA60tUw_.js} +1 -1
  21. package/assets/{estimate-l1-fee-DIfozBrU.js → estimate-l1-fee-Bk6gXX0c.js} +1 -1
  22. package/assets/{ethereum-D_JKLyAV.js → ethereum-BJ_I5XoR.js} +1 -1
  23. package/assets/{extractIPFS-BEA8v8ZZ.js → extractIPFS-CJBk3nUp.js} +1 -1
  24. package/assets/{features-CdJzXJFh.js → features-BrLxj4d0.js} +1 -1
  25. package/assets/{fetchTokenMetadata-CWlNfyda.js → fetchTokenMetadata-12lavQSj.js} +1 -1
  26. package/assets/{fortmatic-CEGToOYx.js → fortmatic-CfkevlPB.js} +1 -1
  27. package/assets/{get-ecosystem-wallet-info-CPzpmtHu.js → get-ecosystem-wallet-info-C_Oi6Edv.js} +1 -1
  28. package/assets/{getBalance-KQKt8hn7.js → getBalance-DQCsQNE3.js} +1 -1
  29. package/assets/{getInstalledModules-CWg0KLmd.js → getInstalledModules-CievZ6nG.js} +1 -1
  30. package/assets/{getNFT-DInnHSMw.js → getNFT-DchyAE-X.js} +1 -1
  31. package/assets/{getNFT-BlHI59t4.js → getNFT-F5uCNKev.js} +2 -2
  32. package/assets/{if-defined-oOXeOSne.js → if-defined-DqlAZTUO.js} +1 -1
  33. package/assets/{in-app-FmFjuvdo.js → in-app-DV8zPLq9.js} +2 -2
  34. package/assets/{in-app-wallet-calls-Dovg-59j.js → in-app-wallet-calls-B4bAQUBa.js} +1 -1
  35. package/assets/{index-acJS1bGk.js → index-0vgrRMWM.js} +1 -1
  36. package/assets/{index-t0S12Dzl.js → index-1XlsRf0v.js} +3 -3
  37. package/assets/{index-BixVWd3Y.js → index-AfQYA0v-.js} +1 -1
  38. package/assets/{index-CjNq5PL9.js → index-B0JAfmvp.js} +1 -1
  39. package/assets/{index-mvtqfIjc.js → index-B2qqxvUY.js} +1 -1
  40. package/assets/{index-CDYj3kOR.js → index-B71PsJ8j.js} +1 -1
  41. package/assets/{index-C5NI85Lq.js → index-BAnsDNYN.js} +1 -1
  42. package/assets/{index-x9DFxp9f.js → index-BBWAwLCX.js} +1 -1
  43. package/assets/{index-Dx87nRVW.js → index-BP_c6dUM.js} +1 -1
  44. package/assets/{index-BalsUw0w.js → index-BY-v6iyb.js} +1 -1
  45. package/assets/index-Bc3ifK0g.js +3 -0
  46. package/assets/{index-CrTViG4P.js → index-BdokbB_S.js} +1 -1
  47. package/assets/{index-CSCe52xo.js → index-BecveQH2.js} +1 -1
  48. package/assets/{index-CJ3RCDw8.js → index-BhiZEafo.js} +1 -1
  49. package/assets/{index-DeKaR6Ou.css → index-Bk6fDwhD.css} +1 -1
  50. package/assets/{index-zl_SaksW.js → index-Boxyd2oA.js} +1 -1
  51. package/assets/{index-CQVAaAYS.js → index-C0FjaoKZ.js} +1 -1
  52. package/assets/{index-yOyvNpCc.js → index-C2bhVCAO.js} +1 -1
  53. package/assets/{index-3TEP8wvg.js → index-CDSKpH1E.js} +1 -1
  54. package/assets/{index-dpBAsLqx.js → index-CKON5R6N.js} +1 -1
  55. package/assets/{index-g4jHhtiW.js → index-COrqQldh.js} +1 -1
  56. package/assets/{index-DCSj-I32.js → index-CU-3nryz.js} +1 -1
  57. package/assets/{index-pRUBgieS.js → index-CiOyCbnB.js} +1 -1
  58. package/assets/{index-BR1ZADk7.js → index-Ckp_AVaU.js} +34 -34
  59. package/assets/{index-BgfB56l_.js → index-CnyOSDhm.js} +1 -1
  60. package/assets/{index--bVVTt8P.js → index-CqwLUoCw.js} +1 -1
  61. package/assets/{index-CEFTG8bM.js → index-CtypDxih.js} +1 -1
  62. package/assets/{index-CBC_FSoh.js → index-Cvu-wA-k.js} +1 -1
  63. package/assets/{index-CTM8Hkvi.js → index-DC2uOj0j.js} +3 -3
  64. package/assets/{index-BcSi3BJu.js → index-DEvQ65cm.js} +2 -2
  65. package/assets/{index-V_Do2vbI.js → index-DOUiqvQb.js} +3 -3
  66. package/assets/{index-C2dKniF1.js → index-DQFom4Wy.js} +1 -1
  67. package/assets/{index-DlF7jW8i.js → index-De9m-UWS.js} +1 -1
  68. package/assets/{index-DWAgaWCs.js → index-Dn6NAEjj.js} +1 -1
  69. package/assets/{index-CwCpxqeF.js → index-DoTS3nqG.js} +1 -1
  70. package/assets/{index-jpp0GH7r.js → index-Dxrm4EPx.js} +2 -2
  71. package/assets/{index-DtihCRG3.js → index-Ob_SpPRA.js} +1 -1
  72. package/assets/{index-CqpEtuW-.js → index-TpsBtcIA.js} +1 -1
  73. package/assets/{index-Bk0I_8uz.js → index-Vzgy5xZi.js} +1 -1
  74. package/assets/{index-DD9TdaEn.js → index-WpAqBWQA.js} +1 -1
  75. package/assets/{index-B9UyUFo8.js → index-YtQbGnNu.js} +1 -1
  76. package/assets/{index-D9NnDWK4.js → index-inPY-_ay.js} +1 -1
  77. package/assets/{index-CP1b7sLb.js → index-lCM0Yxgq.js} +1 -1
  78. package/assets/{index-B5337ZoV.js → index-p6h80e3f.js} +1 -1
  79. package/assets/{index-B4GxLB9m.js → index-rymhDxVC.js} +1 -1
  80. package/assets/{index-htiAyklv.js → index-sBxkRzNb.js} +1 -1
  81. package/assets/{index-DfIfP3Fi.js → index-v-mZEbxM.js} +1 -1
  82. package/assets/{index-C5qWGgHO.js → index-xWgbvees.js} +1 -1
  83. package/assets/{index-Csqg-emG.js → index-zSzFalOk.js} +1 -1
  84. package/assets/{index.es-crHqzkST.js → index.es-BwSxqfVq.js} +1 -1
  85. package/assets/{index.es-DmPJDOyA.js → index.es-WblwLow3.js} +1 -1
  86. package/assets/{linkAccount-CUhbOeg6.js → linkAccount-BewRH79r.js} +1 -1
  87. package/assets/{native-ocRKA6bD.js → native-Bfy9T2NR.js} +1 -1
  88. package/assets/{networks-DHqYycmi.js → networks-B94dMaIx.js} +3 -3
  89. package/assets/{onramp-BwmydiGu.js → onramp-D5hikdnD.js} +1 -1
  90. package/assets/{openzeppelin-DK2xqN70.js → openzeppelin-y_BW_p9H.js} +1 -1
  91. package/assets/{ownerOf-BTfcfVop.js → ownerOf-DbLTUlQ8.js} +1 -1
  92. package/assets/{parseNft-Dv0girr5.js → parseNft-BWjfjF1i.js} +2 -2
  93. package/assets/{pay-with-exchange-DTJdCJQy.js → pay-with-exchange-CBt57SPn.js} +1 -1
  94. package/assets/{qr-overlay-BEFeulTi.js → qr-overlay-9LqXa93u.js} +3 -3
  95. package/assets/{receive-aifBB3vB.js → receive-DYGa0uth.js} +1 -1
  96. package/assets/{ref-BeJiwSUz.js → ref-CH5m8g-_.js} +1 -1
  97. package/assets/{resolveImplementation-yH6FK9uK.js → resolveImplementation-tOR8MDOZ.js} +1 -1
  98. package/assets/{secp256k1-BsLTTFnR.js → secp256k1-C7e03vVD.js} +1 -1
  99. package/assets/{send-B0GdfbVX.js → send-BZVnfh_Q.js} +1 -1
  100. package/assets/{send-eip712-transaction-2ynjyiqj.js → send-eip712-transaction-CXGAJp1J.js} +1 -1
  101. package/assets/{send-gasless-transaction-C9uh5rKo.js → send-gasless-transaction-gX81A9kf.js} +2 -2
  102. package/assets/{session-proposal-Dv0yoYwv.js → session-proposal-C7vqH4fC.js} +1 -1
  103. package/assets/{session-request--Un9_ms7.js → session-request-CGXJcyJV.js} +2 -2
  104. package/assets/{socials-CSXPMnyX.js → socials-D78l6pou.js} +1 -1
  105. package/assets/{swaps-D28AUAw_.js → swaps-DrOcN6PI.js} +1 -1
  106. package/assets/{thirdweb-DQPvuOgZ.js → thirdweb-CaPz3IIA.js} +5 -5
  107. package/assets/{totalSupply-CkOfQyvU.js → totalSupply-BakRyzgy.js} +1 -1
  108. package/assets/{transactions-B5vmQdX1.js → transactions-jBCnxUW2.js} +1 -1
  109. package/assets/{ui-DQ4tqTVn.js → ui-DR5Eq4NP.js} +5 -5
  110. package/assets/{vendor-Coy7ugpC.js → vendor-DWoMeO8l.js} +1 -1
  111. package/assets/{w3m-modal-Co-bqj9Y.js → w3m-modal-CqcJ-ri7.js} +1 -1
  112. package/assets/{wallets-CuOUF33l.js → wallets-CVw0qVp4.js} +4 -4
  113. package/assets/{web-connector-CM_zaD3j.js → web-connector-Xa5kysut.js} +3 -3
  114. package/index.html +5 -5
  115. package/package.json +3 -3
  116. package/assets/browser-ponyfill-0OP9AUCj.js +0 -1
  117. package/assets/index-B9s-zj3U.js +0 -3
@@ -1,4 +1,4 @@
1
- import{d as v,r as _,e as W,i as f,h as l,j as ee}from"./index-CTM8Hkvi.js";import{n as c,c as p,U as F,r as u,b as Ii}from"./index-3TEP8wvg.js";import{o as w}from"./if-defined-oOXeOSne.js";import"./index-CEFTG8bM.js";import"./index-CrTViG4P.js";import"./index-CQVAaAYS.js";import{C as d,O as m,D as Ee,j as S,a as y,M as P,E as C,k as me,i as b,R as h,b as D,S as A,d as x,e as ze,W as Fe,a4 as Xt,a3 as he,U as J,L as qi,q as I,a8 as tt,A as _i,u as Ki,t as Gi,o as Xi,T as ft,F as Yt,G as Qt,a6 as Yi,ad as Qi,I as Bt,ae as Ji}from"./W3MFrameProviderSingleton-DnxzA0kB.js";import"./index-BalsUw0w.js";import{a as Ps,W as Ds}from"./index-mvtqfIjc.js";import"./index-htiAyklv.js";import"./index-CjNq5PL9.js";import"./index-acJS1bGk.js";import{C as E}from"./NetworkUtil-C119Rrm6.js";import{H as Jt}from"./HelpersUtil-LsRFsIhO.js";import{n as Zi}from"./index-C5NI85Lq.js";import{E as Q}from"./ExchangeController-CSm5uFPi.js";import"./index-dpBAsLqx.js";import"./index-x9DFxp9f.js";import"./index-CDYj3kOR.js";import{M as mt}from"./MathUtil-BGCe3rZ3.js";import"./index-C5qWGgHO.js";import{e as Zt,n as ei}from"./ref-BeJiwSUz.js";import"./index-DWAgaWCs.js";import"./index-B9UyUFo8.js";import"./index-Csqg-emG.js";import"./index-g4jHhtiW.js";import{O as bt}from"./index-BixVWd3Y.js";import{e as en}from"./index-CP1b7sLb.js";import"./index-CSCe52xo.js";import"./index-B5337ZoV.js";import{N as tn}from"./NavigationUtil-DmfK5sOV.js";import"./index-B4GxLB9m.js";import"./thirdweb-DQPvuOgZ.js";import"./ui-DQ4tqTVn.js";import"./vendor-Coy7ugpC.js";import"./index-BR1ZADk7.js";import"./index-CBC_FSoh.js";import"./index-CJ3RCDw8.js";import"./index-nibyPLVP.js";import"./index.es-DmPJDOyA.js";import"./browser-ponyfill-0OP9AUCj.js";import"./fromHex-CMtWckFK.js";import"./ConstantsUtil-FZmgiCZu.js";import"./browser-0hk_vZHL.js";const nn=v`
1
+ import{d as v,r as _,e as W,i as f,h as l,j as ee}from"./index-DC2uOj0j.js";import{n as c,c as p,U as F,r as u,b as Ii}from"./index-CDSKpH1E.js";import{o as w}from"./if-defined-DqlAZTUO.js";import"./index-CtypDxih.js";import"./index-BdokbB_S.js";import"./index-C0FjaoKZ.js";import{C as d,O as m,D as Ee,j as S,a as y,M as P,E as C,k as me,i as b,R as h,b as D,S as A,d as x,e as ze,W as Fe,a4 as Xt,a3 as he,U as J,L as qi,q as I,a8 as tt,A as _i,u as Ki,t as Gi,o as Xi,T as ft,F as Yt,G as Qt,a6 as Yi,ad as Qi,I as Bt,ae as Ji}from"./W3MFrameProviderSingleton-DWYoW4MC.js";import"./index-BY-v6iyb.js";import{a as Ps,W as Ds}from"./index-B2qqxvUY.js";import"./index-sBxkRzNb.js";import"./index-B0JAfmvp.js";import"./index-0vgrRMWM.js";import{C as E}from"./NetworkUtil-CAbFACGC.js";import{H as Jt}from"./HelpersUtil-G-ttexgk.js";import{n as Zi}from"./index-BAnsDNYN.js";import{E as Q}from"./ExchangeController-2-tmrsVo.js";import"./index-CKON5R6N.js";import"./index-BBWAwLCX.js";import"./index-B71PsJ8j.js";import{M as mt}from"./MathUtil-BGCe3rZ3.js";import"./index-xWgbvees.js";import{e as Zt,n as ei}from"./ref-CH5m8g-_.js";import"./index-Dn6NAEjj.js";import"./index-YtQbGnNu.js";import"./index-zSzFalOk.js";import"./index-COrqQldh.js";import{O as bt}from"./index-AfQYA0v-.js";import{e as en}from"./index-lCM0Yxgq.js";import"./index-BecveQH2.js";import"./index-p6h80e3f.js";import{N as tn}from"./NavigationUtil-DmfK5sOV.js";import"./index-rymhDxVC.js";import"./thirdweb-CaPz3IIA.js";import"./ui-DR5Eq4NP.js";import"./vendor-DWoMeO8l.js";import"./index-Ckp_AVaU.js";import"./index-Cvu-wA-k.js";import"./index-BhiZEafo.js";import"./index-nibyPLVP.js";import"./index.es-WblwLow3.js";import"./browser-ponyfill-DxSJjNwY.js";import"./fromHex-CMtWckFK.js";import"./ConstantsUtil-DP9HKY5D.js";import"./browser-DvDokY9m.js";const nn=v`
2
2
  :host {
3
3
  display: block;
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-BR1ZADk7.js";import"./thirdweb-DQPvuOgZ.js";import"./ui-DQ4tqTVn.js";import"./vendor-Coy7ugpC.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{b3 as y,b4 as k,b5 as I}from"./index-Ckp_AVaU.js";import"./thirdweb-CaPz3IIA.js";import"./ui-DR5Eq4NP.js";import"./vendor-DWoMeO8l.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{d as u,r as p,i as g,h as c}from"./index-CTM8Hkvi.js";import{n as r,c as f}from"./index-3TEP8wvg.js";import{o as m}from"./if-defined-oOXeOSne.js";const b=u`
1
+ import{d as u,r as p,i as g,h as c}from"./index-DC2uOj0j.js";import{n as r,c as f}from"./index-CDSKpH1E.js";import{o as m}from"./if-defined-DqlAZTUO.js";const b=u`
2
2
  :host {
3
3
  display: block;
4
4
  width: var(--local-width);
@@ -1,4 +1,4 @@
1
- import{e as ft}from"./index-BR1ZADk7.js";import{a as Fn,p as Se}from"./thirdweb-DQPvuOgZ.js";import{c as _n}from"./index-CJ3RCDw8.js";import{g as ge}from"./ui-DQ4tqTVn.js";var Pe={};/*! *****************************************************************************
1
+ import{e as ft}from"./index-Ckp_AVaU.js";import{a as Fn,p as Se}from"./thirdweb-CaPz3IIA.js";import{c as _n}from"./index-BhiZEafo.js";import{g as ge}from"./ui-DR5Eq4NP.js";var Pe={};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any