Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove legacy API docs #3416

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/calm-buttons-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

chore: remove legacy API docs
6 changes: 1 addition & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
10 changes: 0 additions & 10 deletions apps/docs/.typedoc/api-readme.md

This file was deleted.

4 changes: 1 addition & 3 deletions apps/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down Expand Up @@ -551,8 +550,7 @@ export default defineConfig({
link: '/guide/errors/',
collapsed: false,
items: [],
},
apiLinks,
}
],
},
],
Expand Down
12 changes: 4 additions & 8 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@
"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": "",
"license": "ISC",
"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",
Expand All @@ -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"
Expand Down
211 changes: 0 additions & 211 deletions apps/docs/scripts/typedoc-postbuild.ts

This file was deleted.

4 changes: 2 additions & 2 deletions apps/docs/src/guide/contracts/contract-balance.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/contracts/cost-estimation.md
Original file line number Diff line number Diff line change
@@ -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}

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/contracts/dependency-estimation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion apps/docs/src/guide/contracts/deploying-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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}
2 changes: 1 addition & 1 deletion apps/docs/src/guide/contracts/using-different-wallets.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
Loading
Loading