From eb48c96c9a38b8c947c890f270b2129c1c10c64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Brzezin=CC=81ski?= Date: Mon, 1 Jul 2024 22:52:37 +0200 Subject: [PATCH] fix --- pages/api/tokentiers.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pages/api/tokentiers.ts b/pages/api/tokentiers.ts index 5fa06367..dd6b8153 100644 --- a/pages/api/tokentiers.ts +++ b/pages/api/tokentiers.ts @@ -1,5 +1,5 @@ import type { NextApiRequest, NextApiResponse } from 'next' -import { MangoClient } from '@blockworks-foundation/mango-v4' +import { MANGO_V4_ID, MangoClient } from '@blockworks-foundation/mango-v4' import { AnchorProvider, Wallet } from '@coral-xyz/anchor' import { Connection, PublicKey, Keypair } from '@solana/web3.js' import { @@ -48,6 +48,7 @@ async function buildClient(): Promise { const options = AnchorProvider.defaultOptions() const rpcUrl = process.env.NEXT_PUBLIC_ENDPOINT || TRITON_DEDICATED_URL + console.log(rpcUrl, '@@@@@@@') if (!rpcUrl) { throw new Error('MANGO_RPC_URL environment variable is not set') } @@ -59,10 +60,13 @@ async function buildClient(): Promise { return MangoClient.connect( clientProvider, 'mainnet-beta', - new PublicKey('4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg'), + MANGO_V4_ID['mainnet-beta'], + { + idsSource: 'api', + }, ) } catch (e) { - console.log(e, '@@@@@@') + console.log(e) } }