IoTeX client
|
Public Member Functions | |
Account () | |
Construct a new Account object with a new randomly generated address. | |
Account (uint8_t privateKey[IOTEX_PRIVATE_KEY_SIZE]) | |
Construct a new Account object from an existing private key. More... | |
void | getIotexAddress (char buffer[IOTEX_ADDRESS_C_STRING_SIZE]) |
Get the IoTeX address as a null terminated string. More... | |
void | getEthereumAddress (char buffer[ETH_ADDRESS_C_STRING_SIZE]) |
Get the Ethereum address as a null terminated string. More... | |
void | getEthereumAddressBytes (uint8_t buffer[ETH_ADDRESS_SIZE]) |
Get the Ethereum address as a byte array. More... | |
void | getPublicKey (uint8_t buffer[IOTEX_PUBLIC_KEY_SIZE]) |
Get the public key as a byte array. More... | |
void | getPublicKeyString (char buffer[IOTEX_PUBLIC_KEY_C_STRING_SIZE]) |
Get the public key as a null terminated string. More... | |
void | getPrivateKey (uint8_t buffer[IOTEX_PRIVATE_KEY_SIZE]) |
Get the private key as a byte array. More... | |
void | getPrivateKeyString (char buffer[IOTEX_PRIVATE_KEY_C_STRING_SIZE]) |
Get the private key as a null terminated string. More... | |
void | signMessage (const uint8_t *message, size_t size, uint8_t signature[IOTEX_SIGNATURE_SIZE]) |
Singns a message. More... | |
void | signTokenTransferAction (iotex::ResponseTypes::ActionCore_Transfer &transfer, uint8_t signature[IOTEX_SIGNATURE_SIZE]) |
Signs a token transfer action. More... | |
void | signExecutionAction (iotex::ResponseTypes::ActionCore_Execution &execution, uint8_t signature[IOTEX_SIGNATURE_SIZE], uint8_t hash[IOTEX_HASH_SIZE]=nullptr) |
Signs an execution action. More... | |
template<typename TAPI > | |
ResultCode | sendTokenTransferAction (Connection< TAPI > &conn, uint64_t nonce, uint64_t gasLimit, const char *gasPrice, const char *amount, const char *recipient, uint8_t hash[IOTEX_HASH_SIZE]) |
Sends a token transfer action to the blockchain. More... | |
template<typename TAPI > | |
ResultCode | sendExecutionAction (Connection< TAPI > &conn, uint64_t nonce, uint64_t gasLimit, const char *gasPrice, const char *amount, const char contract[IOTEX_ADDRESS_C_STRING_SIZE], IotexString data, uint8_t hash[IOTEX_HASH_SIZE]) |
Sends an execution action to the blockchain. More... | |
Account (Random *pRandomGenerator, Encoder *pEncoder, Signer *pSigner, uint8_t privateKey[IOTEX_PRIVATE_KEY_SIZE]=nullptr) | |
Account::Account | ( | uint8_t | privateKey[IOTEX_PRIVATE_KEY_SIZE] | ) |
Construct a new Account object from an existing private key.
privateKey | The private key |
void Account::getEthereumAddress | ( | char | buffer[ETH_ADDRESS_C_STRING_SIZE] | ) |
Get the Ethereum address as a null terminated string.
[out] | buffer |
void Account::getEthereumAddressBytes | ( | uint8_t | buffer[ETH_ADDRESS_SIZE] | ) |
Get the Ethereum address as a byte array.
[out] | buffer |
void Account::getIotexAddress | ( | char | buffer[IOTEX_ADDRESS_C_STRING_SIZE] | ) |
Get the IoTeX address as a null terminated string.
[out] | buffer |
void Account::getPrivateKey | ( | uint8_t | buffer[IOTEX_PRIVATE_KEY_SIZE] | ) |
Get the private key as a byte array.
[out] | buffer |
void Account::getPrivateKeyString | ( | char | buffer[IOTEX_PRIVATE_KEY_C_STRING_SIZE] | ) |
Get the private key as a null terminated string.
[out] | buffer |
void Account::getPublicKey | ( | uint8_t | buffer[IOTEX_PUBLIC_KEY_SIZE] | ) |
Get the public key as a byte array.
[out] | buffer |
void Account::getPublicKeyString | ( | char | buffer[IOTEX_PUBLIC_KEY_C_STRING_SIZE] | ) |
Get the public key as a null terminated string.
[out] | buffer |
|
inline |
Sends an execution action to the blockchain.
TAPI |
conn | The connection object | |
nonce | The account nonce | |
gasLimit | The gas limit for the action | |
gasPrice | The gas price for the action | |
amount | The amount. Can be zero | |
contract | The contract IoTeX address | |
data | The action data | |
[out] | hash | The action hash if successful |
|
inline |
Sends a token transfer action to the blockchain.
TAPI |
conn | The connection object | |
nonce | The account nonce | |
gasLimit | The gas limit for the action | |
gasPrice | The gas price for the action | |
amount | The amount to transfer | |
recipient | The recipient IoTeX address as a null terminated string | |
[out] | hash | The action hash if successful |
void Account::signExecutionAction | ( | iotex::ResponseTypes::ActionCore_Execution & | execution, |
uint8_t | signature[IOTEX_SIGNATURE_SIZE], | ||
uint8_t | hash[IOTEX_HASH_SIZE] = nullptr |
||
) |
Signs an execution action.
execution | The execution object | |
signature | The execution signature as a byte array | |
[out] | hash | Optional. The execution hash as a byte array |
void Account::signMessage | ( | const uint8_t * | message, |
size_t | size, | ||
uint8_t | signature[IOTEX_SIGNATURE_SIZE] | ||
) |
Singns a message.
message | The mesage as a byte array | |
size | The message sze in bytes | |
[out] | signature | The signed message as a byte array |
void Account::signTokenTransferAction | ( | iotex::ResponseTypes::ActionCore_Transfer & | transfer, |
uint8_t | signature[IOTEX_SIGNATURE_SIZE] | ||
) |
Signs a token transfer action.
transfer | The transfer object | |
[out] | signature | The transfer signature as a byte array |