Skip to content

Commit

Permalink
Update tokenlist path getting (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
unanoc authored Jan 27, 2022
1 parent c8863a7 commit 935a618
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions path/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@ import (
"github.com/trustwallet/go-primitives/types"
)

func GetTokenListPath(chain string) string {
return fmt.Sprintf("blockchains/%s/tokenlist.json", chain)
}
type TokenListType int

const (
TokenlistDefault = iota
TokenlistExtended
)

func GetTokenListPath(chain string, tokenlistType TokenListType) string {
switch tokenlistType {
case TokenlistDefault:
return fmt.Sprintf("blockchains/%s/tokenlist.json", chain)
case TokenlistExtended:
return fmt.Sprintf("blockchains/%s/tokenlist-extended.json", chain)
}

func GetTokenListExtendedPath(chain string) string {
return fmt.Sprintf("blockchains/%s/tokenlist-extended.json", chain)
return ""
}

func GetAssetPath(chain, tokenID string) string {
Expand Down

0 comments on commit 935a618

Please sign in to comment.