-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathTrustWalletCard.tsx
38 lines (31 loc) · 985 Bytes
/
TrustWalletCard.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { useEffect, useState } from 'react'
import { hooks, trustWallet } from '../../connectors/trustWallet'
import { Card } from '../Card'
const { useChainId, useAccounts, useIsActivating, useIsActive, useProvider, useENSNames } = hooks
export default function TrustWalletCard() {
const chainId = useChainId()
const accounts = useAccounts()
const isActivating = useIsActivating()
const isActive = useIsActive()
const provider = useProvider()
const ENSNames = useENSNames(provider)
const [error, setError] = useState(undefined)
useEffect(() => {
trustWallet.connectEagerly().catch((error) => {
console.debug('Failed to connect eagerly to OKX Wallet', error)
})
}, [])
return (
<Card
connector={trustWallet}
activeChainId={chainId}
isActivating={isActivating}
isActive={isActive}
error={error}
setError={setError}
accounts={accounts}
provider={provider}
ENSNames={ENSNames}
/>
)
}