Fix wallet opts passing
This commit is contained in:
parent
c68c7e05fe
commit
49c9531404
1 changed files with 7 additions and 10 deletions
|
@ -603,23 +603,20 @@ func (d *Client) AccountAdd(accountName string, seed *string, privateKey *string
|
|||
}
|
||||
|
||||
type WalletCreateOpts struct {
|
||||
ID string `json:"wallet_id"`
|
||||
SkipOnStartup bool `json:"skip_on_startup,omitempty"`
|
||||
CreateAccount bool `json:"create_account,omitempty"`
|
||||
SingleKey bool `json:"single_key,omitempty"`
|
||||
}
|
||||
|
||||
type WalletCreateArgs struct {
|
||||
WalletCreateOpts
|
||||
ID string `json:"wallet_id"`
|
||||
}
|
||||
|
||||
func (d *Client) WalletCreate(id string, opts *WalletCreateOpts) (*Wallet, error) {
|
||||
response := new(Wallet)
|
||||
if opts == nil {
|
||||
opts = &WalletCreateOpts{}
|
||||
}
|
||||
args := WalletCreateArgs{ID: id, WalletCreateOpts: *opts}
|
||||
return response, d.call(response, "wallet_create", structs.Map(args))
|
||||
opts.ID = id
|
||||
structs.DefaultTagName = "json"
|
||||
return response, d.call(response, "wallet_create", structs.Map(opts))
|
||||
}
|
||||
|
||||
func (d *Client) WalletAdd(id string) (*Wallet, error) {
|
||||
|
|
Loading…
Reference in a new issue