Main build fix and error message (#439)
* fix(quota): api showing outdated results * removed missing module imports * better error messaging on smart account creation (#438) * feat: removes tezos & cosmos --------- Co-authored-by: Derek <alexanderderekrein@gmail.com> Co-authored-by: Gancho Radkov <ganchoradkov@gmail.com>
This commit is contained in:
parent
6db58263f9
commit
68c95a9196
@ -1,9 +1,7 @@
|
||||
import { cosmosAddresses } from '@/utils/CosmosWalletUtil'
|
||||
import { eip155Addresses } from '@/utils/EIP155WalletUtil'
|
||||
import { polkadotAddresses } from '@/utils/PolkadotWalletUtil'
|
||||
import { multiversxAddresses } from '@/utils/MultiversxWalletUtil'
|
||||
import { tronAddresses } from '@/utils/TronWalletUtil'
|
||||
import { tezosAddresses } from '@/utils/TezosWalletUtil'
|
||||
import { solanaAddresses } from '@/utils/SolanaWalletUtil'
|
||||
import { nearAddresses } from '@/utils/NearWalletUtil'
|
||||
import { kadenaAddresses } from '@/utils/KadenaWalletUtil'
|
||||
|
@ -1,15 +1,6 @@
|
||||
import { COSMOS_MAINNET_CHAINS } from '@/data/COSMOSData'
|
||||
import { EIP155_CHAINS } from '@/data/EIP155Data'
|
||||
import { KADENA_CHAINS } from '@/data/KadenaData'
|
||||
import { MULTIVERSX_CHAINS } from '@/data/MultiversxData'
|
||||
import { NEAR_CHAINS } from '@/data/NEARData'
|
||||
import { POLKADOT_CHAINS } from '@/data/PolkadotData'
|
||||
import { SOLANA_CHAINS } from '@/data/SolanaData'
|
||||
import { TEZOS_CHAINS } from '@/data/TezosData'
|
||||
import { TRON_CHAINS } from '@/data/TronData'
|
||||
import { getChainData } from '@/data/chainsUtil'
|
||||
import { Card, Row, styled, Image, Avatar } from '@nextui-org/react'
|
||||
import { ReactNode, useMemo } from 'react'
|
||||
import { Row, Avatar } from '@nextui-org/react'
|
||||
import { useMemo } from 'react'
|
||||
|
||||
interface Props {
|
||||
chainId?: string // namespace + ":" + reference
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { COSMOS_MAINNET_CHAINS, TCosmosChain } from '@/data/COSMOSData'
|
||||
import { EIP155_CHAINS, TEIP155Chain } from '@/data/EIP155Data'
|
||||
import { KADENA_CHAINS, TKadenaChain } from '@/data/KadenaData'
|
||||
import { NEAR_TEST_CHAINS, TNearChain } from '@/data/NEARData'
|
||||
@ -30,7 +29,6 @@ export default function RequestDetailsCard({ chains, protocol }: IProps) {
|
||||
.map(
|
||||
chain =>
|
||||
EIP155_CHAINS[chain as TEIP155Chain]?.name ??
|
||||
COSMOS_MAINNET_CHAINS[chain as TCosmosChain]?.name ??
|
||||
SOLANA_CHAINS[chain as TSolanaChain]?.name ??
|
||||
NEAR_TEST_CHAINS[chain as TNearChain]?.name ??
|
||||
MULTIVERSX_CHAINS[chain as TMultiversxChain]?.name ??
|
||||
@ -48,7 +46,9 @@ export default function RequestDetailsCard({ chains, protocol }: IProps) {
|
||||
<Row>
|
||||
<Col>
|
||||
<Text h5>Relay Protocol</Text>
|
||||
<Text color="$gray400" data-testid="request-detauls-realy-protocol">{protocol}</Text>
|
||||
<Text color="$gray400" data-testid="request-detauls-realy-protocol">
|
||||
{protocol}
|
||||
</Text>
|
||||
</Col>
|
||||
</Row>
|
||||
</Fragment>
|
||||
|
@ -1,5 +1,4 @@
|
||||
import ChainCard from '@/components/ChainCard'
|
||||
import { COSMOS_MAINNET_CHAINS } from '@/data/COSMOSData'
|
||||
import { EIP155_MAINNET_CHAINS, EIP155_TEST_CHAINS } from '@/data/EIP155Data'
|
||||
import { NEAR_TEST_CHAINS } from '@/data/NEARData'
|
||||
import { SOLANA_MAINNET_CHAINS, SOLANA_TEST_CHAINS } from '@/data/SolanaData'
|
||||
@ -14,7 +13,6 @@ import { Fragment } from 'react'
|
||||
* Utilities
|
||||
*/
|
||||
const CHAIN_METADATA = {
|
||||
...COSMOS_MAINNET_CHAINS,
|
||||
...SOLANA_MAINNET_CHAINS,
|
||||
...MULTIVERSX_MAINNET_CHAINS,
|
||||
...TRON_MAINNET_CHAINS,
|
||||
|
@ -1,5 +1,4 @@
|
||||
import ChainCard from '@/components/ChainCard'
|
||||
import { COSMOS_MAINNET_CHAINS } from '@/data/COSMOSData'
|
||||
import { EIP155_MAINNET_CHAINS, EIP155_TEST_CHAINS } from '@/data/EIP155Data'
|
||||
import { NEAR_TEST_CHAINS } from '@/data/NEARData'
|
||||
import { SOLANA_MAINNET_CHAINS, SOLANA_TEST_CHAINS } from '@/data/SolanaData'
|
||||
@ -14,7 +13,6 @@ import { Fragment } from 'react'
|
||||
* Utilities
|
||||
*/
|
||||
const CHAIN_METADATA = {
|
||||
...COSMOS_MAINNET_CHAINS,
|
||||
...SOLANA_MAINNET_CHAINS,
|
||||
...MULTIVERSX_MAINNET_CHAINS,
|
||||
...TRON_MAINNET_CHAINS,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import ChainCard from '@/components/ChainCard'
|
||||
import SettingsStore from '@/store/SettingsStore'
|
||||
import { truncate } from '@/utils/HelperUtil'
|
||||
import { styledToast, truncate } from '@/utils/HelperUtil'
|
||||
import { updateSignClientChainId } from '@/utils/WalletConnectUtil'
|
||||
import { Avatar, Button, Text, Tooltip, Loading } from '@nextui-org/react'
|
||||
import { eip155Wallets } from '@/utils/EIP155WalletUtil'
|
||||
@ -134,7 +134,7 @@ export default function SmartAccountCard({
|
||||
css={{ marginTop: 10, width: '100%' }}
|
||||
onClick={onCreateSmartAccount}
|
||||
>
|
||||
{loading ? <Loading size="sm" /> : 'Create Smart Account'}
|
||||
{loading ? <Loading size="sm" css={{ paddingTop: 10 }} /> : 'Create Smart Account'}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
|
@ -1,26 +0,0 @@
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
export type TCosmosChain = keyof typeof COSMOS_MAINNET_CHAINS
|
||||
|
||||
/**
|
||||
* Chains
|
||||
*/
|
||||
export const COSMOS_MAINNET_CHAINS = {
|
||||
'cosmos:cosmoshub-4': {
|
||||
chainId: 'cosmoshub-4',
|
||||
name: 'Cosmos Hub',
|
||||
logo: '/chain-logos/cosmos-cosmoshub-4.png',
|
||||
rgb: '107, 111, 147',
|
||||
rpc: '',
|
||||
namespace: 'cosmos'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Methods
|
||||
*/
|
||||
export const COSMOS_SIGNING_METHODS = {
|
||||
COSMOS_SIGN_DIRECT: 'cosmos_signDirect',
|
||||
COSMOS_SIGN_AMINO: 'cosmos_signAmino'
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
type ChainMetadata = {
|
||||
chainId: string
|
||||
name: string
|
||||
logo: string
|
||||
rgb: string
|
||||
rpc: string
|
||||
namespace: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
export type TTezosChain = keyof typeof TEZOS_MAINNET_CHAINS
|
||||
|
||||
/**
|
||||
* Chains
|
||||
*/
|
||||
export const TEZOS_MAINNET_CHAINS: Record<string, ChainMetadata> = {
|
||||
'tezos:mainnet': {
|
||||
chainId: 'mainnet',
|
||||
name: 'Tezos',
|
||||
logo: '/chain-logos/tezos.svg',
|
||||
rgb: '44, 125, 247',
|
||||
rpc: 'https://mainnet.api.tez.ie',
|
||||
namespace: 'tezos'
|
||||
}
|
||||
}
|
||||
|
||||
export const TEZOS_TEST_CHAINS: Record<string, ChainMetadata> = {
|
||||
'tezos:testnet': {
|
||||
chainId: 'testnet',
|
||||
name: 'Tezos Testnet',
|
||||
logo: '/chain-logos/tezos.svg',
|
||||
rgb: '44, 125, 247',
|
||||
rpc: 'https://ghostnet.ecadinfra.com',
|
||||
namespace: 'tezos'
|
||||
}
|
||||
}
|
||||
|
||||
export const TEZOS_CHAINS = { ...TEZOS_MAINNET_CHAINS, ...TEZOS_TEST_CHAINS }
|
||||
|
||||
/**
|
||||
* Methods
|
||||
*/
|
||||
export const TEZOS_SIGNING_METHODS = {
|
||||
TEZOS_GET_ACCOUNTS: 'tezos_getAccounts',
|
||||
TEZOS_SEND: 'tezos_send',
|
||||
TEZOS_SIGN: 'tezos_sign'
|
||||
}
|
@ -1,22 +1,18 @@
|
||||
import { COSMOS_MAINNET_CHAINS } from './COSMOSData'
|
||||
import { EIP155_CHAINS } from './EIP155Data'
|
||||
import { KADENA_CHAINS } from './KadenaData'
|
||||
import { MULTIVERSX_CHAINS } from './MultiversxData'
|
||||
import { NEAR_CHAINS } from './NEARData'
|
||||
import { POLKADOT_CHAINS } from './PolkadotData'
|
||||
import { SOLANA_CHAINS } from './SolanaData'
|
||||
import { TEZOS_CHAINS } from './TezosData'
|
||||
import { TRON_CHAINS } from './TronData'
|
||||
|
||||
export const ALL_CHAINS = {
|
||||
...EIP155_CHAINS,
|
||||
...COSMOS_MAINNET_CHAINS,
|
||||
...KADENA_CHAINS,
|
||||
...MULTIVERSX_CHAINS,
|
||||
...NEAR_CHAINS,
|
||||
...POLKADOT_CHAINS,
|
||||
...SOLANA_CHAINS,
|
||||
...TEZOS_CHAINS,
|
||||
...TRON_CHAINS
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
import { SmartAccountLib } from "@/lib/SmartAccountLib";
|
||||
import { styledToast } from "@/utils/HelperUtil";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { TransactionExecutionError } from "viem";
|
||||
|
||||
export default function useSmartAccount(signerPrivateKey: `0x${string}`) {
|
||||
const [loading, setLoading] = useState(false)
|
||||
@ -14,6 +16,12 @@ export default function useSmartAccount(signerPrivateKey: `0x${string}`) {
|
||||
setLoading(false)
|
||||
}
|
||||
catch (e) {
|
||||
if (e instanceof TransactionExecutionError) {
|
||||
// shorten the error message
|
||||
styledToast(e.cause.message, 'error')
|
||||
} else if (e instanceof Error) {
|
||||
styledToast(e.message, 'error')
|
||||
}
|
||||
console.error(e)
|
||||
setLoading(false)
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { Web3WalletTypes } from '@walletconnect/web3wallet'
|
||||
import { COSMOS_SIGNING_METHODS } from '@/data/COSMOSData'
|
||||
import { EIP155_SIGNING_METHODS } from '@/data/EIP155Data'
|
||||
import { SOLANA_SIGNING_METHODS } from '@/data/SolanaData'
|
||||
import { POLKADOT_SIGNING_METHODS } from '@/data/PolkadotData'
|
||||
@ -12,7 +11,6 @@ import { SignClientTypes } from '@walletconnect/types'
|
||||
import { useCallback, useEffect } from 'react'
|
||||
import { NEAR_SIGNING_METHODS } from '@/data/NEARData'
|
||||
import { approveNearRequest } from '@/utils/NearRequestHandlerUtil'
|
||||
import { TEZOS_SIGNING_METHODS } from '@/data/TezosData'
|
||||
import { KADENA_SIGNING_METHODS } from '@/data/KadenaData'
|
||||
|
||||
export default function useWalletConnectEventsManager(initialized: boolean) {
|
||||
@ -60,10 +58,6 @@ export default function useWalletConnectEventsManager(initialized: boolean) {
|
||||
case EIP155_SIGNING_METHODS.ETH_SIGN_TRANSACTION:
|
||||
return ModalStore.open('SessionSendTransactionModal', { requestEvent, requestSession })
|
||||
|
||||
case COSMOS_SIGNING_METHODS.COSMOS_SIGN_DIRECT:
|
||||
case COSMOS_SIGNING_METHODS.COSMOS_SIGN_AMINO:
|
||||
return ModalStore.open('SessionSignCosmosModal', { requestEvent, requestSession })
|
||||
|
||||
case SOLANA_SIGNING_METHODS.SOLANA_SIGN_MESSAGE:
|
||||
case SOLANA_SIGNING_METHODS.SOLANA_SIGN_TRANSACTION:
|
||||
return ModalStore.open('SessionSignSolanaModal', { requestEvent, requestSession })
|
||||
@ -98,10 +92,6 @@ export default function useWalletConnectEventsManager(initialized: boolean) {
|
||||
case TRON_SIGNING_METHODS.TRON_SIGN_MESSAGE:
|
||||
case TRON_SIGNING_METHODS.TRON_SIGN_TRANSACTION:
|
||||
return ModalStore.open('SessionSignTronModal', { requestEvent, requestSession })
|
||||
case TEZOS_SIGNING_METHODS.TEZOS_GET_ACCOUNTS:
|
||||
case TEZOS_SIGNING_METHODS.TEZOS_SEND:
|
||||
case TEZOS_SIGNING_METHODS.TEZOS_SIGN:
|
||||
return ModalStore.open('SessionSignTezosModal', { requestEvent, requestSession })
|
||||
case KADENA_SIGNING_METHODS.KADENA_GET_ACCOUNTS:
|
||||
case KADENA_SIGNING_METHODS.KADENA_SIGN:
|
||||
case KADENA_SIGNING_METHODS.KADENA_QUICKSIGN:
|
||||
|
@ -1,14 +1,12 @@
|
||||
import AccountCard from '@/components/AccountCard'
|
||||
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, SOLANA_TEST_CHAINS } from '@/data/SolanaData'
|
||||
import { POLKADOT_MAINNET_CHAINS, POLKADOT_TEST_CHAINS } from '@/data/PolkadotData'
|
||||
import { MULTIVERSX_MAINNET_CHAINS, MULTIVERSX_TEST_CHAINS } from '@/data/MultiversxData'
|
||||
import { TRON_MAINNET_CHAINS, TRON_TEST_CHAINS } from '@/data/TronData'
|
||||
import { NEAR_TEST_CHAINS } from '@/data/NEARData'
|
||||
import { TEZOS_MAINNET_CHAINS, TEZOS_TEST_CHAINS } from '@/data/TezosData'
|
||||
import { KADENA_MAINNET_CHAINS, KADENA_TEST_CHAINS } from '@/data/KadenaData'
|
||||
import SettingsStore from '@/store/SettingsStore'
|
||||
import { Text } from '@nextui-org/react'
|
||||
@ -21,13 +19,11 @@ export default function HomePage() {
|
||||
testNets,
|
||||
eip155Address,
|
||||
activeChainId,
|
||||
cosmosAddress,
|
||||
solanaAddress,
|
||||
polkadotAddress,
|
||||
nearAddress,
|
||||
multiversxAddress,
|
||||
tronAddress,
|
||||
tezosAddress,
|
||||
kadenaAddress
|
||||
} = useSnapshot(SettingsStore.state)
|
||||
|
||||
@ -50,17 +46,6 @@ export default function HomePage() {
|
||||
data-testid={'chain-card-' + caip10.toString()}
|
||||
/>
|
||||
))}
|
||||
{Object.entries(COSMOS_MAINNET_CHAINS).map(([caip10, { name, logo, rgb }]) => (
|
||||
<AccountCard
|
||||
key={name}
|
||||
name={name}
|
||||
logo={logo}
|
||||
rgb={rgb}
|
||||
address={cosmosAddress}
|
||||
chainId={caip10}
|
||||
data-testid={'chain-card-' + caip10.toString()}
|
||||
/>
|
||||
))}
|
||||
{Object.entries(SOLANA_MAINNET_CHAINS).map(([caip10, { name, logo, rgb }]) => (
|
||||
<AccountCard
|
||||
key={name}
|
||||
@ -105,17 +90,6 @@ export default function HomePage() {
|
||||
data-testid={'chain-card-' + caip10.toString()}
|
||||
/>
|
||||
))}
|
||||
{Object.entries(TEZOS_MAINNET_CHAINS).map(([caip10, { name, logo, rgb }]) => (
|
||||
<AccountCard
|
||||
key={name}
|
||||
name={name}
|
||||
logo={logo}
|
||||
rgb={rgb}
|
||||
address={tezosAddress}
|
||||
chainId={caip10}
|
||||
data-testid={'chain-card-' + caip10.toString()}
|
||||
/>
|
||||
))}
|
||||
{Object.entries(KADENA_MAINNET_CHAINS).map(([caip10, { name, logo, rgb }]) => (
|
||||
<AccountCard
|
||||
key={name}
|
||||
@ -133,10 +107,25 @@ export default function HomePage() {
|
||||
<Text h4 css={{ marginBottom: '$5' }}>
|
||||
Testnets
|
||||
</Text>
|
||||
{Object.entries(EIP155_TEST_CHAINS).map(([caip10, { name, logo, rgb, chainId, smartAccountEnabled }]) => {
|
||||
if (smartAccountEnabled) {
|
||||
{Object.entries(EIP155_TEST_CHAINS).map(
|
||||
([caip10, { name, logo, rgb, chainId, smartAccountEnabled }]) => {
|
||||
if (smartAccountEnabled) {
|
||||
return (
|
||||
<SmartAccountCard
|
||||
key={name}
|
||||
name={name}
|
||||
logo={logo}
|
||||
rgb={rgb}
|
||||
address={eip155Address}
|
||||
chainId={caip10.toString()}
|
||||
data-testid={'chain-card-' + caip10.toString()}
|
||||
isActiveChain={activeChainId === `eip155:${chainId}`}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<SmartAccountCard
|
||||
<AccountCard
|
||||
key={name}
|
||||
name={name}
|
||||
logo={logo}
|
||||
@ -144,23 +133,10 @@ export default function HomePage() {
|
||||
address={eip155Address}
|
||||
chainId={caip10.toString()}
|
||||
data-testid={'chain-card-' + caip10.toString()}
|
||||
isActiveChain={activeChainId === `eip155:${chainId}`}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<AccountCard
|
||||
key={name}
|
||||
name={name}
|
||||
logo={logo}
|
||||
rgb={rgb}
|
||||
address={eip155Address}
|
||||
chainId={caip10.toString()}
|
||||
data-testid={'chain-card-' + caip10.toString()}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
)}
|
||||
{Object.entries(SOLANA_TEST_CHAINS).map(([caip10, { name, logo, rgb }]) => (
|
||||
<AccountCard
|
||||
key={name}
|
||||
@ -216,17 +192,6 @@ export default function HomePage() {
|
||||
data-testid={'chain-card-' + caip10.toString()}
|
||||
/>
|
||||
))}
|
||||
{Object.entries(TEZOS_TEST_CHAINS).map(([caip10, { name, logo, rgb }]) => (
|
||||
<AccountCard
|
||||
key={name}
|
||||
name={name}
|
||||
logo={logo}
|
||||
rgb={rgb}
|
||||
address={tezosAddress}
|
||||
chainId={caip10}
|
||||
data-testid={'chain-card-' + caip10.toString()}
|
||||
/>
|
||||
))}
|
||||
{Object.entries(KADENA_TEST_CHAINS).map(([caip10, { name, logo, rgb }]) => (
|
||||
<AccountCard
|
||||
key={name}
|
||||
|
@ -1,7 +1,6 @@
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import RelayRegionPicker from '@/components/RelayRegionPicker'
|
||||
import SettingsStore from '@/store/SettingsStore'
|
||||
import { cosmosWallets } from '@/utils/CosmosWalletUtil'
|
||||
import { eip155Wallets } from '@/utils/EIP155WalletUtil'
|
||||
import { solanaWallets } from '@/utils/SolanaWalletUtil'
|
||||
import { multiversxWallets } from '@/utils/MultiversxWalletUtil'
|
||||
@ -11,19 +10,10 @@ import { Card, Divider, Row, Switch, Text } from '@nextui-org/react'
|
||||
import { Fragment } from 'react'
|
||||
import { useSnapshot } from 'valtio'
|
||||
import packageJSON from '../../package.json'
|
||||
import { tezosWallets } from '@/utils/TezosWalletUtil'
|
||||
|
||||
export default function SettingsPage() {
|
||||
const {
|
||||
testNets,
|
||||
eip155Address,
|
||||
cosmosAddress,
|
||||
solanaAddress,
|
||||
multiversxAddress,
|
||||
tronAddress,
|
||||
tezosAddress,
|
||||
kadenaAddress
|
||||
} = useSnapshot(SettingsStore.state)
|
||||
const { testNets, eip155Address, solanaAddress, multiversxAddress, tronAddress, kadenaAddress } =
|
||||
useSnapshot(SettingsStore.state)
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
@ -74,13 +64,6 @@ export default function SettingsPage() {
|
||||
<Text css={{ fontFamily: '$mono' }}>{eip155Wallets[eip155Address].getMnemonic()}</Text>
|
||||
</Card>
|
||||
|
||||
<Text h4 css={{ marginTop: '$10', marginBottom: '$5' }}>
|
||||
Cosmos Mnemonic
|
||||
</Text>
|
||||
<Card bordered borderWeight="light" css={{ minHeight: '100px' }}>
|
||||
<Text css={{ fontFamily: '$mono' }}>{cosmosWallets[cosmosAddress].getMnemonic()}</Text>
|
||||
</Card>
|
||||
|
||||
<Text h4 css={{ marginTop: '$10', marginBottom: '$5' }}>
|
||||
Solana Secret Key
|
||||
</Text>
|
||||
@ -104,13 +87,6 @@ export default function SettingsPage() {
|
||||
<Text css={{ fontFamily: '$mono' }}>{tronWallets[tronAddress].privateKey}</Text>
|
||||
</Card>
|
||||
|
||||
<Text h4 css={{ marginTop: '$10', marginBottom: '$5' }}>
|
||||
Tezos Mnemonic
|
||||
</Text>
|
||||
<Card bordered borderWeight="light" css={{ minHeight: '100px', wordWrap: 'break-word' }}>
|
||||
<Text css={{ fontFamily: '$mono' }}>{tezosWallets[tezosAddress].getMnemonic()}</Text>
|
||||
</Card>
|
||||
|
||||
<Text h4 css={{ marginTop: '$10', marginBottom: '$5' }}>
|
||||
Kadena Secret Key
|
||||
</Text>
|
||||
|
@ -21,13 +21,11 @@ interface State {
|
||||
| 'SessionSignTypedDataModal'
|
||||
| 'SessionSendTransactionModal'
|
||||
| 'SessionUnsuportedMethodModal'
|
||||
| 'SessionSignCosmosModal'
|
||||
| 'SessionSignSolanaModal'
|
||||
| 'SessionSignPolkadotModal'
|
||||
| 'SessionSignNearModal'
|
||||
| 'SessionSignMultiversxModal'
|
||||
| 'SessionSignTronModal'
|
||||
| 'SessionSignTezosModal'
|
||||
| 'SessionSignKadenaModal'
|
||||
| 'AuthRequestModal'
|
||||
| 'LoadingModal'
|
||||
|
@ -8,13 +8,11 @@ interface State {
|
||||
testNets: boolean
|
||||
account: number
|
||||
eip155Address: string
|
||||
cosmosAddress: string
|
||||
solanaAddress: string
|
||||
polkadotAddress: string
|
||||
nearAddress: string
|
||||
multiversxAddress: string
|
||||
tronAddress: string
|
||||
tezosAddress: string
|
||||
kadenaAddress: string
|
||||
relayerRegionURL: string
|
||||
activeChainId: string
|
||||
@ -30,13 +28,11 @@ const state = proxy<State>({
|
||||
account: 0,
|
||||
activeChainId: '1',
|
||||
eip155Address: '',
|
||||
cosmosAddress: '',
|
||||
solanaAddress: '',
|
||||
polkadotAddress: '',
|
||||
nearAddress: '',
|
||||
multiversxAddress: '',
|
||||
tronAddress: '',
|
||||
tezosAddress: '',
|
||||
kadenaAddress: '',
|
||||
relayerRegionURL: '',
|
||||
sessions: []
|
||||
@ -56,10 +52,6 @@ const SettingsStore = {
|
||||
state.eip155Address = eip155Address
|
||||
},
|
||||
|
||||
setCosmosAddress(cosmosAddresses: string) {
|
||||
state.cosmosAddress = cosmosAddresses
|
||||
},
|
||||
|
||||
setSolanaAddress(solanaAddress: string) {
|
||||
state.solanaAddress = solanaAddress
|
||||
},
|
||||
@ -85,10 +77,6 @@ const SettingsStore = {
|
||||
state.tronAddress = tronAddress
|
||||
},
|
||||
|
||||
setTezosAddress(tezosAddress: string) {
|
||||
state.tezosAddress = tezosAddress
|
||||
},
|
||||
|
||||
setActiveChainId(value: string) {
|
||||
state.activeChainId = value
|
||||
},
|
||||
|
@ -1,11 +1,9 @@
|
||||
import toast from 'react-hot-toast'
|
||||
import { COSMOS_MAINNET_CHAINS, TCosmosChain } from '@/data/COSMOSData'
|
||||
import { EIP155_CHAINS, TEIP155Chain } from '@/data/EIP155Data'
|
||||
import { MULTIVERSX_CHAINS, TMultiversxChain } from '@/data/MultiversxData'
|
||||
import { NEAR_CHAINS, NEAR_TEST_CHAINS, TNearChain } from '@/data/NEARData'
|
||||
import { POLKADOT_CHAINS, TPolkadotChain } from '@/data/PolkadotData'
|
||||
import { SOLANA_CHAINS, TSolanaChain } from '@/data/SolanaData'
|
||||
import { TEZOS_CHAINS, TTezosChain } from '@/data/TezosData'
|
||||
import { TRON_CHAINS, TTronChain } from '@/data/TronData'
|
||||
import { KADENA_CHAINS, TKadenaChain } from '@/data/KadenaData'
|
||||
|
||||
@ -89,13 +87,6 @@ export function isEIP155Chain(chain: string) {
|
||||
return chain.includes('eip155')
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if chain is part of COSMOS standard
|
||||
*/
|
||||
export function isCosmosChain(chain: string) {
|
||||
return chain.includes('cosmos')
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if chain is part of SOLANA standard
|
||||
*/
|
||||
@ -138,26 +129,17 @@ export function isTronChain(chain: string) {
|
||||
return chain.includes('tron')
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if chain is part of Tezos standard
|
||||
*/
|
||||
export function isTezosChain(chain: string) {
|
||||
return chain.includes('tezos')
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats chainId to its name
|
||||
*/
|
||||
export function formatChainName(chainId: string) {
|
||||
return (
|
||||
COSMOS_MAINNET_CHAINS[chainId as TCosmosChain]?.name ??
|
||||
EIP155_CHAINS[chainId as TEIP155Chain]?.name ??
|
||||
MULTIVERSX_CHAINS[chainId as TMultiversxChain]?.name ??
|
||||
NEAR_TEST_CHAINS[chainId as TNearChain]?.name ??
|
||||
POLKADOT_CHAINS[chainId as TPolkadotChain]?.name ??
|
||||
SOLANA_CHAINS[chainId as TSolanaChain]?.name ??
|
||||
TRON_CHAINS[chainId as TTronChain]?.name ??
|
||||
TEZOS_CHAINS[chainId as TTezosChain]?.name ??
|
||||
KADENA_CHAINS[chainId as TKadenaChain]?.name ??
|
||||
chainId
|
||||
)
|
||||
|
@ -19,13 +19,11 @@ import { kadenaAddresses } from '@/utils/KadenaWalletUtil'
|
||||
import { styledToast } from '@/utils/HelperUtil'
|
||||
import { web3wallet } from '@/utils/WalletConnectUtil'
|
||||
import { EIP155_CHAINS, EIP155_SIGNING_METHODS } from '@/data/EIP155Data'
|
||||
import { COSMOS_MAINNET_CHAINS, COSMOS_SIGNING_METHODS } from '@/data/COSMOSData'
|
||||
import { KADENA_CHAINS, KADENA_SIGNING_METHODS } from '@/data/KadenaData'
|
||||
import { MULTIVERSX_CHAINS, MULTIVERSX_SIGNING_METHODS } from '@/data/MultiversxData'
|
||||
import { NEAR_CHAINS, NEAR_SIGNING_METHODS } from '@/data/NEARData'
|
||||
import { POLKADOT_CHAINS, POLKADOT_SIGNING_METHODS } from '@/data/PolkadotData'
|
||||
import { SOLANA_CHAINS, SOLANA_SIGNING_METHODS } from '@/data/SolanaData'
|
||||
import { TEZOS_CHAINS, TEZOS_SIGNING_METHODS } from '@/data/TezosData'
|
||||
import { TRON_CHAINS, TRON_SIGNING_METHODS } from '@/data/TronData'
|
||||
import ChainDataMini from '@/components/ChainDataMini'
|
||||
import ChainAddressMini from '@/components/ChainAddressMini'
|
||||
@ -54,9 +52,6 @@ export default function SessionProposalModal() {
|
||||
// eip155
|
||||
const eip155Chains = Object.keys(EIP155_CHAINS)
|
||||
const eip155Methods = Object.values(EIP155_SIGNING_METHODS)
|
||||
// cosmos
|
||||
const cosmosChains = Object.keys(COSMOS_MAINNET_CHAINS)
|
||||
const cosmosMethods = Object.values(COSMOS_SIGNING_METHODS)
|
||||
|
||||
// Kadena
|
||||
const kadenaChains = Object.keys(KADENA_CHAINS)
|
||||
@ -78,10 +73,6 @@ export default function SessionProposalModal() {
|
||||
const solanaChains = Object.keys(SOLANA_CHAINS)
|
||||
const solanaMethods = Object.values(SOLANA_SIGNING_METHODS)
|
||||
|
||||
// tezos
|
||||
const tezosChains = Object.keys(TEZOS_CHAINS)
|
||||
const tezosMethods = Object.values(TEZOS_SIGNING_METHODS)
|
||||
|
||||
// tron
|
||||
const tronChains = Object.keys(TRON_CHAINS)
|
||||
const tronMethods = Object.values(TRON_SIGNING_METHODS)
|
||||
|
Loading…
Reference in New Issue
Block a user