Method: Hive::Broadcast.account_update
- Defined in:
- lib/hive/broadcast.rb
.account_update(options, &block) ⇒ Object
Update an account.
= {
wif: wif,
params: {
account: new_account_name,
owner: {
weight_threshold: 1,
account_auths: [],
key_auths: [[owner_public_key, 1]],
},
active: {
weight_threshold: 1,
account_auths: [],
key_auths: [[active_public_key, 1]],
},
posting: {
weight_threshold: 1,
account_auths: [],
key_auths: [[posting_public_key, 1]],
},
memo_key: memo_public_key,
json_metadata: '{}'
}
}
Hive::Broadcast.account_update()
618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 |
# File 'lib/hive/broadcast.rb', line 618 def self.account_update(, &block) required_fields = %i(account) params = [:params] if !!params[:metadata] && !!params[:json_metadata] raise Hive::ArgumentError, 'Assign either metadata or json_metadata, not both.' end = params.delete(:metadata) || {} ||= (JSON[params[:json_metadata]] || nil) || {} params[:json_metadata] = .to_json check_required_fields(params, *required_fields) ops = [[:account_update, params]] process(.merge(ops: ops), &block) end |