Skip to content

Commit

Permalink
Merge branch 'master' into st/chore/upgrade-fuel-core@0.40.2
Browse files Browse the repository at this point in the history
  • Loading branch information
petertonysmith94 authored Jan 3, 2025
2 parents 3ee0b0c + 12e801e commit 9d84127
Show file tree
Hide file tree
Showing 137 changed files with 2,381 additions and 4,058 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-lies-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fuels": patch
---

docs: improving getting started docs for `mainnet`
5 changes: 5 additions & 0 deletions .changeset/clever-bikes-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-fuels": patch
---

chore: bumped `@fuels/*` deps to `0.36.1`
5 changes: 5 additions & 0 deletions .changeset/clever-rocks-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-fuels": patch
---

fix: test ui script in package's json
20 changes: 20 additions & 0 deletions .changeset/fluffy-cooks-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"create-fuels": patch
"@fuel-ts/transactions": patch
"@fuel-ts/abi-typegen": patch
"@fuel-ts/abi-coder": patch
"@fuel-ts/contract": patch
"@fuel-ts/versions": patch
"@fuel-ts/account": patch
"@fuel-ts/address": patch
"@fuel-ts/program": patch
"@fuel-ts/crypto": patch
"@fuel-ts/hasher": patch
"@fuel-ts/logger": patch
"@fuel-ts/merkle": patch
"fuels": patch
"@fuel-ts/utils": patch
"@fuel-ts/math": patch
---

chore: dependency pinning and auditing
5 changes: 5 additions & 0 deletions .changeset/gentle-toes-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuel-ts/account": patch
---

feat: added method to duplicate predicate
5 changes: 5 additions & 0 deletions .changeset/lazy-ears-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-fuels": patch
---

feat: auto-detect package manager in `create fuels`
5 changes: 5 additions & 0 deletions .changeset/new-toys-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fuels": patch
---

fix: paths and globals in `fuels init`
5 changes: 5 additions & 0 deletions .changeset/orange-moles-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuel-ts/abi-coder": patch
---

fix: validation and handling of unsafe integers
8 changes: 8 additions & 0 deletions .changeset/small-plums-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@fuel-ts/address": minor
"@fuel-ts/errors": patch
"@fuel-ts/recipes": patch
"@fuel-ts/logger": minor
---

chore!: remove Bech32 address
21 changes: 21 additions & 0 deletions .github/workflows/audit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Audit"

on:
pull_request:
branches:
- master

jobs:
audit:
if: false
# if: startsWith(github.head_ref, 'changeset-release')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: CI Setup
uses: ./.github/actions/ci-setup

- name: Audit
run: pnpm audit
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ jobs:
- name: Pretest
run: pnpm pretest

- name: Install playwright dependencies
if: matrix.env.name == 'browser'
run: pnpm exec playwright install --with-deps --only-shell chromium

- name: Run Tests - ${{ matrix.env.name }}
run: pnpm test:${{ matrix.env.name }}

Expand Down
7 changes: 1 addition & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,7 @@ During the CI process an automated end-to-end (e2e) test is executed. This test
The e2e test can be found at:
`packages/fuel-gauge/src/e2e-script.test.ts`

The Bech32 address of this wallet is `fuel1x33ajpj0jy5p2wcqqu45e32r75zrwfeh6hwqfv5un670rv4p0mns58enjg`. This address can be funded via the [faucet](https://faucet-testnet.fuel.network/).

> [!NOTE] Note
> `Bech32` addresses like `fuel1..` are now deprecated. Use `B256` addresses instead. ([help](https://docs.fuel.network/docs/specs/abi/argument-encoding/#b256))
The B256 address of this wallet is `0x3463d9064f9128153b00072b4cc543f504372737d5dc04b29c9ebcf1b2a17ee7`. This address can be funded via the [faucet](https://faucet-testnet.fuel.network/).

If you want to run an e2e test locally, you can provide your own wallet address and private key. For obvious security reasons, the private key should not be shared.

Expand All @@ -270,8 +267,6 @@ This will enable you to run the e2e test locally against the live network:
pnpm test:filter e2e-script
```

<!-- TODO: add/fix block explorer URL after testnet support- Checking Wallet Balance: https://fuellabs.github.io/block-explorer-v2/beta-5/?#/address/fuel1x33ajpj0jy5p2wcqqu45e32r75zrwfeh6hwqfv5un670rv4p0mns58enjg -->

# Commit Convention

Before you create a Pull Request, please check whether your commits comply with
Expand Down
139 changes: 77 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,92 +1,107 @@
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/FuelLabs/fuels-ts/master/apps/docs/src/public/fuels-ts-logo-dark.png">
<img alt="Fuels-ts SDK logo" width="400px" src="https://raw.githubusercontent.com/FuelLabs/fuels-ts/master/apps/docs/src/public/fuels-ts-logo-light.png">
</picture>
# fuels-ts

**fuels-ts** is a library for interacting with **Fuel v2**.
Typescript SDK for Fuel.

[![test](https://github.com/FuelLabs/fuels-ts/actions/workflows/test.yaml/badge.svg)](https://github.com/FuelLabs/fuels-ts/actions/workflows/test.yaml)
[![npm](https://img.shields.io/npm/v/fuels)](https://www.npmjs.com/package/fuels)
[![docs](https://img.shields.io/badge/docs-fuels.ts-brightgreen.svg?style=flat)](https://docs.fuel.network/docs/fuels-ts/)
[![npm](https://img.shields.io/npm/v/fuels)](https://www.npmjs.com/package/fuels)
[![discord](https://img.shields.io/badge/chat%20on-discord-orange?&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/xfpK4Pe)

# Resources

The [documentation](https://docs.fuel.network/docs/fuels-ts/) site is your main stop for resources.
# Install ([docs](https://docs.fuel.network/docs/fuels-ts/getting-started/installation))

- [Quickstart](https://docs.fuel.network/docs/intro/quickstart-contract/)
- [Documentation](https://docs.fuel.network/docs/fuels-ts/)
- [Wallets](https://docs.fuel.network/docs/fuels-ts/wallets/)
- [Contracts](https://docs.fuel.network/docs/fuels-ts/contracts/)
- [Scripts](https://docs.fuel.network/docs/fuels-ts/scripts/)
- [Predicates](https://docs.fuel.network/docs/fuels-ts/predicates/)
- [ABI Typegen](https://docs.fuel.network/docs/fuels-ts/fuels-cli/abi-typegen/)
- [Contributing](https://github.com/FuelLabs/fuels-ts/blob/master/CONTRIBUTING.md)
- [The Fuel Forum](https://forum.fuel.network/)
- [The Fuel Ecosystem](#the-fuel-ecosystem)

# Install

```sh
```console
npm install fuels --save
```

> If you are a Windows user, you will need to be running Windows Subsystem for Linux (WSL) to install and use the Fuel toolchain, including the TypeScript SDK. We don't support Windows natively at this time.
# Connect ([docs](https://docs.fuel.network/docs/fuels-ts/getting-started/connecting-to-the-network/))

# Import

Simple example usages.
| Network | URL |
| --------- | --------------------------------------------------------------------------------------------------------------- |
| Mainnet | `https://mainnet.fuel.network/v1/graphql` |
| Testnet | `https://testnet.fuel.network/v1/graphql` |
| Localhost | [Running a local Fuel node](https://docs.fuel.network/docs/fuels-ts/getting-started/running-a-local-fuel-node/) |

```ts
import { Wallet } from "fuels";
import { Provider } from 'fuels';

// Random Wallet
console.log(Wallet.generate());
const NETWORK_URL = 'https://mainnet.fuel.network/v1/graphql';

// Using privateKey Wallet
console.log(new Wallet("0x0000...0000"));
```
const provider = await Provider.create(NETWORK_URL);

# CLI
const chainId = provider.getChainId();
const gasConfig = provider.getGasConfig();
const baseAssetId = provider.getBaseAssetId();

Fuels include some utility commands via built-in CLI tool.
console.log({ chainId, gasConfig, baseAssetId });
```

Check the [docs](https://docs.fuel.network/docs/fuels-ts/) for more info.
# Create a new dApp ([docs](https://docs.fuel.network/docs/fuels-ts/creating-a-fuel-dapp/))

```console
$ npm add fuels
$ npx fuels --help
Usage: fuels [options] [command]
$ npm create fuels

◇ What is the name of your project? #
│ my-fuel-project

⚡️ Success! Created a fullstack Fuel dapp at: my-fuel-project.
```

Options:
-D, --debug Enables verbose logging (default: false)
-S, --silent Omit output messages (default: false)
-v, --version Output the version number
-h, --help Display help
# Enjoy the `fuels` CLI ([docs](https://docs.fuel.network/docs/fuels-ts/fuels-cli/))

```console
$ npm install fuels --save
$ npm fuels --help

Commands:
init [options] Create a sample `fuel.config.ts` file
node [options] Start a Fuel node
dev [options] Start a Fuel node and run build + deploy on every file change
build [options] Build Sway programs and generate Typescript for them
deploy [options] Deploy contracts to the Fuel network
typegen [options] Generate Typescript from Sway ABI JSON files
versions Check for version incompatibilities
help [command] Display help for command
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
```

# The Fuel Ecosystem
In-depth docs:
- [`fuels init`](https://docs.fuel.network/docs/fuels-ts/fuels-cli/commands#fuels-init) — Creates a new `fuels.config.ts` file
- [`fuels build`](https://docs.fuel.network/docs/fuels-ts/fuels-cli/commands#fuels-build) — Build `forc` workspace and generate Typescript types for everything
- [`fuels deploy`](https://docs.fuel.network/docs/fuels-ts/fuels-cli/commands#fuels-deploy) — Deploy workspace contracts and save their IDs to JSON file
- [`fuels dev`](https://docs.fuel.network/docs/fuels-ts/fuels-cli/commands#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

Learn more about the Fuel Ecosystem.
- [./CONTRIBUTING.md](https://github.com/FuelLabs/fuels-ts/blob/master/CONTRIBUTING.md)

- [🌴 Sway](https://docs.fuel.network/docs/sway/) — The new language, empowering everyone to build reliable and efficient smart contracts
- [🧰 Forc](https://docs.fuel.network/docs/forc/) — The Fuel toolbox: _Build, deploy and manage your sway projects_
- [⚙️ Fuel Core](https://github.com/FuelLabs/fuel-core) — The new FuelVM, a blazingly fast blockchain VM
- [🔗 Fuel Specs](https://github.com/FuelLabs/fuel-specs) — The Fuel protocol specifications
- [💼 Fuels Wallet](https://github.com/FuelLabs/fuels-wallet) — The Official Fuels Wallet
- [🦀 Rust SDK](https://github.com/FuelLabs/fuels-rs) — A robust SDK in rust
- [⚡ Fuel Network](https://fuel.network/) — The project
- [📚 The Fuel Forum](https://forum.fuel.network/) — Ask questions, get updates, and contribute to a modular future

# License

Expand Down
54 changes: 27 additions & 27 deletions apps/create-fuels-counter-guide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.1.0",
"type": "module",
"scripts": {
"test:ui": "./test/ui/test-ui.sh",
"test:ui": "sh ./test/ui/test-ui.sh",
"original:dev": "vite",
"original:build": "tsc -b && vite build",
"original:start": "next start",
Expand All @@ -14,35 +14,35 @@
"postbuild": "run-s fuels:build original:build"
},
"dependencies": {
"@fuels/connectors": "^0.27.1",
"@fuels/react": "^0.27.1",
"@tanstack/react-query": "^5.55.4",
"@fuels/connectors": "0.36.1",
"@fuels/react": "0.36.1",
"@tanstack/react-query": "5.55.4",
"clsx": "2.1.1",
"@wagmi/connectors": "^5.1.14",
"@wagmi/core": "^2.13.9",
"dotenv": "^16.4.5",
"@wagmi/connectors": "5.1.14",
"@wagmi/core": "2.13.9",
"dotenv": "16.4.5",
"fuels": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-toastify": "^10.0.6"
"react": "18.3.1",
"react-dom": "18.3.1",
"react-toastify": "10.0.6"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.3.3",
"@eslint/js": "^9.10.0",
"@types/node": "^22.5.5",
"@playwright/test": "^1.47.2",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3",
"autoprefixer": "^10.4.20",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.13",
"globals": "^15.9.0",
"postcss": "^8.4.49",
"tailwindcss": "^3.4.14",
"typescript": "~5.6.3",
"typescript-eslint": "^8.8.0",
"vite": "^5.4.9",
"vitest": "~2.0.5"
"@vitejs/plugin-react": "4.3.3",
"@eslint/js": "9.10.0",
"@types/node": "22.5.5",
"@playwright/test": "1.49.1",
"@types/react": "18.3.11",
"@types/react-dom": "18.3",
"autoprefixer": "10.4.20",
"eslint": "8.57.0",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-react-refresh": "0.4.13",
"globals": "15.9.0",
"postcss": "8.4.49",
"tailwindcss": "3.4.14",
"typescript": "5.6.3",
"typescript-eslint": "8.8.0",
"vite": "5.4.9",
"vitest": "2.0.5"
}
}
3 changes: 2 additions & 1 deletion apps/create-fuels-counter-guide/src/lib.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const isTestnet = environment === environments.TESTNET;
export const localProviderUrl = `http://127.0.0.1:${process.env.VITE_FUEL_NODE_PORT || 4000}/v1/graphql`;
export const testnetProviderUrl = 'https://testnet.fuel.network/v1/graphql';
export const providerUrl = isLocal ? localProviderUrl : testnetProviderUrl;
export const chainId = 0; // Local and testnet are both on chain 0
export const playgroundUrl = providerUrl.replace('v1/graphql', 'v1/playground');

// #region deploying-dapp-to-testnet-frontend-contract-id
Expand All @@ -28,7 +29,7 @@ export const renderTransactionId = (transactionId: string) => {

return (
<a
href={`https://app.fuel.network/tx/${transactionId}/simple`}
href={`https://app-testnet.fuel.network/tx/${transactionId}/simple`}
target="_blank"
rel="noreferrer"
className="underline"
Expand Down
Loading

0 comments on commit 9d84127

Please sign in to comment.