From 98ab2c635aa9b03a574b0f6387e3a60a4a8d3066 Mon Sep 17 00:00:00 2001 From: Bob van der Helm <34470358+bobthebuidlr@users.noreply.github.com> Date: Fri, 2 Feb 2024 14:05:00 +0100 Subject: [PATCH] update osmosis nodes to Rhino (#762) --- .env.example | 2 +- src/configs/chains/osmosis/osmosis-1.ts | 4 ++-- src/hooks/useWalletBalances.tsx | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 5eb59ecd..7090bfc3 100644 --- a/.env.example +++ b/.env.example @@ -13,4 +13,4 @@ CHARTING_LIBRARY_ACCESS_TOKEN=access_token CHARTING_LIBRARY_REPOSITORY=github.com/tradingview/charting_library/ NEXT_PUBLIC_PYTH_API=https://mars.rpc.p2p.world/api - +NEXT_PUBLIC_API_KEY=api_key diff --git a/src/configs/chains/osmosis/osmosis-1.ts b/src/configs/chains/osmosis/osmosis-1.ts index deab52b8..73324653 100644 --- a/src/configs/chains/osmosis/osmosis-1.ts +++ b/src/configs/chains/osmosis/osmosis-1.ts @@ -137,8 +137,8 @@ const Osmosis1: ChainConfig = { }, }, endpoints: { - rpc: 'https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-rpc-front/', - rest: 'https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-lcd-front/', + rpc: 'https://osmosis-rpc.cosmos-apis.com?x-apikey=' + process.env.NEXT_PUBLIC_API_KEY, + rest: 'https://osmosis-rest.cosmos-apis.com/', swap: 'https://app.osmosis.zone', explorer: 'https://www.mintscan.io/osmosis/transactions/', routes: 'https://sqs.osmosis.zone/router', diff --git a/src/hooks/useWalletBalances.tsx b/src/hooks/useWalletBalances.tsx index 0a57a630..a7cb42ec 100644 --- a/src/hooks/useWalletBalances.tsx +++ b/src/hooks/useWalletBalances.tsx @@ -18,7 +18,9 @@ export default function useWalletBalances(address?: string) { async function getWalletBalances(chainConfig: ChainConfig, address: string): Promise { const uri = '/cosmos/bank/v1beta1/balances/' - const response = await fetch(`${chainConfig.endpoints.rest}${uri}${address}`) + const response = await fetch( + `${chainConfig.endpoints.rest}${uri}${address}?x-apikey=${process.env.NEXT_PUBLIC_API_KEY}`, + ) if (response.ok) { const data = await response.json()