Compare commits

...
Author SHA1 Message Date
Adam Fraser d524bbebfe Merge branch 'main' into adamfraser-testnet-node-updates 2023-10-30 17:57:34 +01:00
aleka 2fe6c2bb3b reorder header, center align header, update collapse caret icons (#110) 2023-10-27 23:32:51 -04:00
aleka e6858ca917 show loading state instead of "Unavailable" for place order button (#104)
* show loading instead of unavailable for place order button
2023-10-27 17:39:12 -04:00
aleka d92b49f4fa bump packages, fix missing asset symbol (#106) 2023-10-27 16:47:34 -04:00
aleka e7da21962a add entry point to token migration (#98)
* update migrate panel

* address feedback
2023-10-27 16:14:34 -04:00
aleka b479531e34 update v4 docs link (#102) 2023-10-27 16:13:48 -04:00
Bill 0d4c5a547a Abort key derivation if second signature fails (#109) 2023-10-27 11:41:00 -07:00
Adam Fraser 7ab892e56c Add Bware to testnet node config 2023-10-27 19:34:18 +02:00
Adam Fraser 296cec98f4 Remove DSRV from Testnet node config options 2023-10-27 19:19:00 +02:00
Rui 5b235ee53f Add link to help page (#103) 2023-10-27 09:15:31 -07:00
Adam Fraser 18dee0586b Add Polkachu as RPC Node for Testnet (#105)
* Update env.json

* Add Polkachu option to environments

* Fix trailing comma error
2023-10-25 18:21:27 -04:00
mikemag-dev 9f1f5987ee Update apple-app-site-association (#100) 2023-10-24 18:33:41 -04:00
James Jia 7f531516ca v1.0: Update LICENSE and README (#101)
* Update LICENSE and README

* Update README, package.json

* Update package.json
2023-10-24 14:14:49 -07:00
aleka 3fd71558c0 fix trading view error (#96)
* fix trading view error

* only init trading view if market id is first defined, and nits re fills table with empty asset
2023-10-24 17:06:00 -04:00
aleka 575856b77b remove asset symbol for account balance logic (#95) 2023-10-23 17:51:13 -04:00
John Huang e3609782ed Indexer and validator are on https for DEV (#97) 2023-10-23 14:49:03 -07:00
32 changed files with 590 additions and 498 deletions
+2 -1
View File
@@ -6,4 +6,5 @@ VITE_PK_ENCRYPTION_KEY=
VITE_WALLETCONNECT2_PROJECT_ID=
VITE_V3_TOKEN_ADDRESS=
VITE_V3_TOKEN_ADDRESS=
VITE_TOKEN_MIGRATION_URI=
-42
View File
@@ -1,45 +1,3 @@
Subject to your compliance with applicable law, you are granted the right to use the Licensed Work (defined below) under the terms of the below licenses; provided, however, that if you violate any such applicable law in your use of the Licensed Work, all of your rights and licenses to use (including any rights to reproduce, distribute, install or modify) the Licensed Work will automatically and immediately terminate.
Use of this software before the Change Date specified in the LICENSE file is governed by the Business Source License included in the LICENSE file and at https://spdx.org/licenses/BUSL-1.1.html.
On and after the Change Date specified in the LICENSE file, use of this software will be governed by the Change License (GNU Affero GPL v3) as specified in the LICENSE file.
Business Source License 1.1
Business Source License text copyright © 2023 MariaDB plc, All Rights Reserved. “Business Source License” is a trademark of MariaDB plc.
Copyright (C) 2023 dYdX Trading Inc.
Parameters
Licensor: dYdX Trading Inc.
Licensed Work: dydxprotocol/cosmos-sdk, dydxprotocol/cometbft, dydxprotocol/v4-chain, dydxprotocol/v4-clients, dydxprotocol/v4-web, dydxprotocol/v4-abacus, dydxprotocol/v4-localization, dydxprotocol/v4-documentation, and any dYdX or dYdX Trading Inc. github repository reflecting a copy of this license, or link to this license.
Additional Use Grant: None
Change Date: On the later to occur of (i) the release of the Licensed Work labeled “dYdX Version 1.0 Affero GPL”, and which includes a document uploaded to the relevant github repository stating “The software in this repository is Version 1.0, subject to Affero GPL license”, and (ii) September 30, 2023 (approximate projected release of “Version 1.0” of this software).
Change License: GNU Affero GPL License v3
License text copyright © 2023 MariaDB plc, All Rights Reserved. “Business Source License” is a trademark of MariaDB plc.
Terms
The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License).TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE. MariaDB hereby grants you permission to use this Licenses text to license your works, and to refer to it using the trademark “Business Source License”, as long as you comply with the Covenants of Licensor below.
Covenants of Licensor
In consideration of the right to use this Licenses text and the “Business Source License” name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor:
To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where “compatible” means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation.
To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text “None” to specify a Change Date. Not to modify this License in any other way.
Notice
The Business Source License (this document, or the “License”) is not an Open Source license. However, the Licensed Work will eventually be made available under an Open Source License, as stated in this License.
OPEN SOURCE LICENSE BELOW - TO BE APPLIED AFTER THE CHANGE DATE.
Copyright (C) 2023 dYdX Trading Inc.
Subject to your compliance with applicable law, you are granted the right to use the Licensed Work (defined below) under the terms of the GNU Affero General Public License as set forth below; provided, however, that if you violate any such applicable law in your use of the Licensed Work, all of your rights and licenses to use (including any rights to reproduce, distribute, install or modify) the Licensed Work will automatically and immediately terminate.
+2 -2
View File
@@ -1,10 +1,10 @@
<p align="center"><img src="https://dydx.exchange/icon.svg?" width="256" /></p>
<h1 align="center">v4 Web</h1>
<h1 align="center">dYdX Chain Web</h1>
<div align="center">
<a href='https://github.com/dydxprotocol/v4-web/blob/main/LICENSE'>
<img src='https://img.shields.io/badge/License-BSL_1.1-blue' alt='License' />
<img src='https://img.shields.io/badge/License-AGPL_v3-blue.svg' alt='License' />
</a>
</div>
+5 -5
View File
@@ -1,9 +1,9 @@
{
"name": "dydx-chain-web",
"private": true,
"version": "0.0.1",
"version": "1.0.0",
"type": "module",
"license": "BSL-1.1",
"license": "AGPL-3.0",
"engines": {
"node": ">=18"
},
@@ -39,9 +39,9 @@
"@cosmjs/proto-signing": "^0.31.0",
"@cosmjs/stargate": "^0.31.0",
"@cosmjs/tendermint-rpc": "^0.31.0",
"@dydxprotocol/v4-abacus": "^0.7.6",
"@dydxprotocol/v4-client-js": "^0.40.3",
"@dydxprotocol/v4-localization": "^0.1.32",
"@dydxprotocol/v4-abacus": "^1.0.3",
"@dydxprotocol/v4-client-js": "^1.0.0",
"@dydxprotocol/v4-localization": "^1.0.0",
"@ethersproject/providers": "^5.7.2",
"@js-joda/core": "^5.5.3",
"@radix-ui/react-collapsible": "^1.0.3",
+16 -16
View File
@@ -1,9 +1,5 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
dependencies:
'@0xsquid/sdk':
specifier: ^1.10.0
@@ -27,14 +23,14 @@ dependencies:
specifier: ^0.31.0
version: 0.31.0
'@dydxprotocol/v4-abacus':
specifier: ^0.7.6
version: 0.7.6
specifier: ^1.0.3
version: 1.0.3
'@dydxprotocol/v4-client-js':
specifier: ^0.40.3
version: 0.40.3
specifier: ^1.0.0
version: 1.0.0
'@dydxprotocol/v4-localization':
specifier: ^0.1.32
version: 0.1.32
specifier: ^1.0.0
version: 1.0.0
'@ethersproject/providers':
specifier: ^5.7.2
version: 5.7.2
@@ -979,12 +975,12 @@ packages:
resolution: {integrity: sha512-RpfLEtTlyIxeNPGKcokS+p3BZII/Q3bYxryFRglh5H3A3T8q9fsLYm72VYAMEOOIBLEa8o93kFLiBDUWKrwXZA==}
dev: true
/@dydxprotocol/v4-abacus@0.7.6:
resolution: {integrity: sha512-FdDXRaFMfxhyrJJs0dNrb1KG6X95lPHelua1yCn/SVgzwGaAqlJczrzmdh98INntuRAgIxOu69R5mCGyekumyg==}
/@dydxprotocol/v4-abacus@1.0.3:
resolution: {integrity: sha512-GuX37/DMMNSke8ZFcw52II7IVJfUgVGHqoi1Uw2cUb+hgIjjSG3OtbyRWedm5r6nqWq8BNLOexI0VVFB6OMVYg==}
dev: false
/@dydxprotocol/v4-client-js@0.40.3:
resolution: {integrity: sha512-nMQd6tYisKDKIbfx0BGJSYEOSt+I+t5SsaBSmlgTdso+w2rCRO9vyxS+u6MF9h4w5FsVRfhHo3e6uTWX48WpGQ==}
/@dydxprotocol/v4-client-js@1.0.0:
resolution: {integrity: sha512-ehfHO+zQy795TcJRwtiawadFHZyh4HnpJNP26hCGsIjLE5q6LLHweQHpK/1N/sXU1PBOuQwc7iaJnFop6gYauQ==}
dependencies:
'@cosmjs/amino': 0.30.1
'@cosmjs/encoding': 0.31.1
@@ -1011,8 +1007,8 @@ packages:
- utf-8-validate
dev: false
/@dydxprotocol/v4-localization@0.1.32:
resolution: {integrity: sha512-ZtXScxgFLjUt0Ag52RyFnQe9aEl1Aky5fp+vMGOBduVkFiCEMRMkSsSgg6grMdyw/x0AbnxOTRkhYoX2MsK9Ow==}
/@dydxprotocol/v4-localization@1.0.0:
resolution: {integrity: sha512-U7QjOlzpfSAVEchkNDB3xYRx7okzdeYi83XsnHwI+EHa2quFm/2Y2dhrBkT5fqpZmhcwxb/vG8AZmFSToOf9hA==}
dev: false
/@dydxprotocol/v4-proto@0.4.1:
@@ -14100,3 +14096,7 @@ packages:
/zwitch@2.0.4:
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
dev: true
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
+13 -37
View File
@@ -8,67 +8,43 @@
],
"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"
},
{
"/": "/rankings/competition"
},
{
"/": "/rankings/diamond"
},
{
"/": "/rankings/platinum"
},
{
"/": "/rankings/gold"
},
{
"/": "/rankings/silver"
},
{
"/": "/rankings/bronze"
},
{
"/": "/rankings/pnl-absolute"
},
{
"/": "/rankings/pnl-percent"
"/": "*/portfolio/history/funding"
},
{
"/": "/walletsegue",
+148 -78
View File
@@ -22,10 +22,11 @@
"dydxprotocol-staging-west",
"dydxprotocol-testnet",
"dydxprotocol-testnet-dydx",
"dydxprotocol-testnet-dsrv",
"dydxprotocol-testnet-nodefleet",
"dydxprotocol-testnet-kingnodes",
"dydxprotocol-testnet-liquify"
"dydxprotocol-testnet-liquify",
"dydxprotocol-testnet-polkachu",
"dydxprotocol-testnet-bware"
],
"default": "dydxprotocol-testnet"
}
@@ -56,15 +57,15 @@
"endpoints": {
"indexers": [
{
"api": "http://indexer.v4dev.dydx.exchange",
"api": "https://indexer.v4dev.dydx.exchange",
"socket": "wss://indexer.v4dev.dydx.exchange"
}
],
"validators": [
"http://validator.v4dev.dydx.exchange"
"https://validator.v4dev.dydx.exchange"
],
"0xsquid": "https://testnet.api.0xsquid.com",
"faucet": "http://faucet.v4dev.dydx.exchange"
"faucet": "https://faucet.v4dev.dydx.exchange"
},
"links": {
"tos": "https://dydx.exchange/v4-terms",
@@ -307,10 +308,11 @@
"tos": "https://dydx.exchange/v4-terms",
"privacy": "https://dydx.exchange/privacy",
"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",
"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": {
"walletconnect": {
@@ -370,10 +372,11 @@
"tos": "https://dydx.exchange/v4-terms",
"privacy": "https://dydx.exchange/privacy",
"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",
"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": {
"walletconnect": {
@@ -424,6 +427,8 @@
}
],
"validators": [
"https://dydx-testnet-full-rpc.public.blastapi.io/",
"https://dydx-testnet-rpc.polkachu.com/",
"https://dydx-testnet.nodefleet.org",
"https://test-dydx.kingnodes.com",
"https://dydx-rpc.liquify.com/api=8878132/dydx"
@@ -435,7 +440,7 @@
"tos": "https://dydx.exchange/v4-terms",
"privacy": "https://dydx.exchange/privacy",
"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",
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
"blogs": "https://www.dydx.foundation/blog"
@@ -499,71 +504,7 @@
"privacy": "https://dydx.exchange/privacy",
"statusPage": "https://status.v4testnet.dydx.exchange/",
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
"documentation": "https://v4-teacher.vercel.app/",
"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-dsrv": {
"name": "v4 Public Testnet/DSRV",
"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-archive.allthatnode.com:26657/XZvMM41hESf8PJrEQiTzbCOMVyFca79R"
],
"0xsquid": "https://testnet.api.squidrouter.com",
"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://v4-teacher.vercel.app/",
"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"
@@ -627,7 +568,7 @@
"privacy": "https://dydx.exchange/privacy",
"statusPage": "https://status.v4testnet.dydx.exchange/",
"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",
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
"blogs": "https://www.dydx.foundation/blog"
@@ -691,7 +632,7 @@
"privacy": "https://dydx.exchange/privacy",
"statusPage": "https://status.v4testnet.dydx.exchange/",
"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",
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
"blogs": "https://www.dydx.foundation/blog"
@@ -750,6 +691,134 @@
"0xsquid": "https://testnet.api.squidrouter.com",
"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": {
"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-bware": {
"name": "v4 Public Testnet/BWare",
"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-full-rpc.public.blastapi.io/"
],
"0xsquid": "https://testnet.api.squidrouter.com",
"faucet": "https://faucet.v4testnet.dydx.exchange"
},
"links": {
"tos": "https://dydx.exchange/v4-terms",
"privacy": "https://dydx.exchange/privacy",
@@ -822,7 +891,8 @@
"documentation": "[HTTP link to documentation, can be null]",
"community": "[HTTP link to community, 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": {
"walletconnect": {
+1 -1
View File
@@ -80,7 +80,7 @@ Styled.TriggerIcon = styled.span`
width: var(--trigger-icon-width);
display: inline-flex;
transition: transform 0.3s var(--ease-out-expo);
transition: rotate 0.3s var(--ease-out-expo);
color: var(--trigger-icon-color);
${Styled.Trigger}[data-state='open'] & {
+3
View File
@@ -40,6 +40,7 @@ import {
LockIcon,
LogoShortIcon,
MenuIcon,
MigrateIcon,
MintscanIcon,
OrderbookIcon,
OrderCanceledIcon,
@@ -108,6 +109,7 @@ export enum IconName {
Lock = 'Lock',
LogoShort = 'LogoShort',
Menu = 'Menu',
Migrate = 'Migrate',
Mintscan = 'Mintscan',
Onboarding = 'Onboarding',
Orderbook = 'OrderbookIcon',
@@ -177,6 +179,7 @@ const icons = {
[IconName.Lock]: LockIcon,
[IconName.LogoShort]: LogoShortIcon,
[IconName.Menu]: MenuIcon,
[IconName.Migrate]: MigrateIcon,
[IconName.Mintscan]: MintscanIcon,
[IconName.Orderbook]: OrderbookIcon,
[IconName.OrderCanceled]: OrderCanceledIcon,
+3
View File
@@ -525,6 +525,9 @@ Styled.NavItem = styled(NavItem)<{ orientation: 'horizontal' | 'vertical' }>`
`;
Styled.Icon = styled(Icon)`
height: 0.75em;
transition: rotate 0.3s var(--ease-out-expo);
${Styled.List}[data-orientation="menu"] & {
rotate: -0.25turn;
}
+32 -25
View File
@@ -8,6 +8,7 @@ import { layoutMixins } from '@/styles/layoutMixins';
type PanelProps = {
slotHeaderContent?: string;
slotHeader?: React.ReactNode;
slotRight?: React.ReactNode;
children?: React.ReactNode;
href?: string;
onHeaderClick?: () => void;
@@ -22,6 +23,7 @@ type PanelStyleProps = {
export const Panel = ({
slotHeaderContent,
slotHeader,
slotRight,
children,
href,
onHeaderClick,
@@ -30,55 +32,61 @@ export const Panel = ({
className,
}: PanelProps & PanelStyleProps) => (
<Styled.Panel onClick={onClick}>
{href ? (
<Link to={href}>
{slotHeader ? (
slotHeader
) : (
<Styled.Left>
{href ? (
<Link to={href}>
{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}>
{slotHeaderContent}
<Styled.Icon iconName={IconName.ChevronRight} />
</Styled.Header>
)}
</Link>
) : slotHeader ? (
slotHeader
) : (
slotHeaderContent && (
<Styled.Header role="button" onClick={onHeaderClick} hasSeparator={hasSeparator}>
{slotHeaderContent}
</Styled.Header>
)
)}
<Styled.Content className={className}>{children}</Styled.Content>
)
)}
<Styled.Content className={className}>{children}</Styled.Content>
</Styled.Left>
{slotRight}
</Styled.Panel>
);
const Styled: Record<string, AnyStyledComponent> = {};
Styled.Panel = styled.section`
${layoutMixins.flexColumn}
${layoutMixins.row}
background-color: var(--color-layer-3);
border-radius: 0.875rem;
`;
Styled.Left = styled.div`
${layoutMixins.flexColumn}
width: 100%;
`;
Styled.Header = styled.header<{ hasSeparator?: boolean }>`
${layoutMixins.spacedRow}
padding: 0.875rem 1rem 0.625rem;
font-size: 0.875rem;
padding: 1rem 1rem;
${({ hasSeparator }) =>
hasSeparator &&
css`
padding-bottom: 0.625rem;
box-shadow: 0 var(--border-width) var(--border-color);
`}
`;
Styled.Icon = styled(Icon)`
color: var(--color-text-0);
font-size: 0.625rem;
`;
@@ -86,6 +94,5 @@ Styled.Content = styled.div`
${layoutMixins.scrollArea}
${layoutMixins.stickyArea0}
--stickyArea0-background: transparent;
padding: 0.5rem 1rem;
padding: 1rem 1rem;
`;
+2 -2
View File
@@ -44,7 +44,7 @@ export const useTradingView = ({
const hasMarkets = marketIds.length > 0;
useEffect(() => {
if (hasMarkets && isClientConnected) {
if (hasMarkets && isClientConnected && marketId) {
const widgetOptions = getWidgetOptions();
const widgetOverrides = getWidgetOverrides(appTheme);
const options = {
@@ -75,7 +75,7 @@ export const useTradingView = ({
tvWidgetRef.current = null;
setIsChartReady(false);
};
}, [getCandlesForDatafeed, isClientConnected, hasMarkets, selectedLocale, selectedNetwork]);
}, [getCandlesForDatafeed, isClientConnected, hasMarkets, selectedLocale, selectedNetwork, !!marketId]);
return { savedResolution };
};
+1 -4
View File
@@ -6,7 +6,6 @@ import { useQuery } from 'react-query';
import { formatUnits } from 'viem';
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
import { QUANTUM_MULTIPLIER } from '@/constants/numbers';
import { EvmAddress } from '@/constants/wallets';
import { convertBech32Address } from '@/lib/addressUtils';
@@ -21,7 +20,6 @@ import { useTokenConfigs } from './useTokenConfigs';
type UseAccountBalanceProps = {
// Token Items
addressOrDenom?: string;
assetSymbol?: string;
decimals?: number;
// Chain Items
@@ -40,7 +38,6 @@ export const CHAIN_DEFAULT_TOKEN_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeee
export const useAccountBalance = ({
addressOrDenom,
assetSymbol,
bech32AddrPrefix,
chainId,
decimals = 0,
@@ -91,7 +88,7 @@ export const useAccountBalance = ({
});
const { formatted: evmBalance } = evmQuery.data || {};
const balance = !assetSymbol ? '0' : isCosmosChain ? cosmosQuery.data : evmBalance;
const balance = isCosmosChain ? cosmosQuery.data : evmBalance;
const nativeTokenCoinBalance = balances?.[chainTokenDenom];
const nativeTokenBalance = MustBigNumber(nativeTokenCoinBalance?.amount);
+1
View File
@@ -35,6 +35,7 @@ export { default as LockIcon } from './lock.svg';
export { default as LogoShortIcon } from './logo-short';
export { default as MarketsIcon } from './markets.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 OrderbookIcon } from './orderbook.svg';
export { default as OverviewIcon } from './overview.svg';
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 694 KiB

+24 -11
View File
@@ -24,6 +24,7 @@ import { openDialog } from '@/state/dialogs';
import { headerMixins } from '@/styles/headerMixins';
import { layoutMixins } from '@/styles/layoutMixins';
import breakpoints from '@/styles/breakpoints';
export const HeaderDesktop = () => {
const stringGetter = useStringGetter();
@@ -34,26 +35,26 @@ export const HeaderDesktop = () => {
{
group: 'navigation',
items: [
{
value: 'MARKET',
label: stringGetter({ key: STRING_KEYS.MARKET }),
href: AppRoute.Markets,
},
{
value: 'TRADE',
label: stringGetter({ key: STRING_KEYS.TRADE }),
href: AppRoute.Trade,
},
{
value: chainTokenLabel,
label: chainTokenLabel,
href: `/${chainTokenLabel}`,
},
{
value: 'PORTFOLIO',
label: stringGetter({ key: STRING_KEYS.PORTFOLIO }),
href: AppRoute.Portfolio,
},
{
value: 'MARKETS',
label: stringGetter({ key: STRING_KEYS.MARKETS }),
href: AppRoute.Markets,
},
{
value: chainTokenLabel,
label: chainTokenLabel,
href: `/${chainTokenLabel}`,
},
{
value: 'MORE',
label: stringGetter({ key: STRING_KEYS.MORE }),
@@ -62,7 +63,7 @@ export const HeaderDesktop = () => {
value: 'DOCUMENTATION',
slotBefore: <Icon iconName={IconName.Terminal} />,
label: stringGetter({ key: STRING_KEYS.DOCUMENTATION }),
href: 'https://v4-teacher.vercel.app/',
href: 'https://docs.dydx.exchange/',
},
{
value: 'MINTSCAN',
@@ -150,6 +151,7 @@ const Styled: Record<string, AnyStyledComponent> = {};
Styled.Header = styled.header`
--header-horizontal-padding-mobile: 0.5rem;
--trigger-height: 2.25rem;
--logo-width: 3.5rem;
${layoutMixins.container}
@@ -157,6 +159,8 @@ Styled.Header = styled.header`
${layoutMixins.scrollSnapItem}
backdrop-filter: none;
height: var(--page-currentHeaderHeight);
grid-area: Header;
display: grid;
@@ -169,6 +173,14 @@ Styled.Header = styled.header`
)
var(--border-width) 1fr var(--border-width) auto;
@media ${breakpoints.tablet} {
--trigger-height: 3rem;
}
@media ${breakpoints.mobile} {
--navBefore-width: 7rem;
}
font-size: 0.9375rem;
:before {
@@ -179,6 +191,7 @@ Styled.Header = styled.header`
Styled.NavigationMenu = styled(NavigationMenu)`
& {
--navigationMenu-height: var(--stickyArea-topHeight);
--navigationMenu-item-height: var(--trigger-height);
}
${layoutMixins.scrollArea}
+3 -3
View File
@@ -107,8 +107,8 @@ export const getHydratedTradingData = ({
perpetualMarkets?: Record<string, PerpetualMarket>;
}) => ({
...data,
asset: assets && perpetualMarkets && assets[perpetualMarkets[data.marketId].assetId],
stepSizeDecimals: perpetualMarkets?.[data.marketId].configs?.stepSizeDecimals,
tickSizeDecimals: perpetualMarkets?.[data.marketId].configs?.tickSizeDecimals,
asset: assets && perpetualMarkets && assets[perpetualMarkets[data.marketId]?.assetId],
stepSizeDecimals: perpetualMarkets?.[data.marketId]?.configs?.stepSizeDecimals,
tickSizeDecimals: perpetualMarkets?.[data.marketId]?.configs?.tickSizeDecimals,
...('side' in data && { orderSide: convertAbacusOrderSide(data.side) }),
});
+16 -8
View File
@@ -46,6 +46,8 @@ import {
WALLET_CONNECT_EXPLORER_RECOMMENDED_IDS,
} from '@/constants/wallets';
import { isTruthy } from './isTruthy';
// Config
export const WAGMI_SUPPORTED_CHAINS: Chain[] = [
@@ -78,13 +80,17 @@ export const WAGMI_SUPPORTED_CHAINS: Chain[] = [
celoAlfajores,
];
const { chains, publicClient, webSocketPublicClient } = configureChains(WAGMI_SUPPORTED_CHAINS, [
// alchemyProvider({ apiKey: import.meta.env.VITE_ALCHEMY_API_KEY }),
jsonRpcProvider({
rpc: (chain) => ({ http: chain.rpcUrls.default.http[0] }),
}),
publicProvider(),
]);
const { chains, publicClient, webSocketPublicClient } = configureChains(
WAGMI_SUPPORTED_CHAINS,
[
import.meta.env.VITE_ALCHEMY_API_KEY &&
alchemyProvider({ apiKey: import.meta.env.VITE_ALCHEMY_API_KEY }),
jsonRpcProvider({
rpc: (chain) => ({ http: chain.rpcUrls.default.http[0] }),
}),
publicProvider(),
].filter(isTruthy)
);
const injectedConnectorOptions = {
chains,
@@ -202,5 +208,7 @@ export const resolveWagmiConnector = ({
? createInjectedConnectorWithProvider(walletConnection.provider)
: walletConnection.type === WalletConnectionType.WalletConnect2 && walletConfig.walletconnect2Id
? createWalletConnect2ConnectorWithId(walletConfig.walletconnect2Id, walletConnectConfig)
: getConnectors(walletConnectConfig).find(({ id }: { id: string }) => id === walletConnectionConfig.wagmiConnectorId);
: getConnectors(walletConnectConfig).find(
({ id }: { id: string }) => id === walletConnectionConfig.wagmiConnectorId
);
};
+14 -10
View File
@@ -17,7 +17,7 @@ import { DialogTypes } from '@/constants/dialogs';
import { STRING_KEYS } from '@/constants/localization';
import { AppRoute, PortfolioRoute, HistoryRoute } from '@/constants/routes';
import { wallets, WalletType } from '@/constants/wallets';
import { useAccounts, useStringGetter } from '@/hooks';
import { useAccounts, useStringGetter, useTokenConfigs } from '@/hooks';
import { getOnboardingState } from '@/state/accountSelectors';
import { openDialog } from '@/state/dialogs';
@@ -37,6 +37,7 @@ const Profile = () => {
const isConnected = onboardingState !== OnboardingState.Disconnected;
const { evmAddress, dydxAddress, walletType } = useAccounts();
const { chainTokenLabel } = useTokenConfigs();
const { data: ensName } = useEnsName({
address: evmAddress,
@@ -137,7 +138,11 @@ const Profile = () => {
layout="grid"
/>
</Panel>
<Styled.RewardsPanel header={stringGetter({ key: STRING_KEYS.REWARDS })} hasSeparator>
<Styled.RewardsPanel
slotHeaderContent={stringGetter({ key: STRING_KEYS.REWARDS })}
href={`/${chainTokenLabel}`}
hasSeparator
>
<Styled.Details
items={[
{ key: 'maker', label: stringGetter({ key: STRING_KEYS.YOU_WILL_EARN }), value: '-' },
@@ -149,8 +154,8 @@ const Profile = () => {
</Styled.EqualGrid>
<Styled.TablePanel
header={stringGetter({ key: STRING_KEYS.HISTORY })}
linkto={`${AppRoute.Portfolio}/${PortfolioRoute.History}/${HistoryRoute.Trades}`}
slotHeaderContent={stringGetter({ key: STRING_KEYS.HISTORY })}
href={`${AppRoute.Portfolio}/${PortfolioRoute.History}/${HistoryRoute.Trades}`}
hasSeparator
>
<FillsTable
@@ -273,22 +278,21 @@ Styled.RewardsPanel = styled(Panel)`
`;
Styled.TablePanel = styled(Panel)`
padding: 0;
max-width: calc(100vw - 2rem);
max-height: 10rem;
margin-top: 0.5rem;
padding: 0;
border-radius: 0.875rem;
table {
--tableCell-padding: 0.25rem 1rem;
background-color: transparent;
--tableRow-backgroundColor: var(--color-layer-3);
background-color: var(--color-layer-3);
thead {
color: var(--color-text-0);
}
tbody {
background-color: transparent;
tr {
td:nth-child(2),
td:nth-child(3) {
+2 -4
View File
@@ -22,7 +22,6 @@ import { OnboardingTriggerButton } from '@/views/dialogs/OnboardingTriggerButton
import { openDialog } from '@/state/dialogs';
import { calculateCanAccountTrade } from '@/state/accountCalculators';
// TODO(@aforaleka): replace with real data
export const DYDXBalancePanel = () => {
const dispatch = useDispatch();
const stringGetter = useStringGetter();
@@ -110,7 +109,7 @@ export const DYDXBalancePanel = () => {
value: (
<Output
type={OutputType.Asset}
value={nativeTokenBalance + nativeStakingBalance}
value={nativeTokenBalance.plus(nativeStakingBalance)}
tag={chainTokenLabel}
/>
),
@@ -126,7 +125,7 @@ const Styled: Record<string, AnyStyledComponent> = {};
Styled.Header = styled.div`
${layoutMixins.spacedRow}
padding: 1.25rem 1.5rem 0.5rem;
padding: 1rem 1.5rem 0;
`;
Styled.Title = styled.h3`
@@ -155,7 +154,6 @@ Styled.ReceiveButton = styled(Button)`
Styled.Content = styled.div`
${layoutMixins.flexColumn}
gap: 0.75rem;
padding: 0 0.5rem 0.5rem;
`;
Styled.IconContainer = styled.div`
+222
View File
@@ -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);
`;
+45 -234
View File
@@ -1,134 +1,49 @@
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 { ButtonAction, ButtonSize, ButtonState, ButtonType } from '@/constants/buttons';
import { ButtonAction, ButtonSize } from '@/constants/buttons';
import { DialogTypes } from '@/constants/dialogs';
import { useAccountBalance, useBreakpoints, useStringGetter } from '@/hooks';
import { useBreakpoints, useStringGetter } from '@/hooks';
import { breakpoints } from '@/styles';
import { layoutMixins } from '@/styles/layoutMixins';
import { Details } from '@/components/Details';
import { Panel } from '@/components/Panel';
import { IconName } from '@/components/Icon';
import { Button } from '@/components/Button';
import { IconButton } from '@/components/IconButton';
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 { getSelectedNetwork } from '@/state/appSelectors';
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 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 = () => {
const dispatch = useDispatch();
const stringGetter = useStringGetter();
const { isTablet, isNotTablet } = useBreakpoints();
const selectedNetwork = useSelector(getSelectedNetwork);
// const chainId = Number(ENVIRONMENT_CONFIG_MAP[selectedNetwork].ethereumChainId);
// const { balance } = useAccountBalance({
// addressOrDenom: import.meta.env.VITE_V3_TOKEN_ADDRESS,
// assetSymbol: 'DYDX',
// chainId,
// isCosmosChain: false,
// });
// const tokenBalance = import.meta.env.VITE_V3_TOKEN_ADDRESS ? balance : 0;
const panelArrow = (
<Styled.Arrow>
<Styled.IconButton
action={ButtonAction.Base}
iconName={IconName.Arrow}
size={ButtonSize.Small}
/>
</Styled.Arrow>
);
return (
<Styled.Page>
{/* {isNotTablet ? (
<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>
)} */}
{import.meta.env.VITE_V3_TOKEN_ADDRESS && <MigratePanel />}
<Styled.PanelRow>
{isTablet && (
<Styled.BalancePanelContainer>
@@ -138,42 +53,28 @@ export const RewardsPage = () => {
<Styled.Panel
slotHeader={<Styled.Title>{stringGetter({ key: STRING_KEYS.GOVERNANCE })}</Styled.Title>}
slotRight={panelArrow}
onClick={() => dispatch(openDialog({ type: DialogTypes.ExternalNavKeplr }))}
>
<Styled.Row>
<Styled.Description>
{stringGetter({ key: STRING_KEYS.GOVERNANCE_DESCRIPTION })}
<Link href={GOVERNANCE_HELP_URL} onClick={(e) => e.stopPropagation()}>
{stringGetter({ key: STRING_KEYS.LEARN_MORE })}
</Link>
</Styled.Description>
{/* TODO: vertically center based on Panel height */}
<Styled.IconButton
action={ButtonAction.Base}
iconName={IconName.Arrow}
size={ButtonSize.Small}
/>
</Styled.Row>
<Styled.Description>
{stringGetter({ key: STRING_KEYS.GOVERNANCE_DESCRIPTION })}
<Link href={GOVERNANCE_HELP_URL} onClick={(e) => e.stopPropagation()}>
{stringGetter({ key: STRING_KEYS.LEARN_MORE })}
</Link>
</Styled.Description>
</Styled.Panel>
<Styled.Panel
slotHeader={<Styled.Title>{stringGetter({ key: STRING_KEYS.STAKING })}</Styled.Title>}
slotRight={panelArrow}
onClick={() => dispatch(openDialog({ type: DialogTypes.ExternalNavKeplr }))}
>
<Styled.Row>
<Styled.Description>
{stringGetter({ key: STRING_KEYS.STAKING_DESCRIPTION })}
<Link href={STAKING_HELP_URL} onClick={(e) => e.stopPropagation()}>
{stringGetter({ key: STRING_KEYS.LEARN_MORE })}
</Link>
</Styled.Description>
{/* TODO: vertically center based on Panel height */}
<Styled.IconButton
action={ButtonAction.Base}
iconName={IconName.Arrow}
size={ButtonSize.Small}
/>
</Styled.Row>
<Styled.Description>
{stringGetter({ key: STRING_KEYS.STAKING_DESCRIPTION })}
<Link href={STAKING_HELP_URL} onClick={(e) => e.stopPropagation()}>
{stringGetter({ key: STRING_KEYS.LEARN_MORE })}
</Link>
</Styled.Description>
</Styled.Panel>
{isNotTablet && (
@@ -191,61 +92,25 @@ const Styled: Record<string, AnyStyledComponent> = {};
Styled.Page = styled.div`
${layoutMixins.contentContainerPage}
gap: 1.5rem;
@media ${breakpoints.tablet} {
padding: 1rem;
}
`;
Styled.Panel = styled(Panel)`
padding: 0 1.5rem 1rem;
@media ${breakpoints.tablet} {
max-width: calc(100vw - 2rem);
}
padding: 1rem 1.5rem;
`;
Styled.Row = styled.div`
${layoutMixins.spacedRow}
gap: 1rem;
align-items: center;
Styled.Title = styled.h3`
font: var(--font-medium-book);
color: var(--color-text-2);
padding: 1rem 1.5rem 0;
`;
Styled.Description = styled.div`
color: var(--color-text-0);
a {
color: var(--color-text-1);
}
--link-color: var(--color-text-1);
`;
Styled.Migrate = styled.section`
max-width: min(100vw, var(--content-max-width));
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)`
Styled.PanelRow = styled.div`
${layoutMixins.spacedRow}
gap: 1.5rem;
max-width: min(100vw, var(--content-max-width));
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)`
color: var(--color-text-0);
--color-border: var(--color-layer-6);
`;
Styled.Arrow = styled.div`
padding: 1rem 1.5rem;
`;
+2 -2
View File
@@ -17,7 +17,7 @@ import { MustBigNumber } from '@/lib/numbers';
import { MidMarketPrice } from '@/views/MidMarketPrice';
export const TradeHeaderMobile = () => {
const { name, symbol } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
const { name, id } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
const navigate = useNavigate();
const { market, priceChange24H, priceChange24HPercent } =
@@ -27,7 +27,7 @@ export const TradeHeaderMobile = () => {
<Styled.Header>
<BackButton onClick={() => navigate(AppRoute.Markets)} />
<Styled.MarketName>
<Styled.AssetIcon symbol={symbol} />
<Styled.AssetIcon symbol={id} />
<Styled.Name>
<h3>{name}</h3>
<span>{market}</span>
+1 -1
View File
@@ -168,7 +168,7 @@ Styled.TriggerIcon = styled.span`
width: 0.75em;
display: inline-flex;
transition: transform 0.3s var(--ease-out-expo);
transition: rotate 0.3s var(--ease-out-expo);
${Styled.Trigger}[data-state='open'] & {
rotate: -0.5turn;
@@ -104,4 +104,5 @@ Styled.Button = styled(Button)`
Styled.IconButton = styled(IconButton)`
color: var(--color-text-0);
--color-border: var(--color-layer-6);
`;
@@ -130,12 +130,14 @@ export const GenerateKeys = ({
}
}
} catch (error) {
setStatus(EvmDerivedAccountStatus.NotDerived);
const { message } = parseWalletError({ error, stringGetter });
if (message) {
track(AnalyticsEvent.OnboardingWalletIsNonDeterministic);
setError(message);
}
return;
}
await setWalletFromEvmSignature(signature);
+1 -1
View File
@@ -37,7 +37,7 @@ export const TradeDialog = ({ isOpen, setIsOpen, slotTrigger }: ElementProps) =>
const selectedTradeType = getSelectedTradeType(type);
const { typeOptions } = useSelector(getInputTradeOptions, shallowEqual) ?? {};
const allTradeTypeItems = typeOptions?.toArray()?.map(({ type, stringKey }) => ({
const allTradeTypeItems = (typeOptions?.toArray() ?? []).map(({ type, stringKey }) => ({
value: type,
label: stringGetter({
key: stringKey as StringKey,
@@ -87,7 +87,6 @@ export const DepositForm = ({ onDeposit, onError }: DepositFormProps) => {
// Async Data
const { balance, queryStatus, isQueryFetching } = useAccountBalance({
addressOrDenom: sourceToken?.address || CHAIN_DEFAULT_TOKEN_ADDRESS,
assetSymbol: sourceToken?.symbol || undefined,
chainId: chainId,
decimals: sourceToken?.decimals || undefined,
isCosmosChain: false,
-1
View File
@@ -322,7 +322,6 @@ export const TradeForm = ({
summary={summary ?? undefined}
currentStep={currentStep}
showDeposit={inputAlert?.errorAction === TradeInputErrorAction.DEPOSIT}
showConnectWallet={inputAlert?.errorAction === TradeInputErrorAction.CONNECT_WALLET}
/>
</Styled.Footer>
</Styled.TradeForm>
@@ -7,9 +7,8 @@ import { DialogTypes } from '@/constants/dialogs';
import { STRING_KEYS } from '@/constants/localization';
import { TRADE_TYPE_STRINGS, MobilePlaceOrderSteps } from '@/constants/trade';
import { useStringGetter } from '@/hooks';
import { useStringGetter, useTokenConfigs } from '@/hooks';
import { AssetIcon } from '@/components/AssetIcon';
import { Button } from '@/components/Button';
import { Output, OutputType, ShowSign } from '@/components/Output';
import { WithDetailsReceipt } from '@/components/WithDetailsReceipt';
@@ -47,6 +46,7 @@ export const PlaceOrderButtonAndReceipt = ({
}: ElementProps) => {
const stringGetter = useStringGetter();
const dispatch = useDispatch();
const { chainTokenLabel } = useTokenConfigs();
const canAccountTrade = useSelector(calculateCanAccountTrade);
const subaccountNumber = useSelector(getSubaccountId);
@@ -88,7 +88,14 @@ export const PlaceOrderButtonAndReceipt = ({
{/* <AssetIcon symbol="DYDX" /> */}
</>
),
value: <Output type={OutputType.Asset} value={reward} useGrouping tag={reward ? "Dv4TNT" : ''} />,
value: (
<Output
type={OutputType.Asset}
value={reward}
useGrouping
tag={reward ? chainTokenLabel : ''}
/>
),
tooltip: 'max-reward',
},
{
@@ -111,7 +118,7 @@ export const PlaceOrderButtonAndReceipt = ({
? actionStringKey
: STRING_KEYS.UNAVAILABLE,
buttonAction: ButtonAction.Primary,
buttonState: { isDisabled: !shouldEnableTrade },
buttonState: { isDisabled: !shouldEnableTrade, isLoading: hasMissingData },
},
[MobilePlaceOrderSteps.PreviewOrder]: {
@@ -148,7 +155,10 @@ export const PlaceOrderButtonAndReceipt = ({
const buttonState = currentStep
? buttonStatesPerStep[currentStep].buttonState
: { isDisabled: !shouldEnableTrade || isLoading, isLoading };
: {
isDisabled: !shouldEnableTrade || isLoading,
isLoading: isLoading || hasMissingData,
};
return (
<WithDetailsReceipt detailItems={items}>
+1 -1
View File
@@ -161,7 +161,7 @@ const getFillsTableColumnDef = ({
}[orderSide],
})}
</Styled.Side>
<Output type={OutputType.Text} value={asset.id} />
<Output type={OutputType.Text} value={asset?.id} />
</Styled.TableCell>
),
},
+3 -3
View File
@@ -231,7 +231,7 @@ const getOrdersTableColumnDef = ({
key: STRING_KEYS.FILL,
})}`,
renderCell: ({
asset: { symbol: assetSymbol },
asset,
createdAtMilliseconds,
size,
status,
@@ -254,7 +254,7 @@ const getOrdersTableColumnDef = ({
value={createdAtMilliseconds}
/>
<Styled.AssetIconWithStatus>
<Styled.AssetIcon symbol={assetSymbol} />
<Styled.AssetIcon symbol={asset?.id} />
<Styled.StatusDot color={statusIconColor} />
</Styled.AssetIconWithStatus>
</>
@@ -276,7 +276,7 @@ const getOrdersTableColumnDef = ({
type={OutputType.Asset}
value={size}
fractionDigits={TOKEN_DECIMALS}
tag={assetSymbol}
tag={asset?.id}
/>
</Styled.InlineRow>
</TableCell>