Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3631f51878 | ||
|
|
8518cb6837 | ||
|
|
b9024ca6df | ||
|
|
88fa4e26e4 | ||
|
|
daf862aa40 | ||
|
|
4e6742ba9d | ||
|
|
1ffbead4b3 | ||
|
|
8cfe4e9d85 | ||
|
|
d8383c1088 | ||
|
|
279a5239e5 | ||
|
|
c4b42a77df |
@@ -1,40 +0,0 @@
|
|||||||
name: Workflow for Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'release/v*'
|
|
||||||
- 'hotfix/v*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
sync-release-branch:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Setup Git
|
|
||||||
run: |
|
|
||||||
git config user.name "github-actions"
|
|
||||||
git config user.email "actions@github.com"
|
|
||||||
|
|
||||||
- name: Fetch all history
|
|
||||||
run: git fetch --unshallow || git fetch --all
|
|
||||||
|
|
||||||
- name: Determine Tag Type
|
|
||||||
id: tagtype
|
|
||||||
run: |
|
|
||||||
if [[ ${{ github.ref }} == refs/tags/release/v* ]]; then
|
|
||||||
echo "::set-output name=type::release"
|
|
||||||
elif [[ ${{ github.ref }} == refs/tags/hotfix/v* ]]; then
|
|
||||||
echo "::set-output name=type::hotfix"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Check out the release branch
|
|
||||||
run: |
|
|
||||||
git checkout release || git checkout -b release
|
|
||||||
|
|
||||||
- name: Sync release branch to tag
|
|
||||||
run: |
|
|
||||||
git reset --hard ${{ github.ref }}
|
|
||||||
git push -f origin release
|
|
||||||
+2
-2
@@ -40,9 +40,9 @@
|
|||||||
"@cosmjs/proto-signing": "^0.32.1",
|
"@cosmjs/proto-signing": "^0.32.1",
|
||||||
"@cosmjs/stargate": "^0.32.1",
|
"@cosmjs/stargate": "^0.32.1",
|
||||||
"@cosmjs/tendermint-rpc": "^0.32.1",
|
"@cosmjs/tendermint-rpc": "^0.32.1",
|
||||||
"@dydxprotocol/v4-abacus": "^1.4.9",
|
"@dydxprotocol/v4-abacus": "^1.4.6",
|
||||||
"@dydxprotocol/v4-client-js": "^1.0.20",
|
"@dydxprotocol/v4-client-js": "^1.0.20",
|
||||||
"@dydxprotocol/v4-localization": "^1.1.34",
|
"@dydxprotocol/v4-localization": "^1.1.31",
|
||||||
"@ethersproject/providers": "^5.7.2",
|
"@ethersproject/providers": "^5.7.2",
|
||||||
"@js-joda/core": "^5.5.3",
|
"@js-joda/core": "^5.5.3",
|
||||||
"@radix-ui/react-accordion": "^1.1.2",
|
"@radix-ui/react-accordion": "^1.1.2",
|
||||||
|
|||||||
Generated
+12
-12
@@ -1,9 +1,5 @@
|
|||||||
lockfileVersion: '6.0'
|
lockfileVersion: '6.0'
|
||||||
|
|
||||||
settings:
|
|
||||||
autoInstallPeers: true
|
|
||||||
excludeLinksFromLockfile: false
|
|
||||||
|
|
||||||
overrides:
|
overrides:
|
||||||
follow-redirects: 1.15.3
|
follow-redirects: 1.15.3
|
||||||
|
|
||||||
@@ -30,14 +26,14 @@ dependencies:
|
|||||||
specifier: ^0.32.1
|
specifier: ^0.32.1
|
||||||
version: 0.32.2
|
version: 0.32.2
|
||||||
'@dydxprotocol/v4-abacus':
|
'@dydxprotocol/v4-abacus':
|
||||||
specifier: ^1.4.9
|
specifier: ^1.4.6
|
||||||
version: 1.4.9
|
version: 1.4.6
|
||||||
'@dydxprotocol/v4-client-js':
|
'@dydxprotocol/v4-client-js':
|
||||||
specifier: ^1.0.20
|
specifier: ^1.0.20
|
||||||
version: 1.0.20
|
version: 1.0.20
|
||||||
'@dydxprotocol/v4-localization':
|
'@dydxprotocol/v4-localization':
|
||||||
specifier: ^1.1.34
|
specifier: ^1.1.31
|
||||||
version: 1.1.34
|
version: 1.1.31
|
||||||
'@ethersproject/providers':
|
'@ethersproject/providers':
|
||||||
specifier: ^5.7.2
|
specifier: ^5.7.2
|
||||||
version: 5.7.2
|
version: 5.7.2
|
||||||
@@ -1290,8 +1286,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-Gg5t+eR7vPJMAmhkFt6CZrzPd0EKpAslWwk5rFVYZpJsM8JG5KT9XQ99hgNM3Ov6ScNoIWbXkpX27F6A9cXR4Q==}
|
resolution: {integrity: sha512-Gg5t+eR7vPJMAmhkFt6CZrzPd0EKpAslWwk5rFVYZpJsM8JG5KT9XQ99hgNM3Ov6ScNoIWbXkpX27F6A9cXR4Q==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@dydxprotocol/v4-abacus@1.4.9:
|
/@dydxprotocol/v4-abacus@1.4.6:
|
||||||
resolution: {integrity: sha512-OnrD5Db7AGSxyQE+gWRmkBuXbkZMfSEDB+v2s+ft0zgd4D5j/WTZkk1RG0fn8ISV4AffoN5T24jBWxLfqVlmZw==}
|
resolution: {integrity: sha512-qYq+4TizcMMxYVXckn0LCucWBe5N9ZNtD1XnowCAuBUUifHSgMGvao5OeZIKMgNM/udSKOXLss4zLy6dH/G2SA==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@dydxprotocol/v4-client-js@1.0.20:
|
/@dydxprotocol/v4-client-js@1.0.20:
|
||||||
@@ -1323,8 +1319,8 @@ packages:
|
|||||||
- utf-8-validate
|
- utf-8-validate
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@dydxprotocol/v4-localization@1.1.34:
|
/@dydxprotocol/v4-localization@1.1.31:
|
||||||
resolution: {integrity: sha512-I7zivjv8gS+6b9n7/wh7PY9QEUDIIyLx9ugZ5K6ybar0xT/06yupOVdVE6iLivQ/IAsVi/RFHkD8bQd0DWCetg==}
|
resolution: {integrity: sha512-plJVIgFAKq9/hA/gk5GgKgCQFsH3pNtDWfG/yHLDXyiGX0M0mMEi1bTNVs4podFVoHJu1nSL9YPFlpJ00FteGw==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@dydxprotocol/v4-proto@4.0.0-dev.0:
|
/@dydxprotocol/v4-proto@4.0.0-dev.0:
|
||||||
@@ -16053,3 +16049,7 @@ packages:
|
|||||||
/zwitch@2.0.4:
|
/zwitch@2.0.4:
|
||||||
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
|
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
settings:
|
||||||
|
autoInstallPeers: true
|
||||||
|
excludeLinksFromLockfile: false
|
||||||
|
|||||||
+61
-31
@@ -98,7 +98,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -126,7 +127,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-dev-2": {
|
"dydxprotocol-dev-2": {
|
||||||
@@ -182,7 +184,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -210,7 +213,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-dev-4": {
|
"dydxprotocol-dev-4": {
|
||||||
@@ -267,7 +271,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -295,7 +300,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-dev-5": {
|
"dydxprotocol-dev-5": {
|
||||||
@@ -351,7 +357,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -379,7 +386,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-staging": {
|
"dydxprotocol-staging": {
|
||||||
@@ -437,7 +445,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -465,7 +474,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-staging-forced-update": {
|
"dydxprotocol-staging-forced-update": {
|
||||||
@@ -514,7 +524,8 @@
|
|||||||
"community": "https://discord.com/invite/dydx",
|
"community": "https://discord.com/invite/dydx",
|
||||||
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
||||||
"blogs": "https://www.dydx.foundation/blog",
|
"blogs": "https://www.dydx.foundation/blog",
|
||||||
"newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals"
|
"newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -549,7 +560,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-staging-west": {
|
"dydxprotocol-staging-west": {
|
||||||
@@ -607,7 +619,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -635,7 +648,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet": {
|
"dydxprotocol-testnet": {
|
||||||
@@ -697,7 +711,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -725,7 +740,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet-dydx": {
|
"dydxprotocol-testnet-dydx": {
|
||||||
@@ -784,7 +800,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -812,7 +829,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet-nodefleet": {
|
"dydxprotocol-testnet-nodefleet": {
|
||||||
@@ -871,7 +889,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -899,7 +918,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet-kingnodes": {
|
"dydxprotocol-testnet-kingnodes": {
|
||||||
@@ -958,7 +978,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -986,7 +1007,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet-liquify": {
|
"dydxprotocol-testnet-liquify": {
|
||||||
@@ -1045,7 +1067,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -1073,7 +1096,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet-polkachu": {
|
"dydxprotocol-testnet-polkachu": {
|
||||||
@@ -1123,7 +1147,8 @@
|
|||||||
"community": "https://discord.com/invite/dydx",
|
"community": "https://discord.com/invite/dydx",
|
||||||
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
"feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform",
|
||||||
"blogs": "https://www.dydx.foundation/blog",
|
"blogs": "https://www.dydx.foundation/blog",
|
||||||
"newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals"
|
"newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -1151,7 +1176,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet-bware": {
|
"dydxprotocol-testnet-bware": {
|
||||||
@@ -1210,7 +1236,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnmore": "https://help.dydx.exchange",
|
"accountExportLearnmore": "https://help.dydx.exchange",
|
||||||
"walletLearnmore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnmore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -1238,7 +1265,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-mainnet": {
|
"dydxprotocol-mainnet": {
|
||||||
@@ -1297,7 +1325,8 @@
|
|||||||
"keplrDashboard": "[HTTP link to keplr dashboard, can be null]",
|
"keplrDashboard": "[HTTP link to keplr dashboard, can be null]",
|
||||||
"strideZoneApp": "[HTTP link to stride zone app, can be null]",
|
"strideZoneApp": "[HTTP link to stride zone app, can be null]",
|
||||||
"accountExportLearnMore": "[HTTP link to account export learn more, can be null]",
|
"accountExportLearnMore": "[HTTP link to account export learn more, can be null]",
|
||||||
"walletLearnMore": "[HTTP link to wallet learn more, can be null]"
|
"walletLearnMore": "[HTTP link to wallet learn more, can be null]",
|
||||||
|
"withdrawalGateLearnMore": "[HTTP link to withdrawal gate learn more, can be null]"
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
"walletconnect": {
|
"walletconnect": {
|
||||||
@@ -1325,8 +1354,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -428,13 +428,6 @@
|
|||||||
"whitepaperLink": "https://solana.com/solana-whitepaper.pdf",
|
"whitepaperLink": "https://solana.com/solana-whitepaper.pdf",
|
||||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/solana/"
|
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/solana/"
|
||||||
},
|
},
|
||||||
"STRK-USD": {
|
|
||||||
"name": "Starknet",
|
|
||||||
"tags": ["Layer 2"],
|
|
||||||
"websiteLink": "https://www.starknet.io/en",
|
|
||||||
"whitepaperLink": "https://docs.starknet.io/documentation/",
|
|
||||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/starknet-token/"
|
|
||||||
},
|
|
||||||
"STX-USD": {
|
"STX-USD": {
|
||||||
"name": "Stacks",
|
"name": "Stacks",
|
||||||
"tags": ["Layer 2"],
|
"tags": ["Layer 2"],
|
||||||
|
|||||||
@@ -513,14 +513,6 @@
|
|||||||
{ "exchangeName": "Okx", "ticker": "SOL-USDT", "adjustByMarket": "USDT-USD" },
|
{ "exchangeName": "Okx", "ticker": "SOL-USDT", "adjustByMarket": "USDT-USD" },
|
||||||
{ "exchangeName": "Mexc", "ticker": "SOL_USDT", "adjustByMarket": "USDT-USD" }
|
{ "exchangeName": "Mexc", "ticker": "SOL_USDT", "adjustByMarket": "USDT-USD" }
|
||||||
],
|
],
|
||||||
"STRK": [
|
|
||||||
{ "exchangeName": "Binance", "ticker": "STRKUSDT", "adjustByMarket": "USDT-USD" },
|
|
||||||
{ "exchangeName": "Bybit", "ticker": "STRKUSDT", "adjustByMarket": "USDT-USD" },
|
|
||||||
{ "exchangeName": "Kraken", "ticker": "STRKUSD" },
|
|
||||||
{ "exchangeName": "Kucoin", "ticker": "STRK-USDT", "adjustByMarket": "USDT-USD" },
|
|
||||||
{ "exchangeName": "Okx", "ticker": "STRK-USDT", "adjustByMarket": "USDT-USD" },
|
|
||||||
{ "exchangeName": "Gate", "ticker": "STRK_USDT", "adjustByMarket": "USDT-USD" }
|
|
||||||
],
|
|
||||||
"STX": [
|
"STX": [
|
||||||
{ "exchangeName": "Binance", "ticker": "STXUSDT", "adjustByMarket": "USDT-USD" },
|
{ "exchangeName": "Binance", "ticker": "STXUSDT", "adjustByMarket": "USDT-USD" },
|
||||||
{ "exchangeName": "Bybit", "ticker": "STXUSDT", "adjustByMarket": "USDT-USD" },
|
{ "exchangeName": "Bybit", "ticker": "STXUSDT", "adjustByMarket": "USDT-USD" },
|
||||||
|
|||||||
@@ -968,23 +968,6 @@
|
|||||||
"minOrderSize": 1000000,
|
"minOrderSize": 1000000,
|
||||||
"quantumConversionExponent": -9
|
"quantumConversionExponent": -9
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"baseAsset": "STRK",
|
|
||||||
"referencePrice": 2.05,
|
|
||||||
"numOracles": 6,
|
|
||||||
"liquidityTier": 2,
|
|
||||||
"assetName": "Starknet",
|
|
||||||
"p": 0.0,
|
|
||||||
"atomicResolution": -6.0,
|
|
||||||
"minExchanges": 3,
|
|
||||||
"minPriceChangePpm": 4000,
|
|
||||||
"priceExponent": -9.0,
|
|
||||||
"stepBaseQuantum": 1000000,
|
|
||||||
"ticksizeExponent": -3,
|
|
||||||
"subticksPerTick": 1000000,
|
|
||||||
"minOrderSize": 1000000,
|
|
||||||
"quantumConversionExponent": -9
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"baseAsset": "STX",
|
"baseAsset": "STX",
|
||||||
"referencePrice": 1.5144048703611412,
|
"referencePrice": 1.5144048703611412,
|
||||||
|
|||||||
+37
-19
@@ -71,7 +71,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"dydx-testnet-4": {
|
"dydx-testnet-4": {
|
||||||
"tos": "https://dydx.exchange/v4-terms",
|
"tos": "https://dydx.exchange/v4-terms",
|
||||||
@@ -92,7 +93,8 @@
|
|||||||
"keplrDashboard": "https://testnet.keplr.app/",
|
"keplrDashboard": "https://testnet.keplr.app/",
|
||||||
"strideZoneApp": "https://testnet.stride.zone",
|
"strideZoneApp": "https://testnet.stride.zone",
|
||||||
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
"accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain",
|
||||||
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet"
|
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
|
||||||
|
"withdrawalGateLearnMore": "https://help.dydx.exchange"
|
||||||
},
|
},
|
||||||
"[mainnet chain id]": {
|
"[mainnet chain id]": {
|
||||||
"tos": "[HTTP link to TOS]",
|
"tos": "[HTTP link to TOS]",
|
||||||
@@ -113,7 +115,8 @@
|
|||||||
"keplrDashboard": "[HTTP link to keplr dashboard, can be null]",
|
"keplrDashboard": "[HTTP link to keplr dashboard, can be null]",
|
||||||
"strideZoneApp": "[HTTP link to stride zone app, can be null]",
|
"strideZoneApp": "[HTTP link to stride zone app, can be null]",
|
||||||
"accountExportLearnMore": "[HTTP link to account export learn more, can be null]",
|
"accountExportLearnMore": "[HTTP link to account export learn more, can be null]",
|
||||||
"walletLearnMore": "[HTTP link to wallet learn more, can be null]"
|
"walletLearnMore": "[HTTP link to wallet learn more, can be null]",
|
||||||
|
"withdrawalGateLearnMore": "[HTTP link to withdrawal gate learn more, can be null]"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"wallets": {
|
"wallets": {
|
||||||
@@ -258,7 +261,8 @@
|
|||||||
"faucet": "https://faucet.v4dev.dydx.exchange"
|
"faucet": "https://faucet.v4dev.dydx.exchange"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-dev-2": {
|
"dydxprotocol-dev-2": {
|
||||||
@@ -283,7 +287,8 @@
|
|||||||
"nobleValidator": "https://noble-testnet-rpc.polkachu.com/"
|
"nobleValidator": "https://noble-testnet-rpc.polkachu.com/"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-dev-4": {
|
"dydxprotocol-dev-4": {
|
||||||
@@ -309,7 +314,8 @@
|
|||||||
"faucet": "https://faucet.v4dev4.dydx.exchange"
|
"faucet": "https://faucet.v4dev4.dydx.exchange"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-dev-5": {
|
"dydxprotocol-dev-5": {
|
||||||
@@ -334,7 +340,8 @@
|
|||||||
"nobleValidator": "https://noble-testnet-rpc.polkachu.com/"
|
"nobleValidator": "https://noble-testnet-rpc.polkachu.com/"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-staging": {
|
"dydxprotocol-staging": {
|
||||||
@@ -360,7 +367,8 @@
|
|||||||
"nobleValidator": "https://noble-testnet-rpc.polkachu.com/"
|
"nobleValidator": "https://noble-testnet-rpc.polkachu.com/"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-staging-forced-update": {
|
"dydxprotocol-staging-forced-update": {
|
||||||
@@ -393,7 +401,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-staging-west": {
|
"dydxprotocol-staging-west": {
|
||||||
@@ -419,7 +428,8 @@
|
|||||||
"nobleValidator": "https://noble-testnet-rpc.polkachu.com/"
|
"nobleValidator": "https://noble-testnet-rpc.polkachu.com/"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": true
|
"reduceOnlySupported": true,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet": {
|
"dydxprotocol-testnet": {
|
||||||
@@ -449,7 +459,8 @@
|
|||||||
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet-dydx": {
|
"dydxprotocol-testnet-dydx": {
|
||||||
@@ -475,7 +486,8 @@
|
|||||||
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet-nodefleet": {
|
"dydxprotocol-testnet-nodefleet": {
|
||||||
@@ -501,7 +513,8 @@
|
|||||||
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet-kingnodes": {
|
"dydxprotocol-testnet-kingnodes": {
|
||||||
@@ -527,7 +540,8 @@
|
|||||||
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet-liquify": {
|
"dydxprotocol-testnet-liquify": {
|
||||||
@@ -553,7 +567,8 @@
|
|||||||
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet-polkachu": {
|
"dydxprotocol-testnet-polkachu": {
|
||||||
@@ -579,7 +594,8 @@
|
|||||||
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-testnet-bware": {
|
"dydxprotocol-testnet-bware": {
|
||||||
@@ -605,7 +621,8 @@
|
|||||||
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
"faucet": "https://faucet.v4testnet.dydx.exchange"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dydxprotocol-mainnet": {
|
"dydxprotocol-mainnet": {
|
||||||
@@ -631,8 +648,9 @@
|
|||||||
"nobleValidator": "[noble validator endpoint for mainnet]"
|
"nobleValidator": "[noble validator endpoint for mainnet]"
|
||||||
},
|
},
|
||||||
"featureFlags": {
|
"featureFlags": {
|
||||||
"reduceOnlySupported": false
|
"reduceOnlySupported": false,
|
||||||
|
"withdrawalSafetyEnabled": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
@@ -7,7 +7,12 @@ type ElementProps = {
|
|||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type StyleProps = {
|
||||||
|
className?: string;
|
||||||
|
};
|
||||||
|
|
||||||
export const BackButton = ({
|
export const BackButton = ({
|
||||||
|
className,
|
||||||
onClick = () => {
|
onClick = () => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const navigation = globalThis.navigation;
|
const navigation = globalThis.navigation;
|
||||||
@@ -21,8 +26,9 @@ export const BackButton = ({
|
|||||||
navigation.navigate('/', { replace: true });
|
navigation.navigate('/', { replace: true });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}: ElementProps) => (
|
}: ElementProps & StyleProps) => (
|
||||||
<IconButton
|
<IconButton
|
||||||
|
className={className}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
iconName={IconName.ChevronLeft}
|
iconName={IconName.ChevronLeft}
|
||||||
size={ButtonSize.Small}
|
size={ButtonSize.Small}
|
||||||
|
|||||||
+76
-16
@@ -47,6 +47,7 @@ type StyleProps = {
|
|||||||
hasHeaderBorder?: boolean;
|
hasHeaderBorder?: boolean;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
stacked?: boolean;
|
||||||
withAnimation?: boolean;
|
withAnimation?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -81,6 +82,7 @@ export const Dialog = ({
|
|||||||
slotTrigger,
|
slotTrigger,
|
||||||
slotHeaderInner,
|
slotHeaderInner,
|
||||||
slotFooter,
|
slotFooter,
|
||||||
|
stacked,
|
||||||
withClose = true,
|
withClose = true,
|
||||||
placement = DialogPlacement.Default,
|
placement = DialogPlacement.Default,
|
||||||
portalContainer,
|
portalContainer,
|
||||||
@@ -109,27 +111,48 @@ export const Dialog = ({
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
$stacked={stacked}
|
||||||
$withAnimation={withAnimation}
|
$withAnimation={withAnimation}
|
||||||
>
|
>
|
||||||
<Styled.Header $withBorder={hasHeaderBorder}>
|
{stacked ? (
|
||||||
<Styled.HeaderTopRow>
|
<Styled.StackedHeaderTopRow $withBorder={hasHeaderBorder}>
|
||||||
{onBack && <BackButton onClick={onBack} />}
|
{onBack && <Styled.BackButton onClick={onBack} />}
|
||||||
|
|
||||||
{slotIcon && <Styled.Icon>{slotIcon}</Styled.Icon>}
|
{slotIcon}
|
||||||
|
|
||||||
{title && <Styled.Title>{title}</Styled.Title>}
|
|
||||||
|
|
||||||
{!preventClose && withClose && (
|
{!preventClose && withClose && (
|
||||||
<Styled.Close ref={closeButtonRef}>
|
<Styled.Close ref={closeButtonRef} $absolute={stacked}>
|
||||||
<Icon iconName={IconName.Close} />
|
<Icon iconName={IconName.Close} />
|
||||||
</Styled.Close>
|
</Styled.Close>
|
||||||
)}
|
)}
|
||||||
</Styled.HeaderTopRow>
|
|
||||||
|
|
||||||
{description && <Styled.Description>{description}</Styled.Description>}
|
{title && <Styled.Title>{title}</Styled.Title>}
|
||||||
|
|
||||||
{slotHeaderInner}
|
{description && <Styled.Description>{description}</Styled.Description>}
|
||||||
</Styled.Header>
|
|
||||||
|
{slotHeaderInner}
|
||||||
|
</Styled.StackedHeaderTopRow>
|
||||||
|
) : (
|
||||||
|
<Styled.Header $withBorder={hasHeaderBorder}>
|
||||||
|
<Styled.HeaderTopRow>
|
||||||
|
{onBack && <BackButton onClick={onBack} />}
|
||||||
|
|
||||||
|
{slotIcon && <Styled.Icon>{slotIcon}</Styled.Icon>}
|
||||||
|
|
||||||
|
{title && <Styled.Title>{title}</Styled.Title>}
|
||||||
|
|
||||||
|
{!preventClose && withClose && (
|
||||||
|
<Styled.Close ref={closeButtonRef}>
|
||||||
|
<Icon iconName={IconName.Close} />
|
||||||
|
</Styled.Close>
|
||||||
|
)}
|
||||||
|
</Styled.HeaderTopRow>
|
||||||
|
|
||||||
|
{description && <Styled.Description>{description}</Styled.Description>}
|
||||||
|
|
||||||
|
{slotHeaderInner}
|
||||||
|
</Styled.Header>
|
||||||
|
)}
|
||||||
|
|
||||||
<Styled.Content>{children}</Styled.Content>
|
<Styled.Content>{children}</Styled.Content>
|
||||||
|
|
||||||
@@ -173,7 +196,11 @@ Styled.Overlay = styled(Overlay)`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Container = styled(Content)<{ placement: DialogPlacement; $withAnimation?: boolean }>`
|
Styled.Container = styled(Content)<{
|
||||||
|
placement: DialogPlacement;
|
||||||
|
$stacked?: boolean;
|
||||||
|
$withAnimation?: boolean;
|
||||||
|
}>`
|
||||||
/* Params */
|
/* Params */
|
||||||
--dialog-inset: 1rem;
|
--dialog-inset: 1rem;
|
||||||
--dialog-width: 30rem;
|
--dialog-width: 30rem;
|
||||||
@@ -353,6 +380,13 @@ Styled.Container = styled(Content)<{ placement: DialogPlacement; $withAnimation?
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
`,
|
`,
|
||||||
}[placement])}
|
}[placement])}
|
||||||
|
|
||||||
|
${({ $stacked }) =>
|
||||||
|
$stacked &&
|
||||||
|
css`
|
||||||
|
justify-content: center;
|
||||||
|
text-align: center;
|
||||||
|
`}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Header = styled.header<{ $withBorder: boolean }>`
|
Styled.Header = styled.header<{ $withBorder: boolean }>`
|
||||||
@@ -379,9 +413,21 @@ Styled.HeaderTopRow = styled.div`
|
|||||||
gap: var(--dialog-title-gap);
|
gap: var(--dialog-title-gap);
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.HeaderTopRow = styled.div`
|
Styled.StackedHeaderTopRow = styled.div<{ $withBorder: boolean }>`
|
||||||
${layoutMixins.row}
|
${layoutMixins.flexColumn}
|
||||||
gap: var(--dialog-title-gap);
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: var(--dialog-header-paddingTop) var(--dialog-header-paddingLeft)
|
||||||
|
var(--dialog-header-paddingBottom) var(--dialog-header-paddingRight);
|
||||||
|
border-top-left-radius: inherit;
|
||||||
|
border-top-right-radius: inherit;
|
||||||
|
|
||||||
|
${({ $withBorder }) =>
|
||||||
|
$withBorder &&
|
||||||
|
css`
|
||||||
|
${layoutMixins.withOuterBorder};
|
||||||
|
background: var(--dialog-backgroundColor);
|
||||||
|
`};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Content = styled.div`
|
Styled.Content = styled.div`
|
||||||
@@ -412,7 +458,7 @@ Styled.Icon = styled.div`
|
|||||||
line-height: 1;
|
line-height: 1;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
Styled.Close = styled(Close)`
|
Styled.Close = styled(Close)<{ $absolute?: boolean }>`
|
||||||
width: 0.7813rem;
|
width: 0.7813rem;
|
||||||
height: 0.7813rem;
|
height: 0.7813rem;
|
||||||
|
|
||||||
@@ -438,6 +484,14 @@ Styled.Close = styled(Close)`
|
|||||||
color: var(--color-text-2);
|
color: var(--color-text-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
${({ $absolute }) =>
|
||||||
|
$absolute &&
|
||||||
|
css`
|
||||||
|
position: absolute;
|
||||||
|
right: var(--dialog-header-paddingRight);
|
||||||
|
top: var(--dialog-header-paddingTop);
|
||||||
|
`}
|
||||||
|
|
||||||
@media ${breakpoints.tablet} {
|
@media ${breakpoints.tablet} {
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
height: 1rem;
|
height: 1rem;
|
||||||
@@ -445,6 +499,12 @@ Styled.Close = styled(Close)`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
Styled.BackButton = styled(BackButton)`
|
||||||
|
position: absolute;
|
||||||
|
left: var(--dialog-header-paddingLeft);
|
||||||
|
top: var(--dialog-header-paddingTop);
|
||||||
|
`;
|
||||||
|
|
||||||
Styled.Title = styled(Title)`
|
Styled.Title = styled(Title)`
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,11 @@ export enum DialogTypes {
|
|||||||
FillDetails = 'FillDetails',
|
FillDetails = 'FillDetails',
|
||||||
Help = 'Help',
|
Help = 'Help',
|
||||||
ExternalNavKeplr = 'ExternalNavKeplr',
|
ExternalNavKeplr = 'ExternalNavKeplr',
|
||||||
|
ManageFunds = 'ManageFunds',
|
||||||
MnemonicExport = 'MnemonicExport',
|
MnemonicExport = 'MnemonicExport',
|
||||||
MobileSignIn = 'MobileSignIn',
|
MobileSignIn = 'MobileSignIn',
|
||||||
|
NewMarketAgreement = 'NewMarketAgreement',
|
||||||
|
NewMarketMessageDetails = 'NewMarketMessageDetails',
|
||||||
Onboarding = 'Onboarding',
|
Onboarding = 'Onboarding',
|
||||||
OrderDetails = 'OrderDetails',
|
OrderDetails = 'OrderDetails',
|
||||||
Preferences = 'Preferences',
|
Preferences = 'Preferences',
|
||||||
@@ -20,9 +23,7 @@ export enum DialogTypes {
|
|||||||
Trade = 'Trade',
|
Trade = 'Trade',
|
||||||
Transfer = 'Transfer',
|
Transfer = 'Transfer',
|
||||||
Withdraw = 'Withdraw',
|
Withdraw = 'Withdraw',
|
||||||
ManageFunds = 'ManageFunds',
|
WithdrawalGated = 'WithdrawalGated',
|
||||||
NewMarketMessageDetails = 'NewMarketMessageDetails',
|
|
||||||
NewMarketAgreement = 'NewMarketAgreement',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum TradeBoxDialogTypes {
|
export enum TradeBoxDialogTypes {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { useDebounce } from './useDebounce';
|
|||||||
import { useInterval } from './useInterval';
|
import { useInterval } from './useInterval';
|
||||||
import { useDocumentTitle } from './useDocumentTitle';
|
import { useDocumentTitle } from './useDocumentTitle';
|
||||||
import { useDydxClient } from './useDydxClient';
|
import { useDydxClient } from './useDydxClient';
|
||||||
|
import { useEnvFeatures } from './useEnvFeatures';
|
||||||
import { useGovernanceVariables } from './useGovernanceVariables';
|
import { useGovernanceVariables } from './useGovernanceVariables';
|
||||||
import { useAccountBalance } from './useAccountBalance';
|
import { useAccountBalance } from './useAccountBalance';
|
||||||
import { useAccounts } from './useAccounts';
|
import { useAccounts } from './useAccounts';
|
||||||
@@ -26,6 +27,7 @@ import { useStringGetter } from './useStringGetter';
|
|||||||
import { useSubaccount } from './useSubaccount';
|
import { useSubaccount } from './useSubaccount';
|
||||||
import { useTradeFormInputs } from './useTradeFormInputs';
|
import { useTradeFormInputs } from './useTradeFormInputs';
|
||||||
import { useURLConfigs } from './useURLConfigs';
|
import { useURLConfigs } from './useURLConfigs';
|
||||||
|
import { useWithdrawalInfo } from './useWithdrawalInfo';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
useApiState,
|
useApiState,
|
||||||
@@ -36,6 +38,7 @@ export {
|
|||||||
useDebounce,
|
useDebounce,
|
||||||
useDocumentTitle,
|
useDocumentTitle,
|
||||||
useDydxClient,
|
useDydxClient,
|
||||||
|
useEnvFeatures,
|
||||||
useGovernanceVariables,
|
useGovernanceVariables,
|
||||||
useAccountBalance,
|
useAccountBalance,
|
||||||
useAccounts,
|
useAccounts,
|
||||||
@@ -56,4 +59,5 @@ export {
|
|||||||
useSubaccount,
|
useSubaccount,
|
||||||
useTradeFormInputs,
|
useTradeFormInputs,
|
||||||
useURLConfigs,
|
useURLConfigs,
|
||||||
|
useWithdrawalInfo,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -251,6 +251,17 @@ const useDydxClientContext = () => {
|
|||||||
[compositeClient]
|
[compositeClient]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const getWithdrawalAndTransferGatingStatus = useCallback(async () => {
|
||||||
|
return await compositeClient?.validatorClient.get.GetWithdrawalAndTransferGatingStatus();
|
||||||
|
}, [compositeClient]);
|
||||||
|
|
||||||
|
const getWithdrawalCapacityByDenom = useCallback(
|
||||||
|
async ({ denom }: { denom: string }) => {
|
||||||
|
return await compositeClient?.validatorClient.get.getWithdrawalCapacityByDenom(denom);
|
||||||
|
},
|
||||||
|
[compositeClient]
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// Client initialization
|
// Client initialization
|
||||||
connect: setNetworkConfig,
|
connect: setNetworkConfig,
|
||||||
@@ -267,5 +278,7 @@ const useDydxClientContext = () => {
|
|||||||
requestAllGovernanceProposals,
|
requestAllGovernanceProposals,
|
||||||
getCandlesForDatafeed,
|
getCandlesForDatafeed,
|
||||||
screenAddresses,
|
screenAddresses,
|
||||||
|
getWithdrawalAndTransferGatingStatus,
|
||||||
|
getWithdrawalCapacityByDenom,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
|
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||||
|
|
||||||
|
import { getSelectedNetwork } from '@/state/appSelectors';
|
||||||
|
|
||||||
|
export interface EnvironmentFeatures {
|
||||||
|
reduceOnlySupported: boolean;
|
||||||
|
withdrawalSafetyEnabled: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useEnvFeatures = (): EnvironmentFeatures => {
|
||||||
|
const selectedNetwork = useSelector(getSelectedNetwork);
|
||||||
|
return ENVIRONMENT_CONFIG_MAP[selectedNetwork].featureFlags;
|
||||||
|
};
|
||||||
@@ -27,6 +27,7 @@ export interface LinksConfigs {
|
|||||||
strideZoneApp?: string;
|
strideZoneApp?: string;
|
||||||
accountExportLearnMore?: string;
|
accountExportLearnMore?: string;
|
||||||
walletLearnMore?: string;
|
walletLearnMore?: string;
|
||||||
|
withdrawalGateLearnMore?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useURLConfigs = (): LinksConfigs => {
|
export const useURLConfigs = (): LinksConfigs => {
|
||||||
@@ -54,5 +55,6 @@ export const useURLConfigs = (): LinksConfigs => {
|
|||||||
strideZoneApp: linksConfigs.strideZoneApp || FALLBACK_URL,
|
strideZoneApp: linksConfigs.strideZoneApp || FALLBACK_URL,
|
||||||
accountExportLearnMore: linksConfigs.accountExportLearnMore || FALLBACK_URL,
|
accountExportLearnMore: linksConfigs.accountExportLearnMore || FALLBACK_URL,
|
||||||
walletLearnMore: linksConfigs.walletLearnMore || FALLBACK_URL,
|
walletLearnMore: linksConfigs.walletLearnMore || FALLBACK_URL,
|
||||||
|
withdrawalGateLearnMore: linksConfigs.withdrawalGateLearnMore || FALLBACK_URL,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,131 @@
|
|||||||
|
import { useEffect, useMemo } from 'react';
|
||||||
|
import { useQuery } from 'react-query';
|
||||||
|
import BigNumber from 'bignumber.js';
|
||||||
|
import { encodeJson } from '@dydxprotocol/v4-client-js';
|
||||||
|
import { ByteArrayEncoding } from '@dydxprotocol/v4-client-js/build/src/lib/helpers';
|
||||||
|
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
||||||
|
|
||||||
|
import { DialogTypes } from '@/constants/dialogs';
|
||||||
|
import { isMainnet } from '@/constants/networks';
|
||||||
|
import { useEnvFeatures } from './useEnvFeatures';
|
||||||
|
|
||||||
|
import { getApiState } from '@/state/appSelectors';
|
||||||
|
import { closeDialog, openDialog } from '@/state/dialogs';
|
||||||
|
import { getSelectedLocale } from '@/state/localizationSelectors';
|
||||||
|
|
||||||
|
import { formatRelativeTime } from '@/lib/dateTime';
|
||||||
|
import { BIG_NUMBERS, MustBigNumber } from '@/lib/numbers';
|
||||||
|
import { log } from '@/lib/telemetry';
|
||||||
|
|
||||||
|
import { useDydxClient } from './useDydxClient';
|
||||||
|
import { useTokenConfigs } from './useTokenConfigs';
|
||||||
|
|
||||||
|
const BLOCK_TIME = isMainnet ? 1_000 : 1_500;
|
||||||
|
|
||||||
|
export const useWithdrawalInfo = ({
|
||||||
|
transferType,
|
||||||
|
}: {
|
||||||
|
transferType: 'withdrawal' | 'transfer';
|
||||||
|
}) => {
|
||||||
|
const { getWithdrawalAndTransferGatingStatus, getWithdrawalCapacityByDenom } = useDydxClient();
|
||||||
|
const { usdcDenom, usdcDecimals } = useTokenConfigs();
|
||||||
|
const apiState = useSelector(getApiState, shallowEqual);
|
||||||
|
const { height } = apiState || {};
|
||||||
|
const selectedLocale = useSelector(getSelectedLocale);
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const { withdrawalSafetyEnabled } = useEnvFeatures();
|
||||||
|
|
||||||
|
const { data: usdcWithdrawalCapacity } = useQuery({
|
||||||
|
enabled: withdrawalSafetyEnabled,
|
||||||
|
queryKey: 'usdcWithdrawalCapacity',
|
||||||
|
queryFn: async () => {
|
||||||
|
try {
|
||||||
|
const response = await getWithdrawalCapacityByDenom({ denom: usdcDenom });
|
||||||
|
return JSON.parse(encodeJson(response, ByteArrayEncoding.BIGINT));
|
||||||
|
} catch (error) {
|
||||||
|
log('useWithdrawalInfo/getWithdrawalCapacityByDenom', error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
refetchInterval: 60_000,
|
||||||
|
staleTime: 60_000,
|
||||||
|
});
|
||||||
|
|
||||||
|
const { data: withdrawalAndTransferGatingStatus } = useQuery({
|
||||||
|
enabled: withdrawalSafetyEnabled,
|
||||||
|
queryKey: 'withdrawalTransferGateStatus',
|
||||||
|
queryFn: async () => {
|
||||||
|
try {
|
||||||
|
return await getWithdrawalAndTransferGatingStatus();
|
||||||
|
} catch (error) {
|
||||||
|
log('useWithdrawalInfo/getWithdrawalAndTransferGatingStatus', error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
refetchInterval: 60_000,
|
||||||
|
staleTime: 60_000,
|
||||||
|
});
|
||||||
|
|
||||||
|
const capacity = useMemo(() => {
|
||||||
|
const capacityList = usdcWithdrawalCapacity?.limiterCapacityList;
|
||||||
|
if (!capacityList || capacityList.length < 2) {
|
||||||
|
if (!withdrawalSafetyEnabled) {
|
||||||
|
return BigNumber(Infinity);
|
||||||
|
}
|
||||||
|
|
||||||
|
return BIG_NUMBERS.ZERO;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [{ capacity: daily }, { capacity: weekly }] = capacityList;
|
||||||
|
const dailyBN = MustBigNumber(daily);
|
||||||
|
const weeklyBN = MustBigNumber(weekly);
|
||||||
|
return BigNumber.minimum(dailyBN, weeklyBN).div(10 ** usdcDecimals);
|
||||||
|
}, [usdcDecimals, usdcWithdrawalCapacity]);
|
||||||
|
|
||||||
|
const withdrawalAndTransferGatingStatusValue = useMemo(() => {
|
||||||
|
const { withdrawalsAndTransfersUnblockedAtBlock } = withdrawalAndTransferGatingStatus ?? {};
|
||||||
|
if (
|
||||||
|
height &&
|
||||||
|
withdrawalsAndTransfersUnblockedAtBlock &&
|
||||||
|
height < withdrawalsAndTransfersUnblockedAtBlock &&
|
||||||
|
withdrawalSafetyEnabled
|
||||||
|
) {
|
||||||
|
return {
|
||||||
|
estimatedUnblockTime: formatRelativeTime(
|
||||||
|
Date.now() + (withdrawalsAndTransfersUnblockedAtBlock - height) * BLOCK_TIME,
|
||||||
|
{
|
||||||
|
locale: selectedLocale,
|
||||||
|
largestUnit: 'day',
|
||||||
|
}
|
||||||
|
),
|
||||||
|
isGated: true,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
estimatedUnblockTime: null,
|
||||||
|
isGated: false,
|
||||||
|
};
|
||||||
|
}, [height, withdrawalAndTransferGatingStatus, withdrawalSafetyEnabled]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (
|
||||||
|
withdrawalAndTransferGatingStatusValue.isGated &&
|
||||||
|
withdrawalAndTransferGatingStatusValue.estimatedUnblockTime &&
|
||||||
|
withdrawalSafetyEnabled
|
||||||
|
) {
|
||||||
|
dispatch(closeDialog());
|
||||||
|
dispatch(
|
||||||
|
openDialog({
|
||||||
|
type: DialogTypes.WithdrawalGated,
|
||||||
|
dialogProps: {
|
||||||
|
transferType,
|
||||||
|
estimatedUnblockTime: withdrawalAndTransferGatingStatusValue.estimatedUnblockTime,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}, [transferType, withdrawalAndTransferGatingStatusValue.isGated, withdrawalSafetyEnabled]);
|
||||||
|
|
||||||
|
return {
|
||||||
|
usdcWithdrawalCapacity: capacity,
|
||||||
|
withdrawalAndTransferGatingStatus,
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -11,26 +11,27 @@ import { DepositDialog } from '@/views/dialogs/DepositDialog';
|
|||||||
import { DisconnectDialog } from '@/views/dialogs/DisconnectDialog';
|
import { DisconnectDialog } from '@/views/dialogs/DisconnectDialog';
|
||||||
import { DisplaySettingsDialog } from '@/views/dialogs/DisplaySettingsDialog';
|
import { DisplaySettingsDialog } from '@/views/dialogs/DisplaySettingsDialog';
|
||||||
import { ExchangeOfflineDialog } from '@/views/dialogs/ExchangeOfflineDialog';
|
import { ExchangeOfflineDialog } from '@/views/dialogs/ExchangeOfflineDialog';
|
||||||
|
import { ExternalNavStrideDialog } from '@/views/dialogs/ExternalNavStrideDialog';
|
||||||
import { HelpDialog } from '@/views/dialogs/HelpDialog';
|
import { HelpDialog } from '@/views/dialogs/HelpDialog';
|
||||||
import { ExternalLinkDialog } from '@/views/dialogs/ExternalLinkDialog';
|
import { ExternalLinkDialog } from '@/views/dialogs/ExternalLinkDialog';
|
||||||
import { ExternalNavKeplrDialog } from '@/views/dialogs/ExternalNavKeplrDialog';
|
import { ExternalNavKeplrDialog } from '@/views/dialogs/ExternalNavKeplrDialog';
|
||||||
|
import { ManageFundsDialog } from '@/views/dialogs/ManageFundsDialog';
|
||||||
import { MnemonicExportDialog } from '@/views/dialogs/MnemonicExportDialog';
|
import { MnemonicExportDialog } from '@/views/dialogs/MnemonicExportDialog';
|
||||||
import { MobileSignInDialog } from '@/views/dialogs/MobileSignInDialog';
|
import { MobileSignInDialog } from '@/views/dialogs/MobileSignInDialog';
|
||||||
|
import { NewMarketAgreementDialog } from '@/views/dialogs/NewMarketAgreementDialog';
|
||||||
|
import { NewMarketMessageDetailsDialog } from '@/views/dialogs/NewMarketMessageDetailsDialog';
|
||||||
import { OnboardingDialog } from '@/views/dialogs/OnboardingDialog';
|
import { OnboardingDialog } from '@/views/dialogs/OnboardingDialog';
|
||||||
import { PreferencesDialog } from '@/views/dialogs/PreferencesDialog';
|
import { PreferencesDialog } from '@/views/dialogs/PreferencesDialog';
|
||||||
import { RateLimitDialog } from '@/views/dialogs/RateLimitDialog';
|
import { RateLimitDialog } from '@/views/dialogs/RateLimitDialog';
|
||||||
import { RestrictedGeoDialog } from '@/views/dialogs/RestrictedGeoDialog';
|
import { RestrictedGeoDialog } from '@/views/dialogs/RestrictedGeoDialog';
|
||||||
|
import { RestrictedWalletDialog } from '@/views/dialogs/RestrictedWalletDialog';
|
||||||
import { TradeDialog } from '@/views/dialogs/TradeDialog';
|
import { TradeDialog } from '@/views/dialogs/TradeDialog';
|
||||||
import { TransferDialog } from '@/views/dialogs/TransferDialog';
|
import { TransferDialog } from '@/views/dialogs/TransferDialog';
|
||||||
import { RestrictedWalletDialog } from '@/views/dialogs/RestrictedWalletDialog';
|
|
||||||
import { WithdrawDialog } from '@/views/dialogs/WithdrawDialog';
|
import { WithdrawDialog } from '@/views/dialogs/WithdrawDialog';
|
||||||
import { ManageFundsDialog } from '@/views/dialogs/ManageFundsDialog';
|
import { WithdrawalGateDialog } from '@/views/dialogs/WithdrawalGateDialog';
|
||||||
|
|
||||||
import { OrderDetailsDialog } from '@/views/dialogs/DetailsDialog/OrderDetailsDialog';
|
import { OrderDetailsDialog } from '@/views/dialogs/DetailsDialog/OrderDetailsDialog';
|
||||||
import { FillDetailsDialog } from '@/views/dialogs/DetailsDialog/FillDetailsDialog';
|
import { FillDetailsDialog } from '@/views/dialogs/DetailsDialog/FillDetailsDialog';
|
||||||
import { NewMarketMessageDetailsDialog } from '@/views/dialogs/NewMarketMessageDetailsDialog';
|
|
||||||
import { NewMarketAgreementDialog } from '@/views/dialogs/NewMarketAgreementDialog';
|
|
||||||
import { ExternalNavStrideDialog } from '@/views/dialogs/ExternalNavStrideDialog';
|
|
||||||
|
|
||||||
export const DialogManager = () => {
|
export const DialogManager = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@@ -72,6 +73,7 @@ export const DialogManager = () => {
|
|||||||
[DialogTypes.Trade]: <TradeDialog {...modalProps} />,
|
[DialogTypes.Trade]: <TradeDialog {...modalProps} />,
|
||||||
[DialogTypes.Transfer]: <TransferDialog {...modalProps} />,
|
[DialogTypes.Transfer]: <TransferDialog {...modalProps} />,
|
||||||
[DialogTypes.Withdraw]: <WithdrawDialog {...modalProps} />,
|
[DialogTypes.Withdraw]: <WithdrawDialog {...modalProps} />,
|
||||||
|
[DialogTypes.WithdrawalGated]: <WithdrawalGateDialog {...modalProps} />,
|
||||||
[DialogTypes.ManageFunds]: <ManageFundsDialog {...modalProps} />,
|
[DialogTypes.ManageFunds]: <ManageFundsDialog {...modalProps} />,
|
||||||
[DialogTypes.NewMarketMessageDetails]: <NewMarketMessageDetailsDialog {...modalProps} />,
|
[DialogTypes.NewMarketMessageDetails]: <NewMarketMessageDetailsDialog {...modalProps} />,
|
||||||
[DialogTypes.NewMarketAgreement]: <NewMarketAgreementDialog {...modalProps} />,
|
[DialogTypes.NewMarketAgreement]: <NewMarketAgreementDialog {...modalProps} />,
|
||||||
|
|||||||
Vendored
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { ThemeColorBase } from '@/constants/styles/colors';
|
||||||
|
|
||||||
|
declare module 'styled-components' {
|
||||||
|
export interface DefaultTheme extends ThemeColorBase {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
import styled, { AnyStyledComponent } from 'styled-components';
|
||||||
|
|
||||||
|
import { ButtonAction, ButtonType } from '@/constants/buttons';
|
||||||
|
import { STRING_KEYS } from '@/constants/localization';
|
||||||
|
import { useStringGetter, useURLConfigs } from '@/hooks';
|
||||||
|
import { LinkOutIcon } from '@/icons';
|
||||||
|
import { layoutMixins } from '@/styles/layoutMixins';
|
||||||
|
|
||||||
|
import { Button } from '@/components/Button';
|
||||||
|
import { Dialog } from '@/components/Dialog';
|
||||||
|
import { Icon, IconName } from '@/components/Icon';
|
||||||
|
|
||||||
|
type ElementProps = {
|
||||||
|
setIsOpen: (open: boolean) => void;
|
||||||
|
transferType: 'withdrawal' | 'transfer';
|
||||||
|
estimatedUnblockTime?: string | null;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const WithdrawalGateDialog = ({
|
||||||
|
setIsOpen,
|
||||||
|
estimatedUnblockTime,
|
||||||
|
transferType,
|
||||||
|
}: ElementProps) => {
|
||||||
|
const stringGetter = useStringGetter();
|
||||||
|
const { withdrawalGateLearnMore } = useURLConfigs();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dialog
|
||||||
|
isOpen
|
||||||
|
stacked
|
||||||
|
setIsOpen={setIsOpen}
|
||||||
|
title={
|
||||||
|
{
|
||||||
|
withdrawal: stringGetter({ key: STRING_KEYS.WITHDRAWALS_PAUSED }),
|
||||||
|
transfer: stringGetter({ key: STRING_KEYS.TRANSFERS_PAUSED }),
|
||||||
|
}[transferType]
|
||||||
|
}
|
||||||
|
slotIcon={
|
||||||
|
<Styled.IconContainer>
|
||||||
|
<Styled.Icon iconName={IconName.Warning} />
|
||||||
|
</Styled.IconContainer>
|
||||||
|
}
|
||||||
|
slotFooter={
|
||||||
|
<Styled.ButtonRow>
|
||||||
|
<Button
|
||||||
|
type={ButtonType.Link}
|
||||||
|
action={ButtonAction.Secondary}
|
||||||
|
href={withdrawalGateLearnMore}
|
||||||
|
>
|
||||||
|
{stringGetter({ key: STRING_KEYS.LEARN_MORE })}
|
||||||
|
<LinkOutIcon />
|
||||||
|
</Button>
|
||||||
|
<Button action={ButtonAction.Primary} onClick={() => setIsOpen(false)}>
|
||||||
|
{stringGetter({ key: STRING_KEYS.CLOSE })}
|
||||||
|
</Button>
|
||||||
|
</Styled.ButtonRow>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Styled.Content>
|
||||||
|
{stringGetter({
|
||||||
|
key: STRING_KEYS.WITHDRAWALS_PAUSED_DESC,
|
||||||
|
params: {
|
||||||
|
ESTIMATED_DURATION: estimatedUnblockTime,
|
||||||
|
},
|
||||||
|
})}
|
||||||
|
</Styled.Content>
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const Styled: Record<string, AnyStyledComponent> = {};
|
||||||
|
|
||||||
|
Styled.IconContainer = styled.div`
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
width: 4.5rem;
|
||||||
|
height: 4.5rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
min-width: 4.5rem;
|
||||||
|
min-height: 4.5rem;
|
||||||
|
background-color: var(--color-gradient-warning);
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.Icon = styled(Icon)`
|
||||||
|
color: var(--color-warning);
|
||||||
|
font-size: 2.5rem;
|
||||||
|
margin-bottom: 0.125rem;
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.Content = styled.div`
|
||||||
|
${layoutMixins.column}
|
||||||
|
gap: 1rem;
|
||||||
|
`;
|
||||||
|
|
||||||
|
Styled.ButtonRow = styled.div`
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
gap: 1rem;
|
||||||
|
`;
|
||||||
@@ -17,6 +17,7 @@ import {
|
|||||||
MAX_PRICE_IMPACT,
|
MAX_PRICE_IMPACT,
|
||||||
MIN_CCTP_TRANSFER_AMOUNT,
|
MIN_CCTP_TRANSFER_AMOUNT,
|
||||||
NumberSign,
|
NumberSign,
|
||||||
|
TOKEN_DECIMALS,
|
||||||
} from '@/constants/numbers';
|
} from '@/constants/numbers';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -27,6 +28,8 @@ import {
|
|||||||
useSelectedNetwork,
|
useSelectedNetwork,
|
||||||
useStringGetter,
|
useStringGetter,
|
||||||
useSubaccount,
|
useSubaccount,
|
||||||
|
useTokenConfigs,
|
||||||
|
useWithdrawalInfo,
|
||||||
} from '@/hooks';
|
} from '@/hooks';
|
||||||
import { useLocalNotifications } from '@/hooks/useLocalNotifications';
|
import { useLocalNotifications } from '@/hooks/useLocalNotifications';
|
||||||
|
|
||||||
@@ -85,6 +88,8 @@ export const WithdrawForm = () => {
|
|||||||
const [withdrawAmount, setWithdrawAmount] = useState('');
|
const [withdrawAmount, setWithdrawAmount] = useState('');
|
||||||
const [slippage, setSlippage] = useState(isCctp ? 0 : 0.01); // 0.1% slippage
|
const [slippage, setSlippage] = useState(isCctp ? 0 : 0.01); // 0.1% slippage
|
||||||
const debouncedAmount = useDebounce<string>(withdrawAmount, 500);
|
const debouncedAmount = useDebounce<string>(withdrawAmount, 500);
|
||||||
|
const { usdcLabel } = useTokenConfigs();
|
||||||
|
const { usdcWithdrawalCapacity } = useWithdrawalInfo({ transferType: 'withdrawal' });
|
||||||
|
|
||||||
const isValidAddress = toAddress && isAddress(toAddress);
|
const isValidAddress = toAddress && isAddress(toAddress);
|
||||||
|
|
||||||
@@ -321,61 +326,102 @@ export const WithdrawForm = () => {
|
|||||||
|
|
||||||
const { sanctionedAddresses } = useRestrictions();
|
const { sanctionedAddresses } = useRestrictions();
|
||||||
|
|
||||||
const errorMessage = useMemo(() => {
|
const { alertType, errorMessage } = useMemo(() => {
|
||||||
if (error) {
|
if (error) {
|
||||||
return error;
|
return {
|
||||||
|
errorMessage: error,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (routeErrors) {
|
if (routeErrors) {
|
||||||
return routeErrorMessage
|
return {
|
||||||
? stringGetter({
|
errorMessage: routeErrorMessage
|
||||||
key: STRING_KEYS.SOMETHING_WENT_WRONG_WITH_MESSAGE,
|
? stringGetter({
|
||||||
params: { ERROR_MESSAGE: routeErrorMessage },
|
key: STRING_KEYS.SOMETHING_WENT_WRONG_WITH_MESSAGE,
|
||||||
})
|
params: { ERROR_MESSAGE: routeErrorMessage },
|
||||||
: stringGetter({ key: STRING_KEYS.SOMETHING_WENT_WRONG });
|
})
|
||||||
|
: stringGetter({ key: STRING_KEYS.SOMETHING_WENT_WRONG }),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!toAddress) return stringGetter({ key: STRING_KEYS.WITHDRAW_MUST_SPECIFY_ADDRESS });
|
if (!toAddress) {
|
||||||
|
return {
|
||||||
|
alertType: AlertType.Warning,
|
||||||
|
errorMessage: stringGetter({ key: STRING_KEYS.WITHDRAW_MUST_SPECIFY_ADDRESS }),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (sanctionedAddresses.has(toAddress))
|
if (sanctionedAddresses.has(toAddress))
|
||||||
return stringGetter({
|
return {
|
||||||
key: STRING_KEYS.TRANSFER_INVALID_DYDX_ADDRESS,
|
errorMessage: stringGetter({
|
||||||
});
|
key: STRING_KEYS.TRANSFER_INVALID_DYDX_ADDRESS,
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
|
||||||
if (debouncedAmountBN) {
|
if (debouncedAmountBN) {
|
||||||
if (!chainIdStr && !exchange) {
|
if (!chainIdStr && !exchange) {
|
||||||
return stringGetter({ key: STRING_KEYS.WITHDRAW_MUST_SPECIFY_CHAIN });
|
return {
|
||||||
|
errorMessage: stringGetter({ key: STRING_KEYS.WITHDRAW_MUST_SPECIFY_CHAIN }),
|
||||||
|
};
|
||||||
} else if (!toToken) {
|
} else if (!toToken) {
|
||||||
return stringGetter({ key: STRING_KEYS.WITHDRAW_MUST_SPECIFY_ASSET });
|
return {
|
||||||
|
errorMessage: stringGetter({ key: STRING_KEYS.WITHDRAW_MUST_SPECIFY_ASSET }),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MustBigNumber(debouncedAmountBN).gt(MustBigNumber(freeCollateralBN))) {
|
if (debouncedAmountBN.gt(MustBigNumber(freeCollateralBN))) {
|
||||||
return stringGetter({ key: STRING_KEYS.WITHDRAW_MORE_THAN_FREE });
|
return {
|
||||||
|
errorMessage: stringGetter({ key: STRING_KEYS.WITHDRAW_MORE_THAN_FREE }),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isCctp) {
|
if (isCctp) {
|
||||||
if (MustBigNumber(debouncedAmountBN).gte(MAX_CCTP_TRANSFER_AMOUNT)) {
|
if (debouncedAmountBN.gte(MAX_CCTP_TRANSFER_AMOUNT)) {
|
||||||
return stringGetter({
|
return {
|
||||||
key: STRING_KEYS.MAX_CCTP_TRANSFER_LIMIT_EXCEEDED,
|
errorMessage: stringGetter({
|
||||||
params: {
|
key: STRING_KEYS.MAX_CCTP_TRANSFER_LIMIT_EXCEEDED,
|
||||||
MAX_CCTP_TRANSFER_AMOUNT: MAX_CCTP_TRANSFER_AMOUNT,
|
params: {
|
||||||
},
|
MAX_CCTP_TRANSFER_AMOUNT: MAX_CCTP_TRANSFER_AMOUNT,
|
||||||
});
|
},
|
||||||
|
}),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
!debouncedAmountBN.isZero() &&
|
!debouncedAmountBN.isZero() &&
|
||||||
MustBigNumber(debouncedAmountBN).lte(MIN_CCTP_TRANSFER_AMOUNT)
|
MustBigNumber(debouncedAmountBN).lte(MIN_CCTP_TRANSFER_AMOUNT)
|
||||||
) {
|
) {
|
||||||
return 'Amount must be greater than 10 USDC';
|
return {
|
||||||
|
errorMessage: 'Amount must be greater than 10 USDC',
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isMainnet && MustBigNumber(summary?.aggregatePriceImpact).gte(MAX_PRICE_IMPACT)) {
|
if (isMainnet && MustBigNumber(summary?.aggregatePriceImpact).gte(MAX_PRICE_IMPACT)) {
|
||||||
return stringGetter({ key: STRING_KEYS.PRICE_IMPACT_TOO_HIGH });
|
return { errorMessage: stringGetter({ key: STRING_KEYS.PRICE_IMPACT_TOO_HIGH }) };
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
// Withdrawal Safety
|
||||||
|
if (usdcWithdrawalCapacity.gt(0) && debouncedAmountBN.gt(usdcWithdrawalCapacity)) {
|
||||||
|
return {
|
||||||
|
alertType: AlertType.Warning,
|
||||||
|
errorMessage: stringGetter({
|
||||||
|
key: STRING_KEYS.WITHDRAWAL_LIMIT_OVER,
|
||||||
|
params: {
|
||||||
|
USDC_LIMIT: (
|
||||||
|
<span>
|
||||||
|
{usdcWithdrawalCapacity.toFormat(TOKEN_DECIMALS)}
|
||||||
|
<Styled.Tag>{usdcLabel}</Styled.Tag>
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
errorMessage: undefined,
|
||||||
|
};
|
||||||
}, [
|
}, [
|
||||||
error,
|
error,
|
||||||
routeErrors,
|
routeErrors,
|
||||||
@@ -388,6 +434,7 @@ export const WithdrawForm = () => {
|
|||||||
sanctionedAddresses,
|
sanctionedAddresses,
|
||||||
stringGetter,
|
stringGetter,
|
||||||
summary,
|
summary,
|
||||||
|
usdcWithdrawalCapacity,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const isInvalidNobleAddress = Boolean(
|
const isInvalidNobleAddress = Boolean(
|
||||||
@@ -448,7 +495,11 @@ export const WithdrawForm = () => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Styled.WithDetailsReceipt>
|
</Styled.WithDetailsReceipt>
|
||||||
{errorMessage && <AlertMessage type={AlertType.Error}>{errorMessage}</AlertMessage>}
|
{errorMessage && (
|
||||||
|
<Styled.AlertMessage type={alertType ?? AlertType.Error}>
|
||||||
|
{errorMessage}
|
||||||
|
</Styled.AlertMessage>
|
||||||
|
)}
|
||||||
<Styled.Footer>
|
<Styled.Footer>
|
||||||
<WithdrawButtonAndReceipt
|
<WithdrawButtonAndReceipt
|
||||||
isDisabled={isDisabled}
|
isDisabled={isDisabled}
|
||||||
@@ -465,6 +516,10 @@ export const WithdrawForm = () => {
|
|||||||
|
|
||||||
const Styled: Record<string, AnyStyledComponent> = {};
|
const Styled: Record<string, AnyStyledComponent> = {};
|
||||||
|
|
||||||
|
Styled.Tag = styled(Tag)`
|
||||||
|
margin-left: 0.5ch;
|
||||||
|
`;
|
||||||
|
|
||||||
Styled.DiffOutput = styled(DiffOutput)`
|
Styled.DiffOutput = styled(DiffOutput)`
|
||||||
--diffOutput-valueWithDiff-fontSize: 1em;
|
--diffOutput-valueWithDiff-fontSize: 1em;
|
||||||
`;
|
`;
|
||||||
@@ -484,6 +539,10 @@ Styled.DestinationRow = styled.div`
|
|||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
Styled.AlertMessage = styled(AlertMessage)`
|
||||||
|
display: inline;
|
||||||
|
`;
|
||||||
|
|
||||||
Styled.WithDetailsReceipt = styled(WithDetailsReceipt)`
|
Styled.WithDetailsReceipt = styled(WithDetailsReceipt)`
|
||||||
--withReceipt-backgroundColor: var(--color-layer-2);
|
--withReceipt-backgroundColor: var(--color-layer-2);
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import {
|
|||||||
useStringGetter,
|
useStringGetter,
|
||||||
useSubaccount,
|
useSubaccount,
|
||||||
useTokenConfigs,
|
useTokenConfigs,
|
||||||
|
useWithdrawalInfo,
|
||||||
} from '@/hooks';
|
} from '@/hooks';
|
||||||
|
|
||||||
import { formMixins } from '@/styles/formMixins';
|
import { formMixins } from '@/styles/formMixins';
|
||||||
@@ -64,6 +65,7 @@ export const TransferForm = ({
|
|||||||
const { nativeTokenBalance, usdcBalance } = useAccountBalance();
|
const { nativeTokenBalance, usdcBalance } = useAccountBalance();
|
||||||
const selectedDydxChainId = useSelector(getSelectedDydxChainId);
|
const selectedDydxChainId = useSelector(getSelectedDydxChainId);
|
||||||
const { tokensConfigs, usdcLabel, chainTokenLabel } = useTokenConfigs();
|
const { tokensConfigs, usdcLabel, chainTokenLabel } = useTokenConfigs();
|
||||||
|
useWithdrawalInfo({ transferType: 'transfer' });
|
||||||
|
|
||||||
const {
|
const {
|
||||||
address: recipientAddress,
|
address: recipientAddress,
|
||||||
|
|||||||
+1
-1
@@ -22,6 +22,6 @@
|
|||||||
"@/*": ["src/*"]
|
"@/*": ["src/*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["src", "scripts"],
|
"include": ["src", "scripts", "styled.d.ts"],
|
||||||
"references": [{ "path": "./tsconfig.node.json" }]
|
"references": [{ "path": "./tsconfig.node.json" }]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user