signerOrProvider
Classes
SignerProviderUtils
Utility functions for signer/provider union types
Methods
checkNetworkMatches()
static checkNetworkMatches(signerOrProvider: SignerOrProvider, chainId: number): Promise<void>
Checks that the signer/provider that's provider matches the chain id Throws if not.
Parameters
Parameter | Type | Description |
---|---|---|
signerOrProvider | SignerOrProvider | |
chainId | number |
Returns
Promise
<void
>
Source
dataEntities/signerOrProvider.ts:56
getProvider()
static getProvider(signerOrProvider: SignerOrProvider): undefined | Provider
If signerOrProvider is a provider then return itself. If signerOrProvider is a signer then return signer.provider
Parameters
Parameter | Type | Description |
---|---|---|
signerOrProvider | SignerOrProvider |
Returns
undefined
| Provider
Source
dataEntities/signerOrProvider.ts:24
signerHasProvider()
static signerHasProvider(signer: Signer): signer is Signer & Object
Check if the signer has a connected provider
Parameters
Parameter | Type | Description |
---|---|---|
signer | Signer |
Returns
signer is Signer & Object