Skip to content

Commit

Permalink
add SPL token (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
hewigovens authored Dec 10, 2020
1 parent 6571700 commit 80f2f55
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tokentype/tokentype.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package tokentype
import "github.com/trustwallet/golibs/coin"

type (
Type string
Type string
)

const (
Coin Type = "coin"
Gas Type = "gas"
Coin Type = "coin"
Gas Type = "gas"
ERC20 Type = "ERC20"
BEP2 Type = "BEP2"
BEP8 Type = "BEP8"
Expand All @@ -22,7 +22,8 @@ const (
GO20 Type = "G020"
WAN20 Type = "WAN20"
TT20 Type = "TT20"
KAVA Type = "KAVA"
KAVA Type = "KAVA"
SPL Type = "SPL"
)

func GetEthereumTokenTypeByIndex(coinIndex uint) Type {
Expand All @@ -46,9 +47,10 @@ func GetEthereumTokenTypeByIndex(coinIndex uint) Type {
tokenType = TRC21
case coin.Bsc().ID, coin.Smartchain().ID:
tokenType = BEP20
case coin.Solana().ID:
tokenType = SPL
default:
tokenType = ERC20
}
return tokenType
}

0 comments on commit 80f2f55

Please sign in to comment.