class Blockchain::Xpub

Attributes

account_index[R]
change_index[R]
gap_limit[R]

Public Class Methods

new(x) click to toggle source
# File lib/blockchain/blockexplorer.rb, line 254
def initialize(x)
    addr = x['addresses'][0]
    @change_index = addr['change_index']
    @account_index = addr['account_index']
    @gap_limit = addr['gap_limit']
    @hash160 = addr['hash160'] == nil ? nil : addr['hash160']
    @address = addr['address']
                @n_tx = addr['n_tx']
                @total_received = addr['total_received']
                @total_sent = addr['total_sent']
                @final_balance = addr['final_balance']
                @transactions = addr['txs'] == nil ? nil : addr['txs'].map{ |tx| Transaction.new(tx) }
end