From 9d263b3aaf24f807ef0bc8c3871391060a21b023 Mon Sep 17 00:00:00 2001 From: bonedaddy Date: Thu, 25 Mar 2021 19:09:36 -0700 Subject: [PATCH] fix invalid asset error and returning correct decimals --- bclient/uniswap.go | 4 ++++ db/asset.go | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bclient/uniswap.go b/bclient/uniswap.go index b0bc27d..6f2746b 100644 --- a/bclient/uniswap.go +++ b/bclient/uniswap.go @@ -232,6 +232,10 @@ func (c *Client) PairDecimals(pair string) int { return 18 case "eth-degen10", "eth-degen": return 18 + case "nftp-eth": + return 18 + case "eth-nftp": + return 18 default: return 0 } diff --git a/db/asset.go b/db/asset.go index 3b45489..47331fb 100644 --- a/db/asset.go +++ b/db/asset.go @@ -22,6 +22,7 @@ var ( Asset("ETH"), Asset("ORCL5"), Asset("DEGEN10"), + Asset("NFTP"), } // ErrInvalidAsset is an error returned when the given asset specified is invalid ErrInvalidAsset = errors.New("invalid asset") @@ -30,7 +31,7 @@ var ( // IsValidAsset determines whether or not the given asset is one we are tracking func IsValidAsset(asset string) bool { switch strings.ToLower(asset) { - case "ndx", "defi5", "cc10", "orcl5", "eth", "degen10": + case "ndx", "defi5", "cc10", "orcl5", "eth", "degen10", "nftp": return true default: return false