forked from EvergreenCrypto/docker-finance
Merge pull request #172 into master
95c7212container: fetch: coinbase: remove sort (optimize) (Aaron Fiore)8003929container: fetch: coinbase: fix/update pagination (Aaron Fiore)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
// docker-finance | modern accounting for the power-user
|
||||
//
|
||||
// Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@@ -174,23 +174,20 @@ namespace docker_finance\exchanges\internal\exchanges\coinbase
|
||||
// Format: 1970-01-01T12:34:56Z
|
||||
$created_at = $info['created_at'];
|
||||
$at_year = explode('-', $created_at)[0];
|
||||
if ($at_year != $given_year) {
|
||||
break 2;
|
||||
if ($at_year == $given_year) {
|
||||
$stack[$id][] = $txs[$i];
|
||||
}
|
||||
|
||||
$stack[$id][] = $txs[$i];
|
||||
}
|
||||
|
||||
// Paginate (if needed)
|
||||
$last = $txs[array_key_last($txs)];
|
||||
if (array_key_exists('next_starting_after', $last)) {
|
||||
$account['starting_after'] = $last['next_starting_after'];
|
||||
if (array_key_exists('next_starting_after', $last['info'])) {
|
||||
$account['starting_after'] = $last['info']['next_starting_after'];
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sort($stack);
|
||||
return $stack;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user