diff --git a/coin/coins.go b/coin/coins.go index e79e0e0..cabb317 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-06-14 09:56:59.135704 -0300 -03 m=+0.004544632 +// 2024-07-16 16:42:22.90573 +0900 KST m=+0.007864501 // 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,125 +46,125 @@ 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 - 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 - MERLIN = 4200 - BLAST = 81457 - SCROLL = 534352 + 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 + MERLIN = 4200 + BLAST = 81457 + SCROLL = 534352 INTERNET_COMPUTER = 223 - BOUNCEBIT = 6001 - ZKLINKNOVA = 810180 + BOUNCEBIT = 6001 + ZKLINKNOVA = 810180 ) var Coins = map[uint]Coin{ @@ -1145,7 +1145,7 @@ var Coins = map[uint]Coin{ BlockTime: 0, MinConfirmations: 0, Blockchain: "The Open Network", - IsTokenSupported: false, + IsTokenSupported: true, }, POLYGONZKEVM: { ID: 10001101, @@ -2457,7 +2457,7 @@ var Chains = map[string]Coin{ BlockTime: 0, MinConfirmations: 0, Blockchain: "The Open Network", - IsTokenSupported: false, + IsTokenSupported: true, }, Polygonzkevm().Handle: { ID: 10001101, @@ -3266,3 +3266,4 @@ func Bouncebit() Coin { func Zklinknova() Coin { return Coins[ZKLINKNOVA] } + diff --git a/coin/coins.yml b/coin/coins.yml index 3feef37..cbd81f3 100644 --- a/coin/coins.yml +++ b/coin/coins.yml @@ -804,7 +804,7 @@ name: TON decimals: 9 blockchain: The Open Network - isTokenSupported: false + isTokenSupported: true - id: 10001101 symbol: ZKEVM diff --git a/types/token.go b/types/token.go index 6202aca..2bc29b2 100644 --- a/types/token.go +++ b/types/token.go @@ -146,6 +146,7 @@ const ( TokenVersionV18 TokenVersion = 18 TokenVersionV19 TokenVersion = 19 TokenVersionV20 TokenVersion = 20 + TokenVersionV21 TokenVersion = 21 TokenVersionUndefined TokenVersion = -1 ) @@ -408,7 +409,7 @@ func GetTokenVersion(tokenType string) (TokenVersion, error) { return TokenVersionV10, nil case RONIN, AURORA: return TokenVersionV11, nil - case TON, POLYGONZKEVM, ZKSYNC, SUI: + case POLYGONZKEVM, ZKSYNC, SUI: return TokenVersionV12, nil case BASE, AKASH, AGORIC, AXELAR, JUNO, SEI, OPBNB: return TokenVersionV13, nil @@ -425,6 +426,8 @@ func GetTokenVersion(tokenType string) (TokenVersion, error) { return TokenVersionV19, nil case ZKLINKNOVA: return TokenVersionV20, nil + case TON: + return TokenVersionV21, 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 diff --git a/types/token_test.go b/types/token_test.go index f194f96..b9c9031 100644 --- a/types/token_test.go +++ b/types/token_test.go @@ -548,42 +548,30 @@ func TestGetTokenVersion(t *testing.T) { TokenVersionV14, nil, }, - - { - "Ton token version", - args{t: string(TON)}, - TokenVersionV12, - nil, - }, - { "Stride token version", args{t: string(STRIDE)}, TokenVersionUndefined, nil, }, - { "Neutron token version", args{t: string(NEUTRON)}, TokenVersionUndefined, nil, }, - { "Conflux eSpace token version", args{t: string(CONFLUX)}, TokenVersionV14, nil, }, - { "Acala token version", args{t: string(ACA)}, TokenVersionV14, nil, }, - { "NativeZeta token version", args{t: string(ZETACHAIN)}, @@ -632,6 +620,12 @@ func TestGetTokenVersion(t *testing.T) { TokenVersionV20, nil, }, + { + "TON token version", + args{t: string(TON)}, + TokenVersionV21, + nil, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {