From 3c23b683081e602785415add276d14aa41dc91d4 Mon Sep 17 00:00:00 2001 From: Keno Dressel Date: Fri, 21 Jun 2024 20:41:10 +0200 Subject: [PATCH] feat: adds listing token script --- script/listTokens.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 script/listTokens.js diff --git a/script/listTokens.js b/script/listTokens.js new file mode 100644 index 0000000..dfe7cd8 --- /dev/null +++ b/script/listTokens.js @@ -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();