-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dcrjson: add fundrawtransaction command #1316
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,6 +240,33 @@ func NewEstimatePriorityCmd(numBlocks int64) *EstimatePriorityCmd { | |
} | ||
} | ||
|
||
// FundRawTransactionOptions represents the optional inputs to fund | ||
// a raw transaction. | ||
type FundRawTransactionOptions struct { | ||
ChangeAccount *string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The change account is not part of the equivalent bitcoind RPC (instead, any address can be provided as an option). Why is this different? |
||
LockUnspents *bool `jsonrpcdefault:"false"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not add this for now. Locking outputs doesn't actually work in dcrwallet currently. |
||
FeeRate *float64 | ||
RequiredConfirmations *int32 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bitcoind names this |
||
} | ||
|
||
// FundRawTransactionCmd is a type handling custom marshaling and | ||
// unmarshaling of fundrawtransaction JSON wallet extension commands. | ||
type FundRawTransactionCmd struct { | ||
HexString string | ||
FundAccount string | ||
Options *FundRawTransactionOptions | ||
} | ||
|
||
// NewFundRawTransactionCmd returns a new instance which can be used to issue a | ||
// fundrawtransaction JSON-RPC command. | ||
func NewFundRawTransactionCmd(hexString string, fundAccount string, options *FundRawTransactionOptions) *FundRawTransactionCmd { | ||
return &FundRawTransactionCmd{ | ||
HexString: hexString, | ||
FundAccount: fundAccount, | ||
Options: options, | ||
} | ||
} | ||
|
||
// GenerateVoteCmd is a type handling custom marshaling and | ||
// unmarshaling of generatevote JSON wallet extension commands. | ||
type GenerateVoteCmd struct { | ||
|
@@ -1270,6 +1297,7 @@ func init() { | |
MustRegisterCmd("dropvotingaccount", (*DropVotingAccountCmd)(nil), flags) | ||
MustRegisterCmd("dumpprivkey", (*DumpPrivKeyCmd)(nil), flags) | ||
MustRegisterCmd("estimatepriority", (*EstimatePriorityCmd)(nil), flags) | ||
MustRegisterCmd("fundrawtransaction", (*FundRawTransactionCmd)(nil), flags) | ||
MustRegisterCmd("generatevote", (*GenerateVoteCmd)(nil), flags) | ||
MustRegisterCmd("getaccount", (*GetAccountCmd)(nil), flags) | ||
MustRegisterCmd("getaccountaddress", (*GetAccountAddressCmd)(nil), flags) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type must use
json:"..."
struct tags to provide the key name