@dcl/shop 0.1.0-28716682285.commit-81d5035 → 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 (159) hide show
  1. package/assets/{Assets-DZF_BGDq.js → Assets-nmQB2810.js} +1 -1
  2. package/assets/Cart-CVq8ErN4.js +1 -0
  3. package/assets/{Collection-C7QMeo-8.js → Collection-DrWaGsbD.js} +1 -1
  4. package/assets/{Creator-DalHYmPv.js → Creator-CODX4HY-.js} +1 -1
  5. package/assets/{ExchangeController-CR_0ng5W.js → ExchangeController-DGYlS1u1.js} +1 -1
  6. package/assets/GetCredits-BJ-vtPKx.js +2 -0
  7. package/assets/{HelpersUtil-CfV3xayn.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/{Market-Cggj0BCU.js → Market-C5YZkU0k.js} +1 -1
  11. package/assets/MyAssets-DiQ1f-Nx.js +1 -0
  12. package/assets/{MyFavorites-DUAHlk2T.js → MyFavorites-D2neF-WT.js} +1 -1
  13. package/assets/{MyPurchases-DAwS8VjK.js → MyPurchases-CX-sT4T9.js} +1 -1
  14. package/assets/{RealCheckout-BtdQ4wYN.js → RealCheckout-DVYTPQMi.js} +1 -1
  15. package/assets/{Success-CXbDOKvL.js → Success-Dty0MEac.js} +1 -1
  16. package/assets/{SwapController-jQKmoGp2.js → SwapController-CTsLqo0R.js} +1 -1
  17. package/assets/{TradeService-qV7BPpRs.js → TradeService-Co6yXz1n.js} +1 -1
  18. package/assets/{W3MFrameProviderSingleton-DyH4u3WJ.js → W3MFrameProviderSingleton-DBf03HGk.js} +3 -3
  19. package/assets/{WebCryptoP256-DAh3RA9Y.js → WebCryptoP256-BMVi41Tf.js} +1 -1
  20. package/assets/{basic-Xr6dWq86.js → basic-BKlH1yZE.js} +1 -1
  21. package/assets/{biconomy-CkHCPJwz.js → biconomy-BuC8Y20q.js} +1 -1
  22. package/assets/{buy-gasless-CyxaR54s.js → buy-gasless-EwLKJESl.js} +1 -1
  23. package/assets/{buy-BDt3qh_Q.js → buy-qVYsiH8c.js} +1 -1
  24. package/assets/{ccip-xXRTc90o.js → ccip-BXAlyEXK.js} +1 -1
  25. package/assets/{ccip-BQIKnazd.js → ccip-BhXlCEl_.js} +1 -1
  26. package/assets/{collection-x0DaoqN4.js → collection-yK7CsBpq.js} +1 -1
  27. package/assets/{controller-xFYZ2tIS.js → controller-D31V5T7x.js} +2 -2
  28. package/assets/{core-BKZ4YKYj.js → core-HiY9JG8Q.js} +4 -4
  29. package/assets/{custom-DGEuqAtF.js → custom-CNeK1SBe.js} +1 -1
  30. package/assets/{data-capture-DpMm1B-r.js → data-capture-BGCV8f_8.js} +1 -1
  31. package/assets/decimals-690uYbRk.js +1 -0
  32. package/assets/{decimals-9X9HFAfo.js → decimals-eyiqtEAM.js} +1 -1
  33. package/assets/{detectExtension-D_FUQ2kn.js → detectExtension-HGgsLFYa.js} +1 -1
  34. package/assets/{email-8VZFOLCd.js → email-D3mSaTDc.js} +1 -1
  35. package/assets/{embedded-wallet-i0dfZ3jn.js → embedded-wallet-BIpOn63k.js} +1 -1
  36. package/assets/{engine-Cz8a0LUY.js → engine-Cp4bGvGY.js} +1 -1
  37. package/assets/{estimate-l1-fee-CeaPum-g.js → estimate-l1-fee-DqCr-VRj.js} +1 -1
  38. package/assets/{eth_estimateGas-Ch2Qo3Ym.js → eth_estimateGas-Btj3BdU3.js} +1 -1
  39. package/assets/{eth_getStorageAt-D6WJN9sx.js → eth_getStorageAt-cAsXEzwb.js} +1 -1
  40. package/assets/{eth_getTransactionCount-BRWa6Gde.js → eth_getTransactionCount-9mRngMvR.js} +1 -1
  41. package/assets/{extractIPFS-VtWbdMOz.js → extractIPFS-Cos3MMqA.js} +1 -1
  42. package/assets/{features-CkL7kILZ.js → features-CS9ITEyv.js} +1 -1
  43. package/assets/{fetchTokenMetadata-BXmwN0lx.js → fetchTokenMetadata--27nDLvT.js} +2 -2
  44. package/assets/{get-ecosystem-wallet-info-VhSMDJcW.js → get-ecosystem-wallet-info-DsGpr1v9.js} +1 -1
  45. package/assets/{getBalance-CMO7qPbW.js → getBalance-C1EIeWK3.js} +1 -1
  46. package/assets/{getInstalledModules-C8ciIxny.js → getInstalledModules-CSy_anIJ.js} +1 -1
  47. package/assets/{getNFT-BobGZ6K9.js → getNFT-Biv4Mkbw.js} +1 -1
  48. package/assets/{getNFT-CXOP2pMP.js → getNFT-C3k4-I_M.js} +2 -2
  49. package/assets/{hashTypedData-DvxOZf8f.js → hashTypedData-D-eX1daT.js} +1 -1
  50. package/assets/{hashTypedData-BYzWFHY1.js → hashTypedData-DCkFFbNQ.js} +1 -1
  51. package/assets/{import-MraNS_pv.js → import-DjExR-_c.js} +1 -1
  52. package/assets/{in-app-wallet-calls-CSBUm0WX.js → in-app-wallet-calls-BsZ7t_xW.js} +1 -1
  53. package/assets/{index-07l384vR.js → index-0QSHJ5kM.js} +1 -1
  54. package/assets/{index-R06QFYVY.js → index-B-iF1tO2.js} +1 -1
  55. package/assets/{index-PJXSqGcO.js → index-B91_eufC.js} +1 -1
  56. package/assets/{index-DPiqU2Qi.js → index-BBWsjtyi.js} +1 -1
  57. package/assets/{index-CnuiHcBF.js → index-BDnsSs1l.js} +1 -1
  58. package/assets/{index-BLDgd2FN.js → index-BEDCm9Wu.js} +1 -1
  59. package/assets/{index-CVqa84jW.js → index-BP1BUYI1.js} +1 -1
  60. package/assets/{index-Lqy4HRG5.js → index-BSTJA_7O.js} +2 -2
  61. package/assets/{index-BISQjaPy.js → index-BTkTkfcn.js} +1 -1
  62. package/assets/{index-CQjEYJsK.js → index-BbTcdIk0.js} +1 -1
  63. package/assets/{index-DXkd_D0R.js → index-BgPhxGKT.js} +1 -1
  64. package/assets/{index-CeOCXdzw.js → index-BkdaY7_G.js} +3 -3
  65. package/assets/{index-CZGhYHpa.js → index-BnFty3Li.js} +1 -1
  66. package/assets/{index-BVdflf99.js → index-BoJsJx--.js} +1 -1
  67. package/assets/{index-BvM6IpIn.js → index-Brg6cgDQ.js} +1 -1
  68. package/assets/{index-BEs7D61b.js → index-C0nXxFCO.js} +1 -1
  69. package/assets/{index-Bo1wSLQe.js → index-CJEb8Kzs.js} +1 -1
  70. package/assets/{index-C9CXoAJ2.js → index-CLE07-_x.js} +1 -1
  71. package/assets/{index-CsKQpaxl.js → index-CLXqEKlA.js} +1 -1
  72. package/assets/{index-B0b2BDzP.js → index-CLkVyB5o.js} +1 -1
  73. package/assets/{index-BfPP6XcF.js → index-CLy-wBAP.js} +2 -2
  74. package/assets/{index-Bi33Lec8.js → index-CQtzuPXx.js} +1 -1
  75. package/assets/{index-BfbFKF-_.js → index-CWRbefrn.js} +1 -1
  76. package/assets/{index-BOBTvczf.js → index-CWgv2cWv.js} +1 -1
  77. package/assets/{index-XN4xrhWa.js → index-CXiOQLIu.js} +1 -1
  78. package/assets/{index-CT8vHTeA.js → index-CdcrnJ5_.js} +1 -1
  79. package/assets/{index-DD9FbX3n.js → index-Cj7vACZe.js} +1 -1
  80. package/assets/{index-MrzRV9Q8.js → index-Cmk_xiBk.js} +1 -1
  81. package/assets/{index-C62Ww3lh.js → index-CqIROolS.js} +1 -1
  82. package/assets/{index-BTPsPO-G.js → index-CrBV_1yu.js} +1 -1
  83. package/assets/{index-Dxonssii.js → index-CyqLliR_.js} +3 -3
  84. package/assets/{index-C73nwsCH.js → index-D-S19rzI.js} +1 -1
  85. package/assets/{index-CbSQFzfb.js → index-D1cUVAY6.js} +1 -1
  86. package/assets/{index-C6XcSqXs.js → index-D5uLI4BM.js} +1 -1
  87. package/assets/{index-BmYqfzkI.js → index-DDLsPu5_.js} +12 -12
  88. package/assets/{index-CnG74PqV.js → index-DGoPqCsR.js} +1 -1
  89. package/assets/{index-DZoe-51F.js → index-DOExxORl.js} +1 -1
  90. package/assets/{index-Dgb5np7p.js → index-DUVY_38U.js} +1 -1
  91. package/assets/{index-BmNZbfHe.js → index-DccLoKMC.js} +2 -2
  92. package/assets/{index-FroDaHJR.js → index-DgAZv7hc.js} +1 -1
  93. package/assets/{index-B_00Os6M.js → index-DpcKgN-v.js} +1 -1
  94. package/assets/{index-A9JhdvF3.js → index-DquEMs4O.js} +1 -1
  95. package/assets/{index-BAagTwYN.js → index-KarPC4Z4.js} +1 -1
  96. package/assets/{index-Dhf1C0Kj.js → index-NdfBDpoO.js} +1 -1
  97. package/assets/{index-yUE19psb.js → index-Xk2toQGa.js} +1 -1
  98. package/assets/{index-ChQpTYWw.js → index-XzW65SVh.js} +1 -1
  99. package/assets/{index-D9se8tx4.js → index-cWedEEGZ.js} +1 -1
  100. package/assets/{index-CKmLGQME.js → index-kpX0X-RL.js} +1 -1
  101. package/assets/{index--3veqSx1.js → index-m9UlXIqW.js} +1 -1
  102. package/assets/{index-ChHoaBBu.js → index-xmSB5b1v.js} +1 -1
  103. package/assets/{index-CV6GodQX.js → index-zhHTnO6h.js} +1 -1
  104. package/assets/{index.es-Bzum_YS0.js → index.es-BtrYS_gk.js} +4 -4
  105. package/assets/{index.es-C0jq0YX8.js → index.es-CFwo152a.js} +1 -1
  106. package/assets/{index.es-CfPSe5Iz.js → index.es-Cw0Wg8zr.js} +1 -1
  107. package/assets/{localBatchGatewayRequest-BnMlZrXd.js → localBatchGatewayRequest-W5wM5RIw.js} +1 -1
  108. package/assets/{mana-rate-XfDebPT_.js → mana-rate-D91Nq-wO.js} +1 -1
  109. package/assets/network-ivZE_UMc.js +1 -0
  110. package/assets/{networks-DEhdIFNC.js → networks-DLxu9QYW.js} +1 -1
  111. package/assets/{onramp-C3j52sn0.js → onramp-DjMFTSAW.js} +1 -1
  112. package/assets/{openzeppelin-BTTAmnTW.js → openzeppelin-2ZkXoMQF.js} +1 -1
  113. package/assets/{ownerOf-RMAXTCdV.js → ownerOf-BAgrPslR.js} +1 -1
  114. package/assets/{parseNft-VKRkeiLD.js → parseNft-xmwbSwKx.js} +2 -2
  115. package/assets/{parseSignature-D30lji4A.js → parseSignature-DS_qYYXg.js} +3 -3
  116. package/assets/{parseSignature-CGlxNo0q.js → parseSignature-Dfqx4qdB.js} +1 -1
  117. package/assets/{pay-with-exchange-BvYYQIth.js → pay-with-exchange-BfqKWl-i.js} +1 -1
  118. package/assets/{qr-overlay-17TocZNH.js → qr-overlay-CuzJkOyH.js} +1 -1
  119. package/assets/{receive-C68u0-IH.js → receive-BXV5EvIe.js} +1 -1
  120. package/assets/{resolveImplementation-DfcgAZ7i.js → resolveImplementation-Cp1kSEV-.js} +1 -1
  121. package/assets/{rpc-BmefAEZX.js → rpc-Dtax0ZGB.js} +1 -1
  122. package/assets/{secp256k1-BJfT_BJS.js → secp256k1-C95i4S9L.js} +1 -1
  123. package/assets/{secp256k1-BO5hBgBV.js → secp256k1-D8wYY9C6.js} +1 -1
  124. package/assets/{secp256k1-DMHqss-g.js → secp256k1-yf38iHjx.js} +1 -1
  125. package/assets/{send-UIx8SeHj.js → send-bACcTxXh.js} +1 -1
  126. package/assets/{send-batch-transaction-CBhZSE7o.js → send-batch-transaction-vUlQ3f8W.js} +1 -1
  127. package/assets/{send-eip712-transaction-CYSTjMP2.js → send-eip712-transaction-BAhg0sSO.js} +2 -2
  128. package/assets/{send-gasless-transaction-DwC-e3jQ.js → send-gasless-transaction-Bbc--ckt.js} +2 -2
  129. package/assets/{sendRawTransaction-B_tunbjM.js → sendRawTransaction-Cn-exoEI.js} +3 -3
  130. package/assets/{serializeTransaction-DvYsEu0f.js → serializeTransaction-CI3T0WRP.js} +1 -1
  131. package/assets/{session-proposal-D-hIho9_.js → session-proposal-D0XHSqV_.js} +1 -1
  132. package/assets/{session-request-DD56Mdft.js → session-request-BsTTXWj7.js} +2 -2
  133. package/assets/{sha256-D-iwlmab.js → sha256-DMkvy9Cz.js} +1 -1
  134. package/assets/{signing-Cs3KRA5P.js → signing-DeH43Aaw.js} +4 -4
  135. package/assets/{socials-BNBBd15t.js → socials-D-IAo2yx.js} +1 -1
  136. package/assets/{swaps-Cm5YfdSu.js → swaps-BWMX0U3I.js} +1 -1
  137. package/assets/{thirdweb-C9J5fNOj.js → thirdweb-iPhsIfpR.js} +3 -3
  138. package/assets/{totalSupply-C8BmQbty.js → totalSupply-CSwsdpN_.js} +1 -1
  139. package/assets/{transactionReceipt-Bf7wcNWm.js → transactionReceipt-U1NdpKCV.js} +1 -1
  140. package/assets/{transactions-CuXfm9a0.js → transactions-BkfWn19q.js} +1 -1
  141. package/assets/{useInfiniteGrid-BM3TcyEh.js → useInfiniteGrid-6pBFQ8Kh.js} +1 -1
  142. package/assets/{verifyHash-1pRB3CwV.js → verifyHash-C7RY1nlI.js} +1 -1
  143. package/assets/{w3m-modal-Cml_eV0H.js → w3m-modal-1UZQLvps.js} +1 -1
  144. package/assets/{w3m-modal-B1-SYsNz.js → w3m-modal-DMTcXY8g.js} +1 -1
  145. package/assets/{wait-for-tx-receipt-Bd0-eoIT.js → wait-for-tx-receipt-Dy501zTV.js} +1 -1
  146. package/assets/{wallet-kind-Dt8fQXzn.js → wallet-kind-By432Wm8.js} +1 -1
  147. package/assets/{wallets-D8fixhFd.js → wallets-DpuodgNe.js} +6 -6
  148. package/assets/{web-connector-Cr9k7RR3.js → web-connector-C0IKOCFh.js} +3 -3
  149. package/assets/{writeContract-ZNyMwark.js → writeContract-B_fZae2g.js} +1 -1
  150. package/assets/{zoraTestnet-CzFN1G81.js → zoraTestnet-DBtbozoi.js} +1 -1
  151. package/index.html +8 -8
  152. package/package.json +2 -2
  153. package/assets/Cart-4PH7DZlC.js +0 -1
  154. package/assets/GetCredits-BY6Izy9M.js +0 -2
  155. package/assets/ImportListings-CHMxShJz.js +0 -1
  156. package/assets/ItemDetail-C6PGxnP4.js +0 -1
  157. package/assets/MyAssets-BlcOdmvf.js +0 -1
  158. package/assets/decimals-DpVCb2xf.js +0 -1
  159. package/assets/network-flD-kLcV.js +0 -1
@@ -1 +1 @@
1
- import{r as k}from"./index-BV8s6ez1.js";import{az as w}from"./sendRawTransaction-B_tunbjM.js";import{c as I,e as q}from"./hashTypedData-DvxOZf8f.js";import"./NetworkUtil-DRBYr7tG.js";import"./ethers-BxoDGoYp.js";import"./react-E8ng6RF2.js";import"./index-BmYqfzkI.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};