Skip to content

Commit 46e4126

Browse files
committed
chore: Remove unused occurences of eth provider
1 parent 97e7723 commit 46e4126

File tree

5 files changed

+11
-18
lines changed

5 files changed

+11
-18
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
.env.local
2323
.env.development.local
2424
.env
25+
.eslintcache
2526

2627
# debug
2728
npm-debug.log*

src/hooks/useAllEarnings.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import { useEffect, useState } from 'react'
2-
import { provider } from 'web3-core'
3-
42
import BigNumber from 'bignumber.js'
53
import { useWallet } from 'use-wallet'
6-
74
import { getEarned, getMasterChefContract, getFarms } from '../sushi/utils'
85
import useSushi from './useSushi'
96
import useBlock from './useBlock'
107

118
const useAllEarnings = () => {
129
const [balances, setBalance] = useState([] as Array<BigNumber>)
13-
const { account }: { account: string; ethereum: provider } = useWallet()
10+
const { account }: { account: string } = useWallet()
1411
const sushi = useSushi()
1512
const farms = getFarms(sushi)
1613
const masterChefContract = getMasterChefContract(sushi)

src/hooks/useAllowance.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { useEffect, useState } from 'react'
22
import BigNumber from 'bignumber.js'
33
import { useWallet } from 'use-wallet'
4-
import { provider } from 'web3-core'
54
import { Contract } from 'web3-eth-contract'
65
import useSushi from './useSushi'
76
import { getAllowance } from '../utils/erc20'
@@ -10,7 +9,7 @@ import { getLotteryContract } from '../sushi/lotteryUtils'
109

1110
const useAllowance = (lpContract: Contract) => {
1211
const [allowance, setAllowance] = useState(new BigNumber(0))
13-
const { account }: { account: string; ethereum: provider } = useWallet()
12+
const { account }: { account: string } = useWallet()
1413
const sushi = useSushi()
1514
const masterChefContract = getMasterChefContract(sushi)
1615

@@ -32,7 +31,7 @@ const useAllowance = (lpContract: Contract) => {
3231

3332
export const useSousAllowance = (lpContract: Contract, sousId) => {
3433
const [allowance, setAllowance] = useState(new BigNumber(0))
35-
const { account }: { account: string; ethereum: provider } = useWallet()
34+
const { account }: { account: string } = useWallet()
3635
const sushi = useSushi()
3736
const sousChefContract = getSousChefContract(sushi, sousId)
3837

@@ -54,7 +53,7 @@ export const useSousAllowance = (lpContract: Contract, sousId) => {
5453

5554
export const useLotteryAllowance = () => {
5655
const [allowance, setAllowance] = useState(new BigNumber(0))
57-
const { account }: { account: string; ethereum: provider } = useWallet()
56+
const { account }: { account: string } = useWallet()
5857
const sushi = useSushi()
5958
const lotteryContract = getLotteryContract(sushi)
6059
const cakeContract = getSushiContract(sushi)

src/hooks/useApprove.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import { useCallback } from 'react'
2-
32
import { useWallet } from 'use-wallet'
4-
import { provider } from 'web3-core'
53
import { Contract } from 'web3-eth-contract'
64
import useSushi from './useSushi'
7-
85
import { getSushiContract, approve, getMasterChefContract, getSousChefContract } from '../sushi/utils'
96
import { getLotteryContract } from '../sushi/lotteryUtils'
107

118
const useApprove = (lpContract: Contract) => {
12-
const { account }: { account: string; ethereum: provider } = useWallet()
9+
const { account }: { account: string } = useWallet()
1310
const sushi = useSushi()
1411
const masterChefContract = getMasterChefContract(sushi)
1512

@@ -26,7 +23,7 @@ const useApprove = (lpContract: Contract) => {
2623
}
2724

2825
export const useSousApprove = (lpContract: Contract, sousId) => {
29-
const { account }: { account: string; ethereum: provider } = useWallet()
26+
const { account }: { account: string } = useWallet()
3027
const sushi = useSushi()
3128
const sousChefContract = getSousChefContract(sushi, sousId)
3229

@@ -43,7 +40,7 @@ export const useSousApprove = (lpContract: Contract, sousId) => {
4340
}
4441

4542
export const useLotteryApprove = () => {
46-
const { account }: { account: string; ethereum: provider } = useWallet()
43+
const { account }: { account: string } = useWallet()
4744
const sushi = useSushi()
4845
const lotteryContract = getLotteryContract(sushi)
4946
const cakeContract = getSushiContract(sushi)

src/hooks/useEarnings.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useEffect, useState } from 'react'
2-
import { provider } from 'web3-core'
32
import BigNumber from 'bignumber.js'
43
import { useWallet } from 'use-wallet'
54
import {
@@ -15,7 +14,7 @@ import useBlock from './useBlock'
1514

1615
const useEarnings = (pid: number) => {
1716
const [balance, setBalance] = useState(new BigNumber(0))
18-
const { account }: { account: string; ethereum: provider } = useWallet()
17+
const { account }: { account: string } = useWallet()
1918
const sushi = useSushi()
2019
const masterChefContract = getMasterChefContract(sushi)
2120
const block = useBlock()
@@ -36,7 +35,7 @@ const useEarnings = (pid: number) => {
3635

3736
export const useSousEarnings = (sousId) => {
3837
const [balance, setBalance] = useState(new BigNumber(0))
39-
const { account }: { account: string; ethereum: provider } = useWallet()
38+
const { account }: { account: string } = useWallet()
4039
const sushi = useSushi()
4140
const sousChefContract = getSousChefContract(sushi, sousId)
4241
const masterChefContract = getMasterChefContract(sushi)
@@ -68,7 +67,7 @@ export const useSousLeftBlocks = (sousId) => {
6867
blocksRemaining: 0,
6968
isFinished: false,
7069
})
71-
const { account }: { account: string; ethereum: provider } = useWallet()
70+
const { account }: { account: string } = useWallet()
7271
const sushi = useSushi()
7372
const sousChefContract = getSousChefContract(sushi, sousId)
7473
const block = useBlock()

0 commit comments

Comments
 (0)