Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CoinAddressDerivationTests {
DIGIBYTE -> assertEquals("dgb1qtjgmerfqwdffyf8ghcrkgy52cghsqptynmyswu", address)
ETHEREUM, SMARTCHAIN, POLYGON, OPTIMISM, ARBITRUM, ECOCHAIN, AVALANCHECCHAIN, XDAI,
FANTOM, CELO, CRONOSCHAIN, SMARTBITCOINCASH, KUCOINCOMMUNITYCHAIN, BOBA, METIS,
AURORA, EVMOS, MOONRIVER, MOONBEAM -> assertEquals("0x8f348F300873Fd5DA36950B2aC75a26584584feE", address)
AURORA, EVMOS, MOONRIVER, MOONBEAM, KLAYTN -> assertEquals("0x8f348F300873Fd5DA36950B2aC75a26584584feE", address)
RONIN -> assertEquals("ronin:8f348F300873Fd5DA36950B2aC75a26584584feE", address)
ETHEREUMCLASSIC -> assertEquals("0x078bA3228F3E6C08bEEac9A005de0b7e7089aD1c", address)
GOCHAIN -> assertEquals("0x5940ce4A14210d4Ccd0ac206CE92F21828016aC2", address)
Expand Down
1 change: 1 addition & 0 deletions docs/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ This list is generated from [./registry.json](../registry.json)
| 10001284 | Moonbeam | GLMR | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/moonbeam/info/logo.png" width="32" /> | <https://moonbeam.network> |
| 10001285 | Moonriver | MOVR | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/moonriver/info/logo.png" width="32" /> | <https://moonbeam.network/networks/moonriver> |
| 10002020 | Ronin | RON | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ronin/info/logo.png" width="32" /> | <https://whitepaper.axieinfinity.com/technology/ronin-ethereum-sidechain> |
| 10008217 | Klaytn | KLAY | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/klaytn/info/logo.png" width="32" /> | <https://klaytn.foundation> |
| 10009000 | Avalanche C-Chain | AVAX | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/avalanchec/info/logo.png" width="32" /> | <https://www.avalabs.org/> |
| 10009001 | Evmos | EVMOS | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/evmos/info/logo.png" width="32" /> | <https://evmos.org/> |
| 10042221 | Arbitrum | ETH | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png" width="32" /> | <https://arbitrum.io> |
Expand Down
1 change: 1 addition & 0 deletions include/TrustWalletCore/TWCoinType.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ enum TWCoinType {
TWCoinTypeNativeEvmos = 20009001,
TWCoinTypeMoonriver = 10001285,
TWCoinTypeMoonbeam = 10001284,
TWCoinTypeKlaytn = 10008217,
};

/// Returns the blockchain for a coin type.
Expand Down
28 changes: 28 additions & 0 deletions registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -2542,5 +2542,33 @@
"rpc": "https://rpc.api.moonbeam.network",
"documentation": "https://docs.moonbeam.network"
}
},
{
"id": "klaytn",
"name": "Klaytn",
"coinId": 10008217,
"symbol": "KLAY",
"decimals": 18,
"blockchain": "Ethereum",
"derivation": [
{
"path": "m/44'/60'/0'/0/0"
}
],
"curve": "secp256k1",
"publicKeyType": "secp256k1Extended",
"chainId": "8217",
"explorer": {
"url": "https://scope.klaytn.com",
"txPath": "/tx/",
"accountPath": "/account/",
"sampleTx": "0x93ea92687845fe7bb6cacd69c76a16a2a3c2bbb85a8a93ff0e032d0098d583d7",
"sampleAccount": "0x2ad9656bf5b82caf10847b431012e28e301e83ba"
},
"info": {
"url": "https://klaytn.foundation",
"rpc": "https://public-node-api.klaytnapi.com/v1/cypress",
"documentation": "https://docs.klaytn.foundation"
}
}
]
3 changes: 2 additions & 1 deletion swift/Tests/CoinAddressDerivationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ class CoinAddressDerivationTests: XCTestCase {
.aurora,
.evmos,
.moonriver,
.moonbeam:
.moonbeam,
.klaytn:
let expectedResult = "0x8f348F300873Fd5DA36950B2aC75a26584584feE"
assertCoinDerivation(coin, expectedResult, derivedAddress, address)
case .ronin:
Expand Down
37 changes: 37 additions & 0 deletions tests/Klaytn/TWCoinTypeTests.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright © 2017-2022 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 "../interface/TWTestUtilities.h"
#include <TrustWalletCore/TWCoinTypeConfiguration.h>
#include <gtest/gtest.h>


TEST(TWKlaytnCoinType, TWCoinType) {
const auto coin = TWCoinTypeKlaytn;
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("0x93ea92687845fe7bb6cacd69c76a16a2a3c2bbb85a8a93ff0e032d0098d583d7"));
const auto txUrl = WRAPS(TWCoinTypeConfigurationGetTransactionURL(coin, txId.get()));
const auto accId = WRAPS(TWStringCreateWithUTF8Bytes("0x2ad9656bf5b82caf10847b431012e28e301e83ba"));
const auto accUrl = WRAPS(TWCoinTypeConfigurationGetAccountURL(coin, accId.get()));

assertStringsEqual(id, "klaytn");
assertStringsEqual(name, "Klaytn");
assertStringsEqual(symbol, "KLAY");
ASSERT_EQ(TWCoinTypeConfigurationGetDecimals(coin), 18);
ASSERT_EQ(TWCoinTypeBlockchain(coin), TWBlockchainEthereum);
ASSERT_EQ(TWCoinTypeP2shPrefix(coin), 0x0);
ASSERT_EQ(TWCoinTypeStaticPrefix(coin), 0x0);
assertStringsEqual(chainId, "8217");
assertStringsEqual(txUrl, "https://scope.klaytn.com/tx/0x93ea92687845fe7bb6cacd69c76a16a2a3c2bbb85a8a93ff0e032d0098d583d7");
assertStringsEqual(accUrl, "https://scope.klaytn.com/account/0x2ad9656bf5b82caf10847b431012e28e301e83ba");
}