Socket
Book a DemoInstallSign in
Socket

@xmtp/consent-proof-signature

Package Overview
Dependencies
Maintainers
7
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xmtp/consent-proof-signature

## Usage

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1K
25.55%
Maintainers
7
Weekly downloads
 
Created
Source

Usage

// Sign the message for example with Viem
import { createWalletClient, custom } from "viem";

const timestamp = Date.now();
const message = createConsentMessage(broadcastAddress, timestamp);

const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom((window as any).ethereum!),
});
const [account] = await walletClient.getAddresses();
const signature = await walletClient.signMessage({
  account,
  message,
});
const consentProofBytes = createConsentProofPayload(signature, timestamp);

Now the consentProofBytes can be encoded and sent to a service to decode and add in a new conversation invitation

Keywords

xmtp

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

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.

Install

Related posts