octez.js TypeDocs
    Preparing search index...

    The WalletConnect class implements the WalletProvider interface, providing an alternative to BeaconWallet. This package enables dapps built with octez.js 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
    Index
    signClient: SignClient
    • Configure the Client with an existing session. The session is immediately restored without a prompt on the wallet to accept/decline it. *

      Parameters

      • key: string

      Returns void

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

    • Access the public key of the active account *

      Returns Promise<string>

      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

    • Access the public key hash of the active account *

      Returns Promise<string>

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

    • Transform WalletDelegateParams into a format compliant with the underlying wallet

      Parameters

      • params: () => Promise<WalletDelegateParams>

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

    • Transform WalletFinalizeUnstakeParams into a format compliant with the underlying wallet

      Parameters

      • params: () => Promise<WalletFinalizeUnstakeParams>

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

    • Transform WalletIncreasePaidStorageParams into a format compliant with the underlying wallet

      Parameters

      • params: () => Promise<WalletIncreasePaidStorageParams>

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

    • Transform WalletOriginateParams into a format compliant with the underlying wallet

      Parameters

      • params: () => Promise<WalletOriginateParams>

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

    • Transform WalletRegisterGlobalConstantParams into a format compliant with the underlying wallet

      Parameters

      • params: () => Promise<WalletRegisterGlobalConstantParams>

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

    • Transform WalletStakeParams into a format compliant with the underlying wallet

      Parameters

      • params: () => Promise<WalletStakeParams>

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

    • Transform WalletTransferParams into a format compliant with the underlying wallet

      Parameters

      • params: () => Promise<WalletTransferParams>

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

    • Transform WalletTransferTicketParams into a format compliant with the underlying wallet

      Parameters

      • params: () => Promise<WalletTransferTicketParams>

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

    • Transform WalletUnstakeParams into a format compliant with the underlying wallet

      Parameters

      • params: () => Promise<WalletUnstakeParams>

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

    • Request permission for a new session and establish a connection.

      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>

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

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

      Parameters

      • pkh: string

        public key hash of the selected account *

      Returns void

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

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

      Parameters

      • bytes: string
      • Optionalwatermark: Uint8Array<ArrayBufferLike>

      Returns Promise<string>

      MissingRequiredScope is thrown if permission to sign payload was not granted

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

      Parameters

      • initParams: Options

      Returns Promise<WalletConnect>

      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",
      },
      });