-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e882b7d
commit 47eeca0
Showing
9 changed files
with
38 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/building-with-alloy/transactions/sending-a-legacy-transaction.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## Sending a legacy transaction | ||
|
||
<!-- {{#include ../../examples/transactions/.md}} --> | ||
{{#include ../../examples/transactions/send_legacy_tx.md}} |
4 changes: 3 additions & 1 deletion
4
src/building-with-alloy/transactions/sending-an-EIP-1559-transaction.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
## Sending an EIP-1559 transaction | ||
## Sending an EIP-1559 transaction | ||
|
||
{{#include ../../examples/transactions/send_eip1559_tx.md}} |
4 changes: 3 additions & 1 deletion
4
src/building-with-alloy/transactions/sending-an-EIP-4844-transaction.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
## Sending an EIP-4844 transaction | ||
## Sending an EIP-4844 transaction | ||
|
||
{{#include ../../examples/transactions/send_eip4844_tx.md}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
## Using access lists | ||
## Using access lists | ||
|
||
{{#include ../../examples/transactions/with_access_list.md}} |
26 changes: 25 additions & 1 deletion
26
src/building-with-alloy/transactions/using-the-transaction-builder.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
## Using the `TransactionBuilder` | ||
## Using the `TransactionBuilder` | ||
|
||
The [`TransactionBuilder`](https://alloy-rs.github.io/alloy/alloy_network/transaction/builder/trait.TransactionBuilder.html) is a network specific transaction builder configurable with `.with_*` methods. | ||
|
||
Common fields one can configure are: | ||
|
||
- [with_from](https://alloy-rs.github.io/alloy/alloy_network/transaction/builder/trait.TransactionBuilder.html#method.with_from) | ||
- [with_to](https://alloy-rs.github.io/alloy/alloy_network/transaction/builder/trait.TransactionBuilder.html#method.with_to) | ||
- [with_nonce](https://alloy-rs.github.io/alloy/alloy_network/transaction/builder/trait.TransactionBuilder.html#method.with_nonce) | ||
- [with_chain_id](https://alloy-rs.github.io/alloy/alloy_network/transaction/builder/trait.TransactionBuilder.html#method.with_chain_id) | ||
- [with_value](https://alloy-rs.github.io/alloy/alloy_network/transaction/builder/trait.TransactionBuilder.html#method.with_value) | ||
- [with_gas_limit](https://alloy-rs.github.io/alloy/alloy_network/transaction/builder/trait.TransactionBuilder.html#method.with_gas_limit) | ||
- [with_max_priority_fee_per_gas](https://alloy-rs.github.io/alloy/alloy_network/transaction/builder/trait.TransactionBuilder.html#method.with_max_priority_fee_per_gas) | ||
- [with_max_fee_per_gas](https://alloy-rs.github.io/alloy/alloy_network/transaction/builder/trait.TransactionBuilder.html#method.with_max_fee_per_gas) | ||
|
||
It is generally recommended to use the builder pattern, as shown, rather than directly setting values (`with_to` versus `set_to`). | ||
|
||
```rust,ignore | ||
//! Example showing how to build a transaction using the `TransactionBuilder` | ||
{{#include ../../../lib/examples/examples/transactions/examples/send_eip1559_tx.rs:2:}} | ||
``` | ||
|
||
It is recommended to use the `.with_recommended_fillers()` method on the [ProviderBuilder](../connecting-to-a-blockchain/setting-up-a-provider.md) to automatically [fill fields](../understanding-fillers.md) for you. | ||
|
||
{{#include ../../examples/fillers/recommended_fillers.md}} |