SUI
Sui JSON-RPC MethodsThese are the methods that wallets should implement to handle Sui transactions and messages via WalletConnect. :::warning Please note: The SUI RPC standard is still under review and specifications may change. Implementation details and method signatures are subject to updates. :::
sui_getAccounts
This method returns an Array of public keys and addresses available to sign from the wallet.Parameters
noneReturns
Array - Array of accounts:
Object:pubkey:String- public key for keypairaddress:String- the Sui address
Example
Session Properties
In a connection request, it is recommended to serialize the response togetAccounts 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
transaction(object) - The transaction to sign:transaction(string) - The base64 encoded, BCS encoded, transaction dataaddress(string) - The sender’s Sui address
Returns
object - The signed transaction:
signature(string) - The base64 encoded signaturetransactionBytes(string) - The base64 encoded signed transaction bytes
Example
sui_signAndExecuteTransaction
Sign and execute a Sui transaction.Parameters
transaction(object) - The transaction to sign and execute:transaction(string) - The base64 encoded, BCS encoded, transaction dataaddress(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
sui_signPersonalMessage
Sign a personal message.Parameters
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