Skip to content

Commit db9b663

Browse files
committed
chore: move gas and timeout details to Engine FAQ
1 parent 7cd39f0 commit db9b663

File tree

2 files changed

+47
-18
lines changed

2 files changed

+47
-18
lines changed

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

Lines changed: 47 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,51 @@ Here are three ways to determine when the job is mined:
4547
};
4648
```
4749

50+
### How do I override gas settings?
51+
52+
To override the gas settings, set `txOverrides` in the request body for any write transaction.
53+
Each field is optional and will be estimated by Engine if omitted.
54+
55+
Here's an example request body for a transfer transaction:
56+
```json
57+
{
58+
// Arguments for a transfer transaction
59+
"to": "0xA954fC66de1F90cFB4f29F0ABa391412406820B7",
60+
"amount": "0.5",
61+
62+
// 👇 Specify these overrides based on your chain's gas settings
63+
txOverrides: {
64+
// The limit of gas units to use for this transaction.
65+
gas: "530000",
66+
// The max fee (e.g. gas price) to use in wei.
67+
maxFeePerGas: "1000000000",
68+
// The max priority fee to use in wei.
69+
maxPriorityFeePerGas: "1000000000",
70+
}
71+
```
72+
73+
<Callout variant='warning' title="It is highly recommended to set a timeout when setting a maxFeePerGas.">
74+
75+
Otherwise if gas prices don't fall, transactions may be in your queue indefinitely.
76+
77+
</Callout>
78+
79+
### How do I set a timeout on transactions?
80+
81+
To Set the `txOverrides`
82+
Engine will drop transactions if they are not sent before the timeout.
83+
Note: A transaction that is already sent may be mined after this timeout.
84+
85+
```json
86+
{
87+
// ...other arguments in the write transaction
88+
89+
// 👇 Specify this override. Here's an example of a 2 hour timeout.
90+
txOverrides: {
91+
timeoutSeconds: 7200,
92+
}
93+
```
94+
4895
### How do I customize my RPC?
4996

5097
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: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,6 @@ To send native tokens to a payable method (e.g. ETH on Ethereum), set `txOverrid
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)