Repository: trustwallet/blockatlas
Pull request #1373 (2021-01-18 08:37:55)

Bug fix elrond integration 
Ignore smart contract results with a negative value
These smart contract results are generated by the staking smart contract --> should be ignored

codecov[bot]: # [Codecov](https://codecov.io/gh/trustwallet/blockatlas/pull/1373?src=pr&el=h1) Report
> Merging [#1373](https://codecov.io/gh/trustwallet/blockatlas/pull/1373?src=pr&el=desc) (f4a5121) into [master](https://codecov.io/gh/trustwallet/blockatlas/commit/ce3600e70611faad0dcbb07820ce984d2a7a38c4?el=desc) (ce3600e) will **increase** coverage by `0%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/trustwallet/blockatlas/pull/1373/graphs/tree.svg?width=650&height=150&src=pr&token=jnrjoEQAqv)](https://codecov.io/gh/trustwallet/blockatlas/pull/1373?src=pr&el=tree)

```diff
@@          Coverage Diff           @@
##           master   #1373   +/-   ##
======================================
  Coverage      45%     45%           
======================================
  Files         142     142           
  Lines        4168    4171    +3     
======================================
+ Hits         1907    1912    +5     
+ Misses       2090    2089    -1     
+ Partials      171     170    -1     
```


| [Impacted Files](https://codecov.io/gh/trustwallet/blockatlas/pull/1373?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [platform/elrond/model.go](https://codecov.io/gh/trustwallet/blockatlas/pull/1373/diff?src=pr&el=tree#diff-cGxhdGZvcm0vZWxyb25kL21vZGVsLmdv) | `100% <100%> (ø)` | |
| [platform/elrond/transaction.go](https://codecov.io/gh/trustwallet/blockatlas/pull/1373/diff?src=pr&el=tree#diff-cGxhdGZvcm0vZWxyb25kL3RyYW5zYWN0aW9uLmdv) | `96% <100%> (+7%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/trustwallet/blockatlas/pull/1373?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/trustwallet/blockatlas/pull/1373?src=pr&el=footer). Last update [ce3600e...f4a5121](https://codecov.io/gh/trustwallet/blockatlas/pull/1373?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

hewigovens: can you do a rebase? too many merge from master commits

Patch:
diff --git a/Procfile b/Procfile
index ebaa812..c06f6e4 100644
--- a/Procfile
+++ b/Procfile
@@ -1,6 +1,7 @@
 release: bin/setup -c $HOME/config.yml
 web: bin/api -c $HOME/config.yml -p $PORT
-consumer-transactions: CONSUMER_SERVICE=transactions bin/consumer -c $HOME/config.yml
-consumer-subscriptions: CONSUMER_SERVICE=subscriptions bin/consumer -c $HOME/config.yml
-consumer-tokens: CONSUMER_SERVICE=tokens bin/consumer -c $HOME/config.yml
+consumer_transactions: CONSUMER_SERVICE=transactions bin/consumer -c $HOME/config.yml
+consumer_subscriptions: CONSUMER_SERVICE=subscriptions bin/consumer -c $HOME/config.yml
+consumer_subscriptions_tokens: CONSUMER_SERVICE=subscriptions_tokens bin/consumer -c $HOME/config.yml
+consumer_tokens: CONSUMER_SERVICE=tokens bin/consumer -c $HOME/config.yml
 parser: bin/parser -c $HOME/config.yml
diff --git a/api/endpoint/token.go b/api/endpoint/token.go
index 994a0c1..dfdb975 100644
--- a/api/endpoint/token.go
+++ b/api/endpoint/token.go
@@ -19,7 +19,7 @@ import (
 // @Tags Transactions
 // @Param coin path string true "the coin name" default(ethereum)
 // @Param address path string true "the query address" default(0x5574Cd97432cEd0D7Caf58ac3c4fEDB2061C98fB)
-// @Success 200 {object} types.CollectionPage
+// @Success 200 {object} []string
 // @Failure 500 {object} ErrorResponse
 // @Router /v2/{coin}/tokens/{address} [get]
 func GetTokensByAddress(c *gin.Context, tokenAPI blockatlas.TokensAPI) {
@@ -34,7 +34,7 @@ func GetTokensByAddress(c *gin.Context, tokenAPI blockatlas.TokensAPI) {
 		c.AbortWithStatusJSON(http.StatusInternalServerError, errorResponse(err))
 		return
 	}
-	c.JSON(http.StatusOK, blockatlas.DocsResponse{Docs: &result})
+	c.JSON(http.StatusOK, result)
 }
 
 func GetTokensByAddressV3(c *gin.Context, instance tokenindexer.Instance) {
diff --git a/cmd/consumer/main.go b/cmd/consumer/main.go
index cb26f90..bba2018 100644
--- a/cmd/consumer/main.go
+++ b/cmd/consumer/main.go
@@ -31,9 +31,10 @@ var (
 	cancel   context.CancelFunc
 	database *db.Instance
 
-	transactions  = "transactions"
-	tokens        = "tokens"
-	subscriptions = "subscriptions"
+	transactions        = "transactions"
+	tokens              = "tokens"
+	subscriptions       = "subscriptions"
+	subscriptionsTokens = "subscriptions_tokens"
 )
 
 func init() {
@@ -63,17 +64,22 @@ func main() {
 	platform.Init(config.Default.Platform)
 
 	options := mq.InitDefaultConsumerOptions(config.Default.Consumer.Workers)
+	// Special case options to avoid unknown deadlock on insert
+	subscriptionsOptions := mq.InitDefaultConsumerOptions(1)
 
 	switch config.Default.Consumer.Service {
 	case transactions:
 		setupTransactionsConsumer(options, ctx)
 	case subscriptions:
-		setupSubscriptionsConsumer(options, ctx)
+		setupSubscriptionsConsumer(subscriptionsOptions, ctx)
+	case subscriptionsTokens:
+		setupSubscriptionsTokensConsumer(options, ctx)
 	case tokens:
 		setupTokensConsumer(options, ctx)
 	default:
 		setupTransactionsConsumer(options, ctx)
-		setupSubscriptionsConsumer(options, ctx)
+		setupSubscriptionsConsumer(subscriptionsOptions, ctx)
+		setupSubscriptionsTokensConsumer(options, ctx)
 		setupTokensConsumer(options, ctx)
 	}
 
@@ -85,16 +91,34 @@ func main() {
 }
 
 func setupTransactionsConsumer(options mq.ConsumerOptions, ctx context.Context) {
-	go internal.RawTransactions.RunConsumer(internal.ConsumerDatabase{Database: database, Delivery: notifier.RunNotifier}, options, ctx)
+	go internal.RawTransactions.RunConsumer(internal.ConsumerDatabase{
+		Database: database,
+		Delivery: notifier.RunNotifier,
+		Tag:      transactions,
+	}, options, ctx)
 }
 
 func setupSubscriptionsConsumer(options mq.ConsumerOptions, ctx context.Context) {
-	// Special case options to avoid unknown deadlock on insert
-	subscriptionsOptions := mq.InitDefaultConsumerOptions(1)
-	go internal.Subscriptions.RunConsumer(internal.ConsumerDatabase{Database: database, Delivery: subscriber.RunSubscriber}, subscriptionsOptions, ctx)
-	go internal.SubscriptionsTokens.RunConsumer(tokenindexer.ConsumerIndexer{Database: database, TokensAPIs: platform.TokensAPIs, Delivery: tokenindexer.RunTokenIndexerSubscribe}, options, ctx)
+	go internal.Subscriptions.RunConsumer(internal.ConsumerDatabase{
+		Database: database,
+		Delivery: subscriber.RunSubscriber,
+		Tag:      subscriptions,
+	}, options, ctx)
+}
+
+func setupSubscriptionsTokensConsumer(options mq.ConsumerOptions, ctx context.Context) {
+	go internal.SubscriptionsTokens.RunConsumer(tokenindexer.ConsumerIndexer{
+		Database:   database,
+		TokensAPIs: platform.TokensAPIs,
+		Delivery:   tokenindexer.RunTokenIndexerSubscribe,
+		Tag:        subscriptionsTokens,
+	}, options, ctx)
 }
 
 func setupTokensConsumer(options mq.ConsumerOptions, ctx context.Context) {
-	go internal.RawTokens.RunConsumer(internal.ConsumerDatabase{Database: database, Delivery: tokenindexer.RunTokenIndexer}, options, ctx)
+	go internal.RawTokens.RunConsumer(internal.ConsumerDatabase{
+		Database: database,
+		Delivery: tokenindexer.RunTokenIndexer,
+		Tag:      tokens,
+	}, options, ctx)
 }
diff --git a/config.yml b/config.yml
index 3001b68..72640d5 100644
--- a/config.yml
+++ b/config.yml
@@ -99,7 +99,7 @@ icon:
 # [TRX] Tron: https://tron.network/
 tron:
   api: https://api.trongrid.io
-  explorer: https://apilist.tronscan.org
+  grid: https://api.trongrid.io # trongrid api
 
 # [VET] VeChain: https://www.vechain.org
 vechain:
diff --git a/config/configuration.go b/config/configuration.go
index eb9fe30..3015365 100755
--- a/config/configuration.go
+++ b/config/configuration.go
@@ -99,6 +99,7 @@ type Configuration struct {
 	} `mapstructure:"icon"`
 	Tron struct {
 		API      string `mapstructure:"api"`
+		Grid     string `mapstructure:"grid"`
 		Explorer string `mapstructure:"explorer"`
 	} `mapstructure:"tron"`
 	Vechain struct {
diff --git a/db/subscription.go b/db/subscription.go
index 53cc191..4dbb720 100644
--- a/db/subscription.go
+++ b/db/subscription.go
@@ -2,11 +2,11 @@ package db
 
 import (
 	"github.com/trustwallet/blockatlas/db/models"
-	"github.com/trustwallet/blockatlas/pkg/blockatlas"
+	"github.com/trustwallet/golibs/types"
 	"gorm.io/gorm/clause"
 )
 
-func (i *Instance) CreateSubscriptions(addresses []blockatlas.Subscription) error {
+func (i *Instance) CreateSubscriptions(addresses []types.Subscription) error {
 	if len(addresses) == 0 {
 		return nil
 	}
diff --git a/go.mod b/go.mod
index 80ef65d..fe6c6b9 100644
--- a/go.mod
+++ b/go.mod
@@ -24,7 +24,7 @@ require (
 	github.com/stretchr/testify v1.7.0
 	github.com/swaggo/gin-swagger v1.3.0
 	github.com/swaggo/swag v1.7.0
-	github.com/trustwallet/golibs v0.0.32
+	github.com/trustwallet/golibs v0.0.33
 	github.com/trustwallet/golibs/network v0.0.0-20210113212158-b74318d7ab45
 	golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392
 	golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect
diff --git a/go.sum b/go.sum
index dbf3b64..b5904ba 100644
--- a/go.sum
+++ b/go.sum
@@ -418,8 +418,8 @@ github.com/swaggo/swag v1.5.1/go.mod h1:1Bl9F/ZBpVWh22nY0zmYyASPO1lI/zIwRDrpZU+t
 github.com/swaggo/swag v1.7.0 h1:5bCA/MTLQoIqDXXyHfOpMeDvL9j68OY/udlK4pQoo4E=
 github.com/swaggo/swag v1.7.0/go.mod h1:BdPIL73gvS9NBsdi7M1JOxLvlbfvNRaBP8m6WT6Aajo=
 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
-github.com/trustwallet/golibs v0.0.32 h1:3kBJ6bX2t2HdIEjbuKk/WsExgxHUZVH1JkNbPdofeVs=
-github.com/trustwallet/golibs v0.0.32/go.mod h1:MhWay9yOMBj3yEXTd1EepmxOwekbhVq4F1cIYAD2WRE=
+github.com/trustwallet/golibs v0.0.33 h1:nADMzgTh/MH+4UHK/TfsZ77VVmMUrFPVIIyMBhbDW0M=
+github.com/trustwallet/golibs v0.0.33/go.mod h1:VI0APImKAYxvJ8MnMD6aHSKvnArXUd3NgNEghX5P+K8=
 github.com/trustwallet/golibs/network v0.0.0-20210113212158-b74318d7ab45 h1:zaobIG3KO/CHpY1o/rGouYFHCWIzLE6uYSUwz2JCLmw=
 github.com/trustwallet/golibs/network v0.0.0-20210113212158-b74318d7ab45/go.mod h1:RMMyjp4qUcVhWidjE+XYzQgOtSXuhIKSB5pnLCA3WqY=
 github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
diff --git a/internal/mq.go b/internal/mq.go
index 3fa3a64..e41ff9b 100644
--- a/internal/mq.go
+++ b/internal/mq.go
@@ -22,8 +22,13 @@ const (
 type ConsumerDatabase struct {
 	Database *db.Instance
 	Delivery func(*db.Instance, amqp.Delivery) error
+	Tag      string
 }
 
 func (c ConsumerDatabase) Callback(msg amqp.Delivery) error {
 	return c.Delivery(c.Database, msg)
 }
+
+func (c ConsumerDatabase) ConsumerTag() string {
+	return c.Tag
+}
diff --git a/pkg/blockatlas/observer.go b/pkg/blockatlas/observer.go
deleted file mode 100644
index bb7aa0d..0000000
--- a/pkg/blockatlas/observer.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package blockatlas
-
-import "strconv"
-
-type (
-	Subscriptions map[string][]string
-
-	SubscriptionOperation string
-
-	SubscriptionEvent struct {
-		Subscriptions Subscriptions         `json:"subscriptions"`
-		Operation     SubscriptionOperation `json:"operation"`
-	}
-
-	Subscription struct {
-		Coin    uint   `json:"coin"`
-		Address string `json:"address"`
-	}
-)
-
-func (v *Subscription) AddressID() string {
-	return GetAddressID(strconv.Itoa(int(v.Coin)), v.Address)
-}
-
-func GetAddressID(coin, address string) string {
-	return coin + "_" + address
-}
-
-func (e *SubscriptionEvent) ParseSubscriptions(s Subscriptions) []Subscription {
-	subs := make([]Subscription, 0)
-	for coinStr, perCoin := range s {
-		coin, err := strconv.Atoi(coinStr)
-		if err != nil {
-			continue
-		}
-		for _, addr := range perCoin {
-			subs = append(subs, Subscription{
-				Coin:    uint(coin),
-				Address: addr,
-			})
-		}
-	}
-	return subs
-}
diff --git a/pkg/blockatlas/platform.go b/pkg/blockatlas/platform.go
index 09020c7..5e718b5 100644
--- a/pkg/blockatlas/platform.go
+++ b/pkg/blockatlas/platform.go
@@ -39,7 +39,7 @@ type (
 	// TokensAPI provides token lookups
 	TokensAPI interface {
 		Platform
-		GetTokenListByAddress(address string) (types.TokenPage, error)
+		GetTokenListByAddress(address string) ([]string, error)
 	}
 
 	// StakingAPI provides staking information
diff --git a/platform/binance/mocks/tokens.json b/platform/binance/mocks/tokens.json
index 8f8d1bc..c165618 100644
--- a/platform/binance/mocks/tokens.json
+++ b/platform/binance/mocks/tokens.json
@@ -1,26 +1,5 @@
 [
-  {
-    "name": "Travala.com Token",
-    "symbol": "AVA",
-    "decimals": 8,
-    "token_id": "AVA-645",
-    "coin": 714,
-    "type": "BEP2"
-  },
-  {
-    "name": "Binance Chain Native Token",
-    "symbol": "BNB",
-    "decimals": 8,
-    "token_id": "BNB",
-    "coin": 714,
-    "type": "BEP2"
-  },
-  {
-    "name": "Binance USD",
-    "symbol": "BUSD",
-    "decimals": 8,
-    "token_id": "BUSD-BD1",
-    "coin": 714,
-    "type": "BEP2"
-  }
+  "c714_tAVA-645",
+  "c714_tBNB",
+  "c714_tBUSD-BD1"
 ]
diff --git a/platform/binance/model.go b/platform/binance/model.go
index fb15289..dfa2c2b 100644
--- a/platform/binance/model.go
+++ b/platform/binance/model.go
@@ -215,16 +215,16 @@ func normalizeBaseOfTransaction(t Tx) types.Tx {
 	}
 }
 
-func normalizeTokens(srcBalance []TokenBalance, tokens Tokens) []types.Token {
-	tokensList := make([]types.Token, 0, len(srcBalance))
+func normalizeTokens(srcBalance []TokenBalance, tokens Tokens) []string {
+	assetIds := make([]string, 0)
 	for _, srcToken := range srcBalance {
 		token, ok := normalizeToken(srcToken, tokens)
 		if !ok {
 			continue
 		}
-		tokensList = append(tokensList, token)
+		assetIds = append(assetIds, token.AssetId())
 	}
-	return tokensList
+	return assetIds
 }
 
 func normalizeToken(srcToken TokenBalance, tokens Tokens) (types.Token, bool) {
diff --git a/platform/binance/token.go b/platform/binance/token.go
index 8448cb2..2989314 100644
--- a/platform/binance/token.go
+++ b/platform/binance/token.go
@@ -1,8 +1,6 @@
 package binance
 
-import "github.com/trustwallet/golibs/types"
-
-func (p *Platform) GetTokenListByAddress(address string) (types.TokenPage, error) {
+func (p *Platform) GetTokenListByAddress(address string) ([]string, error) {
 	account, err := p.client.FetchAccountMeta(address)
 	if err != nil || len(account.Balances) == 0 {
 		return nil, nil
diff --git a/platform/bitcoin/blockbook/token.go b/platform/bitcoin/blockbook/token.go
index 09d4ac4..429faa9 100644
--- a/platform/bitcoin/blockbook/token.go
+++ b/platform/bitcoin/blockbook/token.go
@@ -1,10 +1,10 @@
 package blockbook
 
 import (
-	"github.com/trustwallet/golibs/types"
+	"github.com/trustwallet/golibs/asset"
 )
 
-func (c *Client) GetTokenList(address string, coinIndex uint) (types.TokenPage, error) {
+func (c *Client) GetTokenList(address string, coinIndex uint) ([]string, error) {
 	tokens, err := c.GetTokens(address)
 	if err != nil {
 		return nil, err
@@ -12,25 +12,13 @@ func (c *Client) GetTokenList(address string, coinIndex uint) (types.TokenPage,
 	return NormalizeTokens(tokens, coinIndex), nil
 }
 
-func NormalizeTokens(srcTokens []Token, coinIndex uint) []types.Token {
-	tokenPage := make([]types.Token, 0, len(srcTokens))
+func NormalizeTokens(srcTokens []Token, coinIndex uint) []string {
+	tokenPage := make([]string, 0)
 	for _, srcToken := range srcTokens {
 		if srcToken.Balance == "0" || srcToken.Balance == "" {
 			continue
 		}
-		token := NormalizeToken(&srcToken, coinIndex)
-		tokenPage = append(tokenPage, token)
+		tokenPage = append(tokenPage, asset.BuildID(coinIndex, srcToken.Contract))
 	}
 	return tokenPage
 }
-
-func NormalizeToken(srcToken *Token, coinIndex uint) types.Token {
-	return types.Token{
-		Name:     srcToken.Name,
-		Symbol:   srcToken.Symbol,
-		TokenID:  srcToken.Contract,
-		Coin:     coinIndex,
-		Decimals: srcToken.Decimals,
-		Type:     types.GetEthereumTokenTypeByIndex(coinIndex),
-	}
-}
diff --git a/platform/elrond/mocks/scr_negative_value.json b/platform/elrond/mocks/scr_negative_value.json
new file mode 100644
index 0000000..a5cd936
--- /dev/null
+++ b/platform/elrond/mocks/scr_negative_value.json
@@ -0,0 +1,9 @@
+{
+  "hash": "a96ed4816f5312d00361cc16037e19e0cffa4765a79a808d54d89db58fd76aa6",
+  "value": "-2500000000000000000000",
+  "receiver": "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqplllst77y4l",
+  "sender": "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqplllst77y4l",
+  "gasPrice": 1000000000,
+  "signature": "",
+  "status": "success"
+}
diff --git a/platform/elrond/model.go b/platform/elrond/model.go
index 422cd49..705f8ea 100644
--- a/platform/elrond/model.go
+++ b/platform/elrond/model.go
@@ -3,6 +3,7 @@ package elrond
 import (
 	"encoding/json"
 	"math/big"
+	"strings"
 	"time"
 
 	"github.com/trustwallet/golibs/types"
@@ -93,6 +94,10 @@ func (tx *Transaction) Direction(address string) types.Direction {
 	}
 }
 
+func (tx *Transaction) HasNegativeValue() bool {
+	return strings.HasPrefix(tx.Value, "-")
+}
+
 func (tx *Transaction) TxTimestamp(blockRound uint64) time.Duration {
 	if int64(tx.Timestamp) != 0 {
 		return tx.Timestamp
diff --git a/platform/elrond/transaction.go b/platform/elrond/transaction.go
index cf130b8..ebfdedf 100644
--- a/platform/elrond/transaction.go
+++ b/platform/elrond/transaction.go
@@ -25,6 +25,10 @@ func NormalizeTxs(srcTxs []Transaction, address string, block Block) (txs []type
 
 // NormalizeTx converts an Elrond transaction into the generic model
 func NormalizeTx(srcTx Transaction, address string, block Block) (tx types.Tx, ok bool) {
+	if srcTx.HasNegativeValue() {
+		return types.Tx{}, false
+	}
+
 	tx = types.Tx{
 		ID:       srcTx.Hash,
 		Coin:     coin.Elrond().ID,
diff --git a/platform/ethereum/client.go b/platform/ethereum/client.go
index 6229271..219765a 100644
--- a/platform/ethereum/client.go
+++ b/platform/ethereum/client.go
@@ -5,12 +5,12 @@ import "github.com/trustwallet/golibs/types"
 type EthereumClient interface {
 	GetTransactions(address string, coinIndex uint) (types.TxPage, error)
 	GetTokenTxs(address, token string, coinIndex uint) (types.TxPage, error)
-	GetTokenList(address string, coinIndex uint) (types.TokenPage, error)
+	GetTokenList(address string, coinIndex uint) ([]string, error)
 	GetCurrentBlockNumber() (int64, error)
 	GetBlockByNumber(num int64, coinIndex uint) (*types.Block, error)
 }
 
-func (p *Platform) GetTokenListByAddress(address string) (types.TokenPage, error) {
+func (p *Platform) GetTokenListByAddress(address string) ([]string, error) {
 	return p.client.GetTokenList(address, p.CoinIndex)
 }
 
diff --git a/platform/ethereum/trustray/token.go b/platform/ethereum/trustray/token.go
index ef38466..78b07d5 100644
--- a/platform/ethereum/trustray/token.go
+++ b/platform/ethereum/trustray/token.go
@@ -4,7 +4,7 @@ import (
 	"github.com/trustwallet/golibs/types"
 )
 
-func (c *Client) GetTokenList(address string, coinIndex uint) (types.TokenPage, error) {
+func (c *Client) GetTokenList(address string, coinIndex uint) ([]string, error) {
 	account, err := c.GetTokens(address)
 	if err != nil {
 		return nil, err
@@ -27,11 +27,11 @@ func NormalizeToken(srcToken *Contract, coinIndex uint) types.Token {
 }
 
 // NormalizeTxs converts multiple Ethereum tokens
-func NormalizeTokens(srcTokens []Contract, coinIndex uint) []types.Token {
-	tokenPage := make([]types.Token, 0)
+func NormalizeTokens(srcTokens []Contract, coinIndex uint) []string {
+	assetIds := make([]string, 0)
 	for _, srcToken := range srcTokens {
 		token := NormalizeToken(&srcToken, coinIndex)
-		tokenPage = append(tokenPage, token)
+		assetIds = append(assetIds, token.AssetId())
 	}
-	return tokenPage
+	return assetIds
 }
diff --git a/platform/platform.go b/platform/platform.go
index 5721ca6..1f59a60 100644
--- a/platform/platform.go
+++ b/platform/platform.go
@@ -50,7 +50,7 @@ func getAllHandlers() blockatlas.Platforms {
 		coin.Fio().Handle:          fio.Init(config.Default.Fio.API),
 		coin.Aion().Handle:         aion.Init(config.Default.Aion.API),
 		coin.Icon().Handle:         icon.Init(config.Default.Icon.API),
-		coin.Tron().Handle:         tron.Init(config.Default.Tron.API, config.Default.Tron.Explorer),
+		coin.Tron().Handle:         tron.Init(config.Default.Tron.API, config.Default.Tron.Grid),
 		coin.Nano().Handle:         nano.Init(config.Default.Nano.API),
 		coin.Nimiq().Handle:        nimiq.Init(config.Default.Nimiq.API),
 		coin.Iotex().Handle:        iotex.Init(config.Default.Iotex.API),
diff --git a/platform/tezos/block.go b/platform/tezos/block.go
index c5983cc..eda5979 100644
--- a/platform/tezos/block.go
+++ b/platform/tezos/block.go
@@ -2,7 +2,7 @@ package tezos
 
 import (
 	"encoding/json"
-	"errors"
+	"fmt"
 
 	"github.com/trustwallet/golibs/coin"
 	"github.com/trustwallet/golibs/types"
@@ -19,20 +19,36 @@ func (p *Platform) GetBlockByNumber(num int64) (*types.Block, error) {
 	if err != nil {
 		return nil, err
 	}
-	return NormalizeRpcBlock(block)
+
+	return ProcessRpcBlock(block, &p.rpcClient)
 }
 
-func NormalizeRpcBlock(block RpcBlock) (*types.Block, error) {
+func ProcessRpcBlock(block RpcBlock, rpcClient IRpcClient) (*types.Block, error) {
 	txs := []types.Tx{}
 
 	for _, ops := range block.Operations {
 		for _, op := range ops {
 			for _, content := range op.Contents {
 				if tx, err := mapTransaction(content); err == nil {
-					if normalized, err := NormalizeRpcTransaction(tx, block.Header); err == nil {
-						normalized.ID = op.Hash
-						txs = append(txs, normalized)
+					if !(tx.Kind == TxTypeDelegation || tx.Kind == TxTypeTransaction) {
+						continue
+					}
+
+					balance := tx.Amount
+					if len(balance) == 0 {
+						account, err := rpcClient.GetAccountBalanceAtBlock(tx.Source, block.Header.Level)
+						if err != nil {
+							return nil, err
+						}
+						balance = account.Balance
 					}
+
+					normalized, err := NormalizeRpcTransaction(tx, block.Header, balance)
+					if err != nil {
+						return nil, err
+					}
+					normalized.ID = op.Hash
+					txs = append(txs, normalized)
 				}
 			}
 		}
@@ -41,40 +57,19 @@ func NormalizeRpcBlock(block RpcBlock) (*types.Block, error) {
 	return &types.Block{Number: block.Header.Level, Txs: txs}, nil
 }
 
-func NormalizeRpcTransaction(tx RpcTransaction, header RpcBlockHeader) (types.Tx, error) {
-	coin := coin.Tezos()
+func NormalizeRpcTransaction(tx RpcTransaction, header RpcBlockHeader, balance string) (types.Tx, error) {
 
-	var metadata interface{}
 	var to string
 	var txType types.TransactionType
 	switch tx.Kind {
 	case TxTypeTransaction:
 		to = tx.Destination
 		txType = types.TxTransfer
-		metadata = types.Transfer{
-			Value:    types.Amount(tx.Amount),
-			Symbol:   coin.Symbol,
-			Decimals: coin.Decimals,
-		}
 	case TxTypeDelegation:
-		var title types.KeyTitle
-		if len(tx.Delegate) == 0 {
-			title = types.AnyActionUndelegation
-		} else {
-			title = types.AnyActionDelegation
-			to = tx.Delegate
-		}
+		to = tx.Delegate
 		txType = types.TxAnyAction
-		metadata = types.AnyAction{
-			Coin:     coin.ID,
-			Title:    title,
-			Key:      types.KeyStakeDelegate,
-			Name:     coin.Name,
-			Symbol:   coin.Symbol,
-			Decimals: coin.Decimals,
-		}
 	default:
-		return types.Tx{}, errors.New("not supported operation kind: " + tx.Kind)
+		return types.Tx{}, fmt.Errorf("not supported operation kind: %s", tx.Kind)
 	}
 
 	date, err := timefmt.Parse(header.Timestamp, "%Y-%m-%dT%H:%M:%SZ")
@@ -82,15 +77,18 @@ func NormalizeRpcTransaction(tx RpcTransaction, header RpcBlockHeader) (types.Tx
 		return types.Tx{}, err
 	}
 
-	var status types.Status
-	if tx.Metadata.OperationResult.Status == TxStatusApplied {
-		status = types.StatusCompleted
-	} else {
+	metadata, err := mapMetadat(tx, balance)
+	if err != nil {
+		return types.Tx{}, err
+	}
+
+	status := types.StatusCompleted
+	if tx.Metadata.OperationResult.Status != TxStatusApplied {
 		status = types.StatusError
 	}
 
 	return types.Tx{
-		Coin:   coin.ID,
+		Coin:   coin.Tezos().ID,
 		From:   tx.Source,
 		To:     to,
 		Fee:    types.Amount(tx.Fee),
@@ -102,6 +100,38 @@ func NormalizeRpcTransaction(tx RpcTransaction, header RpcBlockHeader) (types.Tx
 	}, nil
 }
 
+func mapMetadat(tx RpcTransaction, balance string) (interface{}, error) {
+	coin := coin.Tezos()
+
+	switch tx.Kind {
+	case TxTypeTransaction:
+		return types.Transfer{
+			Value:    types.Amount(balance),
+			Symbol:   coin.Symbol,
+			Decimals: coin.Decimals,
+		}, nil
+	case TxTypeDelegation:
+		var title types.KeyTitle
+		if len(tx.Delegate) == 0 {
+			title = types.AnyActionUndelegation
+		} else {
+			title = types.AnyActionDelegation
+		}
+
+		return types.AnyAction{
+			Coin:     coin.ID,
+			Title:    title,
+			Key:      types.KeyStakeDelegate,
+			Name:     coin.Name,
+			Symbol:   coin.Symbol,
+			Decimals: coin.Decimals,
+			Value:    types.Amount(balance),
+		}, nil
+	default:
+		return nil, fmt.Errorf("not supported metadata for kind: %s", tx.Kind)
+	}
+}
+
 func mapTransaction(content interface{}) (RpcTransaction, error) {
 	bytes, err := json.Marshal(content)
 	if err != nil {
diff --git a/platform/tezos/model.go b/platform/tezos/model.go
index d90c0b7..6181eb3 100644
--- a/platform/tezos/model.go
+++ b/platform/tezos/model.go
@@ -20,6 +20,10 @@ type (
 		Delegate string `json:"delegate"`
 	}
 
+	AccountBalance struct {
+		Balance string `json:"balance"`
+	}
+
 	ExplorerAccount struct {
 		Transactions []Transaction `json:"ops"`
 	}
diff --git a/platform/tezos/rpc.go b/platform/tezos/rpc.go
index 089a9fb..b0f271f 100644
--- a/platform/tezos/rpc.go
+++ b/platform/tezos/rpc.go
@@ -2,11 +2,16 @@ package tezos
 
 import (
 	"fmt"
+	"strconv"
 	"time"
 
 	"github.com/trustwallet/golibs/client"
 )
 
+type IRpcClient interface {
+	GetAccountBalanceAtBlock(address string, block int64) (account AccountBalance, err error)
+}
+
 type RpcClient struct {
 	client.Request
 }
@@ -46,6 +51,18 @@ func (c *RpcClient) GetAccount(address string) (account Account, err error) {
 	return
 }
 
+func (c *RpcClient) GetAccountBalanceAtBlock(address string, block int64) (account AccountBalance, err error) {
+	var head string
+	if block == 0 {
+		head = "head"
+	} else {
+		head = strconv.FormatInt(block, 10)
+	}
+	path := fmt.Sprintf("chains/main/blocks/%s/context/contracts/%s", head, address)
+	err = c.Get(&account, path, nil)
+	return
+}
+
 func (c *RpcClient) fetchValidatorActivityInfo(id string) (ActivityValidatorInfo, error) {
 	var info ActivityValidatorInfo
 	path := fmt.Sprintf("/chains/main/blocks/head/context/delegates/%s", id)
diff --git a/platform/tezos/rpc_mock.go b/platform/tezos/rpc_mock.go
new file mode 100644
index 0000000..9847ca8
--- /dev/null
+++ b/platform/tezos/rpc_mock.go
@@ -0,0 +1,9 @@
+package tezos
+
+type RpcClientMock struct {
+	Balance string
+}
+
+func (r *RpcClientMock) GetAccountBalanceAtBlock(address string, block int64) (account AccountBalance, err error) {
+	return AccountBalance{Balance: r.Balance}, nil
+}
diff --git a/platform/tron/base.go b/platform/tron/base.go
index fa514ca..e6cb9b5 100644
--- a/platform/tron/base.go
+++ b/platform/tron/base.go
@@ -6,14 +6,14 @@ import (
 )
 
 type Platform struct {
-	client         Client
-	explorerClient ExplorerClient
+	client     Client
+	gridClient GridClient
 }
 
-func Init(api, explorerApi string) *Platform {
+func Init(api, gridApi string) *Platform {
 	return &Platform{
-		client:         Client{internal.InitClient(api)},
-		explorerClient: ExplorerClient{internal.InitClient(explorerApi)},
+		client:     Client{internal.InitClient(api)},
+		gridClient: GridClient{internal.InitClient(api)},
 	}
 }
 
diff --git a/platform/tron/block.go b/platform/tron/block.go
index 80995e2..3c6d289 100644
--- a/platform/tron/block.go
+++ b/platform/tron/block.go
@@ -57,7 +57,7 @@ func (p *Platform) NormalizeBlockChannel(srcTx Tx, txChan chan types.Tx) {
 	if len(transfer.AssetName) > 0 {
 		assetName, err := hex.DecodeString(transfer.AssetName[:])
 		if err == nil {
-			info, err := p.client.fetchTokenInfo(string(assetName))
+			info, err := p.gridClient.fetchTokenInfo(string(assetName))
 			if err == nil && len(info.Data) > 0 {
 				addTokenMeta(tx, srcTx, info.Data[0])
 			}
diff --git a/platform/tron/client.go b/platform/tron/client.go
index 89f6264..8667613 100644
--- a/platform/tron/client.go
+++ b/platform/tron/client.go
@@ -9,11 +9,10 @@ import (
 )
 
 type (
-	Client struct {
+	GridClient struct {
 		client.Request
 	}
-
-	ExplorerClient struct {
+	Client struct {
 		client.Request
 	}
 )
@@ -33,7 +32,7 @@ func (c *Client) fetchBlockByNumber(num int64) (Block, error) {
 	return blocks.Blocks[0], nil
 }
 
-func (c *Client) fetchTxsOfAddress(address, token string) ([]Tx, error) {
+func (c *GridClient) fetchTxsOfAddress(address, token string) ([]Tx, error) {
 	path := fmt.Sprintf("v1/accounts/%s/transactions", url.PathEscape(address))
 
 	var txs Page
@@ -46,9 +45,9 @@ func (c *Client) fetchTxsOfAddress(address, token string) ([]Tx, error) {
 	return txs.Txs, err
 }
 
-func (c *Client) fetchAccount(address string) (accounts *Account, err error) {
+func (c *GridClient) fetchAccount(address string) (accounts *Account, err error) {
 	path := fmt.Sprintf("v1/accounts/%s", address)
-	err = c.GetWithCache(&accounts, path, nil, time.Minute*1)
+	err = c.GetWithCache(&accounts, path, nil, time.Second*1)
 	return
 }
 
@@ -57,7 +56,7 @@ func (c *Client) fetchAccountVotes(address string) (account *AccountData, err er
 	return
 }
 
-func (c *Client) fetchTokenInfo(id string) (asset Asset, err error) {
+func (c *GridClient) fetchTokenInfo(id string) (asset Asset, err error) {
 	path := fmt.Sprintf("v1/assets/%s", id)
 	err = c.GetWithCache(&asset, path, nil, time.Hour*24)
 	return
@@ -81,16 +80,3 @@ func (c *Client) fetchTRC20Transactions(address string) (TRC20Transactions, erro
 	}
 	return result, nil
 }
-
-func (c *ExplorerClient) fetchAllTRC20Tokens(address string) ([]ExplorerTrc20Tokens, error) {
-	var result ExplorerResponse
-	path := "api/account"
-	err := c.GetWithCache(&result, path, url.Values{"address": {address}}, time.Minute*5)
-	if err != nil {
-		return nil, err
-	}
-	if result.ExplorerTrc20Tokens != nil {
-		return result.ExplorerTrc20Tokens, nil
-	}
-	return nil, nil
-}
diff --git a/platform/tron/mocks/tokens/tokens_response.json b/platform/tron/mocks/tokens/tokens_response.json
index 41de9ab..36caf40 100644
--- a/platform/tron/mocks/tokens/tokens_response.json
+++ b/platform/tron/mocks/tokens/tokens_response.json
@@ -1,98 +1,13 @@
 [
-  {
-    "name": "FomoThreeD",
-    "symbol": "FOM",
-    "decimals": 0,
-    "token_id": "1000542",
-    "coin": 195,
-    "type": "TRC10"
-  },
-  {
-    "name": "OtonamiS",
-    "symbol": "OS",
-    "decimals": 0,
-    "token_id": "1000567",
-    "coin": 195,
-    "type": "TRC10"
-  },
-  {
-    "name": "JUST GOV",
-    "symbol": "JST",
-    "decimals": 18,
-    "token_id": "TCFLL5dx5ZJdKnWuesXxi1VPwjLVmWZZy9",
-    "coin": 195,
-    "type": "TRC20"
-  },
-  {
-    "name": "Enme Token",
-    "symbol": "EME",
-    "decimals": 6,
-    "token_id": "TCRhVHPv6efvXgogNMhiunAMXFKcMmv2pF",
-    "coin": 195,
-    "type": "TRC20"
-  },
-  {
-    "name": "BeeHive",
-    "symbol": "BEE",
-    "decimals": 8,
-    "token_id": "TG7Z1ptC7nRkaniDVRhHSyLycaroaS5PdK",
-    "coin": 195,
-    "type": "TRC20"
-  },
-  {
-    "name": "Mono Token",
-    "symbol": "MONO",
-    "decimals": 18,
-    "token_id": "TLKyLt4MXuvvdFvUUc3Zma4rZyj2t87Mak",
-    "coin": 195,
-    "type": "TRC20"
-  },
-  {
-    "name": "WINK",
-    "symbol": "WIN",
-    "decimals": 6,
-    "token_id": "TLa2f6VPqDgRE67v1736s7bJ8Ray5wYjU7",
-    "coin": 195,
-    "type": "TRC20"
-  },
-  {
-    "name": "PYRO Network",
-    "symbol": "PYRO",
-    "decimals": 6,
-    "token_id": "TMCMPzmosnQ8UAYW1zcBwjLTxDq8ce4Y5e",
-    "coin": 195,
-    "type": "TRC20"
-  },
-  {
-    "name": "NoleCoin",
-    "symbol": "NOLE",
-    "decimals": 6,
-    "token_id": "TPt8DTDBZYfJ9fuyRjdWJr4PP68tRfptLG",
-    "coin": 195,
-    "type": "TRC20"
-  },
-  {
-    "name": "Tether USD",
-    "symbol": "USDT",
-    "decimals": 6,
-    "token_id": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
-    "coin": 195,
-    "type": "TRC20"
-  },
-  {
-    "name": "Wuhan Fried Bats",
-    "symbol": "WUHAN",
-    "decimals": 4,
-    "token_id": "TSzjFRf8bQ46kRndWaHYKSq1P5HzRJfPvr",
-    "coin": 195,
-    "type": "TRC20"
-  },
-  {
-    "name": "HelGro",
-    "symbol": "HGRO",
-    "decimals": 6,
-    "token_id": "TTvVC9jv5AfDdHuGeCMcQg6QftmNnfQiVm",
-    "coin": 195,
-    "type": "TRC20"
-  }
+  "c195_t1000567",
+  "c195_tTCFLL5dx5ZJdKnWuesXxi1VPwjLVmWZZy9",
+  "c195_tTCRhVHPv6efvXgogNMhiunAMXFKcMmv2pF",
+  "c195_tTG7Z1ptC7nRkaniDVRhHSyLycaroaS5PdK",
+  "c195_tTJSF4iVkzkRkYwEVNkqJkeGDaZpnFbGy9x",
+  "c195_tTLKyLt4MXuvvdFvUUc3Zma4rZyj2t87Mak",
+  "c195_tTLa2f6VPqDgRE67v1736s7bJ8Ray5wYjU7",
+  "c195_tTMCMPzmosnQ8UAYW1zcBwjLTxDq8ce4Y5e",
+  "c195_tTPt8DTDBZYfJ9fuyRjdWJr4PP68tRfptLG",
+  "c195_tTR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
+  "c195_tTTvVC9jv5AfDdHuGeCMcQg6QftmNnfQiVm"
 ]
diff --git a/platform/tron/stake.go b/platform/tron/stake.go
index 54e276d..35dff0d 100644
--- a/platform/tron/stake.go
+++ b/platform/tron/stake.go
@@ -70,7 +70,7 @@ func (p *Platform) GetDelegations(address string) (blockatlas.DelegationsPage, e
 }
 
 func (p *Platform) UndelegatedBalance(address string) (string, error) {
-	account, err := p.client.fetchAccount(address)
+	account, err := p.gridClient.fetchAccount(address)
 	if err != nil {
 		return "0", err
 	}
diff --git a/platform/tron/token.go b/platform/tron/token.go
index 8d6bd60..9c19291 100644
--- a/platform/tron/token.go
+++ b/platform/tron/token.go
@@ -1,86 +1,32 @@
 package tron
 
 import (
-	"strconv"
-	"strings"
-	"sync"
-
-	log "github.com/sirupsen/logrus"
-	"github.com/trustwallet/golibs/coin"
-	"github.com/trustwallet/golibs/types"
+	"github.com/trustwallet/golibs/asset"
 )
 
-func (p *Platform) GetTokenListByAddress(address string) (types.TokenPage, error) {
-	tokens, err := p.client.fetchAccount(address)
+func (p *Platform) GetTokenListByAddress(address string) ([]string, error) {
+	assetIds := make([]string, 0)
+	tokens, err := p.gridClient.fetchAccount(address)
 	if err != nil {
-		return nil, err
+		return assetIds, err
 	}
-	tokenPage := make(types.TokenPage, 0)
 	if len(tokens.Data) == 0 {
-		return tokenPage, nil
+		return assetIds, nil
 	}
+	data := tokens.Data[0]
 
 	var tokenIds []string
-	for _, v := range tokens.Data[0].AssetsV2 {
-		tokenIds = append(tokenIds, v.Key)
-	}
-
-	tokensChan := p.getTokens(tokenIds)
-	for info := range tokensChan {
-		tokenPage = append(tokenPage, info)
+	for _, v := range data.AssetsV2 {
+		tokenIds = append(assetIds, v.Key)
 	}
-
-	trc20Tokens, err := p.explorerClient.fetchAllTRC20Tokens(address)
-	if err != nil {
-		log.Error("Explorer error" + err.Error())
+	for _, trc20Tokens := range data.Trc20 {
+		for key := range trc20Tokens {
+			tokenIds = append(tokenIds, key)
+		}
 	}
-
-	for _, t := range trc20Tokens {
-		tokenPage = append(tokenPage, types.Token{
-			Name:     t.Name,
-			Symbol:   strings.ToUpper(t.Symbol),
-			Decimals: uint(t.Decimals),
-			TokenID:  t.ContractAddress,
-			Coin:     coin.Tron().ID,
-			Type:     types.TRC20,
-		})
+	for _, tokenId := range tokenIds {
+		assetIds = append(assetIds, asset.BuildID(p.Coin().ID, tokenId))
 	}
 
-	return tokenPage, nil
-}
-
-func (p *Platform) getTokens(ids []string) chan types.Token {
-	tkChan := make(chan types.Token, len(ids))
-	var wg sync.WaitGroup
-	for _, id := range ids {
-		wg.Add(1)
-		go func(i string, c chan types.Token) {
-			defer wg.Done()
-			_ = p.getTokensChannel(i, c)
-		}(id, tkChan)
-	}
-	wg.Wait()
-	close(tkChan)
-	return tkChan
-}
-
-func (p *Platform) getTokensChannel(id string, tkChan chan types.Token) error {
-	info, err := p.client.fetchTokenInfo(id)
-	if err != nil || len(info.Data) == 0 {
-		return err
-	}
-	asset := NormalizeToken(info.Data[0])
-	tkChan <- asset
-	return nil
-}
-
-func NormalizeToken(info AssetInfo) types.Token {
-	return types.Token{
-		Name:     info.Name,
-		Symbol:   strings.ToUpper(info.Symbol),
-		TokenID:  strconv.Itoa(int(info.ID)),
-		Coin:     coin.TRX,
-		Decimals: info.Decimals,
-		Type:     types.TRC10,
-	}
+	return assetIds, nil
 }
diff --git a/platform/tron/transaction.go b/platform/tron/transaction.go
index af8eb10..8ee82b7 100644
--- a/platform/tron/transaction.go
+++ b/platform/tron/transaction.go
@@ -11,7 +11,7 @@ import (
 )
 
 func (p *Platform) GetTxsByAddress(address string) (types.TxPage, error) {
-	Txs, err := p.client.fetchTxsOfAddress(address, "")
+	Txs, err := p.gridClient.fetchTxsOfAddress(address, "")
 	if err != nil && len(Txs) == 0 {
 		return nil, err
 	}
@@ -80,12 +80,12 @@ func addTokenMeta(tx *types.Tx, srcTx Tx, tokenInfo AssetInfo) {
 func (p *Platform) fetchTransactionsForTRC10Tokens(address, token string) (types.TxPage, error) {
 	txs := make(types.TxPage, 0)
 
-	tokenTxs, err := p.client.fetchTxsOfAddress(address, token)
+	tokenTxs, err := p.gridClient.fetchTxsOfAddress(address, token)
 	if err != nil {
 		return nil, err
 	}
 
-	info, err := p.client.fetchTokenInfo(token)
+	info, err := p.gridClient.fetchTokenInfo(token)
 	if err != nil {
 		return nil, err
 	}
diff --git a/services/notifier/base.go b/services/notifier/base.go
index 872dd3b..a942af3 100644
--- a/services/notifier/base.go
+++ b/services/notifier/base.go
@@ -7,6 +7,7 @@ import (
 	log "github.com/sirupsen/logrus"
 	"github.com/streadway/amqp"
 	"github.com/trustwallet/blockatlas/db"
+	"github.com/trustwallet/golibs/types"
 )
 
 const (
@@ -14,23 +15,23 @@ const (
 )
 
 func RunNotifier(database *db.Instance, delivery amqp.Delivery) error {
-	txs, err := GetTransactionsFromDelivery(delivery, Notifier)
+	transactions, err := GetTransactionsFromDelivery(delivery, Notifier)
 	if err != nil {
-		log.WithFields(log.Fields{"service": Notifier, "txs": txs}).Error("failed to get transactions: ", err)
-		return err
+		log.WithFields(log.Fields{"service": Notifier, "body": string(delivery.Body), "error": err}).Error("Unable to unmarshal MQ Message")
+		return nil
 	}
 
 	allAddresses := make([]string, 0)
-	for _, tx := range txs {
+	for _, tx := range transactions {
 		allAddresses = append(allAddresses, tx.GetAddresses()...)
 	}
 
 	addresses := ToUniqueAddresses(allAddresses)
 	for i := range addresses {
-		addresses[i] = strconv.Itoa(int(txs[0].Coin)) + "_" + addresses[i]
+		addresses[i] = strconv.Itoa(int(transactions[0].Coin)) + "_" + addresses[i]
 	}
 
-	if len(txs) == 0 {
+	if len(transactions) == 0 {
 		return nil
 	}
 	subscriptions, err := database.GetSubscriptions(addresses)
@@ -38,13 +39,13 @@ func RunNotifier(database *db.Instance, delivery amqp.Delivery) error {
 		return nil
 	}
 
-	notifications := make([]TransactionNotification, 0)
+	notifications := make([]types.TransactionNotification, 0)
 	for _, sub := range subscriptions {
 		ua, _, ok := UnprefixedAddress(sub.Address)
 		if !ok {
 			continue
 		}
-		notificationsForAddress := buildNotificationsByAddress(ua, txs)
+		notificationsForAddress := buildNotificationsByAddress(ua, transactions)
 		notifications = append(notifications, notificationsForAddress...)
 	}
 
diff --git a/services/notifier/delivery.go b/services/notifier/delivery.go
index e61ddbd..4a5d3e5 100644
--- a/services/notifier/delivery.go
+++ b/services/notifier/delivery.go
@@ -22,7 +22,7 @@ func GetTransactionsFromDelivery(delivery amqp.Delivery, service string) (types.
 	return transactions, nil
 }
 
-func publishNotifications(notifications []TransactionNotification) error {
+func publishNotifications(notifications []types.TransactionNotification) error {
 	raw, err := json.Marshal(notifications)
 	if err != nil {
 		return err
diff --git a/services/notifier/models.go b/services/notifier/models.go
index c3d4794..37edf66 100644
--- a/services/notifier/models.go
+++ b/services/notifier/models.go
@@ -2,19 +2,14 @@ package notifier
 
 import "github.com/trustwallet/golibs/types"
 
-type TransactionNotification struct {
-	Action types.TransactionType `json:"action"`
-	Result types.Tx              `json:"result"`
-}
-
-func buildNotificationsByAddress(address string, txs types.Txs) []TransactionNotification {
+func buildNotificationsByAddress(address string, txs types.Txs) []types.TransactionNotification {
 	transactionsByAddress := toUniqueTransactions(findTransactionsByAddress(txs, address))
 
-	result := make([]TransactionNotification, 0, len(transactionsByAddress))
+	result := make([]types.TransactionNotification, 0, len(transactionsByAddress))
 	for _, tx := range transactionsByAddress {
 		tx.Direction = tx.GetTransactionDirection(address)
 		tx.InferUtxoValue(address, tx.Coin)
-		result = append(result, TransactionNotification{Action: tx.Type, Result: tx})
+		result = append(result, types.TransactionNotification{Action: tx.Type, Result: tx})
 	}
 
 	return result
diff --git a/services/parser/parser.go b/services/parser/parser.go
index aa255e7..e37a44a 100644
--- a/services/parser/parser.go
+++ b/services/parser/parser.go
@@ -262,15 +262,15 @@ func SaveLastParsedBlock(params Params, blocks []types.Block) error {
 	return nil
 }
 
-func publish(params Params, txs types.Txs) error {
+func publish(params Params, transactions types.Txs) error {
 
-	if len(txs) == 0 {
+	if len(transactions) == 0 {
 		return nil
 	}
 
-	body, err := json.Marshal(txs)
+	body, err := json.Marshal(transactions)
 	if err != nil {
-		log.WithFields(log.Fields{"operation": "publish marshal", "coin": params.Api.Coin().Handle}).Error(err)
+		log.WithFields(log.Fields{"operation": "publish marshal", "transactions": transactions, "coin": params.Api.Coin().Handle}).Error(err)
 		return err
 	}
 	return params.TransactionsExchange.Publish(body)
diff --git a/services/subscriber/subscriber.go b/services/subscriber/subscriber.go
index 84e8844..733ae36 100644
--- a/services/subscriber/subscriber.go
+++ b/services/subscriber/subscriber.go
@@ -8,35 +8,27 @@ import (
 	log "github.com/sirupsen/logrus"
 	"github.com/streadway/amqp"
 	"github.com/trustwallet/blockatlas/db"
-	"github.com/trustwallet/blockatlas/pkg/blockatlas"
-)
-
-type Subscriber string
-
-const (
-	Notifications      Subscriber                       = "notifications"
-	AddSubscription    blockatlas.SubscriptionOperation = "AddSubscription"
-	DeleteSubscription blockatlas.SubscriptionOperation = "DeleteSubscription"
+	"github.com/trustwallet/golibs/types"
 )
 
 func RunSubscriber(database *db.Instance, delivery amqp.Delivery) error {
-	var event blockatlas.SubscriptionEvent
+	var event types.SubscriptionEvent
 	err := json.Unmarshal(delivery.Body, &event)
 	if err != nil {
-		log.WithFields(log.Fields{"service": Notifications, "event": event}).Error(err)
-		return err
+		log.WithFields(log.Fields{"service": types.Notifications, "body": string(delivery.Body), "error": err}).Error("Unable to unmarshal MQ Message")
+		return nil
 	}
 
 	subscriptions := event.ParseSubscriptions(event.Subscriptions)
 	switch event.Operation {
-	case AddSubscription:
+	case types.AddSubscription:
 		err := database.CreateSubscriptions(subscriptions)
 		if err != nil {
-			log.WithFields(log.Fields{"service": Notifications, "operation": event.Operation, "subscriptions": subscriptions}).Error(err)
+			log.WithFields(log.Fields{"service": types.Notifications, "operation": event.Operation, "subscriptions": subscriptions}).Error(err)
 			return err
 		}
-		log.WithFields(log.Fields{"service": Notifications, "operation": event.Operation, "subscriptions": len(subscriptions)}).Info("Add subscriptions")
-	case DeleteSubscription:
+		log.WithFields(log.Fields{"service": types.Notifications, "operation": event.Operation, "subscriptions": len(subscriptions)}).Info("Add subscriptions")
+	case types.DeleteSubscription:
 		subscriptionsIds := make([]string, 0)
 		for _, subscription := range subscriptions {
 			subscriptionsIds = append(subscriptionsIds, subscription.AddressID())
diff --git a/services/tokenindexer/api.go b/services/tokenindexer/api.go
index 551a4c8..ff6d0c4 100644
--- a/services/tokenindexer/api.go
+++ b/services/tokenindexer/api.go
@@ -3,10 +3,9 @@ package tokenindexer
 import (
 	"time"
 
-	"github.com/trustwallet/blockatlas/pkg/blockatlas"
-
 	"github.com/trustwallet/blockatlas/db"
 	"github.com/trustwallet/blockatlas/db/models"
+	"github.com/trustwallet/golibs/types"
 )
 
 type Instance struct {
@@ -31,7 +30,7 @@ func (i Instance) GetTokensByAddress(r GetTokensByAddressRequest) (GetTokensByAd
 
 	for coin, coins := range r.AddressesByCoin {
 		for _, address := range coins {
-			list = append(list, blockatlas.GetAddressID(coin, address))
+			list = append(list, types.GetAddressID(coin, address))
 		}
 	}
 	from := time.Unix(int64(r.From), 0)
diff --git a/services/tokenindexer/indexer.go b/services/tokenindexer/indexer.go
index d3d70fb..44c2c97 100644
--- a/services/tokenindexer/indexer.go
+++ b/services/tokenindexer/indexer.go
@@ -17,23 +17,23 @@ const (
 )
 
 func RunTokenIndexer(database *db.Instance, delivery amqp.Delivery) error {
-	txs, err := notifier.GetTransactionsFromDelivery(delivery, TokenIndexer)
+	transactions, err := notifier.GetTransactionsFromDelivery(delivery, TokenIndexer)
 	if err != nil {
-		log.WithFields(log.Fields{"service": TokenIndexer, "txs": txs}).Error("failed to get transactions: ", err)
-		return err
+		log.WithFields(log.Fields{"service": TokenIndexer, "body": string(delivery.Body), "error": err}).Error("Unable to unmarshal MQ Message")
+		return nil
 	}
-	txs = txs.FilterTransactionsByType([]types.TransactionType{
+	transactions = transactions.FilterTransactionsByType([]types.TransactionType{
 		types.TxTokenTransfer,
 		types.TxNativeTokenTransfer,
 	})
 
-	if len(txs) == 0 {
+	if len(transactions) == 0 {
 		return nil
 	}
 
 	// Add new assets to db
 
-	assets := GetAssetsFromTransactions(txs)
+	assets := GetAssetsFromTransactions(transactions)
 	err = database.AddNewAssets(assets)
 	if err != nil {
 		log.WithFields(log.Fields{"service": TokenIndexer}).Error("Failed to add new assets", err)
@@ -41,7 +41,7 @@ func RunTokenIndexer(database *db.Instance, delivery amqp.Delivery) error {
 	}
 
 	// Add asset <> address association
-	addressAssetsMap := assetsMap(txs)
+	addressAssetsMap := assetsMap(transactions)
 
 	return CreateAssociations(database, addressAssetsMap)
 }
diff --git a/services/tokenindexer/indexer_subscribe.go b/services/tokenindexer/indexer_subscribe.go
index 26cec46..bb87414 100644
--- a/services/tokenindexer/indexer_subscribe.go
+++ b/services/tokenindexer/indexer_subscribe.go
@@ -7,30 +7,37 @@ import (
 	"github.com/streadway/amqp"
 	"github.com/trustwallet/blockatlas/db"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
-	"github.com/trustwallet/blockatlas/services/subscriber"
+	"github.com/trustwallet/golibs/types"
 )
 
 type ConsumerIndexer struct {
 	Database   *db.Instance
 	TokensAPIs map[uint]blockatlas.TokensAPI
 	Delivery   func(*db.Instance, map[uint]blockatlas.TokensAPI, amqp.Delivery) error
+	Tag        string
 }
 
 func (c ConsumerIndexer) Callback(msg amqp.Delivery) error {
 	return c.Delivery(c.Database, c.TokensAPIs, msg)
 }
 
+func (c ConsumerIndexer) ConsumerTag() string {
+	return c.Tag
+}
+
 func RunTokenIndexerSubscribe(database *db.Instance, apis map[uint]blockatlas.TokensAPI, delivery amqp.Delivery) error {
-	var event blockatlas.SubscriptionEvent
+	var event types.SubscriptionEvent
 	err := json.Unmarshal(delivery.Body, &event)
 	if err != nil {
-		log.WithFields(log.Fields{"service": SubscriptionsTokenIndexer, "event": event}).Error(err)
-		return err
+		log.WithFields(log.Fields{"service": SubscriptionsTokenIndexer, "body": string(delivery.Body), "error": err}).Error("Unable to unmarshal MQ Message")
+		return nil
 	}
 
+	log.WithFields(log.Fields{"service": TokenIndexer, "event": event.Operation, "subscriptions": len(event.Subscriptions)}).Info("Processing")
+
 	subscriptions := event.ParseSubscriptions(event.Subscriptions)
 	switch event.Operation {
-	case subscriber.AddSubscription:
+	case types.AddSubscription:
 		addressAssetsMap := map[string][]string{}
 
 		for _, coinAddress := range subscriptions {
@@ -38,18 +45,14 @@ func RunTokenIndexerSubscribe(database *db.Instance, apis map[uint]blockatlas.To
 			if !ok {
 				continue
 			}
-			assets, err := api.GetTokenListByAddress(coinAddress.Address)
+			assetIds, err := api.GetTokenListByAddress(coinAddress.Address)
 			if err != nil {
 				continue
 			}
-			assetIds := make([]string, 0)
-			for _, asset := range assets {
-				assetIds = append(assetIds, asset.AssetId())
-			}
 			addressAssetsMap[coinAddress.AddressID()] = assetIds
 		}
 		return CreateAssociations(database, addressAssetsMap)
-	case subscriber.DeleteSubscription:
+	case types.DeleteSubscription:
 		//No action is needed
 		return nil
 	}


Test patch:
diff --git a/pkg/blockatlas/observer_test.go b/pkg/blockatlas/observer_test.go
deleted file mode 100644
index f61e2ab..0000000
--- a/pkg/blockatlas/observer_test.go
+++ /dev/null
@@ -1,70 +0,0 @@
-package blockatlas
-
-import (
-	"sort"
-	"testing"
-
-	"github.com/stretchr/testify/assert"
-)
-
-func Test_parseSubscriptions(t *testing.T) {
-	tests := []struct {
-		name          string
-		subscriptions SubscriptionEvent
-		wantSubs      []Subscription
-	}{
-		{
-			name: "guid with 1 coin",
-			subscriptions: SubscriptionEvent{
-				Subscriptions: Subscriptions{
-					"0": {"xpub6BpYi6J1GZzfY3yY7DbhLLccF3efQa18nQngM3jaehgtNSoEgk6UtPULpC3oK5oA3trczY8Ld34LFw1USMPfGHwTEizdD5QyGcMyuh2UoBA", "xpub6CYwPfnPJLPquufPkb98coSb3mdy1CgaZrWUtYWGJTJ4VWZUbzH9HLGy7nHpP7DG4UdTkYYpirkTWQSP7pWHsrk24Nos5oYNHpfr4BgPVTL"},
-				},
-			},
-			wantSubs: []Subscription{
-				{
-					Coin:    0,
-					Address: "xpub6BpYi6J1GZzfY3yY7DbhLLccF3efQa18nQngM3jaehgtNSoEgk6UtPULpC3oK5oA3trczY8Ld34LFw1USMPfGHwTEizdD5QyGcMyuh2UoBA",
-				},
-				{
-					Coin:    0,
-					Address: "xpub6CYwPfnPJLPquufPkb98coSb3mdy1CgaZrWUtYWGJTJ4VWZUbzH9HLGy7nHpP7DG4UdTkYYpirkTWQSP7pWHsrk24Nos5oYNHpfr4BgPVTL",
-				},
-			},
-		},
-		{
-			name: "guid with 2 coins",
-			subscriptions: SubscriptionEvent{
-				Subscriptions: Subscriptions{
-					"2": {"zpub6rH4MwgyTmuexAX6HAraks5cKv5BbtmwdLirvnU5845ovUJb4abgjt9DtXK4ZEaToRrNj8dQznuLC6Nka4eMviGMinCVMUxKLpuyddcG9Vc"},
-					"0": {"xpub6BpYi6J1GZzfY3yY7DbhLLccF3efQa18nQngM3jaehgtNSoEgk6UtPULpC3oK5oA3trczY8Ld34LFw1USMPfGHwTEizdD5QyGcMyuh2UoBA", "xpub6CYwPfnPJLPquufPkb98coSb3mdy1CgaZrWUtYWGJTJ4VWZUbzH9HLGy7nHpP7DG4UdTkYYpirkTWQSP7pWHsrk24Nos5oYNHpfr4BgPVTL"},
-				},
-			},
-			wantSubs: []Subscription{
-				{
-					Coin:    2,
-					Address: "zpub6rH4MwgyTmuexAX6HAraks5cKv5BbtmwdLirvnU5845ovUJb4abgjt9DtXK4ZEaToRrNj8dQznuLC6Nka4eMviGMinCVMUxKLpuyddcG9Vc",
-				},
-				{
-					Coin:    0,
-					Address: "xpub6BpYi6J1GZzfY3yY7DbhLLccF3efQa18nQngM3jaehgtNSoEgk6UtPULpC3oK5oA3trczY8Ld34LFw1USMPfGHwTEizdD5QyGcMyuh2UoBA",
-				},
-				{
-					Coin:    0,
-					Address: "xpub6CYwPfnPJLPquufPkb98coSb3mdy1CgaZrWUtYWGJTJ4VWZUbzH9HLGy7nHpP7DG4UdTkYYpirkTWQSP7pWHsrk24Nos5oYNHpfr4BgPVTL",
-				},
-			},
-		},
-	}
-	for _, tt := range tests {
-		t.Run(tt.name, func(t *testing.T) {
-			gotSubs := tt.subscriptions.ParseSubscriptions(tt.subscriptions.Subscriptions)
-			sort.Slice(gotSubs, func(i, j int) bool {
-				return gotSubs[i].Coin > gotSubs[j].Coin
-			})
-			sort.Slice(tt.wantSubs, func(i, j int) bool {
-				return tt.wantSubs[i].Coin > tt.wantSubs[j].Coin
-			})
-			assert.EqualValues(t, tt.wantSubs, gotSubs)
-		})
-	}
-}
diff --git a/platform/bitcoin/blockbook/token_test.go b/platform/bitcoin/blockbook/token_test.go
index 560bd44..a1a1ed0 100644
--- a/platform/bitcoin/blockbook/token_test.go
+++ b/platform/bitcoin/blockbook/token_test.go
@@ -3,8 +3,6 @@ package blockbook
 import (
 	"reflect"
 	"testing"
-
-	"github.com/trustwallet/golibs/types"
 )
 
 func TestNormalizeToken(t *testing.T) {
@@ -15,7 +13,7 @@ func TestNormalizeToken(t *testing.T) {
 	tests := []struct {
 		name string
 		args args
-		want []types.Token
+		want []string
 	}{
 		{
 			name: "Should normalize and return token with balance",
@@ -27,12 +25,7 @@ func TestNormalizeToken(t *testing.T) {
 				Symbol:   "USDC",
 				Decimals: 6},
 				coinIndex: 60},
-			want: []types.Token{
-				{
-					Type:    "ERC20",
-					Name:    "USD//C",
-					TokenID: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
-					Symbol:  "USDC", Decimals: 6, Coin: 60}},
+			want: []string{"c60_t0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},
 		},
 		{
 			name: "Should not return token with zero balance",
@@ -44,7 +37,7 @@ func TestNormalizeToken(t *testing.T) {
 				Symbol:   "USDC",
 				Decimals: 6},
 				coinIndex: 60},
-			want: []types.Token{},
+			want: []string{},
 		}, {
 			name: "Should not return token with zero balance",
 			args: args{srcToken: Token{
@@ -55,7 +48,7 @@ func TestNormalizeToken(t *testing.T) {
 				Symbol:   "USDC",
 				Decimals: 6},
 				coinIndex: 60},
-			want: []types.Token{},
+			want: []string{},
 		},
 	}
 	for _, tt := range tests {
diff --git a/platform/elrond/transaction_test.go b/platform/elrond/transaction_test.go
index afd23af..0d67181 100644
--- a/platform/elrond/transaction_test.go
+++ b/platform/elrond/transaction_test.go
@@ -11,13 +11,14 @@ import (
 )
 
 var (
-	userAddress       = `erd10yagg2vme2jns9zqf9xn8kl86fkc6dr063vnuj0mz2kk2jw0qwuqmfmaw0`
-	txTransferSrc1, _ = mock.JsonStringFromFilePath("mocks/tx.json")
-	txTransferSrc2, _ = mock.JsonStringFromFilePath("mocks/tx_2.json")
-	txTransferSrc3, _ = mock.JsonStringFromFilePath("mocks/tx_3.json")
-	txTransferSrc4, _ = mock.JsonStringFromFilePath("mocks/tx_4.json")
-	txTransferSrc5, _ = mock.JsonStringFromFilePath("mocks/tx_5.json")
-	txTransferSrc6, _ = mock.JsonStringFromFilePath("mocks/tx_6.json")
+	userAddress         = `erd10yagg2vme2jns9zqf9xn8kl86fkc6dr063vnuj0mz2kk2jw0qwuqmfmaw0`
+	txTransferSrc1, _   = mock.JsonStringFromFilePath("mocks/tx.json")
+	txTransferSrc2, _   = mock.JsonStringFromFilePath("mocks/tx_2.json")
+	txTransferSrc3, _   = mock.JsonStringFromFilePath("mocks/tx_3.json")
+	txTransferSrc4, _   = mock.JsonStringFromFilePath("mocks/tx_4.json")
+	txTransferSrc5, _   = mock.JsonStringFromFilePath("mocks/tx_5.json")
+	txTransferSrc6, _   = mock.JsonStringFromFilePath("mocks/tx_6.json")
+	scrNegativeValue, _ = mock.JsonStringFromFilePath("mocks/scr_negative_value.json")
 
 	txTransfer1Normalized = types.Tx{
 		ID:       "30d404cc7a42b0158b95f6adfbf9a517627d60f6c7e497c1442dfdb6460285df",
@@ -168,15 +169,16 @@ func TestNormalize(t *testing.T) {
 }
 
 func TestNormalizeTxs(t *testing.T) {
-	var tx1, tx2, tx3 Transaction
+	var tx1, tx2, tx3, scrNegative Transaction
 
 	_ = json.Unmarshal([]byte(txTransferSrc1), &tx1)
 	_ = json.Unmarshal([]byte(txTransferSrc1), &tx2)
 	_ = json.Unmarshal([]byte(txTransferSrc1), &tx3)
+	_ = json.Unmarshal([]byte(scrNegativeValue), &scrNegative)
 
-	txs := []Transaction{tx1, tx2, tx3}
+	txs := []Transaction{tx1, tx2, tx3, scrNegative}
 	normalizedTxs := NormalizeTxs(txs, userAddress, Block{})
-	require.Equal(t, len(txs), len(normalizedTxs))
+	require.Equal(t, len(txs)-1, len(normalizedTxs))
 }
 
 func testNormalize(t *testing.T, _test *test) {
diff --git a/platform/ethereum/transaction_test.go b/platform/ethereum/transaction_test.go
index ceb0ba2..5c846ba 100644
--- a/platform/ethereum/transaction_test.go
+++ b/platform/ethereum/transaction_test.go
@@ -55,8 +55,8 @@ func (c Client) GetTokenTxs(address, token string, coinIndex uint) (types.TxPage
 	return txs, nil
 }
 
-func (c Client) GetTokenList(address string, coinIndex uint) (types.TokenPage, error) {
-	return types.TokenPage{}, nil
+func (c Client) GetTokenList(address string, coinIndex uint) ([]string, error) {
+	return []string{}, nil
 }
 
 func (c Client) GetCurrentBlockNumber() (int64, error) {
diff --git a/platform/tezos/block_test.go b/platform/tezos/block_test.go
index aa5141b..149052d 100644
--- a/platform/tezos/block_test.go
+++ b/platform/tezos/block_test.go
@@ -9,7 +9,7 @@ import (
 	"github.com/trustwallet/golibs/types"
 )
 
-func TestNormalizeRpcBlock(t *testing.T) {
+func TestProcessRpcBlock(t *testing.T) {
 	type args struct {
 		filename string
 	}
@@ -64,6 +64,7 @@ func TestNormalizeRpcBlock(t *testing.T) {
 							Name:     "Tezos",
 							Symbol:   "XTZ",
 							Decimals: 6,
+							Value:    "163965",
 						},
 					},
 					{
@@ -103,6 +104,7 @@ func TestNormalizeRpcBlock(t *testing.T) {
 							Name:     "Tezos",
 							Symbol:   "XTZ",
 							Decimals: 6,
+							Value:    "163965",
 						},
 					},
 					{
@@ -131,15 +133,16 @@ func TestNormalizeRpcBlock(t *testing.T) {
 	for _, tt := range tests {
 		var block RpcBlock
 		_ = mock.JsonModelFromFilePath("mocks/"+tt.args.filename, &block)
+		rpcClient := &RpcClientMock{Balance: "163965"}
 		t.Run(tt.name, func(t *testing.T) {
-			got, err := NormalizeRpcBlock(block)
+			got, err := ProcessRpcBlock(block, rpcClient)
 			fmt.Println(got)
 			if (err != nil) != tt.wantErr {
-				t.Errorf("NormalizeRpcBlock() error = %v, wantErr %v", err, tt.wantErr)
+				t.Errorf("ProcessRpcBlock() error = %v, wantErr %v", err, tt.wantErr)
 				return
 			}
 			if !reflect.DeepEqual(got, tt.want) {
-				t.Errorf("NormalizeRpcBlock() = %v, \nwant %v", got, tt.want)
+				t.Errorf("ProcessRpcBlock() = %v, \nwant %v", got, tt.want)
 			}
 		})
 	}
diff --git a/platform/tron/token_test.go b/platform/tron/token_test.go
index 3246267..8ccde95 100644
--- a/platform/tron/token_test.go
+++ b/platform/tron/token_test.go
@@ -10,26 +10,8 @@ import (
 
 	"github.com/stretchr/testify/assert"
 	"github.com/trustwallet/golibs/mock"
-	"github.com/trustwallet/golibs/types"
 )
 
-var (
-	tokenDst = types.Token{
-		Name:     "Test",
-		Symbol:   "TST",
-		Decimals: 8,
-		TokenID:  "1",
-		Coin:     195,
-		Type:     "TRC10",
-	}
-)
-
-func TestNormalizeToken(t *testing.T) {
-	asset := AssetInfo{Name: "Test", Symbol: "TST", ID: 1, Decimals: 8}
-	actual := NormalizeToken(asset)
-	assert.Equal(t, tokenDst, actual)
-}
-
 func TestPlatform_GetTokenListByAddress(t *testing.T) {
 	server := httptest.NewServer(createMockedAPI())
 	defer server.Close()
@@ -38,7 +20,7 @@ func TestPlatform_GetTokenListByAddress(t *testing.T) {
 	res, err := p.GetTokenListByAddress("TM1zzNDZD2DPASbKcgdVoTYhfmYgtfwx9R")
 	assert.Nil(t, err)
 	sort.Slice(res, func(i, j int) bool {
-		return res[i].TokenID < res[j].TokenID
+		return res[i] < res[j]
 	})
 	rawRes, err := json.Marshal(res)
 	assert.Nil(t, err)