From 5e755f0be38ad3261ff41ced81b6686d68b18e97 Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Fri, 22 Nov 2024 10:58:55 +0000 Subject: [PATCH 01/12] chore: remove typedoc builds --- apps/docs/.typedoc/api-readme.md | 10 -- apps/docs/.vitepress/config.ts | 4 +- apps/docs/package.json | 12 +- apps/docs/scripts/typedoc-postbuild.ts | 211 ------------------------- apps/docs/typedoc.json | 37 ----- pnpm-lock.yaml | 28 ---- 6 files changed, 5 insertions(+), 297 deletions(-) delete mode 100644 apps/docs/.typedoc/api-readme.md delete mode 100644 apps/docs/scripts/typedoc-postbuild.ts delete mode 100644 apps/docs/typedoc.json diff --git a/apps/docs/.typedoc/api-readme.md b/apps/docs/.typedoc/api-readme.md deleted file mode 100644 index ab179391bc0..00000000000 --- a/apps/docs/.typedoc/api-readme.md +++ /dev/null @@ -1,10 +0,0 @@ - - -# The Fuel TypeScript SDK API Documentation - -
- -#### Version Notice: Docs generated using Fuels `v{{fuels}}`, Fuel Core `v{{fuelCore}}`, Sway `v{{forc}}`, and Forc `v{{forc}}`. diff --git a/apps/docs/.vitepress/config.ts b/apps/docs/.vitepress/config.ts index 4efd373d2b1..9f5b0e6c13f 100644 --- a/apps/docs/.vitepress/config.ts +++ b/apps/docs/.vitepress/config.ts @@ -1,7 +1,6 @@ import { defineConfig } from 'vitepress'; import { codeInContextPlugin } from './plugins/codeInContextPlugin'; import { snippetPlugin } from './plugins/snippetPlugin'; -import apiLinks from '../.typedoc/api-links.json'; export default defineConfig({ title: 'Fuels-ts', @@ -551,8 +550,7 @@ export default defineConfig({ link: '/guide/errors/', collapsed: false, items: [], - }, - apiLinks, + } ], }, ], diff --git a/apps/docs/package.json b/apps/docs/package.json index ff2073a02bd..ff518ce8636 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -5,10 +5,9 @@ "description": "", "type": "module", "scripts": { - "dev": "nodemon --config nodemon.config.json -x 'pnpm run docs && vitepress dev'", - "build": "pnpm run docs && vitepress build", - "preview": "pnpm run docs && vitepress preview", - "docs": "typedoc && tsx ./scripts/typedoc-postbuild.ts" + "dev": "nodemon --config nodemon.config.json -x 'vitepress dev'", + "build": "vitepress build", + "preview": "vitepress preview" }, "keywords": [], "author": "", @@ -16,8 +15,7 @@ "dependencies": { "@fuel-ts/errors": "workspace:*", "@fuel-ts/versions": "workspace:*", - "fuels": "workspace:*", - "typedoc-plugin-markdown": "^4.2.9" + "fuels": "workspace:*" }, "devDependencies": { "@types/markdown-it": "^14.1.2", @@ -26,8 +24,6 @@ "markdown-it": "^14.1.0", "nodemon": "^3.1.7", "replace": "^1.2.2", - "typedoc": "^0.26.3", - "typedoc-plugin-merge-modules": "^6.0.2", "vitepress-plugin-search": "1.0.4-alpha.22", "vitepress": "1.3.4", "vue": "^3.5.12" diff --git a/apps/docs/scripts/typedoc-postbuild.ts b/apps/docs/scripts/typedoc-postbuild.ts deleted file mode 100644 index 3b6727a14e7..00000000000 --- a/apps/docs/scripts/typedoc-postbuild.ts +++ /dev/null @@ -1,211 +0,0 @@ -import { readdirSync, renameSync, rmdirSync, rmSync, statSync, writeFileSync } from 'fs'; -import { dirname, join } from 'path'; -import replace from 'replace'; -import { fileURLToPath } from 'url'; - -type Link = { - link: string; - text: string; - items: Link[]; - collapsed?: boolean; -}; - -type RegexReplacement = { - regex: string; - replacement: string; -}; - -/** - * Post build script to trim off undesired leftovers from Typedoc, restructure directories and generate json for links. - */ -const filename = fileURLToPath(import.meta.url); -const docsDir = join(dirname(filename), '../src/'); -const apiDocsDir = join(docsDir, '/api'); - -const filesToRemove = ['api/_media']; - -const filePathReplacements: RegexReplacement[] = []; -const secondaryEntryPoints = ['-index.md', '-test_utils.md', '-cli_utils.md']; -const toFlattern = ['classes', 'interfaces', 'enumerations']; - -const { log } = console; - -/** - * Removes unwanted files and dirs generated by typedoc. - */ -const removeUnwantedFiles = () => - filesToRemove.forEach((dirPath) => { - const fullDirPath = join(docsDir, dirPath); - rmSync(fullDirPath, { recursive: true, force: true }); - }); - -/** - * Generates a json file containing the links for the sidebar to be used by vitepress. - */ -const exportLinksJson = () => { - const links: Link = { link: '/api/', text: 'API', collapsed: true, items: [] }; - const directories = readdirSync(apiDocsDir); - directories - .filter((directory) => !directory.endsWith('.md')) - .forEach((directory) => { - links.items.push({ text: directory, link: `/api/${directory}/`, collapsed: true, items: [] }); - readdirSync(join(apiDocsDir, directory)) - .filter((file) => { - // Exclude index files and files related to secondary entry points - const isIndexFile = file.endsWith('index.md'); - const isSecondaryEntryPoint = secondaryEntryPoints.some((entryPoint) => - file.includes(entryPoint.replace('_', '-').replace('.md', '')) - ); - return !isIndexFile && !isSecondaryEntryPoint; - }) - .forEach((file) => { - const index = links.items.findIndex((item) => item.text === directory); - if (index !== -1) { - const name = file.split('.')[0]; - links.items[index].items.push({ - text: name, - link: `/api/${directory}/${name}`, - items: [], - }); - } - }); - }); - writeFileSync('.typedoc/api-links.json', JSON.stringify(links)); -}; - -const digRecursively = (startingPath: string, rootPackagePath: string, rootPackageName: string) => { - const subDirs = readdirSync(startingPath); - subDirs.forEach((dirName) => { - const secondaryDirPath = join(startingPath, dirName); - if (toFlattern.includes(dirName)) { - const secondaryDirFiles = readdirSync(secondaryDirPath); - - secondaryDirFiles.forEach((file) => { - renameSync(join(secondaryDirPath, file), join(rootPackagePath, file)); - const capitalRootPackageName = - rootPackageName.charAt(0).toUpperCase() + rootPackageName.slice(1); - const filePathToReplace = startingPath.replace(rootPackagePath, rootPackageName); - filePathReplacements.push({ - regex: `${filePathToReplace}/${dirName}/${file}`, - replacement: `${capitalRootPackageName}/${file}`, - }); - }); - - rmSync(secondaryDirPath, { recursive: true, force: true }); - } else { - if (statSync(secondaryDirPath).isDirectory()) { - digRecursively(secondaryDirPath, rootPackagePath, rootPackageName); - } - - if (dirName === 'index.md') { - const pathAfterRoot = secondaryDirPath.replace(`${rootPackagePath}/`, ''); - const pathSegments = pathAfterRoot.split('/'); - if (pathSegments.length - 1 > 0) { - const newIndexFileName = - pathSegments[pathSegments.length - 2] === 'index' - ? `src-index.md` - : `${pathSegments[pathSegments.length - 2]}-index.md`; - renameSync(secondaryDirPath, join(rootPackagePath, newIndexFileName)); - filePathReplacements.push({ - regex: `${pathAfterRoot}`, - replacement: `./${newIndexFileName}`, - }); - } - } - } - }); -}; - -/** - * Flattens the module files generated by typedoc. Only necessary where a package - * has multiple entry points. - */ -const flattenSecondaryModules = () => { - const primaryDirs = readdirSync(apiDocsDir); - primaryDirs.forEach((primaryDirName) => { - const primaryDirPath = join(apiDocsDir, primaryDirName); - if (statSync(primaryDirPath).isDirectory()) { - digRecursively(primaryDirPath, primaryDirPath, primaryDirName); - } - }); -}; - -/** - * Capitalise the Primary Directories - */ -const capitalisePrimaryDirs = () => { - const primaryDirs = readdirSync(apiDocsDir); - primaryDirs - .filter((directory) => !directory.includes('.md')) - .forEach((primaryDirName) => { - const capitalise = primaryDirName.charAt(0).toUpperCase() + primaryDirName.slice(1); - const primaryDirPath = join(apiDocsDir, primaryDirName); - renameSync(primaryDirPath, join(apiDocsDir, capitalise)); - filePathReplacements.push({ - regex: `${primaryDirName}/index.md`, - replacement: `${capitalise}/index.md`, - }); - }); -}; - -/** - * Remove empty directories - */ -const cleanupDirectories = (dirPath: string) => { - const primaryDirs = readdirSync(dirPath); - primaryDirs.forEach((dir) => { - const fullPath = join(dirPath, dir); - if (statSync(fullPath).isDirectory()) { - cleanupDirectories(fullPath); - } - }); - if (readdirSync(dirPath).length === 0) { - rmdirSync(dirPath); - } -}; - -/** - * Recreates the generated typedoc links - */ -const recreateInternalLinks = () => { - const topLevelDirs = readdirSync(apiDocsDir); - - const prefixReplacements: RegexReplacement[] = [ - // Prefix/Typedoc cleanups - { regex: 'classes/', replacement: './' }, - { regex: 'interfaces/', replacement: './' }, - { regex: 'enumerations/', replacement: './' }, - { regex: '../../../', replacement: '../' }, - { regex: '../../', replacement: '../' }, - { regex: 'index/index', replacement: 'index' }, - { regex: '.././', replacement: './' }, - // Resolves `[plugin:vite:vue] Element is missing end tag.` error - { regex: '<', replacement: '<' }, - ]; - - const internalLinksReplacement = [...filePathReplacements, ...prefixReplacements]; - - topLevelDirs.forEach((dir) => { - internalLinksReplacement.forEach(({ regex, replacement }) => { - replace({ - regex, - replacement, - paths: [join(apiDocsDir, dir)], - recursive: true, - silent: true, - }); - }); - }); -}; - -const main = () => { - log('Cleaning up API docs.'); - removeUnwantedFiles(); - flattenSecondaryModules(); - capitalisePrimaryDirs(); - cleanupDirectories(apiDocsDir); - exportLinksJson(); - recreateInternalLinks(); -}; - -main(); diff --git a/apps/docs/typedoc.json b/apps/docs/typedoc.json deleted file mode 100644 index 64b3b7f0e6f..00000000000 --- a/apps/docs/typedoc.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - // ************** // - // TypeDoc Config - // ************** // - "$schema": "https://typedoc.org/schema.json", - "includeVersion": true, - "entryPointStrategy": "packages", - "entryPoints": [ - "../../packages/address", - "../../packages/interfaces", - "../../packages/predicate", - "../../packages/account", - "../../packages/program", - "../../packages/contract", - "../../packages/script", - "../../packages/utils" - ], - "out": "src/api", - "githubPages": false, - "readme": ".typedoc/api-readme.md", - "categorizeByGroup": true, - "cacheBust": true, - "hideGenerator": true, - "plugin": ["typedoc-plugin-markdown", "typedoc-plugin-merge-modules"], - // ********************** // - // Markdown Config - // ********************** // - "hideBreadcrumbs": true, - "membersWithOwnFile": ["Class", "Enum", "Interface"], - "excludeScopesInPaths": true, - "entryFileName": "index.md", - "modulesFileName": "index", - // ******************** // - // Merge Modules Config - // ******************** // - "mergeModulesMergeMode": "module" -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2ffca996076..8ddf80eb852 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -512,9 +512,6 @@ importers: fuels: specifier: workspace:* version: link:../../packages/fuels - typedoc-plugin-markdown: - specifier: ^4.2.9 - version: 4.2.9(typedoc@0.26.6(typescript@5.6.3)) devDependencies: '@types/markdown-it': specifier: ^14.1.2 @@ -534,12 +531,6 @@ importers: replace: specifier: ^1.2.2 version: 1.2.2 - typedoc: - specifier: ^0.26.3 - version: 0.26.6(typescript@5.6.3) - typedoc-plugin-merge-modules: - specifier: ^6.0.2 - version: 6.0.2(typedoc@0.26.6(typescript@5.6.3)) vitepress: specifier: 1.3.4 version: 1.3.4(@algolia/client-search@4.22.1)(@types/node@22.7.7)(@types/react@18.3.11)(axios@1.7.7)(idb-keyval@6.2.1)(postcss@8.4.49)(qrcode@1.5.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(search-insights@2.11.0)(terser@5.36.0)(typescript@5.6.3) @@ -15168,17 +15159,6 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - typedoc-plugin-markdown@4.2.9: - resolution: {integrity: sha512-Wqmx+7ezKFgtTklEq/iUhQ5uFeBDhAT6wiS2na9cFLidIpl9jpDHJy/COYh8jUZXgIRIZVQ/bPNjyrnPFoDwzg==} - engines: {node: '>= 18'} - peerDependencies: - typedoc: 0.26.x - - typedoc-plugin-merge-modules@6.0.2: - resolution: {integrity: sha512-WdADOhOCZBi4wDjP82ua36YSmDaiRGb+o9qXGD9W01nE0hZqbGnogSmalj/zii/T9IaSIRVBPvdQD5urBh8NIw==} - peerDependencies: - typedoc: 0.26.x - typedoc@0.26.6: resolution: {integrity: sha512-SfEU3SH3wHNaxhFPjaZE2kNl/NFtLNW5c1oHsg7mti7GjmUj1Roq6osBQeMd+F4kL0BoRBBr8gQAuqBlfFu8LA==} engines: {node: '>= 18'} @@ -35809,14 +35789,6 @@ snapshots: typedarray@0.0.6: {} - typedoc-plugin-markdown@4.2.9(typedoc@0.26.6(typescript@5.6.3)): - dependencies: - typedoc: 0.26.6(typescript@5.6.3) - - typedoc-plugin-merge-modules@6.0.2(typedoc@0.26.6(typescript@5.6.3)): - dependencies: - typedoc: 0.26.6(typescript@5.6.3) - typedoc@0.26.6(typescript@5.6.3): dependencies: lunr: 2.3.9 From 082311d7243169838af2a8f0cb947af783e3b5bb Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Fri, 22 Nov 2024 12:14:38 +0000 Subject: [PATCH 02/12] chore: move docs links --- .../src/guide/contracts/contract-balance.md | 4 +-- .../src/guide/contracts/cost-estimation.md | 2 +- .../guide/contracts/dependency-estimation.md | 2 +- .../guide/contracts/deploying-contracts.md | 2 +- .../contracts/managing-deployed-contracts.md | 8 ++--- .../contracts/using-different-wallets.md | 2 +- ...custom-transactions-from-contract-calls.md | 2 +- .../src/guide/cookbook/custom-transactions.md | 4 +-- apps/docs/src/guide/errors/index.md | 6 ++-- .../predicates/instantiating-a-predicate.md | 2 +- .../send-and-spend-funds-from-predicates.md | 2 +- apps/docs/src/guide/provider/index.md | 2 +- .../src/guide/provider/provider-options.md | 2 +- .../guide/testing/launching-a-test-node.md | 2 +- .../src/guide/testing/test-node-options.md | 4 +-- apps/docs/src/guide/types/address.md | 20 +++++------ apps/docs/src/guide/types/bech32.md | 4 +-- apps/docs/src/guide/types/bits256.md | 2 +- .../src/guide/utilities/address-conversion.md | 10 +++--- apps/docs/src/guide/utilities/using-assets.md | 2 +- .../src/guide/wallets/checking-balances.md | 4 +-- apps/docs/src/guide/wallets/connectors.md | 33 ++++++++++--------- .../wallets/encrypting-and-decrypting.md | 9 +++-- apps/docs/src/guide/wallets/index.md | 8 ++--- .../guide/wallets/instantiating-wallets.md | 8 ++--- .../guide/wallets/locking-and-unlocking.md | 26 +++++++-------- .../proxy/types/Src14OwnedProxyFactory.ts | 2 +- 27 files changed, 87 insertions(+), 87 deletions(-) diff --git a/apps/docs/src/guide/contracts/contract-balance.md b/apps/docs/src/guide/contracts/contract-balance.md index 4f3f1a4bd0f..20fbddb3366 100644 --- a/apps/docs/src/guide/contracts/contract-balance.md +++ b/apps/docs/src/guide/contracts/contract-balance.md @@ -1,10 +1,10 @@ # Contract Balance -When working with contracts, it's crucial to be aware of the available contract balance of an asset while paying for costly operations. This guide will explain the `getBalance` method in the [Contract](../../api/Program/Contract.md) class, which allows you to check a contract's available balance. +When working with contracts, it's crucial to be aware of the available contract balance of an asset while paying for costly operations. This guide will explain the `getBalance` method in the [Contract](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_program.Contract.html) class, which allows you to check a contract's available balance. ## The `getBalance` Method -The [`Contract.getBalance`](../../api/Program/Contract.md#getbalance) method retrieves the available balance of a specific asset on your contract. This method is particularly useful for determining the remaining balance after sending assets to a contract and executing contract calls. +The [`Contract.getBalance`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_program.Contract.html#getbalance) method retrieves the available balance of a specific asset on your contract. This method is particularly useful for determining the remaining balance after sending assets to a contract and executing contract calls. It is important to note that this method returns the total available contract balance, regardless of how often assets have been sent to it or spent. diff --git a/apps/docs/src/guide/contracts/cost-estimation.md b/apps/docs/src/guide/contracts/cost-estimation.md index d3f76d9a333..e925da3dbf0 100644 --- a/apps/docs/src/guide/contracts/cost-estimation.md +++ b/apps/docs/src/guide/contracts/cost-estimation.md @@ -1,6 +1,6 @@ # Estimating Contract Call Cost -The [`FunctionInvocationScope.getTransactionCost`](../../api/Program/FunctionInvocationScope.md#gettransactioncost) method allows you to estimate the cost of a specific contract call. The return type, `TransactionCost`, is an object containing relevant information for the estimation: +The [`FunctionInvocationScope.getTransactionCost`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_program.FunctionInvocationScope.html#gettransactioncost) method allows you to estimate the cost of a specific contract call. The return type, `TransactionCost`, is an object containing relevant information for the estimation: <<< @/../../../packages/account/src/providers/provider.ts#cost-estimation-1{ts:line-numbers} diff --git a/apps/docs/src/guide/contracts/dependency-estimation.md b/apps/docs/src/guide/contracts/dependency-estimation.md index 7b8213381af..718b1da118e 100644 --- a/apps/docs/src/guide/contracts/dependency-estimation.md +++ b/apps/docs/src/guide/contracts/dependency-estimation.md @@ -4,6 +4,6 @@ In [variable outputs](./variable-outputs.md), we mention that a contract call mi However, by default the SDK always automatically estimates these dependencies and double-checks if everything is in order whenever you invoke a contract function or attempt to send a transaction. -The SDK uses the [Provider.estimateTxDependencies](../../api/Account/Provider.md#estimatetxdependencies) method to set any missing dependencies identified during the estimation process. This requires simulating the transaction a few times in the background. +The SDK uses the [Provider.estimateTxDependencies](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Provider.html#estimatetxdependencies) method to set any missing dependencies identified during the estimation process. This requires simulating the transaction a few times in the background. While relying on the SDK's automatic estimation is a decent default behavior, we recommend manually specifying the dependencies if they are known in advance to avoid the performance impact of the estimation process. diff --git a/apps/docs/src/guide/contracts/deploying-contracts.md b/apps/docs/src/guide/contracts/deploying-contracts.md index 65013a7e1d5..0488c5a4a6c 100644 --- a/apps/docs/src/guide/contracts/deploying-contracts.md +++ b/apps/docs/src/guide/contracts/deploying-contracts.md @@ -53,7 +53,7 @@ Now that the contract is deployed, you can interact with it by submitting a cont ## Deploying a Large Contract as Blobs -In the above guide we use the recommended `deploy` method. If you are working with a contract that is too large to be deployed in a single transaction, then the SDK will chunk the contract for you and submit it as blobs, to then be accessed later by a create transaction. This process is handled by the [`ContractFactory.deployAsBlobTx`](../../api/Contract/ContractFactory.md#deployasblobtx) method. +In the above guide we use the recommended `deploy` method. If you are working with a contract that is too large to be deployed in a single transaction, then the SDK will chunk the contract for you and submit it as blobs, to then be accessed later by a create transaction. This process is handled by the [`ContractFactory.deployAsBlobTx`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_contract.index.ContractFactory.html#deployasblobtx) method. <<< @/../../docs-snippets2/src/contracts/deploying-contracts/deployment.ts#blobs{ts:line-numbers} diff --git a/apps/docs/src/guide/contracts/managing-deployed-contracts.md b/apps/docs/src/guide/contracts/managing-deployed-contracts.md index 855c47a41e0..36c1e1be1c1 100644 --- a/apps/docs/src/guide/contracts/managing-deployed-contracts.md +++ b/apps/docs/src/guide/contracts/managing-deployed-contracts.md @@ -4,9 +4,9 @@ To interact with a deployed contract using the SDK without redeploying it, you o ## Contract ID -The `contractId` property from the [`Contract`](../../api/Program/Contract.md) class is of type [`AbstractAddress`](../../api/Interfaces/AbstractAddress.md), an abstract class that is exclusively extended by the [`Address`](../../api/Address/Address.md) class. +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:https://fuels-ts-docs-api.vercel.app/interfaces/_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`](../../api/Address/Address.md) class wraps all methods from the [`AbstractAddress`](../../api/Interfaces/AbstractAddress.md) 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`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) class wraps all methods from the [`AbstractAddress`](https:https://fuels-ts-docs-api.vercel.app/interfaces/_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). @@ -25,10 +25,10 @@ If you have already an instantiated and deployed contract in hands you can creat <<< @/../../docs-snippets2/src/contracts/managing-deployed-contracts.ts#with-contractId{ts:line-numbers} -The previous example assumes that you have a [`Contract`](../../api/Program/Contract.md) 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`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_program.Contract.html) 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`. -The process of instantiating a [`Contract`](../../api/Program/Contract.md) remains the same when using a contract ID of type `b256`: +The process of instantiating a [`Contract`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_program.Contract.html) remains the same when using a contract ID of type `b256`: <<< @/../../docs-snippets2/src/contracts/managing-deployed-contracts.ts#with-b256{ts:line-numbers} diff --git a/apps/docs/src/guide/contracts/using-different-wallets.md b/apps/docs/src/guide/contracts/using-different-wallets.md index 5c6bfe4b249..75aaf4189b9 100644 --- a/apps/docs/src/guide/contracts/using-different-wallets.md +++ b/apps/docs/src/guide/contracts/using-different-wallets.md @@ -1,6 +1,6 @@ # Making Calls with Different Wallets or Providers -This guide demonstrates how to make contract calls using different wallets and providers by passing either an [`Account`](../../api/Account/Account.md) or a [`Provider`](../../api/Account/Provider.md) to the contract on instantiation. +This guide demonstrates how to make contract calls using different wallets and providers by passing either an [`Account`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Account.html) or a [`Provider`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Provider.html) to the contract on instantiation. ## Changing Wallets diff --git a/apps/docs/src/guide/cookbook/custom-transactions-from-contract-calls.md b/apps/docs/src/guide/cookbook/custom-transactions-from-contract-calls.md index ad7a3f9c610..2ce154e37de 100644 --- a/apps/docs/src/guide/cookbook/custom-transactions-from-contract-calls.md +++ b/apps/docs/src/guide/cookbook/custom-transactions-from-contract-calls.md @@ -1,6 +1,6 @@ # Custom Transactions From Contract Calls -In the previous example we demonstrated how you can instantiate a [`ScriptTransactionRequest`](../../api/Account/ScriptTransactionRequest.md) to customize and build out a more complex transaction via a script. The same can be done using contracts, but this allows us to utilize functions available in the contract and access on-chain state. Allowing us to harness all of the power from an invocation scope and a transaction request. +In the previous example we demonstrated how you can instantiate a [`ScriptTransactionRequest`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.ScriptTransactionRequest.html) to customize and build out a more complex transaction via a script. The same can be done using contracts, but this allows us to utilize functions available in the contract and access on-chain state. Allowing us to harness all of the power from an invocation scope and a transaction request. This cookbook demonstrates how we can utilize a contract call to build out a custom transaction, allowing us to update on-chain state and transfer assets to a recipient address. diff --git a/apps/docs/src/guide/cookbook/custom-transactions.md b/apps/docs/src/guide/cookbook/custom-transactions.md index aafbfade7db..3a22647cdf6 100644 --- a/apps/docs/src/guide/cookbook/custom-transactions.md +++ b/apps/docs/src/guide/cookbook/custom-transactions.md @@ -1,12 +1,12 @@ # Custom Transactions -There may be scenarios where you need to build out transactions that involve multiple program types and assets; this can be done by instantiating a [`ScriptTransactionRequest`](../../api/Account/ScriptTransactionRequest.md). This class allows you to a append multiple program types and assets to a single transaction. +There may be scenarios where you need to build out transactions that involve multiple program types and assets; this can be done by instantiating a [`ScriptTransactionRequest`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.ScriptTransactionRequest.html). This class allows you to a append multiple program types and assets to a single transaction. Consider the following script that transfers multiple assets to a contract: <<< @/../../docs-snippets2/sway/script-transfer-to-contract/src/main.sw#custom-transactions-1{rust:line-numbers} -This script can be executed by creating a [`ScriptTransactionRequest`](../../api/Account/ScriptTransactionRequest.md), appending the resource and contract inputs/outputs and then sending the transaction, as follows: +This script can be executed by creating a [`ScriptTransactionRequest`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.ScriptTransactionRequest.html), appending the resource and contract inputs/outputs and then sending the transaction, as follows: <<< @/../../docs-snippets2/src/scripts/script-custom-transaction.ts#custom-transactions-2{ts:line-numbers} diff --git a/apps/docs/src/guide/errors/index.md b/apps/docs/src/guide/errors/index.md index 324e1c8b12f..77772baa983 100644 --- a/apps/docs/src/guide/errors/index.md +++ b/apps/docs/src/guide/errors/index.md @@ -20,7 +20,7 @@ Check that the arguments supplied to the function match the required type. ### `ACCOUNT_REQUIRED` -When an [`Account`](../../api/Account/Account.md) is required for an operation. This will usually be in the form of a [`Wallet`](../wallets/index.md). +When an [`Account`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Account.html) is required for an operation. This will usually be in the form of a [`Wallet`](../wallets/index.md). It could be caused during the deployments of contracts when an account is required to sign the transaction. This can be resolved by following the deployment guide [here](../contracts/deploying-contracts.md). @@ -214,7 +214,7 @@ Check the status received is within `TransactionStatus`. When the transaction type from the Fuel Node is _not_ supported. -The type is within [`TransactionType`](../../api/Account/TransactionType.md). +The type is within [`TransactionType`](https://fuels-ts-docs-api.vercel.app/enums/_fuel_ts_account.TransactionType.html). ### `INVALID_TTL` @@ -256,7 +256,7 @@ Ensure that a connector has been supplied to the `Account` or `Wallet`. A provider is missing when it's required for a given operation. -It could be caused by the provider not being set for either an [`Account`](../../api/Account/index.md) or a [`Wallet`](../wallets/index.md) - use the `connect` method to attach a provider. +It could be caused by the provider not being set for either an [`Account`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html) or a [`Wallet`](../wallets/index.md) - use the `connect` method to attach a provider. ### `MISSING_REQUIRED_PARAMETER` diff --git a/apps/docs/src/guide/predicates/instantiating-a-predicate.md b/apps/docs/src/guide/predicates/instantiating-a-predicate.md index 86fc9929f55..f96251f506c 100644 --- a/apps/docs/src/guide/predicates/instantiating-a-predicate.md +++ b/apps/docs/src/guide/predicates/instantiating-a-predicate.md @@ -12,7 +12,7 @@ After compiling, you will obtain the binary of the predicate and its JSON ABI (A <<< @/../../docs-snippets2/src/predicates/instantiation/simple.ts#predicate-simple-2{ts:line-numbers} -The created [`Predicate`](../../api/Account/Predicate.md) instance, among other things, has three important properties: the predicate `bytes` (byte code), the `chainId`, and the predicate `address`. +The created [`Predicate`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Predicate.html) instance, among other things, has three important properties: the predicate `bytes` (byte code), the `chainId`, and the predicate `address`. This address, generated from the byte code, corresponds to the Pay-to-Script-Hash (P2SH) address used in Bitcoin. 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 554dc5a2598..aae51f06132 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 @@ -38,7 +38,7 @@ Once the predicate resolves with a return value `true` based on its predefined c --- -In a similar approach, you can use the `createTransfer` method, which returns a [`ScriptTransactionRequest`](../../api/Account/ScriptTransactionRequest.md). Then, we can submit this transaction request by calling the `sendTransaction` method. +In a similar approach, you can use the `createTransfer` method, which returns a [`ScriptTransactionRequest`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.ScriptTransactionRequest.html). Then, we can submit this transaction request by calling the `sendTransaction` method. The following example, we are pre-staging a transaction and therefore we are able to know the transaction ID without actually submitting the transaction. diff --git a/apps/docs/src/guide/provider/index.md b/apps/docs/src/guide/provider/index.md index d8b56ff8a69..4a41105f7b8 100644 --- a/apps/docs/src/guide/provider/index.md +++ b/apps/docs/src/guide/provider/index.md @@ -1,6 +1,6 @@ # Provider -The [`Provider`](../../api/Account/Provider.md) 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](../../api/Account/Provider.md)), 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 ([_*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. 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/provider-options.md b/apps/docs/src/guide/provider/provider-options.md index 4d016955247..44470df891a 100644 --- a/apps/docs/src/guide/provider/provider-options.md +++ b/apps/docs/src/guide/provider/provider-options.md @@ -1,6 +1,6 @@ # Provider Options -You can provide various [options](../../api/Account/index.md#provideroptions) on `Provider` instantiation to modify its behavior. +You can provide various [options](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#provideroptions) on `Provider` instantiation to modify its behavior. ### `retryOptions` diff --git a/apps/docs/src/guide/testing/launching-a-test-node.md b/apps/docs/src/guide/testing/launching-a-test-node.md index a08f5f92636..539f4c09d30 100644 --- a/apps/docs/src/guide/testing/launching-a-test-node.md +++ b/apps/docs/src/guide/testing/launching-a-test-node.md @@ -4,7 +4,7 @@ To simplify testing in isolation, we provide a utility called `launchTestNode`. It allows you to spin up a short-lived `fuel-core` node, set up a custom provider, wallets, deploy contracts, and much more in one go. -For usage information for `launchTestNode` including it's inputs, outputs and options, please check the [API reference](../../api/Contract/test-utils-index.md#launchtestnode). +For usage information for `launchTestNode` including it's inputs, outputs and options, please check the [API reference](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_contract.test_utils.html#launchtestnode). ## Explicit Resource Management diff --git a/apps/docs/src/guide/testing/test-node-options.md b/apps/docs/src/guide/testing/test-node-options.md index edae0e429d4..dae5fb18137 100644 --- a/apps/docs/src/guide/testing/test-node-options.md +++ b/apps/docs/src/guide/testing/test-node-options.md @@ -9,7 +9,7 @@ This reference describes all the options of the [`launchTestNode`](./launching-a <<< @/../../docs-snippets2/src/testing/launching-a-test-node.ts#options{ts:line-numbers} -Check out the [API reference](../../api/Contract/LaunchTestNodeOptions.md) for usage information on the Test Node Options. +Check out the [API reference](https://fuels-ts-docs-api.vercel.app/interfaces/_fuel_ts_contract.test_utils.LaunchTestNodeOptions.html) for usage information on the Test Node Options. ## `walletsConfig` @@ -44,7 +44,7 @@ Used to deploy contracts on the node the `launchTestNode` utility launches. It's - `factory`: contract factory class outputted by `pnpm fuels typegen`. - `walletIndex`: the index of the wallets generated by [`walletsConfig`](./test-node-options.md#walletsconfig) that you want to deploy the contract with. -- `options`: options for [contract deployment](../contracts/deploying-contracts.md#2-contract-deployment) that get passed to the [`ContractFactory.deploy`](../../api/Contract/ContractFactory.md#deploy) method. +- `options`: options for [contract deployment](../contracts/deploying-contracts.md#2-contract-deployment) that get passed to the [`ContractFactory.deploy`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_contract.index.ContractFactory.html#deploy) method. ## `nodeOptions` diff --git a/apps/docs/src/guide/types/address.md b/apps/docs/src/guide/types/address.md index c93ee4b2954..c84d8536f0f 100644 --- a/apps/docs/src/guide/types/address.md +++ b/apps/docs/src/guide/types/address.md @@ -1,26 +1,26 @@ # Address -In Sway, the [`Address`](../../api/Address/Address.md) 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](../../api/Address/Address.md) type. +In Sway, the [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) 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](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) type. ## `AbstractAddress` Class -The SDK defines the [AbstractAddress](../../api/Interfaces/AbstractAddress.md) class, which provides a set of utility functions for easy manipulation and conversion between address formats. +The SDK defines the [AbstractAddress](https:https://fuels-ts-docs-api.vercel.app/interfaces/_fuel_ts_interfaces.AbstractAddress.html) class, which provides a set of utility functions for easy manipulation and conversion between address formats. <<< @/../../../packages/interfaces/src/index.ts#address-1{ts:line-numbers} ## Address Class -Besides conforming to the interface of the [`AbstractAddress`](../../api/Interfaces/AbstractAddress.md), the [`Address`](../../api/Address/Address.md) class also defines one property; `bech32Address`, which is of the [`Bech32`](./bech32.md) type. +Besides conforming to the interface of the [`AbstractAddress`](https:https://fuels-ts-docs-api.vercel.app/interfaces/_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. <<< @/../../../packages/address/src/address.ts#address-2{ts:line-numbers} ## Creating an Address -Thanks to the utility functions provided by the [`AbstractAddress`](../../api/Interfaces/AbstractAddress.md) class, there are several ways to create an [`Address`](../../api/Address/Address.md) instance: +Thanks to the utility functions provided by the [`AbstractAddress`](https:https://fuels-ts-docs-api.vercel.app/interfaces/_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 -To create an [`Address`](../../api/Address/Address.md) from a `Bech32` address, use the following code snippet: +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: <<< @/../../docs-snippets2/src/types/address/creating-an-address.ts#full{ts:line-numbers} @@ -29,25 +29,25 @@ To create an [`Address`](../../api/Address/Address.md) from a `Bech32` address, ### From a Public Key -To create an [`Address`](../../api/Address/Address.md) from a public key, use the following code snippet: +To create an [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) from a public key, use the following code snippet: <<< @/../../docs-snippets2/src/types/address/from-a-public-key.ts#full{ts:line-numbers} ### From a 256-bit Address -To create an [`Address`](../../api/Address/Address.md) from a 256-bit address, use the following code snippet: +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: <<< @/../../docs-snippets2/src/types/address/from-a-b256.ts#full{ts:line-numbers} ## Utility Functions -The [`Address`](../../api/Address/Address.md) class also provides some practical 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`](../../api/Address/Address.md) 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 `Bech32` or `B256` address: <<< @/../../docs-snippets2/src/types/address/utilities-function-1.ts#full{ts:line-numbers} -2. `fromDynamicInput`: Create a new [`Address`](../../api/Address/Address.md) when the address source is unknown: +2. `fromDynamicInput`: Create a new [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) when the address source is unknown: <<< @/../../docs-snippets2/src/types/address/utilities-function-2.ts#full{ts:line-numbers} diff --git a/apps/docs/src/guide/types/bech32.md b/apps/docs/src/guide/types/bech32.md index 59e97dec023..54b40fb137f 100644 --- a/apps/docs/src/guide/types/bech32.md +++ b/apps/docs/src/guide/types/bech32.md @@ -3,9 +3,9 @@ > [!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`](../../api/Address/Address.md) class, specifically through the `bech32Address` property. +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`](../../api/Address/Address.md) class is constructed around the `Bech32` type. +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/). diff --git a/apps/docs/src/guide/types/bits256.md b/apps/docs/src/guide/types/bits256.md index 893ff68cf79..3b4b5699e94 100644 --- a/apps/docs/src/guide/types/bits256.md +++ b/apps/docs/src/guide/types/bits256.md @@ -16,6 +16,6 @@ To convert between a `b256` hexlified string and a `Uint8Array`, you can use the ## Support from `Address` Class -A `b256` value is also supported as part of the [`Address`](../../api/Address/Address.md) class, providing seamless integration with other components of your application. To create an [`Address`](../../api/Address/Address.md) instance from a b256 value, use the `Address.fromB256()` method: +A `b256` value is also supported as part of the [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) class, providing seamless integration with other components of your application. To create an [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) instance from a b256 value, use the `Address.fromB256()` method: <<< @/../../docs-snippets2/src/types/bits256/support-from-address-class.ts#full{ts:line-numbers} diff --git a/apps/docs/src/guide/utilities/address-conversion.md b/apps/docs/src/guide/utilities/address-conversion.md index b6e914e4fd2..e34f771ba5b 100644 --- a/apps/docs/src/guide/utilities/address-conversion.md +++ b/apps/docs/src/guide/utilities/address-conversion.md @@ -28,7 +28,7 @@ This guide demonstrates how to convert between address formats and Sway Standard ## From `Bech32` to `b256` -By instantiating an [`Address`](../../api/Address/Address.md), we can validate a `Bech32` address and easily convert it to a `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`: <<< @/../../docs-snippets2/src/utilities/address-conversion/bech32-to-b256.ts#conversion-5{ts:line-numbers} @@ -38,7 +38,7 @@ Or, if you'd prefer to use utility functions directly for validation and convers ## From `b256` to `Bech32` -In a similar fashion, we have both class functions on the [`Address`](../../api/Address/Address.md) and utilities available for `b256` validation and conversion: +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: <<< @/../../docs-snippets2/src/utilities/address-conversion/b256-to-bech32.ts#conversion-7{ts:line-numbers} @@ -48,18 +48,18 @@ And by using the `isB256` and `toBech32` utilities: ## 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`](../../api/Address/Address.md) class functions such as `toAddress` and `toB256`: +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`: <<< @/../../docs-snippets2/src/utilities/address-conversion/contract.ts#conversion-2{ts:line-numbers} ## Converting a Wallet Address -Similarly, the Wallet `address` property is also of type [`AbstractAddress`](../types/address.md#abstractaddress-class) and can therefore use the same [`Address`](../../api/Address/Address.md) class functions for conversion: +Similarly, the Wallet `address` property is also of type [`AbstractAddress`](../types/address.md#abstractaddress-class) and can therefore use the same [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) class functions for conversion: <<< @/../../docs-snippets2/src/utilities/address-conversion/wallet.ts#conversion-3{ts:line-numbers} ## Converting an Asset ID -[Asset IDs](../types/asset-id.md) are a wrapped [b256](../types/bits256.md) value. The following example shows how to create an [`Address`](../../api/Address/Address.md) from a `b256` type: +[Asset IDs](../types/asset-id.md) are a wrapped [b256](../types/bits256.md) value. The following example shows how to create an [`Address`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_address.Address.html) from a `b256` type: <<< @/../../docs-snippets2/src/utilities/address-conversion/asset-id.ts#conversion-4{ts:line-numbers} diff --git a/apps/docs/src/guide/utilities/using-assets.md b/apps/docs/src/guide/utilities/using-assets.md index 84099342fa7..fdcf8f8efbc 100644 --- a/apps/docs/src/guide/utilities/using-assets.md +++ b/apps/docs/src/guide/utilities/using-assets.md @@ -9,6 +9,6 @@ Included assets such as: - USD Coin (USDC) - Wrapped ETH (WETH) -The helper functions `getAssetFuel` and `getAssetEth` can be used to get an asset's details relative to each network. These return a combination of the asset, and network information (the return types are [`AssetFuel`](../../api/Account/index.md#assetfuel) and [`AssetEth`](../../api/Account/index.md#asseteth) respectively). +The helper functions `getAssetFuel` and `getAssetEth` can be used to get an asset's details relative to each network. These return a combination of the asset, and network information (the return types are [`AssetFuel`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#assetfuel) and [`AssetEth`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#asseteth) respectively). <<< @/../../docs-snippets2/src/utilities/using-assets.ts#using-assets-1{ts:line-numbers} diff --git a/apps/docs/src/guide/wallets/checking-balances.md b/apps/docs/src/guide/wallets/checking-balances.md index fa26d640ed9..813271efc12 100644 --- a/apps/docs/src/guide/wallets/checking-balances.md +++ b/apps/docs/src/guide/wallets/checking-balances.md @@ -1,9 +1,9 @@ # Checking balances -To check the balance of a specific asset, you can use [`getBalance`](../../api/Account/Account.md#getbalance) method. This function aggregates the amounts of all unspent coins of the given asset in your wallet. +To check the balance of a specific asset, you can use [`getBalance`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Account.html#getbalance) method. This function aggregates the amounts of all unspent coins of the given asset in your wallet. <<< @/../../docs-snippets2/src/wallets/checking-balances.ts#checking-balances-1{ts:line-numbers} -To retrieve the balances of all assets in your wallet, use the [`getBalances`](../../api/Account/Account.md#getbalances) method, it returns an array of [`CoinQuantity`](../../api/Account/index.md#coinquantity). This is useful for getting a comprehensive view of your holdings. +To retrieve the balances of all assets in your wallet, use the [`getBalances`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Account.html#getbalances) method, it returns an array of [`CoinQuantity`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#coinquantity). This is useful for getting a comprehensive view of your holdings. <<< @/../../docs-snippets2/src/wallets/checking-balances-two.ts#checking-balances-2{ts:line-numbers} diff --git a/apps/docs/src/guide/wallets/connectors.md b/apps/docs/src/guide/wallets/connectors.md index 552f1d67a4b..65fa0235af6 100644 --- a/apps/docs/src/guide/wallets/connectors.md +++ b/apps/docs/src/guide/wallets/connectors.md @@ -6,7 +6,7 @@ Fuel Wallet Connectors offer a standardized interface to integrate multiple wall `Fuel Connectors` are a set of standardized interfaces that provide a way to interact with various wallets and services. They offer a consistent way to interact with different wallets and services, allowing developers to focus on building their applications rather than worrying about wallet integration. -To build your own wallet integration, you can create a custom connector that extends the abstract [`FuelConnector`](../../api/Account/FuelConnector.md) class. This interface provides a set of methods and events that allow you to interact with the wallet and handle various operations such as connecting, disconnecting, signing messages, and sending transactions. +To build your own wallet integration, you can create a custom connector that extends the abstract [`FuelConnector`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.FuelConnector.html) class. This interface provides a set of methods and events that allow you to interact with the wallet and handle various operations such as connecting, disconnecting, signing messages, and sending transactions. <<< @/../../docs-snippets2/src/wallets/connectors.ts#fuel-connector-extends{ts:line-numbers} @@ -21,6 +21,7 @@ The `name` property is simply a `string` on the connector that serves as an iden <<< @/../../docs-snippets2/src/wallets/connectors.ts#fuel-connector-name{ts:line-numbers} ### `external` + The `external` property is simply a `boolean` that indicates when a connector is external or not. Connectors are considered external, or non-native, when they do not support the Fuel Network (e.g. `Solana`, `WalletConnect`). @@ -66,13 +67,13 @@ The `accounts` event is emitted every time a connector's accounts change. The ev #### `connectors` -The `connectors` event is emitted when the connectors are initialized. The event data is an array of [`FuelConnector`](../../api/Account/FuelConnector.md) objects available on the network. +The `connectors` event is emitted when the connectors are initialized. The event data is an array of [`FuelConnector`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.FuelConnector.html) objects available on the network. <<< @/../../docs-snippets2/src/wallets/connectors.ts#fuel-connector-events-connectors{ts:line-numbers} #### `currentConnector` -The `currentConnector` event is emitted every time the current connector changes. The event data is a [`FuelConnector`](../../api/Account/FuelConnector.md) object that is currently connected. +The `currentConnector` event is emitted every time the current connector changes. The event data is a [`FuelConnector`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.FuelConnector.html) object that is currently connected. <<< @/../../docs-snippets2/src/wallets/connectors.ts#fuel-connector-events-currentConnector{ts:line-numbers} @@ -90,25 +91,25 @@ The `connection` event is emitted every time the connection status changes. The #### `networks` -The `networks` event is emitted every time the network changes. The event data will be a [`Network`](../../api/Account/index.md#network) object containing the current network information. +The `networks` event is emitted every time the network changes. The event data will be a [`Network`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#network) object containing the current network information. <<< @/../../docs-snippets2/src/wallets/connectors.ts#fuel-connector-events-networks{ts:line-numbers} #### `currentNetwork` -The `currentNetwork` event is emitted every time the current network changes. The event data will be a [`Network`](../../api/Account/index.md#network) object containing the current network information. +The `currentNetwork` event is emitted every time the current network changes. The event data will be a [`Network`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#network) object containing the current network information. <<< @/../../docs-snippets2/src/wallets/connectors.ts#fuel-connector-events-currentNetwork{ts:line-numbers} #### `assets` -The `assets` event is emitted every time the assets change. The event data will be an array of [`Asset`](../../api/Account/index.md#asset) objects available on the network. +The `assets` event is emitted every time the assets change. The event data will be an array of [`Asset`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#asset) objects available on the network. <<< @/../../docs-snippets2/src/wallets/connectors.ts#fuel-connector-events-assets{ts:line-numbers} #### `abis` -The `abis` event is emitted every time an ABI is added to a connector. The event data will be an array of [`FuelABI`](../../api/Account/index.md#fuelabi) object. +The `abis` event is emitted every time an ABI is added to a connector. The event data will be an array of [`FuelABI`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#fuelabi) object. <<< @/../../docs-snippets2/src/wallets/connectors.ts#fuel-connector-events-assets{ts:line-numbers} @@ -196,7 +197,7 @@ The `signTransaction` method initiates the send transaction flow for the current It requires two arguments: - `address` (`string`) -- `transaction` ([`TransactionRequestLike`](../../api/Account/index.md#transactionrequestlike)) +- `transaction` ([`TransactionRequestLike`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#transactionrequestlike)) It will return the transaction signature (as a `string`) if it is successfully signed. @@ -206,7 +207,7 @@ It will return the transaction signature (as a `string`) if it is successfully s The `assets` method returns a list of all the assets available for the current connection. -It will return a promise that will resolve to an array of assets (see [`Asset`](../../api/Account/index.md#asset)) that are available on the network. +It will return a promise that will resolve to an array of assets (see [`Asset`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#asset)) that are available on the network. <<< @/../../../packages/account/src/connectors/fuel-connector.ts#fuel-connector-method-assets{ts:line-numbers} @@ -216,7 +217,7 @@ The `addAsset` method adds asset metadata to the connector. It requires a single argument: -- `asset` ([`Asset`](../../api/Account/index.md#asset)) +- `asset` ([`Asset`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#asset)) It returns a promise that resolves to `true` if the asset is successfully added; otherwise, it resolves to `false`. @@ -228,7 +229,7 @@ The `addAssets` method adds multiple asset metadata to the connector. It requires a single argument: -- `assets` (an Array of [`Asset`](../../api/Account/index.md#asset)). +- `assets` (an Array of [`Asset`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#asset)). Returns a promise that resolves to `true` if the assets are successfully added; otherwise, resolves to `false`. @@ -252,7 +253,7 @@ It should throw an error if the network is not available or the network already The `networks` method returns a list of all the networks available for the current connection. -Returns a promise that resolves to an array of available networks (see [`Network`](../../api/Account/index.md#network)). +Returns a promise that resolves to an array of available networks (see [`Network`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#network)). <<< @/../../../packages/account/src/connectors/fuel-connector.ts#fuel-connector-method-networks{ts:line-numbers} @@ -260,7 +261,7 @@ Returns a promise that resolves to an array of available networks (see [`Network The `currentNetwork` method will return the current network that is connected. -It will return a promise that will resolve to the current network (see [`Network`](../../api/Account/index.md#network)). +It will return a promise that will resolve to the current network (see [`Network`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#network)). <<< @/../../../packages/account/src/connectors/fuel-connector.ts#fuel-connector-method-currentNetwork{ts:line-numbers} @@ -270,7 +271,7 @@ The `selectNetwork` method requests the user to select a network for the current It requires a single argument: -- `network` ([`Network`](../../api/Account/index.md#network)) +- `network` ([`Network`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#network)) You call this method with either the `providerUrl` or `chainId` to select the network. @@ -287,7 +288,7 @@ The `addABI` method adds ABI information about a contract to the connector. This It requires two arguments: - `contractId` (`string`) -- `abi` ([`FuelABI`](../../api/Account/index.md#fuelabi)). +- `abi` ([`FuelABI`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#fuelabi)). It will return a promise that will resolve to `true` if the ABI is successfully added; otherwise `false`. @@ -301,7 +302,7 @@ It requires a single argument: - `contractId` (`string`) -Returns a promise that resolves to the ABI information (as a [`FuelABI`](../../api/Account/index.md#fuelabi)) or `null` if the data is unavailable. +Returns a promise that resolves to the ABI information (as a [`FuelABI`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#fuelabi)) or `null` if the data is unavailable. <<< @/../../../packages/account/src/connectors/fuel-connector.ts#fuel-connector-method-getABI{ts:line-numbers} diff --git a/apps/docs/src/guide/wallets/encrypting-and-decrypting.md b/apps/docs/src/guide/wallets/encrypting-and-decrypting.md index 3a6992ad955..a9e446074e1 100644 --- a/apps/docs/src/guide/wallets/encrypting-and-decrypting.md +++ b/apps/docs/src/guide/wallets/encrypting-and-decrypting.md @@ -4,25 +4,24 @@ JSON wallets are a standardized way of storing wallets securely. They follow a s ## Encrypting a Wallet -We will be calling `encrypt` from the [`WalletUnlocked`](../../api/Account/WalletUnlocked.md) instance which will take a password as the argument. It will encrypt the private key using a cipher and returns the JSON keystore wallet. You can then securely store this JSON wallet. +We will be calling `encrypt` from the [`WalletUnlocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html) instance which will take a password as the argument. It will encrypt the private key using a cipher and returns the JSON keystore wallet. You can then securely store this JSON wallet. Here is an example of how you can accomplish this: <<< @/../../docs-snippets2/src/wallets/encrypting-and-decrypting-wallets.ts#encrypting-and-decrypting-json-wallets-1{ts:line-numbers} -Please note that `encrypt` must be called within an instance of [`WalletUnlocked`](../../api/Account/WalletUnlocked.md). This instance can only be achieved through passing a private key or mnemonic phrase to a locked wallet. +Please note that `encrypt` must be called within an instance of [`WalletUnlocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html). This instance can only be achieved through passing a private key or mnemonic phrase to a locked wallet. ## Decrypting a Wallet -To decrypt the JSON wallet and retrieve your private key, you can call `fromEncryptedJson` on a [Wallet](../../api/Account/Wallet.md) instance. It takes the encrypted JSON wallet and the password as its arguments, and returns the decrypted wallet. +To decrypt the JSON wallet and retrieve your private key, you can call `fromEncryptedJson` on a [Wallet](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Wallet.html) instance. It takes the encrypted JSON wallet and the password as its arguments, and returns the decrypted wallet. Here is an example: <<< @/../../docs-snippets2/src/wallets/encrypting-and-decrypting-json-wallets-two.ts#encrypting-and-decrypting-json-wallets-2{ts:line-numbers} -In this example, `decryptedWallet` is an instance of [`WalletUnlocked`](../../api/Account/WalletUnlocked.md) class, now available for use. +In this example, `decryptedWallet` is an instance of [`WalletUnlocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html) class, now available for use. ## Important Remember to securely store your encrypted JSON wallet and password. If you lose them, there will be no way to recover your wallet. For security reasons, avoid sharing your private key, encrypted JSON wallet or password with anyone. - diff --git a/apps/docs/src/guide/wallets/index.md b/apps/docs/src/guide/wallets/index.md index 24e20702a02..ac11239aea0 100644 --- a/apps/docs/src/guide/wallets/index.md +++ b/apps/docs/src/guide/wallets/index.md @@ -11,13 +11,13 @@ Wallets can be used for many important things, for instance: The SDK has multiple classes related to a Wallet instance: -- [Wallet](../../api/Account/Wallet.md): Works simply like a wrapper providing methods to create and instantiating `WalletUnlocked` and `WalletLocked` instances. +- [Wallet](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Wallet.html): Works simply like a wrapper providing methods to create and instantiating `WalletUnlocked` and `WalletLocked` instances. -- [WalletLocked](../../api/Account/WalletLocked.md): Provides the functionalities for a locked wallet. +- [WalletLocked](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletLocked.html): Provides the functionalities for a locked wallet. -- [WalletUnlocked](../../api/Account/WalletUnlocked.md): Provides the functionalities for an unlocked wallet. +- [WalletUnlocked](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html): Provides the functionalities for an unlocked wallet. -- [Account](../../api/Account/Account.md): Provides an abstraction with basic functionalities for wallets or accounts to interact with the network. It is essential to notice that both `WalletLocked` and `WalletUnlocked` extend from the `Account` class. +- [Account](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Account.html): Provides an abstraction with basic functionalities for wallets or accounts to interact with the network. It is essential to notice that both `WalletLocked` and `WalletUnlocked` extend from the `Account` class. Let's explore these different approaches in the following sub-chapters. diff --git a/apps/docs/src/guide/wallets/instantiating-wallets.md b/apps/docs/src/guide/wallets/instantiating-wallets.md index 8a6730d55f9..e9a160713d2 100644 --- a/apps/docs/src/guide/wallets/instantiating-wallets.md +++ b/apps/docs/src/guide/wallets/instantiating-wallets.md @@ -4,13 +4,13 @@ Wallets can be instantiated in multiple ways within the SDK. ## Generating new wallets -To generate a new, unlocked wallet, use the [`generate`](../../api/Account/Wallet.md#generate) method. This method creates a new [`WalletUnlocked`](../../api/Account/WalletUnlocked.md) instance, which is immediately ready for use. +To generate a new, unlocked wallet, use the [`generate`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Wallet.html#generate) method. This method creates a new [`WalletUnlocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html) instance, which is immediately ready for use. <<< @/../../docs-snippets2/src/wallets/instantiating/generate.ts#instantiating-wallets-1{ts:line-numbers} ## Instantiating Unlocked Wallets -Creating [`WalletUnlocked`](../../api/Account/WalletUnlocked.md) instances of your existing wallets is easy and can be done in several ways: +Creating [`WalletUnlocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html) instances of your existing wallets is easy and can be done in several ways: From a private key: @@ -38,13 +38,13 @@ It's possible to instantiate a `WalletUnlocked` from a `WalletLocked`: ## Instantiating Locked Wallets -You can also instantiate [`WalletLocked`](../../api/Account/WalletLocked.md) instances using just the wallet address: +You can also instantiate [`WalletLocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletLocked.html) instances using just the wallet address: <<< @/../../docs-snippets2/src/wallets/instantiating/from-bech32-address.ts#instantiating-wallets-8{ts:line-numbers} ## Connecting to a Provider -While wallets can be used independently of a [`Provider`](../../api/Account/Provider.md), operations requiring blockchain interaction will need one. +While wallets can be used independently of a [`Provider`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Provider.html), operations requiring blockchain interaction will need one. Connecting an existing wallet to a Provider: diff --git a/apps/docs/src/guide/wallets/locking-and-unlocking.md b/apps/docs/src/guide/wallets/locking-and-unlocking.md index 80a0296f0d0..c1d64f00dd5 100644 --- a/apps/docs/src/guide/wallets/locking-and-unlocking.md +++ b/apps/docs/src/guide/wallets/locking-and-unlocking.md @@ -1,25 +1,25 @@ # Locking and Unlocking -The kinds of operations we can perform with a [`Wallet`](../../api/Account/Wallet.md) instance depend on +The kinds of operations we can perform with a [`Wallet`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Wallet.html) instance depend on whether or not we have access to the wallet's private key. -In order to differentiate between [`Wallet`](../../api/Account/Wallet.md) instances that know their private key -and those that do not, we use the [`WalletUnlocked`](../../api/Account/WalletUnlocked.md) and [`WalletLocked`](../../api/Account/WalletLocked.md) types +In order to differentiate between [`Wallet`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.Wallet.html) instances that know their private key +and those that do not, we use the [`WalletUnlocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html) and [`WalletLocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletLocked.html) types respectively. ## Wallet States -The [`WalletUnlocked`](../../api/Account/WalletUnlocked.md) type represents a wallet whose private key is known and -stored internally in memory. A wallet must be of type [`WalletUnlocked`](../../api/Account/WalletUnlocked.md) in order +The [`WalletUnlocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html) type represents a wallet whose private key is known and +stored internally in memory. A wallet must be of type [`WalletUnlocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html) in order to perform operations that involve [signing messages or transactions](./signing.md). -The [`WalletLocked`](../../api/Account/WalletLocked.md) type represents a wallet whose private key is _not_ known or stored -in memory. Instead, [`WalletLocked`](../../api/Account/WalletLocked.md) only knows its public address. A [`WalletLocked`](../../api/Account/WalletLocked.md) cannot be +The [`WalletLocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletLocked.html) type represents a wallet whose private key is _not_ known or stored +in memory. Instead, [`WalletLocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletLocked.html) only knows its public address. A [`WalletLocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletLocked.html) cannot be used to sign transactions, however it may still perform a whole suite of useful operations including listing transactions, assets, querying balances, and so on. -Note that the [`WalletUnlocked`](../../api/Account/WalletUnlocked.md) type implements most methods available on the [`WalletLocked`](../../api/Account/WalletLocked.md) -type. In other words, [`WalletUnlocked`](../../api/Account/WalletUnlocked.md) can be thought of as a thin wrapper around [`WalletLocked`](../../api/Account/WalletLocked.md) that +Note that the [`WalletUnlocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html) type implements most methods available on the [`WalletLocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletLocked.html) +type. In other words, [`WalletUnlocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html) can be thought of as a thin wrapper around [`WalletLocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletLocked.html) that provides greater access via its private key. ## Basic Example @@ -34,16 +34,16 @@ You can choose not to pass through a provider argument on `Wallet` construction: ## Transitioning States -A [`WalletLocked`](../../api/Account/WalletLocked.md) instance can be unlocked by providing the private key: +A [`WalletLocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletLocked.html) instance can be unlocked by providing the private key: <<< @/../../docs-snippets2/src/wallets/locked-to-unlocked.ts#wallet-locked-to-unlocked{ts:line-numbers} -A [`WalletUnlocked`](../../api/Account/WalletUnlocked.md) instance can be locked using the `lock` method: +A [`WalletUnlocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html) instance can be locked using the `lock` method: <<< @/../../docs-snippets2/src/wallets/unlocked-to-locked.ts#wallet-unlocked-to-locked{ts:line-numbers} Most wallet constructors that create or generate a new wallet are provided on -the [`WalletUnlocked`](../../api/Account/WalletUnlocked.md) type. Consider locking the wallet with the `lock` method after the new private +the [`WalletUnlocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html) 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. @@ -51,7 +51,7 @@ key is stored in memory. When designing APIs that accept a wallet as an input, we should think carefully about the kind of access that we require. API developers should aim to minimise -their usage of [`WalletUnlocked`](../../api/Account/WalletUnlocked.md) in order to ensure private keys are stored in +their usage of [`WalletUnlocked`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_account.WalletUnlocked.html) in order to ensure private keys are stored in memory no longer than necessary to reduce the surface area for attacks and vulnerabilities in downstream libraries and applications. diff --git a/packages/fuels/src/cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts b/packages/fuels/src/cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts index 0a142a18e5d..f21c3c8038a 100644 --- a/packages/fuels/src/cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts +++ b/packages/fuels/src/cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts @@ -31,7 +31,7 @@ export class Src14OwnedProxyFactory extends ContractFactory { static deploy ( wallet: Account, options: DeployContractOptions = {} - ): ReturnType { + ) { const factory = new Src14OwnedProxyFactory(wallet); return factory.deploy(options); } From 931f6651083029db26f49e8be4825a40ba19686c Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Fri, 22 Nov 2024 12:23:35 +0000 Subject: [PATCH 03/12] chore: remove API release --- .github/workflows/release.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f6ce152fa9a..938471c537b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -137,12 +137,8 @@ jobs: git merge origin/$GITHUB_REF_NAME --no-edit pnpm install pnpm build - rm -f apps/docs/.gitignore - git add apps/docs/src/api/ - git add apps/docs/.typedoc/api-links.json - git commit -m "docs: API docs - ${{ env.RELEASE_VERSION }}" + git commit -m "docs - ${{ env.RELEASE_VERSION }}" git push - git restore apps/docs/.gitignore - name: Update docs (nightly) if: github.ref_name == 'master' && env.SHOULD_DEPLOY_DOCS == 'true' From 7fc00ce5ab6e89e83db275714ec86381a5178217 Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Fri, 22 Nov 2024 12:28:23 +0000 Subject: [PATCH 04/12] chore: changeset --- .changeset/calm-buttons-help.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changeset/calm-buttons-help.md diff --git a/.changeset/calm-buttons-help.md b/.changeset/calm-buttons-help.md new file mode 100644 index 00000000000..00b00dff4cc --- /dev/null +++ b/.changeset/calm-buttons-help.md @@ -0,0 +1,4 @@ +--- +--- + +chore: remove legacy API docs From bebecdeb918498b59be043829ff2ee4bcfa26615 Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Fri, 22 Nov 2024 12:32:22 +0000 Subject: [PATCH 05/12] fix: reintroduce return type --- .../cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fuels/src/cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts b/packages/fuels/src/cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts index f21c3c8038a..0a142a18e5d 100644 --- a/packages/fuels/src/cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts +++ b/packages/fuels/src/cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts @@ -31,7 +31,7 @@ export class Src14OwnedProxyFactory extends ContractFactory { static deploy ( wallet: Account, options: DeployContractOptions = {} - ) { + ): ReturnType { const factory = new Src14OwnedProxyFactory(wallet); return factory.deploy(options); } From 2d05f67d963110612ae1b1d631a0ed660231c907 Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Mon, 25 Nov 2024 10:59:43 +0000 Subject: [PATCH 06/12] chore: test docs hub integration --- .github/workflows/code-lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-lint.yaml b/.github/workflows/code-lint.yaml index ae0f4134d37..e66c559744b 100644 --- a/.github/workflows/code-lint.yaml +++ b/.github/workflows/code-lint.yaml @@ -12,7 +12,7 @@ concurrency: jobs: docs: - uses: FuelLabs/github-actions/.github/workflows/vp-docs.yml@master + uses: FuelLabs/github-actions/.github/workflows/vp-docs.yml@db/chore/remove-ts-api-doc-validation with: doc-folder-path: "apps/docs/src" spellcheck-config-path: "apps/docs/.spellcheck.yml" From d57d5aa391cf9bc74b3cf1292f6eea313a809fa2 Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Mon, 25 Nov 2024 10:59:56 +0000 Subject: [PATCH 07/12] chore: fix gititgnore --- apps/docs/.gitignore | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/docs/.gitignore b/apps/docs/.gitignore index 715f7d0cc66..dca506bbece 100644 --- a/apps/docs/.gitignore +++ b/apps/docs/.gitignore @@ -1,6 +1,2 @@ .vitepress/cache .vitepress/.temp - -.typedoc/api-links.json - -src/api \ No newline at end of file From 5c9de93da30d4ac8f4b9334b3906e5b15bf25511 Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Mon, 25 Nov 2024 11:30:51 +0000 Subject: [PATCH 08/12] chore: rebuild From 6f5acfe0081d7ff5ff9948f938b611fb79039c6a Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Mon, 25 Nov 2024 11:53:37 +0000 Subject: [PATCH 09/12] chore: remove temp docs hub validation branch --- .github/workflows/code-lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-lint.yaml b/.github/workflows/code-lint.yaml index e66c559744b..ae0f4134d37 100644 --- a/.github/workflows/code-lint.yaml +++ b/.github/workflows/code-lint.yaml @@ -12,7 +12,7 @@ concurrency: jobs: docs: - uses: FuelLabs/github-actions/.github/workflows/vp-docs.yml@db/chore/remove-ts-api-doc-validation + uses: FuelLabs/github-actions/.github/workflows/vp-docs.yml@master with: doc-folder-path: "apps/docs/src" spellcheck-config-path: "apps/docs/.spellcheck.yml" From b94c4771e95246a9bd3039ab8e60d665d0e8adb2 Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Mon, 25 Nov 2024 11:56:04 +0000 Subject: [PATCH 10/12] chore: linting --- apps/docs/.vitepress/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/.vitepress/config.ts b/apps/docs/.vitepress/config.ts index 9f5b0e6c13f..406d3de6703 100644 --- a/apps/docs/.vitepress/config.ts +++ b/apps/docs/.vitepress/config.ts @@ -550,7 +550,7 @@ export default defineConfig({ link: '/guide/errors/', collapsed: false, items: [], - } + }, ], }, ], From 8befe50138722500ee4ad0eb17bc9ff801fa8a23 Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Mon, 25 Nov 2024 12:13:12 +0000 Subject: [PATCH 11/12] chore: rebuild From fd9ac01ffbe9630886ba55c0e8a03d8993528da1 Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Tue, 26 Nov 2024 09:20:50 +0000 Subject: [PATCH 12/12] chore: remove docs branch --- .github/workflows/release.yaml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 938471c537b..98c20fa8953 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -122,24 +122,6 @@ jobs: if: startsWith(env.LAST_COMMIT_MSG, 'ci(release):') && env.RELEASE_VERSION_HIGHER_THAN_LATEST == 'true' run: echo SHOULD_DEPLOY_DOCS=true >> $GITHUB_ENV - - name: Checkout API Docs - if: env.SHOULD_DEPLOY_DOCS == 'true' - uses: actions/checkout@v4 - with: - ref: docs - fetch-depth: 0 - - - name: Generate and Push API Docs - if: env.SHOULD_DEPLOY_DOCS == 'true' - run: | - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config user.name "github-actions[bot]" - git merge origin/$GITHUB_REF_NAME --no-edit - pnpm install - pnpm build - git commit -m "docs - ${{ env.RELEASE_VERSION }}" - git push - - name: Update docs (nightly) if: github.ref_name == 'master' && env.SHOULD_DEPLOY_DOCS == 'true' uses: benc-uk/workflow-dispatch@v1