soroswap / info

Analytics site for Soroswap
https://info.soroswap.finance
GNU General Public License v3.0
3 stars 8 forks source link

2 Zephyr Program Addresses should be taken from /zephyr-programs GitHub Repo #66

Closed esteblock closed 2 months ago

esteblock commented 2 months ago

Currently addresses are hadcoded in src/zephyr/tables.rs

export const ZEPHYR_TABLES = {
  MAINNET: {
    EVENTS: "allZephyrE2092A374F6Cee83Be541C0Fc968C420S",
    PAIRS: "allZephyr923625Cad8F2Bf73069B63583354Ba4As",
    RSV_CH: "allZephyr75975A6609Cbc8F6Ca44Be2B6A15004Fs",
    PHOENIX_PAIRS: "allZephyrAdce4722715Daeecd1B5A878B557B8Abs",
  },
  TESTNET: {
    EVENTS: "allZephyrBb78C5E2F153Dbca0121622E3B87D92Es",
    PAIRS: "allZephyrAc4C7D40C78D2B474009391E80Aedb99S",
    RSV_CH: "allZephyr5C10Be3769D18F24254F26Eafab4Ef45S",
    PHOENIX_PAIRS: "allZephyr979734A56Cb32104E44245Cc51E5336Es",
  },
};

Desired Bring addresses, indexed for network from the /zephyr-programs. Dont hardcode Zephyr program addresses.

esteblock commented 2 months ago

https://github.com/soroswap/zephyr-programs

chopan123 commented 2 months ago

yarn build is failing:

[12:41:17.974] Running build in Washington, D.C., USA (East) – iad1
[12:41:18.089] Cloning github.com/soroswap/info (Branch: feature/FetchZephyrProgramAddresses, Commit: 33bc088)
[12:41:18.317] Cloning completed: 225.277ms
[12:41:24.204] Restored build cache from previous deployment (3gNWpZMUZdRHTLJyrCa5MhJETpb4)
[12:41:24.278] Running "vercel build"
[12:41:25.134] Vercel CLI 37.1.2
[12:41:26.041] Installing dependencies...
[12:41:26.434] yarn install v1.22.19
[12:41:26.505] [1/4] Resolving packages...
[12:41:26.703] success Already up-to-date.
[12:41:26.713] Done in 0.28s.
[12:41:26.725] Detected Next.js version: 14.0.4
[12:41:26.728] Running "yarn run build"
[12:41:26.932] yarn run v1.22.19
[12:41:26.970] $ next build
[12:41:27.854]    Linting and checking validity of types ...
[12:41:32.030] Failed to compile.
[12:41:32.030] 
[12:41:32.030] ./src/zephyr/helpers.ts:101:11
[12:41:32.031] Type error: Property 'rsv_ch' does not exist on type 'ZephyrTables'.
[12:41:32.031] 
[12:41:32.031]    99 | export const getMercuryRsvCh = async (network: Network) => {
[12:41:32.031]   100 |   const mercuryInstance = getMercuryInstance(network);
[12:41:32.031] > 101 |   const { rsv_ch } = await fetchZephyrTables({ network });
[12:41:32.031]       |           ^
[12:41:32.031]   102 |   const response = await mercuryInstance.getCustomQuery({
[12:41:32.031]   103 |     request: GET_ALL_RSV_CH(rsv_ch),
[12:41:32.031]   104 |   });
[12:41:32.075] error Command failed with exit code 1.
[12:41:32.076] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[12:41:32.330] Error: Command "yarn run build" exited with 1
[12:41:33.212]