diff --git a/apps/shared/hooks/useChainSelector.tsx b/apps/shared/hooks/useChainSelector.tsx index b6d3e29..2a655d4 100644 --- a/apps/shared/hooks/useChainSelector.tsx +++ b/apps/shared/hooks/useChainSelector.tsx @@ -6,6 +6,7 @@ import { ReactComponent as InjectiveIcon } from 'components/assets/Injective.svg import { ReactComponent as NeutronIcon } from 'components/assets/Neutron.svg'; import { ReactComponent as NibiruIcon } from 'components/assets/Nibiru.svg'; import { ReactComponent as MigalooIcon } from 'components/assets/Migaloo.svg'; +import { ReactComponent as OsmoIcon } from 'components/assets/Osmo.svg'; import { ChainMetadata as SdkChainMetadata, TERRA_CHAIN, @@ -42,6 +43,8 @@ const getChainMetadata = (sdkMetadata: SdkChainMetadata) => { return { ...sdkMetadata, icon: }; case 'migaloo': return { ...sdkMetadata, icon: }; + case 'osmosis': + return { ...sdkMetadata, icon: }; } }; diff --git a/apps/shared/package.json b/apps/shared/package.json index 51030ba..2444c95 100644 --- a/apps/shared/package.json +++ b/apps/shared/package.json @@ -33,7 +33,7 @@ "@mui/material": "^5.10.2", "@terra-money/feather.js": "^1.0.11", "@terra-money/wallet-kit": "^1.0.11", - "@terra-money/warp-sdk": "^0.2.10", + "@terra-money/warp-sdk": "^0.2.13", "assert": "^2.0.0", "big.js": "^6.2.1", "buffer": "^6.0.3", diff --git a/apps/shared/queries/tokens/useNativeTokensQuery.ts b/apps/shared/queries/tokens/useNativeTokensQuery.ts index 4b6d79a..501ba32 100644 --- a/apps/shared/queries/tokens/useNativeTokensQuery.ts +++ b/apps/shared/queries/tokens/useNativeTokensQuery.ts @@ -1,6 +1,6 @@ import { useQuery, UseQueryResult } from 'react-query'; import { useChainSelector } from '../../hooks'; -import { INJ, LUNA, NativeTokensResponse, NEUTRON, NIBIRU, WHALE } from '../../types'; +import { INJ, LUNA, NativeTokensResponse, NEUTRON, NIBIRU, WHALE, OSMO } from '../../types'; export const useNativeTokensQuery = ( queryName: string = 'QUERY:NATIVE_TOKENS' @@ -16,6 +16,7 @@ export const useNativeTokensQuery = ( ...(selectedChain.name === 'neutron' && { [NEUTRON.key]: NEUTRON }), ...(selectedChain.name === 'nibiru' && { [NIBIRU.key]: NIBIRU }), ...(selectedChain.name === 'migaloo' && { [WHALE.key]: WHALE }), + ...(selectedChain.name === 'osmosis' && { [OSMO.key]: OSMO }), }; }, { diff --git a/apps/shared/types/tokens.ts b/apps/shared/types/tokens.ts index e558a61..03fa3f1 100644 --- a/apps/shared/types/tokens.ts +++ b/apps/shared/types/tokens.ts @@ -69,6 +69,17 @@ export const INJ: NativeToken = { coinGeckoId: 'injective-protocol', }; +export const OSMO: NativeToken = { + key: 'uosmo', + type: 'native', + denom: 'uosmo', + name: 'Osmosis', + symbol: 'OSMO', + decimals: 6, + icon: 'https://station-assets.terra.dev/img/chains/Osmosis.svg', + coinGeckoId: 'osmosis', +}; + export interface NativeTokensResponse { [tokenAddr: string]: NativeToken; } diff --git a/apps/warp-protocol/package.json b/apps/warp-protocol/package.json index 32ac086..daa8f39 100644 --- a/apps/warp-protocol/package.json +++ b/apps/warp-protocol/package.json @@ -57,7 +57,7 @@ "@terra-money/feather.js": "^1.0.11", "@terra-money/terra-station-mobile": "1.0.8", "@terra-money/wallet-kit": "^1.0.11", - "@terra-money/warp-sdk": "^0.2.10", + "@terra-money/warp-sdk": "^0.2.13", "assert": "^2.0.0", "big.js": "^6.2.1", "brace": "^0.11.1", diff --git a/apps/warp-protocol/src/components/assets/Osmo.svg b/apps/warp-protocol/src/components/assets/Osmo.svg new file mode 100644 index 0000000..bc90e46 --- /dev/null +++ b/apps/warp-protocol/src/components/assets/Osmo.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/warp-protocol/src/hooks/useNativeToken.ts b/apps/warp-protocol/src/hooks/useNativeToken.ts index 846a14d..6865569 100644 --- a/apps/warp-protocol/src/hooks/useNativeToken.ts +++ b/apps/warp-protocol/src/hooks/useNativeToken.ts @@ -1,5 +1,5 @@ import { useChainSelector } from '@terra-money/apps/hooks'; -import { INJ, LUNA, NativeToken, NEUTRON, NIBIRU, WHALE } from '@terra-money/apps/types'; +import { INJ, LUNA, NativeToken, NEUTRON, NIBIRU, OSMO, WHALE } from '@terra-money/apps/types'; import { useMemo } from 'react'; export const useNativeToken = (): NativeToken => { @@ -17,6 +17,8 @@ export const useNativeToken = (): NativeToken => { return NIBIRU; case 'migaloo': return WHALE; + case 'osmosis': + return OSMO; } }, [selectedChain.name]); }; diff --git a/apps/warp-protocol/src/utils/finder.ts b/apps/warp-protocol/src/utils/finder.ts index b6c75fc..2c4d9fe 100644 --- a/apps/warp-protocol/src/utils/finder.ts +++ b/apps/warp-protocol/src/utils/finder.ts @@ -7,6 +7,7 @@ const injectiveFinderTxUrl = (network: string, txHash: string) => ? `https://explorer.injective.network/transaction/${txHash}` : `https://testnet.explorer.injective.network/transaction/${txHash}`; const neutronFinderTxUrl = (chainId: string, txHash: string) => `https://neutron.celat.one/${chainId}/txs/${txHash}`; +const osmoFinderTxUrl = (chainId: string, txHash: string) => `https://celatone.osmosis.zone/${chainId}/txs/${txHash}`; export const useFinderTxUrl = () => { const { connectedWallet, chain, chainId } = useLocalWallet(); @@ -24,6 +25,8 @@ export const useFinderTxUrl = () => { return neutronFinderTxUrl(chainId, txHash); case 'injective': return injectiveFinderTxUrl(connectedWallet.network!, txHash); + case 'osmosis': + return osmoFinderTxUrl(connectedWallet.network!, txHash); // TODO: add nibiru and whale when supported } }, diff --git a/indexers/warp-protocol/package.json b/indexers/warp-protocol/package.json index 9fa795e..d521e65 100644 --- a/indexers/warp-protocol/package.json +++ b/indexers/warp-protocol/package.json @@ -16,7 +16,7 @@ "@aws-sdk/client-dynamodb": "^3.159.0", "@aws-sdk/util-dynamodb": "^3.159.0", "@terra-money/feather.js": "^1.0.11", - "@terra-money/warp-sdk": "^0.2.10", + "@terra-money/warp-sdk": "^0.2.13", "@types/node": "^16.11.56", "axios": "^1.1.2", "big.js": "^6.2.1", diff --git a/indexers/warp-protocol/src/utils/Environment.ts b/indexers/warp-protocol/src/utils/Environment.ts index 44be22e..4e75455 100644 --- a/indexers/warp-protocol/src/utils/Environment.ts +++ b/indexers/warp-protocol/src/utils/Environment.ts @@ -79,6 +79,21 @@ export class Environment { } } + if (chainName === 'osmosis') { + if (process.env.NETWORK === 'mainnet') { + return { + height: 14266867, + timestamp: 1710262192, + }; + } else { + // testnet (this is mainnet, switch with testnet data when testnet is added) + return { + height: 14266867, + timestamp: 1710262192, + }; + } + } + // if (chainName === 'migaloo') { // if (process.env.NETWORK === 'testnet') { // // testnet diff --git a/yarn.lock b/yarn.lock index 8fc35d6..f51fc2d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4346,7 +4346,7 @@ __metadata: "@mui/material": ^5.10.2 "@terra-money/feather.js": ^1.0.11 "@terra-money/wallet-kit": ^1.0.11 - "@terra-money/warp-sdk": ^0.2.10 + "@terra-money/warp-sdk": ^0.2.13 "@testing-library/jest-dom": ^5.16.5 "@testing-library/react": ^13.3.0 "@testing-library/user-event": ^13.5.0 @@ -4521,9 +4521,9 @@ __metadata: languageName: node linkType: hard -"@terra-money/warp-sdk@npm:^0.2.10": - version: 0.2.10 - resolution: "@terra-money/warp-sdk@npm:0.2.10" +"@terra-money/warp-sdk@npm:^0.2.13": + version: 0.2.13 + resolution: "@terra-money/warp-sdk@npm:0.2.13" dependencies: "@terra-money/feather.js": ^1.0.11 "@types/node": ^16.11.56 @@ -4536,7 +4536,7 @@ __metadata: lodash: ^4.17.21 pino: ^8.4.2 typescript: ^4.8.2 - checksum: 1e41c08c950b38554f4695bb87d2d27ea853f1f0d9d1f542fd3b3399556a6c4bdbf2517d4c7125985820877b5fa369e9078a8e613fcf885ee2901775b523dad4 + checksum: c37e3ef3e334bd2dfaf30aa3577f3cc83fb755c23961fa7b2ee69e64cbb7c1c65d74df3d1d82ca1a19ac64f69d8cb29c7ba22cf6b3eb053f762e0b488cf9a861 languageName: node linkType: hard @@ -5628,7 +5628,7 @@ __metadata: "@terra-money/feather.js": ^1.0.11 "@terra-money/terra-station-mobile": 1.0.8 "@terra-money/wallet-kit": ^1.0.11 - "@terra-money/warp-sdk": ^0.2.10 + "@terra-money/warp-sdk": ^0.2.13 "@testing-library/jest-dom": ^5.16.5 "@testing-library/react": ^13.3.0 "@testing-library/user-event": ^13.5.0 @@ -5708,7 +5708,7 @@ __metadata: "@aws-sdk/client-dynamodb": ^3.159.0 "@aws-sdk/util-dynamodb": ^3.159.0 "@terra-money/feather.js": ^1.0.11 - "@terra-money/warp-sdk": ^0.2.10 + "@terra-money/warp-sdk": ^0.2.13 "@types/d3-array": ^3.0.3 "@types/node": ^16.11.56 axios: ^1.1.2