diff --git a/.changeset/brave-lies-relax.md b/.changeset/brave-lies-relax.md new file mode 100644 index 00000000000..88aa3dda2c9 --- /dev/null +++ b/.changeset/brave-lies-relax.md @@ -0,0 +1,5 @@ +--- +"fuels": patch +--- + +docs: improving getting started docs for `mainnet` diff --git a/.changeset/clever-bikes-itch.md b/.changeset/clever-bikes-itch.md new file mode 100644 index 00000000000..928b49a6c27 --- /dev/null +++ b/.changeset/clever-bikes-itch.md @@ -0,0 +1,5 @@ +--- +"create-fuels": patch +--- + +chore: bumped `@fuels/*` deps to `0.36.1` diff --git a/.changeset/orange-moles-leave.md b/.changeset/orange-moles-leave.md new file mode 100644 index 00000000000..b749b60962f --- /dev/null +++ b/.changeset/orange-moles-leave.md @@ -0,0 +1,5 @@ +--- +"@fuel-ts/abi-coder": patch +--- + +fix: validation and handling of unsafe integers diff --git a/.changeset/small-plums-talk.md b/.changeset/small-plums-talk.md new file mode 100644 index 00000000000..83f4952100f --- /dev/null +++ b/.changeset/small-plums-talk.md @@ -0,0 +1,8 @@ +--- +"@fuel-ts/address": minor +"@fuel-ts/errors": patch +"@fuel-ts/recipes": patch +"@fuel-ts/logger": minor +--- + +chore!: remove Bech32 address diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 88a07d3af77..0c2b4b5f108 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. @@ -270,8 +267,6 @@ This will enable you to run the e2e test locally against the live network: pnpm test:filter e2e-script ``` - - # Commit Convention Before you create a Pull Request, please check whether your commits comply with diff --git a/README.md b/README.md index 7e664aa4544..5a66a712c54 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,107 @@ - - - Fuels-ts SDK logo - +# 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 diff --git a/apps/create-fuels-counter-guide/package.json b/apps/create-fuels-counter-guide/package.json index aa3662b0c65..eecc050c091 100644 --- a/apps/create-fuels-counter-guide/package.json +++ b/apps/create-fuels-counter-guide/package.json @@ -14,8 +14,8 @@ "postbuild": "run-s fuels:build original:build" }, "dependencies": { - "@fuels/connectors": "0.27.1", - "@fuels/react": "0.27.1", + "@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", diff --git a/apps/create-fuels-counter-guide/src/lib.tsx b/apps/create-fuels-counter-guide/src/lib.tsx index cd4fbd76e68..f01d5ca33e1 100644 --- a/apps/create-fuels-counter-guide/src/lib.tsx +++ b/apps/create-fuels-counter-guide/src/lib.tsx @@ -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 @@ -28,7 +29,7 @@ export const renderTransactionId = (transactionId: string) => { return ( - + diff --git a/apps/demo-wallet-sdk-react/package.json b/apps/demo-wallet-sdk-react/package.json index 3f60228f60a..cde15f2eedd 100644 --- a/apps/demo-wallet-sdk-react/package.json +++ b/apps/demo-wallet-sdk-react/package.json @@ -9,8 +9,8 @@ "lint": "next lint" }, "dependencies": { - "@fuels/connectors": "0.27.1", - "@fuels/react": "0.27.1", + "@fuels/connectors": "0.36.1", + "@fuels/react": "0.36.1", "@tanstack/react-query": "5.55.4", "fuels": "workspace:*", "next": "14.2.15", diff --git a/apps/docs/.vitepress/config.ts b/apps/docs/.vitepress/config.ts index f1a007accd1..05ea76b776e 100644 --- a/apps/docs/.vitepress/config.ts +++ b/apps/docs/.vitepress/config.ts @@ -51,20 +51,24 @@ export default defineConfig({ link: '/guide/getting-started/installation', }, { - text: 'Usage', - link: '/guide/getting-started/usage', + text: 'Connecting to the Network', + link: '/guide/getting-started/connecting-to-the-network', }, { - text: 'Connecting to Testnet', - link: '/guide/getting-started/connecting-to-testnet', + text: 'Running a local Fuel node', + link: '/guide/getting-started/running-a-local-fuel-node', }, { - text: 'Connecting to a Local Node', - link: '/guide/getting-started/connecting-to-a-local-node', + text: 'React Example', + link: '/guide/getting-started/react-example', }, { - text: 'Further Resources', - link: '/guide/getting-started/further-resources', + text: 'CDN Usage', + link: '/guide/getting-started/cdn-usage', + }, + { + text: 'Next Steps', + link: '/guide/getting-started/next-steps', }, ], }, @@ -483,10 +487,6 @@ export default defineConfig({ text: 'Asset Id', link: '/guide/types/asset-id', }, - { - text: 'Bech32', - link: '/guide/types/bech32', - }, { text: 'Bits256', link: '/guide/types/bits256', diff --git a/apps/docs/spell-check-custom-words.txt b/apps/docs/spell-check-custom-words.txt index aa3ebc175d7..bd79fd9cf81 100644 --- a/apps/docs/spell-check-custom-words.txt +++ b/apps/docs/spell-check-custom-words.txt @@ -21,7 +21,6 @@ backends backoff backtrace backtraces -Bech BigNumber Bitfield bitmask diff --git a/apps/docs/src/guide/contracts/managing-deployed-contracts.md b/apps/docs/src/guide/contracts/managing-deployed-contracts.md index b24d3752125..361a9e37599 100644 --- a/apps/docs/src/guide/contracts/managing-deployed-contracts.md +++ b/apps/docs/src/guide/contracts/managing-deployed-contracts.md @@ -6,16 +6,13 @@ To interact with a deployed contract using the SDK without redeploying it, you o The `contractId` property from the [`Contract`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_program.Contract.html) class is of type [`AbstractAddress`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_interfaces.AbstractAddress.html), an abstract class that is exclusively extended by the [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) class. -The [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) class wraps all methods from the [`AbstractAddress`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_interfaces.AbstractAddress.html) class and adds a single property: `bech32Address`. This property is a string encoded in [`Bech32`](../types/bech32.md) format, recognizable by the human-readable prefix `fuel` followed by the separator `1`. - -> [!NOTE] Note -> `Bech32` addresses like `fuel1..` are now deprecated; please switch to B256 format, for more details see [here](https://docs.fuel.network/docs/specs/abi/argument-encoding/#b256). +The [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) class wraps all methods from the [`AbstractAddress`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_interfaces.AbstractAddress.html) class and adds a single property: `b256Address`. This property is a string encoded in [`B256`](../types/bits256.md) format. When you log the `contractId` property of an instantiated Contract using `console.log`, the output appears as follows: ```console Address { - bech32Address: 'fuel1e5tdjlzufcvwut5dvs5yglweepmrevpnvuvt2djj6pyl3mygkwaq8m7f20' + b256Address: '0xcd16d97c5c4e18ee2e8d6428447dd9c8763cb0336718b53652d049f8ec88b3ba' } ``` diff --git a/apps/docs/src/guide/fuels-cli/commands.md b/apps/docs/src/guide/fuels-cli/commands.md index d67a4d96ec0..f842abd7a72 100644 --- a/apps/docs/src/guide/fuels-cli/commands.md +++ b/apps/docs/src/guide/fuels-cli/commands.md @@ -143,7 +143,11 @@ The `fuels dev` command does three things: npx fuels@{{fuels}} node ``` -The `fuels node` command starts a short-lived `fuel-core` node ([docs](./config-file.md#autostartfuelcore)). +Starts a short-lived `fuel-core` node and requires a `fuels.config.ts` config file. + +Generate one with [`fuels init`](#fuels-init): + +<<< @/../../demo-fuels/fuels.config.minimal.ts#config{ts:line-numbers} ## `fuels typegen` diff --git a/apps/docs/src/guide/getting-started/cdn-usage.md b/apps/docs/src/guide/getting-started/cdn-usage.md new file mode 100644 index 00000000000..7b7e2b850f8 --- /dev/null +++ b/apps/docs/src/guide/getting-started/cdn-usage.md @@ -0,0 +1,29 @@ + + +# CDN Usage (browser only) + +```html-vue + +``` + +# More + +- [React Example](./react-example.md) diff --git a/apps/docs/src/guide/getting-started/connecting-to-a-local-node.md b/apps/docs/src/guide/getting-started/connecting-to-a-local-node.md deleted file mode 100644 index 7a464d19088..00000000000 --- a/apps/docs/src/guide/getting-started/connecting-to-a-local-node.md +++ /dev/null @@ -1,10 +0,0 @@ -# Connecting to a Local Node - -Firstly, you will need a local node running on your machine. We recommend one of the following methods: - -- [Testing utilities](../testing/launching-a-test-node.md) can assist in programmatically launching a short-lived node. -- Running [fuel-core](https://docs.fuel.network/guides/running-a-node/running-a-local-node/) directly. - -In the following example, we create a provider to connect to the local node and sign a message. - -<<< @./snippets/connecting-to-localnode.ts#main{ts:line-numbers} diff --git a/apps/docs/src/guide/getting-started/connecting-to-testnet.md b/apps/docs/src/guide/getting-started/connecting-to-testnet.md deleted file mode 100644 index 188a30b1397..00000000000 --- a/apps/docs/src/guide/getting-started/connecting-to-testnet.md +++ /dev/null @@ -1,22 +0,0 @@ -# Connecting to Testnet - -The **Testnet** is a public network that allows you to interact with a Fuel Virtual Machine and is used for testing and development purposes. - -> [!NOTE] Latest Testnet -> Dev Testnet -> -> `https://testnet.fuel.network/v1/graphql` - -We have some useful resources for the Testnet: - -- [**Faucet**](https://faucet-testnet.fuel.network/) - for funding wallets that have been created. -- [**Explorer**](https://app.fuel.network/) - for viewing transactions and blocks. -- [**GraphQL Playground**](https://testnet.fuel.network/v1/playground) - for testing GraphQL queries and mutations. - ---- - -In the example below, we connect a [Provider](../provider/index.md) to the latest testnet and create a new wallet from a private key. - -> **Note:** New wallets on the Testnet will not have any assets! You can use the [Faucet](https://faucet-testnet.fuel.network/) to fund your wallet. - -<<< @./snippets/connecting-to-testnet.ts#main{ts:line-numbers} diff --git a/apps/docs/src/guide/getting-started/connecting-to-the-network.md b/apps/docs/src/guide/getting-started/connecting-to-the-network.md new file mode 100644 index 00000000000..6ef8d6876fd --- /dev/null +++ b/apps/docs/src/guide/getting-started/connecting-to-the-network.md @@ -0,0 +1,26 @@ +# Connecting to the Network + +After [installing](./installation.md) the `fuels` package, it's easy to connect to the Network: + +<<< @./snippets/connecting-to-the-network.ts#main{ts:line-numbers} + +# RPC URLs + +These are our official RPC URLs: + +| Network | URL | +| --------- | ----------------------------------------------------------- | +| Mainnet | `https://testnet.fuel.network/v1/graphql` | +| Testnet | `https://mainnet.fuel.network/v1/graphql` | +| Localhost | [Running a local Fuel node](./running-a-local-fuel-node.md) | + +# Resources + +Access all our apps directly: + +| | Mainnet | Testnet | +| -------- | ------------------------------------------ | ------------------------------------------ | +| Faucet | — | https://faucet-testnet.fuel.network/ | +| Explorer | https://app.fuel.network | https://app-testnet.fuel.network | +| Bridge | https://app.fuel.network/bridge | https://app-testnet.fuel.network/bridge | +| GraphQL | https://mainnet.fuel.network/v1/playground | https://testnet.fuel.network/v1/playground | diff --git a/apps/docs/src/guide/getting-started/further-resources.md b/apps/docs/src/guide/getting-started/further-resources.md deleted file mode 100644 index 015e4115d1b..00000000000 --- a/apps/docs/src/guide/getting-started/further-resources.md +++ /dev/null @@ -1,11 +0,0 @@ -# Further Resources - -For a more in-depth, step-by-step guide on working with the wider Fuel ecosystem, check out the [Developer Quickstart](https://docs.fuel.network/guides/quickstart/). This guide covers: - -1. Installing all tools needed to develop with the Fuel ecosystem. - -2. Writing your first Sway Project. - -3. Deploying your contract. - -4. Building a simple front-end dApp to interact with your deployed contract. diff --git a/apps/docs/src/guide/getting-started/index.md b/apps/docs/src/guide/getting-started/index.md index cbb43088ec9..d818f5891fb 100644 --- a/apps/docs/src/guide/getting-started/index.md +++ b/apps/docs/src/guide/getting-started/index.md @@ -1,3 +1,12 @@ # Getting Started -This guide will walk you through the process of setting up and using the Fuels-ts library in your front-end project. +Welcome to `fuels` Typescript SDK! + +We prepared some guides to walk you through your first steps: + +1. [Installation](./installation.md) +1. [Connecting to the Network](./connecting-to-the-network.md) +1. [Running a local Fuel node](./running-a-local-fuel-node.md) +1. [React Example](./react-example.md) +1. [CDN Usage](./cdn-usage.md) +1. [Next Steps](./next-steps.md) diff --git a/apps/docs/src/guide/getting-started/installation.md b/apps/docs/src/guide/getting-started/installation.md index 51520e763aa..6472bb7ef1d 100644 --- a/apps/docs/src/guide/getting-started/installation.md +++ b/apps/docs/src/guide/getting-started/installation.md @@ -5,24 +5,26 @@ # Installation -We expect you to install the [Fuel Toolchain](https://docs.fuel.network/docs/sway/introduction/fuel_toolchain/#the-fuel-toolchain) before using this library. Follow [this guide](https://docs.fuel.network/guides/installation/) to get this installed. +You must install the [Fuel Toolchain](https://docs.fuel.network/guides/installation/) before using this library. -The next step is to add the `fuels` dependency to your project. You can do this using the following command: +Then add the `fuels` dependency to your project: ::: code-group -```sh-vue [npm] -npm install fuels@{{fuels}} --save +```sh-vue [bun] +bun add fuels@{{fuels}} ``` ```sh-vue [pnpm] pnpm add fuels@{{fuels}} ``` -```sh-vue [bun] -bun add fuels@{{fuels}} +```sh-vue [npm] +npm install fuels@{{fuels}} --save ``` ::: -**Note**: Use version `{{fuels}}` to ensure compatibility with `testnet` network—check the [docs](https://docs.fuel.network/guides/installation/#using-the-latest-toolchain). +Now you are ready to: + +- [Connect to the Network](./connecting-to-the-network.md) diff --git a/apps/docs/src/guide/getting-started/next-steps.md b/apps/docs/src/guide/getting-started/next-steps.md new file mode 100644 index 00000000000..c6fc3d0732d --- /dev/null +++ b/apps/docs/src/guide/getting-started/next-steps.md @@ -0,0 +1,14 @@ +# Done! + +Wait no more, let's build your first Fuel dApp! + +- [Creating a Fuel dApp](../creating-a-fuel-dapp/) + +## Further Resources + +For a more in-depth, step-by-step guide on working with the wider Fuel ecosystem, check out the [Developer Quickstart](https://docs.fuel.network/guides/quickstart/), which uses a more procedural and detailed approach: + +1. Installing all tools needed to develop with the Fuel ecosystem +1. Writing your first Sway Project +1. Deploying your contract +1. Building a simple front-end dApp to interact with your deployed contract diff --git a/apps/docs/src/guide/getting-started/react-example.md b/apps/docs/src/guide/getting-started/react-example.md new file mode 100644 index 00000000000..ff9c3dfebed --- /dev/null +++ b/apps/docs/src/guide/getting-started/react-example.md @@ -0,0 +1,35 @@ +# React Example + + + +```tsx +import { BN, Provider, Wallet } from "fuels"; +import { useEffect, useState } from "react"; + +function App() { + const [balance, setBalance] = useState(0); + + useEffect(() => { + const main = async () => { + const provider = await Provider.create( + "https://mainnet.fuel.network/v1/graphql", + ); + + const wallet = Wallet.fromAddress("0x...", provider); + const { balances } = await wallet.getBalances(); + + setBalance(new BN(balances[0].amount).toNumber()); + }; + + main(); + }, []); + + return
My Balance: {balance}
; +} + +export default App; +``` + +# More + +- [CDN Usage](./cdn-usage.md) diff --git a/apps/docs/src/guide/getting-started/running-a-local-fuel-node.md b/apps/docs/src/guide/getting-started/running-a-local-fuel-node.md new file mode 100644 index 00000000000..97cda0bd168 --- /dev/null +++ b/apps/docs/src/guide/getting-started/running-a-local-fuel-node.md @@ -0,0 +1,35 @@ +# Running a local Fuel node + +Remember to first install the [Fuel Toolchain](https://docs.fuel.network/guides/installation/). + +Check the online docs: + +| | Command | Documentation | +| ----------- | ------------ | ------------------------------------------------------------------------------------------------------ | +| Fuel Binary | `fuel-core` | [docs](https://docs.fuel.network/guides/running-a-node/running-a-local-node/) — Running a local node | +| TS SDK | `fuels node` | [docs](https://docs.fuel.network/docs/fuels-ts/fuels-cli/commands/#fuels-node) — Using the `fuels` CLI | + + + +# Utilities + +## Testing + +You can run a Fuel node from within your `.ts` unit tests: + +- [Launching a test node](../testing/launching-a-test-node.md) + +## Developing + +Configure your project for the `fuels` CLI using a `fuels.config.ts` file: + +- [Using the `fuels init` command](../fuels-cli/commands.md#fuels-init) + +It makes development easier with a hot-reload experience: + +- [Using the `fuels dev` command](../fuels-cli/commands.md#fuels-dev) + +# More + +- [React Example](./react-example.md) +- [CDN Usage](./cdn-usage.md) diff --git a/apps/docs/src/guide/getting-started/snippets/connecting-to-localnode.ts b/apps/docs/src/guide/getting-started/snippets/connecting-to-localnode.ts deleted file mode 100644 index 32d26a15e26..00000000000 --- a/apps/docs/src/guide/getting-started/snippets/connecting-to-localnode.ts +++ /dev/null @@ -1,15 +0,0 @@ -// #region main -import { Provider, Wallet } from 'fuels'; - -import { LOCAL_NETWORK_URL } from '../../../env'; - -const ADDRESS = - '0x767caf5b08eba21c561078a4d5be09bbd7f16b9eca22699a61f1edd9e456126f'; - -const provider = await Provider.create(LOCAL_NETWORK_URL); -const wallet = Wallet.fromAddress(ADDRESS, provider); - -const { balances } = await wallet.getBalances(); - -console.log('Balances', balances); -// #endregion main diff --git a/apps/docs/src/guide/getting-started/snippets/connecting-to-testnet.ts b/apps/docs/src/guide/getting-started/snippets/connecting-to-testnet.ts deleted file mode 100644 index c47478ff548..00000000000 --- a/apps/docs/src/guide/getting-started/snippets/connecting-to-testnet.ts +++ /dev/null @@ -1,15 +0,0 @@ -// #region main -import { Provider, Wallet } from 'fuels'; - -const ADDRESS = - '0x767caf5b08eba21c561078a4d5be09bbd7f16b9eca22699a61f1edd9e456126f'; - -const provider = await Provider.create( - 'https://testnet.fuel.network/v1/graphql' -); -const wallet = Wallet.fromAddress(ADDRESS, provider); - -const { balances } = await wallet.getBalances(); - -console.log('Balances', balances); -// #endregion main diff --git a/apps/docs/src/guide/getting-started/snippets/connecting-to-the-network.ts b/apps/docs/src/guide/getting-started/snippets/connecting-to-the-network.ts new file mode 100644 index 00000000000..b2b15b996c2 --- /dev/null +++ b/apps/docs/src/guide/getting-started/snippets/connecting-to-the-network.ts @@ -0,0 +1,15 @@ +// #region main +import { Provider } from 'fuels'; + +const NETWORK_URL = 'https://mainnet.fuel.network/v1/graphql'; + +const provider = await Provider.create(NETWORK_URL); + +const baseAssetId = provider.getBaseAssetId(); +const chainId = provider.getChainId(); +const gasConfig = provider.getGasConfig(); + +console.log('chainId', chainId); +console.log('baseAssetId', baseAssetId); +console.log('gasConfig', gasConfig); +// #endregion main diff --git a/apps/docs/src/guide/getting-started/usage.md b/apps/docs/src/guide/getting-started/usage.md deleted file mode 100644 index 5e6d24d5962..00000000000 --- a/apps/docs/src/guide/getting-started/usage.md +++ /dev/null @@ -1,50 +0,0 @@ -# Usage - -With the Fuels dependency set up, you can now create a React component that will connect to the Fuel provider and retrieve the base asset balance for a given wallet address. Here's an example of how to do this: - - - -```tsx -import { BN, Provider, Wallet } from "fuels"; -import { useEffect, useState } from "react"; - -function App() { - const [balance, setBalance] = useState(0); - - useEffect(() => { - async () => { - const provider = await Provider.create("https://testnet.fuel.network/v1/graphql"); - const myWallet = Wallet.fromAddress("0x...", provider); - myWallet.getBalances().then((data) => { - setBalance(new BN(data[0].amount).toNumber()); - }); - }() - }, []); - - return
My Balance: {balance}
; -} - -export default App; -``` - -## CDN Usage (browser only) - -For a quick test or just playing around, you can load it in your Web Apps straight from our CDN. - -```html - -``` diff --git a/apps/docs/src/guide/provider/index.md b/apps/docs/src/guide/provider/index.md index 6b004bf3d7b..d8a09b86e83 100644 --- a/apps/docs/src/guide/provider/index.md +++ b/apps/docs/src/guide/provider/index.md @@ -1,6 +1,6 @@ # Provider -The [`Provider`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Provider.html) lets you connect to a Fuel node ([_*local*_](../getting-started/connecting-to-a-local-node.md) or [_*external*_](../getting-started/connecting-to-testnet.md)) and interact with it, encapsulating common client operations in the SDK. Those operations include querying the blockchain for network, block, and transaction-related info (and [more](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Provider.html)), as well as sending [transactions](../transactions/index.md) to the blockchain. +The [`Provider`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Provider.html) lets you connect to a Fuel node ([_*docs*_](../getting-started/connecting-to-the-network.md)) and interact with it, encapsulating common client operations in the SDK. Those operations include querying the blockchain for network, block, and transaction-related info (and [more](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Provider.html)), as well as sending [transactions](../transactions/index.md) to the blockchain. All higher-level abstractions (e.g. [`Wallet`](../wallets/index.md), [`Contract`](../contracts/index.md)) that interact with the blockchain go through the `Provider`, so it's used for various actions like getting a wallet's balance, deploying contracts, querying their state, etc. diff --git a/apps/docs/src/guide/provider/querying-the-chain.md b/apps/docs/src/guide/provider/querying-the-chain.md index 0533208a857..f8ebcc10f6a 100644 --- a/apps/docs/src/guide/provider/querying-the-chain.md +++ b/apps/docs/src/guide/provider/querying-the-chain.md @@ -2,10 +2,7 @@ Once you have set up a provider, you're ready to interact with the Fuel blockchain. -We can connect to either a _*local*_ or an _*external*_ node: - -> 1. _Running a [local node](../getting-started/connecting-to-a-local-node.md)_ -> 1. _Connecting to an [external node](../getting-started/connecting-to-testnet.md)_ +- [Connecting to the Network](../getting-started/connecting-to-the-network.md) Let's look at a few examples below. diff --git a/apps/docs/src/guide/types/address.md b/apps/docs/src/guide/types/address.md index a87f80b38af..73e4a971ea9 100644 --- a/apps/docs/src/guide/types/address.md +++ b/apps/docs/src/guide/types/address.md @@ -10,7 +10,7 @@ The SDK defines the [AbstractAddress](https://fuels-ts-docs-api.vercel.app/class ## Address Class -Besides conforming to the interface of the [`AbstractAddress`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_interfaces.AbstractAddress.html), the [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) class also defines one property; `bech32Address`, which is of the [`Bech32`](./bech32.md) type. +Besides conforming to the interface of the [`AbstractAddress`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_interfaces.AbstractAddress.html), the [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) class also defines one property; `b256Address`, which is of the [`B256`](./bits256.md) type. <<< @/../../../packages/address/src/address.ts#address-2{ts:line-numbers} @@ -18,14 +18,11 @@ Besides conforming to the interface of the [`AbstractAddress`](https://fuels-ts- Thanks to the utility functions provided by the [`AbstractAddress`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_interfaces.AbstractAddress.html) class, there are several ways to create an [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) instance: -### From a `Bech32` Address +### From a b256 address -To create an [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) from a `Bech32` address, use the following code snippet: - -<<< @./snippets/address/creating-an-address.ts#full{ts:line-numbers} +To create an [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) from a 256-bit address, use the following code snippet: -> [!NOTE] Note -> `Bech32` addresses like `fuel1..` are now deprecated. Use `B256` addresses instead. ([help](https://docs.fuel.network/docs/specs/abi/argument-encoding/#b256)) +<<< @./snippets/address/from-a-b256.ts#full{ts:line-numbers} ### From a Public Key @@ -33,17 +30,11 @@ To create an [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_a <<< @./snippets/address/from-a-public-key.ts#full{ts:line-numbers} -### From a 256-bit Address - -To create an [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) from a 256-bit address, use the following code snippet: - -<<< @./snippets/address/from-a-b256.ts#full{ts:line-numbers} - ## Utility Functions The [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) class also provides some practical utility functions: -1. `fromString`: Create a new [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) from an ambiguous source that may be a `Bech32` or `B256` address: +1. `fromString`: Create a new [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) from an ambiguous source that may be a `B256` address: <<< @./snippets/address/utilities-function-1.ts#full{ts:line-numbers} diff --git a/apps/docs/src/guide/types/bech32.md b/apps/docs/src/guide/types/bech32.md deleted file mode 100644 index 58e0d72e4a6..00000000000 --- a/apps/docs/src/guide/types/bech32.md +++ /dev/null @@ -1,22 +0,0 @@ -# `Bech32` - -> [!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 SDK uses the `Bech32` type as the core property of the [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) class, specifically through the `bech32Address` property. - -Originally designed for Bitcoin, the `Bech32` format offers numerous advantages such as enhanced error detection, simplified integrations, and improved compatibility with future upgrades. Given these benefits, the [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) class is constructed around the `Bech32` type. - -You can read more about the `Bech32` type [here](https://thebitcoinmanual.com/articles/btc-bech32-address/). - -## Default Human-Readable Part (HRP) - -A `Bech32` address consists of an HRP (Human-Readable Part) followed by the number `1`, which acts as a separator: - -<<< @/../../../packages/interfaces/src/index.ts#bech32-1{ts:line-numbers} - -A complete `Bech32` address will resemble the following: - -<<< @./snippets/bech32.ts#bech32-2{5 ts:line-numbers} - -The HRP in the example above is `fuel`. This human-readable prefix is included to provide better readability and prevent users from accidentally using addresses on the wrong network. diff --git a/apps/docs/src/guide/types/snippets/address/creating-an-address.ts b/apps/docs/src/guide/types/snippets/address/creating-an-address.ts index bdc0642e38d..377e02066d2 100644 --- a/apps/docs/src/guide/types/snippets/address/creating-an-address.ts +++ b/apps/docs/src/guide/types/snippets/address/creating-an-address.ts @@ -1,10 +1,10 @@ // #region full import { Address } from 'fuels'; -const ADDRESS_BECH32 = - 'fuel1elnmzsav56dqnp95sx4e2pckq36cvae9ser44m5zlvgtwxw49fmqd7e42e'; +const ADDRESS_B256 = + '0xcfe7b143aca69a0984b481ab950716047586772586475aee82fb10b719d52a76'; -const address = new Address(ADDRESS_BECH32); +const address = new Address(ADDRESS_B256); // #endregion full console.log('address', address); diff --git a/apps/docs/src/guide/types/snippets/address/utilities-function-1.ts b/apps/docs/src/guide/types/snippets/address/utilities-function-1.ts index b1acbcd343a..0823a6f9400 100644 --- a/apps/docs/src/guide/types/snippets/address/utilities-function-1.ts +++ b/apps/docs/src/guide/types/snippets/address/utilities-function-1.ts @@ -3,9 +3,7 @@ import { Address } from 'fuels'; const address = Address.fromRandom(); -const addressCloneFromBech = Address.fromString(address.toString()); const addressCloneFromB256 = Address.fromString(address.toB256()); // #endregion full -console.log('addressCloneFromBech', addressCloneFromBech); console.log('addressCloneFromB256', addressCloneFromB256); diff --git a/apps/docs/src/guide/types/snippets/b256.ts b/apps/docs/src/guide/types/snippets/b256.ts new file mode 100644 index 00000000000..595b44ff156 --- /dev/null +++ b/apps/docs/src/guide/types/snippets/b256.ts @@ -0,0 +1,6 @@ +// #region addresses-1 +const b256 = + '0x9ae5b658754e096e4d681c548daf46354495a437cc61492599e33fc64dcdc30c'; +// #endregion addresses-1 + +console.log('b256', b256); diff --git a/apps/docs/src/guide/types/snippets/bech32.ts b/apps/docs/src/guide/types/snippets/bech32.ts deleted file mode 100644 index 5e3c399ec44..00000000000 --- a/apps/docs/src/guide/types/snippets/bech32.ts +++ /dev/null @@ -1,16 +0,0 @@ -// #region bech32-2 -import { Address } from 'fuels'; - -const address = Address.fromRandom(); - -console.log('Bech32', address.bech32Address); - -// fuel1d5cfwekq78r0zq73g7eg0747etkaxxltrqx5tncm7lvg89awe3hswhqjhs -// #endregion bech32-2 - -// #region addresses-1 -const bech32 = - 'fuel1d5cfwekq78r0zq73g7eg0747etkaxxltrqx5tncm7lvg89awe3hswhqjhs'; -// #endregion addresses-1 - -console.log('bech32', bech32); diff --git a/apps/docs/src/guide/utilities/address-conversion.md b/apps/docs/src/guide/utilities/address-conversion.md index 2bb1eaf8c82..ba42aeca586 100644 --- a/apps/docs/src/guide/utilities/address-conversion.md +++ b/apps/docs/src/guide/utilities/address-conversion.md @@ -2,12 +2,9 @@ Addresses and varying address formats are commonplace when interacting with decentralized applications. Furthermore, different networks may enforce different address formats. -The Fuel Network uses the [`Bech32`](../types/bech32.md) address format for its interactions, an example of which can be seen below: +The Fuel Network uses the [`Bits256`](../types/bits256.md) address format for its interactions, an example of which can be seen below: -<<< @/../../docs/src/guide/types/snippets/bech32.ts#addresses-1{ts:line-numbers} - -> [!NOTE] Note -> `Bech32` addresses like `fuel1..` are now deprecated. Use `B256` addresses instead. ([help](https://docs.fuel.network/docs/specs/abi/argument-encoding/#b256)) +<<< @/../../docs/src/guide/types/snippets/b256.ts#addresses-1{ts:line-numbers} However, a hexlified [Bits256](../types/bits256.md) (hex) is another common address format; an example can be seen below: @@ -26,26 +23,6 @@ The following [conversion guide](./address-conversion.md#address-conversion) wil This guide demonstrates how to convert between address formats and Sway Standard Types using helper functions. Native types are wrappers for bytes, and you can perform conversions between them by leveraging these functions and classes. -## From `Bech32` to `b256` - -By instantiating an [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html), we can validate a `Bech32` address and easily convert it to a `b256`: - -<<< @./snippets/address-conversion/bech32-to-b256.ts#conversion-5{ts:line-numbers} - -Or, if you'd prefer to use utility functions directly for validation and conversion, you can use `isBech32` and `toB256`: - -<<< @./snippets/address-conversion/bech32-to-b256-utilities.ts#conversion-6{ts:line-numbers} - -## From `b256` to `Bech32` - -In a similar fashion, we have both class functions on the [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) and utilities available for `b256` validation and conversion: - -<<< @./snippets/address-conversion/b256-to-bech32.ts#conversion-7{ts:line-numbers} - -And by using the `isB256` and `toBech32` utilities: - -<<< @./snippets/address-conversion/b256-to-bech32-utilities.ts#conversion-8{ts:line-numbers} - ## Converting a Contract ID The Contract `id` property has the [`AbstractAddress`](../types/address.md#abstractaddress-class) type. Therefore, it can be converted using the [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) class functions such as `toAddress` and `toB256`: diff --git a/apps/docs/src/guide/utilities/snippets/address-conversion/b256-to-bech32-utilities.ts b/apps/docs/src/guide/utilities/snippets/address-conversion/b256-to-bech32-utilities.ts deleted file mode 100644 index f06ca69b731..00000000000 --- a/apps/docs/src/guide/utilities/snippets/address-conversion/b256-to-bech32-utilities.ts +++ /dev/null @@ -1,12 +0,0 @@ -// #region conversion-8 -import { isB256, toBech32 } from 'fuels'; - -const b256 = - '0x6d309766c0f1c6f103d147b287fabecaedd31beb180d45cf1bf7d88397aecc6f'; -const bech32 = isB256(b256) ? toBech32(b256) : null; -// fuel1d5cfwekq78r0zq73g7eg0747etkaxxltrqx5tncm7lvg89awe3hswhqjhs -// #endregion conversion-8 - -const expectedBech32 = - 'fuel1d5cfwekq78r0zq73g7eg0747etkaxxltrqx5tncm7lvg89awe3hswhqjhs'; -console.log('Bech32 should be equal to example', bech32 === expectedBech32); diff --git a/apps/docs/src/guide/utilities/snippets/address-conversion/b256-to-bech32.ts b/apps/docs/src/guide/utilities/snippets/address-conversion/b256-to-bech32.ts deleted file mode 100644 index 24dc999e4aa..00000000000 --- a/apps/docs/src/guide/utilities/snippets/address-conversion/b256-to-bech32.ts +++ /dev/null @@ -1,16 +0,0 @@ -// #region conversion-7 -import type { B256Address, Bech32Address } from 'fuels'; -import { Address } from 'fuels'; - -const b256: B256Address = - '0x6d309766c0f1c6f103d147b287fabecaedd31beb180d45cf1bf7d88397aecc6f'; - -const address: Address = Address.fromDynamicInput(b256); - -const bech32: Bech32Address = address.bech32Address; -// fuel1d5cfwekq78r0zq73g7eg0747etkaxxltrqx5tncm7lvg89awe3hswhqjhs -// #endregion conversion-7 - -const expectedBech32 = - 'fuel1d5cfwekq78r0zq73g7eg0747etkaxxltrqx5tncm7lvg89awe3hswhqjhs'; -console.log('Bech32 should be equal to example', bech32 === expectedBech32); diff --git a/apps/docs/src/guide/utilities/snippets/address-conversion/bech32-to-b256-utilities.ts b/apps/docs/src/guide/utilities/snippets/address-conversion/bech32-to-b256-utilities.ts deleted file mode 100644 index 037e6e7e7a3..00000000000 --- a/apps/docs/src/guide/utilities/snippets/address-conversion/bech32-to-b256-utilities.ts +++ /dev/null @@ -1,14 +0,0 @@ -// #region conversion-6 -import type { B256Address, Bech32Address } from 'fuels'; -import { isBech32, toB256 } from 'fuels'; - -const bech32: Bech32Address = - 'fuel1d5cfwekq78r0zq73g7eg0747etkaxxltrqx5tncm7lvg89awe3hswhqjhs'; - -const b256: B256Address | null = isBech32(bech32) ? toB256(bech32) : null; -// 0x6d309766c0f1c6f103d147b287fabecaedd31beb180d45cf1bf7d88397aecc6f -// #endregion conversion-6 - -const expectedB256 = - '0x6d309766c0f1c6f103d147b287fabecaedd31beb180d45cf1bf7d88397aecc6f'; -console.log('B256 should be equal to example', b256 === expectedB256); diff --git a/apps/docs/src/guide/utilities/snippets/address-conversion/bech32-to-b256.ts b/apps/docs/src/guide/utilities/snippets/address-conversion/bech32-to-b256.ts deleted file mode 100644 index 82af1183028..00000000000 --- a/apps/docs/src/guide/utilities/snippets/address-conversion/bech32-to-b256.ts +++ /dev/null @@ -1,16 +0,0 @@ -// #region conversion-5 -import type { B256Address, Bech32Address } from 'fuels'; -import { Address } from 'fuels'; - -const bech32: Bech32Address = - 'fuel1d5cfwekq78r0zq73g7eg0747etkaxxltrqx5tncm7lvg89awe3hswhqjhs'; - -const address: Address = Address.fromDynamicInput(bech32); - -const b256: B256Address = address.toB256(); -// 0x6d309766c0f1c6f103d147b287fabecaedd31beb180d45cf1bf7d88397aecc6f -// #endregion conversion-5 - -const expectedB256 = - '0x6d309766c0f1c6f103d147b287fabecaedd31beb180d45cf1bf7d88397aecc6f'; -console.log('B256 should be equal to example', b256 === expectedB256); diff --git a/apps/docs/src/guide/utilities/snippets/address-conversion/contract.ts b/apps/docs/src/guide/utilities/snippets/address-conversion/contract.ts index be3dac1d8ac..c18a8e5607e 100644 --- a/apps/docs/src/guide/utilities/snippets/address-conversion/contract.ts +++ b/apps/docs/src/guide/utilities/snippets/address-conversion/contract.ts @@ -1,5 +1,5 @@ // #region conversion-2 -import type { Bech32Address } from 'fuels'; +import type { B256Address } from 'fuels'; import { Address, Provider, Contract } from 'fuels'; import { LOCAL_NETWORK_URL } from '../../../../env'; @@ -14,10 +14,10 @@ const contractAddress = Address.fromB256( const contract = new Contract(contractAddress, contractAbi, provider); -const bech32: Bech32Address = contract.id.toAddress(); -// fuel1d5cfwekq78r0zq73g7eg0747etkaxxltrqx5tncm7lvg89awe3hswhqjhs +const b256: B256Address = contract.id.toAddress(); +// 0x6d309766c0f1c6f103d147b287fabecaedd31beb180d45cf1bf7d88397aecc6f // #endregion conversion-2 -const expectedBech32 = - 'fuel1d5cfwekq78r0zq73g7eg0747etkaxxltrqx5tncm7lvg89awe3hswhqjhs'; -console.log('Bech32 address should equal expected', bech32 === expectedBech32); +const expectedB256 = + '0x6d309766c0f1c6f103d147b287fabecaedd31beb180d45cf1bf7d88397aecc6f'; +console.log('B256 address should equal expected', b256 === expectedB256); diff --git a/apps/docs/src/guide/utilities/snippets/address-conversion/wallet.ts b/apps/docs/src/guide/utilities/snippets/address-conversion/wallet.ts index 9301faa9957..a5522f62979 100644 --- a/apps/docs/src/guide/utilities/snippets/address-conversion/wallet.ts +++ b/apps/docs/src/guide/utilities/snippets/address-conversion/wallet.ts @@ -1,5 +1,5 @@ // #region conversion-3 -import type { Bech32Address, WalletLocked } from 'fuels'; +import type { B256Address, WalletLocked } from 'fuels'; import { Address, Provider, Wallet } from 'fuels'; import { LOCAL_NETWORK_URL } from '../../../../env'; @@ -12,10 +12,10 @@ const address = Address.fromB256( const wallet: WalletLocked = Wallet.fromAddress(address, provider); -const bech32: Bech32Address = wallet.address.toAddress(); -// fuel1d5cfwekq78r0zq73g7eg0747etkaxxltrqx5tncm7lvg89awe3hswhqjhs +const b256: B256Address = wallet.address.toAddress(); +// 0x6d309766c0f1c6f103d147b287fabecaedd31beb180d45cf1bf7d88397aecc6f // #endregion conversion-3 -const expectedBech32 = - 'fuel1d5cfwekq78r0zq73g7eg0747etkaxxltrqx5tncm7lvg89awe3hswhqjhs'; -console.log('Bech32 address should equal expected', bech32 === expectedBech32); +const expectedB256 = + '0x6d309766c0f1c6f103d147b287fabecaedd31beb180d45cf1bf7d88397aecc6f'; +console.log('b256 address should equal expected', b256 === expectedB256); diff --git a/apps/docs/src/guide/wallets/instantiating-wallets.md b/apps/docs/src/guide/wallets/instantiating-wallets.md index 8c15954f6b5..b7a501ee524 100644 --- a/apps/docs/src/guide/wallets/instantiating-wallets.md +++ b/apps/docs/src/guide/wallets/instantiating-wallets.md @@ -40,7 +40,7 @@ It's possible to instantiate a `WalletUnlocked` from a `WalletLocked`: You can also instantiate [`WalletLocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletLocked.html) instances using just the wallet address: -<<< @./snippets/instantiating/from-bech32-address.ts#instantiating-wallets-8{ts:line-numbers} +<<< @./snippets/instantiating/from-b256-address.ts#instantiating-wallets-8{ts:line-numbers} ## Connecting to a Provider diff --git a/apps/docs/src/guide/wallets/snippets/instantiating/from-bech32-address.ts b/apps/docs/src/guide/wallets/snippets/instantiating/from-b256-address.ts similarity index 58% rename from apps/docs/src/guide/wallets/snippets/instantiating/from-bech32-address.ts rename to apps/docs/src/guide/wallets/snippets/instantiating/from-b256-address.ts index 1ef57e2f503..795333a26ae 100644 --- a/apps/docs/src/guide/wallets/snippets/instantiating/from-bech32-address.ts +++ b/apps/docs/src/guide/wallets/snippets/instantiating/from-b256-address.ts @@ -1,8 +1,8 @@ // #region instantiating-wallets-8 -import type { WalletLocked } from 'fuels'; +import type { B256Address, WalletLocked } from 'fuels'; import { Wallet } from 'fuels'; -const address = `fuel14kjrdcdcp7z4l9xk0pm3cwz9qnjxxd04wx4zgnc3kknslclxzezqyeux5d`; +const address: B256Address = `0x6d309766c0f1c6f103d147b287fabecaedd31beb180d45cf1bf7d88397aecc6f`; const wallet: WalletLocked = Wallet.fromAddress(address); // #endregion instantiating-wallets-8 diff --git a/apps/docs/src/guide/wallets/snippets/instantiating/unlock-from-private-key.ts b/apps/docs/src/guide/wallets/snippets/instantiating/unlock-from-private-key.ts index 2e27e7cfd66..1785aa15f89 100644 --- a/apps/docs/src/guide/wallets/snippets/instantiating/unlock-from-private-key.ts +++ b/apps/docs/src/guide/wallets/snippets/instantiating/unlock-from-private-key.ts @@ -3,7 +3,7 @@ import type { WalletLocked, WalletUnlocked } from 'fuels'; import { Wallet } from 'fuels'; const address = - 'fuel1fjett54ahnydhklerngqhclzmmkmp6s0xnykns8dwsdpjfg3r2rsfazpw5'; + '0x4cb2b5d2bdbcc8dbdbf91cd00be3e2deedb0ea0f34c969c0ed741a1925111a87'; const privateKey = '0x9deba03f08676716e3a4247797672d8008a5198d183048be65415ef89447b890'; diff --git a/apps/docs/src/guide/wallets/snippets/signing/sign-message.ts b/apps/docs/src/guide/wallets/snippets/signing/sign-message.ts index 094919d72b7..1088a24edab 100644 --- a/apps/docs/src/guide/wallets/snippets/signing/sign-message.ts +++ b/apps/docs/src/guide/wallets/snippets/signing/sign-message.ts @@ -16,7 +16,7 @@ const hashedMessage = hashMessage(message); const recoveredAddress = Signer.recoverAddress(hashedMessage, signedMessage); // Example output: Address { -// bech32Address: 'fuel1za0wl90u09c6v88faqkvczu9r927kewvvr0asejv5xmdwtm98w0st7m2s3' +// b256Address: '0x6d309766c0f1c6f103d147b287fabecaedd31beb180d45cf1bf7d88397aecc6f' // } // #endregion signing-1 diff --git a/link-check.config.json b/link-check.config.json index b269b14e999..8ce8f969d75 100644 --- a/link-check.config.json +++ b/link-check.config.json @@ -7,6 +7,12 @@ "ignorePatterns": [ { "pattern": "^http://localhost:3000" + }, + { + "pattern": "https://docs.fuel.network/docs/fuels-ts/getting-started/connecting-to-the-network" + }, + { + "pattern": "https://docs.fuel.network/docs/fuels-ts/getting-started/running-a-local-fuel-node" } ] } diff --git a/packages/abi-coder/src/encoding/coders/BigNumberCoder.test.ts b/packages/abi-coder/src/encoding/coders/BigNumberCoder.test.ts index 2cd1632c752..ff0718c1ce8 100644 --- a/packages/abi-coder/src/encoding/coders/BigNumberCoder.test.ts +++ b/packages/abi-coder/src/encoding/coders/BigNumberCoder.test.ts @@ -23,6 +23,52 @@ describe('BigNumberCoder', () => { expect(actual).toStrictEqual(expected); }); + it('should encode a u64 [max safe integer]', () => { + const coder = new BigNumberCoder('u64'); + const value: number = Number.MAX_SAFE_INTEGER; + const expected = new Uint8Array([0, 31, 255, 255, 255, 255, 255, 255]); + + const data = coder.encode(value); + + expect(data).toEqual(expected); + }); + + it('should throw an error when encoding [number more than max safe integer]', async () => { + const coder = new BigNumberCoder('u64'); + const value: number = Number.MAX_SAFE_INTEGER + 1; + + await expectToThrowFuelError( + () => coder.encode(value), + new FuelError( + ErrorCode.ENCODE_ERROR, + 'Invalid u64 type - number value is too large. Number can only safely handle up to 53 bits.' + ) + ); + }); + + it('should encode a u64 [very big number - as string]', () => { + const coder = new BigNumberCoder('u64'); + const value: string = '76472027892439376'; + const expected = new Uint8Array([1, 15, 174, 231, 121, 200, 89, 80]); + + const data = coder.encode(value); + + expect(data).toEqual(expected); + }); + + it('should throw an error when encoding [number more than max safe integer]', async () => { + const coder = new BigNumberCoder('u64'); + const value: number = 76472027892439376; + + await expectToThrowFuelError( + () => coder.encode(value), + new FuelError( + ErrorCode.ENCODE_ERROR, + 'Invalid u64 type - number value is too large. Number can only safely handle up to 53 bits.' + ) + ); + }); + it('should decode a u64 number', () => { const coder = new BigNumberCoder('u64'); const expectedValue = 0; @@ -34,6 +80,17 @@ describe('BigNumberCoder', () => { expect(actualLength).toBe(expectedLength); }); + it('should decode a u64 [very big number]', () => { + const coder = new BigNumberCoder('u64'); + const data = new Uint8Array([1, 15, 174, 231, 121, 200, 89, 80]); + const expectedValue = bn('76472027892439376'); + + const [actualValue, actualLength] = coder.decode(data, 0); + + expect(actualValue).toEqualBn(expectedValue); + expect(actualLength).toEqual(8); + }); + it('should encode u8 max number', () => { const coder = new BigNumberCoder('u64'); const expected = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 255]); diff --git a/packages/abi-coder/src/encoding/coders/BigNumberCoder.ts b/packages/abi-coder/src/encoding/coders/BigNumberCoder.ts index 08e8c58eb5c..b421bec9ab8 100644 --- a/packages/abi-coder/src/encoding/coders/BigNumberCoder.ts +++ b/packages/abi-coder/src/encoding/coders/BigNumberCoder.ts @@ -20,6 +20,16 @@ export class BigNumberCoder extends Coder { encode(value: BNInput): Uint8Array { let bytes; + // We throw an error if the value is a number and it's more than the max safe integer + // This is because we can experience some odd behavior with integers more than the max safe integer + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER#description + if (typeof value === 'number' && value > Number.MAX_SAFE_INTEGER) { + throw new FuelError( + ErrorCode.ENCODE_ERROR, + `Invalid ${this.type} type - number value is too large. Number can only safely handle up to 53 bits.` + ); + } + try { bytes = toBytes(value, this.encodedLength); } catch (error) { diff --git a/packages/account/src/signer/signer.test.ts b/packages/account/src/signer/signer.test.ts index a6edf44d149..a24c9ef0593 100644 --- a/packages/account/src/signer/signer.test.ts +++ b/packages/account/src/signer/signer.test.ts @@ -11,7 +11,7 @@ describe('Signer', () => { const expectedPrivateKey = '0x5f70feeff1f229e4a95e1056e8b4d80d0b24b565674860cc213bdb07127ce1b1'; const expectedPublicKey = '0x2f34bc0df4db0ec391792cedb05768832b49b1aa3a2dd8c30054d1af00f67d00b74b7acbbf3087c8e0b1a4c343db50aa471d21f278ff5ce09f07795d541fb47e'; - const expectedAddress = 'fuel1785jcs4epy625cmjuv9u269rymmwv6s6q2y9jhnw877nj2j08ehqce3rxf'; + const expectedAddress = '0xf1e92c42b90934aa6372e30bc568a326f6e66a1a0288595e6e3fbd392a4f3e6e'; const expectedMessage = 'my message'; const expectedB256Address = '0xf1e92c42b90934aa6372e30bc568a326f6e66a1a0288595e6e3fbd392a4f3e6e'; const expectedSignedMessage = diff --git a/packages/account/src/wallet/keystore-wallet.test.ts b/packages/account/src/wallet/keystore-wallet.test.ts index c68d6331ac8..036f395f27b 100644 --- a/packages/account/src/wallet/keystore-wallet.test.ts +++ b/packages/account/src/wallet/keystore-wallet.test.ts @@ -14,7 +14,7 @@ describe('Keystore Wallet', () => { const privateKey = '0xeac85e732b683119e62fb52ce3b04c0d2f60539cd55af34c731fcdcf802e5ef4'; const address = Address.fromAddressOrString( - 'fuel1v77yj3g6xcatrhkcz72m2njx4cxxzgj8yepywz7ylf4fhkpptawqkh3dft' + '0x67bc49451a363ab1ded81795b54e46ae0c6122472642470bc4fa6a9bd8215f5c' ); const password = '123456'; diff --git a/packages/account/src/wallet/wallet-unlocked.test.ts b/packages/account/src/wallet/wallet-unlocked.test.ts index b21576af0da..b9e7b1dc7ed 100644 --- a/packages/account/src/wallet/wallet-unlocked.test.ts +++ b/packages/account/src/wallet/wallet-unlocked.test.ts @@ -23,7 +23,7 @@ describe('WalletUnlocked', () => { const expectedPrivateKey = '0x5f70feeff1f229e4a95e1056e8b4d80d0b24b565674860cc213bdb07127ce1b1'; const expectedPublicKey = '0x2f34bc0df4db0ec391792cedb05768832b49b1aa3a2dd8c30054d1af00f67d00b74b7acbbf3087c8e0b1a4c343db50aa471d21f278ff5ce09f07795d541fb47e'; - const expectedAddress = 'fuel1785jcs4epy625cmjuv9u269rymmwv6s6q2y9jhnw877nj2j08ehqce3rxf'; + const expectedAddress = '0xf1e92c42b90934aa6372e30bc568a326f6e66a1a0288595e6e3fbd392a4f3e6e'; const expectedMessage = 'my message'; const expectedSignedMessage = '0x8eeb238db1adea4152644f1cd827b552dfa9ab3f4939718bb45ca476d167c6512a656f4d4c7356bfb9561b14448c230c6e7e4bd781df5ee9e5999faa6495163d'; diff --git a/packages/address/README.md b/packages/address/README.md index 73b0cb482f7..26620e2a7f7 100644 --- a/packages/address/README.md +++ b/packages/address/README.md @@ -2,10 +2,7 @@ **@fuel-ts/address** is a sub-module for interacting with **Fuel**. -This module contains the utilities for encoding and decoding address and contract ids between Bech32 and other address formats. - -> [!NOTE] Note -> `Bech32` addresses like `fuel1..` are now deprecated. Use `B256` addresses instead. ([help](https://docs.fuel.network/docs/specs/abi/argument-encoding/#b256)) +This module contains the utilities for encoding and decoding address and contract ids between B256 and other address formats. # Table of contents diff --git a/packages/address/package.json b/packages/address/package.json index bbd00cdc526..d54451e5dc6 100644 --- a/packages/address/package.json +++ b/packages/address/package.json @@ -41,7 +41,6 @@ "@fuel-ts/errors": "workspace:*", "@fuel-ts/interfaces": "workspace:*", "@fuel-ts/utils": "workspace:*", - "@noble/hashes": "1.5.0", - "bech32": "2.0.0" + "@noble/hashes": "1.5.0" } } diff --git a/packages/address/src/address.test.ts b/packages/address/src/address.test.ts index 12e62237ba1..a168d1e9104 100644 --- a/packages/address/src/address.test.ts +++ b/packages/address/src/address.test.ts @@ -1,6 +1,6 @@ import { FuelError } from '@fuel-ts/errors'; import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils'; -import type { AssetId, B256AddressEvm, Bech32Address, EvmAddress } from '@fuel-ts/interfaces'; +import type { AssetId, B256Address, B256AddressEvm, EvmAddress } from '@fuel-ts/interfaces'; import Address from './address'; import * as utils from './utils'; @@ -11,19 +11,12 @@ const ADDRESS_B256 = '0xef86afa9696cf0dc6385e2c407a6e159a1103cefb7e2ae0636fb33d3 const ADDRESS_B256_EVM_PADDED: B256AddressEvm = '0x00000000000000000000000007a6e159a1103cefb7e2ae0636fb33d3cb2a9e4a'; const ADDRESS_EVM = '0x07a6e159a1103cefb7e2ae0636fb33d3cb2a9e4a'; -const ADDRESS_BECH32: Bech32Address = - 'fuel1a7r2l2tfdncdccu9utzq0fhptxs3q080kl32up3klvea8je2ne9qrqnt6n'; const ADDRESS_CHECKSUM = '0xEf86Afa9696cF0Dc6385E2c407a6E159A1103CEfb7e2Ae0636fb33D3cb2A9e4a'; -const ADDRESS_WORDS = [ - 29, 30, 3, 10, 31, 10, 11, 9, 13, 19, 24, 13, 24, 24, 28, 5, 28, 11, 2, 0, 15, 9, 23, 1, 11, 6, - 16, 17, 0, 15, 7, 15, 22, 31, 17, 10, 28, 1, 17, 22, 31, 12, 25, 29, 7, 18, 25, 10, 19, 25, 5, 0, -]; const ADDRESS_BYTES = [ 239, 134, 175, 169, 105, 108, 240, 220, 99, 133, 226, 196, 7, 166, 225, 89, 161, 16, 60, 239, 183, 226, 174, 6, 54, 251, 51, 211, 203, 42, 158, 74, ]; -const expectedAddress = 'fuel1785jcs4epy625cmjuv9u269rymmwv6s6q2y9jhnw877nj2j08ehqce3rxf'; const expectedB256Address = '0xf1e92c42b90934aa6372e30bc568a326f6e66a1a0288595e6e3fbd392a4f3e6e'; /** @@ -31,51 +24,12 @@ const expectedB256Address = '0xf1e92c42b90934aa6372e30bc568a326f6e66a1a0288595e6 * @group browser */ describe('Address utils', () => { - test('fromBech32 (bech32 to decoded bech32)', () => { - const result = utils.fromBech32(ADDRESS_BECH32); - - expect(result).toEqual({ - prefix: utils.FUEL_BECH32_HRP_PREFIX, - words: ADDRESS_WORDS, - }); - }); - - test('normalizeBech32 (bech32 to lowercase bech32)', () => { - const result = utils.normalizeBech32(ADDRESS_BECH32.toUpperCase() as Bech32Address); - - expect(result).toEqual(ADDRESS_BECH32); - }); - - test('isBech32 (bech32)', () => { - const result = utils.isBech32(ADDRESS_BECH32); - - expect(result).toBeTruthy(); - }); - - test('isBech32 (b256)', () => { - const result = utils.isBech32(ADDRESS_B256); - - expect(result).toBeFalsy(); - }); - - test('isBech32 (bytes)', () => { - const result = utils.isBech32(new Uint8Array(ADDRESS_BYTES)); - - expect(result).toBeFalsy(); - }); - test('isB256 (b256)', () => { const result = utils.isB256(ADDRESS_B256); expect(result).toBeTruthy(); }); - test('isB256 (bech32)', () => { - const result = utils.isB256(ADDRESS_BECH32); - - expect(result).toBeFalsy(); - }); - test('isB256 (invalid chars)', () => { const result = utils.isB256(`${ADDRESS_B256}/?`); @@ -100,12 +54,6 @@ describe('Address utils', () => { expect(result).toBeFalsy(); }); - test('isB256 (using toB256)', () => { - const result = utils.isB256(utils.toB256(ADDRESS_BECH32)); - - expect(result).toBeTruthy(); - }); - test('isPublicKey (publicKey)', () => { const result = utils.isPublicKey(PUBLIC_KEY); @@ -166,43 +114,8 @@ describe('Address utils', () => { expect(result).toBeFalsy(); }); - test('getBytesFromBech32 (bech32 to Uint8Array)', () => { - const result = utils.getBytesFromBech32(ADDRESS_BECH32); - - expect(result).toEqual(new Uint8Array(ADDRESS_BYTES)); - }); - - test('toBech32 (b256 to bech32)', () => { - const result = utils.toBech32(ADDRESS_B256); - - expect(result).toEqual(ADDRESS_BECH32); - }); - - test('toB256 (bech32 to b256)', () => { - const result = utils.toB256(ADDRESS_BECH32); - - expect(result).toEqual(ADDRESS_B256); - }); - - test('toB256 (b256 to b256)', async () => { - const address = ADDRESS_B256 as Bech32Address; - const expectedError = new FuelError( - FuelError.CODES.INVALID_BECH32_ADDRESS, - `Invalid Bech32 Address: ${address}.` - ); - await expectToThrowFuelError(() => utils.toB256(address), expectedError); - }); - - test('toBech32=>toB256', () => { - const ADDRESS = '0x000000000000000000000000000000000000000000000000000000000000002a'; - const result = utils.toBech32(ADDRESS); - const finalResult = utils.toB256(result); - - expect(finalResult).toEqual(ADDRESS); - }); - test('clearFirst12BytesFromB256 (b256 to evm b256)', () => { - const result = utils.clearFirst12BytesFromB256(ADDRESS_B256); + const result = utils.toB256AddressEvm(ADDRESS_B256); expect(result).toEqual(ADDRESS_B256_EVM_PADDED); }); @@ -213,7 +126,7 @@ describe('Address utils', () => { FuelError.CODES.PARSE_FAILED, `Cannot generate EVM Address B256 from: ${invalidB256}.` ); - await expectToThrowFuelError(() => utils.clearFirst12BytesFromB256(invalidB256), expectedError); + await expectToThrowFuelError(() => utils.toB256AddressEvm(invalidB256), expectedError); }); test('padFirst12BytesOfEvmAddress (evm Address to b256)', () => { @@ -237,9 +150,9 @@ describe('Address utils', () => { describe('Address class', () => { test('instantiate an Address class', () => { - const result = new Address(ADDRESS_BECH32.toUpperCase() as Bech32Address); + const result = new Address(ADDRESS_B256.toUpperCase() as B256Address); - expect(result.toAddress()).toEqual(ADDRESS_BECH32); + expect(result.toAddress()).toEqual(ADDRESS_B256); expect(result.toString()).toEqual(ADDRESS_CHECKSUM); expect(`cast as string${result}`).toEqual(`cast as string${ADDRESS_CHECKSUM}`); expect(result.toB256()).toEqual(ADDRESS_B256); @@ -247,8 +160,8 @@ describe('Address class', () => { }); test('instance equality', () => { - const resultA = new Address(ADDRESS_BECH32); - const resultB = new Address(ADDRESS_BECH32.toUpperCase() as Bech32Address); + const resultA = new Address(ADDRESS_B256); + const resultB = new Address(ADDRESS_B256.toUpperCase() as B256Address); expect(resultA).toEqual(resultB); expect(resultA.equals(resultB)).toBeTruthy(); @@ -258,7 +171,7 @@ describe('Address class', () => { test('create an Address class using public key', () => { const address = Address.fromPublicKey(PUBLIC_KEY); - expect(address.toAddress()).toEqual(expectedAddress); + expect(address.toAddress()).toEqual(expectedB256Address); expect(address.toB256()).toEqual(expectedB256Address); }); @@ -275,7 +188,7 @@ describe('Address class', () => { test('create an Address class using b256Address', () => { const address = Address.fromB256(ADDRESS_B256); - expect(address.toAddress()).toEqual(ADDRESS_BECH32); + expect(address.toAddress()).toEqual(ADDRESS_B256); expect(address.toB256()).toEqual(ADDRESS_B256); }); @@ -289,13 +202,13 @@ describe('Address class', () => { await expectToThrowFuelError(() => Address.fromB256(address), expectedError); }); - test('when parsing to JSON it should show the bech32 address', () => { + test('when parsing to JSON it should show the b256 address', () => { const result = Address.fromB256(expectedB256Address); - expect(JSON.stringify(result)).toEqual(`"${expectedAddress}"`); + expect(JSON.stringify(result)).toEqual(`"${expectedB256Address}"`); }); test('valueOf matches toString', () => { - const address = new Address(ADDRESS_BECH32); + const address = new Address(ADDRESS_B256); expect(address.toString()).toEqual(address.valueOf()); }); @@ -303,18 +216,18 @@ describe('Address class', () => { test('create an Address class fromDynamicInput [public key]', () => { const address = Address.fromDynamicInput(PUBLIC_KEY); - expect(address.toAddress()).toEqual(expectedAddress); + expect(address.toAddress()).toEqual(expectedB256Address); expect(address.toB256()).toEqual(expectedB256Address); }); test('create an Address class fromDynamicInput [b256Address]', () => { const address = Address.fromDynamicInput(expectedB256Address); - expect(address.toAddress()).toEqual(expectedAddress); + expect(address.toAddress()).toEqual(expectedB256Address); }); - test('create an Address class fromDynamicInput [bech32Address]', () => { - const address = Address.fromDynamicInput(expectedAddress); + test('create an Address class fromDynamicInput [b256Address]', () => { + const address = Address.fromDynamicInput(expectedB256Address); expect(address.toB256()).toEqual(expectedB256Address); }); @@ -328,7 +241,7 @@ describe('Address class', () => { test('create an Address class fromDynamicInput [bad input]', async () => { const expectedError = new FuelError( FuelError.CODES.PARSE_FAILED, - `Unknown address format: only 'Bech32', 'B256', or 'Public Key (512)' are supported.` + `Unknown address format: only 'B256', or 'Public Key (512)' are supported.` ); await expectToThrowFuelError(() => Address.fromDynamicInput('badinput'), expectedError); }); @@ -390,7 +303,7 @@ describe('Address class', () => { test('validate checksum address for invalid types', () => { const address = Address.fromRandom(); - expect(Address.isChecksumValid(address.toB256())).toBeFalsy(); + expect(Address.isChecksumValid(address.toB256().toLowerCase())).toBeFalsy(); expect( Address.isChecksumValid('0x9cfB2CAd509D417ec40b70ebE1DD72a3624D46fdD1Ea5420dBD755CE7f4dc897') ).toBeFalsy(); diff --git a/packages/address/src/address.ts b/packages/address/src/address.ts index 6f99a248fe5..c6ac5de0744 100644 --- a/packages/address/src/address.ts +++ b/packages/address/src/address.ts @@ -1,27 +1,17 @@ import { FuelError } from '@fuel-ts/errors'; import { AbstractAddress } from '@fuel-ts/interfaces'; -import type { - Bech32Address, - B256Address, - EvmAddress, - AssetId, - ChecksumAddress, -} from '@fuel-ts/interfaces'; +import type { B256Address, EvmAddress, AssetId, ChecksumAddress } from '@fuel-ts/interfaces'; import { arrayify, hexlify } from '@fuel-ts/utils'; import { sha256 } from '@noble/hashes/sha256'; import { - normalizeBech32, - isBech32, - toB256, - getBytesFromBech32, - toBech32, getRandomB256, isPublicKey, isB256, - clearFirst12BytesFromB256, isEvmAddress, padFirst12BytesOfEvmAddress, + toB256AddressEvm, + normalizeB256, } from './utils'; /** @@ -30,31 +20,23 @@ import { */ export default class Address extends AbstractAddress { // #region address-2 - /** - * @deprecated - * Type `Bech32Address` is now deprecated, as is this property. Use `B256` addresses instead. ([help](https://docs.fuel.network/docs/specs/abi/argument-encoding/#b256)) - */ - readonly bech32Address: Bech32Address; + readonly b256Address: B256Address; // #endregion address-2 /** - * @param address - A Bech32 address or B256 address + * @param address - A B256 address */ - constructor(address: Bech32Address | B256Address) { + constructor(address: B256Address) { super(); - if (isB256(address)) { - this.bech32Address = toBech32(address); - } else { - this.bech32Address = normalizeBech32(address as Bech32Address); - - if (!isBech32(this.bech32Address)) { - throw new FuelError( - FuelError.CODES.INVALID_BECH32_ADDRESS, - `Invalid Bech32 Address: ${this.bech32Address}.` - ); - } + if (!isB256(address)) { + throw new FuelError( + FuelError.CODES.INVALID_B256_ADDRESS, + `Invalid B256 Address: ${address}.` + ); } + + this.b256Address = normalizeB256(address); } /** @@ -64,38 +46,38 @@ export default class Address extends AbstractAddress { * @returns A new `ChecksumAddress` instance */ toChecksum(): ChecksumAddress { - return Address.toChecksum(this.toB256()); + return Address.toChecksum(this.b256Address); } /** - * Returns the `bech32Address` property - * @deprecated - * Type `Bech32Address` is now deprecated, as is this method. Use `B256` addresses instead. ([help](https://docs.fuel.network/docs/specs/abi/argument-encoding/#b256)) - * @returns The `bech32Address` property + * Returns the `b256Address` property */ - toAddress(): Bech32Address { - return this.bech32Address; + toAddress(): B256Address { + return this.b256Address; } /** - * Converts and returns the `bech32Address` property to a 256 bit hash string - * @returns The `bech32Address` property as a 256 bit hash string + * Returns the B256 hash address as a string + * + * @returns The B256 address */ toB256(): B256Address { - return toB256(this.bech32Address); + return this.b256Address; } /** - * Converts and returns the `bech32Address` property to a byte array - * @returns The `bech32Address` property as a byte array + * Returns the B256 hash address as a Uint8Array + * + * @returns The B256 address as a Uint8Array */ toBytes(): Uint8Array { - return getBytesFromBech32(this.bech32Address); + return arrayify(this.b256Address); } /** - * Converts the `bech32Address` property to a 256 bit hash string - * @returns The `bech32Address` property as a 256 bit hash string + * Returns the B256 hash address as a string + * + * @returns The B256 address */ toHexString(): B256Address { return this.toB256(); @@ -104,29 +86,28 @@ export default class Address extends AbstractAddress { /** * returns the address `checksum` as a string * - * @returns The `bech32Address` property as a string + * @returns The `b256Address` property as a string */ toString(): string { return this.toChecksum(); } /** - * Converts and returns the `bech32Address` property as a string - * @returns The `bech32Address` property as a JSON string + * Converts and returns the `b256Address` property as a string + * @returns The `b256Address` property as a JSON string */ toJSON(): string { - return this.bech32Address; + return this.b256Address; } /** - * Clears the first 12 bytes of the `bech32Address` property and returns it as a `EvmAddress` - * @returns The `bech32Address` property as an {@link EvmAddress | `EvmAddress`} + * Converts to an EVM address + * + * @returns an {@link EvmAddress | `EvmAddress`} representation of the address */ toEvmAddress(): EvmAddress { - const b256Address = toB256(this.bech32Address); - return { - bits: clearFirst12BytesFromB256(b256Address), + bits: toB256AddressEvm(this.b256Address), } as EvmAddress; } @@ -136,7 +117,7 @@ export default class Address extends AbstractAddress { */ toAssetId(): AssetId { return { - bits: this.toB256(), + bits: this.b256Address, } as AssetId; } @@ -149,12 +130,12 @@ export default class Address extends AbstractAddress { } /** - * Compares this the `bech32Address` property to another for direct equality + * Compares this the `b256Address` property to another for direct equality * @param other - Another address to compare against * @returns The equality of the comparison */ equals(other: Address): boolean { - return this.bech32Address === other.bech32Address; + return this.toChecksum() === other.toChecksum(); } /** @@ -169,7 +150,7 @@ export default class Address extends AbstractAddress { } const b256Address = hexlify(sha256(arrayify(publicKey))); - return new Address(toBech32(b256Address)); + return new Address(b256Address); } /** @@ -186,11 +167,11 @@ export default class Address extends AbstractAddress { ); } - return new Address(toBech32(b256Address)); + return new Address(b256Address); } /** - * Creates an `Address` with a randomized `bech32Address` property + * Creates an `Address` with a randomized `b256Address` property * * @returns A new `Address` instance */ @@ -205,7 +186,7 @@ export default class Address extends AbstractAddress { * @returns A new `Address` instance */ static fromString(address: string): Address { - return isBech32(address) ? new Address(address as Bech32Address) : this.fromB256(address); + return this.fromB256(address); } /** @@ -220,7 +201,7 @@ export default class Address extends AbstractAddress { /** * Takes a dynamic string or `AbstractAddress` and creates an `Address` * - * @param addressId - A string containing Bech32, B256, or Public Key + * @param addressId - A string containing B256, or Public Key * @throws Error - Unknown address if the format is not recognised * @returns A new `Address` instance */ @@ -235,10 +216,6 @@ export default class Address extends AbstractAddress { return Address.fromPublicKey(address); } - if (isBech32(address)) { - return new Address(address as Bech32Address); - } - if (isB256(address)) { return Address.fromB256(address); } @@ -249,7 +226,7 @@ export default class Address extends AbstractAddress { throw new FuelError( FuelError.CODES.PARSE_FAILED, - `Unknown address format: only 'Bech32', 'B256', or 'Public Key (512)' are supported.` + `Unknown address format: only 'B256', or 'Public Key (512)' are supported.` ); } @@ -267,8 +244,7 @@ export default class Address extends AbstractAddress { } const paddedAddress = padFirst12BytesOfEvmAddress(evmAddress); - - return new Address(toBech32(paddedAddress)); + return new Address(paddedAddress); } /** diff --git a/packages/address/src/utils.ts b/packages/address/src/utils.ts index 8123b22c8f9..9f4b7be00e0 100644 --- a/packages/address/src/utils.ts +++ b/packages/address/src/utils.ts @@ -2,61 +2,13 @@ import { randomBytes } from '@fuel-ts/crypto'; import { FuelError } from '@fuel-ts/errors'; import { AbstractContract, AbstractAccount } from '@fuel-ts/interfaces'; import type { - Bech32Address, B256Address, AddressLike, ContractIdLike, AbstractAddress, B256AddressEvm, - BytesLike, } from '@fuel-ts/interfaces'; -import { arrayify, hexlify } from '@fuel-ts/utils'; -import type { Decoded } from 'bech32'; -import { bech32m } from 'bech32'; - -/** - * Fuel Network HRP (human-readable part) for bech32 encoding - * - * @hidden - */ -export const FUEL_BECH32_HRP_PREFIX = 'fuel'; - -/** - * Decodes a Bech32 address string into Decoded - * @deprecated - * Type `Bech32Address` is now deprecated, as is this function. Use `B256` addresses instead. ([help](https://docs.fuel.network/docs/specs/abi/argument-encoding/#b256)) - * @hidden - */ -export function fromBech32(address: Bech32Address): Decoded { - return bech32m.decode(address); -} - -/** - * Converts a B256 address string into Bech32 - * @deprecated - * Type `Bech32Address` is now deprecated, as is this function. Use `B256` addresses instead. ([help](https://docs.fuel.network/docs/specs/abi/argument-encoding/#b256)) - * @hidden - */ -export function toBech32(address: B256Address): Bech32Address { - return bech32m.encode( - FUEL_BECH32_HRP_PREFIX, - bech32m.toWords(arrayify(hexlify(address))) - ) as Bech32Address; -} - -/** - * Determines if a given string is Bech32 format - * @deprecated - * Type `Bech32Address` is now deprecated, as is this function. Use `B256` addresses instead. ([help](https://docs.fuel.network/docs/specs/abi/argument-encoding/#b256)) - * @hidden - */ -export function isBech32(address: BytesLike): boolean { - return ( - typeof address === 'string' && - address.indexOf(FUEL_BECH32_HRP_PREFIX + 1) === 0 && - fromBech32(address as Bech32Address).prefix === FUEL_BECH32_HRP_PREFIX - ); -} +import { arrayify, concat, hexlify } from '@fuel-ts/utils'; /** * Determines if a given string is B256 format @@ -85,42 +37,8 @@ export function isEvmAddress(address: string): boolean { return address.length === 42 && /(0x)[0-9a-f]{40}$/i.test(address); } -/** - * Takes a Bech32 address and returns the byte data - * @deprecated - * The `bech32Address` is now deprecated. Please migrate to B256 format (see https://docs.fuel.network/docs/specs/abi/argument-encoding/#b256 for more details) as this will be the standard going forward. - * @hidden - */ -export function getBytesFromBech32(address: Bech32Address): Uint8Array { - return new Uint8Array(bech32m.fromWords(fromBech32(address).words)); -} - -/** - * Converts a Bech32 address string into B256 - * @hidden - */ -export function toB256(address: Bech32Address): B256Address { - if (!isBech32(address)) { - throw new FuelError( - FuelError.CODES.INVALID_BECH32_ADDRESS, - `Invalid Bech32 Address: ${address}.` - ); - } - - return hexlify(getBytesFromBech32(address)); -} - -/** - * Takes a Bech32 address and returns a normalized (i.e. lower case) representation of it. - * - * The input is validated along the way, which makes this significantly safer than - * using `address.toLowerCase()`. - * - * @hidden - */ -export function normalizeBech32(address: Bech32Address): Bech32Address { - const { words } = fromBech32(address); - return bech32m.encode(FUEL_BECH32_HRP_PREFIX, words) as Bech32Address; +export function normalizeB256(address: B256Address): B256Address { + return address.toLowerCase(); } /** @@ -153,27 +71,21 @@ export const getRandomB256 = () => hexlify(randomBytes(32)); * * @hidden */ -export const clearFirst12BytesFromB256 = (b256: B256Address): B256AddressEvm => { - let bytes; - +export const toB256AddressEvm = (b256: B256Address): B256AddressEvm => { try { if (!isB256(b256)) { - throw new FuelError( - FuelError.CODES.INVALID_BECH32_ADDRESS, - `Invalid Bech32 Address: ${b256}.` - ); + throw new FuelError(FuelError.CODES.INVALID_B256_ADDRESS, `Invalid B256 Address: ${b256}.`); } - bytes = getBytesFromBech32(toBech32(b256)); - bytes = hexlify(bytes.fill(0, 0, 12)) as B256AddressEvm; + const evmBytes = arrayify(b256).slice(12); + const paddedBytes = new Uint8Array(12).fill(0); + return hexlify(concat([paddedBytes, evmBytes])) as B256AddressEvm; } catch (error) { throw new FuelError( FuelError.CODES.PARSE_FAILED, `Cannot generate EVM Address B256 from: ${b256}.` ); } - - return bytes; }; /** diff --git a/packages/errors/src/error-codes.ts b/packages/errors/src/error-codes.ts index 2959d4e6212..6728db60612 100644 --- a/packages/errors/src/error-codes.ts +++ b/packages/errors/src/error-codes.ts @@ -25,12 +25,6 @@ export enum ErrorCode { WORKSPACE_NOT_DETECTED = 'workspace-not-detected', // address - /** - * @deprecated - * Type `Bech32Address` is now deprecated, as is this constant. Use `B256` addresses instead. ([help](https://docs.fuel.network/docs/specs/abi/argument-encoding/#b256)) - */ - INVALID_BECH32_ADDRESS = 'invalid-bech32-address', - INVALID_EVM_ADDRESS = 'invalid-evm-address', INVALID_B256_ADDRESS = 'invalid-b256-address', diff --git a/packages/fuel-gauge/src/doc-examples.test.ts b/packages/fuel-gauge/src/doc-examples.test.ts index 535e6378ae7..3e31b52d923 100644 --- a/packages/fuel-gauge/src/doc-examples.test.ts +++ b/packages/fuel-gauge/src/doc-examples.test.ts @@ -1,4 +1,4 @@ -import type { Bech32Address, BigNumberish, Bytes, WalletLocked } from 'fuels'; +import type { BigNumberish, Bytes, WalletLocked } from 'fuels'; import { bn, hashMessage, @@ -26,9 +26,6 @@ const PUBLIC_KEY = const ADDRESS_B256 = '0xf1e92c42b90934aa6372e30bc568a326f6e66a1a0288595e6e3fbd392a4f3e6e'; -const ADDRESS_BECH32: Bech32Address = - 'fuel1785jcs4epy625cmjuv9u269rymmwv6s6q2y9jhnw877nj2j08ehqce3rxf'; - const ADDRESS_BYTES = new Uint8Array([ 241, 233, 44, 66, 185, 9, 52, 170, 99, 114, 227, 11, 197, 104, 163, 38, 246, 230, 106, 26, 2, 136, 89, 94, 110, 63, 189, 57, 42, 79, 62, 110, @@ -39,8 +36,8 @@ const ADDRESS_BYTES = new Uint8Array([ * @group browser */ describe('Doc Examples', () => { - test('it has an Address class using bech32Address', () => { - const address = new Address(ADDRESS_BECH32); + test('it has an Address class using b256Address', () => { + const address = new Address(ADDRESS_B256); expect(address.toB256()).toEqual(ADDRESS_B256); expect(address.toBytes()).toEqual(ADDRESS_BYTES); @@ -50,14 +47,14 @@ describe('Doc Examples', () => { test('it has an Address class using public key', () => { const address = Address.fromPublicKey(PUBLIC_KEY); - expect(address.toAddress()).toEqual(ADDRESS_BECH32); + expect(address.toAddress()).toEqual(ADDRESS_B256); expect(address.toB256()).toEqual(ADDRESS_B256); }); test('it has an Address class using b256Address', () => { const address = Address.fromB256(ADDRESS_B256); - expect(address.toAddress()).toEqual(ADDRESS_BECH32); + expect(address.toAddress()).toEqual(ADDRESS_B256); expect(address.toB256()).toEqual(ADDRESS_B256); }); @@ -65,8 +62,7 @@ describe('Doc Examples', () => { // you can make a random address - useful for testing const address = Address.fromRandom(); - // you can it has a new Address from an ambiguous source that may be a Bech32 or B256 address - const addressCloneFromBech = Address.fromString(address.toString()); + // you can it has a new Address from an ambiguous source that may be a B256 address const addressCloneFromB256 = Address.fromString(address.toB256()); // if you aren't sure where the address comes from, use fromDynamicInput @@ -76,8 +72,7 @@ describe('Doc Examples', () => { const someAddress = Address.fromDynamicInput(dataFromInput); // you can verify equality using the helper functions - expect(address.equals(addressCloneFromBech)).toBeTruthy(); - expect(addressCloneFromBech.toString()).toEqual(addressCloneFromB256.toString()); + expect(address.equals(addressCloneFromB256)).toBeTruthy(); expect(someAddress).toBeTruthy(); }); diff --git a/packages/fuel-gauge/src/e2e-script.test.ts b/packages/fuel-gauge/src/e2e-script.test.ts index 674fed133c8..b1c692017cf 100644 --- a/packages/fuel-gauge/src/e2e-script.test.ts +++ b/packages/fuel-gauge/src/e2e-script.test.ts @@ -84,13 +84,13 @@ describe.each(selectedNetworks)('Live Script Test', (selectedNetwork) => { output = value; } catch (e) { - const address = wallet.address.toAddress(); + const address = wallet.address.toB256(); console.error((e as Error).message); console.warn(` not enough coins to fit the target? - add assets: ${configuredNetworks[selectedNetwork].faucetUrl} - - bech32 address: ${address} + - B256 address: ${address} `); } diff --git a/packages/fuels/src/cli.ts b/packages/fuels/src/cli.ts index eb02468b6e7..0299c304750 100644 --- a/packages/fuels/src/cli.ts +++ b/packages/fuels/src/cli.ts @@ -68,12 +68,12 @@ export const configureCli = () => { .action(withProgram(command, Commands.init, init)); (command = program.command(Commands.dev)) - .description('Start a Fuel node and run build + deploy on every file change') + .description('Start a Fuel node with hot-reload capabilities') .addOption(pathOption) .action(withConfig(command, Commands.dev, dev)); (command = program.command(Commands.node)) - .description('Start a Fuel node') + .description('Start a Fuel node using project configs') .addOption(pathOption) .action(withConfig(command, Commands.node, node)); diff --git a/packages/interfaces/src/index.ts b/packages/interfaces/src/index.ts index 12e07905429..f5d558f64c5 100644 --- a/packages/interfaces/src/index.ts +++ b/packages/interfaces/src/index.ts @@ -7,13 +7,6 @@ * TODO: Consider re-distritubing interfaces near their original packages */ -// #region bech32-1 -/** - * @deprecated - * Type `Bech32Address` is now deprecated. Use `B256` addresses instead. ([help](https://docs.fuel.network/docs/specs/abi/argument-encoding/#b256)) - */ -export type Bech32Address = `fuel${string}`; -// #endregion bech32-1 export type B256Address = string; export type ChecksumAddress = string; @@ -55,7 +48,7 @@ export abstract class AbstractScriptRequest { export abstract class AbstractAddress { abstract toJSON(): string; abstract toString(): string; - abstract toAddress(): Bech32Address; + abstract toAddress(): B256Address; abstract toB256(): B256Address; abstract toHexString(): string; abstract toBytes(): Uint8Array; diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts index a93a53989c5..dea385796b0 100644 --- a/packages/logger/src/index.ts +++ b/packages/logger/src/index.ts @@ -20,7 +20,6 @@ * * log('with this walletAddress: %w', address) * log('and this B256: %b', address) - * log('and this bech32 address : %n', address) * ``` * * ```console @@ -31,7 +30,6 @@ * ``` */ -import { toBech32 } from '@fuel-ts/address'; import type { Address } from '@fuel-ts/address'; import type { AbstractAddress } from '@fuel-ts/interfaces'; import type { BN } from '@fuel-ts/math'; @@ -108,10 +106,6 @@ debug.formatters.a = (v?: BN): string => { // Add a formatter for converting to a b256 string debug.formatters.b = (v?: AbstractAddress): string => (v == null ? 'undefined' : v.toB256()); -// Add a formatter for outputting a bech32 address -debug.formatters.c = (v?: AbstractAddress): string => - v == null ? 'undefined' : toBech32(v.toString()); - // Add a formatter for outputting a BN hex string debug.formatters.h = (v?: BN): string => (v == null ? 'undefined' : v.toHex()); diff --git a/packages/logger/test/index.test.ts b/packages/logger/test/index.test.ts index 655af61e57d..f3933fce4bf 100644 --- a/packages/logger/test/index.test.ts +++ b/packages/logger/test/index.test.ts @@ -1,4 +1,3 @@ -import type { AbstractAddress } from '@fuel-ts/interfaces'; import { BN } from '@fuel-ts/math'; import debug from 'debug'; import type { MockInstance } from 'vitest'; @@ -99,25 +98,6 @@ describe('Logger Tests', () => { expect(formatted).toBe('undefined'); }); - it('should format AbstractAddress to bech32 string using formatter c', () => { - const mockAddress: AbstractAddress = { - toJSON: () => '', - toString: () => '0x000000000000000000000000000000000000000000000000000000000000002a', - toAddress: () => 'fuel1xyzabc123', - toB256: () => '', - toHexString: () => '', - toBytes: () => new Uint8Array(), - equals: () => false, - }; - const formatted = debug.formatters.c(mockAddress); - expect(formatted).toBe('fuel1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq4qvpkv30'); - }); - - it('should return undefined for null input using formatter c', () => { - const formatted = debug.formatters.c(null); - expect(formatted).toBe('undefined'); - }); - it('should format BN to hex string using formatter h', () => { const bnValue = new BN('255'); const formatted = debug.formatters.h(bnValue); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0975f5d0c60..f53eba3c4c3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -183,11 +183,11 @@ importers: apps/create-fuels-counter-guide: dependencies: '@fuels/connectors': - specifier: 0.27.1 - version: 0.27.1(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(@wagmi/connectors@5.1.14(@types/react@18.3.11)(@wagmi/core@2.13.9(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(immer@9.0.21)(react@18.3.1)(typescript@5.6.3)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)))(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.8)(@babel/preset-env@7.22.5(@babel/core@7.25.8))(@types/react@18.3.11)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.24.0)(typescript@5.6.3)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8))(bufferutil@4.0.8)(fuels@packages+fuels)(immer@9.0.21)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3)(utf-8-validate@5.0.10)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8) + specifier: 0.36.1 + version: 0.36.1(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(@wagmi/connectors@5.1.14(@types/react@18.3.11)(@wagmi/core@2.13.9(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(immer@9.0.21)(react@18.3.1)(typescript@5.6.3)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)))(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.8)(@babel/preset-env@7.22.5(@babel/core@7.25.8))(@types/react@18.3.11)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.24.0)(typescript@5.6.3)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8))(bufferutil@4.0.8)(fuels@packages+fuels)(immer@9.0.21)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3)(utf-8-validate@5.0.10)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8) '@fuels/react': - specifier: 0.27.1 - version: 0.27.1(@tanstack/react-query@5.55.4(react@18.3.1))(@types/react-dom@18.3.0)(fuels@packages+fuels)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: 0.36.1 + version: 0.36.1(@tanstack/react-query@5.55.4(react@18.3.1))(@types/react-dom@18.3.0)(@types/react@18.3.11)(fuels@packages+fuels)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@tanstack/react-query': specifier: 5.55.4 version: 5.55.4(react@18.3.1) @@ -440,11 +440,11 @@ importers: apps/demo-wallet-sdk-react: dependencies: '@fuels/connectors': - specifier: 0.27.1 - version: 0.27.1(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(@wagmi/connectors@5.1.14(@types/react@18.3.11)(@wagmi/core@2.13.9(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(immer@9.0.21)(react@18.3.1)(typescript@5.6.3)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)))(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.8)(@babel/preset-env@7.22.5(@babel/core@7.25.8))(@types/react@18.3.11)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.24.0)(typescript@5.6.3)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8))(bufferutil@4.0.8)(fuels@packages+fuels)(immer@9.0.21)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3)(utf-8-validate@5.0.10)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8) + specifier: 0.36.1 + version: 0.36.1(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(@wagmi/connectors@5.1.14(@types/react@18.3.11)(@wagmi/core@2.13.9(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(immer@9.0.21)(react@18.3.1)(typescript@5.6.3)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)))(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.8)(@babel/preset-env@7.22.5(@babel/core@7.25.8))(@types/react@18.3.11)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.24.0)(typescript@5.6.3)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8))(bufferutil@4.0.8)(fuels@packages+fuels)(immer@9.0.21)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3)(utf-8-validate@5.0.10)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8) '@fuels/react': - specifier: 0.27.1 - version: 0.27.1(@tanstack/react-query@5.55.4(react@18.3.1))(@types/react-dom@18.3.0)(fuels@packages+fuels)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: 0.36.1 + version: 0.36.1(@tanstack/react-query@5.55.4(react@18.3.1))(@types/react-dom@18.3.0)(@types/react@18.3.11)(fuels@packages+fuels)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@tanstack/react-query': specifier: 5.55.4 version: 5.55.4(react@18.3.1) @@ -786,9 +786,6 @@ importers: '@noble/hashes': specifier: 1.5.0 version: 1.5.0 - bech32: - specifier: 2.0.0 - version: 2.0.0 packages/contract: dependencies: @@ -1241,11 +1238,11 @@ importers: templates/nextjs: dependencies: '@fuels/connectors': - specifier: 0.27.1 - version: 0.27.1(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(@wagmi/connectors@5.1.14(@types/react@18.3.11)(@wagmi/core@2.13.9(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(immer@9.0.21)(react@18.3.1)(typescript@5.6.3)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)))(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.8)(@babel/preset-env@7.22.5(@babel/core@7.25.8))(@types/react@18.3.11)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.24.0)(typescript@5.6.3)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8))(bufferutil@4.0.8)(fuels@packages+fuels)(immer@9.0.21)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3)(utf-8-validate@5.0.10)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8) + specifier: 0.36.1 + version: 0.36.1(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(@wagmi/connectors@5.1.14(@types/react@18.3.11)(@wagmi/core@2.13.9(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(immer@9.0.21)(react@18.3.1)(typescript@5.6.3)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)))(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.8)(@babel/preset-env@7.22.5(@babel/core@7.25.8))(@types/react@18.3.11)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.24.0)(typescript@5.6.3)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8))(bufferutil@4.0.8)(fuels@packages+fuels)(immer@9.0.21)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3)(utf-8-validate@5.0.10)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8) '@fuels/react': - specifier: 0.27.1 - version: 0.27.1(@tanstack/react-query@5.55.4(react@18.3.1))(@types/react-dom@18.3.0)(fuels@packages+fuels)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: 0.36.1 + version: 0.36.1(@tanstack/react-query@5.55.4(react@18.3.1))(@types/react-dom@18.3.0)(@types/react@18.3.11)(fuels@packages+fuels)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@tanstack/react-query': specifier: 5.55.4 version: 5.55.4(react@18.3.1) @@ -1317,11 +1314,11 @@ importers: templates/vite: dependencies: '@fuels/connectors': - specifier: 0.27.1 - version: 0.27.1(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(@wagmi/connectors@5.1.14(@types/react@18.3.11)(@wagmi/core@2.13.9(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(immer@9.0.21)(react@18.3.1)(typescript@5.6.3)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)))(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.8)(@babel/preset-env@7.22.5(@babel/core@7.25.8))(@types/react@18.3.11)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.24.0)(typescript@5.6.3)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8))(bufferutil@4.0.8)(fuels@packages+fuels)(immer@9.0.21)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3)(utf-8-validate@5.0.10)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8) + specifier: 0.36.1 + version: 0.36.1(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(@wagmi/connectors@5.1.14(@types/react@18.3.11)(@wagmi/core@2.13.9(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(immer@9.0.21)(react@18.3.1)(typescript@5.6.3)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)))(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.8)(@babel/preset-env@7.22.5(@babel/core@7.25.8))(@types/react@18.3.11)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.24.0)(typescript@5.6.3)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8))(bufferutil@4.0.8)(fuels@packages+fuels)(immer@9.0.21)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3)(utf-8-validate@5.0.10)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8) '@fuels/react': - specifier: 0.27.1 - version: 0.27.1(@tanstack/react-query@5.55.4(react@18.3.1))(@types/react-dom@18.3.0)(fuels@packages+fuels)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: 0.36.1 + version: 0.36.1(@tanstack/react-query@5.55.4(react@18.3.1))(@types/react-dom@18.3.0)(@types/react@18.3.11)(fuels@packages+fuels)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@tanstack/react-query': specifier: 5.55.4 version: 5.55.4(react@18.3.1) @@ -3404,17 +3401,17 @@ packages: resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} engines: {node: '>=14'} - '@fuels/connectors@0.27.1': - resolution: {integrity: sha512-gn5OyniNyFMjq611PfUm2asZ07oUr/wLo9Mx/Kr5vMmc33KAxA2B6uxRhBaBY8ysHwGuab6ZeONjVGnJ7iO8Vw==} + '@fuels/connectors@0.36.1': + resolution: {integrity: sha512-BFoN80F7G7MotNMzFscfFNjvBUBURoxrVjs3Sa7OneR/9eK8zvE87zIF8Ymsh/Cxue4bwwc6/1663PX3RM2OTw==} peerDependencies: - fuels: '>=0.94.0' + fuels: '>=0.96.1' - '@fuels/react@0.27.1': - resolution: {integrity: sha512-qVlgjvIiP8+SGvNIrKAdTWvVTKSoYhjzabL/S6KhJ8Rp3DxWulpyZ0zYuLv5ElOmHMyOKYu5clHZbkhYsvVLYA==} + '@fuels/react@0.36.1': + resolution: {integrity: sha512-vI57X6zRjoe8yWHru/EeHGsqDiAYizvt3P2B38TmnkKKaFlCZkVrDPVLMUAD/oUecE4Y35JcEOF0Su9EXPNXtQ==} peerDependencies: '@tanstack/react-query': '>=5.0.0' - fuels: '>=0.94.0' - react: ^18.2.0 + fuels: '>=0.96.1' + react: '>=18.0.0' '@fuels/vm-asm@0.58.2': resolution: {integrity: sha512-1/5azTzKJP508BXbZvM6Y0V5bCCX5JgEnd/8mXdBFmFvNLOhiYbwb25yk26auqOokfBXvthSkdkrvipEFft6jQ==} @@ -4459,164 +4456,164 @@ packages: engines: {node: '>=18'} hasBin: true - '@radix-ui/primitive@1.0.1': - resolution: {integrity: sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==} + '@radix-ui/primitive@1.1.0': + resolution: {integrity: sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA==} - '@radix-ui/react-compose-refs@1.0.1': - resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==} + '@radix-ui/react-compose-refs@1.1.0': + resolution: {integrity: sha512-b4inOtiaOnYf9KWyO3jAeeCG6FeyfY6ldiEPanbUjWd+xIk5wZeHa8yVwmrJ2vderhu/BQvzCrJI0lHd+wIiqw==} peerDependencies: '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true - '@radix-ui/react-context@1.0.1': - resolution: {integrity: sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==} + '@radix-ui/react-context@1.1.0': + resolution: {integrity: sha512-OKrckBy+sMEgYM/sMmqmErVn0kZqrHPJze+Ql3DzYsDDp0hl0L62nx/2122/Bvps1qz645jlcu2tD9lrRSdf8A==} peerDependencies: '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true - '@radix-ui/react-dialog@1.0.5': - resolution: {integrity: sha512-GjWJX/AUpB703eEBanuBnIWdIXg6NvJFCXcNlSZk4xdszCdhrJgBoUd1cGk67vFO+WdA2pfI/plOpqz/5GUP6Q==} + '@radix-ui/react-dialog@1.1.1': + resolution: {integrity: sha512-zysS+iU4YP3STKNS6USvFVqI4qqx8EpiwmT5TuCApVEBca+eRCbONi4EgzfNSuVnOXvC5UPHHMjs8RXO6DH9Bg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@radix-ui/react-dismissable-layer@1.0.5': - resolution: {integrity: sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==} + '@radix-ui/react-dismissable-layer@1.1.0': + resolution: {integrity: sha512-/UovfmmXGptwGcBQawLzvn2jOfM0t4z3/uKffoBlj724+n3FvBbZ7M0aaBOmkp6pqFYpO4yx8tSVJjx3Fl2jig==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@radix-ui/react-focus-guards@1.0.1': - resolution: {integrity: sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA==} + '@radix-ui/react-focus-guards@1.1.0': + resolution: {integrity: sha512-w6XZNUPVv6xCpZUqb/yN9DL6auvpGX3C/ee6Hdi16v2UUy25HV2Q5bcflsiDyT/g5RwbPQ/GIT1vLkeRb+ITBw==} peerDependencies: '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true - '@radix-ui/react-focus-scope@1.0.4': - resolution: {integrity: sha512-sL04Mgvf+FmyvZeYfNu1EPAaaxD+aw7cYeIB9L9Fvq8+urhltTRaEo5ysKOpHuKPclsZcSUMKlN05x4u+CINpA==} + '@radix-ui/react-focus-scope@1.1.0': + resolution: {integrity: sha512-200UD8zylvEyL8Bx+z76RJnASR2gRMuxlgFCPAe/Q/679a/r0eK3MBVYMb7vZODZcffZBdob1EGnky78xmVvcA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@radix-ui/react-id@1.0.1': - resolution: {integrity: sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==} + '@radix-ui/react-id@1.1.0': + resolution: {integrity: sha512-EJUrI8yYh7WOjNOqpoJaf1jlFIH2LvtgAl+YcFqNCa+4hj64ZXmPkAKOFs/ukjz3byN6bdb/AVUqHkI8/uWWMA==} peerDependencies: '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true - '@radix-ui/react-portal@1.0.4': - resolution: {integrity: sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==} + '@radix-ui/react-portal@1.1.1': + resolution: {integrity: sha512-A3UtLk85UtqhzFqtoC8Q0KvR2GbXF3mtPgACSazajqq6A41mEQgo53iPzY4i6BwDxlIFqWIhiQ2G729n+2aw/g==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@radix-ui/react-presence@1.0.1': - resolution: {integrity: sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==} + '@radix-ui/react-presence@1.1.0': + resolution: {integrity: sha512-Gq6wuRN/asf9H/E/VzdKoUtT8GC9PQc9z40/vEr0VCJ4u5XvvhWIrSsCB6vD2/cH7ugTdSfYq9fLJCcM00acrQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@radix-ui/react-primitive@1.0.3': - resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==} + '@radix-ui/react-primitive@2.0.0': + resolution: {integrity: sha512-ZSpFm0/uHa8zTvKBDjLFWLo8dkr4MBsiDLz0g3gMUwqgLHz9rTaRRGYDgvZPtBJgYCBKXkS9fzmoySgr8CO6Cw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@radix-ui/react-slot@1.0.2': - resolution: {integrity: sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==} + '@radix-ui/react-slot@1.1.0': + resolution: {integrity: sha512-FUCf5XMfmW4dtYl69pdS4DbxKy8nj4M7SafBgPllysxmdachynNflAdp/gCsnYWNDnge6tI9onzMp5ARYc1KNw==} peerDependencies: '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true - '@radix-ui/react-use-callback-ref@1.0.1': - resolution: {integrity: sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==} + '@radix-ui/react-use-callback-ref@1.1.0': + resolution: {integrity: sha512-CasTfvsy+frcFkbXtSJ2Zu9JHpN8TYKxkgJGWbjiZhFivxaeW7rMeZt7QELGVLaYVfFMsKHjb7Ak0nMEe+2Vfw==} peerDependencies: '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true - '@radix-ui/react-use-controllable-state@1.0.1': - resolution: {integrity: sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==} + '@radix-ui/react-use-controllable-state@1.1.0': + resolution: {integrity: sha512-MtfMVJiSr2NjzS0Aa90NPTnvTSg6C/JLCV7ma0W6+OMV78vd8OyRpID+Ng9LxzsPbLeuBnWBA1Nq30AtBIDChw==} peerDependencies: '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true - '@radix-ui/react-use-escape-keydown@1.0.3': - resolution: {integrity: sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==} + '@radix-ui/react-use-escape-keydown@1.1.0': + resolution: {integrity: sha512-L7vwWlR1kTTQ3oh7g1O0CBF3YCyyTj8NmhLR+phShpyA50HCfBFKVJTpshm9PzLiKmehsrQzTYTpX9HvmC9rhw==} peerDependencies: '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true - '@radix-ui/react-use-layout-effect@1.0.1': - resolution: {integrity: sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==} + '@radix-ui/react-use-layout-effect@1.1.0': + resolution: {integrity: sha512-+FPE0rOdziWSrH9athwI1R0HDVbWlEhd+FR+aSDk4uWGmSJ9Z54sdZVDQPZAinJhJXwfT+qnj969mCsT2gfm5w==} peerDependencies: '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -5494,9 +5491,6 @@ packages: '@types/react-dom@18.3.0': resolution: {integrity: sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==} - '@types/react@18.3.1': - resolution: {integrity: sha512-V0kuGBX3+prX+DQ/7r2qsv1NsdfnCLnTgnRJ1pYnxykBhGMz+qj+box5lq7XsO5mtZsBqpjwwTu/7wszPfMBcw==} - '@types/react@18.3.11': resolution: {integrity: sha512-r6QZ069rFTjrEYgFdOck1gK7FLVsgJE7tTz0pQBczlBNUhBNk0MQH4UbnFSwjpQLMkLzgqvBBa+qGpLje16eTQ==} @@ -6891,9 +6885,6 @@ packages: bcrypt-pbkdf@1.0.2: resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==} - bech32@2.0.0: - resolution: {integrity: sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==} - before-after-hook@2.2.3: resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} @@ -12846,8 +12837,8 @@ packages: '@types/react': optional: true - react-remove-scroll@2.5.5: - resolution: {integrity: sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw==} + react-remove-scroll@2.5.7: + resolution: {integrity: sha512-FnrTWO4L7/Bhhf3CYBNArEG/yROV0tKmTv7/3h9QCFvH6sndeFf1wPqOcbFVu5VAulS5dV1wGT3GZZ/1GawqiA==} engines: {node: '>=10'} peerDependencies: '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -17843,7 +17834,7 @@ snapshots: '@fastify/busboy@2.1.1': {} - '@fuels/connectors@0.27.1(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(@wagmi/connectors@5.1.14(@types/react@18.3.11)(@wagmi/core@2.13.9(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(immer@9.0.21)(react@18.3.1)(typescript@5.6.3)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)))(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.8)(@babel/preset-env@7.22.5(@babel/core@7.25.8))(@types/react@18.3.11)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.24.0)(typescript@5.6.3)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8))(bufferutil@4.0.8)(fuels@packages+fuels)(immer@9.0.21)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3)(utf-8-validate@5.0.10)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8)': + '@fuels/connectors@0.36.1(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(@wagmi/connectors@5.1.14(@types/react@18.3.11)(@wagmi/core@2.13.9(@tanstack/query-core@5.56.2)(@types/react@18.3.11)(immer@9.0.21)(react@18.3.1)(typescript@5.6.3)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)))(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.8)(@babel/preset-env@7.22.5(@babel/core@7.25.8))(@types/react@18.3.11)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.24.0)(typescript@5.6.3)(utf-8-validate@5.0.10)(viem@2.20.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8))(bufferutil@4.0.8)(fuels@packages+fuels)(immer@9.0.21)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3)(utf-8-validate@5.0.10)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8)': dependencies: '@ethereumjs/util': 9.0.3 '@ethersproject/bytes': 5.7.0 @@ -17886,15 +17877,15 @@ snapshots: - vue - zod - '@fuels/react@0.27.1(@tanstack/react-query@5.55.4(react@18.3.1))(@types/react-dom@18.3.0)(fuels@packages+fuels)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@fuels/react@0.36.1(@tanstack/react-query@5.55.4(react@18.3.1))(@types/react-dom@18.3.0)(@types/react@18.3.11)(fuels@packages+fuels)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@radix-ui/react-dialog': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-dialog': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@tanstack/react-query': 5.55.4(react@18.3.1) - '@types/react': 18.3.1 events: 3.3.0 fuels: link:packages/fuels react: 18.3.1 transitivePeerDependencies: + - '@types/react' - '@types/react-dom' - react-dom @@ -19400,156 +19391,140 @@ snapshots: - supports-color optional: true - '@radix-ui/primitive@1.0.1': - dependencies: - '@babel/runtime': 7.25.7 + '@radix-ui/primitive@1.1.0': {} - '@radix-ui/react-compose-refs@1.0.1(@types/react@18.3.1)(react@18.3.1)': + '@radix-ui/react-compose-refs@1.1.0(@types/react@18.3.11)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 react: 18.3.1 optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 - '@radix-ui/react-context@1.0.1(@types/react@18.3.1)(react@18.3.1)': + '@radix-ui/react-context@1.1.0(@types/react@18.3.11)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 react: 18.3.1 optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 - '@radix-ui/react-dialog@1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.25.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.1)(react@18.3.1) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.1)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-focus-guards': 1.0.1(@types/react@18.3.1)(react@18.3.1) - '@radix-ui/react-focus-scope': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.1)(react@18.3.1) - '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.0.2(@types/react@18.3.1)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.1)(react@18.3.1) + '@radix-ui/react-dialog@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.11)(react@18.3.1) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.11)(react@18.3.1) + '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-focus-guards': 1.1.0(@types/react@18.3.11)(react@18.3.1) + '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.11)(react@18.3.1) + '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.11)(react@18.3.1) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.11)(react@18.3.1) aria-hidden: 1.2.3 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-remove-scroll: 2.5.5(@types/react@18.3.1)(react@18.3.1) + react-remove-scroll: 2.5.7(@types/react@18.3.11)(react@18.3.1) optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 '@types/react-dom': 18.3.0 - '@radix-ui/react-dismissable-layer@1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-dismissable-layer@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.1)(react@18.3.1) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.1)(react@18.3.1) - '@radix-ui/react-use-escape-keydown': 1.0.3(@types/react@18.3.1)(react@18.3.1) + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.11)(react@18.3.1) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.11)(react@18.3.1) + '@radix-ui/react-use-escape-keydown': 1.1.0(@types/react@18.3.11)(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 '@types/react-dom': 18.3.0 - '@radix-ui/react-focus-guards@1.0.1(@types/react@18.3.1)(react@18.3.1)': + '@radix-ui/react-focus-guards@1.1.0(@types/react@18.3.11)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 react: 18.3.1 optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 - '@radix-ui/react-focus-scope@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-focus-scope@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.1)(react@18.3.1) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.1)(react@18.3.1) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.11)(react@18.3.1) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.11)(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 '@types/react-dom': 18.3.0 - '@radix-ui/react-id@1.0.1(@types/react@18.3.1)(react@18.3.1)': + '@radix-ui/react-id@1.1.0(@types/react@18.3.11)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.1)(react@18.3.1) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.11)(react@18.3.1) react: 18.3.1 optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 - '@radix-ui/react-portal@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-portal@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.11)(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 '@types/react-dom': 18.3.0 - '@radix-ui/react-presence@1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-presence@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.1)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.1)(react@18.3.1) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.11)(react@18.3.1) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.11)(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 '@types/react-dom': 18.3.0 - '@radix-ui/react-primitive@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-primitive@2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 - '@radix-ui/react-slot': 1.0.2(@types/react@18.3.1)(react@18.3.1) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.11)(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 '@types/react-dom': 18.3.0 - '@radix-ui/react-slot@1.0.2(@types/react@18.3.1)(react@18.3.1)': + '@radix-ui/react-slot@1.1.0(@types/react@18.3.11)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.1)(react@18.3.1) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.11)(react@18.3.1) react: 18.3.1 optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 - '@radix-ui/react-use-callback-ref@1.0.1(@types/react@18.3.1)(react@18.3.1)': + '@radix-ui/react-use-callback-ref@1.1.0(@types/react@18.3.11)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 react: 18.3.1 optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 - '@radix-ui/react-use-controllable-state@1.0.1(@types/react@18.3.1)(react@18.3.1)': + '@radix-ui/react-use-controllable-state@1.1.0(@types/react@18.3.11)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.1)(react@18.3.1) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.11)(react@18.3.1) react: 18.3.1 optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 - '@radix-ui/react-use-escape-keydown@1.0.3(@types/react@18.3.1)(react@18.3.1)': + '@radix-ui/react-use-escape-keydown@1.1.0(@types/react@18.3.11)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.1)(react@18.3.1) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.11)(react@18.3.1) react: 18.3.1 optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 - '@radix-ui/react-use-layout-effect@1.0.1(@types/react@18.3.1)(react@18.3.1)': + '@radix-ui/react-use-layout-effect@1.1.0(@types/react@18.3.11)(react@18.3.1)': dependencies: - '@babel/runtime': 7.25.7 react: 18.3.1 optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 '@react-native-community/cli-clean@13.6.6': dependencies: @@ -20734,11 +20709,6 @@ snapshots: dependencies: '@types/react': 18.3.11 - '@types/react@18.3.1': - dependencies: - '@types/prop-types': 15.7.5 - csstype: 3.1.3 - '@types/react@18.3.11': dependencies: '@types/prop-types': 15.7.5 @@ -23345,8 +23315,6 @@ snapshots: dependencies: tweetnacl: 0.14.5 - bech32@2.0.0: {} - before-after-hook@2.2.3: {} better-path-resolve@1.0.0: @@ -30927,24 +30895,24 @@ snapshots: react-refresh@0.14.2: {} - react-remove-scroll-bar@2.3.5(@types/react@18.3.1)(react@18.3.1): + react-remove-scroll-bar@2.3.5(@types/react@18.3.11)(react@18.3.1): dependencies: react: 18.3.1 - react-style-singleton: 2.2.1(@types/react@18.3.1)(react@18.3.1) + react-style-singleton: 2.2.1(@types/react@18.3.11)(react@18.3.1) tslib: 2.8.0 optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 - react-remove-scroll@2.5.5(@types/react@18.3.1)(react@18.3.1): + react-remove-scroll@2.5.7(@types/react@18.3.11)(react@18.3.1): dependencies: react: 18.3.1 - react-remove-scroll-bar: 2.3.5(@types/react@18.3.1)(react@18.3.1) - react-style-singleton: 2.2.1(@types/react@18.3.1)(react@18.3.1) + react-remove-scroll-bar: 2.3.5(@types/react@18.3.11)(react@18.3.1) + react-style-singleton: 2.2.1(@types/react@18.3.11)(react@18.3.1) tslib: 2.8.0 - use-callback-ref: 1.3.1(@types/react@18.3.1)(react@18.3.1) - use-sidecar: 1.1.2(@types/react@18.3.1)(react@18.3.1) + use-callback-ref: 1.3.1(@types/react@18.3.11)(react@18.3.1) + use-sidecar: 1.1.2(@types/react@18.3.11)(react@18.3.1) optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 react-scripts@5.0.1(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.22.5))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.22.5))(@swc/core@1.7.14)(@types/babel__core@7.20.5)(bufferutil@4.0.8)(esbuild@0.17.19)(eslint@9.9.1(jiti@2.3.3))(react@18.3.1)(ts-node@10.9.1(@swc/core@1.7.14)(@types/node@22.5.5)(typescript@5.6.3))(type-fest@3.1.0)(typescript@5.6.3)(utf-8-validate@5.0.10): dependencies: @@ -31038,14 +31006,14 @@ snapshots: react: 18.3.1 react-is: 18.3.1 - react-style-singleton@2.2.1(@types/react@18.3.1)(react@18.3.1): + react-style-singleton@2.2.1(@types/react@18.3.11)(react@18.3.1): dependencies: get-nonce: 1.0.1 invariant: 2.2.4 react: 18.3.1 tslib: 2.8.0 optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 react-toastify@10.0.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: @@ -33150,20 +33118,20 @@ snapshots: urlpattern-polyfill@10.0.0: {} - use-callback-ref@1.3.1(@types/react@18.3.1)(react@18.3.1): + use-callback-ref@1.3.1(@types/react@18.3.11)(react@18.3.1): dependencies: react: 18.3.1 tslib: 2.8.0 optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 - use-sidecar@1.1.2(@types/react@18.3.1)(react@18.3.1): + use-sidecar@1.1.2(@types/react@18.3.11)(react@18.3.1): dependencies: detect-node-es: 1.1.0 react: 18.3.1 tslib: 2.8.0 optionalDependencies: - '@types/react': 18.3.1 + '@types/react': 18.3.11 use-sync-external-store@1.2.0(react@18.3.1): dependencies: diff --git a/scripts/lint-md-links.ts b/scripts/lint-md-links.ts index 20c04136b27..a530688d5a1 100644 --- a/scripts/lint-md-links.ts +++ b/scripts/lint-md-links.ts @@ -9,6 +9,9 @@ const { log } = console; ignore: ['**/node_modules/**', 'apps/demo-*/**', '.changeset/**', '**/CHANGELOG.md'], }); + // TODO: Stop ignoring doc links in `link-check.config.json` + // The above requires this to be merged and deployed: + // - https://github.com/FuelLabs/fuels-ts/pull/3500 try { execSync(`pnpm markdown-link-check -q -c ./link-check.config.json ${mdFiles.join(' ')}`, { stdio: 'inherit', diff --git a/templates/nextjs/package.json b/templates/nextjs/package.json index ffdd10dc7f8..ecfcf9208a8 100644 --- a/templates/nextjs/package.json +++ b/templates/nextjs/package.json @@ -13,8 +13,8 @@ "test:ui": "sh ./test/ui/test-ui.sh" }, "dependencies": { - "@fuels/connectors": "0.27.1", - "@fuels/react": "0.27.1", + "@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", diff --git a/templates/nextjs/src/app/layout.tsx b/templates/nextjs/src/app/layout.tsx index 235c91c3047..6f9e49f67de 100644 --- a/templates/nextjs/src/app/layout.tsx +++ b/templates/nextjs/src/app/layout.tsx @@ -4,7 +4,7 @@ import { FuelProvider } from "@fuels/react"; import React, { ReactNode, useEffect, useState } from "react"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { ToastContainer } from "react-toastify"; -import { Provider } from "fuels"; +import { FuelConnector, Provider } from "fuels"; import { defaultConnectors } from "@fuels/connectors"; import { providerUrl } from "../lib"; @@ -14,9 +14,9 @@ import "@/styles/globals.css"; const queryClient = new QueryClient(); -const connectors = defaultConnectors({ +const connectors: FuelConnector[] = defaultConnectors({ devMode: true, - burnerWalletConfig: { fuelProvider: Provider.create(providerUrl) }, + fuelProvider: Provider.create(providerUrl), }); interface RootLayoutProps { @@ -42,7 +42,12 @@ export default function RootLayout({ children }: RootLayoutProps) { - + + {" "} <>{children} diff --git a/templates/nextjs/src/lib.tsx b/templates/nextjs/src/lib.tsx index a5bd27ffa5c..5229827f2d2 100644 --- a/templates/nextjs/src/lib.tsx +++ b/templates/nextjs/src/lib.tsx @@ -25,7 +25,7 @@ export const renderTransactionId = (transactionId: string) => { return (
{ return ( - +