JsonRpcSigner
A signer that uses JSON-RPC to sign transactions and messages.
Extends
Constructors
new JsonRpcSigner()
Creates a new JsonRpcSigner instance.
Parameters
Parameter | Type | Description |
---|---|---|
provider | JsonRpcApiProvider <any > | The JSON-RPC provider. |
address | string | The address of the signer. |
Returns
Overrides
Source
providers/provider-jsonrpc.ts:322
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
provider | readonly | JsonRpcApiProvider <FetchRequest > | The provider this signer is connected to. | AbstractSigner .provider |
Methods
connect()
Connects the signer to a provider.
Parameters
Parameter | Type | Description |
---|---|---|
provider | null | Provider | The provider to connect to. |
Returns
The connected signer.
Overrides
Throws
If the signer cannot be reconnected.
Source
providers/provider-jsonrpc.ts:336
getAddress()
Gets the address of the signer.
Returns
Promise
<string
>
The address of the signer.
Overrides
Source
providers/provider-jsonrpc.ts:347
sendTransaction()
Sends a transaction.
Parameters
Parameter | Type | Description |
---|---|---|
tx | TransactionRequest | The transaction request. |
Returns
Promise
<TransactionResponse
>
The transaction response.
Overrides
AbstractSigner.sendTransaction
Throws
If the transaction cannot be sent.
Source
providers/provider-jsonrpc.ts:432
signMessage()
Signs a message.
Parameters
Parameter | Type | Description |
---|---|---|
_message | string | Uint8Array | The message to sign. |
Returns
Promise
<string
>
The signed message.
Overrides
AbstractSigner.signMessage
Source
providers/provider-jsonrpc.ts:545
signTransaction()
Signs a transaction.
Parameters
Parameter | Type | Description |
---|---|---|
_tx | TransactionRequest | The transaction request. |
Returns
Promise
<string
>
The signed transaction.
Overrides
AbstractSigner.signTransaction
Throws
If the transaction cannot be signed.
Source
providers/provider-jsonrpc.ts:515
signTypedData()
Signs typed data.
Parameters
Parameter | Type | Description |
---|---|---|
domain | TypedDataDomain | The domain of the typed data. |
types | Record <string , TypedDataField []> | The types of the typed data. |
_value | Record <string , any > | The value of the typed data. |
Returns
Promise
<string
>
The signed typed data.
Overrides
AbstractSigner.signTypedData
Source
providers/provider-jsonrpc.ts:558
unlock()
Unlocks the account.
Parameters
Parameter | Type | Description |
---|---|---|
password | string | The password to unlock the account. |
Returns
Promise
<boolean
>
True if the account is unlocked, false otherwise.
Source
Was this page helpful?