Files

24 lines
735 B
C
Raw Permalink Normal View History

#ifndef RPC_H
#define RPC_H
#include <stddef.h>
#include "config.h"
#include "types.h"
typedef struct {
const MinerConfig *cfg;
} RpcClient;
void rpc_init(RpcClient *client, const MinerConfig *cfg);
int rpc_test_connection(RpcClient *client, char **chain_out);
int rpc_get_best_block_hash(RpcClient *client, char **hash_out);
int rpc_get_block_template(RpcClient *client, BlockTemplate *tpl);
int rpc_get_address_script_pubkey(RpcClient *client, const char *wallet_address, char **script_out);
int rpc_get_raw_transaction(RpcClient *client, const char *txid, char **raw_tx_out);
int rpc_ensure_witness_data(RpcClient *client, BlockTemplate *tpl);
int rpc_submit_block(RpcClient *client, const char *serialized_block);
#endif