Add wallet commands to JSON-RPC client #73
1 changed files with 7 additions and 10 deletions
|
@ -603,14 +603,10 @@ func (d *Client) AccountAdd(accountName string, seed *string, privateKey *string
|
||||||
}
|
}
|
||||||
|
|
||||||
type WalletCreateOpts struct {
|
type WalletCreateOpts struct {
|
||||||
SkipOnStartup bool `json:"skip_on_startup,omitempty"`
|
ID string `json:"wallet_id"`
|
||||||
CreateAccount bool `json:"create_account,omitempty"`
|
SkipOnStartup bool `json:"skip_on_startup,omitempty"`
|
||||||
SingleKey bool `json:"single_key,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) {
|
func (d *Client) WalletCreate(id string, opts *WalletCreateOpts) (*Wallet, error) {
|
||||||
|
@ -618,8 +614,9 @@ func (d *Client) WalletCreate(id string, opts *WalletCreateOpts) (*Wallet, error
|
||||||
if opts == nil {
|
if opts == nil {
|
||||||
opts = &WalletCreateOpts{}
|
opts = &WalletCreateOpts{}
|
||||||
}
|
}
|
||||||
args := WalletCreateArgs{ID: id, WalletCreateOpts: *opts}
|
opts.ID = id
|
||||||
return response, d.call(response, "wallet_create", structs.Map(args))
|
structs.DefaultTagName = "json"
|
||||||
|
return response, d.call(response, "wallet_create", structs.Map(opts))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Client) WalletAdd(id string) (*Wallet, error) {
|
func (d *Client) WalletAdd(id string) (*Wallet, error) {
|
||||||
|
|
Loading…
Reference in a new issue