chore: add all

This commit is contained in:
2025-12-26 10:57:37 +08:00
commit b484273cba
30 changed files with 5822 additions and 0 deletions

38
pkg/types/tx_signal.go Normal file
View File

@@ -0,0 +1,38 @@
package types
import (
"time"
"github.com/samlior/libsam/pkg/consts"
"github.com/shopspring/decimal"
)
type TxSignal struct {
Source string
TxHash string
Maker string
Token0Address string
Token1Address string
Token0Amount decimal.Decimal
Token1Amount decimal.Decimal
Block uint64
BlockAt time.Time
BlockIndex uint64
Event string
Program string
IsProcessed bool
IsToken2022 bool
IsMayhemMode bool
TxFee decimal.Decimal
Token0AmountUint64 uint64
Token1AmountUint64 uint64
}
func (t *TxSignal) Parse() *TxSignal {
t.Token0AmountUint64 = t.Token0Amount.Mul(decimal.New(1, consts.TokenDecimals)).BigInt().Uint64()
t.Token1AmountUint64 = t.Token1Amount.Mul(decimal.New(1, consts.SolDecimals)).BigInt().Uint64()
return t
}
type TxSignalBatch = []*TxSignal