Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/mtkruto/client/1_client_encrypted.ts>ClientEncrypted

Cross-runtime JavaScript library for building Telegram clients
Latest
class ClientEncrypted
import { ClientEncrypted } from "https://deno.land/x/mtkruto@0.2.24/client/1_client_encrypted.ts";

An MTProto client for making encrypted connections. Most users won't need to interact with this. Used internally by Client.

There are a few things to note:

  • This is a bare client and it stores nothing.
  • It expects an authorization key to be present before invoking any method.
  • Authorization must be set using setAuthKey.
  • Incoming packets that aren't a reply to a specific call are passed to the assigned handlers.
  • It doesn't uncompress compressed packets.

Constructors

new
ClientEncrypted(params?: ClientAbstractParams)

Properties

readonly
authKey: Uint8Array
handlers: Handlers
serverSalt: bigint

Methods

connect(): Promise<void>
invoke<T extends Api.AnyObject<P>, P extends Api.Function, R extends unknown = Promise<T["_"] extends keyof Api.Functions ? Api.ReturnType<Api.Functions[T["_"]]> : never>>(function_: T, noWait?: boolean): Promise<R | void>
setAuthKey(key: Uint8Array)