Compare commits

..
Author SHA1 Message Date
Bill He 76a0b6764f Update Squid URL 2023-10-11 09:59:30 -07:00
Rui f9e301b3f0 Add script to inject iOS app ID to public/.well-known/apple-app-site-association (#66)
* Add script to inject iOS app ID to public/.well-known/apple-app-site-association

* package.json

* Fix typo

* Fix typo

* Fix build

* Debug

* Updated to use "dist" folder
2023-10-10 15:58:26 -07:00
John Huang 67ecbd75b4 Added USDC gasDenom, and Staging West label (#65)
* TRCL-2892-configs-changes

* Additional changes for main net template, and WalletConnect payloads

* Added logo file used for WalletConnect, and changed name and description in WC

* Removed a comma

* TRCL-2898 Additional node provider

* Added USDC gasDenom, and Staging West label
2023-10-09 17:08:04 -04:00
Bill a05d88136d Polishes for Onboarding (#57)
* Polishes for Onboarding

* update string

* bump packages

* address nit
2023-10-09 09:34:49 -07:00
Jared Vu f1ca86326d Fix GoodTil var changes (#64) 2023-10-09 08:02:32 -07:00
aleka 5d1d734c59 add config for sign typed data domain name and action for networks (#62) 2023-10-09 10:51:47 -04:00
aleka 9ba6b3d6ba fix typo in walletconnect wallet type (#63) 2023-10-06 15:50:52 -07:00
Jared Vu 62eeab06f5 Fix marketDetails stringKey, do not update state with markets not tracked by Abacus (#61) 2023-10-06 14:12:40 -07:00
John Huang fa621a085b TRCL-2892-configs-changes (#60)
* TRCL-2892-configs-changes

* Additional changes for main net template, and WalletConnect payloads

* Added logo file used for WalletConnect, and changed name and description in WC

* Removed a comma

* TRCL-2898 Additional node provider
2023-10-06 13:50:41 -07:00
Bill 0730e71109 Do not hide rewardpage on prod (#58) 2023-10-04 22:57:39 -07:00
Bill fdd3fbd774 Reward page (#52)
* Implement Rewards Page

* more rewards page panels

* add keplr dialog

* Finish up rewards page

* bump localization

* add to nav

* address comments

* Comment out migration work

* rename

* address comments

* add TODO
2023-10-04 13:11:35 -04:00
Jared Vu 15bf8a1b34 Update Abacus v0.6.0 (#55)
* Abacus 6: New init, deprecate asset.symbol

* deprecate asset.symbol

* Update networks constants

* filesystem

* Update networks.ts

* 0.6.0 -> 0.6.3

* Remove Market filter
2023-10-03 13:10:55 -07:00
Bill 6508a8b857 Add all squid evm networks to wagmi (#50)
* Add all squid evm networks to wagmi

* remove alchemy

* address nit
2023-10-02 18:50:39 -04:00
aleka e10e7c10e0 fix dialog area too long on mobile (#54) 2023-10-02 13:57:41 -04:00
John Huang 175a6fe523 Added tokenDenom to the configs. Also changed the environments payload to a map from list (#53)
* Added tokenDenom to the configs. Also changed the environments payload to a map from list

* Make tokens section more comprehensive
2023-09-28 16:10:09 -07:00
66 changed files with 2068 additions and 458 deletions
+2
View File
@@ -6,3 +6,5 @@ VITE_PK_ENCRYPTION_KEY=
VITE_WALLETCONNECT1_BRIDGE=
VITE_WALLETCONNECT2_PROJECT_ID=
VITE_V3_TOKEN_ADDRESS=
+2
View File
@@ -33,11 +33,13 @@ jobs:
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
STATUS_PAGE_SCRIPT_URI: ${{ secrets.STATUS_PAGE_SCRIPT_URI }}
IOS_APP_ID: ${{ secrets.IOS_APP_ID }}
run: |
pnpm run build
pnpm run build:inject-amplitude
pnpm run build:inject-bugsnag
pnpm run build:inject-statuspage
sh scripts/inject-app-deeplinks.sh
- name: Upload to IPFS via web3.storage
uses: dydxprotocol/add-to-web3@v1
+4 -3
View File
@@ -10,6 +10,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"build:inject-app-deeplinks": "sh scripts/inject-app-deeplinks.sh",
"build:inject-amplitude": "node scripts/inject-amplitude.js",
"build:inject-bugsnag": "node scripts/inject-bugsnag.js",
"build:inject-statuspage": "node scripts/inject-statuspage.js",
@@ -37,9 +38,9 @@
"@cosmjs/proto-signing": "^0.31.0",
"@cosmjs/stargate": "^0.31.0",
"@cosmjs/tendermint-rpc": "^0.31.0",
"@dydxprotocol/v4-abacus": "^0.5.12",
"@dydxprotocol/v4-abacus": "^0.6.4",
"@dydxprotocol/v4-client-js": "^0.36.1",
"@dydxprotocol/v4-localization": "^0.1.12",
"@dydxprotocol/v4-localization": "^0.1.24",
"@ethersproject/providers": "^5.7.2",
"@js-joda/core": "^5.5.3",
"@radix-ui/react-collapsible": "^1.0.3",
@@ -105,7 +106,7 @@
"reselect": "^4.1.8",
"styled-components": "^5.3.11",
"use-latest": "^1.2.1",
"viem": "^1.1.6",
"viem": "^1.12.2",
"wagmi": "^1.3.7"
},
"devDependencies": {
+85 -63
View File
@@ -27,14 +27,14 @@ dependencies:
specifier: ^0.31.0
version: 0.31.0
'@dydxprotocol/v4-abacus':
specifier: ^0.5.12
version: 0.5.12
specifier: ^0.6.4
version: 0.6.4
'@dydxprotocol/v4-client-js':
specifier: ^0.36.1
version: 0.36.1
'@dydxprotocol/v4-localization':
specifier: ^0.1.12
version: 0.1.12
specifier: ^0.1.24
version: 0.1.24
'@ethersproject/providers':
specifier: ^5.7.2
version: 5.7.2
@@ -231,11 +231,11 @@ dependencies:
specifier: ^1.2.1
version: 1.2.1(@types/react@18.2.14)(react@18.2.0)
viem:
specifier: ^1.1.6
version: 1.1.6(typescript@5.1.3)
specifier: ^1.12.2
version: 1.12.2(typescript@5.1.3)
wagmi:
specifier: ^1.3.7
version: 1.3.7(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.3)(viem@1.1.6)
version: 1.3.7(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.3)(viem@1.12.2)
devDependencies:
'@babel/core':
@@ -380,14 +380,14 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/@adraffy/ens-normalize@1.9.0:
resolution: {integrity: sha512-iowxq3U30sghZotgl4s/oJRci6WPBfNO5YYgk2cIOMCHr3LeGPcsZjCEr+33Q4N+oV3OABDAtA+pyvWjbvBifQ==}
dev: false
/@adraffy/ens-normalize@1.9.2:
resolution: {integrity: sha512-0h+FrQDqe2Wn+IIGFkTCd4aAwTJ+7834Ek1COohCyV26AXhwQ7WQaz+4F/nLOeVl/3BtWHOHLPsq46V8YB46Eg==}
dev: false
/@adraffy/ens-normalize@1.9.4:
resolution: {integrity: sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw==}
dev: false
/@ampproject/remapping@2.2.1:
resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==}
engines: {node: '>=6.0.0'}
@@ -979,8 +979,8 @@ packages:
resolution: {integrity: sha512-RpfLEtTlyIxeNPGKcokS+p3BZII/Q3bYxryFRglh5H3A3T8q9fsLYm72VYAMEOOIBLEa8o93kFLiBDUWKrwXZA==}
dev: true
/@dydxprotocol/v4-abacus@0.5.12:
resolution: {integrity: sha512-OigoIjGtp0az1elkP84nc9qKYBVg5Fg4QEJFDn7J7oiUqVvwNggYNfnDsX77D8+K4DJ/rtbi2yZYsDE8OZMSoQ==}
/@dydxprotocol/v4-abacus@0.6.4:
resolution: {integrity: sha512-eH+/9Q/OnQtwzBwM1BJyXybFPdivGmFQWrxM71MFWGs6uIQGbZX775mpoa8deweSTyQ/QrRLRQ1mP2BPDgBQYg==}
dev: false
/@dydxprotocol/v4-client-js@0.36.1:
@@ -1010,8 +1010,8 @@ packages:
- utf-8-validate
dev: false
/@dydxprotocol/v4-localization@0.1.12:
resolution: {integrity: sha512-EiP/8+6Nk9QBa6YSWsyzsZaXoVbz5o/KgUlMp1Cew6VWkXL6DkQY0oMIEEy21pv0zuu/woxhlbyXygpUIcpdMg==}
/@dydxprotocol/v4-localization@0.1.24:
resolution: {integrity: sha512-zSiu8+/6BWNWZXxe73zUp/UjuLG1Cp5UuhXKtbATqqkeZyVCs01QxbBCTs1MLfgsLh02IrfhXCPHvXnzZyReEw==}
dev: false
/@dydxprotocol/v4-proto@0.2.1:
@@ -2032,6 +2032,12 @@ packages:
'@noble/hashes': 1.3.1
dev: false
/@noble/curves@1.2.0:
resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==}
dependencies:
'@noble/hashes': 1.3.2
dev: false
/@noble/ed25519@1.7.3:
resolution: {integrity: sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ==}
dev: true
@@ -2049,6 +2055,11 @@ packages:
engines: {node: '>= 16'}
dev: false
/@noble/hashes@1.3.2:
resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==}
engines: {node: '>= 16'}
dev: false
/@noble/secp256k1@1.7.1:
resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==}
@@ -4647,7 +4658,7 @@ packages:
resolution: {integrity: sha512-gYw0ki/EAuV1oSyMxpqandHjnthZjYYy+YWpTAzf8BqfXM3ItcZLpjxfg+3+mXW8HIO+3jw6T9iiqEXsqHaMMw==}
dependencies:
'@safe-global/safe-gateway-typescript-sdk': 3.9.0
viem: 1.1.6(typescript@5.1.3)
viem: 1.12.2(typescript@5.1.3)
transitivePeerDependencies:
- bufferutil
- encoding
@@ -4660,7 +4671,7 @@ packages:
resolution: {integrity: sha512-XJbEPuaVc7b9n23MqlF6c+ToYIS3f7P2Sel8f3cSBQ9WORE4xrSuvhMpK9fDSFqJ7by/brc+rmJR/5HViRr0/w==}
dependencies:
'@safe-global/safe-gateway-typescript-sdk': 3.9.0
viem: 1.1.6(typescript@5.1.3)
viem: 1.12.2(typescript@5.1.3)
transitivePeerDependencies:
- bufferutil
- encoding
@@ -4681,6 +4692,10 @@ packages:
resolution: {integrity: sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==}
dev: false
/@scure/base@1.1.3:
resolution: {integrity: sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==}
dev: false
/@scure/bip32@1.3.0:
resolution: {integrity: sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q==}
dependencies:
@@ -4697,6 +4712,14 @@ packages:
'@scure/base': 1.1.1
dev: false
/@scure/bip32@1.3.2:
resolution: {integrity: sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==}
dependencies:
'@noble/curves': 1.2.0
'@noble/hashes': 1.3.2
'@scure/base': 1.1.3
dev: false
/@scure/bip39@1.2.0:
resolution: {integrity: sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg==}
dependencies:
@@ -4707,7 +4730,7 @@ packages:
/@scure/bip39@1.2.1:
resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==}
dependencies:
'@noble/hashes': 1.3.1
'@noble/hashes': 1.3.2
'@scure/base': 1.1.1
dev: false
@@ -5408,6 +5431,12 @@ packages:
'@types/node': 20.3.1
dev: false
/@types/ws@8.5.6:
resolution: {integrity: sha512-8B5EO9jLVCy+B58PLHvLDuOD8DRVMgQzq8d55SjLCOn9kqGyqOvy27exVaTio1q1nX5zLu8/6N0n2ThSxOM6tg==}
dependencies:
'@types/node': 20.3.1
dev: false
/@typescript-eslint/eslint-plugin@5.60.0(@typescript-eslint/parser@5.60.0)(eslint@8.43.0)(typescript@5.1.3):
resolution: {integrity: sha512-78B+anHLF1TI8Jn/cD0Q00TBYdMgjdOn980JfAVa9yw5sop8nyTfVOQAv6LWywkOGLclDBtv5z3oxN4w7jxyNg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -5904,17 +5933,6 @@ packages:
pretty-format: 27.5.1
dev: true
/@wagmi/chains@1.2.0(typescript@5.1.3):
resolution: {integrity: sha512-dmDRipsE54JfyudOBkuhEexqQWcrZqxn/qiujG8SBzMh/az/AH5xlJSA+j1CPWTx9+QofSMF3B7A4gb6XRmSaQ==}
peerDependencies:
typescript: '>=5.0.4'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
typescript: 5.1.3
dev: false
/@wagmi/chains@1.4.0(typescript@5.1.3):
resolution: {integrity: sha512-9HwJrhcZ1TxyrCbE10y7s1eSiSiyfGam7AHIOLYExaOX+vpOZ+MNTt4orFEDbEpz1fxwJDPPI38lanAUix1OSA==}
peerDependencies:
@@ -5926,7 +5944,7 @@ packages:
typescript: 5.1.3
dev: false
/@wagmi/connectors@2.6.5(@wagmi/chains@1.4.0)(react@18.2.0)(typescript@5.1.3)(viem@1.1.6):
/@wagmi/connectors@2.6.5(@wagmi/chains@1.4.0)(react@18.2.0)(typescript@5.1.3)(viem@1.12.2):
resolution: {integrity: sha512-klF31togMDd0qQqEcLl5cCGxjMbL0RRXQ8I1vxmEa3KdGzw6Z3ICVzX7/bDfnNEZcOW7BKyAnZDq7rCt5jTOiw==}
peerDependencies:
'@wagmi/chains': '>=1.3.0'
@@ -5950,7 +5968,7 @@ packages:
abitype: 0.8.7(typescript@5.1.3)
eventemitter3: 4.0.7
typescript: 5.1.3
viem: 1.1.6(typescript@5.1.3)
viem: 1.12.2(typescript@5.1.3)
transitivePeerDependencies:
- '@react-native-async-storage/async-storage'
- bufferutil
@@ -5962,7 +5980,7 @@ packages:
- zod
dev: false
/@wagmi/core@1.3.6(@types/react@18.2.14)(react@18.2.0)(typescript@5.1.3)(viem@1.1.6):
/@wagmi/core@1.3.6(@types/react@18.2.14)(react@18.2.0)(typescript@5.1.3)(viem@1.12.2):
resolution: {integrity: sha512-TXv9ZlRR5aySfERFuWMuo+lKXC/CoqtxVJZVHPqhK1jY+nldMx3AvrWzzF4CccRaMYcVdvPFepvmxzq2A2VvWg==}
peerDependencies:
typescript: '>=5.0.4'
@@ -5972,11 +5990,11 @@ packages:
optional: true
dependencies:
'@wagmi/chains': 1.4.0(typescript@5.1.3)
'@wagmi/connectors': 2.6.5(@wagmi/chains@1.4.0)(react@18.2.0)(typescript@5.1.3)(viem@1.1.6)
'@wagmi/connectors': 2.6.5(@wagmi/chains@1.4.0)(react@18.2.0)(typescript@5.1.3)(viem@1.12.2)
abitype: 0.8.7(typescript@5.1.3)
eventemitter3: 4.0.7
typescript: 5.1.3
viem: 1.1.6(typescript@5.1.3)
viem: 1.12.2(typescript@5.1.3)
zustand: 4.4.1(@types/react@18.2.14)(react@18.2.0)
transitivePeerDependencies:
- '@react-native-async-storage/async-storage'
@@ -6677,6 +6695,20 @@ packages:
typescript: 5.1.3
dev: false
/abitype@0.9.8(typescript@5.1.3):
resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==}
peerDependencies:
typescript: '>=5.0.4'
zod: ^3 >=3.19.1
peerDependenciesMeta:
typescript:
optional: true
zod:
optional: true
dependencies:
typescript: 5.1.3
dev: false
/abort-controller@3.0.0:
resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
engines: {node: '>=6.5'}
@@ -9986,12 +10018,12 @@ packages:
ws: 7.5.9
dev: false
/isomorphic-ws@5.0.0(ws@8.12.0):
/isomorphic-ws@5.0.0(ws@8.13.0):
resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==}
peerDependencies:
ws: '*'
dependencies:
ws: 8.12.0
ws: 8.13.0(bufferutil@4.0.7)(utf-8-validate@5.0.10)
dev: false
/it-all@1.0.6:
@@ -13520,21 +13552,24 @@ packages:
vfile-message: 3.1.4
dev: true
/viem@1.1.6(typescript@5.1.3):
resolution: {integrity: sha512-7nK3HMucLr1Yz0QnDXiD6viigKS6QeYD/YhRHpi3Bby/g0hCyZqK8+YJNtp3/Ri64tpl4kaTIeCScJWV2jqXHQ==}
/viem@1.12.2(typescript@5.1.3):
resolution: {integrity: sha512-aCaUCyg72ES+jK4s6tVYOMnOt4if71RwzgiUAUpAuaCgvHFfh9DCnwuEfwkxEZLE2vafOsirgJ3fcn7nsDVQoQ==}
peerDependencies:
typescript: '>=5.0.4'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@adraffy/ens-normalize': 1.9.0
'@noble/curves': 1.0.0
'@noble/hashes': 1.3.0
'@scure/bip32': 1.3.0
'@scure/bip39': 1.2.0
'@wagmi/chains': 1.2.0(typescript@5.1.3)
abitype: 0.8.7(typescript@5.1.3)
isomorphic-ws: 5.0.0(ws@8.12.0)
'@adraffy/ens-normalize': 1.9.4
'@noble/curves': 1.2.0
'@noble/hashes': 1.3.2
'@scure/bip32': 1.3.2
'@scure/bip39': 1.2.1
'@types/ws': 8.5.6
abitype: 0.9.8(typescript@5.1.3)
isomorphic-ws: 5.0.0(ws@8.13.0)
typescript: 5.1.3
ws: 8.12.0
ws: 8.13.0(bufferutil@4.0.7)(utf-8-validate@5.0.10)
transitivePeerDependencies:
- bufferutil
- utf-8-validate
@@ -13702,7 +13737,7 @@ packages:
- supports-color
dev: true
/wagmi@1.3.7(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.3)(viem@1.1.6):
/wagmi@1.3.7(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.3)(viem@1.12.2):
resolution: {integrity: sha512-n4Qwby0QB8/JSGjc0gGn4MWZ0BT229agEg6saPGS6VswmPjJLdkLq9qxKn1JptXxPREmb/ZvwHxU++3Z+gQJVA==}
peerDependencies:
react: '>=17.0.0'
@@ -13715,12 +13750,12 @@ packages:
'@tanstack/query-sync-storage-persister': 4.32.6
'@tanstack/react-query': 4.32.6(react-dom@18.2.0)(react@18.2.0)
'@tanstack/react-query-persist-client': 4.32.6(@tanstack/react-query@4.32.6)
'@wagmi/core': 1.3.6(@types/react@18.2.14)(react@18.2.0)(typescript@5.1.3)(viem@1.1.6)
'@wagmi/core': 1.3.6(@types/react@18.2.14)(react@18.2.0)(typescript@5.1.3)(viem@1.12.2)
abitype: 0.8.7(typescript@5.1.3)
react: 18.2.0
typescript: 5.1.3
use-sync-external-store: 1.2.0(react@18.2.0)
viem: 1.1.6(typescript@5.1.3)
viem: 1.12.2(typescript@5.1.3)
transitivePeerDependencies:
- '@react-native-async-storage/async-storage'
- '@types/react'
@@ -13945,19 +13980,6 @@ packages:
optional: true
dev: false
/ws@8.12.0:
resolution: {integrity: sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: '>=5.0.2'
peerDependenciesMeta:
bufferutil:
optional: true
utf-8-validate:
optional: true
dev: false
/ws@8.13.0(bufferutil@4.0.7)(utf-8-validate@5.0.10):
resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==}
engines: {node: '>=10.0.0'}
+707 -117
View File
@@ -1,31 +1,42 @@
{
"deployments":{
"MAINNET":null,
"TESTNET":{
"environments":[
"deployments": {
"MAINNET": {
"environments": [
"dydxprotocol-mainnet"
],
"default": "dydxprotocol-mainnet"
},
"TESTNET": {
"environments": [
"dydxprotocol-testnet"
],
"default":"dydxprotocol-testnet"
"default": "dydxprotocol-testnet"
},
"DEV":{
"environments":[
"DEV": {
"environments": [
"dydxprotocol-dev",
"dydxprotocol-dev-2",
"dydxprotocol-dev-4",
"dydxprotocol-dev-5",
"dydxprotocol-staging",
"dydxprotocol-testnet"
"dydxprotocol-staging-west",
"dydxprotocol-testnet",
"dydxprotocol-testnet-dydx",
"dydxprotocol-testnet-dsrv",
"dydxprotocol-testnet-nodefleet",
"dydxprotocol-testnet-kingnodes",
"dydxprotocol-testnet-liquify"
],
"default":"dydxprotocol-testnet"
"default": "dydxprotocol-testnet"
}
},
"environments":{
"dydxprotocol-dev":{
"name":"v4 Dev",
"ethereumChainId":"5",
"dydxChainId":"dydxprotocol-testnet",
"isMainNet":false,
"tokens":{
"environments": {
"dydxprotocol-dev": {
"name": "v4 Dev",
"ethereumChainId": "5",
"dydxChainId": "dydxprotocol-testnet",
"isMainNet": false,
"tokens": {
"chain": {
"name": "DYDX",
"denom": "dv4tnt",
@@ -34,34 +45,57 @@
"usdc": {
"name": "USDC",
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"gasDenom": "uusdc",
"image": "/currencies/usdc.png"
}
},
"endpoints":{
"indexers":[
"endpoints": {
"indexers": [
{
"api":"http://indexer.v4dev.dydx.exchange",
"socket":"wss://indexer.v4dev.dydx.exchange"
"api": "http://indexer.v4dev.dydx.exchange",
"socket": "wss://indexer.v4dev.dydx.exchange"
}
],
"validators":[
"validators": [
"http://validator.v4dev.dydx.exchange"
],
"0xsquid":"https://testnet.api.0xsquid.com",
"faucet":"http://faucet.v4dev.dydx.exchange"
"0xsquid": "https://testnet.api.0xsquid.com",
"faucet": "http://faucet.v4dev.dydx.exchange"
},
"links":{
"tos":"https://dydx.exchange/v4-terms",
"privacy":"https://dydx.exchange/privacy",
"mintscan":"https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}"
"links": {
"tos": "https://dydx.exchange/v4-terms",
"privacy": "https://dydx.exchange/privacy",
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
"blogs": "https://www.dydx.foundation/blog"
},
"wallets": {
"walletconnect": {
"client": {
"name": "dYdX v4",
"description": "dYdX v4 App",
"iconUrl": "/logos/dydx-x.png"
},
"v1": {
"bridgeUrl": "wss://api.stage.dydx.exchange/wc/"
},
"v2": {
"projectId": "47559b2ec96c09aed9ff2cb54a31ab0e"
}
},
"walletSegue": {
"callbackUrl": "/walletsegue"
},
"images": "/wallets/",
"signTypedDataAction": "dYdX Chain Onboarding",
"signTypedDataDomainName": "dYdX Chain"
}
},
"dydxprotocol-dev-2":{
"name":"v4 Dev 2",
"ethereumChainId":"5",
"dydxChainId":"dydxprotocol-testnet",
"isMainNet":false,
"tokens":{
"dydxprotocol-dev-2": {
"name": "v4 Dev 2",
"ethereumChainId": "5",
"dydxChainId": "dydxprotocol-testnet",
"isMainNet": false,
"tokens": {
"chain": {
"name": "DYDX",
"denom": "dv4tnt",
@@ -70,33 +104,56 @@
"usdc": {
"name": "USDC",
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"gasDenom": "uusdc",
"image": "/currencies/usdc.png"
}
},
"endpoints":{
"indexers":[
"endpoints": {
"indexers": [
{
"api":"http://dev2-indexer-apne1-lb-public-2076363889.ap-northeast-1.elb.amazonaws.com",
"socket":"ws://dev2-indexer-apne1-lb-public-2076363889.ap-northeast-1.elb.amazonaws.com"
"api": "http://dev2-indexer-apne1-lb-public-2076363889.ap-northeast-1.elb.amazonaws.com",
"socket": "ws://dev2-indexer-apne1-lb-public-2076363889.ap-northeast-1.elb.amazonaws.com"
}
],
"validators":[
"validators": [
"http://35.75.227.118"
],
"0xsquid":"https://testnet.api.0xsquid.com"
"0xsquid": "https://testnet.api.0xsquid.com"
},
"links":{
"tos":"https://dydx.exchange/v4-terms",
"privacy":"https://dydx.exchange/privacy",
"mintscan":"https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}"
"links": {
"tos": "https://dydx.exchange/v4-terms",
"privacy": "https://dydx.exchange/privacy",
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
"blogs": "https://www.dydx.foundation/blog"
},
"wallets": {
"walletconnect": {
"client": {
"name": "dYdX v4",
"description": "dYdX v4 App",
"iconUrl": "/logos/dydx-x.png"
},
"v1": {
"bridgeUrl": "wss://api.stage.dydx.exchange/wc/"
},
"v2": {
"projectId": "47559b2ec96c09aed9ff2cb54a31ab0e"
}
},
"walletSegue": {
"callbackUrl": "/walletsegue"
},
"images": "/wallets/",
"signTypedDataAction": "dYdX Chain Onboarding",
"signTypedDataDomainName": "dYdX Chain"
}
},
"dydxprotocol-dev-4":{
"name":"v4 Dev 4",
"ethereumChainId":"5",
"dydxChainId":"dydxprotocol-testnet",
"isMainNet":false,
"tokens":{
"dydxprotocol-dev-4": {
"name": "v4 Dev 4",
"ethereumChainId": "5",
"dydxChainId": "dydxprotocol-testnet",
"isMainNet": false,
"tokens": {
"chain": {
"name": "DYDX",
"denom": "dv4tnt",
@@ -105,33 +162,56 @@
"usdc": {
"name": "USDC",
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"gasDenom": "uusdc",
"image": "/currencies/usdc.png"
}
},
"endpoints":{
"indexers":[
"endpoints": {
"indexers": [
{
"api":"http://indexer.v4dev4.dydx.exchange",
"socket":"ws://indexer.v4dev4.dydx.exchange"
"api": "http://indexer.v4dev4.dydx.exchange",
"socket": "ws://indexer.v4dev4.dydx.exchange"
}
],
"validators":[
"validators": [
"http://validator.v4dev4.dydx.exchange"
],
"0xsquid":"https://testnet.api.0xsquid.com"
"0xsquid": "https://testnet.api.0xsquid.com"
},
"links":{
"tos":"https://dydx.exchange/v4-terms",
"privacy":"https://dydx.exchange/privacy",
"mintscan":"https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}"
"links": {
"tos": "https://dydx.exchange/v4-terms",
"privacy": "https://dydx.exchange/privacy",
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
"blogs": "https://www.dydx.foundation/blog"
},
"wallets": {
"walletconnect": {
"client": {
"name": "dYdX v4",
"description": "dYdX v4 App",
"iconUrl": "/logos/dydx-x.png"
},
"v1": {
"bridgeUrl": "wss://api.stage.dydx.exchange/wc/"
},
"v2": {
"projectId": "47559b2ec96c09aed9ff2cb54a31ab0e"
}
},
"walletSegue": {
"callbackUrl": "/walletsegue"
},
"images": "/wallets/",
"signTypedDataAction": "dYdX Chain Onboarding",
"signTypedDataDomainName": "dYdX Chain"
}
},
"dydxprotocol-dev-5":{
"name":"v4 Dev 5",
"ethereumChainId":"5",
"dydxChainId":"dydxprotocol-testnet",
"isMainNet":false,
"tokens":{
"dydxprotocol-dev-5": {
"name": "v4 Dev 5",
"ethereumChainId": "5",
"dydxChainId": "dydxprotocol-testnet",
"isMainNet": false,
"tokens": {
"chain": {
"name": "DYDX",
"denom": "dv4tnt",
@@ -140,33 +220,56 @@
"usdc": {
"name": "USDC",
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"gasDenom": "uusdc",
"image": "/currencies/usdc.png"
}
},
"endpoints":{
"indexers":[
"endpoints": {
"indexers": [
{
"api":"http://dev5-indexer-apne1-lb-public-1721328151.ap-northeast-1.elb.amazonaws.com",
"socket":"ws://dev5-indexer-apne1-lb-public-1721328151.ap-northeast-1.elb.amazonaws.com"
"api": "http://dev5-indexer-apne1-lb-public-1721328151.ap-northeast-1.elb.amazonaws.com",
"socket": "ws://dev5-indexer-apne1-lb-public-1721328151.ap-northeast-1.elb.amazonaws.com"
}
],
"validators":[
"validators": [
"http://18.223.78.50"
],
"0xsquid":"https://testnet.api.0xsquid.com"
"0xsquid": "https://testnet.api.0xsquid.com"
},
"links":{
"tos":"https://dydx.exchange/v4-terms",
"privacy":"https://dydx.exchange/privacy",
"mintscan":"https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}"
"links": {
"tos": "https://dydx.exchange/v4-terms",
"privacy": "https://dydx.exchange/privacy",
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
"blogs": "https://www.dydx.foundation/blog"
},
"wallets": {
"walletconnect": {
"client": {
"name": "dYdX v4",
"description": "dYdX v4 App",
"iconUrl": "/logos/dydx-x.png"
},
"v1": {
"bridgeUrl": "wss://api.stage.dydx.exchange/wc/"
},
"v2": {
"projectId": "47559b2ec96c09aed9ff2cb54a31ab0e"
}
},
"walletSegue": {
"callbackUrl": "/walletsegue"
},
"images": "/wallets/",
"signTypedDataAction": "dYdX Chain Onboarding",
"signTypedDataDomainName": "dYdX Chain"
}
},
"dydxprotocol-staging":{
"name":"v4 Staging",
"ethereumChainId":"5",
"dydxChainId":"dydxprotocol-testnet",
"isMainNet":false,
"tokens":{
"dydxprotocol-staging": {
"name": "v4 Staging",
"ethereumChainId": "5",
"dydxChainId": "dydxprotocol-testnet",
"isMainNet": false,
"tokens": {
"chain": {
"name": "DYDX",
"denom": "dv4tnt",
@@ -175,37 +278,60 @@
"usdc": {
"name": "USDC",
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"gasDenom": "uusdc",
"image": "/currencies/usdc.png"
}
},
"endpoints":{
"indexers":[
"endpoints": {
"indexers": [
{
"api":"https://indexer.v4staging.dydx.exchange",
"socket":"wss://indexer.v4staging.dydx.exchange"
"api": "https://indexer.v4staging.dydx.exchange",
"socket": "wss://indexer.v4staging.dydx.exchange"
}
],
"faucet":"https://faucet.v4staging.dydx.exchange",
"validators":[
"faucet": "https://faucet.v4staging.dydx.exchange",
"validators": [
"https://validator.v4staging.dydx.exchange"
],
"0xsquid":"https://squid-api-git-main-cosmos-testnet-0xsquid.vercel.app"
"0xsquid": "https://testnet.api.squidrouter.com"
},
"links":{
"tos":"https://dydx.exchange/v4-terms",
"privacy":"https://dydx.exchange/privacy",
"mintscan":"https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
"documentation":"https://v4-teacher.vercel.app/",
"community":"https://discord.com/invite/dydx",
"feedback":"https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform"
"links": {
"tos": "https://dydx.exchange/v4-terms",
"privacy": "https://dydx.exchange/privacy",
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
"documentation": "https://v4-teacher.vercel.app/",
"community": "https://discord.com/invite/dydx",
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
"blogs": "https://www.dydx.foundation/blog"
},
"wallets": {
"walletconnect": {
"client": {
"name": "dYdX v4",
"description": "dYdX v4 App",
"iconUrl": "/logos/dydx-x.png"
},
"v1": {
"bridgeUrl": "wss://api.stage.dydx.exchange/wc/"
},
"v2": {
"projectId": "47559b2ec96c09aed9ff2cb54a31ab0e"
}
},
"walletSegue": {
"callbackUrl": "/walletsegue"
},
"images": "/wallets/",
"signTypedDataAction": "dYdX Chain Onboarding",
"signTypedDataDomainName": "dYdX Chain"
}
},
"dydxprotocol-testnet":{
"name":"v4 Public Testnet",
"ethereumChainId":"5",
"dydxChainId":"dydx-testnet-3",
"isMainNet":false,
"tokens":{
"dydxprotocol-staging-west": {
"name": "v4 Staging West",
"ethereumChainId": "5",
"dydxChainId": "dydxprotocol-testnet",
"isMainNet": false,
"tokens": {
"chain": {
"name": "DYDX",
"denom": "dv4tnt",
@@ -214,30 +340,494 @@
"usdc": {
"name": "USDC",
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"gasDenom": "uusdc",
"image": "/currencies/usdc.png"
}
},
"endpoints":{
"indexers":[
"endpoints": {
"indexers": [
{
"api":"https://dydx-testnet.imperator.co",
"socket":"wss://dydx-testnet.imperator.co"
"api": "https://indexer.v4staging.dydx.exchange",
"socket": "wss://indexer.v4staging.dydx.exchange"
}
],
"validators":[
"https://dydx-testnet.nodefleet.org",
"https://test-dydx.kingnodes.com/"
"faucet": "https://faucet.v4staging.dydx.exchange",
"validators": [
"https://validator-uswest1.v4staging.dydx.exchange"
],
"0xsquid":"https://squid-api-git-main-cosmos-testnet-0xsquid.vercel.app",
"faucet":"https://faucet.v4testnet.dydx.exchange"
"0xsquid": "https://testnet.api.squidrouter.com"
},
"links":{
"tos":"https://dydx.exchange/v4-terms",
"privacy":"https://dydx.exchange/privacy",
"mintscan":"https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
"documentation":"https://v4-teacher.vercel.app/",
"community":"https://discord.com/invite/dydx",
"feedback":"https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform"
"links": {
"tos": "https://dydx.exchange/v4-terms",
"privacy": "https://dydx.exchange/privacy",
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
"documentation": "https://v4-teacher.vercel.app/",
"community": "https://discord.com/invite/dydx",
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
"blogs": "https://www.dydx.foundation/blog"
},
"wallets": {
"walletconnect": {
"client": {
"name": "dYdX v4",
"description": "dYdX v4 App",
"iconUrl": "/logos/dydx-x.png"
},
"v1": {
"bridgeUrl": "wss://api.stage.dydx.exchange/wc/"
},
"v2": {
"projectId": "47559b2ec96c09aed9ff2cb54a31ab0e"
}
},
"walletSegue": {
"callbackUrl": "/walletsegue"
},
"images": "/wallets/",
"signTypedDataAction": "dYdX Chain Onboarding",
"signTypedDataDomainName": "dYdX Chain"
}
},
"dydxprotocol-testnet": {
"name": "v4 Public Testnet",
"ethereumChainId": "5",
"dydxChainId": "dydx-testnet-3",
"isMainNet": false,
"tokens": {
"chain": {
"name": "DYDX",
"denom": "dv4tnt",
"image": "/currencies/dydx.png"
},
"usdc": {
"name": "USDC",
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"gasDenom": "uusdc",
"image": "/currencies/usdc.png"
}
},
"endpoints": {
"indexers": [
{
"api": "https://dydx-testnet.imperator.co",
"socket": "wss://dydx-testnet.imperator.co"
}
],
"validators": [
"https://dydx-testnet.nodefleet.org",
"https://test-dydx.kingnodes.com",
"https://dydx-rpc.liquify.com/api=8878132/dydx"
],
"0xsquid": "https://testnet.api.squidrouter.com",
"faucet": "https://faucet.v4testnet.dydx.exchange"
},
"links": {
"tos": "https://dydx.exchange/v4-terms",
"privacy": "https://dydx.exchange/privacy",
"mintscan": "https://testnet.mintscan.io/dydx-testnet/txs/{tx_hash}",
"documentation": "https://v4-teacher.vercel.app/",
"community": "https://discord.com/invite/dydx",
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
"blogs": "https://www.dydx.foundation/blog"
},
"wallets": {
"walletconnect": {
"client": {
"name": "dYdX v4",
"description": "dYdX v4 App",
"iconUrl": "/logos/dydx-x.png"
},
"v1": {
"bridgeUrl": "wss://api.stage.dydx.exchange/wc/"
},
"v2": {
"projectId": "47559b2ec96c09aed9ff2cb54a31ab0e"
}
},
"walletSegue": {
"callbackUrl": "/walletsegue"
},
"images": "/wallets/",
"signTypedDataAction": "dYdX V4 Onboarding",
"signTypedDataDomainName": "dYdX V4"
}
},
"dydxprotocol-testnet-dydx": {
"name": "v4 Public Testnet/dYdX",
"ethereumChainId": "5",
"dydxChainId": "dydx-testnet-3",
"isMainNet": false,
"tokens": {
"chain": {
"name": "DYDX",
"denom": "dv4tnt",
"image": "/currencies/dydx.png"
},
"usdc": {
"name": "USDC",
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"gasDenom": "uusdc",
"image": "/currencies/usdc.png"
}
},
"endpoints": {
"indexers": [
{
"api": "https://indexer.v4testnet.dydx.exchange",
"socket": "wss://indexer.v4testnet.dydx.exchange"
}
],
"validators": [
"https://validator.v4testnet.dydx.exchange"
],
"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": {
"walletconnect": {
"client": {
"name": "dYdX v4",
"description": "dYdX v4 App",
"iconUrl": "/logos/dydx-x.png"
},
"v1": {
"bridgeUrl": "wss://api.stage.dydx.exchange/wc/"
},
"v2": {
"projectId": "47559b2ec96c09aed9ff2cb54a31ab0e"
}
},
"walletSegue": {
"callbackUrl": "/walletsegue"
},
"images": "/wallets/",
"signTypedDataAction": "dYdX V4 Onboarding",
"signTypedDataDomainName": "dYdX V4"
}
},
"dydxprotocol-testnet-dsrv": {
"name": "v4 Public Testnet/DSRV",
"ethereumChainId": "5",
"dydxChainId": "dydx-testnet-3",
"isMainNet": false,
"tokens": {
"chain": {
"name": "DYDX",
"denom": "dv4tnt",
"image": "/currencies/dydx.png"
},
"usdc": {
"name": "USDC",
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"gasDenom": "uusdc",
"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": {
"walletconnect": {
"client": {
"name": "dYdX v4",
"description": "dYdX v4 App",
"iconUrl": "/logos/dydx-x.png"
},
"v1": {
"bridgeUrl": "wss://api.stage.dydx.exchange/wc/"
},
"v2": {
"projectId": "47559b2ec96c09aed9ff2cb54a31ab0e"
}
},
"walletSegue": {
"callbackUrl": "/walletsegue"
},
"images": "/wallets/",
"signTypedDataAction": "dYdX V4 Onboarding",
"signTypedDataDomainName": "dYdX V4"
}
},
"dydxprotocol-testnet-nodefleet": {
"name": "v4 Public Testnet/nodefleet",
"ethereumChainId": "5",
"dydxChainId": "dydx-testnet-3",
"isMainNet": false,
"tokens": {
"chain": {
"name": "DYDX",
"denom": "dv4tnt",
"image": "/currencies/dydx.png"
},
"usdc": {
"name": "USDC",
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"gasDenom": "uusdc",
"image": "/currencies/usdc.png"
}
},
"endpoints": {
"indexers": [
{
"api": "https://dydx-testnet.imperator.co",
"socket": "wss://dydx-testnet.imperator.co"
}
],
"validators": [
"https://dydx-testnet.nodefleet.org"
],
"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": {
"walletconnect": {
"client": {
"name": "dYdX v4",
"description": "dYdX v4 App",
"iconUrl": "/logos/dydx-x.png"
},
"v1": {
"bridgeUrl": "wss://api.stage.dydx.exchange/wc/"
},
"v2": {
"projectId": "47559b2ec96c09aed9ff2cb54a31ab0e"
}
},
"walletSegue": {
"callbackUrl": "/walletsegue"
},
"images": "/wallets/",
"signTypedDataAction": "dYdX V4 Onboarding",
"signTypedDataDomainName": "dYdX V4"
}
},
"dydxprotocol-testnet-kingnodes": {
"name": "v4 Public Testnet/KingNodes",
"ethereumChainId": "5",
"dydxChainId": "dydx-testnet-3",
"isMainNet": false,
"tokens": {
"chain": {
"name": "DYDX",
"denom": "dv4tnt",
"image": "/currencies/dydx.png"
},
"usdc": {
"name": "USDC",
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"gasDenom": "uusdc",
"image": "/currencies/usdc.png"
}
},
"endpoints": {
"indexers": [
{
"api": "https://dydx-testnet.imperator.co",
"socket": "wss://dydx-testnet.imperator.co"
}
],
"validators": [
"https://test-dydx.kingnodes.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://v4-teacher.vercel.app/",
"community": "https://discord.com/invite/dydx",
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
"blogs": "https://www.dydx.foundation/blog"
},
"wallets": {
"walletconnect": {
"client": {
"name": "dYdX v4",
"description": "dYdX v4 App",
"iconUrl": "/logos/dydx-x.png"
},
"v1": {
"bridgeUrl": "wss://api.stage.dydx.exchange/wc/"
},
"v2": {
"projectId": "47559b2ec96c09aed9ff2cb54a31ab0e"
}
},
"walletSegue": {
"callbackUrl": "/walletsegue"
},
"images": "/wallets/",
"signTypedDataAction": "dYdX V4 Onboarding",
"signTypedDataDomainName": "dYdX V4"
}
},
"dydxprotocol-testnet-liquify": {
"name": "v4 Public Testnet/Liquify",
"ethereumChainId": "5",
"dydxChainId": "dydx-testnet-3",
"isMainNet": false,
"tokens": {
"chain": {
"name": "DYDX",
"denom": "dv4tnt",
"image": "/currencies/dydx.png"
},
"usdc": {
"name": "USDC",
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"gasDenom": "uusdc",
"image": "/currencies/usdc.png"
}
},
"endpoints": {
"indexers": [
{
"api": "https://dydx-testnet.imperator.co",
"socket": "wss://dydx-testnet.imperator.co"
}
],
"validators": [
"https://dydx-rpc.liquify.com/api=8878132/dydx"
],
"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": {
"walletconnect": {
"client": {
"name": "dYdX v4",
"description": "dYdX v4 App",
"iconUrl": "/logos/dydx-x.png"
},
"v1": {
"bridgeUrl": "wss://api.stage.dydx.exchange/wc/"
},
"v2": {
"projectId": "47559b2ec96c09aed9ff2cb54a31ab0e"
}
},
"walletSegue": {
"callbackUrl": "/walletsegue"
},
"images": "/wallets/",
"signTypedDataAction": "dYdX V4 Onboarding",
"signTypedDataDomainName": "dYdX V4"
}
},
"dydxprotocol-mainet": {
"name": "v4",
"ethereumChainId": "1",
"dydxChainId": "[mainnet chain id]",
"isMainNet": true,
"tokens": {
"comment": "Change according to mainnet release",
"chain": {
"name": "DYDX",
"denom": "dv4tnt",
"image": "/currencies/dydx.png"
},
"usdc": {
"name": "USDC",
"denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"gasDenom": "uusdc",
"image": "/currencies/usdc.png"
}
},
"endpoints": {
"indexers": [
{
"api": "[REST endpoint]",
"socket": "[Websocket endpoint]"
}
],
"validators": [
"[Validator endpoint 1",
"[Validator endpoint n]"
],
"0xsquid": "[0xSquid endpoint for mainnet]"
},
"links": {
"tos": "[HTTP link to TOS]",
"privacy": "[HTTP link to Privacy Policy]",
"mintscan": "[HTTP link to Mintscan, with {tx_hash} placeholder]",
"documentation": "[HTTP link to documentation, can be null]",
"community": "[HTTP link to community, can be null]",
"feedback": "[HTTP link to feedback form, can be null]",
"blogs": "[HTTP link to blogs, can be null]"
},
"wallets": {
"walletconnect": {
"client": {
"name": "[Name of the app]",
"description": "[Description of the app]",
"iconUrl": "[Relative URL of the icon URL]"
},
"v1": {
"bridgeUrl": "[Bridge URL]"
},
"v2": {
"projectId": "[Project ID]"
}
},
"walletSegue": {
"callbackUrl": "[Relative callback URL for WalletSegue, should match apple-app-site-association]"
},
"images": "[Relative URL for wallet images]",
"signTypedDataAction": "dYdX Chain Onboarding",
"signTypedDataDomainName": "dYdX Chain"
}
}
}
+474
View File
@@ -0,0 +1,474 @@
[
{
"id":"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",
"name":"MetaMask",
"description":"",
"homepage":"https://metamask.io/",
"chains":[
"eip155:1",
"eip155:42161",
"eip155:43114"
],
"versions":[
"1"
],
"app":{
"browser":"",
"ios":"https://apps.apple.com/us/app/metamask/id1438144202",
"android":"https://play.google.com/store/apps/details?id=io.metamask",
"mac":"",
"windows":"",
"linux":""
},
"mobile":{
"native":"metamask:",
"universal":"https://metamask.app.link"
},
"desktop":{
"native":"",
"universal":""
},
"metadata":{
"shortName":"MetaMask",
"colors":{
"primary":"rgb(255, 255, 255)",
"secondary":""
}
},
"config":{
"comment":"MetaMask",
"iosMinVersion":"0",
"imageUrl":"https://v4.testnet.dydx.exchange/wallets/metamask.png",
"image":"metamask.png",
"encoding":"=\"#%/<>?@\\^`{|}:&",
"connections":[
{
"type":"walletConnectV2",
"native":"metamask:",
"universal":"https://metamask.app.link"
}
]
},
"userFields":{
"analyticEvent":"METAMASK"
}
},
{
"id":"coinbase-wallet",
"name":"Coinbase Wallet",
"description":"",
"homepage":"https://www.coinbase.com/wallet",
"chains":[
"eip155:1"
],
"versions":[
"1"
],
"app":{
"browser":"",
"ios":"https://apps.apple.com/us/app/coinbase-wallet-nfts-crypto/id1278383455",
"android":"https://play.google.com/store/apps/details?id=org.toshi",
"mac":"",
"windows":"",
"linux":""
},
"mobile":{
"native":"cbwallet:",
"universal":""
},
"desktop":{
"native":"",
"universal":""
},
"metadata":{
"shortName":"Coinbase",
"colors":{
"primary":"rgb(255, 255, 255)",
"secondary":""
}
},
"config":{
"comment":"Coinbase",
"iosMinVersion":"1.8.0",
"imageUrl":"https://v4.testnet.dydx.exchange/wallets/coinbase-wallet.png",
"image":"coinbase-wallet.png",
"encoding":"=\"#%/<>?@\\^`{|}:&",
"connections":[
{
"type":"walletSegue",
"native":"cbwallet:",
"universal":""
}
]
},
"userFields":{
"analyticEvent":"COINBASE_WALLET"
}
},
{
"id":"9d373b43ad4d2cf190fb1a774ec964a1addf406d6fd24af94ab7596e58c291b2",
"name":"imToken",
"description":"",
"homepage":"https://token.im/",
"chains":[
"eip155:1"
],
"versions":[
"1"
],
"app":{
"browser":"",
"ios":"https://itunes.apple.com/us/app/imtoken2/id1384798940",
"android":"https://play.google.com/store/apps/details?id=im.token.app",
"mac":"",
"windows":"",
"linux":""
},
"mobile":{
"native":"imtokenv2:",
"universal":""
},
"desktop":{
"native":"",
"universal":""
},
"metadata":{
"shortName":"imToken",
"colors":{
"primary":"rgb(255, 255, 255)",
"secondary":""
}
},
"config":{
"comment":"imToken",
"iosMinVersion":"0",
"imageUrl":"https://v4.testnet.dydx.exchange/wallets/imtoken.png",
"image":"imtoken.png",
"connections":[
{
"type":"walletConnect",
"native":"imtokenv2:",
"universal":""
}
]
},
"userFields":{
"analyticEvent":"IMTOKEN"
}
},
{
"id":"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",
"name":"Trust Wallet",
"description":"",
"homepage":"https://trustwallet.com/",
"chains":[
"eip155:1",
"eip155:42161",
"eip155:43114"
],
"versions":[
"1"
],
"app":{
"browser":"",
"ios":"https://apps.apple.com/app/apple-store/id1288339409",
"android":"https://play.google.com/store/apps/details?id=com.wallet.crypto.trustapp",
"mac":"",
"windows":"",
"linux":""
},
"mobile":{
"native":"trust:",
"universal":"https://link.trustwallet.com"
},
"desktop":{
"native":"",
"universal":""
},
"metadata":{
"shortName":"Trust",
"colors":{
"primary":"rgb(51, 117, 187)",
"secondary":""
}
},
"config":{
"comment":"Trust Wallet",
"iosMinVersion":"0",
"encoding":"=\"#%/<>?@\\^`{|}:&",
"imageUrl":"https://v4.testnet.dydx.exchange/wallets/trust-wallet.png",
"image":"trust-wallet.png",
"connections":[
{
"type":"walletConnectV2",
"native":"trust:",
"universal":"https://link.trustwallet.com"
}
]
},
"userFields":{
"analyticEvent":"TRUST_WALLET"
}
},
{
"id":"Zerion",
"name":"Zerion",
"description":"",
"homepage":"https://zerion.io/",
"chains":[
"eip155:1"
],
"versions":[
"1"
],
"app":{
"browser":"",
"ios":"https://apps.apple.com/app/apple-store/id1456732565",
"android":"https://play.google.com/store/apps/details?id=io.zerion.android",
"mac":"",
"windows":"",
"linux":""
},
"mobile":{
"native":"zerion:",
"universal":""
},
"desktop":{
"native":"",
"universal":""
},
"metadata":{
"shortName":"Zerion",
"colors":{
"primary":"rgb(51, 117, 187)",
"secondary":""
}
},
"config":{
"comment":"Zerion Wallet",
"iosMinVersion":"0",
"encoding":"=\"#%/<>?@\\^`{|}:&",
"imageUrl":"https://v4.testnet.dydx.exchange/wallets/zerion.png",
"image":"zerion.png",
"connections":[
{
"type":"walletConnectV2",
"native":"zerion:",
"universal":""
}
]
},
"userFields":{
"analyticEvent":"ZERION"
}
},
{
"id":"20459438007b75f4f4acb98bf29aa3b800550309646d375da5fd4aac6c2a2c66",
"name":"TokenPocket",
"description":"",
"homepage":"https://tokenpocket.pro/",
"chains":[
"eip155:1"
],
"versions":[
"1"
],
"app":{
"browser":"",
"ios":"https://apps.apple.com/us/app/tokenpocket-trusted-wallet/id1436028697",
"android":"https://play.google.com/store/apps/details?id=vip.mytokenpocket",
"mac":"",
"windows":"",
"linux":""
},
"mobile":{
"native":"tpoutside:",
"universal":""
},
"desktop":{
"native":"",
"universal":""
},
"metadata":{
"shortName":"TokenPocket",
"colors":{
"primary":"rgb(41, 128, 254)",
"secondary":""
}
},
"config":{
"comment":"TokenPocket",
"iosMinVersion":"0",
"imageUrl":"https://v4.testnet.dydx.exchange/wallets/tokenpocket.png",
"image":"tokenpocket.png",
"connections":[
{
"type":"walletConnect",
"native":"tpoutside:",
"universal":""
}
]
},
"userFields":{
"analyticEvent":"TOKEN_POCKET"
}
},
{
"id":"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",
"name":"Rainbow",
"description":"",
"homepage":"https://rainbow.me/",
"chains":[
"eip155:1"
],
"versions":[
"1"
],
"app":{
"browser":"",
"ios":"https://apps.apple.com/us/app/rainbow-ethereum-wallet/id1457119021",
"android":"",
"mac":"",
"windows":"",
"linux":""
},
"mobile":{
"native":"rainbow:",
"universal":"https://rnbwapp.com"
},
"desktop":{
"native":"",
"universal":""
},
"metadata":{
"shortName":"Rainbow",
"colors":{
"primary":"rgb(0, 30, 89)",
"secondary":""
}
},
"config":{
"comment":"Rainbow",
"iosMinVersion":"0",
"encoding":"=\"#%/<>?@\\^`{|}:&",
"backlinked":true,
"imageUrl":"https://v4.testnet.dydx.exchange/wallets/rainbow-wallet.png",
"image":"rainbow-wallet.png",
"connections":[
{
"type":"walletConnectV2",
"native":"rainbow:",
"universal":"https://rnbwapp.com"
}
]
},
"userFields":{
"analyticEvent":"RAINBOW_WALLET"
}
},
{
"id":"09102e7bbbd3f92001eda104abe23803181629f695e8f1b95af96d88ff7d5890",
"name":"1inch Wallet",
"description":"",
"homepage":"https://1inch.io/wallet/",
"chains":[
"eip155:1",
"eip155:56"
],
"versions":[
"1"
],
"app":{
"browser":"",
"ios":"https://apps.apple.com/us/app/1inch-defi-wallet/id1546049391",
"android":"",
"mac":"",
"windows":"",
"linux":""
},
"mobile":{
"native":"oneinch:",
"universal":"https://wallet.1inch.io"
},
"desktop":{
"native":"",
"universal":""
},
"metadata":{
"shortName":"1inch",
"colors":{
"primary":"rgb(31, 36, 46)",
"secondary":""
}
},
"config":{
"comment":"1inch",
"iosMinVersion":"0",
"encoding":"=\"#%/<>?@\\^`{|}:&",
"imageUrl":"https://v4.testnet.dydx.exchange/wallets/1inch.png",
"image":"1inch.png",
"connections":[
{
"type":"walletConnect",
"native":"oneinch:",
"universal":"https://wallet.1inch.io"
}
]
},
"userFields":{
"analyticEvent":"1INCH"
}
},
{
"id":"bae74827272509a6d63ea25514d9c68ad235c14e45e183518c7ded4572a1b0c4",
"name":"Huobi Wallet",
"description":"",
"homepage":"https://huobiwallet.com/",
"chains":[
"eip155:1"
],
"versions":[
"1"
],
"app":{
"browser":"",
"ios":"https://apps.apple.com/us/app/id1433883012",
"android":"https://play.google.com/store/apps/details?id=com.huobionchainwallet.gp",
"mac":"",
"windows":"",
"linux":""
},
"mobile":{
"native":"huobiwallet:",
"universal":""
},
"desktop":{
"native":"",
"universal":""
},
"metadata":{
"shortName":"Huobi",
"colors":{
"primary":"rgb(45,101,248)",
"secondary":""
}
},
"config":{
"comment":"Huobi",
"iosMinVersion":"0",
"encoding":"=\"#%/<>?@\\^`{|}:&",
"imageUrl":"https://v4.testnet.dydx.exchange/wallets/huobi-wallet.png",
"image":"huobi-wallet.png",
"connections":[
{
"type":"walletConnect",
"native":"huobiwallet:",
"universal":""
}
]
},
"userFields":{
"analyticEvent":"HUOBI_WALLET"
}
}
]
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
source="dist/.well-known/apple-app-site-association"
if [ ! -f "$source" ]; then
echo "Error: $source file not found"
exit 1
fi
app_id=$IOS_APP_ID
if [ -z "$app_id" ]; then
echo "Error: IOS_APP_ID is empty"
exit 1
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s/{PLACE_YOUR_APP_ID_HERE}/$app_id/g" $source
else
sed -i "s/{PLACE_YOUR_APP_ID_HERE}/$app_id/g" $source
fi
+2 -4
View File
@@ -67,9 +67,7 @@ const Content = () => {
<Route path={AppRoute.Trade} element={<TradePage />} />
</Route>
<Route path={AppRoute.Markets} element={<MarketsPage />} />
{import.meta.env.MODE !== 'production' && (
<Route path={AppRoute.Rewards} element={<RewardsPage />} />
)}
<Route path={AppRoute.Rewards} element={<RewardsPage />} />
{isTablet && (
<>
<Route path={AppRoute.Alerts} element={<AlertsPage />} />
@@ -197,7 +195,7 @@ Styled.NotificationsToastArea = styled(NotificationsToastArea)`
Styled.DialogArea = styled.aside`
position: fixed;
height: 100vh;
height: 100%;
z-index: 1;
inset: 0;
overflow: clip;
+3 -3
View File
@@ -12,7 +12,7 @@ type ElementProps = {
};
children: React.ReactNode;
href?: string;
onClick?: () => void;
onClick?: (e: MouseEvent) => void;
withIcon?: boolean;
};
@@ -37,12 +37,12 @@ export const Link = forwardRef<HTMLAnchorElement, ElementProps & StyleProps>(
ref={ref}
className={className}
href={href}
onClick={() => {
onClick={(e: MouseEvent) => {
if (analyticsConfig) {
console.log(analyticsConfig);
}
onClick?.();
onClick?.(e);
}}
rel="noopener noreferrer"
target="_blank"
+3 -1
View File
@@ -11,6 +11,7 @@ type PanelProps = {
children?: React.ReactNode;
href?: string;
onHeaderClick?: () => void;
onClick?: () => void;
};
type PanelStyleProps = {
@@ -24,10 +25,11 @@ export const Panel = ({
children,
href,
onHeaderClick,
onClick,
hasSeparator,
className,
}: PanelProps & PanelStyleProps) => (
<Styled.Panel>
<Styled.Panel onClick={onClick}>
{href ? (
<Link to={href}>
{slotHeader ? (
+1 -1
View File
@@ -24,7 +24,7 @@ export const MarketTableCell = ({
slotLeft={
<>
{showFavorite && <Icon iconName={IconName.Star} />}
<Styled.AssetIcon symbol={asset?.symbol} />
<Styled.AssetIcon symbol={asset?.id} />
</>
}
>
+1
View File
@@ -6,6 +6,7 @@ import { STRING_KEYS } from './localization';
export type Nullable<T> = T | null | undefined;
// ------ V4 Protocols ------ //
export const AbacusAppConfig = Abacus.exchange.dydx.abacus.state.manager.AppConfigs;
export const IOImplementations = Abacus.exchange.dydx.abacus.utils.IOImplementations;
export const UIImplementations = Abacus.exchange.dydx.abacus.utils.UIImplementations;
export type AbacusDYDXChainTransactionsProtocol = Omit<
+1
View File
@@ -5,6 +5,7 @@ export enum DialogTypes {
ExchangeOffline = 'ExchangeOffline',
FillDetails = 'FillDetails',
Help = 'Help',
ExternalNavKeplr = 'ExternalNavKeplr',
MnemonicExport = 'MnemonicExport',
MobileSignIn = 'MobileSignIn',
Onboarding = 'Onboarding',
+12
View File
@@ -0,0 +1,12 @@
import environments from '../../public/configs/env.json';
// TODO: Update for Mainnet deployment
export const AVAILABLE_ENVIRONMENTS =
import.meta.env.MODE === 'production'
? environments.deployments.TESTNET
: environments.deployments.DEV;
export const CURRENT_ABACUS_DEPLOYMENT = import.meta.env.MODE === 'production' ? 'TESTNET' : 'DEV';
export const ENVIRONMENT_CONFIG_MAP = environments.environments;
export type DydxNetwork = keyof typeof ENVIRONMENT_CONFIG_MAP;
export const DEFAULT_APP_ENVIRONMENT = AVAILABLE_ENVIRONMENTS.default as DydxNetwork;
-29
View File
@@ -1,29 +0,0 @@
import { ENDPOINTS, DEV_ENDPOINTS } from '@dydxprotocol/v4-localization';
export const NETWORK_ENDPOINTS = import.meta.env.MODE === 'production' ? ENDPOINTS : DEV_ENDPOINTS;
export const CLIENT_NETWORK_CONFIGS: Record<
string,
(typeof NETWORK_ENDPOINTS.environments)[number]
> = Object.fromEntries(
NETWORK_ENDPOINTS.environments.map((environment) => [environment.environment, environment])
);
export const DEFAULT_APP_ENVIRONMENT = NETWORK_ENDPOINTS.defaultEnvironment;
export enum DydxV4Network {
V4Mainnet = 'dydxprotocol-mainnet',
V4Staging = 'dydxprotocol-staging',
V4Testnet2 = 'dydxprotocol-testnet',
V4Local = 'dydxprotocol-dev',
}
export type DydxNetwork = keyof typeof CLIENT_NETWORK_CONFIGS;
export function isDydxV4Network(network: any): boolean {
return CLIENT_NETWORK_CONFIGS[network]?.version === 'v4';
}
export function isValidDydxNetwork(network: any): boolean {
return Object.keys(CLIENT_NETWORK_CONFIGS).includes(network);
}
+17 -14
View File
@@ -24,6 +24,8 @@ import {
import { isMetaMask } from '@/lib/wallet/providers';
import { DydxNetwork, ENVIRONMENT_CONFIG_MAP } from './networks';
// Wallet connection types
export enum WalletConnectionType {
@@ -266,7 +268,7 @@ export const wallets: Record<WalletType, WalletConfig> = {
walletconnect2Id: '4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0',
},
[WalletType.WalletConnect2]: {
type: WalletType.WalletConnect,
type: WalletType.WalletConnect2,
stringKey: STRING_KEYS.WALLET_CONNECT_2,
icon: WalletConnectIcon,
connectionTypes: [WalletConnectionType.WalletConnect2],
@@ -318,20 +320,21 @@ export type WalletConnection = {
export const COSMOS_DERIVATION_PATH = "m/44'/118'/0'/0/0";
/**
* @description typed data to sign for v4 onboarding
* @description typed data to sign for dYdX Chain onboarding
*/
export const SIGN_TYPED_DATA = {
primaryType: 'dYdX',
domain: {
name: 'dYdX V4',
},
types: {
dYdX: [{ name: 'action', type: 'string' }],
},
message: {
action: 'dYdX V4 Onboarding',
},
} as const;
export const getSignTypedData = (selectedNetwork: DydxNetwork) =>
({
primaryType: 'dYdX',
domain: {
name: ENVIRONMENT_CONFIG_MAP[selectedNetwork].wallets.signTypedDataDomainName,
},
types: {
dYdX: [{ name: 'action', type: 'string' }],
},
message: {
action: ENVIRONMENT_CONFIG_MAP[selectedNetwork].wallets.signTypedDataAction,
},
} as const);
export type PrivateInformation = ReturnType<typeof onboarding.deriveHDKeyFromEthereumSignature>;
+12 -7
View File
@@ -7,14 +7,14 @@ import { formatUnits } from 'viem';
import { USDC_DENOM, DYDX_DENOM } from '@dydxprotocol/v4-client-js';
import { CLIENT_NETWORK_CONFIGS } from '@/constants/networks';
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
import { QUANTUM_MULTIPLIER } from '@/constants/numbers';
import { EvmAddress } from '@/constants/wallets';
import { convertBech32Address } from '@/lib/addressUtils';
import { MustBigNumber } from '@/lib/numbers';
import { getBalances } from '@/state/accountSelectors';
import { getBalances, getStakingBalances } from '@/state/accountSelectors';
import { getSelectedNetwork } from '@/state/appSelectors';
import { useAccounts } from './useAccounts';
@@ -52,16 +52,15 @@ export const useAccountBalance = ({
const selectedNetwork = useSelector(getSelectedNetwork);
const balances = useSelector(getBalances, shallowEqual);
const evmChainId = Number(CLIENT_NETWORK_CONFIGS[selectedNetwork].ethereumChainId);
const evmChainId = Number(ENVIRONMENT_CONFIG_MAP[selectedNetwork].ethereumChainId);
const stakingBalances = useSelector(getStakingBalances, shallowEqual);
const evmQuery = useBalance({
enabled: Boolean(!isCosmosChain && addressOrDenom?.startsWith('0x')),
address: evmAddress,
chainId: typeof chainId === 'number' ? chainId : Number(evmChainId),
token:
addressOrDenom === CHAIN_DEFAULT_TOKEN_ADDRESS
? undefined
: (addressOrDenom as EvmAddress),
addressOrDenom === CHAIN_DEFAULT_TOKEN_ADDRESS ? undefined : (addressOrDenom as EvmAddress),
watch: true,
});
@@ -98,13 +97,19 @@ export const useAccountBalance = ({
const nativeTokenBalance = MustBigNumber(nativeTokenCoinBalance?.amount)
.div(QUANTUM_MULTIPLIER)
.toNumber();
const usdcCoinBalance = balances?.[USDC_DENOM];
const usdcBalance = MustBigNumber(usdcCoinBalance?.amount).div(QUANTUM_MULTIPLIER).toNumber();
const nativeStakingCoinBalanace = stakingBalances?.[DYDX_DENOM];
const nativeStakingBalance = MustBigNumber(nativeStakingCoinBalanace?.amount)
.div(QUANTUM_MULTIPLIER)
.toNumber();
return {
balance,
nativeTokenBalance,
nativeStakingBalance,
usdcBalance,
queryStatus: isCosmosChain ? cosmosQuery.status : evmQuery.status,
isQueryFetching: isCosmosChain ? cosmosQuery.isFetching : evmQuery.fetchStatus === 'fetching',
+1 -2
View File
@@ -1,4 +1,3 @@
import { isDydxV4Network } from '@/constants/networks';
import { WalletType } from '@/constants/wallets';
import { isTruthy } from '@/lib/isTruthy';
@@ -11,7 +10,7 @@ export const useDisplayedWallets = () => {
return [
WalletType.MetaMask,
import.meta.env.MODE !== 'production' && isDydxV4Network(selectedNetwork) && WalletType.Keplr,
import.meta.env.MODE !== 'production' && WalletType.Keplr,
WalletType.WalletConnect2,
WalletType.WalletConnect,
+1 -2
View File
@@ -3,7 +3,7 @@ import { useDispatch } from 'react-redux';
import { LocalStorageKey } from '@/constants/localStorage';
import { DEFAULT_APP_ENVIRONMENT, DydxNetwork, isValidDydxNetwork } from '@/constants/networks';
import { DEFAULT_APP_ENVIRONMENT, type DydxNetwork } from '@/constants/networks';
import { useLocalStorage } from '@/hooks';
@@ -18,7 +18,6 @@ export const useInitializePage = () => {
const [localStorageNetwork] = useLocalStorage<DydxNetwork>({
key: LocalStorageKey.SelectedNetwork,
defaultValue: DEFAULT_APP_ENVIRONMENT,
validateFn: isValidDydxNetwork, // backwards compatibility
});
useEffect(() => {
+4 -3
View File
@@ -6,7 +6,7 @@ import { LocalStorageKey } from '@/constants/localStorage';
import { type TransferNotifcation } from '@/constants/notifications';
import { useAccounts } from '@/hooks/useAccounts';
import { SQUID_ERROR_TYPES, useSquid } from '@/hooks/useSquid';
import { STATUS_ERROR_GRACE_PERIOD, useSquid } from '@/hooks/useSquid';
import { useLocalStorage } from './useLocalStorage';
const LocalNotificationsContext = createContext<
@@ -62,6 +62,7 @@ const useLocalNotificationsContext = () => {
txHash,
toChainId,
fromChainId,
triggeredAt,
status: currentStatus,
} of transferNotifications) {
try {
@@ -70,8 +71,8 @@ const useLocalNotificationsContext = () => {
const status = await squid?.getStatus({ transactionId: txHash, toChainId, fromChainId });
if (status) statuses[txHash] = status;
} catch (error) {
// ignore not found errors since the route might not be available yet
if (error?.errors?.length && error.errors[0].errorType !== SQUID_ERROR_TYPES.NotFoundError) {
// ignore errors for the first 120s since the status might not be available yet
if (!triggeredAt || Date.now() - triggeredAt > STATUS_ERROR_GRACE_PERIOD) {
statuses[txHash] = error;
}
}
+9 -11
View File
@@ -28,15 +28,13 @@ export const useMarketsData = (
const allAssets = useSelector(getAssets, shallowEqual) || {};
const markets = useMemo(() => {
return Object.values(allPerpetualMarkets)
.filter((market) => allAssets[market?.assetId]) // Filter out markets with no asset information
.map((marketData) => ({
asset: allAssets[marketData.assetId],
tickSizeDecimals: marketData.configs?.tickSizeDecimals,
...marketData,
...marketData.perpetual,
...marketData.configs,
})) as MarketData[];
return Object.values(allPerpetualMarkets).map((marketData) => ({
asset: allAssets[marketData.assetId],
tickSizeDecimals: marketData.configs?.tickSizeDecimals,
...marketData,
...marketData.perpetual,
...marketData.configs,
})) as MarketData[];
}, [allPerpetualMarkets, allAssets]);
const filteredMarkets = useMemo(() => {
@@ -45,8 +43,8 @@ export const useMarketsData = (
if (searchFilter) {
return filtered.filter(
({ asset }) =>
asset.name?.toLocaleLowerCase().includes(searchFilter.toLowerCase()) ||
asset.symbol?.toLocaleLowerCase().includes(searchFilter.toLowerCase())
asset?.name?.toLocaleLowerCase().includes(searchFilter.toLowerCase()) ||
asset?.id?.toLocaleLowerCase().includes(searchFilter.toLowerCase())
);
}
return filtered;
+5 -10
View File
@@ -2,15 +2,13 @@ import { createContext, useContext, useEffect, useMemo, useState } from 'react';
import { useSelector } from 'react-redux';
import { Squid } from '@0xsquid/sdk';
import { CLIENT_NETWORK_CONFIGS, isDydxV4Network } from '@/constants/networks';
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
import { getSelectedNetwork } from '@/state/appSelectors';
export const NATIVE_TOKEN_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
export const NATIVE_TOKEN_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';
export enum SQUID_ERROR_TYPES {
NotFoundError = 'NotFoundError',
}
export const STATUS_ERROR_GRACE_PERIOD = 120_000;
const useSquidContext = () => {
const selectedNetwork = useSelector(getSelectedNetwork);
@@ -24,10 +22,7 @@ const useSquidContext = () => {
};
const squid = useMemo(
() =>
isDydxV4Network(selectedNetwork)
? new Squid({ baseUrl: CLIENT_NETWORK_CONFIGS[selectedNetwork]?.endpoints['0xsquid'] })
: undefined,
() => new Squid({ baseUrl: ENVIRONMENT_CONFIG_MAP[selectedNetwork]?.endpoints['0xsquid'] }),
[selectedNetwork]
);
@@ -41,7 +36,7 @@ const useSquidContext = () => {
};
type SquidContextType = ReturnType<typeof useSquidContext>;
const SquidContext = createContext<SquidContextType>(undefined);
const SquidContext = createContext<SquidContextType | undefined>(undefined);
SquidContext.displayName = '0xSquid';
export const SquidProvider = ({ ...props }) => (
+2
View File
@@ -11,6 +11,7 @@ import { DepositDialog } from '@/views/dialogs/DepositDialog';
import { DisconnectDialog } from '@/views/dialogs/DisconnectDialog';
import { ExchangeOfflineDialog } from '@/views/dialogs/ExchangeOfflineDialog';
import { HelpDialog } from '@/views/dialogs/HelpDialog';
import { ExternalNavKeplrDialog } from '@/views/dialogs/ExternalNavKeplrDialog';
import { MnemonicExportDialog } from '@/views/dialogs/MnemonicExportDialog';
import { MobileSignInDialog } from '@/views/dialogs/MobileSignInDialog';
import { OnboardingDialog } from '@/views/dialogs/OnboardingDialog';
@@ -47,6 +48,7 @@ export const DialogManager = () => {
[DialogTypes.ExchangeOffline]: <ExchangeOfflineDialog {...modalProps} />,
[DialogTypes.FillDetails]: <FillDetailsDialog {...modalProps} />,
[DialogTypes.Help]: <HelpDialog {...modalProps} />,
[DialogTypes.ExternalNavKeplr]: <ExternalNavKeplrDialog {...modalProps} />,
[DialogTypes.MnemonicExport]: <MnemonicExportDialog {...modalProps} />,
[DialogTypes.MobileSignIn]: <MobileSignInDialog {...modalProps} />,
[DialogTypes.Onboarding]: <OnboardingDialog {...modalProps} />,
+5
View File
@@ -42,6 +42,11 @@ export const HeaderDesktop = () => {
label: stringGetter({ key: STRING_KEYS.TRADE }),
href: AppRoute.Trade,
},
{
value: 'Dv4TNT',
label: 'Dv4TNT',
href: AppRoute.Rewards,
},
{
value: 'PORTFOLIO',
label: stringGetter({ key: STRING_KEYS.PORTFOLIO }),
-5
View File
@@ -1,5 +1,4 @@
import type { AbacusFileSystemProtocol, FileLocation, Nullable } from '@/constants/abacus';
import { NETWORK_ENDPOINTS } from '@/constants/networks';
export const ENDPOINTS_PATH =
import.meta.env.MODE === 'production'
@@ -8,10 +7,6 @@ export const ENDPOINTS_PATH =
class AbacusFileSystem implements AbacusFileSystemProtocol {
readTextFile(location: FileLocation, path: string): Nullable<string> {
if (path === ENDPOINTS_PATH) {
return JSON.stringify(NETWORK_ENDPOINTS);
}
return null;
}
+5 -3
View File
@@ -22,10 +22,11 @@ import {
UIImplementations,
CoroutineTimer,
TransferType,
AbacusAppConfig,
} from '@/constants/abacus';
import { DEFAULT_MARKETID } from '@/constants/markets';
import { type DydxNetwork } from '@/constants/networks';
import { CURRENT_ABACUS_DEPLOYMENT, type DydxNetwork } from '@/constants/networks';
import type { RootStore } from '@/state/_store';
@@ -80,8 +81,9 @@ class AbacusStateManager {
);
this.stateManager = new AsyncAbacusStateManager(
import.meta.env.SHARED_RESOURCES_URI,
ENDPOINTS_PATH,
'',
CURRENT_ABACUS_DEPLOYMENT,
AbacusAppConfig.Companion.forWeb,
ioImplementations,
uiImplementations,
// @ts-ignore
+16 -5
View File
@@ -20,6 +20,7 @@ import type { RootStore } from '@/state/_store';
import {
setBalances,
setStakingBalances,
setFills,
setFundingPayments,
setHistoricalPnl,
@@ -34,6 +35,7 @@ import { setAssets } from '@/state/assets';
import { setConfigs } from '@/state/configs';
import { setInputs } from '@/state/inputs';
import { setHistoricalFundings, setLiveTrades, setMarkets, setOrderbook } from '@/state/perpetuals';
import { isTruthy } from '../isTruthy';
class AbacusStateNotifier implements AbacusStateNotificationProtocol {
private store: RootStore | undefined;
@@ -76,12 +78,19 @@ class AbacusStateNotifier implements AbacusStateNotificationProtocol {
if (changes.has(Changes.accountBalances)) {
if (updatedState.account?.balances) {
const balances: Record<string, AccountBalance> = {}
const balances: Record<string, AccountBalance> = {};
for (const { k, v } of updatedState.account.balances.toArray()) {
balances[k] = v;
}
dispatch(setBalances(balances));
}
if (updatedState.account?.stakingBalances) {
const stakingBalances: Record<string, AccountBalance> = {};
for (const { k, v } of updatedState.account.stakingBalances.toArray()) {
stakingBalances[k] = v;
}
dispatch(setStakingBalances(stakingBalances));
}
}
if (changes.has(Changes.configs)) {
@@ -100,10 +109,12 @@ class AbacusStateNotifier implements AbacusStateNotificationProtocol {
dispatch(
setMarkets({
markets: Object.fromEntries(
(marketIds || updatedState.marketIds()?.toArray() || []).map((marketId: string) => {
const marketData = updatedState.market(marketId);
return [marketId, marketData];
})
(marketIds || updatedState.marketIds()?.toArray() || [])
.map((marketId: string) => {
const marketData = updatedState.market(marketId);
return [marketId, marketData];
})
.filter(isTruthy)
) as Record<string, PerpetualMarket>,
update: !!marketIds,
})
+34 -2
View File
@@ -10,7 +10,23 @@ import {
bscTestnet,
optimism,
optimismGoerli,
} from 'wagmi/chains';
base,
baseGoerli,
polygon,
polygonMumbai,
linea,
lineaTestnet,
mantle,
mantleTestnet,
moonbeam,
moonbaseAlpha,
filecoin,
filecoinHyperspace,
fantom,
fantomTestnet,
celo,
celoAlfajores,
} from 'viem/chains';
import { alchemyProvider } from 'wagmi/providers/alchemy';
import { jsonRpcProvider } from 'wagmi/providers/jsonRpc';
@@ -36,10 +52,26 @@ export const WAGMI_SUPPORTED_CHAINS: Chain[] = [
bscTestnet,
optimism,
optimismGoerli,
base,
baseGoerli,
polygon,
polygonMumbai,
linea,
lineaTestnet,
mantle,
mantleTestnet,
moonbeam,
moonbaseAlpha,
filecoin,
filecoinHyperspace,
fantom,
fantomTestnet,
celo,
celoAlfajores,
];
const { chains, publicClient, webSocketPublicClient } = configureChains(WAGMI_SUPPORTED_CHAINS, [
alchemyProvider({ apiKey: import.meta.env.VITE_ALCHEMY_API_KEY }),
// alchemyProvider({ apiKey: import.meta.env.VITE_ALCHEMY_API_KEY }),
jsonRpcProvider({
rpc: (chain) => ({ http: chain.rpcUrls.default.http[0] }),
}),
+8 -10
View File
@@ -29,10 +29,10 @@ export const DYDXBalancePanel = () => {
const { walletType } = useAccounts();
const canAccountTrade = useSelector(calculateCanAccountTrade, shallowEqual);
const { nativeTokenBalance } = useAccountBalance();
const { nativeTokenBalance, nativeStakingBalance } = useAccountBalance();
return (
<Styled.TransfersCard
<Panel
slotHeader={
<Styled.Header>
<Styled.Title>
@@ -97,7 +97,7 @@ export const DYDXBalancePanel = () => {
</Styled.Label>
),
value: <Output type={OutputType.Asset} value={undefined} />,
value: <Output type={OutputType.Asset} value={nativeStakingBalance} />,
},
]}
/>
@@ -106,21 +106,17 @@ export const DYDXBalancePanel = () => {
{
key: 'totalBalance',
label: 'Total balance',
value: <Output type={OutputType.Asset} value={nativeTokenBalance} tag="Dv4TNT" />,
value: <Output type={OutputType.Asset} value={nativeTokenBalance + nativeStakingBalance} tag="Dv4TNT" />,
},
]}
/>
</Styled.Content>
</Styled.TransfersCard>
</Panel>
);
};
const Styled: Record<string, AnyStyledComponent> = {};
Styled.TransfersCard = styled(Panel)`
width: 21.25rem;
`;
Styled.Header = styled.div`
${layoutMixins.spacedRow}
padding: 1.25rem 1.5rem 0.5rem;
@@ -174,13 +170,15 @@ Styled.IconContainer = styled.div`
Styled.WalletAndStakedBalance = styled(Details)`
--details-item-backgroundColor: var(--color-layer-6);
grid-template-columns: 1fr 1fr;
gap: 0.5rem;
> div {
gap: 1rem;
padding: 1rem;
width: 8.625rem;
border-radius: 0.75em;
background-color: var(--color-layer-5);
+322 -6
View File
@@ -1,17 +1,333 @@
import styled, { AnyStyledComponent } from 'styled-components';
import { useDispatch, useSelector } from 'react-redux';
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
import { STRING_KEYS } from '@/constants/localization';
import { ButtonAction, ButtonSize, ButtonState, ButtonType } from '@/constants/buttons';
import { DialogTypes } from '@/constants/dialogs';
import { useAccountBalance, useBreakpoints, useStringGetter } from '@/hooks';
import { breakpoints } from '@/styles';
import { layoutMixins } from '@/styles/layoutMixins';
import { Details } from '@/components/Details';
import { Panel } from '@/components/Panel';
import { IconName } from '@/components/Icon';
import { Button } from '@/components/Button';
import { IconButton } from '@/components/IconButton';
import { Link } from '@/components/Link';
import { Output, OutputType } from '@/components/Output';
import { VerticalSeparator } from '@/components/Separator';
import { WithReceipt } from '@/components/WithReceipt';
import { openDialog } from '@/state/dialogs';
import { getSelectedNetwork } from '@/state/appSelectors';
import { DYDXBalancePanel } from './DYDXBalancePanel';
export const RewardsPage = () => (
<Styled.Page>
<DYDXBalancePanel />
</Styled.Page>
);
// 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 = () => {
const dispatch = useDispatch();
const stringGetter = useStringGetter();
const { isTablet, isNotTablet } = useBreakpoints();
const selectedNetwork = useSelector(getSelectedNetwork);
// const chainId = Number(ENVIRONMENT_CONFIG_MAP[selectedNetwork].ethereumChainId);
// const { balance } = useAccountBalance({
// addressOrDenom: import.meta.env.VITE_V3_TOKEN_ADDRESS,
// assetSymbol: 'DYDX',
// chainId,
// isCosmosChain: false,
// });
// const tokenBalance = import.meta.env.VITE_V3_TOKEN_ADDRESS ? balance : 0;
return (
<Styled.Page>
{/* {isNotTablet ? (
<Styled.Migrate>
<Styled.TwoItemRow>
<div>
<Styled.MigrateTitle>
{stringGetter({ key: STRING_KEYS.MIGRATE })}
</Styled.MigrateTitle>
<Styled.Description>
{stringGetter({ key: STRING_KEYS.MIGRATE_DESCRIPTION })}
<Link href={MIGRATE_HELP_URL}>
{stringGetter({ key: STRING_KEYS.LEARN_MORE })} →
</Link>
</Styled.Description>
</div>
<Styled.MigrateAction>
<div>
<div>{stringGetter({ key: STRING_KEYS.AVAILABLE_TO_MIGRATE })}</div>
<div>
<Styled.Token type={OutputType.Asset} value={tokenBalance} />
</div>
</div>
<Button
action={tokenBalance ? ButtonAction.Primary : ButtonAction.Base}
// type={ButtonType.Link}
// href={BRIDGE_URL}
disabled
>
{tokenBalance
? `${stringGetter({ key: STRING_KEYS.MIGRATE_NOW })} →`
: stringGetter({ key: STRING_KEYS.NO_TOKENS_TO_MIGRATE })}
</Button>
</Styled.MigrateAction>
</Styled.TwoItemRow>
</Styled.Migrate>
) : (
<Styled.MobileMigrateCard
slotHeader={
<Styled.MobileMigrateHeader>
<h3>{stringGetter({ key: STRING_KEYS.MIGRATE })}</h3>
<VerticalSeparator />
<span>
{stringGetter({
key: STRING_KEYS.FROM_TO,
params: { FROM: <strong>Ethereum</strong>, TO: <strong>dYdX Chain</strong> },
})}
</span>
</Styled.MobileMigrateHeader>
}
>
<Styled.WithReceipt
slotReceipt={
<Styled.Details
items={[
{
key: 'available-to-migrate',
label: stringGetter({ key: STRING_KEYS.AVAILABLE_TO_MIGRATE }),
value: <Output type={OutputType.Asset} value={tokenBalance} />,
},
]}
/>
}
>
<Button
action={tokenBalance ? ButtonAction.Primary : ButtonAction.Base}
size={ButtonSize.Medium}
disabled
>
{tokenBalance
? `${stringGetter({ key: STRING_KEYS.MIGRATE_NOW })} →`
: stringGetter({ key: STRING_KEYS.NO_TOKENS_TO_MIGRATE })}
</Button>
</Styled.WithReceipt>
<Styled.LearnMore>
{stringGetter({ key: STRING_KEYS.WANT_TO_LEARN })}
<Link href={MIGRATE_HELP_URL}>{stringGetter({ key: STRING_KEYS.CLICK_HERE })}</Link>
</Styled.LearnMore>
</Styled.MobileMigrateCard>
)} */}
<Styled.PanelRow>
{isTablet && (
<Styled.BalancePanelContainer>
<DYDXBalancePanel />
</Styled.BalancePanelContainer>
)}
<Styled.Panel
slotHeader={<Styled.Title>{stringGetter({ key: STRING_KEYS.GOVERNANCE })}</Styled.Title>}
onClick={() => dispatch(openDialog({ type: DialogTypes.ExternalNavKeplr }))}
>
<Styled.Row>
<Styled.Description>
{stringGetter({ key: STRING_KEYS.GOVERNANCE_DESCRIPTION })}
<Link href={GOVERNANCE_HELP_URL} onClick={(e) => e.stopPropagation()}>
{stringGetter({ key: STRING_KEYS.LEARN_MORE })}
</Link>
</Styled.Description>
{/* TODO: vertically center based on Panel height */}
<Styled.IconButton
action={ButtonAction.Base}
iconName={IconName.Arrow}
size={ButtonSize.Small}
/>
</Styled.Row>
</Styled.Panel>
<Styled.Panel
slotHeader={<Styled.Title>{stringGetter({ key: STRING_KEYS.STAKING })}</Styled.Title>}
onClick={() => dispatch(openDialog({ type: DialogTypes.ExternalNavKeplr }))}
>
<Styled.Row>
<Styled.Description>
{stringGetter({ key: STRING_KEYS.STAKING_DESCRIPTION })}
<Link href={STAKING_HELP_URL} onClick={(e) => e.stopPropagation()}>
{stringGetter({ key: STRING_KEYS.LEARN_MORE })}
</Link>
</Styled.Description>
{/* TODO: vertically center based on Panel height */}
<Styled.IconButton
action={ButtonAction.Base}
iconName={IconName.Arrow}
size={ButtonSize.Small}
/>
</Styled.Row>
</Styled.Panel>
{isNotTablet && (
<Styled.BalancePanelContainer>
<DYDXBalancePanel />
</Styled.BalancePanelContainer>
)}
</Styled.PanelRow>
</Styled.Page>
);
};
const Styled: Record<string, AnyStyledComponent> = {};
Styled.Page = styled.div`
${layoutMixins.centered}
${layoutMixins.contentContainerPage}
gap: 1.5rem;
@media ${breakpoints.tablet} {
padding: 1rem;
}
`;
Styled.Panel = styled(Panel)`
padding: 0 1.5rem 1rem;
@media ${breakpoints.tablet} {
max-width: calc(100vw - 2rem);
}
`;
Styled.Row = styled.div`
${layoutMixins.spacedRow}
gap: 1rem;
align-items: center;
`;
Styled.Description = styled.div`
color: var(--color-text-0);
a {
color: var(--color-text-1);
}
`;
Styled.Migrate = styled.section`
max-width: min(100vw, var(--content-max-width));
padding: 1.5rem;
background-color: var(--color-layer-3);
border-radius: 0.875rem;
`;
Styled.TwoItemRow = styled(Styled.Row)`
grid-template-columns: 1fr 1fr;
`;
Styled.MigrateAction = styled(Styled.TwoItemRow)`
padding: 1rem;
background-color: var(--color-layer-2);
border: solid var(--border-width) var(--color-border);
border-radius: 0.75rem;
`;
Styled.Token = styled(Output)`
font: var(--font-large-book);
`;
Styled.PanelRow = styled(Styled.Row)`
gap: 1.5rem;
max-width: min(100vw, var(--content-max-width));
align-items: flex-start;
> section {
cursor: pointer;
}
@media ${breakpoints.tablet} {
grid-auto-flow: row;
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)`
color: var(--color-text-0);
`;
+2 -2
View File
@@ -12,12 +12,12 @@ import { getCurrentMarketAssetData } from '@/state/assetsSelectors';
import { getCurrentMarketId } from '@/state/perpetualsSelectors';
export const MarketSelectorAndStats = ({ className }: { className?: string }) => {
const { symbol = '' } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
const { id = '' } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
const currentMarketId = useSelector(getCurrentMarketId);
return (
<Styled.Container className={className}>
<MarketsDropdown currentMarketId={currentMarketId} symbol={symbol} />
<MarketsDropdown currentMarketId={currentMarketId} symbol={id} />
<VerticalSeparator />
+5
View File
@@ -37,6 +37,7 @@ export type AccountState = {
walletType?: WalletType;
historicalPnlPeriod?: HistoricalPnlPeriods;
balances?: Record<string, AccountBalance>;
stakingBalances?: Record<string, AccountBalance>;
};
const initialState: AccountState = {
@@ -154,6 +155,9 @@ export const accountSlice = createSlice({
setBalances: (state, action: PayloadAction<Record<string, AccountBalance>>) => {
state.balances = action.payload;
},
setStakingBalances: (state, action: PayloadAction<Record<string, AccountBalance>>) => {
state.stakingBalances = action.payload;
},
addUncommittedOrderClientId: (state, action: PayloadAction<number>) => {
state.uncommittedOrderClientIds.push(action.payload);
},
@@ -179,6 +183,7 @@ export const {
viewedFills,
viewedOrders,
setBalances,
setStakingBalances,
addUncommittedOrderClientId,
removeUncommittedOrderClientId,
} = accountSlice.actions;
+3 -6
View File
@@ -2,7 +2,6 @@ import { createSelector } from 'reselect';
import { SubaccountPosition } from '@/constants/abacus';
import { OnboardingState, OnboardingSteps } from '@/constants/account';
import { isDydxV4Network } from '@/constants/networks';
import {
getExistingOpenPositions,
@@ -12,8 +11,6 @@ import {
getUncommittedOrderClientIds,
} from '@/state/accountSelectors';
import { getSelectedNetwork } from '@/state/appSelectors';
export const calculateOnboardingStep = createSelector(
[getOnboardingState, getOnboardingGuards],
(onboardingState: OnboardingState, onboardingGuards: ReturnType<typeof getOnboardingGuards>) => {
@@ -35,9 +32,9 @@ export const calculateOnboardingStep = createSelector(
* @description calculate whether an account is in a state where they can trade
*/
export const calculateCanAccountTrade = createSelector(
[getOnboardingState, getSelectedNetwork],
(onboardingState: OnboardingState, selectedNetwork: string) => {
return onboardingState === OnboardingState.AccountConnected && isDydxV4Network(selectedNetwork);
[getOnboardingState],
(onboardingState: OnboardingState) => {
return onboardingState === OnboardingState.AccountConnected;
}
);
+5
View File
@@ -337,3 +337,8 @@ export const getUserStats = (state: RootState) => ({
* @returns user wallet balances
*/
export const getBalances = (state: RootState) => state.account?.balances;
/**
* @returns user wallet staking balances
* */
export const getStakingBalances = (state: RootState) => state.account?.stakingBalances;
+1 -6
View File
@@ -3,11 +3,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import { AbacusApiState } from '@/constants/abacus';
import { LocalStorageKey } from '@/constants/localStorage';
import {
DEFAULT_APP_ENVIRONMENT,
isValidDydxNetwork,
type DydxNetwork,
} from '@/constants/networks';
import { DEFAULT_APP_ENVIRONMENT, type DydxNetwork } from '@/constants/networks';
import { getLocalStorage } from '@/lib/localStorage';
@@ -23,7 +19,6 @@ const initialState: AppState = {
selectedNetwork: getLocalStorage({
key: LocalStorageKey.SelectedNetwork,
defaultValue: DEFAULT_APP_ENVIRONMENT,
validateFn: isValidDydxNetwork,
}),
};
+6 -8
View File
@@ -24,7 +24,7 @@ export const MarketDetails: React.FC = () => {
const stringGetter = useStringGetter();
const { isTablet } = useBreakpoints();
const { configs, market } = useSelector(getCurrentMarketData, shallowEqual) || {};
const { symbol, name, resources } = useSelector(getCurrentMarketAssetData, shallowEqual) || {};
const { id, name, resources } = useSelector(getCurrentMarketAssetData, shallowEqual) || {};
if (!configs) return null;
@@ -75,7 +75,7 @@ export const MarketDetails: React.FC = () => {
useGrouping
value={stepSize}
type={OutputType.Asset}
tag={symbol}
tag={id}
fractionDigits={stepSizeDecimals}
/>
),
@@ -88,7 +88,7 @@ export const MarketDetails: React.FC = () => {
useGrouping
value={minOrderSize}
type={OutputType.Asset}
tag={symbol}
tag={id}
fractionDigits={stepSizeDecimals}
/>
),
@@ -132,18 +132,16 @@ export const MarketDetails: React.FC = () => {
<Styled.Header>
<Styled.WrapRow>
<Styled.MarketTitle>
<AssetIcon symbol={symbol} />
<AssetIcon symbol={id} />
{name}
</Styled.MarketTitle>
{isTablet && <Styled.MarketLinks />}
</Styled.WrapRow>
<Styled.MarketDescription>
{primaryDescriptionKey && (
<p>{stringGetter({ key: STRING_KEYS[primaryDescriptionKey as StringKey] })}</p>
)}
{primaryDescriptionKey && <p>{stringGetter({ key: `APP.${primaryDescriptionKey}` })}</p>}
{secondaryDescriptionKey && (
<p>{stringGetter({ key: STRING_KEYS[secondaryDescriptionKey as StringKey] })}</p>
<p>{stringGetter({ key: `APP.${secondaryDescriptionKey}` })}</p>
)}
</Styled.MarketDescription>
+2 -2
View File
@@ -45,7 +45,7 @@ const defaultMarketStatistics = Object.values(MarketStats);
export const MarketStatsDetails = ({ showMidMarketPrice = true }: ElementProps) => {
const stringGetter = useStringGetter();
const { isTablet } = useBreakpoints();
const { symbol = '' } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
const { id = '' } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
const { tickSizeDecimals } = useSelector(getCurrentMarketConfig, shallowEqual) ?? {};
const midMarketPrice = useSelector(getCurrentMarketMidMarketPrice);
const lastMidMarketPrice = useRef(midMarketPrice);
@@ -116,7 +116,7 @@ export const MarketStatsDetails = ({ showMidMarketPrice = true }: ElementProps)
<Styled.Output
type={OutputType.Number}
value={value}
tag={symbol}
tag={id}
fractionDigits={LARGE_TOKEN_DECIMALS}
/>
);
+4 -4
View File
@@ -60,12 +60,12 @@ const MarketsDropdownContent = ({ onRowAction }: { onRowAction?: (market: string
columnKey: 'market',
getCellValue: (row) => row.market,
label: stringGetter({ key: STRING_KEYS.MARKET }),
renderCell: ({ asset }) => (
renderCell: ({ assetId, id }) => (
<Styled.MarketName isFavorited={false}>
{/* TRCL-1693 <Icon iconName={IconName.Star} /> */}
<AssetIcon symbol={asset.symbol} />
<h2>{asset.name}</h2>
<Tag>{asset.symbol}</Tag>
<AssetIcon symbol={assetId} />
<h2>{id}</h2>
<Tag>{assetId}</Tag>
</Styled.MarketName>
),
},
+4 -4
View File
@@ -68,7 +68,7 @@ export const PositionInfo = ({ showNarrowVariation }: { showNarrowVariation?: bo
const isLoading = useSelector(calculateIsAccountLoading);
const { stepSizeDecimals, tickSizeDecimals } = currentMarketConfigs || {};
const { symbol } = currentMarketAssetData || {};
const { id } = currentMarketAssetData || {};
const { type: dialogType } = activeDialog || {};
const { type: tradeBoxDialogType } = activeTradeBoxDialog || {};
@@ -188,7 +188,7 @@ export const PositionInfo = ({ showNarrowVariation }: { showNarrowVariation?: bo
label: STRING_KEYS.LIQUIDATION_PRICE,
tooltip: 'liquidation-price',
tooltipParams: {
SYMBOL: symbol || '',
SYMBOL: id || '',
},
fractionDigits: tickSizeDecimals,
hasInvalidNewValue: Boolean(newLeverageIsInvalid),
@@ -326,7 +326,7 @@ export const PositionInfo = ({ showNarrowVariation }: { showNarrowVariation?: bo
notionalTotal={notionalTotal?.current}
postOrderSize={size?.postOrder}
stepSizeDecimals={stepSizeDecimals}
symbol={symbol || undefined}
symbol={id || undefined}
tickSizeDecimals={tickSizeDecimals}
showNarrowVariation={showNarrowVariation}
isLoading={isLoading}
@@ -370,7 +370,7 @@ export const PositionInfo = ({ showNarrowVariation }: { showNarrowVariation?: bo
notionalTotal={notionalTotal?.current}
postOrderSize={size?.postOrder}
stepSizeDecimals={stepSizeDecimals}
symbol={symbol || undefined}
symbol={id || undefined}
tickSizeDecimals={tickSizeDecimals}
isLoading={isLoading}
/>
+10 -1
View File
@@ -53,6 +53,15 @@ export const TransferStatusToast = ({
if (!status) return <LoadingDots size={3} />;
const statusString =
type === 'deposit'
? status?.squidTransactionStatus === 'success'
? STRING_KEYS.DEPOSIT_COMPLETE
: STRING_KEYS.DEPOSIT_STATUS
: status?.squidTransactionStatus === 'success'
? STRING_KEYS.WITHDRAW_COMPLETE
: STRING_KEYS.WITHDRAW_STATUS;
return (
<Styled.Root open={open} onOpenChange={setOpen}>
<WithReceipt
@@ -67,7 +76,7 @@ export const TransferStatusToast = ({
<Styled.BridgingStatus>
<Styled.Status>
{stringGetter({
key: type === 'deposit' ? STRING_KEYS.DEPOSIT_STATUS : STRING_KEYS.WITHDRAW_STATUS,
key: statusString,
params: {
AMOUNT_USD: <Styled.InlineOutput type={OutputType.Fiat} value={toAmount} />,
ESTIMATED_DURATION: (
+1 -1
View File
@@ -51,7 +51,7 @@ export const TransferStatusSteps = ({ status }: ElementProps) => {
label: stringGetter({
key: type === 'deposit' ? STRING_KEYS.DEPOSIT_TO_CHAIN : STRING_KEYS.WITHDRAW_TO_CHAIN,
params: {
CHAIN: status?.toChain?.chainData?.chainName,
CHAIN: type === 'deposit' ? 'dYdX' : status?.toChain?.chainData?.chainName,
},
}),
step: TransferStatusStep.ToChain,
+4 -4
View File
@@ -98,7 +98,7 @@ export const DepthChart = ({
// Chart data
const orderbook = useSelector(getCurrentMarketOrderbook, shallowEqual);
const { symbol = '' } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
const { id = '' } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
const { stepSizeDecimals, tickSizeDecimals } =
useSelector(getCurrentMarketConfig, shallowEqual) ?? {};
@@ -393,7 +393,7 @@ export const DepthChart = ({
? chartPointAtPointer.size
: tooltipData!.nearestDatum?.datum.depth
}
tag={symbol}
tag={id}
accentColor={
{
[DepthChartSeries.Asks]: 'var(--color-negative)',
@@ -476,7 +476,7 @@ export const DepthChart = ({
type={OutputType.Asset}
value={chartPointAtPointer.size}
fractionDigits={stepSizeDecimals}
tag={symbol}
tag={id}
useGrouping={false}
/>
),
@@ -543,7 +543,7 @@ export const DepthChart = ({
type={OutputType.Asset}
value={nearestDatum?.datum.depth}
fractionDigits={stepSizeDecimals}
tag={symbol}
tag={id}
useGrouping={false}
/>
),
+2 -2
View File
@@ -28,7 +28,7 @@ type ElementProps = {
};
export const ClosePositionDialog = ({ setIsOpen }: ElementProps) => {
const { symbol } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
const { id } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
const { isTablet } = useBreakpoints();
const stringGetter = useStringGetter();
@@ -46,7 +46,7 @@ export const ClosePositionDialog = ({ setIsOpen }: ElementProps) => {
} = {
[MobilePlaceOrderSteps.EditOrder]: {
title: <CloseOrderHeader />,
slotIcon: <AssetIcon symbol={symbol} />,
slotIcon: <AssetIcon symbol={id} />,
},
[MobilePlaceOrderSteps.PreviewOrder]: {
title: (
@@ -19,7 +19,7 @@ import { MustBigNumber } from '@/lib/numbers';
type ElementProps = {
fillId: string;
setIsOpen?: (open: boolean) => void;
setIsOpen: (open: boolean) => void;
};
export const FillDetailsDialog = ({ fillId, setIsOpen }: ElementProps) => {
@@ -94,7 +94,7 @@ export const FillDetailsDialog = ({ fillId, setIsOpen }: ElementProps) => {
return (
<DetailsDialog
slotIcon={<Styled.AssetIcon symbol={asset.symbol} />}
slotIcon={<Styled.AssetIcon symbol={asset.id} />}
title={resources.typeStringKey && stringGetter({ key: resources.typeStringKey })}
items={detailItems}
setIsOpen={setIsOpen}
@@ -194,7 +194,7 @@ export const OrderDetailsDialog = ({ orderId, setIsOpen }: ElementProps) => {
return (
<DetailsDialog
slotIcon={<Styled.AssetIcon symbol={asset.symbol} />}
slotIcon={<Styled.AssetIcon symbol={asset.id} />}
title={!resources.typeStringKey ? '' : stringGetter({ key: resources.typeStringKey })}
slotFooter={
isAccountViewOnly ? null : isOrderStatusClearable(status) ? (
@@ -0,0 +1,107 @@
import styled, { type AnyStyledComponent } from 'styled-components';
import { ButtonAction, ButtonSize, ButtonType } from '@/constants/buttons';
import { STRING_KEYS } from '@/constants/localization';
import { useBreakpoints, useStringGetter } from '@/hooks';
import { Button } from '@/components/Button';
import { Dialog, DialogPlacement } from '@/components/Dialog';
import { IconName } from '@/components/Icon';
import { IconButton } from '@/components/IconButton';
import { layoutMixins } from '@/styles/layoutMixins';
type ElementProps = {
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) => {
const stringGetter = useStringGetter();
const { isTablet } = useBreakpoints();
return (
<Dialog
isOpen
setIsOpen={setIsOpen}
title={stringGetter({ key: STRING_KEYS.HAVE_YOU_EXPORTED })}
placement={isTablet ? DialogPlacement.FullScreen : DialogPlacement.Default}
>
<Styled.Content>
<Styled.Button type={ButtonType.Link} size={ButtonSize.XLarge} href={KEPLR_DASHBOARD_URL}>
<span>
{stringGetter({
key: STRING_KEYS.NAVIGATE_TO_KEPLR,
params: {
STRONG_YES: <strong>{stringGetter({ key: STRING_KEYS.YES })}</strong>,
},
})}
</span>
<Styled.IconButton
action={ButtonAction.Base}
iconName={IconName.Arrow}
size={ButtonSize.XSmall}
/>
</Styled.Button>
<Styled.Button type={ButtonType.Link} size={ButtonSize.XLarge} href={HELP_URL}>
<span>
{stringGetter({
key: STRING_KEYS.LEARN_TO_EXPORT,
params: {
STRONG_NO: <strong>{stringGetter({ key: STRING_KEYS.NO })}</strong>,
},
})}
</span>
<Styled.IconButton
action={ButtonAction.Base}
iconName={IconName.Arrow}
size={ButtonSize.XSmall}
/>
</Styled.Button>
</Styled.Content>
</Dialog>
);
};
const Styled: Record<string, AnyStyledComponent> = {};
Styled.TextToggle = styled.div`
${layoutMixins.stickyFooter}
color: var(--color-accent);
cursor: pointer;
margin-top: auto;
&:hover {
text-decoration: underline;
}
`;
Styled.Content = styled.div`
${layoutMixins.stickyArea0}
--stickyArea0-bottomHeight: 2rem;
--stickyArea0-bottomGap: 1rem;
--stickyArea0-totalInsetBottom: 0.5rem;
${layoutMixins.flexColumn}
gap: 1rem;
`;
Styled.Button = styled(Button)`
--button-font: var(--font-base-book);
--button-padding: 0 1.5rem;
gap: 0;
justify-content: space-between;
`;
Styled.IconButton = styled(IconButton)`
color: var(--color-text-0);
`;
@@ -9,8 +9,8 @@ import { AlertType } from '@/constants/alerts';
import { AnalyticsEvent } from '@/constants/analytics';
import { ButtonAction } from '@/constants/buttons';
import { STRING_KEYS } from '@/constants/localization';
import { CLIENT_NETWORK_CONFIGS } from '@/constants/networks';
import { DydxAddress, SIGN_TYPED_DATA } from '@/constants/wallets';
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
import { DydxAddress, getSignTypedData } from '@/constants/wallets';
import { useAccounts, useBreakpoints, useDydxClient, useStringGetter } from '@/hooks';
import { useMatchingEvmNetwork } from '@/hooks/useMatchingEvmNetwork';
@@ -55,7 +55,7 @@ export const GenerateKeys = ({
// 1. Switch network
const selectedNetwork = useSelector(getSelectedNetwork);
const chainId = Number(CLIENT_NETWORK_CONFIGS[selectedNetwork].ethereumChainId);
const chainId = Number(ENVIRONMENT_CONFIG_MAP[selectedNetwork].ethereumChainId);
const { isMatchingNetwork, matchNetwork, isSwitchingNetwork } = useMatchingEvmNetwork({
chainId,
@@ -85,10 +85,11 @@ export const GenerateKeys = ({
EvmDerivedAccountStatus.Derived,
].includes(status);
const signTypedData = getSignTypedData(selectedNetwork);
const { signTypedDataAsync } = useSignTypedData({
...SIGN_TYPED_DATA,
...signTypedData,
domain: {
...SIGN_TYPED_DATA.domain,
...signTypedData.domain,
chainId,
},
});
@@ -165,8 +166,8 @@ export const GenerateKeys = ({
{[
{
status: EvmDerivedAccountStatus.Deriving,
title: stringGetter({ key: STRING_KEYS.GENERATE_COSMOS_WALLET }),
description: stringGetter({ key: STRING_KEYS.GENERATE_COSMOS_WALLET }),
title: stringGetter({ key: STRING_KEYS.GENERATE_DYDX_WALLET }),
description: stringGetter({ key: STRING_KEYS.VERIFY_WALLET_OWNERSHIP }),
},
status === EvmDerivedAccountStatus.EnsuringDeterminism && {
status: EvmDerivedAccountStatus.EnsuringDeterminism,
+4 -4
View File
@@ -3,7 +3,7 @@ import { shallowEqual, useSelector } from 'react-redux';
import styled, { AnyStyledComponent, css } from 'styled-components';
import { TradeInputField } from '@/constants/abacus';
import { STRING_KEYS } from '@/constants/localization';
import { STRING_KEYS, StringKey } from '@/constants/localization';
import { TradeTypes, TRADE_TYPE_STRINGS, MobilePlaceOrderSteps } from '@/constants/trade';
import { useBreakpoints, useStringGetter } from '@/hooks';
@@ -31,7 +31,7 @@ type ElementProps = {
export const TradeDialog = ({ isOpen, setIsOpen, slotTrigger }: ElementProps) => {
const { isMobile } = useBreakpoints();
const stringGetter = useStringGetter();
const { symbol } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
const { id } = useSelector(getCurrentMarketAssetData, shallowEqual) ?? {};
const currentTradeData = useSelector(getInputTradeData, shallowEqual);
const { type } = currentTradeData || {};
const selectedTradeType = getSelectedTradeType(type);
@@ -40,9 +40,9 @@ export const TradeDialog = ({ isOpen, setIsOpen, slotTrigger }: ElementProps) =>
const allTradeTypeItems = typeOptions?.toArray()?.map(({ type, stringKey }) => ({
value: type,
label: stringGetter({
key: stringKey,
key: stringKey as StringKey,
}),
slotBefore: <AssetIcon symbol={symbol} />,
slotBefore: <AssetIcon symbol={id} />,
}));
const [currentStep, setCurrentStep] = useState<MobilePlaceOrderSteps>(
@@ -217,7 +217,6 @@ export const DepositForm = ({ onDeposit, onError }: DepositFormProps) => {
!requestPayload.data ||
!requestPayload.value ||
!requestPayload.gasLimit ||
!requestPayload.gasPrice ||
!requestPayload.routeType
) {
throw new Error('Missing request payload');
@@ -168,6 +168,19 @@ export const DepositButtonAndReceipt = ({
/>
),
},
{
key: 'estimatedRouteDuration',
label: <span>{stringGetter({ key: STRING_KEYS.ESTIMATED_TIME })}</span>,
value: typeof summary?.estimatedRouteDuration === 'number' && (
<Output
type={OutputType.Text}
value={stringGetter({
key: STRING_KEYS.X_MINUTES_LOWERCASED,
params: { X: Math.round(summary?.estimatedRouteDuration / 60) },
})}
/>
),
},
];
const isFormValid = !isDisabled && !isEditingSlippage;
@@ -4,7 +4,7 @@ import styled, { type AnyStyledComponent } from 'styled-components';
import { ButtonAction, ButtonType } from '@/constants/buttons';
import { STRING_KEYS } from '@/constants/localization';
import { CLIENT_NETWORK_CONFIGS } from '@/constants/networks';
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
import { useAccounts, useStringGetter, useSubaccount } from '@/hooks';
import { layoutMixins } from '@/styles/layoutMixins';
@@ -65,7 +65,7 @@ export const TestnetDepositForm = ({ onDeposit, onError }: DepositFormProps) =>
key: STRING_KEYS.CREDITED_WITH,
params: {
AMOUNT_USD:
CLIENT_NETWORK_CONFIGS[selectedNetwork].ethereumChainId === 'dydxprotocol-testnet'
ENVIRONMENT_CONFIG_MAP[selectedNetwork].ethereumChainId === 'dydxprotocol-testnet'
? 1000
: 100,
},
@@ -4,6 +4,7 @@ import styled, { type AnyStyledComponent } from 'styled-components';
import type { NumberFormatValues } from 'react-number-format';
import { shallowEqual, useSelector } from 'react-redux';
import { TESTNET_CHAIN_ID } from '@dydxprotocol/v4-client-js';
import { isAddress } from 'viem';
import { TransferInputField, TransferInputTokenResource, TransferType } from '@/constants/abacus';
import { AlertType } from '@/constants/alerts';
@@ -26,6 +27,7 @@ import { Link } from '@/components/Link';
import { OutputType } from '@/components/Output';
import { Tag } from '@/components/Tag';
import { WithDetailsReceipt } from '@/components/WithDetailsReceipt';
import { Icon, IconName } from '@/components/Icon';
import { ChainSelectMenu } from '@/views/forms/AccountManagementForms/ChainSelectMenu';
@@ -59,6 +61,8 @@ export const WithdrawForm = () => {
resources,
} = useSelector(getTransferInputs, shallowEqual) || {};
const isValidAddress = toAddress && isAddress(toAddress);
const toToken = useMemo(
() => (token ? resources?.tokenResources?.get(token) : undefined),
[token, resources]
@@ -179,7 +183,6 @@ export const WithdrawForm = () => {
const onSelectChain = useCallback((chain: string) => {
if (chain) {
abacusStateManager.clearTransferInputValues();
abacusStateManager.setTransferValue({
field: TransferInputField.chain,
value: chain,
@@ -190,7 +193,6 @@ export const WithdrawForm = () => {
const onSelectToken = useCallback((token: TransferInputTokenResource) => {
if (token) {
abacusStateManager.clearTransferInputValues();
abacusStateManager.setTransferValue({
field: TransferInputField.token,
value: token.address,
@@ -265,7 +267,12 @@ export const WithdrawForm = () => {
placeholder={stringGetter({ key: STRING_KEYS.ADDRESS })}
onChange={onChangeAddress}
value={toAddress || ''}
label={stringGetter({ key: STRING_KEYS.DESTINATION })}
label={
<span>
{stringGetter({ key: STRING_KEYS.DESTINATION })}{' '}
{isValidAddress ? <Styled.CheckIcon iconName={IconName.Check} /> : null}
</span>
}
/>
<ChainSelectMenu
label={stringGetter({ key: STRING_KEYS.NETWORK })}
@@ -342,3 +349,10 @@ Styled.TransactionInfo = styled.span`
Styled.FormInputButton = styled(Button)`
${formMixins.inputInnerButton}
`;
Styled.CheckIcon = styled(Icon)`
margin: 0 1ch;
color: var(--color-positive);
font-size: 0.625rem;
`;
@@ -1,14 +1,19 @@
import { useState } from 'react';
import { shallowEqual, useSelector } from 'react-redux';
import styled, { type AnyStyledComponent } from 'styled-components';
import { formatUnits } from 'viem';
import { TransferInputTokenResource } from '@/constants/abacus';
import { ButtonAction, ButtonShape, ButtonSize, ButtonType } from '@/constants/buttons';
import { STRING_KEYS } from '@/constants/localization';
import { NumberSign } from '@/constants/numbers';
import { formatSeconds } from '@/lib/timeUtils';
import { layoutMixins } from '@/styles/layoutMixins';
import { useStringGetter } from '@/hooks';
import { useAccountBalance } from '@/hooks/useAccountBalance';
import { layoutMixins } from '@/styles/layoutMixins';
import { Button } from '@/components/Button';
@@ -16,6 +21,7 @@ import { Details, DetailsItem } from '@/components/Details';
import { DiffOutput } from '@/components/DiffOutput';
import { Icon, IconName } from '@/components/Icon';
import { Output, OutputType } from '@/components/Output';
import { Tag } from '@/components/Tag';
import { ToggleButton } from '@/components/ToggleButton';
import { WithReceipt } from '@/components/WithReceipt';
@@ -49,22 +55,14 @@ export const WithdrawButtonAndReceipt = ({
const [isEditingSlippage, setIsEditingSlipapge] = useState(false);
const stringGetter = useStringGetter();
// TODO: uncomment when we have a way to get token amount estimate from abacus
// const { balance, queryStatus } = useAccountBalance({
// addressOrDenom: withdrawToken?.address || undefined,
// assetSymbol: withdrawToken?.symbol || undefined,
// chainId: withdrawChain ? parseInt(withdrawChain) : undefined,
// decimals: withdrawToken?.decimals || undefined,
// isCosmosChain: false,
// });
// const balanceBN = MustBigNumber(balance);
// const newBalance =
// // toAmountMin && withdrawToken && parseUnits(toAmountMin, withdrawToken.decimals).toString();
const { leverage } = useSelector(getSubaccount, shallowEqual) || {};
const { summary, requestPayload } = useSelector(getTransferInputs, shallowEqual) || {};
const toAmount =
summary?.toAmount &&
withdrawToken?.decimals &&
formatUnits(BigInt(summary.toAmount), withdrawToken?.decimals);
const feeSubitems: DetailsItem[] = [];
if (typeof summary?.gasFee === 'number') {
@@ -98,9 +96,27 @@ export const WithdrawButtonAndReceipt = ({
),
subitems: feeSubitems,
},
{
key: 'wallet',
label: (
<span>
{stringGetter({ key: STRING_KEYS.AMOUNT_RECEIVED })}{' '}
{withdrawToken && <Tag>{withdrawToken?.symbol}</Tag>}
</span>
),
value: (
<Styled.DiffOutput
type={OutputType.Asset}
value={'0'}
newValue={toAmount}
sign={NumberSign.Positive}
withDiff={Boolean(toAmount)}
/>
),
},
{
key: 'leverage',
label: <span>{stringGetter({ key: STRING_KEYS.LEVERAGE })}</span>,
label: <span>{stringGetter({ key: STRING_KEYS.ACCOUNT_LEVERAGE })}</span>,
value: (
<Styled.DiffOutput
type={OutputType.Multiple}
@@ -137,25 +153,19 @@ export const WithdrawButtonAndReceipt = ({
/>
),
},
// TODO: uncomment when we have a way to get token amount estimate from abacus
// {
// key: 'wallet',
// label: (
// <span>
// {stringGetter({ key: STRING_KEYS.WALLET })}{' '}
// {withdrawToken && <Tag>{withdrawToken?.symbol}</Tag>}
// </span>
// ),
// value: (
// <Styled.DiffOutput
// type={OutputType.Asset}
// value={balanceBN?.toString()}
// newValue={newBalance}
// sign={NumberSign.Negative}
// withDiff={Boolean(balance !== newBalance)}
// />
// ),
// },
{
key: 'estimatedRouteDuration',
label: <span>{stringGetter({ key: STRING_KEYS.ESTIMATED_TIME })}</span>,
value: typeof summary?.estimatedRouteDuration === 'number' && (
<Output
type={OutputType.Text}
value={stringGetter({
key: STRING_KEYS.X_MINUTES_LOWERCASED,
params: { X: Math.round(summary?.estimatedRouteDuration / 60) },
})}
/>
),
},
];
const isFormValid = !isDisabled && !isEditingSlippage;
+2 -2
View File
@@ -80,7 +80,7 @@ export const ClosePositionForm = ({
const { closePosition } = useSubaccount();
const market = useSelector(getCurrentMarketId);
const { symbol } = useSelector(getCurrentMarketAssetData, shallowEqual) || {};
const { id } = useSelector(getCurrentMarketAssetData, shallowEqual) || {};
const { stepSizeDecimals } = useSelector(getCurrentMarketConfig, shallowEqual) || {};
const { size: sizeData, summary } = useSelector(getInputClosePositionData, shallowEqual) || {};
const { size, percent } = sizeData || {};
@@ -193,7 +193,7 @@ export const ClosePositionForm = ({
label={
<>
{stringGetter({ key: STRING_KEYS.AMOUNT })}
{symbol && <Tag>{symbol}</Tag>}
{id && <Tag>{id}</Tag>}
</>
}
decimals={stepSizeDecimals || TOKEN_DECIMALS}
@@ -6,7 +6,7 @@ import { layoutMixins } from '@/styles/layoutMixins';
import { formMixins } from '@/styles/formMixins';
import { TradeInputField } from '@/constants/abacus';
import { STRING_KEYS } from '@/constants/localization';
import { STRING_KEYS, StringKey } from '@/constants/localization';
import { INTEGER_DECIMALS } from '@/constants/numbers';
import { TimeUnitShort } from '@/constants/time';
import { GOOD_TIL_TIME_TIMESCALE_STRINGS } from '@/constants/trade';
@@ -29,12 +29,12 @@ export const AdvancedTradeOptions = () => {
const currentTradeFormConfig = useSelector(getInputTradeOptions, shallowEqual);
const inputTradeData = useSelector(getInputTradeData, shallowEqual);
const { execution, goodUntil, postOnly, reduceOnly, timeInForce } = inputTradeData || {};
const { execution, goodTil, postOnly, reduceOnly, timeInForce } = inputTradeData || {};
const { executionOptions, needsGoodUntil, needsPostOnly, needsReduceOnly, timeInForceOptions } =
currentTradeFormConfig || {};
const { duration, unit } = goodUntil || {};
const { duration, unit } = goodTil || {};
const needsExecution = executionOptions || needsPostOnly || needsReduceOnly;
@@ -62,7 +62,7 @@ export const AdvancedTradeOptions = () => {
<Styled.SelectItem
key={type}
value={type}
label={stringGetter({ key: stringKey })}
label={stringGetter({ key: stringKey as StringKey })}
/>
))}
</Styled.SelectMenu>
@@ -76,7 +76,7 @@ export const AdvancedTradeOptions = () => {
onChange={({ value }: NumberFormatValues) => {
abacusStateManager.setTradeValue({
value: Number(value),
field: TradeInputField.goodUntilDuration,
field: TradeInputField.goodTilDuration,
});
}}
value={duration ?? ''}
@@ -86,7 +86,7 @@ export const AdvancedTradeOptions = () => {
onValueChange={(goodTilTimeTimescale: string) => {
abacusStateManager.setTradeValue({
value: goodTilTimeTimescale,
field: TradeInputField.goodUntilUnit,
field: TradeInputField.goodTilUnit,
});
}}
>
@@ -121,7 +121,7 @@ export const AdvancedTradeOptions = () => {
<Styled.SelectItem
key={type}
value={type}
label={stringGetter({ key: stringKey })}
label={stringGetter({ key: stringKey as StringKey })}
/>
))}
</Styled.SelectMenu>
@@ -21,7 +21,7 @@ type ElementProps = {
export const PositionPreview = ({ showNarrowVariation }: ElementProps) => {
const stringGetter = useStringGetter();
const { symbol } = useSelector(getCurrentMarketAssetData, shallowEqual) || {};
const { id } = useSelector(getCurrentMarketAssetData, shallowEqual) || {};
const { configs, oraclePrice } = useSelector(getCurrentMarketData, shallowEqual) || {};
const { size: positionSize } = useSelector(getCurrentMarketPositionData, shallowEqual) || {};
const { stepSizeDecimals, tickSizeDecimals } = configs || {};
@@ -29,12 +29,12 @@ export const PositionPreview = ({ showNarrowVariation }: ElementProps) => {
return (
<Styled.PositionPreviewContainer>
<Styled.YourPosition>
{!showNarrowVariation && <AssetIcon symbol={symbol} />}
{!showNarrowVariation && <AssetIcon symbol={id} />}
<span>
{stringGetter({
key: STRING_KEYS.YOUR_MARKET_POSITION,
params: {
MARKET: showNarrowVariation ? '' : <strong>{symbol ?? ''}</strong>,
MARKET: showNarrowVariation ? '' : <strong>{id ?? ''}</strong>,
},
})}
</span>
@@ -44,7 +44,7 @@ export const PositionPreview = ({ showNarrowVariation }: ElementProps) => {
oraclePrice={oraclePrice}
postOrderSize={positionSize?.postOrder}
stepSizeDecimals={stepSizeDecimals}
symbol={symbol || undefined}
symbol={id || undefined}
tickSizeDecimals={tickSizeDecimals}
showNarrowVariation={showNarrowVariation}
/>
@@ -40,7 +40,7 @@ export const TradeSizeInputs = () => {
const stringGetter = useStringGetter();
const { isTablet } = useBreakpoints();
const { symbol } = useSelector(getCurrentMarketAssetData, shallowEqual) || {};
const { id } = useSelector(getCurrentMarketAssetData, shallowEqual) || {};
const inputTradeSizeData = useSelector(getInputTradeSizeData, shallowEqual);
const currentTradeInputOptions = useSelector(getInputTradeOptions, shallowEqual);
@@ -94,7 +94,7 @@ export const TradeSizeInputs = () => {
shape={ButtonShape.Square}
>
<Icon iconName={IconName.Trade} />
{showUSDCInputOnTablet ? 'USD' : symbol}
{showUSDCInputOnTablet ? 'USD' : id}
</Styled.ToggleButton>
);
@@ -105,10 +105,10 @@ export const TradeSizeInputs = () => {
onInput={onSizeInput}
label={
<>
<WithTooltip tooltip="order-amount" stringParams={{ SYMBOL: symbol ?? '' }} side="right">
<WithTooltip tooltip="order-amount" stringParams={{ SYMBOL: id ?? '' }} side="right">
{stringGetter({ key: STRING_KEYS.AMOUNT })}
</WithTooltip>
{symbol && <Tag>{symbol}</Tag>}
{id && <Tag>{id}</Tag>}
</>
}
slotRight={isTablet && inputToggleButton}
@@ -126,11 +126,7 @@ export const TradeSizeInputs = () => {
decimals={tickSizeDecimals || USD_DECIMALS}
label={
<>
<WithTooltip
tooltip="order-amount-usd"
stringParams={{ SYMBOL: symbol ?? '' }}
side="right"
>
<WithTooltip tooltip="order-amount-usd" stringParams={{ SYMBOL: id ?? '' }} side="right">
{stringGetter({ key: STRING_KEYS.AMOUNT })}
</WithTooltip>
<Tag>USD</Tag>
+13 -5
View File
@@ -11,9 +11,13 @@ import { TransferInputField, TransferType } from '@/constants/abacus';
import { AlertType } from '@/constants/alerts';
import { ButtonShape, ButtonSize } from '@/constants/buttons';
import { STRING_KEYS } from '@/constants/localization';
import { CLIENT_NETWORK_CONFIGS } from '@/constants/networks';
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
import { NumberSign, QUANTUM_MULTIPLIER } from '@/constants/numbers';
import { DYDX_CHAIN_ASSET_COIN_DENOM, DYDX_CHAIN_ASSET_TAGS, DydxChainAsset } from '@/constants/wallets';
import {
DYDX_CHAIN_ASSET_COIN_DENOM,
DYDX_CHAIN_ASSET_TAGS,
DydxChainAsset,
} from '@/constants/wallets';
import {
useAccountBalance,
@@ -60,7 +64,11 @@ export const TransferForm = ({
const stringGetter = useStringGetter();
const { freeCollateral } = useSelector(getSubaccount, shallowEqual) || {};
const { dydxAddress } = useAccounts();
const { address: recipientAddress, size, fee } = useSelector(getTransferInputs, shallowEqual) || {};
const {
address: recipientAddress,
size,
fee,
} = useSelector(getTransferInputs, shallowEqual) || {};
const { transfer } = useSubaccount();
const { nativeTokenBalance, usdcBalance } = useAccountBalance();
const { selectedNetwork } = useSelectedNetwork();
@@ -193,7 +201,7 @@ export const TransferForm = ({
const networkOptions = [
{
chainId: CLIENT_NETWORK_CONFIGS[selectedNetwork].dydxChainId,
chainId: ENVIRONMENT_CONFIG_MAP[selectedNetwork].dydxChainId,
label: (
<Styled.InlineRow>
<AssetIcon symbol="DYDX" /> {stringGetter({ key: STRING_KEYS.DYDX_CHAIN })}
@@ -283,7 +291,7 @@ export const TransferForm = ({
/>
<Styled.NetworkSelectMenu
label={stringGetter({ key: STRING_KEYS.NETWORK })}
value={CLIENT_NETWORK_CONFIGS[selectedNetwork].dydxChainId}
value={ENVIRONMENT_CONFIG_MAP[selectedNetwork].dydxChainId}
slotTriggerAfter={null}
>
{networkOptions.map(({ chainId, label }) => (
+7 -9
View File
@@ -129,15 +129,13 @@ export const useGlobalCommands = (): MenuConfig<string, string> => {
{
value: NavItems.NavigateToMarket,
label: 'Navigate to Market',
subitems: joinedPerpetualMarketsAndAssets.map(
({ market = '', name = '', symbol = '' }) => ({
value: market, // `${market}|${name}`,
slotBefore: <AssetIcon symbol={symbol} />,
label: name,
tag: symbol, // <abbr>{symbol}</abbr>,
onSelect: () => navigate(`/trade/${market}`),
})
),
subitems: joinedPerpetualMarketsAndAssets.map(({ market = '', name = '', id = '' }) => ({
value: market,
slotBefore: <AssetIcon symbol={id} />,
label: name,
tag: id,
onSelect: () => navigate(`/trade/${market}`),
})),
},
],
},
+10 -10
View File
@@ -1,13 +1,13 @@
import { type MenuItem } from '@/constants/menus';
import { type DydxNetwork, NETWORK_ENDPOINTS } from '@/constants/networks';
import { useStringGetter } from '@/hooks';
import {
AVAILABLE_ENVIRONMENTS,
type DydxNetwork,
ENVIRONMENT_CONFIG_MAP,
} from '@/constants/networks';
export const useNetworks = (): MenuItem<DydxNetwork>[] => {
const stringGetter = useStringGetter();
return NETWORK_ENDPOINTS.environments.map(({ stringKey, environment }) => ({
key: environment,
label: stringGetter({ key: stringKey }),
value: environment,
export const useNetworks = (): MenuItem<DydxNetwork>[] =>
(AVAILABLE_ENVIRONMENTS.environments as DydxNetwork[]).map((dydxNetwork) => ({
key: dydxNetwork,
label: ENVIRONMENT_CONFIG_MAP[dydxNetwork].name,
value: dydxNetwork,
}));
};
+4 -6
View File
@@ -89,8 +89,8 @@ const getFillsTableColumnDef = ({
label: `${stringGetter({ key: STRING_KEYS.TYPE })} / ${stringGetter({
key: STRING_KEYS.AMOUNT,
})}`,
renderCell: ({ resources, size, stepSizeDecimals, asset: { symbol } }) => (
<TableCell stacked slotLeft={<Styled.AssetIcon symbol={symbol} />}>
renderCell: ({ resources, size, stepSizeDecimals, asset: { id } }) => (
<TableCell stacked slotLeft={<Styled.AssetIcon symbol={id} />}>
<span>
{resources.typeStringKey ? stringGetter({ key: resources.typeStringKey }) : null}
</span>
@@ -161,7 +161,7 @@ const getFillsTableColumnDef = ({
}[orderSide],
})}
</Styled.Side>
<Output type={OutputType.Text} value={asset.symbol} />
<Output type={OutputType.Text} value={asset.id} />
</Styled.TableCell>
),
},
@@ -325,9 +325,7 @@ export const FillsTable = ({
if (hasUnseenFillUpdates) dispatch(viewedFills());
}, [hasUnseenFillUpdates]);
const symbol = currentMarket
? allAssets[allPerpetualMarkets[currentMarket]?.assetId]?.symbol
: null;
const symbol = currentMarket ? allAssets[allPerpetualMarkets[currentMarket]?.assetId]?.id : null;
const fillsData = fills.map((fill: SubaccountFill) =>
getHydratedTradingData({
+5 -2
View File
@@ -12,7 +12,10 @@ import { MarketTableCell } from '@/components/Table/MarketTableCell';
import { Output, OutputType } from '@/components/Output';
import { Table, TableCell, type ColumnDef } from '@/components/Table';
import { getCurrentMarketFundingPayments, getSubaccountFundingPayments } from '@/state/accountSelectors';
import {
getCurrentMarketFundingPayments,
getSubaccountFundingPayments,
} from '@/state/accountSelectors';
import { getAssets } from '@/state/assetsSelectors';
import { getPerpetualMarkets } from '@/state/perpetualsSelectors';
@@ -111,7 +114,7 @@ export const FundingPaymentsTable = ({
type={OutputType.Asset}
value={Math.abs(positionSize)}
fractionDigits={stepSizeDecimals}
tag={asset.symbol}
tag={asset.id}
/>
<Styled.Output
type={OutputType.Text}
+3 -3
View File
@@ -43,7 +43,7 @@ export const LiveTrades = ({ className, histogramSide = 'left' }: StyleProps) =>
const currentMarketConfig = useSelector(getCurrentMarketConfig, shallowEqual);
const currentMarketLiveTrades = useSelector(getCurrentMarketLiveTrades, shallowEqual) || [];
const { symbol = '' } = currentMarketAssetData ?? {};
const { id = '' } = currentMarketAssetData ?? {};
const { stepSizeDecimals, tickSizeDecimals } = currentMarketConfig || {};
const rows = currentMarketLiveTrades.map(
@@ -84,7 +84,7 @@ export const LiveTrades = ({ className, histogramSide = 'left' }: StyleProps) =>
columnKey: 'size',
getCellValue: (row: RowData) => row.size,
label: stringGetter({ key: STRING_KEYS.SIZE }),
tag: symbol,
tag: id,
renderCell: (row: RowData) => (
<Styled.SizeOutput
type={OutputType.Asset}
@@ -111,7 +111,7 @@ export const LiveTrades = ({ className, histogramSide = 'left' }: StyleProps) =>
},
!isTablet && timeColumn,
].filter(isTruthy);
}, [stepSizeDecimals, tickSizeDecimals, symbol, histogramSide, stringGetter]);
}, [stepSizeDecimals, tickSizeDecimals, id, histogramSide, stringGetter]);
return (
<Styled.LiveTradesTable
+2 -4
View File
@@ -37,9 +37,7 @@ export const MarketsTable = ({ className }: { className?: string }) => {
columnKey: 'market',
getCellValue: (row) => row.market,
label: stringGetter({ key: STRING_KEYS.MARKET }),
renderCell: ({ asset, id }) => (
<Styled.MarketTableCell asset={asset} marketId={id} />
),
renderCell: ({ asset, id }) => <Styled.MarketTableCell asset={asset} marketId={id} />,
},
{
columnKey: 'price',
@@ -144,7 +142,7 @@ export const MarketsTable = ({ className }: { className?: string }) => {
fractionDigits={LARGE_TOKEN_DECIMALS}
type={OutputType.Number}
value={row.openInterest}
tag={row.asset?.symbol}
tag={row.asset?.id}
/>
<Output
type={OutputType.Fiat}
+2 -2
View File
@@ -72,13 +72,13 @@ const getPositionsTableColumnDef = ({
getCellValue: (row) => row.id,
label: stringGetter({ key: STRING_KEYS.DETAILS }),
renderCell: ({ id, asset, leverage, resources, size }) => (
<TableCell stacked slotLeft={<Styled.AssetIcon symbol={asset?.symbol} />}>
<TableCell stacked slotLeft={<Styled.AssetIcon symbol={asset?.id} />}>
<Styled.HighlightOutput
type={OutputType.Asset}
value={size?.current}
fractionDigits={TOKEN_DECIMALS}
showSign={ShowSign.None}
tag={asset?.symbol}
tag={asset?.id}
/>
<Styled.InlineRow>
<Styled.PositionSide>