{"id":26448,"library":"sui-ts-transpiler","title":"sui-ts-transpiler","description":"A CLI tool and SDK that converts TypeScript smart contracts to Sui Move language with full logic preservation (not just structural mapping). v1.0.0 targets Node >=16 and ships TypeScript declarations. It provides a `sui-ts` CLI for project scaffolding (`init`), transpilation (`transpile`), building (`build`), and sample generation. Key differentiators: complete logic conversion vs. syntax-only mappers, automatic Sui-specific type mapping (e.g., `constructor()` → `create_*()`), and programmatic SDK support via `SuiMoveTranspiler` class. Active development under @gsui-team.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/gsui-team/sui-ts-transpiler","tags":["javascript","sui","move","typescript","blockchain","transpiler","smart-contracts","web3"],"install":[{"cmd":"npm install sui-ts-transpiler","lang":"bash","label":"npm"},{"cmd":"yarn add sui-ts-transpiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add sui-ts-transpiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Requires Node.js >=16.0.0 (engines field). CLI or SDK will fail on older versions.","package":"node","optional":false}],"imports":[{"note":"Package uses named export for the transpiler class; default import is not supported.","wrong":"import SuiMoveTranspiler from 'sui-ts-transpiler'","symbol":"SuiMoveTranspiler","correct":"import { SuiMoveTranspiler } from 'sui-ts-transpiler'"},{"note":"CLI command is `sui-ts`, not the package name. Global install via npm -g sui-ts-transpiler provides the bin.","wrong":"sui-ts-transpiler init my-project","symbol":"sui-ts CLI","correct":"sui-ts init my-project"},{"note":"This type is exported for configuring the transpiler programmatically. Not documented in the snippet but present in .d.ts files.","wrong":"","symbol":"MoveTranspilerOptions","correct":"import { MoveTranspilerOptions } from 'sui-ts-transpiler'"}],"quickstart":{"code":"npm install -g sui-ts-transpiler\nsui-ts init my-sui-project\ncd my-sui-project\nnpm install\ncat > src/contract.ts << 'EOF'\nclass Counter {\n    private value: number;\n    private owner: Address;\n    constructor(owner: Address) {\n        this.value = 0;\n        this.owner = owner;\n    }\n    public increment(): void {\n        this.value = this.value + 1;\n    }\n    public getValue(): number {\n        return this.value;\n    }\n}\nEOF\nsui-ts transpile\nls out/","lang":"typescript","description":"Installs the transpiler globally, creates a new project, writes a simple TypeScript contract, transpiles it, and lists the generated Move files."},"warnings":[{"fix":"Use `sui-ts init <project>` or alias `npx sui-ts-transpiler` if needed.","message":"CLI command is `sui-ts` not `sui-ts-transpiler`. Users often try `sui-ts-transpiler init` which fails.","severity":"gotcha","affected_versions":"all"},{"fix":"Use npx: `npx sui-ts-transpiler init <project>` or install locally as devDependency.","message":"Global install may conflict with other Sui tooling if `sui-ts` is already used by another package.","severity":"breaking","affected_versions":"all"},{"fix":"Use `bigint` for values exceeding 2^53-1. The transpiler maps `bigint` to `u256`.","message":"Number → u64, but Move's u64 is unsigned and 64-bit. Large numbers (>2^53-1) lose precision in JS; the compiler may silently truncate.","severity":"gotcha","affected_versions":"all"},{"fix":"Prefer `--verbose` in scripts for forward compatibility.","message":"Package uses `-v` for verbose. Future versions may change to `--verbose` only.","severity":"deprecated","affected_versions":"1.0.0"},{"fix":"Use PascalCase class names that are also valid Move identifiers (no leading underscores).","message":"Constructor transpiles to a create function named after the class (e.g., `create_counter`). If the class name is not a valid Move identifier (e.g., starts with underscore), the generated name may conflict.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install globally: `npm install -g sui-ts-transpiler` or locally: `npm install --save-dev sui-ts-transpiler`.","cause":"Trying to require or import the package without installing it.","error":"Error: Cannot find module 'sui-ts-transpiler'"},{"fix":"Install globally: `npm install -g sui-ts-transpiler`. If still not found, check npm global bin directory or use npx: `npx sui-ts-transpiler`.","cause":"Global installation missing or not on PATH.","error":"sui-ts: command not found"},{"fix":"Ensure string values are UTF-8 encoded. For complex strings, use `vector<u8>` directly in TS with `new Uint8Array([...])`.","cause":"Using TypeScript `string` type which maps to `vector<u8>` in Move, but the transpiler expects a specific format.","error":"Error: Type 'string' is not assignable to type 'vector<u8>'"},{"fix":"Run `sui-ts build` which generates a proper Move.toml and directory structure, then publish from `out/`.","cause":"Output directory structure mismatch when publishing; Move expects specific package layout.","error":"Error: Module 'contract' not found in package 'sui_contract'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}