The WalletConnect class implements the WalletProvider interface, providing an alternative to BeaconWallet. This package enables dapps built with Taquito to connect to wallets via the WalletConnect/Reown protocol.

Currently, a QR code is displayed to establish a connection with a wallet. As more Tezos wallets integrate with WalletConnect, we plan showing a list of available wallets alongside the QR code.

Implements

  • WalletProvider

Constructors

Properties

signClient: SignClient

Methods

  • Parameters

    • key: string

    Returns void

    Configure the Client with an existing session. The session is immediately restored without a prompt on the wallet to accept/decline it.

    InvalidSessionKey is thrown if the provided session key doesn't exist

  • Returns Promise<string>

    Access the public key of the active account

    ActiveAccountUnspecified thrown when there are multiple Tezos account in the session and none is set as the active one

    MissingRequiredScope is thrown if permission to get accounts was not granted

    PublicKeyRetrievalError is thrown if the public key is not found

  • Returns Promise<string>

    Access the public key hash of the active account

    ActiveAccountUnspecified thrown when there are multiple Tezos account in the session and none is set as the active one

  • Parameters

    • params: (() => Promise<WalletDelegateParams>)
        • (): Promise<WalletDelegateParams>
        • Returns Promise<WalletDelegateParams>

    Returns Promise<
        | Partial<RPCTransferOperation>
        | Partial<RPCTransferTicketOperation>
        | Partial<RPCOriginationOperation>
        | Partial<RPCDelegateOperation>
        | Partial<RPCIncreasePaidStorageOperation>>

    Transform WalletDelegateParams into a format compliant with the underlying wallet

  • Parameters

    • params: (() => Promise<WalletFinalizeUnstakeParams>)
        • (): Promise<WalletFinalizeUnstakeParams>
        • Returns Promise<WalletFinalizeUnstakeParams>

    Returns Promise<
        | Partial<RPCTransferOperation>
        | Partial<RPCTransferTicketOperation>
        | Partial<RPCOriginationOperation>
        | Partial<RPCDelegateOperation>
        | Partial<RPCIncreasePaidStorageOperation>>

    Transform WalletFinalizeUnstakeParams into a format compliant with the underlying wallet

  • Parameters

    • params: (() => Promise<WalletIncreasePaidStorageParams>)
        • (): Promise<WalletIncreasePaidStorageParams>
        • Returns Promise<WalletIncreasePaidStorageParams>

    Returns Promise<
        | Partial<RPCTransferOperation>
        | Partial<RPCTransferTicketOperation>
        | Partial<RPCOriginationOperation>
        | Partial<RPCDelegateOperation>
        | Partial<RPCIncreasePaidStorageOperation>>

    Transform WalletIncreasePaidStorageParams into a format compliant with the underlying wallet

  • Parameters

    • params: (() => Promise<WalletOriginateParams>)
        • (): Promise<WalletOriginateParams>
        • Returns Promise<WalletOriginateParams>

    Returns Promise<
        | Partial<RPCTransferOperation>
        | Partial<RPCTransferTicketOperation>
        | Partial<RPCOriginationOperation>
        | Partial<RPCDelegateOperation>
        | Partial<RPCIncreasePaidStorageOperation>>

    Transform WalletOriginateParams into a format compliant with the underlying wallet

  • Parameters

    • params: (() => Promise<WalletStakeParams>)
        • (): Promise<WalletStakeParams>
        • Returns Promise<WalletStakeParams>

    Returns Promise<
        | Partial<RPCTransferOperation>
        | Partial<RPCTransferTicketOperation>
        | Partial<RPCOriginationOperation>
        | Partial<RPCDelegateOperation>
        | Partial<RPCIncreasePaidStorageOperation>>

    Transform WalletStakeParams into a format compliant with the underlying wallet

  • Parameters

    • params: (() => Promise<WalletTransferParams>)
        • (): Promise<WalletTransferParams>
        • Returns Promise<WalletTransferParams>

    Returns Promise<
        | Partial<RPCTransferOperation>
        | Partial<RPCTransferTicketOperation>
        | Partial<RPCOriginationOperation>
        | Partial<RPCDelegateOperation>
        | Partial<RPCIncreasePaidStorageOperation>>

    Transform WalletTransferParams into a format compliant with the underlying wallet

  • Parameters

    • params: (() => Promise<WalletTransferTicketParams>)
        • (): Promise<WalletTransferTicketParams>
        • Returns Promise<WalletTransferTicketParams>

    Returns Promise<
        | Partial<RPCTransferOperation>
        | Partial<RPCTransferTicketOperation>
        | Partial<RPCOriginationOperation>
        | Partial<RPCDelegateOperation>
        | Partial<RPCIncreasePaidStorageOperation>>

    Transform WalletTransferTicketParams into a format compliant with the underlying wallet

  • Parameters

    • params: (() => Promise<WalletUnstakeParams>)
        • (): Promise<WalletUnstakeParams>
        • Returns Promise<WalletUnstakeParams>

    Returns Promise<
        | Partial<RPCTransferOperation>
        | Partial<RPCTransferTicketOperation>
        | Partial<RPCOriginationOperation>
        | Partial<RPCDelegateOperation>
        | Partial<RPCIncreasePaidStorageOperation>>

    Transform WalletUnstakeParams into a format compliant with the underlying wallet

  • Parameters

    • connectParams: {
          pairingTopic?: string;
          permissionScope: PermissionScopeParam;
          registryUrl?: string;
      }
      • OptionalpairingTopic?: string

        Option to connect to an existing active pairing. If pairingTopic is defined, a prompt will appear in the corresponding wallet to accept or decline the session proposal. If no pairingTopic, a QR code modal will open in the dapp, allowing to connect to a wallet.

      • permissionScope: PermissionScopeParam

        The networks, methods, and events that will be granted permission

      • OptionalregistryUrl?: string

        Optional registry of wallet deep links to show in the Modal

    Returns Promise<void>

    Request permission for a new session and establish a connection.

    ConnectionFailed is thrown if no connection can be established with a wallet

  • Parameters

    Returns Promise<string>

    Once the session is establish, send Tezos operations to be approved, signed and inject by the wallet.

    MissingRequiredScope is thrown if permission to send operation was not granted

  • Parameters

    • pkh: string

      public key hash of the selected account

    Returns void

    Set the active account. Must be called if there are multiple accounts in the session and every time the active account is switched

    InvalidAccount thrown if the pkh is not part of the active accounts in the session

  • Parameters

    Returns void

    Set the active network. Must be called if there are multiple network in the session and every time the active network is switched

    InvalidNetwork thrown if the network is not part of the active networks in the session

  • Parameters

    • bytes: string
    • Optionalwatermark: Uint8Array

    Returns Promise<string>

    Once the session is establish, send payload to be signed by the wallet.

    MissingRequiredScope is thrown if permission to sign payload was not granted

  • Parameters

    • initParams: Options

    Returns Promise<WalletConnect>

    Initialize a WalletConnect provider (Initialize a WalletConnect client with persisted storage and a network connection)

    await WalletConnect.init({
    projectId: "YOUR_PROJECT_ID", // can get YOUR_PROJECT_ID from [Reown Cloud](https://cloud.reown.com)
    metadata: {
    name: "YOUR_DAPP_NAME",
    description: "YOUR_DAPP_DESCRIPTION",
    icons: ["ICON_URL"],
    url: "DAPP_URL",
    },
    });