2022-03-07 14:21:32 +01:00
|
|
|
#ifndef _ERC721_PLUGIN_H_
|
|
|
|
|
#define _ERC721_PLUGIN_H_
|
2021-12-17 12:04:51 +01:00
|
|
|
|
2022-03-07 14:21:32 +01:00
|
|
|
#ifdef HAVE_NFT_SUPPORT
|
2021-11-22 14:39:36 +01:00
|
|
|
|
2022-03-08 17:59:36 +01:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include "ethUstream.h"
|
2024-01-16 17:17:42 +01:00
|
|
|
#include "asset_info.h"
|
2024-08-01 16:50:46 +02:00
|
|
|
#include "eth_plugin_interface.h"
|
2021-11-22 14:39:36 +01:00
|
|
|
|
|
|
|
|
// Internal plugin for EIP 721: https://eips.ethereum.org/EIPS/eip-721
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
APPROVE,
|
|
|
|
|
SET_APPROVAL_FOR_ALL,
|
|
|
|
|
TRANSFER,
|
|
|
|
|
SAFE_TRANSFER,
|
|
|
|
|
SAFE_TRANSFER_DATA,
|
2022-03-08 18:19:07 +01:00
|
|
|
SELECTORS_COUNT
|
2021-11-22 14:39:36 +01:00
|
|
|
} erc721_selector_t;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
FROM,
|
|
|
|
|
TO,
|
|
|
|
|
DATA,
|
|
|
|
|
TOKEN_ID,
|
|
|
|
|
OPERATOR,
|
|
|
|
|
APPROVED,
|
|
|
|
|
NONE,
|
|
|
|
|
} erc721_selector_field;
|
|
|
|
|
|
|
|
|
|
typedef struct erc721_context_t {
|
|
|
|
|
uint8_t address[ADDRESS_LENGTH];
|
|
|
|
|
uint8_t tokenId[INT256_LENGTH];
|
|
|
|
|
|
|
|
|
|
bool approved;
|
|
|
|
|
|
|
|
|
|
erc721_selector_field next_param;
|
|
|
|
|
uint8_t selectorIndex;
|
|
|
|
|
} erc721_context_t;
|
|
|
|
|
|
2024-08-01 16:50:46 +02:00
|
|
|
void handle_provide_parameter_721(ethPluginProvideParameter_t *parameters);
|
|
|
|
|
void handle_query_contract_ui_721(ethQueryContractUI_t *parameters);
|
2021-12-17 12:04:51 +01:00
|
|
|
|
2022-01-14 17:32:17 +01:00
|
|
|
#endif // HAVE_NFT_SUPPORT
|
2022-03-07 14:21:32 +01:00
|
|
|
|
|
|
|
|
#endif // _ERC721_PLUGIN_H_
|