Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@walletconnect/web3wallet
Advanced tools
The Web3Wallet SDK streamlines the integration process, making it easier for wallet developers to include the authentication and transaction signing features necessary for their users to connect and interact with all sorts of apps — now and in the future.
npm install @walletconnect/web3wallet
import { Core } from "@walletconnect/core";
import { Web3Wallet } from "@walletconnect/web3wallet";
const core = new Core({
projectId: process.env.PROJECT_ID,
});
const web3wallet = await Web3Wallet.init({
core, // <- pass the shared `core` instance
metadata: {
name: "Demo app",
description: "Demo Client as Wallet/Peer",
url: "www.walletconnect.com",
icons: [],
},
});
web3wallet.on("session_proposal", async (proposal) => {
const session = await web3wallet.approveSession({
id: proposal.id,
namespaces,
});
});
await web3wallet.core.pairing.pair({ uri });
web3wallet.on("session_proposal", async (proposal) => {
const session = await web3wallet.rejectSession({
id: proposal.id,
reason: getSdkError("USER_REJECTED_METHODS"),
});
});
await web3wallet.disconnectSession({
topic,
reason: getSdkError("USER_DISCONNECTED"),
});
web3wallet.on("session_request", async (event) => {
const { id, method, params } = event.request;
await web3wallet.respondSessionRequest({ id, result: response });
});
await web3wallet.updateSession({ topic, namespaces: newNs });
await web3wallet.extendSession({ topic });
await web3wallet.emitSessionEvent({
topic,
event: {
name: "accountsChanged",
data: ["0xab16a96D359eC26a11e2C2b3d8f8B8942d5Bfcdb"],
},
chainId: "eip155:1",
});
web3wallet.on("session_proposal", handler);
web3wallet.on("session_request", handler);
web3wallet.on("session_delete", handler);
const iss = `did:pkh:eip155:1:${address}`;
web3wallet.on("auth_request", async (event) => {
// format the payload
const message = web3wallet.formatMessage(event.params.cacaoPayload, iss);
// prompt the user to sign the message
const signature = await wallet.signMessage(message);
// respond
await web3wallet.respondAuthRequest(
{
id: args.id,
signature: {
s: signature,
t: "eip191",
},
},
iss,
);
});
await web3wallet.core.pairing.pair({ uri: request.uri, activatePairing: true });
web3wallet.on("auth_request", handler);
FAQs
Web3Wallet for WalletConnect Protocol
The npm package @walletconnect/web3wallet receives a total of 26,845 weekly downloads. As such, @walletconnect/web3wallet popularity was classified as popular.
We found that @walletconnect/web3wallet demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 13 open source maintainers 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.