-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c8270b9
commit a111b5c
Showing
5 changed files
with
173 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
export const spotMarketIdMap: Record<string, { slug: string; ticker: string }> = | ||
{ | ||
'0xd0ba680312852ffb0709446fff518e6c4d798fb70cfd2699aba3717a2517cfd5': { | ||
// APP/INJ | ||
slug: 'app-usdt', | ||
ticker: 'APP/USDT' | ||
}, | ||
'0x959c9401a557ac090fff3ec11db5a1a9832e51a97a41b722d2496bb3cb0b2f72': { | ||
// ANDR/INJ | ||
slug: 'andr-usdt', | ||
ticker: 'ANDR/USDT' | ||
}, | ||
'0xa6ec1de114a5ffa85b6b235144383ce51028a1c0c2dee7db5ff8bf14d5ca0d49': { | ||
slug: 'pythlegacy-usdt', | ||
ticker: 'PYTHlegacy/USDT' | ||
} | ||
} | ||
|
||
export const spotDenomMap: Record<string, Function> = { | ||
'factory/inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk/inj1tjcf9497fwmrnk22jfu5hsdq82qshga54ajvzy': | ||
({ slug, ticker }: { slug: string; ticker: string }) => ({ | ||
slug: slug.replace('pyth', 'pythlegacy'), | ||
ticker: ticker.replace('PYTH', 'PYTHlegacy') | ||
}), | ||
peggy0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48: ({ | ||
slug, | ||
ticker | ||
}: { | ||
slug: string | ||
ticker: string | ||
}) => ({ | ||
slug: slug.replace('usdc', 'usdclegacy'), | ||
ticker: ticker.replace('USDC', 'USDClegacy') | ||
}), | ||
'factory/inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk/inj1q6zlut7gtkzknkk773jecujwsdkgq882akqksk': | ||
({ slug, ticker }: { slug: string; ticker: string }) => ({ | ||
slug: slug.replace('usdc', 'usdcet'), | ||
ticker: ticker.replace('USDC', 'USDCet') | ||
}), | ||
'ibc/2CBC2EA121AE42563B08028466F37B600F2D7D4282342DE938283CC3FB2BC00E': ({ | ||
slug, | ||
ticker | ||
}: { | ||
slug: string | ||
ticker: string | ||
}) => ({ | ||
slug: slug.replace('usdcnb', 'usdc'), | ||
ticker: ticker.replace('USDCnb', 'USDC') | ||
}), | ||
'factory/inj1alwxgkns9x7d2sprymwwfvzl5t7teetym02lrj/NONJA': ({ | ||
slug, | ||
ticker | ||
}: { | ||
slug: string | ||
ticker: string | ||
}) => ({ | ||
slug: slug.replace('nonja', 'nonjaunverified'), | ||
ticker: ticker.replace('NONJA', 'NONJAunverified') | ||
}), | ||
'factory/inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk/inj1sthrn5ep8ls5vzz8f9gp89khhmedahhdkqa8z3': | ||
({ ticker }: { ticker: string }) => ({ | ||
ticker: ticker.replace('SOL', 'SOLlegacy') | ||
}), | ||
'factory/inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk/inj1d5vz0uzwlpfvgwrwulxg6syy82axa58y4fuszd': | ||
({ ticker }: { ticker: string }) => ({ | ||
ticker: ticker.replace('ARB', 'ARBlegacy') | ||
}), | ||
'factory/inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk/inj1dxv423h8ygzgxmxnvrf33ws3k94aedfdevxd8h': | ||
({ ticker }: { ticker: string }) => ({ | ||
ticker: ticker.replace('WMATIC', 'WMATIClegacy') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { spotMarketIdMap, spotDenomMap } from '@/data/spot' | ||
|
||
export const sharedSpotGetSlugAndTicket = ({ | ||
marketId, | ||
slug, | ||
ticker, | ||
baseDenom, | ||
quoteDenom | ||
}: { | ||
marketId: string | ||
slug: string | ||
ticker: string | ||
baseDenom: string | ||
quoteDenom: string | ||
}): { slug: string; ticker: string } => { | ||
if (spotMarketIdMap[marketId]) { | ||
return spotMarketIdMap[marketId] | ||
} | ||
|
||
if (spotDenomMap[baseDenom]) { | ||
return spotDenomMap[baseDenom]({ slug, ticker }) | ||
} | ||
|
||
if (spotDenomMap[quoteDenom]) { | ||
return spotDenomMap[quoteDenom]({ slug, ticker }) | ||
} | ||
|
||
return { slug, ticker } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1648,10 +1648,10 @@ | |
shx "^0.3.2" | ||
snakecase-keys "^5.4.1" | ||
|
||
"@injectivelabs/[email protected].46": | ||
version "1.14.11-beta.46" | ||
resolved "https://registry.npmjs.org/@injectivelabs/sdk-ui-ts/-/sdk-ui-ts-1.14.11-beta.46.tgz#fc074c304036468b2193abc23ef2f3cc34a57022" | ||
integrity sha512-COM8Aff1cerM41JVDHnTkCKojQHVc749qa09sakFTAorKZRzF+mSyyYurf9fHuPtO9PQ0KxDd1qxwpTiP08XkQ== | ||
"@injectivelabs/[email protected].47": | ||
version "1.14.11-beta.47" | ||
resolved "https://registry.yarnpkg.com/@injectivelabs/sdk-ui-ts/-/sdk-ui-ts-1.14.11-beta.47.tgz#26cda020261cf0cfa7706a175c866ac6e0e8b273" | ||
integrity sha512-IVGX+yonL4UdtGgiK9DC4eBpblR5XKuWA9qN4IKwAFOyNc5aag1cypCEXD82DjEkRkxJ+IoZ/QagI8dM11u3uQ== | ||
dependencies: | ||
"@injectivelabs/contracts" "^1.14.11-beta.4" | ||
"@injectivelabs/exceptions" "^1.14.11-beta.3" | ||
|
@@ -1728,10 +1728,10 @@ | |
snakecase-keys "^5.1.2" | ||
store2 "^2.12.0" | ||
|
||
"@injectivelabs/[email protected].42": | ||
version "1.14.11-beta.42" | ||
resolved "https://registry.npmjs.org/@injectivelabs/wallet-ts/-/wallet-ts-1.14.11-beta.42.tgz#d5f58cfa6884524062c56fa4c91b9c99c006753a" | ||
integrity sha512-Ccq65Bc+CoWMStsrbd8dghFr82bvM3yAF2B5QwElQ6Nj6SFFvYCt5hhhpsjC+W8MGiqyNp3/AzS9G51NfU0rwA== | ||
"@injectivelabs/[email protected].43": | ||
version "1.14.11-beta.43" | ||
resolved "https://registry.yarnpkg.com/@injectivelabs/wallet-ts/-/wallet-ts-1.14.11-beta.43.tgz#9ae49178b831eadd6392fac287b04a4e1716a645" | ||
integrity sha512-vJfJMBJtUlE8tXi+YFc4fBabFeknBLfzvJV2CPdVKYS+/Ky9sPWJBPgi1RbiwXVQoEsoQ2aPkCGiB4LsZJ3aGw== | ||
dependencies: | ||
"@cosmjs/launchpad" "0.27.1" | ||
"@cosmjs/proto-signing" "0.32.2" | ||
|