Skip to content

Commit

Permalink
chore: provider fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Bulat committed Oct 26, 2023
1 parent f44da35 commit 74ddbb5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/config/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const NetworkList: Networks = {
polkadot: {
name: 'polkadot',
endpoints: {
rpc: 'wss://apps-rpc.polkadot.io',
lightClient: WellKnownChain.polkadot,
defaultRpcEndpoint: 'Automata 1RPC',
rpcEndpoints: {
Expand Down Expand Up @@ -90,7 +89,6 @@ export const NetworkList: Networks = {
kusama: {
name: 'kusama',
endpoints: {
rpc: 'wss://kusama-rpc.polkadot.io',
lightClient: WellKnownChain.ksmcc3,
defaultRpcEndpoint: 'Automata 1RPC',
rpcEndpoints: {
Expand Down Expand Up @@ -160,7 +158,6 @@ export const NetworkList: Networks = {
westend: {
name: 'westend',
endpoints: {
rpc: 'wss://westend-rpc.polkadot.io',
lightClient: WellKnownChain.westend2,
defaultRpcEndpoint: 'OnFinality',
rpcEndpoints: {
Expand Down
3 changes: 2 additions & 1 deletion src/contexts/Api/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ export const APIProvider = ({ children, network }: APIProviderProps) => {
// connect function sets provider and updates active network.
const connectProvider = async (lc?: ScProvider) => {
const newProvider =
lc || new WsProvider(NetworkList[network].endpoints.rpc);
lc ||
new WsProvider(NetworkList[network].endpoints.rpcEndpoints[rpcEndpoint]);
if (lc) {
await newProvider.connect();
}
Expand Down
1 change: 0 additions & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type NetworkColor =
export interface Network {
name: NetworkName;
endpoints: {
rpc: string;
lightClient: AnyApi;
defaultRpcEndpoint: string;
rpcEndpoints: Record<string, string>;
Expand Down

0 comments on commit 74ddbb5

Please sign in to comment.