Skip to content

Commit

Permalink
Feat: Add Neon Mainnet Network
Browse files Browse the repository at this point in the history
  • Loading branch information
joehquak committed Jul 26, 2023
1 parent 1c81571 commit 87c4c99
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,5 @@ This list is generated from [./registry.json](../registry.json)
| 70000118 | Kujira | KUJI | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/kujira/info/logo.png" width="32" /> | <https://kujira.app/> |
| 80000118 | Comdex | CMDX | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/comdex/info/logo.png" width="32" /> | <https://comdex.one/> |
| 90000118 | Neutron | NTRN | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/neutron/info/logo.png" width="32" /> | <https://neutron.org/> |
| 255022934 | Neon | NEON | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/neon/info/logo.png" width="32" /> | <https://neonevm.org> |
| 1323161554 | Aurora | ETH | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/aurora/info/logo.png" width="32" /> | <https://aurora.dev/> |
1 change: 1 addition & 0 deletions include/TrustWalletCore/TWCoinType.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ enum TWCoinType {
TWCoinTypeAcala = 787,
TWCoinTypeAcalaEVM = 10000787,
TWCoinTypeOpBNBtestnet = 5611,
TWCoinTypeNeon = 255022934,
};

/// Returns the blockchain for a coin type.
Expand Down
30 changes: 30 additions & 0 deletions registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -4204,5 +4204,35 @@
"rpc": "https://toncenter.com/api/v2/jsonRPC",
"documentation": "https://ton.org/docs"
}
},
{
"id": "neon",
"name": "Neon",
"coinId": 255022934,
"symbol": "NEON",
"decimals": 18,
"blockchain": "Ethereum",
"derivation": [
{
"path": "m/44'/60'/0'/0/0"
}
],
"curve": "secp256k1",
"publicKeyType": "secp256k1Extended",
"chainId": "245022934",
"addressHasher": "keccak256",
"explorer": {
"url": "https://neonscan.org",
"txPath": "/tx/",
"accountPath": "/address/",
"sampleTx": "0x77d86af2c6f02f14ef13ca52bf54864d92fcc4b32d8e884e225061c006738ed6",
"sampleAccount": "0xfa4a8650e7bebb918859c280a86f9661bed29877"
},
"info": {
"url": "https://neonevm.org",
"source": "https://github.com/neonevm/neon-evm",
"rpc": "https://neon-proxy-mainnet.solana.p2p.org/",
"documentation": "https://docs.neonfoundation.io/docs/quick_start"
}
}
]
37 changes: 37 additions & 0 deletions tests/chains/Neon/TWCoinTypeTests.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright © 2017-2023 Trust Wallet.
//
// This file is part of Trust. The full Trust copyright notice, including
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.
//
// This is a GENERATED FILE, changes made here MAY BE LOST.
// Generated one-time (codegen/bin/cointests)
//

#include "TestUtilities.h"
#include <TrustWalletCore/TWCoinTypeConfiguration.h>
#include <gtest/gtest.h>


TEST(TWNeonCoinType, TWCoinType) {
const auto coin = TWCoinTypeNeon;
const auto symbol = WRAPS(TWCoinTypeConfigurationGetSymbol(coin));
const auto id = WRAPS(TWCoinTypeConfigurationGetID(coin));
const auto name = WRAPS(TWCoinTypeConfigurationGetName(coin));
const auto chainId = WRAPS(TWCoinTypeChainId(coin));
const auto txId = WRAPS(TWStringCreateWithUTF8Bytes("0x77d86af2c6f02f14ef13ca52bf54864d92fcc4b32d8e884e225061c006738ed6"));
const auto txUrl = WRAPS(TWCoinTypeConfigurationGetTransactionURL(coin, txId.get()));
const auto accId = WRAPS(TWStringCreateWithUTF8Bytes("0xfa4a8650e7bebb918859c280a86f9661bed29877"));
const auto accUrl = WRAPS(TWCoinTypeConfigurationGetAccountURL(coin, accId.get()));

assertStringsEqual(id, "neon");
assertStringsEqual(name, "Neon");
assertStringsEqual(symbol, "NEON");
ASSERT_EQ(TWCoinTypeConfigurationGetDecimals(coin), 18);
ASSERT_EQ(TWCoinTypeBlockchain(coin), TWBlockchainEthereum);
ASSERT_EQ(TWCoinTypeP2shPrefix(coin), 0x0);
ASSERT_EQ(TWCoinTypeStaticPrefix(coin), 0x0);
assertStringsEqual(chainId, "245022934");
assertStringsEqual(txUrl, "https://neonscan.org/tx/0x77d86af2c6f02f14ef13ca52bf54864d92fcc4b32d8e884e225061c006738ed6");
assertStringsEqual(accUrl, "https://neonscan.org/address/0xfa4a8650e7bebb918859c280a86f9661bed29877");
}
1 change: 1 addition & 0 deletions tests/common/CoinAddressDerivationTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ TEST(Coin, DeriveAddress) {
case TWCoinTypeIoTeXEVM:
case TWCoinTypeScroll:
case TWCoinTypeOpBNBtestnet:
case TWCoinTypeNeon:
EXPECT_EQ(address, "0x9d8A62f656a8d1615C1294fd71e9CFb3E4855A4F");
break;

Expand Down

0 comments on commit 87c4c99

Please sign in to comment.