Fuel Network Typescript SDK
https://github.com/FuelLabs/fuels-ts.git
Typescript SDK for Fuel.
npm install fuels --save
| 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 });
$ npm create fuels
โ What is the name of your project? #
โ my-fuel-project
โ
โก๏ธ Success! Created a fullstack Fuel dapp at: my-fuel-project.
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 filefuels build โ Build forc workspace and generate Typescript types for everythingfuels deploy โ Deploy workspace contracts and save their IDs to JSON filefuels dev โ Start a Fuel node with hot-reload capabilitiesForum โ https://forum.fuel.networkDiscord โ https://discord.gg/xfpK4PeThe primary license for this repo is Apache 2.0, see LICENSE.