Method: Hive::Broadcast.create_claimed_account
- Defined in:
- lib/hive/broadcast.rb
.create_claimed_account(options, &block) ⇒ Object
Create a claimed account.
= {
wif: wif,
params: {
creator: creator_account_name,
new_account_name: 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.create_claimed_account()
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 |
# File 'lib/hive/broadcast.rb', line 559 def self.create_claimed_account(, &block) required_fields = %i(creator new_account_name owner active posting memo_key json_metadata) 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) params[:extensions] ||= [] ops = [[:create_claimed_account, params]] process(.merge(ops: ops), &block) end |