Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b220203c91 |
+1
-2
@@ -6,5 +6,4 @@ VITE_PK_ENCRYPTION_KEY=
|
|||||||
|
|
||||||
VITE_WALLETCONNECT2_PROJECT_ID=
|
VITE_WALLETCONNECT2_PROJECT_ID=
|
||||||
|
|
||||||
VITE_V3_TOKEN_ADDRESS=0x6d5bb505a4f85c10b122ccc36e30f57e2b86a291
|
VITE_V3_TOKEN_ADDRESS=
|
||||||
VITE_TOKEN_MIGRATION_URI=https://bridge.dydx.trade/
|
|
||||||
@@ -1,3 +1,45 @@
|
|||||||
|
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 License’s 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 License’s 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.
|
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.
|
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.
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<p align="center"><img src="https://dydx.exchange/icon.svg?" width="256" /></p>
|
<p align="center"><img src="https://dydx.exchange/icon.svg?" width="256" /></p>
|
||||||
|
|
||||||
<h1 align="center">dYdX Chain Web</h1>
|
<h1 align="center">v4 Web</h1>
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a href='https://github.com/dydxprotocol/v4-web/blob/main/LICENSE'>
|
<a href='https://github.com/dydxprotocol/v4-web/blob/main/LICENSE'>
|
||||||
<img src='https://img.shields.io/badge/License-AGPL_v3-blue.svg' alt='License' />
|
<img src='https://img.shields.io/badge/License-BSL_1.1-blue' alt='License' />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ Alternatively, follow the [IPFS Kubo installation guide](https://docs.ipfs.tech
|
|||||||
|
|
||||||
## Part 1: Setting up your local environment
|
## Part 1: Setting up your local environment
|
||||||
|
|
||||||
### 1. Clone the repo
|
### Step 1: Clone the repo
|
||||||
|
|
||||||
Clone the repository and navigate to its directory:
|
Clone the repository and navigate to its directory:
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ git clone https://github.com/dydxprotocol/v4-web.git
|
|||||||
cd v4-web
|
cd v4-web
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Install pnpm and dependencies
|
### Step 2: Install pnpm and dependencies
|
||||||
|
|
||||||
Install pnpm and the project dependencies:
|
Install pnpm and the project dependencies:
|
||||||
|
|
||||||
@@ -69,9 +69,7 @@ You'll need to provide a Wallet Connect project id to enable onboarding and wall
|
|||||||
- Create a project on https://cloud.walletconnect.com/app
|
- Create a project on https://cloud.walletconnect.com/app
|
||||||
- Copy over the project ID into this [field](https://github.com/dydxprotocol/v4-web/blob/67ecbd75b43e0c264b7b4d2d9b3d969830b0621c/public/configs/env.json#L822C33-L822C46)
|
- Copy over the project ID into this [field](https://github.com/dydxprotocol/v4-web/blob/67ecbd75b43e0c264b7b4d2d9b3d969830b0621c/public/configs/env.json#L822C33-L822C46)
|
||||||
|
|
||||||
# Deployments
|
## Part 4: Deploying with Vercel
|
||||||
|
|
||||||
## Deploying with Vercel
|
|
||||||
|
|
||||||
### Step 1: Connect your repository to Vercel
|
### Step 1: Connect your repository to Vercel
|
||||||
|
|
||||||
@@ -88,7 +86,7 @@ If you wish to incorporate analytics via Amplitude and Bugsnag, you can use our
|
|||||||
|
|
||||||
For more details, check out Vercel's [official documentation](https://vercel.com/docs).
|
For more details, check out Vercel's [official documentation](https://vercel.com/docs).
|
||||||
|
|
||||||
## Deploying to IPFS
|
## Part 5: Deploying to IPFS
|
||||||
|
|
||||||
### web3.storage: deploy to IPFS via web3.storage using the provided script
|
### web3.storage: deploy to IPFS via web3.storage using the provided script
|
||||||
|
|
||||||
@@ -120,18 +118,3 @@ To access your content on IPFS:
|
|||||||
2. **Public IPFS gateway:** Access your content via a public IPFS gateway, such as [https://dweb.link](https://dweb.link/) or [https://w3s.link/](https://w3s.link/). Use the gateway URL with your CID appended, like `https://dweb.link/ipfs/your_cid`.
|
2. **Public IPFS gateway:** Access your content via a public IPFS gateway, such as [https://dweb.link](https://dweb.link/) or [https://w3s.link/](https://w3s.link/). Use the gateway URL with your CID appended, like `https://dweb.link/ipfs/your_cid`.
|
||||||
|
|
||||||
Replace `your_cid` with the actual CID.
|
Replace `your_cid` with the actual CID.
|
||||||
|
|
||||||
## Cloudflare Settings
|
|
||||||
|
|
||||||
We recommend that you add your website to Cloudflare for additional security settings.
|
|
||||||
|
|
||||||
To block OFAC Sanctioned countries:
|
|
||||||
1. Navigate Websites > Domain > Security > WAF
|
|
||||||
|
|
||||||
2. Create Rule with the following settings:
|
|
||||||
* If incoming requests match
|
|
||||||
`(ip.geoip.country eq "CU") or (ip.geoip.country eq "IR") or (ip.geoip.country eq "KP") or (ip.geoip.country eq "SY") or (ip.geoip.country eq "MM") or (ip.geoip.subdivision_1_iso_code eq "UA-09") or (ip.geoip.subdivision_1_iso_code eq "UA-14") or (ip.geoip.subdivision_1_iso_code eq "UA-43")`
|
|
||||||
* This rule will bring up a Cloudflare page when a restricted geography tries to access your site. You will have the option to display:
|
|
||||||
1. Custom Text
|
|
||||||
- (e.g. `Because you appear to be a resident of, or trading from, a jurisdiction that violates our terms of use, or have engaged in activity that violates our terms of use, you have been blocked. You may withdraw your funds from the protocol at any time.`)
|
|
||||||
2. Default Cloudflare WAF block page
|
|
||||||
|
|||||||
+5
-5
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "dydx-chain-web",
|
"name": "dydx-chain-web",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.0",
|
"version": "0.0.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "AGPL-3.0",
|
"license": "BSL-1.1",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
},
|
},
|
||||||
@@ -39,9 +39,9 @@
|
|||||||
"@cosmjs/proto-signing": "^0.31.0",
|
"@cosmjs/proto-signing": "^0.31.0",
|
||||||
"@cosmjs/stargate": "^0.31.0",
|
"@cosmjs/stargate": "^0.31.0",
|
||||||
"@cosmjs/tendermint-rpc": "^0.31.0",
|
"@cosmjs/tendermint-rpc": "^0.31.0",
|
||||||
"@dydxprotocol/v4-abacus": "^1.0.10",
|
"@dydxprotocol/v4-abacus": "^0.7.6",
|
||||||
"@dydxprotocol/v4-client-js": "^1.0.0",
|
"@dydxprotocol/v4-client-js": "^0.40.3",
|
||||||
"@dydxprotocol/v4-localization": "^1.0.0",
|
"@dydxprotocol/v4-localization": "^0.1.32",
|
||||||
"@ethersproject/providers": "^5.7.2",
|
"@ethersproject/providers": "^5.7.2",
|
||||||
"@js-joda/core": "^5.5.3",
|
"@js-joda/core": "^5.5.3",
|
||||||
"@radix-ui/react-collapsible": "^1.0.3",
|
"@radix-ui/react-collapsible": "^1.0.3",
|
||||||
|
|||||||
Generated
+15
-15
@@ -27,14 +27,14 @@ dependencies:
|
|||||||
specifier: ^0.31.0
|
specifier: ^0.31.0
|
||||||
version: 0.31.0
|
version: 0.31.0
|
||||||
'@dydxprotocol/v4-abacus':
|
'@dydxprotocol/v4-abacus':
|
||||||
specifier: ^1.0.10
|
specifier: ^0.7.6
|
||||||
version: 1.0.10
|
version: 0.7.6
|
||||||
'@dydxprotocol/v4-client-js':
|
'@dydxprotocol/v4-client-js':
|
||||||
specifier: ^1.0.0
|
specifier: ^0.40.3
|
||||||
version: 1.0.0
|
version: 0.40.3
|
||||||
'@dydxprotocol/v4-localization':
|
'@dydxprotocol/v4-localization':
|
||||||
specifier: ^1.0.0
|
specifier: ^0.1.32
|
||||||
version: 1.0.0
|
version: 0.1.32
|
||||||
'@ethersproject/providers':
|
'@ethersproject/providers':
|
||||||
specifier: ^5.7.2
|
specifier: ^5.7.2
|
||||||
version: 5.7.2
|
version: 5.7.2
|
||||||
@@ -979,12 +979,12 @@ packages:
|
|||||||
resolution: {integrity: sha512-RpfLEtTlyIxeNPGKcokS+p3BZII/Q3bYxryFRglh5H3A3T8q9fsLYm72VYAMEOOIBLEa8o93kFLiBDUWKrwXZA==}
|
resolution: {integrity: sha512-RpfLEtTlyIxeNPGKcokS+p3BZII/Q3bYxryFRglh5H3A3T8q9fsLYm72VYAMEOOIBLEa8o93kFLiBDUWKrwXZA==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@dydxprotocol/v4-abacus@1.0.10:
|
/@dydxprotocol/v4-abacus@0.7.6:
|
||||||
resolution: {integrity: sha512-SdxI/JcyxM1ydtR9ImWujeurea3gbxj37qYnw1wz829BQiZ05uNEtll3xJCI0MjpG+01ARsxVys7SHbpjSxwOg==}
|
resolution: {integrity: sha512-FdDXRaFMfxhyrJJs0dNrb1KG6X95lPHelua1yCn/SVgzwGaAqlJczrzmdh98INntuRAgIxOu69R5mCGyekumyg==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@dydxprotocol/v4-client-js@1.0.0:
|
/@dydxprotocol/v4-client-js@0.40.3:
|
||||||
resolution: {integrity: sha512-ehfHO+zQy795TcJRwtiawadFHZyh4HnpJNP26hCGsIjLE5q6LLHweQHpK/1N/sXU1PBOuQwc7iaJnFop6gYauQ==}
|
resolution: {integrity: sha512-nMQd6tYisKDKIbfx0BGJSYEOSt+I+t5SsaBSmlgTdso+w2rCRO9vyxS+u6MF9h4w5FsVRfhHo3e6uTWX48WpGQ==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@cosmjs/amino': 0.30.1
|
'@cosmjs/amino': 0.30.1
|
||||||
'@cosmjs/encoding': 0.31.1
|
'@cosmjs/encoding': 0.31.1
|
||||||
@@ -1011,8 +1011,8 @@ packages:
|
|||||||
- utf-8-validate
|
- utf-8-validate
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@dydxprotocol/v4-localization@1.0.0:
|
/@dydxprotocol/v4-localization@0.1.32:
|
||||||
resolution: {integrity: sha512-U7QjOlzpfSAVEchkNDB3xYRx7okzdeYi83XsnHwI+EHa2quFm/2Y2dhrBkT5fqpZmhcwxb/vG8AZmFSToOf9hA==}
|
resolution: {integrity: sha512-ZtXScxgFLjUt0Ag52RyFnQe9aEl1Aky5fp+vMGOBduVkFiCEMRMkSsSgg6grMdyw/x0AbnxOTRkhYoX2MsK9Ow==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@dydxprotocol/v4-proto@0.4.1:
|
/@dydxprotocol/v4-proto@0.4.1:
|
||||||
@@ -7656,7 +7656,7 @@ packages:
|
|||||||
resolution: {integrity: sha512-WIdaQ8uW1vIbYvNnAVunkC6yxTrneJC7VQ5UUQ0kuw8b0C0A39KTIpoQHCfc8tV7o9vF4niwRhdXEdfAgQEsQQ==}
|
resolution: {integrity: sha512-WIdaQ8uW1vIbYvNnAVunkC6yxTrneJC7VQ5UUQ0kuw8b0C0A39KTIpoQHCfc8tV7o9vF4niwRhdXEdfAgQEsQQ==}
|
||||||
dependencies:
|
dependencies:
|
||||||
cosmos-directory-types: 0.0.6
|
cosmos-directory-types: 0.0.6
|
||||||
node-fetch-native: 1.4.1
|
node-fetch-native: 1.4.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/cosmos-directory-types@0.0.6:
|
/cosmos-directory-types@0.0.6:
|
||||||
@@ -11287,8 +11287,8 @@ packages:
|
|||||||
engines: {node: '>=10.5.0'}
|
engines: {node: '>=10.5.0'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/node-fetch-native@1.4.1:
|
/node-fetch-native@1.4.0:
|
||||||
resolution: {integrity: sha512-NsXBU0UgBxo2rQLOeWNZqS3fvflWePMECr8CoSWoSTqCqGbVVsvl9vZu1HfQicYN0g5piV9Gh8RTEvo/uP752w==}
|
resolution: {integrity: sha512-F5kfEj95kX8tkDhUCYdV8dg3/8Olx/94zB8+ZNthFs6Bz31UpUi8Xh40TN3thLwXgrwXry1pEg9lJ++tLWTcqA==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/node-fetch@2.6.12:
|
/node-fetch@2.6.12:
|
||||||
|
|||||||
@@ -8,43 +8,67 @@
|
|||||||
],
|
],
|
||||||
"components": [
|
"components": [
|
||||||
{
|
{
|
||||||
"/": "/"
|
"/": "/trade/*"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/#/"
|
"/": "/r/*"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "*/markets"
|
"/": "/portfolio/overview"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "*/trade"
|
"/": "/portfolio/positions"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "*/trade/*"
|
"/": "/portfolio/orders"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "*/portfolio"
|
"/": "/portfolio/fees"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "*/portfolio/overview"
|
"/": "/portfolio/history"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "*/portfolio/positions"
|
"/": "/portfolio/history/trades"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "*/portfolio/orders"
|
"/": "/portfolio/history/transfers"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "*/portfolio/fees"
|
"/": "/portfolio/history/funding"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "*/portfolio/history/trades"
|
"/": "/rewards"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "*/portfolio/history/transfers"
|
"/": "/my-profile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "*/portfolio/history/funding"
|
"/": "/rankings/hedgies"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"/": "/rankings/competition"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"/": "/rankings/diamond"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"/": "/rankings/platinum"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"/": "/rankings/gold"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"/": "/rankings/silver"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"/": "/rankings/bronze"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"/": "/rankings/pnl-absolute"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"/": "/rankings/pnl-percent"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"/": "/walletsegue",
|
"/": "/walletsegue",
|
||||||
|
|||||||
+85
-304
@@ -22,11 +22,10 @@
|
|||||||
"dydxprotocol-staging-west",
|
"dydxprotocol-staging-west",
|
||||||
"dydxprotocol-testnet",
|
"dydxprotocol-testnet",
|
||||||
"dydxprotocol-testnet-dydx",
|
"dydxprotocol-testnet-dydx",
|
||||||
|
"dydxprotocol-testnet-dsrv",
|
||||||
"dydxprotocol-testnet-nodefleet",
|
"dydxprotocol-testnet-nodefleet",
|
||||||
"dydxprotocol-testnet-kingnodes",
|
"dydxprotocol-testnet-kingnodes",
|
||||||
"dydxprotocol-testnet-liquify",
|
"dydxprotocol-testnet-liquify"
|
||||||
"dydxprotocol-testnet-polkachu",
|
|
||||||
"dydxprotocol-testnet-bware"
|
|
||||||
],
|
],
|
||||||
"default": "dydxprotocol-testnet"
|
"default": "dydxprotocol-testnet"
|
||||||
}
|
}
|
||||||
@@ -38,7 +37,6 @@
|
|||||||
"dydxChainId": "dydxprotocol-testnet",
|
"dydxChainId": "dydxprotocol-testnet",
|
||||||
"chainName": "dYdX Chain",
|
"chainName": "dYdX Chain",
|
||||||
"chainLogo": "dydx-chain.png",
|
"chainLogo": "dydx-chain.png",
|
||||||
"squidIntegratorId": "dYdX-api",
|
|
||||||
"isMainNet": false,
|
"isMainNet": false,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"chain": {
|
"chain": {
|
||||||
@@ -72,19 +70,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}",
|
||||||
"blogs": "https://www.dydx.foundation/blog",
|
"blogs": "https://www.dydx.foundation/blog"
|
||||||
"foundation": "https://www.dydx.foundation",
|
|
||||||
"help": "https://help.dydx.exchange/",
|
|
||||||
"initialMarginFractionLearnMore": "https://help.dydx.exchange/articles/5232637-maximum-position-sizes",
|
|
||||||
"reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders",
|
|
||||||
"mintscanBase": "https://testnet.mintscan.io/dydx-testnet",
|
|
||||||
"documentation": "https://docs.dydx.exchange/",
|
|
||||||
"community": "https://discord.com/invite/dydx",
|
|
||||||
"governanceLearnMore": "https://help.dydx.exchange",
|
|
||||||
"stakingLearnMore": "https://help.dydx.exchange",
|
|
||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange",
|
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -111,7 +97,6 @@
|
|||||||
"dydxChainId": "dydxprotocol-testnet",
|
"dydxChainId": "dydxprotocol-testnet",
|
||||||
"chainName": "dYdX Chain",
|
"chainName": "dYdX Chain",
|
||||||
"chainLogo": "dydx-chain.png",
|
"chainLogo": "dydx-chain.png",
|
||||||
"squidIntegratorId": "dYdX-api",
|
|
||||||
"isMainNet": false,
|
"isMainNet": false,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"chain": {
|
"chain": {
|
||||||
@@ -144,19 +129,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}",
|
||||||
"blogs": "https://www.dydx.foundation/blog",
|
"blogs": "https://www.dydx.foundation/blog"
|
||||||
"foundation": "https://www.dydx.foundation",
|
|
||||||
"help": "https://help.dydx.exchange/",
|
|
||||||
"initialMarginFractionLearnMore": "https://help.dydx.exchange/articles/5232637-maximum-position-sizes",
|
|
||||||
"reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders",
|
|
||||||
"mintscanBase": "https://testnet.mintscan.io/dydx-testnet",
|
|
||||||
"documentation": "https://docs.dydx.exchange/",
|
|
||||||
"community": "https://discord.com/invite/dydx",
|
|
||||||
"governanceLearnMore": "https://help.dydx.exchange",
|
|
||||||
"stakingLearnMore": "https://help.dydx.exchange",
|
|
||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange",
|
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -183,7 +156,6 @@
|
|||||||
"dydxChainId": "dydxprotocol-testnet",
|
"dydxChainId": "dydxprotocol-testnet",
|
||||||
"chainName": "dYdX Chain",
|
"chainName": "dYdX Chain",
|
||||||
"chainLogo": "dydx-chain.png",
|
"chainLogo": "dydx-chain.png",
|
||||||
"squidIntegratorId": "dYdX-api",
|
|
||||||
"isMainNet": false,
|
"isMainNet": false,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"chain": {
|
"chain": {
|
||||||
@@ -216,19 +188,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}",
|
||||||
"blogs": "https://www.dydx.foundation/blog",
|
"blogs": "https://www.dydx.foundation/blog"
|
||||||
"foundation": "https://www.dydx.foundation",
|
|
||||||
"help": "https://help.dydx.exchange/",
|
|
||||||
"initialMarginFractionLearnMore": "https://help.dydx.exchange/articles/5232637-maximum-position-sizes",
|
|
||||||
"reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders",
|
|
||||||
"mintscanBase": "https://testnet.mintscan.io/dydx-testnet",
|
|
||||||
"documentation": "https://docs.dydx.exchange/",
|
|
||||||
"community": "https://discord.com/invite/dydx",
|
|
||||||
"governanceLearnMore": "https://help.dydx.exchange",
|
|
||||||
"stakingLearnMore": "https://help.dydx.exchange",
|
|
||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange",
|
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -255,7 +215,6 @@
|
|||||||
"dydxChainId": "dydxprotocol-testnet",
|
"dydxChainId": "dydxprotocol-testnet",
|
||||||
"chainName": "dYdX Chain",
|
"chainName": "dYdX Chain",
|
||||||
"chainLogo": "dydx-chain.png",
|
"chainLogo": "dydx-chain.png",
|
||||||
"squidIntegratorId": "dYdX-api",
|
|
||||||
"isMainNet": false,
|
"isMainNet": false,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"chain": {
|
"chain": {
|
||||||
@@ -288,19 +247,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}",
|
||||||
"blogs": "https://www.dydx.foundation/blog",
|
"blogs": "https://www.dydx.foundation/blog"
|
||||||
"foundation": "https://www.dydx.foundation",
|
|
||||||
"help": "https://help.dydx.exchange/",
|
|
||||||
"initialMarginFractionLearnMore": "https://help.dydx.exchange/articles/5232637-maximum-position-sizes",
|
|
||||||
"reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders",
|
|
||||||
"mintscanBase": "https://testnet.mintscan.io/dydx-testnet",
|
|
||||||
"documentation": "https://docs.dydx.exchange/",
|
|
||||||
"community": "https://discord.com/invite/dydx",
|
|
||||||
"governanceLearnMore": "https://help.dydx.exchange",
|
|
||||||
"stakingLearnMore": "https://help.dydx.exchange",
|
|
||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange",
|
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -327,7 +274,6 @@
|
|||||||
"dydxChainId": "dydxprotocol-testnet",
|
"dydxChainId": "dydxprotocol-testnet",
|
||||||
"chainName": "dYdX Chain",
|
"chainName": "dYdX Chain",
|
||||||
"chainLogo": "dydx-chain.png",
|
"chainLogo": "dydx-chain.png",
|
||||||
"squidIntegratorId": "dYdX-api",
|
|
||||||
"isMainNet": false,
|
"isMainNet": false,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"chain": {
|
"chain": {
|
||||||
@@ -361,20 +307,10 @@
|
|||||||
"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://docs.dydx.exchange/",
|
"documentation": "https://v4-teacher.vercel.app/",
|
||||||
"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",
|
|
||||||
"foundation": "https://www.dydx.foundation",
|
|
||||||
"initialMarginFractionLearnMore": "https://help.dydx.exchange/articles/5232637-maximum-position-sizes",
|
|
||||||
"reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders",
|
|
||||||
"mintscanBase": "https://testnet.mintscan.io/dydx-testnet",
|
|
||||||
"governanceLearnMore": "https://help.dydx.exchange",
|
|
||||||
"stakingLearnMore": "https://help.dydx.exchange",
|
|
||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange",
|
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -401,7 +337,6 @@
|
|||||||
"dydxChainId": "dydxprotocol-testnet",
|
"dydxChainId": "dydxprotocol-testnet",
|
||||||
"chainName": "dYdX Chain",
|
"chainName": "dYdX Chain",
|
||||||
"chainLogo": "dydx-chain.png",
|
"chainLogo": "dydx-chain.png",
|
||||||
"squidIntegratorId": "dYdX-api",
|
|
||||||
"isMainNet": false,
|
"isMainNet": false,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"chain": {
|
"chain": {
|
||||||
@@ -435,20 +370,10 @@
|
|||||||
"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://docs.dydx.exchange/",
|
"documentation": "https://v4-teacher.vercel.app/",
|
||||||
"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",
|
|
||||||
"foundation": "https://www.dydx.foundation",
|
|
||||||
"initialMarginFractionLearnMore": "https://help.dydx.exchange/articles/5232637-maximum-position-sizes",
|
|
||||||
"reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders",
|
|
||||||
"mintscanBase": "https://testnet.mintscan.io/dydx-testnet",
|
|
||||||
"governanceLearnMore": "https://help.dydx.exchange",
|
|
||||||
"stakingLearnMore": "https://help.dydx.exchange",
|
|
||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange",
|
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -475,7 +400,6 @@
|
|||||||
"dydxChainId": "dydx-testnet-4",
|
"dydxChainId": "dydx-testnet-4",
|
||||||
"chainName": "dYdX Chain",
|
"chainName": "dYdX Chain",
|
||||||
"chainLogo": "dydx-chain.png",
|
"chainLogo": "dydx-chain.png",
|
||||||
"squidIntegratorId": "dYdX-api",
|
|
||||||
"isMainNet": false,
|
"isMainNet": false,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"chain": {
|
"chain": {
|
||||||
@@ -500,8 +424,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"validators": [
|
"validators": [
|
||||||
"https://dydx-testnet-full-rpc.public.blastapi.io/",
|
|
||||||
"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"
|
||||||
@@ -513,20 +435,10 @@
|
|||||||
"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://docs.dydx.exchange/",
|
"documentation": "https://v4-teacher.vercel.app/",
|
||||||
"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"
|
||||||
"foundation": "https://www.dydx.foundation",
|
|
||||||
"help": "https://help.dydx.exchange/",
|
|
||||||
"initialMarginFractionLearnMore": "https://help.dydx.exchange/articles/5232637-maximum-position-sizes",
|
|
||||||
"reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders",
|
|
||||||
"mintscanBase": "https://testnet.mintscan.io/dydx-testnet",
|
|
||||||
"governanceLearnMore": "https://help.dydx.exchange",
|
|
||||||
"stakingLearnMore": "https://help.dydx.exchange",
|
|
||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange",
|
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -553,7 +465,6 @@
|
|||||||
"dydxChainId": "dydx-testnet-4",
|
"dydxChainId": "dydx-testnet-4",
|
||||||
"chainName": "dYdX Chain",
|
"chainName": "dYdX Chain",
|
||||||
"chainLogo": "dydx-chain.png",
|
"chainLogo": "dydx-chain.png",
|
||||||
"squidIntegratorId": "dYdX-api",
|
|
||||||
"isMainNet": false,
|
"isMainNet": false,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"chain": {
|
"chain": {
|
||||||
@@ -588,20 +499,74 @@
|
|||||||
"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://docs.dydx.exchange/",
|
"documentation": "https://v4-teacher.vercel.app/",
|
||||||
"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"
|
||||||
"foundation": "https://www.dydx.foundation",
|
},
|
||||||
"help": "https://help.dydx.exchange/",
|
"wallets": {
|
||||||
"initialMarginFractionLearnMore": "https://help.dydx.exchange/articles/5232637-maximum-position-sizes",
|
"walletconnect": {
|
||||||
"reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders",
|
"client": {
|
||||||
"mintscanBase": "https://testnet.mintscan.io/dydx-testnet",
|
"name": "dYdX v4",
|
||||||
"governanceLearnMore": "https://help.dydx.exchange",
|
"description": "dYdX v4 App",
|
||||||
"stakingLearnMore": "https://help.dydx.exchange",
|
"iconUrl": "/logos/dydx-x.png"
|
||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
},
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange",
|
"v2": {
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"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/",
|
||||||
|
"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": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -628,7 +593,6 @@
|
|||||||
"dydxChainId": "dydx-testnet-4",
|
"dydxChainId": "dydx-testnet-4",
|
||||||
"chainName": "dYdX Chain",
|
"chainName": "dYdX Chain",
|
||||||
"chainLogo": "dydx-chain.png",
|
"chainLogo": "dydx-chain.png",
|
||||||
"squidIntegratorId": "dYdX-api",
|
|
||||||
"isMainNet": false,
|
"isMainNet": false,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"chain": {
|
"chain": {
|
||||||
@@ -663,20 +627,10 @@
|
|||||||
"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://docs.dydx.exchange/",
|
"documentation": "https://v4-teacher.vercel.app/",
|
||||||
"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"
|
||||||
"foundation": "https://www.dydx.foundation",
|
|
||||||
"help": "https://help.dydx.exchange/",
|
|
||||||
"initialMarginFractionLearnMore": "https://help.dydx.exchange/articles/5232637-maximum-position-sizes",
|
|
||||||
"reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders",
|
|
||||||
"mintscanBase": "https://testnet.mintscan.io/dydx-testnet",
|
|
||||||
"governanceLearnMore": "https://help.dydx.exchange",
|
|
||||||
"stakingLearnMore": "https://help.dydx.exchange",
|
|
||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange",
|
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -703,7 +657,6 @@
|
|||||||
"dydxChainId": "dydx-testnet-4",
|
"dydxChainId": "dydx-testnet-4",
|
||||||
"chainName": "dYdX Chain",
|
"chainName": "dYdX Chain",
|
||||||
"chainLogo": "dydx-chain.png",
|
"chainLogo": "dydx-chain.png",
|
||||||
"squidIntegratorId": "dYdX-api",
|
|
||||||
"isMainNet": false,
|
"isMainNet": false,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"chain": {
|
"chain": {
|
||||||
@@ -738,20 +691,10 @@
|
|||||||
"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://docs.dydx.exchange/",
|
"documentation": "https://v4-teacher.vercel.app/",
|
||||||
"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"
|
||||||
"foundation": "https://www.dydx.foundation",
|
|
||||||
"help": "https://help.dydx.exchange/",
|
|
||||||
"initialMarginFractionLearnMore": "https://help.dydx.exchange/articles/5232637-maximum-position-sizes",
|
|
||||||
"reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders",
|
|
||||||
"mintscanBase": "https://testnet.mintscan.io/dydx-testnet",
|
|
||||||
"governanceLearnMore": "https://help.dydx.exchange",
|
|
||||||
"stakingLearnMore": "https://help.dydx.exchange",
|
|
||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange",
|
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -778,7 +721,6 @@
|
|||||||
"dydxChainId": "dydx-testnet-4",
|
"dydxChainId": "dydx-testnet-4",
|
||||||
"chainName": "dYdX Chain",
|
"chainName": "dYdX Chain",
|
||||||
"chainLogo": "dydx-chain.png",
|
"chainLogo": "dydx-chain.png",
|
||||||
"squidIntegratorId": "dYdX-api",
|
|
||||||
"isMainNet": false,
|
"isMainNet": false,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"chain": {
|
"chain": {
|
||||||
@@ -813,82 +755,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://docs.dydx.exchange/",
|
"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",
|
|
||||||
"foundation": "https://www.dydx.foundation",
|
|
||||||
"help": "https://help.dydx.exchange/",
|
|
||||||
"initialMarginFractionLearnMore": "https://help.dydx.exchange/articles/5232637-maximum-position-sizes",
|
|
||||||
"reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders",
|
|
||||||
"mintscanBase": "https://testnet.mintscan.io/dydx-testnet",
|
|
||||||
"governanceLearnMore": "https://help.dydx.exchange",
|
|
||||||
"stakingLearnMore": "https://help.dydx.exchange",
|
|
||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange",
|
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
|
||||||
},
|
|
||||||
"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",
|
|
||||||
"squidIntegratorId": "dYdX-api",
|
|
||||||
"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",
|
"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"
|
||||||
@@ -912,88 +779,12 @@
|
|||||||
"signTypedDataDomainName": "dYdX V4"
|
"signTypedDataDomainName": "dYdX V4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet-bware": {
|
|
||||||
"name": "v4 Public Testnet/BWare",
|
|
||||||
"ethereumChainId": "5",
|
|
||||||
"dydxChainId": "dydx-testnet-4",
|
|
||||||
"chainName": "dYdX Chain",
|
|
||||||
"chainLogo": "dydx-chain.png",
|
|
||||||
"squidIntegratorId": "dYdX-api",
|
|
||||||
"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",
|
|
||||||
"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",
|
|
||||||
"foundation": "https://www.dydx.foundation",
|
|
||||||
"help": "https://help.dydx.exchange/",
|
|
||||||
"initialMarginFractionLearnmore": "https://help.dydx.exchange/articles/5232637-maximum-position-sizes",
|
|
||||||
"reduceOnlyLearnmore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders",
|
|
||||||
"mintscanBase": "https://testnet.mintscan.io/dydx-testnet",
|
|
||||||
"governanceLearnmore": "https://help.dydx.exchange",
|
|
||||||
"stakingLearnmore": "https://help.dydx.exchange",
|
|
||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
|
||||||
"accountExportLearnmore": "https://help.dydx.exchange",
|
|
||||||
"walletLearnmore": "https://www.dydx.academy/video/defi-wallet"
|
|
||||||
},
|
|
||||||
"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-mainnet": {
|
"dydxprotocol-mainnet": {
|
||||||
"name": "v4",
|
"name": "v4",
|
||||||
"ethereumChainId": "1",
|
"ethereumChainId": "1",
|
||||||
"dydxChainId": "[mainnet chain id]",
|
"dydxChainId": "[mainnet chain id]",
|
||||||
"chainName": "dYdX Chain",
|
"chainName": "dYdX Chain",
|
||||||
"chainLogo": "dydx-chain.png",
|
"chainLogo": "dydx-chain.png",
|
||||||
"squidIntegratorId": "[mainnet squid integrator id]",
|
|
||||||
"isMainNet": true,
|
"isMainNet": true,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"comment": "Change according to mainnet release",
|
"comment": "Change according to mainnet release",
|
||||||
@@ -1028,20 +819,10 @@
|
|||||||
"tos": "[HTTP link to TOS]",
|
"tos": "[HTTP link to TOS]",
|
||||||
"privacy": "[HTTP link to Privacy Policy]",
|
"privacy": "[HTTP link to Privacy Policy]",
|
||||||
"mintscan": "[HTTP link to Mintscan, with {tx_hash} placeholder]",
|
"mintscan": "[HTTP link to Mintscan, with {tx_hash} placeholder]",
|
||||||
"mintscanBase": "[HTTP link to TOS mintsacn base url]",
|
|
||||||
"feedback": "[HTTP link to feedback form, can be null]",
|
|
||||||
"blogs": "[HTTP link to blogs, can be null]",
|
|
||||||
"foundation": "[HTTP link to foundation, can be null]",
|
|
||||||
"initialMarginFractionLearnMore": "[HTTP link to initial margin fraction learn more, can be null]",
|
|
||||||
"reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders",
|
|
||||||
"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]",
|
||||||
"help": "[HTTP link to help page, can be null]",
|
"feedback": "[HTTP link to feedback form, can be null]",
|
||||||
"governanceLearnMore": "[HTTP link to governance learn more, can be null]",
|
"blogs": "[HTTP link to blogs, can be null]"
|
||||||
"stakingLearnMore": "[HTTP link to staking learn more, can be null]",
|
|
||||||
"keplrDashboard": "[HTTP link to keplr dashboard, can be null]",
|
|
||||||
"accountExportLearnMore": "[HTTP link to account export learn more, can be null]",
|
|
||||||
"walletLearnMore": "[HTTP link to wallet learn more, can be null]"
|
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
"iosMinVersion": "0",
|
"iosMinVersion": "0",
|
||||||
"imageUrl": "",
|
"imageUrl": "",
|
||||||
"encoding": "=\"#%/<>?@\\^`{|}:&",
|
"encoding": "=\"#%/<>?@\\^`{|}:&",
|
||||||
"androidPackage": "io.metamask",
|
|
||||||
"connections": [
|
"connections": [
|
||||||
{
|
{
|
||||||
"type": "walletConnectV2",
|
"type": "walletConnectV2",
|
||||||
@@ -99,7 +98,6 @@
|
|||||||
"iosMinVersion": "1.8.0",
|
"iosMinVersion": "1.8.0",
|
||||||
"imageUrl": "",
|
"imageUrl": "",
|
||||||
"encoding": "=\"#%/<>?@\\^`{|}:&",
|
"encoding": "=\"#%/<>?@\\^`{|}:&",
|
||||||
"androidPackage": "org.toshi",
|
|
||||||
"connections": [
|
"connections": [
|
||||||
{
|
{
|
||||||
"type": "walletSegue",
|
"type": "walletSegue",
|
||||||
@@ -157,7 +155,6 @@
|
|||||||
"comment": "imToken",
|
"comment": "imToken",
|
||||||
"iosMinVersion": "0",
|
"iosMinVersion": "0",
|
||||||
"imageUrl": "",
|
"imageUrl": "",
|
||||||
"androidPackage": "im.token.app",
|
|
||||||
"connections": [
|
"connections": [
|
||||||
{
|
{
|
||||||
"type": "walletConnectV2",
|
"type": "walletConnectV2",
|
||||||
@@ -217,7 +214,6 @@
|
|||||||
"iosMinVersion": "0",
|
"iosMinVersion": "0",
|
||||||
"encoding": "=\"#%/<>?@\\^`{|}:&",
|
"encoding": "=\"#%/<>?@\\^`{|}:&",
|
||||||
"imageUrl": "",
|
"imageUrl": "",
|
||||||
"androidPackage": "com.wallet.crypto.trustapp",
|
|
||||||
"connections": [
|
"connections": [
|
||||||
{
|
{
|
||||||
"type": "walletConnectV2",
|
"type": "walletConnectV2",
|
||||||
@@ -275,7 +271,6 @@
|
|||||||
"iosMinVersion": "0",
|
"iosMinVersion": "0",
|
||||||
"encoding": "=\"#%/<>?@\\^`{|}:&",
|
"encoding": "=\"#%/<>?@\\^`{|}:&",
|
||||||
"imageUrl": "",
|
"imageUrl": "",
|
||||||
"androidPackage": "io.zerion.android",
|
|
||||||
"connections": [
|
"connections": [
|
||||||
{
|
{
|
||||||
"type": "walletConnectV2",
|
"type": "walletConnectV2",
|
||||||
@@ -332,7 +327,6 @@
|
|||||||
"comment": "TokenPocket",
|
"comment": "TokenPocket",
|
||||||
"iosMinVersion": "0",
|
"iosMinVersion": "0",
|
||||||
"imageUrl": "",
|
"imageUrl": "",
|
||||||
"androidPackage": "vip.mytokenpocket",
|
|
||||||
"connections": [
|
"connections": [
|
||||||
{
|
{
|
||||||
"type": "walletConnectV2",
|
"type": "walletConnectV2",
|
||||||
@@ -389,7 +383,6 @@
|
|||||||
"comment": "Rainbow",
|
"comment": "Rainbow",
|
||||||
"iosMinVersion": "0",
|
"iosMinVersion": "0",
|
||||||
"encoding": "=\"#%/<>?@\\^`{|}:&",
|
"encoding": "=\"#%/<>?@\\^`{|}:&",
|
||||||
"androidPackage": "me.rainbow",
|
|
||||||
"backlinked": true,
|
"backlinked": true,
|
||||||
"imageUrl": "",
|
"imageUrl": "",
|
||||||
"connections": [
|
"connections": [
|
||||||
@@ -449,7 +442,6 @@
|
|||||||
"comment": "1inch",
|
"comment": "1inch",
|
||||||
"iosMinVersion": "0",
|
"iosMinVersion": "0",
|
||||||
"encoding": "=\"#%/<>?@\\^`{|}:&",
|
"encoding": "=\"#%/<>?@\\^`{|}:&",
|
||||||
"androidPackage": "io.oneinch.android",
|
|
||||||
"imageUrl": "",
|
"imageUrl": "",
|
||||||
"connections": [
|
"connections": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
## App Integrations
|
|
||||||
### Amplitude
|
|
||||||
Analytics service used to collect data to help the dYdX Product team make informed product decisions.
|
|
||||||
|
|
||||||
<b>To use with dydxprotocol/v4-web:</b>
|
|
||||||
1. Amplitude account with API key.
|
|
||||||
2. Add API key in Github > Secrets and Variables > Actions as `AMPLITUDE_API_KEY`
|
|
||||||
3. In your deploy scripts add `pnpm run build:inject-amplitude` after your pnpm build / vite build command.
|
|
||||||
|
|
||||||
### Bugsnag
|
|
||||||
Error handling service used to collect handled/unhandled errors within the app. The information collected is used to help debug and alert the engineering team of crashes/unhandled errors within the app to improve stability.
|
|
||||||
|
|
||||||
<b>To use with dydxprotocol/v4-web:</b>
|
|
||||||
1. Bugsnag account with API key.
|
|
||||||
2. Add API key in Github > Secrets and Variables > Actions as `BUGSNAG_API_KEY`
|
|
||||||
3. In your deploy scripts add `pnpm run build:inject-bugsnag` after your pnpm build / vite build command.
|
|
||||||
4. If you are using with the Amplitude deployment scripts, your build command may look like the following: `pnpm build && pnpm run build:inject-amplitude && pnpm run build:inject-bugsnag`
|
|
||||||
|
|
||||||
### StatusPage
|
|
||||||
Service used to inform users of any status updates to our platform. These status updates are manually set and updated by the On Call engineers.
|
|
||||||
|
|
||||||
<b>To use with dydxprotocol/v4-web:</b>
|
|
||||||
1. StatusPage account and script URI
|
|
||||||
2. Add API key in Github > Secrets and Variables > Actions as `STATUS_PAGE_SCRIPT_URI`
|
|
||||||
3. In your deploy scripts add `pnpm run build:inject-statuspage` after your pnpm build / vite build command.
|
|
||||||
4. If you are using with the Amplitude deployment scripts, your build command may look like the following: `pnpm build && pnpm run build:inject-amplitude && pnpm run build:inject-statuspage`
|
|
||||||
|
|
||||||
### Intercom
|
|
||||||
Service used for live customer support (chat/inbox) as well as home for Help Articles.
|
|
||||||
|
|
||||||
<b>To use with dydxprotocol/v4-web:</b>
|
|
||||||
1. Create Intercom account
|
|
||||||
2. In Intercom UI
|
|
||||||
Getting started > Set up Messenger > will give you your API Key on Step 2
|
|
||||||
Customize Intercom Messenger by adding logo and brand colors
|
|
||||||
3. Add API key in Github > Secrets and Variables > Actions as `INTERCOM_APP_ID`
|
|
||||||
4. In your deploy scripts add `pnpm run build:inject-intercom` after your pnpm build / vite build command.
|
|
||||||
5. If you are using with the Amplitude deployment scripts, your build command may look like the following: `pnpm build && pnpm run build:inject-amplitude && pnpm run build:inject-intercom`
|
|
||||||
@@ -80,7 +80,7 @@ Styled.TriggerIcon = styled.span`
|
|||||||
width: var(--trigger-icon-width);
|
width: var(--trigger-icon-width);
|
||||||
|
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
transition: rotate 0.3s var(--ease-out-expo);
|
transition: transform 0.3s var(--ease-out-expo);
|
||||||
color: var(--trigger-icon-color);
|
color: var(--trigger-icon-color);
|
||||||
|
|
||||||
${Styled.Trigger}[data-state='open'] & {
|
${Styled.Trigger}[data-state='open'] & {
|
||||||
|
|||||||
@@ -225,7 +225,6 @@ Styled.CollapsibleContent = styled(CollapsibleContent)`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.IconButton = styled(IconButton)`
|
Styled.IconButton = styled(IconButton)`
|
||||||
--button-icon-size: 1em;
|
|
||||||
${Styled.CollapsibleRoot}[data-state='closed'] & {
|
${Styled.CollapsibleRoot}[data-state='closed'] & {
|
||||||
rotate: -0.5turn;
|
rotate: -0.5turn;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ type PickDialogProps = Pick<
|
|||||||
| 'slotHeaderInner'
|
| 'slotHeaderInner'
|
||||||
| 'slotTrigger'
|
| 'slotTrigger'
|
||||||
| 'slotFooter'
|
| 'slotFooter'
|
||||||
| 'preventClose'
|
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export const ComboboxDialogMenu = <
|
export const ComboboxDialogMenu = <
|
||||||
@@ -58,7 +57,6 @@ export const ComboboxDialogMenu = <
|
|||||||
children,
|
children,
|
||||||
|
|
||||||
placement = DialogPlacement.Default,
|
placement = DialogPlacement.Default,
|
||||||
preventClose,
|
|
||||||
className,
|
className,
|
||||||
}: ElementProps<MenuItemValue, MenuGroupValue> &
|
}: ElementProps<MenuItemValue, MenuGroupValue> &
|
||||||
PickComboxMenuProps<MenuItemValue, MenuGroupValue> &
|
PickComboxMenuProps<MenuItemValue, MenuGroupValue> &
|
||||||
@@ -74,7 +72,6 @@ export const ComboboxDialogMenu = <
|
|||||||
slotTrigger={slotTrigger}
|
slotTrigger={slotTrigger}
|
||||||
slotFooter={slotFooter}
|
slotFooter={slotFooter}
|
||||||
placement={placement}
|
placement={placement}
|
||||||
preventClose={preventClose}
|
|
||||||
className={className}
|
className={className}
|
||||||
>
|
>
|
||||||
<Styled.ComboboxMenu
|
<Styled.ComboboxMenu
|
||||||
|
|||||||
@@ -33,11 +33,9 @@ export const DropdownHeaderMenu = <MenuItemValue extends string>({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Root>
|
<Root>
|
||||||
<Styled.Trigger className={className} asChild>
|
<Styled.Trigger className={className}>
|
||||||
<div>
|
|
||||||
{children}
|
{children}
|
||||||
<Styled.DropdownIconButton iconName={IconName.Caret} isToggle />
|
<Styled.DropdownIconButton iconName={IconName.Caret} isToggle />
|
||||||
</div>
|
|
||||||
</Styled.Trigger>
|
</Styled.Trigger>
|
||||||
<Portal>
|
<Portal>
|
||||||
<Styled.Content
|
<Styled.Content
|
||||||
|
|||||||
+1
-10
@@ -24,10 +24,9 @@ import {
|
|||||||
CommentIcon,
|
CommentIcon,
|
||||||
CopyIcon,
|
CopyIcon,
|
||||||
CubeIcon,
|
CubeIcon,
|
||||||
DepositIcon,
|
|
||||||
DepthChartIcon,
|
|
||||||
DiscordIcon,
|
DiscordIcon,
|
||||||
EtherscanIcon,
|
EtherscanIcon,
|
||||||
|
DepthChartIcon,
|
||||||
ExportKeysIcon,
|
ExportKeysIcon,
|
||||||
FeedbackIcon,
|
FeedbackIcon,
|
||||||
FileIcon,
|
FileIcon,
|
||||||
@@ -41,7 +40,6 @@ import {
|
|||||||
LockIcon,
|
LockIcon,
|
||||||
LogoShortIcon,
|
LogoShortIcon,
|
||||||
MenuIcon,
|
MenuIcon,
|
||||||
MigrateIcon,
|
|
||||||
MintscanIcon,
|
MintscanIcon,
|
||||||
OrderbookIcon,
|
OrderbookIcon,
|
||||||
OrderCanceledIcon,
|
OrderCanceledIcon,
|
||||||
@@ -70,7 +68,6 @@ import {
|
|||||||
WarningIcon,
|
WarningIcon,
|
||||||
WebsiteIcon,
|
WebsiteIcon,
|
||||||
WhitepaperIcon,
|
WhitepaperIcon,
|
||||||
WithdrawIcon,
|
|
||||||
} from '@/icons';
|
} from '@/icons';
|
||||||
|
|
||||||
export enum IconName {
|
export enum IconName {
|
||||||
@@ -95,7 +92,6 @@ 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',
|
||||||
@@ -112,7 +108,6 @@ 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',
|
||||||
@@ -142,7 +137,6 @@ export enum IconName {
|
|||||||
Warning = 'Warning',
|
Warning = 'Warning',
|
||||||
Website = 'Website',
|
Website = 'Website',
|
||||||
Whitepaper = 'Whitepaper',
|
Whitepaper = 'Whitepaper',
|
||||||
Withdraw = 'Withdraw',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const icons = {
|
const icons = {
|
||||||
@@ -167,7 +161,6 @@ 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,
|
||||||
@@ -184,7 +177,6 @@ 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,
|
||||||
@@ -213,7 +205,6 @@ 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 = {
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ const Styled: Record<string, AnyStyledComponent> = {};
|
|||||||
const buttonMixin = css`
|
const buttonMixin = css`
|
||||||
// Params
|
// Params
|
||||||
--button-icon-size: 1.125em;
|
--button-icon-size: 1.125em;
|
||||||
--button-padding: 0;
|
|
||||||
|
|
||||||
// Rules
|
// Rules
|
||||||
> * {
|
> * {
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ const NavItem = forwardRef(
|
|||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
{slotAfter}
|
{slotAfter}
|
||||||
{subitems?.length && <Styled.Icon iconName={IconName.Triangle} />}
|
{subitems?.length && <Styled.Icon iconName={IconName.Caret} />}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -525,9 +525,6 @@ Styled.NavItem = styled(NavItem)<{ orientation: 'horizontal' | 'vertical' }>`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Icon = styled(Icon)`
|
Styled.Icon = styled(Icon)`
|
||||||
font-size: 0.375em;
|
|
||||||
transition: rotate 0.3s var(--ease-out-expo);
|
|
||||||
|
|
||||||
${Styled.List}[data-orientation="menu"] & {
|
${Styled.List}[data-orientation="menu"] & {
|
||||||
rotate: -0.25turn;
|
rotate: -0.25turn;
|
||||||
}
|
}
|
||||||
|
|||||||
+27
-52
@@ -8,7 +8,6 @@ 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;
|
||||||
@@ -23,7 +22,6 @@ type PanelStyleProps = {
|
|||||||
export const Panel = ({
|
export const Panel = ({
|
||||||
slotHeaderContent,
|
slotHeaderContent,
|
||||||
slotHeader,
|
slotHeader,
|
||||||
slotRight,
|
|
||||||
children,
|
children,
|
||||||
href,
|
href,
|
||||||
onHeaderClick,
|
onHeaderClick,
|
||||||
@@ -31,80 +29,56 @@ export const Panel = ({
|
|||||||
hasSeparator,
|
hasSeparator,
|
||||||
className,
|
className,
|
||||||
}: PanelProps & PanelStyleProps) => (
|
}: PanelProps & PanelStyleProps) => (
|
||||||
<Styled.Panel onClick={onClick} className={className}>
|
<Styled.Panel onClick={onClick}>
|
||||||
<Styled.Left>
|
{href ? (
|
||||||
{href ? (
|
<Link to={href}>
|
||||||
<Link to={href}>
|
{slotHeader ? (
|
||||||
{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>
|
||||||
<Styled.Content>{children}</Styled.Content>
|
) : slotHeader ? (
|
||||||
</Styled.Left>
|
slotHeader
|
||||||
{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<{ onClick?: () => void }>`
|
Styled.Panel = styled.section`
|
||||||
--panel-paddingY: 1rem;
|
${layoutMixins.flexColumn}
|
||||||
--panel-paddingX: 1rem;
|
|
||||||
--panel-content-paddingY: var(--panel-paddingY);
|
|
||||||
--panel-content-paddingX: var(--panel-paddingX);
|
|
||||||
|
|
||||||
${layoutMixins.row}
|
|
||||||
|
|
||||||
background-color: var(--color-layer-3);
|
background-color: var(--color-layer-3);
|
||||||
border-radius: 0.875rem;
|
border-radius: 0.875rem;
|
||||||
|
|
||||||
${({ onClick }) =>
|
|
||||||
onClick &&
|
|
||||||
css`
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
button:not(:disabled) {
|
|
||||||
color: var(--button-hover-textColor);
|
|
||||||
filter: var(--button-hover-filter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`}
|
|
||||||
`;
|
|
||||||
|
|
||||||
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: var(--panel-paddingY) var(--panel-paddingX);
|
|
||||||
|
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;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -112,5 +86,6 @@ Styled.Content = styled.div`
|
|||||||
${layoutMixins.scrollArea}
|
${layoutMixins.scrollArea}
|
||||||
${layoutMixins.stickyArea0}
|
${layoutMixins.stickyArea0}
|
||||||
--stickyArea0-background: transparent;
|
--stickyArea0-background: transparent;
|
||||||
padding: var(--panel-content-paddingY) var(--panel-content-paddingX);
|
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -7,15 +7,13 @@ import { ButtonShape, ButtonSize } from '@/constants/buttons';
|
|||||||
import { useBreakpoints } from '@/hooks';
|
import { useBreakpoints } from '@/hooks';
|
||||||
import { layoutMixins } from '@/styles/layoutMixins';
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
|
|
||||||
import { type BaseButtonProps } from '@/components/BaseButton';
|
import { type BaseButtonProps } from '@/components/BaseButton';
|
||||||
import { ToggleButton } from '@/components/ToggleButton';
|
import { ToggleButton } from '@/components/ToggleButton';
|
||||||
|
|
||||||
type ElementProps<MenuItemValue extends string> = {
|
type ElementProps<MenuItemValue extends string> = {
|
||||||
items: MenuItem<MenuItemValue>[];
|
items: MenuItem<MenuItemValue>[];
|
||||||
value: MenuItemValue;
|
value: MenuItemValue;
|
||||||
onValueChange: (value: any) => void;
|
onValueChange: (value: MenuItemValue) => void;
|
||||||
onInteraction?: () => void;
|
|
||||||
ensureSelected?: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type StyleProps = {
|
type StyleProps = {
|
||||||
@@ -27,14 +25,10 @@ export const ToggleGroup = forwardRef(
|
|||||||
{
|
{
|
||||||
items,
|
items,
|
||||||
value,
|
value,
|
||||||
ensureSelected = true,
|
|
||||||
onValueChange,
|
onValueChange,
|
||||||
onInteraction,
|
|
||||||
|
|
||||||
className,
|
className,
|
||||||
size,
|
size,
|
||||||
shape = ButtonShape.Pill,
|
shape = ButtonShape.Pill,
|
||||||
|
|
||||||
...buttonProps
|
...buttonProps
|
||||||
}: ElementProps<MenuItemValue> & StyleProps & BaseButtonProps,
|
}: ElementProps<MenuItemValue> & StyleProps & BaseButtonProps,
|
||||||
ref: Ref<HTMLDivElement>
|
ref: Ref<HTMLDivElement>
|
||||||
@@ -46,17 +40,12 @@ export const ToggleGroup = forwardRef(
|
|||||||
ref={ref}
|
ref={ref}
|
||||||
type="single"
|
type="single"
|
||||||
value={value}
|
value={value}
|
||||||
onValueChange={(newValue: MenuItemValue) => {
|
onValueChange={onValueChange}
|
||||||
if ((ensureSelected && newValue) || !ensureSelected) {
|
|
||||||
onValueChange(newValue);
|
|
||||||
}
|
|
||||||
onInteraction?.();
|
|
||||||
}}
|
|
||||||
className={className}
|
className={className}
|
||||||
loop
|
loop
|
||||||
>
|
>
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<Item key={item.value} value={item.value} asChild>
|
<Item key={item.value} value={item.value} aria-label={item.label} asChild>
|
||||||
<ToggleButton
|
<ToggleButton
|
||||||
size={size ? size : isTablet ? ButtonSize.Small : ButtonSize.XSmall}
|
size={size ? size : isTablet ? ButtonSize.Small : ButtonSize.XSmall}
|
||||||
shape={shape}
|
shape={shape}
|
||||||
|
|||||||
@@ -2,13 +2,11 @@ import type { ReactNode } from 'react';
|
|||||||
import styled, { AnyStyledComponent } from 'styled-components';
|
import styled, { AnyStyledComponent } from 'styled-components';
|
||||||
import { Content, Portal, Provider, Root, Trigger, Arrow } from '@radix-ui/react-tooltip';
|
import { Content, Portal, Provider, Root, Trigger, Arrow } from '@radix-ui/react-tooltip';
|
||||||
|
|
||||||
import { STRING_KEYS } from '@/constants/localization';
|
|
||||||
import { tooltipStrings } from '@/constants/tooltips';
|
import { tooltipStrings } from '@/constants/tooltips';
|
||||||
|
|
||||||
import { useStringGetter, useURLConfigs } from '@/hooks';
|
import { useStringGetter } from '@/hooks';
|
||||||
|
|
||||||
import { Icon, IconName } from '@/components/Icon';
|
import { Icon, IconName } from '@/components/Icon';
|
||||||
import { Link } from '@/components/Link';
|
|
||||||
|
|
||||||
import { layoutMixins } from '@/styles/layoutMixins';
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
import { popoverMixins } from '@/styles/popoverMixins';
|
import { popoverMixins } from '@/styles/popoverMixins';
|
||||||
@@ -40,24 +38,20 @@ export const WithTooltip = ({
|
|||||||
slotTooltip,
|
slotTooltip,
|
||||||
}: ElementProps & StyleProps) => {
|
}: ElementProps & StyleProps) => {
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
const urlConfigs = useURLConfigs();
|
|
||||||
|
|
||||||
const getTooltipStrings = tooltip && tooltipStrings[tooltip];
|
const getTooltipStrings = tooltip && tooltipStrings[tooltip];
|
||||||
if (!getTooltipStrings && !tooltipString && !slotTooltip) return <>{children}</>;
|
if (!getTooltipStrings && !tooltipString && !slotTooltip) return <>{children}</>;
|
||||||
|
|
||||||
let tooltipTitle;
|
let tooltipTitle;
|
||||||
let tooltipBody;
|
let tooltipBody;
|
||||||
let tooltipLearnMore;
|
|
||||||
|
|
||||||
if (getTooltipStrings) {
|
if (getTooltipStrings) {
|
||||||
const { title, body, learnMoreLink } = getTooltipStrings({
|
const { title, body } = getTooltipStrings({
|
||||||
stringGetter,
|
stringGetter,
|
||||||
stringParams,
|
stringParams,
|
||||||
urlConfigs,
|
|
||||||
});
|
});
|
||||||
tooltipTitle = title;
|
tooltipTitle = title;
|
||||||
tooltipBody = body;
|
tooltipBody = body;
|
||||||
tooltipLearnMore = learnMoreLink;
|
|
||||||
} else {
|
} else {
|
||||||
tooltipBody = tooltipString;
|
tooltipBody = tooltipString;
|
||||||
}
|
}
|
||||||
@@ -78,13 +72,6 @@ export const WithTooltip = ({
|
|||||||
<dl>
|
<dl>
|
||||||
{tooltipTitle && <dt>{tooltipTitle}</dt>}
|
{tooltipTitle && <dt>{tooltipTitle}</dt>}
|
||||||
{tooltipBody && <dd>{tooltipBody}</dd>}
|
{tooltipBody && <dd>{tooltipBody}</dd>}
|
||||||
{tooltipLearnMore && (
|
|
||||||
<dd>
|
|
||||||
<Styled.LearnMore href={tooltipLearnMore}>
|
|
||||||
{stringGetter({ key: STRING_KEYS.LEARN_MORE })} →
|
|
||||||
</Styled.LearnMore>
|
|
||||||
</dd>
|
|
||||||
)}
|
|
||||||
<Styled.Arrow />
|
<Styled.Arrow />
|
||||||
</dl>
|
</dl>
|
||||||
)}
|
)}
|
||||||
@@ -155,7 +142,3 @@ Styled.Arrow = styled(Arrow)`
|
|||||||
Styled.Icon = styled(Icon)`
|
Styled.Icon = styled(Icon)`
|
||||||
color: var(--color-text-0);
|
color: var(--color-text-0);
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.LearnMore = styled(Link)`
|
|
||||||
--link-color: var(--color-accent);
|
|
||||||
`;
|
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ import {
|
|||||||
WARNINGS_STRING_KEYS,
|
WARNINGS_STRING_KEYS,
|
||||||
} from '@dydxprotocol/v4-localization';
|
} from '@dydxprotocol/v4-localization';
|
||||||
|
|
||||||
import { type LinksConfigs } from '@/hooks/useURLConfigs';
|
|
||||||
|
|
||||||
export { TOOLTIP_STRING_KEYS } from '@dydxprotocol/v4-localization';
|
export { TOOLTIP_STRING_KEYS } from '@dydxprotocol/v4-localization';
|
||||||
|
|
||||||
export enum SupportedLocales {
|
export enum SupportedLocales {
|
||||||
@@ -81,11 +79,9 @@ export type TooltipStrings = {
|
|||||||
[key: string]: ({
|
[key: string]: ({
|
||||||
stringGetter,
|
stringGetter,
|
||||||
stringParams,
|
stringParams,
|
||||||
urlConfigs,
|
|
||||||
}: {
|
}: {
|
||||||
stringGetter: StringGetterFunction;
|
stringGetter: StringGetterFunction;
|
||||||
stringParams?: any;
|
stringParams?: any;
|
||||||
urlConfigs?: LinksConfigs;
|
|
||||||
}) => {
|
}) => {
|
||||||
title: string;
|
title: string;
|
||||||
body: string;
|
body: string;
|
||||||
|
|||||||
@@ -37,3 +37,7 @@ export const HISTORY_ROUTE = `${AppRoute.Portfolio}/${PortfolioRoute.History}/:s
|
|||||||
export const DEFAULT_TRADE_ROUTE = `${AppRoute.Trade}/${DEFAULT_MARKETID}`;
|
export const DEFAULT_TRADE_ROUTE = `${AppRoute.Trade}/${DEFAULT_MARKETID}`;
|
||||||
export const SETTINGS_ROUTE = `${AppRoute.Settings}/*`;
|
export const SETTINGS_ROUTE = `${AppRoute.Settings}/*`;
|
||||||
export const DEFAULT_DOCUMENT_TITLE = 'dYdX';
|
export const DEFAULT_DOCUMENT_TITLE = 'dYdX';
|
||||||
|
|
||||||
|
export enum ExternalLink {
|
||||||
|
Foundation = 'https://dydx.foundation',
|
||||||
|
}
|
||||||
|
|||||||
@@ -57,10 +57,10 @@ export const tradeTooltips: TooltipStrings = {
|
|||||||
title: stringGetter({ key: TOOLTIP_STRING_KEYS.INDEX_PRICE_TITLE }),
|
title: stringGetter({ key: TOOLTIP_STRING_KEYS.INDEX_PRICE_TITLE }),
|
||||||
body: stringGetter({ key: TOOLTIP_STRING_KEYS.INDEX_PRICE_BODY }),
|
body: stringGetter({ key: TOOLTIP_STRING_KEYS.INDEX_PRICE_BODY }),
|
||||||
}),
|
}),
|
||||||
'initial-margin-fraction': ({ stringGetter, urlConfigs }) => ({
|
'initial-margin-fraction': ({ stringGetter }) => ({
|
||||||
title: stringGetter({ key: TOOLTIP_STRING_KEYS.INITIAL_MARGIN_FRACTION_TITLE }),
|
title: stringGetter({ key: TOOLTIP_STRING_KEYS.INITIAL_MARGIN_FRACTION_TITLE }),
|
||||||
body: stringGetter({ key: TOOLTIP_STRING_KEYS.INITIAL_MARGIN_FRACTION_BODY }),
|
body: stringGetter({ key: TOOLTIP_STRING_KEYS.INITIAL_MARGIN_FRACTION_BODY }),
|
||||||
learnMoreLink: urlConfigs?.initialMarginFractionLearnMore,
|
learnMoreLink: 'https://help.dydx.exchange/articles/5232637-maximum-position-sizes',
|
||||||
}),
|
}),
|
||||||
'initial-stop': ({ stringGetter }) => ({
|
'initial-stop': ({ stringGetter }) => ({
|
||||||
title: stringGetter({ key: TOOLTIP_STRING_KEYS.INITIAL_STOP_TITLE }),
|
title: stringGetter({ key: TOOLTIP_STRING_KEYS.INITIAL_STOP_TITLE }),
|
||||||
@@ -146,10 +146,10 @@ export const tradeTooltips: TooltipStrings = {
|
|||||||
title: stringGetter({ key: TOOLTIP_STRING_KEYS.REALIZED_PNL_TITLE }),
|
title: stringGetter({ key: TOOLTIP_STRING_KEYS.REALIZED_PNL_TITLE }),
|
||||||
body: stringGetter({ key: TOOLTIP_STRING_KEYS.REALIZED_PNL_BODY }),
|
body: stringGetter({ key: TOOLTIP_STRING_KEYS.REALIZED_PNL_BODY }),
|
||||||
}),
|
}),
|
||||||
'reduce-only': ({ stringGetter, urlConfigs }) => ({
|
'reduce-only': ({ stringGetter }) => ({
|
||||||
title: stringGetter({ key: TOOLTIP_STRING_KEYS.REDUCE_ONLY_TITLE }),
|
title: stringGetter({ key: TOOLTIP_STRING_KEYS.REDUCE_ONLY_TITLE }),
|
||||||
body: stringGetter({ key: TOOLTIP_STRING_KEYS.REDUCE_ONLY_BODY }),
|
body: stringGetter({ key: TOOLTIP_STRING_KEYS.REDUCE_ONLY_BODY }),
|
||||||
learnMoreLink: urlConfigs?.reduceOnlyLearnMore,
|
learnMoreLink: 'https://help.dydx.exchange/articles/6345793-reduce-only-orders',
|
||||||
}),
|
}),
|
||||||
spread: () => ({
|
spread: () => ({
|
||||||
title: 'Spread',
|
title: 'Spread',
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import { useShouldShowFooter } from './useShouldShowFooter';
|
|||||||
import { useSelectedNetwork } from './useSelectedNetwork';
|
import { useSelectedNetwork } from './useSelectedNetwork';
|
||||||
import { useStringGetter } from './useStringGetter';
|
import { useStringGetter } from './useStringGetter';
|
||||||
import { useSubaccount } from './useSubaccount';
|
import { useSubaccount } from './useSubaccount';
|
||||||
import { useURLConfigs } from './useURLConfigs';
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
useApiState,
|
useApiState,
|
||||||
@@ -49,5 +48,4 @@ export {
|
|||||||
useSelectedNetwork,
|
useSelectedNetwork,
|
||||||
useStringGetter,
|
useStringGetter,
|
||||||
useSubaccount,
|
useSubaccount,
|
||||||
useURLConfigs,
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export const useTradingView = ({
|
|||||||
const hasMarkets = marketIds.length > 0;
|
const hasMarkets = marketIds.length > 0;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (hasMarkets && isClientConnected && marketId) {
|
if (hasMarkets && isClientConnected) {
|
||||||
const widgetOptions = getWidgetOptions();
|
const widgetOptions = getWidgetOptions();
|
||||||
const widgetOverrides = getWidgetOverrides(appTheme);
|
const widgetOverrides = getWidgetOverrides(appTheme);
|
||||||
const options = {
|
const options = {
|
||||||
@@ -75,7 +75,7 @@ export const useTradingView = ({
|
|||||||
tvWidgetRef.current = null;
|
tvWidgetRef.current = null;
|
||||||
setIsChartReady(false);
|
setIsChartReady(false);
|
||||||
};
|
};
|
||||||
}, [getCandlesForDatafeed, isClientConnected, hasMarkets, selectedLocale, selectedNetwork, !!marketId]);
|
}, [getCandlesForDatafeed, isClientConnected, hasMarkets, selectedLocale, selectedNetwork]);
|
||||||
|
|
||||||
return { savedResolution };
|
return { savedResolution };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { useQuery } from 'react-query';
|
|||||||
import { formatUnits } from 'viem';
|
import { formatUnits } from 'viem';
|
||||||
|
|
||||||
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||||
|
import { QUANTUM_MULTIPLIER } from '@/constants/numbers';
|
||||||
import { EvmAddress } from '@/constants/wallets';
|
import { EvmAddress } from '@/constants/wallets';
|
||||||
|
|
||||||
import { convertBech32Address } from '@/lib/addressUtils';
|
import { convertBech32Address } from '@/lib/addressUtils';
|
||||||
@@ -20,6 +21,7 @@ import { useTokenConfigs } from './useTokenConfigs';
|
|||||||
type UseAccountBalanceProps = {
|
type UseAccountBalanceProps = {
|
||||||
// Token Items
|
// Token Items
|
||||||
addressOrDenom?: string;
|
addressOrDenom?: string;
|
||||||
|
assetSymbol?: string;
|
||||||
decimals?: number;
|
decimals?: number;
|
||||||
|
|
||||||
// Chain Items
|
// Chain Items
|
||||||
@@ -38,6 +40,7 @@ export const CHAIN_DEFAULT_TOKEN_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeee
|
|||||||
|
|
||||||
export const useAccountBalance = ({
|
export const useAccountBalance = ({
|
||||||
addressOrDenom,
|
addressOrDenom,
|
||||||
|
assetSymbol,
|
||||||
bech32AddrPrefix,
|
bech32AddrPrefix,
|
||||||
chainId,
|
chainId,
|
||||||
decimals = 0,
|
decimals = 0,
|
||||||
@@ -88,7 +91,7 @@ export const useAccountBalance = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const { formatted: evmBalance } = evmQuery.data || {};
|
const { formatted: evmBalance } = evmQuery.data || {};
|
||||||
const balance = isCosmosChain ? cosmosQuery.data : evmBalance;
|
const balance = !assetSymbol ? '0' : isCosmosChain ? cosmosQuery.data : evmBalance;
|
||||||
|
|
||||||
const nativeTokenCoinBalance = balances?.[chainTokenDenom];
|
const nativeTokenCoinBalance = balances?.[chainTokenDenom];
|
||||||
const nativeTokenBalance = MustBigNumber(nativeTokenCoinBalance?.amount);
|
const nativeTokenBalance = MustBigNumber(nativeTokenCoinBalance?.amount);
|
||||||
|
|||||||
@@ -6,10 +6,8 @@ import { MarketFilters, MARKET_FILTER_LABELS, type MarketData } from '@/constant
|
|||||||
import { getAssets } from '@/state/assetsSelectors';
|
import { getAssets } from '@/state/assetsSelectors';
|
||||||
import { getPerpetualMarkets } from '@/state/perpetualsSelectors';
|
import { getPerpetualMarkets } from '@/state/perpetualsSelectors';
|
||||||
|
|
||||||
import { isTruthy } from '@/lib/isTruthy';
|
|
||||||
|
|
||||||
const filterFunctions = {
|
const filterFunctions = {
|
||||||
[MarketFilters.ALL]: () => true,
|
[MarketFilters.ALL]: (market: MarketData) => true,
|
||||||
[MarketFilters.LAYER_1]: (market: MarketData) => {
|
[MarketFilters.LAYER_1]: (market: MarketData) => {
|
||||||
return market.asset.tags?.toArray().includes('Layer 1');
|
return market.asset.tags?.toArray().includes('Layer 1');
|
||||||
},
|
},
|
||||||
@@ -30,15 +28,13 @@ export const useMarketsData = (
|
|||||||
const allAssets = useSelector(getAssets, shallowEqual) || {};
|
const allAssets = useSelector(getAssets, shallowEqual) || {};
|
||||||
|
|
||||||
const markets = useMemo(() => {
|
const markets = useMemo(() => {
|
||||||
return Object.values(allPerpetualMarkets)
|
return Object.values(allPerpetualMarkets).map((marketData) => ({
|
||||||
.filter(isTruthy)
|
asset: allAssets[marketData.assetId],
|
||||||
.map((marketData) => ({
|
tickSizeDecimals: marketData.configs?.tickSizeDecimals,
|
||||||
asset: allAssets[marketData.assetId],
|
...marketData,
|
||||||
tickSizeDecimals: marketData.configs?.tickSizeDecimals,
|
...marketData.perpetual,
|
||||||
...marketData,
|
...marketData.configs,
|
||||||
...marketData.perpetual,
|
})) as MarketData[];
|
||||||
...marketData.configs,
|
|
||||||
})) as MarketData[];
|
|
||||||
}, [allPerpetualMarkets, allAssets]);
|
}, [allPerpetualMarkets, allAssets]);
|
||||||
|
|
||||||
const filteredMarkets = useMemo(() => {
|
const filteredMarkets = useMemo(() => {
|
||||||
|
|||||||
@@ -22,11 +22,7 @@ const useSquidContext = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const squid = useMemo(
|
const squid = useMemo(
|
||||||
() =>
|
() => new Squid({ baseUrl: ENVIRONMENT_CONFIG_MAP[selectedNetwork]?.endpoints['0xsquid'] }),
|
||||||
new Squid({
|
|
||||||
baseUrl: ENVIRONMENT_CONFIG_MAP[selectedNetwork]?.endpoints['0xsquid'],
|
|
||||||
integratorId: ENVIRONMENT_CONFIG_MAP[selectedNetwork]?.squidIntegratorId,
|
|
||||||
}),
|
|
||||||
[selectedNetwork]
|
[selectedNetwork]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
|
||||||
|
|
||||||
import { useSelectedNetwork } from '@/hooks';
|
|
||||||
|
|
||||||
const FALLBACK_URL = 'https://help.dydx.exchange/';
|
|
||||||
|
|
||||||
export interface LinksConfigs {
|
|
||||||
tos: string,
|
|
||||||
privacy: string,
|
|
||||||
mintscan: string,
|
|
||||||
mintscanBase: string,
|
|
||||||
feedback?: string,
|
|
||||||
help?: string,
|
|
||||||
blogs?: string,
|
|
||||||
foundation?: string,
|
|
||||||
initialMarginFractionLearnMore?: string,
|
|
||||||
reduceOnlyLearnMore?: string,
|
|
||||||
documentation?: string,
|
|
||||||
community?: string,
|
|
||||||
governanceLearnMore?: string,
|
|
||||||
stakingLearnMore?: string,
|
|
||||||
keplrDashboard?: string,
|
|
||||||
accountExportLearnMore?: string,
|
|
||||||
walletLearnMore?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export const useURLConfigs = (): LinksConfigs => {
|
|
||||||
const { selectedNetwork } = useSelectedNetwork();
|
|
||||||
const linksConfigs = ENVIRONMENT_CONFIG_MAP[selectedNetwork].links as LinksConfigs;
|
|
||||||
|
|
||||||
return {
|
|
||||||
tos: linksConfigs.tos,
|
|
||||||
privacy: linksConfigs.privacy,
|
|
||||||
mintscan: linksConfigs.mintscan,
|
|
||||||
mintscanBase: linksConfigs.mintscanBase,
|
|
||||||
feedback: linksConfigs.feedback || FALLBACK_URL,
|
|
||||||
help: linksConfigs.help || FALLBACK_URL,
|
|
||||||
blogs: linksConfigs.blogs || FALLBACK_URL,
|
|
||||||
foundation: linksConfigs.foundation || FALLBACK_URL,
|
|
||||||
initialMarginFractionLearnMore: linksConfigs.initialMarginFractionLearnMore || FALLBACK_URL,
|
|
||||||
reduceOnlyLearnMore: linksConfigs.reduceOnlyLearnMore || FALLBACK_URL,
|
|
||||||
documentation: linksConfigs.documentation || FALLBACK_URL,
|
|
||||||
community: linksConfigs.community || FALLBACK_URL,
|
|
||||||
governanceLearnMore: linksConfigs.governanceLearnMore || FALLBACK_URL,
|
|
||||||
stakingLearnMore: linksConfigs.stakingLearnMore || FALLBACK_URL,
|
|
||||||
keplrDashboard: linksConfigs.keplrDashboard || FALLBACK_URL,
|
|
||||||
accountExportLearnMore: linksConfigs.accountExportLearnMore || FALLBACK_URL,
|
|
||||||
walletLearnMore: linksConfigs.walletLearnMore || FALLBACK_URL,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<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>
|
|
||||||
|
Before Width: | Height: | Size: 886 B |
@@ -19,7 +19,6 @@ 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';
|
||||||
@@ -36,7 +35,6 @@ 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';
|
||||||
@@ -60,7 +58,6 @@ 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
|
Before Width: | Height: | Size: 694 KiB |
@@ -1,4 +0,0 @@
|
|||||||
<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>
|
|
||||||
|
Before Width: | Height: | Size: 723 B |
@@ -8,7 +8,7 @@ import { STRING_KEYS } from '@/constants/localization';
|
|||||||
import { AppRoute } from '@/constants/routes';
|
import { AppRoute } from '@/constants/routes';
|
||||||
import { LogoShortIcon, BellStrokeIcon } from '@/icons';
|
import { LogoShortIcon, BellStrokeIcon } from '@/icons';
|
||||||
|
|
||||||
import { useTokenConfigs, useStringGetter, useURLConfigs } from '@/hooks';
|
import { useTokenConfigs, useStringGetter } from '@/hooks';
|
||||||
|
|
||||||
import { Icon, IconName } from '@/components/Icon';
|
import { Icon, IconName } from '@/components/Icon';
|
||||||
import { IconButton } from '@/components/IconButton';
|
import { IconButton } from '@/components/IconButton';
|
||||||
@@ -24,11 +24,9 @@ import { openDialog } from '@/state/dialogs';
|
|||||||
|
|
||||||
import { headerMixins } from '@/styles/headerMixins';
|
import { headerMixins } from '@/styles/headerMixins';
|
||||||
import { layoutMixins } from '@/styles/layoutMixins';
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
import breakpoints from '@/styles/breakpoints';
|
|
||||||
|
|
||||||
export const HeaderDesktop = () => {
|
export const HeaderDesktop = () => {
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
const { documentation, community, mintscanBase } = useURLConfigs();
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { chainTokenLabel } = useTokenConfigs();
|
const { chainTokenLabel } = useTokenConfigs();
|
||||||
|
|
||||||
@@ -36,26 +34,26 @@ export const HeaderDesktop = () => {
|
|||||||
{
|
{
|
||||||
group: 'navigation',
|
group: 'navigation',
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
value: 'MARKET',
|
||||||
|
label: stringGetter({ key: STRING_KEYS.MARKET }),
|
||||||
|
href: AppRoute.Markets,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
value: 'TRADE',
|
value: 'TRADE',
|
||||||
label: stringGetter({ key: STRING_KEYS.TRADE }),
|
label: stringGetter({ key: STRING_KEYS.TRADE }),
|
||||||
href: AppRoute.Trade,
|
href: AppRoute.Trade,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
value: 'PORTFOLIO',
|
|
||||||
label: stringGetter({ key: STRING_KEYS.PORTFOLIO }),
|
|
||||||
href: AppRoute.Portfolio,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'MARKETS',
|
|
||||||
label: stringGetter({ key: STRING_KEYS.MARKETS }),
|
|
||||||
href: AppRoute.Markets,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
value: chainTokenLabel,
|
value: chainTokenLabel,
|
||||||
label: chainTokenLabel,
|
label: chainTokenLabel,
|
||||||
href: `/${chainTokenLabel}`,
|
href: `/${chainTokenLabel}`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
value: 'PORTFOLIO',
|
||||||
|
label: stringGetter({ key: STRING_KEYS.PORTFOLIO }),
|
||||||
|
href: AppRoute.Portfolio,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
value: 'MORE',
|
value: 'MORE',
|
||||||
label: stringGetter({ key: STRING_KEYS.MORE }),
|
label: stringGetter({ key: STRING_KEYS.MORE }),
|
||||||
@@ -64,19 +62,19 @@ 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: documentation,
|
href: 'https://v4-teacher.vercel.app/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'MINTSCAN',
|
value: 'MINTSCAN',
|
||||||
slotBefore: <Icon iconName={IconName.Mintscan} />,
|
slotBefore: <Icon iconName={IconName.Mintscan} />,
|
||||||
label: stringGetter({ key: STRING_KEYS.MINTSCAN }),
|
label: stringGetter({ key: STRING_KEYS.MINTSCAN }),
|
||||||
href: mintscanBase,
|
href: 'https://testnet.mintscan.io/dydx-testnet',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'COMMUNITY',
|
value: 'COMMUNITY',
|
||||||
slotBefore: <Icon iconName={IconName.Discord} />,
|
slotBefore: <Icon iconName={IconName.Discord} />,
|
||||||
label: stringGetter({ key: STRING_KEYS.COMMUNITY }),
|
label: stringGetter({ key: STRING_KEYS.COMMUNITY }),
|
||||||
href: community,
|
href: 'https://discord.gg/dydx',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'TERMS_OF_USE',
|
value: 'TERMS_OF_USE',
|
||||||
@@ -152,7 +150,6 @@ const Styled: Record<string, AnyStyledComponent> = {};
|
|||||||
|
|
||||||
Styled.Header = styled.header`
|
Styled.Header = styled.header`
|
||||||
--header-horizontal-padding-mobile: 0.5rem;
|
--header-horizontal-padding-mobile: 0.5rem;
|
||||||
--trigger-height: 2.25rem;
|
|
||||||
--logo-width: 3.5rem;
|
--logo-width: 3.5rem;
|
||||||
|
|
||||||
${layoutMixins.container}
|
${layoutMixins.container}
|
||||||
@@ -160,8 +157,6 @@ Styled.Header = styled.header`
|
|||||||
${layoutMixins.scrollSnapItem}
|
${layoutMixins.scrollSnapItem}
|
||||||
backdrop-filter: none;
|
backdrop-filter: none;
|
||||||
|
|
||||||
height: var(--page-currentHeaderHeight);
|
|
||||||
|
|
||||||
grid-area: Header;
|
grid-area: Header;
|
||||||
|
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -174,14 +169,6 @@ Styled.Header = styled.header`
|
|||||||
)
|
)
|
||||||
var(--border-width) 1fr var(--border-width) auto;
|
var(--border-width) 1fr var(--border-width) auto;
|
||||||
|
|
||||||
@media ${breakpoints.tablet} {
|
|
||||||
--trigger-height: 3rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media ${breakpoints.mobile} {
|
|
||||||
--navBefore-width: 7rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
font-size: 0.9375rem;
|
font-size: 0.9375rem;
|
||||||
|
|
||||||
:before {
|
:before {
|
||||||
@@ -192,7 +179,6 @@ Styled.Header = styled.header`
|
|||||||
Styled.NavigationMenu = styled(NavigationMenu)`
|
Styled.NavigationMenu = styled(NavigationMenu)`
|
||||||
& {
|
& {
|
||||||
--navigationMenu-height: var(--stickyArea-topHeight);
|
--navigationMenu-height: var(--stickyArea-topHeight);
|
||||||
--navigationMenu-item-height: var(--trigger-height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
${layoutMixins.scrollArea}
|
${layoutMixins.scrollArea}
|
||||||
|
|||||||
+3
-3
@@ -107,8 +107,8 @@ export const getHydratedTradingData = ({
|
|||||||
perpetualMarkets?: Record<string, PerpetualMarket>;
|
perpetualMarkets?: Record<string, PerpetualMarket>;
|
||||||
}) => ({
|
}) => ({
|
||||||
...data,
|
...data,
|
||||||
asset: assets && perpetualMarkets && assets[perpetualMarkets[data.marketId]?.assetId],
|
asset: assets && perpetualMarkets && assets[perpetualMarkets[data.marketId].assetId],
|
||||||
stepSizeDecimals: perpetualMarkets?.[data.marketId]?.configs?.stepSizeDecimals,
|
stepSizeDecimals: perpetualMarkets?.[data.marketId].configs?.stepSizeDecimals,
|
||||||
tickSizeDecimals: perpetualMarkets?.[data.marketId]?.configs?.tickSizeDecimals,
|
tickSizeDecimals: perpetualMarkets?.[data.marketId].configs?.tickSizeDecimals,
|
||||||
...('side' in data && { orderSide: convertAbacusOrderSide(data.side) }),
|
...('side' in data && { orderSide: convertAbacusOrderSide(data.side) }),
|
||||||
});
|
});
|
||||||
|
|||||||
+8
-16
@@ -46,8 +46,6 @@ 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[] = [
|
||||||
@@ -80,17 +78,13 @@ export const WAGMI_SUPPORTED_CHAINS: Chain[] = [
|
|||||||
celoAlfajores,
|
celoAlfajores,
|
||||||
];
|
];
|
||||||
|
|
||||||
const { chains, publicClient, webSocketPublicClient } = configureChains(
|
const { chains, publicClient, webSocketPublicClient } = configureChains(WAGMI_SUPPORTED_CHAINS, [
|
||||||
WAGMI_SUPPORTED_CHAINS,
|
// alchemyProvider({ apiKey: import.meta.env.VITE_ALCHEMY_API_KEY }),
|
||||||
[
|
jsonRpcProvider({
|
||||||
import.meta.env.VITE_ALCHEMY_API_KEY &&
|
rpc: (chain) => ({ http: chain.rpcUrls.default.http[0] }),
|
||||||
alchemyProvider({ apiKey: import.meta.env.VITE_ALCHEMY_API_KEY }),
|
}),
|
||||||
jsonRpcProvider({
|
publicProvider(),
|
||||||
rpc: (chain) => ({ http: chain.rpcUrls.default.http[0] }),
|
]);
|
||||||
}),
|
|
||||||
publicProvider(),
|
|
||||||
].filter(isTruthy)
|
|
||||||
);
|
|
||||||
|
|
||||||
const injectedConnectorOptions = {
|
const injectedConnectorOptions = {
|
||||||
chains,
|
chains,
|
||||||
@@ -208,7 +202,5 @@ 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(
|
: getConnectors(walletConnectConfig).find(({ id }: { id: string }) => id === walletConnectionConfig.wagmiConnectorId);
|
||||||
({ id }: { id: string }) => id === walletConnectionConfig.wagmiConnectorId
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|||||||
+13
-21
@@ -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, useTokenConfigs } from '@/hooks';
|
import { useAccounts, useStringGetter } from '@/hooks';
|
||||||
|
|
||||||
import { getOnboardingState } from '@/state/accountSelectors';
|
import { getOnboardingState } from '@/state/accountSelectors';
|
||||||
import { openDialog } from '@/state/dialogs';
|
import { openDialog } from '@/state/dialogs';
|
||||||
@@ -37,7 +37,6 @@ 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,
|
||||||
@@ -138,11 +137,7 @@ const Profile = () => {
|
|||||||
layout="grid"
|
layout="grid"
|
||||||
/>
|
/>
|
||||||
</Panel>
|
</Panel>
|
||||||
<Styled.RewardsPanel
|
<Styled.RewardsPanel header={stringGetter({ key: STRING_KEYS.REWARDS })} hasSeparator>
|
||||||
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: '-' },
|
||||||
@@ -154,8 +149,8 @@ const Profile = () => {
|
|||||||
</Styled.EqualGrid>
|
</Styled.EqualGrid>
|
||||||
|
|
||||||
<Styled.TablePanel
|
<Styled.TablePanel
|
||||||
slotHeaderContent={stringGetter({ key: STRING_KEYS.HISTORY })}
|
header={stringGetter({ key: STRING_KEYS.HISTORY })}
|
||||||
href={`${AppRoute.Portfolio}/${PortfolioRoute.History}/${HistoryRoute.Trades}`}
|
linkto={`${AppRoute.Portfolio}/${PortfolioRoute.History}/${HistoryRoute.Trades}`}
|
||||||
hasSeparator
|
hasSeparator
|
||||||
>
|
>
|
||||||
<FillsTable
|
<FillsTable
|
||||||
@@ -180,7 +175,7 @@ Styled.MobileProfileLayout = styled.div`
|
|||||||
${layoutMixins.contentContainerPage}
|
${layoutMixins.contentContainerPage}
|
||||||
|
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
padding: 1.25rem;
|
padding: 1rem;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Header = styled.header`
|
Styled.Header = styled.header`
|
||||||
@@ -278,25 +273,22 @@ Styled.RewardsPanel = styled(Panel)`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.TablePanel = styled(Panel)`
|
Styled.TablePanel = styled(Panel)`
|
||||||
--panel-content-paddingY: 0;
|
padding: 0;
|
||||||
--panel-content-paddingX: 0;
|
max-width: calc(100vw - 2rem);
|
||||||
|
max-height: 10rem;
|
||||||
> div > div {
|
|
||||||
margin-top: 0.5rem;
|
|
||||||
--scrollArea-height: 10rem;
|
|
||||||
border-radius: 0.875rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
table {
|
||||||
max-height: 10rem;
|
|
||||||
--tableCell-padding: 0.25rem 1rem;
|
--tableCell-padding: 0.25rem 1rem;
|
||||||
--tableRow-backgroundColor: var(--color-layer-3);
|
|
||||||
background-color: var(--color-layer-3);
|
background-color: transparent;
|
||||||
|
|
||||||
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) {
|
||||||
|
|||||||
+106
-131
@@ -1,12 +1,12 @@
|
|||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import { Nullable } from '@dydxprotocol/v4-abacus';
|
import { Nullable } from '@dydxprotocol/v4-abacus';
|
||||||
import styled, { AnyStyledComponent } from 'styled-components';
|
import styled, { AnyStyledComponent } from 'styled-components';
|
||||||
import { shallowEqual, useSelector } from 'react-redux';
|
import { shallowEqual, useSelector } from 'react-redux';
|
||||||
|
|
||||||
import { FeeTier } from '@/constants/abacus';
|
import { FeeTier } from '@/constants/abacus';
|
||||||
import { FEE_DECIMALS } from '@/constants/numbers';
|
import { FEE_DECIMALS, QUANTUM_MULTIPLIER } from '@/constants/numbers';
|
||||||
import { STRING_KEYS } from '@/constants/localization';
|
import { STRING_KEYS } from '@/constants/localization';
|
||||||
import { useBreakpoints, useStringGetter } from '@/hooks';
|
import { useAccounts, useBreakpoints, useStringGetter } from '@/hooks';
|
||||||
import { breakpoints } from '@/styles';
|
import { breakpoints } from '@/styles';
|
||||||
import { layoutMixins } from '@/styles/layoutMixins';
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
import { tableMixins } from '@/styles/tableMixins';
|
import { tableMixins } from '@/styles/tableMixins';
|
||||||
@@ -29,8 +29,9 @@ const EQUALITY_SYMBOL_MAP = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const Fees = () => {
|
export const Fees = () => {
|
||||||
|
const { dydxAddress } = useAccounts();
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
const { isTablet, isNotTablet } = useBreakpoints();
|
const { isNotTablet } = useBreakpoints();
|
||||||
const userFeeTier = useSelector(getUserFeeTier, shallowEqual);
|
const userFeeTier = useSelector(getUserFeeTier, shallowEqual);
|
||||||
const userStats = useSelector(getUserStats, shallowEqual);
|
const userStats = useSelector(getUserStats, shallowEqual);
|
||||||
const feeTiers = useSelector(getFeeTiers, shallowEqual);
|
const feeTiers = useSelector(getFeeTiers, shallowEqual);
|
||||||
@@ -55,28 +56,28 @@ export const Fees = () => {
|
|||||||
<Styled.AdditionalConditions>
|
<Styled.AdditionalConditions>
|
||||||
{!isAdditional && !totalShare && !makerShare && <Output type={OutputType.Text} />}
|
{!isAdditional && !totalShare && !makerShare && <Output type={OutputType.Text} />}
|
||||||
{!!totalShare && (
|
{!!totalShare && (
|
||||||
<Styled.AdditionalConditionsText>
|
<Styled.TextRow>
|
||||||
{isAdditional && stringGetter({ key: STRING_KEYS.AND })}{' '}
|
{isAdditional && <span>{stringGetter({ key: STRING_KEYS.AND })}</span>}
|
||||||
{stringGetter({ key: STRING_KEYS.EXCHANGE_MARKET_SHARE })}{' '}
|
<span>{stringGetter({ key: STRING_KEYS.EXCHANGE_MARKET_SHARE })}</span>
|
||||||
<Styled.Highlighted>{'>'}</Styled.Highlighted>{' '}
|
<Styled.Highlighted>{'>'}</Styled.Highlighted>
|
||||||
<Styled.HighlightOutput
|
<Styled.HighlightOutput
|
||||||
type={OutputType.Percent}
|
type={OutputType.Percent}
|
||||||
value={totalShare}
|
value={totalShare}
|
||||||
fractionDigits={0}
|
fractionDigits={0}
|
||||||
/>
|
/>
|
||||||
</Styled.AdditionalConditionsText>
|
</Styled.TextRow>
|
||||||
)}
|
)}
|
||||||
{!!makerShare && (
|
{!!makerShare && (
|
||||||
<Styled.AdditionalConditionsText>
|
<Styled.TextRow>
|
||||||
{isAdditional && stringGetter({ key: STRING_KEYS.AND })}{' '}
|
{isAdditional && <span>{stringGetter({ key: STRING_KEYS.AND })}</span>}
|
||||||
{stringGetter({ key: STRING_KEYS.MAKER_MARKET_SHARE })}{' '}
|
<span>{stringGetter({ key: STRING_KEYS.MAKER_MARKET_SHARE })}</span>
|
||||||
<Styled.Highlighted>{'>'}</Styled.Highlighted>{' '}
|
<Styled.Highlighted>{'>'}</Styled.Highlighted>
|
||||||
<Styled.HighlightOutput
|
<Styled.HighlightOutput
|
||||||
type={OutputType.Percent}
|
type={OutputType.Percent}
|
||||||
value={makerShare}
|
value={makerShare}
|
||||||
fractionDigits={0}
|
fractionDigits={0}
|
||||||
/>
|
/>
|
||||||
</Styled.AdditionalConditionsText>
|
</Styled.TextRow>
|
||||||
)}
|
)}
|
||||||
</Styled.AdditionalConditions>
|
</Styled.AdditionalConditions>
|
||||||
),
|
),
|
||||||
@@ -102,90 +103,91 @@ export const Fees = () => {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
<div>
|
||||||
<Styled.FeeTable
|
<Styled.FeeTable
|
||||||
label="Fee Tiers"
|
label="Fee Tiers"
|
||||||
data={feeTiers || []}
|
data={feeTiers || []}
|
||||||
getRowKey={(row: FeeTier) => row.tier}
|
getRowKey={(row: FeeTier) => row.tier}
|
||||||
getRowAttributes={(row: FeeTier) => ({
|
getRowAttributes={(row: FeeTier) => ({
|
||||||
'data-yours': row.tier === userFeeTier,
|
'data-yours': row.tier === userFeeTier,
|
||||||
})}
|
})}
|
||||||
columns={(
|
columns={(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
columnKey: 'tier',
|
columnKey: 'tier',
|
||||||
getCellValue: (row) => row.tier,
|
getCellValue: (row) => row.tier,
|
||||||
label: stringGetter({ key: STRING_KEYS.TIER }),
|
label: stringGetter({ key: STRING_KEYS.TIER }),
|
||||||
allowsSorting: false,
|
allowsSorting: false,
|
||||||
renderCell: ({ tier }) => (
|
renderCell: ({ tier }) => (
|
||||||
<Styled.Tier>
|
<Styled.Tier>
|
||||||
<Styled.Output type={OutputType.Text} value={tier} />
|
<Styled.Output type={OutputType.Text} value={tier} />
|
||||||
{tier === userFeeTier && (
|
{tier === userFeeTier && (
|
||||||
<Styled.YouTag size={TagSize.Medium}>
|
<Styled.YouTag size={TagSize.Medium}>
|
||||||
{stringGetter({ key: STRING_KEYS.YOU })}
|
{stringGetter({ key: STRING_KEYS.YOU })}
|
||||||
</Styled.YouTag>
|
</Styled.YouTag>
|
||||||
)}
|
)}
|
||||||
</Styled.Tier>
|
</Styled.Tier>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
columnKey: 'volume',
|
columnKey: 'volume',
|
||||||
getCellValue: (row) => row.volume,
|
getCellValue: (row) => row.volume,
|
||||||
label: stringGetter({ key: STRING_KEYS.VOLUME_30D }),
|
label: stringGetter({ key: STRING_KEYS.VOLUME_30D }),
|
||||||
allowsSorting: false,
|
allowsSorting: false,
|
||||||
renderCell: ({ symbol, volume, makerShare, totalShare }) => (
|
renderCell: ({ symbol, volume, makerShare, totalShare }) => (
|
||||||
<>
|
<>
|
||||||
<span>{`${
|
<span>{`${
|
||||||
symbol in EQUALITY_SYMBOL_MAP
|
symbol in EQUALITY_SYMBOL_MAP
|
||||||
? EQUALITY_SYMBOL_MAP[symbol as keyof typeof EQUALITY_SYMBOL_MAP]
|
? EQUALITY_SYMBOL_MAP[symbol as keyof typeof EQUALITY_SYMBOL_MAP]
|
||||||
: symbol
|
: symbol
|
||||||
} `}</span>
|
} `}</span>
|
||||||
<Styled.HighlightOutput type={OutputType.CompactFiat} value={volume} />
|
<Styled.HighlightOutput type={OutputType.CompactFiat} value={volume} />
|
||||||
{isTablet &&
|
{!isNotTablet &&
|
||||||
AdditionalConditions({ totalShare, makerShare, isAdditional: true })}
|
AdditionalConditions({ totalShare, makerShare, isAdditional: true })}
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
isNotTablet && {
|
isNotTablet && {
|
||||||
columnKey: 'condition',
|
columnKey: 'condition',
|
||||||
getCellValue: (row) => row.volume,
|
getCellValue: (row) => row.volume,
|
||||||
label: stringGetter({ key: STRING_KEYS.ADDITIONAL_CONDITION }),
|
label: stringGetter({ key: STRING_KEYS.ADDITIONAL_CONDITION }),
|
||||||
allowsSorting: false,
|
allowsSorting: false,
|
||||||
renderCell: ({ totalShare, makerShare }) =>
|
renderCell: ({ totalShare, makerShare }) =>
|
||||||
AdditionalConditions({ totalShare, makerShare }),
|
AdditionalConditions({ totalShare, makerShare }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
columnKey: 'maker',
|
columnKey: 'maker',
|
||||||
getCellValue: (row) => row.maker,
|
getCellValue: (row) => row.maker,
|
||||||
label: stringGetter({ key: STRING_KEYS.MAKER }),
|
label: stringGetter({ key: STRING_KEYS.MAKER }),
|
||||||
allowsSorting: false,
|
allowsSorting: false,
|
||||||
renderCell: ({ maker }) => (
|
renderCell: ({ maker }) => (
|
||||||
<Styled.HighlightOutput
|
<Styled.HighlightOutput
|
||||||
type={OutputType.SmallPercent}
|
type={OutputType.SmallPercent}
|
||||||
value={maker}
|
value={maker}
|
||||||
fractionDigits={FEE_DECIMALS}
|
fractionDigits={FEE_DECIMALS}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
columnKey: 'taker',
|
columnKey: 'taker',
|
||||||
getCellValue: (row) => row.taker,
|
getCellValue: (row) => row.taker,
|
||||||
label: stringGetter({ key: STRING_KEYS.TAKER }),
|
label: stringGetter({ key: STRING_KEYS.TAKER }),
|
||||||
allowsSorting: false,
|
allowsSorting: false,
|
||||||
renderCell: ({ taker }) => (
|
renderCell: ({ taker }) => (
|
||||||
<Styled.HighlightOutput
|
<Styled.HighlightOutput
|
||||||
type={OutputType.SmallPercent}
|
type={OutputType.SmallPercent}
|
||||||
value={taker}
|
value={taker}
|
||||||
fractionDigits={FEE_DECIMALS}
|
fractionDigits={FEE_DECIMALS}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
] as ColumnDef<FeeTier>[]
|
] as ColumnDef<FeeTier>[]
|
||||||
).filter(isTruthy)}
|
).filter(isTruthy)}
|
||||||
selectionBehavior="replace"
|
selectionBehavior="replace"
|
||||||
withOuterBorder={isNotTablet}
|
withOuterBorder={isNotTablet}
|
||||||
withInnerBorders
|
withInnerBorders
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</Styled.ContentWrapper>
|
</Styled.ContentWrapper>
|
||||||
</AttachedExpandingSection>
|
</AttachedExpandingSection>
|
||||||
);
|
);
|
||||||
@@ -196,43 +198,21 @@ const Styled: Record<string, AnyStyledComponent> = {};
|
|||||||
Styled.ContentWrapper = styled.div`
|
Styled.ContentWrapper = styled.div`
|
||||||
${layoutMixins.flexColumn}
|
${layoutMixins.flexColumn}
|
||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
max-width: 100vw;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.AdditionalConditions = styled.div`
|
Styled.AdditionalConditions = styled.div`
|
||||||
${tableMixins.cellContentColumn}
|
${tableMixins.cellContentColumn}
|
||||||
justify-content: end;
|
|
||||||
|
|
||||||
color: var(--color-text-0);
|
color: var(--color-text-0);
|
||||||
font: var(--font-small-book);
|
|
||||||
|
|
||||||
> :nth-child(2) {
|
> :nth-child(2) {
|
||||||
font: var(--font-small-book);
|
font: var(--font-base-book);
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
Styled.AdditionalConditionsText = styled.span`
|
|
||||||
display: flex;
|
|
||||||
gap: 0.5ch;
|
|
||||||
|
|
||||||
@media ${breakpoints.mobile} {
|
|
||||||
display: inline;
|
|
||||||
max-width: 8rem;
|
|
||||||
min-width: 0;
|
|
||||||
|
|
||||||
output {
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.FeesDetails = styled(Details)`
|
Styled.FeesDetails = styled(Details)`
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
|
||||||
@media ${breakpoints.notTablet} {
|
|
||||||
margin: 0 1.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media ${breakpoints.tablet} {
|
@media ${breakpoints.tablet} {
|
||||||
padding: 1rem 1rem 0 1rem;
|
padding: 1rem 1rem 0 1rem;
|
||||||
--details-grid-numColumns: 1;
|
--details-grid-numColumns: 1;
|
||||||
@@ -257,7 +237,11 @@ Styled.FeesDetails = styled(Details)`
|
|||||||
}
|
}
|
||||||
|
|
||||||
output {
|
output {
|
||||||
font: var(--font-base-book);
|
font: var(--font-medium-book);
|
||||||
|
|
||||||
|
@media ${breakpoints.tablet} {
|
||||||
|
font: var(--font-base-book);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -287,11 +271,6 @@ Styled.FeeTable = styled(Table)`
|
|||||||
|
|
||||||
font: var(--font-base-book);
|
font: var(--font-base-book);
|
||||||
|
|
||||||
@media ${breakpoints.mobile} {
|
|
||||||
--tableCell-padding: 1rem 1.25rem;
|
|
||||||
font: var(--font-small-book);
|
|
||||||
}
|
|
||||||
|
|
||||||
tbody tr {
|
tbody tr {
|
||||||
&[data-yours='true'] {
|
&[data-yours='true'] {
|
||||||
background-color: var(--color-layer-3);
|
background-color: var(--color-layer-3);
|
||||||
@@ -304,10 +283,6 @@ Styled.FeeTable = styled(Table)`
|
|||||||
|
|
||||||
@media ${breakpoints.notTablet} {
|
@media ${breakpoints.notTablet} {
|
||||||
--tableHeader-backgroundColor: var(--color-layer-1);
|
--tableHeader-backgroundColor: var(--color-layer-1);
|
||||||
|
|
||||||
thead tr {
|
|
||||||
--border-width: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import { OnboardingTriggerButton } from '@/views/dialogs/OnboardingTriggerButton
|
|||||||
import { openDialog } from '@/state/dialogs';
|
import { openDialog } from '@/state/dialogs';
|
||||||
import { calculateCanAccountTrade } from '@/state/accountCalculators';
|
import { calculateCanAccountTrade } from '@/state/accountCalculators';
|
||||||
|
|
||||||
|
// TODO(@aforaleka): replace with real data
|
||||||
export const DYDXBalancePanel = () => {
|
export const DYDXBalancePanel = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
@@ -32,11 +33,11 @@ export const DYDXBalancePanel = () => {
|
|||||||
const { chainTokenLabel } = useTokenConfigs();
|
const { chainTokenLabel } = useTokenConfigs();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Styled.Panel
|
<Panel
|
||||||
slotHeader={
|
slotHeader={
|
||||||
<Styled.Header>
|
<Styled.Header>
|
||||||
<Styled.Title>
|
<Styled.Title>
|
||||||
<AssetIcon symbol={chainTokenLabel} />
|
{/* <AssetIcon symbol="DYDX" /> */}
|
||||||
{chainTokenLabel}
|
{chainTokenLabel}
|
||||||
</Styled.Title>
|
</Styled.Title>
|
||||||
<Styled.ReceiveAndTransferButtons>
|
<Styled.ReceiveAndTransferButtons>
|
||||||
@@ -109,7 +110,7 @@ export const DYDXBalancePanel = () => {
|
|||||||
value: (
|
value: (
|
||||||
<Output
|
<Output
|
||||||
type={OutputType.Asset}
|
type={OutputType.Asset}
|
||||||
value={nativeTokenBalance.plus(nativeStakingBalance)}
|
value={nativeTokenBalance + nativeStakingBalance}
|
||||||
tag={chainTokenLabel}
|
tag={chainTokenLabel}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
@@ -117,20 +118,15 @@ export const DYDXBalancePanel = () => {
|
|||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</Styled.Content>
|
</Styled.Content>
|
||||||
</Styled.Panel>
|
</Panel>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const Styled: Record<string, AnyStyledComponent> = {};
|
const Styled: Record<string, AnyStyledComponent> = {};
|
||||||
|
|
||||||
Styled.Panel = styled(Panel)`
|
|
||||||
--panel-paddingX: 1.5rem;
|
|
||||||
`;
|
|
||||||
|
|
||||||
Styled.Header = styled.div`
|
Styled.Header = styled.div`
|
||||||
${layoutMixins.spacedRow}
|
${layoutMixins.spacedRow}
|
||||||
gap: 1rem;
|
padding: 1.25rem 1.5rem 0.5rem;
|
||||||
padding: 1rem 1.5rem 0;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Title = styled.h3`
|
Styled.Title = styled.h3`
|
||||||
@@ -159,6 +155,7 @@ Styled.ReceiveButton = styled(Button)`
|
|||||||
Styled.Content = styled.div`
|
Styled.Content = styled.div`
|
||||||
${layoutMixins.flexColumn}
|
${layoutMixins.flexColumn}
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
|
padding: 0 0.5rem 0.5rem;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.IconContainer = styled.div`
|
Styled.IconContainer = styled.div`
|
||||||
@@ -182,7 +179,7 @@ Styled.WalletAndStakedBalance = styled(Details)`
|
|||||||
--details-item-backgroundColor: var(--color-layer-6);
|
--details-item-backgroundColor: var(--color-layer-6);
|
||||||
|
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
gap: 1rem;
|
gap: 0.5rem;
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
|||||||
@@ -1,224 +0,0 @@
|
|||||||
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.MigratePanel
|
|
||||||
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.Column>
|
|
||||||
<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.Column>
|
|
||||||
</Styled.MigratePanel>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const Styled: Record<string, AnyStyledComponent> = {};
|
|
||||||
|
|
||||||
Styled.MigratePanel = styled(Panel)`
|
|
||||||
--panel-paddingX: 1.5rem;
|
|
||||||
width: 100%;
|
|
||||||
`;
|
|
||||||
|
|
||||||
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.Column = styled.div`
|
|
||||||
${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,74 +1,186 @@
|
|||||||
import styled, { AnyStyledComponent } from 'styled-components';
|
import styled, { AnyStyledComponent } from 'styled-components';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch, useSelector } 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 } from '@/constants/buttons';
|
import { ButtonAction, ButtonSize, ButtonState, ButtonType } from '@/constants/buttons';
|
||||||
import { DialogTypes } from '@/constants/dialogs';
|
import { DialogTypes } from '@/constants/dialogs';
|
||||||
|
|
||||||
import { useBreakpoints, useStringGetter, useURLConfigs } from '@/hooks';
|
import { useAccountBalance, 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
|
||||||
|
const GOVERNANCE_HELP_URL = 'https://help.dydx.exchange/';
|
||||||
|
const STAKING_HELP_URL = 'https://help.dydx.exchange/';
|
||||||
|
|
||||||
export const RewardsPage = () => {
|
export const RewardsPage = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
const { governanceLearnMore, stakingLearnMore } = useURLConfigs();
|
|
||||||
const { isTablet, isNotTablet } = useBreakpoints();
|
const { isTablet, isNotTablet } = useBreakpoints();
|
||||||
|
|
||||||
const panelArrow = (
|
const selectedNetwork = useSelector(getSelectedNetwork);
|
||||||
<Styled.Arrow>
|
|
||||||
<Styled.IconButton
|
// const chainId = Number(ENVIRONMENT_CONFIG_MAP[selectedNetwork].ethereumChainId);
|
||||||
action={ButtonAction.Base}
|
|
||||||
iconName={IconName.Arrow}
|
// const { balance } = useAccountBalance({
|
||||||
size={ButtonSize.Small}
|
// addressOrDenom: import.meta.env.VITE_V3_TOKEN_ADDRESS,
|
||||||
/>
|
// assetSymbol: 'DYDX',
|
||||||
</Styled.Arrow>
|
// chainId,
|
||||||
);
|
// isCosmosChain: false,
|
||||||
|
// });
|
||||||
|
|
||||||
|
// const tokenBalance = import.meta.env.VITE_V3_TOKEN_ADDRESS ? balance : 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Styled.Page>
|
<Styled.Page>
|
||||||
{import.meta.env.VITE_V3_TOKEN_ADDRESS && <MigratePanel />}
|
{/* {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>
|
||||||
|
)} */}
|
||||||
|
|
||||||
<Styled.PanelRow>
|
<Styled.PanelRow>
|
||||||
{isTablet && <DYDXBalancePanel />}
|
{isTablet && (
|
||||||
|
<Styled.BalancePanelContainer>
|
||||||
|
<DYDXBalancePanel />
|
||||||
|
</Styled.BalancePanelContainer>
|
||||||
|
)}
|
||||||
|
|
||||||
<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.Description>
|
<Styled.Row>
|
||||||
{stringGetter({ key: STRING_KEYS.GOVERNANCE_DESCRIPTION })}
|
<Styled.Description>
|
||||||
<Link href={governanceLearnMore} onClick={(e) => e.stopPropagation()}>
|
{stringGetter({ key: STRING_KEYS.GOVERNANCE_DESCRIPTION })}
|
||||||
{stringGetter({ key: STRING_KEYS.LEARN_MORE })} →
|
<Link href={GOVERNANCE_HELP_URL} onClick={(e) => e.stopPropagation()}>
|
||||||
</Link>
|
{stringGetter({ key: STRING_KEYS.LEARN_MORE })} →
|
||||||
</Styled.Description>
|
</Link>
|
||||||
|
</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.Description>
|
<Styled.Row>
|
||||||
{stringGetter({ key: STRING_KEYS.STAKING_DESCRIPTION })}
|
<Styled.Description>
|
||||||
<Link href={stakingLearnMore} onClick={(e) => e.stopPropagation()}>
|
{stringGetter({ key: STRING_KEYS.STAKING_DESCRIPTION })}
|
||||||
{stringGetter({ key: STRING_KEYS.LEARN_MORE })} →
|
<Link href={STAKING_HELP_URL} onClick={(e) => e.stopPropagation()}>
|
||||||
</Link>
|
{stringGetter({ key: STRING_KEYS.LEARN_MORE })} →
|
||||||
</Styled.Description>
|
</Link>
|
||||||
|
</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 && <DYDXBalancePanel />}
|
{isNotTablet && (
|
||||||
|
<Styled.BalancePanelContainer>
|
||||||
|
<DYDXBalancePanel />
|
||||||
|
</Styled.BalancePanelContainer>
|
||||||
|
)}
|
||||||
</Styled.PanelRow>
|
</Styled.PanelRow>
|
||||||
</Styled.Page>
|
</Styled.Page>
|
||||||
);
|
);
|
||||||
@@ -79,56 +191,143 @@ const Styled: Record<string, AnyStyledComponent> = {};
|
|||||||
Styled.Page = styled.div`
|
Styled.Page = styled.div`
|
||||||
${layoutMixins.contentContainerPage}
|
${layoutMixins.contentContainerPage}
|
||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
padding: 2rem;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
> * {
|
|
||||||
--content-max-width: 70rem;
|
|
||||||
max-width: min(calc(100vw - 4rem), var(--content-max-width));
|
|
||||||
}
|
|
||||||
|
|
||||||
@media ${breakpoints.tablet} {
|
@media ${breakpoints.tablet} {
|
||||||
padding: 1.25rem;
|
padding: 1rem;
|
||||||
|
|
||||||
> * {
|
|
||||||
max-width: calc(100vw - 2.5rem);
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Panel = styled(Panel)`
|
Styled.Panel = styled(Panel)`
|
||||||
--panel-paddingX: 1.5rem;
|
padding: 0 1.5rem 1rem;
|
||||||
|
|
||||||
|
@media ${breakpoints.tablet} {
|
||||||
|
max-width: calc(100vw - 2rem);
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Title = styled.h3`
|
Styled.Row = styled.div`
|
||||||
font: var(--font-medium-book);
|
${layoutMixins.spacedRow}
|
||||||
color: var(--color-text-2);
|
gap: 1rem;
|
||||||
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.PanelRow = styled.div`
|
Styled.Migrate = styled.section`
|
||||||
${layoutMixins.gridEqualColumns}
|
max-width: min(100vw, var(--content-max-width));
|
||||||
gap: 1.5rem;
|
|
||||||
|
|
||||||
|
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;
|
||||||
|
max-width: min(100vw, var(--content-max-width));
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|
||||||
|
> section {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
@media ${breakpoints.tablet} {
|
@media ${breakpoints.tablet} {
|
||||||
grid-auto-flow: row;
|
grid-auto-flow: row;
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
|
max-width: auto;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
Styled.BalancePanelContainer = styled.div`
|
||||||
|
width: 21.25rem;
|
||||||
|
|
||||||
|
@media ${breakpoints.tablet} {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
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;
|
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -227,8 +227,8 @@ export const HorizontalPanel = ({ isOpen = true, setIsOpen }: ElementProps) => {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
value={view}
|
value={view}
|
||||||
onValueChange={setView}
|
onValueChange={(newView: string) => {
|
||||||
onInteraction={() => {
|
setView((newView || view) as PanelView);
|
||||||
setIsOpen?.(true);
|
setIsOpen?.(true);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { MustBigNumber } from '@/lib/numbers';
|
|||||||
import { MidMarketPrice } from '@/views/MidMarketPrice';
|
import { MidMarketPrice } from '@/views/MidMarketPrice';
|
||||||
|
|
||||||
export const TradeHeaderMobile = () => {
|
export const TradeHeaderMobile = () => {
|
||||||
const { name, id } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
|
const { name, symbol } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const { market, priceChange24H, priceChange24HPercent } =
|
const { market, priceChange24H, priceChange24HPercent } =
|
||||||
@@ -27,7 +27,7 @@ export const TradeHeaderMobile = () => {
|
|||||||
<Styled.Header>
|
<Styled.Header>
|
||||||
<BackButton onClick={() => navigate(AppRoute.Markets)} />
|
<BackButton onClick={() => navigate(AppRoute.Markets)} />
|
||||||
<Styled.MarketName>
|
<Styled.MarketName>
|
||||||
<Styled.AssetIcon symbol={id} />
|
<Styled.AssetIcon symbol={symbol} />
|
||||||
<Styled.Name>
|
<Styled.Name>
|
||||||
<h3>{name}</h3>
|
<h3>{name}</h3>
|
||||||
<span>{market}</span>
|
<span>{market}</span>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export const MarketFilter = ({
|
|||||||
<>
|
<>
|
||||||
{!isSearch && (
|
{!isSearch && (
|
||||||
<ToggleGroup
|
<ToggleGroup
|
||||||
items={Object.values(filters).map((value) => ({
|
items={Object.entries(filters).map(([key, value]) => ({
|
||||||
label: stringGetter({ key: MARKET_FILTER_LABELS[value] }),
|
label: stringGetter({ key: MARKET_FILTER_LABELS[value] }),
|
||||||
value,
|
value,
|
||||||
}))}
|
}))}
|
||||||
|
|||||||
@@ -198,6 +198,8 @@ Styled.Details = styled(Details)`
|
|||||||
@media ${breakpoints.tablet} {
|
@media ${breakpoints.tablet} {
|
||||||
${layoutMixins.withOuterAndInnerBorders}
|
${layoutMixins.withOuterAndInnerBorders}
|
||||||
|
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
|
||||||
font: var(--font-small-book);
|
font: var(--font-small-book);
|
||||||
|
|
||||||
> * {
|
> * {
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ Styled.TriggerIcon = styled.span`
|
|||||||
width: 0.75em;
|
width: 0.75em;
|
||||||
|
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
transition: rotate 0.3s var(--ease-out-expo);
|
transition: transform 0.3s var(--ease-out-expo);
|
||||||
|
|
||||||
${Styled.Trigger}[data-state='open'] & {
|
${Styled.Trigger}[data-state='open'] & {
|
||||||
rotate: -0.5turn;
|
rotate: -0.5turn;
|
||||||
|
|||||||
@@ -246,7 +246,9 @@ export const FundingChart = ({ selectedLocale }: ElementProps) => {
|
|||||||
}[rate] || '',
|
}[rate] || '',
|
||||||
}))}
|
}))}
|
||||||
value={fundingRateView}
|
value={fundingRateView}
|
||||||
onValueChange={setFundingRateView}
|
onValueChange={(newRate: FundingRateResolution) => {
|
||||||
|
if (newRate) setFundingRateView(newRate);
|
||||||
|
}}
|
||||||
size={ButtonSize.XSmall}
|
size={ButtonSize.XSmall}
|
||||||
/>
|
/>
|
||||||
</Styled.FundingRateToggle>
|
</Styled.FundingRateToggle>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import styled, { type AnyStyledComponent } from 'styled-components';
|
|||||||
|
|
||||||
import { ButtonAction, ButtonSize, ButtonType } from '@/constants/buttons';
|
import { ButtonAction, ButtonSize, ButtonType } from '@/constants/buttons';
|
||||||
import { STRING_KEYS } from '@/constants/localization';
|
import { STRING_KEYS } from '@/constants/localization';
|
||||||
import { useBreakpoints, useStringGetter, useURLConfigs } from '@/hooks';
|
import { useBreakpoints, useStringGetter } from '@/hooks';
|
||||||
|
|
||||||
import { Button } from '@/components/Button';
|
import { Button } from '@/components/Button';
|
||||||
import { Dialog, DialogPlacement } from '@/components/Dialog';
|
import { Dialog, DialogPlacement } from '@/components/Dialog';
|
||||||
@@ -15,10 +15,12 @@ type ElementProps = {
|
|||||||
setIsOpen: (open: boolean) => void;
|
setIsOpen: (open: boolean) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO: replace placeholder URL with real URLs when avaialble
|
||||||
|
const KEPLR_DASHBOARD_URL = 'https://testnet.keplr.app/';
|
||||||
|
const HELP_URL = 'https://help.dydx.exchange/en/articles/2921366-how-do-i-create-an-account-or-sign-up';
|
||||||
|
|
||||||
export const ExternalNavKeplrDialog = ({ setIsOpen }: ElementProps) => {
|
export const ExternalNavKeplrDialog = ({ setIsOpen }: ElementProps) => {
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
const { keplrDashboard, accountExportLearnMore } = useURLConfigs();
|
|
||||||
|
|
||||||
const { isTablet } = useBreakpoints();
|
const { isTablet } = useBreakpoints();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -29,7 +31,7 @@ export const ExternalNavKeplrDialog = ({ setIsOpen }: ElementProps) => {
|
|||||||
placement={isTablet ? DialogPlacement.FullScreen : DialogPlacement.Default}
|
placement={isTablet ? DialogPlacement.FullScreen : DialogPlacement.Default}
|
||||||
>
|
>
|
||||||
<Styled.Content>
|
<Styled.Content>
|
||||||
<Styled.Button type={ButtonType.Link} size={ButtonSize.XLarge} href={keplrDashboard}>
|
<Styled.Button type={ButtonType.Link} size={ButtonSize.XLarge} href={KEPLR_DASHBOARD_URL}>
|
||||||
<span>
|
<span>
|
||||||
{stringGetter({
|
{stringGetter({
|
||||||
key: STRING_KEYS.NAVIGATE_TO_KEPLR,
|
key: STRING_KEYS.NAVIGATE_TO_KEPLR,
|
||||||
@@ -46,7 +48,7 @@ export const ExternalNavKeplrDialog = ({ setIsOpen }: ElementProps) => {
|
|||||||
/>
|
/>
|
||||||
</Styled.Button>
|
</Styled.Button>
|
||||||
|
|
||||||
<Styled.Button type={ButtonType.Link} size={ButtonSize.XLarge} href={accountExportLearnMore}>
|
<Styled.Button type={ButtonType.Link} size={ButtonSize.XLarge} href={HELP_URL}>
|
||||||
<span>
|
<span>
|
||||||
{stringGetter({
|
{stringGetter({
|
||||||
key: STRING_KEYS.LEARN_TO_EXPORT,
|
key: STRING_KEYS.LEARN_TO_EXPORT,
|
||||||
@@ -102,5 +104,4 @@ 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);
|
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import { useMemo } from 'react';
|
|||||||
import styled, { AnyStyledComponent } from 'styled-components';
|
import styled, { AnyStyledComponent } from 'styled-components';
|
||||||
|
|
||||||
import { STRING_KEYS } from '@/constants/localization';
|
import { STRING_KEYS } from '@/constants/localization';
|
||||||
import { useStringGetter, useURLConfigs } from '@/hooks';
|
import { useStringGetter } from '@/hooks';
|
||||||
|
import { ChatIcon, FeedbackIcon, FileIcon, TerminalIcon } from '@/icons';
|
||||||
|
|
||||||
import { ComboboxDialogMenu } from '@/components/ComboboxDialogMenu';
|
import { ComboboxDialogMenu } from '@/components/ComboboxDialogMenu';
|
||||||
import { Icon, IconName } from '@/components/Icon';
|
|
||||||
|
|
||||||
import { isTruthy } from '@/lib/isTruthy';
|
import { isTruthy } from '@/lib/isTruthy';
|
||||||
|
|
||||||
@@ -13,24 +13,39 @@ type ElementProps = {
|
|||||||
setIsOpen: (open: boolean) => void;
|
setIsOpen: (open: boolean) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const HELP_LINKS = {
|
||||||
|
apiDocumentation: 'https://v4-teacher.vercel.app/',
|
||||||
|
helpCenter: null,
|
||||||
|
feedback: null,
|
||||||
|
};
|
||||||
|
|
||||||
export const HelpDialog = ({ setIsOpen }: ElementProps) => {
|
export const HelpDialog = ({ setIsOpen }: ElementProps) => {
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
const { help: helpCenter, community } = useURLConfigs();
|
|
||||||
|
|
||||||
const HELP_ITEMS = useMemo(
|
const HELP_ITEMS = useMemo(
|
||||||
() => [
|
() => [
|
||||||
{
|
{
|
||||||
group: 'help-items',
|
group: 'help-items',
|
||||||
items: [
|
items: [
|
||||||
helpCenter && {
|
HELP_LINKS.helpCenter && {
|
||||||
value: 'help-center',
|
value: 'help-center',
|
||||||
label: stringGetter({ key: STRING_KEYS.HELP_CENTER }),
|
label: stringGetter({ key: STRING_KEYS.HELP_CENTER }),
|
||||||
description: stringGetter({ key: STRING_KEYS.HELP_CENTER_DESCRIPTION }),
|
description: stringGetter({ key: STRING_KEYS.HELP_CENTER_DESCRIPTION }),
|
||||||
onSelect: () => {
|
onSelect: () => {
|
||||||
helpCenter && globalThis.open(helpCenter, '_blank');
|
HELP_LINKS.helpCenter && globalThis.open(HELP_LINKS.helpCenter, '_blank');
|
||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
},
|
},
|
||||||
slotBefore: <Icon iconName={IconName.File} />,
|
slotBefore: <FileIcon />,
|
||||||
|
},
|
||||||
|
HELP_LINKS.apiDocumentation && {
|
||||||
|
value: 'api-documentation',
|
||||||
|
label: stringGetter({ key: STRING_KEYS.API_DOCUMENTATION }),
|
||||||
|
description: stringGetter({ key: STRING_KEYS.API_DOCUMENTATION_DESCRIPTION }),
|
||||||
|
onSelect: () => {
|
||||||
|
HELP_LINKS.apiDocumentation && globalThis.open(HELP_LINKS.apiDocumentation, '_blank');
|
||||||
|
setIsOpen(false);
|
||||||
|
},
|
||||||
|
slotBefore: <TerminalIcon />,
|
||||||
},
|
},
|
||||||
globalThis?.Intercom && {
|
globalThis?.Intercom && {
|
||||||
value: 'live-chat',
|
value: 'live-chat',
|
||||||
@@ -40,22 +55,22 @@ export const HelpDialog = ({ setIsOpen }: ElementProps) => {
|
|||||||
globalThis.Intercom('show');
|
globalThis.Intercom('show');
|
||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
},
|
},
|
||||||
slotBefore: <Icon iconName={IconName.Chat} />,
|
slotBefore: <ChatIcon />,
|
||||||
},
|
},
|
||||||
community && {
|
HELP_LINKS.feedback && {
|
||||||
value: 'community',
|
value: 'feedback',
|
||||||
label: stringGetter({ key: STRING_KEYS.COMMUNITY }),
|
label: stringGetter({ key: STRING_KEYS.PROVIDE_FEEDBACK }),
|
||||||
description: stringGetter({ key: STRING_KEYS.COMMUNITY_DESCRIPTION }),
|
description: stringGetter({ key: STRING_KEYS.PROVIDE_FEEDBACK_DESCRIPTION }),
|
||||||
onSelect: () => {
|
onSelect: () => {
|
||||||
community && globalThis.open(community, '_blank');
|
HELP_LINKS.feedback && globalThis.open(HELP_LINKS.feedback, '_blank');
|
||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
},
|
},
|
||||||
slotBefore: <Icon iconName={IconName.Discord} />,
|
slotBefore: <FeedbackIcon />,
|
||||||
},
|
},
|
||||||
].filter(isTruthy),
|
].filter(isTruthy),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[stringGetter, helpCenter, community]
|
[stringGetter]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -13,15 +13,16 @@ import { Button } from '@/components/Button';
|
|||||||
import { Icon } from '@/components/Icon';
|
import { Icon } from '@/components/Icon';
|
||||||
import { Link } from '@/components/Link';
|
import { Link } from '@/components/Link';
|
||||||
|
|
||||||
import { useAccounts, useStringGetter, useURLConfigs } from '@/hooks';
|
import { useAccounts, useStringGetter } from '@/hooks';
|
||||||
import { useDisplayedWallets } from '@/hooks/useDisplayedWallets';
|
import { useDisplayedWallets } from '@/hooks/useDisplayedWallets';
|
||||||
|
|
||||||
import { breakpoints } from '@/styles';
|
import { breakpoints } from '@/styles';
|
||||||
import { layoutMixins } from '@/styles/layoutMixins';
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
|
|
||||||
|
const aboutWalletsLink = `https://www.dydx.academy/video/defi-wallet`;
|
||||||
|
|
||||||
export const ChooseWallet = () => {
|
export const ChooseWallet = () => {
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
const { walletLearnMore } = useURLConfigs();
|
|
||||||
|
|
||||||
const displayedWallets = useDisplayedWallets();
|
const displayedWallets = useDisplayedWallets();
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@ export const ChooseWallet = () => {
|
|||||||
</Styled.Wallets>
|
</Styled.Wallets>
|
||||||
|
|
||||||
<Styled.Footer>
|
<Styled.Footer>
|
||||||
<Link href={walletLearnMore} withIcon>
|
<Link href={aboutWalletsLink} withIcon>
|
||||||
{stringGetter({ key: STRING_KEYS.ABOUT_WALLETS })}
|
{stringGetter({ key: STRING_KEYS.ABOUT_WALLETS })}
|
||||||
</Link>
|
</Link>
|
||||||
</Styled.Footer>
|
</Styled.Footer>
|
||||||
|
|||||||
@@ -130,14 +130,12 @@ 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);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export const TradeDialog = ({ isOpen, setIsOpen, slotTrigger }: ElementProps) =>
|
|||||||
const selectedTradeType = getSelectedTradeType(type);
|
const selectedTradeType = getSelectedTradeType(type);
|
||||||
const { typeOptions } = useSelector(getInputTradeOptions, shallowEqual) ?? {};
|
const { typeOptions } = useSelector(getInputTradeOptions, shallowEqual) ?? {};
|
||||||
|
|
||||||
const allTradeTypeItems = (typeOptions?.toArray() ?? []).map(({ type, stringKey }) => ({
|
const allTradeTypeItems = typeOptions?.toArray()?.map(({ type, stringKey }) => ({
|
||||||
value: type,
|
value: type,
|
||||||
label: stringGetter({
|
label: stringGetter({
|
||||||
key: stringKey as StringKey,
|
key: stringKey as StringKey,
|
||||||
@@ -73,7 +73,9 @@ export const TradeDialog = ({ isOpen, setIsOpen, slotTrigger }: ElementProps) =>
|
|||||||
<Styled.ToggleGroup
|
<Styled.ToggleGroup
|
||||||
items={allTradeTypeItems}
|
items={allTradeTypeItems}
|
||||||
value={selectedTradeType}
|
value={selectedTradeType}
|
||||||
onValueChange={onTradeTypeChange}
|
onValueChange={(tradeType: TradeTypes) =>
|
||||||
|
onTradeTypeChange(tradeType || selectedTradeType)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ export const DepositForm = ({ onDeposit, onError }: DepositFormProps) => {
|
|||||||
// Async Data
|
// Async Data
|
||||||
const { balance, queryStatus, isQueryFetching } = useAccountBalance({
|
const { balance, queryStatus, isQueryFetching } = useAccountBalance({
|
||||||
addressOrDenom: sourceToken?.address || CHAIN_DEFAULT_TOKEN_ADDRESS,
|
addressOrDenom: sourceToken?.address || CHAIN_DEFAULT_TOKEN_ADDRESS,
|
||||||
|
assetSymbol: sourceToken?.symbol || undefined,
|
||||||
chainId: chainId,
|
chainId: chainId,
|
||||||
decimals: sourceToken?.decimals || undefined,
|
decimals: sourceToken?.decimals || undefined,
|
||||||
isCosmosChain: false,
|
isCosmosChain: false,
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ export const ClosePositionForm = ({
|
|||||||
value: value.toString(),
|
value: value.toString(),
|
||||||
}))}
|
}))}
|
||||||
value={percent?.toString() ?? ''}
|
value={percent?.toString() ?? ''}
|
||||||
onValueChange={onSelectPercentage}
|
onValueChange={(value: any) => onSelectPercentage((value || percent?.toString()) ?? '')}
|
||||||
shape={ButtonShape.Rectangle}
|
shape={ButtonShape.Rectangle}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -322,6 +322,7 @@ export const TradeForm = ({
|
|||||||
summary={summary ?? undefined}
|
summary={summary ?? undefined}
|
||||||
currentStep={currentStep}
|
currentStep={currentStep}
|
||||||
showDeposit={inputAlert?.errorAction === TradeInputErrorAction.DEPOSIT}
|
showDeposit={inputAlert?.errorAction === TradeInputErrorAction.DEPOSIT}
|
||||||
|
showConnectWallet={inputAlert?.errorAction === TradeInputErrorAction.CONNECT_WALLET}
|
||||||
/>
|
/>
|
||||||
</Styled.Footer>
|
</Styled.Footer>
|
||||||
</Styled.TradeForm>
|
</Styled.TradeForm>
|
||||||
|
|||||||
@@ -153,7 +153,9 @@ export const MarketLeverageInput = ({
|
|||||||
value: MustBigNumber(leverageAmount).toFixed(LEVERAGE_DECIMALS),
|
value: MustBigNumber(leverageAmount).toFixed(LEVERAGE_DECIMALS),
|
||||||
}))}
|
}))}
|
||||||
value={MustBigNumber(formattedLeverageValue).abs().toFixed(LEVERAGE_DECIMALS)} // sign agnostic
|
value={MustBigNumber(formattedLeverageValue).abs().toFixed(LEVERAGE_DECIMALS)} // sign agnostic
|
||||||
onValueChange={updateLeverage}
|
onValueChange={(option?: number) =>
|
||||||
|
updateLeverage(option === undefined ? formattedLeverageValue : option)
|
||||||
|
}
|
||||||
shape={ButtonShape.Rectangle}
|
shape={ButtonShape.Rectangle}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ import { DialogTypes } from '@/constants/dialogs';
|
|||||||
import { STRING_KEYS } from '@/constants/localization';
|
import { STRING_KEYS } from '@/constants/localization';
|
||||||
import { TRADE_TYPE_STRINGS, MobilePlaceOrderSteps } from '@/constants/trade';
|
import { TRADE_TYPE_STRINGS, MobilePlaceOrderSteps } from '@/constants/trade';
|
||||||
|
|
||||||
import { useStringGetter, useTokenConfigs } from '@/hooks';
|
import { useStringGetter } from '@/hooks';
|
||||||
|
|
||||||
|
import { AssetIcon } from '@/components/AssetIcon';
|
||||||
import { Button } from '@/components/Button';
|
import { Button } from '@/components/Button';
|
||||||
import { Output, OutputType, ShowSign } from '@/components/Output';
|
import { Output, OutputType, ShowSign } from '@/components/Output';
|
||||||
import { WithDetailsReceipt } from '@/components/WithDetailsReceipt';
|
import { WithDetailsReceipt } from '@/components/WithDetailsReceipt';
|
||||||
@@ -46,7 +47,6 @@ export const PlaceOrderButtonAndReceipt = ({
|
|||||||
}: ElementProps) => {
|
}: ElementProps) => {
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { chainTokenLabel } = useTokenConfigs();
|
|
||||||
|
|
||||||
const canAccountTrade = useSelector(calculateCanAccountTrade);
|
const canAccountTrade = useSelector(calculateCanAccountTrade);
|
||||||
const subaccountNumber = useSelector(getSubaccountId);
|
const subaccountNumber = useSelector(getSubaccountId);
|
||||||
@@ -88,14 +88,7 @@ export const PlaceOrderButtonAndReceipt = ({
|
|||||||
{/* <AssetIcon symbol="DYDX" /> */}
|
{/* <AssetIcon symbol="DYDX" /> */}
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
value: (
|
value: <Output type={OutputType.Asset} value={reward} useGrouping tag={reward ? "Dv4TNT" : ''} />,
|
||||||
<Output
|
|
||||||
type={OutputType.Asset}
|
|
||||||
value={reward}
|
|
||||||
useGrouping
|
|
||||||
tag={reward ? chainTokenLabel : ''}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
tooltip: 'max-reward',
|
tooltip: 'max-reward',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -118,7 +111,7 @@ export const PlaceOrderButtonAndReceipt = ({
|
|||||||
? actionStringKey
|
? actionStringKey
|
||||||
: STRING_KEYS.UNAVAILABLE,
|
: STRING_KEYS.UNAVAILABLE,
|
||||||
buttonAction: ButtonAction.Primary,
|
buttonAction: ButtonAction.Primary,
|
||||||
buttonState: { isDisabled: !shouldEnableTrade, isLoading: hasMissingData },
|
buttonState: { isDisabled: !shouldEnableTrade },
|
||||||
},
|
},
|
||||||
|
|
||||||
[MobilePlaceOrderSteps.PreviewOrder]: {
|
[MobilePlaceOrderSteps.PreviewOrder]: {
|
||||||
@@ -155,10 +148,7 @@ export const PlaceOrderButtonAndReceipt = ({
|
|||||||
|
|
||||||
const buttonState = currentStep
|
const buttonState = currentStep
|
||||||
? buttonStatesPerStep[currentStep].buttonState
|
? buttonStatesPerStep[currentStep].buttonState
|
||||||
: {
|
: { isDisabled: !shouldEnableTrade || isLoading, isLoading };
|
||||||
isDisabled: !shouldEnableTrade || isLoading,
|
|
||||||
isLoading: isLoading || hasMissingData,
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDetailsReceipt detailItems={items}>
|
<WithDetailsReceipt detailItems={items}>
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import {
|
|||||||
useTokenConfigs,
|
useTokenConfigs,
|
||||||
useStringGetter,
|
useStringGetter,
|
||||||
useAccountBalance,
|
useAccountBalance,
|
||||||
useURLConfigs,
|
|
||||||
} from '@/hooks';
|
} from '@/hooks';
|
||||||
|
|
||||||
import { OnboardingTriggerButton } from '@/views/dialogs/OnboardingTriggerButton';
|
import { OnboardingTriggerButton } from '@/views/dialogs/OnboardingTriggerButton';
|
||||||
@@ -37,9 +36,10 @@ import { truncateAddress } from '@/lib/wallet';
|
|||||||
import { layoutMixins } from '@/styles/layoutMixins';
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
import { headerMixins } from '@/styles/headerMixins';
|
import { headerMixins } from '@/styles/headerMixins';
|
||||||
|
|
||||||
|
const explorerBaseUri = 'https://testnet.mintscan.io/dydx-testnet';
|
||||||
|
|
||||||
export const AccountMenu = () => {
|
export const AccountMenu = () => {
|
||||||
const stringGetter = useStringGetter();
|
const stringGetter = useStringGetter();
|
||||||
const { mintscanBase } = useURLConfigs();
|
|
||||||
const { isTablet } = useBreakpoints();
|
const { isTablet } = useBreakpoints();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const onboardingState = useSelector(getOnboardingState);
|
const onboardingState = useSelector(getOnboardingState);
|
||||||
@@ -92,7 +92,7 @@ export const AccountMenu = () => {
|
|||||||
/>
|
/>
|
||||||
<IconButton
|
<IconButton
|
||||||
action={ButtonAction.Base}
|
action={ButtonAction.Base}
|
||||||
href={`${mintscanBase}/account/${dydxAddress}`}
|
href={`${explorerBaseUri}/account/${dydxAddress}`}
|
||||||
iconName={IconName.LinkOut}
|
iconName={IconName.LinkOut}
|
||||||
shape={ButtonShape.Square}
|
shape={ButtonShape.Square}
|
||||||
type={ButtonType.Link}
|
type={ButtonType.Link}
|
||||||
@@ -139,7 +139,7 @@ export const AccountMenu = () => {
|
|||||||
fractionDigits={2}
|
fractionDigits={2}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<AssetActions asset={DydxChainAsset.USDC} dispatch={dispatch} withOnboarding />
|
<AssetActions asset={DydxChainAsset.USDC} dispatch={dispatch} />
|
||||||
</div>
|
</div>
|
||||||
</Styled.Balances>
|
</Styled.Balances>
|
||||||
</Styled.AccountInfo>
|
</Styled.AccountInfo>
|
||||||
@@ -167,7 +167,7 @@ export const AccountMenu = () => {
|
|||||||
// value: 'ViewInExplorer',
|
// value: 'ViewInExplorer',
|
||||||
// icon: <Icon iconName={IconName.Etherscan} />,
|
// icon: <Icon iconName={IconName.Etherscan} />,
|
||||||
// label: stringGetter({ key: STRING_KEYS.OPEN_IN_ETHERSCAN }),
|
// label: stringGetter({ key: STRING_KEYS.OPEN_IN_ETHERSCAN }),
|
||||||
// onSelect: () => globalThis.open(`${mintscanBase}/address/${address}`),
|
// onSelect: () => globalThis.open(`${explorerBaseUri}/address/${address}`),
|
||||||
// separator: true,
|
// separator: true,
|
||||||
// },
|
// },
|
||||||
...(onboardingState === OnboardingState.AccountConnected && hdKey
|
...(onboardingState === OnboardingState.AccountConnected && hdKey
|
||||||
@@ -212,45 +212,28 @@ export const AccountMenu = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const AssetActions = memo(
|
const AssetActions = memo(({ asset, dispatch }: { asset: DydxChainAsset; dispatch: Dispatch }) => (
|
||||||
({
|
<Styled.InlineRow>
|
||||||
asset,
|
{[
|
||||||
dispatch,
|
// TODO(@rosepuppy): Add withdraw action for USDC
|
||||||
withOnboarding,
|
{
|
||||||
}: {
|
dialogType: DialogTypes.Receive,
|
||||||
asset: DydxChainAsset;
|
iconName: IconName.Qr,
|
||||||
dispatch: Dispatch;
|
},
|
||||||
withOnboarding?: boolean;
|
{ dialogType: DialogTypes.Transfer, iconName: IconName.Send },
|
||||||
}) => (
|
].map(({ iconName, dialogType }) => (
|
||||||
<Styled.InlineRow>
|
<IconButton
|
||||||
{[
|
key={dialogType}
|
||||||
withOnboarding && {
|
action={ButtonAction.Base}
|
||||||
dialogType: DialogTypes.Withdraw,
|
shape={ButtonShape.Square}
|
||||||
iconName: IconName.Withdraw,
|
iconName={iconName}
|
||||||
},
|
onClick={() =>
|
||||||
withOnboarding && {
|
dispatch(openDialog({ type: dialogType, dialogProps: { selectedAsset: asset } }))
|
||||||
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> = {};
|
||||||
|
|
||||||
@@ -368,7 +351,3 @@ Styled.ConnectToChain = styled(Styled.Column)`
|
|||||||
font: var(--font-small-book);
|
font: var(--font-small-book);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.IconButton = styled(IconButton)`
|
|
||||||
--button-padding: 0 0.25rem;
|
|
||||||
`;
|
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import styled from 'styled-components';
|
|
||||||
import { layoutMixins } from '@/styles/layoutMixins';
|
|
||||||
import { groupBy } from 'lodash';
|
import { groupBy } from 'lodash';
|
||||||
|
|
||||||
import { type Notification, NotificationStatus } from '@/constants/notifications';
|
import { type Notification, NotificationStatus } from '@/constants/notifications';
|
||||||
|
|
||||||
import { useBreakpoints } from '@/hooks';
|
|
||||||
import { useNotifications } from '@/hooks/useNotifications';
|
import { useNotifications } from '@/hooks/useNotifications';
|
||||||
import { CloseIcon } from '@/icons';
|
|
||||||
|
|
||||||
import { Button } from '@/components/Button';
|
import { Button } from '@/components/Button';
|
||||||
import { ButtonAction, ButtonSize } from '@/constants/buttons';
|
import { ButtonAction, ButtonSize } from '@/constants/buttons';
|
||||||
@@ -16,6 +13,10 @@ import { DialogPlacement } from '@/components/Dialog';
|
|||||||
import { Output, OutputType } from '@/components/Output';
|
import { Output, OutputType } from '@/components/Output';
|
||||||
import { IconButton } from '@/components/IconButton';
|
import { IconButton } from '@/components/IconButton';
|
||||||
import { Toolbar } from '@/components/Toolbar';
|
import { Toolbar } from '@/components/Toolbar';
|
||||||
|
import { CloseIcon } from '@/icons';
|
||||||
|
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
|
|
||||||
type ElementProps = {
|
type ElementProps = {
|
||||||
slotTrigger?: React.ReactNode;
|
slotTrigger?: React.ReactNode;
|
||||||
@@ -26,7 +27,6 @@ export const NotificationsMenu = ({
|
|||||||
slotTrigger,
|
slotTrigger,
|
||||||
placement = DialogPlacement.Sidebar,
|
placement = DialogPlacement.Sidebar,
|
||||||
}: ElementProps) => {
|
}: ElementProps) => {
|
||||||
const { isTablet } = useBreakpoints();
|
|
||||||
const {
|
const {
|
||||||
notifications,
|
notifications,
|
||||||
getDisplayData,
|
getDisplayData,
|
||||||
@@ -173,7 +173,6 @@ export const NotificationsMenu = ({
|
|||||||
</$FooterToolbar>
|
</$FooterToolbar>
|
||||||
}
|
}
|
||||||
placement={placement}
|
placement={placement}
|
||||||
preventClose={isTablet}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ const getFillsTableColumnDef = ({
|
|||||||
}[orderSide],
|
}[orderSide],
|
||||||
})}
|
})}
|
||||||
</Styled.Side>
|
</Styled.Side>
|
||||||
<Output type={OutputType.Text} value={asset?.id} />
|
<Output type={OutputType.Text} value={asset.id} />
|
||||||
</Styled.TableCell>
|
</Styled.TableCell>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ const getOrdersTableColumnDef = ({
|
|||||||
key: STRING_KEYS.FILL,
|
key: STRING_KEYS.FILL,
|
||||||
})}`,
|
})}`,
|
||||||
renderCell: ({
|
renderCell: ({
|
||||||
asset,
|
asset: { symbol: assetSymbol },
|
||||||
createdAtMilliseconds,
|
createdAtMilliseconds,
|
||||||
size,
|
size,
|
||||||
status,
|
status,
|
||||||
@@ -254,7 +254,7 @@ const getOrdersTableColumnDef = ({
|
|||||||
value={createdAtMilliseconds}
|
value={createdAtMilliseconds}
|
||||||
/>
|
/>
|
||||||
<Styled.AssetIconWithStatus>
|
<Styled.AssetIconWithStatus>
|
||||||
<Styled.AssetIcon symbol={asset?.id} />
|
<Styled.AssetIcon symbol={assetSymbol} />
|
||||||
<Styled.StatusDot color={statusIconColor} />
|
<Styled.StatusDot color={statusIconColor} />
|
||||||
</Styled.AssetIconWithStatus>
|
</Styled.AssetIconWithStatus>
|
||||||
</>
|
</>
|
||||||
@@ -276,7 +276,7 @@ const getOrdersTableColumnDef = ({
|
|||||||
type={OutputType.Asset}
|
type={OutputType.Asset}
|
||||||
value={size}
|
value={size}
|
||||||
fractionDigits={TOKEN_DECIMALS}
|
fractionDigits={TOKEN_DECIMALS}
|
||||||
tag={asset?.id}
|
tag={assetSymbol}
|
||||||
/>
|
/>
|
||||||
</Styled.InlineRow>
|
</Styled.InlineRow>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|||||||
Reference in New Issue
Block a user