Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1823690299 | ||
|
|
846c6ca608 | ||
|
|
e7da21962a | ||
|
|
b479531e34 | ||
|
|
0d4c5a547a | ||
|
|
5b235ee53f | ||
|
|
18dee0586b | ||
|
|
9f1f5987ee |
@@ -7,3 +7,4 @@ VITE_PK_ENCRYPTION_KEY=
|
|||||||
VITE_WALLETCONNECT2_PROJECT_ID=
|
VITE_WALLETCONNECT2_PROJECT_ID=
|
||||||
|
|
||||||
VITE_V3_TOKEN_ADDRESS=
|
VITE_V3_TOKEN_ADDRESS=
|
||||||
|
VITE_TOKEN_MIGRATION_URI=
|
||||||
+1
-1
@@ -39,7 +39,7 @@
|
|||||||
"@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": "^0.7.6",
|
"@dydxprotocol/v4-abacus": "^1.0.3",
|
||||||
"@dydxprotocol/v4-client-js": "^0.40.3",
|
"@dydxprotocol/v4-client-js": "^0.40.3",
|
||||||
"@dydxprotocol/v4-localization": "^0.1.32",
|
"@dydxprotocol/v4-localization": "^0.1.32",
|
||||||
"@ethersproject/providers": "^5.7.2",
|
"@ethersproject/providers": "^5.7.2",
|
||||||
|
|||||||
Generated
+4
-4
@@ -27,8 +27,8 @@ dependencies:
|
|||||||
specifier: ^0.31.0
|
specifier: ^0.31.0
|
||||||
version: 0.31.0
|
version: 0.31.0
|
||||||
'@dydxprotocol/v4-abacus':
|
'@dydxprotocol/v4-abacus':
|
||||||
specifier: ^0.7.6
|
specifier: ^1.0.3
|
||||||
version: 0.7.6
|
version: 1.0.3
|
||||||
'@dydxprotocol/v4-client-js':
|
'@dydxprotocol/v4-client-js':
|
||||||
specifier: ^0.40.3
|
specifier: ^0.40.3
|
||||||
version: 0.40.3
|
version: 0.40.3
|
||||||
@@ -979,8 +979,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-RpfLEtTlyIxeNPGKcokS+p3BZII/Q3bYxryFRglh5H3A3T8q9fsLYm72VYAMEOOIBLEa8o93kFLiBDUWKrwXZA==}
|
resolution: {integrity: sha512-RpfLEtTlyIxeNPGKcokS+p3BZII/Q3bYxryFRglh5H3A3T8q9fsLYm72VYAMEOOIBLEa8o93kFLiBDUWKrwXZA==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@dydxprotocol/v4-abacus@0.7.6:
|
/@dydxprotocol/v4-abacus@1.0.3:
|
||||||
resolution: {integrity: sha512-FdDXRaFMfxhyrJJs0dNrb1KG6X95lPHelua1yCn/SVgzwGaAqlJczrzmdh98INntuRAgIxOu69R5mCGyekumyg==}
|
resolution: {integrity: sha512-GuX37/DMMNSke8ZFcw52II7IVJfUgVGHqoi1Uw2cUb+hgIjjSG3OtbyRWedm5r6nqWq8BNLOexI0VVFB6OMVYg==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@dydxprotocol/v4-client-js@0.40.3:
|
/@dydxprotocol/v4-client-js@0.40.3:
|
||||||
|
|||||||
@@ -8,67 +8,43 @@
|
|||||||
],
|
],
|
||||||
"components": [
|
"components": [
|
||||||
{
|
{
|
||||||
"/": "/trade/*"
|
"/": "/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/r/*"
|
"/": "/#/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/overview"
|
"/": "*/markets"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/positions"
|
"/": "*/trade"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/orders"
|
"/": "*/trade/*"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/fees"
|
"/": "*/portfolio"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/history"
|
"/": "*/portfolio/overview"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/history/trades"
|
"/": "*/portfolio/positions"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/history/transfers"
|
"/": "*/portfolio/orders"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/portfolio/history/funding"
|
"/": "*/portfolio/fees"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/rewards"
|
"/": "*/portfolio/history/trades"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/my-profile"
|
"/": "*/portfolio/history/transfers"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/rankings/hedgies"
|
"/": "*/portfolio/history/funding"
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/competition"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/diamond"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/platinum"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/gold"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/silver"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/bronze"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/pnl-absolute"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"/": "/rankings/pnl-percent"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/walletsegue",
|
"/": "/walletsegue",
|
||||||
|
|||||||
+80
-11
@@ -25,7 +25,8 @@
|
|||||||
"dydxprotocol-testnet-dsrv",
|
"dydxprotocol-testnet-dsrv",
|
||||||
"dydxprotocol-testnet-nodefleet",
|
"dydxprotocol-testnet-nodefleet",
|
||||||
"dydxprotocol-testnet-kingnodes",
|
"dydxprotocol-testnet-kingnodes",
|
||||||
"dydxprotocol-testnet-liquify"
|
"dydxprotocol-testnet-liquify",
|
||||||
|
"dydxprotocol-testnet-polkachu"
|
||||||
],
|
],
|
||||||
"default": "dydxprotocol-testnet"
|
"default": "dydxprotocol-testnet"
|
||||||
}
|
}
|
||||||
@@ -307,10 +308,11 @@
|
|||||||
"tos": "https://dydx.exchange/v4-terms",
|
"tos": "https://dydx.exchange/v4-terms",
|
||||||
"privacy": "https://dydx.exchange/privacy",
|
"privacy": "https://dydx.exchange/privacy",
|
||||||
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
||||||
"documentation": "https://v4-teacher.vercel.app/",
|
"documentation": "https://docs.dydx.exchange/",
|
||||||
"community": "https://discord.com/invite/dydx",
|
"community": "https://discord.com/invite/dydx",
|
||||||
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
||||||
"blogs": "https://www.dydx.foundation/blog"
|
"blogs": "https://www.dydx.foundation/blog",
|
||||||
|
"help": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -370,10 +372,11 @@
|
|||||||
"tos": "https://dydx.exchange/v4-terms",
|
"tos": "https://dydx.exchange/v4-terms",
|
||||||
"privacy": "https://dydx.exchange/privacy",
|
"privacy": "https://dydx.exchange/privacy",
|
||||||
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
||||||
"documentation": "https://v4-teacher.vercel.app/",
|
"documentation": "https://docs.dydx.exchange/",
|
||||||
"community": "https://discord.com/invite/dydx",
|
"community": "https://discord.com/invite/dydx",
|
||||||
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
||||||
"blogs": "https://www.dydx.foundation/blog"
|
"blogs": "https://www.dydx.foundation/blog",
|
||||||
|
"help": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -424,6 +427,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"validators": [
|
"validators": [
|
||||||
|
"https://dydx-testnet-rpc.polkachu.com/",
|
||||||
"https://dydx-testnet.nodefleet.org",
|
"https://dydx-testnet.nodefleet.org",
|
||||||
"https://test-dydx.kingnodes.com",
|
"https://test-dydx.kingnodes.com",
|
||||||
"https://dydx-rpc.liquify.com/api=8878132/dydx"
|
"https://dydx-rpc.liquify.com/api=8878132/dydx"
|
||||||
@@ -435,7 +439,7 @@
|
|||||||
"tos": "https://dydx.exchange/v4-terms",
|
"tos": "https://dydx.exchange/v4-terms",
|
||||||
"privacy": "https://dydx.exchange/privacy",
|
"privacy": "https://dydx.exchange/privacy",
|
||||||
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
||||||
"documentation": "https://v4-teacher.vercel.app/",
|
"documentation": "https://docs.dydx.exchange/",
|
||||||
"community": "https://discord.com/invite/dydx",
|
"community": "https://discord.com/invite/dydx",
|
||||||
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
||||||
"blogs": "https://www.dydx.foundation/blog"
|
"blogs": "https://www.dydx.foundation/blog"
|
||||||
@@ -499,7 +503,7 @@
|
|||||||
"privacy": "https://dydx.exchange/privacy",
|
"privacy": "https://dydx.exchange/privacy",
|
||||||
"statusPage": "https://status.v4testnet.dydx.exchange/",
|
"statusPage": "https://status.v4testnet.dydx.exchange/",
|
||||||
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
||||||
"documentation": "https://v4-teacher.vercel.app/",
|
"documentation": "https://docs.dydx.exchange/",
|
||||||
"community": "https://discord.com/invite/dydx",
|
"community": "https://discord.com/invite/dydx",
|
||||||
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
||||||
"blogs": "https://www.dydx.foundation/blog"
|
"blogs": "https://www.dydx.foundation/blog"
|
||||||
@@ -563,7 +567,7 @@
|
|||||||
"privacy": "https://dydx.exchange/privacy",
|
"privacy": "https://dydx.exchange/privacy",
|
||||||
"statusPage": "https://status.v4testnet.dydx.exchange/",
|
"statusPage": "https://status.v4testnet.dydx.exchange/",
|
||||||
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
||||||
"documentation": "https://v4-teacher.vercel.app/",
|
"documentation": "https://docs.dydx.exchange/",
|
||||||
"community": "https://discord.com/invite/dydx",
|
"community": "https://discord.com/invite/dydx",
|
||||||
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
||||||
"blogs": "https://www.dydx.foundation/blog"
|
"blogs": "https://www.dydx.foundation/blog"
|
||||||
@@ -627,7 +631,7 @@
|
|||||||
"privacy": "https://dydx.exchange/privacy",
|
"privacy": "https://dydx.exchange/privacy",
|
||||||
"statusPage": "https://status.v4testnet.dydx.exchange/",
|
"statusPage": "https://status.v4testnet.dydx.exchange/",
|
||||||
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
||||||
"documentation": "https://v4-teacher.vercel.app/",
|
"documentation": "https://docs.dydx.exchange/",
|
||||||
"community": "https://discord.com/invite/dydx",
|
"community": "https://discord.com/invite/dydx",
|
||||||
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
||||||
"blogs": "https://www.dydx.foundation/blog"
|
"blogs": "https://www.dydx.foundation/blog"
|
||||||
@@ -691,7 +695,7 @@
|
|||||||
"privacy": "https://dydx.exchange/privacy",
|
"privacy": "https://dydx.exchange/privacy",
|
||||||
"statusPage": "https://status.v4testnet.dydx.exchange/",
|
"statusPage": "https://status.v4testnet.dydx.exchange/",
|
||||||
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
||||||
"documentation": "https://v4-teacher.vercel.app/",
|
"documentation": "https://docs.dydx.exchange/",
|
||||||
"community": "https://discord.com/invite/dydx",
|
"community": "https://discord.com/invite/dydx",
|
||||||
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
||||||
"blogs": "https://www.dydx.foundation/blog"
|
"blogs": "https://www.dydx.foundation/blog"
|
||||||
@@ -750,6 +754,70 @@
|
|||||||
"0xsquid": "https://testnet.api.squidrouter.com",
|
"0xsquid": "https://testnet.api.squidrouter.com",
|
||||||
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
||||||
},
|
},
|
||||||
|
"links": {
|
||||||
|
"tos": "https://dydx.exchange/v4-terms",
|
||||||
|
"privacy": "https://dydx.exchange/privacy",
|
||||||
|
"statusPage": "https://status.v4testnet.dydx.exchange/",
|
||||||
|
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
|
||||||
|
"documentation": "https://docs.dydx.exchange/",
|
||||||
|
"community": "https://discord.com/invite/dydx",
|
||||||
|
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
||||||
|
"blogs": "https://www.dydx.foundation/blog"
|
||||||
|
},
|
||||||
|
"wallets": {
|
||||||
|
"walletconnect": {
|
||||||
|
"client": {
|
||||||
|
"name": "dYdX v4",
|
||||||
|
"description": "dYdX v4 App",
|
||||||
|
"iconUrl": "/logos/dydx-x.png"
|
||||||
|
},
|
||||||
|
"v2": {
|
||||||
|
"projectId": "47559b2ec96c09aed9ff2cb54a31ab0e"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"walletSegue": {
|
||||||
|
"callbackUrl": "/walletsegue"
|
||||||
|
},
|
||||||
|
"images": "/wallets/",
|
||||||
|
"signTypedDataAction": "dYdX Chain Onboarding",
|
||||||
|
"signTypedDataDomainName": "dYdX V4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dydxprotocol-testnet-polkachu": {
|
||||||
|
"name": "v4 Public Testnet/Polkahcu",
|
||||||
|
"ethereumChainId": "5",
|
||||||
|
"dydxChainId": "dydx-testnet-4",
|
||||||
|
"chainName": "dYdX Chain",
|
||||||
|
"chainLogo": "dydx-chain.png",
|
||||||
|
"isMainNet": false,
|
||||||
|
"tokens": {
|
||||||
|
"chain": {
|
||||||
|
"name": "Dv4TNT",
|
||||||
|
"denom": "adv4tnt",
|
||||||
|
"decimals": 18,
|
||||||
|
"image": "/currencies/dydx.png"
|
||||||
|
},
|
||||||
|
"usdc": {
|
||||||
|
"name": "USDC",
|
||||||
|
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
|
||||||
|
"gasDenom": "uusdc",
|
||||||
|
"decimals": 6,
|
||||||
|
"image": "/currencies/usdc.png"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"endpoints": {
|
||||||
|
"indexers": [
|
||||||
|
{
|
||||||
|
"api": "https://dydx-testnet.imperator.co",
|
||||||
|
"socket": "wss://dydx-testnet.imperator.co"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"validators": [
|
||||||
|
"https://dydx-testnet-rpc.polkachu.com/"
|
||||||
|
],
|
||||||
|
"0xsquid": "https://testnet.api.squidrouter.com",
|
||||||
|
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
||||||
|
},
|
||||||
"links": {
|
"links": {
|
||||||
"tos": "https://dydx.exchange/v4-terms",
|
"tos": "https://dydx.exchange/v4-terms",
|
||||||
"privacy": "https://dydx.exchange/privacy",
|
"privacy": "https://dydx.exchange/privacy",
|
||||||
@@ -822,7 +890,8 @@
|
|||||||
"documentation": "[HTTP link to documentation, can be null]",
|
"documentation": "[HTTP link to documentation, can be null]",
|
||||||
"community": "[HTTP link to community, can be null]",
|
"community": "[HTTP link to community, can be null]",
|
||||||
"feedback": "[HTTP link to feedback form, can be null]",
|
"feedback": "[HTTP link to feedback form, can be null]",
|
||||||
"blogs": "[HTTP link to blogs, can be null]"
|
"blogs": "[HTTP link to blogs, can be null]",
|
||||||
|
"help": "[HTTP link to help page, can be null]"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
|
|||||||
+10
-1
@@ -24,9 +24,10 @@ import {
|
|||||||
CommentIcon,
|
CommentIcon,
|
||||||
CopyIcon,
|
CopyIcon,
|
||||||
CubeIcon,
|
CubeIcon,
|
||||||
|
DepositIcon,
|
||||||
|
DepthChartIcon,
|
||||||
DiscordIcon,
|
DiscordIcon,
|
||||||
EtherscanIcon,
|
EtherscanIcon,
|
||||||
DepthChartIcon,
|
|
||||||
ExportKeysIcon,
|
ExportKeysIcon,
|
||||||
FeedbackIcon,
|
FeedbackIcon,
|
||||||
FileIcon,
|
FileIcon,
|
||||||
@@ -40,6 +41,7 @@ import {
|
|||||||
LockIcon,
|
LockIcon,
|
||||||
LogoShortIcon,
|
LogoShortIcon,
|
||||||
MenuIcon,
|
MenuIcon,
|
||||||
|
MigrateIcon,
|
||||||
MintscanIcon,
|
MintscanIcon,
|
||||||
OrderbookIcon,
|
OrderbookIcon,
|
||||||
OrderCanceledIcon,
|
OrderCanceledIcon,
|
||||||
@@ -68,6 +70,7 @@ import {
|
|||||||
WarningIcon,
|
WarningIcon,
|
||||||
WebsiteIcon,
|
WebsiteIcon,
|
||||||
WhitepaperIcon,
|
WhitepaperIcon,
|
||||||
|
WithdrawIcon,
|
||||||
} from '@/icons';
|
} from '@/icons';
|
||||||
|
|
||||||
export enum IconName {
|
export enum IconName {
|
||||||
@@ -92,6 +95,7 @@ export enum IconName {
|
|||||||
Comment = 'Comment',
|
Comment = 'Comment',
|
||||||
Copy = 'Copy',
|
Copy = 'Copy',
|
||||||
Cube = 'Cube',
|
Cube = 'Cube',
|
||||||
|
Deposit = 'Deposit',
|
||||||
DepthChart = 'DepthChart',
|
DepthChart = 'DepthChart',
|
||||||
Discord = 'Discord',
|
Discord = 'Discord',
|
||||||
Etherscan = 'Etherscan',
|
Etherscan = 'Etherscan',
|
||||||
@@ -108,6 +112,7 @@ export enum IconName {
|
|||||||
Lock = 'Lock',
|
Lock = 'Lock',
|
||||||
LogoShort = 'LogoShort',
|
LogoShort = 'LogoShort',
|
||||||
Menu = 'Menu',
|
Menu = 'Menu',
|
||||||
|
Migrate = 'Migrate',
|
||||||
Mintscan = 'Mintscan',
|
Mintscan = 'Mintscan',
|
||||||
Onboarding = 'Onboarding',
|
Onboarding = 'Onboarding',
|
||||||
Orderbook = 'OrderbookIcon',
|
Orderbook = 'OrderbookIcon',
|
||||||
@@ -137,6 +142,7 @@ export enum IconName {
|
|||||||
Warning = 'Warning',
|
Warning = 'Warning',
|
||||||
Website = 'Website',
|
Website = 'Website',
|
||||||
Whitepaper = 'Whitepaper',
|
Whitepaper = 'Whitepaper',
|
||||||
|
Withdraw = 'Withdraw',
|
||||||
}
|
}
|
||||||
|
|
||||||
const icons = {
|
const icons = {
|
||||||
@@ -161,6 +167,7 @@ const icons = {
|
|||||||
[IconName.Comment]: CommentIcon,
|
[IconName.Comment]: CommentIcon,
|
||||||
[IconName.Copy]: CopyIcon,
|
[IconName.Copy]: CopyIcon,
|
||||||
[IconName.Cube]: CubeIcon,
|
[IconName.Cube]: CubeIcon,
|
||||||
|
[IconName.Deposit]: DepositIcon,
|
||||||
[IconName.DepthChart]: DepthChartIcon,
|
[IconName.DepthChart]: DepthChartIcon,
|
||||||
[IconName.Discord]: DiscordIcon,
|
[IconName.Discord]: DiscordIcon,
|
||||||
[IconName.Etherscan]: EtherscanIcon,
|
[IconName.Etherscan]: EtherscanIcon,
|
||||||
@@ -177,6 +184,7 @@ const icons = {
|
|||||||
[IconName.Lock]: LockIcon,
|
[IconName.Lock]: LockIcon,
|
||||||
[IconName.LogoShort]: LogoShortIcon,
|
[IconName.LogoShort]: LogoShortIcon,
|
||||||
[IconName.Menu]: MenuIcon,
|
[IconName.Menu]: MenuIcon,
|
||||||
|
[IconName.Migrate]: MigrateIcon,
|
||||||
[IconName.Mintscan]: MintscanIcon,
|
[IconName.Mintscan]: MintscanIcon,
|
||||||
[IconName.Orderbook]: OrderbookIcon,
|
[IconName.Orderbook]: OrderbookIcon,
|
||||||
[IconName.OrderCanceled]: OrderCanceledIcon,
|
[IconName.OrderCanceled]: OrderCanceledIcon,
|
||||||
@@ -205,6 +213,7 @@ const icons = {
|
|||||||
[IconName.Warning]: WarningIcon,
|
[IconName.Warning]: WarningIcon,
|
||||||
[IconName.Website]: WebsiteIcon,
|
[IconName.Website]: WebsiteIcon,
|
||||||
[IconName.Whitepaper]: WhitepaperIcon,
|
[IconName.Whitepaper]: WhitepaperIcon,
|
||||||
|
[IconName.Withdraw]: WithdrawIcon,
|
||||||
} as Record<IconName, ElementType>;
|
} as Record<IconName, ElementType>;
|
||||||
|
|
||||||
type ElementProps = {
|
type ElementProps = {
|
||||||
|
|||||||
+32
-25
@@ -8,6 +8,7 @@ import { layoutMixins } from '@/styles/layoutMixins';
|
|||||||
type PanelProps = {
|
type PanelProps = {
|
||||||
slotHeaderContent?: string;
|
slotHeaderContent?: string;
|
||||||
slotHeader?: React.ReactNode;
|
slotHeader?: React.ReactNode;
|
||||||
|
slotRight?: React.ReactNode;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
href?: string;
|
href?: string;
|
||||||
onHeaderClick?: () => void;
|
onHeaderClick?: () => void;
|
||||||
@@ -22,6 +23,7 @@ type PanelStyleProps = {
|
|||||||
export const Panel = ({
|
export const Panel = ({
|
||||||
slotHeaderContent,
|
slotHeaderContent,
|
||||||
slotHeader,
|
slotHeader,
|
||||||
|
slotRight,
|
||||||
children,
|
children,
|
||||||
href,
|
href,
|
||||||
onHeaderClick,
|
onHeaderClick,
|
||||||
@@ -30,55 +32,61 @@ export const Panel = ({
|
|||||||
className,
|
className,
|
||||||
}: PanelProps & PanelStyleProps) => (
|
}: PanelProps & PanelStyleProps) => (
|
||||||
<Styled.Panel onClick={onClick}>
|
<Styled.Panel onClick={onClick}>
|
||||||
{href ? (
|
<Styled.Left>
|
||||||
<Link to={href}>
|
{href ? (
|
||||||
{slotHeader ? (
|
<Link to={href}>
|
||||||
slotHeader
|
{slotHeader ? (
|
||||||
) : (
|
slotHeader
|
||||||
|
) : (
|
||||||
|
<Styled.Header role="button" onClick={onHeaderClick} hasSeparator={hasSeparator}>
|
||||||
|
{slotHeaderContent}
|
||||||
|
<Styled.Icon iconName={IconName.ChevronRight} />
|
||||||
|
</Styled.Header>
|
||||||
|
)}
|
||||||
|
</Link>
|
||||||
|
) : slotHeader ? (
|
||||||
|
slotHeader
|
||||||
|
) : (
|
||||||
|
slotHeaderContent && (
|
||||||
<Styled.Header role="button" onClick={onHeaderClick} hasSeparator={hasSeparator}>
|
<Styled.Header role="button" onClick={onHeaderClick} hasSeparator={hasSeparator}>
|
||||||
{slotHeaderContent}
|
{slotHeaderContent}
|
||||||
<Styled.Icon iconName={IconName.ChevronRight} />
|
|
||||||
</Styled.Header>
|
</Styled.Header>
|
||||||
)}
|
)
|
||||||
</Link>
|
)}
|
||||||
) : slotHeader ? (
|
<Styled.Content className={className}>{children}</Styled.Content>
|
||||||
slotHeader
|
</Styled.Left>
|
||||||
) : (
|
{slotRight}
|
||||||
slotHeaderContent && (
|
|
||||||
<Styled.Header role="button" onClick={onHeaderClick} hasSeparator={hasSeparator}>
|
|
||||||
{slotHeaderContent}
|
|
||||||
</Styled.Header>
|
|
||||||
)
|
|
||||||
)}
|
|
||||||
<Styled.Content className={className}>{children}</Styled.Content>
|
|
||||||
</Styled.Panel>
|
</Styled.Panel>
|
||||||
);
|
);
|
||||||
|
|
||||||
const Styled: Record<string, AnyStyledComponent> = {};
|
const Styled: Record<string, AnyStyledComponent> = {};
|
||||||
|
|
||||||
Styled.Panel = styled.section`
|
Styled.Panel = styled.section`
|
||||||
${layoutMixins.flexColumn}
|
${layoutMixins.row}
|
||||||
|
|
||||||
background-color: var(--color-layer-3);
|
background-color: var(--color-layer-3);
|
||||||
border-radius: 0.875rem;
|
border-radius: 0.875rem;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
Styled.Left = styled.div`
|
||||||
|
${layoutMixins.flexColumn}
|
||||||
|
width: 100%;
|
||||||
|
`;
|
||||||
|
|
||||||
Styled.Header = styled.header<{ hasSeparator?: boolean }>`
|
Styled.Header = styled.header<{ hasSeparator?: boolean }>`
|
||||||
${layoutMixins.spacedRow}
|
${layoutMixins.spacedRow}
|
||||||
|
padding: 1rem 1rem;
|
||||||
padding: 0.875rem 1rem 0.625rem;
|
|
||||||
font-size: 0.875rem;
|
|
||||||
|
|
||||||
${({ hasSeparator }) =>
|
${({ hasSeparator }) =>
|
||||||
hasSeparator &&
|
hasSeparator &&
|
||||||
css`
|
css`
|
||||||
|
padding-bottom: 0.625rem;
|
||||||
box-shadow: 0 var(--border-width) var(--border-color);
|
box-shadow: 0 var(--border-width) var(--border-color);
|
||||||
`}
|
`}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Icon = styled(Icon)`
|
Styled.Icon = styled(Icon)`
|
||||||
color: var(--color-text-0);
|
color: var(--color-text-0);
|
||||||
|
|
||||||
font-size: 0.625rem;
|
font-size: 0.625rem;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -86,6 +94,5 @@ Styled.Content = styled.div`
|
|||||||
${layoutMixins.scrollArea}
|
${layoutMixins.scrollArea}
|
||||||
${layoutMixins.stickyArea0}
|
${layoutMixins.stickyArea0}
|
||||||
--stickyArea0-background: transparent;
|
--stickyArea0-background: transparent;
|
||||||
|
padding: 1rem 1rem;
|
||||||
padding: 0.5rem 1rem;
|
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
||||||
|
<g clip-path="url(#clip0_18204_36775)">
|
||||||
|
<path d="M13.2426 6.25736C14.0817 7.09647 14.6531 8.16557 14.8846 9.32946C15.1162 10.4933 14.9973 11.6997 14.5432 12.7961C14.0891 13.8925 13.32 14.8295 12.3334 15.4888C11.3467 16.1481 10.1866 16.5 8.99993 16.5C7.81324 16.5 6.6532 16.1481 5.66651 15.4888C4.67981 14.8295 3.91078 13.8925 3.45665 12.7961C3.00253 11.6997 2.88371 10.4933 3.11522 9.32946C3.34673 8.16557 3.91817 7.09647 4.75729 6.25736" stroke="#C8C7D8" stroke-width="1.35" stroke-linecap="round"/>
|
||||||
|
<path d="M11.25 9L9 11.25M9 11.25L6.75 9M9 11.25V1.6875" stroke="#C8C7D8" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_18204_36775">
|
||||||
|
<rect width="18" height="18" fill="white"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 886 B |
@@ -19,6 +19,7 @@ export { default as CoinsIcon } from './coins.svg';
|
|||||||
export { default as CommentIcon } from './comment.svg';
|
export { default as CommentIcon } from './comment.svg';
|
||||||
export { default as CopyIcon } from './copy.svg';
|
export { default as CopyIcon } from './copy.svg';
|
||||||
export { default as CubeIcon } from './cube.svg';
|
export { default as CubeIcon } from './cube.svg';
|
||||||
|
export { default as DepositIcon } from './deposit.svg';
|
||||||
export { default as DepthChartIcon } from './depth-chart.svg';
|
export { default as DepthChartIcon } from './depth-chart.svg';
|
||||||
export { default as DiscordIcon } from './discord.svg';
|
export { default as DiscordIcon } from './discord.svg';
|
||||||
export { default as ExportKeysIcon } from './export-keys.svg';
|
export { default as ExportKeysIcon } from './export-keys.svg';
|
||||||
@@ -35,6 +36,7 @@ export { default as LockIcon } from './lock.svg';
|
|||||||
export { default as LogoShortIcon } from './logo-short';
|
export { default as LogoShortIcon } from './logo-short';
|
||||||
export { default as MarketsIcon } from './markets.svg';
|
export { default as MarketsIcon } from './markets.svg';
|
||||||
export { default as MenuIcon } from './menu.svg';
|
export { default as MenuIcon } from './menu.svg';
|
||||||
|
export { default as MigrateIcon } from './migrate.svg';
|
||||||
export { default as MintscanIcon } from './logos/mintscan.svg';
|
export { default as MintscanIcon } from './logos/mintscan.svg';
|
||||||
export { default as OrderbookIcon } from './orderbook.svg';
|
export { default as OrderbookIcon } from './orderbook.svg';
|
||||||
export { default as OverviewIcon } from './overview.svg';
|
export { default as OverviewIcon } from './overview.svg';
|
||||||
@@ -58,6 +60,7 @@ export { default as TransferIcon } from './transfer.svg';
|
|||||||
export { default as TriangleIcon } from './triangle.svg';
|
export { default as TriangleIcon } from './triangle.svg';
|
||||||
export { default as TryAgainIcon } from './try-again.svg';
|
export { default as TryAgainIcon } from './try-again.svg';
|
||||||
export { default as WarningIcon } from './warning.svg';
|
export { default as WarningIcon } from './warning.svg';
|
||||||
|
export { default as WithdrawIcon } from './withdraw.svg';
|
||||||
|
|
||||||
// Wallets
|
// Wallets
|
||||||
export { default as BitkeepIcon } from './wallets/bitkeep.svg';
|
export { default as BitkeepIcon } from './wallets/bitkeep.svg';
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 694 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
||||||
|
<path d="M13.2426 6.2573C14.0817 7.09641 14.6531 8.16551 14.8846 9.3294C15.1162 10.4933 14.9973 11.6997 14.5432 12.796C14.0891 13.8924 13.32 14.8295 12.3334 15.4888C11.3467 16.148 10.1866 16.4999 8.99993 16.4999C7.81324 16.4999 6.6532 16.148 5.66651 15.4888C4.67981 14.8295 3.91078 13.8924 3.45665 12.796C3.00253 11.6997 2.88371 10.4933 3.11522 9.3294C3.34673 8.16551 3.91817 7.09641 4.75729 6.2573" stroke="#C8C7D8" stroke-width="1.35" stroke-linecap="round"/>
|
||||||
|
<path d="M11.25 2.9375L9 0.6875M9 0.6875L6.75 2.9375M9 0.6875V10.25" stroke="#C8C7D8" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 723 B |
@@ -62,7 +62,7 @@ export const HeaderDesktop = () => {
|
|||||||
value: 'DOCUMENTATION',
|
value: 'DOCUMENTATION',
|
||||||
slotBefore: <Icon iconName={IconName.Terminal} />,
|
slotBefore: <Icon iconName={IconName.Terminal} />,
|
||||||
label: stringGetter({ key: STRING_KEYS.DOCUMENTATION }),
|
label: stringGetter({ key: STRING_KEYS.DOCUMENTATION }),
|
||||||
href: 'https://v4-teacher.vercel.app/',
|
href: 'https://docs.dydx.exchange/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'MINTSCAN',
|
value: 'MINTSCAN',
|
||||||
|
|||||||
+16
-8
@@ -46,6 +46,8 @@ import {
|
|||||||
WALLET_CONNECT_EXPLORER_RECOMMENDED_IDS,
|
WALLET_CONNECT_EXPLORER_RECOMMENDED_IDS,
|
||||||
} from '@/constants/wallets';
|
} from '@/constants/wallets';
|
||||||
|
|
||||||
|
import { isTruthy } from './isTruthy';
|
||||||
|
|
||||||
// Config
|
// Config
|
||||||
|
|
||||||
export const WAGMI_SUPPORTED_CHAINS: Chain[] = [
|
export const WAGMI_SUPPORTED_CHAINS: Chain[] = [
|
||||||
@@ -78,13 +80,17 @@ export const WAGMI_SUPPORTED_CHAINS: Chain[] = [
|
|||||||
celoAlfajores,
|
celoAlfajores,
|
||||||
];
|
];
|
||||||
|
|
||||||
const { chains, publicClient, webSocketPublicClient } = configureChains(WAGMI_SUPPORTED_CHAINS, [
|
const { chains, publicClient, webSocketPublicClient } = configureChains(
|
||||||
// alchemyProvider({ apiKey: import.meta.env.VITE_ALCHEMY_API_KEY }),
|
WAGMI_SUPPORTED_CHAINS,
|
||||||
jsonRpcProvider({
|
[
|
||||||
rpc: (chain) => ({ http: chain.rpcUrls.default.http[0] }),
|
import.meta.env.VITE_ALCHEMY_API_KEY &&
|
||||||
}),
|
alchemyProvider({ apiKey: import.meta.env.VITE_ALCHEMY_API_KEY }),
|
||||||
publicProvider(),
|
jsonRpcProvider({
|
||||||
]);
|
rpc: (chain) => ({ http: chain.rpcUrls.default.http[0] }),
|
||||||
|
}),
|
||||||
|
publicProvider(),
|
||||||
|
].filter(isTruthy)
|
||||||
|
);
|
||||||
|
|
||||||
const injectedConnectorOptions = {
|
const injectedConnectorOptions = {
|
||||||
chains,
|
chains,
|
||||||
@@ -202,5 +208,7 @@ export const resolveWagmiConnector = ({
|
|||||||
? createInjectedConnectorWithProvider(walletConnection.provider)
|
? createInjectedConnectorWithProvider(walletConnection.provider)
|
||||||
: walletConnection.type === WalletConnectionType.WalletConnect2 && walletConfig.walletconnect2Id
|
: walletConnection.type === WalletConnectionType.WalletConnect2 && walletConfig.walletconnect2Id
|
||||||
? createWalletConnect2ConnectorWithId(walletConfig.walletconnect2Id, walletConnectConfig)
|
? createWalletConnect2ConnectorWithId(walletConfig.walletconnect2Id, walletConnectConfig)
|
||||||
: getConnectors(walletConnectConfig).find(({ id }: { id: string }) => id === walletConnectionConfig.wagmiConnectorId);
|
: getConnectors(walletConnectConfig).find(
|
||||||
|
({ id }: { id: string }) => id === walletConnectionConfig.wagmiConnectorId
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
+14
-10
@@ -17,7 +17,7 @@ import { DialogTypes } from '@/constants/dialogs';
|
|||||||
import { STRING_KEYS } from '@/constants/localization';
|
import { STRING_KEYS } from '@/constants/localization';
|
||||||
import { AppRoute, PortfolioRoute, HistoryRoute } from '@/constants/routes';
|
import { AppRoute, PortfolioRoute, HistoryRoute } from '@/constants/routes';
|
||||||
import { wallets, WalletType } from '@/constants/wallets';
|
import { wallets, WalletType } from '@/constants/wallets';
|
||||||
import { useAccounts, useStringGetter } from '@/hooks';
|
import { useAccounts, useStringGetter, useTokenConfigs } from '@/hooks';
|
||||||
|
|
||||||
import { getOnboardingState } from '@/state/accountSelectors';
|
import { getOnboardingState } from '@/state/accountSelectors';
|
||||||
import { openDialog } from '@/state/dialogs';
|
import { openDialog } from '@/state/dialogs';
|
||||||
@@ -37,6 +37,7 @@ const Profile = () => {
|
|||||||
const isConnected = onboardingState !== OnboardingState.Disconnected;
|
const isConnected = onboardingState !== OnboardingState.Disconnected;
|
||||||
|
|
||||||
const { evmAddress, dydxAddress, walletType } = useAccounts();
|
const { evmAddress, dydxAddress, walletType } = useAccounts();
|
||||||
|
const { chainTokenLabel } = useTokenConfigs();
|
||||||
|
|
||||||
const { data: ensName } = useEnsName({
|
const { data: ensName } = useEnsName({
|
||||||
address: evmAddress,
|
address: evmAddress,
|
||||||
@@ -137,7 +138,11 @@ const Profile = () => {
|
|||||||
layout="grid"
|
layout="grid"
|
||||||
/>
|
/>
|
||||||
</Panel>
|
</Panel>
|
||||||
<Styled.RewardsPanel header={stringGetter({ key: STRING_KEYS.REWARDS })} hasSeparator>
|
<Styled.RewardsPanel
|
||||||
|
slotHeaderContent={stringGetter({ key: STRING_KEYS.REWARDS })}
|
||||||
|
href={`/${chainTokenLabel}`}
|
||||||
|
hasSeparator
|
||||||
|
>
|
||||||
<Styled.Details
|
<Styled.Details
|
||||||
items={[
|
items={[
|
||||||
{ key: 'maker', label: stringGetter({ key: STRING_KEYS.YOU_WILL_EARN }), value: '-' },
|
{ key: 'maker', label: stringGetter({ key: STRING_KEYS.YOU_WILL_EARN }), value: '-' },
|
||||||
@@ -149,8 +154,8 @@ const Profile = () => {
|
|||||||
</Styled.EqualGrid>
|
</Styled.EqualGrid>
|
||||||
|
|
||||||
<Styled.TablePanel
|
<Styled.TablePanel
|
||||||
header={stringGetter({ key: STRING_KEYS.HISTORY })}
|
slotHeaderContent={stringGetter({ key: STRING_KEYS.HISTORY })}
|
||||||
linkto={`${AppRoute.Portfolio}/${PortfolioRoute.History}/${HistoryRoute.Trades}`}
|
href={`${AppRoute.Portfolio}/${PortfolioRoute.History}/${HistoryRoute.Trades}`}
|
||||||
hasSeparator
|
hasSeparator
|
||||||
>
|
>
|
||||||
<FillsTable
|
<FillsTable
|
||||||
@@ -273,22 +278,21 @@ Styled.RewardsPanel = styled(Panel)`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.TablePanel = styled(Panel)`
|
Styled.TablePanel = styled(Panel)`
|
||||||
padding: 0;
|
|
||||||
max-width: calc(100vw - 2rem);
|
max-width: calc(100vw - 2rem);
|
||||||
max-height: 10rem;
|
max-height: 10rem;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
padding: 0;
|
||||||
|
border-radius: 0.875rem;
|
||||||
|
|
||||||
table {
|
table {
|
||||||
--tableCell-padding: 0.25rem 1rem;
|
--tableCell-padding: 0.25rem 1rem;
|
||||||
|
--tableRow-backgroundColor: var(--color-layer-3);
|
||||||
background-color: transparent;
|
background-color: var(--color-layer-3);
|
||||||
|
|
||||||
thead {
|
thead {
|
||||||
color: var(--color-text-0);
|
color: var(--color-text-0);
|
||||||
}
|
}
|
||||||
|
|
||||||
tbody {
|
tbody {
|
||||||
background-color: transparent;
|
|
||||||
|
|
||||||
tr {
|
tr {
|
||||||
td:nth-child(2),
|
td:nth-child(2),
|
||||||
td:nth-child(3) {
|
td:nth-child(3) {
|
||||||
|
|||||||
@@ -0,0 +1,222 @@
|
|||||||
|
import styled, { AnyStyledComponent } from 'styled-components';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
|
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||||
|
import { STRING_KEYS } from '@/constants/localization';
|
||||||
|
import { ButtonAction, ButtonSize, ButtonType } from '@/constants/buttons';
|
||||||
|
|
||||||
|
import { useAccountBalance, useBreakpoints, useStringGetter } from '@/hooks';
|
||||||
|
|
||||||
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
|
|
||||||
|
import { Details } from '@/components/Details';
|
||||||
|
import { Panel } from '@/components/Panel';
|
||||||
|
import { Button } from '@/components/Button';
|
||||||
|
import { Link } from '@/components/Link';
|
||||||
|
import { IconName, Icon } from '@/components/Icon';
|
||||||
|
import { Output, OutputType } from '@/components/Output';
|
||||||
|
import { VerticalSeparator } from '@/components/Separator';
|
||||||
|
import { Tag } from '@/components/Tag';
|
||||||
|
import { WithReceipt } from '@/components/WithReceipt';
|
||||||
|
|
||||||
|
import { getSelectedNetwork } from '@/state/appSelectors';
|
||||||
|
|
||||||
|
import { MustBigNumber } from '@/lib/numbers';
|
||||||
|
|
||||||
|
const TOKEN_MIGRATION_LEARN_MORE_LINK =
|
||||||
|
'https://www.dydx.foundation/blog/update-on-exploring-the-future-of-dydx';
|
||||||
|
|
||||||
|
export const MigratePanel = () => {
|
||||||
|
const { isNotTablet } = useBreakpoints();
|
||||||
|
const stringGetter = useStringGetter();
|
||||||
|
|
||||||
|
const selectedNetwork = useSelector(getSelectedNetwork);
|
||||||
|
|
||||||
|
const chainId = Number(ENVIRONMENT_CONFIG_MAP[selectedNetwork].ethereumChainId);
|
||||||
|
|
||||||
|
// v3 token is only on mainnet
|
||||||
|
const { balance: tokenBalance } = useAccountBalance({
|
||||||
|
addressOrDenom: chainId === 1 ? import.meta.env.VITE_V3_TOKEN_ADDRESS : undefined,
|
||||||
|
chainId: 1,
|
||||||
|
isCosmosChain: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
return isNotTablet ? (
|
||||||
|
<Styled.MigratePanel
|
||||||
|
slotHeader={<Styled.Title>{stringGetter({ key: STRING_KEYS.MIGRATE })}</Styled.Title>}
|
||||||
|
slotRight={
|
||||||
|
<Styled.MigrateAction>
|
||||||
|
<div>
|
||||||
|
<div>{stringGetter({ key: STRING_KEYS.AVAILABLE_TO_MIGRATE })}</div>
|
||||||
|
<Styled.Token type={OutputType.Asset} value={tokenBalance} />
|
||||||
|
</div>
|
||||||
|
{import.meta.env.VITE_TOKEN_MIGRATION_URI && (
|
||||||
|
<Button
|
||||||
|
action={MustBigNumber(tokenBalance).gt(0) ? ButtonAction.Primary : ButtonAction.Base}
|
||||||
|
type={ButtonType.Link}
|
||||||
|
href={import.meta.env.VITE_TOKEN_MIGRATION_URI}
|
||||||
|
slotRight={<Icon iconName={IconName.LinkOut} />}
|
||||||
|
>
|
||||||
|
{stringGetter({ key: STRING_KEYS.MIGRATE_NOW })}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</Styled.MigrateAction>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Styled.Description>
|
||||||
|
{stringGetter({ key: STRING_KEYS.MIGRATE_DESCRIPTION })}
|
||||||
|
<Link href={TOKEN_MIGRATION_LEARN_MORE_LINK}>
|
||||||
|
{stringGetter({ key: STRING_KEYS.LEARN_MORE })} →
|
||||||
|
</Link>
|
||||||
|
</Styled.Description>
|
||||||
|
</Styled.MigratePanel>
|
||||||
|
) : (
|
||||||
|
<Styled.MobileMigratePanel
|
||||||
|
slotHeader={
|
||||||
|
<Styled.MobileMigrateHeader>
|
||||||
|
<h3>
|
||||||
|
<Icon iconName={IconName.Migrate} />
|
||||||
|
{stringGetter({ key: STRING_KEYS.MIGRATE })}
|
||||||
|
</h3>
|
||||||
|
<Styled.VerticalSeparator />
|
||||||
|
<span>
|
||||||
|
{stringGetter({
|
||||||
|
key: STRING_KEYS.FROM_TO,
|
||||||
|
params: { FROM: <b>Ethereum</b>, TO: <b>dYdX Chain</b> },
|
||||||
|
})}
|
||||||
|
</span>
|
||||||
|
</Styled.MobileMigrateHeader>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Styled.WithReceipt
|
||||||
|
slotReceipt={
|
||||||
|
<Styled.Details
|
||||||
|
items={[
|
||||||
|
{
|
||||||
|
key: 'available-to-migrate',
|
||||||
|
label: (
|
||||||
|
<Styled.InlineRow>
|
||||||
|
{stringGetter({ key: STRING_KEYS.AVAILABLE_TO_MIGRATE })}
|
||||||
|
<Tag>DYDX</Tag>
|
||||||
|
</Styled.InlineRow>
|
||||||
|
),
|
||||||
|
value: <Output type={OutputType.Asset} value={tokenBalance} />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{import.meta.env.VITE_TOKEN_MIGRATION_URI && (
|
||||||
|
<Button
|
||||||
|
action={tokenBalance ? ButtonAction.Primary : ButtonAction.Base}
|
||||||
|
size={ButtonSize.Medium}
|
||||||
|
slotRight={<Icon iconName={IconName.LinkOut} />}
|
||||||
|
href={import.meta.env.VITE_TOKEN_MIGRATION_URI}
|
||||||
|
>
|
||||||
|
{stringGetter({ key: STRING_KEYS.MIGRATE_NOW })}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</Styled.WithReceipt>
|
||||||
|
<Styled.InlineRow>
|
||||||
|
{stringGetter({ key: STRING_KEYS.WANT_TO_LEARN })}
|
||||||
|
<Link href={TOKEN_MIGRATION_LEARN_MORE_LINK} withIcon>
|
||||||
|
{stringGetter({ key: STRING_KEYS.CLICK_HERE })}
|
||||||
|
</Link>
|
||||||
|
</Styled.InlineRow>
|
||||||
|
</Styled.MobileMigratePanel>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const Styled: Record<string, AnyStyledComponent> = {};
|
||||||
|
|
||||||
|
Styled.MigratePanel = styled(Panel)`
|
||||||
|
padding: 1rem 1.5rem;
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.Title = styled.h3`
|
||||||
|
font: var(--font-medium-book);
|
||||||
|
color: var(--color-text-2);
|
||||||
|
|
||||||
|
padding: 1rem 1.5rem 0;
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.MigrateAction = styled.div`
|
||||||
|
${layoutMixins.flexEqualColumns}
|
||||||
|
align-items: center;
|
||||||
|
margin-right: 1rem;
|
||||||
|
gap: 1rem;
|
||||||
|
padding: 1rem;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
background-color: var(--color-layer-2);
|
||||||
|
border: solid var(--border-width) var(--color-border);
|
||||||
|
border-radius: 0.75rem;
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.Token = styled(Output)`
|
||||||
|
font: var(--font-large-book);
|
||||||
|
color: var(--color-text-2);
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.Description = styled.div`
|
||||||
|
color: var(--color-text-0);
|
||||||
|
--link-color: var(--color-text-1);
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.MobileMigratePanel = styled(Panel)`
|
||||||
|
${layoutMixins.flexColumn}
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.MobileMigrateHeader = styled.div`
|
||||||
|
${layoutMixins.inlineRow}
|
||||||
|
gap: 1ch;
|
||||||
|
|
||||||
|
font: var(--font-small-book);
|
||||||
|
color: var(--color-text-0);
|
||||||
|
|
||||||
|
padding: 1rem 1.5rem 0;
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
${layoutMixins.inlineRow}
|
||||||
|
font: var(--font-large-book);
|
||||||
|
color: var(--color-text-2);
|
||||||
|
|
||||||
|
svg {
|
||||||
|
font-size: 1.75rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
margin-top: 0.2rem;
|
||||||
|
|
||||||
|
b {
|
||||||
|
font-weight: var(--fontWeight-book);
|
||||||
|
color: var(--color-text-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.VerticalSeparator = styled(VerticalSeparator)`
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
&& {
|
||||||
|
height: 1.5rem;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.Details = styled(Details)`
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.WithReceipt = styled(WithReceipt)`
|
||||||
|
width: 100%;
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.InlineRow = styled.div`
|
||||||
|
${layoutMixins.inlineRow}
|
||||||
|
color: var(--color-text-0);
|
||||||
|
--link-color: var(--color-text-1);
|
||||||
|
`;
|
||||||
@@ -1,134 +1,49 @@
|
|||||||
import styled, { AnyStyledComponent } from 'styled-components';
|
import styled, { AnyStyledComponent } from 'styled-components';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch } from 'react-redux';
|
||||||
|
|
||||||
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
|
||||||
import { STRING_KEYS } from '@/constants/localization';
|
import { STRING_KEYS } from '@/constants/localization';
|
||||||
import { ButtonAction, ButtonSize, ButtonState, ButtonType } from '@/constants/buttons';
|
import { ButtonAction, ButtonSize } from '@/constants/buttons';
|
||||||
import { DialogTypes } from '@/constants/dialogs';
|
import { DialogTypes } from '@/constants/dialogs';
|
||||||
|
|
||||||
import { useAccountBalance, useBreakpoints, useStringGetter } from '@/hooks';
|
import { useBreakpoints, useStringGetter } from '@/hooks';
|
||||||
|
|
||||||
import { breakpoints } from '@/styles';
|
import { breakpoints } from '@/styles';
|
||||||
import { layoutMixins } from '@/styles/layoutMixins';
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
|
|
||||||
import { Details } from '@/components/Details';
|
|
||||||
import { Panel } from '@/components/Panel';
|
import { Panel } from '@/components/Panel';
|
||||||
import { IconName } from '@/components/Icon';
|
import { IconName } from '@/components/Icon';
|
||||||
import { Button } from '@/components/Button';
|
|
||||||
import { IconButton } from '@/components/IconButton';
|
import { IconButton } from '@/components/IconButton';
|
||||||
import { Link } from '@/components/Link';
|
import { Link } from '@/components/Link';
|
||||||
import { Output, OutputType } from '@/components/Output';
|
|
||||||
import { VerticalSeparator } from '@/components/Separator';
|
|
||||||
import { WithReceipt } from '@/components/WithReceipt';
|
|
||||||
|
|
||||||
import { openDialog } from '@/state/dialogs';
|
import { openDialog } from '@/state/dialogs';
|
||||||
import { getSelectedNetwork } from '@/state/appSelectors';
|
|
||||||
|
|
||||||
import { DYDXBalancePanel } from './DYDXBalancePanel';
|
import { DYDXBalancePanel } from './DYDXBalancePanel';
|
||||||
|
import { MigratePanel } from './MigratePanel';
|
||||||
|
|
||||||
// TODO: replace placeholder URL with real URLs when avaialble
|
// TODO: consolidate help link urls to env variables
|
||||||
const GOVERNANCE_HELP_URL = 'https://help.dydx.exchange/';
|
const GOVERNANCE_HELP_URL = 'https://help.dydx.exchange/';
|
||||||
const STAKING_HELP_URL = 'https://help.dydx.exchange/';
|
const STAKING_HELP_URL =
|
||||||
|
'https://docs.dydx.community/dydx-chain-documentation/staking/how-to-stake';
|
||||||
|
|
||||||
export const RewardsPage = () => {
|
export const RewardsPage = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
|
|
||||||
const { isTablet, isNotTablet } = useBreakpoints();
|
const { isTablet, isNotTablet } = useBreakpoints();
|
||||||
|
|
||||||
const selectedNetwork = useSelector(getSelectedNetwork);
|
const panelArrow = (
|
||||||
|
<Styled.Arrow>
|
||||||
// const chainId = Number(ENVIRONMENT_CONFIG_MAP[selectedNetwork].ethereumChainId);
|
<Styled.IconButton
|
||||||
|
action={ButtonAction.Base}
|
||||||
// const { balance } = useAccountBalance({
|
iconName={IconName.Arrow}
|
||||||
// addressOrDenom: import.meta.env.VITE_V3_TOKEN_ADDRESS,
|
size={ButtonSize.Small}
|
||||||
// assetSymbol: 'DYDX',
|
/>
|
||||||
// chainId,
|
</Styled.Arrow>
|
||||||
// isCosmosChain: false,
|
);
|
||||||
// });
|
|
||||||
|
|
||||||
// const tokenBalance = import.meta.env.VITE_V3_TOKEN_ADDRESS ? balance : 0;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Styled.Page>
|
<Styled.Page>
|
||||||
{/* {isNotTablet ? (
|
{import.meta.env.VITE_V3_TOKEN_ADDRESS && <MigratePanel />}
|
||||||
<Styled.Migrate>
|
|
||||||
<Styled.TwoItemRow>
|
|
||||||
<div>
|
|
||||||
<Styled.MigrateTitle>
|
|
||||||
{stringGetter({ key: STRING_KEYS.MIGRATE })}
|
|
||||||
</Styled.MigrateTitle>
|
|
||||||
<Styled.Description>
|
|
||||||
{stringGetter({ key: STRING_KEYS.MIGRATE_DESCRIPTION })}
|
|
||||||
<Link href={MIGRATE_HELP_URL}>
|
|
||||||
{stringGetter({ key: STRING_KEYS.LEARN_MORE })} →
|
|
||||||
</Link>
|
|
||||||
</Styled.Description>
|
|
||||||
</div>
|
|
||||||
<Styled.MigrateAction>
|
|
||||||
<div>
|
|
||||||
<div>{stringGetter({ key: STRING_KEYS.AVAILABLE_TO_MIGRATE })}</div>
|
|
||||||
<div>
|
|
||||||
<Styled.Token type={OutputType.Asset} value={tokenBalance} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<Button
|
|
||||||
action={tokenBalance ? ButtonAction.Primary : ButtonAction.Base}
|
|
||||||
// type={ButtonType.Link}
|
|
||||||
// href={BRIDGE_URL}
|
|
||||||
disabled
|
|
||||||
>
|
|
||||||
{tokenBalance
|
|
||||||
? `${stringGetter({ key: STRING_KEYS.MIGRATE_NOW })} →`
|
|
||||||
: stringGetter({ key: STRING_KEYS.NO_TOKENS_TO_MIGRATE })}
|
|
||||||
</Button>
|
|
||||||
</Styled.MigrateAction>
|
|
||||||
</Styled.TwoItemRow>
|
|
||||||
</Styled.Migrate>
|
|
||||||
) : (
|
|
||||||
<Styled.MobileMigrateCard
|
|
||||||
slotHeader={
|
|
||||||
<Styled.MobileMigrateHeader>
|
|
||||||
<h3>{stringGetter({ key: STRING_KEYS.MIGRATE })}</h3>
|
|
||||||
<VerticalSeparator />
|
|
||||||
<span>
|
|
||||||
{stringGetter({
|
|
||||||
key: STRING_KEYS.FROM_TO,
|
|
||||||
params: { FROM: <strong>Ethereum</strong>, TO: <strong>dYdX Chain</strong> },
|
|
||||||
})}
|
|
||||||
</span>
|
|
||||||
</Styled.MobileMigrateHeader>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Styled.WithReceipt
|
|
||||||
slotReceipt={
|
|
||||||
<Styled.Details
|
|
||||||
items={[
|
|
||||||
{
|
|
||||||
key: 'available-to-migrate',
|
|
||||||
label: stringGetter({ key: STRING_KEYS.AVAILABLE_TO_MIGRATE }),
|
|
||||||
value: <Output type={OutputType.Asset} value={tokenBalance} />,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
action={tokenBalance ? ButtonAction.Primary : ButtonAction.Base}
|
|
||||||
size={ButtonSize.Medium}
|
|
||||||
disabled
|
|
||||||
>
|
|
||||||
{tokenBalance
|
|
||||||
? `${stringGetter({ key: STRING_KEYS.MIGRATE_NOW })} →`
|
|
||||||
: stringGetter({ key: STRING_KEYS.NO_TOKENS_TO_MIGRATE })}
|
|
||||||
</Button>
|
|
||||||
</Styled.WithReceipt>
|
|
||||||
<Styled.LearnMore>
|
|
||||||
{stringGetter({ key: STRING_KEYS.WANT_TO_LEARN })}
|
|
||||||
<Link href={MIGRATE_HELP_URL}>{stringGetter({ key: STRING_KEYS.CLICK_HERE })}</Link>
|
|
||||||
</Styled.LearnMore>
|
|
||||||
</Styled.MobileMigrateCard>
|
|
||||||
)} */}
|
|
||||||
|
|
||||||
<Styled.PanelRow>
|
<Styled.PanelRow>
|
||||||
{isTablet && (
|
{isTablet && (
|
||||||
<Styled.BalancePanelContainer>
|
<Styled.BalancePanelContainer>
|
||||||
@@ -138,42 +53,28 @@ export const RewardsPage = () => {
|
|||||||
|
|
||||||
<Styled.Panel
|
<Styled.Panel
|
||||||
slotHeader={<Styled.Title>{stringGetter({ key: STRING_KEYS.GOVERNANCE })}</Styled.Title>}
|
slotHeader={<Styled.Title>{stringGetter({ key: STRING_KEYS.GOVERNANCE })}</Styled.Title>}
|
||||||
|
slotRight={panelArrow}
|
||||||
onClick={() => dispatch(openDialog({ type: DialogTypes.ExternalNavKeplr }))}
|
onClick={() => dispatch(openDialog({ type: DialogTypes.ExternalNavKeplr }))}
|
||||||
>
|
>
|
||||||
<Styled.Row>
|
<Styled.Description>
|
||||||
<Styled.Description>
|
{stringGetter({ key: STRING_KEYS.GOVERNANCE_DESCRIPTION })}
|
||||||
{stringGetter({ key: STRING_KEYS.GOVERNANCE_DESCRIPTION })}
|
<Link href={GOVERNANCE_HELP_URL} onClick={(e) => e.stopPropagation()}>
|
||||||
<Link href={GOVERNANCE_HELP_URL} onClick={(e) => e.stopPropagation()}>
|
{stringGetter({ key: STRING_KEYS.LEARN_MORE })} →
|
||||||
{stringGetter({ key: STRING_KEYS.LEARN_MORE })} →
|
</Link>
|
||||||
</Link>
|
</Styled.Description>
|
||||||
</Styled.Description>
|
|
||||||
{/* TODO: vertically center based on Panel height */}
|
|
||||||
<Styled.IconButton
|
|
||||||
action={ButtonAction.Base}
|
|
||||||
iconName={IconName.Arrow}
|
|
||||||
size={ButtonSize.Small}
|
|
||||||
/>
|
|
||||||
</Styled.Row>
|
|
||||||
</Styled.Panel>
|
</Styled.Panel>
|
||||||
|
|
||||||
<Styled.Panel
|
<Styled.Panel
|
||||||
slotHeader={<Styled.Title>{stringGetter({ key: STRING_KEYS.STAKING })}</Styled.Title>}
|
slotHeader={<Styled.Title>{stringGetter({ key: STRING_KEYS.STAKING })}</Styled.Title>}
|
||||||
|
slotRight={panelArrow}
|
||||||
onClick={() => dispatch(openDialog({ type: DialogTypes.ExternalNavKeplr }))}
|
onClick={() => dispatch(openDialog({ type: DialogTypes.ExternalNavKeplr }))}
|
||||||
>
|
>
|
||||||
<Styled.Row>
|
<Styled.Description>
|
||||||
<Styled.Description>
|
{stringGetter({ key: STRING_KEYS.STAKING_DESCRIPTION })}
|
||||||
{stringGetter({ key: STRING_KEYS.STAKING_DESCRIPTION })}
|
<Link href={STAKING_HELP_URL} onClick={(e) => e.stopPropagation()}>
|
||||||
<Link href={STAKING_HELP_URL} onClick={(e) => e.stopPropagation()}>
|
{stringGetter({ key: STRING_KEYS.LEARN_MORE })} →
|
||||||
{stringGetter({ key: STRING_KEYS.LEARN_MORE })} →
|
</Link>
|
||||||
</Link>
|
</Styled.Description>
|
||||||
</Styled.Description>
|
|
||||||
{/* TODO: vertically center based on Panel height */}
|
|
||||||
<Styled.IconButton
|
|
||||||
action={ButtonAction.Base}
|
|
||||||
iconName={IconName.Arrow}
|
|
||||||
size={ButtonSize.Small}
|
|
||||||
/>
|
|
||||||
</Styled.Row>
|
|
||||||
</Styled.Panel>
|
</Styled.Panel>
|
||||||
|
|
||||||
{isNotTablet && (
|
{isNotTablet && (
|
||||||
@@ -191,61 +92,25 @@ const Styled: Record<string, AnyStyledComponent> = {};
|
|||||||
Styled.Page = styled.div`
|
Styled.Page = styled.div`
|
||||||
${layoutMixins.contentContainerPage}
|
${layoutMixins.contentContainerPage}
|
||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
|
|
||||||
@media ${breakpoints.tablet} {
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Panel = styled(Panel)`
|
Styled.Panel = styled(Panel)`
|
||||||
padding: 0 1.5rem 1rem;
|
padding: 1rem 1.5rem;
|
||||||
|
|
||||||
@media ${breakpoints.tablet} {
|
|
||||||
max-width: calc(100vw - 2rem);
|
|
||||||
}
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Row = styled.div`
|
Styled.Title = styled.h3`
|
||||||
${layoutMixins.spacedRow}
|
font: var(--font-medium-book);
|
||||||
gap: 1rem;
|
color: var(--color-text-2);
|
||||||
|
padding: 1rem 1.5rem 0;
|
||||||
align-items: center;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Description = styled.div`
|
Styled.Description = styled.div`
|
||||||
color: var(--color-text-0);
|
color: var(--color-text-0);
|
||||||
|
--link-color: var(--color-text-1);
|
||||||
a {
|
|
||||||
color: var(--color-text-1);
|
|
||||||
}
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Migrate = styled.section`
|
Styled.PanelRow = styled.div`
|
||||||
max-width: min(100vw, var(--content-max-width));
|
${layoutMixins.spacedRow}
|
||||||
|
|
||||||
padding: 1.5rem;
|
|
||||||
|
|
||||||
background-color: var(--color-layer-3);
|
|
||||||
border-radius: 0.875rem;
|
|
||||||
`;
|
|
||||||
|
|
||||||
Styled.TwoItemRow = styled(Styled.Row)`
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
`;
|
|
||||||
|
|
||||||
Styled.MigrateAction = styled(Styled.TwoItemRow)`
|
|
||||||
padding: 1rem;
|
|
||||||
|
|
||||||
background-color: var(--color-layer-2);
|
|
||||||
border: solid var(--border-width) var(--color-border);
|
|
||||||
border-radius: 0.75rem;
|
|
||||||
`;
|
|
||||||
|
|
||||||
Styled.Token = styled(Output)`
|
|
||||||
font: var(--font-large-book);
|
|
||||||
`;
|
|
||||||
|
|
||||||
Styled.PanelRow = styled(Styled.Row)`
|
|
||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
max-width: min(100vw, var(--content-max-width));
|
max-width: min(100vw, var(--content-max-width));
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
@@ -269,65 +134,11 @@ Styled.BalancePanelContainer = styled.div`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Title = styled.h3`
|
|
||||||
${layoutMixins.inlineRow}
|
|
||||||
padding: 1.25rem 1.5rem 0.5rem;
|
|
||||||
|
|
||||||
font: var(--font-medium-book);
|
|
||||||
color: var(--color-text-2);
|
|
||||||
`;
|
|
||||||
|
|
||||||
Styled.MigrateTitle = styled(Styled.Title)`
|
|
||||||
padding: 0 0 0.5rem;
|
|
||||||
`;
|
|
||||||
|
|
||||||
Styled.MobileMigrateCard = styled(Styled.Panel)`
|
|
||||||
${layoutMixins.flexColumn}
|
|
||||||
gap: 1rem;
|
|
||||||
|
|
||||||
align-items: center;
|
|
||||||
`;
|
|
||||||
|
|
||||||
Styled.MobileMigrateHeader = styled(Styled.Title)`
|
|
||||||
${layoutMixins.inlineRow}
|
|
||||||
gap: 1ch;
|
|
||||||
padding-bottom: 1rem;
|
|
||||||
|
|
||||||
font: var(--font-small-book);
|
|
||||||
color: var(--color-text-0);
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
${layoutMixins.inlineRow}
|
|
||||||
font: var(--font-large-book);
|
|
||||||
color: var(--color-text-2);
|
|
||||||
|
|
||||||
svg {
|
|
||||||
font-size: 1.75rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
margin-top: 0.2rem;
|
|
||||||
b {
|
|
||||||
font-weight: var(--fontWeight-book);
|
|
||||||
color: var(--color-text-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
Styled.Details = styled(Details)`
|
|
||||||
padding: 0.5rem 1rem;
|
|
||||||
`;
|
|
||||||
|
|
||||||
Styled.WithReceipt = styled(WithReceipt)`
|
|
||||||
width: 100%;
|
|
||||||
`;
|
|
||||||
|
|
||||||
Styled.LearnMore = styled(Styled.Description)`
|
|
||||||
${layoutMixins.row}
|
|
||||||
gap: 1ch;
|
|
||||||
`;
|
|
||||||
|
|
||||||
Styled.IconButton = styled(IconButton)`
|
Styled.IconButton = styled(IconButton)`
|
||||||
color: var(--color-text-0);
|
color: var(--color-text-0);
|
||||||
|
--color-border: var(--color-layer-6);
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.Arrow = styled.div`
|
||||||
|
padding: 1rem 1.5rem;
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -104,4 +104,5 @@ Styled.Button = styled(Button)`
|
|||||||
|
|
||||||
Styled.IconButton = styled(IconButton)`
|
Styled.IconButton = styled(IconButton)`
|
||||||
color: var(--color-text-0);
|
color: var(--color-text-0);
|
||||||
|
--color-border: var(--color-layer-6);
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -130,12 +130,14 @@ export const GenerateKeys = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
setStatus(EvmDerivedAccountStatus.NotDerived);
|
||||||
const { message } = parseWalletError({ error, stringGetter });
|
const { message } = parseWalletError({ error, stringGetter });
|
||||||
|
|
||||||
if (message) {
|
if (message) {
|
||||||
track(AnalyticsEvent.OnboardingWalletIsNonDeterministic);
|
track(AnalyticsEvent.OnboardingWalletIsNonDeterministic);
|
||||||
setError(message);
|
setError(message);
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await setWalletFromEvmSignature(signature);
|
await setWalletFromEvmSignature(signature);
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ export const AccountMenu = () => {
|
|||||||
fractionDigits={2}
|
fractionDigits={2}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<AssetActions asset={DydxChainAsset.USDC} dispatch={dispatch} />
|
<AssetActions asset={DydxChainAsset.USDC} dispatch={dispatch} withOnboarding />
|
||||||
</div>
|
</div>
|
||||||
</Styled.Balances>
|
</Styled.Balances>
|
||||||
</Styled.AccountInfo>
|
</Styled.AccountInfo>
|
||||||
@@ -212,28 +212,45 @@ export const AccountMenu = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const AssetActions = memo(({ asset, dispatch }: { asset: DydxChainAsset; dispatch: Dispatch }) => (
|
const AssetActions = memo(
|
||||||
<Styled.InlineRow>
|
({
|
||||||
{[
|
asset,
|
||||||
// TODO(@rosepuppy): Add withdraw action for USDC
|
dispatch,
|
||||||
{
|
withOnboarding,
|
||||||
dialogType: DialogTypes.Receive,
|
}: {
|
||||||
iconName: IconName.Qr,
|
asset: DydxChainAsset;
|
||||||
},
|
dispatch: Dispatch;
|
||||||
{ dialogType: DialogTypes.Transfer, iconName: IconName.Send },
|
withOnboarding?: boolean;
|
||||||
].map(({ iconName, dialogType }) => (
|
}) => (
|
||||||
<IconButton
|
<Styled.InlineRow>
|
||||||
key={dialogType}
|
{[
|
||||||
action={ButtonAction.Base}
|
withOnboarding && {
|
||||||
shape={ButtonShape.Square}
|
dialogType: DialogTypes.Withdraw,
|
||||||
iconName={iconName}
|
iconName: IconName.Withdraw,
|
||||||
onClick={() =>
|
},
|
||||||
dispatch(openDialog({ type: dialogType, dialogProps: { selectedAsset: asset } }))
|
withOnboarding && {
|
||||||
}
|
dialogType: DialogTypes.Deposit,
|
||||||
/>
|
iconName: IconName.Deposit,
|
||||||
))}
|
},
|
||||||
</Styled.InlineRow>
|
{
|
||||||
));
|
dialogType: DialogTypes.Transfer,
|
||||||
|
dialogProps: { selectedAsset: asset },
|
||||||
|
iconName: IconName.Send,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
.filter(isTruthy)
|
||||||
|
.map(({ iconName, dialogType, dialogProps }) => (
|
||||||
|
<Styled.IconButton
|
||||||
|
key={dialogType}
|
||||||
|
action={ButtonAction.Base}
|
||||||
|
shape={ButtonShape.Square}
|
||||||
|
iconName={iconName}
|
||||||
|
onClick={() => dispatch(openDialog({ type: dialogType, dialogProps }))}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</Styled.InlineRow>
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
const Styled: Record<string, AnyStyledComponent> = {};
|
const Styled: Record<string, AnyStyledComponent> = {};
|
||||||
|
|
||||||
@@ -351,3 +368,7 @@ Styled.ConnectToChain = styled(Styled.Column)`
|
|||||||
font: var(--font-small-book);
|
font: var(--font-small-book);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
Styled.IconButton = styled(IconButton)`
|
||||||
|
--button-padding: 0 0.25rem;
|
||||||
|
`;
|
||||||
|
|||||||
Reference in New Issue
Block a user