forked from EvergreenCrypto/docker-finance
container: src: fetch: gemini: add debug logging
This commit is contained in:
@@ -107,7 +107,9 @@ namespace docker_finance\exchanges\internal\exchanges\gemini
|
||||
string $method = 'GET',
|
||||
array $params = []
|
||||
): mixed {
|
||||
return $this->get_api()->request($path, $api, $method, $params, null, null, []);
|
||||
$response = $this->get_api()->request($path, $api, $method, $params, null, null, []);
|
||||
utils\CLI::print_debug($response);
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +130,9 @@ namespace docker_finance\exchanges\internal\exchanges\gemini
|
||||
*/
|
||||
private function get_symbols(): array
|
||||
{
|
||||
return $this->request('v1/symbols', 'public');
|
||||
$response = $this->request('v1/symbols', 'public');
|
||||
utils\CLI::print_debug($response);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -138,12 +142,15 @@ namespace docker_finance\exchanges\internal\exchanges\gemini
|
||||
private function get_trades(string $symbol, string $timestamp): array
|
||||
{
|
||||
// Don't use ccxt fetch_my_trades because API consistency (in returned results) is needed
|
||||
return $this->request(
|
||||
$response = $this->request(
|
||||
'v1/mytrades',
|
||||
'private',
|
||||
'POST',
|
||||
['symbol' => $symbol, 'timestamp' => $timestamp, 'limit_trades' => self::PAGINATION_LIMIT]
|
||||
);
|
||||
|
||||
utils\CLI::print_debug($response);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -295,11 +302,14 @@ namespace docker_finance\exchanges\internal\exchanges\gemini
|
||||
*/
|
||||
private function get_transactions(int $timestamp): array
|
||||
{
|
||||
return $this->get_api()->fetch_transactions(
|
||||
$response = $this->get_api()->fetch_transactions(
|
||||
null,
|
||||
$timestamp,
|
||||
self::PAGINATION_LIMIT
|
||||
);
|
||||
|
||||
utils\CLI::print_debug($response);
|
||||
return $response;
|
||||
}
|
||||
|
||||
//! @brief Implements read handler
|
||||
@@ -402,12 +412,15 @@ namespace docker_finance\exchanges\internal\exchanges\gemini
|
||||
$until_timestampms = $this->get_max_timestampms();
|
||||
}
|
||||
|
||||
return $this->request(
|
||||
$response = $this->request(
|
||||
'v1/earn/history',
|
||||
'private',
|
||||
'POST',
|
||||
['limit' => 500, 'interestOnly' => true, 'since' => $this->get_given_timestampms(), 'until' => $until_timestampms, 'sortAsc' => false] // @phpstan-ignore-line // TODO: resolve
|
||||
); // TODO: set PAGINATION_LIMIT
|
||||
|
||||
utils\CLI::print_debug($response);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user