-
Notifications
You must be signed in to change notification settings - Fork 126
/
gas.go
25 lines (22 loc) · 1.05 KB
/
gas.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Package gas defines the Gas API. All chains that support transactions (either
// account-based or utxo-based) should implement this API. This API is used to
// understand the current recommended gas costs required to get confirmations in
// a reasonable amount of time.
package gas
import (
"context"
"github.com/renproject/pack"
)
// The Estimator interface defines the functionality required to know the
// current recommended gas prices.
type Estimator interface {
// EstimateGasPrice that should be used to get confirmation within a
// reasonable amount of time. The precise definition of "reasonable amount
// of time" varies from chain to chain, and so is left open to
// interpretation by the implementation. For example, in Bitcoin, it would
// be the recommended SATs-per-byte required to get a transaction into the
// next block. In Ethereum, it would be the recommended GWEI-per-gas
// required to get a transaction into one of the next few blocks (because
// blocks happen a lot faster).
EstimateGasPrice(context.Context) (pack.U256, error)
}