class Blockio::Client

Defined in:

blockio/main.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(api_key : String, pin : String) #

[View source]

Instance Method Detail

def archive_addresses(addresses : Array(String), kind : AddressType = AddressType::Address) #

Archives upto 100 addresses in a single API call. Addresses can be specified by their labels.


[View source]
def get_address_balance(addresses) #

Returns the balance of the specified addresses, or labels. (Can be used to query balances for external (non-account) addresses. If an external address' balance is returned, its user_id and label fields will be null.)

TODO implement allowance of labels


[View source]
def get_address_by_label(label : String) #

Returns the address specified by a label.


[View source]
def get_balance #

Returns the balance of your entire Bitcoin, Litecoin, or Dogecoin account (i.e., the sum of balances of all addresses/users within it) as numbers to 8 decimal points, as strings.


[View source]
def get_current_price(base_currency : String = "") #

Returns the prices from the largest exchanges for Bitcoin, Dogecoin, or Litecoin, specified by the API Key. Specifying the base currency is optional.


[View source]
def get_my_addresses #

Returns the (unarchived) addresses, their labels, user ids, and balances on your account. (Do not use this if you plan on having more than 2,500 addresses on your account. Use get_address_balance instead.)


[View source]
def get_my_addresses_without_balances #

Returns all the (unarchived) addresses, their labels, and user ids on your account.


[View source]
def get_my_archived_addresses #

Returns all the archived addresses, their labels, and user ids on your account.


[View source]
def get_network_fee_estimate #

Estimates the Network Fee you will need to pay when you make a withdrawal request. The Network Fee is required by the Bitcoin/Dogecoin/etc. networks, not Block.io.


[View source]
def get_new_address(label : String = "") #

Returns a newly generated address, and its unique(!) label generated by Block.io. You can optionally specify a custom label.


[View source]
def get_transactions(type_of_tx : String, before_tx : String | Nil = nil, addresses : String | Nil = nil) #

Returns various data for the last 25 transactions spent or received. You can optionally specify a before_tx parameter to get earlier transactions. (You can use this method to query for addresses that are not on your account.) Each result provides a confidence rating that shows the network's belief in the transaction's viability. We recommend waiting for confidence ratings to reach 0.90-0.99 for unconfirmed transactions if you need to validate it. If a double spend is detected for an unconfirmed transaction, its confidence rating falls to 0.0.


[View source]
def is_green_transaction(transactions : Array(String)) #

Returns an array of transactions that were sent by Block.io Green Addresses. Funds sent from Green Addresses are guaranteed by Block.io, and can be used immediately on receipt with zero network confirmations.


[View source]
def unarchive_addresses(addresses : Array(String), kind : AddressType = AddressType::Address) #

Unarchives upto 100 addresses in a single API call. Addresses can be specified by their labels.


[View source]
def withdraw(input : Hash(String, BigDecimal), estimate_fee : Bool = false) #

Withdraws amount of coins from any addresses in your account to up to 2500 destination addresses.


[View source]
def withdraw(address : String, amount : BigDecimal) #

[View source]
def withdraw_from_addresses #

Withdraws AMOUNT coins from upto 2500 addresses at a time, and deposits it to up to 2500 destination addresses.


[View source]
def withdraw_from_labels #

Withdraws AMOUNT coins from upto 2500 labels at a time, and deposits it to upto 2500 destination addresses, or labels.


[View source]