Skip to main content

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
ParameterTypeDescription
signerOrProviderSignerOrProvider
chainIdnumber
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
ParameterTypeDescription
signerOrProviderSignerOrProvider
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
ParameterTypeDescription
signerSigner
Returns

signer is Signer & Object

Source

dataEntities/signerOrProvider.ts:44