> ## Documentation Index
> Fetch the complete documentation index at: https://dynamic-docs-feat-sidebar-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# solana-extension

The package that gives access to an [Extension](/react-native/package-references/client#extension-method)
that allows integrating Solana/web3.js to our [client](/react-native/client).

## Functions

### `SolanaExtension` method

```typescript
SolanaExtension(): Extension<ISolanaExtension>
```

A method that, when passed to the client instance, injects the following modules into it:

#### `solana` module

Provides methods to create solana connection and signer for solana wallets.

<Info>
  The reference types below are simplified for the sake of readability. See the
  [type specification](#isolanaextension-type) for details.
</Info>

| Property        | Type                                                                | Description                                                                                                                                       |
| --------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `getClient`     | `(props: { wallet: Wallet }) => ISolanaSigner`                      | Crate a Signer for the wallet that allows for sign messages and transactions.                                                                     |
| `getConnection` | `(connectionConfig?: ConnectionConfig \| Commitment) => Connection` | Create a `@solana/web3.js` Connection object to query the blockchain. Accepts an same argument that is Solana's Connection class second argument. |

## Types

### `ISolanaExtension` type

Type of the solana extension.

```typescript
import {
  Connection,
  PublicKey,
  SendOptions,
  Transaction,
  TransactionSignature,
  VersionedTransaction,
} from '@solana/web3.js'

import { type Wallet } from '@dynamic-labs/client'

type SignedMessage = {
  signature: Uint8Array
}

type ISolanaSigner = {
  publicKey: PublicKey
  signTransaction<T extends Transaction | VersionedTransaction>(
    transaction: T
  ): Promise<T>
  signAllTransactions<T extends Transaction | VersionedTransaction>(
    transactions: T[]
  ): Promise<T[]>
  signAndSendTransaction<T extends Transaction | VersionedTransaction>(
    transaction: T,
    options?: SendOptions
  ): Promise<{ signature: TransactionSignature }>
  signMessage(message: Uint8Array, encoding?: string): Promise<SignedMessage>
}

type ISolanaExtension = {
  solana: {
    getConnection: (
      connectionConfig?: ConnectionConfig | Commitment
    ) => Connection
    getSigner: (props: { wallet: Wallet }) => ISolanaSigner
  }
}
```
