From 059c44094e9979d555d8e853fd7cd46247707708 Mon Sep 17 00:00:00 2001 From: Shane Fontaine <9441295+shanefontaine@users.noreply.github.com> Date: Tue, 9 Jan 2024 13:30:18 -0800 Subject: [PATCH 1/7] Bump core --- README.md | 1 + backend/package.json | 2 +- backend/src/config.ts | 38 +++++++++++++++++++++++++++++--------- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 64c68c5..f87af68 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ ARBITRUM_RPC= NOVA_RPC= BASE_RPC= LINEA_RPC= +POLYGONZK_RPC= ``` ```sh diff --git a/backend/package.json b/backend/package.json index c3f1b00..44444c6 100644 --- a/backend/package.json +++ b/backend/package.json @@ -41,7 +41,7 @@ "typescript": "^4.6.3" }, "dependencies": { - "@hop-protocol/core": "^0.0.1-beta.203", + "@hop-protocol/core": "^0.0.1-beta.217", "@types/memory-cache": "^0.2.2", "@types/pidusage": "^2.0.2", "cors": "^2.8.5", diff --git a/backend/src/config.ts b/backend/src/config.ts index 6b7e224..caaadd1 100644 --- a/backend/src/config.ts +++ b/backend/src/config.ts @@ -61,7 +61,8 @@ export const transferTimes = { gnosis: 20, nova: 10, base: 2, - linea: 20 + linea: 20, + polygonzk: 20 }, optimism: { ethereum: 25, @@ -70,7 +71,8 @@ export const transferTimes = { gnosis: 25, nova: 25, base: 25, - linea: 25 + linea: 25, + polygonzk: 25 }, arbitrum: { ethereum: 12, @@ -79,7 +81,8 @@ export const transferTimes = { gnosis: 12, nova: 12, base: 12, - linea: 12 + linea: 12, + polygonzk: 12 }, polygon: { ethereum: 10, @@ -88,7 +91,8 @@ export const transferTimes = { gnosis: 10, nova: 10, base: 10, - linea: 10 + linea: 10, + polygonzk: 10 }, gnosis: { ethereum: 4, @@ -97,7 +101,8 @@ export const transferTimes = { polygon: 4, nova: 4, base: 4, - linea: 4 + linea: 4, + polygonzk: 4 }, nova: { ethereum: 12, @@ -106,7 +111,8 @@ export const transferTimes = { polygon: 12, gnosis: 12, base: 12, - linea: 12 + linea: 12, + polygonzk: 12 }, base: { ethereum: 25, @@ -115,7 +121,8 @@ export const transferTimes = { polygon: 25, gnosis: 25, nova: 25, - linea: 25 + linea: 25, + polygonzk: 25 }, linea: { ethereum: 25, @@ -124,7 +131,18 @@ export const transferTimes = { polygon: 25, gnosis: 25, nova: 25, - base: 25 + base: 25, + polygonzk: 25 + }, + polygonzk: { + ethereum: 5, + optimism: 5, + arbitrum: 5, + polygon: 5, + gnosis: 5, + nova: 5, + base: 5, + linea: 5 }, scroll: { ethereum: 1, @@ -133,7 +151,9 @@ export const transferTimes = { polygon: 1, gnosis: 1, nova: 1, - base: 1 + base: 1, + linea: 1, + polygonzk: 1 } } From dcf30b818a40e5ec3cb73ddbd8e1ad0022241863 Mon Sep 17 00:00:00 2001 From: Shane Fontaine <9441295+shanefontaine@users.noreply.github.com> Date: Tue, 9 Jan 2024 13:38:29 -0800 Subject: [PATCH 2/7] backed: add cg API key --- backend/src/config.ts | 1 + backend/src/price.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/config.ts b/backend/src/config.ts index caaadd1..3aff86f 100644 --- a/backend/src/config.ts +++ b/backend/src/config.ts @@ -18,6 +18,7 @@ export const postgresConfig = { maxConnections: process.env.POSTGRES_MAX_CONNECTIONS ? parseInt(process.env.POSTGRES_MAX_CONNECTIONS, 10) : 10 } export const regenesisEnabled = process.env.REGENESIS_ENABLED === 'true' +export const CoingeckoApiKey = process.env.COINGECKO_API_KEY || '' const tokenSet = new Set([]) const chainSet = new Set([]) diff --git a/backend/src/price.ts b/backend/src/price.ts index a89f497..0edee82 100644 --- a/backend/src/price.ts +++ b/backend/src/price.ts @@ -1,5 +1,6 @@ import fetch from 'isomorphic-fetch' import { tokens } from '@hop-protocol/core/metadata' +import { CoingeckoApiKey } from './config' function getCoinId (tokenSymbol: string) { return tokens[tokenSymbol]?.coingeckoId @@ -11,7 +12,7 @@ export async function getPriceHistory (tokenSymbol: string, days: number) { throw new Error(`coingecko coin id not found for token "${tokenSymbol}"`) } - const url = `https://api.coingecko.com/api/v3/coins/${coinId}/market_chart?vs_currency=usd&days=${days}&interval=daily` + const url = `https://api.coingecko.com/api/v3/coins/${coinId}/market_chart?vs_currency=usd&days=${days}&interval=daily&x_cg_pro_api_key=${CoingeckoApiKey}` console.log(url) return Promise.race([fetch(url) .then(async (res: any) => { From 0d048188de15c823aee423b9d64805b5792a81d3 Mon Sep 17 00:00:00 2001 From: Shane Fontaine <9441295+shanefontaine@users.noreply.github.com> Date: Tue, 9 Jan 2024 14:02:42 -0800 Subject: [PATCH 3/7] Add dbeug logs --- backend/src/price.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/price.ts b/backend/src/price.ts index 0edee82..fb3aa33 100644 --- a/backend/src/price.ts +++ b/backend/src/price.ts @@ -23,6 +23,7 @@ export async function getPriceHistory (tokenSymbol: string, days: number) { }) .then((json: any) => { console.log('fetched', coinId) + console.log('debug', JSON.stringify(json)) return json.prices.map((data: any[]) => { data[0] = Math.floor(data[0] / 1000) return data From 01a647d15b8928b528d0d27c6995d803b2cea4eb Mon Sep 17 00:00:00 2001 From: Shane Fontaine <9441295+shanefontaine@users.noreply.github.com> Date: Tue, 9 Jan 2024 14:06:49 -0800 Subject: [PATCH 4/7] be: use pro api endpoint --- backend/src/price.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/price.ts b/backend/src/price.ts index fb3aa33..4e01d5d 100644 --- a/backend/src/price.ts +++ b/backend/src/price.ts @@ -12,7 +12,7 @@ export async function getPriceHistory (tokenSymbol: string, days: number) { throw new Error(`coingecko coin id not found for token "${tokenSymbol}"`) } - const url = `https://api.coingecko.com/api/v3/coins/${coinId}/market_chart?vs_currency=usd&days=${days}&interval=daily&x_cg_pro_api_key=${CoingeckoApiKey}` + const url = `https://pro-api.coingecko.com/api/v3/coins/${coinId}/market_chart?vs_currency=usd&days=${days}&interval=daily&x_cg_pro_api_key=${CoingeckoApiKey}` console.log(url) return Promise.race([fetch(url) .then(async (res: any) => { From b4fbb821b4f7cdcd30c239e1399eaa1376c3e22a Mon Sep 17 00:00:00 2001 From: Shane Fontaine <9441295+shanefontaine@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:22:11 -0800 Subject: [PATCH 5/7] Add lifi on linea --- backend/src/config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/config.ts b/backend/src/config.ts index 3aff86f..85ae4ec 100644 --- a/backend/src/config.ts +++ b/backend/src/config.ts @@ -165,6 +165,7 @@ const _integrationsMap : Record = { '0x3a23f943181408eac424116af7b7790c94cb97a5': 'socket', // socket gateway '0x362fa9d0bca5d19f743db50738345ce2b40ec99f': 'lifi', '0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae': 'lifi', + '0xde1e598b81620773454588b85d6b5d4eec32573e': 'lifi', '0x82e0b8cdd80af5930c4452c684e71c861148ec8a': 'metamask', '0x0439e60f02a8900a951603950d8d4527f400c3f1': 'metamask', // mainnet '0xb90357f2b86dbfd59c3502215d4060f71df8ca0e': 'metamask', // optimism From 386c1b7f3a9f186833c56ac62a3fa4742b9d183f Mon Sep 17 00:00:00 2001 From: Shane Fontaine <9441295+shanefontaine@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:53:57 -0800 Subject: [PATCH 6/7] Bump --- backend/package.json | 2 +- frontend/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index 44444c6..9fb9f51 100644 --- a/backend/package.json +++ b/backend/package.json @@ -41,7 +41,7 @@ "typescript": "^4.6.3" }, "dependencies": { - "@hop-protocol/core": "^0.0.1-beta.217", + "@hop-protocol/core": "^0.0.1-beta.218", "@types/memory-cache": "^0.2.2", "@types/pidusage": "^2.0.2", "cors": "^2.8.5", diff --git a/frontend/package.json b/frontend/package.json index ba17e83..7304b9e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -18,7 +18,7 @@ "dependencies": { "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", - "@hop-protocol/core": "^0.0.1-beta.203", + "@hop-protocol/core": "^0.0.1-beta.204", "@mui/icons-material": "^5.11.0", "@mui/material": "^5.11.8", "@mui/styles": "^5.11.7", From 4992e0310ab2092a72478b08af996d4179ce167a Mon Sep 17 00:00:00 2001 From: Shane Fontaine <9441295+shanefontaine@users.noreply.github.com> Date: Thu, 1 Feb 2024 16:17:36 -0800 Subject: [PATCH 7/7] bump --- backend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index 9fb9f51..09d3804 100644 --- a/backend/package.json +++ b/backend/package.json @@ -41,7 +41,7 @@ "typescript": "^4.6.3" }, "dependencies": { - "@hop-protocol/core": "^0.0.1-beta.218", + "@hop-protocol/core": "^0.0.1-beta.219", "@types/memory-cache": "^0.2.2", "@types/pidusage": "^2.0.2", "cors": "^2.8.5",