Sha256: 29da1e3909b07f0e9ebfccc0c87bd7dd57a438f6a9cfee5f8a1016606c992365

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('*', 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.3.0 lib/bit_wallet/wallet.rb
bit_wallet-0.2.0 lib/bit_wallet/wallet.rb