btcjson: Add signrawtransactionwithwallet command

This commit is contained in:
vctt94 2019-04-09 16:38:40 -03:00 committed by Mark Beamer Jr
parent ef4a45f8e2
commit acbc059f70
No known key found for this signature in database
GPG key ID: 1C314FB89AD76973
2 changed files with 27 additions and 0 deletions

View file

@ -600,6 +600,24 @@ type SignRawTransactionCmd struct {
Flags *string `jsonrpcdefault:"\"ALL\""`
}
// NewSignRawTransactionWithWalletCmd returns a new instance which can be used to issue a
// signrawtransaction JSON-RPC command.
//
// The parameters which are pointers indicate they are optional. Passing nil
// for optional parameters will use the default value.
func NewSignRawTransactionWithWalletCmd(hexEncodedTx string, inputs *[]RawTxInput) *SignRawTransactionWithWalletCmd {
return &SignRawTransactionWithWalletCmd{
RawTx: hexEncodedTx,
Inputs: inputs,
}
}
// SignRawTransactionWithWalletCmd defines the signrawtransactionwithwallet JSON-RPC command.
type SignRawTransactionWithWalletCmd struct {
RawTx string
Inputs *[]RawTxInput
}
// NewSignRawTransactionCmd returns a new instance which can be used to issue a
// signrawtransaction JSON-RPC command.
//
@ -693,6 +711,7 @@ func init() {
MustRegisterCmd("settxfee", (*SetTxFeeCmd)(nil), flags)
MustRegisterCmd("signmessage", (*SignMessageCmd)(nil), flags)
MustRegisterCmd("signrawtransaction", (*SignRawTransactionCmd)(nil), flags)
MustRegisterCmd("signrawtransactionwithwallet", (*SignRawTransactionWithWalletCmd)(nil), flags)
MustRegisterCmd("walletlock", (*WalletLockCmd)(nil), flags)
MustRegisterCmd("walletpassphrase", (*WalletPassphraseCmd)(nil), flags)
MustRegisterCmd("walletpassphrasechange", (*WalletPassphraseChangeCmd)(nil), flags)

View file

@ -137,6 +137,14 @@ type SignRawTransactionResult struct {
Errors []SignRawTransactionError `json:"errors,omitempty"`
}
// SignRawTransactionWithWalletResult models the data from the
// signrawtransactionwithwallet command.
type SignRawTransactionWithWalletResult struct {
Hex string `json:"hex"`
Complete bool `json:"complete"`
Errors []SignRawTransactionError `json:"errors,omitempty"`
}
// ValidateAddressWalletResult models the data returned by the wallet server
// validateaddress command.
type ValidateAddressWalletResult struct {