-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Bitcoin Core RPC Methods
Here is a list of Methods that provided on bitcoin core
all of them will be auto-generated for us
with a bit small amount of work
- abandontransaction
- addmultisigaddress
- addnode
- addwitnessaddress
- backupwallet
- bumpfee
- clearbanned
- createmultisig
- createrawtransaction
- decoderawtransaction
- decodescript
- disconnectnode
- dumpprivkey
- dumpwallet
- encryptwallet
- estimatefee
- estimatepriority
- fundrawtransaction
- generate
- generatetoaddress
- getaccountaddress
- getaccount
- getaddednodeinfo
- getaddressesbyaccount
- getbalance
- getbestblockhash
- getblock
- getblockchaininfo
- getblockcount
- getblockhash
- getblockheader
- getblocktemplate
- getchaintips
- getconnectioncount
- getdifficulty
- getgenerate
- gethashespersec
- getinfo
- getmemoryinfo
- getmempoolancestors
- getmempooldescendants
- getmempoolentry
- getmempoolinfo
- getmininginfo
- getnettotals
- getnetworkhashps
- getnetworkinfo
- getnewaddress
- getpeerinfo
- getrawchangeaddress
- getrawmempool
- getrawtransaction
- getreceivedbyaccount
- getreceivedbyaddress
- gettransaction
- gettxout
- gettxoutproof
- gettxoutsetinfo
- getunconfirmedbalance
- getwalletinfo
- getwork
- importaddress
- importmulti
- importprivkey
- importprunedfunds
- importwallet
- keypoolrefill
- listaccounts
- listaddressgroupings
- listbanned
- listlockunspent
- listreceivedbyaccount
- listreceivedbyaddress
- listsinceblock
- listtransactions
- listunspent
- lockunspent
- ping-rpc
- preciousblock
- prioritisetransaction
- pruneblockchain
- removeprunedfunds
- sendfrom
- sendmany
- sendrawtransaction
- sendtoaddress
- setaccount
- setban
- setgenerate
- setnetworkactive
- settxfee
- signmessage
- signmessagewithprivkey
- signrawtransaction
- submitblock
- validateaddress
- verifychain
- verifymessage
- verifytxoutproof
- walletlock
- walletpassphrase
- walletpassphrasechange
Wanna Help ?
- Fork & Clone it in your local machine
- Chose a Method From Above, and you should check if there is no PR created for it.
- Create a new branch, the branch name should be in this format
bitclient-{methodname} - Add the Method to a new
jsonfile named after the method name insrc/methodsSee below. - Create a PR with
(feat): Adding {methodname} to Bitclient - after adding it and your PR has been accepted, kindly delete your branch and rebase.
- Thank you ❤️
How To Add Methods
the structure of json file is really simple, here is an example of getaccount method
"getAccount": {
"description": "The getaccount RPC returns the name of the account associated with the given address.",
"spec": "https://bitcoin.org/en/developer-reference#getaccount",
"params": {
"address": {
"type": "string",
"required": true,
"description": "A P2PKH or P2SH Bitcoin address belonging either to a specific account or the default account (“”)"
}
},
"result": {
"type": "string",
"required": true,
"description": "The name of an account, or an empty string (“”, the default account)"
}
}all information has been copied from the method reference.
but some times the return type is got complex, like here in this method getblockchaininfo, the generator is just smart to convert these types from json to typescript interfaces.
"getBlockChainInfo": {
"description": "The getblockchaininfo RPC provides information about the current state of the block chain.",
"spec": "https://bitcoin.org/en/developer-reference#getblockchaininfo",
"params": {},
"result": {
"type": {
"chain": "string",
"blocks": 0,
"headers": 0,
"bestblockhash": "string",
"difficulty": 0,
"mediantime": 0,
"verificationprogress": 0,
"chainwork": "string",
"pruned": true,
"softforks": [
{
"id": "string",
"version": 0,
"reject": {
"status": true
}
}
],
"bip9_softforks": {
"csv": {
"status": "string",
"startTime": 0,
"timeout": 0,
"since": 0
},
"segwit": {
"status": "string",
"bit": 0,
"startTime": 0,
"timeout": 0,
"since": 0
}
}
},
"required": true,
"description": ""
}
}you just have to copy the method's response example provided by it's reference, BUT with some modifications
Methods Spec:
- All Method Names should be in
lowerCamalCase, also for the parameters name. - If the method takes no
paramsjust make theparamsobject empty"params": {} - if the one of the
paramsis optional set"required"tofalse(:trollface: ). - If the
resultis anObjectyou should edit the values to this- type of
numberjust make it0( it could be any arbitrary number) - type of
stringmake it"string"( it could be any arbitrary string but let's make it a spec) - type of
booleanmake ittrue( it could be any false too)
- type of
- same goes to the
params⬆️ .
see more examples in the json files, it will help you a lot.
Metadata
Metadata
Assignees
Labels
No labels