Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

sui-kit

> 编程语言
Open source

Toolkit for interacting with SUI network in typescript

189 stars0 likes0 views
WebsiteGitHub

About

Toolkit for interacting with SUI network in typescript

Toolkit for interacting with SUI network

Features

  • Transfer SUI, Custom Coin and objects.
  • Move call
  • Programmable transaction
  • Query on-chain data
  • HD wallet multi-accounts

Pre-requisites

@mysten/sui is a peer dependency, so install it alongside sui-kit:

bash
npm install @scallop-io/sui-kit @mysten/sui

How to use

Init SuiKit

…

Transfer

You can use SuiKit to transfer SUI, custom coins, and any objects.

…

Stake SUI

You can use SuiKit to stake SUI.

typescript
/**
 * This is an example of using SuiKit to stake SUI
 */
const stakeAmount = 1000;
const validatorAddress = '0x123'; // replace with real address
suiKit.stakeSui(stakeAmount, validatorAddress).then(() => {
  console.log('Stake SUI success');
});

Move call

You can use SuiKit to call move functions.

typescript
const res = await suiKit.moveCall({
  target: '0x2::coin::join',
  arguments: [coin0, coin1],
  typeArguments: [coinType],
});
console.log(res);

How to pass arguments? Suppose you have a move function like this:

move
public entry fun test_args(
  addrs: vector,
  name: vector,
  numbers: vector,
  bools: vector,
  coins: vector>,
  ctx: &mut TxContext,
) {
  // ...
}

You can pass the arguments like this:

…

All the supported types are:

  • address
  • u8
  • u16
  • u32
  • u64
  • u128
  • u256
  • bool
  • object

Programmable transaction

With programmable transaction, you can send a transaction with multiple actions. The following is an example using flashloan to make arbitrage. (check here for the corresponding Move contract code)

…

SuiTxBlock and Transaction

SuiTxBlock extends Transaction from @mysten/sui, so every base method and property is available directly on it — there is no wrapped .txBlock to reach through.

typescript
const tx = new SuiTxBlock();
tx.setSender(sender);
const coin = tx.object('');
const [amount] = tx.splitCoins(tx.gas, [1000]);
const bytes = await tx.build({ client: suiKit.client });

You can also copy or restore a transaction as a SuiTxBlock:

typescript
import { Transaction } from '@mysten/sui/transactions';

// copy an existing Transaction (or SuiTxBlock)
const copy = new SuiTxBlock(new Transaction());
// restore from `toJSON()` output or BCS transaction bytes
const restored = SuiTxBlock.from(await tx.toJSON());
// restore from transaction kind bytes
const kind = SuiTxBlock.fromKind(
  await tx.build({ client: suiKit.client, onlyTransactionKind: true })
);

The overridden helpers accept sui-kit's looser argument types, so object ids, object refs and shared object refs work anywhere an object is expected:

typescript
tx.splitCoins({ objectId: '', version: '1', digest: '' }, [1000]);
tx.mergeCoins('', ['', '']);
tx.transferObjects([''], recipient);

Two differences from the base class to keep in mind:

  • moveCall takes positional arguments (target, args, typeArgs) as shown above; the base { target, arguments, typeArguments } object form is not accepted.
  • Because moveCall narrows the base signature, TypeScript may require a cast when passing a SuiTxBlock to an API typed as Transaction. SuiKit methods such as signTxn, signAndSendTxn, dryRunTxn and inspectTxn accept it directly.

Multi-accounts

SuiKit follows bip32 & bip39 standard, so you can use it to manage multiple accounts. When init SuiKit, you can pass in your mnemonics to create a wallet with multiple accounts.

…

Publish & upgrade Move package

We have a standalone npm package to help you publish and upgrade Move package based on sui-kit.

Please refer to the repository: sui-package-kit

Migration Guide

If you're upgrading from v1.x to v2.0.0, please refer to the Migration Guide.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptsuitypescript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言