PHP code example of cryptomkt / cryptomkt-curl-php

1. Go to this page and download the library: Download cryptomkt/cryptomkt-curl-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cryptomkt / cryptomkt-curl-php example snippets


use Cryptomkt\Client;
use Cryptomkt\Configuration;

$configuration = Configuration::apiKey($apiKey, $apiSecret);
$client = Client::create($configuration);

use Cryptomkt\Client;
use Cryptomkt\Configuration;

$configuration = Configuration::apiKey($apiKey, $apiSecret);
$configuration->setLogger($logger);
$client = Client::create($configuration);

$data = $markets->getRawData();

$data = $client->decodeLastResponse();

$markets = $client->getMarkets();

$arguments = array('market' => 'ETHARS');
$ticker = $client->getTicker($arguments);

$arguments = array('market' => 'ETHCLP','start' => '2017-05-20', 'end' => '2017-05-30', 'page' => 1);
$trades = $client->getTrades($arguments);

$arguments = array('market' => 'ETHARS','type' => 'buy', 'page' => 1);
$orders = $client->getOrders($arguments);

$arguments = array('id' => 'M107435');
$order = $client->getOrder($arguments);  

$arguments = array('market' => 'ETHCLP', 'page' => 0);
$active_orders = $client->getActiveOrders($arguments);

$arguments = array('market' => 'ETHCLP', 'page' => 0);
var_dump($client->getExecutedOrders($arguments));

$arguments = array(
        'amount' => '0.3',
        'market' => 'ethclp',
        'price' => '200000',
        'type' => 'sell'
    );
$response = $client->createOrder($arguments);

$arguments = array('id' => 'M107441');
$response = $client->cancelOrder($arguments);

$response = $client->getBalance();

$arguments = array(
    'to_receive' => '3000',
    'to_receive_currency' => 'CLP',
    'payment_receiver' => '[email protected]',
    'external_id' => '123456CM',
    'callback_url' => '',
    'error_url' => '',
    'success_url' => '',
    'refund_email' => '[email protected]',
    'language' => ['es','en','pt']
);

$response = $client->createPayOrder($arguments);  

$arguments = array('id' => 'P13565');
$response = $client->getPayOrder($arguments);  

$arguments = array('start_date' => '1/05/2018','end_date' => '31/05/2018');
$response = $client->getPayOrders($arguments);  
json
""cryptomkt/cryptomkt-curl-php": "dev-master"
}