Update project structure and build process

This commit is contained in:
Juan Pablo Civile
2025-05-13 11:10:08 -03:00
parent 124e9fa1bc
commit d9f3e925a4
277 changed files with 15321 additions and 930 deletions

View File

@@ -0,0 +1,35 @@
package newop
import "github.com/muun/libwallet/operation"
// FeeWindow holds a map of target block to fee rate for a given time
type FeeWindow struct {
FastConfTarget int64
MediumConfTarget int64
SlowConfTarget int64
TargetedFees map[uint]float64
}
func (w *FeeWindow) PutTargetedFees(target int64, feeRateInSatsPerVByte float64) {
if w.TargetedFees == nil {
w.TargetedFees = make(map[uint]float64)
}
w.TargetedFees[uint(target)] = feeRateInSatsPerVByte
}
func (w *FeeWindow) GetTargetedFees(target int64) float64 {
if w.TargetedFees == nil {
return 0
}
return w.TargetedFees[uint(target)]
}
func (w *FeeWindow) nextHighestBlock(feeRate float64) int64 {
return int64(w.toInternalType().NextHighestBlock(feeRate))
}
func (w *FeeWindow) toInternalType() *operation.FeeWindow {
return &operation.FeeWindow{
TargetedFees: w.TargetedFees,
}
}