MCPcopy
hub / github.com/FuelLabs/fuels-ts

github.com/FuelLabs/fuels-ts @v0.103.0 sqlite

repository ↗ · DeepWiki ↗ · release v0.103.0 ↗
2,183 symbols 9,535 edges 1,205 files 379 documented · 17%
README

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: - 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.

Extension points exported contracts — how you extend this code

IType (Interface)
(no doc) [21 implementers]
packages/abi-typegen/src/types/interfaces/IType.ts
DeployableContractFactory (Interface)
(no doc) [4 implementers]
packages/contract/src/test-utils/launch-test-node.ts
BNHelper (Interface)
(no doc) [2 implementers]
packages/math/src/bn.ts
FuelSdk (Interface)
(no doc) [2 implementers]
packages/account/src/connectors/fuel.ts
WithAddress (Interface)
(no doc) [1 implementers]
packages/address/src/types.ts
MapStore (Interface)
(no doc)
packages/merkle/src/sparse/utils.ts
Keystore (Interface)
(no doc)
packages/crypto/src/types.ts
Coin (Interface)
(no doc)
packages/utils/src/utils/types.ts

Core symbols most depended-on inside this repo

bn
called by 1211
packages/math/src/bn.ts
call
called by 513
packages/program/src/functions/base-invocation-scope.ts
waitForResult
called by 494
packages/contract/src/contract-factory.ts
getBaseAssetId
called by 409
packages/account/src/providers/provider.ts
toB256
called by 369
packages/address/src/address.ts
waitForResult
called by 362
packages/account/src/utils/deployScriptOrPredicate.ts
launchTestNode
called by 359
packages/contract/src/test-utils/launch-test-node.ts
push
called by 358
packages/program/src/instruction-set.ts

Shape

Function 928
Method 775
Class 291
Interface 155
Enum 34

Languages

TypeScript100%

Modules by API surface

packages/account/src/providers/provider.ts73 symbols
packages/account/src/connectors/fuel-connector.ts44 symbols
packages/math/src/bn.ts42 symbols
packages/account/src/providers/transaction-request/transaction-request.ts38 symbols
packages/account/src/account.ts37 symbols
packages/transactions/src/coders/transaction.ts36 symbols
packages/account/src/connectors/fuel.ts35 symbols
packages/program/src/functions/base-invocation-scope.ts32 symbols
packages/transactions/src/coders/output.ts31 symbols
packages/account/src/providers/transaction-summary/operations.ts30 symbols
packages/transactions/src/coders/input.ts24 symbols
packages/account/test/fixtures/mocked-connector.ts23 symbols

Dependencies from manifests, versioned

@actions/core1.11.1 · 1×
@actions/github6.0.0 · 1×
@changesets/cli2.28.1 · 1×
@changesets/get-github-info0.6.0 · 1×
@changesets/read0.6.3 · 1×
@changesets/types6.1.0 · 1×
@eslint/js9.24.0 · 1×
@fuel-ts/abi-coderworkspace:* · 1×
@fuel-ts/abi-typegenworkspace:* · 1×
@fuel-ts/accountworkspace:* · 1×
@fuel-ts/addressworkspace:* · 1×
@fuel-ts/contractworkspace:* · 1×

For agents

$ claude mcp add fuels-ts \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact