From 9ef8623e04a16e7ff3ba9a153fcdd04d77d10b53 Mon Sep 17 00:00:00 2001 From: VladyslavSt Date: Mon, 19 Jul 2021 18:54:02 +0300 Subject: [PATCH 1/2] New fixed version --- api-examples/currencies/index.php | 263 ++++++++++++++---------------- 1 file changed, 118 insertions(+), 145 deletions(-) diff --git a/api-examples/currencies/index.php b/api-examples/currencies/index.php index 785949d..ec55420 100644 --- a/api-examples/currencies/index.php +++ b/api-examples/currencies/index.php @@ -22,7 +22,7 @@

- Code sample + Code sample

@@ -40,104 +40,96 @@
+
+ + + + + + + + + + + + + + -
-
- - - - + 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 "
";

From 7a1da75425353ee1b79fa96d2a8674b9ebd5560b Mon Sep 17 00:00:00 2001
From: VladyslavSt <78020458+VladyslavSt@users.noreply.github.com>
Date: Tue, 20 Jul 2021 11:37:51 +0300
Subject: [PATCH 2/2] Update index.php

---
 api-examples/currencies/index.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/api-examples/currencies/index.php b/api-examples/currencies/index.php
index ec55420..7abce89 100644
--- a/api-examples/currencies/index.php
+++ b/api-examples/currencies/index.php
@@ -39,7 +39,7 @@
 
             
- @@ -262,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 +}