diff --git a/coin/coins.go b/coin/coins.go index 22be777..750e1b1 100644 --- a/coin/coins.go +++ b/coin/coins.go @@ -1,6 +1,6 @@ // Code generated by go generate; DO NOT EDIT. // This file was generated by robots at -// 2024-02-07 15:26:52.372196 -0300 -03 m=+0.002848264 +// 2024-04-15 15:30:07.029969 +0400 +04 m=+0.002842751 // using data from coins.yml package coin @@ -23,7 +23,7 @@ type Coin struct { BlockTime int MinConfirmations int64 Blockchain string // Name of the Blockchain which core is used for this network - IsTokenSupported bool // Indicate whether the backend supports token parsing for this network + IsTokenSupported bool // Indicate whether the backend supports token parsing for this network } type AssetID string @@ -46,119 +46,120 @@ func (c Coin) TokenAssetID(t string) AssetID { } const ( - ETHEREUM = 60 - CLASSIC = 61 - ICON = 74 - COSMOS = 118 - RIPPLE = 144 - STELLAR = 148 - POA = 178 - TRON = 195 - FIO = 235 - NIMIQ = 242 - IOTEX = 304 - IOTEXEVM = 10004689 - ZILLIQA = 313 - AION = 425 - AETERNITY = 457 - KAVA = 459 - THETA = 500 - BINANCE = 714 - VECHAIN = 818 - CALLISTO = 820 - TOMOCHAIN = 889 - THUNDERTOKEN = 1001 - ONTOLOGY = 1024 - TEZOS = 1729 - KIN = 2017 - NEBULAS = 2718 - GOCHAIN = 6060 - WANCHAIN = 5718350 - WAVES = 5741564 - BITCOIN = 0 - LITECOIN = 2 - DOGE = 3 - DASH = 5 - VIACOIN = 14 - GROESTLCOIN = 17 - ZCASH = 133 - FIRO = 136 - BITCOINCASH = 145 - RAVENCOIN = 175 - QTUM = 2301 - ZELCASH = 19167 - DECRED = 42 - ALGORAND = 283 - NANO = 165 - DIGIBYTE = 20 - HARMONY = 1023 - KUSAMA = 434 - POLKADOT = 354 - SOLANA = 501 - NEAR = 397 - ELROND = 508 - SMARTCHAIN = 20000714 - FILECOIN = 461 - OASIS = 474 - MONACOIN = 22 - BITCOINGOLD = 156 - EOS = 194 - TERRA = 330 - BAND = 494 - NEO = 888 - CARDANO = 1815 - NULS = 8964 - POLYGON = 966 - THORCHAIN = 931 - OPTIMISM = 10000070 - XDAI = 10000100 - AVALANCHEC = 10009000 - HECO = 10000553 - FANTOM = 10000250 - ARBITRUM = 10042221 - CELO = 52752 - RONIN = 10002020 - OSMOSIS = 10000118 - CRONOS = 10000025 - KCC = 10000321 - AURORA = 1323161554 - KAVAEVM = 10002222 - METER = 18000 - EVMOS = 10009001 - NATIVEEVMOS = 20009001 - OKC = 996 - CRYPTOORG = 394 - APTOS = 637 - MOONBEAM = 10001284 - KLAYTN = 10008217 - METIS = 10001088 - MOONRIVER = 10001285 - BOBA = 10000288 - TON = 607 - POLYGONZKEVM = 10001101 - ZKSYNC = 10000324 - SUI = 784 - STRIDE = 40000118 - NEUTRON = 90000118 - STARGAZE = 20000118 + ETHEREUM = 60 + CLASSIC = 61 + ICON = 74 + COSMOS = 118 + RIPPLE = 144 + STELLAR = 148 + POA = 178 + TRON = 195 + FIO = 235 + NIMIQ = 242 + IOTEX = 304 + IOTEXEVM = 10004689 + ZILLIQA = 313 + AION = 425 + AETERNITY = 457 + KAVA = 459 + THETA = 500 + BINANCE = 714 + VECHAIN = 818 + CALLISTO = 820 + TOMOCHAIN = 889 + THUNDERTOKEN = 1001 + ONTOLOGY = 1024 + TEZOS = 1729 + KIN = 2017 + NEBULAS = 2718 + GOCHAIN = 6060 + WANCHAIN = 5718350 + WAVES = 5741564 + BITCOIN = 0 + LITECOIN = 2 + DOGE = 3 + DASH = 5 + VIACOIN = 14 + GROESTLCOIN = 17 + ZCASH = 133 + FIRO = 136 + BITCOINCASH = 145 + RAVENCOIN = 175 + QTUM = 2301 + ZELCASH = 19167 + DECRED = 42 + ALGORAND = 283 + NANO = 165 + DIGIBYTE = 20 + HARMONY = 1023 + KUSAMA = 434 + POLKADOT = 354 + SOLANA = 501 + NEAR = 397 + ELROND = 508 + SMARTCHAIN = 20000714 + FILECOIN = 461 + OASIS = 474 + MONACOIN = 22 + BITCOINGOLD = 156 + EOS = 194 + TERRA = 330 + BAND = 494 + NEO = 888 + CARDANO = 1815 + NULS = 8964 + POLYGON = 966 + THORCHAIN = 931 + OPTIMISM = 10000070 + XDAI = 10000100 + AVALANCHEC = 10009000 + HECO = 10000553 + FANTOM = 10000250 + ARBITRUM = 10042221 + CELO = 52752 + RONIN = 10002020 + OSMOSIS = 10000118 + CRONOS = 10000025 + KCC = 10000321 + AURORA = 1323161554 + KAVAEVM = 10002222 + METER = 18000 + EVMOS = 10009001 + NATIVEEVMOS = 20009001 + OKC = 996 + CRYPTOORG = 394 + APTOS = 637 + MOONBEAM = 10001284 + KLAYTN = 10008217 + METIS = 10001088 + MOONRIVER = 10001285 + BOBA = 10000288 + TON = 607 + POLYGONZKEVM = 10001101 + ZKSYNC = 10000324 + SUI = 784 + STRIDE = 40000118 + NEUTRON = 90000118 + STARGAZE = 20000118 NATIVEINJECTIVE = 10000060 - CFXEVM = 1030 - ACALA = 787 - ACALAEVM = 10000787 - BASE = 8453 - AKASH = 17000118 - AGORIC = 564 - AXELAR = 50000118 - JUNO = 30000118 - SEI = 19000118 - NEON = 245022934 - OPBNB = 204 - LINEA = 59144 - GBNB = 5600 - MANTLE = 5000 - MANTA = 169 - ZETACHAIN = 10007000 - ZETAEVM = 20007000 + CFXEVM = 1030 + ACALA = 787 + ACALAEVM = 10000787 + BASE = 8453 + AKASH = 17000118 + AGORIC = 564 + AXELAR = 50000118 + JUNO = 30000118 + SEI = 19000118 + NEON = 245022934 + OPBNB = 204 + LINEA = 59144 + GBNB = 5600 + MANTLE = 5000 + MANTA = 169 + ZETACHAIN = 10007000 + ZETAEVM = 20007000 + MERLIN = 4200 ) var Coins = map[uint]Coin{ @@ -1405,6 +1406,17 @@ var Coins = map[uint]Coin{ Blockchain: "Ethereum", IsTokenSupported: false, }, + MERLIN: { + ID: 4200, + Handle: "merlin", + Symbol: "BTC", + Name: "Merlin", + Decimals: 18, + BlockTime: 0, + MinConfirmations: 0, + Blockchain: "Ethereum", + IsTokenSupported: true, + }, } var Chains = map[string]Coin{ @@ -2651,6 +2663,17 @@ var Chains = map[string]Coin{ Blockchain: "Ethereum", IsTokenSupported: false, }, + Merlin().Handle: { + ID: 4200, + Handle: "merlin", + Symbol: "BTC", + Name: "Merlin", + Decimals: 18, + BlockTime: 0, + MinConfirmations: 0, + Blockchain: "Ethereum", + IsTokenSupported: true, + }, } func Ethereum() Coin { @@ -3105,3 +3128,6 @@ func Zetaevm() Coin { return Coins[ZETAEVM] } +func Merlin() Coin { + return Coins[MERLIN] +} diff --git a/coin/coins.yml b/coin/coins.yml index c263e11..d217afd 100644 --- a/coin/coins.yml +++ b/coin/coins.yml @@ -1012,4 +1012,12 @@ name: Zeta EVM decimals: 18 blockchain: Ethereum - isTokenSupported: false \ No newline at end of file + isTokenSupported: false + +- id: 4200 + symbol: BTC + handle: merlin + name: Merlin + decimals: 18 + blockchain: Ethereum + isTokenSupported: true diff --git a/coin/models_test.go b/coin/models_test.go index 615adc3..3e72015 100644 --- a/coin/models_test.go +++ b/coin/models_test.go @@ -445,6 +445,7 @@ var evmCoinsTestSet = map[uint]struct{}{ MANTLE: {}, MANTA: {}, ZETAEVM: {}, + MERLIN: {}, } // TestEvmCoinsList This test will automatically fail when new EVM chain is added to coins.yml diff --git a/types/chain.go b/types/chain.go index a5147a5..7c9cea7 100644 --- a/types/chain.go +++ b/types/chain.go @@ -165,6 +165,8 @@ func GetChainFromAssetType(assetType string) (coin.Coin, error) { return coin.Zetachain(), nil case ZETAEVM: return coin.Zetaevm(), nil + case MERLIN: + return coin.Merlin(), nil } return coin.Coin{}, errors.New("unknown asset type: " + assetType) diff --git a/types/token.go b/types/token.go index e50294f..9dd6370 100644 --- a/types/token.go +++ b/types/token.go @@ -117,6 +117,7 @@ const ( MANTA TokenType = "MANTA" ZETACHAIN TokenType = "ZETACHAIN" ZETAEVM TokenType = "ZETAEVM" + MERLIN TokenType = "MERLIN" ) const ( @@ -136,6 +137,7 @@ const ( TokenVersionV14 TokenVersion = 14 TokenVersionV15 TokenVersion = 15 TokenVersionV16 TokenVersion = 16 + TokenVersionV17 TokenVersion = 17 TokenVersionUndefined TokenVersion = -1 ) @@ -225,6 +227,7 @@ func GetTokenTypes() []TokenType { MANTA, ZETACHAIN, ZETAEVM, + MERLIN, } } @@ -391,6 +394,8 @@ func GetTokenVersion(tokenType string) (TokenVersion, error) { return TokenVersionV14, nil case BRC20: return TokenVersionV16, nil + case MERLIN: + return TokenVersionV17, 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 @@ -504,6 +509,8 @@ func GetEthereumTokenTypeByIndex(coinIndex uint) (TokenType, error) { tokenType = MANTA case coin.ZETAEVM: tokenType = ZETAEVM + case coin.MERLIN: + tokenType = MERLIN } if tokenType == "" { diff --git a/types/token_test.go b/types/token_test.go index 48c8b4f..2b775ce 100644 --- a/types/token_test.go +++ b/types/token_test.go @@ -573,6 +573,12 @@ func TestGetTokenVersion(t *testing.T) { TokenVersionV16, nil, }, + { + "MERLIN token version", + args{t: string(MERLIN)}, + TokenVersionV17, + nil, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {