{"id":26446,"library":"sui-ts-transpiler-advanced","title":"sui-ts-transpiler-advanced","description":"A CLI tool and SDK (v1.0.0) that converts TypeScript smart contracts to Sui Move language with full logic preservation, not just structural mapping. Released as an initial stable version, it offers commands for project init, transpilation, and build. Key differentiators include support for classes, type mappings (string→vector<u8>, number→u64, bigint→u256), and programmatic usage via import. Suitable for developers working with Sui blockchain who prefer TypeScript over Move.","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-advanced","lang":"bash","label":"npm"},{"cmd":"yarn add sui-ts-transpiler-advanced","lang":"bash","label":"yarn"},{"cmd":"pnpm add sui-ts-transpiler-advanced","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"For transpiling TypeScript source code","package":"typescript","optional":true}],"imports":[{"note":"ESM-only; CJS require not supported in v1.0.0","wrong":"const SuiMoveTranspiler = require('sui-ts-transpiler-advanced')","symbol":"SuiMoveTranspiler","correct":"import { SuiMoveTranspiler } from 'sui-ts-transpiler-advanced'"},{"note":"Default export available; named import also works but default is preferred for single-class usage","wrong":"import { SuiMoveTranspiler } from 'sui-ts-transpiler-advanced'","symbol":"default","correct":"import SuiMoveTranspiler from 'sui-ts-transpiler-advanced'"},{"note":"Type-only import for TypeScript; no runtime value","symbol":"SuiMoveTranspilerOptions","correct":"import type { SuiMoveTranspilerOptions } from 'sui-ts-transpiler-advanced'"}],"quickstart":{"code":"import { SuiMoveTranspiler } from 'sui-ts-transpiler-advanced';\n\nconst transpiler = new SuiMoveTranspiler({\n  outputDir: 'build',\n  moduleName: 'my_contract',\n  packageName: 'my_package'\n});\n\nconst tsCode = `\nclass Token {\n  private name: string;\n  private supply: number;\n  \n  constructor(name: string, supply: number) {\n    this.name = name;\n    this.supply = supply;\n  }\n}\n`;\n\nconst result = transpiler.transpile(tsCode);\n\nif (result.success) {\n  console.log('Generated Move code:', result.moveCode);\n} else {\n  console.error('Errors:', result.errors);\n}","lang":"typescript","description":"Programmatic usage of sui-ts-transpiler-advanced to transpile a TypeScript class to Sui Move"},"warnings":[{"fix":"Upgrade Node.js to version 16+.","message":"Requires Node >=16.0.0; lower versions will fail to load the package.","severity":"breaking","affected_versions":"<16.0.0"},{"fix":"Use import syntax or dynamic import() instead of require().","message":"ESM-only package; attempting require() will throw ERR_REQUIRE_ESM.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use DEBUG=sui-ts-transpiler sui-ts transpile instead of -v/--verbose.","message":"The --verbose flag is deprecated in favor of environment variable DEBUG=sui-ts-transpiler.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"All class fields become public struct fields in Move; adjust security assumptions.","message":"TypeScript private fields are not transpiled to Move private fields; Move uses module-level visibility.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Convert your file to ES module (use 'type': 'module' in package.json) or use dynamic import() instead.","cause":"Package is ESM-only; CommonJS require() is not supported.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/sui-ts-transpiler-advanced/index.js from /path/to/file.js not supported."},{"fix":"Add 'type': 'module' to your package.json or rename file to .mjs.","cause":"The import statement is used in a CommonJS file.","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Use 'new SuiMoveTranspiler(options)' instead of calling it as a function.","cause":"SuiMoveTranspiler must be instantiated with the new keyword; it is not a factory function.","error":"TypeError: Class constructor SuiMoveTranspiler cannot be invoked without 'new'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}