-
Notifications
You must be signed in to change notification settings - Fork 1
Account Exploration
Justin Craig-Kuhn edited this page Feb 5, 2018
·
2 revisions
This section is a work in progress.
Instantiate a new Nano::Account object by passing in a valid Nano address. These start with xrb_ or nano_.
account = Nano::Account.new('xrb_1a6juq686ztbiduiuwcco7xg1kewhss6778co4n7pw3h7nne9dxed3rg57cy')
# => #<Nano::Account:0x00000000013cb3a0 @address="xrb_1a6juq686ztbiduiuwcco7xg1kewhss6778co4n7pw3h7nne9dxed3rg57cy", @client=#<Nano::Client:0x000000000100ef28 @url="localhost:7076">>Now we can get information about the account:
account.info
# => {
"frontier"=>"FF84533A571D953A596EA401FD41743AC85D04F406E76FDE4408EAED50B473C5",
"open_block"=>"991CF190094C00F0B68E2E5F75F6BEE95A2E0BD93CEAA4A6734DB9F19B728948",
"representative_block"=>"991CF190094C00F0B68E2E5F75F6BEE95A2E0BD93CEAA4A6734DB9F19B728948",
"balance"=>235580100176034320859259343606608761791,
"modified_timestamp"=>1501793775,
"block_count"=>33
}
account.representative
# => "xrb_1a6juq686ztbiduiuwcco7xg1kewhss6778co4n7pw3h7nne9dxed3rg57cy"
account.key
# => "3068BB1CA04525BB0E416C485FE6A67FD52540227D267CC8B6E8DA958A7FA039"
account.weight
# => 850
account.delegators
# => {
"xrb_13bqhi1cdqq8yb9szneoc38qk899d58i5rcrgdk5mkdm86hekpoez3zxw5sd"=>"500000000000000000000000000000000000",
"xrb_17k6ug685154an8gri9whhe5kb5z1mf5w6y39gokc1657sh95fegm8ht1zpn"=>"961647970820730000000000000000000000"
}