Constructors

Properties

approveSession: ((params: {
    id: number;
    namespaces: Record<string, BaseNamespace>;
    relayProtocol?: string;
}) => Promise<Struct>) = ...

Approve a session proposal from a dapp

Type declaration

    • (params): Promise<Struct>
    • Parameters

      • params: {
            id: number;
            namespaces: Record<string, BaseNamespace>;
            relayProtocol?: string;
        }
        • id: number
        • namespaces: Record<string, BaseNamespace>
        • OptionalrelayProtocol?: string

      Returns Promise<Struct>

      • The session data
disconnectSession: ((params: {
    reason: ErrorResponse;
    topic: string;
}) => Promise<void>) = ...

Disconnect a WalletConnect session

Type declaration

    • (params): Promise<void>
    • Parameters

      • params: {
            reason: ErrorResponse;
            topic: string;
        }
        • reason: ErrorResponse
        • topic: string

      Returns Promise<void>

emitSessionEvent: ((params: {
    chainId: string;
    event: any;
    topic: string;
}) => Promise<void>) = ...

Emit session events

Type declaration

    • (params): Promise<void>
    • Parameters

      • params: {
            chainId: string;
            event: any;
            topic: string;
        }
        • chainId: string
        • event: any
        • topic: string

      Returns Promise<void>

extendSession: ((params: {
    topic: string;
}) => Promise<void>) = ...

Extend WalletConnect session by updating session expiry

Type declaration

    • (params): Promise<void>
    • Parameters

      • params: {
            topic: string;
        }
        • topic: string

      Returns Promise<void>

getActiveSessions: (() => Record<string, Struct>) = ...

Get active sessions

Type declaration

    • (): Record<string, Struct>
    • Returns Record<string, Struct>

getPendingSessionProposals: (() => Record<number, Struct>) = ...

Get pending session proposals

Type declaration

    • (): Record<number, Struct>
    • Returns Record<number, Struct>

getPendingSessionRequests: (() => Struct[]) = ...

Get pending session requests

Type declaration

    • (): Struct[]
    • Returns Struct[]

pair: ((params: {
    activatePairing?: boolean;
    uri: string;
}) => Promise<void>) = ...

Pair with the given URI received from a dapp

rejectSession: ((params: {
    id: number;
    reason: ErrorResponse;
}) => Promise<void>) = ...

Reject a session proposal from a dapp

Type declaration

    • (params): Promise<void>
    • Parameters

      • params: {
            id: number;
            reason: ErrorResponse;
        }
        • id: number
        • reason: ErrorResponse

      Returns Promise<void>

respondSessionRequest: ((params: {
    response: JsonRpcResponse;
    topic: string;
}) => Promise<void>) = ...

Respond to a session request received from a dapp

updateSession: ((params: {
    namespaces: Namespaces;
    topic: string;
}) => Promise<void>) = ...

Update WalletConnect session namespaces

Type declaration

    • (params): Promise<void>
    • Parameters

      • params: {
            namespaces: Namespaces;
            topic: string;
        }
        • namespaces: Namespaces
        • topic: string

      Returns Promise<void>

Methods

  • Parse the session proposal received from a dapp, construct the session namespace, and approve the session proposal if the chain is supported.

    Parameters

    • proposal: {
          verifyContext: Context;
      } & Omit<BaseEventArgs<Struct>, "topic">

      The session proposal

    Returns Promise<void | Struct>

    • The session data if approved
  • Approves a session request received from a dapp, processes the request using the wallet corresponding to the account in the request, and sends a response with the result or an error.

    Parameters

    • requestEvent: {
          verifyContext: Context;
      } & BaseEventArgs<{
          chainId: string;
          request: {
              method: string;
              params: any;
          };
      }>

      The session request

    Returns Promise<void>

  • Parse and reject the session proposal

    Parameters

    • proposal: {
          verifyContext: Context;
      } & Omit<BaseEventArgs<Struct>, "topic">

      The session proposal

    • Optionalreason: ErrorResponse

      The reason for rejecting the session proposal

    Returns Promise<void>

  • Reject a session request received from a dapp

    Parameters

    • requestEvent: {
          verifyContext: Context;
      } & BaseEventArgs<{
          chainId: string;
          request: {
              method: string;
              params: any;
          };
      }>

      The session request

    • Optionalreason: ErrorResponse

      The reason for rejecting the session request

    Returns Promise<void>