-
Notifications
You must be signed in to change notification settings - Fork 47
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
4b85e4a
commit 3cdc051
Showing
2 changed files
with
32 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Transaction fees | ||
|
||
Starknet transactions are priced using a single `max_fee` value, which indicates the maximum amount of fees (in `Wei`) that an account is willing to pay. | ||
|
||
For commands that send out transactions, Starkli needs to come up with this value. By default, a fee estimate is requested from the [provider](./providers.md), and a 50% buffer is added on top of the estimate to avoid failures due to price fluctuations. | ||
|
||
## Setting `max_fee` manually | ||
|
||
It's possible to skip the entire fee estimation process by manually providing a `max_fee` value. | ||
|
||
The recommended way to do it is through the `--max-fee` option, which accepts a decimal value in Ether (18 decimals). For example, to perform an `ETH` transfer with a `max_fee` of `0.01 ETH`: | ||
|
||
```console | ||
starkli invoke eth transfer 0x1234 u256:100 --max-fee 0.01 | ||
``` | ||
|
||
If you already have the `max_fee` value in `Wei`, it's also possible to use the raw value directly via the `--max-fee-raw` option. An equivalent command to the example above would be: | ||
|
||
```console | ||
starkli invoke eth transfer 0x1234 u256:100 --max-fee-raw 10000000000000000 | ||
``` | ||
|
||
## Estimating fee only (dry run) | ||
|
||
Commands that send out transactions accept a `--estimate-only` flag, which stops command execution as soon as an estimate is generated. | ||
|
||
An example command to estimate the fee for an `ETH` transfer: | ||
|
||
```console | ||
starkli invoke eth transfer 0x1234 u256:100 --estimate-only | ||
``` |