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

# sui-extension

> [card] Recommended: JavaScript SDK for React Native
>
> While this SDK is still supported, we recommend using newer [JavaScript SDK](https://docs.dynamic.xyz/docs/javascript/reference/react-native-quickstart.md), which is optimized for React Native, but also comes with a host of other benefits.

The package that gives access to an [Extension](https://docs.dynamic.xyz/docs/react-native/reference/package-references/client.md#extension-method)
that allows integrating Sui blockchain functionality to our [client](https://docs.dynamic.xyz/docs/react-native/reference/client.md).

## Functions

### `SuiExtension` method

```typescript theme={"system"}
SuiExtension(): Extension<ISuiExtension>
```

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

#### `sui` module

Provides methods to create Sui client and signer for Sui wallets.

> [!NOTE]
>
> The reference types below are simplified for the sake of readability. See the
> [type specification](#isuiextension-type) for details.

| Property | Type | Description |
| - | - | - |
| `getSigner` | `(props: { wallet: Wallet }) => ISuiSigner` | Returns an object that can be used to prompt the user for message and transaction signing. |
| `getNetworkUrl` | `(props: { walletId: string }) => Promise<string>` | Returns the Sui fullnode URL for the network the wallet is connected to. Especially useful for creating Sui clients. |
| `getNetworkName` | `(props: { walletId: string }) => Promise<SuiNetworkName>` | Returns the name of the network the wallet is connected to. |

## Types

### `ISuiExtension` type

Type of the Sui extension.

```typescript theme={"system"}
import { Transaction } from '@mysten/sui/transactions'
import { type Wallet } from '@dynamic-labs/legacy-client'

type SuiNetworkName = 'mainnet' | 'testnet' | 'devnet'

type ISuiSigner = {
  signTransaction(transaction: Transaction): Promise<{ signature: string }>
  signMessage(message: string): Promise<{ signature: string }>
}

type ISuiExtension = {
  sui: {
    getSigner: (props: { wallet: Wallet }) => ISuiSigner
    getNetworkUrl: (props: { walletId: string }) => Promise<string>
    getNetworkName: (props: { walletId: string }) => Promise<SuiNetworkName>
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.