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

rc: salamander #1495

Merged
merged 83 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
cd99e17
Adding RCs list
arboleya Dec 8, 2023
2b9495a
Ignoring RC labels
arboleya Dec 8, 2023
4dfd727
Configuring RC label
arboleya Dec 8, 2023
75ed18d
Re-configuring RC label
arboleya Dec 8, 2023
820b5e2
Adjusting PRs accepted labels
arboleya Dec 8, 2023
8b2c663
Merge branch 'master' into rc/salamander
arboleya Dec 10, 2023
8ebd388
chore: updating code owners (#1496)
arboleya Dec 12, 2023
4b3c8ea
Merge branch 'master' into rc/salamander
arboleya Dec 12, 2023
e12a62d
Merge branch 'master' into rc/salamander
arboleya Dec 13, 2023
c7b9b92
Merge branch 'master' into rc/salamander
arboleya Dec 13, 2023
cdc3e84
Merge branch 'master' into rc/salamander
arboleya Dec 13, 2023
8bea836
docs: purge hardcoded snippets on 'using typegen' page (#1403)
Dhaiwat10 Dec 14, 2023
5d5c939
chore: remove method that's same as base method (#1445)
nedsalk Dec 14, 2023
cd7aed5
Merge branch 'master' into rc/salamander
arboleya Dec 14, 2023
5261579
chore: implement RC workflow (#1497)
danielbate Dec 15, 2023
6a1c2f1
chore: fix rc release string replace (#1529)
danielbate Dec 15, 2023
b52c137
Merge branch 'master' into rc/salamander
arboleya Dec 15, 2023
e236fc8
Merge branch 'master' into rc/salamander
arboleya Dec 15, 2023
55e8301
docs: Update some hyperlinks to reference the new documentation hub (…
petertonysmith94 Dec 18, 2023
c5e56b4
Merge branch 'master' into rc/salamander
arboleya Dec 19, 2023
53ab0d6
chore: improve rc release message (#1559)
danielbate Dec 19, 2023
8021b38
feat: GraphQL subscriptions (#1374)
nedsalk Dec 20, 2023
58ef6e7
chore: pin `graphql-request` to `v5` (#1567)
danielbate Dec 20, 2023
e52a1cc
Merge branch 'master' into rc/salamander
arboleya Dec 20, 2023
5ebe5eb
chore: upgrade `tsx` (#1574)
danielbate Dec 20, 2023
5f12a6b
feat: migrate from Jest to Vitest (#1310)
danielbate Dec 21, 2023
92add1d
chore: fix temp test workflow (#1579)
danielbate Dec 21, 2023
76fee0e
Merge branch 'master' into rc/salamander
arboleya Dec 21, 2023
098c349
Fixing tsconfig.json
arboleya Dec 21, 2023
d759de2
chore: update required node engine in `create-fuels` (#1582)
danielbate Dec 21, 2023
576a46e
chore: add node version test matrix (#1575)
danielbate Dec 21, 2023
d3335de
chore: fix broken rc message (#1580)
danielbate Dec 22, 2023
c988199
chore: update nodejs to v20 (#1544)
nedsalk Dec 22, 2023
8d84846
feat: accepting addresses as `string` (#1583)
Torres-ssf Dec 22, 2023
773194c
chore: properly format the PR coverage report comment (#1586)
danielbate Dec 22, 2023
7949bb8
fix: flaky test (#1590)
Torres-ssf Dec 22, 2023
00e5850
docs: update `deposit-and-withdraw` page (#1591)
Torres-ssf Dec 23, 2023
563914e
feat: retry mechanism (#1474)
nedsalk Jan 3, 2024
87b7ce1
Merge branch 'master' into rc/salamander
arboleya Jan 3, 2024
7e46db9
Merge branch 'master' into rc/salamander
arboleya Jan 4, 2024
f698256
feat: replaced `semver` dependency with custom implementation (#1594)
nedsalk Jan 5, 2024
6c82640
feat: replace `elliptic` with `@noble/curves` (#1601)
nedsalk Jan 5, 2024
168a0e8
Merge branch 'master' into rc/salamander
arboleya Jan 5, 2024
ad7ee46
chore: fix CI failing due to missing tag in test (#1614)
nedsalk Jan 5, 2024
78e5e40
feat: improve ABI Coders `decode` validation (#1426)
danielbate Jan 5, 2024
ad5923d
Merge branch 'master' into rc/salamander
arboleya Jan 9, 2024
6796ef2
fix: do not generate a coverage diff without coverage artifact (#1629)
danielbate Jan 11, 2024
0668d88
Merge branch 'master' into rc/salamander
arboleya Jan 11, 2024
d31ee60
chore: pinpoint vitest to 1.0.4 (#1637)
arboleya Jan 12, 2024
db1df6b
chore: remove `ethers` dependency from `utils` (#1640)
danielbate Jan 12, 2024
14aebe7
fix: `getOperation` for `Transfer Asset` (#1619)
Torres-ssf Jan 15, 2024
b32dc96
fix: remove external font dependencies (#1642)
petertonysmith94 Jan 15, 2024
aac1b71
fix: generate RC PR comment on `pull_request` event only (#1648)
danielbate Jan 16, 2024
d41a26d
Merge branch 'master' into rc/salamander
arboleya Jan 16, 2024
de3cb15
fix: fix failing `rc` comment (#1657)
danielbate Jan 16, 2024
5236bfb
chore: add missing test group (#1658)
danielbate Jan 16, 2024
ed0a49f
Merge branch 'master' into rc/salamander
arboleya Jan 16, 2024
2682148
feat: implement browser compatibility testing (#1630)
danielbate Jan 17, 2024
1b0bb20
chore: fix string replace in `rc` ci (#1659)
danielbate Jan 17, 2024
403ee6a
chore: adding extra reporters (#1661)
arboleya Jan 17, 2024
587d445
chore: manually trigger `rc` CI (#1660)
danielbate Jan 17, 2024
45c32d0
Enabling PR auto-release
arboleya Jan 17, 2024
311fe7f
Fixing RC name resolution
arboleya Jan 17, 2024
1284d07
feat: use `submitAndAwait` graphql endpoint (#1615)
nedsalk Jan 18, 2024
26a370d
fix: flaky retry test (#1654)
nedsalk Jan 18, 2024
606e6e6
feat: create a wallet without a provider (#1566)
petertonysmith94 Jan 18, 2024
206c2fe
chore!: Share single chainConfig and review node-related utilities (#…
Dhaiwat10 Jan 18, 2024
901ae9b
Merge branch 'master' into rc/salamander
arboleya Jan 18, 2024
1d27e03
Merge branch 'master' into rc/salamander
arboleya Jan 23, 2024
82b336a
Lintfix
arboleya Jan 23, 2024
3b3458f
Lintfix
arboleya Jan 23, 2024
287b195
Lintfix
arboleya Jan 23, 2024
987eea4
chore: use new temporary coverage artifact (#1676)
danielbate Jan 23, 2024
ad17420
Merge branch 'master' into rc/salamander
arboleya Jan 24, 2024
d5298b6
Merge branch 'master' into rc/salamander
arboleya Jan 24, 2024
5f67bc1
Lintfix
arboleya Jan 24, 2024
dba7f8e
Lintfix
arboleya Jan 24, 2024
d81526e
Merge branch 'master' into rc/salamander
arboleya Jan 24, 2024
fbccf3f
fix: internalizing `findBinPath` utility (#1679)
arboleya Jan 24, 2024
5c8da10
Adjusting residual mistake after last merge from `master`
arboleya Jan 24, 2024
e126580
Merge branch 'master' into rc/salamander
arboleya Jan 26, 2024
fb505f9
Adding test group
arboleya Jan 26, 2024
2d6976e
Trigger CI
arboleya Jan 26, 2024
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
Prev Previous commit
Next Next commit
Merge branch 'master' into rc/salamander
  • Loading branch information
arboleya committed Jan 23, 2024
commit 1d27e03494388a5042202fd7ca86eaaf8dcc0673
6 changes: 6 additions & 0 deletions .changeset/beige-actors-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@fuel-ts/forc": patch
"@fuel-ts/fuel-core": patch
---

Fixing installation from git branches
6 changes: 6 additions & 0 deletions .changeset/kind-toes-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@fuel-ts/forc": patch
"@fuel-ts/versions": patch
---

Upgrading forc to 0.49.1
2 changes: 2 additions & 0 deletions .changeset/silent-schools-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// #region custom-transactions-1
script;

use std::token::force_transfer_to_contract;
use std::asset::force_transfer_to_contract;

fn main(
contract_address: b256,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// #region contract-balance-2
contract;

use std::token::transfer_to_address;
use std::asset::transfer_to_address;

abi TransferToAddress {
#[payable]
Expand Down
7 changes: 6 additions & 1 deletion apps/docs/spell-check-custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,9 @@ cryptographically
Config
config
configs
WSL
WSL
WalletUnlocked
WalletLocked
AbstractAddress
ContractFactory
ScriptTransactionRequest
2 changes: 1 addition & 1 deletion apps/docs/src/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ A Provider is a Class that provides an abstraction for a connection to a Fuel no

## Wallet and signer

A `Wallet` is a Class with direct or indirect access to a private key. You can use a `Wallet` to sign messages and transactions to authorize the network to charge your account to perform operations. The terms wallet and signer in the SDK are often used interchangeably, but, technically, a `Signer` enables the signing of transactions and messages; the `Wallet` implements the `Signer` functionality.
A [`Wallet`](./api/Wallet/Wallet.md) is a Class with direct or indirect access to a private key. You can use a [`Wallet`](./api/Wallet/Wallet.md) to sign messages and transactions to authorize the network to charge your account to perform operations. The terms wallet and signer in the SDK are often used interchangeably, but, technically, a `Signer` enables the signing of transactions and messages; the [`Wallet`](./api/Wallet/Wallet.md) implements the `Signer` functionality.
10 changes: 5 additions & 5 deletions apps/docs/src/guide/addresses/conversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This guide demonstrates how to convert between address formats and Sway Standard

## From `Bech32` to `b256`

By instantiating an `Address`, we can validate a `Bech32` address and easily convert it to a `b256`:
By instantiating an [`Address`](../../api/Address/Address.md), we can validate a `Bech32` address and easily convert it to a `b256`:

<<< @/../../docs-snippets/src/guide/types/conversion.test.ts#conversion-5{ts:line-numbers}

Expand All @@ -14,7 +14,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` and utilities available for `b256` validation and conversion:
In a similar fashion, we have both class functions on the [`Address`](../../api/Address/Address.md) and utilities available for `b256` validation and conversion:

<<< @/../../docs-snippets/src/guide/types/conversion.test.ts#conversion-7{ts:line-numbers}

Expand All @@ -24,18 +24,18 @@ And by using the `isB256` and `toBech32` utilities:

## Converting a Contract ID

The Contract `id` property has the [`AbstractAddress`](../types/address#abstractaddress-class) type. Therefore, it can be converted using the `Address` class functions such as `toAddress` and `toB256`:
The Contract `id` property has the [`AbstractAddress`](../types/address#abstractaddress-class) type. Therefore, it can be converted using the [`Address`](../../api/Address/Address.md) class functions such as `toAddress` and `toB256`:

<<< @/../../docs-snippets/src/guide/types/conversion.test.ts#conversion-2{ts:line-numbers}

## Converting a Wallet Address

Similarly, the Wallet `address` property is also of type [`AbstractAddress`](../types/address#abstractaddress-class) and can therefore use the same `Address` class functions for conversion:
Similarly, the Wallet `address` property is also of type [`AbstractAddress`](../types/address#abstractaddress-class) and can therefore use the same [`Address`](../../api/Address/Address.md) class functions for conversion:

<<< @/../../docs-snippets/src/guide/types/conversion.test.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` 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`](../../api/Address/Address.md) from a `b256` type:

<<< @/../../docs-snippets/src/guide/types/conversion.test.ts#conversion-4{ts:line-numbers}
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` or a `Provider` to the contract on instantiation.
This guide demonstrates how to make contract calls using different wallets and providers by passing either an [`Account`](../../api/Wallet/Account.md) or a [`Provider`](../../api/Providers/Provider.md) to the contract on instantiation.

## Changing Wallets

Expand Down
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` 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](../../api/Program/Contract.md) class, which allows you to check a contract's available balance.

## The `getBalance` Method

The `Contract` class includes a method called `getBalance` that retrieves the available balance of a specific asset for a contract. This method is particularly useful for determining the remaining balance after sending assets to a contract and executing contract calls.
The [`Contract`](../../api/Program/Contract.md) class includes a method called `getBalance` that retrieves the available balance of a specific asset for a contract. This method is particularly useful for determining the remaining balance after sending assets to a contract and executing contract calls.

<<< @/../../../packages/program/src/contract.ts#contract-balance-1{ts:line-numbers}

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 `getTransactionCost` function provided by the `provider` 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 `getTransactionCost` function provided by the [Provider](../../api/Providers/Provider.md) 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/providers/src/provider.ts#cost-estimation-1{ts:line-numbers}

Expand Down
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 @@ -27,7 +27,7 @@ Load the contract bytecode and JSON ABI, generated from the Sway source, into th

## 4. Deploying the Contract

Initialize a `ContractFactory` with the bytecode, ABI, and wallet. Deploy the contract and use its methods.
Initialize a [`ContractFactory`](../../api/Contract/ContractFactory.md) with the bytecode, ABI, and wallet. Deploy the contract and use its methods.

<<< @/../../docs-snippets/src/guide/contracts/deploying-contracts.test.ts#contract-setup-3{ts:line-numbers}

Expand Down
8 changes: 4 additions & 4 deletions apps/docs/src/guide/contracts/managing-deployed-contracts.md
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` class is of type `AbstractAddress`, an abstract class that is exclusively extended by the `Address` class.
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 `Address` class wraps all methods from the `AbstractAddress` class and adds a single property: `bech32Address`. This property is a string encoded in [`Bech32`](../types/bech32.md) format, recognizable by the human-readable prefix `fuel` followed by the separator `1`.
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`.

When you log the `contractId` property of an instantiated Contract using `console.log`, the output appears as follows:

Expand All @@ -22,10 +22,10 @@ If you have already an instantiated and deployed contract in hands you can creat

<<< @/../../docs-snippets/src/guide/contracts/managing-deployed-contracts.test.ts#managing-deployed-contracts-1{ts:line-numbers}

The previous example assumes that you have a `Contract` instance at hand. However, some Fuel tools and Sway use the [`b256`](../types/bits256.md) type format, a hex-encoded string-like type, for contract IDs.
The previous example assumes that you have a [`Contract`](../../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.

You might have this format instead, for example, if you have deployed your contract with `forc deploy`.

The process of instantiating a `Contract` remains the same when using a contract ID of type `b256`:
The process of instantiating a [`Contract`](../../api/Program/Contract.md) remains the same when using a contract ID of type `b256`:

<<< @/../../docs-snippets/src/guide/contracts/managing-deployed-contracts.test.ts#managing-deployed-contracts-2{ts:line-numbers}
4 changes: 2 additions & 2 deletions apps/docs/src/guide/cookbook/custom-transactions.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# 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`. 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`](../../api/Providers/ScriptTransactionRequest.md). 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-snippets/test/fixtures/forc-projects/script-transfer-to-contract/src/main.sw#custom-transactions-1{ts:line-numbers}

This script can be executed by creating a `ScriptTransactionRequest`, appending the resource and contract inputs/outputs and then sending the transaction, as follows:
This script can be executed by creating a [`ScriptTransactionRequest`](../../api/Providers/ScriptTransactionRequest.md), appending the resource and contract inputs/outputs and then sending the transaction, as follows:

<<< @/../../docs-snippets/src/guide/scripts/script-custom-transaction.test.ts#custom-transactions-2{ts:line-numbers}
2 changes: 1 addition & 1 deletion apps/docs/src/guide/predicates/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ After compiling, you will obtain the binary of the predicate and its JSON ABI (A

<<< @/../../docs-snippets/src/guide/predicates/index.test.ts#predicate-index-2{ts:line-numbers}

The created `Predicate` instance, among other things, has three important properties: the predicate `bytes` (byte code), the `chainId`, and the predicate `address`.
The created [`Predicate`](../../api/Predicate/Predicate.md) 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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ With the predicate instantiated, we can transfer funds to its address. This requ

Now that our predicate holds funds, we can use it to validate a transaction.

First, we need to set its data. Note that the `main` function in our predicate example requires a parameter called `input_address` of type `b256`. We achieve this using the `Predicate` class method `setData`.
First, we need to set its data. Note that the `main` function in our predicate example requires a parameter called `input_address` of type `b256`. We achieve this using the [`Predicate`](../../api/Predicate/Predicate.md) class method `setData`.

<<< @/../../docs-snippets/src/guide/predicates/send-and-spend-funds-from-predicates.test.ts#send-and-spend-funds-from-predicates-4{ts:line-numbers}

Expand All @@ -40,7 +40,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`. 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`](../../api/Providers/ScriptTransactionRequest.md). Then, we can submit this transaction request by calling the `sendTransaction` method.

This can be useful if you need the transaction ID before actually submitting it to the node.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/providers/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Providers

An instance of the `Provider` class lets you connect to a Fuel node. It provides read-only access to the blockchain state. You can use this provider as-is or through a `Wallet` instance.
An instance of the [`Provider`](../../api/Providers/Provider.md) class lets you connect to a Fuel node. It provides read-only access to the blockchain state. You can use this provider as-is or through a [`Wallet`](../../api/Wallet/Wallet.md) instance.

<<< @/../../../packages/providers/test/provider.test.ts#provider-definition{ts:line-numbers}
22 changes: 11 additions & 11 deletions apps/docs/src/guide/types/address.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
# Address

In Sway, the `Address` type serves as a type-safe wrapper around the primitive `b256` type. The SDK takes a different approach and has its own abstraction for the `Address` type.
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.

## `AbstractAddress` Class
## [`AbstractAddress`](../../api/Interfaces/AbstractAddress.md) Class

The SDK defines the `AbstractAddress` class, which provides a set of utility functions for easy manipulation and conversion between address formats.
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.

<<< @/../../../packages/interfaces/src/index.ts#address-1{ts:line-numbers}

## Address Class

Besides conforming to the interface of the `AbstractAddress`, the `Address` also defines one property; `bech32Address`, which is of the [`Bech32`](./bech32.md) type.
Besides conforming to the interface of the [`AbstractAddress`](../../api/Interfaces/AbstractAddress.md), the [`Address`](../../api/Address/Address.md) 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` class, there are several ways to create an `Address` instance:
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:

### From a `Bech32` Address

To create an `Address` from a `Bech32` address, use the following code snippet:
To create an [`Address`](../../api/Address/Address.md) from a `Bech32` address, use the following code snippet:

<<< @/../../docs-snippets/src/guide/types/address.test.ts#address-2{ts:line-numbers}

### From a Public Key

To create an `Address` from a public key, use the following code snippet:
To create an [`Address`](../../api/Address/Address.md) from a public key, use the following code snippet:

<<< @/../../docs-snippets/src/guide/types/address.test.ts#address-3{ts:line-numbers}

### From a 256-bit Address

To create an `Address` from a 256-bit address, use the following code snippet:
To create an [`Address`](../../api/Address/Address.md) from a 256-bit address, use the following code snippet:

<<< @/../../docs-snippets/src/guide/types/address.test.ts#address-4{ts:line-numbers}

## Utility Functions

The `Address` class also provides some practical utility functions:
The [`Address`](../../api/Address/Address.md) class also provides some practical utility functions:

1. `fromString`: Create a new `Address` from an ambiguous source that may be a `Bech32` or `B256` address:
1. `fromString`: Create a new [`Address`](../../api/Address/Address.md) from an ambiguous source that may be a `Bech32` or `B256` address:

<<< @/../../docs-snippets/src/guide/types/address.test.ts#address-5{ts:line-numbers}

2. `fromDynamicInput`: Create a new `Address` when the address source is unknown:
2. `fromDynamicInput`: Create a new [`Address`](../../api/Address/Address.md) when the address source is unknown:

<<< @/../../docs-snippets/src/guide/types/address.test.ts#address-6{ts:line-numbers}

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/guide/types/bech32.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# `Bech32`

The SDK uses the `Bech32` type as the core property of the `Address` class, specifically through the `bech32Address` property.
The SDK uses the `Bech32` type as the core property of the [`Address`](../../api/Address/Address.md) 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` 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`](../../api/Address/Address.md) class is constructed around the `Bech32` type.

You can read more about the `Bech32` type [here](https://thebitcoinmanual.com/articles/btc-bech32-address/).

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/types/bits256.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` class, providing seamless integration with other components of your application. To create an `Address` instance from a b256 value, use the `Address.fromB256()` method:
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:

<<< @/../../docs-snippets/src/guide/types/bits256.test.ts#bits256-3{ts:line-numbers}
Loading
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.