MCPcopy Index your code
hub / github.com/FuelLabs/fuels-rs

github.com/FuelLabs/fuels-rs @v0.77.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.77.0 ↗ · + Follow
1,999 symbols 7,217 edges 227 files 160 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

fuels-rs

build crates.io docs discord

Rust SDK for Fuel. It can be used for a variety of things, including but not limited to:

  • Compiling, deploying, and testing Sway contracts;
  • Launching a local Fuel network;
  • Crafting and signing transactions with hand-crafted scripts or contract calls;
  • Generating type-safe Rust bindings of contract methods;
  • And more, fuels-rs is still in active development.

Documentation

See the fuels-rs book

Features

  • [x] Launch Fuel nodes
  • [x] Deploy contracts
  • [x] Interact with deployed contracts
  • [x] Type-safe Sway contracts bindings code generation
  • [x] Run Sway scripts
  • [x] CLI for common operations
  • [x] Local test wallets
  • [ ] Wallet integration
  • [ ] Events querying/monitoring

FAQ

What dependencies do I need?

How can I run the SDK tests?

First, build the test projects using forc:

forc build --release --path e2e

Then you can run the SDK tests with:

cargo test

You can also run specific tests. The following example will run all integration tests in types.rs whose names contain in_vector and show their outputs:

cargo test --test types in_vector -- --show-output

How to run WASM tests?

You need to have wasm32 as a target, if you don't already:

 rustup target add wasm32-unknown-unknown

You also need wasm-pack, if you don't already:

cargo install wasm-pack

Navigate to packages/wasm-tests and run wasm-pack test.

What to do if my tests are failing on master

Before doing anything else, try all these commands:

cargo clean
rm Cargo.lock
forc build --release --path e2e
cargo test

Why is the prefix fuels and not fuel?

In order to make the SDK for Fuel feel familiar with those coming from the ethers.js ecosystem, this project opted for an s at the end. The fuels-* family of SDKs is inspired by The Ethers Project.

How can I run the docs locally?

Install mdbook by running:

cargo install mdbook

Next, navigate to the docs folder and run the command below to start a local server and open a new tab in your browser.

mdbook serve --open

You can build the book by running:

mdbook build

Extension points exported contracts — how you extend this code

Parameterize (Interface)
`abigen` requires `Parameterized` to construct nested types. It is also used by `try_from_bytes` to facilitate the insta [21 …
packages/fuels-core/src/traits/parameterize.rs
ViewOnlyAccount (Interface)
(no doc) [3 implementers]
packages/fuels-accounts/src/account.rs
Sealed (Interface)
(no doc) [3 implementers]
packages/fuels-programs/src/calls/utils.rs
ErrorsExt (Interface)
(no doc) [1 implementers]
packages/fuels-macros/src/parse_utils.rs
GitHubPort (Interface)
(no doc) [1 implementers]
scripts/change-log/src/ports/github.rs
Sealed (Interface)
(no doc) [6 implementers]
packages/fuels-core/src/utils.rs
Account (Interface)
(no doc) [2 implementers]
packages/fuels-accounts/src/account.rs
ContractDependency (Interface)
Trait implemented by contract instances so that they can be passed to the `with_contracts` method [1 implementers]
packages/fuels-programs/src/calls/call_handler.rs

Core symbols most depended-on inside this repo

call
called by 340
packages/fuels-programs/src/calls/call_handler.rs
methods
called by 209
examples/rust_bindings/src/rust_bindings_formatted.rs
address
called by 168
packages/fuels-accounts/src/predicate.rs
iter
called by 148
packages/fuels-code-gen/src/program_bindings/utils.rs
into_iter
called by 112
packages/fuels-programs/src/contract/storage.rs
add_call
called by 62
packages/fuels-programs/src/calls/call_handler.rs
as_slice
called by 52
packages/fuels-core/src/types/wrappers/transaction.rs
build
called by 49
packages/fuels-core/src/types/transaction_builders/blob.rs

Shape

Function 961
Method 790
Class 180
Enum 43
Interface 25

Languages

Rust96%
TypeScript4%

Modules by API surface

docs/theme/highlight.js85 symbols
packages/fuels-core/src/types/transaction_builders.rs78 symbols
packages/fuels-accounts/src/provider.rs65 symbols
e2e/tests/contracts.rs61 symbols
packages/fuels-accounts/src/provider/retryable_client.rs46 symbols
e2e/tests/types_contracts.rs43 symbols
packages/fuels-core/src/types/wrappers/transaction.rs41 symbols
packages/fuels-core/src/codec/abi_decoder.rs39 symbols
packages/fuels-code-gen/src/program_bindings/resolved_type.rs39 symbols
e2e/tests/providers.rs37 symbols
e2e/tests/logs.rs36 symbols
packages/fuels-core/src/types/param_types/from_type_application.rs33 symbols

For agents

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

⬇ download graph artifact

Ask about this repo answers extend the page