MultichainApiClient<T>: {
    createSession: MultichainApi<T>["wallet_createSession"];
    extendsRpcApi: (<U>() => MultichainApiClient<T & U>);
    getSession: MultichainApi<T>["wallet_getSession"];
    invokeMethod: MultichainApi<T>["wallet_invokeMethod"];
    onNotification: ((callback: ((data: unknown) => void)) => (() => void));
    revokeSession: MultichainApi<T>["wallet_revokeSession"];
}

Type for transport layer mapping to the multichain api methods

Type Parameters

  • T extends RpcApi = DefaultRpcApi

    The RPC API type that defines available methods and their parameters

Type declaration

  • createSession: MultichainApi<T>["wallet_createSession"]

    Creates a new session with the wallet

    Session creation parameters

    Required scopes that must be granted by the wallet

    Optional scopes that may be granted by the wallet

    Properties to be associated with the session

    A promise that resolves to the session data

  • extendsRpcApi: (<U>() => MultichainApiClient<T & U>)

    Extends the RPC API with additional methods

  • getSession: MultichainApi<T>["wallet_getSession"]

    Gets the current session data if a session exists

    A promise that resolves to the session data or undefined if no session exists

  • invokeMethod: MultichainApi<T>["wallet_invokeMethod"]

    Invokes a method on the wallet for a specific scope

    Method invocation parameters

    The scope to invoke the method on

    The method request details

    The method name to invoke

    The parameters for the method

    A promise that resolves to the method return value

  • onNotification: ((callback: ((data: unknown) => void)) => (() => void))

    Registers a callback for notifications from the wallet

      • (callback): (() => void)
      • Parameters

        • callback: ((data: unknown) => void)

          Function to call when a notification is received

            • (data): void
            • Parameters

              • data: unknown

              Returns void

        Returns (() => void)

        A function to remove the callback

          • (): void
          • Returns void

  • revokeSession: MultichainApi<T>["wallet_revokeSession"]

    Revokes the current session and disconnects from the wallet

    A promise that resolves when the session is revoked