Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
849bda8e8e | ||
|
|
57edb711d5 | ||
|
|
8235c64c93 | ||
|
|
750fb077f5 | ||
|
|
d781cb3199 | ||
|
|
f6bf635b0d | ||
|
|
56187f7a84 | ||
|
|
93c76f1c3f | ||
|
|
521b6d6135 | ||
|
|
94772bf4dc | ||
|
|
149f21e7e0 | ||
|
|
0a3ef3a7ab | ||
|
|
fef9935883 | ||
|
|
c7a5b706e1 |
@@ -0,0 +1 @@
|
|||||||
|
if('serviceWorker' in navigator) navigator.serviceWorker.register('/dev-sw.js?dev-sw', { scope: '/', type: 'classic' })
|
||||||
+4
-1
@@ -39,11 +39,13 @@
|
|||||||
"@cosmjs/proto-signing": "^0.31.0",
|
"@cosmjs/proto-signing": "^0.31.0",
|
||||||
"@cosmjs/stargate": "^0.31.0",
|
"@cosmjs/stargate": "^0.31.0",
|
||||||
"@cosmjs/tendermint-rpc": "^0.31.0",
|
"@cosmjs/tendermint-rpc": "^0.31.0",
|
||||||
"@dydxprotocol/v4-abacus": "^1.2.3",
|
"@dydxprotocol/v4-abacus": "^1.2.5",
|
||||||
"@dydxprotocol/v4-client-js": "^1.0.11",
|
"@dydxprotocol/v4-client-js": "^1.0.11",
|
||||||
"@dydxprotocol/v4-localization": "^1.1.11",
|
"@dydxprotocol/v4-localization": "^1.1.11",
|
||||||
"@ethersproject/providers": "^5.7.2",
|
"@ethersproject/providers": "^5.7.2",
|
||||||
"@js-joda/core": "^5.5.3",
|
"@js-joda/core": "^5.5.3",
|
||||||
|
"@privy-io/react-auth": "^1.53.1",
|
||||||
|
"@privy-io/wagmi-connector": "^0.1.12",
|
||||||
"@radix-ui/react-accordion": "^1.1.2",
|
"@radix-ui/react-accordion": "^1.1.2",
|
||||||
"@radix-ui/react-checkbox": "^1.0.4",
|
"@radix-ui/react-checkbox": "^1.0.4",
|
||||||
"@radix-ui/react-collapsible": "^1.0.3",
|
"@radix-ui/react-collapsible": "^1.0.3",
|
||||||
@@ -151,6 +153,7 @@
|
|||||||
"url-polyfill": "^1.1.12",
|
"url-polyfill": "^1.1.12",
|
||||||
"util": "^0.12.5",
|
"util": "^0.12.5",
|
||||||
"vite": "^4.3.9",
|
"vite": "^4.3.9",
|
||||||
|
"vite-plugin-pwa": "^0.17.4",
|
||||||
"vite-plugin-svgr": "^3.2.0",
|
"vite-plugin-svgr": "^3.2.0",
|
||||||
"vitest": "^0.32.2",
|
"vitest": "^0.32.2",
|
||||||
"w3name": "^1.0.8",
|
"w3name": "^1.0.8",
|
||||||
|
|||||||
Generated
+2708
-46
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,230 @@
|
|||||||
|
<svg width="254" height="77" viewBox="0 0 254 77" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g id="Group 1258">
|
||||||
|
<g id="Ellipse 9" opacity="0.4" filter="url(#filter0_f_20300_14972)">
|
||||||
|
<ellipse cx="86.5425" cy="-3.91219" rx="116.542" ry="20.0878" fill="#7774FF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 10" opacity="0.3" filter="url(#filter1_f_20300_14972)">
|
||||||
|
<circle cx="74.5734" cy="4.63007" r="1.00507" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 12" opacity="0.3" filter="url(#filter2_f_20300_14972)">
|
||||||
|
<circle cx="82.1105" cy="7.64179" r="1.00507" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 22" opacity="0.3" filter="url(#filter3_f_20300_14972)">
|
||||||
|
<circle cx="116.785" cy="4.63007" r="1.00507" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 11" opacity="0.3" filter="url(#filter4_f_20300_14972)">
|
||||||
|
<circle cx="64.774" cy="8.90488" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 18" opacity="0.3" filter="url(#filter5_f_20300_14972)">
|
||||||
|
<circle cx="96.4322" cy="3.87363" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 20" opacity="0.3" filter="url(#filter6_f_20300_14972)">
|
||||||
|
<circle cx="76.0807" cy="14.9361" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 21" opacity="0.3" filter="url(#filter7_f_20300_14972)">
|
||||||
|
<circle cx="104.725" cy="4.87754" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 23" opacity="0.3" filter="url(#filter8_f_20300_14972)">
|
||||||
|
<circle cx="114.021" cy="7.13925" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 24" opacity="0.3" filter="url(#filter9_f_20300_14972)">
|
||||||
|
<circle cx="109.75" cy="15.4361" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 25" opacity="0.3" filter="url(#filter10_f_20300_14972)">
|
||||||
|
<circle cx="119.801" cy="12.6705" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 27" opacity="0.3" filter="url(#filter11_f_20300_14972)">
|
||||||
|
<circle cx="94.0885" cy="11.0182" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 30" opacity="0.3" filter="url(#filter12_f_20300_14972)">
|
||||||
|
<circle cx="154.475" cy="11.6666" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 29" opacity="0.3" filter="url(#filter13_f_20300_14972)">
|
||||||
|
<circle cx="146.435" cy="8.90488" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 15" opacity="0.3" filter="url(#filter14_f_20300_14972)">
|
||||||
|
<circle cx="24.0103" cy="4.44785" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 33" opacity="0.3" filter="url(#filter15_f_20300_14972)">
|
||||||
|
<circle cx="-1.05899" cy="13.6783" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 16" opacity="0.3" filter="url(#filter16_f_20300_14972)">
|
||||||
|
<circle cx="17.441" cy="16.4908" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 35" opacity="0.3" filter="url(#filter17_f_20300_14972)">
|
||||||
|
<circle cx="36.0553" cy="6.63535" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 32" opacity="0.3" filter="url(#filter18_f_20300_14972)">
|
||||||
|
<circle cx="10.8707" cy="14.2994" r="0.502536" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 13" opacity="0.3" filter="url(#filter19_f_20300_14972)">
|
||||||
|
<circle cx="55.7274" cy="9.65615" r="0.753803" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 19" opacity="0.3" filter="url(#filter20_f_20300_14972)">
|
||||||
|
<circle cx="87.3886" cy="20.7108" r="0.753803" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 26" opacity="0.3" filter="url(#filter21_f_20300_14972)">
|
||||||
|
<circle cx="123.82" cy="15.1874" r="0.753803" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 36" opacity="0.3" filter="url(#filter22_f_20300_14972)">
|
||||||
|
<circle cx="134.876" cy="14.4335" r="0.753803" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 28" opacity="0.3" filter="url(#filter23_f_20300_14972)">
|
||||||
|
<circle cx="129.6" cy="6.38662" r="0.753803" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 14" opacity="0.3" filter="url(#filter24_f_20300_14972)">
|
||||||
|
<circle cx="41.6571" cy="14.9335" r="0.753803" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 31" opacity="0.3" filter="url(#filter25_f_20300_14972)">
|
||||||
|
<circle cx="4.21767" cy="17.9491" r="0.753803" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 34" opacity="0.3" filter="url(#filter26_f_20300_14972)">
|
||||||
|
<circle cx="12.2177" cy="6.88662" r="0.753803" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
<g id="Ellipse 17" opacity="0.3" filter="url(#filter27_f_20300_14972)">
|
||||||
|
<circle cx="50.2001" cy="3.6249" r="0.753803" fill="#9A9AFF"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<filter id="filter0_f_20300_14972" x="-94" y="-88" width="361.085" height="168.176" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="32" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter1_f_20300_14972" x="72.5633" y="2.61993" width="4.01991" height="4.02186" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter2_f_20300_14972" x="80.6029" y="6.13418" width="3.01484" height="3.01679" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.251268" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter3_f_20300_14972" x="115.278" y="3.12246" width="3.01484" height="3.01679" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.251268" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter4_f_20300_14972" x="63.2664" y="7.39727" width="3.01502" height="3.01405" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter5_f_20300_14972" x="94.9246" y="2.36602" width="3.01502" height="3.01405" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter6_f_20300_14972" x="74.5731" y="13.4285" width="3.01502" height="3.01405" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter7_f_20300_14972" x="103.218" y="3.36993" width="3.01502" height="3.01405" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter8_f_20300_14972" x="112.513" y="5.63165" width="3.01502" height="3.01405" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter9_f_20300_14972" x="108.242" y="13.9285" width="3.01502" height="3.01405" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter10_f_20300_14972" x="118.294" y="11.1629" width="3.01502" height="3.01405" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter11_f_20300_14972" x="92.5809" y="9.51055" width="3.01502" height="3.01405" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter12_f_20300_14972" x="153.47" y="10.6615" width="2.00995" height="2.00898" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.251268" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter13_f_20300_14972" x="144.928" y="7.39727" width="3.01502" height="3.01405" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter14_f_20300_14972" x="22.5027" y="2.94024" width="3.01502" height="3.01405" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter15_f_20300_14972" x="-2.56659" y="12.1707" width="3.01502" height="3.01405" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter16_f_20300_14972" x="15.9334" y="14.9832" width="3.01502" height="3.01405" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter17_f_20300_14972" x="35.0502" y="5.63028" width="2.00995" height="2.00898" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.251268" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter18_f_20300_14972" x="9.86563" y="13.2943" width="2.00995" height="2.00898" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.251268" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter19_f_20300_14972" x="53.9686" y="7.89727" width="3.51795" height="3.51795" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter20_f_20300_14972" x="85.6297" y="18.952" width="3.51795" height="3.51795" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter21_f_20300_14972" x="122.061" y="13.4285" width="3.51795" height="3.51795" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter22_f_20300_14972" x="133.117" y="12.6746" width="3.51795" height="3.51795" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter23_f_20300_14972" x="127.842" y="4.62774" width="3.51795" height="3.51795" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter24_f_20300_14972" x="39.8982" y="13.1746" width="3.51795" height="3.51795" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter25_f_20300_14972" x="2.4588" y="16.1902" width="3.51795" height="3.51795" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter26_f_20300_14972" x="10.4588" y="5.12774" width="3.51795" height="3.51795" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="filter27_f_20300_14972" x="48.4412" y="1.86602" width="3.51795" height="3.51795" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
||||||
|
<feGaussianBlur stdDeviation="0.502536" result="effect1_foregroundBlur_20300_14972"/>
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 15 KiB |
+8
-1
@@ -2,6 +2,8 @@ import { lazy, Suspense } from 'react';
|
|||||||
import { Navigate, Route, Routes } from 'react-router-dom';
|
import { Navigate, Route, Routes } from 'react-router-dom';
|
||||||
import styled, { AnyStyledComponent, css } from 'styled-components';
|
import styled, { AnyStyledComponent, css } from 'styled-components';
|
||||||
import { WagmiConfig } from 'wagmi';
|
import { WagmiConfig } from 'wagmi';
|
||||||
|
import { PrivyProvider } from '@privy-io/react-auth';
|
||||||
|
import { PrivyWagmiConnector } from '@privy-io/wagmi-connector';
|
||||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||||
import { GrazProvider } from 'graz';
|
import { GrazProvider } from 'graz';
|
||||||
|
|
||||||
@@ -32,7 +34,7 @@ import { NotificationsToastArea } from '@/layout/NotificationsToastArea';
|
|||||||
import { DialogManager } from '@/layout/DialogManager';
|
import { DialogManager } from '@/layout/DialogManager';
|
||||||
import { GlobalCommandDialog } from '@/views/dialogs/GlobalCommandDialog';
|
import { GlobalCommandDialog } from '@/views/dialogs/GlobalCommandDialog';
|
||||||
|
|
||||||
import { config } from '@/lib/wagmi';
|
import { config, privyConfig } from '@/lib/wagmi';
|
||||||
|
|
||||||
import { breakpoints } from '@/styles';
|
import { breakpoints } from '@/styles';
|
||||||
import { layoutMixins } from '@/styles/layoutMixins';
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
@@ -120,8 +122,13 @@ const wrapProvider = (Component: React.ComponentType<any>, props?: any) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const providers = [
|
const providers = [
|
||||||
|
wrapProvider(PrivyProvider, {
|
||||||
|
appId: import.meta.env.VITE_PRIVY_APP_ID,
|
||||||
|
config: privyConfig,
|
||||||
|
}),
|
||||||
wrapProvider(QueryClientProvider, { client: queryClient }),
|
wrapProvider(QueryClientProvider, { client: queryClient }),
|
||||||
wrapProvider(GrazProvider),
|
wrapProvider(GrazProvider),
|
||||||
|
wrapProvider(PrivyWagmiConnector, { wagmiChainsConfig: config }),
|
||||||
wrapProvider(WagmiConfig, { config }),
|
wrapProvider(WagmiConfig, { config }),
|
||||||
wrapProvider(LocaleProvider),
|
wrapProvider(LocaleProvider),
|
||||||
wrapProvider(RestrictionProvider),
|
wrapProvider(RestrictionProvider),
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ import {
|
|||||||
PriceChartIcon,
|
PriceChartIcon,
|
||||||
PrivacyIcon,
|
PrivacyIcon,
|
||||||
QrIcon,
|
QrIcon,
|
||||||
|
RewardStarIcon,
|
||||||
SearchIcon,
|
SearchIcon,
|
||||||
SendIcon,
|
SendIcon,
|
||||||
ShareIcon,
|
ShareIcon,
|
||||||
@@ -134,6 +135,7 @@ export enum IconName {
|
|||||||
PriceChart = 'PriceChart',
|
PriceChart = 'PriceChart',
|
||||||
Privacy = 'Privacy',
|
Privacy = 'Privacy',
|
||||||
Qr = 'Qr',
|
Qr = 'Qr',
|
||||||
|
RewardStar = 'RewardStar',
|
||||||
Search = 'Search',
|
Search = 'Search',
|
||||||
Send = 'Send',
|
Send = 'Send',
|
||||||
Share = 'Share',
|
Share = 'Share',
|
||||||
@@ -208,6 +210,7 @@ const icons = {
|
|||||||
[IconName.PriceChart]: PriceChartIcon,
|
[IconName.PriceChart]: PriceChartIcon,
|
||||||
[IconName.Privacy]: PrivacyIcon,
|
[IconName.Privacy]: PrivacyIcon,
|
||||||
[IconName.Qr]: QrIcon,
|
[IconName.Qr]: QrIcon,
|
||||||
|
[IconName.RewardStar]: RewardStarIcon,
|
||||||
[IconName.Search]: SearchIcon,
|
[IconName.Search]: SearchIcon,
|
||||||
[IconName.Send]: SendIcon,
|
[IconName.Send]: SendIcon,
|
||||||
[IconName.Share]: ShareIcon,
|
[IconName.Share]: ShareIcon,
|
||||||
|
|||||||
@@ -27,9 +27,8 @@ export const ToastArea = ({ swipeDirection, children, className }: ToastAreaProp
|
|||||||
const $ToastArea = styled.aside`
|
const $ToastArea = styled.aside`
|
||||||
// Params
|
// Params
|
||||||
--toasts-gap: 0.5rem;
|
--toasts-gap: 0.5rem;
|
||||||
|
|
||||||
// Rules
|
// Rules
|
||||||
${layoutMixins.scrollArea}
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ export type AnalyticsEventData<T extends AnalyticsEvent> =
|
|||||||
elapsedTime?: number;
|
elapsedTime?: number;
|
||||||
blockHeight?: number;
|
blockHeight?: number;
|
||||||
indexerBlockHeight?: number;
|
indexerBlockHeight?: number;
|
||||||
|
trailingBlocks?: number;
|
||||||
}
|
}
|
||||||
: // Navigation
|
: // Navigation
|
||||||
T extends AnalyticsEvent.NavigatePage
|
T extends AnalyticsEvent.NavigatePage
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ export type NotificationDisplayData = {
|
|||||||
slotTitleLeft?: React.ReactNode;
|
slotTitleLeft?: React.ReactNode;
|
||||||
slotTitleRight?: React.ReactNode;
|
slotTitleRight?: React.ReactNode;
|
||||||
|
|
||||||
|
groupKey: string; // Grouping key toast notification stacking
|
||||||
|
|
||||||
// Overrides title/body for Notification in NotificationMenu
|
// Overrides title/body for Notification in NotificationMenu
|
||||||
renderCustomBody?: ({
|
renderCustomBody?: ({
|
||||||
isToast,
|
isToast,
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import { DydxNetwork, ENVIRONMENT_CONFIG_MAP } from './networks';
|
|||||||
export enum WalletConnectionType {
|
export enum WalletConnectionType {
|
||||||
CoinbaseWalletSdk = 'coinbaseWalletSdk',
|
CoinbaseWalletSdk = 'coinbaseWalletSdk',
|
||||||
CosmosSigner = 'CosmosSigner',
|
CosmosSigner = 'CosmosSigner',
|
||||||
|
Privy = 'Privy',
|
||||||
InjectedEip1193 = 'injectedEip1193',
|
InjectedEip1193 = 'injectedEip1193',
|
||||||
WalletConnect2 = 'walletConnect2',
|
WalletConnect2 = 'walletConnect2',
|
||||||
}
|
}
|
||||||
@@ -68,6 +69,9 @@ export const walletConnectionTypes: Record<WalletConnectionType, WalletConnectio
|
|||||||
[WalletConnectionType.CosmosSigner]: {
|
[WalletConnectionType.CosmosSigner]: {
|
||||||
name: 'CosmosSigner',
|
name: 'CosmosSigner',
|
||||||
},
|
},
|
||||||
|
[WalletConnectionType.Privy]: {
|
||||||
|
name: 'Privy',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Wallets
|
// Wallets
|
||||||
@@ -90,6 +94,7 @@ export enum WalletType {
|
|||||||
WalletConnect2 = 'WALLETCONNECT_2',
|
WalletConnect2 = 'WALLETCONNECT_2',
|
||||||
// TestWallet = 'TEST_WALLET',
|
// TestWallet = 'TEST_WALLET',
|
||||||
OtherWallet = 'OTHER_WALLET',
|
OtherWallet = 'OTHER_WALLET',
|
||||||
|
Privy = 'PRIVY',
|
||||||
}
|
}
|
||||||
|
|
||||||
const WALLET_CONNECT_EXPLORER_RECOMMENDED_WALLETS = {
|
const WALLET_CONNECT_EXPLORER_RECOMMENDED_WALLETS = {
|
||||||
@@ -243,6 +248,12 @@ export const wallets: Record<WalletType, WalletConfig> = {
|
|||||||
icon: KeplrIcon,
|
icon: KeplrIcon,
|
||||||
connectionTypes: [WalletConnectionType.CosmosSigner],
|
connectionTypes: [WalletConnectionType.CosmosSigner],
|
||||||
},
|
},
|
||||||
|
[WalletType.Privy]: {
|
||||||
|
type: WalletType.Privy,
|
||||||
|
stringKey: STRING_KEYS.KEPLR,
|
||||||
|
icon: GenericWalletIcon,
|
||||||
|
connectionTypes: [WalletConnectionType.Privy],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Injected EIP-1193 Providers
|
// Injected EIP-1193 Providers
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
import { useCallback, useContext, createContext, useEffect, useState, useMemo } from 'react';
|
import { useCallback, useContext, createContext, useEffect, useState, useMemo } from 'react';
|
||||||
|
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { AES, enc } from 'crypto-js';
|
import { AES, enc } from 'crypto-js';
|
||||||
import { NOBLE_BECH32_PREFIX, LocalWallet, type Subaccount } from '@dydxprotocol/v4-client-js';
|
import { NOBLE_BECH32_PREFIX, LocalWallet, type Subaccount } from '@dydxprotocol/v4-client-js';
|
||||||
|
|
||||||
import { OnboardingGuard, OnboardingState, type EvmDerivedAddresses } from '@/constants/account';
|
import { OnboardingGuard, OnboardingState, type EvmDerivedAddresses } from '@/constants/account';
|
||||||
import { DialogTypes } from '@/constants/dialogs';
|
import { DialogTypes } from '@/constants/dialogs';
|
||||||
import { LocalStorageKey, LOCAL_STORAGE_VERSIONS } from '@/constants/localStorage';
|
import { LocalStorageKey, LOCAL_STORAGE_VERSIONS } from '@/constants/localStorage';
|
||||||
import { DydxAddress, EvmAddress, PrivateInformation } from '@/constants/wallets';
|
import {
|
||||||
|
DydxAddress,
|
||||||
|
EvmAddress,
|
||||||
|
PrivateInformation,
|
||||||
|
WalletConnectionType,
|
||||||
|
getSignTypedData,
|
||||||
|
} from '@/constants/wallets';
|
||||||
|
|
||||||
import { setOnboardingState, setOnboardingGuard } from '@/state/account';
|
import { setOnboardingState, setOnboardingGuard } from '@/state/account';
|
||||||
import { forceOpenDialog } from '@/state/dialogs';
|
import { forceOpenDialog } from '@/state/dialogs';
|
||||||
@@ -20,6 +26,11 @@ import { useLocalStorage } from './useLocalStorage';
|
|||||||
import { useRestrictions } from './useRestrictions';
|
import { useRestrictions } from './useRestrictions';
|
||||||
import { useWalletConnection } from './useWalletConnection';
|
import { useWalletConnection } from './useWalletConnection';
|
||||||
|
|
||||||
|
import { useSignTypedData } from 'wagmi';
|
||||||
|
import { getSelectedNetwork } from '@/state/appSelectors';
|
||||||
|
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||||
|
import { usePrivy } from '@privy-io/react-auth';
|
||||||
|
|
||||||
const AccountsContext = createContext<ReturnType<typeof useAccountsContext> | undefined>(undefined);
|
const AccountsContext = createContext<ReturnType<typeof useAccountsContext> | undefined>(undefined);
|
||||||
|
|
||||||
AccountsContext.displayName = 'Accounts';
|
AccountsContext.displayName = 'Accounts';
|
||||||
@@ -153,6 +164,7 @@ const useAccountsContext = () => {
|
|||||||
|
|
||||||
// dYdX wallet / onboarding state
|
// dYdX wallet / onboarding state
|
||||||
const [localDydxWallet, setLocalDydxWallet] = useState<LocalWallet>();
|
const [localDydxWallet, setLocalDydxWallet] = useState<LocalWallet>();
|
||||||
|
const [localNobleWallet, setLocalNobleWallet] = useState<LocalWallet>();
|
||||||
const [hdKey, setHdKey] = useState<PrivateInformation>();
|
const [hdKey, setHdKey] = useState<PrivateInformation>();
|
||||||
|
|
||||||
const dydxAccounts = useMemo(() => localDydxWallet?.accounts, [localDydxWallet]);
|
const dydxAccounts = useMemo(() => localDydxWallet?.accounts, [localDydxWallet]);
|
||||||
@@ -162,6 +174,11 @@ const useAccountsContext = () => {
|
|||||||
[localDydxWallet]
|
[localDydxWallet]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const nobleAddress = useMemo(
|
||||||
|
() => localNobleWallet?.address,
|
||||||
|
[localNobleWallet]
|
||||||
|
);
|
||||||
|
|
||||||
const setWalletFromEvmSignature = async (signature: string) => {
|
const setWalletFromEvmSignature = async (signature: string) => {
|
||||||
const { wallet, mnemonic, privateKey, publicKey } = await getWalletFromEvmSignature({
|
const { wallet, mnemonic, privateKey, publicKey } = await getWalletFromEvmSignature({
|
||||||
signature,
|
signature,
|
||||||
@@ -176,6 +193,20 @@ const useAccountsContext = () => {
|
|||||||
}
|
}
|
||||||
}, [evmAddress, dydxAddress]);
|
}, [evmAddress, dydxAddress]);
|
||||||
|
|
||||||
|
const selectedNetwork = useSelector(getSelectedNetwork);
|
||||||
|
|
||||||
|
const chainId = Number(ENVIRONMENT_CONFIG_MAP[selectedNetwork].ethereumChainId);
|
||||||
|
|
||||||
|
const signTypedData = getSignTypedData(selectedNetwork);
|
||||||
|
const { signTypedDataAsync } = useSignTypedData({
|
||||||
|
...signTypedData,
|
||||||
|
domain: {
|
||||||
|
...signTypedData.domain,
|
||||||
|
chainId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const { ready, authenticated } = usePrivy();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
if (connectedDydxAddress && signerGraz) {
|
if (connectedDydxAddress && signerGraz) {
|
||||||
@@ -192,7 +223,17 @@ const useAccountsContext = () => {
|
|||||||
|
|
||||||
const evmDerivedAccount = evmDerivedAddresses[evmAddress];
|
const evmDerivedAccount = evmDerivedAddresses[evmAddress];
|
||||||
|
|
||||||
if (evmDerivedAccount?.encryptedSignature) {
|
if (walletConnectionType === WalletConnectionType.Privy && authenticated && ready) {
|
||||||
|
try {
|
||||||
|
const signature = await signTypedDataAsync();
|
||||||
|
|
||||||
|
await setWalletFromEvmSignature(signature);
|
||||||
|
dispatch(setOnboardingState(OnboardingState.AccountConnected));
|
||||||
|
} catch (error) {
|
||||||
|
log('useAccounts/decryptSignature', error);
|
||||||
|
forgetEvmSignature();
|
||||||
|
}
|
||||||
|
} else if (evmDerivedAccount?.encryptedSignature) {
|
||||||
try {
|
try {
|
||||||
const signature = decryptSignature(evmDerivedAccount.encryptedSignature);
|
const signature = decryptSignature(evmDerivedAccount.encryptedSignature);
|
||||||
|
|
||||||
@@ -211,7 +252,15 @@ const useAccountsContext = () => {
|
|||||||
dispatch(setOnboardingState(OnboardingState.Disconnected));
|
dispatch(setOnboardingState(OnboardingState.Disconnected));
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
}, [evmAddress, evmDerivedAddresses, signerWagmi, connectedDydxAddress, signerGraz]);
|
}, [
|
||||||
|
evmAddress,
|
||||||
|
evmDerivedAddresses,
|
||||||
|
signerWagmi,
|
||||||
|
connectedDydxAddress,
|
||||||
|
signerGraz,
|
||||||
|
authenticated,
|
||||||
|
ready,
|
||||||
|
]);
|
||||||
|
|
||||||
// abacus
|
// abacus
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -224,6 +273,7 @@ const useAccountsContext = () => {
|
|||||||
if (hdKey?.mnemonic) {
|
if (hdKey?.mnemonic) {
|
||||||
const nobleWallet = await LocalWallet.fromMnemonic(hdKey.mnemonic, NOBLE_BECH32_PREFIX);
|
const nobleWallet = await LocalWallet.fromMnemonic(hdKey.mnemonic, NOBLE_BECH32_PREFIX);
|
||||||
abacusStateManager.setNobleWallet(nobleWallet);
|
abacusStateManager.setNobleWallet(nobleWallet);
|
||||||
|
setLocalNobleWallet(nobleWallet);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
setNobleWallet();
|
setNobleWallet();
|
||||||
@@ -322,6 +372,7 @@ const useAccountsContext = () => {
|
|||||||
localDydxWallet,
|
localDydxWallet,
|
||||||
dydxAccounts,
|
dydxAccounts,
|
||||||
dydxAddress,
|
dydxAddress,
|
||||||
|
nobleAddress,
|
||||||
|
|
||||||
// Onboarding state
|
// Onboarding state
|
||||||
saveHasAcknowledgedTerms,
|
saveHasAcknowledgedTerms,
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export const useAnalytics = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// AnalyticsEvent.NetworkStatus
|
// AnalyticsEvent.NetworkStatus
|
||||||
const { height, indexerHeight, status } = useApiState();
|
const { height, indexerHeight, status, trailingBlocks} = useApiState();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (status) {
|
if (status) {
|
||||||
@@ -114,6 +114,7 @@ export const useAnalytics = () => {
|
|||||||
elapsedTime: lastSuccessfulIndexerRpcQuery && Date.now() - lastSuccessfulIndexerRpcQuery,
|
elapsedTime: lastSuccessfulIndexerRpcQuery && Date.now() - lastSuccessfulIndexerRpcQuery,
|
||||||
blockHeight: height ?? undefined,
|
blockHeight: height ?? undefined,
|
||||||
indexerBlockHeight: indexerHeight ?? undefined,
|
indexerBlockHeight: indexerHeight ?? undefined,
|
||||||
|
trailingBlocks: trailingBlocks ?? undefined
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [status]);
|
}, [status]);
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export const getIndexerHeight = (apiState: Nullable<AbacusApiState>) => {
|
|||||||
export const useApiState = () => {
|
export const useApiState = () => {
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
const apiState = useSelector(getApiState, shallowEqual);
|
const apiState = useSelector(getApiState, shallowEqual);
|
||||||
const { haltedBlock, height, status, trailingBlocks } = apiState ?? {};
|
const { haltedBlock, height, status, trailingBlocks} = apiState ?? {};
|
||||||
const statusErrorMessage = getStatusErrorMessage({ apiState, stringGetter });
|
const statusErrorMessage = getStatusErrorMessage({ apiState, stringGetter });
|
||||||
const indexerHeight = getIndexerHeight(apiState);
|
const indexerHeight = getIndexerHeight(apiState);
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export const useDisplayedWallets = () => {
|
|||||||
// WalletType.BitKeep,
|
// WalletType.BitKeep,
|
||||||
// WalletType.Coin98,
|
// WalletType.Coin98,
|
||||||
|
|
||||||
|
WalletType.Privy,
|
||||||
WalletType.OtherWallet,
|
WalletType.OtherWallet,
|
||||||
].filter(isTruthy);
|
].filter(isTruthy);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { useCallback, useEffect, useMemo } from 'react';
|
import { useCallback, useEffect, useMemo } from 'react';
|
||||||
import { useNetwork, useSwitchNetwork } from 'wagmi';
|
import { useNetwork, useSwitchNetwork } from 'wagmi';
|
||||||
|
import { useSwitchNetwork as useSwitchNetworkPrivy } from '@privy-io/wagmi-connector';
|
||||||
|
import { WalletConnectionType } from '@/constants/wallets';
|
||||||
|
|
||||||
|
import { useWalletConnection } from './useWalletConnection';
|
||||||
|
|
||||||
export const useMatchingEvmNetwork = ({
|
export const useMatchingEvmNetwork = ({
|
||||||
chainId,
|
chainId,
|
||||||
@@ -11,7 +15,10 @@ export const useMatchingEvmNetwork = ({
|
|||||||
onError?: (error: Error) => void;
|
onError?: (error: Error) => void;
|
||||||
}) => {
|
}) => {
|
||||||
const { chain } = useNetwork();
|
const { chain } = useNetwork();
|
||||||
|
const { walletConnectionType } = useWalletConnection();
|
||||||
const { isLoading, switchNetworkAsync } = useSwitchNetwork({ onError });
|
const { isLoading, switchNetworkAsync } = useSwitchNetwork({ onError });
|
||||||
|
const { isLoading: isLoadingPrivy, switchNetworkAsync: switchNetworkAsyncPrivy } =
|
||||||
|
useSwitchNetworkPrivy({ onError });
|
||||||
|
|
||||||
// If chainId is not a number, we can assume it is a non EVM compatible chain
|
// If chainId is not a number, we can assume it is a non EVM compatible chain
|
||||||
const isMatchingNetwork = useMemo(
|
const isMatchingNetwork = useMemo(
|
||||||
@@ -21,7 +28,11 @@ export const useMatchingEvmNetwork = ({
|
|||||||
|
|
||||||
const matchNetwork = useCallback(async () => {
|
const matchNetwork = useCallback(async () => {
|
||||||
if (!isMatchingNetwork) {
|
if (!isMatchingNetwork) {
|
||||||
await switchNetworkAsync?.(Number(chainId));
|
if (walletConnectionType === WalletConnectionType.Privy) {
|
||||||
|
await switchNetworkAsyncPrivy?.(Number(chainId));
|
||||||
|
} else {
|
||||||
|
await switchNetworkAsync?.(Number(chainId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [chainId, chain]);
|
}, [chainId, chain]);
|
||||||
|
|
||||||
@@ -34,6 +45,6 @@ export const useMatchingEvmNetwork = ({
|
|||||||
return {
|
return {
|
||||||
isMatchingNetwork,
|
isMatchingNetwork,
|
||||||
matchNetwork,
|
matchNetwork,
|
||||||
isSwitchingNetwork: isLoading,
|
isSwitchingNetwork: isLoading || isLoadingPrivy,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import { useLocalNotifications } from '@/hooks/useLocalNotifications';
|
|||||||
|
|
||||||
import { AssetIcon } from '@/components/AssetIcon';
|
import { AssetIcon } from '@/components/AssetIcon';
|
||||||
import { Icon, IconName } from '@/components/Icon';
|
import { Icon, IconName } from '@/components/Icon';
|
||||||
|
import { BlockRewardNotification } from '@/views/notifications/BlockRewardNotification';
|
||||||
import { TradeNotification } from '@/views/notifications/TradeNotification';
|
import { TradeNotification } from '@/views/notifications/TradeNotification';
|
||||||
import { TransferStatusNotification } from '@/views/notifications/TransferStatusNotification';
|
import { TransferStatusNotification } from '@/views/notifications/TransferStatusNotification';
|
||||||
|
|
||||||
@@ -80,6 +81,7 @@ export const notificationTypes: NotificationTypeConfig[] = [
|
|||||||
body: abacusNotif.text ? stringGetter({ key: abacusNotif.text, params }) : '',
|
body: abacusNotif.text ? stringGetter({ key: abacusNotif.text, params }) : '',
|
||||||
toastDuration: DEFAULT_TOAST_AUTO_CLOSE_MS,
|
toastDuration: DEFAULT_TOAST_AUTO_CLOSE_MS,
|
||||||
toastSensitivity: 'foreground',
|
toastSensitivity: 'foreground',
|
||||||
|
groupKey: abacusNotificationType,
|
||||||
renderCustomBody: ({ isToast, notification }) => (
|
renderCustomBody: ({ isToast, notification }) => (
|
||||||
<TradeNotification
|
<TradeNotification
|
||||||
isToast={isToast}
|
isToast={isToast}
|
||||||
@@ -93,6 +95,29 @@ export const notificationTypes: NotificationTypeConfig[] = [
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'blockReward': {
|
||||||
|
trigger(
|
||||||
|
abacusNotif.id,
|
||||||
|
{
|
||||||
|
icon: abacusNotif.image && <$Icon src={abacusNotif.image} alt="" />,
|
||||||
|
title: stringGetter({ key: abacusNotif.title }),
|
||||||
|
body: abacusNotif.text ? stringGetter({ key: abacusNotif.text, params }) : '',
|
||||||
|
toastDuration: DEFAULT_TOAST_AUTO_CLOSE_MS,
|
||||||
|
toastSensitivity: 'foreground',
|
||||||
|
groupKey: abacusNotificationType,
|
||||||
|
renderCustomBody: ({ isToast, notification }) => (
|
||||||
|
<BlockRewardNotification
|
||||||
|
isToast={isToast}
|
||||||
|
data={parsedData}
|
||||||
|
notification={notification}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
[abacusNotif.updateTimeInMilliseconds, abacusNotif.data],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
trigger(
|
trigger(
|
||||||
abacusNotif.id,
|
abacusNotif.id,
|
||||||
@@ -102,6 +127,7 @@ export const notificationTypes: NotificationTypeConfig[] = [
|
|||||||
body: abacusNotif.text ? stringGetter({ key: abacusNotif.text, params }) : '',
|
body: abacusNotif.text ? stringGetter({ key: abacusNotif.text, params }) : '',
|
||||||
toastDuration: DEFAULT_TOAST_AUTO_CLOSE_MS,
|
toastDuration: DEFAULT_TOAST_AUTO_CLOSE_MS,
|
||||||
toastSensitivity: 'foreground',
|
toastSensitivity: 'foreground',
|
||||||
|
groupKey: abacusNotificationType,
|
||||||
},
|
},
|
||||||
[abacusNotif.updateTimeInMilliseconds, abacusNotif.data]
|
[abacusNotif.updateTimeInMilliseconds, abacusNotif.data]
|
||||||
);
|
);
|
||||||
@@ -197,6 +223,7 @@ export const notificationTypes: NotificationTypeConfig[] = [
|
|||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
toastSensitivity: 'foreground',
|
toastSensitivity: 'foreground',
|
||||||
|
groupKey: NotificationType.SquidTransfer,
|
||||||
},
|
},
|
||||||
[isFinished]
|
[isFinished]
|
||||||
);
|
);
|
||||||
@@ -242,6 +269,7 @@ export const notificationTypes: NotificationTypeConfig[] = [
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
toastSensitivity: 'foreground',
|
toastSensitivity: 'foreground',
|
||||||
|
groupKey: NotificationType.ReleaseUpdates,
|
||||||
},
|
},
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { useCallback, useEffect, useState, useMemo } from 'react';
|
import { useCallback, useEffect, useState, useMemo } from 'react';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
|
import { usePrivy, useLogout } from '@privy-io/react-auth';
|
||||||
|
|
||||||
import { LocalStorageKey } from '@/constants/localStorage';
|
import { LocalStorageKey } from '@/constants/localStorage';
|
||||||
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||||
@@ -104,8 +105,10 @@ export const useWalletConnection = () => {
|
|||||||
[walletConnectConfig, walletType, walletConnectionType]
|
[walletConnectConfig, walletType, walletConnectionType]
|
||||||
);
|
);
|
||||||
|
|
||||||
const { connectAsync: connectWagmi } = useConnectWagmi({ connector: wagmiConnector })
|
const { connectAsync: connectWagmi } = useConnectWagmi({ connector: wagmiConnector });
|
||||||
const { suggestAndConnect: connectGraz } = useConnectGraz();
|
const { suggestAndConnect: connectGraz } = useConnectGraz();
|
||||||
|
const { login, ready, authenticated } = usePrivy();
|
||||||
|
const { logout } = useLogout();
|
||||||
|
|
||||||
const connectWallet = useCallback(
|
const connectWallet = useCallback(
|
||||||
async ({ walletType }: { walletType: WalletType }) => {
|
async ({ walletType }: { walletType: WalletType }) => {
|
||||||
@@ -114,6 +117,11 @@ export const useWalletConnection = () => {
|
|||||||
try {
|
try {
|
||||||
if (!walletConnection) {
|
if (!walletConnection) {
|
||||||
throw new Error('Onboarding: No wallet connection found.');
|
throw new Error('Onboarding: No wallet connection found.');
|
||||||
|
} else if (walletConnection.type === WalletConnectionType.Privy) {
|
||||||
|
|
||||||
|
if (!isConnectedWagmi && !authenticated && ready) {
|
||||||
|
login();
|
||||||
|
}
|
||||||
} else if (walletConnection.type === WalletConnectionType.CosmosSigner) {
|
} else if (walletConnection.type === WalletConnectionType.CosmosSigner) {
|
||||||
const cosmosWalletType = {
|
const cosmosWalletType = {
|
||||||
[WalletType.Keplr as string]: CosmosWalletType.KEPLR,
|
[WalletType.Keplr as string]: CosmosWalletType.KEPLR,
|
||||||
@@ -156,7 +164,7 @@ export const useWalletConnection = () => {
|
|||||||
walletConnectionType: walletConnection.type,
|
walletConnectionType: walletConnection.type,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
[isConnectedGraz, signerGraz, isConnectedWagmi, signerWagmi]
|
[isConnectedGraz, signerGraz, isConnectedWagmi, signerWagmi, login, ready, authenticated]
|
||||||
);
|
);
|
||||||
|
|
||||||
const disconnectWallet = useCallback(async () => {
|
const disconnectWallet = useCallback(async () => {
|
||||||
@@ -165,6 +173,7 @@ export const useWalletConnection = () => {
|
|||||||
|
|
||||||
if (isConnectedWagmi) await disconnectWagmi();
|
if (isConnectedWagmi) await disconnectWagmi();
|
||||||
if (isConnectedGraz) await disconnectGraz();
|
if (isConnectedGraz) await disconnectGraz();
|
||||||
|
if (authenticated) await logout();
|
||||||
}, [isConnectedGraz, isConnectedWagmi]);
|
}, [isConnectedGraz, isConnectedWagmi]);
|
||||||
|
|
||||||
// Wallet selection
|
// Wallet selection
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ export { default as PriceChartIcon } from './price-chart.svg';
|
|||||||
export { default as PrivacyIcon } from './privacy.svg';
|
export { default as PrivacyIcon } from './privacy.svg';
|
||||||
export { default as ProfileIcon } from './profile.svg';
|
export { default as ProfileIcon } from './profile.svg';
|
||||||
export { default as QrIcon } from './qr.svg';
|
export { default as QrIcon } from './qr.svg';
|
||||||
|
export { default as RewardStarIcon } from './reward-star.svg';
|
||||||
export { default as SearchIcon } from './search.svg';
|
export { default as SearchIcon } from './search.svg';
|
||||||
export { default as SendIcon } from './send.svg';
|
export { default as SendIcon } from './send.svg';
|
||||||
export { default as ShareIcon } from './share.svg';
|
export { default as ShareIcon } from './share.svg';
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 481 KiB |
+34
-59
@@ -1,7 +1,11 @@
|
|||||||
import { useMemo, useState } from 'react';
|
import { useState } from 'react';
|
||||||
import styled, { css } from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
|
|
||||||
import { NotificationStatus } from '@/constants/notifications';
|
import {
|
||||||
|
type Notification,
|
||||||
|
type NotificationDisplayData,
|
||||||
|
NotificationStatus,
|
||||||
|
} from '@/constants/notifications';
|
||||||
import { ButtonShape, ButtonSize } from '@/constants/buttons';
|
import { ButtonShape, ButtonSize } from '@/constants/buttons';
|
||||||
import { useNotifications } from '@/hooks/useNotifications';
|
import { useNotifications } from '@/hooks/useNotifications';
|
||||||
import { useBreakpoints } from '@/hooks/useBreakpoints';
|
import { useBreakpoints } from '@/hooks/useBreakpoints';
|
||||||
@@ -13,54 +17,31 @@ import { Toast } from '@/components/Toast';
|
|||||||
import { ToastArea } from '@/components/ToastArea';
|
import { ToastArea } from '@/components/ToastArea';
|
||||||
import { ToggleButton } from '@/components/ToggleButton';
|
import { ToggleButton } from '@/components/ToggleButton';
|
||||||
|
|
||||||
|
type ElementProps = {
|
||||||
|
notifications: {
|
||||||
|
notification: Notification<any, any>;
|
||||||
|
key: string;
|
||||||
|
displayData: NotificationDisplayData;
|
||||||
|
}[];
|
||||||
|
};
|
||||||
|
|
||||||
type StyleProps = {
|
type StyleProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const MAX_TOASTS = 10;
|
export const NotificationStack = ({ notifications, className }: ElementProps & StyleProps) => {
|
||||||
|
|
||||||
export const NotificationsToastArea = ({ className }: StyleProps) => {
|
|
||||||
const [shouldStackNotifications, setshouldStackNotifications] = useState(true);
|
const [shouldStackNotifications, setshouldStackNotifications] = useState(true);
|
||||||
|
|
||||||
const {
|
const { markUnseen, markSeen, onNotificationAction } = useNotifications();
|
||||||
notifications,
|
|
||||||
getKey,
|
|
||||||
getDisplayData,
|
|
||||||
markUnseen,
|
|
||||||
markSeen,
|
|
||||||
isMenuOpen,
|
|
||||||
onNotificationAction,
|
|
||||||
} = useNotifications();
|
|
||||||
|
|
||||||
const { isMobile } = useBreakpoints();
|
const { isMobile } = useBreakpoints();
|
||||||
const notificationMap = useMemo(() => {
|
const hasMultipleToasts = notifications.length > 1;
|
||||||
return (
|
|
||||||
Object.values(notifications)
|
|
||||||
// Sort by time of first trigger
|
|
||||||
.sort(
|
|
||||||
(n1, n2) =>
|
|
||||||
n1.timestamps[NotificationStatus.Triggered]! -
|
|
||||||
n2.timestamps[NotificationStatus.Triggered]!
|
|
||||||
)
|
|
||||||
.map((notification) => ({
|
|
||||||
notification,
|
|
||||||
key: getKey(notification),
|
|
||||||
displayData: getDisplayData(notification),
|
|
||||||
}))
|
|
||||||
.filter(
|
|
||||||
({ displayData, notification }) =>
|
|
||||||
displayData && notification.status < NotificationStatus.Unseen
|
|
||||||
)
|
|
||||||
.slice(-MAX_TOASTS)
|
|
||||||
);
|
|
||||||
}, [notifications, getKey, getDisplayData]);
|
|
||||||
|
|
||||||
if (isMenuOpen) return null;
|
|
||||||
|
|
||||||
const hasMultipleToasts = notificationMap.length > 1;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledToastArea swipeDirection={isMobile ? 'up' : 'right'} className={className}>
|
<StyledToastArea
|
||||||
|
swipeDirection={isMobile ? 'up' : 'right'}
|
||||||
|
className={className}
|
||||||
|
size={notifications.length}
|
||||||
|
>
|
||||||
{hasMultipleToasts && (
|
{hasMultipleToasts && (
|
||||||
<StyledToggleButton
|
<StyledToggleButton
|
||||||
shape={ButtonShape.Pill}
|
shape={ButtonShape.Pill}
|
||||||
@@ -72,12 +53,12 @@ export const NotificationsToastArea = ({ className }: StyleProps) => {
|
|||||||
</StyledToggleButton>
|
</StyledToggleButton>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{notificationMap.map(({ notification, key, displayData }, idx) => (
|
{notifications.map(({ notification, key, displayData }, idx) => (
|
||||||
<StyledToast
|
<StyledToast
|
||||||
key={key}
|
key={key}
|
||||||
isStacked={shouldStackNotifications}
|
isStacked={idx > 0 && shouldStackNotifications}
|
||||||
isOpen={notification.status < NotificationStatus.Unseen}
|
isOpen={notification.status < NotificationStatus.Unseen}
|
||||||
layer={notificationMap.length - 1 - idx}
|
layer={idx}
|
||||||
notification={notification}
|
notification={notification}
|
||||||
slotIcon={displayData.icon}
|
slotIcon={displayData.icon}
|
||||||
slotTitle={displayData.title}
|
slotTitle={displayData.title}
|
||||||
@@ -110,19 +91,13 @@ export const NotificationsToastArea = ({ className }: StyleProps) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const StyledToastArea = styled(ToastArea)`
|
const StyledToastArea = styled(ToastArea)<{ size: number }>`
|
||||||
position: absolute;
|
position: relative;
|
||||||
width: min(17.5rem, 100%);
|
${({ size }) =>
|
||||||
inset: 0 0 0 auto;
|
size &&
|
||||||
|
css`
|
||||||
padding: 0.75rem 0.75rem 0.75rem 0;
|
padding-bottom: calc(${size - 1} * 2px);
|
||||||
|
`}
|
||||||
mask-image: linear-gradient(to left, transparent, white 0.5rem);
|
|
||||||
|
|
||||||
@media ${breakpoints.mobile} {
|
|
||||||
width: 100%;
|
|
||||||
position: fixed;
|
|
||||||
}
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledToast = styled(Toast)<{ isStacked?: boolean; layer: number }>`
|
const StyledToast = styled(Toast)<{ isStacked?: boolean; layer: number }>`
|
||||||
@@ -133,7 +108,7 @@ const StyledToast = styled(Toast)<{ isStacked?: boolean; layer: number }>`
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: calc(${layer} * 2px);
|
top: calc(${layer} * 2px);
|
||||||
right: calc(${layer} * -2px);
|
right: 0;
|
||||||
`
|
`
|
||||||
: css`
|
: css`
|
||||||
margin-bottom: 0.75rem;
|
margin-bottom: 0.75rem;
|
||||||
@@ -145,7 +120,7 @@ const StyledToggleButton = styled(ToggleButton)<{ isPressed: boolean }>`
|
|||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 4px;
|
top: -0.5rem;
|
||||||
left: calc(50% - 0.75rem);
|
left: calc(50% - 0.75rem);
|
||||||
--button-width: 2rem;
|
--button-width: 2rem;
|
||||||
--button-height: 1rem;
|
--button-height: 1rem;
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
import { useMemo } from 'react';
|
||||||
|
import { groupBy } from 'lodash';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
import { breakpoints } from '@/styles';
|
||||||
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
|
|
||||||
|
import { NotificationStatus } from '@/constants/notifications';
|
||||||
|
import { useNotifications } from '@/hooks/useNotifications';
|
||||||
|
|
||||||
|
import { NotificationStack } from './NotifcationStack';
|
||||||
|
|
||||||
|
type StyleProps = {
|
||||||
|
className?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const MAX_TOASTS = 10;
|
||||||
|
|
||||||
|
export const NotificationsToastArea = ({ className }: StyleProps) => {
|
||||||
|
const { notifications, getKey, getDisplayData, isMenuOpen } = useNotifications();
|
||||||
|
|
||||||
|
const notificationMapByType = useMemo(() => {
|
||||||
|
const notificationMap = Object.values(notifications)
|
||||||
|
// Sort by time of first trigger
|
||||||
|
.sort(
|
||||||
|
(n1, n2) =>
|
||||||
|
n1.timestamps[NotificationStatus.Triggered]! -
|
||||||
|
n2.timestamps[NotificationStatus.Triggered]!
|
||||||
|
)
|
||||||
|
.map((notification) => ({
|
||||||
|
notification,
|
||||||
|
key: getKey(notification),
|
||||||
|
displayData: getDisplayData(notification),
|
||||||
|
}))
|
||||||
|
.filter(
|
||||||
|
({ displayData, notification }) =>
|
||||||
|
displayData && notification.status < NotificationStatus.Unseen
|
||||||
|
)
|
||||||
|
.slice(-MAX_TOASTS);
|
||||||
|
return groupBy(notificationMap, (notification) => notification.displayData?.groupKey);
|
||||||
|
}, [notifications, getKey, getDisplayData]);
|
||||||
|
|
||||||
|
if (isMenuOpen) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<StyledToastArea className={className}>
|
||||||
|
{Object.keys(notificationMapByType).map((groupKey) => (
|
||||||
|
<NotificationStack notifications={notificationMapByType[groupKey]} key={groupKey} />
|
||||||
|
))}
|
||||||
|
</StyledToastArea>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const StyledToastArea = styled.div`
|
||||||
|
${layoutMixins.scrollArea}
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
width: min(17.5rem, 100%);
|
||||||
|
inset: 0 0 0 auto;
|
||||||
|
|
||||||
|
padding: 0.75rem 0.75rem 0.75rem 0;
|
||||||
|
|
||||||
|
mask-image: linear-gradient(to left, transparent, white 0.5rem);
|
||||||
|
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
|
@media ${breakpoints.mobile} {
|
||||||
|
width: 100%;
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
`;
|
||||||
@@ -11,16 +11,16 @@ class TestFlags {
|
|||||||
const params = new URLSearchParams(queryParamsString);
|
const params = new URLSearchParams(queryParamsString);
|
||||||
|
|
||||||
for (const [key, value] of params) {
|
for (const [key, value] of params) {
|
||||||
this.queryParams[key] = value;
|
this.queryParams[key.toLowerCase()] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get displayInitializingMarkets() {
|
get displayInitializingMarkets() {
|
||||||
return !!this.queryParams.displayInitializingMarkets;
|
return !!this.queryParams.displayinitializingmarkets;
|
||||||
}
|
}
|
||||||
|
|
||||||
get withCCTP() {
|
get showMobileSignInOption() {
|
||||||
return !!this.queryParams.withCCTP;
|
return !!this.queryParams.mobilesignin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { createConfig, configureChains, mainnet, Chain } from 'wagmi';
|
import { createConfig, configureChains, mainnet, Chain } from 'wagmi';
|
||||||
import { goerli } from 'wagmi/chains';
|
import { goerli } from 'wagmi/chains';
|
||||||
|
import type { PrivyClientConfig } from '@privy-io/react-auth';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
arbitrum,
|
arbitrum,
|
||||||
@@ -85,6 +86,19 @@ export const WAGMI_SUPPORTED_CHAINS: Chain[] = [
|
|||||||
kava,
|
kava,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const privyConfig: PrivyClientConfig = {
|
||||||
|
embeddedWallets: {
|
||||||
|
createOnLogin: 'users-without-wallets',
|
||||||
|
requireUserPasswordOnCreate: true,
|
||||||
|
noPromptOnSignature: true,
|
||||||
|
},
|
||||||
|
loginMethods: ['email', 'sms', 'twitter', 'google', 'apple'],
|
||||||
|
appearance: {
|
||||||
|
theme: '#28283c',
|
||||||
|
},
|
||||||
|
defaultChain: sepolia
|
||||||
|
};
|
||||||
|
|
||||||
const { chains, publicClient, webSocketPublicClient } = configureChains(
|
const { chains, publicClient, webSocketPublicClient } = configureChains(
|
||||||
WAGMI_SUPPORTED_CHAINS,
|
WAGMI_SUPPORTED_CHAINS,
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -62,6 +62,12 @@ export const getWalletConnection = ({
|
|||||||
type: WalletConnectionType.CosmosSigner,
|
type: WalletConnectionType.CosmosSigner,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case WalletConnectionType.Privy: {
|
||||||
|
return {
|
||||||
|
type: WalletConnectionType.Privy,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ export const MarketDetails: React.FC = () => {
|
|||||||
if (!configs) return null;
|
if (!configs) return null;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
basePositionNotional,
|
|
||||||
tickSize,
|
tickSize,
|
||||||
stepSize,
|
stepSize,
|
||||||
initialMarginFraction,
|
initialMarginFraction,
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import { useState } from 'react';
|
|
||||||
import styled, { AnyStyledComponent } from 'styled-components';
|
import styled, { AnyStyledComponent } from 'styled-components';
|
||||||
import { useDispatch } from 'react-redux';
|
|
||||||
|
|
||||||
import { AlertType } from '@/constants/alerts';
|
import { AlertType } from '@/constants/alerts';
|
||||||
import { STRING_KEYS } from '@/constants/localization';
|
import { STRING_KEYS } from '@/constants/localization';
|
||||||
@@ -13,7 +11,7 @@ import { Button } from '@/components/Button';
|
|||||||
import { Icon } from '@/components/Icon';
|
import { Icon } from '@/components/Icon';
|
||||||
import { Link } from '@/components/Link';
|
import { Link } from '@/components/Link';
|
||||||
|
|
||||||
import { useAccounts, useStringGetter, useURLConfigs } from '@/hooks';
|
import { useAccounts, useBreakpoints, useStringGetter, useURLConfigs } from '@/hooks';
|
||||||
import { useDisplayedWallets } from '@/hooks/useDisplayedWallets';
|
import { useDisplayedWallets } from '@/hooks/useDisplayedWallets';
|
||||||
|
|
||||||
import { breakpoints } from '@/styles';
|
import { breakpoints } from '@/styles';
|
||||||
@@ -27,6 +25,8 @@ export const ChooseWallet = () => {
|
|||||||
|
|
||||||
const { selectWalletType, selectedWalletType, selectedWalletError } = useAccounts();
|
const { selectWalletType, selectedWalletType, selectedWalletError } = useAccounts();
|
||||||
|
|
||||||
|
const { isMobile } = useBreakpoints();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{selectedWalletType && selectedWalletError && (
|
{selectedWalletType && selectedWalletError && (
|
||||||
@@ -56,7 +56,11 @@ export const ChooseWallet = () => {
|
|||||||
slotLeft={<Styled.Icon iconComponent={wallets[walletType].icon} />}
|
slotLeft={<Styled.Icon iconComponent={wallets[walletType].icon} />}
|
||||||
size={ButtonSize.Small}
|
size={ButtonSize.Small}
|
||||||
>
|
>
|
||||||
<div>{stringGetter({ key: wallets[walletType].stringKey })}</div>
|
<div>
|
||||||
|
{walletType !== WalletType.Privy && import.meta.env.VITE_PRIVY_APP_ID
|
||||||
|
? stringGetter({ key: wallets[walletType].stringKey })
|
||||||
|
: `Socials ${isMobile ? '' : '(Email, SMS, etc.)'}`}
|
||||||
|
</div>
|
||||||
</Styled.WalletButton>
|
</Styled.WalletButton>
|
||||||
))}
|
))}
|
||||||
</Styled.Wallets>
|
</Styled.Wallets>
|
||||||
|
|||||||
@@ -34,11 +34,30 @@ export const ChainSelectMenu = ({ label, selectedChain, onSelectChain }: Element
|
|||||||
slotBefore: <Styled.Img src={chain.iconUrl} alt="" />,
|
slotBefore: <Styled.Img src={chain.iconUrl} alt="" />,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const selectedOption = chains.find((item) => item.type === selectedChain);
|
const selectedOption = selectedChain === 'coinbase' ? {
|
||||||
|
stringKey: 'Coinbase',
|
||||||
|
iconUrl: '/wallets/coinbase-wallet.png',
|
||||||
|
} : chains.find((item) => item.type === selectedChain);
|
||||||
|
|
||||||
|
const exchanges = [
|
||||||
|
{
|
||||||
|
value: 'coinbase',
|
||||||
|
label: 'Coinbase',
|
||||||
|
onSelect: () => {
|
||||||
|
onSelectChain('coinbase');
|
||||||
|
},
|
||||||
|
slotBefore: <Styled.Img src="/wallets/coinbase-wallet.png" alt="" />,
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SearchSelectMenu
|
<SearchSelectMenu
|
||||||
items={[
|
items={[
|
||||||
|
{
|
||||||
|
group: 'exchanges',
|
||||||
|
groupLabel: 'Exchanges',
|
||||||
|
items: exchanges,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
group: 'chains',
|
group: 'chains',
|
||||||
groupLabel: stringGetter({ key: STRING_KEYS.CHAINS }),
|
groupLabel: stringGetter({ key: STRING_KEYS.CHAINS }),
|
||||||
|
|||||||
@@ -38,12 +38,14 @@ import abacusStateManager from '@/lib/abacus';
|
|||||||
import { MustBigNumber } from '@/lib/numbers';
|
import { MustBigNumber } from '@/lib/numbers';
|
||||||
import { getNobleChainId, NATIVE_TOKEN_ADDRESS } from '@/lib/squid';
|
import { getNobleChainId, NATIVE_TOKEN_ADDRESS } from '@/lib/squid';
|
||||||
import { log } from '@/lib/telemetry';
|
import { log } from '@/lib/telemetry';
|
||||||
import { parseWalletError } from '@/lib/wallet';
|
import { parseWalletError, truncateAddress } from '@/lib/wallet';
|
||||||
|
|
||||||
import { ChainSelectMenu } from './ChainSelectMenu';
|
import { ChainSelectMenu } from './ChainSelectMenu';
|
||||||
import { TokenSelectMenu } from './TokenSelectMenu';
|
import { TokenSelectMenu } from './TokenSelectMenu';
|
||||||
|
|
||||||
import { DepositButtonAndReceipt } from './DepositForm/DepositButtonAndReceipt';
|
import { DepositButtonAndReceipt } from './DepositForm/DepositButtonAndReceipt';
|
||||||
|
import { QrCode } from '@/components/QrCode';
|
||||||
|
import { CopyButton } from '@/components/CopyButton';
|
||||||
|
|
||||||
type DepositFormProps = {
|
type DepositFormProps = {
|
||||||
onDeposit?: () => void;
|
onDeposit?: () => void;
|
||||||
@@ -55,8 +57,9 @@ export const DepositForm = ({ onDeposit, onError }: DepositFormProps) => {
|
|||||||
const [error, setError] = useState<Error | null>(null);
|
const [error, setError] = useState<Error | null>(null);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const { selectedNetwork } = useSelectedNetwork();
|
const { selectedNetwork } = useSelectedNetwork();
|
||||||
|
const [isCoinbase, setIsCoinbase] = useState(false);
|
||||||
|
|
||||||
const { evmAddress, signerWagmi, publicClientWagmi } = useAccounts();
|
const { evmAddress, signerWagmi, publicClientWagmi, nobleAddress } = useAccounts();
|
||||||
|
|
||||||
const { addTransferNotification } = useLocalNotifications();
|
const { addTransferNotification } = useLocalNotifications();
|
||||||
|
|
||||||
@@ -133,7 +136,10 @@ export const DepositForm = ({ onDeposit, onError }: DepositFormProps) => {
|
|||||||
}, [error]);
|
}, [error]);
|
||||||
|
|
||||||
const onSelectChain = useCallback((chain: string) => {
|
const onSelectChain = useCallback((chain: string) => {
|
||||||
if (chain) {
|
if (chain === 'coinbase') {
|
||||||
|
setIsCoinbase(true);
|
||||||
|
} else if (chain) {
|
||||||
|
setIsCoinbase(false);
|
||||||
abacusStateManager.clearTransferInputValues();
|
abacusStateManager.clearTransferInputValues();
|
||||||
abacusStateManager.setTransferValue({
|
abacusStateManager.setTransferValue({
|
||||||
field: TransferInputField.chain,
|
field: TransferInputField.chain,
|
||||||
@@ -364,9 +370,43 @@ export const DepositForm = ({ onDeposit, onError }: DepositFormProps) => {
|
|||||||
return <LoadingSpace id="DepositForm" />;
|
return <LoadingSpace id="DepositForm" />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isCoinbase) {
|
||||||
|
return (
|
||||||
|
<Styled.Form onSubmit={onSubmit}>
|
||||||
|
<ChainSelectMenu
|
||||||
|
selectedChain={isCoinbase ? 'coinbase' : chainIdStr || undefined}
|
||||||
|
onSelectChain={onSelectChain}
|
||||||
|
/>
|
||||||
|
{nobleAddress && (
|
||||||
|
<>
|
||||||
|
<Styled.ReceiveQr
|
||||||
|
side="bottom"
|
||||||
|
detailItems={[
|
||||||
|
{
|
||||||
|
key: 'nobleAddress',
|
||||||
|
label: "Noble Address",
|
||||||
|
value: nobleAddress,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<QrCode size={432} value={nobleAddress} />
|
||||||
|
</Styled.ReceiveQr>
|
||||||
|
<p>
|
||||||
|
* This address only supports transfers of USDC to the Noble chain.
|
||||||
|
</p>
|
||||||
|
<CopyButton value={nobleAddress} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Styled.Form>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Styled.Form onSubmit={onSubmit}>
|
<Styled.Form onSubmit={onSubmit}>
|
||||||
<ChainSelectMenu selectedChain={chainIdStr || undefined} onSelectChain={onSelectChain} />
|
<ChainSelectMenu
|
||||||
|
selectedChain={isCoinbase ? 'coinbase' : chainIdStr || undefined}
|
||||||
|
onSelectChain={onSelectChain}
|
||||||
|
/>
|
||||||
<TokenSelectMenu selectedToken={sourceToken || undefined} onSelectToken={onSelectToken} />
|
<TokenSelectMenu selectedToken={sourceToken || undefined} onSelectToken={onSelectToken} />
|
||||||
<Styled.WithDetailsReceipt side="bottom" detailItems={amountInputReceipt}>
|
<Styled.WithDetailsReceipt side="bottom" detailItems={amountInputReceipt}>
|
||||||
<FormInput
|
<FormInput
|
||||||
@@ -427,3 +467,13 @@ Styled.TransactionInfo = styled.span`
|
|||||||
Styled.FormInputButton = styled(Button)`
|
Styled.FormInputButton = styled(Button)`
|
||||||
${formMixins.inputInnerButton}
|
${formMixins.inputInnerButton}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
Styled.Exchange = styled.div`
|
||||||
|
${layoutMixins.flexColumn}
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.ReceiveQr = styled(WithDetailsReceipt)`
|
||||||
|
`;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export const WithdrawButtonAndReceipt = ({
|
|||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
|
|
||||||
const { leverage } = useSelector(getSubaccount, shallowEqual) || {};
|
const { leverage } = useSelector(getSubaccount, shallowEqual) || {};
|
||||||
const { isCctp, summary, requestPayload } = useSelector(getTransferInputs, shallowEqual) || {};
|
const { summary, requestPayload } = useSelector(getTransferInputs, shallowEqual) || {};
|
||||||
const canAccountTrade = useSelector(calculateCanAccountTrade, shallowEqual);
|
const canAccountTrade = useSelector(calculateCanAccountTrade, shallowEqual);
|
||||||
const { usdcLabel } = useTokenConfigs();
|
const { usdcLabel } = useTokenConfigs();
|
||||||
|
|
||||||
@@ -85,26 +85,6 @@ export const WithdrawButtonAndReceipt = ({
|
|||||||
|
|
||||||
const totalFees = (summary?.bridgeFee || 0) + (summary?.gasFee || 0);
|
const totalFees = (summary?.bridgeFee || 0) + (summary?.gasFee || 0);
|
||||||
|
|
||||||
const { toAmount, toAmountMin } = useMemo(() => {
|
|
||||||
if (isCctp) {
|
|
||||||
return {
|
|
||||||
toAmount: summary?.toAmount,
|
|
||||||
toAmountMin: summary?.toAmountMin,
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
toAmount:
|
|
||||||
summary?.toAmount &&
|
|
||||||
withdrawToken?.decimals &&
|
|
||||||
formatUnits(BigInt(summary.toAmount), withdrawToken.decimals),
|
|
||||||
toAmountMin:
|
|
||||||
summary?.toAmountMin &&
|
|
||||||
withdrawToken?.decimals &&
|
|
||||||
formatUnits(BigInt(summary.toAmountMin), withdrawToken.decimals),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}, [isCctp, summary, withdrawToken]);
|
|
||||||
|
|
||||||
const submitButtonReceipt = [
|
const submitButtonReceipt = [
|
||||||
{
|
{
|
||||||
key: 'total-fees',
|
key: 'total-fees',
|
||||||
@@ -153,7 +133,7 @@ export const WithdrawButtonAndReceipt = ({
|
|||||||
{withdrawToken && <Tag>{withdrawToken?.symbol}</Tag>}
|
{withdrawToken && <Tag>{withdrawToken?.symbol}</Tag>}
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
value: <Output type={OutputType.Asset} value={toAmount} fractionDigits={TOKEN_DECIMALS} />,
|
value: <Output type={OutputType.Asset} value={summary?.toAmount} fractionDigits={TOKEN_DECIMALS} />,
|
||||||
subitems: [
|
subitems: [
|
||||||
{
|
{
|
||||||
key: 'minimum-amount-received',
|
key: 'minimum-amount-received',
|
||||||
@@ -164,7 +144,7 @@ export const WithdrawButtonAndReceipt = ({
|
|||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
value: (
|
value: (
|
||||||
<Output type={OutputType.Asset} value={toAmountMin} fractionDigits={TOKEN_DECIMALS} />
|
<Output type={OutputType.Asset} value={summary?.toAmountMin} fractionDigits={TOKEN_DECIMALS} />
|
||||||
),
|
),
|
||||||
tooltip: 'minimum-amount-received',
|
tooltip: 'minimum-amount-received',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ import { STRING_KEYS, StringGetterFunction, TOOLTIP_STRING_KEYS } from '@/consta
|
|||||||
import { isMainnet } from '@/constants/networks';
|
import { isMainnet } from '@/constants/networks';
|
||||||
import { DydxChainAsset, wallets } from '@/constants/wallets';
|
import { DydxChainAsset, wallets } from '@/constants/wallets';
|
||||||
|
|
||||||
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
|
import { headerMixins } from '@/styles/headerMixins';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useAccounts,
|
useAccounts,
|
||||||
useBreakpoints,
|
useBreakpoints,
|
||||||
@@ -35,10 +38,8 @@ import { getOnboardingState, getSubaccount } from '@/state/accountSelectors';
|
|||||||
|
|
||||||
import { isTruthy } from '@/lib/isTruthy';
|
import { isTruthy } from '@/lib/isTruthy';
|
||||||
import { truncateAddress } from '@/lib/wallet';
|
import { truncateAddress } from '@/lib/wallet';
|
||||||
|
|
||||||
import { layoutMixins } from '@/styles/layoutMixins';
|
|
||||||
import { headerMixins } from '@/styles/headerMixins';
|
|
||||||
import { MustBigNumber } from '@/lib/numbers';
|
import { MustBigNumber } from '@/lib/numbers';
|
||||||
|
import { testFlags } from '@/lib/testFlags';
|
||||||
|
|
||||||
export const AccountMenu = () => {
|
export const AccountMenu = () => {
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
@@ -178,7 +179,7 @@ export const AccountMenu = () => {
|
|||||||
},
|
},
|
||||||
...(onboardingState === OnboardingState.AccountConnected && hdKey
|
...(onboardingState === OnboardingState.AccountConnected && hdKey
|
||||||
? [
|
? [
|
||||||
!isMainnet && {
|
(!isMainnet || testFlags.showMobileSignInOption) && {
|
||||||
value: 'MobileQrSignIn',
|
value: 'MobileQrSignIn',
|
||||||
icon: <Icon iconName={IconName.Qr} />,
|
icon: <Icon iconName={IconName.Qr} />,
|
||||||
label: stringGetter({ key: STRING_KEYS.TITLE_SIGN_INTO_MOBILE }),
|
label: stringGetter({ key: STRING_KEYS.TITLE_SIGN_INTO_MOBILE }),
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
import styled, { type AnyStyledComponent } from 'styled-components';
|
||||||
|
|
||||||
|
import { STRING_KEYS } from '@/constants/localization';
|
||||||
|
import { useStringGetter } from '@/hooks';
|
||||||
|
|
||||||
|
import { Details } from '@/components/Details';
|
||||||
|
import { Notification, NotificationProps } from '@/components/Notification';
|
||||||
|
import { Output, OutputType } from '@/components/Output';
|
||||||
|
import { Icon, IconName } from '@/components/Icon';
|
||||||
|
|
||||||
|
type ElementProps = {
|
||||||
|
data: {
|
||||||
|
BLOCK_REWARD_AMOUNT: string;
|
||||||
|
BLOCK_REWARD_HEIGHT: string;
|
||||||
|
BLOCK_REWARD_TIME_MILLISECONDS: string;
|
||||||
|
TOKEN_NAME: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export type BlockRewardNotificationProps = NotificationProps & ElementProps;
|
||||||
|
|
||||||
|
export const BlockRewardNotification = ({
|
||||||
|
isToast,
|
||||||
|
data,
|
||||||
|
notification,
|
||||||
|
}: BlockRewardNotificationProps) => {
|
||||||
|
const stringGetter = useStringGetter();
|
||||||
|
const { BLOCK_REWARD_AMOUNT, TOKEN_NAME } = data;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Styled.Notification
|
||||||
|
isToast={isToast}
|
||||||
|
notification={notification}
|
||||||
|
slotIcon={<Icon iconName={IconName.RewardStar} />}
|
||||||
|
slotTitle={stringGetter({ key: STRING_KEYS.TRADING_REWARD_RECEIVED })}
|
||||||
|
slotCustomContent={
|
||||||
|
<Styled.Details
|
||||||
|
items={[
|
||||||
|
{
|
||||||
|
key: 'block_reward',
|
||||||
|
label: stringGetter({ key: STRING_KEYS.BLOCK_REWARD }),
|
||||||
|
value: (
|
||||||
|
<Styled.Output
|
||||||
|
type={OutputType.Asset}
|
||||||
|
value={BLOCK_REWARD_AMOUNT}
|
||||||
|
tag={TOKEN_NAME}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const Styled: Record<string, AnyStyledComponent> = {};
|
||||||
|
|
||||||
|
Styled.Details = styled(Details)`
|
||||||
|
--details-item-height: 1.5rem;
|
||||||
|
|
||||||
|
dd {
|
||||||
|
color: var(--color-text-2);
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.Notification = styled(Notification)`
|
||||||
|
background-image: url('/dots-background-2.svg');
|
||||||
|
background-size: cover;
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.Output = styled(Output)`
|
||||||
|
&:before {
|
||||||
|
content: '+';
|
||||||
|
color: var(--color-positive);
|
||||||
|
margin-right: 0.5ch;
|
||||||
|
}
|
||||||
|
`;
|
||||||
@@ -2,6 +2,7 @@ import { defineConfig } from 'vite';
|
|||||||
import react from '@vitejs/plugin-react';
|
import react from '@vitejs/plugin-react';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import svgr from 'vite-plugin-svgr';
|
import svgr from 'vite-plugin-svgr';
|
||||||
|
import { VitePWA } from 'vite-plugin-pwa';
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig(({ mode }) => ({
|
export default defineConfig(({ mode }) => ({
|
||||||
@@ -50,6 +51,12 @@ export default defineConfig(({ mode }) => ({
|
|||||||
svgr({
|
svgr({
|
||||||
exportAsDefault: true,
|
exportAsDefault: true,
|
||||||
}),
|
}),
|
||||||
|
VitePWA({
|
||||||
|
registerType: 'autoUpdate',
|
||||||
|
devOptions: {
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
publicDir: 'public',
|
publicDir: 'public',
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user