generated from Tahul/vue-composable-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
wallet.ts
22 lines (19 loc) · 943 Bytes
/
wallet.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { ProviderRpcError, RpcError } from '../errors'
import { Connector, ConnectorName, ProviderTarget } from './connector'
import { EIP1193Provider } from './eip1193'
import { EIP6963ProviderInfo } from './eip6963'
export type ConnectionStatus = 'idle' | 'connecting' | 'connected'
export type Wallet = {
status: ConnectionStatus
error: ProviderRpcError | string | null
connectorName: ConnectorName | null
provider: EIP1193Provider | null
connector: Connector | null
address: string | null
chainId: number | null
providerTarget: ProviderTarget | null // Only available when connectorName is 'BrowserWallet'
providerInfo: EIP6963ProviderInfo | null // Only available when connectorName is 'BrowserWallet' and providerTarget is 'rdns'
}
export type OnDisconnectCallback = (...args: any[]) => void
export type OnAccountsChangedCallback = (accounts: string[]) => void
export type OnChainChangedCallback = (chainId: number) => void