Options
All
  • Public
  • Public/Protected
  • All
Menu

A simple interface that defines the callbacks that can be implemented

Hierarchy

  • WcCallbacks

Index

Methods

Optional onCreated

  • onCreated(topics: string[]): void
  • Defines the callback for when a pairing is created

    Parameters

    • topics: string[]

    Returns void

Optional onDeleted

  • onDeleted(): void
  • Defines a callback for when the wallet disconnects from the dApp

    wcInstance.subscribeToEvents({
    onDeleted: () => {
    // here is where you describe a logout callback
    logout()
    }
    })

    Returns void

Optional onProposal

  • onProposal(uri: string): void
  • Defines the callback for when the proposal is built so the dApp can show a QRCode to start the connection.

    wcInstance.subscribeToEvents({
    onProposal: (uri: string) => {
    // show the QRCode, you can use @walletconnect/qrcode-modal to do so, but any QRCode presentation is fine
    QRCodeModal.open(uri, () => {})
    // alternatively you can show Neon Wallet's connection website, which is more welcoming
    window.open(`https://neon.coz.io/connect?uri=${uri}`, '_blank').focus();
    }
    })

    Parameters

    • uri: string

      the code that will be delivered to the wallet to establish a connection

    Returns void

Generated using TypeDoc