fix: Pass additional data when community token is received (#4954)
This commit is contained in:
parent
0d9b6138d6
commit
2aa306ef4c
|
@ -63,15 +63,10 @@ type Token struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReceivedToken struct {
|
type ReceivedToken struct {
|
||||||
Address common.Address `json:"address"`
|
Token
|
||||||
Name string `json:"name"`
|
Amount float64 `json:"amount"`
|
||||||
Symbol string `json:"symbol"`
|
TxHash common.Hash `json:"txHash"`
|
||||||
Image string `json:"image,omitempty"`
|
IsFirst bool `json:"isFirst"`
|
||||||
ChainID uint64 `json:"chainId"`
|
|
||||||
CommunityData *community.Data `json:"community_data,omitempty"`
|
|
||||||
Amount float64 `json:"amount"`
|
|
||||||
TxHash common.Hash `json:"txHash"`
|
|
||||||
IsFirst bool `json:"isFirst"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Token) IsNative() bool {
|
func (t *Token) IsNative() bool {
|
||||||
|
@ -829,17 +824,13 @@ 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,
|
Amount: floatAmount,
|
||||||
Symbol: t.Symbol,
|
TxHash: txHash,
|
||||||
Image: t.Image,
|
IsFirst: isFirst,
|
||||||
ChainID: t.ChainID,
|
|
||||||
CommunityData: t.CommunityData,
|
|
||||||
Amount: floatAmount,
|
|
||||||
TxHash: txHash,
|
|
||||||
IsFirst: isFirst,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
encodedMessage, err := json.Marshal(receivedToken)
|
encodedMessage, err := json.Marshal(receivedToken)
|
||||||
|
|
Loading…
Reference in New Issue