fuels-ts README

The project's README from github.com/FuelLabs/fuels-ts. As one markdown file: README.md.

fuels-ts

Typescript SDK for Fuel.

test docs npm discord

Install (docs)

npm install fuels --save

Connect (docs)

Network URL
Mainnet https://mainnet.fuel.network/v1/graphql
Testnet https://testnet.fuel.network/v1/graphql
Localhost Running a local Fuel node
import { Provider } from 'fuels';

const NETWORK_URL = 'https://mainnet.fuel.network/v1/graphql';

const provider = new Provider(NETWORK_URL);

const chainId = await provider.getChainId();
const gasConfig = await provider.getGasConfig();
const baseAssetId = await provider.getBaseAssetId();

console.log({ chainId, gasConfig, baseAssetId });

Create a new dApp (docs)

$ npm create fuels

◇ What is the name of your project? #
│ my-fuel-project
└

⚡️ Success! Created a fullstack Fuel dapp at: my-fuel-project.

Enjoy the fuels CLI (docs)

$ npm install fuels --save
$ npm fuels --help

Commands:
  init [options]      Create a sample `fuel.config.ts` file
  build [options]     Build Sway programs and generate Typescript for them
  deploy [options]    Deploy contracts to the Fuel network
  dev [options]       Start a Fuel node with hot-reload capabilities
  node [options]      Start a Fuel node using project configs
  typegen [options]   Generate Typescript from Sway ABI JSON files
  versions [options]  Check for version incompatibilities
  help [command]      Display help for command

In-depth docs:

Official Docs



Apps & Ecosystem

Get in Touch

Contribute

License

The primary license for this repo is Apache 2.0, see LICENSE.

fuels-ts (FuelLabs/fuels-ts)

Searching Database…

42.9K ·GitHub
What is this?fuels-ts is the official TypeScript SDK for Fuel Network, letting developers build dApps, interact with Sway smart contracts, and connect to Fuel nodes from JavaScript/TypeScript.
Is this a library or does it come with its own CLI?It is both: a TypeScript library you import into your app, and a bundled 'fuels' CLI for scaffolding, building, and deploying projects.
How do I start a new dApp with it?Install the SDK, then use the fuels CLI to create a new dApp and generate a fuels.config.ts file for your project.
Do I need the Fuel toolchain installed too?Yes, you need the Fuel toolchain (which includes Forc, the Sway compiler) installed separately, since the CLI builds Forc workspaces into TypeScript types.
What Node.js version does it require?It requires Node.js 20, 22, or 24, and pnpm 9.4 or later as the package manager for the monorepo.
Which networks can I connect to?You can connect to Fuel Mainnet, Testnet, or a Localhost node you run yourself.
Can I run a local Fuel node for development with this CLI?Yes, the 'fuels dev' command starts a Fuel node with hot-reload capabilities, useful for local development.
How do I deploy my Sway contracts?Use 'fuels deploy' to deploy your workspace contracts and automatically save their contract IDs to a JSON file for use in your app.
Is there a related wallet SDK for Fuel?Yes, Fuel maintains a separate Fuel Wallet SDK alongside this Typescript SDK, Rust SDK, and other ecosystem tools like Forc and Fuel Core.
Creator
FuelLabs
Size
112.4 MB
Stars
42.9K
Age
5y
Commits · 90 Days