sui library

A cross-platform Dart SDK for the Sui blockchain — mobile, web and desktop.

Transports

Sui is decommissioning JSON-RPC (fully off on 2026-07-31). This SDK provides the replacement transports and keeps the legacy one for the transition:

  • SuiGrpcClient — gRPC-web (protobuf) over HTTP, the primary read/write client against full nodes.
  • SuiGraphQLClient — GraphQL for indexer-backed queries (transaction history, events, staking, validators).
  • MvrClient — Move Registry (@org/app) name resolution.
  • SuiClient — the legacy JSON-RPC client. Deprecated; prefer the gRPC / GraphQL clients above.

Quick start

final client = SuiGrpcClient(network: SuiNetwork.mainnet);
final account = SuiAccount.ed25519Account();

final tx = Transaction();
final coin = tx.splitCoins(tx.gas, [tx.pureInt(1000000)]);
tx.transferObjects([coin], tx.pureAddress(recipient));

final result = await client.signAndExecuteTransaction(account, tx);

Classes

AddressOwner
AddStakeTransaction
AuthorityQuorumSignInfo
BalanceChange
BuildOptions
CertifiedTransaction
Claim
Coin
CoinBalance
CoinDenominationInfoResponse
CoinMetadataStruct
CoinStruct
CoinSupply
Commands
CoreClient
Transport-agnostic core API, mirroring the official TypeScript SDK's CoreClient (client/core.ts).
DisplayFieldsResponse
DryRunTransactionBlockResponse
Ed25519Keypair
Ed25519PublicKey
EffectsCert
EpochSummary
EventFilter
ExecutionStatus
FaucetClient
FaucetCoinInfo
FaucetResponse
Response of the faucet /v2/gas route.
GasConfig
GasCostSummary
GraphQLTransport
Minimal GraphQL-over-HTTP transport for Sui GraphQL RPC.
GrpcBuilderAdapter
Adapts GrpcCoreClient to the TransactionBuilderClient interface so the Transaction builder can resolve objects, Move function signatures and gas (via server-side resolveGasData) over gRPC-web.
GrpcCoreClient
gRPC-web implementation of CoreClient over sui.rpc.v2.
GrpcStatus
Standard gRPC status codes (subset used for mapping).
GrpcWebTransport
gRPC-web (unary) transport implemented over dio.
Id
Inputs
JsonRpcClient
MoveCall
MoveCallTransaction
MoveEventField
MoveEventModule
MoveModule
MultiSig
MultiSigPublicKey
MultiSigPublicKeyStruct
MultiSigStruct
MvrClient
Move Registry (MVR) resolver: turns @org/app package names and MVR-named types (e.g. @org/app::module::Type) into on-chain package IDs / fully qualified type tags.
ObjectOwner
OwnedObjectRef
PaginatedCoins
PaginatedObjectsResponse
PaginatedTransactionResponse
ParsedPartialMultiSigSignature
ParsedPasskeySignature
The decoded fields of a serialized passkey signature.
PasskeyAssertion
The result of a passkey assertion (WebAuthn get).
PasskeyKeypair
A passkey signer implementing SIP-9. Holds the 33-byte compressed secp256r1 public key and a PasskeyProvider; the private key never leaves the authenticator. Mirrors Mysten's PasskeyKeypair.
PasskeyProvider
Platform-agnostic passkey provider. The application supplies a WebAuthn backed implementation (browser / iOS / Android); this SDK performs the Sui-specific encoding. Mirrors Mysten's PasskeyProvider.
PasskeyPublicKey
A passkey public key. Mirrors Mysten's PasskeyPublicKey (SIP-9): flag 0x06, 33-byte compressed secp256r1 point.
PasskeyRegistration
The result of creating a passkey credential (WebAuthn create).
Pay
PayAllSui
PayAllSuiTransaction
Send all SUI coins to one recipient. This is for SUI coin only and does not require a separate gas coin object. Specifically, what pay_all_sui does are:
PaySui
PaySuiTransaction
Send SUI coins to a list of addresses, following a list of amounts. This is for SUI coin only and does not require a separate gas coin object. Specifically, what pay_sui does are:
PayTransaction
Send Coin<T> to a list of addresses, where T can be any coin type, following a list of amounts, The object specified in the gas field will be used to pay the gas fee for the transaction. The gas object can not appear in input_coins. If the gas object is not specified, the RPC server will auto-select one.
ProofPoints
PubkeyEnumWeightPair
PubkeyWeightPair
PublicKeyWeight
PublishTransaction
RequestOptions
ResolvedGasData
Result of one-shot server-side gas resolution: the gas payment the server selected and the budget it computed (and echoed gas price).
Secp256
Secp256k1Keypair
An Secp256k1 Keypair used for signing transactions.
Secp256KeypairData
Secp256PublicKey
Secp256r1Keypair
An Secp256r1 Keypair used for signing transactions.
SenderTransaction
SenderTransactionPage
A page of a sender's transactions with the fields wallets show per row.
SerializeTransactionOptions
Shared
SignableTransaction
SIGNATURE_SCHEME_TO_FLAG
SignatureData
SignatureVerification
SignatureWithBytes
SignOptions
SplitCoinEqualTransaction
SplitCoinTransaction
StakedSuiInfo
SuiAccount
SuiBalance
SuiBcs
SuiChangeEpoch
SuiClient
Legacy JSON-RPC client for a Sui full node.
SuiCoin
SuiCoinPage
SuiData
SuiExecuteTransactionResponse
SuiExecutionResult
SuiGasCost
SuiGasData
SuiGraphQLClient
GraphQL client for Sui GraphQL RPC (the secondary transport).
SuiGrpcClient
gRPC-web client for Sui full nodes (sui.rpc.v2).
SuiGrpcCompat
Drop-in-ish replacement for the legacy JSON-RPC SuiClient, backed by the new gRPC-web transport (and GraphQL for filtered queries). Exposes the same method names and legacy model return types the app already consumes, so callers migrate by swapping the client construction only.
SuiMoveObject
SuiMovePackage
SuiNamePage
Minimal page wrapper matching the legacy resolveNameServiceNames return shape (.data.firstOrNull). Page wrapper for resolveNameServiceNames results (.data = names).
SuiObject
SuiObjectData
SuiObjectDataFields
SuiObjectDataOptions
SuiObjectError
SuiObjectInfo
SuiObjectRef
SuiObjectResponse
SuiOwner
SuiPackage
SuiParsedMergeCoinResponse
SuiParsedPublishResponse
SuiParsedSplitCoinResponse
SuiParsedTransactionResponse
SuiRawMoveObject
SuiTransactionBlock
SuiTransactionBlockData
SuiTransactionBlockResponseOptions
SuiTransactionData
SuiTransactionKind
SuiTransactionResponse
SuiTransferSui
SuiUrls
TimeRange
Transaction
TransactionBlockDataBuilder
TransactionBuilderClient
Narrow interface of the data-provider capabilities the transaction Transaction builder needs during build():
TransactionData
TransactionDigestPage
TransactionEffects
TransactionExpiration
TransactionHistoryOptions
Selects which per-transaction details a history query fetches. Mirrors the SDK's SuiTransactionBlockResponseOptions convention. Object changes are off by default because they can be large; enable them to surface NFT / owned-object transfers, which produce no balance change.
TransactionResult
Transactions
Legacy helpers used to construct transactions.
TransferObject
TransferObjectTransaction
TransferSuiTransaction
TxBalanceChange
TxObjectChange
An object's ownership/state change within a transaction — enough to surface NFT (and other owned-object) transfers, which leave no balance change.
ValidatorInfo
WebsocketClient
Legacy JSON-RPC WebSocket subscription client.
WithdrawStakeTransaction
ZkLoginDeserializedSignature
ZkLoginPublicIdentifier
ZkLoginSignature
ZkLoginSignatureInputs

Enums

ExecuteTransaction
ExecutionStatusType
ObjectStatus
ObjectType
Ordering
SignatureScheme
SuiNetwork
Sui networks and their public full-node gRPC-web endpoints.
SuiNSType
SuiOwnerKind
Transport-neutral Dart models for the most common results, so callers don't depend on sui.rpc.v2 protobuf types directly. These map from the gRPC messages today; a GraphQL transport can populate the same shapes later.
TransactionKindName
UnserializedSignableTransaction
UpgradePolicy

Mixins

Keypair
A keypair used for signing transactions.
PublicKey
TxnDataSerializer

Extensions

GrpcTransactionExecutor on GrpcCoreClient
Builds, signs and executes a Transaction over gRPC without a legacy JSON-RPC client. Gas (price, coin selection, budget) is resolved by Transaction.build — server-side via simulate with doGasSelection.
LegacyNames on SuiGrpcClient
Source-compatibility bridge: exposes the legacy JsonRpcProvider / SuiClient method NAMES on top of the new gRPC client so existing call sites need minimal changes.

Properties

COIN_TYPE_ARG_REGEX RegExp
final
curve256k1Params → ECCurve_secp256k1
final
curve256r1Params → ECCurve_secp256r1
final
GAS_SAFE_OVERHEAD BigInt
final
NORMALIZE_SUI_TYPE_ARG String
final
SECP256R1_SPKI_HEADER Uint8List
Fixed DER SubjectPublicKeyInfo header for a secp256r1/prime256v1 key. The full SPKI is header || 0x04 || x || y (65-byte uncompressed point).
final
SUI_CLOCK_OBJECT_ID String
final
SUI_SYSTEM_STATE_OBJECT_ID String
final
VALID_BASE64_REGEX RegExp
final
zkLoginSignature → BcsType<Map<String, dynamic>, dynamic>
final

Functions

asIndices(int bitmap) Uint8List
base64UrlCharTo6Bits(String base64UrlChar) List<int>
base64UrlStringToBitVector(String base64UrlString) List<int>
bytesEqual(Uint8List a, Uint8List b) bool
chunk<T>(List<T> arr, int size) List<List<T>>
computeZkLoginAddressFromSeed(BigInt addressSeed, String iss) String
decodeBase64URL(String s, int i) String
decodeBigIntToUnsigned(List<int> magnitude) BigInt
decodeSuiPrivateKey(String value) → (SignatureScheme, Uint8List)
This returns an ParsedKeypair object based by validating the 33-byte Bech32 encoded string starting with suiprivkey, and parse out the signature scheme and the private key in bytes.
deriveDynamicFieldID(String parentId, String nameType, Uint8List nameBcs) String
Derive the object ID of a dynamic field on parentId with the given field name type (nameType, e.g. u64 or 0x2::foo::Bar) and BCS-encoded name value (nameBcs).
encodeBigInt(BigInt? number) Uint8List
encodeBigIntAsUnsigned(BigInt number) Uint8List
encodeSuiPrivateKey(Uint8List bytes, SignatureScheme scheme) String
This returns a Bech32 encoded string starting with suiprivkey, encoding 33-byte flag || bytes for the given the 32-byte private key and its signature scheme.
expectClient(BuildOptions options) TransactionBuilderClient
extractClaimValue<R>(Claim claim, String claimName) → R
findCommonPublicKey(List<PasskeyPublicKey> a, List<PasskeyPublicKey> b) PasskeyPublicKey
Returns the single public key present in both candidate lists; throws if there isn't exactly one common key.
findFirstNonZeroIndex(Uint8List bytes) int
generateMnemonic({int strength = 128}) String
getHexByteLength(String value) int
getIdFromCallArg(dynamic arg) → dynamic
getMoveObject(dynamic data) SuiMoveObject?
getMoveObjectType(SuiObjectResponse resp) String?
getMovePackageContent(dynamic data) MovePackageContent
getObjectDeletedResponse(SuiObjectResponse resp) SuiObjectRef?
getObjectFields(dynamic resp) MovePackageContent
getObjectOwner(SuiObjectResponse resp) ObjectOwner?
getObjectPreviousTransactionDigest(SuiObjectResponse resp) String?
getObjectReference(SuiObjectResponse resp) SuiObjectRef?
getObjectType(SuiObjectResponse resp) String?
getObjectVersion(dynamic data) int?
getRandom() → FortunaRandom
getSharedObjectInitialVersion(SuiObjectResponse resp) int?
getSharedObjectInput(dynamic arg) → dynamic
getSuiObjectData(SuiObjectResponse resp) SuiObject?
getTransactionKind(SuiTransactionBlockResponse data) → dynamic
getZkLoginSignature(ZkLoginSignature signature) String
getZkLoginSignatureBytes(ZkLoginSignature signature) Uint8List
graphqlEndpoint(SuiNetwork network) String
Public GraphQL RPC endpoint for a given network.
grpcWebEndpoint(SuiNetwork network) String
Base URL for the gRPC-web endpoint of a given network.
hasPublicTransfer(dynamic data) bool
isHex(String value) bool
isImmutableObject(SuiObjectResponse resp) bool
isMutableSharedObjectInput(dynamic arg) bool
isSharedObject(SuiObjectResponse resp) bool
isSharedObjectInput(dynamic arg) bool
isSuiObjectResponse(SuiObjectResponse resp) bool
isValidBIP32Path(String path) bool
Parse and validate a path that is compliant to BIP-32 in form m/54'/784'/{account_index}'/{change_index}/{address_index} for Secp256k1 and m/74'/784'/{account_index}'/{change_index}/{address_index} for Secp256r1.
isValidHardenedPath(String path) bool
Parse and validate a path that is compliant to SLIP-0010 in form m/44'/784'/{account_index}'/{change_index}'/{address_index}'.
isValidMnemonics(String mnemonics) bool
isValidSuiAddress(String value) bool
isValidSuiNSName(String name) bool
isValidSuiObjectId(String value) bool
isValidTransactionDigest(String value) bool
mnemonicToSeed(String mnemonics) Uint8List
Uses KDF to derive 64 bytes of key data from mnemonic with empty password.
mnemonicToSeedHex(String mnemonics) String
Derive the seed in hex format from mnemonic with empty password.
mvrEndpoint(SuiNetwork network) String?
Move Registry (MVR) HTTP endpoint for resolving @org/app names to package IDs / type tags. Only mainnet and testnet are served.
normalizeStructTag(StructTag type) String
normalizeStructTagString(String type) String
normalizeSuiAddress(String value, [bool forceAdd0x = false]) String
Perform the following operations:
normalizeSuiNSName(String name, [SuiNSType format = SuiNSType.at]) String
normalizeSuiObjectId(String value, [bool forceAdd0x = false]) String
normalizeTypeAddresses(String type) String
Pads every 0x-prefixed hex address inside a Move type string to the full 32-byte (64 hex) form, so short and long address forms compare equal.
padLeftUint8List(Uint8List data, [int len = 32]) Uint8List
parseDerSPKI(Uint8List derBytes) Uint8List
Parses a DER SubjectPublicKeyInfo into an uncompressed P-256 point (0x04 || x || y), verifying the fixed secp256r1 header.
parsePartialSignatures(MultiSigStruct multisig) List<ParsedPartialMultiSigSignature>
Parse multisig structure into an array of individual signatures: signature scheme, the actual individual signature, public key and its weight.
parseSerializedPasskeySignature(Uint8List signature) ParsedPasskeySignature
Parses flag(0x06) || BCS(PasskeyAuthenticator) into its fields.
parseSerializedSignature(String serializedSignature) SignaturePubkeyPair
parseStructTag(String type) StructTag
parseTypeTag(String type) → dynamic
parseZkLoginSignature(Uint8List signature) ZkLoginDeserializedSignature
prepareSuiAddress(String address) String
publicKeyFromRawBytes(String signatureScheme, Uint8List bytes) PublicKey
splitGenericParameters(String str, [(String, String) genericSeparators = ('<', '>')]) List<String>
toBigEndianBytes(BigInt num, int width) Uint8List
Derive bytearray from num where the bytearray is not padded with 0.
toPaddedBigEndianBytes(BigInt num, int width) Uint8List
Derive bytearray from num where the bytearray is padded to the left with 0s to the specified width.
toSerializedSignature(SignatureScheme signatureScheme, Uint8List signature, PublicKey pubKey) String
toZkLoginPublicIdentifier(BigInt addressSeed, String iss) ZkLoginPublicIdentifier
verifyExtendedClaim(String claim) → (dynamic, dynamic)

Exceptions / Errors

GraphQLException
GrpcWebException