diff --git a/server/index.ts b/server/index.ts index 1e99c7c5..4665ee21 100644 --- a/server/index.ts +++ b/server/index.ts @@ -9,7 +9,6 @@ import url from "url"; import { Dto, GetDeliveredRewardsDto, - GetPoolsDto, GetQueueDto, ServerErrorDto, } from "../client/src/entities/dto"; @@ -32,7 +31,6 @@ import { getFromKoios, getFromVM, getPoolMetadata, - getPools, getRewards, postFromKoios, sanitizeString, @@ -66,76 +64,10 @@ app.use(express.json()); app.use(require("morgan")(LOG_TYPE)); app.use(cors({ origin: "*" })); -const resp200Ok = { - responses: { - 200: { - description: "Success", - content: { - "application/json": { - schema: { - type: "object", - }, - }, - }, - }, - }, -}; - -const resp200Ok500Bad = { - responses: { - 200: { - description: "Success", - content: { - "application/json": { - schema: { - type: "object", - }, - }, - }, - }, - 500: { - content: { - "application/json": { - schema: { - type: "object", - properties: { - error: { type: "string" }, - }, - }, - }, - }, - }, - }, -}; - app.use("/api/tx", TxRouter); app.use("/api/util", UtilRouter); app.use("/api/admin", AdminRouter); -app.get( - "/api/getpools", - errorHandlerWrapper(async (_req: Request, res: Response) => { - const pools = await getPools(); - const whitelist = TOSIFEE_WHITELIST ? TOSIFEE_WHITELIST.split(",") : []; - const whitelistedPools: PoolInfo[] = []; - const regularPools: PoolInfo[] = []; - Object.values(pools).forEach((pool) => { - if (pool.visible === "f" || pool.id.includes("project_")) { - return; - } - if (whitelist.includes(pool.id)) { - whitelistedPools.push(pool); - } else { - regularPools.push(pool); - } - }); - return res.status(200).send({ - whitelistedPools: _.shuffle(whitelistedPools), - regularPools: _.shuffle(regularPools), - }); - }), -); - app.get( "/api/getsettings", typedErrorHandlerWrapper(async (_, res) => { @@ -532,16 +464,6 @@ app.get( }), ); -app.get( - "/api/getprojects", - errorHandlerWrapper(async (_req: Request, res: Response) => { - const projects = JSON.parse( - fs.readFileSync(__dirname + "/public/json/projects.json", "utf8"), - ); - return res.status(200).send(projects); - }), -); - app.get( "/api/getpopupinfo", errorHandlerWrapper(async (_req: Request, res: Response) => { @@ -560,9 +482,6 @@ app.get( }), ); -// host static files such as images -app.use("/api/img", express.static(__dirname + "/public/img")); - const server = app.listen(PORT, () => { console.log(`Server listening on ${PORT}`); }); diff --git a/server/public/img/project-logo/aada/aada-compact-dark.png b/server/public/img/project-logo/aada/aada-compact-dark.png deleted file mode 100644 index e728f8ab..00000000 Binary files a/server/public/img/project-logo/aada/aada-compact-dark.png and /dev/null differ diff --git a/server/public/img/project-logo/aada/aada-compact-light.png b/server/public/img/project-logo/aada/aada-compact-light.png deleted file mode 100644 index cf846ed6..00000000 Binary files a/server/public/img/project-logo/aada/aada-compact-light.png and /dev/null differ diff --git a/server/public/img/project-logo/aada/aada-full-dark.png b/server/public/img/project-logo/aada/aada-full-dark.png deleted file mode 100644 index da5436c4..00000000 Binary files a/server/public/img/project-logo/aada/aada-full-dark.png and /dev/null differ diff --git a/server/public/img/project-logo/aada/aada-full-light.png b/server/public/img/project-logo/aada/aada-full-light.png deleted file mode 100644 index 9bdbd671..00000000 Binary files a/server/public/img/project-logo/aada/aada-full-light.png and /dev/null differ diff --git a/server/public/img/project-logo/aneta/aneta-compact-light.png b/server/public/img/project-logo/aneta/aneta-compact-light.png deleted file mode 100644 index cff84410..00000000 Binary files a/server/public/img/project-logo/aneta/aneta-compact-light.png and /dev/null differ diff --git a/server/public/img/project-logo/aneta/aneta-full-dark.png b/server/public/img/project-logo/aneta/aneta-full-dark.png deleted file mode 100644 index acec8c59..00000000 Binary files a/server/public/img/project-logo/aneta/aneta-full-dark.png and /dev/null differ diff --git a/server/public/img/project-logo/aneta/aneta-full-light.png b/server/public/img/project-logo/aneta/aneta-full-light.png deleted file mode 100644 index b6173794..00000000 Binary files a/server/public/img/project-logo/aneta/aneta-full-light.png and /dev/null differ diff --git a/server/public/img/project-logo/ardana/ardana-compact-dark.png b/server/public/img/project-logo/ardana/ardana-compact-dark.png deleted file mode 100644 index e24df4a4..00000000 Binary files a/server/public/img/project-logo/ardana/ardana-compact-dark.png and /dev/null differ diff --git a/server/public/img/project-logo/ardana/ardana-full-dark.png b/server/public/img/project-logo/ardana/ardana-full-dark.png deleted file mode 100644 index 23df8ee8..00000000 Binary files a/server/public/img/project-logo/ardana/ardana-full-dark.png and /dev/null differ diff --git a/server/public/img/project-logo/ardana/ardana-full-light.png b/server/public/img/project-logo/ardana/ardana-full-light.png deleted file mode 100644 index 33ad3a98..00000000 Binary files a/server/public/img/project-logo/ardana/ardana-full-light.png and /dev/null differ diff --git a/server/public/img/project-logo/merkaba/merkaba-compact-dark.png b/server/public/img/project-logo/merkaba/merkaba-compact-dark.png deleted file mode 100644 index f8b4b966..00000000 Binary files a/server/public/img/project-logo/merkaba/merkaba-compact-dark.png and /dev/null differ diff --git a/server/public/img/project-logo/merkaba/merkaba-compact-light.png b/server/public/img/project-logo/merkaba/merkaba-compact-light.png deleted file mode 100644 index 5c5f8b9f..00000000 Binary files a/server/public/img/project-logo/merkaba/merkaba-compact-light.png and /dev/null differ diff --git a/server/public/img/project-logo/merkaba/merkaba-dark.png b/server/public/img/project-logo/merkaba/merkaba-dark.png deleted file mode 100644 index 1d582d23..00000000 Binary files a/server/public/img/project-logo/merkaba/merkaba-dark.png and /dev/null differ diff --git a/server/public/img/project-logo/merkaba/merkaba-light.png b/server/public/img/project-logo/merkaba/merkaba-light.png deleted file mode 100644 index 4afa3f6e..00000000 Binary files a/server/public/img/project-logo/merkaba/merkaba-light.png and /dev/null differ diff --git a/server/public/img/project-logo/minswap/minswap-compact-dark.png b/server/public/img/project-logo/minswap/minswap-compact-dark.png deleted file mode 100644 index c237e374..00000000 Binary files a/server/public/img/project-logo/minswap/minswap-compact-dark.png and /dev/null differ diff --git a/server/public/img/project-logo/minswap/minswap-compact-light.png b/server/public/img/project-logo/minswap/minswap-compact-light.png deleted file mode 100644 index d7226301..00000000 Binary files a/server/public/img/project-logo/minswap/minswap-compact-light.png and /dev/null differ diff --git a/server/public/img/project-logo/minswap/minswap-full-dark.png b/server/public/img/project-logo/minswap/minswap-full-dark.png deleted file mode 100644 index 690fa589..00000000 Binary files a/server/public/img/project-logo/minswap/minswap-full-dark.png and /dev/null differ diff --git a/server/public/img/project-logo/minswap/minswap-full-light.png b/server/public/img/project-logo/minswap/minswap-full-light.png deleted file mode 100644 index de2d73b9..00000000 Binary files a/server/public/img/project-logo/minswap/minswap-full-light.png and /dev/null differ diff --git a/server/public/img/project-logo/scatdao/scatdao-compact-dark.png b/server/public/img/project-logo/scatdao/scatdao-compact-dark.png deleted file mode 100644 index de1c8b6c..00000000 Binary files a/server/public/img/project-logo/scatdao/scatdao-compact-dark.png and /dev/null differ diff --git a/server/public/img/project-logo/scatdao/scatdao-compact-light.png b/server/public/img/project-logo/scatdao/scatdao-compact-light.png deleted file mode 100644 index b86c4c05..00000000 Binary files a/server/public/img/project-logo/scatdao/scatdao-compact-light.png and /dev/null differ diff --git a/server/public/img/project-logo/scatdao/scatdao-full-dark.png b/server/public/img/project-logo/scatdao/scatdao-full-dark.png deleted file mode 100644 index e5543e76..00000000 Binary files a/server/public/img/project-logo/scatdao/scatdao-full-dark.png and /dev/null differ diff --git a/server/public/img/project-logo/scatdao/scatdao-full-light.png b/server/public/img/project-logo/scatdao/scatdao-full-light.png deleted file mode 100644 index 8e284a01..00000000 Binary files a/server/public/img/project-logo/scatdao/scatdao-full-light.png and /dev/null differ diff --git a/server/public/img/tosidrop-logo/tosidrop-dark.png b/server/public/img/tosidrop-logo/tosidrop-dark.png deleted file mode 100644 index 51aa9fc7..00000000 Binary files a/server/public/img/tosidrop-logo/tosidrop-dark.png and /dev/null differ diff --git a/server/public/img/tosidrop-logo/tosidrop-light.png b/server/public/img/tosidrop-logo/tosidrop-light.png deleted file mode 100644 index 034d300e..00000000 Binary files a/server/public/img/tosidrop-logo/tosidrop-light.png and /dev/null differ diff --git a/server/public/img/tosidrop-logo/tosidrop.png b/server/public/img/tosidrop-logo/tosidrop.png deleted file mode 100644 index 9a601fa3..00000000 Binary files a/server/public/img/tosidrop-logo/tosidrop.png and /dev/null differ diff --git a/server/public/json/projects.json b/server/public/json/projects.json deleted file mode 100644 index 3aee0af5..00000000 --- a/server/public/json/projects.json +++ /dev/null @@ -1,135 +0,0 @@ -[ - { - "logos": { - "logoDefault": "/api/img/project-logo/aneta/aneta-full-light.png", - "logoDark": "/api/img/project-logo/aneta/aneta-full-dark.png", - "logoCompact": "/api/img/project-logo/aneta/aneta-compact-light.png" - }, - "descs": { - "descShort": "AnetaBTC is a fully on-chain, decentralized protocol that allows Bitcoin to be directly wrapped on the Ergo and Cardano blockchains.", - "descLong": "AnetaBTC is a fully on-chain, decentralized protocol that allows Bitcoin to be directly wrapped on the Ergo and Cardano blockchains. Rooted in the fundamentals of decentralization, anetaBTC is backed by a strong global community, and is developing infrastructure throughout both Cardano and Ergo to advance the adoption and functionality of both platforms. AnetaBTC is on target to release their wrapping protocol on the Ergo tesnet in Q4 2022. cNETA, the Cardano native token of anetaBTC, represents governance and revenue rights over the anetBTC protocol, including ownership of anetaBTC’s community owned NETA Liquidity Fund, which holds 8+ assets and over $1 million in total value.", - "claimDesc": "Must be staking to one of the follwing pools: NETA1, NETA2, ..." - }, - "token": { - "token": "cNETA", - "totalSupply": 1000000000, - "policyID": "b34b3ea80060ace9427bda98690a73d33840e27aaa8d6edb7f0c757a" - }, - "urls": { - "website": "https://anetabtc.io/", - "medium": "https://medium.com/@anetaBTC", - "twitter": "https://twitter.com/anetaBTC", - "discord": "https://discord.gg/S85CKeyHTc", - "telegram": "https://t.me/anetaBTC", - "paper": "https://medium.com/@anetaBTC/anetabtc-litepaper-v1-0-171f29b3276a", - "docs": "https://docs.anetabtc.io/", - "cardanoScan": "https://cardanoscan.io/token/b34b3ea80060ace9427bda98690a73d33840e27aaa8d6edb7f0c757a634e455441" - } - }, - { - "logos": { - "logoDefault": "/api/img/project-logo/minswap/minswap-full-light.png", - "logoDark": "/api/img/project-logo/minswap/minswap-full-dark.png", - "logoCompact": "/api/img/project-logo/minswap/minswap-compact-light.png", - "logoCompactDark": "/api/img/project-logo/minswap/minswap-compact-dark.png" - }, - "descs": { - "descShort": "Minswap is a Decentralized Exchange (DEX). The purpose of a DEX is to enable permissionless trading of token pairs.", - "descLong": "Minswap is a Decentralized Exchange (DEX). The purpose of a DEX is to enable permissionless trading of token pairs. For each swap, a fee is taken, which goes to the Liquidity Providers (LPs). Anyone can provide Liquidity as well, hence profits are decentralized. Minswap is a community-centric DEX, in that our tokens are fairly distributed, without any private or VC investment.\n\nMinswap has pioneered several ideas in the Cardano ecosystem such as the FISO model, touted as the fairest ISO model in the Cardano community, and they plan to continue developing several value adding features.This will benefit both the Minswap community, and the Cardano community as a whole." - }, - "token": { - "token": "MINt", - "totalSupply": 5000000000, - "policyID": "29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6" - }, - "urls": { - "website": "https://minswap.org/", - "medium": "https://minswap-labs.medium.com/", - "twitter": "https://twitter.com/minswapdex", - "discord": "http://discord.gg/minswap", - "telegram": "https://t.me/MinswapMafia", - "paper": "https://docs.minswap.org/whitepaper", - "docs": "https://docs.minswap.org/", - "cardanoScan": "https://cardanoscan.io/token/29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e74" - } - }, - { - "logos": { - "logoDefault": "/api/img/project-logo/aada/aada-full-light.png", - "logoDark": "/api/img/project-logo/aada/aada-full-dark.png", - "logoCompact": "/api/img/project-logo/aada/aada-compact-light.png", - "logoCompactDark": "/api/img/project-logo/aada/aada-compact-dark.png" - }, - "descs": { - "descShort": "Aada V.1 app is a peer-to-peer lending and borrowing protocol on the Cardano blockchain.", - "descLong": "Aada V.1 app is a peer-to-peer lending and borrowing protocol on the Cardano blockchain. It allows users to submit loan requests and lend assets in an order book style. Borrowers can place inquiries by setting custom parameters like asset type, amount, collateral, term, and interest. In turn, lenders can choose whether to fill orders and liquidate them. The initial Aada protocol is a prequel to the V.2 version, which will include a pooled lending mechanism." - }, - "token": { - "token": "AADA", - "totalSupply": 29500000, - "policyID": "8fef2d34078659493ce161a6c7fba4b56afefa8535296a5743f69587" - }, - "urls": { - "website": "https://aada.finance/", - "paper": "https://github.com/aadafinance/materials/blob/main/Aada_finance_lightpaper.pdf", - "docs": "https://aada.gitbook.io/aada", - "medium": "https://medium.com/@aada.finance", - "twitter": "https://twitter.com/AadaFinance", - "discord": "https://discord.gg/zZPHeH78BE", - "telegram": "https://t.me/aadacommunity", - "cardanoScan": "https://cardanoscan.io/token/8fef2d34078659493ce161a6c7fba4b56afefa8535296a5743f6958741414441" - } - }, - { - "logos": { - "logoDefault": "/api/img/project-logo/scatdao/scatdao-full-light.png", - "logoDark": "/api/img/project-logo/scatdao/scatdao-full-dark.png", - "logoCompact": "/api/img/project-logo/scatdao/scatdao-compact-light.png", - "logoCompactDark": "/api/img/project-logo/scatdao/scatdao-compact-dark.png" - }, - "descs": { - "descShort": "SCAT DAO is bringing decentralized audits, research, and safety to Cardano. Token holders can vote on which projects they would like to be audited.", - "descLong": "Smart Contract Audit Token Decentralized Autonomous Organization (SCATDAO) is a new audit paradigm that reinvents the way audits are selected, performed, and financed. With SCATDAO we solve audits inherent problem, the conflict of interest that comes from paying for an audit service. As we have seen with Enron, Tyco, and countless others, the possibility always exists for an auditor to commit fraud to keep their client happy. With SCATDAO, the token holders choose the projects they care for and want to be audited." - }, - "token": { - "token": "AUDIT", - "totalSupply": 1000000000, - "policyID": "f2fe9aafd2e5b3b00e2949a96d44a84d9f4d818d63945010a466a4ae" - }, - "urls": { - "website": "https://www.scatdao.com/", - "paper": "https://scatdao.b-cdn.net/wp-content/uploads/2022/06/SCATDAO-Whitepaper.pdf", - "medium": "https://medium.com/@scatdao", - "twitter": "https://twitter.com/SCATDAO", - "discord": "http://discord.gg/rfFkJxu9kP", - "telegram": "http://t.me/SCAT_DAO", - "cardanoScan": "https://cardanoscan.io/tokenPolicy/f2fe9aafd2e5b3b00e2949a96d44a84d9f4d818d63945010a466a4ae" - } - }, - { - "logos": { - "logoDefault": "/api/img/project-logo/merkaba/merkaba-light.png", - "logoDark": "/api/img/project-logo/merkaba/merkaba-dark.png", - "logoCompact": "/api/img/project-logo/merkaba/merkaba-compact-light.png", - "logoCompactDark": "/api/img/project-logo/merkaba/merkaba-compact-dark.png" - }, - "descs": { - "descShort": "Merkaba is a Hemp Collective based out of Raglan, New Zealand grown over the last seven years.", - "descLong": "Merkaba is a Hemp Collective based out of Raglan, New Zealand grown over the last seven years.", - "claimDesc": "Must be staking to one of the follwing pools: NETA1, NETA2, ..." - }, - "token": { - "token": "MKA", - "totalSupply": 420000000, - "policyID": "f4d97191f857096b441a410c036f63d6697dde0c71d2755dd664e302" - }, - "urls": { - "website": "https://merkaba-token.io/", - "twitter": "https://twitter.com/MerkabaToken", - "discord": "https://discord.gg/a7HzSenWX5", - "paper": "https://merkaba-token.io/", - "docs": "https://merkaba-token.io/", - "cardanoScan": "https://cardanoscan.io/token/f4d97191f857096b441a410c036f63d6697dde0c71d2755dd664e3024d4b41" - } - } -] diff --git a/server/utils/helpers.ts b/server/utils/helpers.ts index 3a7b3055..5c88e1cd 100644 --- a/server/utils/helpers.ts +++ b/server/utils/helpers.ts @@ -16,7 +16,6 @@ import { import { GetPricePairs } from "../../client/src/entities/min.entities"; import { ClaimableToken, - GetPools, GetRewardsDto, VmDeliveredReward, VmTokenInfoMap, @@ -168,18 +167,6 @@ export async function postPoolInfo(pools: string[]) { return postFromKoios("pool_info", { _pool_bech32_ids: pools }); } -export async function getPools() { - let pools = longTermCache.get("pools") as GetPools; - if (pools == null) { - pools = await getFromVM("get_pools"); - Object.values(pools).forEach((pool) => { - pool.id = convertPoolIdToBech32(pool.id); - }); - longTermCache.set("pools", pools); - } - return pools; -} - export async function getTokens(options?: { flushCache?: boolean; }): Promise {