Merge nft and tokens into a single asset header
This commit is contained in:
@@ -20,6 +20,17 @@
|
||||
#include <stdint.h>
|
||||
#include "common_utils.h"
|
||||
|
||||
// NFT
|
||||
|
||||
#define COLLECTION_NAME_MAX_LEN 70
|
||||
|
||||
typedef struct nftInfo_t {
|
||||
uint8_t contractAddress[ADDRESS_LENGTH]; // must be first item
|
||||
char collectionName[COLLECTION_NAME_MAX_LEN + 1];
|
||||
} nftInfo_t;
|
||||
|
||||
// TOKENS
|
||||
|
||||
#define MAX_TICKER_LEN 11 // 10 characters + '\0'
|
||||
#define MAX_ITEMS 2
|
||||
|
||||
@@ -31,3 +42,10 @@ typedef struct tokenDefinition_t {
|
||||
char ticker[MAX_TICKER_LEN];
|
||||
uint8_t decimals;
|
||||
} tokenDefinition_t;
|
||||
|
||||
// UNION
|
||||
|
||||
typedef union extraInfo_t {
|
||||
tokenDefinition_t token;
|
||||
nftInfo_t nft;
|
||||
} extraInfo_t;
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "tokens.h"
|
||||
#include "asset_info.h"
|
||||
#include "common_utils.h"
|
||||
|
||||
void array_hexstr(char *strbuf, const void *bin, unsigned int len) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "os.h"
|
||||
#include "cx.h"
|
||||
#include "tokens.h"
|
||||
#include "asset_info.h"
|
||||
#include "tx_content.h"
|
||||
|
||||
/*************************************************************************************************
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "tokens.h"
|
||||
#include "nft.h"
|
||||
|
||||
typedef union extraInfo_t {
|
||||
tokenDefinition_t token;
|
||||
nftInfo_t nft;
|
||||
} extraInfo_t;
|
||||
@@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define COLLECTION_NAME_MAX_LEN 70
|
||||
|
||||
typedef struct nftInfo_t {
|
||||
uint8_t contractAddress[ADDRESS_LENGTH]; // must be first item
|
||||
char collectionName[COLLECTION_NAME_MAX_LEN + 1];
|
||||
} nftInfo_t;
|
||||
Reference in New Issue
Block a user