1
// Copyright © 2017-2020 Trust Wallet.
2
//
3
// This file is part of Trust. The full Trust copyright notice, including
4
// terms governing use, modification, and redistribution, is contained in the
5
// file LICENSE at the root of the source code distribution tree.
6

7
#include "Entry.h"
8

9
#include "Ethereum/Address.h"
10
#include "Signer.h"
11

12
using namespace TW::Theta;
13
using namespace std;
14

15 1
bool Entry::validateAddress(TWCoinType coin, const string& address, TW::byte, TW::byte, const char*) const {
16 1
    return Ethereum::Address::isValid(address);
17
}
18

19 1
string Entry::normalizeAddress(TWCoinType coin, const string& address) const {
20
    // normalized with EIP55 checksum
21 1
    return Ethereum::Address(address).string();
22
}
23

24 1
string Entry::deriveAddress(TWCoinType coin, const PublicKey& publicKey, TW::byte, const char*) const {
25 1
    return Ethereum::Address(publicKey).string();
26
}
27

28 1
void Entry::sign(TWCoinType coin, const TW::Data& dataIn, TW::Data& dataOut) const {
29 1
    signTemplate<Signer, Proto::SigningInput>(dataIn, dataOut);
30
}

Read our documentation on viewing source code .

Loading