Add solana devnet

This commit is contained in:
Ilja 2022-03-14 14:36:45 +02:00
parent 08e3ff9f62
commit 2b9a9e4e6a
4 changed files with 22 additions and 7 deletions

View File

@ -1,6 +1,6 @@
import { COSMOS_MAINNET_CHAINS, TCosmosChain } from '@/data/COSMOSData'
import { EIP155_CHAINS, TEIP155Chain } from '@/data/EIP155Data'
import { SOLANA_MAINNET_CHAINS, TSolanaChain } from '@/data/SolanaData'
import { SOLANA_CHAINS, TSolanaChain } from '@/data/SolanaData'
import { Col, Divider, Row, Text } from '@nextui-org/react'
import { Fragment } from 'react'
@ -27,7 +27,7 @@ export default function RequesDetailsCard({ chains, protocol }: IProps) {
chain =>
EIP155_CHAINS[chain as TEIP155Chain]?.name ??
COSMOS_MAINNET_CHAINS[chain as TCosmosChain]?.name ??
SOLANA_MAINNET_CHAINS[chain as TSolanaChain]?.name ??
SOLANA_CHAINS[chain as TSolanaChain]?.name ??
chain
)
.join(', ')}

View File

@ -16,6 +16,18 @@ export const SOLANA_MAINNET_CHAINS = {
}
}
export const SOLANA_TEST_CHAINS = {
'solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K': {
chainId: '8E9rvCKLFQia2Y35HXjjpWzj8weVo44K',
name: 'Solana Devnet',
logo: '/chain-logos/solana-4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ.png',
rgb: '30, 240, 166',
rpc: ''
}
}
export const SOLANA_CHAINS = { ...SOLANA_MAINNET_CHAINS, ...SOLANA_TEST_CHAINS }
/**
* Methods
*/

View File

@ -3,7 +3,7 @@ import AccountPicker from '@/components/AccountPicker'
import PageHeader from '@/components/PageHeader'
import { COSMOS_MAINNET_CHAINS } from '@/data/COSMOSData'
import { EIP155_MAINNET_CHAINS, EIP155_TEST_CHAINS } from '@/data/EIP155Data'
import { SOLANA_MAINNET_CHAINS } from '@/data/SolanaData'
import { SOLANA_MAINNET_CHAINS, SOLANA_TEST_CHAINS } from '@/data/SolanaData'
import SettingsStore from '@/store/SettingsStore'
import { Text } from '@nextui-org/react'
import { Fragment } from 'react'
@ -38,6 +38,9 @@ export default function HomePage() {
{Object.values(EIP155_TEST_CHAINS).map(({ name, logo, rgb }) => (
<AccountCard key={name} name={name} logo={logo} rgb={rgb} address={eip155Address} />
))}
{Object.values(SOLANA_TEST_CHAINS).map(({ name, logo, rgb }) => (
<AccountCard key={name} name={name} logo={logo} rgb={rgb} address={solanaAddress} />
))}
</Fragment>
) : null}
</Fragment>

View File

@ -5,7 +5,7 @@ import RequestMethodCard from '@/components/RequestMethodCard'
import RequestModalContainer from '@/components/RequestModalContainer'
import { COSMOS_MAINNET_CHAINS, TCosmosChain } from '@/data/COSMOSData'
import { EIP155_CHAINS, TEIP155Chain } from '@/data/EIP155Data'
import { SOLANA_MAINNET_CHAINS, TSolanaChain } from '@/data/SolanaData'
import { SOLANA_CHAINS, TSolanaChain } from '@/data/SolanaData'
import ModalStore from '@/store/ModalStore'
import { cosmosAddresses } from '@/utils/CosmosWalletUtil'
import { eip155Addresses } from '@/utils/EIP155WalletUtil'
@ -103,7 +103,7 @@ export default function SessionProposalModal() {
if (isEIP155Chain(chain)) {
return (
<ProposalSelectSection
name={EIP155_CHAINS[chain as TEIP155Chain].name}
name={EIP155_CHAINS[chain as TEIP155Chain]?.name}
addresses={eip155Addresses}
selectedAddresses={selectedEIP155}
onSelect={onSelectEIP155}
@ -113,7 +113,7 @@ export default function SessionProposalModal() {
} else if (isCosmosChain(chain)) {
return (
<ProposalSelectSection
name={COSMOS_MAINNET_CHAINS[chain as TCosmosChain].name}
name={COSMOS_MAINNET_CHAINS[chain as TCosmosChain]?.name}
addresses={cosmosAddresses}
selectedAddresses={selectedCosmos}
onSelect={onSelectCosmos}
@ -123,7 +123,7 @@ export default function SessionProposalModal() {
} else if (isSolanaChain(chain)) {
return (
<ProposalSelectSection
name={SOLANA_MAINNET_CHAINS[chain as TSolanaChain].name}
name={SOLANA_CHAINS[chain as TSolanaChain]?.name}
addresses={solanaAddresses}
selectedAddresses={selectedSolana}
onSelect={onSelectSolana}