forked from trustwallet/wallet-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAddress.h
40 lines (28 loc) · 1.09 KB
/
Address.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// 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.
#pragma once
#include "Data.h"
#include "../PublicKey.h"
#include <string>
namespace TW::Algorand {
class Address {
public:
/// Base32 encoded address string length.
static const size_t encodedSize = 58;
/// Sha512/256 checksum size.
static const size_t checksumSize = 4;
/// Address data consisting of public key.
std::array<byte, PublicKey::ed25519Size> bytes;
/// Determines whether a string makes a valid address.
static bool isValid(const std::string& string);
/// Initializes a Algorand address with a string representation.
explicit Address(const std::string& string);
/// Initializes a Algorand address with a public key.
explicit Address(const PublicKey& publicKey);
/// Returns a string representation of the address.
std::string string() const;
};
} // namespace TW::Algorand