Registry / devops / xtract-cli

xtract-cli

JSON →
library1.0.0jsnpmunverified

Solidity to MultiversX smart contract transpiler with CLI and TypeScript SDK. As of v1.0.0 (released 2025), XTract also includes wallet creation, WASM build via mxpy, and deployment to devnet/testnet/mainnet. It supports full Solidity function bodies, mappings (including nested), modifiers, inheritance, events, require/revert, and control flow. The npm package xtract-cli ships TypeScript types and a SDK (XtractTranspiler, ContractDeployer) for programmatic use. Peer dependency on @multiversx/sdk-core >=13.0.0. Node >=18 required.

npm install xtract-cli
INSTALL
IMPORT
SIG · XTRACT-CLI
X
xtract-cli
devopsjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

XtractTranspiler
import { XtractTranspiler } from 'xtract-cli/sdk'
import { XtractTranspiler } from 'xtract-cli'
SDK classes are exported from the /sdk subpath, not the package root.
ContractDeployer
import { ContractDeployer } from 'xtract-cli/sdk'
import ContractDeployer from 'xtract-cli'
Named export from /sdk subpath. Incorrect default import from root.
XtractTranspiler (default)
import XtractTranspiler from 'xtract-cli/sdk'
const XtractTranspiler = require('xtract-cli/sdk').XtractTranspiler
Package is ESM-only. CommonJS require with destructuring works but default import is preferred.

Transpile a simple Solidity counter contract to Rust and deploy the pre-built WASM to MultiversX devnet.

// npm install xtract-cli import { XtractTranspiler, ContractDeployer } from 'xtract-cli/sdk'; import { ProxyNetworkProvider, UserSigner } from '@multiversx/sdk-core'; // Transpile const transpiler = new XtractTranspiler(); const solidity = `contract Counter { uint256 public count; function increment() public { count += 1; } }`; const result = await transpiler.transpileCode(solidity); console.log(result.rustCode); // Deploy (after building WASM manually) const provider = new ProxyNetworkProvider('https://devnet-gateway.multiversx.com', { timeout: 10000 }); const signer = UserSigner.fromPem('path/to/wallet.pem'); const deployer = new ContractDeployer(provider, signer); const address = await deployer.deploy({ wasmPath: './output/contract.wasm', abiPath: './output/contract.abi.json', gasLimit: 60000000, }); console.log('Deployed at:', address);
xtract --version
Debug
Known issues
breakingv1.0.0 moves SDK exports from root to /sdk subpath. Existing imports from 'xtract-cli' will break.
fix
Change import to 'xtract-cli/sdk'.
affects: <1.0.0
breakingCLI commands 'xtract build' and 'xtract deploy' are new in v1.0.0. No backward compatibility with v0.x deploy scripts.
fix
Update CI/CD pipelines to use the new CLI commands. Review changelog for full migration guide.
affects: <1.0.0
deprecatedv0.x Python CLI 'xtract' is deprecated but still available on PyPI. New features added only to npm package.
fix
Migrate to npm package xtract-cli@>=1.0.0.
affects: <1.0.0
gotchaThe 'xtract wallet create' command generates a PEM file that includes the private key in plaintext. Do not commit or share this file.
fix
Use hardware wallet or keep PEM file secure. For testnets, it's acceptable but avoid on mainnet.
affects: >=1.0.0
gotchaTranspiled Rust code requires mxpy (MultiversX CLI) for building to WASM. The 'xtract build' command shells out to mxpy.
fix
Install mxpy from https://docs.multiversx.com/sdk-and-tools/mxpy/
affects: >=1.0.0
gotchaTypeScript SDK requires Node >=18. Will fail on older versions with cryptic errors.
fix
Update Node.js to >=18.0.0.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'xtract-cli' or its corresponding type declarations.
Importing from 'xtract-cli' instead of 'xtract-cli/sdk'.
fix
Change import path to 'xtract-cli/sdk'.
Module parse failed: The keyword 'import' is reserved
Using ESM syntax in a CommonJS project without proper configuration.
fix
Add 'type': 'module' to package.json or use .mjs extension.
Error: Cannot find module '@multiversx/sdk-core'
Missing peer dependency when using SDK classes like ContractDeployer.
fix
npm install @multiversx/sdk-core@^13.0.0
TypeError: XtractTranspiler is not a constructor
Default import attempted on a named export.
fix
Use named import: import { XtractTranspiler } from 'xtract-cli/sdk'.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
@multiversx/sdk-coreoptionalUsed by the TypeScript SDK for core MultiversX types and signing
Agent activity
40 hits · last 30 days
node
34
Resources
xtract-cli — npm install xtract-cli · libregistry