Skip to content

Commit

Permalink
docs: fix api links (#3452)
Browse files Browse the repository at this point in the history
* docs: fixing API links

* chore: fixing relative links
  • Loading branch information
petertonysmith94 authored Dec 7, 2024
1 parent b9e93e1 commit 24edd5d
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion apps/docs/src/guide/contracts/contract-balance.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ When working with contracts, it's crucial to be aware of the available contract

## The `getBalance` Method

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.
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`](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:
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](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.
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`](https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_contract.index.ContractFactory.html#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.

<<< @./snippets/deploying-contracts/deployment.ts#blobs{ts:line-numbers}

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/contracts/minted-token-asset-id.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ Since the asset ID depends on the contract ID, which is always dynamic (unlike t

## Create Asset Id

The SDK provides a helper named `createAssetId` which takes the contract ID and sub ID as parameters. This helper internally calls `getMintedAssetId` and returns the Sway native parameter [AssetId](https://docs.fuel.network/docs/fuels-ts/interfaces/#assetid), ready to be used in a Sway program invocation:
The SDK provides a helper named `createAssetId` which takes the contract ID and sub ID as parameters. This helper internally calls `getMintedAssetId` and returns the Sway native parameter [AssetId](https://fuels-ts-docs-api.vercel.app/types/_fuel_ts_interfaces.AssetId.html), ready to be used in a Sway program invocation:

<<< @./snippets/utilities/create-asset-id.ts#create-asset-id-1{ts:line-numbers}
2 changes: 1 addition & 1 deletion apps/docs/src/guide/predicates/methods.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Interacting With Predicates

The `Predicate` class extends the [`Account`](https://docs.fuel.network/docs/fuels-ts/account/) class, inheriting all its methods. Therefore, there are multiple ways to interact with predicates, but broadly speaking, we can think about three:
The `Predicate` class extends the [`Account`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html) class, inheriting all its methods. Therefore, there are multiple ways to interact with predicates, but broadly speaking, we can think about three:

- `Checking Balances`
- `Transactions`
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/provider/provider-options.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Provider Options

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.
You can provide various [options](https://fuels-ts-docs-api.vercel.app/types/_fuel_ts_account.ProviderOptions.html) on `Provider` instantiation to modify its behavior.

### `retryOptions`

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/testing/launching-a-test-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -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](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_contract.test_utils.html#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/functions/_fuel_ts_contract.test_utils.launchTestNode.html).

## Explicit Resource Management

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/guide/utilities/using-assets.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Assets

We export an array of [`Asset`](https://docs.fuel.network/docs/fuels-ts/account/#asset) objects, that can be useful when creating your dApp. The `Asset` object has useful metadata about the different assets that are available on blockchain networks (Fuel and Ethereum).
We export an array of [`Asset`](https://fuels-ts-docs-api.vercel.app/types/_fuel_ts_account.Asset.html) objects, that can be useful when creating your dApp. The `Asset` object has useful metadata about the different assets that are available on blockchain networks (Fuel and Ethereum).

Included assets such as:

Expand All @@ -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`](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).
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/types/_fuel_ts_account.AssetFuel.html) and [`AssetEth`](https://fuels-ts-docs-api.vercel.app/types/_fuel_ts_account.AssetEth.html) respectively).

<<< @./snippets/using-assets.ts#using-assets-1{ts:line-numbers}
4 changes: 2 additions & 2 deletions apps/docs/src/guide/wallets/checking-balances.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Checking balances

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.
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.

<<< @./snippets/checking-balances.ts#checking-balances-1{ts:line-numbers}

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.
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/types/_fuel_ts_account.CoinQuantity.html). This is useful for getting a comprehensive view of your holdings.

<<< @./snippets/checking-balances-two.ts#checking-balances-2{ts:line-numbers}
26 changes: 13 additions & 13 deletions apps/docs/src/guide/wallets/connectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,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`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#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/types/_fuel_ts_account.Network.html) object containing the current network information.

<<< @./snippets/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`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#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/types/_fuel_ts_account.Network.html) object containing the current network information.

<<< @./snippets/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`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#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/types/_fuel_ts_account.Asset.html) objects available on the network.

<<< @./snippets/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`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#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/types/_fuel_ts_account.FuelABI.html) object.

<<< @./snippets/connectors.ts#fuel-connector-events-assets{ts:line-numbers}

Expand Down Expand Up @@ -197,7 +197,7 @@ The `signTransaction` method initiates the send transaction flow for the current
It requires two arguments:

- `address` (`string`)
- `transaction` ([`TransactionRequestLike`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#transactionrequestlike))
- `transaction` ([`TransactionRequestLike`](https://fuels-ts-docs-api.vercel.app/types/_fuel_ts_account.TransactionRequestLike.html))

It will return the transaction signature (as a `string`) if it is successfully signed.

Expand All @@ -207,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`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#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/types/_fuel_ts_account.Asset.html)) that are available on the network.

<<< @/../../../packages/account/src/connectors/fuel-connector.ts#fuel-connector-method-assets{ts:line-numbers}

Expand All @@ -217,7 +217,7 @@ The `addAsset` method adds asset metadata to the connector.

It requires a single argument:

- `asset` ([`Asset`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#asset))
- `asset` ([`Asset`](https://fuels-ts-docs-api.vercel.app/types/_fuel_ts_account.Asset.html))

It returns a promise that resolves to `true` if the asset is successfully added; otherwise, it resolves to `false`.

Expand All @@ -229,7 +229,7 @@ The `addAssets` method adds multiple asset metadata to the connector.

It requires a single argument:

- `assets` (an Array of [`Asset`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#asset)).
- `assets` (an Array of [`Asset`](https://fuels-ts-docs-api.vercel.app/types/_fuel_ts_account.Asset.html)).

Returns a promise that resolves to `true` if the assets are successfully added; otherwise, resolves to `false`.

Expand All @@ -253,15 +253,15 @@ 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`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#network)).
Returns a promise that resolves to an array of available networks (see [`Network`](https://fuels-ts-docs-api.vercel.app/types/_fuel_ts_account.Network.html)).

<<< @/../../../packages/account/src/connectors/fuel-connector.ts#fuel-connector-method-networks{ts:line-numbers}

#### `currentNetwork`

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`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#network)).
It will return a promise that will resolve to the current network (see [`Network`](https://fuels-ts-docs-api.vercel.app/types/_fuel_ts_account.Network.html)).

<<< @/../../../packages/account/src/connectors/fuel-connector.ts#fuel-connector-method-currentNetwork{ts:line-numbers}

Expand All @@ -271,7 +271,7 @@ The `selectNetwork` method requests the user to select a network for the current

It requires a single argument:

- `network` ([`Network`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#network))
- `network` ([`Network`](https://fuels-ts-docs-api.vercel.app/types/_fuel_ts_account.Network.html))

You call this method with either the `providerUrl` or `chainId` to select the network.

Expand All @@ -288,7 +288,7 @@ The `addABI` method adds ABI information about a contract to the connector. This
It requires two arguments:

- `contractId` (`string`)
- `abi` ([`FuelABI`](https://fuels-ts-docs-api.vercel.app/modules/_fuel_ts_account.html#fuelabi)).
- `abi` ([`FuelABI`](https://fuels-ts-docs-api.vercel.app/types/_fuel_ts_account.FuelABI.html)).

It will return a promise that will resolve to `true` if the ABI is successfully added; otherwise `false`.

Expand All @@ -302,7 +302,7 @@ It requires a single argument:

- `contractId` (`string`)

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.
Returns a promise that resolves to the ABI information (as a [`FuelABI`](https://fuels-ts-docs-api.vercel.app/types/_fuel_ts_account.FuelABI.html)) or `null` if the data is unavailable.

<<< @/../../../packages/account/src/connectors/fuel-connector.ts#fuel-connector-method-getABI{ts:line-numbers}

Expand Down

0 comments on commit 24edd5d

Please sign in to comment.