> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# JsonRpcSigner

A signer that uses JSON-RPC to sign transactions and messages.

## Extends

* [`AbstractSigner`](/sdk/content/classes/AbstractSigner)\<[`JsonRpcApiProvider`](/sdk/content/classes/JsonRpcApiProvider)>

## Constructors

### new JsonRpcSigner()

```ts theme={null}
new JsonRpcSigner(provider, address): JsonRpcSigner
```

Creates a new JsonRpcSigner instance.

#### Parameters

| Parameter  | Type                                                                    | Description                |
| :--------- | :---------------------------------------------------------------------- | :------------------------- |
| `provider` | [`JsonRpcApiProvider`](/sdk/content/classes/JsonRpcApiProvider)\<`any`> | The JSON-RPC provider.     |
| `address`  | `string`                                                                | The address of the signer. |

#### Returns

[`JsonRpcSigner`](/sdk/content/classes/JsonRpcSigner)

#### Overrides

[`AbstractSigner`](/sdk/content/classes/AbstractSigner).[`constructor`](/sdk/content/classes/AbstractSigner#constructors)

#### Source

[providers/provider-jsonrpc.ts:328](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/providers/provider-jsonrpc.ts#L328)

## Properties

| Property   | Modifier   | Type                                                                                                                  | Description                               | Inherited from                                                     |
| :--------- | :--------- | :-------------------------------------------------------------------------------------------------------------------- | :---------------------------------------- | :----------------------------------------------------------------- |
| `provider` | `readonly` | [`JsonRpcApiProvider`](/sdk/content/classes/JsonRpcApiProvider)\<[`FetchRequest`](/sdk/content/classes/FetchRequest)> | The provider this signer is connected to. | [`AbstractSigner`](/sdk/content/classes/AbstractSigner).`provider` |

## Methods

### connect()

```ts theme={null}
connect(provider): Signer
```

Connects the signer to a provider.

#### Parameters

| Parameter  | Type                                                     | Description                 |
| :--------- | :------------------------------------------------------- | :-------------------------- |
| `provider` | `null` \| [`Provider`](/sdk/content/interfaces/Provider) | The provider to connect to. |

#### Returns

[`Signer`](/sdk/content/interfaces/Signer)

The connected signer.

#### Overrides

[`AbstractSigner`](/sdk/content/classes/AbstractSigner).[`connect`](/sdk/content/classes/AbstractSigner#connect)

#### Throws

If the signer cannot be reconnected.

#### Source

[providers/provider-jsonrpc.ts:342](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/providers/provider-jsonrpc.ts#L342)

***

### getAddress()

```ts theme={null}
getAddress(): Promise<string>
```

Gets the address of the signer.

#### Returns

`Promise`\<`string`>

The address of the signer.

#### Overrides

[`AbstractSigner`](/sdk/content/classes/AbstractSigner).[`getAddress`](/sdk/content/classes/AbstractSigner#getaddress)

#### Source

[providers/provider-jsonrpc.ts:353](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/providers/provider-jsonrpc.ts#L353)

***

### sendTransaction()

```ts theme={null}
sendTransaction(tx): Promise<TransactionResponse>
```

Sends a transaction.

#### Parameters

| Parameter | Type                                                                 | Description              |
| :-------- | :------------------------------------------------------------------- | :----------------------- |
| `tx`      | [`TransactionRequest`](/sdk/content/type-aliases/TransactionRequest) | The transaction request. |

#### Returns

`Promise`\<[`TransactionResponse`](/sdk/content/type-aliases/TransactionResponse)>

The transaction response.

#### Overrides

`AbstractSigner.sendTransaction`

#### Throws

If the transaction cannot be sent.

#### Source

[providers/provider-jsonrpc.ts:438](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/providers/provider-jsonrpc.ts#L438)

***

### signMessage()

```ts theme={null}
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:551](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/providers/provider-jsonrpc.ts#L551)

***

### signTransaction()

```ts theme={null}
signTransaction(_tx): Promise<string>
```

Signs a transaction.

#### Parameters

| Parameter | Type                                                                 | Description              |
| :-------- | :------------------------------------------------------------------- | :----------------------- |
| `_tx`     | [`TransactionRequest`](/sdk/content/type-aliases/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:521](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/providers/provider-jsonrpc.ts#L521)

***

### signTypedData()

```ts theme={null}
signTypedData(
   domain, 
   types, 
_value): Promise<string>
```

Signs typed data.

#### Parameters

| Parameter | Type                                                                               | Description                   |
| :-------- | :--------------------------------------------------------------------------------- | :---------------------------- |
| `domain`  | [`TypedDataDomain`](/sdk/content/interfaces/TypedDataDomain)                       | The domain of the typed data. |
| `types`   | `Record`\<`string`, [`TypedDataField`](/sdk/content/interfaces/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:564](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/providers/provider-jsonrpc.ts#L564)

***

### unlock()

```ts theme={null}
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

[providers/provider-jsonrpc.ts:583](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/providers/provider-jsonrpc.ts#L583)
