Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add chihuahua & Injective details. for 'ROAR' token. nb: Inject… #256

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/consts/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import KujiPng from 'images/kuji.png'
import CarbonSvg from 'images/carbon.svg'
import StrideSvg from 'images/stride.svg'
import MigalooSvg from 'images/migaloo.svg'
import HuaHuaSvg from 'images/huahua.svg'
import BigNumber from 'bignumber.js'
import { UTIL } from 'consts'

Expand All @@ -39,6 +40,7 @@ const blockChainImage: Record<BlockChainType, string> = {
[BlockChainType.carbon]: CarbonSvg,
[BlockChainType.stride]: StrideSvg,
[BlockChainType.migaloo]: MigalooSvg,
[BlockChainType.chihuahua]: HuaHuaSvg,
}

const blockChainName: Record<BlockChainType, string> = {
Expand All @@ -60,6 +62,7 @@ const blockChainName: Record<BlockChainType, string> = {
[BlockChainType.carbon]: 'Carbon',
[BlockChainType.stride]: 'Stride',
[BlockChainType.migaloo]: 'Migaloo',
[BlockChainType.chihuahua]: 'Chihuahua',
}

const metamaskRpc: Record<BlockChainType, string[]> = {
Expand Down Expand Up @@ -91,6 +94,7 @@ const metamaskRpc: Record<BlockChainType, string[]> = {
[BlockChainType.carbon]: [],
[BlockChainType.stride]: [],
[BlockChainType.migaloo]: [],
[BlockChainType.chihuahua]: [],
}

const isEtherBaseBlockChain = (bc: BlockChainType): boolean => {
Expand Down
14 changes: 13 additions & 1 deletion src/hooks/useWhiteList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,22 @@ const whitelist: Record<
'ibc/40C29143BF4153B365089E40E437B7AA819672646C45BB0A5F1E10915A0B6708',
},
},
[BlockChainType.inj]: {
[BridgeType.ibc]: {
terra1lxx40s29qvkrcj8fsa3yzyehy7w50umdvvnls2r830rys6lu2zns63eelv:
'ibc/E6CFB0AC1D339A8CBA3353DF0D7E080B4B14D026D1C90F63F666C223B04D548C',
},
},
[BlockChainType.chihuahua]: {
[BridgeType.ibc]: {
terra1lxx40s29qvkrcj8fsa3yzyehy7w50umdvvnls2r830rys6lu2zns63eelv:
'ibc/6BB4ADB45B1903AE497710FBC24E73C2C578A79D25EF923BD2E784A7FD0FC59F',
},
},
// not yet supported on terra2
[BlockChainType.bsc]: {},
[BlockChainType.fantom]: {},
[BlockChainType.inj]: {},

[BlockChainType.polygon]: {},
[BlockChainType.moonbeam]: {},
// other chains
Expand Down
64 changes: 64 additions & 0 deletions src/images/huahua.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions src/pages/Send/BlockChainNetwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,17 @@ const BlockChainNetwork = (): ReactElement => {
value: BlockChainType.carbon,
isDisabled: fromBlockChain === BlockChainType.carbon,
},
{
label: NETWORK.blockChainName[BlockChainType.chihuahua],
value: BlockChainType.chihuahua,
isDisabled: fromBlockChain === BlockChainType.chihuahua,
},
/* TODO: add Injective signing capability
{
label: NETWORK.blockChainName[BlockChainType.inj],
value: BlockChainType.inj,
isDisabled: fromBlockChain === BlockChainType.inj,
},*/
{
label: NETWORK.blockChainName[BlockChainType.stride],
value: BlockChainType.stride,
Expand Down Expand Up @@ -262,6 +273,18 @@ const BlockChainNetwork = (): ReactElement => {
value: BlockChainType.carbon,
isDisabled: fromBlockChain === BlockChainType.carbon,
},
{
label: NETWORK.blockChainName[BlockChainType.chihuahua],
value: BlockChainType.chihuahua,
isDisabled: fromBlockChain === BlockChainType.chihuahua,
},
/* TODO: add Injective signing capability
{
label: NETWORK.blockChainName[BlockChainType.inj],
value: BlockChainType.inj,
isDisabled: fromBlockChain === BlockChainType.inj,
},
*/
{
label: NETWORK.blockChainName[BlockChainType.stride],
value: BlockChainType.stride,
Expand Down
1 change: 1 addition & 0 deletions src/pages/Send/SendForm/AssetList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ const AssetList = ({
x.symbol.toLowerCase().includes(inputFilterLower)
: true
})
// console.log('assetlist',assetList);

useEffect(() => {
if (showModal) {
Expand Down
27 changes: 27 additions & 0 deletions src/types/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export enum BlockChainType {
carbon = 'carbon',
stride = 'stride',
migaloo = 'migaloo',
chihuahua = 'chihuahua',
}

export enum BridgeType {
Expand All @@ -37,6 +38,7 @@ export const availableBridges: Record<BlockChainType, BridgeType[]> = {
[BlockChainType.carbon]: [BridgeType.ibc],
[BlockChainType.stride]: [BridgeType.ibc],
[BlockChainType.migaloo]: [BridgeType.ibc],
[BlockChainType.chihuahua]: [BridgeType.ibc],
[BlockChainType.ethereum]: [BridgeType.axelar],
[BlockChainType.avalanche]: [BridgeType.axelar],

Expand Down Expand Up @@ -68,6 +70,7 @@ export type IbcNetwork =
| BlockChainType.carbon
| BlockChainType.stride
| BlockChainType.migaloo
| BlockChainType.chihuahua

export function isIbcNetwork(network: BlockChainType): boolean {
return [
Expand All @@ -82,6 +85,7 @@ export function isIbcNetwork(network: BlockChainType): boolean {
BlockChainType.carbon,
BlockChainType.stride,
BlockChainType.migaloo,
BlockChainType.chihuahua,
].includes(network)
}

Expand All @@ -98,6 +102,7 @@ export const terraIbcChannels: Record<IbcNetwork, string> = {
[BlockChainType.carbon]: 'channel-36',
[BlockChainType.stride]: 'channel-46',
[BlockChainType.migaloo]: 'channel-86',
[BlockChainType.chihuahua]: 'channel-', // TODO: update chihuahua channel
}

export type IcsNetwork =
Expand All @@ -106,6 +111,8 @@ export type IcsNetwork =
| BlockChainType.kujira
| BlockChainType.carbon
| BlockChainType.migaloo
| BlockChainType.chihuahua
| BlockChainType.inj

// channels IBC chain -> Axelar
export const axelarIbcChannels: Record<string, string> = {
Expand All @@ -125,6 +132,7 @@ export const ibcChannels: Record<IbcNetwork, string> = {
[BlockChainType.carbon]: 'channel-12',
[BlockChainType.stride]: 'channel-52',
[BlockChainType.migaloo]: 'channel-0',
[BlockChainType.chihuahua]: 'channel-',
}

// channels Terra -> IBC chain
Expand Down Expand Up @@ -157,6 +165,16 @@ export const terraIcsChannels: Record<
contract:
'terra1e0mrzy8077druuu42vs0hu7ugguade0cj65dgtauyaw4gsl4kv0qtdf2au',
},
[BlockChainType.inj]: {
channel: 'channel-116',
contract:
'terra1e0mrzy8077druuu42vs0hu7ugguade0cj65dgtauyaw4gsl4kv0qtdf2au',
},
[BlockChainType.chihuahua]: {
channel: 'channel-114',
contract:
'terra1e0mrzy8077druuu42vs0hu7ugguade0cj65dgtauyaw4gsl4kv0qtdf2au',
},
}

// channels IBC chain -> Terra
Expand All @@ -180,6 +198,12 @@ export const icsChannels: Record<
[BlockChainType.migaloo]: {
channel: 'channel-2',
},
[BlockChainType.chihuahua]: {
channel: 'channel-42',
},
[BlockChainType.inj]: {
channel: 'channel-118',
},
}

export const ibcPrefix: Record<IbcNetwork, string> = {
Expand All @@ -194,6 +218,7 @@ export const ibcPrefix: Record<IbcNetwork, string> = {
[BlockChainType.carbon]: 'swth1',
[BlockChainType.stride]: 'stride1',
[BlockChainType.migaloo]: 'migaloo1',
[BlockChainType.chihuahua]: 'chihuahua1',
}

export const ibcChainId: Record<IbcNetwork, string> = {
Expand All @@ -208,6 +233,7 @@ export const ibcChainId: Record<IbcNetwork, string> = {
[BlockChainType.carbon]: 'carbon-1',
[BlockChainType.stride]: 'stride-1',
[BlockChainType.migaloo]: 'migaloo-1',
[BlockChainType.chihuahua]: 'chihuahua-1',
}

export const ibcRpc: Record<IbcNetwork, string> = {
Expand All @@ -222,6 +248,7 @@ export const ibcRpc: Record<IbcNetwork, string> = {
[BlockChainType.carbon]: 'https://tm-api.carbon.network/',
[BlockChainType.stride]: 'https://stride-fleet.main.stridenet.co/',
[BlockChainType.migaloo]: 'https://migaloo-rpc.polkachu.com/',
[BlockChainType.chihuahua]: 'https://chihuahua-rpc.polkachu.com/',
}

export interface LocalTerraNetwork {
Expand Down