WebService::CoinSpot - Trade BitCoin, Ethereum, Monero and other CryptoCurrency via CoinSpot
version 0.002
use WebService::CoinSpot; my $coinspot = WebService::CoinSpot->new( auth_key => 'xxxxxxxx', auth_secret => 'xxxxxxxx', base_url => 'https://www.coinspot.com.au', # optional, default shown );
Trade BitCoin, Ethereum, Monero and other CryptoCurrency via the CoinSpot vaguely RESTful API.
You will of course need to create an account on CoinSpot, which is an Australian place to Trade CryptoCurrency.
This API software is an Alpha release, which I am published for people to comment on and provide pull requests.
Test it carefully before relying upon it with your valuable currency.
my $coinspot = WebService::CoinSpot->new( auth_key => 'xxxxxxxx', auth_secret => 'xxxxxxxx', base_url => 'https://www.coinspot.com.au', # optional, default shown );
Creates new object. No ping type operation is performed, so you won't know if there's is a problem with your parameters until you try to do something.
Parameters
Optional. But without it you will only get some "Market Status" features.
The API key that CoinSpot will provide you. Look on the account settings web page.
The Secret key that CoinSpot will provide you. Look on the account settings web page.
WARNING: do not commit this secret to public source control repositories.
Optional.
Specify a different base URL for the API. This will likely never be needed.
Read only accessory for auth_key
Read only accessory for auth_secret
Get information about whats happening in the market. None of these spend your money or sell your assets.
my $response = $coinspot->latest();
Get Latest Prices (doesn't require auth_key or auth_secret)
None.
Returns
Hash or hash reference with all the latest prices.
One property for each coin with the latest prices for that coin
my $response = $coinspot->orders( cointype => 'BTC' );
List Open Orders
i.e. BTC, LTC, DOGE, ETH, ETC.
Hash or hash reference with all the latest open orders.
Array containing all the open buy orders
Array containing all the open sell orders
my $response = $coinspot->orders_history( cointype => 'BTC' );
List Order History
Hash or hash reference with last 1,000 completed orders
Array of the last 1,000 completed orders
Examine what's in your account. None of these functions spend your money or sell your assets.
my $response = $coinspot->balances();
List My Balances
Hash or hash reference with balances for your account
One property for each coin with your balance for that coin
my $response = $coinspot->myorders();
List My Orders
Array containing all your buy orders
Array containing all your sell orders
Exchange AUD for CryptoCurrency. These functions will spend your money.
my $response = $coinspot->quotebuy( cointype => 'BTC', amount => 9_999_999, );
Quick Buy Quote
Note: This is just a quote, not a commitment to buy.
The amount of coins to buy
Hash or hash reference with estimations
The rate per coin
Estimated hours to wait for trade to complete (0 = immediate trade)
my $response = $coinspot->buy( cointype => 'BTC', amount => 9_999_999, rate => 0.50, );
Place Buy Order
DANGER DANGER DANGER
This function will try to spend your hard earned money on CryptoCurrency.
You can cancel orders via "cancelbuy"
The amount of coins to buy, max precision 8 decimal places
The rate in AUD you are willing to pay, max precision 6 decimal places
Ok or error only.
my $response = $coinspot->cancelbuy( id => 1234 );
Cancel Buy Order
WARNING WARNING WARNING
This function will cancel buy orders, if unfulfilled.
The id of the order to cancel
Moves / sends coins from wallet to wallet. These functions will cause assets to leave your CoinSpot account.
my $response = $coinspot->sendcoin( cointype => 'BTC', address => 'abc1234', amount => 9_999_999, );
Send Coins
This function will move assets from your CoinSpot account to other wallets.
The address to send coins to
The amount of coins to send
my $response = $coinspot->depositcoin( cointype => 'BTC', );
Deposit Coins
Your deposit address for the coin
Exchange CryptoCurrency for AUD. These functions will sell your assets
my $response = $coinspot->quotesell( cointype => 'BTC', amount => 9_999_999, );
Quick Sell Quote
Note: This is just a quote, not a commitment to sell.
The amount of coins to sell
my $response = $coinspot->sell( cointype => 'BTC', amount => 9_999_999, rate => 0.50, );
Place Sell Order
This function will try to sell your CryptoCurrency in exchange for Australian Dollars
You can cancel orders via "cancelsell"
The amount of coins you want to sell, max precision 8 decimal places
my $response = $coinspot->cancelsell( id => 1234 );
This function will cancel sell orders, if unfulfilled.
CoinSpot
Dean Hamstead <djzort@cpan.org>
This software is copyright (c) 2017 by Dean Hamstad.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install WebService::CoinSpot, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::CoinSpot
CPAN shell
perl -MCPAN -e shell install WebService::CoinSpot
For more information on module installation, please visit the detailed CPAN module installation guide.