JsonRpcSigner
A signer that uses JSON-RPC to sign transactions and messages.
Extends
Constructors
new JsonRpcSigner()
new JsonRpcSigner(provider, address): 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:326
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
provider | readonly | JsonRpcApiProvider <FetchRequest > | The provider this signer is connected to. | AbstractSigner .provider |
Methods
connect()
connect(provider): Signer
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:340
getAddress()
getAddress(): Promise<string>
Gets the address of the signer.
Returns
Promise
<string
>
The address of the signer.
Overrides
Source
providers/provider-jsonrpc.ts:351
sendTransaction()
sendTransaction(tx): Promise<TransactionResponse>
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:436
signMessage()
signMessage(_message): Promise<string>
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:549
signTransaction()
signTransaction(_tx): Promise<string>
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:519
signTypedData()
signTypedData(
domain,
types,
_value): Promise<string>
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:562
unlock()
unlock(password): Promise<boolean>
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?