Skip to content

Commit 22287e0

Browse files
feat: add VinuChain (coin type 10000207)
Add VinuChain as an EVM-compatible chain with: - Chain ID: 207 - Coin type: 10000207 (10000000 + chainId convention) - Symbol: VC - Decimals: 18 - Address derivation: identical to Ethereum (secp256k1, keccak256) - Explorer: https://vinuexplorer.org - Website: https://vinuchain.org Files changed: - registry.json: new chain entry - codegen-v2/manifest/TWEthereumChainID.yaml: chain ID 207 - codegen-v2/manifest/TWCoinType.yaml: coin type 10000207 - include/TrustWalletCore/TWCoinType.h: TWCoinTypeVinuChain enum value - tests/chains/VinuChain/TWCoinTypeTests.cpp: coin type test - tests/common/CoinAddressDerivationTests.cpp: EVM address derivation - rust/tw_tests/tests/coin_address_derivation_test.rs: Rust derivation test - swift/Tests/CoinAddressDerivationTests.swift: Swift derivation test - kotlin/.../CoinAddressDerivationTests.kt: Kotlin multiplatform test - android/.../CoinAddressDerivationTests.kt: Android Kotlin test
1 parent 39e659a commit 22287e0

File tree

10 files changed

+72
-2
lines changed

10 files changed

+72
-2
lines changed

android/app/src/androidTest/java/com/trustwallet/core/app/blockchains/CoinAddressDerivationTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class CoinAddressDerivationTests {
4444
DIGIBYTE -> assertEquals("dgb1qtjgmerfqwdffyf8ghcrkgy52cghsqptynmyswu", address)
4545

4646
ETHEREUM, SMARTCHAIN, POLYGON, OPTIMISM, ZKSYNC, ARBITRUM, ARBITRUMNOVA, ECOCHAIN, AVALANCHECCHAIN, XDAI,
47-
FANTOM, CELO, CRONOSCHAIN, SMARTBITCOINCASH, KUCOINCOMMUNITYCHAIN, BOBA, METIS,
47+
VINUCHAIN, FANTOM, CELO, CRONOSCHAIN, SMARTBITCOINCASH, KUCOINCOMMUNITYCHAIN, BOBA, METIS,
4848
AURORA, EVMOS, MOONRIVER, MOONBEAM, KAVAEVM, KAIA, METER, OKXCHAIN, POLYGONZKEVM, SCROLL,
4949
CONFLUXESPACE, ACALAEVM, OPBNB, NEON, BASE, LINEA, GREENFIELD, MANTLE, ZENEON, MANTAPACIFIC,
5050
ZETAEVM, MERLIN, LIGHTLINK, BLAST, BOUNCEBIT, ZKLINKNOVA, SONIC, PLASMA, MONAD, MEGAETH,

codegen-v2/manifest/TWCoinType.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ enums:
158158
value: 10009000
159159
- name: xdai
160160
value: 10000100
161+
- name: vinuchain
162+
value: 10000207
161163
- name: fantom
162164
value: 10000250
163165
- name: cryptoOrg

codegen-v2/manifest/TWEthereumChainID.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ enums:
3939
value: 100
4040
- name: smartbch
4141
value: 10000
42+
- name: vinuchain
43+
value: 207
4244
- name: fantom
4345
value: 250
4446
- name: boba

include/TrustWalletCore/TWCoinType.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ enum TWCoinType {
192192
TWCoinTypePlasma = 9745,
193193
TWCoinTypeMonad = 10143,
194194
TWCoinTypeMegaETH = 4326,
195+
TWCoinTypeVinuChain = 10000207,
195196
// end_of_tw_coin_type_marker_do_not_modify
196197
};
197198

kotlin/wallet-core-kotlin/src/commonTest/kotlin/com/trustwallet/core/test/CoinAddressDerivationTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CoinAddressDerivationTests {
3737
DigiByte -> "dgb1qtjgmerfqwdffyf8ghcrkgy52cghsqptynmyswu"
3838

3939
Ethereum, SmartChain, Polygon, Optimism, Zksync, Arbitrum, ArbitrumNova, ECOChain, AvalancheCChain, XDai,
40-
Fantom, Celo, CronosChain, SmartBitcoinCash, KuCoinCommunityChain, Boba, Metis,
40+
VinuChain, Fantom, Celo, CronosChain, SmartBitcoinCash, KuCoinCommunityChain, Boba, Metis,
4141
Aurora, Evmos, Moonriver, Moonbeam, KavaEvm, Kaia, Meter, OKXChain, PolygonzkEVM, Scroll,
4242
ConfluxeSpace, AcalaEVM, OpBNB, Neon, Base, Linea, Greenfield, Mantle, ZenEON, MantaPacific,
4343
ZetaEVM, Merlin, Lightlink, Blast, BounceBit, ZkLinkNova, Sonic, Plasma, Monad, MegaETH,

registry.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4974,5 +4974,32 @@
49744974
"rpc": "https://mainnet.megaeth.com/rpc",
49754975
"documentation": "https://docs.megaeth.com"
49764976
}
4977+
},
4978+
{
4979+
"id": "vinuchain",
4980+
"name": "VinuChain",
4981+
"coinId": 10000207,
4982+
"symbol": "VC",
4983+
"decimals": 18,
4984+
"blockchain": "Ethereum",
4985+
"derivation": [
4986+
{
4987+
"path": "m/44'/60'/0'/0/0"
4988+
}
4989+
],
4990+
"curve": "secp256k1",
4991+
"publicKeyType": "secp256k1Extended",
4992+
"chainId": "207",
4993+
"addressHasher": "keccak256",
4994+
"explorer": {
4995+
"url": "https://vinuexplorer.org",
4996+
"txPath": "/tx/",
4997+
"accountPath": "/address/",
4998+
"sampleTx": "0xb0a741d882291951de1fac72e90b9baf886ddb0c9c87658a0c206490dfaa5202",
4999+
"sampleAccount": "0x9474feb9917b87da6f0d830ba66ee0035835c0d3"
5000+
},
5001+
"info": {
5002+
"url": "https://vinuchain.org"
5003+
}
49775004
}
49785005
]

rust/tw_tests/tests/coin_address_derivation_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ fn test_coin_address_derivation() {
5050
| CoinType::ECOChain
5151
| CoinType::EthereumClassic
5252
| CoinType::Evmos
53+
| CoinType::VinuChain
5354
| CoinType::Fantom
5455
| CoinType::GoChain
5556
| CoinType::KavaEvm

swift/Tests/CoinAddressDerivationTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class CoinAddressDerivationTests: XCTestCase {
8989
.ecochain,
9090
.avalancheCChain,
9191
.xdai,
92+
.vinuchain,
9293
.fantom,
9394
.celo,
9495
.cronosChain,
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
//
3+
// Copyright © 2017 Trust Wallet.
4+
//
5+
// This is a GENERATED FILE, changes made here MAY BE LOST.
6+
// Generated one-time (codegen/bin/cointests)
7+
//
8+
9+
#include "TestUtilities.h"
10+
#include <TrustWalletCore/TWCoinTypeConfiguration.h>
11+
#include <gtest/gtest.h>
12+
13+
14+
TEST(TWVinuChainCoinType, TWCoinType) {
15+
const auto coin = TWCoinTypeVinuChain;
16+
const auto symbol = WRAPS(TWCoinTypeConfigurationGetSymbol(coin));
17+
const auto id = WRAPS(TWCoinTypeConfigurationGetID(coin));
18+
const auto name = WRAPS(TWCoinTypeConfigurationGetName(coin));
19+
const auto chainId = WRAPS(TWCoinTypeChainId(coin));
20+
const auto txId = WRAPS(TWStringCreateWithUTF8Bytes("0xb0a741d882291951de1fac72e90b9baf886ddb0c9c87658a0c206490dfaa5202"));
21+
const auto txUrl = WRAPS(TWCoinTypeConfigurationGetTransactionURL(coin, txId.get()));
22+
const auto accId = WRAPS(TWStringCreateWithUTF8Bytes("0x9474feb9917b87da6f0d830ba66ee0035835c0d3"));
23+
const auto accUrl = WRAPS(TWCoinTypeConfigurationGetAccountURL(coin, accId.get()));
24+
25+
assertStringsEqual(id, "vinuchain");
26+
assertStringsEqual(name, "VinuChain");
27+
assertStringsEqual(symbol, "VC");
28+
ASSERT_EQ(TWCoinTypeConfigurationGetDecimals(coin), 18);
29+
ASSERT_EQ(TWCoinTypeBlockchain(coin), TWBlockchainEthereum);
30+
ASSERT_EQ(TWCoinTypeP2shPrefix(coin), 0x0);
31+
ASSERT_EQ(TWCoinTypeStaticPrefix(coin), 0x0);
32+
assertStringsEqual(chainId, "207");
33+
assertStringsEqual(txUrl, "https://vinuexplorer.org/tx/0xb0a741d882291951de1fac72e90b9baf886ddb0c9c87658a0c206490dfaa5202");
34+
assertStringsEqual(accUrl, "https://vinuexplorer.org/address/0x9474feb9917b87da6f0d830ba66ee0035835c0d3");
35+
}

tests/common/CoinAddressDerivationTests.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ TEST(Coin, DeriveAddress) {
4848
case TWCoinTypeECOChain:
4949
case TWCoinTypeEthereumClassic:
5050
case TWCoinTypeEvmos:
51+
case TWCoinTypeVinuChain:
5152
case TWCoinTypeFantom:
5253
case TWCoinTypeGoChain:
5354
case TWCoinTypeKavaEvm:

0 commit comments

Comments
 (0)