remove struct Erc20ContractInfo
parent
59e19458b4
commit
547376cfc9
|
@ -217,14 +217,6 @@ type Erc20Contract struct {
|
|||
Decimals int `json:"decimals"`
|
||||
}
|
||||
|
||||
type Erc20ContractInfo struct {
|
||||
Contract string `json:"contract"`
|
||||
Name string `json:"name"`
|
||||
Symbol string `json:"symbol"`
|
||||
Decimals int `json:"decimals"`
|
||||
Icon string `json:"icon"`
|
||||
}
|
||||
|
||||
// Erc20Transfer contains a single ERC20 token transfer
|
||||
type Erc20Transfer struct {
|
||||
Contract string
|
||||
|
|
|
@ -1007,15 +1007,14 @@ func (s *PublicServer) apiTokenList(r *http.Request, apiVersion int) (interface{
|
|||
return nil, api.NewAPIError("fail to fetch token list", true)
|
||||
}
|
||||
|
||||
erc20Infos := make([]*bchain.Erc20ContractInfo, 0)
|
||||
erc20Infos := make([]*bchain.Erc20Contract, 0)
|
||||
for _, t := range tokens {
|
||||
if len(t.Contract) > 0 {
|
||||
info := &bchain.Erc20ContractInfo{
|
||||
info := &bchain.Erc20Contract{
|
||||
Contract: t.Contract,
|
||||
Name: t.Name,
|
||||
Symbol: t.Symbol,
|
||||
Decimals: t.Decimals,
|
||||
Icon: "",
|
||||
}
|
||||
|
||||
erc20Infos = append(erc20Infos, info)
|
||||
|
@ -1049,12 +1048,11 @@ func (s *PublicServer) apiTokenInfo(r *http.Request, apiVersion int) (interface{
|
|||
return nil, api.NewAPIError("fail to fetch token info", true)
|
||||
}
|
||||
|
||||
erc20Info := &bchain.Erc20ContractInfo{
|
||||
erc20Info := &bchain.Erc20Contract{
|
||||
Contract: info.Contract,
|
||||
Name: info.Name,
|
||||
Symbol: info.Symbol,
|
||||
Decimals: info.Decimals,
|
||||
Icon: "",
|
||||
}
|
||||
|
||||
return erc20Info, nil
|
||||
|
|
Loading…
Reference in New Issue