chore: add all
This commit is contained in:
38
pkg/types/tx_signal.go
Normal file
38
pkg/types/tx_signal.go
Normal 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
|
||||
Reference in New Issue
Block a user