Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unit214 #101

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions script/listTokens.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
async function main() {
const AUTH_TOKEN = process.env.AUTH_TOKEN || '';
if (!AUTH_TOKEN) {
console.log('Please provide AUTH_TOKEN');
process.exit(1);
}

const mainnetTokens = [
'ct_J3zBY8xxjsRr3QojETNw48Eb38fjvEuJKkQ6KzECvubvEcvCa',
'ct_7UfopTwsRuLGFEcsScbYgQ6YnySXuyMxQWhw6fjycnzS5Nyzq',
'ct_2U1usf3A8ZNUcZLkZe5rEoBTxk7eJvk9fcbRDNqmRiwXCHAYN',
'ct_KeTvHnhU85vuuQMMZocaiYkPL9tkoavDRT3Jsy47LK2YqLHYb',
'ct_xtk8rSz9suPb6D6VLquyfVji25FcnFRDjn3dnn5mmvHsPiESt',
];

const MAINNET_DEX_BACKEND_URL =
'https://dex-backend-mainnet.prd.service.aepps.com';
const TESTNET_DEX_BACKEND_URL =
'https://dex-backend-testnet.prd.service.aepps.com';

const path = '/tokens/listed/';

for (const token of mainnetTokens) {
await fetch(`${MAINNET_DEX_BACKEND_URL}${path}${token}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: AUTH_TOKEN,
},
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch((err) => console.error(err));
}
}
main();
2 changes: 1 addition & 1 deletion src/database/token/token-db.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class TokenDbService {
) * 100 AS "priceChangeYear"
FROM
"Token" t
LEFT JOIN public."Pair" p ON t.id = p.t0
LEFT JOIN "Pair" p ON t.id = p.t0
OR t.id = p.t1
LEFT JOIN LATERAL (
SELECT
Expand Down
Loading