@reown/appkit-cdn 0.0.3
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.
- package/LICENSE +190 -0
- package/dist/W3MFrameProviderSingleton-BpWUndnw.cjs +11014 -0
- package/dist/W3MFrameProviderSingleton-CuVI_88U.js +65026 -0
- package/dist/ethers.cjs +1 -0
- package/dist/ethers.js +17800 -0
- package/dist/hooks.module-BmccViTi.cjs +1 -0
- package/dist/hooks.module-C2zxEs4Z.js +764 -0
- package/dist/index--u0BBJui.js +128 -0
- package/dist/index-B5dlb2GK.cjs +1 -0
- package/dist/index-BGcCLdgU.js +3175 -0
- package/dist/index-BgSdiVHK.cjs +64 -0
- package/dist/index-BzzLy8QO.js +2055 -0
- package/dist/index-CEbNT_sk.cjs +41 -0
- package/dist/index-Cbfs_-YJ.js +254 -0
- package/dist/index-CjczsdX0.js +9034 -0
- package/dist/index-CytFwM4F.cjs +1 -0
- package/dist/index-DIBheNE_.js +250 -0
- package/dist/index-DTZ3zFoi.js +931 -0
- package/dist/index-DoNvH4sY.cjs +1 -0
- package/dist/index-DxKsnlAL.cjs +7 -0
- package/dist/index-_fb0kPJf.js +161 -0
- package/dist/index-e2XnZub2.cjs +1 -0
- package/dist/index-qHZ88Aei.cjs +47 -0
- package/dist/index.es-Dzy36BN7.js +11685 -0
- package/dist/index.es-wptiKBWB.cjs +43 -0
- package/dist/metamask-sdk-CH4ak2WC.cjs +217 -0
- package/dist/metamask-sdk-vSsaK2qA.js +40484 -0
- package/dist/native-DUnMHCku.cjs +1 -0
- package/dist/native-DZv9b0EL.js +16 -0
- package/dist/w3m-modal-Cb8iN1Y9.js +290 -0
- package/dist/w3m-modal-pgEnMCmq.cjs +149 -0
- package/dist/wagmi-Cz2I9r-O.cjs +47 -0
- package/dist/wagmi-Dnkdlm7T.js +26712 -0
- package/dist/wagmi.cjs +1 -0
- package/dist/wagmi.js +9 -0
- package/package.json +38 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const g=require("./W3MFrameProviderSingleton-BpWUndnw.cjs"),G=require("./hooks.module-BmccViTi.cjs");var _t={},ne={},be={};Object.defineProperty(be,"__esModule",{value:!0});be.walletLogo=void 0;const tn=(n,e)=>{let t;switch(n){case"standard":return t=e,`data:image/svg+xml,%3Csvg width='${e}' height='${t}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return t=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return t=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return t=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return t=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return t=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return t=e,`data:image/svg+xml,%3Csvg width='${e}' height='${t}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};be.walletLogo=tn;var ye={},T={},U={};Object.defineProperty(U,"__esModule",{value:!0});U.errorValues=U.standardErrorCodes=void 0;U.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};U.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var we={},Fe={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.serialize=n.getErrorCode=n.isValidCode=n.getMessageFromCode=n.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=U,t="Unspecified error message.";n.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function r(d,f=t){if(d&&Number.isInteger(d)){const b=d.toString();if(h(e.errorValues,b))return e.errorValues[b].message;if(c(d))return n.JSON_RPC_SERVER_ERROR_MESSAGE}return f}n.getMessageFromCode=r;function s(d){if(!Number.isInteger(d))return!1;const f=d.toString();return!!(e.errorValues[f]||c(d))}n.isValidCode=s;function i(d){var f;if(typeof d=="number")return d;if(a(d))return(f=d.code)!==null&&f!==void 0?f:d.errorCode}n.getErrorCode=i;function a(d){return typeof d=="object"&&d!==null&&(typeof d.code=="number"||typeof d.errorCode=="number")}function o(d,{shouldIncludeStack:f=!1}={}){const b={};if(d&&typeof d=="object"&&!Array.isArray(d)&&h(d,"code")&&s(d.code)){const B=d;b.code=B.code,B.message&&typeof B.message=="string"?(b.message=B.message,h(B,"data")&&(b.data=B.data)):(b.message=r(b.code),b.data={originalError:l(d)})}else b.code=e.standardErrorCodes.rpc.internal,b.message=m(d,"message")?d.message:t,b.data={originalError:l(d)};return f&&(b.stack=m(d,"stack")?d.stack:void 0),b}n.serialize=o;function c(d){return d>=-32099&&d<=-32e3}function l(d){return d&&typeof d=="object"&&!Array.isArray(d)?Object.assign({},d):d}function h(d,f){return Object.prototype.hasOwnProperty.call(d,f)}function m(d,f){return typeof d=="object"&&d!==null&&f in d&&typeof d[f]=="string"}})(Fe);Object.defineProperty(we,"__esModule",{value:!0});we.standardErrors=void 0;const _=U,Et=Fe;we.standardErrors={rpc:{parse:n=>k(_.standardErrorCodes.rpc.parse,n),invalidRequest:n=>k(_.standardErrorCodes.rpc.invalidRequest,n),invalidParams:n=>k(_.standardErrorCodes.rpc.invalidParams,n),methodNotFound:n=>k(_.standardErrorCodes.rpc.methodNotFound,n),internal:n=>k(_.standardErrorCodes.rpc.internal,n),server:n=>{if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=n;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return k(e,n)},invalidInput:n=>k(_.standardErrorCodes.rpc.invalidInput,n),resourceNotFound:n=>k(_.standardErrorCodes.rpc.resourceNotFound,n),resourceUnavailable:n=>k(_.standardErrorCodes.rpc.resourceUnavailable,n),transactionRejected:n=>k(_.standardErrorCodes.rpc.transactionRejected,n),methodNotSupported:n=>k(_.standardErrorCodes.rpc.methodNotSupported,n),limitExceeded:n=>k(_.standardErrorCodes.rpc.limitExceeded,n)},provider:{userRejectedRequest:n=>$(_.standardErrorCodes.provider.userRejectedRequest,n),unauthorized:n=>$(_.standardErrorCodes.provider.unauthorized,n),unsupportedMethod:n=>$(_.standardErrorCodes.provider.unsupportedMethod,n),disconnected:n=>$(_.standardErrorCodes.provider.disconnected,n),chainDisconnected:n=>$(_.standardErrorCodes.provider.chainDisconnected,n),unsupportedChain:n=>$(_.standardErrorCodes.provider.unsupportedChain,n),custom:n=>{if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:t,data:r}=n;if(!t||typeof t!="string")throw new Error('"message" must be a nonempty string');return new kt(e,t,r)}}};function k(n,e){const[t,r]=St(e);return new Ct(n,t||(0,Et.getMessageFromCode)(n),r)}function $(n,e){const[t,r]=St(e);return new kt(n,t||(0,Et.getMessageFromCode)(n),r)}function St(n){if(n){if(typeof n=="string")return[n];if(typeof n=="object"&&!Array.isArray(n)){const{message:e,data:t}=n;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,t]}}return[]}class Ct extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||typeof t!="string")throw new Error('"message" must be a nonempty string.');super(t),this.code=e,r!==void 0&&(this.data=r)}}class kt extends Ct{constructor(e,t,r){if(!nn(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function nn(n){return Number.isInteger(n)&&n>=1e3&&n<=4999}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.standardErrors=n.standardErrorCodes=void 0;var e=U;Object.defineProperty(n,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});var t=we;Object.defineProperty(n,"standardErrors",{enumerable:!0,get:function(){return t.standardErrors}})})(T);var ve={},X={};Object.defineProperty(X,"__esModule",{value:!0});X.isErrorResponse=void 0;function rn(n){return n.errorMessage!==void 0}X.isErrorResponse=rn;var K={};Object.defineProperty(K,"__esModule",{value:!0});K.LIB_VERSION=void 0;K.LIB_VERSION="4.0.4";Object.defineProperty(ve,"__esModule",{value:!0});ve.serializeError=void 0;const sn=X,an=K,on=U,cn=Fe;function dn(n,e){const t=(0,cn.serialize)(ln(n),{shouldIncludeStack:!0}),r=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");r.searchParams.set("version",an.LIB_VERSION),r.searchParams.set("code",t.code.toString());const s=un(t.data,e);return s&&r.searchParams.set("method",s),r.searchParams.set("message",t.message),Object.assign(Object.assign({},t),{docUrl:r.href})}ve.serializeError=dn;function ln(n){return typeof n=="string"?{message:n,code:on.standardErrorCodes.rpc.internal}:(0,sn.isErrorResponse)(n)?Object.assign(Object.assign({},n),{message:n.errorMessage,code:n.errorCode,data:{method:n.method}}):n}function un(n,e){const t=n==null?void 0:n.method;if(t)return t;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}var E={};Object.defineProperty(E,"__esModule",{value:!0});E.RegExpString=E.IntNumber=E.BigIntString=E.AddressString=E.HexString=E.OpaqueType=void 0;function re(){return n=>n}E.OpaqueType=re;E.HexString=re();E.AddressString=re();E.BigIntString=re();function hn(n){return Math.floor(n)}E.IntNumber=hn;E.RegExpString=re();var u={};Object.defineProperty(u,"__esModule",{value:!0});u.areAddressArraysEqual=u.getFavicon=u.range=u.isBigNumber=u.ensureParsedJSONObject=u.ensureBigInt=u.ensureRegExpString=u.ensureIntNumber=u.ensureBuffer=u.ensureAddressString=u.ensureEvenLengthHexString=u.ensureHexString=u.isHexString=u.prepend0x=u.strip0x=u.has0xPrefix=u.hexStringFromIntNumber=u.intNumberFromHexString=u.bigIntStringFromBigInt=u.hexStringFromBuffer=u.hexStringToUint8Array=u.uint8ArrayToHex=u.randomBytesHex=void 0;const q=T,M=E,It=/^[0-9]*$/,Mt=/^[a-f0-9]*$/;function gn(n){return Lt(crypto.getRandomValues(new Uint8Array(n)))}u.randomBytesHex=gn;function Lt(n){return[...n].map(e=>e.toString(16).padStart(2,"0")).join("")}u.uint8ArrayToHex=Lt;function pn(n){return new Uint8Array(n.match(/.{1,2}/g).map(e=>parseInt(e,16)))}u.hexStringToUint8Array=pn;function fn(n,e=!1){const t=n.toString("hex");return(0,M.HexString)(e?`0x${t}`:t)}u.hexStringFromBuffer=fn;function mn(n){return(0,M.BigIntString)(n.toString(10))}u.bigIntStringFromBigInt=mn;function bn(n){return(0,M.IntNumber)(Number(BigInt(ie(n,!0))))}u.intNumberFromHexString=bn;function yn(n){return(0,M.HexString)(`0x${BigInt(n).toString(16)}`)}u.hexStringFromIntNumber=yn;function Ve(n){return n.startsWith("0x")||n.startsWith("0X")}u.has0xPrefix=Ve;function _e(n){return Ve(n)?n.slice(2):n}u.strip0x=_e;function At(n){return Ve(n)?`0x${n.slice(2)}`:`0x${n}`}u.prepend0x=At;function se(n){if(typeof n!="string")return!1;const e=_e(n).toLowerCase();return Mt.test(e)}u.isHexString=se;function Rt(n,e=!1){if(typeof n=="string"){const t=_e(n).toLowerCase();if(Mt.test(t))return(0,M.HexString)(e?`0x${t}`:t)}throw q.standardErrors.rpc.invalidParams(`"${String(n)}" is not a hexadecimal string`)}u.ensureHexString=Rt;function ie(n,e=!1){let t=Rt(n,!1);return t.length%2===1&&(t=(0,M.HexString)(`0${t}`)),e?(0,M.HexString)(`0x${t}`):t}u.ensureEvenLengthHexString=ie;function wn(n){if(typeof n=="string"){const e=_e(n).toLowerCase();if(se(e)&&e.length===40)return(0,M.AddressString)(At(e))}throw q.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(n)}`)}u.ensureAddressString=wn;function vn(n){if(g.Buffer.isBuffer(n))return n;if(typeof n=="string"){if(se(n)){const e=ie(n,!1);return g.Buffer.from(e,"hex")}return g.Buffer.from(n,"utf8")}throw q.standardErrors.rpc.invalidParams(`Not binary data: ${String(n)}`)}u.ensureBuffer=vn;function xt(n){if(typeof n=="number"&&Number.isInteger(n))return(0,M.IntNumber)(n);if(typeof n=="string"){if(It.test(n))return(0,M.IntNumber)(Number(n));if(se(n))return(0,M.IntNumber)(Number(BigInt(ie(n,!0))))}throw q.standardErrors.rpc.invalidParams(`Not an integer: ${String(n)}`)}u.ensureIntNumber=xt;function _n(n){if(n instanceof RegExp)return(0,M.RegExpString)(n.toString());throw q.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(n)}`)}u.ensureRegExpString=_n;function En(n){if(n!==null&&(typeof n=="bigint"||Pt(n)))return BigInt(n.toString(10));if(typeof n=="number")return BigInt(xt(n));if(typeof n=="string"){if(It.test(n))return BigInt(n);if(se(n))return BigInt(ie(n,!0))}throw q.standardErrors.rpc.invalidParams(`Not an integer: ${String(n)}`)}u.ensureBigInt=En;function Sn(n){if(typeof n=="string")return JSON.parse(n);if(typeof n=="object")return n;throw q.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(n)}`)}u.ensureParsedJSONObject=Sn;function Pt(n){if(n==null||typeof n.constructor!="function")return!1;const{constructor:e}=n;return typeof e.config=="function"&&typeof e.EUCLID=="number"}u.isBigNumber=Pt;function Cn(n,e){return Array.from({length:e-n},(t,r)=>n+r)}u.range=Cn;function kn(){const n=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:t}=document.location,r=n?n.getAttribute("href"):null;return!r||r.startsWith("javascript:")||r.startsWith("vbscript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?e+r:`${e}//${t}${r}`}u.getFavicon=kn;function In(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}u.areAddressArraysEqual=In;var P={},Ee={},Se={},w={};Object.defineProperty(w,"__esModule",{value:!0});w.decryptContent=w.encryptContent=w.importKeyFromHexString=w.exportKeyToHexString=w.decrypt=w.encrypt=w.deriveSharedSecret=w.generateKeyPair=void 0;const Nt=u;async function Mn(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}w.generateKeyPair=Mn;async function Ln(n,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},n,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}w.deriveSharedSecret=Ln;async function jt(n,e){const t=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:t},n,new TextEncoder().encode(e));return{iv:t,cipherText:r}}w.encrypt=jt;async function Tt(n,{iv:e,cipherText:t}){const r=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},n,t);return new TextDecoder().decode(r)}w.decrypt=Tt;function Ot(n){switch(n){case"public":return"spki";case"private":return"pkcs8"}}async function An(n,e){const t=Ot(n),r=await crypto.subtle.exportKey(t,e);return(0,Nt.uint8ArrayToHex)(new Uint8Array(r))}w.exportKeyToHexString=An;async function Rn(n,e){const t=Ot(n),r=(0,Nt.hexStringToUint8Array)(e).buffer;return await crypto.subtle.importKey(t,r,{name:"ECDH",namedCurve:"P-256"},!0,n==="private"?["deriveKey"]:[])}w.importKeyFromHexString=Rn;async function xn(n,e){const t=JSON.stringify(n,(r,s)=>{if(!(s instanceof Error))return s;const i=s;return Object.assign(Object.assign({},i.code?{code:i.code}:{}),{message:i.message})});return jt(e,t)}w.encryptContent=xn;async function Pn(n,e){return JSON.parse(await Tt(e,n))}w.decryptContent=Pn;var O={};Object.defineProperty(O,"__esModule",{value:!0});O.ScopedLocalStorage=void 0;class me{constructor(e,t){this.scope=e,this.module=t}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),t=[];for(let r=0;r<localStorage.length;r++){const s=localStorage.key(r);typeof s=="string"&&s.startsWith(e)&&t.push(s)}t.forEach(r=>localStorage.removeItem(r))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new me("CBWSDK").clear(),new me("walletlink").clear()}}O.ScopedLocalStorage=me;Object.defineProperty(Se,"__esModule",{value:!0});Se.SCWKeyManager=void 0;const ce=w,Nn=O,We={storageKey:"ownPrivateKey",keyType:"private"},Ue={storageKey:"ownPublicKey",keyType:"public"},Be={storageKey:"peerPublicKey",keyType:"public"};class jn{constructor(){this.storage=new Nn.ScopedLocalStorage("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(Be,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(Ue.storageKey),this.storage.removeItem(We.storageKey),this.storage.removeItem(Be.storageKey)}async generateKeyPair(){const e=await(0,ce.generateKeyPair)();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(We,e.privateKey),await this.storeKey(Ue,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(We)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(Ue)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(Be)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await(0,ce.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const t=this.storage.getItem(e.storageKey);return t?(0,ce.importKeyFromHexString)(e.keyType,t):null}async storeKey(e,t){const r=await(0,ce.exportKeyToHexString)(e.keyType,t);this.storage.setItem(e.storageKey,r)}}Se.SCWKeyManager=jn;var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.SCWStateManager=void 0;const Tn=O,Xe="accounts",et="activeChain",tt="availableChains",nt="walletCapabilities";class On{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(e){var t,r;this.storage=new Tn.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=e.updateListener,this.availableChains=this.loadItemFromStorage(tt),this._walletCapabilities=this.loadItemFromStorage(nt);const s=this.loadItemFromStorage(Xe),i=this.loadItemFromStorage(et);s&&this.updateListener.onAccountsUpdate({accounts:s,source:"storage"}),i&&this.updateListener.onChainUpdate({chain:i,source:"storage"}),this._accounts=s||[],this._activeChain=i||{id:(r=(t=e.appChainIds)===null||t===void 0?void 0:t[0])!==null&&r!==void 0?r:1}}updateAccounts(e){this._accounts=e,this.storeItemToStorage(Xe,e),this.updateListener.onAccountsUpdate({accounts:e,source:"wallet"})}switchChain(e){var t;const r=(t=this.availableChains)===null||t===void 0?void 0:t.find(s=>s.id===e);return r?(r===this._activeChain||(this._activeChain=r,this.storeItemToStorage(et,r),this.updateListener.onChainUpdate({chain:r,source:"wallet"})),!0):!1}updateAvailableChains(e){if(!e||Object.keys(e).length===0)return;const t=Object.entries(e).map(([r,s])=>({id:Number(r),rpcUrl:s}));this.availableChains=t,this.storeItemToStorage(tt,t),this.switchChain(this._activeChain.id)}updateWalletCapabilities(e){this._walletCapabilities=e,this.storeItemToStorage(nt,e)}storeItemToStorage(e,t){this.storage.setItem(e,JSON.stringify(t))}loadItemFromStorage(e){const t=this.storage.getItem(e);return t?JSON.parse(t):void 0}clear(){this.storage.clear()}}Ce.SCWStateManager=On;Object.defineProperty(Ee,"__esModule",{value:!0});Ee.SCWSigner=void 0;const Dn=Se,Wn=Ce,de=T,rt=u,le=w;class Un{constructor(e){this.metadata=e.metadata,this.communicator=e.communicator,this.keyManager=new Dn.SCWKeyManager,this.stateManager=new Wn.SCWStateManager({appChainIds:this.metadata.appChainIds,updateListener:e.updateListener}),this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(){const e=await this.createRequestMessage({handshake:{method:"eth_requestAccounts",params:this.metadata}}),t=await this.communicator.postRequestAndWaitForResponse(e);if("failure"in t.content)throw t.content.failure;const r=await(0,le.importKeyFromHexString)("public",t.sender);await this.keyManager.setPeerPublicKey(r);const s=await this.decryptResponseMessage(t);this.updateInternalState({method:"eth_requestAccounts"},s);const i=s.result;if("error"in i)throw i.error;return this.stateManager.accounts}async request(e){const t=this.tryLocalHandling(e);if(t!==void 0){if(t instanceof Error)throw t;return t}await this.communicator.waitForPopupLoaded();const r=await this.sendEncryptedRequest(e),s=await this.decryptResponseMessage(r);this.updateInternalState(e,s);const i=s.result;if("error"in i)throw i.error;return i.value}async disconnect(){this.stateManager.clear(),await this.keyManager.clear()}tryLocalHandling(e){var t;switch(e.method){case"wallet_switchEthereumChain":{const r=e.params;if(!r||!(!((t=r[0])===null||t===void 0)&&t.chainId))throw de.standardErrors.rpc.invalidParams();const s=(0,rt.ensureIntNumber)(r[0].chainId);return this.stateManager.switchChain(s)?null:void 0}case"wallet_getCapabilities":{const r=this.stateManager.walletCapabilities;if(!r)throw de.standardErrors.provider.unauthorized("No wallet capabilities found, please disconnect and reconnect");return r}default:return}}async sendEncryptedRequest(e){const t=await this.keyManager.getSharedSecret();if(!t)throw de.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");const r=await(0,le.encryptContent)({action:e,chainId:this.stateManager.activeChain.id},t),s=await this.createRequestMessage({encrypted:r});return this.communicator.postRequestAndWaitForResponse(s)}async createRequestMessage(e){const t=await(0,le.exportKeyToHexString)("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:t,content:e,timestamp:new Date}}async decryptResponseMessage(e){const t=e.content;if("failure"in t)throw t.failure;const r=await this.keyManager.getSharedSecret();if(!r)throw de.standardErrors.provider.unauthorized("Invalid session");return(0,le.decryptContent)(t.encrypted,r)}updateInternalState(e,t){var r,s;const i=(r=t.data)===null||r===void 0?void 0:r.chains;i&&this.stateManager.updateAvailableChains(i);const a=(s=t.data)===null||s===void 0?void 0:s.capabilities;a&&this.stateManager.updateWalletCapabilities(a);const o=t.result;if(!("error"in o))switch(e.method){case"eth_requestAccounts":{const c=o.value;this.stateManager.updateAccounts(c);break}case"wallet_switchEthereumChain":{if(o.value!==null)return;const c=e.params,l=(0,rt.ensureIntNumber)(c[0].chainId);this.stateManager.switchChain(l);break}}}}Ee.SCWSigner=Un;var ke={};const Bn=G.js;function Dt(n){return g.Buffer.allocUnsafe(n).fill(0)}function Hn(n){return n.toString(2).length}function Wt(n,e){let t=n.toString(16);t.length%2!==0&&(t="0"+t);const r=t.match(/.{1,2}/g).map(s=>parseInt(s,16));for(;r.length<e;)r.unshift(0);return g.Buffer.from(r)}function Kn(n,e){const t=n<0n;let r;if(t){const s=(1n<<BigInt(e))-1n;r=(~n&s)+1n}else r=n;return r&=(1n<<BigInt(e))-1n,r}function Ut(n,e,t){const r=Dt(e);return n=Ie(n),t?n.length<e?(n.copy(r),r):n.slice(0,e):n.length<e?(n.copy(r,e-n.length),r):n.slice(-e)}function qn(n,e){return Ut(n,e,!0)}function Ie(n){if(!g.Buffer.isBuffer(n))if(Array.isArray(n))n=g.Buffer.from(n);else if(typeof n=="string")Bt(n)?n=g.Buffer.from(Vn(Ht(n)),"hex"):n=g.Buffer.from(n);else if(typeof n=="number")n=intToBuffer(n);else if(n==null)n=g.Buffer.allocUnsafe(0);else if(typeof n=="bigint")n=Wt(n);else if(n.toArray)n=g.Buffer.from(n.toArray());else throw new Error("invalid type");return n}function $n(n){return n=Ie(n),"0x"+n.toString("hex")}function Fn(n,e){return n=Ie(n),e||(e=256),Bn("keccak"+e).update(n).digest()}function Vn(n){return n.length%2?"0"+n:n}function Bt(n){return typeof n=="string"&&n.match(/^0x[0-9A-Fa-f]*$/)}function Ht(n){return typeof n=="string"&&n.startsWith("0x")?n.slice(2):n}var Kt={zeros:Dt,setLength:Ut,setLengthRight:qn,isHexString:Bt,stripHexPrefix:Ht,toBuffer:Ie,bufferToHex:$n,keccak:Fn,bitLengthFromBigInt:Hn,bufferBEFromBigInt:Wt,twosFromBigInt:Kn};const S=Kt;function qt(n){return n.startsWith("int[")?"int256"+n.slice(3):n==="int"?"int256":n.startsWith("uint[")?"uint256"+n.slice(4):n==="uint"?"uint256":n.startsWith("fixed[")?"fixed128x128"+n.slice(5):n==="fixed"?"fixed128x128":n.startsWith("ufixed[")?"ufixed128x128"+n.slice(6):n==="ufixed"?"ufixed128x128":n}function Y(n){return parseInt(/^\D+(\d+)$/.exec(n)[1],10)}function st(n){var e=/^\D+(\d+)x(\d+)$/.exec(n);return[parseInt(e[1],10),parseInt(e[2],10)]}function $t(n){var e=n.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function H(n){var e=typeof n;if(e==="string"||e==="number")return BigInt(n);if(e==="bigint")return n;throw new Error("Argument is not a number")}function R(n,e){var t,r,s,i;if(n==="address")return R("uint160",H(e));if(n==="bool")return R("uint8",e?1:0);if(n==="string")return R("bytes",new g.Buffer(e,"utf8"));if(Zn(n)){if(typeof e.length>"u")throw new Error("Not an array?");if(t=$t(n),t!=="dynamic"&&t!==0&&e.length>t)throw new Error("Elements exceed array size: "+t);s=[],n=n.slice(0,n.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(i in e)s.push(R(n,e[i]));if(t==="dynamic"){var a=R("uint256",e.length);s.unshift(a)}return g.Buffer.concat(s)}else{if(n==="bytes")return e=new g.Buffer(e),s=g.Buffer.concat([R("uint256",e.length),e]),e.length%32!==0&&(s=g.Buffer.concat([s,S.zeros(32-e.length%32)])),s;if(n.startsWith("bytes")){if(t=Y(n),t<1||t>32)throw new Error("Invalid bytes<N> width: "+t);return S.setLengthRight(e,32)}else if(n.startsWith("uint")){if(t=Y(n),t%8||t<8||t>256)throw new Error("Invalid uint<N> width: "+t);r=H(e);const o=S.bitLengthFromBigInt(r);if(o>t)throw new Error("Supplied uint exceeds width: "+t+" vs "+o);if(r<0)throw new Error("Supplied uint is negative");return S.bufferBEFromBigInt(r,32)}else if(n.startsWith("int")){if(t=Y(n),t%8||t<8||t>256)throw new Error("Invalid int<N> width: "+t);r=H(e);const o=S.bitLengthFromBigInt(r);if(o>t)throw new Error("Supplied int exceeds width: "+t+" vs "+o);const c=S.twosFromBigInt(r,256);return S.bufferBEFromBigInt(c,32)}else if(n.startsWith("ufixed")){if(t=st(n),r=H(e),r<0)throw new Error("Supplied ufixed is negative");return R("uint256",r*BigInt(2)**BigInt(t[1]))}else if(n.startsWith("fixed"))return t=st(n),R("int256",H(e)*BigInt(2)**BigInt(t[1]))}throw new Error("Unsupported or invalid type: "+n)}function zn(n){return n==="string"||n==="bytes"||$t(n)==="dynamic"}function Zn(n){return n.lastIndexOf("]")===n.length-1}function Gn(n,e){var t=[],r=[],s=32*n.length;for(var i in n){var a=qt(n[i]),o=e[i],c=R(a,o);zn(a)?(t.push(R("uint256",s)),r.push(c),s+=c.length):t.push(c)}return g.Buffer.concat(t.concat(r))}function Ft(n,e){if(n.length!==e.length)throw new Error("Number of types are not matching the values");for(var t,r,s=[],i=0;i<n.length;i++){var a=qt(n[i]),o=e[i];if(a==="bytes")s.push(o);else if(a==="string")s.push(new g.Buffer(o,"utf8"));else if(a==="bool")s.push(new g.Buffer(o?"01":"00","hex"));else if(a==="address")s.push(S.setLength(o,20));else if(a.startsWith("bytes")){if(t=Y(a),t<1||t>32)throw new Error("Invalid bytes<N> width: "+t);s.push(S.setLengthRight(o,t))}else if(a.startsWith("uint")){if(t=Y(a),t%8||t<8||t>256)throw new Error("Invalid uint<N> width: "+t);r=H(o);const c=S.bitLengthFromBigInt(r);if(c>t)throw new Error("Supplied uint exceeds width: "+t+" vs "+c);s.push(S.bufferBEFromBigInt(r,t/8))}else if(a.startsWith("int")){if(t=Y(a),t%8||t<8||t>256)throw new Error("Invalid int<N> width: "+t);r=H(o);const c=S.bitLengthFromBigInt(r);if(c>t)throw new Error("Supplied int exceeds width: "+t+" vs "+c);const l=S.twosFromBigInt(r,t);s.push(S.bufferBEFromBigInt(l,t/8))}else throw new Error("Unsupported or invalid type: "+a)}return g.Buffer.concat(s)}function Yn(n,e){return S.keccak(Ft(n,e))}var Jn={rawEncode:Gn,solidityPack:Ft,soliditySHA3:Yn};const A=Kt,te=Jn,Vt={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},He={encodeData(n,e,t,r=!0){const s=["bytes32"],i=[this.hashType(n,t)];if(r){const a=(o,c,l)=>{if(t[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":A.keccak(this.encodeData(c,l,t,r))];if(l===void 0)throw new Error(`missing value for field ${o} of type ${c}`);if(c==="bytes")return["bytes32",A.keccak(l)];if(c==="string")return typeof l=="string"&&(l=g.Buffer.from(l,"utf8")),["bytes32",A.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const h=c.slice(0,c.lastIndexOf("[")),m=l.map(d=>a(o,h,d));return["bytes32",A.keccak(te.rawEncode(m.map(([d])=>d),m.map(([,d])=>d)))]}return[c,l]};for(const o of t[n]){const[c,l]=a(o.name,o.type,e[o.name]);s.push(c),i.push(l)}}else for(const a of t[n]){let o=e[a.name];if(o!==void 0)if(a.type==="bytes")s.push("bytes32"),o=A.keccak(o),i.push(o);else if(a.type==="string")s.push("bytes32"),typeof o=="string"&&(o=g.Buffer.from(o,"utf8")),o=A.keccak(o),i.push(o);else if(t[a.type]!==void 0)s.push("bytes32"),o=A.keccak(this.encodeData(a.type,o,t,r)),i.push(o);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(a.type),i.push(o)}}return te.rawEncode(s,i)},encodeType(n,e){let t="",r=this.findTypeDependencies(n,e).filter(s=>s!==n);r=[n].concat(r.sort());for(const s of r){if(!e[s])throw new Error("No type definition specified: "+s);t+=s+"("+e[s].map(({name:a,type:o})=>o+" "+a).join(",")+")"}return t},findTypeDependencies(n,e,t=[]){if(n=n.match(/^\w*/)[0],t.includes(n)||e[n]===void 0)return t;t.push(n);for(const r of e[n])for(const s of this.findTypeDependencies(r.type,e,t))!t.includes(s)&&t.push(s);return t},hashStruct(n,e,t,r=!0){return A.keccak(this.encodeData(n,e,t,r))},hashType(n,e){return A.keccak(this.encodeType(n,e))},sanitizeData(n){const e={};for(const t in Vt.properties)n[t]&&(e[t]=n[t]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(n,e=!0){const t=this.sanitizeData(n),r=[g.Buffer.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",t.domain,t.types,e)),t.primaryType!=="EIP712Domain"&&r.push(this.hashStruct(t.primaryType,t.message,t.types,e)),A.keccak(g.Buffer.concat(r))}};var Qn={TYPED_MESSAGE_SCHEMA:Vt,TypedDataUtils:He,hashForSignTypedDataLegacy:function(n){return Xn(n.data)},hashForSignTypedData_v3:function(n){return He.hash(n.data,!1)},hashForSignTypedData_v4:function(n){return He.hash(n.data)}};function Xn(n){const e=new Error("Expect argument to be non-empty array");if(typeof n!="object"||!n.length)throw e;const t=n.map(function(i){return i.type==="bytes"?A.toBuffer(i.value):i.value}),r=n.map(function(i){return i.type}),s=n.map(function(i){if(!i.name)throw e;return i.type+" "+i.name});return te.soliditySHA3(["bytes32","bytes32"],[te.soliditySHA3(new Array(n.length).fill("string"),s),te.soliditySHA3(r,t)])}var N={};Object.defineProperty(N,"__esModule",{value:!0});N.APP_VERSION_KEY=N.LOCAL_STORAGE_ADDRESSES_KEY=N.WALLET_USER_NAME_KEY=void 0;N.WALLET_USER_NAME_KEY="walletUsername";N.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";N.APP_VERSION_KEY="AppVersion";var ae={};Object.defineProperty(ae,"__esModule",{value:!0});ae.RelayEventManager=void 0;const er=u;class tr{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,t=(0,er.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}ae.RelayEventManager=tr;var Me={},Le={},Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.WalletLinkCipher=void 0;const ue=u;class nr{constructor(e){this.secret=e}async encrypt(e){const t=this.secret;if(t.length!==64)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,ue.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},s,i.encode(e)),o=16,c=a.slice(a.byteLength-o),l=a.slice(0,a.byteLength-o),h=new Uint8Array(c),m=new Uint8Array(l),d=new Uint8Array([...r,...h,...m]);return(0,ue.uint8ArrayToHex)(d)}async decrypt(e){const t=this.secret;if(t.length!==64)throw Error("secret must be 256 bits");return new Promise((r,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,ue.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,ue.hexStringToUint8Array)(e),o=a.slice(0,12),c=a.slice(12,28),l=a.slice(28),h=new Uint8Array([...l,...c]),m={name:"AES-GCM",iv:new Uint8Array(o)};try{const d=await window.crypto.subtle.decrypt(m,i,h),f=new TextDecoder;r(f.decode(d))}catch(d){s(d)}})()})}}Ae.WalletLinkCipher=nr;var Re={};Object.defineProperty(Re,"__esModule",{value:!0});Re.WalletLinkHTTP=void 0;class rr{constructor(e,t,r){this.linkAPIUrl=e,this.sessionId=t;const s=`${t}:${r}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(t=>fetch(`${this.linkAPIUrl}/events/${t.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(t=>console.error("Unabled to mark event as failed:",t))}async fetchUnseenEvents(){var e;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:r,error:s}=await t.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(e=r==null?void 0:r.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${t.status}`)}}Re.WalletLinkHTTP=rr;var J={};Object.defineProperty(J,"__esModule",{value:!0});J.WalletLinkWebSocket=J.ConnectionState=void 0;var Z;(function(n){n[n.DISCONNECTED=0]="DISCONNECTED",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED"})(Z||(J.ConnectionState=Z={}));class sr{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,t)=>{var r;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){t(i);return}(r=this.connectionStateListener)===null||r===void 0||r.call(this,Z.CONNECTING),s.onclose=i=>{var a;this.clearWebSocket(),t(new Error(`websocket error ${i.code}: ${i.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Z.DISCONNECTED)},s.onopen=i=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Z.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},s.onmessage=i=>{var a,o;if(i.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(i.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,c)}catch{}}})}disconnect(){var e;const{webSocket:t}=this;if(t){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,Z.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch{}}}sendData(e){const{webSocket:t}=this;if(!t){this.pendingData.push(e),this.connect();return}t.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}J.WalletLinkWebSocket=sr;Object.defineProperty(Le,"__esModule",{value:!0});Le.WalletLinkConnection=void 0;const it=N,ir=Ae,ar=Re,he=J,F=E,at=1e4,or=6e4;class cr{constructor({session:e,linkAPIUrl:t,listener:r,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,F.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",c=>a.JsonRpcUrl&&this.handleChainUpdated(c,a.JsonRpcUrl)]]).forEach((c,l)=>{const h=a[l];h!==void 0&&c(h)})},this.handleDestroyed=a=>{var o;a==="1"&&((o=this.listener)===null||o===void 0||o.resetAndReload())},this.handleAccountUpdated=async a=>{var o;{const c=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.accountUpdated(c)}},this.handleMetadataUpdated=async(a,o)=>{var c;{const l=await this.cipher.decrypt(o);(c=this.listener)===null||c===void 0||c.metadataUpdated(a,l)}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(it.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(it.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,o)=>{var c;{const l=await this.cipher.decrypt(a),h=await this.cipher.decrypt(o);(c=this.listener)===null||c===void 0||c.chainUpdated(l,h)}},this.session=e,this.cipher=new ir.WalletLinkCipher(e.secret),this.listener=r;const i=new he.WalletLinkWebSocket(`${t}/rpc`,s);i.setConnectionStateListener(async a=>{let o=!1;switch(a){case he.ConnectionState.DISCONNECTED:if(!this.destroyed){const c=async()=>{await new Promise(l=>setTimeout(l,5e3)),this.destroyed||i.connect().catch(()=>{c()})};c()}break;case he.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),o=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},at),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case he.ConnectionState.CONNECTING:break}this.connected!==o&&(this.connected=o)}),i.setIncomingDataListener(a=>{var o;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const c=a.type==="IsLinkedOK"?a.linked:void 0;this.linked=c||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((o=this.requestResolutions.get(a.id))===null||o===void 0||o(a))}),this.ws=i,this.http=new ar.WalletLinkHTTP(t,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}destroy(){this.destroyed=!0,this.ws.disconnect(),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var t;this._connected=e,e&&((t=this.onceConnected)===null||t===void 0||t.call(this))}setOnceConnected(e){return new Promise(t=>{this.connected?e().then(t):this.onceConnected=()=>{e().then(t),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var t,r;this._linked=e,e&&((t=this.onceLinked)===null||t===void 0||t.call(this)),(r=this.listener)===null||r===void 0||r.linkedUpdated(e)}setOnceLinked(e){return new Promise(t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}})}async handleIncomingEvent(e){var t;if(!(e.type!=="Event"||e.event!=="Web3Response")){const r=await this.cipher.decrypt(e.data),s=JSON.parse(r);if(s.type!=="WEB3_RESPONSE")return;(t=this.listener)===null||t===void 0||t.handleWeb3ResponseMessage(s)}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(t=>this.handleIncomingEvent(t))}async setSessionMetadata(e,t){const r={type:"SetSessionConfig",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:t}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(r);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(e,t,r=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:s,callWebhook:r};return this.setOnceLinked(async()=>{const a=await this.makeRequest(i);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>at*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,t=or){const r=e.id;this.sendData(e);let s;return Promise.race([new Promise((i,a)=>{s=window.setTimeout(()=>{a(new Error(`request ${r} timed out`))},t)}),new Promise(i=>{this.requestResolutions.set(r,a=>{clearTimeout(s),i(a),this.requestResolutions.delete(r)})})])}async authenticate(){const e={type:"HostSession",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},t=await this.makeRequest(e);if(t.type==="Fail")throw new Error(t.error||"failed to authenticate")}sendIsLinked(){const e={type:"IsLinked",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}Le.WalletLinkConnection=cr;var xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.WalletLinkSession=void 0;const dr=g.sha_jsExports,ot=u,ct="session:id",dt="session:secret",lt="session:linked";class ze{constructor(e,t,r,s){this._storage=e,this._id=t||(0,ot.randomBytesHex)(16),this._secret=r||(0,ot.randomBytesHex)(32),this._key=new dr.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(e){const t=e.getItem(ct),r=e.getItem(lt),s=e.getItem(dt);return t&&s?new ze(e,t,s,r==="1"):null}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(ct,this._id),this._storage.setItem(dt,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(lt,this._linked?"1":"0")}}xe.WalletLinkSession=ze;var C={};Object.defineProperty(C,"__esModule",{value:!0});C.isDarkMode=C.isMobileWeb=C.getLocation=C.createQrUrl=void 0;function lr(n,e,t,r,s,i){const a=r?"parent-id":"id",o=new URLSearchParams({[a]:n,secret:e,server:t,v:s,chainId:i.toString()}).toString();return`${t}/#/link?${o}`}C.createQrUrl=lr;function ur(){try{return window.frameElement!==null}catch{return!1}}function hr(){try{return ur()&&window.top?window.top.location:window.location}catch{return window.location}}C.getLocation=hr;function gr(){var n;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((n=window==null?void 0:window.navigator)===null||n===void 0?void 0:n.userAgent)}C.isMobileWeb=gr;function pr(){var n,e;return(e=(n=window==null?void 0:window.matchMedia)===null||n===void 0?void 0:n.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}C.isDarkMode=pr;var Pe={},oe={},Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var fr=g.commonjsGlobal&&g.commonjsGlobal.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(oe,"__esModule",{value:!0});oe.injectCssReset=void 0;const mr=fr(Ze);function br(){const n=document.createElement("style");n.type="text/css",n.appendChild(document.createTextNode(mr.default)),document.documentElement.appendChild(n)}oe.injectCssReset=br;var Ge={},Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(n){var e=g.commonjsGlobal&&g.commonjsGlobal.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(n,"__esModule",{value:!0}),n.SnackbarInstance=n.SnackbarContainer=n.Snackbar=void 0;const t=e(G.require$$0),r=G.require$$1,s=G.require$$2,i=C,a=e(Ye),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class l{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=(0,i.isDarkMode)()}attach(f){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",f.appendChild(this.root),this.render()}presentItem(f){const b=this.nextItemKey++;return this.items.set(b,f),this.render(),()=>{this.items.delete(b),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,r.render)((0,r.h)("div",null,(0,r.h)(n.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([f,b])=>(0,r.h)(n.SnackbarInstance,Object.assign({},b,{key:f}))))),this.root)}}n.Snackbar=l;const h=d=>(0,r.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-container")},(0,r.h)("style",null,a.default),(0,r.h)("div",{class:"-cbwsdk-snackbar"},d.children));n.SnackbarContainer=h;const m=({autoExpand:d,message:f,menuItems:b})=>{const[B,Qt]=(0,s.useState)(!0),[De,Qe]=(0,s.useState)(d??!1);(0,s.useEffect)(()=>{const L=[window.setTimeout(()=>{Qt(!1)},1),window.setTimeout(()=>{Qe(!0)},1e4)];return()=>{L.forEach(window.clearTimeout)}});const Xt=()=>{Qe(!De)};return(0,r.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-instance",B&&"-cbwsdk-snackbar-instance-hidden",De&&"-cbwsdk-snackbar-instance-expanded")},(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:Xt},(0,r.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},f),(0,r.h)("div",{class:"-gear-container"},!De&&(0,r.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,r.h)("img",{src:c,class:"-gear-icon",title:"Expand"}))),b&&b.length>0&&(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},b.map((L,en)=>(0,r.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-instance-menu-item",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:L.onClick,key:en},(0,r.h)("svg",{width:L.svgWidth,height:L.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("path",{"fill-rule":L.defaultFillRule,"clip-rule":L.defaultClipRule,d:L.path,fill:"#AAAAAA"})),(0,r.h)("span",{class:(0,t.default)("-cbwsdk-snackbar-instance-menu-item-info",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},L.info)))))};n.SnackbarInstance=m})(Ge);Object.defineProperty(Pe,"__esModule",{value:!0});Pe.WalletLinkRelayUI=void 0;const yr=oe,wr=Ge;class vr{constructor(){this.attached=!1,this.snackbar=new wr.Snackbar}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.snackbar.attach(t),this.attached=!0,(0,yr.injectCssReset)()}showConnecting(e){let t;return e.isUnlinkedErrorState?t={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:t={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}}Pe.WalletLinkRelayUI=vr;var Ne={},je={},Je={};Object.defineProperty(Je,"__esModule",{value:!0});Je.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var zt=g.commonjsGlobal&&g.commonjsGlobal.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(je,"__esModule",{value:!0});je.RedirectDialog=void 0;const _r=zt(G.require$$0),x=G.require$$1,Er=oe,Sr=Ge,Cr=C,kr=zt(Je);class Ir{constructor(){this.root=null,this.darkMode=(0,Cr.isDarkMode)()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,Er.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,x.render)(null,this.root),e&&(0,x.render)((0,x.h)(Mr,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}je.RedirectDialog=Ir;const Mr=({title:n,buttonText:e,darkMode:t,onButtonClick:r,onDismiss:s})=>{const i=t?"dark":"light";return(0,x.h)(Sr.SnackbarContainer,{darkMode:t},(0,x.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,x.h)("style",null,kr.default),(0,x.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,x.h)("div",{class:(0,_r.default)("-cbwsdk-redirect-dialog-box",i)},(0,x.h)("p",null,n),(0,x.h)("button",{onClick:r},e))))};var j={};Object.defineProperty(j,"__esModule",{value:!0});j.CBW_MOBILE_DEEPLINK_URL=j.WALLETLINK_URL=j.CB_KEYS_URL=void 0;j.CB_KEYS_URL="https://keys.coinbase.com/connect";j.WALLETLINK_URL="https://www.walletlink.org";j.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.WLMobileRelayUI=void 0;const Lr=je,Ar=C,Rr=j;class xr{constructor(){this.attached=!1,this.redirectDialog=new Lr.RedirectDialog}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const t=new URL(Rr.CBW_MOBILE_DEEPLINK_URL);t.searchParams.append("redirect_url",(0,Ar.getLocation)().href),e&&t.searchParams.append("wl_url",e);const r=document.createElement("a");r.target="cbw-opener",r.href=t.href,r.rel="noreferrer noopener",r.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}Ne.WLMobileRelayUI=xr;Object.defineProperty(Me,"__esModule",{value:!0});Me.WalletLinkRelay=void 0;const Pr=Le,Nr=N,jr=ae,Ke=xe,V=X,Tr=C,Or=Pe,ut=Ne,Dr=T,y=u,Wr=O;class W{constructor(e){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,Tr.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=i=>{this.isLinked=i;const a=this.storage.getItem(Nr.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this._session.linked=i),this.isUnlinkedErrorState=!1,a){const o=a.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!i&&this._session.linked&&!c&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(i,a)=>{this.storage.setItem(i,a)},this.chainUpdated=(i,a)=>{this.chainCallbackParams.chainId===i&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:i,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(i,a))},this.accountUpdated=i=>{this.accountsCallback&&this.accountsCallback([i]),W.accountRequestCallbackIds.size>0&&(Array.from(W.accountRequestCallbackIds.values()).forEach(a=>{const o={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[i]}};this.invokeCallback(Object.assign(Object.assign({},o),{id:a}))}),W.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage;const{session:t,ui:r,connection:s}=this.subscribe();this._session=t,this.connection=s,this.relayEventManager=new jr.RelayEventManager,this.ui=r}subscribe(){const e=Ke.WalletLinkSession.load(this.storage)||new Ke.WalletLinkSession(this.storage).save(),{linkAPIUrl:t}=this,r=new Pr.WalletLinkConnection({session:e,linkAPIUrl:t,listener:this}),s=this.isMobileWeb?new ut.WLMobileRelayUI:new Or.WalletLinkRelayUI;return r.connect(),{session:e,ui:s,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{this.connection.destroy();const e=Ke.WalletLinkSession.load(this.storage);(e==null?void 0:e.id)===this._session.id&&Wr.ScopedLocalStorage.clearAll(),document.location.reload()}).catch(e=>{})}setAppInfo(e,t){this.appName=e,this.appLogoUrl=t}getStorageItem(e){return this.storage.getItem(e)}setStorageItem(e,t){this.storage.setItem(e,t)}signEthereumMessage(e,t,r,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,y.hexStringFromBuffer)(e,!0),address:t,addPrefix:r,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(e,t,r){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,y.hexStringFromBuffer)(e,!0),signature:(0,y.hexStringFromBuffer)(t,!0),addPrefix:r}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,y.bigIntStringFromBigInt)(e.weiValue),data:(0,y.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,y.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,y.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,y.bigIntStringFromBigInt)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,y.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,y.bigIntStringFromBigInt)(e.weiValue),data:(0,y.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,y.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,y.bigIntStringFromBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,y.bigIntStringFromBigInt)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,y.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,y.hexStringFromBuffer)(e,!0),chainId:t}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getWalletLinkSession(){return this._session}genericRequest(e,t){return this.sendRequest({method:"generic",params:{action:t,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let t=null;const r=(0,y.randomBytesHex)(8),s=i=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,i),t==null||t()};return new Promise((i,a)=>{t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(r,o=>{if(t==null||t(),(0,V.isErrorResponse)(o))return a(new Error(o.errorMessage));i(o)}),this.publishWeb3RequestEvent(r,e)})}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e}publishWeb3RequestEvent(e,t){const r={type:"WEB3_REQUEST",id:e,request:t};this.publishEvent("Web3Request",r,!0).then(s=>{}).catch(s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r.id,response:{method:t.method,errorMessage:s.message}})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(t.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof ut.WLMobileRelayUI)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const t={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",t,!1).then()}publishEvent(e,t,r){return this.connection.publishEvent(e,t,r)}handleWeb3ResponseMessage(e){const{response:t}=e;if(t.method==="requestEthereumAccounts"){W.accountRequestCallbackIds.forEach(r=>this.invokeCallback(Object.assign(Object.assign({},e),{id:r}))),W.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,t,r){var s;const i=(s=r==null?void 0:r.message)!==null&&s!==void 0?s:"Unspecified error message.";this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:t,errorMessage:i}})}invokeCallback(e){const t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},t=(0,y.randomBytesHex)(8);return new Promise((r,s)=>{this.relayEventManager.callbacks.set(t,i=>{if((0,V.isErrorResponse)(i))return s(new Error(i.errorMessage));r(i)}),W.accountRequestCallbackIds.add(t),this.publishWeb3RequestEvent(t,e)})}watchAsset(e,t,r,s,i,a){const o={method:"watchAsset",params:{type:e,options:{address:t,symbol:r,decimals:s,image:i},chainId:a}};let c=null;const l=(0,y.randomBytesHex)(8),h=m=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,o.method,m),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload}),new Promise((m,d)=>{this.relayEventManager.callbacks.set(l,f=>{if(c==null||c(),(0,V.isErrorResponse)(f))return d(new Error(f.errorMessage));m(f)}),this.publishWeb3RequestEvent(l,o)})}addEthereumChain(e,t,r,s,i,a){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:s,chainName:i,iconUrls:r,nativeCurrency:a}};let c=null;const l=(0,y.randomBytesHex)(8),h=m=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,o.method,m),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload}),new Promise((m,d)=>{this.relayEventManager.callbacks.set(l,f=>{if(c==null||c(),(0,V.isErrorResponse)(f))return d(new Error(f.errorMessage));m(f)}),this.publishWeb3RequestEvent(l,o)})}switchEthereumChain(e,t){const r={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})},s=(0,y.randomBytesHex)(8);return new Promise((i,a)=>{this.relayEventManager.callbacks.set(s,o=>{if((0,V.isErrorResponse)(o)&&o.errorCode)return a(Dr.standardErrors.provider.custom({code:o.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,V.isErrorResponse)(o))return a(new Error(o.errorMessage));i(o)}),this.publishWeb3RequestEvent(s,r)})}}Me.WalletLinkRelay=W;W.accountRequestCallbackIds=new Set;var Ur=g.commonjsGlobal&&g.commonjsGlobal.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ke,"__esModule",{value:!0});ke.WalletLinkSigner=void 0;const qe=Ur(Qn),ht=N,Br=ae,D=X,Hr=Me,gt=j,v=T,p=u,Kr=O,$e="DefaultChainId",pt="DefaultJsonRpcUrl";class qr{constructor(e){var t,r;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;const{appName:s,appLogoUrl:i}=e.metadata;this._appName=s,this._appLogoUrl=i,this._storage=new Kr.ScopedLocalStorage("walletlink",gt.WALLETLINK_URL),this.updateListener=e.updateListener,this._relayEventManager=new Br.RelayEventManager,this._jsonRpcUrlFromOpts="";const a=this._storage.getItem(ht.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const c=a.split(" ");c[0]!==""&&(this._addresses=c.map(l=>(0,p.ensureAddressString)(l)),(t=this.updateListener)===null||t===void 0||t.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem($e)&&((r=this.updateListener)===null||r===void 0||r.onChainUpdate({chain:{id:this.getChainId(),rpcUrl:this.jsonRpcUrl},source:"storage"}),this.hasMadeFirstChainChangedEmission=!0),this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:t,secret:r}=e.getWalletLinkSession();return{id:t,secret:r}}async handshake(){return await this.request({method:"eth_requestAccounts"})}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(pt))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(pt,e)}updateProviderInfo(e,t){var r;this.jsonRpcUrl=e;const s=this.getChainId();this._storage.setItem($e,t.toString(10)),((0,p.ensureIntNumber)(t)!==s||!this.hasMadeFirstChainChangedEmission)&&((r=this.updateListener)===null||r===void 0||r.onChainUpdate({chain:{id:t,rpcUrl:e},source:"wallet"}),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,t,r,s,i,a){const c=await this.initializeRelay().watchAsset(e,t,r,s,i,a==null?void 0:a.toString());return(0,D.isErrorResponse)(c)?!1:!!c.result}async addEthereumChain(e,t,r,s,i,a){var o,c;if((0,p.ensureIntNumber)(e)===this.getChainId())return!1;const l=this.initializeRelay();this._isAuthorized()||await l.requestEthereumAccounts();const h=await l.addEthereumChain(e.toString(),t,i,r,s,a);return(0,D.isErrorResponse)(h)?!1:(((o=h.result)===null||o===void 0?void 0:o.isApproved)===!0&&this.updateProviderInfo(t[0],e),((c=h.result)===null||c===void 0?void 0:c.isApproved)===!0)}async switchEthereumChain(e){const r=await this.initializeRelay().switchEthereumChain(e.toString(10),this.selectedAddress||void 0);if((0,D.isErrorResponse)(r)){if(!r.errorCode)return;throw r.errorCode===v.standardErrorCodes.provider.unsupportedChain?v.standardErrors.provider.unsupportedChain():v.standardErrors.provider.custom({message:r.errorMessage,code:r.errorCode})}const s=r.result;s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,e)}async disconnect(){this._relay&&this._relay.resetAndReload(),this._storage.clear()}async request(e){try{return this._request(e).catch(t=>{throw t})}catch(t){return Promise.reject(t)}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw v.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:t,params:r}=e;if(typeof t!="string"||t.length===0)throw v.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))throw v.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const s=r===void 0?[]:r,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:t,params:s,jsonrpc:"2.0",id:i})).result}_setAddresses(e,t){var r;if(!Array.isArray(e))throw new Error("addresses is not an array");const s=e.map(i=>(0,p.ensureAddressString)(i));JSON.stringify(s)!==JSON.stringify(this._addresses)&&(this._addresses=s,(r=this.updateListener)===null||r===void 0||r.onAccountsUpdate({accounts:s,source:"wallet"}),this._storage.setItem(ht.LOCAL_STORAGE_ADDRESSES_KEY,s.join(" ")))}_sendRequestAsync(e){return new Promise((t,r)=>{try{const s=this._handleSynchronousMethods(e);if(s!==void 0)return t({jsonrpc:"2.0",id:e.id,result:s})}catch(s){return r(s)}this._handleAsynchronousMethods(e).then(s=>s&&t(Object.assign(Object.assign({},s),{id:e.id}))).catch(s=>r(s))})}_handleSynchronousMethods(e){const{method:t}=e;switch(t){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:t}=e,r=e.params||[];switch(t){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(r);case"eth_ecRecover":return this._eth_ecRecover(r);case"personal_sign":return this._personal_sign(r);case"personal_ecRecover":return this._personal_ecRecover(r);case"eth_signTransaction":return this._eth_signTransaction(r);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(r);case"eth_sendTransaction":return this._eth_sendTransaction(r);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(r);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(r);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(r);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(r);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(r);case"wallet_watchAsset":return this._wallet_watchAsset(r);default:return this._throwUnsupportedMethodError()}}_isKnownAddress(e){try{const t=(0,p.ensureAddressString)(e);return this._addresses.map(s=>(0,p.ensureAddressString)(s)).includes(t)}catch{}return!1}_ensureKnownAddress(e){if(!this._isKnownAddress(e))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const t=e.from?(0,p.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(t);const r=e.to?(0,p.ensureAddressString)(e.to):null,s=e.value!=null?(0,p.ensureBigInt)(e.value):BigInt(0),i=e.data?(0,p.ensureBuffer)(e.data):g.Buffer.alloc(0),a=e.nonce!=null?(0,p.ensureIntNumber)(e.nonce):null,o=e.gasPrice!=null?(0,p.ensureBigInt)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,p.ensureBigInt)(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?(0,p.ensureBigInt)(e.maxPriorityFeePerGas):null,h=e.gas!=null?(0,p.ensureBigInt)(e.gas):null,m=e.chainId?(0,p.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:t,toAddress:r,weiValue:s,data:i,nonce:a,gasPriceInWei:o,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLimit:h,chainId:m}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw v.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw v.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,t,r,s){this._ensureKnownAddress(t);try{const a=await this.initializeRelay().signEthereumMessage(e,t,r,s);if((0,D.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(i){throw typeof i.message=="string"&&i.message.match(/(denied|rejected)/i)?v.standardErrors.provider.userRejectedRequest("User denied message signature"):i}}async _ethereumAddressFromSignedMessage(e,t,r){const i=await this.initializeRelay().ethereumAddressFromSignedMessage(e,t,r);if((0,D.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,p.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem($e);if(!e)return(0,p.ensureIntNumber)(1);const t=parseInt(e,10);return(0,p.ensureIntNumber)(t)}async _eth_requestAccounts(){if(this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{if(e=await this.initializeRelay().requestEthereumAccounts(),(0,D.isErrorResponse)(e))throw new Error(e.errorMessage)}catch(t){throw typeof t.message=="string"&&t.message.match(/(denied|rejected)/i)?v.standardErrors.provider.userRejectedRequest("User denied account authorization"):t}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const t=(0,p.ensureAddressString)(e[0]),r=(0,p.ensureBuffer)(e[1]);return this._signEthereumMessage(r,t,!1)}_eth_ecRecover(e){const t=(0,p.ensureBuffer)(e[0]),r=(0,p.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!1)}_personal_sign(e){this._requireAuthorization();const t=(0,p.ensureBuffer)(e[0]),r=(0,p.ensureAddressString)(e[1]);return this._signEthereumMessage(t,r,!0)}_personal_ecRecover(e){const t=(0,p.ensureBuffer)(e[0]),r=(0,p.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!0)}async _eth_signTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const s=await this.initializeRelay().signEthereumTransaction(t);if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?v.standardErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_sendRawTransaction(e){const t=(0,p.ensureBuffer)(e[0]),s=await this.initializeRelay().submitEthereumTransaction(t,this.getChainId());if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}async _eth_sendTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const s=await this.initializeRelay().signAndSubmitEthereumTransaction(t);if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?v.standardErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_signTypedData_v1(e){this._requireAuthorization();const t=(0,p.ensureParsedJSONObject)(e[0]),r=(0,p.ensureAddressString)(e[1]);this._ensureKnownAddress(r);const s=qe.default.hashForSignTypedDataLegacy({data:t}),i=JSON.stringify(t,null,2);return this._signEthereumMessage(s,r,!1,i)}async _eth_signTypedData_v3(e){this._requireAuthorization();const t=(0,p.ensureAddressString)(e[0]),r=(0,p.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const s=qe.default.hashForSignTypedData_v3({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(s,t,!1,i)}async _eth_signTypedData_v4(e){this._requireAuthorization();const t=(0,p.ensureAddressString)(e[0]),r=(0,p.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const s=qe.default.hashForSignTypedData_v4({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(s,t,!1,i)}async _wallet_addEthereumChain(e){var t,r,s,i;const a=e[0];if(((t=a.rpcUrls)===null||t===void 0?void 0:t.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw v.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw v.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const o=parseInt(a.chainId,16);return await this.addEthereumChain(o,(r=a.rpcUrls)!==null&&r!==void 0?r:[],(s=a.blockExplorerUrls)!==null&&s!==void 0?s:[],a.chainName,(i=a.iconUrls)!==null&&i!==void 0?i:[],a.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const t=e[0];return await this.switchEthereumChain(parseInt(t.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const t=Array.isArray(e)?e[0]:e;if(!t.type)throw v.standardErrors.rpc.invalidParams("Type is required");if((t==null?void 0:t.type)!=="ERC20")throw v.standardErrors.rpc.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(t!=null&&t.options))throw v.standardErrors.rpc.invalidParams("Options are required");if(!(t!=null&&t.options.address))throw v.standardErrors.rpc.invalidParams("Address is required");const r=this.getChainId(),{address:s,symbol:i,image:a,decimals:o}=t.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(t.type,s,i,o,a,r)}}initializeRelay(){if(!this._relay){const e=new Hr.WalletLinkRelay({linkAPIUrl:gt.WALLETLINK_URL,storage:this._storage});e.setAppInfo(this._appName,this._appLogoUrl),e.attachUI(),e.setAccountsCallback((t,r)=>this._setAddresses(t,r)),e.setChainCallback((t,r)=>{this.updateProviderInfo(r,parseInt(t,10))}),this._relay=e}return this._relay}}ke.WalletLinkSigner=qr;var I={};Object.defineProperty(I,"__esModule",{value:!0});I.checkErrorForInvalidRequestArgs=I.getCoinbaseInjectedProvider=I.getCoinbaseInjectedSigner=I.fetchRPCRequest=void 0;const $r=K,fe=T;async function Fr(n,e){if(!e.rpcUrl)throw fe.standardErrors.rpc.internal("No RPC URL set for chain");const t=Object.assign(Object.assign({},n),{jsonrpc:"2.0",id:crypto.randomUUID()});return(await(await window.fetch(e.rpcUrl,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":$r.LIB_VERSION}})).json()).result}I.fetchRPCRequest=Fr;function Zt(){return globalThis.coinbaseWalletSigner}I.getCoinbaseInjectedSigner=Zt;function Vr(){return globalThis.coinbaseWalletExtension}function zr(){var n,e;try{const t=globalThis;return(n=t.ethereum)!==null&&n!==void 0?n:(e=t.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function Zr({metadata:n,preference:e}){var t;if(e.options!=="smartWalletOnly"){if(Zt())return;const i=Vr();if(i){const{appName:a,appLogoUrl:o,appChainIds:c}=n;return(t=i.setAppInfo)===null||t===void 0||t.call(i,a,o,c),i}}const r=zr();if(r!=null&&r.isCoinbaseBrowser)return r}I.getCoinbaseInjectedProvider=Zr;function Gr(n){if(!n||typeof n!="object"||Array.isArray(n))return fe.standardErrors.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:n});const{method:e,params:t}=n;if(typeof e!="string"||e.length===0)return fe.standardErrors.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:n});if(t!==void 0&&!Array.isArray(t)&&(typeof t!="object"||t===null))return fe.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:n})}I.checkErrorForInvalidRequestArgs=Gr;Object.defineProperty(P,"__esModule",{value:!0});P.createSigner=P.fetchSignerType=P.storeSignerType=P.loadSignerType=void 0;const Yr=Ee,Gt=ke,Jr=T,Qr=I,Xr=O,Yt="SignerType",Jt=new Xr.ScopedLocalStorage("CBWSDK","SignerConfigurator");function es(){return Jt.getItem(Yt)}P.loadSignerType=es;function ts(n){Jt.setItem(Yt,n)}P.storeSignerType=ts;async function ns(n){const{communicator:e,metadata:t}=n;ss(e,t).catch(()=>{});const r={id:crypto.randomUUID(),event:"selectSignerType",data:n.preference},{data:s}=await e.postRequestAndWaitForResponse(r);return s}P.fetchSignerType=ns;function rs(n){const{signerType:e,metadata:t,communicator:r,updateListener:s}=n;switch(e){case"scw":return new Yr.SCWSigner({metadata:t,updateListener:s,communicator:r});case"walletlink":return new Gt.WalletLinkSigner({metadata:t,updateListener:s});case"extension":{const i=(0,Qr.getCoinbaseInjectedSigner)();if(!i)throw Jr.standardErrors.rpc.internal("injected signer not found");return i}}}P.createSigner=rs;async function ss(n,e){await n.onMessage(({event:r})=>r==="WalletLinkSessionRequest");const t=new Gt.WalletLinkSigner({metadata:e});n.postMessage({event:"WalletLinkUpdate",data:{session:t.getSession()}}),await t.handshake(),n.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}var Te={},Q={};Object.defineProperty(Q,"__esModule",{value:!0});Q.closePopup=Q.openPopup=void 0;const is=T,ft=420,mt=540;function as(n){const e=(window.innerWidth-ft)/2+window.screenX,t=(window.innerHeight-mt)/2+window.screenY,r=window.open(n,"Smart Wallet",`width=${ft}, height=${mt}, left=${e}, top=${t}`);if(r==null||r.focus(),!r)throw is.standardErrors.rpc.internal("Pop up window failed to open");return r}Q.openPopup=as;function os(n){n&&!n.closed&&n.close()}Q.closePopup=os;Object.defineProperty(Te,"__esModule",{value:!0});Te.Communicator=void 0;const cs=K,bt=Q,ds=j,yt=T;class ls{constructor(e=ds.CB_KEYS_URL){this.popup=null,this.listeners=new Map,this.postMessage=async t=>{(await this.waitForPopupLoaded()).postMessage(t,this.url.origin)},this.postRequestAndWaitForResponse=async t=>{const r=this.onMessage(({requestId:s})=>s===t.id);return this.postMessage(t),await r},this.onMessage=async t=>new Promise((r,s)=>{const i=a=>{if(a.origin!==this.url.origin)return;const o=a.data;t(o)&&(r(o),window.removeEventListener("message",i),this.listeners.delete(i))};window.addEventListener("message",i),this.listeners.set(i,{reject:s})}),this.disconnect=()=>{(0,bt.closePopup)(this.popup),this.popup=null,this.listeners.forEach(({reject:t},r)=>{t(yt.standardErrors.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",r)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=(0,bt.openPopup)(this.url),this.onMessage(({event:t})=>t==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:t})=>t==="PopupLoaded").then(t=>{this.postMessage({requestId:t.id,data:{version:cs.LIB_VERSION}})}).then(()=>{if(!this.popup)throw yt.standardErrors.rpc.internal();return this.popup})),this.url=new URL(e)}}Te.Communicator=ls;var Oe={};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.determineMethodCategory=void 0;const wt={handshake:["eth_requestAccounts"],sign:["eth_ecRecover","personal_sign","personal_ecRecover","eth_signTransaction","eth_sendTransaction","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTypedData","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus"],state:["eth_chainId","eth_accounts","eth_coinbase","net_version"],deprecated:["eth_sign","eth_signTypedData_v2"],unsupported:["eth_subscribe","eth_unsubscribe"],fetch:[]};function us(n){for(const e in wt){const t=e;if(wt[t].includes(n))return t}}Oe.determineMethodCategory=us;var hs=g.commonjsGlobal&&g.commonjsGlobal.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t},gs=g.commonjsGlobal&&g.commonjsGlobal.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ye,"__esModule",{value:!0});ye.CoinbaseWalletProvider=void 0;const ps=gs(g.eventemitter3Exports),z=T,fs=ve,ge=E,ee=u,pe=P,vt=I,ms=Te,bs=Oe,ys=O;class ws extends ps.default{constructor(e){var t,r,{metadata:s}=e,i=e.preference,{keysUrl:a}=i,o=hs(i,["keysUrl"]);super(),this.accounts=[],this.handlers={handshake:async l=>{try{if(this.connected)return this.emit("connect",{chainId:(0,ee.hexStringFromIntNumber)((0,ge.IntNumber)(this.chain.id))}),this.accounts;const h=await this.requestSignerSelection(),m=this.initSigner(h),d=await m.handshake();return this.signer=m,(0,pe.storeSignerType)(h),this.emit("connect",{chainId:(0,ee.hexStringFromIntNumber)((0,ge.IntNumber)(this.chain.id))}),d}catch(h){throw this.handleUnauthorizedError(h),h}},sign:async l=>{if(!this.connected||!this.signer)throw z.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");try{return await this.signer.request(l)}catch(h){throw this.handleUnauthorizedError(h),h}},fetch:l=>(0,vt.fetchRPCRequest)(l,this.chain),state:l=>{const h=()=>{if(this.connected)return this.accounts;throw z.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(l.method){case"eth_chainId":return(0,ee.hexStringFromIntNumber)((0,ge.IntNumber)(this.chain.id));case"net_version":return this.chain.id;case"eth_accounts":return h();case"eth_coinbase":return h()[0];default:return this.handlers.unsupported(l)}},deprecated:({method:l})=>{throw z.standardErrors.rpc.methodNotSupported(`Method ${l} is deprecated.`)},unsupported:({method:l})=>{throw z.standardErrors.rpc.methodNotSupported(`Method ${l} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:l,source:h})=>{(0,ee.areAddressArraysEqual)(this.accounts,l)||(this.accounts=l,h!=="storage"&&this.emit("accountsChanged",this.accounts))},onChainUpdate:({chain:l,source:h})=>{l.id===this.chain.id&&l.rpcUrl===this.chain.rpcUrl||(this.chain=l,h!=="storage"&&this.emit("chainChanged",(0,ee.hexStringFromIntNumber)((0,ge.IntNumber)(l.id))))}},this.metadata=s,this.preference=o,this.communicator=new ms.Communicator(a),this.chain={id:(r=(t=s.appChainIds)===null||t===void 0?void 0:t[0])!==null&&r!==void 0?r:1};const c=(0,pe.loadSignerType)();this.signer=c?this.initSigner(c):null}get connected(){return this.accounts.length>0}async request(e){var t;try{const r=(0,vt.checkErrorForInvalidRequestArgs)(e);if(r)throw r;const s=(t=(0,bs.determineMethodCategory)(e.method))!==null&&t!==void 0?t:"fetch";return this.handlers[s](e)}catch(r){return Promise.reject((0,fs.serializeError)(r,e.method))}}handleUnauthorizedError(e){e.code===z.standardErrorCodes.provider.unauthorized&&this.disconnect()}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){this.accounts=[],this.chain={id:1},ys.ScopedLocalStorage.clearAll(),this.emit("disconnect",z.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,pe.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(e){return(0,pe.createSigner)({signerType:e,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}}ye.CoinbaseWalletProvider=ws;Object.defineProperty(ne,"__esModule",{value:!0});ne.CoinbaseWalletSDK=void 0;const vs=be,_s=ye,Es=O,Ss=K,Cs=u,ks=I;class Is{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||(0,Cs.getFavicon)(),appChainIds:e.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(e={options:"all"}){var t;const r={metadata:this.metadata,preference:e};return(t=(0,ks.getCoinbaseInjectedProvider)(r))!==null&&t!==void 0?t:new _s.CoinbaseWalletProvider(r)}getCoinbaseWalletLogo(e,t=240){return(0,vs.walletLogo)(e,t)}storeLatestVersion(){new Es.ScopedLocalStorage("CBWSDK").setItem("VERSION",Ss.LIB_VERSION)}}ne.CoinbaseWalletSDK=Is;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CoinbaseWalletSDK=void 0;const e=ne;n.default=e.CoinbaseWalletSDK;var t=ne;Object.defineProperty(n,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return t.CoinbaseWalletSDK}})})(_t);const Ms=g.getDefaultExportFromCjs(_t),Ls=Object.freeze(Object.defineProperty({__proto__:null,default:Ms},Symbol.toStringTag,{value:"Module"}));exports.index=Ls;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { p as x, n as A, o as v, r as E, O as C, m as l, q as T, t as m, u as y, v as _, w as b, x as u, y as d, i as g, z as S, D as I, M as O, R as N } from "./W3MFrameProviderSingleton-CuVI_88U.js";
|
|
2
|
+
import { J as P, Y as z, G as D } from "./W3MFrameProviderSingleton-CuVI_88U.js";
|
|
3
|
+
const s = x({
|
|
4
|
+
status: "uninitialized"
|
|
5
|
+
}), p = {
|
|
6
|
+
state: s,
|
|
7
|
+
subscribeKey(t, e) {
|
|
8
|
+
return A(s, t, e);
|
|
9
|
+
},
|
|
10
|
+
subscribe(t) {
|
|
11
|
+
return v(s, () => t(s));
|
|
12
|
+
},
|
|
13
|
+
_getClient() {
|
|
14
|
+
if (!s._client)
|
|
15
|
+
throw new Error("SIWEController client not set");
|
|
16
|
+
return s._client;
|
|
17
|
+
},
|
|
18
|
+
async getNonce(t) {
|
|
19
|
+
const n = await this._getClient().getNonce(t);
|
|
20
|
+
return this.setNonce(n), n;
|
|
21
|
+
},
|
|
22
|
+
async getSession() {
|
|
23
|
+
try {
|
|
24
|
+
const e = await this._getClient().getSession();
|
|
25
|
+
return e && (this.setSession(e), this.setStatus("success")), e;
|
|
26
|
+
} catch {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
createMessage(t) {
|
|
31
|
+
const n = this._getClient().createMessage(t);
|
|
32
|
+
return this.setMessage(n), n;
|
|
33
|
+
},
|
|
34
|
+
async verifyMessage(t) {
|
|
35
|
+
return await this._getClient().verifyMessage(t);
|
|
36
|
+
},
|
|
37
|
+
async signIn() {
|
|
38
|
+
return await this._getClient().signIn();
|
|
39
|
+
},
|
|
40
|
+
async signOut() {
|
|
41
|
+
var e;
|
|
42
|
+
const t = this._getClient();
|
|
43
|
+
await t.signOut(), this.setStatus("ready"), this.setSession(void 0), (e = t.onSignOut) == null || e.call(t);
|
|
44
|
+
},
|
|
45
|
+
onSignIn(t) {
|
|
46
|
+
var n;
|
|
47
|
+
const e = this._getClient();
|
|
48
|
+
(n = e.onSignIn) == null || n.call(e, t);
|
|
49
|
+
},
|
|
50
|
+
onSignOut() {
|
|
51
|
+
var e;
|
|
52
|
+
const t = this._getClient();
|
|
53
|
+
(e = t.onSignOut) == null || e.call(t);
|
|
54
|
+
},
|
|
55
|
+
setSIWEClient(t) {
|
|
56
|
+
s._client = E(t), s.status = "ready", C.setIsSiweEnabled(t.options.enabled);
|
|
57
|
+
},
|
|
58
|
+
setNonce(t) {
|
|
59
|
+
s.nonce = t;
|
|
60
|
+
},
|
|
61
|
+
setStatus(t) {
|
|
62
|
+
s.status = t, l.setSiweStatus(t);
|
|
63
|
+
},
|
|
64
|
+
setMessage(t) {
|
|
65
|
+
s.message = t;
|
|
66
|
+
},
|
|
67
|
+
setSession(t) {
|
|
68
|
+
s.session = t, s.status = t ? "success" : "ready";
|
|
69
|
+
}
|
|
70
|
+
}, R = T`
|
|
71
|
+
:host {
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
gap: var(--wui-spacing-2xl);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
wui-visual-thumbnail:nth-child(1) {
|
|
78
|
+
z-index: 1;
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
var U = function(t, e, n, a) {
|
|
82
|
+
var r = arguments.length, i = r < 3 ? e : a === null ? a = Object.getOwnPropertyDescriptor(e, n) : a, o;
|
|
83
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
84
|
+
i = Reflect.decorate(t, e, n, a);
|
|
85
|
+
else
|
|
86
|
+
for (var c = t.length - 1; c >= 0; c--)
|
|
87
|
+
(o = t[c]) && (i = (r < 3 ? o(i) : r > 3 ? o(e, n, i) : o(e, n)) || i);
|
|
88
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
89
|
+
};
|
|
90
|
+
let f = class extends y {
|
|
91
|
+
constructor() {
|
|
92
|
+
var e, n;
|
|
93
|
+
super(...arguments), this.dappImageUrl = (e = C.state.metadata) == null ? void 0 : e.icons, this.walletImageUrl = (n = l.state.connectedWalletInfo) == null ? void 0 : n.icon;
|
|
94
|
+
}
|
|
95
|
+
firstUpdated() {
|
|
96
|
+
var n;
|
|
97
|
+
const e = (n = this.shadowRoot) == null ? void 0 : n.querySelectorAll("wui-visual-thumbnail");
|
|
98
|
+
e != null && e[0] && this.createAnimation(e[0], "translate(18px)"), e != null && e[1] && this.createAnimation(e[1], "translate(-18px)");
|
|
99
|
+
}
|
|
100
|
+
render() {
|
|
101
|
+
var e;
|
|
102
|
+
return _`
|
|
103
|
+
<wui-visual-thumbnail
|
|
104
|
+
?borderRadiusFull=${!0}
|
|
105
|
+
.imageSrc=${(e = this.dappImageUrl) == null ? void 0 : e[0]}
|
|
106
|
+
></wui-visual-thumbnail>
|
|
107
|
+
<wui-visual-thumbnail .imageSrc=${this.walletImageUrl}></wui-visual-thumbnail>
|
|
108
|
+
`;
|
|
109
|
+
}
|
|
110
|
+
createAnimation(e, n) {
|
|
111
|
+
e.animate([{ transform: "translateX(0px)" }, { transform: n }], {
|
|
112
|
+
duration: 1600,
|
|
113
|
+
easing: "cubic-bezier(0.56, 0, 0.48, 1)",
|
|
114
|
+
direction: "alternate",
|
|
115
|
+
iterations: 1 / 0
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
f.styles = R;
|
|
120
|
+
f = U([
|
|
121
|
+
m("w3m-connecting-siwe")
|
|
122
|
+
], f);
|
|
123
|
+
var h = function(t, e, n, a) {
|
|
124
|
+
var r = arguments.length, i = r < 3 ? e : a === null ? a = Object.getOwnPropertyDescriptor(e, n) : a, o;
|
|
125
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
126
|
+
i = Reflect.decorate(t, e, n, a);
|
|
127
|
+
else
|
|
128
|
+
for (var c = t.length - 1; c >= 0; c--)
|
|
129
|
+
(o = t[c]) && (i = (r < 3 ? o(i) : r > 3 ? o(e, n, i) : o(e, n)) || i);
|
|
130
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
131
|
+
};
|
|
132
|
+
let w = class extends y {
|
|
133
|
+
constructor() {
|
|
134
|
+
var e;
|
|
135
|
+
super(...arguments), this.dappName = (e = C.state.metadata) == null ? void 0 : e.name, this.isSigning = !1, this.isCancelling = !1;
|
|
136
|
+
}
|
|
137
|
+
render() {
|
|
138
|
+
return _`
|
|
139
|
+
<wui-flex justifyContent="center" .padding=${["2xl", "0", "xxl", "0"]}>
|
|
140
|
+
<w3m-connecting-siwe></w3m-connecting-siwe>
|
|
141
|
+
</wui-flex>
|
|
142
|
+
<wui-flex
|
|
143
|
+
.padding=${["0", "4xl", "l", "4xl"]}
|
|
144
|
+
gap="s"
|
|
145
|
+
justifyContent="space-between"
|
|
146
|
+
>
|
|
147
|
+
<wui-text variant="paragraph-500" align="center" color="fg-100"
|
|
148
|
+
>${this.dappName ?? "Dapp"} needs to connect to your wallet</wui-text
|
|
149
|
+
>
|
|
150
|
+
</wui-flex>
|
|
151
|
+
<wui-flex
|
|
152
|
+
.padding=${["0", "3xl", "l", "3xl"]}
|
|
153
|
+
gap="s"
|
|
154
|
+
justifyContent="space-between"
|
|
155
|
+
>
|
|
156
|
+
<wui-text variant="small-400" align="center" color="fg-200"
|
|
157
|
+
>Sign this message to prove you own this wallet and proceed. Canceling will disconnect
|
|
158
|
+
you.</wui-text
|
|
159
|
+
>
|
|
160
|
+
</wui-flex>
|
|
161
|
+
<wui-flex .padding=${["l", "xl", "xl", "xl"]} gap="s" justifyContent="space-between">
|
|
162
|
+
<wui-button
|
|
163
|
+
size="lg"
|
|
164
|
+
borderRadius="xs"
|
|
165
|
+
fullWidth
|
|
166
|
+
variant="neutral"
|
|
167
|
+
?loading=${this.isCancelling}
|
|
168
|
+
@click=${this.onCancel.bind(this)}
|
|
169
|
+
data-testid="w3m-connecting-siwe-cancel"
|
|
170
|
+
>
|
|
171
|
+
Cancel
|
|
172
|
+
</wui-button>
|
|
173
|
+
<wui-button
|
|
174
|
+
size="lg"
|
|
175
|
+
borderRadius="xs"
|
|
176
|
+
fullWidth
|
|
177
|
+
variant="main"
|
|
178
|
+
@click=${this.onSign.bind(this)}
|
|
179
|
+
?loading=${this.isSigning}
|
|
180
|
+
data-testid="w3m-connecting-siwe-sign"
|
|
181
|
+
>
|
|
182
|
+
${this.isSigning ? "Signing..." : "Sign"}
|
|
183
|
+
</wui-button>
|
|
184
|
+
</wui-flex>
|
|
185
|
+
`;
|
|
186
|
+
}
|
|
187
|
+
async onSign() {
|
|
188
|
+
var e, n, a;
|
|
189
|
+
this.isSigning = !0, u.sendEvent({
|
|
190
|
+
event: "CLICK_SIGN_SIWE_MESSAGE",
|
|
191
|
+
type: "track",
|
|
192
|
+
properties: {
|
|
193
|
+
network: ((e = d.state.caipNetwork) == null ? void 0 : e.id) || "",
|
|
194
|
+
isSmartAccount: l.state.preferredAccountType === g.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
try {
|
|
198
|
+
p.setStatus("loading");
|
|
199
|
+
const r = await p.signIn();
|
|
200
|
+
return p.setStatus("success"), u.sendEvent({
|
|
201
|
+
event: "SIWE_AUTH_SUCCESS",
|
|
202
|
+
type: "track",
|
|
203
|
+
properties: {
|
|
204
|
+
network: ((n = d.state.caipNetwork) == null ? void 0 : n.id) || "",
|
|
205
|
+
isSmartAccount: l.state.preferredAccountType === g.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
206
|
+
}
|
|
207
|
+
}), r;
|
|
208
|
+
} catch {
|
|
209
|
+
const o = l.state.preferredAccountType === g.ACCOUNT_TYPES.SMART_ACCOUNT;
|
|
210
|
+
return o ? S.showError("This application might not support Smart Accounts") : S.showError("Signature declined"), p.setStatus("error"), u.sendEvent({
|
|
211
|
+
event: "SIWE_AUTH_ERROR",
|
|
212
|
+
type: "track",
|
|
213
|
+
properties: {
|
|
214
|
+
network: ((a = d.state.caipNetwork) == null ? void 0 : a.id) || "",
|
|
215
|
+
isSmartAccount: o
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
} finally {
|
|
219
|
+
this.isSigning = !1;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
async onCancel() {
|
|
223
|
+
var n;
|
|
224
|
+
this.isCancelling = !0, l.state.isConnected ? (await I.disconnect(), O.close()) : N.push("Connect"), this.isCancelling = !1, u.sendEvent({
|
|
225
|
+
event: "CLICK_CANCEL_SIWE",
|
|
226
|
+
type: "track",
|
|
227
|
+
properties: {
|
|
228
|
+
network: ((n = d.state.caipNetwork) == null ? void 0 : n.id) || "",
|
|
229
|
+
isSmartAccount: l.state.preferredAccountType === g.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
h([
|
|
235
|
+
b()
|
|
236
|
+
], w.prototype, "isSigning", void 0);
|
|
237
|
+
h([
|
|
238
|
+
b()
|
|
239
|
+
], w.prototype, "isCancelling", void 0);
|
|
240
|
+
w = h([
|
|
241
|
+
m("w3m-connecting-siwe-view")
|
|
242
|
+
], w);
|
|
243
|
+
export {
|
|
244
|
+
p as SIWEController,
|
|
245
|
+
f as W3mConnectingSiwe,
|
|
246
|
+
w as W3mConnectingSiweView,
|
|
247
|
+
P as formatMessage,
|
|
248
|
+
z as getDidAddress,
|
|
249
|
+
D as getDidChainId
|
|
250
|
+
};
|