Polkadot Apps
    Preparing search index...

    Core orchestrator for signer management.

    Manages account discovery and signer creation across multiple providers (Host API, browser extensions, dev accounts). Framework-agnostic — use the subscribe() pattern to integrate with React, Vue, or any framework.

    const manager = new SignerManager();
    manager.subscribe(state => console.log(state.status));

    // Auto-detect: tries Host API first, then browser extensions
    await manager.connect();

    // Or connect to a specific provider
    await manager.connect("dev");

    // Select account and get signer
    manager.selectAccount("5GrwvaEF...");
    const signer = manager.getSigner();
    Index

    Constructors

    Methods

    • Connect to a provider.

      If no provider type is specified, runs environment-aware auto-detection:

      Inside a container (iframe/webview):

      1. Try direct Host API connection (preferred, idiomatic path)
      2. If host fails, try Spektr extension injection as fallback
      3. If both fail, return error — no further fallback

      Outside a container (standalone browser):

      1. Try browser extensions directly
      2. If fails, return error — no host attempt

      When connecting to a specific provider, it is used directly.

      Parameters

      Returns Promise<Result<SignerAccount[], SignerError>>

    • Create a Ring VRF proof for anonymous operations.

      Proves that the signer is a member of the ring at the given location without revealing which member. Only available when connected via the host provider — returns HOST_UNAVAILABLE otherwise.

      Parameters

      • dotNsIdentifier: string
      • derivationIndex: number
      • location: RingLocation
      • message: Uint8Array

      Returns Promise<Result<Uint8Array<ArrayBufferLike>, SignerError>>

    • List available browser extensions.

      Async because extensions inject into window.injectedWeb3 asynchronously after page load. Uses the same injection wait as the extension provider.

      Returns Promise<string[]>

    • Get an app-scoped product account from the host.

      Product accounts are derived by the host wallet for each app, identified by dotNsIdentifier (e.g., "mark3t.dot"). Only available when connected via the host provider — returns HOST_UNAVAILABLE otherwise.

      Parameters

      • dotNsIdentifier: string
      • derivationIndex: number = 0

      Returns Promise<Result<SignerAccount, SignerError>>

      const result = await manager.getProductAccount("myapp.dot");
      if (result.ok) {
      const signer = result.value.getSigner();
      }
    • Get a contextual alias for a product account via Ring VRF.

      Aliases prove account membership in a ring without revealing which account produced the alias. Only available when connected via the host provider — returns HOST_UNAVAILABLE otherwise.

      Parameters

      • dotNsIdentifier: string
      • derivationIndex: number = 0

      Returns Promise<Result<ContextualAlias, SignerError>>

    • Get the PolkadotSigner for the currently selected account. Returns null if no account is selected or manager is disconnected.

      Returns PolkadotSigner | null

    • Sign arbitrary bytes with the currently selected account.

      Convenience wrapper around PolkadotSigner.signBytes — useful for master key derivation, message signing, and proof generation without constructing a full transaction.

      Returns a SIGNING_FAILED error if no account is selected or signing fails.

      Parameters

      • data: Uint8Array

      Returns Promise<Result<Uint8Array<ArrayBufferLike>, SignerError>>