diff --git a/server/tokenlogoinfo/Client.go b/server/tokenlogoinfo/Client.go index 2cb969c8..7e0367d5 100644 --- a/server/tokenlogoinfo/Client.go +++ b/server/tokenlogoinfo/Client.go @@ -17,6 +17,8 @@ import ( const ( endpointGetLogoInfos = "/priapi/v1/oc/web-common/coin/getLogoInfoBatch" + ChainNativeTokenAddr = "0x0000000000000000000000000000000000000000" + EmptyStr = "" ) type Client struct { @@ -117,5 +119,8 @@ func (c *Client) GetTokenLogoInfos(tokenAddArr []*tokenlogo.QueryLogoParam) (map } func GetTokenLogoMapKey(tokenAddr string, chainId uint32) string { + if tokenAddr == ChainNativeTokenAddr { + tokenAddr = EmptyStr + } return fmt.Sprintf("%s_%d", strings.ToLower(tokenAddr), chainId) } diff --git a/server/tokenlogoinfo/logohelper.go b/server/tokenlogoinfo/logohelper.go index 582e965e..a2131145 100644 --- a/server/tokenlogoinfo/logohelper.go +++ b/server/tokenlogoinfo/logohelper.go @@ -57,9 +57,13 @@ func buildQueryLogoParams(noCacheTokenMap map[uint32][]string) []*tokenlogo.Quer var logoParams []*tokenlogo.QueryLogoParam for k, v := range noCacheTokenMap { for _, addr := range v { + finalAddr := addr + if addr == ChainNativeTokenAddr { + finalAddr = EmptyStr + } logoParams = append(logoParams, &tokenlogo.QueryLogoParam{ ChainId: k, - TokenContractAddress: addr, + TokenContractAddress: finalAddr, }) } }