@1001-digital/components 1.2.1 → 1.2.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.
Files changed (45) hide show
  1. package/package.json +1 -21
  2. package/src/index.ts +0 -3
  3. package/src/evm/assets/wallets/coinbase.svg +0 -4
  4. package/src/evm/assets/wallets/in-app.svg +0 -5
  5. package/src/evm/assets/wallets/metamask.svg +0 -1
  6. package/src/evm/assets/wallets/phantom.svg +0 -4
  7. package/src/evm/assets/wallets/rabby.svg +0 -24
  8. package/src/evm/assets/wallets/rainbow.svg +0 -59
  9. package/src/evm/assets/wallets/safe.png +0 -0
  10. package/src/evm/assets/wallets/walletconnect.svg +0 -1
  11. package/src/evm/components/EvmAccount.vue +0 -28
  12. package/src/evm/components/EvmAvatar.vue +0 -62
  13. package/src/evm/components/EvmConnect.vue +0 -301
  14. package/src/evm/components/EvmConnectDialog.vue +0 -75
  15. package/src/evm/components/EvmConnectionStatus.vue +0 -13
  16. package/src/evm/components/EvmConnectorQR.vue +0 -86
  17. package/src/evm/components/EvmInAppWalletSetup.vue +0 -251
  18. package/src/evm/components/EvmMetaMaskQR.vue +0 -34
  19. package/src/evm/components/EvmProfile.vue +0 -186
  20. package/src/evm/components/EvmSeedPhraseInput.vue +0 -193
  21. package/src/evm/components/EvmSiwe.vue +0 -190
  22. package/src/evm/components/EvmSiweDialog.vue +0 -93
  23. package/src/evm/components/EvmSwitchNetwork.vue +0 -132
  24. package/src/evm/components/EvmTransactionFlow.vue +0 -353
  25. package/src/evm/components/EvmWalletConnectQR.vue +0 -13
  26. package/src/evm/components/EvmWalletConnectWallets.vue +0 -200
  27. package/src/evm/composables/base.ts +0 -7
  28. package/src/evm/composables/chainId.ts +0 -42
  29. package/src/evm/composables/ens.ts +0 -113
  30. package/src/evm/composables/gasPrice.ts +0 -37
  31. package/src/evm/composables/priceFeed.ts +0 -116
  32. package/src/evm/composables/siwe.ts +0 -89
  33. package/src/evm/composables/uri.ts +0 -12
  34. package/src/evm/composables/walletExplorer.ts +0 -130
  35. package/src/evm/config.ts +0 -35
  36. package/src/evm/connectors/inAppWallet.ts +0 -5
  37. package/src/evm/index.ts +0 -60
  38. package/src/evm/utils/addresses.ts +0 -6
  39. package/src/evm/utils/cache.ts +0 -59
  40. package/src/evm/utils/chains.ts +0 -32
  41. package/src/evm/utils/ens.ts +0 -116
  42. package/src/evm/utils/format-eth.ts +0 -15
  43. package/src/evm/utils/price.ts +0 -17
  44. package/src/evm/utils/siwe.ts +0 -70
  45. package/src/evm/utils/uri.ts +0 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1001-digital/components",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -13,39 +13,19 @@
13
13
  "src"
14
14
  ],
15
15
  "peerDependencies": {
16
- "@wagmi/core": ">=3.0.0",
17
- "@wagmi/vue": ">=0.5.0",
18
- "viem": ">=2.0.0",
19
16
  "vue": "^3.5.0",
20
17
  "@1001-digital/styles": "^1.0.1"
21
18
  },
22
- "peerDependenciesMeta": {
23
- "@wagmi/core": {
24
- "optional": true
25
- },
26
- "@wagmi/vue": {
27
- "optional": true
28
- },
29
- "viem": {
30
- "optional": true
31
- }
32
- },
33
19
  "dependencies": {
34
- "@1001-digital/wagmi-in-app-wallet": "^0.1.0",
35
20
  "@iconify/vue": "^5.0.0",
36
21
  "@internationalized/date": "^3.8.0",
37
22
  "@types/luxon": "^3.7.0",
38
- "@types/qrcode": "^1.5.6",
39
23
  "@visualizevalue/opepicons": "^0.1.0",
40
24
  "@vueuse/core": "^14.2.0",
41
25
  "luxon": "^3.7.0",
42
- "qrcode": "^1.5.4",
43
26
  "reka-ui": "^2.8.0"
44
27
  },
45
28
  "devDependencies": {
46
- "@wagmi/core": "^3.4.0",
47
- "@wagmi/vue": "^0.5.0",
48
- "viem": "^2.45.0",
49
29
  "vue": "^3.5.0"
50
30
  }
51
31
  }
package/src/index.ts CHANGED
@@ -81,6 +81,3 @@ export type { DateValue } from '@internationalized/date'
81
81
  export { IconAliasesKey, defaultIconAliases } from './base/icons'
82
82
  export type { IconAliases } from './base/icons'
83
83
  export { LinkComponentKey } from './base/link'
84
-
85
- // EVM
86
- export * from './evm/index'
@@ -1,4 +0,0 @@
1
- <svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <rect width="1024" height="1024" fill="#0052FF"/>
3
- <path 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"/>
4
- </svg>
@@ -1,5 +0,0 @@
1
- <svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <rect width="56" height="56" fill="#323232"/>
3
- <path d="M35.5 31H35.515" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
4
- <path d="M20.5 20.5H38.5C39.2956 20.5 40.0587 20.8161 40.6213 21.3787C41.1839 21.9413 41.5 22.7044 41.5 23.5V38.5C41.5 39.2956 41.1839 40.0587 40.6213 40.6213C40.0587 41.1839 39.2956 41.5 38.5 41.5H17.5C16.7044 41.5 15.9413 41.1839 15.3787 40.6213C14.8161 40.0587 14.5 39.2956 14.5 38.5V17.5C14.5 16.7044 14.8161 15.9413 15.3787 15.3787C15.9413 14.8161 16.7044 14.5 17.5 14.5H38.5" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
5
- </svg>
@@ -1 +0,0 @@
1
- <svg fill="none" height="33" viewBox="0 0 35 33" width="35" xmlns="http://www.w3.org/2000/svg"><g stroke-linecap="round" stroke-linejoin="round" stroke-width=".25"><path d="m32.9582 1-13.1341 9.7183 2.4424-5.72731z" fill="#e17726" stroke="#e17726"/><g fill="#e27625" stroke="#e27625"><path d="m2.66296 1 13.01714 9.809-2.3254-5.81802z"/><path d="m28.2295 23.5335-3.4947 5.3386 7.4829 2.0603 2.1436-7.2823z"/><path d="m1.27281 23.6501 2.13055 7.2823 7.46994-2.0603-3.48166-5.3386z"/><path d="m10.4706 14.5149-2.0786 3.1358 7.405.3369-.2469-7.969z"/><path d="m25.1505 14.5149-5.1575-4.58704-.1688 8.05974 7.4049-.3369z"/><path d="m10.8733 28.8721 4.4819-2.1639-3.8583-3.0062z"/><path d="m20.2659 26.7082 4.4689 2.1639-.6105-5.1701z"/></g><path d="m24.7348 28.8721-4.469-2.1639.3638 2.9025-.039 1.231z" fill="#d5bfb2" stroke="#d5bfb2"/><path d="m10.8732 28.8721 4.1572 1.9696-.026-1.231.3508-2.9025z" fill="#d5bfb2" stroke="#d5bfb2"/><path d="m15.1084 21.7842-3.7155-1.0884 2.6243-1.2051z" fill="#233447" stroke="#233447"/><path d="m20.5126 21.7842 1.0913-2.2935 2.6372 1.2051z" fill="#233447" stroke="#233447"/><path d="m10.8733 28.8721.6495-5.3386-4.13117.1167z" fill="#cc6228" stroke="#cc6228"/><path d="m24.0982 23.5335.6366 5.3386 3.4946-5.2219z" fill="#cc6228" stroke="#cc6228"/><path d="m27.2291 17.6507-7.405.3369.6885 3.7966 1.0913-2.2935 2.6372 1.2051z" fill="#cc6228" stroke="#cc6228"/><path d="m11.3929 20.6958 2.6242-1.2051 1.0913 2.2935.6885-3.7966-7.40495-.3369z" fill="#cc6228" stroke="#cc6228"/><path d="m8.392 17.6507 3.1049 6.0513-.1039-3.0062z" fill="#e27525" stroke="#e27525"/><path d="m24.2412 20.6958-.1169 3.0062 3.1049-6.0513z" fill="#e27525" stroke="#e27525"/><path d="m15.797 17.9876-.6886 3.7967.8704 4.4833.1949-5.9087z" fill="#e27525" stroke="#e27525"/><path d="m19.8242 17.9876-.3638 2.3584.1819 5.9216.8704-4.4833z" fill="#e27525" stroke="#e27525"/><path d="m20.5127 21.7842-.8704 4.4834.6236.4406 3.8584-3.0062.1169-3.0062z" fill="#f5841f" stroke="#f5841f"/><path d="m11.3929 20.6958.104 3.0062 3.8583 3.0062.6236-.4406-.8704-4.4834z" fill="#f5841f" stroke="#f5841f"/><path d="m20.5906 30.8417.039-1.231-.3378-.2851h-4.9626l-.3248.2851.026 1.231-4.1572-1.9696 1.4551 1.1921 2.9489 2.0344h5.0536l2.962-2.0344 1.442-1.1921z" fill="#c0ac9d" stroke="#c0ac9d"/><path d="m20.2659 26.7082-.6236-.4406h-3.6635l-.6236.4406-.3508 2.9025.3248-.2851h4.9626l.3378.2851z" fill="#161616" stroke="#161616"/><path d="m33.5168 11.3532 1.1043-5.36447-1.6629-4.98873-12.6923 9.3944 4.8846 4.1205 6.8983 2.0085 1.52-1.7752-.6626-.4795 1.0523-.9588-.8054-.622 1.0523-.8034z" fill="#763e1a" stroke="#763e1a"/><path d="m1 5.98873 1.11724 5.36447-.71451.5313 1.06527.8034-.80545.622 1.05228.9588-.66255.4795 1.51997 1.7752 6.89835-2.0085 4.8846-4.1205-12.69233-9.3944z" fill="#763e1a" stroke="#763e1a"/><path d="m32.0489 16.5234-6.8983-2.0085 2.0786 3.1358-3.1049 6.0513 4.1052-.0519h6.1318z" fill="#f5841f" stroke="#f5841f"/><path d="m10.4705 14.5149-6.89828 2.0085-2.29944 7.1267h6.11883l4.10519.0519-3.10487-6.0513z" fill="#f5841f" stroke="#f5841f"/><path d="m19.8241 17.9876.4417-7.5932 2.0007-5.4034h-8.9119l2.0006 5.4034.4417 7.5932.1689 2.3842.013 5.8958h3.6635l.013-5.8958z" fill="#f5841f" stroke="#f5841f"/></g></svg>
@@ -1,4 +0,0 @@
1
- <svg viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <rect width="128" height="128" fill="#AB9FF2"/>
3
- <path fill-rule="evenodd" clip-rule="evenodd" d="M55.6416 82.1477C50.8744 89.4525 42.8862 98.6966 32.2568 98.6966C27.232 98.6966 22.4004 96.628 22.4004 87.6424C22.4004 64.7584 53.6445 29.3335 82.6339 29.3335C99.1257 29.3335 105.697 40.7755 105.697 53.7689C105.697 70.4471 94.8739 89.5171 84.1156 89.5171C80.7013 89.5171 79.0264 87.6424 79.0264 84.6688C79.0264 83.8931 79.1552 83.0527 79.4129 82.1477C75.7409 88.4182 68.6546 94.2361 62.0192 94.2361C57.1877 94.2361 54.7397 91.1979 54.7397 86.9314C54.7397 85.3799 55.0618 83.7638 55.6416 82.1477ZM80.6133 53.3182C80.6133 57.1044 78.3795 58.9975 75.8806 58.9975C73.3438 58.9975 71.1479 57.1044 71.1479 53.3182C71.1479 49.532 73.3438 47.6389 75.8806 47.6389C78.3795 47.6389 80.6133 49.532 80.6133 53.3182ZM94.8102 53.3184C94.8102 57.1046 92.5763 58.9977 90.0775 58.9977C87.5407 58.9977 85.3447 57.1046 85.3447 53.3184C85.3447 49.5323 87.5407 47.6392 90.0775 47.6392C92.5763 47.6392 94.8102 49.5323 94.8102 53.3184Z" fill="#FFFDF8"/>
4
- </svg>
@@ -1,24 +0,0 @@
1
- <svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M438.47 279.097C452.952 246.637 381.359 155.948 312.964 118.165C269.853 88.895 224.93 92.9162 215.832 105.768C195.865 133.972 281.948 157.871 339.518 185.759C327.143 191.152 315.481 200.83 308.623 213.207C287.16 189.697 240.052 169.451 184.777 185.759C147.528 196.749 116.571 222.658 104.606 261.791C101.699 260.495 98.4799 259.774 95.0934 259.774C82.1436 259.774 71.6456 270.308 71.6456 283.301C71.6456 296.295 82.1436 306.828 95.0934 306.828C97.4937 306.828 104.999 305.213 104.999 305.213L224.93 306.085C176.967 382.43 139.063 393.59 139.063 406.817C139.063 420.043 175.331 416.459 188.948 411.529C254.138 387.928 324.155 314.373 336.17 293.199C386.625 299.515 429.028 300.262 438.47 279.097Z" fill="url(#paint0_linear_1758_656)"/>
3
- <path fill-rule="evenodd" clip-rule="evenodd" d="M339.513 185.763C339.516 185.764 339.519 185.766 339.522 185.767C342.191 184.712 341.759 180.758 341.026 177.652C339.342 170.515 310.284 141.724 282.997 128.829C245.815 111.257 218.435 112.163 214.39 120.262C221.964 135.837 257.077 150.461 293.748 165.733C309.394 172.249 325.323 178.883 339.519 185.76C339.517 185.761 339.515 185.762 339.513 185.763Z" fill="url(#paint1_linear_1758_656)"/>
4
- <path fill-rule="evenodd" clip-rule="evenodd" d="M292.329 342.523C284.809 339.64 276.315 336.994 266.658 334.594C276.955 316.108 279.115 288.74 269.391 271.437C255.743 247.153 238.612 234.228 198.802 234.228C176.907 234.228 117.955 241.628 116.909 291.006C116.799 296.187 116.906 300.935 117.28 305.301L224.93 306.084C210.417 329.185 196.825 346.318 184.926 359.345C199.213 363.019 211.003 366.103 221.828 368.934C232.098 371.62 241.499 374.079 251.339 376.598C266.182 365.748 280.135 353.917 292.329 342.523Z" fill="url(#paint2_linear_1758_656)"/>
5
- <path d="M103.169 300.228C107.567 337.737 128.813 352.437 172.227 356.788C215.641 361.138 240.544 358.22 273.698 361.246C301.389 363.774 326.113 377.932 335.285 373.04C343.539 368.636 338.921 352.728 327.876 342.521C313.558 329.291 293.742 320.093 258.875 316.828C265.824 297.739 263.877 270.973 253.085 256.411C237.481 235.355 208.68 225.836 172.227 229.995C134.143 234.34 97.6504 253.153 103.169 300.228Z" fill="url(#paint3_linear_1758_656)"/>
6
- <defs>
7
- <linearGradient id="paint0_linear_1758_656" x1="180.439" y1="250.352" x2="435.479" y2="322.433" gradientUnits="userSpaceOnUse">
8
- <stop stop-color="#8697FF"/>
9
- <stop offset="1" stop-color="#ABB7FF"/>
10
- </linearGradient>
11
- <linearGradient id="paint1_linear_1758_656" x1="392.428" y1="245.489" x2="207.876" y2="61.1077" gradientUnits="userSpaceOnUse">
12
- <stop stop-color="#8697FF"/>
13
- <stop offset="1" stop-color="#5156D8" stop-opacity="0"/>
14
- </linearGradient>
15
- <linearGradient id="paint2_linear_1758_656" x1="297.446" y1="348.967" x2="120.465" y2="247.558" gradientUnits="userSpaceOnUse">
16
- <stop stop-color="#465EED"/>
17
- <stop offset="1" stop-color="#8697FF" stop-opacity="0"/>
18
- </linearGradient>
19
- <linearGradient id="paint3_linear_1758_656" x1="195.658" y1="248.443" x2="315.581" y2="400.306" gradientUnits="userSpaceOnUse">
20
- <stop stop-color="#8898FF"/>
21
- <stop offset="0.983895" stop-color="#6277F1"/>
22
- </linearGradient>
23
- </defs>
24
- </svg>
@@ -1,59 +0,0 @@
1
- <svg viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g clip-path="url(#clip0_8_458)">
3
- <rect width="120" height="120" fill="url(#paint0_linear_8_458)"/>
4
- <path d="M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z" fill="url(#paint1_radial_8_458)"/>
5
- <path d="M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z" fill="url(#paint2_linear_8_458)"/>
6
- <path d="M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z" fill="url(#paint3_linear_8_458)"/>
7
- <path d="M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z" fill="url(#paint4_radial_8_458)"/>
8
- <path d="M68 94H84V100H68V94Z" fill="url(#paint5_linear_8_458)"/>
9
- <path d="M20 52L20 36L26 36L26 52H20Z" fill="url(#paint6_linear_8_458)"/>
10
- <path d="M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z" fill="url(#paint7_radial_8_458)"/>
11
- <path d="M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z" fill="url(#paint8_radial_8_458)"/>
12
- <path d="M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z" fill="url(#paint9_radial_8_458)"/>
13
- </g>
14
- <defs>
15
- <linearGradient id="paint0_linear_8_458" x1="60" y1="0" x2="60" y2="120" gradientUnits="userSpaceOnUse">
16
- <stop stop-color="#174299"/>
17
- <stop offset="1" stop-color="#001E59"/>
18
- </linearGradient>
19
- <radialGradient id="paint1_radial_8_458" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(26 94) rotate(-90) scale(74)">
20
- <stop offset="0.770277" stop-color="#FF4000"/>
21
- <stop offset="1" stop-color="#8754C9"/>
22
- </radialGradient>
23
- <linearGradient id="paint2_linear_8_458" x1="83" y1="97" x2="100" y2="97" gradientUnits="userSpaceOnUse">
24
- <stop stop-color="#FF4000"/>
25
- <stop offset="1" stop-color="#8754C9"/>
26
- </linearGradient>
27
- <linearGradient id="paint3_linear_8_458" x1="23" y1="20" x2="23" y2="37" gradientUnits="userSpaceOnUse">
28
- <stop stop-color="#8754C9"/>
29
- <stop offset="1" stop-color="#FF4000"/>
30
- </linearGradient>
31
- <radialGradient id="paint4_radial_8_458" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(26 94) rotate(-90) scale(58)">
32
- <stop offset="0.723929" stop-color="#FFF700"/>
33
- <stop offset="1" stop-color="#FF9901"/>
34
- </radialGradient>
35
- <linearGradient id="paint5_linear_8_458" x1="68" y1="97" x2="84" y2="97" gradientUnits="userSpaceOnUse">
36
- <stop stop-color="#FFF700"/>
37
- <stop offset="1" stop-color="#FF9901"/>
38
- </linearGradient>
39
- <linearGradient id="paint6_linear_8_458" x1="23" y1="52" x2="23" y2="36" gradientUnits="userSpaceOnUse">
40
- <stop stop-color="#FFF700"/>
41
- <stop offset="1" stop-color="#FF9901"/>
42
- </linearGradient>
43
- <radialGradient id="paint7_radial_8_458" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(26 94) rotate(-90) scale(42)">
44
- <stop offset="0.59513" stop-color="#00AAFF"/>
45
- <stop offset="1" stop-color="#01DA40"/>
46
- </radialGradient>
47
- <radialGradient id="paint8_radial_8_458" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(51 97) scale(17 45.3333)">
48
- <stop stop-color="#00AAFF"/>
49
- <stop offset="1" stop-color="#01DA40"/>
50
- </radialGradient>
51
- <radialGradient id="paint9_radial_8_458" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(23 69) rotate(-90) scale(17 322.37)">
52
- <stop stop-color="#00AAFF"/>
53
- <stop offset="1" stop-color="#01DA40"/>
54
- </radialGradient>
55
- <clipPath id="clip0_8_458">
56
- <rect width="120" height="120" fill="white"/>
57
- </clipPath>
58
- </defs>
59
- </svg>
Binary file
@@ -1 +0,0 @@
1
- <svg fill="none" height="400" viewBox="0 0 400 400" width="400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h400v400h-400z"/></clipPath><g clip-path="url(#a)"><circle cx="200" cy="200" fill="#3396ff" r="199.5" stroke="#66b1ff"/><path d="m122.519 148.965c42.791-41.729 112.171-41.729 154.962 0l5.15 5.022c2.14 2.086 2.14 5.469 0 7.555l-17.617 17.18c-1.07 1.043-2.804 1.043-3.874 0l-7.087-6.911c-29.853-29.111-78.253-29.111-108.106 0l-7.59 7.401c-1.07 1.043-2.804 1.043-3.874 0l-17.617-17.18c-2.14-2.086-2.14-5.469 0-7.555zm191.397 35.529 15.679 15.29c2.14 2.086 2.14 5.469 0 7.555l-70.7 68.944c-2.139 2.087-5.608 2.087-7.748 0l-50.178-48.931c-.535-.522-1.402-.522-1.937 0l-50.178 48.931c-2.139 2.087-5.608 2.087-7.748 0l-70.7015-68.945c-2.1396-2.086-2.1396-5.469 0-7.555l15.6795-15.29c2.1396-2.086 5.6085-2.086 7.7481 0l50.1789 48.932c.535.522 1.402.522 1.937 0l50.177-48.932c2.139-2.087 5.608-2.087 7.748 0l50.179 48.932c.535.522 1.402.522 1.937 0l50.179-48.931c2.139-2.087 5.608-2.087 7.748 0z" fill="#fff"/></g></svg>
@@ -1,28 +0,0 @@
1
- <template>
2
- <slot
3
- :display="display"
4
- :is-current="isCurrent"
5
- >
6
- <span>{{ display }}</span>
7
- </slot>
8
- </template>
9
-
10
- <script setup lang="ts">
11
- import { computed } from 'vue'
12
- import type { Address } from 'viem'
13
- import { useConnection } from '@wagmi/vue'
14
- import { shortAddress } from '../utils/addresses'
15
-
16
- const props = defineProps<{
17
- address?: Address
18
- }>()
19
- const address = computed(() => props.address)
20
-
21
- const { address: currentAddress } = useConnection()
22
-
23
- const isCurrent = computed<boolean>(
24
- () => currentAddress.value?.toLowerCase() === address.value?.toLowerCase(),
25
- )
26
-
27
- const display = computed<string>(() => shortAddress(address.value!))
28
- </script>
@@ -1,62 +0,0 @@
1
- <template>
2
- <slot
3
- :src="src"
4
- :ens="ens"
5
- :is-current="isCurrent"
6
- >
7
- <img
8
- v-if="src"
9
- :src="src"
10
- :alt="ens || 'Avatar'"
11
- :class="['evm-avatar', { large }]"
12
- />
13
- <Opepicon
14
- v-else-if="address"
15
- :seed="address"
16
- :size="large ? 256 : 64"
17
- :class="['evm-avatar', { large }]"
18
- />
19
- </slot>
20
- </template>
21
-
22
- <script setup lang="ts">
23
- import { computed } from 'vue'
24
- import type { Address } from 'viem'
25
- import { useConnection } from '@wagmi/vue'
26
- import { useEnsWithAvatar } from '../composables/ens'
27
- import { useResolveUri } from '../composables/uri'
28
- import Opepicon from '../../base/components/Opepicon.vue'
29
-
30
- const props = defineProps<{
31
- address?: Address
32
- large?: boolean
33
- }>()
34
- const address = computed(() => props.address)
35
-
36
- const { address: currentAddress } = useConnection()
37
-
38
- const isCurrent = computed<boolean>(
39
- () => currentAddress.value?.toLowerCase() === address.value?.toLowerCase(),
40
- )
41
-
42
- const { data: ensData } = useEnsWithAvatar(address)
43
- const resolve = useResolveUri()
44
-
45
- const ens = computed(() => ensData.value?.ens || null)
46
- const src = computed(() => resolve(ensData.value?.data?.avatar))
47
- </script>
48
-
49
- <style scoped>
50
- .evm-avatar {
51
- width: var(--size-5);
52
- height: var(--size-5);
53
- border-radius: 50%;
54
- background-color: var(--background);
55
- object-fit: cover;
56
-
57
- &.large {
58
- width: var(--size-9);
59
- height: var(--size-9);
60
- }
61
- }
62
- </style>
@@ -1,301 +0,0 @@
1
- <template>
2
- <EvmInAppWalletSetup
3
- v-if="showInAppSetup"
4
- @connected="onInAppConnected"
5
- @back="showInAppSetup = false"
6
- />
7
- <template v-else-if="errorMessage">
8
- <Alert type="error">
9
- {{ errorMessage }}
10
- </Alert>
11
- <Button
12
- class="link muted small"
13
- @click="resetConnection"
14
- >
15
- <Icon type="chevron-left" />
16
- <span>Back</span>
17
- </Button>
18
- </template>
19
- <EvmMetaMaskQR
20
- v-else-if="metaMaskUri"
21
- :uri="metaMaskUri"
22
- @back="resetConnection"
23
- />
24
- <EvmWalletConnectWallets
25
- v-else-if="walletConnectUri"
26
- :uri="walletConnectUri"
27
- @back="resetConnection"
28
- />
29
- <template v-else-if="isConnecting">
30
- <Loading
31
- :txt="`Waiting for ${connectingWallet} confirmation...`"
32
- spinner
33
- stacked
34
- />
35
- </template>
36
- <div
37
- v-else
38
- class="wallet-options"
39
- >
40
- <Button
41
- v-for="connector in shownConnectors"
42
- :key="connector.uid"
43
- @click="() => login(connector)"
44
- class="block choose-connector"
45
- >
46
- <img
47
- v-if="ICONS[connector.name] || connector.icon"
48
- :src="ICONS[connector.name] || connector.icon"
49
- :alt="connector.name"
50
- />
51
- <div
52
- v-else
53
- class="default-wallet-icon"
54
- >
55
- <Icon type="wallet" />
56
- </div>
57
- <span>{{ connector.name }}</span>
58
- </Button>
59
- <Button
60
- v-if="wcConnector"
61
- @click="loginWithSafe"
62
- class="block choose-connector"
63
- >
64
- <img
65
- :src="safeIcon"
66
- alt="Safe"
67
- />
68
- <span>Safe</span>
69
- </Button>
70
- <Button
71
- v-if="inAppConnector"
72
- @click="showInAppSetup = true"
73
- class="block choose-connector"
74
- >
75
- <img
76
- :src="inAppIcon"
77
- alt="Seed Phrase"
78
- />
79
- <span>In App</span>
80
- </Button>
81
- <Button
82
- to="https://ethereum.org/wallets/"
83
- target="_blank"
84
- class="link muted small"
85
- >
86
- <Icon type="help" />
87
- <span>New to wallets?</span>
88
- </Button>
89
- </div>
90
- </template>
91
-
92
- <script setup lang="ts">
93
- import { ref, computed } from 'vue'
94
- import type { Connector } from '@wagmi/vue'
95
- import { useConnect, useConnectors, useChainId } from '@wagmi/vue'
96
- import Button from '../../base/components/Button.vue'
97
- import Icon from '../../base/components/Icon.vue'
98
- import Alert from '../../base/components/Alert.vue'
99
- import Loading from '../../base/components/Loading.vue'
100
- import EvmMetaMaskQR from './EvmMetaMaskQR.vue'
101
- import EvmWalletConnectWallets from './EvmWalletConnectWallets.vue'
102
- import EvmInAppWalletSetup from './EvmInAppWalletSetup.vue'
103
-
104
- import coinbaseIcon from '../assets/wallets/coinbase.svg'
105
- import metamaskIcon from '../assets/wallets/metamask.svg'
106
- import phantomIcon from '../assets/wallets/phantom.svg'
107
- import rabbyIcon from '../assets/wallets/rabby.svg'
108
- import rainbowIcon from '../assets/wallets/rainbow.svg'
109
- import safeIcon from '../assets/wallets/safe.png'
110
- import inAppIcon from '../assets/wallets/in-app.svg'
111
- import walletconnectIcon from '../assets/wallets/walletconnect.svg'
112
-
113
- const ICONS: Record<string, string> = {
114
- 'Base Account': coinbaseIcon,
115
- MetaMask: metamaskIcon,
116
- Phantom: phantomIcon,
117
- 'Rabby Wallet': rabbyIcon,
118
- Rainbow: rainbowIcon,
119
- Safe: safeIcon,
120
- 'In App': inAppIcon,
121
- WalletConnect: walletconnectIcon,
122
- }
123
-
124
- const PRIORITY: Record<string, number> = {
125
- WalletConnect: 20,
126
- 'Base Account': 10,
127
- }
128
-
129
- const emit = defineEmits<{
130
- connected: []
131
- }>()
132
-
133
- const chainId = useChainId()
134
- const connectors = useConnectors()
135
- const { mutateAsync: connectAsync } = useConnect()
136
-
137
- const inAppConnector = computed(() =>
138
- connectors.value.find((c) => c.type === 'inAppWallet'),
139
- )
140
- const showInAppSetup = ref(false)
141
-
142
- const shownConnectors = computed(() => {
143
- const unique = Array.from(
144
- new Map(
145
- connectors.value?.map((connector) => [connector.name, connector]),
146
- ).values(),
147
- )
148
-
149
- const filtered =
150
- unique.length > 1
151
- ? unique.filter(
152
- (c) =>
153
- c.id !== 'injected' && c.id !== 'safe' && c.type !== 'inAppWallet',
154
- )
155
- : unique.filter((c) => c.type !== 'inAppWallet')
156
-
157
- return filtered.sort((a, b) => {
158
- const priorityA = PRIORITY[a.name] ?? 5
159
- const priorityB = PRIORITY[b.name] ?? 5
160
- return priorityA - priorityB
161
- })
162
- })
163
-
164
- const wcConnector = computed(() =>
165
- connectors.value.find((c) => c.id === 'walletConnect'),
166
- )
167
-
168
- const errorMessage = ref('')
169
- const isConnecting = ref(false)
170
- const connectingWallet = ref('')
171
- const metaMaskUri = ref('')
172
- const walletConnectUri = ref('')
173
- const safeDeepLink = ref(false)
174
-
175
- const loginWithSafe = () => {
176
- if (!wcConnector.value) return
177
- safeDeepLink.value = true
178
- login(wcConnector.value)
179
- }
180
-
181
- const login = async (connector: Connector) => {
182
- errorMessage.value = ''
183
- isConnecting.value = true
184
- connectingWallet.value = safeDeepLink.value ? 'Safe' : connector.name
185
- metaMaskUri.value = ''
186
- walletConnectUri.value = ''
187
-
188
- const handleMetaMaskMessage = (event: { type: string; data?: unknown }) => {
189
- if (event.type === 'display_uri' && typeof event.data === 'string') {
190
- metaMaskUri.value = event.data
191
- }
192
- }
193
-
194
- const handleWcMessage = (event: { type: string; data?: unknown }) => {
195
- if (event.type === 'display_uri' && typeof event.data === 'string') {
196
- if (safeDeepLink.value) {
197
- window.open(
198
- `https://app.safe.global/wc?uri=${encodeURIComponent(event.data)}`,
199
- '_blank',
200
- 'noreferrer',
201
- )
202
- } else {
203
- walletConnectUri.value = event.data
204
- }
205
- }
206
- }
207
-
208
- if (connector.id === 'metaMaskSDK') {
209
- connector.emitter.on('message', handleMetaMaskMessage)
210
- } else if (connector.id === 'walletConnect') {
211
- connector.emitter.on('message', handleWcMessage)
212
- }
213
-
214
- try {
215
- await connectAsync({ connector, chainId: chainId.value })
216
-
217
- emit('connected')
218
-
219
- resetConnection()
220
- } catch (error: unknown) {
221
- isConnecting.value = false
222
- metaMaskUri.value = ''
223
- walletConnectUri.value = ''
224
- safeDeepLink.value = false
225
-
226
- const errorMsg = error instanceof Error ? error.message : ''
227
- if (
228
- errorMsg.includes('User rejected') ||
229
- errorMsg.includes('rejected') ||
230
- errorMsg.includes('denied')
231
- ) {
232
- errorMessage.value = 'Connection cancelled. Please try again.'
233
- } else {
234
- errorMessage.value = 'Failed to connect. Please try again.'
235
- }
236
- console.error('Wallet connection error:', error)
237
- } finally {
238
- if (connector.id === 'metaMaskSDK') {
239
- connector.emitter.off('message', handleMetaMaskMessage)
240
- } else if (connector.id === 'walletConnect') {
241
- connector.emitter.off('message', handleWcMessage)
242
- }
243
- }
244
- }
245
-
246
- const resetConnection = () => {
247
- errorMessage.value = ''
248
- isConnecting.value = false
249
- connectingWallet.value = ''
250
- metaMaskUri.value = ''
251
- walletConnectUri.value = ''
252
- safeDeepLink.value = false
253
- }
254
-
255
- const onInAppConnected = () => {
256
- showInAppSetup.value = false
257
- emit('connected')
258
- }
259
-
260
- const reset = () => {
261
- resetConnection()
262
- showInAppSetup.value = false
263
- }
264
-
265
- defineExpose({ reset })
266
- </script>
267
-
268
- <style scoped>
269
- .wallet-options {
270
- display: grid;
271
- gap: var(--spacer);
272
-
273
- button.choose-connector {
274
- justify-content: flex-start;
275
- padding-inline-start: var(--ui-padding-inline);
276
-
277
- img,
278
- .default-wallet-icon {
279
- margin: -1rem 0 -1rem -0.6rem;
280
- width: var(--size-5);
281
- height: var(--size-5);
282
- }
283
-
284
- .default-wallet-icon {
285
- display: flex;
286
- align-items: center;
287
- justify-content: center;
288
- background: var(--gray-z-2);
289
- }
290
-
291
- span:last-child {
292
- border-left: var(--border);
293
- padding-left: var(--spacer-sm);
294
- }
295
- }
296
- }
297
-
298
- .link.muted {
299
- justify-self: center;
300
- }
301
- </style>
@@ -1,75 +0,0 @@
1
- <template>
2
- <Button
3
- v-if="showConnect"
4
- @click="open = true"
5
- :class="className"
6
- >
7
- <slot>Connect Wallet</slot>
8
- </Button>
9
- <slot
10
- v-else-if="isConnected"
11
- name="connected"
12
- :address="address"
13
- >
14
- <EvmAccount :address="address" />
15
- </slot>
16
-
17
- <Dialog
18
- v-if="showConnect"
19
- title="Connect Wallet"
20
- v-model:open="open"
21
- @closed="onClosed"
22
- >
23
- <EvmConnect
24
- ref="connectRef"
25
- @connected="onConnected"
26
- />
27
- </Dialog>
28
- </template>
29
-
30
- <script setup lang="ts">
31
- import { ref, computed, watch, onMounted } from 'vue'
32
- import { useConnection } from '@wagmi/vue'
33
- import Button from '../../base/components/Button.vue'
34
- import Dialog from '../../base/components/Dialog.vue'
35
- import EvmAccount from './EvmAccount.vue'
36
- import EvmConnect from './EvmConnect.vue'
37
-
38
- defineProps<{
39
- className?: string
40
- }>()
41
-
42
- const emit = defineEmits<{
43
- connected: [{ address: `0x${string}` | undefined }]
44
- disconnected: []
45
- }>()
46
-
47
- const { address, isConnected } = useConnection()
48
-
49
- const showConnect = computed(() => !isConnected.value)
50
- const open = ref(false)
51
- const connectRef = ref<InstanceType<typeof EvmConnect> | null>(null)
52
-
53
- const onConnected = () => {
54
- open.value = false
55
- }
56
-
57
- const onClosed = () => {
58
- connectRef.value?.reset()
59
- }
60
-
61
- const check = () =>
62
- isConnected.value
63
- ? emit('connected', { address: address.value })
64
- : emit('disconnected')
65
-
66
- watch(isConnected, () => {
67
- check()
68
- if (!isConnected.value) {
69
- open.value = false
70
- connectRef.value?.reset()
71
- }
72
- })
73
-
74
- onMounted(() => check())
75
- </script>
@@ -1,13 +0,0 @@
1
- <template>
2
- <slot
3
- :status="status"
4
- :address="address"
5
- :connector="connector"
6
- />
7
- </template>
8
-
9
- <script setup lang="ts">
10
- import { useConnection } from '@wagmi/vue'
11
-
12
- const { address, connector, status } = useConnection()
13
- </script>