EVM, ARB, ETH gas top up policies + tron config change
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"github.com/shopspring/decimal"
|
||||
"github.com/tech/sendico/gateway/chain/internal/service/gateway/commands/wallet"
|
||||
"github.com/tech/sendico/gateway/chain/internal/service/gateway/driver/evm"
|
||||
"github.com/tech/sendico/gateway/chain/internal/service/gateway/driver/tron"
|
||||
"github.com/tech/sendico/gateway/chain/internal/service/gateway/shared"
|
||||
"github.com/tech/sendico/gateway/chain/storage/model"
|
||||
@@ -171,6 +172,14 @@ func computeGasTopUp(ctx context.Context, deps Deps, walletRef string, estimated
|
||||
return topUp, decision.CapHit, &decision, nativeBalance, walletModel, nil
|
||||
}
|
||||
|
||||
if networkCfg.GasTopUpPolicy != nil {
|
||||
topUp, capHit, err := evm.ComputeGasTopUp(networkCfg, walletModel, estimatedFee, nativeBalance)
|
||||
if err != nil {
|
||||
return nil, false, nil, nil, nil, err
|
||||
}
|
||||
return topUp, capHit, nil, nativeBalance, walletModel, nil
|
||||
}
|
||||
|
||||
topUp, err := defaultGasTopUp(estimatedFee, nativeBalance)
|
||||
if err != nil {
|
||||
return nil, false, nil, nil, nil, err
|
||||
|
||||
Reference in New Issue
Block a user