@dcl/auth-site 5.1.2-34524450523.commit-4b2008e → 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 (116) hide show
  1. package/assets/{ConstantsUtil-DSEMevgo.js → ConstantsUtil-DP9HKY5D.js} +1 -1
  2. package/assets/{ContentfulRichText-bgOZSn86.js → ContentfulRichText-BssZV2jG.js} +1 -1
  3. package/assets/{ExchangeController-ElBgOWvQ.js → ExchangeController-2-tmrsVo.js} +1 -1
  4. package/assets/{HelpersUtil-DkXh5CjR.js → HelpersUtil-G-ttexgk.js} +1 -1
  5. package/assets/{LoginPage--38-9RQI.js → LoginPage-CN969Mzq.js} +1 -1
  6. package/assets/{NetworkUtil-DBeoVFoG.js → NetworkUtil-CAbFACGC.js} +1 -1
  7. package/assets/{SwapController-DEhYrmsq.js → SwapController-CBF7_cLL.js} +1 -1
  8. package/assets/{W3MFrameProviderSingleton-DKq7QfZL.js → W3MFrameProviderSingleton-DWYoW4MC.js} +3 -3
  9. package/assets/{biconomy-D0v11-WS.js → biconomy-D8U0vtA8.js} +1 -1
  10. package/assets/{browser-B_cnG7MM.js → browser-DvDokY9m.js} +1 -1
  11. package/assets/browser-ponyfill-DxSJjNwY.js +1 -0
  12. package/assets/{ccip-atl_6EW7.js → ccip-BOIGsm1Y.js} +1 -1
  13. package/assets/{ccip-QCp-fjxK.js → ccip-DoW2JhQm.js} +1 -1
  14. package/assets/{chains-C2pMTXXd.js → chains-DwGn4Qhb.js} +1 -1
  15. package/assets/{common-DAOxJaPg.js → common-C3U3NVnW.js} +1 -1
  16. package/assets/{controller-BRp192aN.js → controller-Yskek2X1.js} +2 -2
  17. package/assets/{data-capture-DaP5Bv-z.js → data-capture-cSp7KxPh.js} +1 -1
  18. package/assets/{email-D2VYLAEO.js → email-DvzkJPnh.js} +1 -1
  19. package/assets/{embedded-wallet-o0twKWes.js → embedded-wallet-CUWuM-o9.js} +1 -1
  20. package/assets/{engine-C3zJefLH.js → engine-BA60tUw_.js} +1 -1
  21. package/assets/{estimate-l1-fee-DH1BVUnD.js → estimate-l1-fee-Bk6gXX0c.js} +1 -1
  22. package/assets/{ethereum-D2mxwKk0.js → ethereum-BJ_I5XoR.js} +1 -1
  23. package/assets/{extractIPFS-4XWQqDJo.js → extractIPFS-CJBk3nUp.js} +1 -1
  24. package/assets/{features-Dp1Xk8B8.js → features-BrLxj4d0.js} +1 -1
  25. package/assets/{fetchTokenMetadata-je6Tet03.js → fetchTokenMetadata-12lavQSj.js} +1 -1
  26. package/assets/{fortmatic-E-gdLQr8.js → fortmatic-CfkevlPB.js} +1 -1
  27. package/assets/{get-ecosystem-wallet-info-HpHhPFoG.js → get-ecosystem-wallet-info-C_Oi6Edv.js} +1 -1
  28. package/assets/{getBalance-BqUGBP7W.js → getBalance-DQCsQNE3.js} +1 -1
  29. package/assets/{getInstalledModules-DP_wWX1P.js → getInstalledModules-CievZ6nG.js} +1 -1
  30. package/assets/{getNFT-VhD50L5D.js → getNFT-DchyAE-X.js} +1 -1
  31. package/assets/{getNFT-6kWvD-7p.js → getNFT-F5uCNKev.js} +2 -2
  32. package/assets/{if-defined-bIvP9Nvu.js → if-defined-DqlAZTUO.js} +1 -1
  33. package/assets/{in-app-DKWdJ0q7.js → in-app-DV8zPLq9.js} +2 -2
  34. package/assets/{in-app-wallet-calls-0sh635KN.js → in-app-wallet-calls-B4bAQUBa.js} +1 -1
  35. package/assets/{index-Bh0iNubk.js → index-0vgrRMWM.js} +1 -1
  36. package/assets/{index-CeMxqoyR.js → index-1XlsRf0v.js} +3 -3
  37. package/assets/{index-Cy8VtDht.js → index-AfQYA0v-.js} +1 -1
  38. package/assets/{index-ETcTUSVU.js → index-B0JAfmvp.js} +1 -1
  39. package/assets/{index-CxO7fKLn.js → index-B2qqxvUY.js} +1 -1
  40. package/assets/{index-Cu-k-1zO.js → index-B71PsJ8j.js} +1 -1
  41. package/assets/{index-CLZccgNK.js → index-BAnsDNYN.js} +1 -1
  42. package/assets/{index-BG40S2NP.js → index-BBWAwLCX.js} +1 -1
  43. package/assets/{index-C_yex2Dv.js → index-BP_c6dUM.js} +1 -1
  44. package/assets/{index-DE004xvS.js → index-BY-v6iyb.js} +1 -1
  45. package/assets/{index-Uays-1TZ.js → index-Bc3ifK0g.js} +1 -1
  46. package/assets/{index-DKbv2sh0.js → index-BdokbB_S.js} +1 -1
  47. package/assets/{index-D6Risnpr.js → index-BecveQH2.js} +1 -1
  48. package/assets/{index-B9TZA7_K.js → index-BhiZEafo.js} +1 -1
  49. package/assets/{index-C_QiE4hi.css → index-Bk6fDwhD.css} +1 -1
  50. package/assets/{index-Cawypxcc.js → index-Boxyd2oA.js} +1 -1
  51. package/assets/{index-CQcXstZd.js → index-C0FjaoKZ.js} +1 -1
  52. package/assets/{index-CS3P_-Iz.js → index-C2bhVCAO.js} +1 -1
  53. package/assets/{index-BhtR_uvr.js → index-CDSKpH1E.js} +1 -1
  54. package/assets/{index-UwgRnR-h.js → index-CKON5R6N.js} +1 -1
  55. package/assets/{index-Bf_X8SwN.js → index-COrqQldh.js} +1 -1
  56. package/assets/{index-BPvmpnpM.js → index-CU-3nryz.js} +1 -1
  57. package/assets/{index-b4S_0u_N.js → index-CiOyCbnB.js} +1 -1
  58. package/assets/{index-AON_JR-V.js → index-Ckp_AVaU.js} +10 -10
  59. package/assets/{index-CK9HhD2O.js → index-CnyOSDhm.js} +1 -1
  60. package/assets/{index-B13aupCi.js → index-CqwLUoCw.js} +1 -1
  61. package/assets/{index-BtfQ1dum.js → index-CtypDxih.js} +1 -1
  62. package/assets/{index-Cg0YaM-r.js → index-Cvu-wA-k.js} +1 -1
  63. package/assets/{index-CvCHYxeZ.js → index-DC2uOj0j.js} +3 -3
  64. package/assets/{index-LPMzRsxF.js → index-DEvQ65cm.js} +2 -2
  65. package/assets/{index-nGOahVbl.js → index-DOUiqvQb.js} +3 -3
  66. package/assets/{index-BTP7ujyZ.js → index-DQFom4Wy.js} +1 -1
  67. package/assets/{index-CSgIyp_M.js → index-De9m-UWS.js} +1 -1
  68. package/assets/{index-CwpdJg3Y.js → index-Dn6NAEjj.js} +1 -1
  69. package/assets/{index-p1FTE9ie.js → index-DoTS3nqG.js} +1 -1
  70. package/assets/{index-DIKd2HHc.js → index-Dxrm4EPx.js} +2 -2
  71. package/assets/{index-CMcCM8CI.js → index-Ob_SpPRA.js} +1 -1
  72. package/assets/{index-DlXcUGf1.js → index-TpsBtcIA.js} +1 -1
  73. package/assets/{index-DA8SgThY.js → index-Vzgy5xZi.js} +1 -1
  74. package/assets/{index-DiGaFypj.js → index-WpAqBWQA.js} +1 -1
  75. package/assets/{index-DlR1hLVr.js → index-YtQbGnNu.js} +1 -1
  76. package/assets/{index-OqFAvDaH.js → index-inPY-_ay.js} +1 -1
  77. package/assets/{index-DTmJvaJi.js → index-lCM0Yxgq.js} +1 -1
  78. package/assets/{index-BvDSVX19.js → index-p6h80e3f.js} +1 -1
  79. package/assets/{index-PnvwWCCm.js → index-rymhDxVC.js} +1 -1
  80. package/assets/{index-CigO0MRJ.js → index-sBxkRzNb.js} +1 -1
  81. package/assets/{index-JmFemEB2.js → index-v-mZEbxM.js} +1 -1
  82. package/assets/{index-Cycot5La.js → index-xWgbvees.js} +1 -1
  83. package/assets/{index-jcDR7bu5.js → index-zSzFalOk.js} +1 -1
  84. package/assets/{index.es-fkk6htIA.js → index.es-BwSxqfVq.js} +1 -1
  85. package/assets/{index.es-CRIwtS1m.js → index.es-WblwLow3.js} +1 -1
  86. package/assets/{linkAccount-CYoyH6iw.js → linkAccount-BewRH79r.js} +1 -1
  87. package/assets/{native-BpSCmApg.js → native-Bfy9T2NR.js} +1 -1
  88. package/assets/{networks-CZeE42CD.js → networks-B94dMaIx.js} +3 -3
  89. package/assets/{onramp-CblwUpcw.js → onramp-D5hikdnD.js} +1 -1
  90. package/assets/{openzeppelin-OggPggDy.js → openzeppelin-y_BW_p9H.js} +1 -1
  91. package/assets/{ownerOf-CLtcGFXW.js → ownerOf-DbLTUlQ8.js} +1 -1
  92. package/assets/{parseNft-CHIK1y2o.js → parseNft-BWjfjF1i.js} +2 -2
  93. package/assets/{pay-with-exchange-QOTOaVZY.js → pay-with-exchange-CBt57SPn.js} +1 -1
  94. package/assets/{qr-overlay-Cx2VnW9I.js → qr-overlay-9LqXa93u.js} +3 -3
  95. package/assets/{receive-BJZv5dur.js → receive-DYGa0uth.js} +1 -1
  96. package/assets/{ref-BEBr2zKA.js → ref-CH5m8g-_.js} +1 -1
  97. package/assets/{resolveImplementation-CXBv6VTI.js → resolveImplementation-tOR8MDOZ.js} +1 -1
  98. package/assets/{secp256k1-BbKBEV5d.js → secp256k1-C7e03vVD.js} +1 -1
  99. package/assets/{send-Bg8_p49w.js → send-BZVnfh_Q.js} +1 -1
  100. package/assets/{send-eip712-transaction-iXSyPIV0.js → send-eip712-transaction-CXGAJp1J.js} +1 -1
  101. package/assets/{send-gasless-transaction-Cbo_PvoF.js → send-gasless-transaction-gX81A9kf.js} +2 -2
  102. package/assets/{session-proposal-CItJKPYh.js → session-proposal-C7vqH4fC.js} +1 -1
  103. package/assets/{session-request--7Jk0e3w.js → session-request-CGXJcyJV.js} +2 -2
  104. package/assets/{socials-B3grKB6D.js → socials-D78l6pou.js} +1 -1
  105. package/assets/{swaps-C_uaDJe4.js → swaps-DrOcN6PI.js} +1 -1
  106. package/assets/{thirdweb-CqYj0Zr7.js → thirdweb-CaPz3IIA.js} +5 -5
  107. package/assets/{totalSupply-Du9VjrWa.js → totalSupply-BakRyzgy.js} +1 -1
  108. package/assets/{transactions-B7HxzgfX.js → transactions-jBCnxUW2.js} +1 -1
  109. package/assets/{ui-BZ8uZPIM.js → ui-DR5Eq4NP.js} +5 -5
  110. package/assets/{vendor-CvE3BVBL.js → vendor-DWoMeO8l.js} +1 -1
  111. package/assets/{w3m-modal-D6Wbtne2.js → w3m-modal-CqcJ-ri7.js} +1 -1
  112. package/assets/{wallets-BQ_1TsVz.js → wallets-CVw0qVp4.js} +4 -4
  113. package/assets/{web-connector-DVkR_QJ0.js → web-connector-Xa5kysut.js} +3 -3
  114. package/index.html +5 -5
  115. package/package.json +3 -3
  116. package/assets/browser-ponyfill-BPnww19Q.js +0 -1
@@ -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-CvCHYxeZ.js";import{n as c,c as p,U as F,r as u,b as Ii}from"./index-BhtR_uvr.js";import{o as w}from"./if-defined-bIvP9Nvu.js";import"./index-BtfQ1dum.js";import"./index-DKbv2sh0.js";import"./index-CQcXstZd.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-DKq7QfZL.js";import"./index-DE004xvS.js";import{a as Ps,W as Ds}from"./index-CxO7fKLn.js";import"./index-CigO0MRJ.js";import"./index-ETcTUSVU.js";import"./index-Bh0iNubk.js";import{C as E}from"./NetworkUtil-DBeoVFoG.js";import{H as Jt}from"./HelpersUtil-DkXh5CjR.js";import{n as Zi}from"./index-CLZccgNK.js";import{E as Q}from"./ExchangeController-ElBgOWvQ.js";import"./index-UwgRnR-h.js";import"./index-BG40S2NP.js";import"./index-Cu-k-1zO.js";import{M as mt}from"./MathUtil-BGCe3rZ3.js";import"./index-Cycot5La.js";import{e as Zt,n as ei}from"./ref-BEBr2zKA.js";import"./index-CwpdJg3Y.js";import"./index-DlR1hLVr.js";import"./index-jcDR7bu5.js";import"./index-Bf_X8SwN.js";import{O as bt}from"./index-Cy8VtDht.js";import{e as en}from"./index-DTmJvaJi.js";import"./index-D6Risnpr.js";import"./index-BvDSVX19.js";import{N as tn}from"./NavigationUtil-DmfK5sOV.js";import"./index-PnvwWCCm.js";import"./thirdweb-CqYj0Zr7.js";import"./ui-BZ8uZPIM.js";import"./vendor-CvE3BVBL.js";import"./index-AON_JR-V.js";import"./index-Cg0YaM-r.js";import"./index-B9TZA7_K.js";import"./index-nibyPLVP.js";import"./index.es-CRIwtS1m.js";import"./browser-ponyfill-BPnww19Q.js";import"./fromHex-CMtWckFK.js";import"./ConstantsUtil-DSEMevgo.js";import"./browser-B_cnG7MM.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-AON_JR-V.js";import"./thirdweb-CqYj0Zr7.js";import"./ui-BZ8uZPIM.js";import"./vendor-CvE3BVBL.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-CvCHYxeZ.js";import{n as r,c as f}from"./index-BhtR_uvr.js";import{o as m}from"./if-defined-bIvP9Nvu.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-AON_JR-V.js";import{a as Fn,p as Se}from"./thirdweb-CqYj0Zr7.js";import{c as _n}from"./index-B9TZA7_K.js";import{g as ge}from"./ui-BZ8uZPIM.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