Cleanup accounts jsonrpc code

This commit is contained in:
Andrey Beletsky 2019-05-24 21:52:04 +07:00
parent 630260d0b1
commit 818b00190d
2 changed files with 11 additions and 15 deletions

View file

@ -182,15 +182,10 @@ func (d *Client) AccountFund(fromAccount string, toAccount string, amount string
func (d *Client) AccountCreate(accountName string, singleKey bool) (*AccountCreateResponse, error) {
response := new(AccountCreateResponse)
args := struct {
AccountName string `json:"account_name"`
SingleKey bool `json:"single_key"`
}{
AccountName: accountName,
SingleKey: singleKey,
}
structs.DefaultTagName = "json"
return response, d.call(response, "account_create", structs.Map(args))
return response, d.call(response, "account_create", map[string]interface{}{
"account_name": accountName,
"single_key": singleKey,
})
}
func (d *Client) AccountRemove(accountID string) (*AccountRemoveResponse, error) {

View file

@ -213,12 +213,13 @@ type AccountListResponse struct {
type AccountBalanceResponse string
type AccountCreateResponse struct {
ID string `json:"id"`
Name string `json:"name"`
PublicKey string `json:"public_key"`
PrivateKey string `json:"private_key"`
Seed string `json:"seed"`
Ledger string `json:"ledger"`
ID string `json:"id"`
Name string `json:"name"`
PublicKey string `json:"public_key"`
PrivateKey string `json:"private_key"`
Seed string `json:"seed"`
Ledger string `json:"ledger"`
ModifiedOn float64 `json:"modified_on"`
}
type AccountRemoveResponse AccountCreateResponse