๐Ÿ“ฆ FuelLabs / fuels-ts

Fuel Network Typescript SDK

โ˜… 43.4k stars โ‘‚ 1.4k forks ๐Ÿ‘ 43.4k watching โš–๏ธ Apache License 2.0
fueltypescript
๐Ÿ“ฅ Clone https://github.com/FuelLabs/fuels-ts.git
HTTPS git clone https://github.com/FuelLabs/fuels-ts.git
SSH git clone git@github.com:FuelLabs/fuels-ts.git
CLI gh repo clone FuelLabs/fuels-ts
Loading files...
๐Ÿ“„ README.md

fuels-ts

Typescript SDK for Fuel.

test docs npm discord

Install (docs)

npm install fuels --save

Connect (docs)

NetworkURL
Mainnethttps://mainnet.fuel.network/v1/graphql
Testnethttps://testnet.fuel.network/v1/graphql
LocalhostRunning 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:

  • fuels init โ€” Creates a new fuels.config.ts file
  • fuels build โ€” Build forc workspace and generate Typescript types for everything
  • fuels deploy โ€” Deploy workspace contracts and save their IDs to JSON file
  • fuels dev โ€” Start a Fuel node with hot-reload capabilities

Official Docs

  • Install The Fuel Toolchain โ€” https://docs.fuel.network/guides/installation/

  • Typescript SDK โ€” https://docs.fuel.network/docs/fuels-ts
  • Fuel Wallet SDK โ€” https://docs.fuel.network/docs/wallet
  • Rust SDK โ€” https://docs.fuel.network/docs/fuels-rs
  • GraphQL Playground โ€” https://docs.fuel.network/docs/graphql

  • Forc โ€” https://docs.fuel.network/docs/forc
  • Sway โ€” https://docs.fuel.network/docs/sway
  • Fuel Core โ€” https://github.com/FuelLabs/fuel-core
  • Fuel VM โ€” https://docs.fuel.network/docs/specs/fuel-vm
  • Fuel Specs โ€” https://docs.fuel.network/docs/specs

Apps & Ecosystem

  • Fuel Bridge โ€” https://app.fuel.network/bridge
  • Block Explorer โ€” https://app.fuel.network
  • Ecosystem Apps โ€” https://app.fuel.network/ecosystem

Get in Touch

  • Forum โ€” https://forum.fuel.network
  • Discord โ€” https://discord.gg/xfpK4Pe

Contribute

License

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