OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Func Js

Func Js is an open-source package that combines the TON FunC compiler and Fift interpreter in a WebAssembly library, exposing JavaScript and TypeScript bindings and a CLI. It compiles FunC smart-contract source into BOC code cells and can return the generated Fift assembly for debugging.

Independent OpenViST project profile, based on linked sources.

Func Js — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Func Js when a TON development workflow needs FunC compilation from JavaScript, TypeScript, a WebAssembly-capable browser, or the command line, especially when BOC output or assembly for debugging is needed.

Who it is for

  • TON smart-contract developers working with FunC source
  • JavaScript and TypeScript developers adding FunC compilation to a project build
  • Developers creating browser-based tools that compile FunC using WebAssembly

Documented uses

  • Compile FunC target files and their included sources into BOC code-cell output
  • Add compilation to a Node.js or browser-based JavaScript/TypeScript workflow
  • Produce a BOC file from source files through the CLI
  • Inspect generated Fift assembly while debugging compilation
Before you choose

Requirements & limits

The repository identifies the package as open source under the MIT License.

  • Browser use requires WebAssembly support; Node.js is also documented.
  • Compilation inputs must include targets and every required included FunC source.
  • The library supports source maps, arrays, or a synchronous source resolver; the resolver must return source text.
  • The package produces compilation artifacts and assembly; the cited documentation does not describe a deployment workflow.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Compile FunC source with the CLI

Produce a BOC file from FunC source files using the documented command-line interface.

Before you start

  • Node.js/npm tooling for the documented npx command
  • FunC source files, including required included files such as stdlib.fc when used

Steps

  1. Run the command below, substituting the source and output paths for your project.

    Documented command
    npx func-js ./stdlib.fc ./wallet.fc --boc ./output.boc
  2. Use the command below to review other available output options.

    Documented command
    npx func-js -h

Expected outcome

The CLI is instructed to write compiled BOC output to the specified path.

Guide limitations

  • The example command documents file-based CLI use; it does not describe deployment or execution of the resulting contract.
Source-based practical guide

Install the library and prepare a compilation call

Add the package to a JavaScript or TypeScript project and provide the source inputs required by its compiler API.

Before you start

  • A Node.js or browser environment with WebAssembly support
  • Target FunC source and all required included source files

Steps

  1. Install @ton-community/func-js with yarn add @ton-community/func-js or the command below.

    Documented command
    npm i @ton-community/func-js
  2. Import compileFunc and call it with target filenames and a source map, or provide sources as an array of filename/content entries.

  3. If using a source array, omit targets to use its filenames in order; otherwise specify targets explicitly.

Expected outcome

The documented API returns compilation status and, on success, a base64-encoded BOC code cell plus Fift assembly.

Guide limitations

  • All target and included source contents must be supplied or resolvable.
  • A resolver must be synchronous and return a string; the guide describes setup and inputs, not a tested build or deployment.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
10 October 2026
Original website title
ton-community/func-js · Official homepage title · retained in its source language