PHP code example of vittominacori / changelly-php

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

    

vittominacori / changelly-php example snippets




use Changelly\Changelly;

$changelly = new Changelly('yourApiKey', 'yourApiSecret');

$changelly->getCurrencies();

$changelly->getCurrenciesFull();

$changelly->getMinAmount('btc', 'eth');

$changelly->getExchangeAmount('btc', 'eth', '1');

$changelly->createTransaction('btc', 'eth', '0x123123...123', 0.3);

$changelly->getStatus('854e8d7dc9ef');

$changelly->getTransactions();

composer 
json
[
  {
    "id": "854e8d7dc9ef",
    "createdAt": 1525446902,
    "payinConfirmations": "0",
    "status": "waiting",
    "currencyFrom": "btc",
    "currencyTo": "eth",
    "payinAddress": "36P9TNYPbZrGs8Udn84F9uAY95VYM2Xk4K",
    "payinExtraId": null,
    "payinHash": null,
    "payoutAddress": "0x123123...123",
    "payoutExtraId": null,
    "payoutHash": null,
    "amountFrom": "",
    "amountTo": "0",
    "networkFee": null,
    "changellyFee": "0.5",
    "apiExtraFee": "0"
  },
  (...)
]