mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-02 02:41:28 +00:00
nem: Add nem_transaction_create_importance_transfer
This commit is contained in:
parent
9c91985674
commit
56114cc0a6
31
nem.c
31
nem.c
@ -584,3 +584,34 @@ bool nem_transaction_write_minimum_cosignatories(nem_transaction_ctx *ctx,
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool nem_transaction_create_importance_transfer(nem_transaction_ctx *ctx,
|
||||||
|
uint8_t network,
|
||||||
|
uint32_t timestamp,
|
||||||
|
const ed25519_public_key signer,
|
||||||
|
uint64_t fee,
|
||||||
|
uint32_t deadline,
|
||||||
|
uint32_t mode,
|
||||||
|
const ed25519_public_key remote) {
|
||||||
|
|
||||||
|
if (!signer) {
|
||||||
|
signer = ctx->public_key;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ret = nem_transaction_write_common(ctx,
|
||||||
|
NEM_TRANSACTION_TYPE_IMPORTANCE_TRANSFER,
|
||||||
|
network << 24 | 1,
|
||||||
|
timestamp,
|
||||||
|
signer,
|
||||||
|
fee,
|
||||||
|
deadline);
|
||||||
|
if (!ret) return false;
|
||||||
|
|
||||||
|
#define NEM_SERIALIZE \
|
||||||
|
serialize_u32(mode) \
|
||||||
|
serialize_write(remote, sizeof(ed25519_public_key))
|
||||||
|
|
||||||
|
#include "nem_serialize.h"
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
10
nem.h
10
nem.h
@ -42,6 +42,7 @@
|
|||||||
#define NEM_ADDRESS_SIZE_RAW 25
|
#define NEM_ADDRESS_SIZE_RAW 25
|
||||||
|
|
||||||
#define NEM_TRANSACTION_TYPE_TRANSFER 0x0101
|
#define NEM_TRANSACTION_TYPE_TRANSFER 0x0101
|
||||||
|
#define NEM_TRANSACTION_TYPE_IMPORTANCE_TRANSFER 0x0801
|
||||||
#define NEM_TRANSACTION_TYPE_AGGREGATE_MODIFICATION 0x1001
|
#define NEM_TRANSACTION_TYPE_AGGREGATE_MODIFICATION 0x1001
|
||||||
#define NEM_TRANSACTION_TYPE_MULTISIG_SIGNATURE 0x1002
|
#define NEM_TRANSACTION_TYPE_MULTISIG_SIGNATURE 0x1002
|
||||||
#define NEM_TRANSACTION_TYPE_MULTISIG 0x1004
|
#define NEM_TRANSACTION_TYPE_MULTISIG 0x1004
|
||||||
@ -176,4 +177,13 @@ bool nem_transaction_write_cosignatory_modification(nem_transaction_ctx *ctx,
|
|||||||
bool nem_transaction_write_minimum_cosignatories(nem_transaction_ctx *ctx,
|
bool nem_transaction_write_minimum_cosignatories(nem_transaction_ctx *ctx,
|
||||||
int32_t relative_change);
|
int32_t relative_change);
|
||||||
|
|
||||||
|
bool nem_transaction_create_importance_transfer(nem_transaction_ctx *ctx,
|
||||||
|
uint8_t network,
|
||||||
|
uint32_t timestamp,
|
||||||
|
const ed25519_public_key signer,
|
||||||
|
uint64_t fee,
|
||||||
|
uint32_t deadline,
|
||||||
|
uint32_t mode,
|
||||||
|
const ed25519_public_key remote);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user