@thruputchain/client
    Preparing search index...

    Interface WalletProvider

    Framework- and transport-neutral, origin-scoped wallet interface. Validate unknown results with the matching parser before using them.

    interface WalletProvider {
        info: WalletProviderInfo;
        supportedMethods?: readonly string[];
        on(event: "change", listener: (session: WalletSession) => void): () => void;
        request(request: ProviderRequest): Promise<unknown>;
    }
    Index

    Properties

    Methods

    Properties

    supportedMethods?: readonly string[]

    Optional request extensions. Absence means legacy single-call behavior.

    Methods

    • Subscribe to full session snapshots for changes to accounts, authorization, account metadata, or network, including disconnect. Subscription itself emits no snapshot; use getSession to read one. See request for event ordering.

      Parameters

      Returns () => void

      An idempotent unsubscribe function.

    • Send a request across the wallet boundary. The result is unknown until validated.

      Method Result Permission and behavior
      connect WalletSession Request origin-scoped permission through wallet UI; reject on refusal. Success has at least one authorized account.
      getSession WalletSession Non-interactive snapshot; never prompt or grant access. Unauthorized origins see empty accounts and the current network hash.
      disconnect null Idempotently revoke this origin's permission and pending approvals.
      getCapabilities WalletCapabilities Non-interactive; requires an authorized account on the requested network. Older providers return 4200.
      signTransaction SignTransactionResult Approve and sign the exact unsigned transaction; never broadcast.
      submitTransaction SubmitTransactionResult Broadcast only exact previously approved signed bytes; acknowledgement is not an execution receipt.

      Changes caused by connect/disconnect must reach page-facing listeners before the request resolves, including across bridges with separate response/event paths.

      Parameters

      Returns Promise<unknown>