From bce93ce3cdc1ef4b1f50fcf274591ba00726be16 Mon Sep 17 00:00:00 2001 From: rampall Date: Wed, 18 Oct 2023 16:42:06 +0300 Subject: [PATCH] fix: update `swap-endpoint` to `blockchain-rpc-endpoint` (#628) --- src/pages/settings/index.tsx | 2 +- src/pages/status/SetupSteps/EthereumConnectionCheck.tsx | 2 +- src/pages/top-up/Swap.tsx | 8 ++++---- src/utils/desktop.ts | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pages/settings/index.tsx b/src/pages/settings/index.tsx index 63206f56..b81cdd76 100644 --- a/src/pages/settings/index.tsx +++ b/src/pages/settings/index.tsx @@ -30,7 +30,7 @@ export default function SettingsPage(): ReactElement { try { setAndPersistJsonRpcProvider(value) - const shouldUpdateDesktop = isDesktop && (await getDesktopConfiguration(desktopUrl))['swap-endpoint'] + const shouldUpdateDesktop = isDesktop && (await getDesktopConfiguration(desktopUrl))['blockchain-rpc-endpoint'] if (shouldUpdateDesktop) { await setJsonRpcInDesktop(desktopUrl, value) diff --git a/src/pages/status/SetupSteps/EthereumConnectionCheck.tsx b/src/pages/status/SetupSteps/EthereumConnectionCheck.tsx index 70b441fe..c10a351b 100644 --- a/src/pages/status/SetupSteps/EthereumConnectionCheck.tsx +++ b/src/pages/status/SetupSteps/EthereumConnectionCheck.tsx @@ -34,7 +34,7 @@ export default function EthereumConnectionCheck(): ReactElement | null { Getblock . By default, Bee expects a local node at http://localhost:8545. To use a provider instead, simply change - the swap-endpoint in your configuration file. + the blockchain-rpc-endpoint in your configuration file. )} diff --git a/src/pages/top-up/Swap.tsx b/src/pages/top-up/Swap.tsx index e93b4194..86b8ed63 100644 --- a/src/pages/top-up/Swap.tsx +++ b/src/pages/top-up/Swap.tsx @@ -162,12 +162,12 @@ export function Swap({ header }: Props): ReactElement { ) } - if (!desktopConfiguration['swap-endpoint']) { - throw new SwapError('Swap endpoint is not configured in Swarm Desktop') + if (!desktopConfiguration['blockchain-rpc-endpoint']) { + throw new SwapError('Blockchain RPC endpoint is not configured in Swarm Desktop') } await wrapWithSwapError( - Rpc.getNetworkChainId(desktopConfiguration['swap-endpoint']), - `Swap endpoint not reachable at ${desktopConfiguration['swap-endpoint']}`, + Rpc.getNetworkChainId(desktopConfiguration['blockchain-rpc-endpoint']), + `Blockchain RPC endpoint not reachable at ${desktopConfiguration['blockchain-rpc-endpoint']}`, ) await wrapWithSwapError(sendSwapRequest(daiToSwap), GENERIC_SWAP_FAILED_ERROR_MESSAGE) } diff --git a/src/utils/desktop.ts b/src/utils/desktop.ts index a96d798a..64391526 100644 --- a/src/utils/desktop.ts +++ b/src/utils/desktop.ts @@ -17,7 +17,7 @@ export interface BeeConfig { 'resolver-options': string 'use-postage-snapshot': boolean 'data-dir': string - 'swap-endpoint'?: string + 'blockchain-rpc-endpoint'?: string } export async function getBzzPriceAsDai(desktopUrl: string): Promise { @@ -29,13 +29,13 @@ export async function getBzzPriceAsDai(desktopUrl: string): Promise { export function upgradeToLightNode(desktopUrl: string, rpcProvider: string): Promise { return updateDesktopConfiguration(desktopUrl, { 'swap-enable': true, - 'swap-endpoint': rpcProvider, + 'blockchain-rpc-endpoint': rpcProvider, }) } export async function setJsonRpcInDesktop(desktopUrl: string, value: string): Promise { await updateDesktopConfiguration(desktopUrl, { - 'swap-endpoint': value, + 'blockchain-rpc-endpoint': value, }) }