Repository: trustwallet/blockatlas
Pull request #901 (2020-02-21 20:25:10)

Update PRs from dev branch


Patch:
diff --git a/Makefile b/Makefile
index 0c5a5d7..cbde91f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,10 @@
 #! /usr/bin/make -f
 
 # Project variables.
+PACKAGE := github.com/trustwallet/blockatlas
 VERSION := $(shell git describe --tags)
 BUILD := $(shell git rev-parse --short HEAD)
+DATETIME := $(shell date +"%Y.%m.%d-%H:%M:%S")
 PROJECT_NAME := $(shell basename "$(PWD)")
 API_SERVICE := platform_api
 OBSERVER_SERVICE := platform_observer
@@ -26,7 +28,7 @@ CONFIG_FILE=$(GOBASE)/config.yml
 GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
 
 # Use linker flags to provide version/build settings
-LDFLAGS=-ldflags "-X=main.Version=$(VERSION) -X=main.Build=$(BUILD)"
+LDFLAGS=-ldflags "-X=$(PACKAGE)/build.Version=$(VERSION) -X=$(PACKAGE)/build.Build=$(BUILD) -X=$(PACKAGE)/build.Date=$(DATETIME)"
 
 # Redirect error output to a file, so we can show it in development mode.
 STDERR := /tmp/.$(PROJECT_NAME)-stderr.txt
diff --git a/build/build.go b/build/build.go
new file mode 100644
index 0000000..49f78ec
--- /dev/null
+++ b/build/build.go
@@ -0,0 +1,26 @@
+package build
+
+import (
+	"fmt"
+	"runtime"
+)
+
+var (
+	Version = "dev"
+	Build   = "dev"
+	Date    = ""
+)
+
+func LogVersionInfo() {
+	fmt.Printf(`
+************************************************
+Version: %v
+Build: %v
+Date: %v
+OS: %s
+Arch: %s
+Go: %s
+************************************************
+`,
+		Version, Build, Date, runtime.GOOS, runtime.GOARCH, runtime.Version())
+}
diff --git a/cmd/market_api/main.go b/cmd/market_api/main.go
index fbe183b..69310fa 100644
--- a/cmd/market_api/main.go
+++ b/cmd/market_api/main.go
@@ -3,6 +3,7 @@ package main
 import (
 	"github.com/gin-gonic/gin"
 	"github.com/trustwallet/blockatlas/api"
+	"github.com/trustwallet/blockatlas/build"
 	"github.com/trustwallet/blockatlas/config"
 	_ "github.com/trustwallet/blockatlas/docs"
 	"github.com/trustwallet/blockatlas/internal"
@@ -23,6 +24,7 @@ var (
 )
 
 func init() {
+	build.LogVersionInfo()
 	port, confPath, sg, cache = internal.InitAPIWithRedis(defaultPort, defaultConfigPath)
 }
 
@@ -38,7 +40,10 @@ func main() {
 	engine.GET("/", api.GetRoot)
 	engine.GET("/status", func(c *gin.Context) {
 		ginutils.RenderSuccess(c, map[string]interface{}{
-			"status": true,
+			"status":  true,
+			"version": build.Version,
+			"build":   build.Build,
+			"date":    build.Date,
 		})
 	})
 
diff --git a/cmd/market_observer/main.go b/cmd/market_observer/main.go
index 6474614..152fbae 100644
--- a/cmd/market_observer/main.go
+++ b/cmd/market_observer/main.go
@@ -1,6 +1,7 @@
 package main
 
 import (
+	"github.com/trustwallet/blockatlas/build"
 	"github.com/trustwallet/blockatlas/internal"
 	"github.com/trustwallet/blockatlas/market"
 	"github.com/trustwallet/blockatlas/storage"
@@ -16,6 +17,7 @@ var (
 )
 
 func init() {
+	build.LogVersionInfo()
 	_, confPath, _, cache = internal.InitAPIWithRedis("", defaultConfigPath)
 }
 
diff --git a/cmd/observer_api/main.go b/cmd/observer_api/main.go
index dbaaf3f..997b390 100644
--- a/cmd/observer_api/main.go
+++ b/cmd/observer_api/main.go
@@ -3,6 +3,7 @@ package main
 import (
 	"github.com/gin-gonic/gin"
 	"github.com/trustwallet/blockatlas/api"
+	"github.com/trustwallet/blockatlas/build"
 	"github.com/trustwallet/blockatlas/config"
 	_ "github.com/trustwallet/blockatlas/docs"
 	"github.com/trustwallet/blockatlas/internal"
@@ -23,6 +24,7 @@ var (
 )
 
 func init() {
+	build.LogVersionInfo()
 	port, confPath, sg, cache = internal.InitAPIWithRedis(defaultPort, defaultConfigPath)
 }
 
@@ -38,7 +40,10 @@ func main() {
 	engine.GET("/", api.GetRoot)
 	engine.GET("/status", func(c *gin.Context) {
 		ginutils.RenderSuccess(c, map[string]interface{}{
-			"status": true,
+			"status":  true,
+			"version": build.Version,
+			"build":   build.Build,
+			"date":    build.Date,
 		})
 	})
 
diff --git a/cmd/platform_api/main.go b/cmd/platform_api/main.go
index 73873e4..c3bf9a5 100644
--- a/cmd/platform_api/main.go
+++ b/cmd/platform_api/main.go
@@ -3,6 +3,7 @@ package main
 import (
 	"github.com/gin-gonic/gin"
 	"github.com/trustwallet/blockatlas/api"
+	"github.com/trustwallet/blockatlas/build"
 	"github.com/trustwallet/blockatlas/config"
 	_ "github.com/trustwallet/blockatlas/docs"
 	"github.com/trustwallet/blockatlas/internal"
@@ -22,6 +23,7 @@ var (
 )
 
 func init() {
+	build.LogVersionInfo()
 	port, confPath, sg = internal.InitAPI(defaultPort, defaultConfigPath)
 	platform.Init(config.Configuration.Platform)
 }
@@ -37,7 +39,10 @@ func main() {
 	engine.GET("/", api.GetRoot)
 	engine.GET("/status", func(c *gin.Context) {
 		ginutils.RenderSuccess(c, map[string]interface{}{
-			"status": true,
+			"status":  true,
+			"version": build.Version,
+			"build":   build.Build,
+			"date":    build.Date,
 		})
 	})
 
diff --git a/cmd/platform_observer/main.go b/cmd/platform_observer/main.go
index 3ec4f8f..04cdfe1 100644
--- a/cmd/platform_observer/main.go
+++ b/cmd/platform_observer/main.go
@@ -2,6 +2,7 @@ package main
 
 import (
 	"context"
+	"github.com/trustwallet/blockatlas/build"
 	"github.com/trustwallet/blockatlas/config"
 	"github.com/trustwallet/blockatlas/internal"
 	"github.com/trustwallet/blockatlas/observer"
@@ -21,6 +22,7 @@ var (
 )
 
 func init() {
+	build.LogVersionInfo()
 	_, confPath, _, cache = internal.InitAPIWithRedis("", defaultConfigPath)
 	platform.Init(config.Configuration.Platform)
 }
diff --git a/cmd/swagger_api/main.go b/cmd/swagger_api/main.go
index d3f2359..2b4c851 100644
--- a/cmd/swagger_api/main.go
+++ b/cmd/swagger_api/main.go
@@ -5,6 +5,7 @@ import (
 	ginSwagger "github.com/swaggo/gin-swagger"
 	"github.com/swaggo/gin-swagger/swaggerFiles"
 	"github.com/trustwallet/blockatlas/api"
+	"github.com/trustwallet/blockatlas/build"
 	"github.com/trustwallet/blockatlas/config"
 	_ "github.com/trustwallet/blockatlas/docs"
 	"github.com/trustwallet/blockatlas/internal"
@@ -23,6 +24,7 @@ var (
 )
 
 func init() {
+	build.LogVersionInfo()
 	port, confPath, sg = internal.InitAPI(defaultPort, defaultConfigPath)
 }
 
@@ -37,7 +39,10 @@ func main() {
 	engine.GET("/", api.GetRoot)
 	engine.GET("/status", func(c *gin.Context) {
 		ginutils.RenderSuccess(c, map[string]interface{}{
-			"status": true,
+			"status":  true,
+			"version": build.Version,
+			"build":   build.Build,
+			"date":    build.Date,
 		})
 	})
 
diff --git a/go.mod b/go.mod
index fddd41e..8a81e9d 100644
--- a/go.mod
+++ b/go.mod
@@ -15,6 +15,7 @@ require (
 	github.com/go-redis/redis v6.15.6+incompatible
 	github.com/hewigovens/go-coincodec v1.0.4
 	github.com/jinzhu/gorm v1.9.12
+	github.com/mitchellh/mapstructure v1.1.2
 	github.com/mr-tron/base58 v1.1.3
 	github.com/patrickmn/go-cache v2.1.0+incompatible
 	github.com/prometheus/client_golang v1.4.0
diff --git a/market/clients/coingecko/client.go b/market/clients/coingecko/client.go
index d8774fc..93a4257 100644
--- a/market/clients/coingecko/client.go
+++ b/market/clients/coingecko/client.go
@@ -41,14 +41,9 @@ func (c *Client) FetchLatestRates(coins GeckoCoins, currency string) (prices Coi
 				end = i + bucketSize
 			}
 			bucket := ci[i:end]
-			values := url.Values{
-				"vs_currency": {currency},
-				"sparkline":   {"false"},
-				"ids":         {strings.Join(bucket[:], ",")},
-			}
+			ids := strings.Join(bucket[:], ",")
 
-			var cp CoinPrices
-			err := c.Get(&cp, "v3/coins/markets", values)
+			cp, err := c.FetchCoinsMarkets(currency, ids)
 			if err != nil {
 				logger.Error(err)
 				return
@@ -71,7 +66,7 @@ func (c *Client) FetchLatestRates(coins GeckoCoins, currency string) (prices Coi
 	return
 }
 
-func (c *Client) GetChartsData(id string, currency string, timeStart int64, timeEnd int64) (charts Charts, err error) {
+func (c *Client) GetChartsData(id, currency string, timeStart, timeEnd int64) (charts Charts, err error) {
 	values := url.Values{
 		"vs_currency": {currency},
 		"from":        {strconv.FormatInt(timeStart, 10)},
@@ -89,6 +84,17 @@ func (c *Client) FetchCoinsList() (coins GeckoCoins, err error) {
 	return
 }
 
+func (c *Client) FetchCoinsMarkets(currency, ids string) (cp CoinPrices, err error) {
+	values := url.Values{
+		"vs_currency": {currency},
+		"sparkline":   {"false"},
+		"ids":         {ids},
+	}
+
+	err = c.Get(&cp, "v3/coins/markets", values)
+	return
+}
+
 func (coins GeckoCoins) coinIds() []string {
 	coinIds := make([]string, 0)
 	for _, coin := range coins {
diff --git a/market/market/coingecko/coingecko.go b/market/market/coingecko/coingecko.go
index 6729505..d16f21d 100644
--- a/market/market/coingecko/coingecko.go
+++ b/market/market/coingecko/coingecko.go
@@ -17,7 +17,7 @@ type Market struct {
 	market.Market
 }
 
-func InitMarket(api string, updateTime string) market.Provider {
+func InitMarket(api, updateTime string) market.Provider {
 	m := &Market{
 		client: coingecko.NewClient(api),
 		Market: market.Market{
@@ -45,7 +45,7 @@ func (m *Market) normalizeTicker(price coingecko.CoinPrice, provider string) (ti
 	coinName := strings.ToUpper(price.Symbol)
 	coinType := blockatlas.TypeCoin
 
-	cgCoin, err := m.cache.GetCoinsById(price.Id)
+	cgCoins, err := m.cache.GetCoinsById(price.Id)
 	if err != nil {
 		tickers = append(tickers, &blockatlas.Ticker{
 			CoinName: coinName,
@@ -62,7 +62,7 @@ func (m *Market) normalizeTicker(price coingecko.CoinPrice, provider string) (ti
 		return
 	}
 
-	for _, cg := range cgCoin {
+	for _, cg := range cgCoins {
 		coinName = strings.ToUpper(cg.Symbol)
 		if cg.CoinType == blockatlas.TypeCoin {
 			tokenId = ""
diff --git a/pkg/blockatlas/api.go b/pkg/blockatlas/api.go
index bafbb61..141637b 100644
--- a/pkg/blockatlas/api.go
+++ b/pkg/blockatlas/api.go
@@ -5,14 +5,8 @@ import (
 	"github.com/trustwallet/blockatlas/coin"
 )
 
-// Initer is a service that can be initialized once
-type Initer interface {
-	Init() error
-}
-
 // Platform can be used to access a crypto service
 type Platform interface {
-	Initer
 	Coin() coin.Coin
 }
 
diff --git a/pkg/blockatlas/platform.go b/pkg/blockatlas/platform.go
new file mode 100644
index 0000000..0dad231
--- /dev/null
+++ b/pkg/blockatlas/platform.go
@@ -0,0 +1,11 @@
+package blockatlas
+
+type Platforms map[string]Platform
+
+func (ps Platforms) GetPlatformList() []Platform {
+	platforms := make([]Platform, 0)
+	for _, p := range ps {
+		platforms = append(platforms, p)
+	}
+	return platforms
+}
diff --git a/platform/aeternity/base.go b/platform/aeternity/base.go
index 1f345c8..bf412ce 100644
--- a/platform/aeternity/base.go
+++ b/platform/aeternity/base.go
@@ -1,7 +1,6 @@
 package aeternity
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("aeternity.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/aion/base.go b/platform/aion/base.go
index 15379aa..1e7fa84 100644
--- a/platform/aion/base.go
+++ b/platform/aion/base.go
@@ -1,7 +1,6 @@
 package aion
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("aion.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/algorand/base.go b/platform/algorand/base.go
index 1e121c6..3dd9cde 100644
--- a/platform/algorand/base.go
+++ b/platform/algorand/base.go
@@ -1,8 +1,6 @@
 package algorand
 
 import (
-	"github.com/spf13/viper"
-
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -11,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("algorand.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/binance/base.go b/platform/binance/base.go
index ae15a6e..55f9fb3 100644
--- a/platform/binance/base.go
+++ b/platform/binance/base.go
@@ -1,7 +1,6 @@
 package binance
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -11,13 +10,14 @@ type Platform struct {
 	dexClient DexClient
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("binance.api"))}
+func Init(api, dex string) *Platform {
+	p := &Platform{
+		client:    Client{blockatlas.InitClient(api)},
+		dexClient: DexClient{blockatlas.InitClient(dex)},
+	}
 	p.client.ErrorHandler = getHTTPError
-
-	p.dexClient = DexClient{blockatlas.InitClient(viper.GetString("binance.dex"))}
 	p.dexClient.ErrorHandler = getHTTPError
-	return nil
+	return p
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/bitcoin/base.go b/platform/bitcoin/base.go
index a8c685b..ada173e 100644
--- a/platform/bitcoin/base.go
+++ b/platform/bitcoin/base.go
@@ -1,8 +1,6 @@
 package bitcoin
 
 import (
-	"fmt"
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -12,19 +10,17 @@ type Platform struct {
 	CoinIndex uint
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString(p.ConfigKey()))}
-	return nil
+func Init(coin uint, api string) *Platform {
+	return &Platform{
+		CoinIndex: coin,
+		client:    Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
 	return coin.Coins[p.CoinIndex]
 }
 
-func (p *Platform) ConfigKey() string {
-	return fmt.Sprintf("%s.api", p.Coin().Handle)
-}
-
 func (p *Platform) GetAddressesFromXpub(xpub string) ([]string, error) {
 	tokens, err := p.client.GetAddressesFromXpub(xpub)
 	addresses := make([]string, 0)
diff --git a/platform/cosmos/base.go b/platform/cosmos/base.go
index 3fea3ce..3b3b92c 100644
--- a/platform/cosmos/base.go
+++ b/platform/cosmos/base.go
@@ -1,8 +1,6 @@
 package cosmos
 
 import (
-	"fmt"
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -12,15 +10,13 @@ type Platform struct {
 	CoinIndex uint
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString(p.ConfigKey()))}
-	return nil
+func Init(coin uint, api string) *Platform {
+	return &Platform{
+		CoinIndex: coin,
+		client:    Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
 	return coin.Coins[p.CoinIndex]
 }
-
-func (p *Platform) ConfigKey() string {
-	return fmt.Sprintf("%s.api", p.Coin().Handle)
-}
diff --git a/platform/ethereum/base.go b/platform/ethereum/base.go
index 2d5aadd..4d78bcd 100644
--- a/platform/ethereum/base.go
+++ b/platform/ethereum/base.go
@@ -1,33 +1,30 @@
 package ethereum
 
 import (
-	"fmt"
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
 
 type Platform struct {
-	client            Client
-	collectionsClient CollectionsClient
 	CoinIndex         uint
 	RpcURL            string
+	client            Client
+	collectionsClient CollectionsClient
 }
 
-func (p *Platform) Init() error {
-	handle := coin.Coins[p.CoinIndex].Handle
-
-	coinVar := fmt.Sprintf("%s.api", handle)
-	p.client = Client{blockatlas.InitClient(viper.GetString(coinVar))}
-
-	collectionsApiVar := fmt.Sprintf("%s.collections_api", handle)
-	p.collectionsClient = CollectionsClient{blockatlas.InitClient(viper.GetString(collectionsApiVar))}
-
-	collectionsApiKeyVar := fmt.Sprintf("%s.collections_api_key", handle)
-	p.collectionsClient.Headers["X-API-KEY"] = viper.GetString(collectionsApiKeyVar)
+func Init(coin uint, api, rpc string) *Platform {
+	return &Platform{
+		CoinIndex: coin,
+		RpcURL:    rpc,
+		client:    Client{blockatlas.InitClient(api)},
+	}
+}
 
-	p.RpcURL = viper.GetString("ethereum.rpc")
-	return nil
+func InitWitCollection(coin uint, api, rpc, collectionApi, collectionKey string) *Platform {
+	p := Init(coin, api, rpc)
+	p.collectionsClient = CollectionsClient{blockatlas.InitClient(collectionApi)}
+	p.collectionsClient.Headers["X-API-KEY"] = collectionKey
+	return p
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/fio/base.go b/platform/fio/base.go
index 6db1586..5f5641d 100644
--- a/platform/fio/base.go
+++ b/platform/fio/base.go
@@ -1,7 +1,6 @@
 package fio
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("fio.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/harmony/base.go b/platform/harmony/base.go
index 75bce0e..f9e8c81 100644
--- a/platform/harmony/base.go
+++ b/platform/harmony/base.go
@@ -1,7 +1,6 @@
 package harmony
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,10 +9,12 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("harmony.api"))}
+func Init(api string) *Platform {
+	p := &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 	p.client.Headers["Content-Type"] = "application/json"
-	return nil
+	return p
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/icon/base.go b/platform/icon/base.go
index 74c785a..d247899 100644
--- a/platform/icon/base.go
+++ b/platform/icon/base.go
@@ -1,7 +1,6 @@
 package icon
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("icon.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/iotex/base.go b/platform/iotex/base.go
index e9de7da..b7880f7 100644
--- a/platform/iotex/base.go
+++ b/platform/iotex/base.go
@@ -1,7 +1,6 @@
 package iotex
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("iotex.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/nano/base.go b/platform/nano/base.go
index 08cac55..8dfde34 100644
--- a/platform/nano/base.go
+++ b/platform/nano/base.go
@@ -3,18 +3,18 @@ package nano
 import (
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
-
-	"github.com/spf13/viper"
 )
 
 type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("nano.api"))}
+func Init(api string) *Platform {
+	p := &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 	p.client.Headers["Content-Type"] = "application/json"
-	return nil
+	return p
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/nebulas/base.go b/platform/nebulas/base.go
index 2b03679..6d41707 100644
--- a/platform/nebulas/base.go
+++ b/platform/nebulas/base.go
@@ -1,7 +1,6 @@
 package nebulas
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("nebulas.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/nimiq/base.go b/platform/nimiq/base.go
index e64e822..0772b85 100644
--- a/platform/nimiq/base.go
+++ b/platform/nimiq/base.go
@@ -1,7 +1,6 @@
 package nimiq
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("nimiq.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/ontology/base.go b/platform/ontology/base.go
index dd5ce04..cd7945c 100644
--- a/platform/ontology/base.go
+++ b/platform/ontology/base.go
@@ -1,7 +1,6 @@
 package ontology
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	blockatlas "github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("ontology.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/ontology/model.go b/platform/ontology/model.go
index ae54ab7..a5cd55a 100644
--- a/platform/ontology/model.go
+++ b/platform/ontology/model.go
@@ -134,11 +134,22 @@ func (tfs Transfers) isClaimReward() bool {
 	if tfs[0].AssetName != AssetONG || tfs[1].AssetName != AssetONG {
 		return false
 	}
+	// Avoid transactions for yourself
+	if tfs[0].ToAddress == tfs[0].FromAddress || tfs[1].ToAddress == tfs[1].FromAddress {
+		return false
+	}
 	// Verify if one of the transfers is a fee transfer.
 	if !tfs.hasFeeTransfer() {
 		return false
 	}
-	return true
+	// The user need to pay a fee to get his reward
+	if tfs[1].isFeeTransfer() && tfs[0].ToAddress == tfs[1].FromAddress && tfs[1].ToAddress == GovernanceContract {
+		return true
+	}
+	if tfs[0].isFeeTransfer() && tfs[1].ToAddress == tfs[0].FromAddress && tfs[0].ToAddress == GovernanceContract {
+		return false
+	}
+	return false
 
 }
 
diff --git a/platform/platform.go b/platform/platform.go
new file mode 100644
index 0000000..502ab16
--- /dev/null
+++ b/platform/platform.go
@@ -0,0 +1,97 @@
+package platform
+
+import (
+	"fmt"
+	"github.com/spf13/viper"
+	"github.com/trustwallet/blockatlas/coin"
+	"github.com/trustwallet/blockatlas/pkg/blockatlas"
+	"github.com/trustwallet/blockatlas/platform/aeternity"
+	"github.com/trustwallet/blockatlas/platform/aion"
+	"github.com/trustwallet/blockatlas/platform/algorand"
+	"github.com/trustwallet/blockatlas/platform/binance"
+	"github.com/trustwallet/blockatlas/platform/bitcoin"
+	"github.com/trustwallet/blockatlas/platform/cosmos"
+	"github.com/trustwallet/blockatlas/platform/ethereum"
+	"github.com/trustwallet/blockatlas/platform/fio"
+	"github.com/trustwallet/blockatlas/platform/harmony"
+	"github.com/trustwallet/blockatlas/platform/icon"
+	"github.com/trustwallet/blockatlas/platform/iotex"
+	"github.com/trustwallet/blockatlas/platform/nano"
+	"github.com/trustwallet/blockatlas/platform/nebulas"
+	"github.com/trustwallet/blockatlas/platform/nimiq"
+	"github.com/trustwallet/blockatlas/platform/ontology"
+	"github.com/trustwallet/blockatlas/platform/polkadot"
+	"github.com/trustwallet/blockatlas/platform/ripple"
+	"github.com/trustwallet/blockatlas/platform/stellar"
+	"github.com/trustwallet/blockatlas/platform/tezos"
+	"github.com/trustwallet/blockatlas/platform/theta"
+	"github.com/trustwallet/blockatlas/platform/tron"
+	"github.com/trustwallet/blockatlas/platform/vechain"
+	"github.com/trustwallet/blockatlas/platform/waves"
+	"github.com/trustwallet/blockatlas/platform/zilliqa"
+)
+
+func GetVar(name string) string {
+	return viper.GetString(name)
+}
+
+func GetApiVar(coinId uint) string {
+	varName := fmt.Sprintf("%s.api", coin.Coins[coinId].Handle)
+	return GetVar(varName)
+}
+
+func GetRpcVar(coinId uint) string {
+	varName := fmt.Sprintf("%s.rpc", coin.Coins[coinId].Handle)
+	return GetVar(varName)
+}
+
+func getPlatformMap() blockatlas.Platforms {
+	return blockatlas.Platforms{
+		coin.Fio().Handle:          fio.Init(GetApiVar(coin.FIO)),
+		coin.Aion().Handle:         aion.Init(GetApiVar(coin.AION)),
+		coin.Icon().Handle:         icon.Init(GetApiVar(coin.ICX)),
+		coin.Tron().Handle:         tron.Init(GetApiVar(coin.TRX)),
+		coin.Nano().Handle:         nano.Init(GetApiVar(coin.NANO)),
+		coin.Nimiq().Handle:        nimiq.Init(GetApiVar(coin.NIM)),
+		coin.Iotex().Handle:        iotex.Init(GetApiVar(coin.IOTX)),
+		coin.Theta().Handle:        theta.Init(GetApiVar(coin.THETA)),
+		coin.Waves().Handle:        waves.Init(GetApiVar(coin.WAVES)),
+		coin.Ripple().Handle:       ripple.Init(GetApiVar(coin.XRP)),
+		coin.Harmony().Handle:      harmony.Init(GetApiVar(coin.ONE)),
+		coin.Vechain().Handle:      vechain.Init(GetApiVar(coin.VET)),
+		coin.Nebulas().Handle:      nebulas.Init(GetApiVar(coin.NAS)),
+		coin.Ontology().Handle:     ontology.Init(GetApiVar(coin.ONT)),
+		coin.Algorand().Handle:     algorand.Init(GetApiVar(coin.ALGO)),
+		coin.Aeternity().Handle:    aeternity.Init(GetApiVar(coin.AE)),
+		coin.Tezos().Handle:        tezos.Init(GetApiVar(coin.XTZ), GetRpcVar(coin.XTZ)),
+		coin.Binance().Handle:      binance.Init(GetApiVar(coin.BNB), GetVar("binance.dex")),
+		coin.Zilliqa().Handle:      zilliqa.Init(GetApiVar(coin.ZIL), GetVar("zilliqa.key"), GetRpcVar(coin.ZIL), GetVar("zilliqa.lookup")),
+		coin.Kusama().Handle:       polkadot.Init(coin.KSM, GetApiVar(coin.KSM)),
+		coin.Stellar().Handle:      stellar.Init(coin.XLM, GetApiVar(coin.XLM)),
+		coin.Kin().Handle:          stellar.Init(coin.KIN, GetApiVar(coin.KIN)),
+		coin.Cosmos().Handle:       cosmos.Init(coin.ATOM, GetApiVar(coin.ATOM)),
+		coin.Kava().Handle:         cosmos.Init(coin.KAVA, GetApiVar(coin.KAVA)),
+		coin.Bitcoin().Handle:      bitcoin.Init(coin.BTC, GetApiVar(coin.BTC)),
+		coin.Litecoin().Handle:     bitcoin.Init(coin.LTC, GetApiVar(coin.LTC)),
+		coin.Bitcoincash().Handle:  bitcoin.Init(coin.BCH, GetApiVar(coin.BCH)),
+		coin.Zcash().Handle:        bitcoin.Init(coin.ZEC, GetApiVar(coin.ZEC)),
+		coin.Zcoin().Handle:        bitcoin.Init(coin.XZC, GetApiVar(coin.XZC)),
+		coin.Viacoin().Handle:      bitcoin.Init(coin.VIA, GetApiVar(coin.VIA)),
+		coin.Ravencoin().Handle:    bitcoin.Init(coin.RVN, GetApiVar(coin.RVN)),
+		coin.Groestlcoin().Handle:  bitcoin.Init(coin.GRS, GetApiVar(coin.GRS)),
+		coin.Zelcash().Handle:      bitcoin.Init(coin.ZEL, GetApiVar(coin.ZEL)),
+		coin.Decred().Handle:       bitcoin.Init(coin.DCR, GetApiVar(coin.DCR)),
+		coin.Digibyte().Handle:     bitcoin.Init(coin.DGB, GetApiVar(coin.DGB)),
+		coin.Dash().Handle:         bitcoin.Init(coin.DASH, GetApiVar(coin.DASH)),
+		coin.Doge().Handle:         bitcoin.Init(coin.DOGE, GetApiVar(coin.DOGE)),
+		coin.Qtum().Handle:         bitcoin.Init(coin.QTUM, GetApiVar(coin.QTUM)),
+		coin.Gochain().Handle:      ethereum.Init(coin.GO, GetApiVar(coin.GO), GetRpcVar(coin.GO)),
+		coin.Thundertoken().Handle: ethereum.Init(coin.TT, GetApiVar(coin.TT), GetRpcVar(coin.TT)),
+		coin.Classic().Handle:      ethereum.Init(coin.ETC, GetApiVar(coin.ETC), GetRpcVar(coin.ETC)),
+		coin.Poa().Handle:          ethereum.Init(coin.POA, GetApiVar(coin.POA), GetRpcVar(coin.POA)),
+		coin.Callisto().Handle:     ethereum.Init(coin.CLO, GetApiVar(coin.CLO), GetRpcVar(coin.CLO)),
+		coin.Wanchain().Handle:     ethereum.Init(coin.WAN, GetApiVar(coin.WAN), GetRpcVar(coin.WAN)),
+		coin.Tomochain().Handle:    ethereum.Init(coin.TOMO, GetApiVar(coin.TOMO), GetRpcVar(coin.TOMO)),
+		coin.Ethereum().Handle:     ethereum.InitWitCollection(coin.ETH, GetApiVar(coin.ETH), GetRpcVar(coin.ETH), GetVar("ethereum.collections_api"), GetVar("ethereum.collections_api_key")),
+	}
+}
diff --git a/platform/polkadot/base.go b/platform/polkadot/base.go
index e2342dd..65d5357 100644
--- a/platform/polkadot/base.go
+++ b/platform/polkadot/base.go
@@ -1,8 +1,6 @@
 package polkadot
 
 import (
-	"fmt"
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -12,15 +10,13 @@ type Platform struct {
 	CoinIndex uint
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString(p.ConfigKey()))}
-	return nil
+func Init(coin uint, api string) *Platform {
+	return &Platform{
+		CoinIndex: coin,
+		client:    Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
 	return coin.Coins[p.CoinIndex]
 }
-
-func (p *Platform) ConfigKey() string {
-	return fmt.Sprintf("%s.api", p.Coin().Handle)
-}
diff --git a/platform/registry.go b/platform/registry.go
index 35a5165..3c51287 100644
--- a/platform/registry.go
+++ b/platform/registry.go
@@ -5,84 +5,9 @@ import (
 	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 	"github.com/trustwallet/blockatlas/pkg/logger"
-	"github.com/trustwallet/blockatlas/platform/cosmos"
-	"github.com/trustwallet/blockatlas/platform/polkadot"
-
-	"github.com/trustwallet/blockatlas/coin"
-	"github.com/trustwallet/blockatlas/platform/aeternity"
-	"github.com/trustwallet/blockatlas/platform/aion"
-	"github.com/trustwallet/blockatlas/platform/algorand"
-	"github.com/trustwallet/blockatlas/platform/binance"
-	"github.com/trustwallet/blockatlas/platform/bitcoin"
-	"github.com/trustwallet/blockatlas/platform/ethereum"
-	"github.com/trustwallet/blockatlas/platform/fio"
-	"github.com/trustwallet/blockatlas/platform/harmony"
-	"github.com/trustwallet/blockatlas/platform/icon"
-	"github.com/trustwallet/blockatlas/platform/iotex"
-	"github.com/trustwallet/blockatlas/platform/nano"
-	"github.com/trustwallet/blockatlas/platform/nebulas"
-	"github.com/trustwallet/blockatlas/platform/nimiq"
-	"github.com/trustwallet/blockatlas/platform/ontology"
-	"github.com/trustwallet/blockatlas/platform/ripple"
-	"github.com/trustwallet/blockatlas/platform/stellar"
-	"github.com/trustwallet/blockatlas/platform/tezos"
-	"github.com/trustwallet/blockatlas/platform/theta"
-	"github.com/trustwallet/blockatlas/platform/tron"
-	"github.com/trustwallet/blockatlas/platform/vechain"
-	"github.com/trustwallet/blockatlas/platform/waves"
-	"github.com/trustwallet/blockatlas/platform/zilliqa"
 )
 
 var (
-	allPlatformsList = []blockatlas.Platform{
-		&binance.Platform{},
-		&nimiq.Platform{},
-		&ripple.Platform{},
-		&stellar.Platform{CoinIndex: coin.XLM},
-		&stellar.Platform{CoinIndex: coin.KIN},
-		&ethereum.Platform{CoinIndex: coin.ETH},
-		&ethereum.Platform{CoinIndex: coin.ETC},
-		&ethereum.Platform{CoinIndex: coin.POA},
-		&ethereum.Platform{CoinIndex: coin.CLO},
-		&ethereum.Platform{CoinIndex: coin.GO},
-		&ethereum.Platform{CoinIndex: coin.WAN},
-		&ethereum.Platform{CoinIndex: coin.TOMO},
-		&ethereum.Platform{CoinIndex: coin.TT},
-		&cosmos.Platform{CoinIndex: coin.ATOM},
-		&cosmos.Platform{CoinIndex: coin.KAVA},
-		&tezos.Platform{},
-		&aion.Platform{},
-		&icon.Platform{},
-		&iotex.Platform{},
-		&ontology.Platform{},
-		&theta.Platform{},
-		&tron.Platform{},
-		&vechain.Platform{},
-		&zilliqa.Platform{},
-		&waves.Platform{},
-		&aeternity.Platform{},
-		&bitcoin.Platform{CoinIndex: coin.BTC},
-		&bitcoin.Platform{CoinIndex: coin.LTC},
-		&bitcoin.Platform{CoinIndex: coin.BCH},
-		&bitcoin.Platform{CoinIndex: coin.DASH},
-		&bitcoin.Platform{CoinIndex: coin.DOGE},
-		&bitcoin.Platform{CoinIndex: coin.ZEC},
-		&bitcoin.Platform{CoinIndex: coin.XZC},
-		&bitcoin.Platform{CoinIndex: coin.VIA},
-		&bitcoin.Platform{CoinIndex: coin.RVN},
-		&bitcoin.Platform{CoinIndex: coin.QTUM},
-		&bitcoin.Platform{CoinIndex: coin.GRS},
-		&bitcoin.Platform{CoinIndex: coin.ZEL},
-		&bitcoin.Platform{CoinIndex: coin.DCR},
-		&bitcoin.Platform{CoinIndex: coin.DGB},
-		&nebulas.Platform{},
-		&fio.Platform{},
-		&algorand.Platform{},
-		&nano.Platform{},
-		&harmony.Platform{},
-		&polkadot.Platform{CoinIndex: coin.KSM},
-	}
-
 	// Platforms contains all registered platforms by handle
 	Platforms map[string]blockatlas.Platform
 
@@ -102,113 +27,15 @@ var (
 	CollectionAPIs map[uint]blockatlas.CollectionAPI
 )
 
-func getPlatform(handle string) blockatlas.Platform {
-	switch handle {
-	case coin.Binance().Handle:
-		return &binance.Platform{}
-	case coin.Nimiq().Handle:
-		return &nimiq.Platform{}
-	case coin.Ripple().Handle:
-		return &ripple.Platform{}
-	case coin.Stellar().Handle:
-		return &stellar.Platform{CoinIndex: coin.XLM}
-	case coin.Kin().Handle:
-		return &stellar.Platform{CoinIndex: coin.KIN}
-	case coin.Ethereum().Handle:
-		return &ethereum.Platform{CoinIndex: coin.ETH}
-	case coin.Classic().Handle:
-		return &ethereum.Platform{CoinIndex: coin.ETC}
-	case coin.Poa().Handle:
-		return &ethereum.Platform{CoinIndex: coin.POA}
-	case coin.Callisto().Handle:
-		return &ethereum.Platform{CoinIndex: coin.CLO}
-	case coin.Gochain().Handle:
-		return &ethereum.Platform{CoinIndex: coin.GO}
-	case coin.Wanchain().Handle:
-		return &ethereum.Platform{CoinIndex: coin.WAN}
-	case coin.Tomochain().Handle:
-		return &ethereum.Platform{CoinIndex: coin.TOMO}
-	case coin.Thundertoken().Handle:
-		return &ethereum.Platform{CoinIndex: coin.TT}
-	case coin.Cosmos().Handle:
-		return &cosmos.Platform{CoinIndex: coin.ATOM}
-	case coin.Kava().Handle:
-		return &cosmos.Platform{CoinIndex: coin.KAVA}
-	case coin.Tezos().Handle:
-		return &tezos.Platform{}
-	case coin.Aion().Handle:
-		return &aion.Platform{}
-	case coin.Icon().Handle:
-		return &icon.Platform{}
-	case coin.Iotex().Handle:
-		return &iotex.Platform{}
-	case coin.Ontology().Handle:
-		return &ontology.Platform{}
-	case coin.Theta().Handle:
-		return &theta.Platform{}
-	case coin.Tron().Handle:
-		return &tron.Platform{}
-	case coin.Vechain().Handle:
-		return &vechain.Platform{}
-	case coin.Zilliqa().Handle:
-		return &zilliqa.Platform{}
-	case coin.Waves().Handle:
-		return &waves.Platform{}
-	case coin.Aeternity().Handle:
-		return &aeternity.Platform{}
-	case coin.Bitcoin().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.BTC}
-	case coin.Litecoin().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.LTC}
-	case coin.Bitcoincash().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.BCH}
-	case coin.Dash().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.DASH}
-	case coin.Doge().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.DOGE}
-	case coin.Zcash().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.ZEC}
-	case coin.Zcoin().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.XZC}
-	case coin.Viacoin().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.VIA}
-	case coin.Ravencoin().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.RVN}
-	case coin.Qtum().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.QTUM}
-	case coin.Groestlcoin().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.GRS}
-	case coin.Zelcash().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.ZEL}
-	case coin.Decred().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.DCR}
-	case coin.Digibyte().Handle:
-		return &bitcoin.Platform{CoinIndex: coin.DGB}
-	case coin.Nebulas().Handle:
-		return &nebulas.Platform{}
-	case coin.Fio().Handle:
-		return &fio.Platform{}
-	case coin.Algorand().Handle:
-		return &algorand.Platform{}
-	case coin.Nano().Handle:
-		return &nano.Platform{}
-	case coin.Harmony().Handle:
-		return &harmony.Platform{}
-	case coin.Kusama().Handle:
-		return &polkadot.Platform{CoinIndex: coin.KSM}
-	default:
-		return nil
-	}
-}
-
 func getActivePlatforms(handle string) []blockatlas.Platform {
 	logger.Info("Loaded with: ", logger.Params{"handle": handle})
 
-	platform := getPlatform(handle)
-	if platform != nil {
+	platforms := getPlatformMap()
+	platform, ok := platforms[handle]
+	if ok {
 		return []blockatlas.Platform{platform}
 	}
-	return allPlatformsList
+	return platforms.GetPlatformList()
 }
 
 func Init(platformHandle string) {
@@ -240,14 +67,7 @@ func Init(platformHandle string) {
 		if _, exists := Platforms[handle]; exists {
 			logger.Fatal("Duplicate handle", p)
 		}
-
-		err := platform.Init()
-		if err != nil {
-			logger.Error("Failed to initialize API", err, p)
-		}
-
 		Platforms[handle] = platform
-
 		if blockAPI, ok := platform.(blockatlas.BlockAPI); ok {
 			BlockAPIs[handle] = blockAPI
 		}
diff --git a/platform/ripple/base.go b/platform/ripple/base.go
index 83be177..ea0dfc2 100644
--- a/platform/ripple/base.go
+++ b/platform/ripple/base.go
@@ -1,7 +1,6 @@
 package ripple
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("ripple.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/ripple/client.go b/platform/ripple/client.go
index 5e8ec70..b2d0800 100644
--- a/platform/ripple/client.go
+++ b/platform/ripple/client.go
@@ -13,7 +13,7 @@ type Client struct {
 func (c *Client) GetTxsOfAddress(address string) ([]Tx, error) {
 	query := url.Values{
 		"type":       {"Payment"},
-		"descending": {"true"},
+		"descending": {"false"},
 		"limit":      {"200"},
 	}
 	uri := fmt.Sprintf("accounts/%s/transactions", url.PathEscape(address))
diff --git a/platform/stellar/base.go b/platform/stellar/base.go
index 67a7ec7..fe4be7c 100644
--- a/platform/stellar/base.go
+++ b/platform/stellar/base.go
@@ -1,8 +1,6 @@
 package stellar
 
 import (
-	"fmt"
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -12,11 +10,11 @@ type Platform struct {
 	CoinIndex uint
 }
 
-func (p *Platform) Init() error {
-	handle := coin.Coins[p.CoinIndex].Handle
-	api := fmt.Sprintf("%s.api", handle)
-	p.client = Client{blockatlas.InitClient(viper.GetString(api))}
-	return nil
+func Init(coin uint, api string) *Platform {
+	return &Platform{
+		CoinIndex: coin,
+		client:    Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/tezos/base.go b/platform/tezos/base.go
index 0aad538..bbb3e1c 100644
--- a/platform/tezos/base.go
+++ b/platform/tezos/base.go
@@ -1,7 +1,6 @@
 package tezos
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -11,11 +10,13 @@ type Platform struct {
 	rpcClient RpcClient
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("tezos.api"))}
+func Init(api, rpc string) *Platform {
+	p := &Platform{
+		client:    Client{blockatlas.InitClient(api)},
+		rpcClient: RpcClient{blockatlas.InitClient(rpc)},
+	}
 	p.client.SetTimeout(35)
-	p.rpcClient = RpcClient{blockatlas.InitClient(viper.GetString("tezos.rpc"))}
-	return nil
+	return p
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/theta/base.go b/platform/theta/base.go
index c7db94c..317bdcd 100644
--- a/platform/theta/base.go
+++ b/platform/theta/base.go
@@ -1,7 +1,6 @@
 package theta
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("theta.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/tron/base.go b/platform/tron/base.go
index c713d98..24c15a0 100644
--- a/platform/tron/base.go
+++ b/platform/tron/base.go
@@ -1,7 +1,6 @@
 package tron
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("tron.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/vechain/base.go b/platform/vechain/base.go
index 2b66085..3b5dfa4 100644
--- a/platform/vechain/base.go
+++ b/platform/vechain/base.go
@@ -1,7 +1,6 @@
 package vechain
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("vechain.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/waves/base.go b/platform/waves/base.go
index 6715d90..26897e9 100644
--- a/platform/waves/base.go
+++ b/platform/waves/base.go
@@ -1,7 +1,6 @@
 package waves
 
 import (
-	"github.com/spf13/viper"
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
 )
@@ -10,9 +9,10 @@ type Platform struct {
 	client Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("waves.api"))}
-	return nil
+func Init(api string) *Platform {
+	return &Platform{
+		client: Client{blockatlas.InitClient(api)},
+	}
 }
 
 func (p *Platform) Coin() coin.Coin {
diff --git a/platform/zilliqa/base.go b/platform/zilliqa/base.go
index 5a0550e..44602f8 100644
--- a/platform/zilliqa/base.go
+++ b/platform/zilliqa/base.go
@@ -3,8 +3,6 @@ package zilliqa
 import (
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
-
-	"github.com/spf13/viper"
 )
 
 type Platform struct {
@@ -13,13 +11,14 @@ type Platform struct {
 	udClient  Client
 }
 
-func (p *Platform) Init() error {
-	p.client = Client{blockatlas.InitClient(viper.GetString("zilliqa.api"))}
-	p.client.Headers["X-APIKEY"] = viper.GetString("zilliqa.key")
-
-	p.rpcClient = RpcClient{blockatlas.InitClient(viper.GetString("zilliqa.rpc"))}
-	p.udClient = Client{blockatlas.InitClient(viper.GetString("zilliqa.lookup"))}
-	return nil
+func Init(api, apiKey, rpc, udClient string) *Platform {
+	p := &Platform{
+		client:    Client{blockatlas.InitClient(api)},
+		rpcClient: RpcClient{blockatlas.InitClient(rpc)},
+		udClient:  Client{blockatlas.InitClient(udClient)},
+	}
+	p.client.Headers["X-APIKEY"] = apiKey
+	return p
 }
 
 func (p *Platform) Coin() coin.Coin {


Test patch:
diff --git a/pkg/blockatlas/platform_test.go b/pkg/blockatlas/platform_test.go
new file mode 100644
index 0000000..5cafdb6
--- /dev/null
+++ b/pkg/blockatlas/platform_test.go
@@ -0,0 +1,45 @@
+package blockatlas
+
+import (
+	"reflect"
+	"testing"
+)
+
+func TestPlatforms_GetPlatformList(t *testing.T) {
+	var p Platform
+	tests := []struct {
+		name string
+		ps   Platforms
+		want []Platform
+	}{
+		{
+			"test 1",
+			Platforms{
+				"test1": p,
+				"test2": p,
+				"test3": p,
+			},
+			[]Platform{p, p, p},
+		}, {
+			"test 2",
+			Platforms{
+				"test1": p,
+				"test2": p,
+			},
+			[]Platform{p, p},
+		}, {
+			"test 3",
+			Platforms{
+				"test1": p,
+			},
+			[]Platform{p},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			if got := tt.ps.GetPlatformList(); !reflect.DeepEqual(got, tt.want) {
+				t.Errorf("GetPlatformList() = %v, want %v", got, tt.want)
+			}
+		})
+	}
+}
diff --git a/pkg/tests/integration/bitcoin/block.go b/pkg/tests/integration/bitcoin/block.go
index 26fcddb..3237b43 100755
--- a/pkg/tests/integration/bitcoin/block.go
+++ b/pkg/tests/integration/bitcoin/block.go
@@ -3,6 +3,8 @@
 package bitcoin
 
 import (
+	"github.com/trustwallet/blockatlas/coin"
+	"github.com/trustwallet/blockatlas/platform"
 	"github.com/trustwallet/blockatlas/platform/bitcoin"
 	"testing"
 )
@@ -13,8 +15,7 @@ const (
 
 func TestBitcoin(t *testing.T) {
 	t.Run("test bitcoin", func(t *testing.T) {
-		p := &bitcoin.Platform{}
-		_ = p.Init()
+		p := bitcoin.Init(coin.BTC, platform.GetApiVar(coin.BTC))
 		testCurrentBlockNumber(p, t)
 		testGetBlockByNumber(p, t)
 	})
diff --git a/pkg/tests/integration/ontology/block.go b/pkg/tests/integration/ontology/block.go
index 2238b0a..d5c01b1 100755
--- a/pkg/tests/integration/ontology/block.go
+++ b/pkg/tests/integration/ontology/block.go
@@ -5,6 +5,7 @@ package ontology
 import (
 	"github.com/trustwallet/blockatlas/coin"
 	"github.com/trustwallet/blockatlas/pkg/blockatlas"
+	"github.com/trustwallet/blockatlas/platform"
 	"github.com/trustwallet/blockatlas/platform/ontology"
 	"testing"
 )
@@ -81,8 +82,7 @@ const (
 
 func TestOntology(t *testing.T) {
 	t.Run("test ontology", func(t *testing.T) {
-		p := &ontology.Platform{}
-		_ = p.Init()
+		p := ontology.Init(platform.GetVar("ontology.api"))
 		testCurrentBlockNumber(p, t)
 		testGetBlockByNumber(p, t)
 	})
diff --git a/pkg/tests/postman/Blockatlas.postman_collection.json b/pkg/tests/postman/Blockatlas.postman_collection.json
index ad9a8fe..d30fd67 100644
--- a/pkg/tests/postman/Blockatlas.postman_collection.json
+++ b/pkg/tests/postman/Blockatlas.postman_collection.json
@@ -1,7 +1,7 @@
 {
 	"info": {
-		"_postman_id": "b31e9564-879c-4fb0-ad27-986070bc06a0",
-		"name": "Blockatlas",
+		"_postman_id": "4e4d72ba-02c4-4d87-af91-ea42b6225ee4",
+		"name": "Blockatlas вум",
 		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
 	},
 	"item": [
@@ -1598,124 +1598,6 @@
 		{
 			"name": "market",
 			"item": [
-				{
-					"name": "ticker",
-					"event": [
-						{
-							"listen": "prerequest",
-							"script": {
-								"id": "7312c9e7-5330-421a-9ca8-171101050e38",
-								"exec": [
-									"var token_id = pm.environment.get(\"token_id\");",
-									"if(!token_id) {",
-									"    pm.environment.set(\"token_id\", \"\");",
-									"}",
-									""
-								],
-								"type": "text/javascript"
-							}
-						},
-						{
-							"listen": "test",
-							"script": {
-								"id": "acec8baa-0ef0-4703-ab83-c555260deffa",
-								"exec": [
-									"var Ajv = require('ajv');",
-									"var ajv = new Ajv({logger: console});",
-									"let schema = {",
-									"  \"type\": \"object\",",
-									"  \"properties\": {",
-									"    \"coin\": {",
-									"      \"type\": \"integer\"",
-									"    },",
-									"    \"coin_name\": {",
-									"      \"type\": \"string\"",
-									"    },",
-									"    \"token_id\": {",
-									"      \"type\": \"string\"",
-									"    },",
-									"    \"type\": {",
-									"      \"type\": \"string\"",
-									"    },",
-									"    \"price\": {",
-									"      \"type\": \"object\",",
-									"      \"properties\": {",
-									"        \"value\": {",
-									"          \"type\": \"number\"",
-									"        },",
-									"        \"change_24h\": {",
-									"          \"type\": \"number\"",
-									"        },",
-									"        \"currency\": {",
-									"          \"type\": \"string\"",
-									"        },",
-									"        \"provider\": {",
-									"          \"type\": \"string\"",
-									"        }",
-									"      }",
-									"    },",
-									"    \"last_update\": {",
-									"      \"type\": \"string\"",
-									"    }",
-									"  }",
-									"};",
-									"",
-									"var jsonData = pm.response.json();",
-									"",
-									"pm.test(\"response must be valid and have a body\", function () {",
-									"    pm.response.to.have.status(200);",
-									"    pm.response.to.be.ok;",
-									"    pm.response.to.not.be.error;",
-									"    pm.response.to.be.withBody;",
-									"    pm.response.to.be.json;",
-									"});",
-									"",
-									"pm.test(\"schema is valid\", function() {",
-									"    pm.expect(ajv.validate(schema, jsonData)).to.be.true;",
-									"});",
-									""
-								],
-								"type": "text/javascript"
-							}
-						}
-					],
-					"request": {
-						"method": "GET",
-						"header": [
-							{
-								"key": "Authorization",
-								"type": "text",
-								"value": "Bearer {{market_auth}}"
-							}
-						],
-						"url": {
-							"raw": "{{host}}/v1/market/ticker?currency={{currency}}&coin={{coin}}&token={{token_id}}",
-							"host": [
-								"{{host}}"
-							],
-							"path": [
-								"v1",
-								"market",
-								"ticker"
-							],
-							"query": [
-								{
-									"key": "currency",
-									"value": "{{currency}}"
-								},
-								{
-									"key": "coin",
-									"value": "{{coin}}"
-								},
-								{
-									"key": "token",
-									"value": "{{token_id}}"
-								}
-							]
-						}
-					},
-					"response": []
-				},
 				{
 					"name": "charts",
 					"event": [
@@ -2275,93 +2157,6 @@
 						}
 					},
 					"response": []
-				},
-				{
-					"name": "status",
-					"event": [
-						{
-							"listen": "prerequest",
-							"script": {
-								"id": "7312c9e7-5330-421a-9ca8-171101050e38",
-								"exec": [
-									""
-								],
-								"type": "text/javascript"
-							}
-						},
-						{
-							"listen": "test",
-							"script": {
-								"id": "acec8baa-0ef0-4703-ab83-c555260deffa",
-								"exec": [
-									"var Ajv = require('ajv');",
-									"var ajv = new Ajv({logger: console});",
-									"let schema = {",
-									"  \"type\": \"object\",",
-									"  \"minProperties\": 5,",
-									"  \"uniqueItems\": true,",
-									"  \"items\": {\"type\": \"object\"}",
-									"};",
-									"",
-									"var jsonData = pm.response.json();",
-									"",
-									"pm.test(\"response must be valid and have a body\", function () {",
-									"    pm.response.to.have.status(200);",
-									"    pm.response.to.be.ok;",
-									"    pm.response.to.not.be.error;",
-									"    pm.response.to.be.withBody;",
-									"    pm.response.to.be.json;",
-									"});",
-									"",
-									"pm.test(\"schema is valid\", function() {",
-									"    pm.expect(ajv.validate(schema, jsonData)).to.be.true;",
-									"});",
-									""
-								],
-								"type": "text/javascript"
-							}
-						}
-					],
-					"protocolProfileBehavior": {
-						"disableBodyPruning": true
-					},
-					"request": {
-						"method": "GET",
-						"header": [
-							{
-								"key": "Authorization",
-								"type": "text",
-								"value": "Bearer {{observer_auth}}"
-							},
-							{
-								"key": "Content-Type",
-								"name": "Content-Type",
-								"type": "text",
-								"value": "application/json"
-							}
-						],
-						"body": {
-							"mode": "raw",
-							"raw": "",
-							"options": {
-								"raw": {
-									"language": "json"
-								}
-							}
-						},
-						"url": {
-							"raw": "{{host}}/observer/v1/status",
-							"host": [
-								"{{host}}"
-							],
-							"path": [
-								"observer",
-								"v1",
-								"status"
-							]
-						}
-					},
-					"response": []
 				}
 			],
 			"event": [
@@ -2571,25 +2366,25 @@
 	],
 	"variable": [
 		{
-			"id": "7e392582-2f75-48a2-a096-ef338490e7f8",
+			"id": "ad2326b7-fb90-4b11-a1e3-dfe8ea3aae65",
 			"key": "host",
 			"value": "http://localhost:8420",
 			"type": "string"
 		},
 		{
-			"id": "39dad5f8-9727-4dda-9f27-b4e29dd0ff18",
+			"id": "7ae1014f-44e1-4c16-aacd-2be971ee15ef",
 			"key": "observer_auth",
 			"value": "test",
 			"type": "string"
 		},
 		{
-			"id": "edc48bc9-0c39-46a1-809a-c6d71874a958",
+			"id": "0d3dcacb-5b63-409a-8150-9e06d24e1eb4",
 			"key": "market_auth",
 			"value": "",
 			"type": "string"
 		},
 		{
-			"id": "2ee77821-80ac-470a-9293-78b361ef27c7",
+			"id": "c42f8723-ad35-45ea-9dd2-066ced0780bc",
 			"key": "platform_auth",
 			"value": "",
 			"type": "string"
diff --git a/pkg/tests/postman/transaction_data.json b/pkg/tests/postman/transaction_data.json
index 6818b82..4c580ca 100644
--- a/pkg/tests/postman/transaction_data.json
+++ b/pkg/tests/postman/transaction_data.json
@@ -117,7 +117,7 @@
     },
     {
         "handler": "waves",
-        "address": "3P7wz6TXienpw3BHe8eHUEuZWb6WE58kgnQ"
+        "address": "3PJ4q4sqriJs2y7Z45wmbLrbmV9MDecbPxD"
     },
     {
         "handler": "digibyte",
diff --git a/platform/ontology/model_test.go b/platform/ontology/model_test.go
index 72b03d3..b67322b 100644
--- a/platform/ontology/model_test.go
+++ b/platform/ontology/model_test.go
@@ -37,6 +37,40 @@ func TestTransfer_isFeeTransfer(t *testing.T) {
 }
 
 var (
+	transfersClaims2 = Transfers{{
+		Amount:      "0.4",
+		FromAddress: "AFmseVrdL9f9oyCzZefL9tG6UbvhUMqNMV",
+		ToAddress:   "AUyL4TZ1zFEcSKDJrjFnD7vsq5iFZMZqT7",
+		AssetName:   "ong",
+	}, {
+		Amount:      "0.01",
+		FromAddress: "AUyL4TZ1zFEcSKDJrjFnD7vsq5iFZMZqT7",
+		ToAddress:   "AFmseVrdL9f9oyCzZefL9tG6UbviEH9ugK",
+		AssetName:   "ong",
+	}}
+	transfersOngYourself = Transfers{{
+		Amount:      "0.02",
+		FromAddress: "AUyL4TZ1zFEcSKDJrjFnD7vsq5iFZMZqT7",
+		ToAddress:   "AUyL4TZ1zFEcSKDJrjFnD7vsq5iFZMZqT7",
+		AssetName:   "ong",
+	}, {
+		Amount:      "0.01",
+		FromAddress: "AUyL4TZ1zFEcSKDJrjFnD7vsq5iFZMZqT7",
+		ToAddress:   "AFmseVrdL9f9oyCzZefL9tG6UbviEH9ugK",
+		AssetName:   "ong",
+	}}
+	transfersOng2 = Transfers{{
+		Amount:      "0.4",
+		FromAddress: "AUyL4TZ1zFEcSKDJrjFnD7vsq5iFZMZqT7",
+		ToAddress:   "Abm1FqnU4qur9bviXmrD5YnNixXGvMsi9R",
+		AssetName:   "ong",
+	}, {
+		Amount:      "0.01",
+		FromAddress: "AUyL4TZ1zFEcSKDJrjFnD7vsq5iFZMZqT7",
+		ToAddress:   "AFmseVrdL9f9oyCzZefL9tG6UbviEH9ugK",
+		AssetName:   "ong",
+	}}
+
 	transferFee = Transfer{
 		Amount:      "0.01",
 		FromAddress: "ARFXGXSmgFT2h9EiS4D5fen127Lzi48Eij",
@@ -55,10 +89,10 @@ var (
 		ToAddress:   "ARncJn1rr9hivokUWxzr915vS3usR6xdgJ",
 		AssetName:   "ont",
 	}
-	transfersClaims = Transfers{transferOng, transferFee}
-	transfersOnt    = Transfers{transferOnt, transferFee}
-	transfersOng    = Transfers{transferOng}
-	transfersFee    = Transfers{transferFee}
+	transfersClaims1 = Transfers{transferOng, transferFee}
+	transfersOnt     = Transfers{transferOnt, transferFee}
+	transfersOng1    = Transfers{transferOng}
+	transfersFee     = Transfers{transferFee}
 )
 
 func TestTransfers_getTransfer(t *testing.T) {
@@ -68,15 +102,15 @@ func TestTransfers_getTransfer(t *testing.T) {
 		asset AssetType
 		want  *Transfer
 	}{
-		{"Transfer Claims Asset Ong", transfersClaims, AssetONG, &transferOng},
-		{"Transfer Claims Asset Ont", transfersClaims, AssetONT, nil},
-		{"Transfer Claims Asset All", transfersClaims, AssetAll, &transferOng},
+		{"Transfer Claims Asset Ong", transfersClaims1, AssetONG, &transferOng},
+		{"Transfer Claims Asset Ont", transfersClaims1, AssetONT, nil},
+		{"Transfer Claims Asset All", transfersClaims1, AssetAll, &transferOng},
 		{"Transfer Ont Asset Ong", transfersOnt, AssetONG, nil},
 		{"Transfer Ont Asset Ont", transfersOnt, AssetONT, &transferOnt},
 		{"Transfer Ont Asset All", transfersOnt, AssetAll, &transferOnt},
-		{"Transfer Ong Asset Ong", transfersOng, AssetONG, &transferOng},
-		{"Transfer Ong Asset Ont", transfersOng, AssetONT, nil},
-		{"Transfer Ong Asset All", transfersOng, AssetAll, &transferOng},
+		{"Transfer Ong Asset Ong", transfersOng1, AssetONG, &transferOng},
+		{"Transfer Ong Asset Ont", transfersOng1, AssetONT, nil},
+		{"Transfer Ong Asset All", transfersOng1, AssetAll, &transferOng},
 		{"Transfer Fee Asset Ong", transfersFee, AssetONG, nil},
 		{"Transfer Fee Asset Ont", transfersFee, AssetONT, nil},
 		{"Transfer Fee Asset All", transfersFee, AssetAll, nil},
@@ -96,9 +130,12 @@ func TestTransfers_hasFeeTransfer(t *testing.T) {
 		tfs  Transfers
 		want bool
 	}{
-		{"Transfer Claims", transfersClaims, true},
+		{"Transfer Claims 1", transfersClaims1, true},
+		{"Transfer Calims 2", transfersClaims2, true},
 		{"Transfer Ont", transfersOnt, true},
-		{"Transfer Ong", transfersOng, false},
+		{"Transfer Ong 1", transfersOng1, false},
+		{"Transfer Ong 2", transfersOng2, true},
+		{"Transfer Ong Yourself ", transfersOngYourself, true},
 		{"Transfer Fee", transfersFee, true},
 	}
 	for _, tt := range tests {
@@ -116,9 +153,12 @@ func TestTransfers_isClaimReward(t *testing.T) {
 		tfs  Transfers
 		want bool
 	}{
-		{"Transfer Claims", transfersClaims, true},
+		{"Transfer Claims 1", transfersClaims1, true},
+		{"Transfer Claims 2", transfersClaims2, true},
 		{"Transfer Ont", transfersOnt, false},
-		{"Transfer Ong", transfersOng, false},
+		{"Transfer Ong 1", transfersOng1, false},
+		{"Transfer Ong 2", transfersOng2, false},
+		{"Transfer Ong Yourself", transfersOngYourself, false},
 		{"Transfer Fee", transfersFee, false},
 	}
 	for _, tt := range tests {
diff --git a/platform/ontology/transaction_test.go b/platform/ontology/transaction_test.go
index 2312fc5..fc31822 100644
--- a/platform/ontology/transaction_test.go
+++ b/platform/ontology/transaction_test.go
@@ -289,6 +289,6 @@ func TestNormalizeBlock(t *testing.T) {
 	if err != nil {
 		t.Fatal(err)
 	}
-	want := `[{"id":"266d9d7282a5601bf6cb8fc5368a76a2aa54f45731a063a699a692487bcbd0cb","coin":1024,"from":"AbEeCHUWpzQaxUN7G1a83N3P2XtVLuMLaE","to":"ASLbwuar3ZTbUbLPnCgjGUw2WHhMfvJJtx","fee":"10000000","date":1580481541,"block":7707834,"status":"completed","type":"any_action","memo":"","metadata":{"coin":1024,"title":"Claim Rewards","key":"stake_claim_rewards","token_id":"ong","name":"Ontology Gas","symbol":"ONG","decimals":9,"value":"51000000000000"}},{"id":"2935268c5715f1f2015ba828681c39399dedbe7a24ed628ef7b85d9aac8045fd","coin":1024,"from":"ANdrA47zDXUu8MCkMdD3FYPmpSNGYeAvKz","to":"ASLbwuar3ZTbUbLPnCgjGUw2WHhMfvJJtx","fee":"10000000","date":1580481541,"block":7707834,"status":"completed","type":"transfer","memo":"","metadata":{"value":"113.2","symbol":"ONT","decimals":0}},{"id":"40976edc1306b0e5f55b90c8d3ca248bb544e5ebbadb02be6146ba0a0de402c3","coin":1024,"from":"Abg2gs6pfpQu82jXbm8EYGiipRBvf9ktVS","to":"ASLbwuar3ZTbUbLPnCgjGUw2WHhMfvJJtx","fee":"10000000","date":1580481541,"block":7707834,"status":"completed","type":"transfer","memo":"","metadata":{"value":"10949","symbol":"ONT","decimals":0}}]`
+	want := `[{"id":"266d9d7282a5601bf6cb8fc5368a76a2aa54f45731a063a699a692487bcbd0cb","coin":1024,"from":"AbEeCHUWpzQaxUN7G1a83N3P2XtVLuMLaE","to":"ASLbwuar3ZTbUbLPnCgjGUw2WHhMfvJJtx","fee":"10000000","date":1580481541,"block":7707834,"status":"completed","type":"native_token_transfer","memo":"","metadata":{"name":"Ontology Gas","symbol":"ONG","token_id":"ong","decimals":9,"value":"51000000000000","from":"AbEeCHUWpzQaxUN7G1a83N3P2XtVLuMLaE","to":"ASLbwuar3ZTbUbLPnCgjGUw2WHhMfvJJtx"}},{"id":"2935268c5715f1f2015ba828681c39399dedbe7a24ed628ef7b85d9aac8045fd","coin":1024,"from":"ANdrA47zDXUu8MCkMdD3FYPmpSNGYeAvKz","to":"ASLbwuar3ZTbUbLPnCgjGUw2WHhMfvJJtx","fee":"10000000","date":1580481541,"block":7707834,"status":"completed","type":"transfer","memo":"","metadata":{"value":"113.2","symbol":"ONT","decimals":0}},{"id":"40976edc1306b0e5f55b90c8d3ca248bb544e5ebbadb02be6146ba0a0de402c3","coin":1024,"from":"Abg2gs6pfpQu82jXbm8EYGiipRBvf9ktVS","to":"ASLbwuar3ZTbUbLPnCgjGUw2WHhMfvJJtx","fee":"10000000","date":1580481541,"block":7707834,"status":"completed","type":"transfer","memo":"","metadata":{"value":"10949","symbol":"ONT","decimals":0}}]`
 	assert.Equal(t, want, string(got))
 }