App-btcindo

 view release on metacpan or  search on metacpan

script/btcindo  view on Meta::CPAN


my $prefix = '/App/btcindo/';

Perinci::CmdLine::Any->new(
    url => $prefix,
    subcommands => {
        public          => { url => "${prefix}public" },
        private         => { url => "${prefix}private" },

        # public
        ticker          => { url => "${prefix}ticker", },
        trades          => { url => "${prefix}trades", },
        depth           => { url => "${prefix}depth", },
        "price-history" => { url => "${prefix}price_history", },
        pairs           => { url => "${prefix}pairs", },

        info                => { url => "${prefix}info", },
        balance             => { url => "${prefix}balance", },
        "tx-history"        => { url => "${prefix}tx_history", },
        "trade-history"     => { url => "${prefix}trade_history", },
        "open-orders"       => { url => "${prefix}open_orders", },
        "create-order"      => { url => "${prefix}create_order", },
        "cancel-order"      => { url => "${prefix}cancel_order", },
        "cancel-orders"     => { url => "${prefix}cancel_orders", },
        "cancel-all-orders" => { url => "${prefix}cancel_all_orders", },
        "hold-details"      => { url => "${prefix}hold_details", },

        # aliases
        "trade" => { url => "${prefix}create_order", },

        # not yet
        "profit" => { url => "${prefix}profit", show_in_help => 0, },
        "trade-history-total" => { url => "${prefix}trade_history_total", show_in_help => 0 },
    },
    log => 1,
)->run;

# ABSTRACT: CLI for bitcoin.co.id (VIP)
# PODNAME: btcindo

__END__

=pod

=encoding UTF-8

=head1 NAME

btcindo - CLI for bitcoin.co.id (VIP)

=head1 VERSION

This document describes version 0.022 of btcindo (from Perl distribution App-btcindo), released on 2018-03-07.

=head1 SYNOPSIS

First, create an account at L<https://bitcoin.co.id>, create the trade API key
then insert the API key and secret key in F<~/.config/btcindo.conf>. Since the
configuration file contains the API secret key, please make sure that the
permission of the file is set so that unauthorized users cannot read it (e.g.
chmod it to 0600).

 # In ~/.config/btcindo.conf
 key = ...
 secret = ...

To list available pairs:

 % btcindo pairs

To show ticker:

 % btcindo ticker                     ;# default pair: btc_idr
 % btcindo ticker --pair eth_idr

To show latest trades:

 % btcindo trades

To show your balance:

 % btcindo balance

To show transaction history (Rupiah deposits & withdrawals):

 % btcindo tx-history

To show your trade history:

 % btcindo trade-history
 % btcindo trade-history --time-from 2017-05-31
 % btcindo trade-history --trade-id-from 1200000 --trade-id-to 1200100

To show your open/pending orders:

 % btcindo open-orders

To create a new order:

 # buy Rp 1.500.000-worth of bitcoin at Rp 34.000.000/BTC
 % btcindo trade buy 34000000 --idr 1500000

 # sell 0.01 bitcoin at Rp 38.000.000/BTC (create-order is alias for trade)
 % btcindo create-order sell 38000000 --btc 0.01

Cancel an existing order:

 % btcindo cancel-order sell 2345678 ;# btc_idr
 % btcindo cancel-order sell 345678 --pair bch_idr

Cancelling multiple orders in one go:

 % btcindo cancel-all-orders
 % btcindo cancel-orders --type buy
 % btcindo cancel-orders --type buy --pair btc_idr
 % btcindo cancel-orders --currency idr

For other available commands, see the help message or documentation:

 % btcindo -h



( run in 0.571 second using v1.01-cache-2.11-cpan-d8267643d1d )