PHP code example of bobel / payeer-client

1. Go to this page and download the library: Download bobel/payeer-client 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/ */

    

bobel / payeer-client example snippets


$api = new PayeerClient(
    id: 'bd443f00-092c-4436-92a4-a704ef679e24',
    key: 'your_key');

$result = $api->isOk();

$webSocket = new WebSocketServer(
    id: 'bd443f00-092c-4436-92a4-a704ef679e24',
    key: 'your_key');

$webSocket->run();

// Get all rates
$result = $api->rates();

// Get rates by criteria
$result = $api->rates([
    ["BTC", "USD"],
    ["BTC", "RUB"]
]);

$result = $api->stats([
    ["BTC", "USD"]
]);

$result = $api->orders([
    ["BTC", "USD"],
    ["BTC", "RUB"]
]);

$result = $api->trades([
    ["BTC", "USD"],
    ["BTC", "RUB"]
]);

// Get all trades
$result = $api->myTrades();

// Get specific trades by criteria
$result = $api->myTrades(
        currencyPairs: [
            ["BTC", "USD"],
            ["BTC", "RUB"]
        ],
        action: Action::Buy,
        dateFrom: 1630443600,
        dateTo: 1633035599,
        pageSize: 3);

$result = $api->balance();

    // Get all my orders
    $result = $api->order->list(status: Status::Opened);
        
    // Get my orders by criteria
    $result = $api->order->list(
        status: Status::Opened,
        currencyPairs: [
            ["BTC", "USD"],
            ["BTC", "RUB"]
        ],
        action: Action::Buy);
        
    // Get all orders
    $result = $api->order->list(pageSize: 3);
    
    // Get all orders by criteria
    $result = $api->order->list(
        status: Status::Canceled,
        currencyPairs: [
            ["BTC", "USD"],
            ["BTC", "RUB"]
        ],
        action: Action::Buy,
        dateFrom: 1630443600,
        dateTo: 1633035599,
        pageSize: 3);    

    // Cancel all orders
    $result = $api->order->cancel();
    
    // Cancel orders by criteria
    $result = $api->order->cancel(
        currencyPairs: [
            ["TRX", "RUB"],
            ["DOGE", "RUB"]
        ],
        action: Action::Buy);
        
    // Cancel exact order by ID
    $result = $api->order->cancel(37054293);

$result = $api->order->status(37054293);

$result = $api->order->create(
    currencyPairs: [
        ["TRX", "USD"]
    ],
    type: Type::Limit,
    action: Action::Buy,
    amount: 10,
    price: 0.08);