mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 12:00:59 +00:00
nem: Add nem_network_name
This commit is contained in:
parent
501c778812
commit
fd0952621e
13
nem.c
13
nem.c
@ -30,6 +30,19 @@
|
|||||||
#include "ripemd160.h"
|
#include "ripemd160.h"
|
||||||
#include "sha3.h"
|
#include "sha3.h"
|
||||||
|
|
||||||
|
const char *nem_network_name(uint8_t network) {
|
||||||
|
switch (network) {
|
||||||
|
case NEM_NETWORK_MAINNET:
|
||||||
|
return "NEM Mainnet";
|
||||||
|
case NEM_NETWORK_TESTNET:
|
||||||
|
return "NEM Testnet";
|
||||||
|
case NEM_NETWORK_MIJIN:
|
||||||
|
return "Mijin";
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void nem_get_address_raw(const ed25519_public_key public_key, uint8_t version, uint8_t *address) {
|
void nem_get_address_raw(const ed25519_public_key public_key, uint8_t version, uint8_t *address) {
|
||||||
uint8_t hash[SHA3_256_DIGEST_LENGTH];
|
uint8_t hash[SHA3_256_DIGEST_LENGTH];
|
||||||
|
|
||||||
|
2
nem.h
2
nem.h
@ -33,6 +33,8 @@
|
|||||||
#define NEM_ADDRESS_SIZE 40
|
#define NEM_ADDRESS_SIZE 40
|
||||||
#define NEM_ADDRESS_SIZE_RAW 25
|
#define NEM_ADDRESS_SIZE_RAW 25
|
||||||
|
|
||||||
|
const char *nem_network_name(uint8_t network);
|
||||||
|
|
||||||
void nem_get_address_raw(const ed25519_public_key public_key, uint8_t version, uint8_t *address);
|
void nem_get_address_raw(const ed25519_public_key public_key, uint8_t version, uint8_t *address);
|
||||||
bool nem_get_address(const ed25519_public_key public_key, uint8_t version, char *address);
|
bool nem_get_address(const ed25519_public_key public_key, uint8_t version, char *address);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user