fix: Pass additional data when community token is received (#4954)

This commit is contained in:
Cuteivist 2024-03-25 18:30:59 +01:00 committed by GitHub
parent 0d9b6138d6
commit 2aa306ef4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 18 deletions

View File

@ -63,12 +63,7 @@ type Token struct {
} }
type ReceivedToken struct { type ReceivedToken struct {
Address common.Address `json:"address"` Token
Name string `json:"name"`
Symbol string `json:"symbol"`
Image string `json:"image,omitempty"`
ChainID uint64 `json:"chainId"`
CommunityData *community.Data `json:"community_data,omitempty"`
Amount float64 `json:"amount"` Amount float64 `json:"amount"`
TxHash common.Hash `json:"txHash"` TxHash common.Hash `json:"txHash"`
IsFirst bool `json:"isFirst"` IsFirst bool `json:"isFirst"`
@ -829,14 +824,10 @@ func (tm *Manager) SignalCommunityTokenReceived(address common.Address, txHash c
} }
floatAmount, _ := new(big.Float).Quo(new(big.Float).SetInt(value), new(big.Float).SetInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(t.Decimals)), nil))).Float64() floatAmount, _ := new(big.Float).Quo(new(big.Float).SetInt(value), new(big.Float).SetInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(t.Decimals)), nil))).Float64()
t.Image = tm.mediaServer.MakeCommunityTokenImagesURL(t.CommunityData.ID, t.ChainID, t.Symbol)
receivedToken := ReceivedToken{ receivedToken := ReceivedToken{
Address: t.Address, Token: *t,
Name: t.Name,
Symbol: t.Symbol,
Image: t.Image,
ChainID: t.ChainID,
CommunityData: t.CommunityData,
Amount: floatAmount, Amount: floatAmount,
TxHash: txHash, TxHash: txHash,
IsFirst: isFirst, IsFirst: isFirst,