Signer<T extends _SignerImpl> class
A Signer in ethers is an abstraction of an Ethereum Account, which can be used to sign messages and transactions and send signed transactions to the Ethereum Network to execute state changing operations.
The available operations depend largely on the sub-class used.
For example, a Signer from MetaMask can send transactions and sign messages but cannot sign a transaction (without broadcasting it).
- Implementers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- impl → T
-
Internal JS Object, should not be used directly.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call(
TransactionRequest request) → Future< String> -
Returns the result of calling using the
request
, with this account address being used as the from field. -
connect(
Provider< _ProviderImpl> provider) → Signer<_SignerImpl> -
Connect this Signer to new
provider
. May simply throw an error if changing providers is not supported. -
estimateGas(
TransactionRequest request) → Future< BigInt> -
Returns the result of estimating the cost to send the
request
, with this account address being used as the from field. -
getAddress(
) → Future< String> - Returns a Future that resolves to the account address.
-
getBalance(
[dynamic blockTag]) → Future< BigInt> -
Returns the balance of this wallet at
blockTag
. -
getChainId(
) → Future< int> - Returns the chain ID this wallet is connected to.
-
getGasPrice(
) → Future< BigInt> - Returns the current gas price.
-
getTransactionCount(
[dynamic blockTag]) → Future< int> -
Returns the number of transactions this account has ever sent at
blockTag
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendTransaction(
TransactionRequest request) → Future< TransactionResponse> - Submits transaction to the network to be mined.
-
signMessage(
String message) → Future< String> -
Returns a Future which resolves to the Raw Signature of
message
. -
signTransaction(
TransactionRequest request) → Future< String> -
Returns a Future which resolves to the signed transaction of the
request
. This method does not populate any missing fields. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited