Documentation
¶
Index ¶
- Constants
- func CalculatePaddedFeeLimit(feeLimit int32, bumpTimes uint32, multiplier float64) int32
- func ParseLatestEnergyPrice(energyPricesStr string) (int32, error)
- type AccountStore
- type TronTx
- type TronTxm
- func (t *TronTxm) Close() error
- func (t *TronTxm) Enqueue(request TronTxmRequest) error
- func (t *TronTxm) GetClient() sdk.FullNodeClient
- func (t *TronTxm) HealthReport() map[string]error
- func (t *TronTxm) InflightCount() (int, int)
- func (t *TronTxm) Name() string
- func (t *TronTxm) Ready() error
- func (t *TronTxm) SignAndBroadcast(ctx context.Context, fromAddress address.Address, coreTx *common.Transaction) (*fullnode.BroadcastResponse, error)
- func (t *TronTxm) Start(ctx context.Context) error
- func (t *TronTxm) TriggerSmartContract(ctx context.Context, tx *TronTx) (*fullnode.TriggerSmartContractResponse, error)
- type TronTxmConfig
- type TronTxmRequest
- type TxStore
- type UnconfirmedTx
Constants ¶
View Source
const ( MAX_RETRY_ATTEMPTS = 5 MAX_BROADCAST_RETRY_DURATION = 30 * time.Second BROADCAST_DELAY_DURATION = 2 * time.Second DEFAULT_ENERGY_MULTIPLIER = 1.5 )
View Source
const DEFAULT_ENERGY_UNIT_PRICE int32 = 210 // as of 2025-02-10
Variables ¶
This section is empty.
Functions ¶
func CalculatePaddedFeeLimit ¶
func ParseLatestEnergyPrice ¶
Types ¶
type AccountStore ¶
type AccountStore struct {
// contains filtered or unexported fields
}
func NewAccountStore ¶
func NewAccountStore() *AccountStore
func (*AccountStore) GetAllUnconfirmed ¶
func (c *AccountStore) GetAllUnconfirmed() map[string][]*UnconfirmedTx
func (*AccountStore) GetTotalInflightCount ¶
func (c *AccountStore) GetTotalInflightCount() int
func (*AccountStore) GetTxStore ¶
func (c *AccountStore) GetTxStore(fromAddress string) *TxStore
type TronTxm ¶
type TronTxm struct {
Logger logger.Logger
Keystore loop.Keystore
Config TronTxmConfig
EstimateEnergyEnabled bool // TODO: Move this to a NodeState/Config struct when we move to MultiNode
Client sdk.FullNodeClient
BroadcastChan chan *TronTx
AccountStore *AccountStore
Starter utils.StartStopOnce
Done sync.WaitGroup
Stop chan struct{}
}
func New ¶
func New(lgr logger.Logger, keystore loop.Keystore, client sdk.FullNodeClient, config TronTxmConfig) *TronTxm
func (*TronTxm) Enqueue ¶
func (t *TronTxm) Enqueue(request TronTxmRequest) error
Enqueues a transaction for broadcasting. Each item in the params array should be a map with a single key-value pair, where the key is the ABI type.
func (*TronTxm) GetClient ¶
func (t *TronTxm) GetClient() sdk.FullNodeClient
func (*TronTxm) HealthReport ¶
func (*TronTxm) InflightCount ¶
func (*TronTxm) SignAndBroadcast ¶
func (t *TronTxm) SignAndBroadcast(ctx context.Context, fromAddress address.Address, coreTx *common.Transaction) (*fullnode.BroadcastResponse, error)
func (*TronTxm) TriggerSmartContract ¶
type TronTxmConfig ¶
type TronTxmRequest ¶
type TxStore ¶
type TxStore struct {
// contains filtered or unexported fields
}
TxStore tracks broadcast & unconfirmed txs per account address per chain id
func NewTxStore ¶
func NewTxStore() *TxStore
func (*TxStore) AddUnconfirmed ¶
func (*TxStore) GetUnconfirmed ¶
func (s *TxStore) GetUnconfirmed() []*UnconfirmedTx
func (*TxStore) InflightCount ¶
type UnconfirmedTx ¶
Click to show internal directories.
Click to hide internal directories.