Skip to content

Commit

Permalink
Add BounceBit support
Browse files Browse the repository at this point in the history
  • Loading branch information
yasssuz committed Jun 1, 2024
1 parent 7588e65 commit 4259385
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 118 deletions.
264 changes: 146 additions & 118 deletions coin/coins.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions coin/coins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1045,3 +1045,11 @@
decimals: 8
blockchain: Internet Computer
isTokenSupported: false

- id: 6001
symbol: BB
handle: bouncebit
name: BounceBit
decimals: 18
blockchain: Ethereum
isTokenSupported: false
2 changes: 2 additions & 0 deletions types/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ func GetChainFromAssetType(assetType string) (coin.Coin, error) {
return coin.Scroll(), nil
case ICP:
return coin.Internet_computer(), nil
case BOUNCEBIT:
return coin.Bouncebit(), nil
}

return coin.Coin{}, errors.New("unknown asset type: " + assetType)
Expand Down
9 changes: 9 additions & 0 deletions types/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const (
BLAST TokenType = "BLAST"
SCROLL TokenType = "SCROLL"
ICP TokenType = "ICP"
BOUNCEBIT TokenType = "BOUNCEBIT"
)

const (
Expand All @@ -142,6 +143,7 @@ const (
TokenVersionV16 TokenVersion = 16
TokenVersionV17 TokenVersion = 17
TokenVersionV18 TokenVersion = 18
TokenVersionV19 TokenVersion = 19
TokenVersionUndefined TokenVersion = -1
)

Expand Down Expand Up @@ -235,6 +237,7 @@ func GetTokenTypes() []TokenType {
BLAST,
SCROLL,
ICP,
BOUNCEBIT,
}
}

Expand Down Expand Up @@ -352,6 +355,8 @@ func GetTokenType(c uint, tokenID string) (string, bool) {
return string(SCROLL), true
case coin.INTERNET_COMPUTER:
return string(ICP), true
case coin.BOUNCEBIT:
return string(BOUNCEBIT), true
default:
return "", false
}
Expand Down Expand Up @@ -411,6 +416,8 @@ func GetTokenVersion(tokenType string) (TokenVersion, error) {
return TokenVersionV17, nil
case BLAST, SCROLL:
return TokenVersionV18, nil
case BOUNCEBIT:
return TokenVersionV19, nil
case ERC721, ERC1155, EOS, NEP5, VET, ONTOLOGY, THETA, TOMO, POA, OASIS, ALGORAND, METER, EVMOS_ERC20,
KIP20, STRIDE, NEUTRON, FA2, CARDANO, NATIVEEVMOS, CRYPTOORG, COSMOS, OSMOSIS, STARGAZE:
return TokenVersionUndefined, nil
Expand Down Expand Up @@ -530,6 +537,8 @@ func GetEthereumTokenTypeByIndex(coinIndex uint) (TokenType, error) {
tokenType = BLAST
case coin.SCROLL:
tokenType = SCROLL
case coin.BOUNCEBIT:
tokenType = BOUNCEBIT
}

if tokenType == "" {
Expand Down
Loading

0 comments on commit 4259385

Please sign in to comment.