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

# SUI

> Sign messages, send transactions, and interact with the SUI blockchain using the Dynamic Kotlin SDK.

## Overview

`SuiModule` provides native SUI blockchain operations including message signing, transaction signing (raw or built from `to`/`value`), sending transactions, and network queries. Access it via `DynamicSDK.getInstance().sui`.

## Prerequisites

* Dynamic SDK initialized (see [Quickstart](/kotlin/quickstart))
* User authenticated (see [Authentication](/kotlin/authentication))
* SUI enabled in the [Dynamic dashboard](https://app.dynamic.xyz/dashboard/chains-and-networks#sui)

## Get a SUI Wallet

If SUI is enabled in the dashboard, the user gets a SUI wallet on signup. Find it via `userWallets`, or create one explicitly with `EmbeddedWalletChain.SUI`:

```kotlin theme={"system"}
val sdk = DynamicSDK.getInstance()

// Filter existing
val suiWallet = sdk.wallets.userWallets.firstOrNull { it.chain == "SUI" }

// Or create
val wallet = sdk.wallets.embedded.createWallet(chain = EmbeddedWalletChain.SUI)
```

## Get Network Name

Query the network name for the connected SUI wallet:

```kotlin theme={"system"}
val network = sdk.sui.getNetworkName(walletId = wallet.id)
println("Network: $network") // e.g. "mainnet", "testnet"
```

## Sign a Message

Sign a message using the connected SUI wallet:

```kotlin theme={"system"}
val signature = sdk.sui.signMessage(
  walletId = wallet.id,
  message = "Hello, SUI!"
)
println("Signature: $signature")
```

## Sign a Transaction

Sign a raw base64-encoded SUI transaction without broadcasting it:

```kotlin theme={"system"}
val signature = sdk.sui.signTransaction(
  walletId = wallet.id,
  transaction = "base64EncodedTransaction..."
)
```

## Sign a Transfer Transaction

Build and sign a SUI transfer from convenient `to`/`value` parameters:

```kotlin theme={"system"}
val signature = sdk.sui.signTransferTransaction(
  walletId = wallet.id,
  to = "0x...",
  value = "0.001",   // SUI
  gasPrice = null,   // optional override
  gasBudget = null   // optional override
)
```

## Send Transactions

There are three flavors of broadcast:

```kotlin theme={"system"}
// Broadcast an already-signed transaction
val txDigest = sdk.sui.sendTransaction(
  walletId = wallet.id,
  transaction = "base64SignedTransaction..."
)

// Sign and send a raw transaction in one call
val txDigest2 = sdk.sui.signAndSendTransaction(
  walletId = wallet.id,
  transaction = "base64UnsignedTransaction..."
)

// Sign and send a transfer built from to/value
val txDigest3 = sdk.sui.signAndSendTransferTransaction(
  walletId = wallet.id,
  to = "0x...",
  value = "0.001",
  gasPrice = null,
  gasBudget = null
)
```

## API Reference

| Method                           | Returns  | Description                             |
| -------------------------------- | -------- | --------------------------------------- |
| `getNetworkName`                 | `String` | Get the connected network name          |
| `signMessage`                    | `String` | Sign a message                          |
| `signTransaction`                | `String` | Sign a raw base64 transaction           |
| `signTransferTransaction`        | `String` | Sign a transfer built from `to`/`value` |
| `sendTransaction`                | `String` | Broadcast a signed transaction          |
| `signAndSendTransaction`         | `String` | Sign and broadcast a raw transaction    |
| `signAndSendTransferTransaction` | `String` | Sign and broadcast a transfer           |

## Next Steps

* [Bitcoin Operations](/kotlin/wallets/bitcoin/overview) — Bitcoin operations
* [TON Operations](/kotlin/wallets/ton/overview) — TON operations
* [Token Balances](/kotlin/wallets/general/token-balances) — Multi-chain balance queries
