diff --git a/api-examples/currencies/index.php b/api-examples/currencies/index.php index 785949d..7abce89 100644 --- a/api-examples/currencies/index.php +++ b/api-examples/currencies/index.php @@ -22,7 +22,7 @@

- Code sample + Code sample

@@ -39,105 +39,97 @@
- + + + + + + + + + +
+ + + + + + + + + + + + + + -
-
- - - - + else if (selectElement.value == 'Find a currency by its ID' || selectElement.value == 'Get the latest block number by currency' || + selectElement.value == 'Retrieve the currency icon' || selectElement.value == 'Retrieve the currency icon as svg'){ + document.getElementById('currency_id_block').style.display = "block"; + } + else if (selectElement.value == 'Validation'){ + document.getElementById('currency_id_block').style.display = "block"; + document.getElementById('address_block').style.display = "block"; + } + }); + + + +
0) { + $apiUrl .= '?' . http_build_query($query_builder); } - $params = []; break; - case 'find': - $apiUrl = 'https://api.coinpayments.net/api/v1/currencies/' . $_GET['currency_id']; - $params = []; + case 'Find a currency by its ID': + $apiUrl .= '/' . $_GET['currency_id']; break; - case 'get_block': - $apiUrl = 'https://api.coinpayments.net/api/v1/currencies/blockchain-nodes/' . $_GET['currency_id'] . '/latest-block-number'; - $params = []; + case 'Get the latest block number by currency': + $apiUrl .= '/' . $_GET['currency_id'] . '/latest-block-number'; break; - case 'get_req': - $apiUrl = 'https://api.coinpayments.net/api/v1/currencies/required-confirmations'; - $params = []; + case 'Get the required confirmations for each currency': + $apiUrl .= '/required-confirmations'; break; - case 'icon_retrieve': - $apiUrl = 'https://api.coinpayments.net/api/v1/currencies/' . $_GET['currency_id'] . '/logo'; - $params = []; + case 'Retrieve the currency icon': + $apiUrl .= '/' . $_GET['currency_id'] . '/logo'; + break; + + case 'Retrieve the currency icon as svg': + $apiUrl .= '/' . $_GET['currency_id'] . '/logosvg'; break; case 'conversions': - $apiUrl = 'https://api.coinpayments.net/api/v1/currencies/conversions'; - $params = []; + $apiUrl .= '/conversions'; break; case 'validate': - $apiUrl = 'https://api.coinpayments.net/api/v1/currencies/' . $_GET['currency_id'] . "/" . $_GET['address'] . "/validate"; - $params = []; + $apiUrl .= '/' . $_GET['currency_id'] . "/" . $_GET['address'] . "/validate"; break; } - $response = sendRequest($method, $apiUrl, $_GET['clientId'], $_GET['clientSecret'], $date, $params); echo "
";
@@ -289,4 +262,4 @@ function signature($method, $apiUrl, $clientId, $date, $clientSecret, $params)
     ]);
 
     return base64_encode(hash_hmac('sha256', $signatureString, $clientSecret, true));
-}
\ No newline at end of file
+}