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

# Sui

> Overview of the Sui JSON-RPC methods supported by Wallet SDK.

These are the methods that wallets should implement to handle Sui transactions and messages via WalletConnect.

<Warning>
  The SUI RPC standard is still under review and specifications may change. Implementation details and method signatures are subject to updates.
</Warning>

## sui\_getAccounts

This method returns an Array of public keys and addresses available to sign from the wallet.

### Parameters

none

### Returns

`Array` - Array of accounts:

* `Object` :
  * `pubkey` : `String` - public key for keypair
  * `address` : `String` - the Sui address

### Example

```typescript theme={null}
// Request
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "sui_getAccounts",
  "params": {}
}

// Result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [{ "pubkey": "AC68P56WCCTF0nUEX31/V5b1wqiD1pvfc8Fql8dPIPDA",  "address":"0x3cd077f41680eebca0176baad3915b2ea26dbbdfd10161865234732bb1f2ac50" }]
}
```

### Session Properties

In a connection request, it is recommended to serialize the response to `getAccounts` in `session.sessionProperties.sui_getAccounts`. This allows dapps to consume an active session without requiring a context switch to re-request all addresses and associated public keys from the wallet.

## sui\_signTransaction

Sign a Sui transaction without executing it.

#### Parameters

1. `transaction` (object) - The transaction to sign:
   * `transaction` (string) - The base64 encoded, BCS encoded, transaction data
   * `address` (string) - The sender's Sui address

#### Returns

`object` - The signed transaction:

* `signature` (string) - The base64 encoded signature
* `transactionBytes` (string) - The base64 encoded signed transaction bytes

#### Example

```javascript theme={null}
// Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "sui_signTransaction",
  "params": {
    "transaction": "AAACAAhkAAAAAAAAAAAgcfGPMPqXhXLvgkjSYSgtJoBBfJN4xPm3bwZGapDhVIICAgABAQAAAQEDAAAAAAEBAHHxjzD6l4Vy74JI0mEoLSaAQXyTeMT5t28GRmqQ4VSCAq3fqx8mNL6p13BcS9bG74Gbh1dowEtQ",
    "address": "0xd5f647edb77d4fda31d0304506447fb3c92e55aaf77bc5ed4b77c332dd4605fa"
  }
}

// Response
{
  "jsonrpc": "2.0",
  "result": {
    "signature": "ACRvdr3yI2mdpeOK+NsJIimdNGcE9R//jjT3HALZ17fFyu818op4jZi/64lPBjpKMDX6ZtxnCFZExTOFdpi3MwEZXLv/ORduxMYX0fw8dbHlnWC8WG0ymrlAmARpEibbhw==",
    "transactionBytes": "AAACAAhkAAAAAAAAAAAg1fZH7bd9T9ox0DBFBkR/s8kuVar3e8XtS3fDMt1GBfoCAgABAQAAAQEDAAAAAAEBANX2R+23fU/aMdAwRQZEf7PJLlWq93vF7Ut3wzLdRgX6At/pRJzj2VpZgqXpSvEtd3GzPvt99hR8e/yOCGz/8nbRmA7QFAAAAAAgBy5vStJizn76LmJTBlDiONdR/2rSuzzS4L+Tp/Zs4hZ8cBxYkcSlxBD6QXvgS11E6d+DNek8LiA/beba6iH3l5gO0BQAAAAAIMpdmZjiqJ5GG9di1MAgD4S3uRr2gaMC7S1WsaeBwNIx1fZH7bd9T9ox0DBFBkR/s8kuVar3e8XtS3fDMt1GBfroAwAAAAAAAECrPAAAAAAAAA=="
  },
  "id": 1
}
```

### sui\_signAndExecuteTransaction

Sign and execute a Sui transaction.

#### Parameters

1. `transaction` (object) - The transaction to sign and execute:
   * `transaction` (string) - The base64 encoded, BCS encoded, transaction data
   * `address` (string) - The sender's Sui address

#### Returns

`object` - The transaction result:

* `digest` (string) - The transaction digest that can be used to look up the transaction in the explorer

#### Example

```javascript theme={null}
// Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "sui_signAndExecuteTransaction",
  "params": {
    "transaction": "AAACAAhkAAAAAAAAAAAgcfGPMPqXhXLvgkjSYSgtJoBBfJN4xPm3bwZGapDhVIICAgABAQAAAQEDAAAAAAEBAHHxjzD6l4Vy74JI0mEoLSaAQXyTeMT5t28GRmqQ4VSCAq3fqx8mNL6p13BcS9bG74Gbh1dowEtQ",
    "address": "0xd5f647edb77d4fda31d0304506447fb3c92e55aaf77bc5ed4b77c332dd4605fa"
  }
}

// Response
{
  "jsonrpc": "2.0",
  "result": {
    "digest": "GBqPRFR9sYfWA8rt2wCkcgZrctyYMj8Ufunxkjg5G8zt"
  },
  "id": 1
}
```

### sui\_signPersonalMessage

Sign a personal message.

#### Parameters

1. `message` (object) - The message to sign:
   * `message` (string) - The message to sign (plain text)
   * `address` (string) - The account address to sign with

#### Returns

`object` - The signed message:

* `signature` (string) - The base64 encoded signature

#### Example

```javascript theme={null}
// Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "sui_signPersonalMessage",
  "params": {
    "message": "This is a message to be signed for SUI",
    "address": "0xd5f647edb77d4fda31d0304506447fb3c92e55aaf77bc5ed4b77c332dd4605fa"
  }
}

// Response
{
  "jsonrpc": "2.0",
  "result": {
    "signature": "APsZ7PvuAynXYxxfeo0Py4DWOnrUpwqHhJJ1F8aGB2nmS5Wv9dvVo8Gr7DKaXwPMqFaFNKsHb0Hej07R0L0NpQsZXLv/ORduxMYX0fw8dbHlnWC8WG0ymrlAmARpEibbhw=="
  },
  "id": 1
}
```

## Additional Resources

For more information about Sui RPC methods and implementation details, please refer to the [official Sui documentation](https://docs.sui.io/sui-api-ref).
