satisfy linting errors
This commit is contained in:
parent
f0fe137e26
commit
5eff6011d8
|
@ -3,7 +3,7 @@ import BN from 'bn.js'
|
||||||
import useWalletStore from '../stores/useWalletStore'
|
import useWalletStore from '../stores/useWalletStore'
|
||||||
|
|
||||||
const Balances = () => {
|
const Balances = () => {
|
||||||
var { tokenAccounts, mints } = useWalletStore((state) => state)
|
const { tokenAccounts, mints } = useWalletStore((state) => state)
|
||||||
|
|
||||||
function fixedPointToNumber(value: BN, decimals: number) {
|
function fixedPointToNumber(value: BN, decimals: number) {
|
||||||
const divisor = new BN(10).pow(new BN(decimals))
|
const divisor = new BN(10).pow(new BN(decimals))
|
||||||
|
|
|
@ -6,10 +6,7 @@ import {
|
||||||
ChevronDownIcon,
|
ChevronDownIcon,
|
||||||
DuplicateIcon,
|
DuplicateIcon,
|
||||||
LogoutIcon,
|
LogoutIcon,
|
||||||
MenuIcon,
|
|
||||||
XIcon,
|
|
||||||
} from '@heroicons/react/outline'
|
} from '@heroicons/react/outline'
|
||||||
import { useRouter } from 'next/router'
|
|
||||||
import ConnectWalletButton from './ConnectWalletButton'
|
import ConnectWalletButton from './ConnectWalletButton'
|
||||||
import WalletIcon from './WalletIcon'
|
import WalletIcon from './WalletIcon'
|
||||||
import useWalletStore from '../stores/useWalletStore'
|
import useWalletStore from '../stores/useWalletStore'
|
||||||
|
@ -27,7 +24,6 @@ const WALLET_OPTIONS = [
|
||||||
]
|
]
|
||||||
|
|
||||||
const TopBar = () => {
|
const TopBar = () => {
|
||||||
const { asPath } = useRouter()
|
|
||||||
const { connected, current: wallet } = useWalletStore((s) => s)
|
const { connected, current: wallet } = useWalletStore((s) => s)
|
||||||
const [isCopied, setIsCopied] = useState(false)
|
const [isCopied, setIsCopied] = useState(false)
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,6 @@ export default function useWallet() {
|
||||||
)
|
)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('provider url changed', selectedProviderUrl)
|
|
||||||
if (selectedProviderUrl) {
|
if (selectedProviderUrl) {
|
||||||
setSavedProviderUrl(selectedProviderUrl)
|
setSavedProviderUrl(selectedProviderUrl)
|
||||||
}
|
}
|
||||||
|
@ -66,7 +65,6 @@ export default function useWallet() {
|
||||||
if (provider) {
|
if (provider) {
|
||||||
const updateWallet = () => {
|
const updateWallet = () => {
|
||||||
// hack to also update wallet synchronously in case it disconnects
|
// hack to also update wallet synchronously in case it disconnects
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
const wallet = new (provider.adapter || Wallet)(
|
const wallet = new (provider.adapter || Wallet)(
|
||||||
savedProviderUrl,
|
savedProviderUrl,
|
||||||
endpoint
|
endpoint
|
||||||
|
|
|
@ -11,7 +11,7 @@ interface NotificationStore extends State {
|
||||||
set: (x: any) => void
|
set: (x: any) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
const useNotificationStore = create<NotificationStore>((set, get) => ({
|
const useNotificationStore = create<NotificationStore>((set, _get) => ({
|
||||||
notifications: [],
|
notifications: [],
|
||||||
set: (fn) => set(produce(fn)),
|
set: (fn) => set(produce(fn)),
|
||||||
}))
|
}))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import create, { State } from 'zustand'
|
import create, { State } from 'zustand'
|
||||||
import produce from 'immer'
|
import produce from 'immer'
|
||||||
import { Connection, PublicKey } from '@solana/web3.js'
|
import { Connection } from '@solana/web3.js'
|
||||||
|
|
||||||
import { EndpointInfo, WalletAdapter } from '../@types/types'
|
import { EndpointInfo, WalletAdapter } from '../@types/types'
|
||||||
import {
|
import {
|
||||||
|
@ -84,11 +84,10 @@ const useWalletStore = create<WalletStore>((set, get) => ({
|
||||||
const connection = get().connection.current
|
const connection = get().connection.current
|
||||||
const connected = get().connected
|
const connected = get().connected
|
||||||
const tokenAccounts = get().tokenAccounts
|
const tokenAccounts = get().tokenAccounts
|
||||||
const mints = get().mints
|
|
||||||
const set = get().set
|
const set = get().set
|
||||||
|
|
||||||
if (connected) {
|
if (connected) {
|
||||||
var fetchMints = tokenAccounts.map((a) =>
|
const fetchMints = tokenAccounts.map((a) =>
|
||||||
getMint(connection, a.account.mint)
|
getMint(connection, a.account.mint)
|
||||||
)
|
)
|
||||||
const mintResults = await Promise.all(fetchMints)
|
const mintResults = await Promise.all(fetchMints)
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { render, fireEvent } from '../testUtils'
|
import { render } from '../testUtils'
|
||||||
import Home from '../../pages/index'
|
import Home from '../../pages/index'
|
||||||
|
|
||||||
describe('Home page', () => {
|
describe('Home page', () => {
|
||||||
it('renders', () => {
|
it('renders', () => {
|
||||||
const { asFragment } = render(<Home />, {})
|
render(<Home />, {})
|
||||||
expect(true).toBe(true)
|
expect(true).toBe(true)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Connection, ParsedAccountData, PublicKey } from '@solana/web3.js'
|
import { Connection, PublicKey } from '@solana/web3.js'
|
||||||
import {
|
import {
|
||||||
AccountInfo,
|
AccountInfo,
|
||||||
AccountLayout,
|
AccountLayout,
|
||||||
|
|
|
@ -8,7 +8,9 @@ export function SolletExtensionAdapter(_, network) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
on: () => {},
|
on: () => {
|
||||||
|
/* do nothing */
|
||||||
|
},
|
||||||
connect: () => {
|
connect: () => {
|
||||||
notify({
|
notify({
|
||||||
message: 'Sollet Extension Error',
|
message: 'Sollet Extension Error',
|
||||||
|
|
Loading…
Reference in New Issue