Add sign raw transaction with wallet #1

Merged
tiger5226 merged 4 commits from addSignRawTransactionWithWallet into master 2020-02-03 04:02:24 +01:00
2 changed files with 27 additions and 0 deletions
Showing only changes of commit acbc059f70 - Show all commits

View file

@ -600,6 +600,24 @@ type SignRawTransactionCmd struct {
Flags *string `jsonrpcdefault:"\"ALL\""` 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 // NewSignRawTransactionCmd returns a new instance which can be used to issue a
// signrawtransaction JSON-RPC command. // signrawtransaction JSON-RPC command.
// //
@ -693,6 +711,7 @@ func init() {
MustRegisterCmd("settxfee", (*SetTxFeeCmd)(nil), flags) MustRegisterCmd("settxfee", (*SetTxFeeCmd)(nil), flags)
MustRegisterCmd("signmessage", (*SignMessageCmd)(nil), flags) MustRegisterCmd("signmessage", (*SignMessageCmd)(nil), flags)
MustRegisterCmd("signrawtransaction", (*SignRawTransactionCmd)(nil), flags) MustRegisterCmd("signrawtransaction", (*SignRawTransactionCmd)(nil), flags)
MustRegisterCmd("signrawtransactionwithwallet", (*SignRawTransactionWithWalletCmd)(nil), flags)
MustRegisterCmd("walletlock", (*WalletLockCmd)(nil), flags) MustRegisterCmd("walletlock", (*WalletLockCmd)(nil), flags)
MustRegisterCmd("walletpassphrase", (*WalletPassphraseCmd)(nil), flags) MustRegisterCmd("walletpassphrase", (*WalletPassphraseCmd)(nil), flags)
MustRegisterCmd("walletpassphrasechange", (*WalletPassphraseChangeCmd)(nil), flags) MustRegisterCmd("walletpassphrasechange", (*WalletPassphraseChangeCmd)(nil), flags)

View file

@ -137,6 +137,14 @@ type SignRawTransactionResult struct {
Errors []SignRawTransactionError `json:"errors,omitempty"` 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 // ValidateAddressWalletResult models the data returned by the wallet server
// validateaddress command. // validateaddress command.
type ValidateAddressWalletResult struct { type ValidateAddressWalletResult struct {