Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Connecting web applications to the Cosmos ecosystem.
yarn && yarn start
# OR
npm install && npm run start
Now It supports React application only.
yarn add cosmodal
# OR
npm install --save cosmodal
WalletManagerProvider
and render it around your whole app.import { getKeplrFromWindow } from "@keplr-wallet/stores";
import WalletConnect from "@walletconnect/client";
import {
KeplrWalletConnectV1,
WalletInfo,
WalletManagerProvider,
} from "cosmodal";
import type { AppProps } from "next/app";
import Head from "next/head";
import { EmbedChainInfos } from "../config";
const walletInfoList: WalletInfo[] = [
{
id: "keplr-wallet-extension",
name: "Keplr Wallet",
description: "Keplr Browser Extension",
logoImgUrl: "/keplr-wallet-extension.png",
getWallet: () => getKeplrFromWindow(),
},
{
id: "walletconnect-keplr",
name: "WalletConnect",
description: "Keplr Mobile",
logoImgUrl: "/walletconnect-keplr.png",
getWallet: (connector?: WalletConnect) =>
Promise.resolve(
connector
? new KeplrWalletConnectV1(connector, EmbedChainInfos)
: undefined
),
},
];
function MyApp({ Component, pageProps }: AppProps) {
return (
<WalletManagerProvider walletInfoList={walletInfoList}>
<Component {...pageProps} />
</WalletManagerProvider>
);
}
export default MyApp;
useWalletManager
in your componentimport { Keplr } from "@keplr-wallet/types";
import { KeplrWalletConnectV1, useWalletManager } from "cosmodal";
import type { NextPage } from "next";
import { useState } from "react";
const Home: NextPage = () => {
const [address, setAddress] = useState("");
const { getWallet } = useWalletManager();
const connectWallet = async () => {
const wallet: Keplr | KeplrWalletConnectV1 = await getWallet();
await wallet.enable(["cosmoshub-4"]);
const key = await wallet.getKey("cosmoshub-4");
setAddress(key.bech32Address);
};
return <div>Your address: {address}</div>;
};
export default Home;
To learn more about Cosmodal API, please check our example code
To learn more about how to use Keplr-specific API, please check the following resources:
To learn more about JavaScript client library for Cosmos check out CosmJS
FAQs
Connecting web applications to the Cosmos ecosystem.
We found that cosmodal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.