TS SDK v1.0.0 Migration Guide
This migration guide covers changes and new features for the Sui TS SDK, and well as related changes
to @mysten/bcs and @mysten/dapp-kit.
@mysten/sui
Ad part of the 1.0 release the @mysten/sui.js package has been renamed to @mysten/sui
/bcs
Types
SuiObjectRef: removing bigint fromversionshould we remove this completelyObjectArg:ImmOrOwned->ImmOrOwnedObjectandShared->SharedObject- Added
ObjectCallArg PureArgChanged ArrayLike to Array not sure if this is correct
Bcs Types
CallArgremovedObjVecArgumentenumKind to enum, Removed nested structs to align with Rust definitionsProgrammableMoveCallSplit target intopackage,moduleandfunction, typeArguments now TypeTag instead of StringTransactionenumKind to enum, replaced nested structs with tuples to align with Rust definitions- Removed some type exports
- Use typeof bcs.XYZ.$inferType instead
/transactions
Types
TransactionObjectArgumentshape changedTransactionResultshape changedTransactionObjectInputshape changedTransactionArgumentshape changedTransactionBlockInput->TransactionInputand shape changed
Transaction
- renamed
TransactionBlocktoTransaction blockDatais deprecated, returns snapshot of v1 blockData, should this be removed?- added getBlockData that returns new v2 blockData
- removed tx.pure(rawValue)
- Added support for (tx) => input as transaction arguments
- renamed packageId -> package in Upgrade command
- makeMoveVec
objects->elements
exports
- getPureSerializationType removed
- added getPureBcsSchema, normalizedTypeToMoveTypeSignature
/utils
Removed is and assert helpers
/multisig
- publicKeyFromSuiBytes moved to /verify
/verify
- verifyTransactionBlock -> verifyTransactionBlockSignature
- verifyPersonalMessage -> verifyPersonalMessageSignature
/cryptography
- Removed intent enum exports (use bcs instead)
@mysten/bcs
- removed registry
- default maxSize of writer = Infinity
- renamed
sizetoinitialSizein writer - signPersonalMessage fix returned bytes to not be wrapped
dapp-kit
- changed useSignAndExecuteTransactionBlock
- transactions are now executed in wallets rather than in dapps by default
TODO:
- rename transactions to commands?