> ## 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.

# Send A Sui Transaction

> [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.

```ts createClient.ts theme={"system"}
import { createClient } from '@dynamic-labs/legacy-client'
import { SuiExtension } from '@dynamic-labs/legacy-sui-extension'

export const dynamicClient = createClient({
  environmentId: 'YOUR-ENVIRONMENT-ID',
}).extend(SuiExtension())
```

```ts sendSui.ts theme={"system"}
import { dynamicClient } from './dynamicClient'
import { SuiClient } from '@mysten/sui.js/client'
import { Transaction } from '@mysten/sui/transactions'
import { MIST_PER_SUI } from '@mysten/sui/utils';


export const sendSui = async (to: string, amountSui: string) => {
  const wallet = dynamicClient.wallets.primary
  if (!wallet) return

  const networkUrl = await dynamicClient.sui.getNetworkUrl({ walletId: wallet.id })
  const suiClient = new SuiClient({ url: networkUrl })
  const signer = dynamicClient.sui.getSigner({ wallet })

  const tx = new Transaction()
  tx.setSender(wallet.address)

  const [coin] = tx.splitCoins(tx.gas, [BigInt(Math.floor(Number(amountSui) * MIST_PER_SUI))])
  tx.transferObjects([coin], to)

  const { signature } = await signer.signTransaction(tx)
  const txBytes = await tx.build({ client: suiClient as any })

  const { digest } = await suiClient.executeTransactionBlock({ transactionBlock: txBytes, signature })
  return digest
}
```

```
```


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