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

View File

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

View File

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