TypeScript SDK
V1 Migration

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 from version should we remove this completely
  • ObjectArg: ImmOrOwned -> ImmOrOwnedObject and Shared -> SharedObject
  • Added ObjectCallArg
  • PureArg Changed ArrayLike to Array not sure if this is correct

Bcs Types

  • CallArg removed ObjVec
  • Argument enumKind to enum, Removed nested structs to align with Rust definitions
  • ProgrammableMoveCall Split target into package, module and function, typeArguments now TypeTag instead of String
  • Transaction enumKind to enum, replaced nested structs with tuples to align with Rust definitions
  • Removed some type exports
  • Use typeof bcs.XYZ.$inferType instead

/transactions

Types

  • TransactionObjectArgument shape changed
  • TransactionResult shape changed
  • TransactionObjectInput shape changed
  • TransactionArgument shape changed
  • TransactionBlockInput -> TransactionInput and shape changed

Transaction

  • renamed TransactionBlock to Transaction
  • blockData is 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 size to initialSize in 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?