Skip to content

Commit 4259385

Browse files
committed
Add BounceBit support
1 parent 7588e65 commit 4259385

File tree

5 files changed

+182
-118
lines changed

5 files changed

+182
-118
lines changed

coin/coins.go

Lines changed: 146 additions & 118 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coin/coins.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,3 +1045,11 @@
10451045
decimals: 8
10461046
blockchain: Internet Computer
10471047
isTokenSupported: false
1048+
1049+
- id: 6001
1050+
symbol: BB
1051+
handle: bouncebit
1052+
name: BounceBit
1053+
decimals: 18
1054+
blockchain: Ethereum
1055+
isTokenSupported: false

types/chain.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ func GetChainFromAssetType(assetType string) (coin.Coin, error) {
173173
return coin.Scroll(), nil
174174
case ICP:
175175
return coin.Internet_computer(), nil
176+
case BOUNCEBIT:
177+
return coin.Bouncebit(), nil
176178
}
177179

178180
return coin.Coin{}, errors.New("unknown asset type: " + assetType)

types/token.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ const (
121121
BLAST TokenType = "BLAST"
122122
SCROLL TokenType = "SCROLL"
123123
ICP TokenType = "ICP"
124+
BOUNCEBIT TokenType = "BOUNCEBIT"
124125
)
125126

126127
const (
@@ -142,6 +143,7 @@ const (
142143
TokenVersionV16 TokenVersion = 16
143144
TokenVersionV17 TokenVersion = 17
144145
TokenVersionV18 TokenVersion = 18
146+
TokenVersionV19 TokenVersion = 19
145147
TokenVersionUndefined TokenVersion = -1
146148
)
147149

@@ -235,6 +237,7 @@ func GetTokenTypes() []TokenType {
235237
BLAST,
236238
SCROLL,
237239
ICP,
240+
BOUNCEBIT,
238241
}
239242
}
240243

@@ -352,6 +355,8 @@ func GetTokenType(c uint, tokenID string) (string, bool) {
352355
return string(SCROLL), true
353356
case coin.INTERNET_COMPUTER:
354357
return string(ICP), true
358+
case coin.BOUNCEBIT:
359+
return string(BOUNCEBIT), true
355360
default:
356361
return "", false
357362
}
@@ -411,6 +416,8 @@ func GetTokenVersion(tokenType string) (TokenVersion, error) {
411416
return TokenVersionV17, nil
412417
case BLAST, SCROLL:
413418
return TokenVersionV18, nil
419+
case BOUNCEBIT:
420+
return TokenVersionV19, nil
414421
case ERC721, ERC1155, EOS, NEP5, VET, ONTOLOGY, THETA, TOMO, POA, OASIS, ALGORAND, METER, EVMOS_ERC20,
415422
KIP20, STRIDE, NEUTRON, FA2, CARDANO, NATIVEEVMOS, CRYPTOORG, COSMOS, OSMOSIS, STARGAZE:
416423
return TokenVersionUndefined, nil
@@ -530,6 +537,8 @@ func GetEthereumTokenTypeByIndex(coinIndex uint) (TokenType, error) {
530537
tokenType = BLAST
531538
case coin.SCROLL:
532539
tokenType = SCROLL
540+
case coin.BOUNCEBIT:
541+
tokenType = BOUNCEBIT
533542
}
534543

535544
if tokenType == "" {

0 commit comments

Comments
 (0)