sui
library
Functions
argumentToGrpcArgument (Map <String , dynamic > arg )
→ Argument
asIndices (int bitmap )
→ Uint8List
base64UrlCharTo6Bits (String base64UrlChar )
→ List <int >
base64UrlStringToBitVector (String base64UrlString )
→ List <int >
bytesEqual (Uint8List a , Uint8List b )
→ bool
callArgToGrpcInput (Map <String , dynamic > arg )
→ Input
chunk <T > (List <T > arr , int size )
→ List <List <T > >
coinWithBalance ({required dynamic balance , String ? type , bool useGasCoin = true })
→ CoinWithBalanceBuilder
Returns a coin of type holding exactly balance, selecting and merging the
sender's coins at build time. For SUI, the gas coin is used unless
useGasCoin is false. Requires a client and a sender on the transaction.
commandToGrpcCommand (Map cmd )
→ Command
computeZkLoginAddressFromSeed (BigInt addressSeed , String iss , {bool legacyAddress = false })
→ String
createBalance ({required dynamic balance , String ? type , bool useGasCoin = true })
→ CoinWithBalanceBuilder
Like coinWithBalance but yields a Balance<T> instead of a Coin<T>.
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 ({required String parentObjectId , required String keyTypeTag , required Uint8List keyBcs })
→ String
Deterministic UID of a dynamic field, for direct getObject(uid).
BLAKE2b-256 of 0xf0 || parent (32) || keyLen (u64 LE) || keyBcs || typeTagBcs (order is wire-significant).
deriveObjectId ({required String parentObjectId , required String typeTag , required Uint8List key })
→ String
Derive the ID of a derived_object. key is BCS-encoded key bytes; typeTag is its Move type.
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 )
→ SuiCoreClient
findCommonPublicKey (List <PasskeyPublicKey > a , List <PasskeyPublicKey > b )
→ PasskeyPublicKey
Returns the single public key present in both lists, throwing if there is not
exactly one. Used with two PasskeyKeypair.signAndRecover results.
findFirstNonZeroIndex (Uint8List bytes )
→ int
formatAddress (String address )
→ String
Shorten an address to 0xXXXX…XXXX for display.
formatDigest (String digest )
→ String
Shorten a digest to its first 10 characters followed by an ellipsis.
generateMnemonic ({int strength = 128 })
→ String
getExtendedEphemeralPublicKey (PublicKey publicKey )
→ String
Flag-prefixed base64 ephemeral public key expected by the proving service.
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
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
isValidMoveIdentifier (String name )
→ bool
isValidNamedPackage (String name )
→ bool
Whether name is a valid Move Registry (MVR) package name, e.g.
@org/app or @org/app/1.
isValidNamedType (String type )
→ bool
Whether type contains valid named packages and is a valid Move struct tag.
isValidParsedStructTag (StructTag tag )
→ bool
isValidPersonalMessageSignature (Uint8List message , String signature , {String ? address })
→ bool
Like isValidSignature , for a personal message.
isValidSignature (Uint8List bytes , String signature , {String ? address })
→ bool
Whether signature is valid over bytes (and matches address if given).
Returns false instead of throwing on malformed/invalid signatures.
isValidStructTag (String type )
→ bool
isValidSuiAddress (String value )
→ bool
isValidSuiNSName (String name )
→ bool
isValidSuiObjectId (String value )
→ bool
isValidTransactionDigest (String value )
→ bool
True if value is a valid tx digest (Base58-encoded 32 bytes).
isValidTransactionSignature (Uint8List transaction , String signature , {String ? address })
→ bool
Like isValidSignature , for transaction bytes.
isValidTypeTag (String type )
→ bool
jwtDecode (String token , { })
→ Map <String , dynamic >
Decode a JWT without verifying its signature. Returns the payload, or the
header when header is true.
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.
normalizeStructTag (StructTag type )
→ String
normalizeStructTagString (String type )
→ String
normalizeSuiAddress (String value , [bool forceAdd0x = false ])
→ String
Lowercases, prepends 0x, and left-pads to SUI_ADDRESS_LENGTH.
normalizeSuiNSName (String name , [SuiNSType format = SuiNSType.at ])
→ String
normalizeSuiObjectId (String value , [bool forceAdd0x = false ])
→ String
normalizeZkLoginIssuer (String iss )
→ String
Normalize a zkLogin issuer: accounts.google.com -> https://accounts.google.com.
padLeftUint8List (Uint8List data , [int len = 32 ])
→ Uint8List
parseDerSPKI (Uint8List der )
→ Uint8List
Parses a DER SubjectPublicKeyInfo into the uncompressed point
(0x04 || x || y), verifying the curve is secp256r1 (P-256).
parsePartialSignatures (MultiSigStruct multisig )
→ List <ParsedPartialMultiSigSignature >
Parses a multisig into its individual signatures (scheme, signature, public key, weight).
parseSerializedPasskeySignature (dynamic signature )
→ ParsedPasskeySignature
Parses a serialized passkey signature (flag 0x06 || BCS(PasskeyAuthenticator)),
from raw bytes or a base64 string, into its component fields.
parseSerializedSignature (String serializedSignature )
→ SignaturePubkeyPair
parseStructTag (String type )
→ StructTag
parseToMist (String amount )
→ BigInt
Parse a SUI decimal string into MIST.
parseToUnits (String amount , int decimals )
→ BigInt
Parse a decimal string to smallest-unit BigInt (pure BigInt, no float).
parseTypeTag (String type )
→ dynamic
parseZkLoginSignature (Uint8List signature )
→ ZkLoginDeserializedSignature
prepareSuiAddress (String address )
→ String
publicKeyFromRawBytes (String signatureScheme , Uint8List bytes , {String ? address })
→ PublicKey
publicKeyFromSuiBytes (dynamic publicKey , {String ? address })
→ PublicKey
Decode a flag-prefixed public key (base64 or raw bytes); inverse of
PublicKey.toSuiPublicKey .
resolveCoinBalance (TransactionBlockDataBuilder transactionData , BuildOptions options , Future <void > next () )
→ Future <void >
Resolves all COIN_WITH_BALANCE intents in transactionData into concrete
merge/split commands.
splitGenericParameters (String str , [(String , String ) genericSeparators = ('<', '>') ])
→ List <String >
toBigEndianBytes (BigInt num , int width )
→ Uint8List
Big-endian bytes of num with leading zeros stripped.
toIterableGrpcArguments (List ? args )
→ List <Argument >
toPaddedBigEndianBytes (BigInt num , int width )
→ Uint8List
Big-endian bytes of num, left-padded with zeros to width.
toSerializedSignature (SignatureScheme signatureScheme , Uint8List signature , PublicKey pubKey )
→ String
toZkLoginPublicIdentifier (BigInt addressSeed , String iss , {bool legacyAddress = false })
→ ZkLoginPublicIdentifier
transactionDataToGrpcTransaction (TransactionData data )
→ Transaction
verifyExtendedClaim (String claim )
→ (dynamic , dynamic )
verifyPersonalMessageSignature (Uint8List message , String signature , {String ? address })
→ PublicKey
Like verifySignature , for a personal message.
verifySignature (Uint8List bytes , String signature , {String ? address })
→ PublicKey
Verify signature over bytes, returning the recovered PublicKey .
Throws if invalid or mismatched with address.
verifyTransactionSignature (Uint8List transaction , String signature , {String ? address })
→ PublicKey
Like verifySignature , for transaction bytes.