# SolanaSigner | @account-kit/signer

> The SolanaSigner class is used to sign transactions and messages for the Solana blockchain. It provides methods to add signatures to transactions and sign messages.

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

Defined in: [account-kit/signer/src/solanaSigner.ts:18](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/solanaSigner.ts#L18)

The SolanaSigner class is used to sign transactions and messages for the Solana blockchain.
It provides methods to add signatures to transactions and sign messages.

## Constructors

### Constructor

```ts
new SolanaSigner(client): SolanaSigner;
```

Defined in: [account-kit/signer/src/solanaSigner.ts:27](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/solanaSigner.ts#L27)

Constructor for the SolanaSigner class which is a wrapper around the alchemy client, and is more focused on the solana web3

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `client`
      </td>

      <td>
        `BaseSignerClient`
      </td>

      <td>
        This is the client that will be used to sign the transaction, and we are just having functions on top of it.
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`SolanaSigner`

## Properties

<table>
  <thead>
    <tr>
      <th align="left">Property</th>
      <th align="left">Type</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        <a id="address" /> `address`
      </td>

      <td>
        `string`
      </td>
    </tr>

    <tr>
      <td>
        <a id="alchemyclient" /> `alchemyClient`
      </td>

      <td>
        `BaseSignerClient`
      </td>
    </tr>

  </tbody>
</table>

## Methods

### addSignature()

```ts
addSignature(transaction): Promise<Transaction | VersionedTransaction>;
```

Defined in: [account-kit/signer/src/solanaSigner.ts:41](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/solanaSigner.ts#L41)

Adds a signature of the client user to a transaction

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `transaction`
      </td>

      <td>
        `Transaction` | `VersionedTransaction`
      </td>

      <td>
        The transaction to add the signature to
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`Promise`\<`Transaction` | `VersionedTransaction`>

The transaction with the signature added

---

### addSponsorship()

```ts
addSponsorship(
   instructions,
   connection,
   policyId?): Promise<VersionedTransaction>;
```

Defined in: [account-kit/signer/src/solanaSigner.ts:158](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/solanaSigner.ts#L158)

Adds sponsorship to a transaction. Used to have a party like Alchemy pay for the transaction.

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `instructions`
      </td>

      <td>
        `TransactionInstruction`\[]
      </td>

      <td>
        The instructions to add to the transaction
      </td>
    </tr>

    <tr>
      <td>
        `connection`
      </td>

      <td>
        `Connection`
      </td>

      <td>
        The connection to use for the transaction
      </td>
    </tr>

    <tr>
      <td>
        `policyId?`
      </td>

      <td>
        `string`
      </td>

      <td>
        The policy ID to add sponsorship to
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`Promise`\<`VersionedTransaction`>

The transaction with sponsorship added

---

### createTransaction()

Creates a transfer transaction. Used for the SolanaCard example.

#### Param

The instructions to add to the transaction

#### Param

The connection to use for the transaction

#### Param

The version of the transaction

#### Call Signature

```ts
createTransaction(
   instructions,
   connection,
   version?): Promise<VersionedTransaction>;
```

Defined in: [account-kit/signer/src/solanaSigner.ts:92](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/solanaSigner.ts#L92)

##### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `instructions`
      </td>

      <td>
        `TransactionInstruction`\[]
      </td>
    </tr>

    <tr>
      <td>
        `connection`
      </td>

      <td>
        `Connection`
      </td>
    </tr>

    <tr>
      <td>
        `version?`
      </td>

      <td>
        `"versioned"`
      </td>
    </tr>

  </tbody>
</table>

##### Returns

`Promise`\<`VersionedTransaction`>

#### Call Signature

```ts
createTransaction(
   instructions,
   connection,
   version?): Promise<Transaction>;
```

Defined in: [account-kit/signer/src/solanaSigner.ts:97](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/solanaSigner.ts#L97)

##### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `instructions`
      </td>

      <td>
        `TransactionInstruction`\[]
      </td>
    </tr>

    <tr>
      <td>
        `connection`
      </td>

      <td>
        `Connection`
      </td>
    </tr>

    <tr>
      <td>
        `version?`
      </td>

      <td>
        `"legacy"`
      </td>
    </tr>

  </tbody>
</table>

##### Returns

`Promise`\<`Transaction`>

#### Call Signature

```ts
createTransaction(instructions, connection): Promise<VersionedTransaction>;
```

Defined in: [account-kit/signer/src/solanaSigner.ts:102](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/solanaSigner.ts#L102)

##### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `instructions`
      </td>

      <td>
        `TransactionInstruction`\[]
      </td>
    </tr>

    <tr>
      <td>
        `connection`
      </td>

      <td>
        `Connection`
      </td>
    </tr>

  </tbody>
</table>

##### Returns

`Promise`\<`VersionedTransaction`>

---

### signMessage()

```ts
signMessage(message): Promise<ByteArray>;
```

Defined in: [account-kit/signer/src/solanaSigner.ts:73](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/solanaSigner.ts#L73)

Signs a message

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `message`
      </td>

      <td>
        `Uint8Array`
      </td>

      <td>
        The message to sign
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`Promise`\<[`ByteArray`](https://viem.sh)>

The signature of the message