Skip to content

Commit

Permalink
Merge pull request #245 from gnoswap-labs/GSW-656-change-to-json-rpc-…
Browse files Browse the repository at this point in the history
…provider

feat: [GSW-656] Change to JSON RPCProvider
  • Loading branch information
jinoosss authored Dec 11, 2023
2 parents 72b7620 + 540a777 commit e262f61
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { TokenRepositoryImpl } from "@repositories/token/token-repository-impl";
import { createContext, useEffect, useLayoutEffect, useMemo, useState } from "react";
import { useAtom } from "jotai";
import { CommonState, WalletState } from "@states/index";
import { GnoJSONRPCProvider, GnoProvider, GnoWSProvider } from "@gnolang/gno-js-client";
import { GnoJSONRPCProvider, GnoProvider } from "@gnolang/gno-js-client";
import { SwapRepositoryImpl } from "@repositories/swap/swap-repository-impl";
import ChainNetworkInfos from "@resources/chains.json";
import { SwapRouterRepository } from "@repositories/swap/swap-router-repository";
Expand Down Expand Up @@ -104,8 +104,7 @@ const GnoswapServiceProvider: React.FC<React.PropsWithChildren> = ({
const currentNetwork = network || ChainNetworkInfos.find(info => info.chainId === defaultChainId);
if (currentNetwork) {
try {
const provider = new GnoWSProvider(currentNetwork.wsUrl, 5 * 1000);
await provider.waitForOpenConnection();
const provider = new GnoJSONRPCProvider(currentNetwork.rpcUrl);
setRPCProvider(provider);
return true;
} catch (error) {
Expand Down

0 comments on commit e262f61

Please sign in to comment.