Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BounceBit support #172

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions coin/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ var evmCoinsTestSet = map[uint]struct{}{
MERLIN: {},
BLAST: {},
SCROLL: {},
BOUNCEBIT: {},
}

// TestEvmCoinsList This test will automatically fail when new EVM chain is added to coins.yml
Expand Down
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
Loading