diff --git a/.changeset/polite-dragons-study.md b/.changeset/polite-dragons-study.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/polite-dragons-study.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 86b6ec6a31e..cda33cbec19 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,6 +15,7 @@ jobs: uses: FuelLabs/github-actions/.github/workflows/vp-docs.yml@master with: doc-folder-path: "apps/docs/src" + spellcheck-config-path: "apps/docs/.spellcheck.yml" test: runs-on: ubuntu-latest diff --git a/apps/docs/.spellcheck.yml b/apps/docs/.spellcheck.yml new file mode 100644 index 00000000000..dee58ed22d6 --- /dev/null +++ b/apps/docs/.spellcheck.yml @@ -0,0 +1,33 @@ +matrix: + - name: SPCheck + aspell: + lang: en + dictionary: + encoding: utf-8 + wordlists: + - apps/docs/spell-check-custom-words.txt + pipeline: + - pyspelling.filters.context: + context_visible_first: true + escapes: \\[\\`~] + delimiters: + # Ignore all code blocks + - open: '(?s)^(?P *`{3,}\s*(\w+\s*,?\s*)+.*?)$' + close: '^( *`{3,})$' + # Ignore lines starting with <<< @ + - open: '^(<<<.*)' + close: '$' + - pyspelling.filters.markdown: + markdown_extensions: + - pymdownx.superfences: + - pyspelling.filters.html: + comments: false + ignores: + - code + - pre + sources: + - 'apps/docs/src/*.md' + - 'apps/docs/src/**/*.md' + - 'apps/docs/src/**/**/*.md' + default_encoding: utf-8 + \ No newline at end of file diff --git a/apps/docs/spell-check-custom-words.txt b/apps/docs/spell-check-custom-words.txt new file mode 100644 index 00000000000..7968d781c51 --- /dev/null +++ b/apps/docs/spell-check-custom-words.txt @@ -0,0 +1,290 @@ +ABI +ABIs +ASM +IDE +IDEs +LSP +namespace +ALU +APIs +JSON +BrowserStack +CLI +Deserialization +deserializing +DApp +subcurrency +Subcurrency +intrinsics +Intrinsics +workspace +workspaces +Workspaces +neovim +EVM +EVM's +EOA +ERC +Ethereum +Ethereum's +FVM +FuelVM +Fuelup +Github +GraphQL +Infura +JSON +LSP +Merkle +PoA +PoS +PoW +RPC +SDK +SDK's +SDKs +SauceLabs +Sepolia +Structs +Sway +TAI +TODO +TypeScript +UTF +UTXO +UTXOs +Utils +VM +VSCode +abigen +args +async +backend +backtraces +blockchain +blockchain's +bytecode +codespace +codespaces +config +cryptographic +customizable +customizations +dapp +dev +dropdown +enum +enums +env +forc +frontend +fuelup +fullstack +graphQL +graphql +http +https +js +localhost +mainnet +mempool +merkle +monorepo +monorepos +natively +npm +nvm +onboarding +params +pnpm +prerelease +queryable +quickstart +relayer +relayers +repo +repos +runnable +stateful +struct +structs +struct's +testnet +testnets +toolchain +toolchains +urql +validator +validators +superABI +superABIs +SuperABIs +supertraits +compositional +typeclass +turbofish +DSL +TOML +IPFS +Bitwise +Bitwise +runtime +runtimes +formatter +deployable +Utils +ETH +initializer +initializers +destructuring +instantiation +VMs +superset +CEI +pre +entrancy +interoperable +blockchains +keccak +SHA +UI +backtrace +Collateralized +collateralized +submodule +DEX +TypeChain +inlines +inlining +MiB +FuelVM's +deterministically +CLI +VS +GraphViz +DOT +DCA +AST +GitHub +decrypt +decrypted +Decrypted +Decrypting +decrypting +subcommand +subcommands +Subcommands +supertrait +supertraits +Supertraits +incrementor +monomorphization +Booleans +boolean +Orchestrator +orchestrator +growable +arity +tuple's +unary +SRC +DEX +FuelLabs +PRs +codebase +PostgreSQL +Postgres +MacOS +macOS +backends +hoc +semver +SQLx +Homebrew +Changelog +lookups +namespaces +YAML +WASM +WebAssembly +dApp +dApps +JWT +Schemas +schemas +AssemblyScript +indexable +Macbook +Dockerized +TLDR +IaaS +Updatable +coinbase +Coinbase +postcondition +Postcondition +Cryptocurrency +cryptocurrency +ECDSA +EcDSA +secp +Secp +Bitfield +SMT +SMTs +subtrees +subtree +prepended +unhashed +preimage +FIPS +EdDSA +curve25519 +blazingly +pseudocode +Pseudocode +endian +KiB +SUT +Celestia +encodings +callee +inlined +parsable +underflows +bitmask +XORs +XOR +ORs +ANDs +rhs +lhs +scalable +Scalable +Exponentiate +exponentiate +Executablity +executablity +Unwritable +unwritable +untrusted +intra +OOB +INSTRs +INSTR +unspendable +HRP +Typegen +typegen +Autoloading +decrypts +hexlified +reaccessing +Reaccessing +integrations +keystore +Keystore +cryptographically +Config +config +configs \ No newline at end of file diff --git a/apps/docs/src/guide/abi-typegen/index.md b/apps/docs/src/guide/abi-typegen/index.md index e02bc51012e..96271ec4f52 100644 --- a/apps/docs/src/guide/abi-typegen/index.md +++ b/apps/docs/src/guide/abi-typegen/index.md @@ -22,7 +22,7 @@ It tells the SDK about the AB Given the following Sway smart contract: - + ```rust:line-numbers contract; diff --git a/apps/docs/src/guide/abi-typegen/using-generated-types.md b/apps/docs/src/guide/abi-typegen/using-generated-types.md index 98991109a43..eb2c4032091 100644 --- a/apps/docs/src/guide/abi-typegen/using-generated-types.md +++ b/apps/docs/src/guide/abi-typegen/using-generated-types.md @@ -10,7 +10,7 @@ yarn exec fuels typegen -i ./abis/*-abi.json -o ./types We can use these files like so: - + ```ts import { Wallet } from "fuels"; @@ -64,7 +64,7 @@ yarn exec fuels typegen -i ./abis/*-abi.json -o ./types --script We can use these files like so: - + ```ts import { Wallet } from "fuels"; @@ -92,7 +92,7 @@ yarn exec fuels typegen -i ./abis/*-abi.json -o ./types --predicate We can use these files like so: - + ```ts import { Wallet } from "fuels"; diff --git a/apps/docs/src/guide/cli/commands.md b/apps/docs/src/guide/cli/commands.md index dcd6f040733..1be377ea9fd 100644 --- a/apps/docs/src/guide/cli/commands.md +++ b/apps/docs/src/guide/cli/commands.md @@ -8,7 +8,7 @@ The `fuels` CLI consists of a couple commands. npx fuels help init ``` -``` +```console Options: -w, --workspace Relative dir path to Forc workspace -c, --contracts Relative path/globals to Contracts @@ -54,7 +54,7 @@ In a nutshell: npx fuels help build ``` -``` +```console Options: -p, --path Path to project root (default: "/Users/anderson/Code/fuel/fuels-ts/apps/docs") -d, --deploy Deploy contracts after build (auto-starts a `fuel-core` node if needed) @@ -74,7 +74,7 @@ npx fuels build npx fuels build --deploy ``` -Using the `--deploy` flag will aditionally: +Using the `--deploy` flag will additionally: 1. Auto-start a short-lived `fuel-core` node if _needed_ ([docs](./config-file.md#autostartfuelcore)) 2. Run `deploy` on that node @@ -128,7 +128,7 @@ Manually generates type definitions and factory classes from ABI JSON files. npx fuels help typegen ``` -``` +```console Options: -i, --inputs Input paths/globals to your Abi JSON files -o, --output Directory path for generated files diff --git a/apps/docs/src/guide/contracts/inter-contract-calls.md b/apps/docs/src/guide/contracts/inter-contract-calls.md index 5306a2b0488..ad2aa1795b5 100644 --- a/apps/docs/src/guide/contracts/inter-contract-calls.md +++ b/apps/docs/src/guide/contracts/inter-contract-calls.md @@ -1,6 +1,6 @@ # Inter-Contract Calls with the SDK -This guide explains how to use the SDK to execute a contract call where one contract interacts with another contract. We will use a simple scenario involving a SimpleToken contract and a TokenDepositor contract. +This guide explains how to use the SDK to execute a contract call where one contract interacts with another contract. We will use a simple scenario involving a `SimpleToken` contract and a `TokenDepositor` contract. ## `SimpleToken` and `TokenDepositor` Contracts @@ -24,4 +24,4 @@ Once both contracts are deployed, we can use the SDK to make the `TokenDepositor <<< @/../../docs-snippets/src/guide/contracts/inter-contract-calls.test.ts#inter-contract-calls-3{ts:line-numbers} -Pay attention to the method `addContracts` called by the TokenDepositor contract. This method accepts an array of instances of deployed contracts. Without calling this method, the inter-contract call will not work. +Pay attention to the method `addContracts` called by the `TokenDepositor` contract. This method accepts an array of instances of deployed contracts. Without calling this method, the inter-contract call will not work. diff --git a/apps/docs/src/guide/contracts/managing-deployed-contracts.md b/apps/docs/src/guide/contracts/managing-deployed-contracts.md index eace4523d61..b32f367d8b5 100644 --- a/apps/docs/src/guide/contracts/managing-deployed-contracts.md +++ b/apps/docs/src/guide/contracts/managing-deployed-contracts.md @@ -6,7 +6,7 @@ To interact with a deployed contract using the SDK without redeploying it, you o The `contractId` property from the `Contract` class is of type `AbstractAddress`, an abstract class that is exclusively extended by the `Address` class. -The `Address` class wrapps all methods from the `AbstractAddress` 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`. +The `Address` class wraps all methods from the `AbstractAddress` 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`. When you log the `contractId` property of an instantiated Contract using `console.log`, the output appears as follows: @@ -18,11 +18,11 @@ When you log the `contractId` property of an instantiated Contract using `consol --- -If you have already an instantiated and deployed contract in hands you can create another contract instance simply by using the `contractId` property and the contract JSON abi: +If you have already an instantiated and deployed contract in hands you can create another contract instance simply by using the `contractId` property and the contract JSON ABI: <<< @/../../docs-snippets/src/guide/contracts/managing-deployed-contracts.test.ts#managing-deployed-contracts-1{ts:line-numbers} -The previous example assumes that you have a `Contract` instance at hand. However, some Fuel tools and Sway use the [b256](../types/bits256.md) type format, a hex-encoded string-like type, for contract IDs. +The previous example assumes that you have a `Contract` instance at hand. However, some Fuel tools and Sway use the [`b256`](../types/bits256.md) type format, a hex-encoded string-like type, for contract IDs. You might have this format instead, for example, if you have deployed your contract with `forc deploy`. diff --git a/apps/docs/src/guide/contracts/storage-slots.md b/apps/docs/src/guide/contracts/storage-slots.md index 798a42ed65a..1a2d58694f1 100644 --- a/apps/docs/src/guide/contracts/storage-slots.md +++ b/apps/docs/src/guide/contracts/storage-slots.md @@ -4,7 +4,7 @@ When deploying a contract, you can specify the custom storage slots that you wan <<< @/../../../packages/fuel-gauge/src/storage-test-contract.test.ts#contract-deployment-storage-slots{ts:line-numbers} -## Using plain Javascript +## Using plain JavaScript In the above example, we directly imported the storage slots from a JSON file generated by the Sway compiler. diff --git a/apps/docs/src/guide/messages/index.md b/apps/docs/src/guide/messages/index.md index 8c5d32c9dec..22f068fe883 100644 --- a/apps/docs/src/guide/messages/index.md +++ b/apps/docs/src/guide/messages/index.md @@ -1,6 +1,6 @@ # Messages -A message is an object that contains some data that when broadcasted to the network, can change the state of the blockchain. This can include sending tokens, creating a new account, or deploying a smart contract. Messages are signed by a sender and broadcasted to the network. This message is then verified and included in a block. +A message is an object that contains some data that when broadcast to the network, can change the state of the blockchain. This can include sending tokens, creating a new account, or deploying a smart contract. Messages are signed by a sender and broadcast to the network. This message is then verified and included in a block. This is the general structure of a `Message` object: diff --git a/apps/docs/src/guide/predicates/index.md b/apps/docs/src/guide/predicates/index.md index a85fb835dc2..e3f632cf90b 100644 --- a/apps/docs/src/guide/predicates/index.md +++ b/apps/docs/src/guide/predicates/index.md @@ -2,7 +2,7 @@ import { data } from '../../versions.data' const { forc } = data const introUrl = `https://fuellabs.github.io/sway/v${forc}/book/introduction/index.html` - const debbugUrl = `https://fuellabs.github.io/sway/v${forc}/book/sway-program-types/predicates.html?#debugging-predicates` + const debugUrl = `https://fuellabs.github.io/sway/v${forc}/book/sway-program-types/predicates.html?#debugging-predicates` # Predicates @@ -47,4 +47,4 @@ In the next section, we provide a step-by-step guide on how to interact with a p ## Debugging Predicates -Currently there is no way to debbug a predicate yet. In the meantime, a practical workaround is to initially write, test, and debug your predicate as a script, which has more debugging tools available. Once it's working as expected, you can then convert it back into a predicate. +Currently there is no way to debug a predicate yet. In the meantime, a practical workaround is to initially write, test, and debug your predicate as a script, which has more debugging tools available. Once it's working as expected, you can then convert it back into a predicate. diff --git a/apps/docs/src/guide/predicates/send-and-spend-funds-from-predicates.md b/apps/docs/src/guide/predicates/send-and-spend-funds-from-predicates.md index 337b0d79d8c..b620dc80953 100644 --- a/apps/docs/src/guide/predicates/send-and-spend-funds-from-predicates.md +++ b/apps/docs/src/guide/predicates/send-and-spend-funds-from-predicates.md @@ -10,7 +10,7 @@ Consider the following predicate: <<< @/../../docs-snippets/test/fixtures/forc-projects/simple-predicate/src/main.sw#send-and-spend-funds-from-predicates-1{rust:line-numbers} -This predicate accepts an address of type `b256` and compares it with a hardcoded address of the same type. If both addresses are equal, the predicate returns true, otherwise it will return false. +This predicate accepts an address of type `b256` and compares it with a hard-coded address of the same type. If both addresses are equal, the predicate returns true, otherwise it will return false. ## Interacting with the Predicate Using SDK @@ -46,7 +46,7 @@ Trying to forward the entire amount held by the predicate results in an error be ## Predicate Validation Failure -What happens when a predicate fails to validate? Recall our predicate only validates if the `input_address` matches the hardcoded `valid_address`. Hence, if we set a different data from the `valid_address`, the predicate will fail to validate. +What happens when a predicate fails to validate? Recall our predicate only validates if the `input_address` matches the hard-coded `valid_address`. Hence, if we set a different data from the `valid_address`, the predicate will fail to validate. When a predicate fails to validate, the SDK throws an error that starts like this: diff --git a/apps/docs/src/guide/providers/connecting-to-an-external-node.md b/apps/docs/src/guide/providers/connecting-to-an-external-node.md index 5447877bf6c..9b3f1529669 100644 --- a/apps/docs/src/guide/providers/connecting-to-an-external-node.md +++ b/apps/docs/src/guide/providers/connecting-to-an-external-node.md @@ -12,10 +12,10 @@ In the code example, we connected a new provider to the Testnet node and created > > Once the assets have been transferred to the wallet, you can reuse it in other tests by providing the private key! > -> In addition to the faucet, there is a block explorer for the Tesnet at +> In addition to the faucet, there is a block explorer for the Testnet at > > [block-explorer](https://fuellabs.github.io/block-explorer-v2) -If you want to connect to another node just change the url or IP and port. For example, to connect to a local node that was created with `fuel-core` you can use: +If you want to connect to another node just change the URL or IP and port. For example, to connect to a local node that was created with `fuel-core` you can use: <<< @/../../../packages/fuel-gauge/src/doc-examples.test.ts#provider-local{ts:line-numbers} diff --git a/apps/docs/src/guide/testing/setting-up-a-custom-chain.md b/apps/docs/src/guide/testing/setting-up-a-custom-chain.md index e70e93e0b32..825e1dd6933 100644 --- a/apps/docs/src/guide/testing/setting-up-a-custom-chain.md +++ b/apps/docs/src/guide/testing/setting-up-a-custom-chain.md @@ -2,7 +2,7 @@ The `launchNodeAndGetWallets` method lets you launch a local Fuel node with various customizations. -In the code snippet below, we provide a custom chain config file to the `launchNodeAndGetWallets` method. You can use a chain config file to customize things like the chain's consensus parameters or specify some initial states for the chain. Click here to see what a chain config file looks like: [chainConfig.json](https://github.com/FuelLabs/fuels-ts/blob/master/.fuel-core/configs/chainConfig.json) +In the code snippet below, we provide a custom chain config file to the `launchNodeAndGetWallets` method. You can use a chain config file to customize things like the chain's consensus parameters or specify some initial states for the chain. Click here to see what a chain config file looks like: [`chainConfig.json`](https://github.com/FuelLabs/fuels-ts/blob/master/.fuel-core/configs/chainConfig.json) <<< @/../../../packages/wallet/src/test-utils/launchNode.test.ts#launchNode-custom-config{ts:line-numbers} diff --git a/apps/docs/src/guide/types/address.md b/apps/docs/src/guide/types/address.md index 040bda21e2d..4e69d6f6526 100644 --- a/apps/docs/src/guide/types/address.md +++ b/apps/docs/src/guide/types/address.md @@ -2,7 +2,7 @@ In Sway, the `Address` type serves as a type-safe wrapper around the primitive `b256` type. The SDK takes a different approach and has its own abstraction for the `Address` type. -## AbstractAddress Class +## `AbstractAddress` Class The SDK defines the `AbstractAddress` class, which provides a set of utility functions for easy manipulation and conversion between address formats. @@ -10,7 +10,7 @@ The SDK defines the `AbstractAddress` class, which provides a set of utility fun ## Address Class -Besides conforming to the interface of the `AbstractAddress`, the `Address` also defines one property; `bech32Address`, which is of the [Bech32](./bech32.md) type. +Besides conforming to the interface of the `AbstractAddress`, the `Address` also defines one property; `bech32Address`, which is of the [`Bech32`](./bech32.md) type. <<< @/../../../packages/address/src/address.ts#address-2{ts:line-numbers} @@ -18,7 +18,7 @@ Besides conforming to the interface of the `AbstractAddress`, the `Address` also Thanks to the utility functions provided by the `AbstractAddress` class, there are several ways to create an `Address` instance: -### From a Bech32 Address +### From a `Bech32` Address To create an `Address` from a `Bech32` address, use the following code snippet: @@ -40,7 +40,7 @@ To create an `Address` from a 256-bit address, use the following code snippet: The `Address` class also provides some practical utility functions: -1. `fromString`: Create a new `Address` from an ambiguous source that may be a Bech32 or B256 address: +1. `fromString`: Create a new `Address` from an ambiguous source that may be a `Bech32` or `B256` address: <<< @/../../docs-snippets/src/guide/types/address.test.ts#address-5{ts:line-numbers} diff --git a/apps/docs/src/guide/types/bech32.md b/apps/docs/src/guide/types/bech32.md index 79970f4c729..01fdb557af2 100644 --- a/apps/docs/src/guide/types/bech32.md +++ b/apps/docs/src/guide/types/bech32.md @@ -1,4 +1,4 @@ -# Bech32 +# `Bech32` The SDK uses the `Bech32` type as the core property of the `Address` class, specifically through the `bech32Address` property. diff --git a/apps/docs/src/guide/types/bits256.md b/apps/docs/src/guide/types/bits256.md index 89be069ec0f..6f739f937c0 100644 --- a/apps/docs/src/guide/types/bits256.md +++ b/apps/docs/src/guide/types/bits256.md @@ -1,20 +1,20 @@ -# Bits256 +# `Bits256` The type `b256` in Fuel represents hashes and holds a 256-bit (32-bytes) value. The TypeScript SDK represents `b256` as a hexlified string value for portability and provides utilities to convert to `Uint8Array` when the [raw bytes](./bytes32.md) are required. -## Generating random b256 values +## Generating random `b256` values To generate a random `b256` value, you can use the `getRandomB256()` function: <<< @/../../docs-snippets/src/guide/types/bits256.test.ts#bits256-1{ts:line-numbers} -### Converting between b256 and Uint8Array +### Converting between `b256` and `Uint8Array` -To convert between a `b256` hexlified string and a Uint8Array, you can use the `arrayify` and `hexlify` functions: +To convert between a `b256` hexlified string and a `Uint8Array`, you can use the `arrayify` and `hexlify` functions: <<< @/../../docs-snippets/src/guide/types/bits256.test.ts#bits256-2{ts:line-numbers} -## Support from Address Class +## Support from `Address` Class A `b256` value is also supported as part of the `Address` class, providing seamless integration with other components of your application. To create an `Address` instance from a b256 value, use the `Address.fromB256()` method: diff --git a/apps/docs/src/guide/types/conversion.md b/apps/docs/src/guide/types/conversion.md index 69254b07ec2..ddf41a44bef 100644 --- a/apps/docs/src/guide/types/conversion.md +++ b/apps/docs/src/guide/types/conversion.md @@ -2,21 +2,21 @@ This guide demonstrates how to convert between `Addresses` and Fuel's native types (`Bytes32`, `b256`) using helper functions. Native types are wrappers for bytes, and you can perform conversions between them by leveraging these functions. -## 1. Bytes32 and b256 Conversion +## 1. `Bytes32` and `b256` Conversion The following example demonstrates how to convert between `Bytes32` and to `b256`: <<< @/../../docs-snippets/src/guide/types/conversion.test.ts#conversion-1{ts:line-numbers} -## 2. ContractId +## 2. `ContractId` -The Contract `id` property has the [AbstractAddress](./address#abstractaddress-class) type. This means that a contract ID can be converted among all the supported convertions from the `AbstractClass`. +The Contract `id` property has the [`AbstractAddress`](./address#abstractaddress-class) type. This means that a contract ID can be converted among all the supported conversions from the `AbstractClass`. <<< @/../../docs-snippets/src/guide/types/conversion.test.ts#conversion-2{ts:line-numbers} ## 3. Wallet Address -The Wallet `address` property has the [AbstractAddress](./address#abstractaddress-class) type. So just like a contract ID, it can be converted among all the supported convertions from the `AbstractClass`. +The Wallet `address` property has the [`AbstractAddress`](./address#abstractaddress-class) type. So just like a contract ID, it can be converted among all the supported conversions from the `AbstractClass`. <<< @/../../docs-snippets/src/guide/types/conversion.test.ts#conversion-3{ts:line-numbers} diff --git a/apps/docs/src/guide/types/enums.md b/apps/docs/src/guide/types/enums.md index 2691b4272a9..b9b1fba9a9e 100644 --- a/apps/docs/src/guide/types/enums.md +++ b/apps/docs/src/guide/types/enums.md @@ -4,7 +4,7 @@ Sway Enums are a little distinct from TypeScript Enums. In this document, we wil ## Basic Sway Enum Example -Consider the following basic Sway Enum called StateError: +Consider the following basic Sway Enum called `StateError`: <<< @/../../docs-snippets/test/fixtures/forc-projects/echo-enum/src/main.sw#enum-1{rust:line-numbers} diff --git a/apps/docs/src/guide/types/evm-address.md b/apps/docs/src/guide/types/evm-address.md index 98148122bb6..2a5eebe54ce 100644 --- a/apps/docs/src/guide/types/evm-address.md +++ b/apps/docs/src/guide/types/evm-address.md @@ -1,4 +1,4 @@ -# EvmAddress +# `EvmAddress` An Ethereum Virtual Machine (EVM) Address can be represented using the `EvmAddress` type. It's definition matches the Sway standard library type being a `Struct` wrapper around an inner `Bits256` value. diff --git a/apps/docs/src/guide/types/raw-slice.md b/apps/docs/src/guide/types/raw-slice.md index 190f8775325..b84c89e7842 100644 --- a/apps/docs/src/guide/types/raw-slice.md +++ b/apps/docs/src/guide/types/raw-slice.md @@ -1,10 +1,10 @@ -# RawSlice +# `RawSlice` A dynamic array of values can be represented using the `RawSlice` type. A raw slice can be a value reference or a raw pointer. <<< @/../../docs-snippets/src/guide/types/raw-slice.test.ts#raw-slice-1{ts:line-numbers} -## Using a RawSlice +## Using a `RawSlice` The `RawSlice` type can be integrated with your contract calls. Consider the following contract that can compare and return a `RawSlice`: diff --git a/apps/docs/src/guide/types/std-string.md b/apps/docs/src/guide/types/std-string.md index 5e865bb96fb..1315919d71c 100644 --- a/apps/docs/src/guide/types/std-string.md +++ b/apps/docs/src/guide/types/std-string.md @@ -1,10 +1,10 @@ -# StdString +# `StdString` A dynamic string of variable length can be represented using the `StdString` type, also known as a Standard Lib String or `std-lib-string`. It behaves much like a dynamic string in most languages, and is essentially an array of characters. <<< @/../../docs-snippets/src/guide/types/std-string.test.ts#std-string-1{ts:line-numbers} -## Using a StdString +## Using a `StdString` The `StdString` type can be integrated with your contract calls. Consider the following contract that can compare and return a String: diff --git a/apps/docs/src/guide/wallet-manager/getting-started-with-wallet-manager.md b/apps/docs/src/guide/wallet-manager/getting-started-with-wallet-manager.md index 177eec293d1..94ff429edd0 100644 --- a/apps/docs/src/guide/wallet-manager/getting-started-with-wallet-manager.md +++ b/apps/docs/src/guide/wallet-manager/getting-started-with-wallet-manager.md @@ -20,7 +20,7 @@ By default, a `WalletManager` instance is locked when created. Before using it, Once your `WalletManager` is unlocked, it can manage your wallets. -## Managing Vaults with WalletManager +## Managing Vaults with `WalletManager` A vault in `WalletManager` serves as a secure container for wallets. The `WalletManager` manages wallets by interacting with these vaults, supporting operations such as `getAccounts`, which returns public information about all wallets stored in the vault, and `exportAccount`, which exports a private key for a given wallet address. @@ -50,10 +50,10 @@ This will output something like this: <<< @/../../docs-snippets/src/guide/wallet-manager/getting-started-with-wallet-manager.test.ts#getting-started-with-wallet-manager-6{bash:line-numbers} -As you can see, the WalletManager assigns unique `vaultIds` for each vault. The first vault you added has a `vaultId` of `0`, and the second one has a `vaultId` of `1`. +As you can see, the `WalletManager` assigns unique `vaultIds` for each vault. The first vault you added has a `vaultId` of `0`, and the second one has a `vaultId` of `1`. Let's retrieve your wallet instance with the `getWallet` method: <<< @/../../docs-snippets/src/guide/wallet-manager/getting-started-with-wallet-manager.test.ts#getting-started-with-wallet-manager-7{ts:line-numbers} -This guide walked through the steps to instantiate a WalletManager, set up its first vault, and retrieve vault information. The following sections will explore more functionalities of WalletManager, and go deeper into the usage of its vaults and the details of its storage system. +This guide walked through the steps to instantiate a `WalletManager`, set up its first vault, and retrieve vault information. The following sections will explore more functionalities of `WalletManager`, and go deeper into the usage of its vaults and the details of its storage system. diff --git a/apps/docs/src/guide/wallet-manager/index.md b/apps/docs/src/guide/wallet-manager/index.md index 6d349a5cb27..83f59477799 100644 --- a/apps/docs/src/guide/wallet-manager/index.md +++ b/apps/docs/src/guide/wallet-manager/index.md @@ -1,10 +1,10 @@ # Wallet Manager -The WalletManager is a robust tool designed for managing vaults of wallets. It offers robust management of vaults, including support for custom storage and powerful encryption of all held vaults. +The `WalletManager` is a robust tool designed for managing vaults of wallets. It offers robust management of vaults, including support for custom storage and powerful encryption of all held vaults. ## Key Features -### Managing Vaults with WalletManager +### Managing Vaults with `WalletManager` This includes adding new wallets to specific vaults, retrieving all wallets from a vault, exporting specific vaults, and exporting private keys. The `WalletManager` class currently supports two types of vaults: `PrivateKeyVault` and `MnemonicVault`. diff --git a/apps/docs/src/guide/wallets/access.md b/apps/docs/src/guide/wallets/access.md index bd2981ef837..290169c11ec 100644 --- a/apps/docs/src/guide/wallets/access.md +++ b/apps/docs/src/guide/wallets/access.md @@ -38,7 +38,7 @@ A `WalletUnlocked` instance can be locked using the `lock` method: <<< @/../../../packages/fuel-gauge/src/doc-examples.test.ts#wallet-unlocked-to-locked{ts:line-numbers} Most wallet constructors that create or generate a new wallet are provided on -the `WalletUnlocked` type. Consider `lock`ing the wallet after the new private +the `WalletUnlocked` type. Consider locking the wallet with the `lock` method after the new private key has been handled in order to reduce the scope in which the wallet's private key is stored in memory. diff --git a/apps/docs/src/index.md b/apps/docs/src/index.md index 0152de2da36..a959bb6af1e 100644 --- a/apps/docs/src/index.md +++ b/apps/docs/src/index.md @@ -48,7 +48,7 @@ npm install fuels --save ## Import - + ```ts:line-numbers import { Wallet } from "fuels"; @@ -62,7 +62,7 @@ console.log(Wallet.fromPrivateKey(PRIVATE_KEY)); ## Calling Contracts - + ```ts:line-numbers import { Provider, Wallet, Contract, BigNumberish, BN } from "fuels"; @@ -85,7 +85,7 @@ console.log(transactionId, value); ## Deploying Contracts - + ```ts:line-numbers import { Provider, ContractFactory } from "fuels";