{"id":26669,"library":"xtract-cli","title":"XTract","description":"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.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/XTract-build/Xtract","tags":["javascript","solidity","multiversx","transpiler","elrond","smart-contract","evm","rust","sdk","typescript"],"install":[{"cmd":"npm install xtract-cli","lang":"bash","label":"npm"},{"cmd":"yarn add xtract-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add xtract-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used by the TypeScript SDK for core MultiversX types and signing","package":"@multiversx/sdk-core","optional":true}],"imports":[{"note":"SDK classes are exported from the /sdk subpath, not the package root.","wrong":"import { XtractTranspiler } from 'xtract-cli'","symbol":"XtractTranspiler","correct":"import { XtractTranspiler } from 'xtract-cli/sdk'"},{"note":"Named export from /sdk subpath. Incorrect default import from root.","wrong":"import ContractDeployer from 'xtract-cli'","symbol":"ContractDeployer","correct":"import { ContractDeployer } from 'xtract-cli/sdk'"},{"note":"Package is ESM-only. CommonJS require with destructuring works but default import is preferred.","wrong":"const XtractTranspiler = require('xtract-cli/sdk').XtractTranspiler","symbol":"XtractTranspiler (default)","correct":"import XtractTranspiler from 'xtract-cli/sdk'"}],"quickstart":{"code":"// npm install xtract-cli\nimport { XtractTranspiler, ContractDeployer } from 'xtract-cli/sdk';\nimport { ProxyNetworkProvider, UserSigner } from '@multiversx/sdk-core';\n\n// Transpile\nconst transpiler = new XtractTranspiler();\nconst solidity = `contract Counter {\n    uint256 public count;\n    function increment() public {\n        count += 1;\n    }\n}`;\nconst result = await transpiler.transpileCode(solidity);\nconsole.log(result.rustCode);\n\n// Deploy (after building WASM manually)\nconst provider = new ProxyNetworkProvider('https://devnet-gateway.multiversx.com', { timeout: 10000 });\nconst signer = UserSigner.fromPem('path/to/wallet.pem');\nconst deployer = new ContractDeployer(provider, signer);\nconst address = await deployer.deploy({\n  wasmPath: './output/contract.wasm',\n  abiPath: './output/contract.abi.json',\n  gasLimit: 60000000,\n});\nconsole.log('Deployed at:', address);","lang":"typescript","description":"Transpile a simple Solidity counter contract to Rust and deploy the pre-built WASM to MultiversX devnet."},"warnings":[{"fix":"Change import to 'xtract-cli/sdk'.","message":"v1.0.0 moves SDK exports from root to /sdk subpath. Existing imports from 'xtract-cli' will break.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Update CI/CD pipelines to use the new CLI commands. Review changelog for full migration guide.","message":"CLI commands 'xtract build' and 'xtract deploy' are new in v1.0.0. No backward compatibility with v0.x deploy scripts.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Migrate to npm package xtract-cli@>=1.0.0.","message":"v0.x Python CLI 'xtract' is deprecated but still available on PyPI. New features added only to npm package.","severity":"deprecated","affected_versions":"<1.0.0"},{"fix":"Use hardware wallet or keep PEM file secure. For testnets, it's acceptable but avoid on mainnet.","message":"The 'xtract wallet create' command generates a PEM file that includes the private key in plaintext. Do not commit or share this file.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Install mxpy from https://docs.multiversx.com/sdk-and-tools/mxpy/","message":"Transpiled Rust code requires mxpy (MultiversX CLI) for building to WASM. The 'xtract build' command shells out to mxpy.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update Node.js to >=18.0.0.","message":"TypeScript SDK requires Node >=18. Will fail on older versions with cryptic errors.","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":"Change import path to 'xtract-cli/sdk'.","cause":"Importing from 'xtract-cli' instead of 'xtract-cli/sdk'.","error":"Cannot find module 'xtract-cli' or its corresponding type declarations."},{"fix":"Add 'type': 'module' to package.json or use .mjs extension.","cause":"Using ESM syntax in a CommonJS project without proper configuration.","error":"Module parse failed: The keyword 'import' is reserved"},{"fix":"npm install @multiversx/sdk-core@^13.0.0","cause":"Missing peer dependency when using SDK classes like ContractDeployer.","error":"Error: Cannot find module '@multiversx/sdk-core'"},{"fix":"Use named import: import { XtractTranspiler } from 'xtract-cli/sdk'.","cause":"Default import attempted on a named export.","error":"TypeError: XtractTranspiler is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}