@xmtp/consent-proof-signature
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Consent Proof Signature

Usage

const timestamp = Date.now();
const message = createConsentMessage(broadcastAddress, timestamp);
// Sign the message for example with Viem
import { createWalletClient, custom } from "viem";

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

Package Sidebar

Install

npm i @xmtp/consent-proof-signature

Weekly Downloads

1,633

Version

0.1.3

License

MIT

Unpacked Size

9.22 kB

Total Files

11

Last publish

Collaborators

  • alexxmtp
  • fabriguespe
  • nplasterer-xmtp
  • saul-xmtp
  • nick-xmtp
  • xmtp-eng-robot
  • galligan