Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edf40ab99f | ||
|
|
ff7cfb3655 | ||
|
|
6ce57aaa3b | ||
|
|
3540300574 | ||
|
|
156168ed18 | ||
|
|
04741d0b5a | ||
|
|
33fbcf74b8 | ||
|
|
5531e21c76 |
@@ -40,7 +40,7 @@
|
||||
"@cosmjs/proto-signing": "^0.32.1",
|
||||
"@cosmjs/stargate": "^0.32.1",
|
||||
"@cosmjs/tendermint-rpc": "^0.32.1",
|
||||
"@dydxprotocol/v4-abacus": "^1.4.5",
|
||||
"@dydxprotocol/v4-abacus": "^1.4.2",
|
||||
"@dydxprotocol/v4-client-js": "^1.0.20",
|
||||
"@dydxprotocol/v4-localization": "^1.1.30",
|
||||
"@ethersproject/providers": "^5.7.2",
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
lockfileVersion: '6.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
overrides:
|
||||
follow-redirects: 1.15.3
|
||||
|
||||
@@ -26,8 +30,8 @@ dependencies:
|
||||
specifier: ^0.32.1
|
||||
version: 0.32.2
|
||||
'@dydxprotocol/v4-abacus':
|
||||
specifier: ^1.4.5
|
||||
version: 1.4.5
|
||||
specifier: ^1.4.2
|
||||
version: 1.4.2
|
||||
'@dydxprotocol/v4-client-js':
|
||||
specifier: ^1.0.20
|
||||
version: 1.0.20
|
||||
@@ -1286,8 +1290,8 @@ packages:
|
||||
resolution: {integrity: sha512-Gg5t+eR7vPJMAmhkFt6CZrzPd0EKpAslWwk5rFVYZpJsM8JG5KT9XQ99hgNM3Ov6ScNoIWbXkpX27F6A9cXR4Q==}
|
||||
dev: false
|
||||
|
||||
/@dydxprotocol/v4-abacus@1.4.5:
|
||||
resolution: {integrity: sha512-LhJmpIaUkHCsSiHx+jdk+59euvGp2E+gGFelpfmOYpH1+enZgEXDQvWsgHSFEQxYP3mRiGG4uo+ZYNGdvffg7g==}
|
||||
/@dydxprotocol/v4-abacus@1.4.2:
|
||||
resolution: {integrity: sha512-+hugk0RulMwMthR2xCMYXohcC3sEYqVW/lmiq0RUuHZ9yrjmgy48xl0aZUmXGUYXyoiHXPS4AULhRKHQ4OOLwg==}
|
||||
dev: false
|
||||
|
||||
/@dydxprotocol/v4-client-js@1.0.20:
|
||||
@@ -16049,7 +16053,3 @@ packages:
|
||||
/zwitch@2.0.4:
|
||||
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
|
||||
dev: true
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
@@ -1329,4 +1329,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,13 @@
|
||||
"whitepaperLink": "https://why.cardano.org/en/introduction/motivation/",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/cardano/"
|
||||
},
|
||||
"AGIX-USD": {
|
||||
"name": "SingularityNET",
|
||||
"tags": ["AI"],
|
||||
"websiteLink": "https://public.singularitynet.io/whitepaper.pdf",
|
||||
"whitepaperLink": "https://public.singularitynet.io/whitepaper.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/singularitynet/"
|
||||
},
|
||||
"ALGO-USD": {
|
||||
"name": "Algorand",
|
||||
"tags": ["Layer 1"],
|
||||
@@ -78,7 +85,7 @@
|
||||
},
|
||||
"BLUR-USD": {
|
||||
"name": "Blur",
|
||||
"tags": [],
|
||||
"tags": ["NFT"],
|
||||
"websiteLink": "https://blur.io/",
|
||||
"whitepaperLink": "https://docs.blur.foundation/",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/blur-token/"
|
||||
@@ -91,6 +98,13 @@
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/bnb/"
|
||||
|
||||
},
|
||||
"CHZ-USD": {
|
||||
"name": "Chiliz",
|
||||
"tags": ["Layer 1"],
|
||||
"websiteLink": "https://www.chiliz.com/",
|
||||
"whitepaperLink": "https://www.chiliz.com/docs/litepaper-v1.1-20230703.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/chiliz/"
|
||||
},
|
||||
"CELO-USD": {
|
||||
"name": "Celo",
|
||||
"tags": [],
|
||||
@@ -147,6 +161,13 @@
|
||||
"whitepaperLink": "https://cdn.enjin.io/downloads/whitepapers/enjin-coin/en.pdf/",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/enjin-coin/"
|
||||
},
|
||||
"ENS-USD": {
|
||||
"name": "Ethereum Name Service",
|
||||
"tags": [],
|
||||
"websiteLink": "https://coinmarketcap.com/currencies/ethereum-name-service/",
|
||||
"whitepaperLink": "https://docs.ens.domains/",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/ethereum-name-service/"
|
||||
},
|
||||
"EOS-USD": {
|
||||
"name": "EOS",
|
||||
"tags": ["Layer 1"],
|
||||
@@ -170,6 +191,13 @@
|
||||
"displayStepSize": "0.001",
|
||||
"displayTickSize": "0.1"
|
||||
},
|
||||
"FET-USD": {
|
||||
"name": "Fetch.ai",
|
||||
"tags": ["AI"],
|
||||
"websiteLink": "https://fetch.ai/",
|
||||
"whitepaperLink": "https://www.dropbox.com/s/gxptsecwdl3jjtn/David%20Minarsch%20-%202021-04-26%2010.34.17%20-%20paper_21_finalversion.pdf?e=1&dl=0",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/fetch/"
|
||||
},
|
||||
"FIL-USD": {
|
||||
"name": "Filecoin",
|
||||
"tags": ["Layer 1"],
|
||||
@@ -177,6 +205,34 @@
|
||||
"whitepaperLink": "https://filecoin.io/filecoin.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/filecoin/"
|
||||
},
|
||||
"FTM-USD": {
|
||||
"name": "Fantom",
|
||||
"tags": [],
|
||||
"websiteLink": "https://fantom.foundation/",
|
||||
"whitepaperLink": "https://fantom.foundation/_next/static/media/wp_fantom_v1.6.39329cdc5d0ee59684cbc6f228516383.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/fantom/"
|
||||
},
|
||||
"GALA-USD": {
|
||||
"name": "Gala",
|
||||
"tags": ["Gaming", "Layer 1"],
|
||||
"websiteLink": "https://gala.com/",
|
||||
"whitepaperLink": "https://galahackathon.com/v1.0.0/pdf/sdk-documentation.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/gala/"
|
||||
},
|
||||
"GMT-USD": {
|
||||
"name": "GMT",
|
||||
"tags": ["Gaming"],
|
||||
"websiteLink": "https://stepn.com/",
|
||||
"whitepaperLink/": "https://whitepaper.stepn.com/",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/green-metaverse-token/"
|
||||
},
|
||||
"GRT-USD": {
|
||||
"name": "The Graph",
|
||||
"tags": [],
|
||||
"websiteLink": "https://thegraph.com/",
|
||||
"whitepaperLink/": "https://github.com/graphprotocol/research/blob/master/papers/whitepaper/the-graph-whitepaper.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/the-graph/"
|
||||
},
|
||||
"HNT-USD": {
|
||||
"name": "Helium",
|
||||
"tags": ["Layer 1"],
|
||||
@@ -184,6 +240,13 @@
|
||||
"whitepaperLink": "http://whitepaper.helium.com",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/helium/"
|
||||
},
|
||||
"HBAR-USD": {
|
||||
"name": "Hedera",
|
||||
"tags": [],
|
||||
"websiteLink": "https://hedera.com/",
|
||||
"whitepaperLink/": "https://files.hedera.com/hh_whitepaper_v2.2-20230918.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/hedera/"
|
||||
},
|
||||
"ICP-USD": {
|
||||
"name": "Internet Computer",
|
||||
"tags": ["Layer 1"],
|
||||
@@ -191,6 +254,27 @@
|
||||
"whitepaperLink": "https://dfinity.org/whitepaper.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/internet-computer/"
|
||||
},
|
||||
"IMX-USD": {
|
||||
"name": "Immutable X",
|
||||
"tags": ["Gaming", "Layer 2", "NFT"],
|
||||
"websiteLink": "https://www.immutable.com/",
|
||||
"whitepaperLink": "https://assets.website-files.com/646557ee455c3e16e4a9bcb3/6499367de527dd82ab7475a3_Immutable%20Whitepaper%20Update%202023%20(3).pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/immutable-x/"
|
||||
},
|
||||
"INJ-USD": {
|
||||
"name": "Injective",
|
||||
"tags": ["Layer 1", "Defi"],
|
||||
"websiteLink": "https://injective.com/",
|
||||
"whitepaperLink": "https://docs.injective.network/intro/01_overview.html",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/injective/"
|
||||
},
|
||||
"JTO-USD": {
|
||||
"name": "Jito",
|
||||
"tags": ["Defi"],
|
||||
"websiteLink": "https://www.jito.network/",
|
||||
"whitepaperLink": "https://github.com/jito-foundation",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/jito/"
|
||||
},
|
||||
"JUP-USD": {
|
||||
"name": "Jupiter",
|
||||
"tags": ["Defi"],
|
||||
@@ -198,6 +282,13 @@
|
||||
"whitepaperLink": "https://station.jup.ag/blog/green-paper",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/jupiter-ag/"
|
||||
},
|
||||
"KAVA-USD": {
|
||||
"name": "Kava",
|
||||
"tags": ["Layer 1"],
|
||||
"websiteLink": "https://www.kava.io/",
|
||||
"whitepaperLink": "https://docsend.com/view/gwbwpc3",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/kava/"
|
||||
},
|
||||
"LDO-USD": {
|
||||
"name": "Lido DAO",
|
||||
"tags": ["Defi"],
|
||||
@@ -219,6 +310,20 @@
|
||||
"whitepaperLink": "https://litecoin.info/index.php/Main_Page",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/litecoin/"
|
||||
},
|
||||
"MANA-USD": {
|
||||
"name": "Decentraland",
|
||||
"tags": ["AR/VR"],
|
||||
"websiteLink": "https://decentraland.org/",
|
||||
"whitepaperLink": "https://decentraland.org/whitepaper.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/decentraland/"
|
||||
},
|
||||
"MASK-USD": {
|
||||
"name": "Mask Network",
|
||||
"tags": [],
|
||||
"websiteLink": "https://mask.io/",
|
||||
"whitepaperLink": "https://masknetwork.medium.com/introducing-mask-network-maskbook-the-future-of-the-internet-5a973d874edd",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/mask-network/"
|
||||
},
|
||||
"MATIC-USD": {
|
||||
"name": "Polygon",
|
||||
"tags": ["Layer 2"],
|
||||
@@ -226,6 +331,13 @@
|
||||
"whitepaperLink": "https://polygon.technology/lightpaper-polygon.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/polygon/"
|
||||
},
|
||||
"MINA-USD": {
|
||||
"name": "Mina",
|
||||
"tags": ["Layer 1"],
|
||||
"websiteLink": "https://minaprotocol.com/",
|
||||
"whitepaperLink": "https://docs.minaprotocol.com/assets/economicsWhitepaper.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/mina/"
|
||||
},
|
||||
"MKR-USD": {
|
||||
"name": "Maker",
|
||||
"tags": ["Governance"],
|
||||
@@ -240,6 +352,13 @@
|
||||
"whitepaperLink": "https://near.org/papers/the-official-near-white-paper/",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/near-protocol/"
|
||||
},
|
||||
"ORDI-USD": {
|
||||
"name": "ORDI",
|
||||
"tags": ["NFT"],
|
||||
"websiteLink": "https://ordinals.com/",
|
||||
"whitepaperLink": "https://rodarmor.com/blog/",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/ordi/"
|
||||
},
|
||||
"OP-USD": {
|
||||
"name": "Optimism",
|
||||
"tags": [],
|
||||
@@ -253,6 +372,20 @@
|
||||
"websiteLink": "https://www.pepe.vip/",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/pepe/"
|
||||
},
|
||||
"PYTH-USD": {
|
||||
"name": "Pyth Network",
|
||||
"tags": [],
|
||||
"websiteLink": "https://pyth.network/",
|
||||
"whitepaperLink": "https://pyth.network/whitepaper_v2.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/pyth-network/"
|
||||
},
|
||||
"RNDR-USD": {
|
||||
"name": "Render Token",
|
||||
"tags": ["AI"],
|
||||
"websiteLink": "https://rendernetwork.com/",
|
||||
"whitepaperLink": "https://renderfoundation.com/whitepaper",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/render/"
|
||||
},
|
||||
"RUNE-USD": {
|
||||
"name": "THORChain",
|
||||
"tags": ["Layer 1"],
|
||||
@@ -260,6 +393,13 @@
|
||||
"whitepaperLink": "https://whitepaper.io/document/709/thorchain-whitepaper",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/thorchain/"
|
||||
},
|
||||
"SAND-USD": {
|
||||
"name": "The Sandbox",
|
||||
"tags": ["Gaming"],
|
||||
"websiteLink": "https://www.sandbox.game/en/",
|
||||
"whitepaperLink": "https://installers.sandbox.game/The_Sandbox_Whitepaper_2020.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/the-sandbox/"
|
||||
},
|
||||
"SEI-USD": {
|
||||
"name": "Sei",
|
||||
"tags": ["Layer 1", "Defi"],
|
||||
@@ -288,6 +428,13 @@
|
||||
"whitepaperLink": "https://solana.com/solana-whitepaper.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/solana/"
|
||||
},
|
||||
"STX-USD": {
|
||||
"name": "Stacks",
|
||||
"tags": ["Layer 2"],
|
||||
"websiteLink": "https://www.stacks.co/",
|
||||
"whitepaperLink": "https://gaia.blockstack.org/hub/1AxyPunHHAHiEffXWESKfbvmBpGQv138Fp/stacks.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/stacks/"
|
||||
},
|
||||
"SUI-USD": {
|
||||
"name": "Sui",
|
||||
"tags": ["Layer 1"],
|
||||
@@ -337,6 +484,13 @@
|
||||
"whitepaperLink": "https://whitepaper.worldcoin.org/",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/worldcoin-org/"
|
||||
},
|
||||
"WOO-USD": {
|
||||
"name": "WOO Network",
|
||||
"tags": ["Defi"],
|
||||
"websiteLink": "https://woo.org/",
|
||||
"whitepaperLink": "https://woo.org/Litepaper.pdf",
|
||||
"coinMarketCapsLink": "https://coinmarketcap.com/currencies/wootrade/"
|
||||
},
|
||||
"XLM-USD": {
|
||||
"name": "Stellar",
|
||||
"tags": ["Layer 1"],
|
||||
|
||||
@@ -274,7 +274,7 @@
|
||||
{
|
||||
"baseAsset": "CRV",
|
||||
"referencePrice": 0.48346754113361784,
|
||||
"numOracles": 5,
|
||||
"numOracles": 6,
|
||||
"liquidityTier": 2,
|
||||
"assetName": "Curve DAO Token",
|
||||
"p": -1.0,
|
||||
@@ -325,7 +325,7 @@
|
||||
{
|
||||
"baseAsset": "DYM",
|
||||
"referencePrice": 5.544949130771594,
|
||||
"numOracles": 5,
|
||||
"numOracles": 6,
|
||||
"liquidityTier": 2,
|
||||
"assetName": "Dymension",
|
||||
"p": 0.0,
|
||||
@@ -412,7 +412,7 @@
|
||||
"referencePrice": 0.5560893147613742,
|
||||
"numOracles": 6,
|
||||
"liquidityTier": 2,
|
||||
"assetName": "Fetch AI",
|
||||
"assetName": "Fetch.ai",
|
||||
"p": -1.0,
|
||||
"atomicResolution": -5.0,
|
||||
"minExchanges": 3,
|
||||
@@ -480,7 +480,7 @@
|
||||
"referencePrice": 0.20404992804891367,
|
||||
"numOracles": 6,
|
||||
"liquidityTier": 2,
|
||||
"assetName": "STEPN",
|
||||
"assetName": "GMT",
|
||||
"p": -1.0,
|
||||
"atomicResolution": -5.0,
|
||||
"minExchanges": 3,
|
||||
@@ -514,7 +514,7 @@
|
||||
"referencePrice": 0.07686278766140874,
|
||||
"numOracles": 6,
|
||||
"liquidityTier": 2,
|
||||
"assetName": "Hedera Hashgraph",
|
||||
"assetName": "Hedera",
|
||||
"p": -2.0,
|
||||
"atomicResolution": -4.0,
|
||||
"minExchanges": 3,
|
||||
@@ -565,7 +565,7 @@
|
||||
"referencePrice": 33.427379051845875,
|
||||
"numOracles": 7,
|
||||
"liquidityTier": 2,
|
||||
"assetName": "Injective Protocol",
|
||||
"assetName": "Injective",
|
||||
"p": 1.0,
|
||||
"atomicResolution": -7.0,
|
||||
"minExchanges": 3,
|
||||
@@ -597,7 +597,7 @@
|
||||
{
|
||||
"baseAsset": "JUP",
|
||||
"referencePrice": 0.4339790660244292,
|
||||
"numOracles": 5,
|
||||
"numOracles": 6,
|
||||
"liquidityTier": 2,
|
||||
"assetName": "Jupiter",
|
||||
"p": -1.0,
|
||||
@@ -750,7 +750,7 @@
|
||||
{
|
||||
"baseAsset": "MKR",
|
||||
"referencePrice": 1943.1865605831852,
|
||||
"numOracles": 5,
|
||||
"numOracles": 6,
|
||||
"liquidityTier": 2,
|
||||
"assetName": "Maker",
|
||||
"p": 3.0,
|
||||
@@ -869,7 +869,7 @@
|
||||
{
|
||||
"baseAsset": "RUNE",
|
||||
"referencePrice": 3.7264809096406806,
|
||||
"numOracles": 5,
|
||||
"numOracles": 6,
|
||||
"liquidityTier": 2,
|
||||
"assetName": "Thorchain",
|
||||
"p": 0.0,
|
||||
@@ -888,7 +888,7 @@
|
||||
"referencePrice": 0.37297439115035663,
|
||||
"numOracles": 6,
|
||||
"liquidityTier": 2,
|
||||
"assetName": "SAND",
|
||||
"assetName": "The Sandbox",
|
||||
"p": -1.0,
|
||||
"atomicResolution": -5.0,
|
||||
"minExchanges": 3,
|
||||
@@ -1073,9 +1073,9 @@
|
||||
{
|
||||
"baseAsset": "WOO",
|
||||
"referencePrice": 0.2944897275608197,
|
||||
"numOracles": 5,
|
||||
"numOracles": 6,
|
||||
"liquidityTier": 2,
|
||||
"assetName": "Wootrade Network",
|
||||
"assetName": "WOO Network",
|
||||
"p": -1.0,
|
||||
"atomicResolution": -5.0,
|
||||
"minExchanges": 3,
|
||||
|
||||
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 348 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 117 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 31 KiB |
@@ -8,6 +8,7 @@ const assetIcons = {
|
||||
'1INCH': '/currencies/1inch.png',
|
||||
AAVE: '/currencies/aave.png',
|
||||
ADA: '/currencies/ada.png',
|
||||
AGIX: '/currencies/agix.png',
|
||||
ALGO: '/currencies/algo.png',
|
||||
APE: '/currencies/ape.png',
|
||||
APT: '/currencies/apt.png',
|
||||
@@ -20,6 +21,7 @@ const assetIcons = {
|
||||
BONK: '/currencies/bonk.png',
|
||||
BTC: '/currencies/btc.png',
|
||||
CELO: '/currencies/celo.png',
|
||||
CHZ: '/currencies/chz.png',
|
||||
COMP: '/currencies/comp.png',
|
||||
CRV: '/currencies/crv.png',
|
||||
DAI: '/currencies/dai.png',
|
||||
@@ -28,25 +30,44 @@ const assetIcons = {
|
||||
DYDX: '/currencies/dydx.png',
|
||||
DYM: '/currencies/dym.png',
|
||||
ENJ: '/currencies/enj.png',
|
||||
ENS: '/currencies/ens.png',
|
||||
EOS: '/currencies/eos.png',
|
||||
ETC: '/currencies/etc.png',
|
||||
ETH: '/currencies/eth.png',
|
||||
FET: '/currencies/fet.png',
|
||||
FIL: '/currencies/fil.png',
|
||||
FTM: '/currencies/ftm.png',
|
||||
GALA: "/currencies/gala.png",
|
||||
GMT: "/currencies/gmt.png",
|
||||
GRT: "/currencies/grt.png",
|
||||
HBAR: "/currencies/hbar.png",
|
||||
ICP: '/currencies/icp.png',
|
||||
IMX: '/currencies/imx.png',
|
||||
INJ: '/currencies/inj.png',
|
||||
JTO: '/currencies/jto.png',
|
||||
JUP: '/currencies/jup.png',
|
||||
KAVA: '/currencies/kava.png',
|
||||
LDO: '/currencies/ldo.png',
|
||||
LINK: '/currencies/link.png',
|
||||
LTC: '/currencies/ltc.png',
|
||||
MANA: '/currencies/mana.png',
|
||||
MATIC: '/currencies/matic.png',
|
||||
MASK: '/currencies/mask.png',
|
||||
MINA: '/currencies/mina.png',
|
||||
MKR: '/currencies/mkr.png',
|
||||
NEAR: '/currencies/near.png',
|
||||
ORDI: "/currencies/ordi.png",
|
||||
OP: '/currencies/op.png',
|
||||
PEPE: '/currencies/pepe.png',
|
||||
PYTH: '/currencies/pyth.png',
|
||||
RNDR: '/currencies/rndr.png',
|
||||
RUNE: '/currencies/rune.png',
|
||||
SAND: '/currencies/sand.png',
|
||||
SEI: '/currencies/sei.png',
|
||||
SHIB: '/currencies/shib.png',
|
||||
SNX: '/currencies/snx.png',
|
||||
SOL: '/currencies/sol.png',
|
||||
STX: '/currencies/stx.png',
|
||||
SUI: '/currencies/sui.png',
|
||||
SUSHI: '/currencies/sushi.png',
|
||||
TIA: '/currencies/tia.png',
|
||||
@@ -57,6 +78,7 @@ const assetIcons = {
|
||||
USDT: '/currencies/usdt.png',
|
||||
WBTC: '/currencies/wbtc.png',
|
||||
WETH: '/currencies/weth.png',
|
||||
WOO: '/currencies/woo.png',
|
||||
WLD: '/currencies/wld.png',
|
||||
XLM: '/currencies/xlm.png',
|
||||
XMR: '/currencies/xmr.png',
|
||||
|
||||
@@ -33,4 +33,9 @@ TagStory.argTypes = {
|
||||
control: { type: 'select' },
|
||||
defaultValue: undefined,
|
||||
},
|
||||
isHighlighted: {
|
||||
options: [true, false],
|
||||
control: { type: 'select' },
|
||||
defaultValue: false,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -76,5 +76,6 @@ export const Tag = styled.span<StyleProps>`
|
||||
isHighlighted &&
|
||||
css`
|
||||
background-color: var(--color-accent);
|
||||
color: var(--color-text-button);
|
||||
`}
|
||||
`;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import environments from '../../public/configs/v1/env.json';
|
||||
import environments from '../../public/configs/env.json';
|
||||
|
||||
const CURRENT_MODE = ({
|
||||
production: 'MAINNET',
|
||||
@@ -14,10 +14,5 @@ export const isDev = CURRENT_MODE === 'DEV';
|
||||
export const AVAILABLE_ENVIRONMENTS = environments.deployments[CURRENT_MODE];
|
||||
export const CURRENT_ABACUS_DEPLOYMENT = CURRENT_MODE;
|
||||
export const ENVIRONMENT_CONFIG_MAP = environments.environments;
|
||||
export const TOKEN_CONFIG_MAP = environments.tokens;
|
||||
export const LINKS_CONFIG_MAP = environments.links;
|
||||
export const WALLETS_CONFIG_MAP = environments.wallets;
|
||||
export const GOVERNANCE_CONFIG_MAP = environments.governance;
|
||||
export type DydxNetwork = keyof typeof ENVIRONMENT_CONFIG_MAP;
|
||||
export type DydxChainId = keyof typeof TOKEN_CONFIG_MAP;
|
||||
export const DEFAULT_APP_ENVIRONMENT = AVAILABLE_ENVIRONMENTS.default as DydxNetwork;
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
|
||||
import { isMetaMask } from '@/lib/wallet/providers';
|
||||
|
||||
import { DydxChainId, WALLETS_CONFIG_MAP } from './networks';
|
||||
import { DydxNetwork, ENVIRONMENT_CONFIG_MAP } from './networks';
|
||||
|
||||
// Wallet connection types
|
||||
|
||||
@@ -291,17 +291,17 @@ export const COSMOS_DERIVATION_PATH = "m/44'/118'/0'/0/0";
|
||||
/**
|
||||
* @description typed data to sign for dYdX Chain onboarding
|
||||
*/
|
||||
export const getSignTypedData = (selectedDydxChainId: DydxChainId) =>
|
||||
export const getSignTypedData = (selectedNetwork: DydxNetwork) =>
|
||||
({
|
||||
primaryType: 'dYdX',
|
||||
domain: {
|
||||
name: WALLETS_CONFIG_MAP[selectedDydxChainId].signTypedDataDomainName,
|
||||
name: ENVIRONMENT_CONFIG_MAP[selectedNetwork].wallets.signTypedDataDomainName,
|
||||
},
|
||||
types: {
|
||||
dYdX: [{ name: 'action', type: 'string' }],
|
||||
},
|
||||
message: {
|
||||
action: WALLETS_CONFIG_MAP[selectedDydxChainId].signTypedDataAction,
|
||||
action: ENVIRONMENT_CONFIG_MAP[selectedNetwork].wallets.signTypedDataAction,
|
||||
},
|
||||
} as const);
|
||||
|
||||
|
||||
@@ -18,13 +18,14 @@ import type { ResolutionString } from 'public/tradingview/charting_library';
|
||||
import type { ConnectNetworkEvent, NetworkConfig } from '@/constants/abacus';
|
||||
import { DEFAULT_TRANSACTION_MEMO } from '@/constants/analytics';
|
||||
import { type Candle, RESOLUTION_MAP } from '@/constants/candles';
|
||||
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||
import { DydxChainAsset } from '@/constants/wallets';
|
||||
|
||||
import { getSelectedNetwork } from '@/state/appSelectors';
|
||||
|
||||
import { log } from '@/lib/telemetry';
|
||||
|
||||
import { useRestrictions } from './useRestrictions';
|
||||
import { useTokenConfigs } from './useTokenConfigs';
|
||||
|
||||
type DydxContextType = ReturnType<typeof useDydxClientContext>;
|
||||
const DydxContext = createContext<DydxContextType>({} as DydxContextType);
|
||||
@@ -40,8 +41,7 @@ const useDydxClientContext = () => {
|
||||
// ------ Network ------ //
|
||||
|
||||
const selectedNetwork = useSelector(getSelectedNetwork);
|
||||
const { usdcDenom, usdcDecimals, usdcGasDenom, chainTokenDenom, chainTokenDecimals } =
|
||||
useTokenConfigs();
|
||||
const tokensConfigs = ENVIRONMENT_CONFIG_MAP[selectedNetwork].tokens;
|
||||
|
||||
const [networkConfig, setNetworkConfig] = useState<NetworkConfig>();
|
||||
|
||||
@@ -75,11 +75,11 @@ const useDydxClientContext = () => {
|
||||
networkConfig.validatorUrl,
|
||||
networkConfig.chainId,
|
||||
{
|
||||
USDC_DENOM: usdcDenom,
|
||||
USDC_DECIMALS: usdcDecimals,
|
||||
USDC_GAS_DENOM: usdcGasDenom,
|
||||
CHAINTOKEN_DENOM: chainTokenDenom,
|
||||
CHAINTOKEN_DECIMALS: chainTokenDecimals,
|
||||
USDC_DENOM: tokensConfigs[DydxChainAsset.USDC].denom,
|
||||
USDC_DECIMALS: tokensConfigs[DydxChainAsset.USDC].decimals,
|
||||
USDC_GAS_DENOM: tokensConfigs[DydxChainAsset.USDC].gasDenom,
|
||||
CHAINTOKEN_DENOM: tokensConfigs[DydxChainAsset.CHAINTOKEN].denom,
|
||||
CHAINTOKEN_DECIMALS: tokensConfigs[DydxChainAsset.CHAINTOKEN].decimals,
|
||||
},
|
||||
{
|
||||
broadcastPollIntervalMs: 3_000,
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import { GOVERNANCE_CONFIG_MAP } from '@/constants/networks';
|
||||
|
||||
import { getSelectedDydxChainId } from '@/state/appSelectors';
|
||||
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||
import { useSelectedNetwork } from '@/hooks';
|
||||
|
||||
export interface GovernanceVariables {
|
||||
newMarketProposal: {
|
||||
@@ -13,7 +10,7 @@ export interface GovernanceVariables {
|
||||
}
|
||||
|
||||
export const useGovernanceVariables = (): GovernanceVariables => {
|
||||
const selectedDydxChainId = useSelector(getSelectedDydxChainId);
|
||||
const governanceVars = GOVERNANCE_CONFIG_MAP[selectedDydxChainId] as GovernanceVariables;
|
||||
const { selectedNetwork } = useSelectedNetwork();
|
||||
const governanceVars = ENVIRONMENT_CONFIG_MAP[selectedNetwork].governance as GovernanceVariables;
|
||||
return governanceVars;
|
||||
};
|
||||
|
||||
@@ -5,6 +5,7 @@ import { isEqual, groupBy } from 'lodash';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
import { DialogTypes } from '@/constants/dialogs';
|
||||
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||
import { AppRoute } from '@/constants/routes';
|
||||
import { DydxChainAsset } from '@/constants/wallets';
|
||||
|
||||
@@ -22,7 +23,7 @@ import {
|
||||
TransferNotificationTypes,
|
||||
} from '@/constants/notifications';
|
||||
|
||||
import { useStringGetter } from '@/hooks';
|
||||
import { useSelectedNetwork, useStringGetter } from '@/hooks';
|
||||
import { useLocalNotifications } from '@/hooks/useLocalNotifications';
|
||||
|
||||
import { AssetIcon } from '@/components/AssetIcon';
|
||||
@@ -35,7 +36,6 @@ import { getSubaccountFills, getSubaccountOrders } from '@/state/accountSelector
|
||||
import { openDialog } from '@/state/dialogs';
|
||||
import { getAbacusNotifications } from '@/state/notificationsSelectors';
|
||||
import { getMarketIds } from '@/state/perpetualsSelectors';
|
||||
import { getSelectedDydxChainId } from '@/state/appSelectors';
|
||||
|
||||
import { formatSeconds } from '@/lib/timeUtils';
|
||||
|
||||
@@ -175,7 +175,7 @@ export const notificationTypes: NotificationTypeConfig[] = [
|
||||
useTrigger: ({ trigger }) => {
|
||||
const stringGetter = useStringGetter();
|
||||
const { transferNotifications } = useLocalNotifications();
|
||||
const selectedDydxChainId = useSelector(getSelectedDydxChainId);
|
||||
const { selectedNetwork } = useSelectedNetwork();
|
||||
|
||||
useEffect(() => {
|
||||
for (const transfer of transferNotifications) {
|
||||
@@ -184,7 +184,7 @@ export const notificationTypes: NotificationTypeConfig[] = [
|
||||
const icon = <Icon iconName={isFinished ? IconName.Transfer : IconName.Clock} />;
|
||||
|
||||
const transferType =
|
||||
type ?? fromChainId === selectedDydxChainId
|
||||
type ?? fromChainId === ENVIRONMENT_CONFIG_MAP[selectedNetwork].dydxChainId
|
||||
? TransferNotificationTypes.Withdrawal
|
||||
: TransferNotificationTypes.Deposit;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useCallback } from 'react';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
|
||||
import { LocalStorageKey } from '@/constants/localStorage';
|
||||
import { DEFAULT_APP_ENVIRONMENT, DydxNetwork } from '@/constants/networks';
|
||||
import { DEFAULT_APP_ENVIRONMENT, DydxNetwork, ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||
|
||||
import { useAccounts, useLocalStorage } from '@/hooks';
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import { setSubaccount, setHistoricalPnl, removeUncommittedOrderClientId } from
|
||||
import { getBalances } from '@/state/accountSelectors';
|
||||
|
||||
import abacusStateManager from '@/lib/abacus';
|
||||
import { hashFromTx } from '@/lib/txUtils';
|
||||
import { hashFromTx } from '@/lib/hashfromTx';
|
||||
import { log } from '@/lib/telemetry';
|
||||
|
||||
import { useAccounts } from './useAccounts';
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import { TOKEN_CONFIG_MAP } from '@/constants/networks';
|
||||
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||
import { DydxChainAsset } from '@/constants/wallets';
|
||||
|
||||
import { getSelectedDydxChainId } from '@/state/appSelectors';
|
||||
import { useSelectedNetwork } from '@/hooks';
|
||||
|
||||
export const useTokenConfigs = (): {
|
||||
tokensConfigs: {
|
||||
@@ -12,33 +10,31 @@ export const useTokenConfigs = (): {
|
||||
name: string;
|
||||
decimals: number;
|
||||
gasDenom?: string;
|
||||
};
|
||||
},
|
||||
[DydxChainAsset.CHAINTOKEN]: {
|
||||
denom: string;
|
||||
name: string;
|
||||
decimals: number;
|
||||
gasDenom?: string;
|
||||
};
|
||||
},
|
||||
};
|
||||
usdcDenom: string;
|
||||
usdcDecimals: number;
|
||||
usdcGasDenom: string;
|
||||
usdcLabel: string;
|
||||
chainTokenDenom: string;
|
||||
chainTokenDecimals: number;
|
||||
chainTokenLabel: string;
|
||||
} => {
|
||||
const selectedDydxChainId = useSelector(getSelectedDydxChainId);
|
||||
const tokensConfigs = TOKEN_CONFIG_MAP[selectedDydxChainId];
|
||||
const { selectedNetwork } = useSelectedNetwork();
|
||||
const tokensConfigs = ENVIRONMENT_CONFIG_MAP[selectedNetwork].tokens;
|
||||
|
||||
return {
|
||||
return {
|
||||
tokensConfigs,
|
||||
usdcDenom: tokensConfigs[DydxChainAsset.USDC].denom,
|
||||
usdcDecimals: tokensConfigs[DydxChainAsset.USDC].decimals,
|
||||
usdcGasDenom: tokensConfigs[DydxChainAsset.USDC].gasDenom,
|
||||
usdcDenom: tokensConfigs[DydxChainAsset.USDC].denom,
|
||||
usdcDecimals: tokensConfigs[DydxChainAsset.USDC].decimals,
|
||||
usdcLabel: tokensConfigs[DydxChainAsset.USDC].name,
|
||||
chainTokenDenom: tokensConfigs[DydxChainAsset.CHAINTOKEN].denom,
|
||||
chainTokenDecimals: tokensConfigs[DydxChainAsset.CHAINTOKEN].decimals,
|
||||
chainTokenDecimals: tokensConfigs[DydxChainAsset.CHAINTOKEN].decimals,
|
||||
chainTokenLabel: tokensConfigs[DydxChainAsset.CHAINTOKEN].name,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
import { useSelector } from 'react-redux';
|
||||
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||
|
||||
import { LINKS_CONFIG_MAP } from '@/constants/networks';
|
||||
|
||||
import { getSelectedDydxChainId } from '@/state/appSelectors';
|
||||
import { useSelectedNetwork } from '@/hooks';
|
||||
|
||||
const FALLBACK_URL = 'https://help.dydx.exchange/';
|
||||
|
||||
export interface LinksConfigs {
|
||||
tos: string;
|
||||
privacy: string;
|
||||
statusPage: string;
|
||||
mintscan: string;
|
||||
mintscanBase: string;
|
||||
feedback?: string;
|
||||
@@ -30,13 +27,12 @@ export interface LinksConfigs {
|
||||
}
|
||||
|
||||
export const useURLConfigs = (): LinksConfigs => {
|
||||
const selectedDydxChainId = useSelector(getSelectedDydxChainId);
|
||||
const linksConfigs = LINKS_CONFIG_MAP[selectedDydxChainId] as LinksConfigs;
|
||||
const { selectedNetwork } = useSelectedNetwork();
|
||||
const linksConfigs = ENVIRONMENT_CONFIG_MAP[selectedNetwork].links as LinksConfigs;
|
||||
|
||||
return {
|
||||
tos: linksConfigs.tos,
|
||||
privacy: linksConfigs.privacy,
|
||||
statusPage: linksConfigs.statusPage,
|
||||
mintscan: linksConfigs.mintscan,
|
||||
mintscanBase: linksConfigs.mintscanBase,
|
||||
feedback: linksConfigs.feedback || FALLBACK_URL,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useSelector } from 'react-redux';
|
||||
import { EvmDerivedAddresses } from '@/constants/account';
|
||||
import { STRING_KEYS } from '@/constants/localization';
|
||||
import { LocalStorageKey } from '@/constants/localStorage';
|
||||
import { ENVIRONMENT_CONFIG_MAP, WALLETS_CONFIG_MAP } from '@/constants/networks';
|
||||
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||
|
||||
import {
|
||||
type DydxAddress,
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
WalletType as CosmosWalletType,
|
||||
} from 'graz';
|
||||
|
||||
import { getSelectedDydxChainId } from '@/state/appSelectors';
|
||||
import { getSelectedNetwork } from '@/state/appSelectors';
|
||||
|
||||
import { resolveWagmiConnector } from '@/lib/wagmi';
|
||||
import { getWalletConnection, parseWalletError } from '@/lib/wallet';
|
||||
@@ -91,8 +91,8 @@ export const useWalletConnection = () => {
|
||||
|
||||
// Wallet connection
|
||||
|
||||
const selectedDydxChainId = useSelector(getSelectedDydxChainId);
|
||||
const walletConnectConfig = WALLETS_CONFIG_MAP[selectedDydxChainId].walletconnect;
|
||||
const selectedNetwork = useSelector(getSelectedNetwork);
|
||||
const walletConnectConfig = ENVIRONMENT_CONFIG_MAP[selectedNetwork].wallets.walletconnect;
|
||||
const wagmiConnector = useMemo(
|
||||
() =>
|
||||
walletType && walletConnectionType
|
||||
|
||||
@@ -3,9 +3,9 @@ import styled, { type AnyStyledComponent, css } from 'styled-components';
|
||||
import { AbacusApiStatus } from '@/constants/abacus';
|
||||
import { ButtonSize, ButtonType } from '@/constants/buttons';
|
||||
import { STRING_KEYS } from '@/constants/localization';
|
||||
import { isDev } from '@/constants/networks';
|
||||
import { ENVIRONMENT_CONFIG_MAP, isDev } from '@/constants/networks';
|
||||
|
||||
import { useApiState, useStringGetter, useURLConfigs } from '@/hooks';
|
||||
import { useApiState, useSelectedNetwork, useStringGetter } from '@/hooks';
|
||||
import { ChatIcon, LinkOutIcon } from '@/icons';
|
||||
|
||||
import { layoutMixins } from '@/styles/layoutMixins';
|
||||
@@ -28,7 +28,8 @@ enum ExchangeStatus {
|
||||
export const FooterDesktop = () => {
|
||||
const stringGetter = useStringGetter();
|
||||
const { height, indexerHeight, status, statusErrorMessage } = useApiState();
|
||||
const { statusPage } = useURLConfigs();
|
||||
const { selectedNetwork } = useSelectedNetwork();
|
||||
const { statusPage } = ENVIRONMENT_CONFIG_MAP[selectedNetwork].links;
|
||||
|
||||
const { exchangeStatus, label } =
|
||||
!status || status === AbacusApiStatus.NORMAL
|
||||
|
||||
@@ -34,7 +34,7 @@ import {
|
||||
import { DEFAULT_TRANSACTION_MEMO } from '@/constants/analytics';
|
||||
import { DialogTypes } from '@/constants/dialogs';
|
||||
import { UNCOMMITTED_ORDER_TIMEOUT_MS } from '@/constants/trade';
|
||||
import { DydxNetwork, isTestnet } from '@/constants/networks';
|
||||
import { ENVIRONMENT_CONFIG_MAP, DydxNetwork, isTestnet } from '@/constants/networks';
|
||||
|
||||
import { RootStore } from '@/state/_store';
|
||||
import { addUncommittedOrderClientId, removeUncommittedOrderClientId } from '@/state/account';
|
||||
@@ -43,8 +43,7 @@ import { openDialog } from '@/state/dialogs';
|
||||
import { StatefulOrderError } from '../errors';
|
||||
import { bytesToBigInt } from '../numbers';
|
||||
import { log } from '../telemetry';
|
||||
import { hashFromTx, getMintscanTxLink } from '../txUtils';
|
||||
import { getDydxChainIdFromNetwork } from '../network';
|
||||
import { hashFromTx } from '../hashfromTx';
|
||||
|
||||
class DydxChainTransactions implements AbacusDYDXChainTransactionsProtocol {
|
||||
private compositeClient: CompositeClient | undefined;
|
||||
@@ -239,10 +238,9 @@ class DydxChainTransactions implements AbacusDYDXChainTransactionsProtocol {
|
||||
|
||||
if (isTestnet) {
|
||||
console.log(
|
||||
getMintscanTxLink(
|
||||
getDydxChainIdFromNetwork(this.compositeClient.network.getString() as DydxNetwork),
|
||||
hash
|
||||
)
|
||||
`${ENVIRONMENT_CONFIG_MAP[
|
||||
this.compositeClient.network.getString() as DydxNetwork
|
||||
]?.links?.mintscan?.replace('{tx_hash}', hash.toString())}`
|
||||
);
|
||||
} else console.log(`txHash: ${hash}`);
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export const hashFromTx = (
|
||||
txHash: string | Uint8Array
|
||||
): string => `0x${Buffer.from(txHash).toString('hex')}`;
|
||||
@@ -1,8 +1,4 @@
|
||||
import { type DydxNetwork, ENVIRONMENT_CONFIG_MAP, type DydxChainId } from '@/constants/networks';
|
||||
import { type DydxNetwork, ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||
|
||||
export const validateAgainstAvailableEnvironments = (value: DydxNetwork) =>
|
||||
Object.keys(ENVIRONMENT_CONFIG_MAP).includes(value);
|
||||
|
||||
export const getDydxChainIdFromNetwork = (network: DydxNetwork) => {
|
||||
return ENVIRONMENT_CONFIG_MAP[network].dydxChainId as DydxChainId;
|
||||
};
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import { DydxChainId, LINKS_CONFIG_MAP } from '@/constants/networks';
|
||||
|
||||
export const hashFromTx = (txHash: string | Uint8Array): string =>
|
||||
`0x${Buffer.from(txHash).toString('hex')}`;
|
||||
|
||||
export const getMintscanTxLink = (dydxChainId: DydxChainId, txHash: string): string =>
|
||||
`${LINKS_CONFIG_MAP[dydxChainId]?.mintscan?.replace('{tx_hash}', txHash.toString())}`;
|
||||
@@ -1,8 +1,4 @@
|
||||
import { DydxChainId, ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||
import type { RootState } from './_store';
|
||||
|
||||
export const getApiState = (state: RootState) => state.app.apiState;
|
||||
export const getSelectedNetwork = (state: RootState) => state.app.selectedNetwork;
|
||||
|
||||
export const getSelectedDydxChainId = (state: RootState) =>
|
||||
ENVIRONMENT_CONFIG_MAP[state.app.selectedNetwork].dydxChainId as DydxChainId;
|
||||
|
||||
@@ -25,7 +25,7 @@ import { Switch } from '@/components/Switch';
|
||||
import { WithReceipt } from '@/components/WithReceipt';
|
||||
import { WithTooltip } from '@/components/WithTooltip';
|
||||
|
||||
import { getSelectedNetwork, getSelectedDydxChainId } from '@/state/appSelectors';
|
||||
import { getSelectedNetwork } from '@/state/appSelectors';
|
||||
|
||||
import { track } from '@/lib/analytics';
|
||||
import { isTruthy } from '@/lib/isTruthy';
|
||||
@@ -98,8 +98,7 @@ export const GenerateKeys = ({
|
||||
EvmDerivedAccountStatus.Derived,
|
||||
].includes(status);
|
||||
|
||||
const selectedDydxChainId = useSelector(getSelectedDydxChainId);
|
||||
const signTypedData = getSignTypedData(selectedDydxChainId);
|
||||
const signTypedData = getSignTypedData(selectedNetwork);
|
||||
const { signTypedDataAsync } = useSignTypedData({
|
||||
...signTypedData,
|
||||
domain: {
|
||||
|
||||
@@ -10,7 +10,7 @@ import { TransferInputField, TransferInputTokenResource, TransferType } from '@/
|
||||
import { AlertType } from '@/constants/alerts';
|
||||
import { ButtonSize } from '@/constants/buttons';
|
||||
import { STRING_KEYS } from '@/constants/localization';
|
||||
import { isMainnet } from '@/constants/networks';
|
||||
import { ENVIRONMENT_CONFIG_MAP, isMainnet } from '@/constants/networks';
|
||||
import { MAX_CCTP_TRANSFER_AMOUNT, MAX_PRICE_IMPACT, NumberSign } from '@/constants/numbers';
|
||||
import type { EvmAddress } from '@/constants/wallets';
|
||||
|
||||
@@ -32,7 +32,6 @@ import { OutputType } from '@/components/Output';
|
||||
import { Tag } from '@/components/Tag';
|
||||
import { WithDetailsReceipt } from '@/components/WithDetailsReceipt';
|
||||
|
||||
import { getSelectedDydxChainId } from '@/state/appSelectors';
|
||||
import { getTransferInputs } from '@/state/inputsSelectors';
|
||||
|
||||
import abacusStateManager from '@/lib/abacus';
|
||||
@@ -57,7 +56,7 @@ export const DepositForm = ({ onDeposit, onError }: DepositFormProps) => {
|
||||
const [error, setError] = useState<Error | null>(null);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [requireUserActionInWallet, setRequireUserActionInWallet] = useState(false);
|
||||
const selectedDydxChainId = useSelector(getSelectedDydxChainId);
|
||||
const { selectedNetwork } = useSelectedNetwork();
|
||||
|
||||
const { evmAddress, signerWagmi, publicClientWagmi, nobleAddress } = useAccounts();
|
||||
|
||||
@@ -263,7 +262,9 @@ export const DepositForm = ({ onDeposit, onError }: DepositFormProps) => {
|
||||
if (txHash) {
|
||||
addTransferNotification({
|
||||
txHash: txHash,
|
||||
toChainId: !isCctp ? selectedDydxChainId : getNobleChainId(),
|
||||
toChainId: !isCctp
|
||||
? ENVIRONMENT_CONFIG_MAP[selectedNetwork].dydxChainId
|
||||
: getNobleChainId(),
|
||||
fromChainId: chainIdStr || undefined,
|
||||
toAmount: summary?.usdcSize || undefined,
|
||||
triggeredAt: Date.now(),
|
||||
|
||||
@@ -9,7 +9,7 @@ import { TransferInputField, TransferInputTokenResource, TransferType } from '@/
|
||||
import { AlertType } from '@/constants/alerts';
|
||||
import { ButtonSize } from '@/constants/buttons';
|
||||
import { STRING_KEYS } from '@/constants/localization';
|
||||
import { isMainnet } from '@/constants/networks';
|
||||
import { ENVIRONMENT_CONFIG_MAP, isMainnet } from '@/constants/networks';
|
||||
import { TransferNotificationTypes } from '@/constants/notifications';
|
||||
import { MAX_CCTP_TRANSFER_AMOUNT, MAX_PRICE_IMPACT, NumberSign } from '@/constants/numbers';
|
||||
|
||||
@@ -40,7 +40,6 @@ import { Icon, IconName } from '@/components/Icon';
|
||||
|
||||
import { SourceSelectMenu } from '@/views/forms/AccountManagementForms/SourceSelectMenu';
|
||||
|
||||
import { getSelectedDydxChainId } from '@/state/appSelectors';
|
||||
import { getSubaccount } from '@/state/accountSelectors';
|
||||
import { getTransferInputs } from '@/state/inputsSelectors';
|
||||
|
||||
@@ -55,7 +54,7 @@ export const WithdrawForm = () => {
|
||||
const stringGetter = useStringGetter();
|
||||
const [error, setError] = useState<string>();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const selectedDydxChainId = useSelector(getSelectedDydxChainId);
|
||||
const { selectedNetwork } = useSelectedNetwork();
|
||||
|
||||
const { sendSquidWithdraw } = useSubaccount();
|
||||
const { freeCollateral } = useSelector(getSubaccount, shallowEqual) || {};
|
||||
@@ -178,7 +177,9 @@ export const WithdrawForm = () => {
|
||||
addTransferNotification({
|
||||
txHash: txHash,
|
||||
type: TransferNotificationTypes.Withdrawal,
|
||||
fromChainId: !isCctp ? selectedDydxChainId : getNobleChainId(),
|
||||
fromChainId: !isCctp
|
||||
? ENVIRONMENT_CONFIG_MAP[selectedNetwork].dydxChainId
|
||||
: getNobleChainId(),
|
||||
toChainId: chainIdStr || undefined,
|
||||
toAmount: debouncedAmountBN.toNumber(),
|
||||
triggeredAt: Date.now(),
|
||||
|
||||
@@ -9,6 +9,7 @@ import { TransferInputField, TransferType } from '@/constants/abacus';
|
||||
import { AlertType } from '@/constants/alerts';
|
||||
import { ButtonShape, ButtonSize } from '@/constants/buttons';
|
||||
import { STRING_KEYS } from '@/constants/localization';
|
||||
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||
import { NumberSign } from '@/constants/numbers';
|
||||
import { DydxChainAsset } from '@/constants/wallets';
|
||||
|
||||
@@ -17,6 +18,7 @@ import {
|
||||
useAccounts,
|
||||
useDydxClient,
|
||||
useRestrictions,
|
||||
useSelectedNetwork,
|
||||
useStringGetter,
|
||||
useSubaccount,
|
||||
useTokenConfigs,
|
||||
@@ -39,7 +41,6 @@ import { TransferButtonAndReceipt } from '@/views/forms/TransferForm/TransferBut
|
||||
import { WithDetailsReceipt } from '@/components/WithDetailsReceipt';
|
||||
|
||||
import { getSubaccount } from '@/state/accountSelectors';
|
||||
import { getSelectedDydxChainId } from '@/state/appSelectors';
|
||||
import { getTransferInputs } from '@/state/inputsSelectors';
|
||||
|
||||
import abacusStateManager from '@/lib/abacus';
|
||||
@@ -62,7 +63,7 @@ export const TransferForm = ({
|
||||
const { dydxAddress } = useAccounts();
|
||||
const { transfer } = useSubaccount();
|
||||
const { nativeTokenBalance, usdcBalance } = useAccountBalance();
|
||||
const selectedDydxChainId = useSelector(getSelectedDydxChainId);
|
||||
const { selectedNetwork } = useSelectedNetwork();
|
||||
const { tokensConfigs, usdcLabel, chainTokenLabel } = useTokenConfigs();
|
||||
|
||||
const {
|
||||
@@ -238,7 +239,7 @@ export const TransferForm = ({
|
||||
|
||||
const networkOptions = [
|
||||
{
|
||||
chainId: selectedDydxChainId,
|
||||
chainId: ENVIRONMENT_CONFIG_MAP[selectedNetwork].dydxChainId,
|
||||
label: (
|
||||
<Styled.InlineRow>
|
||||
<AssetIcon symbol="DYDX" /> {stringGetter({ key: STRING_KEYS.DYDX_CHAIN })}
|
||||
@@ -321,7 +322,7 @@ export const TransferForm = ({
|
||||
/>
|
||||
<Styled.NetworkSelectMenu
|
||||
label={stringGetter({ key: STRING_KEYS.NETWORK })}
|
||||
value={selectedDydxChainId}
|
||||
value={ENVIRONMENT_CONFIG_MAP[selectedNetwork].dydxChainId}
|
||||
slotTriggerAfter={null}
|
||||
>
|
||||
{networkOptions.map(({ chainId, label }) => (
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import styled, { css, type AnyStyledComponent } from 'styled-components';
|
||||
import { StatusResponse } from '@0xsquid/sdk';
|
||||
|
||||
import { STRING_KEYS } from '@/constants/localization';
|
||||
import { TransferNotificationTypes } from '@/constants/notifications';
|
||||
|
||||
import { useStringGetter, useURLConfigs } from '@/hooks';
|
||||
|
||||
import { layoutMixins } from '@/styles/layoutMixins';
|
||||
import { useStringGetter, useSelectedNetwork, useURLConfigs } from '@/hooks';
|
||||
|
||||
import { Link } from '@/components/Link';
|
||||
import { Icon, IconName } from '@/components/Icon';
|
||||
import { LoadingDots } from '@/components/Loading/LoadingDots';
|
||||
import { LoadingSpinner } from '@/components/Loading/LoadingSpinner';
|
||||
|
||||
import { getSelectedDydxChainId } from '@/state/appSelectors';
|
||||
import { layoutMixins } from '@/styles/layoutMixins';
|
||||
import { STRING_KEYS } from '@/constants/localization';
|
||||
import { ENVIRONMENT_CONFIG_MAP } from '@/constants/networks';
|
||||
import { TransferNotificationTypes } from '@/constants/notifications';
|
||||
|
||||
type ElementProps = {
|
||||
status?: StatusResponse;
|
||||
@@ -35,8 +32,9 @@ enum TransferStatusStep {
|
||||
|
||||
export const TransferStatusSteps = ({ className, status, type }: ElementProps & StyleProps) => {
|
||||
const stringGetter = useStringGetter();
|
||||
const selectedDydxChainId = useSelector(getSelectedDydxChainId);
|
||||
const { selectedNetwork } = useSelectedNetwork();
|
||||
const { mintscan: mintscanTxUrl } = useURLConfigs();
|
||||
const dydxChainId = ENVIRONMENT_CONFIG_MAP[selectedNetwork].dydxChainId;
|
||||
|
||||
const { currentStep, steps } = useMemo(() => {
|
||||
const routeStatus = status?.routeStatus;
|
||||
@@ -57,7 +55,7 @@ export const TransferStatusSteps = ({ className, status, type }: ElementProps &
|
||||
link:
|
||||
type === TransferNotificationTypes.Deposit
|
||||
? status?.fromChain?.transactionUrl
|
||||
: routeStatus?.[0]?.chainId === selectedDydxChainId && routeStatus[0].txHash
|
||||
: routeStatus?.[0]?.chainId === dydxChainId && routeStatus[0].txHash
|
||||
? `${mintscanTxUrl?.replace('{tx_hash}', routeStatus[0].txHash.replace('0x', ''))}`
|
||||
: undefined,
|
||||
},
|
||||
@@ -83,7 +81,7 @@ export const TransferStatusSteps = ({ className, status, type }: ElementProps &
|
||||
link:
|
||||
type === TransferNotificationTypes.Withdrawal
|
||||
? status?.toChain?.transactionUrl
|
||||
: currentStatus?.chainId === selectedDydxChainId && currentStatus?.txHash
|
||||
: currentStatus?.chainId === dydxChainId && currentStatus?.txHash
|
||||
? `${mintscanTxUrl?.replace('{tx_hash}', currentStatus.txHash.replace('0x', ''))}`
|
||||
: undefined,
|
||||
},
|
||||
|
||||