Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client";

import { WalletProvider } from "../WalletProvider";
import { ChainProvider } from "@cosmos-kit/react";
import { useNetwork } from "../NetworkProvider";
Expand All @@ -18,10 +16,10 @@ export function WalletProviderWrapper({
}: {
children: React.ReactNode;
}) {
const { networkMeta: meta } = useNetwork();
const { networkMeta: meta, currentNetwork } = useNetwork();
const wallets = [new KeplrExtensionWallet(keplrExtensionInfo)];

const chain = getOverlockChain(meta);
const chain = getOverlockChain(meta, currentNetwork);
const assetList = getOverlockAssetList(meta);

return (
Expand All @@ -31,6 +29,14 @@ export function WalletProviderWrapper({
throwErrors={false}
assetLists={[assetList]}
walletModal={DefaultModal}
endpointOptions={{
endpoints: {
[meta.chain_name]: {
rpc: meta.apis.rpc.map((api) => api.address),
rest: meta.apis.rest.map((api) => api.address),
},
},
}}
>
<WalletProvider>{children}</WalletProvider>
</ChainProvider>
Expand Down
10 changes: 7 additions & 3 deletions app/src/chain/client/cosmos/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
ibcProtoRegistry,
} from "interchain";
import type { AssetList, Chain } from "@chain-registry/types";
import { NetworkMeta } from "./types";
import { Network, NetworkMeta } from "./types";

export const protoRegistry: ReadonlyArray<[string, GeneratedType]> = [
...cosmosProtoRegistry,
Expand All @@ -30,11 +30,15 @@ export const aminoConverters = {

export const COIN_DECIMALS = 6;

export function getOverlockChain(meta: NetworkMeta): Chain {
export function getOverlockChain(
meta: NetworkMeta,
currentNetwork: Network,
): Chain {
const network_type = currentNetwork.name == "Devnet" ? "devnet" : "testnet";
return {
chain_name: meta.chain_name,
status: meta.status,
network_type: "testnet",
network_type,
pretty_name: meta.pretty_name,
chain_id: meta.chain_id,
chain_type: "cosmos",
Expand Down