Commit graph

159 commits

Author SHA1 Message Date
Romashka
821114285b
typo-Update register_test.go (#2291) 2025-01-09 08:32:50 -05:00
Oliver Gugger
ed879eac20
btcjson: turn warnings into StringOrArray type
Fixes #2224 and lightningnetwork/lnd#9053.

Depending on the version of Bitcoin Core, the "warnings" field in the
response to getnetworkinfo is either a single string value or an array
of strings.
We can easily parse those two variants with a custom type that
implements an UnmarshalJSON method.
2024-09-02 15:38:35 +02:00
Bruno Garcia
1a1dd2a2b3
btcjson: check if both begin and end are numbers in UnmarshalJSON 2024-08-23 12:22:54 -07:00
coderwander
11bd614171
Fix struct names (#2169)
Signed-off-by: coderwander <770732124@qq.com>
2024-06-19 11:38:54 -04:00
lilasxie
cccaa5f9b0 refactor: specify strconv.ParseFloat bitsize to 64 2024-06-03 18:28:21 +08:00
Olaoluwa Osuntokun
ae5533602c
Merge pull request #2142 from YusukeShimizu/feeRate-BTCkvB
btcclient+btcjson: defaultMaxFeeRate to BTC/kvB
2024-04-02 19:19:26 -07:00
bruwbird
80b27f5471
btcclient+btcjson: add type alias for BTC/kvB
Added type alias BTC/kvB to explicitly indicate that
it represents the fee in BTC for a transaction size of 1 kB.
Because bitcoind uses its own fee rate type
(BTC/kvB instead of sat/kWU we use in lnd),
define the type in btcjson package,
as it's the only place where we actually use BTC/kvB.
2024-03-27 17:58:12 +09:00
bruwbird
bbb6967247
btcclient+btcjson: feeRate to BTC/kvB
defaultMaxFeeRate was set to 1e8 / 10(sat/kb) as a parameter.
But BTC/kvB is the expected value, so the units was wrong.
This commit updates defaultMaxFeeRate to BTC/kvB and sets it to 0.1,
which is the default value of Bitcoin Core.
This commit also updates the comment to reflect the change.

Because maxFeeRate sanity check has been added in
bitcoin core v27.0 or later,
sendrawtransaction cannot be executed without this change.
2024-03-27 17:58:12 +09:00
mattn
3cb9f602e8
fix typos (#2100) 2024-03-25 09:44:25 -04:00
yyforyongyu
dd31767617
btcjson: add new command GetTxSpendingPrevOutCmd 2024-02-27 22:58:33 +08:00
Nikolay Bryskin
069a0eca29
Added 'include_unsafe' option to FundRawTransaction 2024-02-05 14:55:17 +02:00
yyforyongyu
c7e40280d5
rpcclient: support testmempoolaccept for bitcoind 2024-01-15 17:22:41 +08:00
yyforyongyu
ca4261f028
btcjson: add TestMempoolAcceptCmd 2024-01-15 17:22:40 +08:00
Olaoluwa Osuntokun
f7e9fba086
Merge pull request #1918 from kcalvinalvin/2022-11-06-implement-getchaintips
blockchain, btcjson: Implement getchaintips rpc call
2023-11-14 17:16:15 -08:00
Oliver Gugger
6f93d9f40d
Merge pull request #1969 from lindlof/rpc-address-align
Add address field (rpc client & server)
2023-08-03 08:17:30 +02:00
Calvin Kim
892ae679b3 btcjson, main: Implement the getchaintips call
getchaintips call is implemented and the behavior mimics that of Bitcoin
Core. Resolves https://github.com/btcsuite/btcd/issues/1912.
2023-07-16 16:03:48 +09:00
cui fliter
e160bb6922 multi: remove repetitive the
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-06-26 15:40:51 +08:00
Calvin Kim
ba5407615d multi: Run gofmt on the entire repository
The doc formatting changes introduced in the recent go version is
increasing the diff for all of the new commits.  Formatting it all in
this commit will help the readability of future PRs by reducing the
diff.
2023-06-21 22:31:09 +09:00
Mikael Lindlof
e4c88c3a3e rpc: Add ScriptPubKeyResult address field 2023-06-06 21:57:01 +01:00
Jonathan Chappelow
788fb8faf8 rpcclient: add getnewaddresstype and revert breaking change
This reverts the previous breaking change to the GetNewAddress and
GetRawChangeAddress rpcclient.Client methods, and adds the methods
GetNewAddressType and GetRawChangeAddressType for requesting
an address of a certain type.  This change allows the rpcclient package
to continue to work with versions of the btcwallet app that do not
recognize the address type parameter.
2022-04-14 11:25:56 -05:00
Torkel Rogstad
85b6f7ed2a rpcclient: add getzmqnotifications RPC 2022-04-09 07:46:07 -04:00
Jonathan Chappelow
7eaf360063 btcjson: add addresstype arg to getrawchangeaddress 2022-04-09 07:38:57 -04:00
Jonathan Chappelow
061aef98af btcjson: add addresstype arg to getnewaddress 2022-04-09 07:38:57 -04:00
dekokun
796f1746b3 btcjson: Update the fields of GetNetworkInfoResult
Update the fields of GetNetworkInfoResult to reflect the current number
of inbound and outbound peer connections.

* ConnectionsIn - The number of inbound peer connections
* ConnectionsOut - The number of outbound peer connections
2022-04-09 07:01:50 -04:00
James Smoot
71c844310a Default to JSONRPC 1.0 if the rpcVersion empty 2022-04-09 06:55:59 -04:00
Olaoluwa Osuntokun
0b245cca4f
btcjson+rpc: add min activation height to soft fork RPC response 2022-01-25 15:27:52 -08:00
Olaoluwa Osuntokun
caac0f821a
multi: update btcutil imports to point to new sub-module
In this commit, we update all the btcutil imports to point to the new
sub-module.

In the same commit, we also modify the recently added `btcutil/go.mod`
file as we need to continue pointing to the _old_ version of btcd, until
we merge this PR and push a new tag.
2022-01-10 18:44:58 -08:00
Gabriel Nasr
505915dc3f btcjson: Update WalletCreateFundedPsbtOpts.FeeRate from *int64 to *float64 2021-06-25 15:23:44 -03:00
Aurèle Oulès
2d7825cf70 btcjson: Updated TxRawResult.Version from int32 to uint32 2021-04-13 15:21:09 -04:00
Jake Sylvestre
d08785547a docs: update shields 2021-03-05 07:45:19 -05:00
Jake Sylvestre
2a1aa5129e Add Batch JSON-RPC support (rpc client & server) 2021-02-09 09:47:46 -05:00
Steven Kreuzer
7bbd9b0284 btcjson: Update fields in GetBlockChainInfoResult
Update the fields of GetBlockChainInfoResult to reflect the current state of
the RPC returned by other full-node implementations.

 * InitialBlockDownload - Node is in Initial Block Download mode if True.
 * SizeOnDisk - The estimated size of the block and undo files on disk.
2021-01-26 09:52:38 -05:00
Vinayak Borkar
c3ece697da Fixes btcsuite/btcd#1653 2021-01-18 13:51:45 -05:00
Oliver Gugger
9e8bb3eddb
btcjson+rpcserverhelp: restore bitcoind compatibility
The PR #1594 introduced a change that made the order of parameters
relevant, if one of them is nil. This makes it harder to be backward
compatible with the same JSON message if an existing parameter in
bitcoind was re-purposed to have a different meaning.
2020-11-12 15:47:51 +01:00
Anirudha Bose
535f25593d rpcclient: implement createwallet with functional options 2020-10-26 14:54:05 -04:00
Anirudha Bose
5e56ca05e1 btcjson: add new JSON-RPC errors and document them 2020-10-26 09:35:46 -04:00
Torkel Rogstad
1d75e0a885 rpcclient: add more wallet commands
Implement backupwallet, dumpwallet, loadwallet and unloadwallet.
2020-10-26 09:34:56 -04:00
David Mazary
6adfc07d1e Unmarshal hashes/second as float in GetMiningInfoResult 2020-10-26 09:33:28 -04:00
Anirudha Bose
6519c04a6f rpcclient: implement gettxoutsetinfo command 2020-10-05 10:03:47 -04:00
Henry Fisher
584c382334 rpc: add signrawtransactionwithwallet interface
Adds interface for issuing a signrawtransactionwithwallet command.
Note that this does not add functionality for the btcd rpc server
itself, it simply assumes that the RPC client has this ability and gives
an API for interacting with the RPC client.

rpc: add signrawtransactionwithwallet interface
2020-10-05 09:56:12 -04:00
Anirudha Bose
0bf42f4476 rpcserver: add txid to getblocktemplate response 2020-10-05 09:55:45 -04:00
Anirudha Bose
e9a51e8dcd rpcclient: implement getwalletinfo command 2020-09-25 12:18:06 -04:00
Anirudha Bose
ac3f235eb9 rpcclient: implement getaddressinfo command
Fields such as label, and labelspurpose are not included, since they
are deprecated, and will be removed in Bitcoin Core 0.21.
2020-09-21 09:47:58 -04:00
Elliott Minns
6daaf73544
GetBlockTemplate RPC client implementation (#1629)
* GetBlockTemplate RPC client implementation

* Txid added to the getblocktemplate result

* Omitempty for TxID and improved comment for GetBlockTemplate 'rules' field
2020-09-21 09:42:35 -04:00
Anirudha Bose
f4024160f3 btcjson: add test for null params in searchrawtransactions
Closes PR #1476.
2020-09-21 09:42:09 -04:00
Anirudha Bose
c693bd8bc5 rpcclient: add deriveaddresses RPC command 2020-09-14 10:30:47 -04:00
Andrew Tugarinov
5ae1f21cd9 Added ListSinceBlockMinConfWatchOnly method. 2020-09-14 09:48:40 -04:00
Federico Bond
6f49f1f194 btcjson,rpcclient: add support for PSBT commands to rpcclient 2020-09-14 09:37:27 -04:00
Mikael Lindlof
fff96610aa rpc: Add getnodeaddresses JSON-RPC support
Add NodeAddresses function to rpcserverConnManager
interface for fetching known node addresses.
2020-09-14 09:36:05 -04:00
Mikael Lindlof
eb05726dac Nullable optional JSON-RPC parameters
Fix command marshalling dropping params following params with nil value.

#1591 Allow specifying null parameter value from command line.
2020-09-08 10:01:44 -04:00