Skip to content

Commit b2276e9

Browse files
committed
chore: move gas and timeout details to Engine FAQ (#4914)
<!-- start pr-codex --> ## PR-Codex overview This PR focuses on updating the documentation for transaction settings in the `Engine` feature. It clarifies the structure and usage of `txOverrides` for sending native currency and overriding gas settings, including examples and warnings about transaction timeouts. ### Detailed summary - Changed keys in `txOverrides` from unquoted to quoted strings in the JSON structure. - Added a section on sending native currency with examples. - Introduced a section on overriding gas settings with examples. - Included a warning about setting a timeout for transactions. - Added a section on specifying transaction timeouts with examples. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent b31ab5a commit b2276e9

File tree

2 files changed

+66
-22
lines changed

2 files changed

+66
-22
lines changed

apps/portal/src/app/engine/faq/page.mdx

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { Callout } from "@doc";
2+
13
# FAQ
24

35
## About Engine
@@ -45,6 +47,66 @@ Here are three ways to determine when the job is mined:
4547
};
4648
```
4749

50+
### How do I send native currency with my transaction?
51+
52+
To send native tokens (e.g. ETH on Ethereum), set `txOverrides.value`.
53+
This may be required when calling a `payable` contract method.
54+
55+
Here's an example of sending 0.2 ETH:
56+
57+
```json
58+
{
59+
// ...other arguments in the write transaction
60+
61+
"txOverrides": {
62+
"value": "200000000000000000"
63+
}
64+
}
65+
```
66+
67+
### How do I override gas settings?
68+
69+
To override the gas settings, set relevant `txOverrides` gas fields.
70+
Each field is optional and will be estimated by Engine if omitted.
71+
72+
Here's an example of setting a gas limit of 210,000 gas units, 1 gwei max fee, and 1 gwei max priority fee:
73+
74+
```json
75+
{
76+
// ...other arguments in the write transaction
77+
78+
"txOverrides": {
79+
"gas": "210000",
80+
"maxFeePerGas": "1000000000",
81+
"maxPriorityFeePerGas": "1000000000"
82+
}
83+
}
84+
```
85+
86+
<Callout variant='warning' title="It is highly recommended to set a timeout when setting a maxFeePerGas.">
87+
88+
Otherwise if gas prices don't fall, transactions may be in your queue indefinitely.
89+
90+
</Callout>
91+
92+
### How do I set a timeout on transactions?
93+
94+
To specify a transaction timeout, set `txOverrides.timeoutSeconds`.
95+
Engine flags transactions as `errored` if they are not sent before the timeout. An `errored` webhook will be sent.
96+
97+
Note: A transaction sent before the timeout may be mined after the timeout.
98+
99+
Here's an example of a 2-hour timeout:
100+
```json
101+
{
102+
// ...other arguments in the write transaction
103+
104+
"txOverrides": {
105+
"timeoutSeconds": 7200
106+
}
107+
}
108+
```
109+
48110
### How do I customize my RPC?
49111

50112
Use [Update Chain Configuration](https://redocly.github.io/redoc/?url=https://demo.web3api.thirdweb.com/json#tag/Configuration/operation/updateChainsConfiguration) to override a chain's settings.

apps/portal/src/app/engine/features/contracts/page.mdx

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,32 +75,14 @@ To send native tokens to a payable method (e.g. ETH on Ethereum), set `txOverrid
7575

7676
```json
7777
{
78-
functionName: "...",
79-
args: [ ... ],
80-
txOverrides: {
81-
value: 1000000000000000, // 0.001 ETH in wei
78+
"functionName": "...",
79+
"args": [ ... ],
80+
"txOverrides": {
81+
"value": "1000000000000000", // 0.001 ETH in wei
8282
}
8383
}
8484
```
8585

86-
### Override gas settings
87-
88-
To override the gas settings for your transaction, set `txOverrides` in the request body to any write transaction. Each of these fields are optional and will be estimated by Engine if omitted.
89-
90-
```json
91-
{
92-
functionName: "...",
93-
args: [ ... ],
94-
txOverrides: {
95-
// The limit of gas units to use for this transaction.
96-
gas: "530000",
97-
// The max fee (e.g. gas price) to use in wei.
98-
maxFeePerGas: "1000000000",
99-
// The max priority fee to use in wei.
100-
maxPriorityFeePerGas: "1000000000",
101-
}
102-
```
103-
10486
## Read from a contract
10587

10688
```ts

0 commit comments

Comments
 (0)