sui_dart 0.9.1
sui_dart: ^0.9.1 copied to clipboard
A cross-platform SDK for Sui blockchain, supporting Mobile, Web and Desktop.
0.9.1 #
Fixed #
Transaction.toJson()encoded the raw block snapshot and threw "Converting object to an encodable object failed: Instance of 'TransactionData'".- Blocks whose commands reference an earlier command's result now serialize to
JSON.
TransactionResultwas not encodable, so bothtoJsonandtoJsonAsyncfailed on nearly every real transaction. Transaction.object()no longer resolves an argument onto an existing pure input. A value with no object id matched the first pure input, handing back a pure argument where an object was wanted and failing on chain withCommandArgumentError { kind: InvalidUsageOfPureArg }.
0.9.0 #
This release is breaking throughout: the JSON-RPC surface is gone and the
transport layer is unified behind SuiCoreClient.
Added #
SuiCoreClient, a transport-agnostic contract for reads, simulate, and execute, withGrpcCoreClientandGraphQLCoreClientimplementations reachable viaclient.coreonSuiGrpcClientandSuiGraphQLClient.- README "Choosing a Transport" comparison table.
Changed #
SuiGrpcClientread methods renamed to matchSuiCoreClient:listCoins/listOwnedObjects/listBalances/listDynamicFieldsare nowgetCoins/getOwnedObjects/getAllBalances/getDynamicFields.BuildOptions/SerializeTransactionOptions/SignOptionstakeclient: SuiCoreClient(passclient.core) instead ofresolutionClient. GraphQL building is read-only: move-call arguments aren't resolved.- Renamed
grpc/client.darttogrpc/sui_grpc_client.dartandgrpc/core.darttogrpc/grpc_core_client.dart.
Removed #
- JSON-RPC surface:
SuiClient,JsonRpcProvider,JsonRpcClient,WebsocketClient,RawSigner,SignerWithProvider,SerialTransactionExecutor,TxnDataSerializer. UseSuiGrpcClientorSuiGraphQLClient. TxResolutionClient/GrpcResolutionClientand the deprecatedlist*aliases onGrpcCoreClient.- Unused
MultiSig/PubkeyWeightPair(cryptography/multisig.dart) andSuiPure(bcs/sui_pure.dart). UseMultiSigPublicKeyandschemaFromName(builder/pure.dart).
0.0.1 #
- Initial version, created by Mofa Labs.
0.0.3 #
-
SuiNS
-
Websocket
-
Secp256r1
-
Programmable Transactions Block
0.0.4 #
- Add requestSuiFromFaucetV1
- Fix TransactionBlock decode json data
0.1.0 #
- Refactor JsonRpcProvider
- Add more rpc methods
- Update readme
0.1.1 #
- Add Events API
0.1.2 #
- Add Web Support
0.1.3 #
- Fix query gas object
- Fix setSigner
- Add Web Demo
0.1.4 #
- Fix TransactionBlock
- Rename ED25519 to Ed25519
0.1.5 #
- Fix TransactionBlock Input Type, Estimate Gas
0.1.6 #
- Add zkLogin
0.1.7 #
- Fix hex pad
0.2.0 #
- Add MultiSig
- Add zkLogin Test
0.2.1 #
- export bech32 private key
0.3.0 #
- Refactor Transaction & BCS
0.3.1 #
- Fix dio use default transformer
0.3.2 #
- Fix bugs
0.3.3 #
- Fix example
- Clean code
0.3.4 #
- Perf: resolve move modules
- Bump BCS
0.3.5 #
- Fix map equality in transaction arguments
0.3.6 #
- Fix parse subIndex failed
0.3.7 #
- Config request options
0.3.8 #
- Refactor: major
- Fix: Update GetDynamicFieldObjects param
- Fix: Remove Flutter dependency
0.3.9 #
- Feat: Handle devInspect both Transaction and build result
0.3.10 #
- Fix: Only set sender if transaction input is valid
0.4.0 #
- Feat: gRPC client integration (
SuiGrpcClient+GrpcCoreClient, transaction resolver, type converters, generated proto bindings) - Feat: Add
deriveDynamicFieldIdhelper for one-shot dynamic-field UID lookup - Feat: Add
toSuiObject()converter onGrpcObjectData - Feat: Support
FundsWithdrawalcase incallArgToGrpcInput - Feat: Protobuf value conversion functions for dynamic mapping in gRPC core
- Refactor: Align gRPC types with the canonical on-chain types
- Refactor: Replace untyped
Map<String, dynamic>/Map<String, bool>with typed classes in gRPC core - Refactor: Improved type safety in transaction handling across
GrpcCoreClientandSuiGrpcClient - Fix: Use
transaction.bcsinstead ofeffects.bcsinGrpcCoreClient - Fix: Cast
typeArgumentstoStringfor move calls incommandToGrpcCommand - Fix: Handle non-string version types in
callArgToGrpcInput - Chore: Update Sui URLs to include port 443; upgrade SDK to 3.11.0
- Chore: Upgrade
pointycastleto 4.0.0
0.4.1 #
- Chore: Swap
bip32/bip39forbip32_plus/bip39_plus(pointycastle ^4 compatible). Removes the need for apointycastledependency override in consumers.
0.5.0 #
- Chore: Update package metadata (
homepage,repository,issue_tracker). - Feat: Add an
example/demonstrating account creation, faucet funding, and balance lookup. - Chore: Tighten dependency lower bounds and widen
web_socket_channelto^3.0.3. - Refactor: Move platform-specific HTTP adapters under
lib/src/so the package reports correct platform support (Android, iOS, Windows, macOS, Linux). - Style: Resolve all
dart analyzewarnings — add public-API type annotations, remove dead code, and escape doc comments.
0.5.1 #
- Fix: Relax
metaconstraint to^1.18.0(was^1.18.3).^1.18.3cannot resolve on current Flutter stable, which pinsmeta 1.18.0; the package only uses@immutable.
0.6.0 #
Synced to f898c13.
Breaking #
computeZkLoginAddressFromSeedandtoZkLoginPublicIdentifiertake alegacyAddressnamed argument (defaults tofalse). Previously the two functions disagreed on seed encoding (unpadded vs padded), so the address derived from a seed did not match the address derived from the public identifier. PasslegacyAddress: truefor the deprecated legacy derivation.Ed25519Keypair.fromSecretKeynow validates the secret key by default (skipValidationdefaults tofalse).- BCS
ExecutionStatusvariantFailedrenamed toFailure; effects fieldcongestedObjectsrenamed tocongested_objects;UnchangedSharedKind(variantsMutateDeleted/ReadDeleted) renamed toUnchangedConsensusKind(MutateConsensusStreamEnded/ReadConsensusStreamEnded); effects fieldunchangedSharedObjectsrenamed tounchangedConsensusObjects.
Fixes #
- BCS:
Owner.ConsensusAddressOwnerfield order corrected to{startVersion, owner}(the previous order produced wrong bytes). - BCS:
TransactionEffectsis now an enum ({V1, V2}) instead of a struct; decoding effects as a struct read both versions back-to-back. - BCS: added the newer
ExecutionFailureStatusandCommandArgumentErrorvariants, plusObjectOut.AccumulatorWriteV1and the accumulator types, so current chain effects decode without out-of-range-tag errors. - Transaction builder:
isUsedAsMutableno longer marks nearly every shared-object input mutable (invertedMergeCoins/SplitCoinsconditions); shared-object mutability now also honors an explicitmutableflag. - Transaction builder:
splitCoins,mergeCoins,transferObjects, andmakeMoveVecnow accept string object IDs and route object-position arguments throughobject(). - Transaction builder:
Transaction.fromaccepts base64 BCS bytes in addition to JSON;getIdFromCallArgnormalizes unresolved object IDs. - Type parsing:
parseStructTagrejects malformed tags (empty components, trailing content);parseTypeTaghandlesvector<...>(includingvector<struct>);normalizeStructTagrejects top-level vector strings. isValidTransactionDigestnow validates Base58 (digests are Base58, not Base64).- zkLogin: the Google issuer is normalized consistently across address and public-identifier derivation;
ZkLoginPublicIdentifiergains legacy/non-legacy handling (legacyAddress,fromBytes({address, legacyAddress}),fromProof,verifyAddress). - Crypto: secp256k1/secp256r1 verification rejects non-canonical (high-S) signatures; point recovery uses the correct per-curve field prime (was hardcoded to secp256k1).
ed25519_hd_key.getPublicKey(withZeroByte: true)no longer crashes on the fixed-length buffer.
Added #
lib/cryptography/verify.dart:verifySignature/verifyPersonalMessageSignature/verifyTransactionSignature, their non-throwingisValid*variants, andpublicKeyFromSuiBytes.lib/utils/format.dart:parseToUnits,parseToMist,formatAddress,formatDigest.lib/utils/move_registry.dart:isValidNamedPackage,isValidNamedType.common.dart:isValidStructTag,isValidTypeTag,isValidMoveIdentifier.- BCS:
CallArg.FundsWithdrawal(withReservation/WithdrawalType/WithdrawFrom),TransactionExpiration.ValidDuring, and theObject/ObjectInner/MovePackageschema. FaucetClient.requestSuiFromFaucetV2(/v2/gas) withFaucetResponseV2;V0/V1/status methods are deprecated.PublicKey.verifyAddress;MultiSigPublicKey.getThreshold/getPublicKeys;Ed25519Keypair.deriveKeypairFromSeed;deriveObjectId; constantsSUI_RANDOM_OBJECT_ID,SUI_COIN_REGISTRY_OBJECT_ID,SUI_DENY_LIST_OBJECT_ID.
0.7.0 #
Synced to f898c13.
Fixed #
Transaction.serialize()no longer throwsConverting object to an encodable object failed.serializeV1TransactionDataleft the per-command argument/module lists as lazyIterables (.map(...)without.toList()), whichjsonEncodecannot encode; they are now materialized.
Added #
Signerbase class (lib/cryptography/signer.dart) — a transport-agnostic signing interface withsignTransaction/signPersonalMessagebuilt onsignWithIntent.ZkLoginSigner(lib/zklogin/signer.dart) — wraps an ephemeralKeypairand converts its signatures into zkLogin signatures using the proofinputs+maxEpoch. Optionaladdressvalidates the derived address against thelegacyAddressflag. Uses no Poseidon.MultiSigSigner(lib/multisig/multisig_signer.dart) — wraps aMultiSigPublicKeyand its member keypairs;signTransaction/signPersonalMessagecollect and combine the members' partial signatures. Validates membership, deduplication, and that the combined weight meets the threshold.jwtDecode(lib/zklogin/jwt_decode.dart) — decode a JWT's payload or header without signature verification (InvalidTokenErroron malformed input).getExtendedEphemeralPublicKey(lib/zklogin/utils.dart) — the flag-prefixed base64 ephemeral public key the zkLogin proving service expects.
gRPC #
- Regenerated
lib/grpc/generated/from the latest protobuf definitions.AccumulatorWritenow carries the authenticated-events shape (value_kind+integer_value/integer_tuple/event_digest_value, theEventDigestEntrymessage, and theAccumulatorValueenum);objectandtransaction_execution_servicemessages picked up their new fields. - Added the
ForkingService(sui/forking/v1alpha) client and exposed it asSuiGrpcClient.forkingService(admin-only; forsui-forkinstances).
0.8.0 #
Synced to f898c13.
Added #
- Passkey (WebAuthn) signature verification:
PasskeyPublicKeyandparseSerializedPasskeySignature(lib/cryptography/passkey_publickey.dart), withSignatureScheme.Passkey(flag0x06) wired intoparseSerializedSignature,publicKeyFromRawBytes, andpublicKeyFromSuiBytes. Verification reconstructs the WebAuthn signing payload and checks the inner secp256r1 signature against the embedded key. - Passkey signing (
lib/cryptography/passkey_keypair.dart):PasskeyKeypairplus aPasskeyProviderinterface the host app backs with a platform WebAuthn/credentials binding. Handles DER signature parsing, low-S normalization, deriving the secp256r1 key from the DERSubjectPublicKeyInfo, and assembling the serialized passkey signature;signAndRecover/findCommonPublicKeyidentify an existing passkey's key. Signing is async. coinWithBalance/createBalanceintents (lib/builder/intents/coin_with_balance.dart):tx.add(coinWithBalance({type, balance}))yields a coin (or balance) of an exact amount, with the sender's coins selected, merged, and split at build time. Backed by a new async intent-resolution pipeline (Transaction.addIntentResolver) andTransactionBlockDataBuilder.replaceCommand(which remaps argument indices after splicing). SUI uses the gas coin unlessuseGasCoin: false. Requires a client and sender. The address-balance withdrawal path is not used; surplus remains an owned coin.Transaction.toJsonAsync/prepareForSerialization/isPreparedForSerialization: async JSON serialization that resolves intents first (without requiring gas/sender), with asupportedIntentsoption to leave intents for the recipient to resolve. The synchronoustoJson()is unchanged.SerialTransactionExecutor(lib/builder/executor/serial_transaction_executor.dart): signs and executes transactions one at a time for a single account, reusing the gas coin from each transaction's effects so back-to-back transactions don't wait for indexing. Includes aSerialQueueutility. (Caches only the gas coin, not arbitrary owned-object versions; there is no parallel executor.)
0.8.1 #
Added #
- gRPC transaction building:
GrpcResolutionClient+BuildOptions.resolutionClientbuild transactions over gRPC (coin selection, object/gas/move resolution, dry-run viasimulateTransaction);TxResolutionClientabstracts the transport. Validated on mainnet. SuiGrpcClient:buildTransaction/signAndExecuteTransaction(end-to-end over gRPC) andgetDynamicFieldObject(thesuix_getDynamicFieldObjectequivalent).- gRPC
Eventexposesjsonalongsidebcs(u64 fields lose precision injson; decodebcs).
Fixed #
- gRPC
simulateTransaction(commandResults: true)/ devInspect now return Move call return values — the read mask omittedcommand_outputs, so the server returned none.
Deprecated #
- JSON-RPC layer (
SuiClient,JsonRpcClient,JsonRpcProvider,SignerWithProvider,RawSigner) in favor ofSuiGrpcClient; JSON-RPC sunsets ~July 2026. Still functional; removed in a future major.
0.8.2 #
Fixed #
- gRPC
simulateTransaction(events: true)/ devInspect now return emitted events — the read mask requestedeventsinstead oftransaction.events(events are nested undertransaction), so the server returned none.
0.8.3 #
Added #
ObjectIncludeOptions.display+ObjectData.display: gRPC object reads can fetch the rendered Sui Display (name,image_url, …) as aMap. Null when the type has no Display template.
0.8.4 #
Fixed #
- gRPC event reads: the events read mask used
transaction.events, which the node rejects as an invalid path (INVALID_ARGUMENT), sogetTransaction/executeTransaction/simulateTransaction(events: true)returned no events. Corrected to the top-leveleventsfield, verified against mainnet. Reverts the incorrect 0.8.2 change. - gRPC dry-run:
dryRunTransactionsimulated without requestingeffects, so auto gas-budget estimation had nogasUsedand a failed simulation reported success. It now requestseffects.
0.8.6 #
Added #
simulateTransactionacceptschecksEnabled. Passfalseto run the transaction checks as DISABLED (maps to the gRPCSimulateTransactionRequest.checksfield). When disabled, the node ignoresdoGasSelection, so an unfunded sender can simulate without gas.
0.8.7 #
Fixed #
- gRPC
simulateTransaction(events: true)returned no events, so event-driven read queries came back empty.SimulateTransactionResponsenests the executed transaction undertransaction, so simulate now builds its owntransaction.-prefixed read mask (_simulateReadMask), naming the derived per-event JSON explicitly, whilegetTransaction/executeTransactionkeep the top-leveleventsmask. This resolves the 0.8.2/0.8.4 flip-flop, where one shared mask could not satisfy both response shapes: 0.8.2 switched it totransaction.eventsand broke get/execute; 0.8.4 reverted toeventsand re-broke simulate.
Changed #
simulateTransactiondisables transaction checks by default whendoGasSelectionisfalse— a read-only simulate has no gas to satisfy gas checks. Gas-selecting simulations keep the node default so real gas/validity errors still surface; passchecksEnabledto override.
0.8.8 #
Added #
- Add
SuiGraphQLClientandGraphQLTransportwith custom queries, structured errors, partial data, cancellation, and cursor pagination. - Add generated typed operations for transaction and object history, gas summaries, events, epochs, validators, and stakes.
- Add a checked-in Sui GraphQL schema and schema-refresh tooling.