Expose all mnemonics and secret keys in settings
This commit is contained in:
parent
52f8c5d82c
commit
0a839ff36e
@ -29,6 +29,10 @@ export default class SolanaLib {
|
|||||||
return await this.keypair.publicKey.toBase58()
|
return await this.keypair.publicKey.toBase58()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getSecretKey() {
|
||||||
|
return this.keypair.secretKey.toString()
|
||||||
|
}
|
||||||
|
|
||||||
public async signMessage(message: string) {
|
public async signMessage(message: string) {
|
||||||
const signature = nacl.sign.detached(bs58.decode(message), this.keypair.secretKey)
|
const signature = nacl.sign.detached(bs58.decode(message), this.keypair.secretKey)
|
||||||
|
|
||||||
|
@ -1,29 +1,18 @@
|
|||||||
import PageHeader from '@/components/PageHeader'
|
import PageHeader from '@/components/PageHeader'
|
||||||
import SettingsStore from '@/store/SettingsStore'
|
import SettingsStore from '@/store/SettingsStore'
|
||||||
|
import { cosmosWallets } from '@/utils/CosmosWalletUtil'
|
||||||
import { eip155Wallets } from '@/utils/EIP155WalletUtil'
|
import { eip155Wallets } from '@/utils/EIP155WalletUtil'
|
||||||
|
import { solanaWallets } from '@/utils/SolanaWalletUtil'
|
||||||
import { Card, Divider, Row, Switch, Text } from '@nextui-org/react'
|
import { Card, Divider, Row, Switch, Text } from '@nextui-org/react'
|
||||||
import { Fragment } from 'react'
|
import { Fragment } from 'react'
|
||||||
import { useSnapshot } from 'valtio'
|
import { useSnapshot } from 'valtio'
|
||||||
|
|
||||||
export default function SettingsPage() {
|
export default function SettingsPage() {
|
||||||
const { testNets, eip155Address } = useSnapshot(SettingsStore.state)
|
const { testNets, eip155Address, cosmosAddress, solanaAddress } = useSnapshot(SettingsStore.state)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<PageHeader title="Settings" />
|
<PageHeader title="Settings" />
|
||||||
<Text h4 css={{ marginBottom: '$5' }}>
|
|
||||||
Mnemonic
|
|
||||||
</Text>
|
|
||||||
<Card bordered borderWeight="light" css={{ minHeight: '75px' }}>
|
|
||||||
<Text css={{ fontFamily: '$mono' }}>{eip155Wallets[eip155Address].mnemonic.phrase}</Text>
|
|
||||||
</Card>
|
|
||||||
|
|
||||||
<Text css={{ color: '$yellow500', marginTop: '$5', textAlign: 'center' }}>
|
|
||||||
Warning: mnemonic is provided for development purposes only and should not be used
|
|
||||||
elsewhere!
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Divider y={3} />
|
|
||||||
|
|
||||||
<Text h4 css={{ marginBottom: '$5' }}>
|
<Text h4 css={{ marginBottom: '$5' }}>
|
||||||
Testnets
|
Testnets
|
||||||
@ -33,7 +22,33 @@ export default function SettingsPage() {
|
|||||||
<Text>{testNets ? 'Enabled' : 'Disabled'}</Text>
|
<Text>{testNets ? 'Enabled' : 'Disabled'}</Text>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<Divider y={3} />
|
<Divider y={2} />
|
||||||
|
|
||||||
|
<Text css={{ color: '$yellow500', marginBottom: '$5', textAlign: 'left', padding: 0 }}>
|
||||||
|
Warning: mnemonics and secret keys are provided for development purposes only and should not
|
||||||
|
be used elsewhere!
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<Text h4 css={{ marginTop: '$5', marginBottom: '$5' }}>
|
||||||
|
EIP155 Mnemonic
|
||||||
|
</Text>
|
||||||
|
<Card bordered borderWeight="light" css={{ minHeight: '100px' }}>
|
||||||
|
<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>
|
||||||
|
<Card bordered borderWeight="light" css={{ minHeight: '215px', wordWrap: 'break-word' }}>
|
||||||
|
<Text css={{ fontFamily: '$mono' }}>{solanaWallets[solanaAddress].getSecretKey()}</Text>
|
||||||
|
</Card>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user