@dcl/shop 0.1.0-28716680419.commit-115ef85 → 0.1.0-28716868442.commit-8bfb3b0

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 (169) hide show
  1. package/assets/Assets-nmQB2810.js +1 -0
  2. package/assets/Cart-CVq8ErN4.js +1 -0
  3. package/assets/Collection-DrWaGsbD.js +1 -0
  4. package/assets/Creator-CODX4HY-.js +1 -0
  5. package/assets/{ExchangeController-oKZCI5Cm.js → ExchangeController-DGYlS1u1.js} +1 -1
  6. package/assets/GetCredits-BJ-vtPKx.js +2 -0
  7. package/assets/{HelpersUtil-DlwsWqwo.js → HelpersUtil-Cs7A9lff.js} +1 -1
  8. package/assets/ImportListings-DWEJuGBQ.js +1 -0
  9. package/assets/ItemDetail-CLZiYPr_.js +1 -0
  10. package/assets/LoadMore-DB6TwvRe.js +1 -0
  11. package/assets/Market-C5YZkU0k.js +1 -0
  12. package/assets/MyAssets-DiQ1f-Nx.js +1 -0
  13. package/assets/MyFavorites-D2neF-WT.js +1 -0
  14. package/assets/MyPurchases-CX-sT4T9.js +1 -0
  15. package/assets/{RealCheckout-B-VZgd32.js → RealCheckout-DVYTPQMi.js} +1 -1
  16. package/assets/SkeletonCards-yV2mi4oc.js +1 -0
  17. package/assets/{Success-UyUVmhqC.js → Success-Dty0MEac.js} +1 -1
  18. package/assets/{SwapController-C4kBShaN.js → SwapController-CTsLqo0R.js} +1 -1
  19. package/assets/{TradeService-DJv1m80G.js → TradeService-Co6yXz1n.js} +1 -1
  20. package/assets/{W3MFrameProviderSingleton-BajAKkgJ.js → W3MFrameProviderSingleton-DBf03HGk.js} +3 -3
  21. package/assets/{WebCryptoP256-1b46_-Gp.js → WebCryptoP256-BMVi41Tf.js} +1 -1
  22. package/assets/{basic-BYmmYUvJ.js → basic-BKlH1yZE.js} +1 -1
  23. package/assets/{biconomy-Dn8n1yMa.js → biconomy-BuC8Y20q.js} +1 -1
  24. package/assets/{buy-gasless-DvmGkt5H.js → buy-gasless-EwLKJESl.js} +1 -1
  25. package/assets/{buy-B7s3xnPy.js → buy-qVYsiH8c.js} +1 -1
  26. package/assets/{ccip-6aROGgJo.js → ccip-BXAlyEXK.js} +1 -1
  27. package/assets/{ccip-ns4bJSsS.js → ccip-BhXlCEl_.js} +1 -1
  28. package/assets/{collection-Clqatgq9.js → collection-yK7CsBpq.js} +1 -1
  29. package/assets/{controller-Bv77GbzU.js → controller-D31V5T7x.js} +2 -2
  30. package/assets/{core-fQqw9elX.js → core-HiY9JG8Q.js} +4 -4
  31. package/assets/{custom-CDeGqBaz.js → custom-CNeK1SBe.js} +1 -1
  32. package/assets/{data-capture-Du4NJ56P.js → data-capture-BGCV8f_8.js} +1 -1
  33. package/assets/decimals-690uYbRk.js +1 -0
  34. package/assets/{decimals-DAUiLOwK.js → decimals-eyiqtEAM.js} +1 -1
  35. package/assets/{detectExtension-Ds3yS-BV.js → detectExtension-HGgsLFYa.js} +1 -1
  36. package/assets/{email-B_pxpP5c.js → email-D3mSaTDc.js} +1 -1
  37. package/assets/{embedded-wallet-DPVZun8j.js → embedded-wallet-BIpOn63k.js} +1 -1
  38. package/assets/{engine-hhTljyZB.js → engine-Cp4bGvGY.js} +1 -1
  39. package/assets/{estimate-l1-fee-C4oOyuI_.js → estimate-l1-fee-DqCr-VRj.js} +1 -1
  40. package/assets/{eth_estimateGas-D0gecbs_.js → eth_estimateGas-Btj3BdU3.js} +1 -1
  41. package/assets/{eth_getStorageAt-BFVhklul.js → eth_getStorageAt-cAsXEzwb.js} +1 -1
  42. package/assets/{eth_getTransactionCount-DCcVmIL3.js → eth_getTransactionCount-9mRngMvR.js} +1 -1
  43. package/assets/{extractIPFS-_lNiLeth.js → extractIPFS-Cos3MMqA.js} +1 -1
  44. package/assets/{features-DncncE5f.js → features-CS9ITEyv.js} +1 -1
  45. package/assets/{fetchTokenMetadata-DvRBbgwu.js → fetchTokenMetadata--27nDLvT.js} +2 -2
  46. package/assets/{get-ecosystem-wallet-info-B7f_phjw.js → get-ecosystem-wallet-info-DsGpr1v9.js} +1 -1
  47. package/assets/{getBalance-BnpIAunn.js → getBalance-C1EIeWK3.js} +1 -1
  48. package/assets/{getInstalledModules-uDQciopR.js → getInstalledModules-CSy_anIJ.js} +1 -1
  49. package/assets/{getNFT-CTXTVdrc.js → getNFT-Biv4Mkbw.js} +1 -1
  50. package/assets/{getNFT-DoDC41xG.js → getNFT-C3k4-I_M.js} +2 -2
  51. package/assets/{hashTypedData-DK4wFgd9.js → hashTypedData-D-eX1daT.js} +1 -1
  52. package/assets/{hashTypedData-CFB72Lv_.js → hashTypedData-DCkFFbNQ.js} +1 -1
  53. package/assets/{import-Cnia99Q3.js → import-DjExR-_c.js} +1 -1
  54. package/assets/{in-app-wallet-calls-BjNeExD4.js → in-app-wallet-calls-BsZ7t_xW.js} +1 -1
  55. package/assets/{index-Dfm9U86F.js → index-0QSHJ5kM.js} +1 -1
  56. package/assets/{index-BrCIZMhr.js → index-B-iF1tO2.js} +1 -1
  57. package/assets/{index-Bo3uMk6y.js → index-B91_eufC.js} +1 -1
  58. package/assets/{index-CWLWfuhG.js → index-BBWsjtyi.js} +1 -1
  59. package/assets/{index-nGmuCx2o.js → index-BDnsSs1l.js} +1 -1
  60. package/assets/{index-BqlddYem.js → index-BEDCm9Wu.js} +1 -1
  61. package/assets/{index-G2m5zW4B.js → index-BP1BUYI1.js} +1 -1
  62. package/assets/{index-CDefEfgf.js → index-BSTJA_7O.js} +2 -2
  63. package/assets/{index-D9Y2-jjA.js → index-BTkTkfcn.js} +1 -1
  64. package/assets/{index-DbbWMdX8.js → index-BbTcdIk0.js} +1 -1
  65. package/assets/{index-BhN3BfbK.js → index-BgPhxGKT.js} +1 -1
  66. package/assets/{index-B8QnqxlO.js → index-BkdaY7_G.js} +3 -3
  67. package/assets/{index-BQfq4rEJ.js → index-BnFty3Li.js} +1 -1
  68. package/assets/{index-BBAS_XzU.js → index-BoJsJx--.js} +1 -1
  69. package/assets/{index-yU_-adaI.js → index-Brg6cgDQ.js} +1 -1
  70. package/assets/{index-CAWxx-t9.js → index-C0nXxFCO.js} +1 -1
  71. package/assets/{index-CLIt2qWt.js → index-CJEb8Kzs.js} +1 -1
  72. package/assets/{index-ra_FFhx_.js → index-CLE07-_x.js} +1 -1
  73. package/assets/{index-CqbILdiv.js → index-CLXqEKlA.js} +1 -1
  74. package/assets/{index-ORO4OGRK.js → index-CLkVyB5o.js} +1 -1
  75. package/assets/{index-C7mxuo2v.js → index-CLy-wBAP.js} +2 -2
  76. package/assets/{index-CRymZiKW.js → index-CQtzuPXx.js} +1 -1
  77. package/assets/{index-BwIPPZe_.js → index-CWRbefrn.js} +1 -1
  78. package/assets/{index-W3bT5EjH.js → index-CWgv2cWv.js} +1 -1
  79. package/assets/{index-DFpOueb5.js → index-CXiOQLIu.js} +1 -1
  80. package/assets/{index-DAPfm2Hj.js → index-CdcrnJ5_.js} +1 -1
  81. package/assets/{index-BZHLf8Dx.js → index-Cj7vACZe.js} +1 -1
  82. package/assets/{index-_6K_Lm8_.js → index-Cmk_xiBk.js} +7 -7
  83. package/assets/{index-C3xQgbb2.js → index-CqIROolS.js} +1 -1
  84. package/assets/{index-yxg1tO6a.js → index-CrBV_1yu.js} +1 -1
  85. package/assets/{index-Djj4c5iy.js → index-CyqLliR_.js} +3 -3
  86. package/assets/{index-l6gRgJ4r.js → index-D-S19rzI.js} +1 -1
  87. package/assets/{index-D-cD9Fhz.js → index-D1cUVAY6.js} +1 -1
  88. package/assets/{index-BKpKjRh2.js → index-D5uLI4BM.js} +1 -1
  89. package/assets/{index-Cqm_NJEy.js → index-DDLsPu5_.js} +12 -12
  90. package/assets/{index-CPTeXTyI.js → index-DGoPqCsR.js} +1 -1
  91. package/assets/{index-Bx0NX1Wy.js → index-DOExxORl.js} +1 -1
  92. package/assets/{index-CifOEt4M.js → index-DUVY_38U.js} +1 -1
  93. package/assets/index-DccLoKMC.js +2 -0
  94. package/assets/{index-DLmaljHx.js → index-DgAZv7hc.js} +1 -1
  95. package/assets/{index-BE8AJRWt.js → index-DpcKgN-v.js} +1 -1
  96. package/assets/{index-C0KPF2ok.js → index-DquEMs4O.js} +1 -1
  97. package/assets/{index-CWVYaGnK.js → index-KarPC4Z4.js} +1 -1
  98. package/assets/{index-BTNxDX2G.js → index-NdfBDpoO.js} +1 -1
  99. package/assets/{index-BI9iNAKi.js → index-Xk2toQGa.js} +1 -1
  100. package/assets/{index-BQIH261h.js → index-XzW65SVh.js} +1 -1
  101. package/assets/{index-ChCcNci6.js → index-cWedEEGZ.js} +1 -1
  102. package/assets/{index-CXpxRn3z.js → index-kpX0X-RL.js} +1 -1
  103. package/assets/{index-Dr1f_0US.js → index-m9UlXIqW.js} +1 -1
  104. package/assets/{index-Cd6ChLZW.js → index-xmSB5b1v.js} +1 -1
  105. package/assets/{index-C--hbOLp.css → index-xq0r0dow.css} +1 -1
  106. package/assets/{index-Cvs_N0Ve.js → index-zhHTnO6h.js} +1 -1
  107. package/assets/{index.es-HUt3VpyX.js → index.es-BtrYS_gk.js} +4 -4
  108. package/assets/{index.es-CKLkgDZt.js → index.es-CFwo152a.js} +1 -1
  109. package/assets/{index.es-DGdHHHtp.js → index.es-Cw0Wg8zr.js} +1 -1
  110. package/assets/{localBatchGatewayRequest-iNoZcrHT.js → localBatchGatewayRequest-W5wM5RIw.js} +1 -1
  111. package/assets/{mana-rate-C_Yy03l8.js → mana-rate-D91Nq-wO.js} +1 -1
  112. package/assets/network-ivZE_UMc.js +1 -0
  113. package/assets/{networks-BWmZZyaq.js → networks-DLxu9QYW.js} +1 -1
  114. package/assets/{onramp-QCIxEeo3.js → onramp-DjMFTSAW.js} +1 -1
  115. package/assets/{openzeppelin-xqR8JMTB.js → openzeppelin-2ZkXoMQF.js} +1 -1
  116. package/assets/{ownerOf-B89ptWrA.js → ownerOf-BAgrPslR.js} +1 -1
  117. package/assets/{parseNft-AcTYDuXN.js → parseNft-xmwbSwKx.js} +2 -2
  118. package/assets/{parseSignature-DpYdqsGi.js → parseSignature-DS_qYYXg.js} +3 -3
  119. package/assets/{parseSignature-DBgAZruJ.js → parseSignature-Dfqx4qdB.js} +1 -1
  120. package/assets/{pay-with-exchange-CWJUDtoF.js → pay-with-exchange-BfqKWl-i.js} +1 -1
  121. package/assets/{qr-overlay-DgpsQY2R.js → qr-overlay-CuzJkOyH.js} +1 -1
  122. package/assets/{receive-D1oWMsub.js → receive-BXV5EvIe.js} +1 -1
  123. package/assets/{resolveImplementation-CCmXeJg1.js → resolveImplementation-Cp1kSEV-.js} +1 -1
  124. package/assets/{rpc-BuAzgf8H.js → rpc-Dtax0ZGB.js} +1 -1
  125. package/assets/{secp256k1-DDtV5KEA.js → secp256k1-C95i4S9L.js} +1 -1
  126. package/assets/{secp256k1-Dnfgbr2s.js → secp256k1-D8wYY9C6.js} +1 -1
  127. package/assets/{secp256k1-BPbHjUCl.js → secp256k1-yf38iHjx.js} +1 -1
  128. package/assets/{send-BQ0FuoZ9.js → send-bACcTxXh.js} +1 -1
  129. package/assets/{send-batch-transaction-DyiLluuy.js → send-batch-transaction-vUlQ3f8W.js} +1 -1
  130. package/assets/{send-eip712-transaction-C_eikAWL.js → send-eip712-transaction-BAhg0sSO.js} +2 -2
  131. package/assets/{send-gasless-transaction-D7W_wzMo.js → send-gasless-transaction-Bbc--ckt.js} +2 -2
  132. package/assets/{sendRawTransaction-BSnJUgqM.js → sendRawTransaction-Cn-exoEI.js} +3 -3
  133. package/assets/{serializeTransaction-DKint7z0.js → serializeTransaction-CI3T0WRP.js} +1 -1
  134. package/assets/{session-proposal-D3LluU_8.js → session-proposal-D0XHSqV_.js} +1 -1
  135. package/assets/{session-request-DQlplaEX.js → session-request-BsTTXWj7.js} +2 -2
  136. package/assets/{sha256-bqbJ7V3D.js → sha256-DMkvy9Cz.js} +1 -1
  137. package/assets/{signing-vGxXLj5d.js → signing-DeH43Aaw.js} +4 -4
  138. package/assets/{socials-S8l_pJBo.js → socials-D-IAo2yx.js} +1 -1
  139. package/assets/{swaps-CTxiHwdM.js → swaps-BWMX0U3I.js} +1 -1
  140. package/assets/{thirdweb-utLlPpMo.js → thirdweb-iPhsIfpR.js} +3 -3
  141. package/assets/{totalSupply-B4hRGo3K.js → totalSupply-CSwsdpN_.js} +1 -1
  142. package/assets/{transactionReceipt-C8k8Opcm.js → transactionReceipt-U1NdpKCV.js} +1 -1
  143. package/assets/{transactions-2nmqx5cb.js → transactions-BkfWn19q.js} +1 -1
  144. package/assets/useInfiniteGrid-6pBFQ8Kh.js +1 -0
  145. package/assets/{verifyHash-Bf81sELO.js → verifyHash-C7RY1nlI.js} +1 -1
  146. package/assets/{w3m-modal-8A7Qjg8T.js → w3m-modal-1UZQLvps.js} +1 -1
  147. package/assets/{w3m-modal-CsNCA81W.js → w3m-modal-DMTcXY8g.js} +1 -1
  148. package/assets/{wait-for-tx-receipt-C76Hb5Zh.js → wait-for-tx-receipt-Dy501zTV.js} +1 -1
  149. package/assets/{wallet-kind-D_XdST5P.js → wallet-kind-By432Wm8.js} +1 -1
  150. package/assets/{wallets-D8P40Wbw.js → wallets-DpuodgNe.js} +6 -6
  151. package/assets/{web-connector-CkTchwt2.js → web-connector-C0IKOCFh.js} +3 -3
  152. package/assets/{writeContract-DmDACNNF.js → writeContract-B_fZae2g.js} +1 -1
  153. package/assets/{zoraTestnet-BaDaLVMN.js → zoraTestnet-DBtbozoi.js} +1 -1
  154. package/index.html +8 -8
  155. package/package.json +2 -2
  156. package/assets/Assets-DokepZqK.js +0 -1
  157. package/assets/Cart-m5buv6cO.js +0 -1
  158. package/assets/Collection-CQmLgLU7.js +0 -1
  159. package/assets/Creator-IjVK-CLN.js +0 -1
  160. package/assets/GetCredits-DDBBHPyF.js +0 -2
  161. package/assets/ImportListings-B4ddKo7M.js +0 -1
  162. package/assets/ItemDetail-DpuaTZWb.js +0 -1
  163. package/assets/Market-CmN66hf8.js +0 -1
  164. package/assets/MyAssets-BSfT19rO.js +0 -1
  165. package/assets/MyFavorites-CE_zEiSL.js +0 -1
  166. package/assets/MyPurchases-Dsoq_U6b.js +0 -1
  167. package/assets/decimals-CFPKxJPz.js +0 -1
  168. package/assets/index-BCqi-WJ_.js +0 -2
  169. package/assets/network-3abJoeoe.js +0 -1
@@ -1 +1 @@
1
- import{r as k}from"./index-BV8s6ez1.js";import{az as w}from"./sendRawTransaction-BSnJUgqM.js";import{c as I,e as q}from"./hashTypedData-DK4wFgd9.js";import"./NetworkUtil-DRBYr7tG.js";import"./ethers-BxoDGoYp.js";import"./react-E8ng6RF2.js";import"./index-Cqm_NJEy.js";const v=()=>"9.1.0",C=t=>t.toString(16).padStart(2,"0"),R=t=>{const e=new Uint8Array(t/2);return window.crypto.getRandomValues(e),Array.from(e,C).join("")},E=()=>typeof window<"u"?R(10):new Date().getTime().toString(36);class g{}g.makeRequest=(t,e)=>({id:E(),method:t,params:e,env:{sdkVersion:v()}});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 f;(function(t){t.requestAddressBook="requestAddressBook"})(f||(f={}));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 y=!0;return Array.isArray(this.allowedOrigins)&&(y=this.allowedOrigins.find(P=>P.test(a))!==void 0),!o&&l&&B&&y},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 S=t=>typeof t=="object"&&t!=null&&"domain"in t&&"types"in t&&"message"in t;var m=k();class A{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(!S(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 O{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",V="0x20c13b0b",p=4001;class d extends Error{constructor(e,s,a){super(e),this.code=s,this.data=a,Object.setPrototypeOf(this,d.prototype)}}class _{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",p);try{return(await this.communicator.send(r.wallet_requestPermissions,e)).data}catch{throw new d("Permissions rejected",p)}}isPermissionRequestValid(e){return e.every(s=>typeof s=="object"?Object.keys(s).every(a=>!!Object.values(f).includes(a)):!1)}}const b=(t,e)=>e.some(s=>s.parentCapability===t),M=()=>(t,e,s)=>{const a=s.value;return s.value=async function(){const n=new _(this.communicator);let i=await n.getPermissions();if(b(e,i)||(i=await n.requestPermissions([{[e]:{}}])),!b(e,i))throw new d("Permissions rejected",p);return a.apply(this)},s};var j=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 T{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=w({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=w({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()===V}catch{return!1}}calculateMessageHash(e){return I(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 q({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)}),S(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}}j([M()],T.prototype,"requestAddressBook",null);class W{constructor(e={}){const{allowedDomains:s=null,debug:a=!1}=e;this.communicator=new H(s,a),this.eth=new O(this.communicator),this.txs=new A(this.communicator),this.safe=new T(this.communicator),this.wallet=new _(this.communicator)}}const $=m.Operation,z=m.TokenType,J=m.TransactionStatus,Q=m.TransferDirection;export{g as MessageFormatter,r as Methods,$ as Operation,c as RPC_CALLS,f as RestrictedMethods,z as TokenType,J as TransactionStatus,Q as TransferDirection,W as default,v as getSDKVersion,S as isObjectEIP712TypedData};
1
+ import{r as k}from"./index-BV8s6ez1.js";import{az as w}from"./sendRawTransaction-Cn-exoEI.js";import{c as I,e as q}from"./hashTypedData-D-eX1daT.js";import"./NetworkUtil-DRBYr7tG.js";import"./ethers-BxoDGoYp.js";import"./react-E8ng6RF2.js";import"./index-DDLsPu5_.js";const v=()=>"9.1.0",C=t=>t.toString(16).padStart(2,"0"),R=t=>{const e=new Uint8Array(t/2);return window.crypto.getRandomValues(e),Array.from(e,C).join("")},E=()=>typeof window<"u"?R(10):new Date().getTime().toString(36);class g{}g.makeRequest=(t,e)=>({id:E(),method:t,params:e,env:{sdkVersion:v()}});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 f;(function(t){t.requestAddressBook="requestAddressBook"})(f||(f={}));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 y=!0;return Array.isArray(this.allowedOrigins)&&(y=this.allowedOrigins.find(P=>P.test(a))!==void 0),!o&&l&&B&&y},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 S=t=>typeof t=="object"&&t!=null&&"domain"in t&&"types"in t&&"message"in t;var m=k();class A{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(!S(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 O{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",V="0x20c13b0b",p=4001;class d extends Error{constructor(e,s,a){super(e),this.code=s,this.data=a,Object.setPrototypeOf(this,d.prototype)}}class _{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",p);try{return(await this.communicator.send(r.wallet_requestPermissions,e)).data}catch{throw new d("Permissions rejected",p)}}isPermissionRequestValid(e){return e.every(s=>typeof s=="object"?Object.keys(s).every(a=>!!Object.values(f).includes(a)):!1)}}const b=(t,e)=>e.some(s=>s.parentCapability===t),M=()=>(t,e,s)=>{const a=s.value;return s.value=async function(){const n=new _(this.communicator);let i=await n.getPermissions();if(b(e,i)||(i=await n.requestPermissions([{[e]:{}}])),!b(e,i))throw new d("Permissions rejected",p);return a.apply(this)},s};var j=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 T{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=w({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=w({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()===V}catch{return!1}}calculateMessageHash(e){return I(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 q({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)}),S(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}}j([M()],T.prototype,"requestAddressBook",null);class W{constructor(e={}){const{allowedDomains:s=null,debug:a=!1}=e;this.communicator=new H(s,a),this.eth=new O(this.communicator),this.txs=new A(this.communicator),this.safe=new T(this.communicator),this.wallet=new _(this.communicator)}}const $=m.Operation,z=m.TokenType,J=m.TransactionStatus,Q=m.TransferDirection;export{g as MessageFormatter,r as Methods,$ as Operation,c as RPC_CALLS,f as RestrictedMethods,z as TokenType,J as TransactionStatus,Q as TransferDirection,W as default,v as getSDKVersion,S as isObjectEIP712TypedData};