Skip to content

Commit

Permalink
MANTA coin (#154)
Browse files Browse the repository at this point in the history
* coin

* coin

* coin
  • Loading branch information
defisaur authored Dec 27, 2023
1 parent ee074e4 commit 5890540
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 1 deletion.
29 changes: 28 additions & 1 deletion 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 @@ -989,3 +989,11 @@
decimals: 18
blockchain: Ethereum
isTokenSupported: false

- id: 169
symbol: ETH
handle: manta
name: Manta Pacific
decimals: 18
blockchain: Ethereum
isTokenSupported: true
1 change: 1 addition & 0 deletions coin/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ var evmCoinsTestSet = map[uint]struct{}{
OPBNB: {},
LINEA: {},
MANTLE: {},
MANTA: {},
}

// 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 @@ -159,6 +159,8 @@ func GetChainFromAssetType(assetType string) (coin.Coin, error) {
return coin.Stargaze(), nil
case MANTLE:
return coin.Mantle(), nil
case MANTA:
return coin.Manta(), 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 @@ -114,6 +114,7 @@ const (
OPBNB TokenType = "OPBNB"
LINEA TokenType = "LINEA"
MANTLE TokenType = "MANTLE"
MANTA TokenType = "MANTA"
)

const (
Expand All @@ -131,6 +132,7 @@ const (
TokenVersionV12 TokenVersion = 12
TokenVersionV13 TokenVersion = 13
TokenVersionV14 TokenVersion = 14
TokenVersionV15 TokenVersion = 15
TokenVersionUndefined TokenVersion = -1
)

Expand Down Expand Up @@ -217,6 +219,7 @@ func GetTokenTypes() []TokenType {
LINEA,
ACALAEVM,
MANTLE,
MANTA,
}
}

Expand Down Expand Up @@ -322,6 +325,8 @@ func GetTokenType(c uint, tokenID string) (string, bool) {
return string(NEON), true
case coin.MANTLE:
return string(MANTLE), true
case coin.MANTA:
return string(MANTA), true
default:
return "", false
}
Expand Down Expand Up @@ -374,6 +379,8 @@ func GetTokenVersion(tokenType string) (TokenVersion, error) {
return TokenVersionV13, nil
case KAVAEVM, BOBA, METIS, NEON, LINEA, ACA, ACALAEVM, CONFLUX, IOTEXEVM, KLAYTN, MOONRIVER, MOONBEAM, MANTLE:
return TokenVersionV14, nil
case MANTA:
return TokenVersionV15, nil
case BRC20, ERC721, ERC1155, EOS, NEP5, VET, ONTOLOGY, THETA, TOMO, POA, OASIS, ALGORAND, METER, EVMOS_ERC20,
KIP20, STRIDE, NEUTRON, FA2, CARDANO, NATIVEINJECTIVE, NATIVEEVMOS, CRYPTOORG, COSMOS, OSMOSIS, STARGAZE:
return TokenVersionUndefined, nil
Expand Down Expand Up @@ -483,6 +490,8 @@ func GetEthereumTokenTypeByIndex(coinIndex uint) (TokenType, error) {
tokenType = LINEA
case coin.MANTLE:
tokenType = MANTLE
case coin.MANTA:
tokenType = MANTA
}

if tokenType == "" {
Expand Down

0 comments on commit 5890540

Please sign in to comment.