Sha256: 7208193ea29454691141c49608dd4b56a1236bd941865e799b874ae8d21d4507

Contents?: true

Size: 576 Bytes

Versions: 2

Compression:

Stored size: 576 Bytes

Contents

module BitWallet
  class Wallet

    def initialize(config={})
      @config = config
    end

    def accounts
      @accounts ||= Accounts.new(self)
    end

    def recent_transactions(options={})
      count = options.delete(:limit) || 10
      client.listtransactions(nil, count).map do |hash|
        Transaction.new self, hash
      end
    end

    private

    def client
      @client ||= Bitcoin::Client.new(@config[:username],
                                      @config[:password],
                                      @config.slice(:port))
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bit_wallet-0.1.1 lib/bit_wallet/wallet.rb
bit_wallet-0.1.0 lib/bit_wallet/wallet.rb