Constructors

  • Initializes the DAppConnector instance.

    Parameters

    • metadata: Metadata

      SignClientTypes.Metadata object for the DApp metadata.

    • network: LedgerId

      LedgerId representing the network (default: LedgerId.TESTNET).

    • projectId: string

      Project ID for the WalletConnect client.

    • Optional methods: string[]

      Array of supported methods for the DApp (optional).

    • Optional events: string[]

      Array of supported events for the DApp (optional).

    • Optional chains: string[]

    Returns DAppConnector

Properties

dAppMetadata: Metadata
isInitializing: boolean = false
network: LedgerId = LedgerId.TESTNET
projectId: string
signers: DAppSigner[] = []
supportedChains: string[] = []
supportedEvents: string[] = []
supportedMethods: string[] = []
walletConnectClient: undefined | SignClient

Methods

  • Type Parameters

    • T

    Parameters

    • callback: (() => Promise<T>)
        • (): Promise<T>
        • Returns Promise<T>

    Returns Promise<T>

  • Returns Promise<Struct[]>

  • Initiates the WallecConnect connection flow using URI.

    Parameters

    • launchCallback: ((uri) => void)
        • (uri): void
        • Parameters

          • uri: string

          Returns void

    • Optional pairingTopic: string

      The pairing topic for the connection (optional).

    Returns Promise<void>

    A Promise that resolves when the connection process is complete.

  • Initiates the WalletConnect connection flow using a QR code.

    Parameters

    • Optional pairingTopic: string

      The pairing topic for the connection (optional).

    Returns Promise<void>

    A Promise that resolves when the connection process is complete.

  • Parameters

    • Optional pairingTopic: string

    Returns Promise<{
        approval: (() => Promise<Struct>);
        uri?: string;
    }>

  • Parameters

    • session: Struct

    Returns DAppSigner[]

  • Disconnects the current session associated with the specified topic.

    Parameters

    • topic: string

      The topic of the session to disconnect.

    Returns Promise<void>

    A Promise that resolves when the session is disconnected.

  • Disconnects all active sessions and pairings.

    Throws error when WalletConnect is not initialized or there are no active sessions/pairings.

    Returns Promise<void>

    A Promise that resolves when all active sessions and pairings are disconnected.

  • Initializes the DAppConnector instance.

    Parameters

    • logger: {
          logger?: BaseLogger;
      } = {}

      BaseLogger for logging purposes (optional).

      • Optional logger?: BaseLogger

    Returns Promise<void>

  • Parameters

    • session: Struct

    Returns Promise<void>

  • Initiates the WalletConnect connection flow using a QR code.

    Parameters

    • Optional pairingTopic: string

      The pairing topic for the connection (optional).

    Returns Promise<void>

    A Promise that resolves when the connection process is complete.

  • Parameters

    • topic: string
    • retries: number = 3

    Returns Promise<void>

  • Parameters

    • __namedParameters: PingParams
    • pingTimeoutMs: number = 1_000

    Returns Promise<void>

  • Type Parameters

    • Req extends RequestParams

    • Res extends JsonRpcResult<any>

    Parameters

    • __namedParameters: Req["request"]

    Returns Promise<Res>

  • Signs a provided message with provided signerAccountId.

    Parameters

    Returns Promise<SignMessageResult>

    Promise<SignMessageResult>

    Example

    const params = {
    signerAccountId: '0.0.12345',
    message: 'Hello World!'
    }

    const result = await dAppConnector.signMessage(params)
  • Signs and executes Transactions on the Hedera network.

    Parameters

    Returns Promise<SignTransactionResult>

    Promise<SignTransactionResult>

    Example

    const transactionBodyObject = transactionToTransactionBody(transaction, AccountId.fromString('0.0.3'))
    const transactionBody = transactionBodyToBase64String(transactionBodyObject)

    const params = {
    signerAccountId: '0.0.12345',
    transactionBody
    }

    const result = await dAppConnector.signTransaction(params)

Generated using TypeDoc