๐Ÿ“ฆ 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
fuel-fuels-ts-bot[bot] fuel-fuels-ts-bot[bot] ci(release): `v0.102.0` @ `master` (#3936) 9a7b697 2 months ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ .changeset
๐Ÿ“ .fuel-core
๐Ÿ“ .github
๐Ÿ“ .vscode
๐Ÿ“ apps
๐Ÿ“ internal
๐Ÿ“ packages
๐Ÿ“ playwright-tests
๐Ÿ“ scripts
๐Ÿ“ snapshots
๐Ÿ“ templates
๐Ÿ“„ .env.example
๐Ÿ“„ .eslintignore
๐Ÿ“„ .eslintrc.js
๐Ÿ“„ .gitignore
๐Ÿ“„ .knip.json
๐Ÿ“„ .npmrc
๐Ÿ“„ .nvmrc
๐Ÿ“„ .nycrc
๐Ÿ“„ .prettierignore
๐Ÿ“„ .prettierrc
๐Ÿ“„ .syncpackrc
๐Ÿ“„ CHANGELOG.md
๐Ÿ“„ CODE_OF_CONDUCT.md
๐Ÿ“„ CONTRIBUTING.md
๐Ÿ“„ LICENSE
๐Ÿ“„ package.json
๐Ÿ“„ pnpm-lock.yaml
๐Ÿ“„ README.md
๐Ÿ“„ SECURITY.md
๐Ÿ“„ tsconfig.base.json
๐Ÿ“„ tsconfig.json
๐Ÿ“„ tsconfig.test.json
๐Ÿ“„ tsdoc.base.json
๐Ÿ“„ turbo.json
๐Ÿ“„ typedoc.base.json
๐Ÿ“„ 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.