Canton dApp Booster
    Preparing search index...

    What createMockAdapter returns: a ProviderAdapter plus emit, which simulates the wallet pushing an event to subscribers of provider().on(...).

    interface MockAdapter {
        detect(): Promise<boolean>;
        emit: (event: string, payload: unknown) => void;
        getInfo(): WalletInfo;
        icon?: string;
        name: string;
        provider(): Provider<RpcTypes>;
        providerId: string;
        restore?(): Promise<Provider<RpcTypes> | null>;
        teardown(): void;
        type: ProviderType;
    }

    Hierarchy

    • ProviderAdapter
      • MockAdapter
    Index
    emit: (event: string, payload: unknown) => void
    icon?: string
    name: string
    providerId: string
    type: ProviderType
    • Check whether this wallet is currently available. Extensions probe for the browser extension; gateways always return true.

      Returns Promise<boolean>

    • Return wallet metadata for display in the wallet picker.

      Returns WalletInfo

    • Return a Provider for this wallet. Extension adapters return a DappProvider (openrpc-dapp-api.json). Remote adapters may return a provider that bridges the remote API to the dApp API surface.

      The caller is responsible for invoking provider.request({ method: 'connect' }) and provider.request({ method: 'disconnect' }).

      Returns Provider<RpcTypes>

    • Attempt to restore a previous session (e.g. from localStorage). Returns a ready-to-use provider if the session was restored, or null.

      Returns Promise<Provider<RpcTypes> | null>

    • Clean up adapter-specific resources (e.g. close popup windows). Called after disconnect. Does NOT call disconnect on the provider.

      Returns void