forked from trustwallet/wallet-core
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathTWDerivationPathIndex.h
51 lines (41 loc) · 1.5 KB
/
TWDerivationPathIndex.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
41
42
43
44
45
46
47
48
49
50
51
// SPDX-License-Identifier: Apache-2.0
//
// Copyright © 2017 Trust Wallet.
#pragma once
#include "TWBase.h"
#include "TWString.h"
TW_EXTERN_C_BEGIN
/// Represents a derivation path index in C++ with value and hardened flag.
TW_EXPORT_CLASS
struct TWDerivationPathIndex;
/// Creates a new Index with a value and hardened flag.
/// Must be deleted with TWDerivationPathIndexDelete after use.
///
/// \param value Index value
/// \param hardened Indicates if the Index is hardened.
/// \return A new Index.
TW_EXPORT_STATIC_METHOD
struct TWDerivationPathIndex* _Nonnull TWDerivationPathIndexCreate(uint32_t value, bool hardened);
/// Deletes an Index.
///
/// \param index Index to delete.
TW_EXPORT_METHOD
void TWDerivationPathIndexDelete(struct TWDerivationPathIndex* _Nonnull index);
/// Returns numeric value of an Index.
///
/// \param index Index to get the numeric value of.
TW_EXPORT_PROPERTY
uint32_t TWDerivationPathIndexValue(struct TWDerivationPathIndex* _Nonnull index);
/// Returns hardened flag of an Index.
///
/// \param index Index to get hardened flag.
/// \return true if hardened, false otherwise.
TW_EXPORT_PROPERTY
bool TWDerivationPathIndexHardened(struct TWDerivationPathIndex* _Nonnull index);
/// Returns the string description of a derivation path index.
///
/// \param path Index to get the address of.
/// \return The string description of the derivation path index.
TW_EXPORT_PROPERTY
TWString* _Nonnull TWDerivationPathIndexDescription(struct TWDerivationPathIndex* _Nonnull index);
TW_EXTERN_C_END