-
Notifications
You must be signed in to change notification settings - Fork 205
/
Copy pathIRpcService.cs
158 lines (133 loc) · 7.58 KB
/
IRpcService.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
// Copyright (c) 2014 - 2016 George Kimionis
// See the accompanying file LICENSE for the Software License Aggrement
using System.Collections.Generic;
using BitcoinLib.Requests.AddNode;
using BitcoinLib.Requests.CreateRawTransaction;
using BitcoinLib.Requests.FundRawTransaction;
using BitcoinLib.Requests.SignRawTransaction;
using BitcoinLib.Responses;
namespace BitcoinLib.Services.RpcServices.RpcService
{
public interface IRpcService
{
#region Blockchain
string GetBestBlockHash();
GetBlockResponse GetBlock(string hash, bool verbose = true);
GetBlockResponseVerbose GetBlock(string hash, int verbosity);
GetBlockchainInfoResponse GetBlockchainInfo();
uint GetBlockCount();
string GetBlockHash(long index);
// getblockheader
// getchaintips
double GetDifficulty();
List<GetChainTipsResponse> GetChainTips();
GetMemPoolInfoResponse GetMemPoolInfo();
GetRawMemPoolResponse GetRawMemPool(bool verbose = false);
GetTransactionResponse GetTxOut(string txId, int n, bool includeMemPool = true);
// gettxoutproof["txid",...] ( blockhash )
GetTxOutSetInfoResponse GetTxOutSetInfo();
bool VerifyChain(ushort checkLevel = 3, uint numBlocks = 288); // Note: numBlocks: 0 => ALL
#endregion
#region Control
GetInfoResponse GetInfo();
string Help(string command = null);
string Stop();
#endregion
#region Generating
// generate numblocks
bool GetGenerate();
string SetGenerate(bool generate, short generatingProcessorsLimit);
#endregion
#region Mining
GetBlockTemplateResponse GetBlockTemplate(params object[] parameters);
GetMiningInfoResponse GetMiningInfo();
ulong GetNetworkHashPs(uint blocks = 120, long height = -1);
bool PrioritiseTransaction(string txId, decimal priorityDelta, decimal feeDelta);
string SubmitBlock(string hexData, params object[] parameters);
#endregion
#region Network
void AddNode(string node, NodeAction action);
// clearbanned
// disconnectnode
GetAddedNodeInfoResponse GetAddedNodeInfo(string dns, string node = null);
int GetConnectionCount();
GetNetTotalsResponse GetNetTotals();
GetNetworkInfoResponse GetNetworkInfo();
List<GetPeerInfoResponse> GetPeerInfo();
// listbanned
void Ping();
// setban
#endregion
#region Rawtransactions
string CreateRawTransaction(CreateRawTransactionRequest rawTransaction);
DecodeRawTransactionResponse DecodeRawTransaction(string rawTransactionHexString);
DecodeScriptResponse DecodeScript(string hexString);
// fundrawtransaction
GetRawTransactionResponse GetRawTransaction(string txId, int verbose = 0);
string SendRawTransaction(string rawTransactionHexString, bool? allowHighFees = false);
SignRawTransactionResponse SignRawTransaction(SignRawTransactionRequest signRawTransactionRequest);
SignRawTransactionWithKeyResponse SignRawTransactionWithKey(SignRawTransactionWithKeyRequest signRawTransactionWithKeyRequest);
SignRawTransactionWithWalletResponse SignRawTransactionWithWallet(SignRawTransactionWithWalletRequest signRawTransactionWithWalletRequest);
GetFundRawTransactionResponse GetFundRawTransaction(string rawTransactionHex, FundRawTransactionOptions options = null);
#endregion
#region Util
CreateMultiSigResponse CreateMultiSig(int nRquired, List<string> publicKeys);
decimal EstimateFee(ushort nBlocks);
EstimateSmartFeeResponse EstimateSmartFee(ushort nBlocks);
decimal EstimatePriority(ushort nBlocks);
// estimatesmartfee
// estimatesmartpriority
ValidateAddressResponse ValidateAddress(string bitcoinAddress);
bool VerifyMessage(string bitcoinAddress, string signature, string message);
#endregion
#region Wallet
// abandontransaction
string AddMultiSigAddress(int nRquired, List<string> publicKeys, string account = null);
string AddWitnessAddress(string address);
void BackupWallet(string destination);
string DumpPrivKey(string bitcoinAddress);
void DumpWallet(string filename);
string GetAccount(string bitcoinAddress);
string GetAccountAddress(string account);
List<string> GetAddressesByAccount(string account);
Dictionary<string, GetAddressesByLabelResponse> GetAddressesByLabel(string label);
GetAddressInfoResponse GetAddressInfo(string bitcoinAddress);
decimal GetBalance(string account = null, int minConf = 1, bool? includeWatchonly = null);
string GetNewAddress(string account = "");
string GetRawChangeAddress();
decimal GetReceivedByAccount(string account, int minConf = 1);
decimal GetReceivedByAddress(string bitcoinAddress, int minConf = 1);
decimal GetReceivedByLabel(string account, int minConf = 1);
GetTransactionResponse GetTransaction(string txId, bool? includeWatchonly = null);
decimal GetUnconfirmedBalance();
GetWalletInfoResponse GetWalletInfo();
void ImportAddress(string address, string label = null, bool rescan = true);
string ImportPrivKey(string privateKey, string label = null, bool rescan = true);
// importpubkey
void ImportWallet(string filename);
string KeyPoolRefill(uint newSize = 100);
Dictionary<string, decimal> ListAccounts(int minConf = 1, bool? includeWatchonly = null);
List<List<ListAddressGroupingsResponse>> ListAddressGroupings();
List<string> ListLabels();
string ListLockUnspent();
List<ListReceivedByAccountResponse> ListReceivedByAccount(int minConf = 1, bool includeEmpty = false, bool? includeWatchonly = null);
List<ListReceivedByAddressResponse> ListReceivedByAddress(int minConf = 1, bool includeEmpty = false, bool? includeWatchonly = null);
List<ListReceivedByLabelResponse> ListReceivedByLabel(int minConf = 1, bool includeEmpty = false, bool? includeWatchonly = null);
ListSinceBlockResponse ListSinceBlock(string blockHash = null, int targetConfirmations = 1, bool? includeWatchonly = null);
List<ListTransactionsResponse> ListTransactions(string account = null, int count = 10, int from = 0, bool? includeWatchonly = null);
List<ListUnspentResponse> ListUnspent(int minConf = 1, int maxConf = 9999999, List<string> addresses = null);
bool LockUnspent(bool unlock, IList<ListUnspentResponse> listUnspentResponses);
bool Move(string fromAccount, string toAccount, decimal amount, int minConf = 1, string comment = "");
string SendFrom(string fromAccount, string toBitcoinAddress, decimal amount, int minConf = 1, string comment = null, string commentTo = null);
string SendMany(string fromAccount, Dictionary<string, decimal> toBitcoinAddress, int minConf = 1, string comment = null);
string SendToAddress(string bitcoinAddress, decimal amount, string comment = null, string commentTo = null, bool subtractFeeFromAmount = false);
string SetAccount(string bitcoinAddress, string account);
string SetLabel(string bitcoinAddress, string label);
string SetTxFee(decimal amount);
string SignMessage(string bitcoinAddress, string message);
string WalletLock();
string WalletPassphrase(string passphrase, int timeoutInSeconds);
string WalletPassphraseChange(string oldPassphrase, string newPassphrase);
#endregion
}
}