UNPKG

@tgsnake/core

Version:

Pure Telegram MTProto library for nodejs

1,238 lines (1,237 loc) 3.81 MB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Raw = void 0; const index_js_1 = require("./core/index.js"); const platform_node_js_1 = require("../platform.node.js"); var Raw; (function (Raw) { Raw.Layer = 201; Raw.HighestSCLayer = 144; class ResPQ extends index_js_1.TLObject { nonce; serverNonce; pq; serverPublicKeyFingerprints; constructor(params) { super(); this.classType = 'types'; this.className = 'ResPQ'; this.constructorId = 0x05162463; this.subclassOfId = 0x786986b8; this._slots = ['nonce', 'serverNonce', 'pq', 'serverPublicKeyFingerprints']; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.pq = params.pq; this.serverPublicKeyFingerprints = params.serverPublicKeyFingerprints; } static async read(_data, ..._args) { let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let pq = await index_js_1.Primitive.Bytes.read(_data); let serverPublicKeyFingerprints = await index_js_1.TLObject.read(_data, index_js_1.Primitive.Long); return new Raw.ResPQ({ nonce: nonce, serverNonce: serverNonce, pq: pq, serverPublicKeyFingerprints: serverPublicKeyFingerprints, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.pq !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.pq)); } if (this.serverPublicKeyFingerprints) { b.write(index_js_1.Primitive.Vector.write(this.serverPublicKeyFingerprints, index_js_1.Primitive.Long)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.ResPQ = ResPQ; class PQInnerData extends index_js_1.TLObject { pq; p; q; nonce; serverNonce; newNonce; constructor(params) { super(); this.classType = 'types'; this.className = 'PQInnerData'; this.constructorId = 0x83c95aec; this.subclassOfId = 0x41701377; this._slots = ['pq', 'p', 'q', 'nonce', 'serverNonce', 'newNonce']; this.pq = params.pq; this.p = params.p; this.q = params.q; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.newNonce = params.newNonce; } static async read(_data, ..._args) { let pq = await index_js_1.Primitive.Bytes.read(_data); let p = await index_js_1.Primitive.Bytes.read(_data); let q = await index_js_1.Primitive.Bytes.read(_data); let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let newNonce = await index_js_1.Primitive.Int256.read(_data); return new Raw.PQInnerData({ pq: pq, p: p, q: q, nonce: nonce, serverNonce: serverNonce, newNonce: newNonce, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.pq !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.pq)); } if (this.p !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.p)); } if (this.q !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.q)); } if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.newNonce !== undefined) { b.write(index_js_1.Primitive.Int256.write(this.newNonce)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.PQInnerData = PQInnerData; class PQInnerDataDc extends index_js_1.TLObject { pq; p; q; nonce; serverNonce; newNonce; dc; constructor(params) { super(); this.classType = 'types'; this.className = 'PQInnerDataDc'; this.constructorId = 0xa9f55f95; this.subclassOfId = 0x41701377; this._slots = ['pq', 'p', 'q', 'nonce', 'serverNonce', 'newNonce', 'dc']; this.pq = params.pq; this.p = params.p; this.q = params.q; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.newNonce = params.newNonce; this.dc = params.dc; } static async read(_data, ..._args) { let pq = await index_js_1.Primitive.Bytes.read(_data); let p = await index_js_1.Primitive.Bytes.read(_data); let q = await index_js_1.Primitive.Bytes.read(_data); let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let newNonce = await index_js_1.Primitive.Int256.read(_data); let dc = await index_js_1.Primitive.Int.read(_data); return new Raw.PQInnerDataDc({ pq: pq, p: p, q: q, nonce: nonce, serverNonce: serverNonce, newNonce: newNonce, dc: dc, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.pq !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.pq)); } if (this.p !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.p)); } if (this.q !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.q)); } if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.newNonce !== undefined) { b.write(index_js_1.Primitive.Int256.write(this.newNonce)); } if (this.dc !== undefined) { b.write(index_js_1.Primitive.Int.write(this.dc)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.PQInnerDataDc = PQInnerDataDc; class PQInnerDataTemp extends index_js_1.TLObject { pq; p; q; nonce; serverNonce; newNonce; expiresIn; constructor(params) { super(); this.classType = 'types'; this.className = 'PQInnerDataTemp'; this.constructorId = 0x3c6a84d4; this.subclassOfId = 0x41701377; this._slots = ['pq', 'p', 'q', 'nonce', 'serverNonce', 'newNonce', 'expiresIn']; this.pq = params.pq; this.p = params.p; this.q = params.q; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.newNonce = params.newNonce; this.expiresIn = params.expiresIn; } static async read(_data, ..._args) { let pq = await index_js_1.Primitive.Bytes.read(_data); let p = await index_js_1.Primitive.Bytes.read(_data); let q = await index_js_1.Primitive.Bytes.read(_data); let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let newNonce = await index_js_1.Primitive.Int256.read(_data); let expiresIn = await index_js_1.Primitive.Int.read(_data); return new Raw.PQInnerDataTemp({ pq: pq, p: p, q: q, nonce: nonce, serverNonce: serverNonce, newNonce: newNonce, expiresIn: expiresIn, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.pq !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.pq)); } if (this.p !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.p)); } if (this.q !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.q)); } if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.newNonce !== undefined) { b.write(index_js_1.Primitive.Int256.write(this.newNonce)); } if (this.expiresIn !== undefined) { b.write(index_js_1.Primitive.Int.write(this.expiresIn)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.PQInnerDataTemp = PQInnerDataTemp; class PQInnerDataTempDc extends index_js_1.TLObject { pq; p; q; nonce; serverNonce; newNonce; dc; expiresIn; constructor(params) { super(); this.classType = 'types'; this.className = 'PQInnerDataTempDc'; this.constructorId = 0x56fddf88; this.subclassOfId = 0x41701377; this._slots = ['pq', 'p', 'q', 'nonce', 'serverNonce', 'newNonce', 'dc', 'expiresIn']; this.pq = params.pq; this.p = params.p; this.q = params.q; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.newNonce = params.newNonce; this.dc = params.dc; this.expiresIn = params.expiresIn; } static async read(_data, ..._args) { let pq = await index_js_1.Primitive.Bytes.read(_data); let p = await index_js_1.Primitive.Bytes.read(_data); let q = await index_js_1.Primitive.Bytes.read(_data); let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let newNonce = await index_js_1.Primitive.Int256.read(_data); let dc = await index_js_1.Primitive.Int.read(_data); let expiresIn = await index_js_1.Primitive.Int.read(_data); return new Raw.PQInnerDataTempDc({ pq: pq, p: p, q: q, nonce: nonce, serverNonce: serverNonce, newNonce: newNonce, dc: dc, expiresIn: expiresIn, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.pq !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.pq)); } if (this.p !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.p)); } if (this.q !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.q)); } if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.newNonce !== undefined) { b.write(index_js_1.Primitive.Int256.write(this.newNonce)); } if (this.dc !== undefined) { b.write(index_js_1.Primitive.Int.write(this.dc)); } if (this.expiresIn !== undefined) { b.write(index_js_1.Primitive.Int.write(this.expiresIn)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.PQInnerDataTempDc = PQInnerDataTempDc; class BindAuthKeyInner extends index_js_1.TLObject { nonce; tempAuthKeyId; permAuthKeyId; tempSessionId; expiresAt; constructor(params) { super(); this.classType = 'types'; this.className = 'BindAuthKeyInner'; this.constructorId = 0x75a3f765; this.subclassOfId = 0x2f099171; this._slots = ['nonce', 'tempAuthKeyId', 'permAuthKeyId', 'tempSessionId', 'expiresAt']; this.nonce = params.nonce; this.tempAuthKeyId = params.tempAuthKeyId; this.permAuthKeyId = params.permAuthKeyId; this.tempSessionId = params.tempSessionId; this.expiresAt = params.expiresAt; } static async read(_data, ..._args) { let nonce = await index_js_1.Primitive.Long.read(_data); let tempAuthKeyId = await index_js_1.Primitive.Long.read(_data); let permAuthKeyId = await index_js_1.Primitive.Long.read(_data); let tempSessionId = await index_js_1.Primitive.Long.read(_data); let expiresAt = await index_js_1.Primitive.Int.read(_data); return new Raw.BindAuthKeyInner({ nonce: nonce, tempAuthKeyId: tempAuthKeyId, permAuthKeyId: permAuthKeyId, tempSessionId: tempSessionId, expiresAt: expiresAt, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Long.write(this.nonce)); } if (this.tempAuthKeyId !== undefined) { b.write(index_js_1.Primitive.Long.write(this.tempAuthKeyId)); } if (this.permAuthKeyId !== undefined) { b.write(index_js_1.Primitive.Long.write(this.permAuthKeyId)); } if (this.tempSessionId !== undefined) { b.write(index_js_1.Primitive.Long.write(this.tempSessionId)); } if (this.expiresAt !== undefined) { b.write(index_js_1.Primitive.Int.write(this.expiresAt)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.BindAuthKeyInner = BindAuthKeyInner; class ServerDhParamsFail extends index_js_1.TLObject { nonce; serverNonce; newNonceHash; constructor(params) { super(); this.classType = 'types'; this.className = 'ServerDhParamsFail'; this.constructorId = 0x79cb045d; this.subclassOfId = 0xa6188d9e; this._slots = ['nonce', 'serverNonce', 'newNonceHash']; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.newNonceHash = params.newNonceHash; } static async read(_data, ..._args) { let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let newNonceHash = await index_js_1.Primitive.Int128.read(_data); return new Raw.ServerDhParamsFail({ nonce: nonce, serverNonce: serverNonce, newNonceHash: newNonceHash, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.newNonceHash !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.newNonceHash)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.ServerDhParamsFail = ServerDhParamsFail; class ServerDhParamsOk extends index_js_1.TLObject { nonce; serverNonce; encryptedAnswer; constructor(params) { super(); this.classType = 'types'; this.className = 'ServerDhParamsOk'; this.constructorId = 0xd0e8075c; this.subclassOfId = 0xa6188d9e; this._slots = ['nonce', 'serverNonce', 'encryptedAnswer']; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.encryptedAnswer = params.encryptedAnswer; } static async read(_data, ..._args) { let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let encryptedAnswer = await index_js_1.Primitive.Bytes.read(_data); return new Raw.ServerDhParamsOk({ nonce: nonce, serverNonce: serverNonce, encryptedAnswer: encryptedAnswer, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.encryptedAnswer !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.encryptedAnswer)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.ServerDhParamsOk = ServerDhParamsOk; class ServerDhInnerData extends index_js_1.TLObject { nonce; serverNonce; g; dhPrime; gA; serverTime; constructor(params) { super(); this.classType = 'types'; this.className = 'ServerDhInnerData'; this.constructorId = 0xb5890dba; this.subclassOfId = 0xc69a67bc; this._slots = ['nonce', 'serverNonce', 'g', 'dhPrime', 'gA', 'serverTime']; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.g = params.g; this.dhPrime = params.dhPrime; this.gA = params.gA; this.serverTime = params.serverTime; } static async read(_data, ..._args) { let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let g = await index_js_1.Primitive.Int.read(_data); let dhPrime = await index_js_1.Primitive.Bytes.read(_data); let gA = await index_js_1.Primitive.Bytes.read(_data); let serverTime = await index_js_1.Primitive.Int.read(_data); return new Raw.ServerDhInnerData({ nonce: nonce, serverNonce: serverNonce, g: g, dhPrime: dhPrime, gA: gA, serverTime: serverTime, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.g !== undefined) { b.write(index_js_1.Primitive.Int.write(this.g)); } if (this.dhPrime !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.dhPrime)); } if (this.gA !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.gA)); } if (this.serverTime !== undefined) { b.write(index_js_1.Primitive.Int.write(this.serverTime)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.ServerDhInnerData = ServerDhInnerData; class ClientDhInnerData extends index_js_1.TLObject { nonce; serverNonce; retryId; gB; constructor(params) { super(); this.classType = 'types'; this.className = 'ClientDhInnerData'; this.constructorId = 0x6643b654; this.subclassOfId = 0xf8eeef6a; this._slots = ['nonce', 'serverNonce', 'retryId', 'gB']; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.retryId = params.retryId; this.gB = params.gB; } static async read(_data, ..._args) { let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let retryId = await index_js_1.Primitive.Long.read(_data); let gB = await index_js_1.Primitive.Bytes.read(_data); return new Raw.ClientDhInnerData({ nonce: nonce, serverNonce: serverNonce, retryId: retryId, gB: gB, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.retryId !== undefined) { b.write(index_js_1.Primitive.Long.write(this.retryId)); } if (this.gB !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.gB)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.ClientDhInnerData = ClientDhInnerData; class DhGenOk extends index_js_1.TLObject { nonce; serverNonce; newNonceHash1; constructor(params) { super(); this.classType = 'types'; this.className = 'DhGenOk'; this.constructorId = 0x3bcbf734; this.subclassOfId = 0x55dd6cdb; this._slots = ['nonce', 'serverNonce', 'newNonceHash1']; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.newNonceHash1 = params.newNonceHash1; } static async read(_data, ..._args) { let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let newNonceHash1 = await index_js_1.Primitive.Int128.read(_data); return new Raw.DhGenOk({ nonce: nonce, serverNonce: serverNonce, newNonceHash1: newNonceHash1, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.newNonceHash1 !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.newNonceHash1)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.DhGenOk = DhGenOk; class DhGenRetry extends index_js_1.TLObject { nonce; serverNonce; newNonceHash2; constructor(params) { super(); this.classType = 'types'; this.className = 'DhGenRetry'; this.constructorId = 0x46dc1fb9; this.subclassOfId = 0x55dd6cdb; this._slots = ['nonce', 'serverNonce', 'newNonceHash2']; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.newNonceHash2 = params.newNonceHash2; } static async read(_data, ..._args) { let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let newNonceHash2 = await index_js_1.Primitive.Int128.read(_data); return new Raw.DhGenRetry({ nonce: nonce, serverNonce: serverNonce, newNonceHash2: newNonceHash2, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.newNonceHash2 !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.newNonceHash2)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.DhGenRetry = DhGenRetry; class DhGenFail extends index_js_1.TLObject { nonce; serverNonce; newNonceHash3; constructor(params) { super(); this.classType = 'types'; this.className = 'DhGenFail'; this.constructorId = 0xa69dae02; this.subclassOfId = 0x55dd6cdb; this._slots = ['nonce', 'serverNonce', 'newNonceHash3']; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.newNonceHash3 = params.newNonceHash3; } static async read(_data, ..._args) { let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let newNonceHash3 = await index_js_1.Primitive.Int128.read(_data); return new Raw.DhGenFail({ nonce: nonce, serverNonce: serverNonce, newNonceHash3: newNonceHash3, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.newNonceHash3 !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.newNonceHash3)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.DhGenFail = DhGenFail; class DestroyAuthKeyOk extends index_js_1.TLObject { constructor() { super(); this.classType = 'types'; this.className = 'DestroyAuthKeyOk'; this.constructorId = 0xf660e1d4; this.subclassOfId = 0x8291e68e; this._slots = []; } static async read(_data, ..._args) { return new Raw.DestroyAuthKeyOk(); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); return platform_node_js_1.Buffer.from(b.buffer); } } Raw.DestroyAuthKeyOk = DestroyAuthKeyOk; class DestroyAuthKeyNone extends index_js_1.TLObject { constructor() { super(); this.classType = 'types'; this.className = 'DestroyAuthKeyNone'; this.constructorId = 0x0a9f2259; this.subclassOfId = 0x8291e68e; this._slots = []; } static async read(_data, ..._args) { return new Raw.DestroyAuthKeyNone(); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); return platform_node_js_1.Buffer.from(b.buffer); } } Raw.DestroyAuthKeyNone = DestroyAuthKeyNone; class DestroyAuthKeyFail extends index_js_1.TLObject { constructor() { super(); this.classType = 'types'; this.className = 'DestroyAuthKeyFail'; this.constructorId = 0xea109b13; this.subclassOfId = 0x8291e68e; this._slots = []; } static async read(_data, ..._args) { return new Raw.DestroyAuthKeyFail(); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); return platform_node_js_1.Buffer.from(b.buffer); } } Raw.DestroyAuthKeyFail = DestroyAuthKeyFail; class ReqPq extends index_js_1.TLObject { __response__; nonce; constructor(params) { super(); this.classType = 'functions'; this.className = 'ReqPq'; this.constructorId = 0x60469778; this.subclassOfId = 0x786986b8; this._slots = ['nonce']; this.nonce = params.nonce; } static async read(_data, ..._args) { let nonce = await index_js_1.Primitive.Int128.read(_data); return new Raw.ReqPq({ nonce: nonce }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.ReqPq = ReqPq; class ReqPqMulti extends index_js_1.TLObject { __response__; nonce; constructor(params) { super(); this.classType = 'functions'; this.className = 'ReqPqMulti'; this.constructorId = 0xbe7e8ef1; this.subclassOfId = 0x786986b8; this._slots = ['nonce']; this.nonce = params.nonce; } static async read(_data, ..._args) { let nonce = await index_js_1.Primitive.Int128.read(_data); return new Raw.ReqPqMulti({ nonce: nonce }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.ReqPqMulti = ReqPqMulti; class ReqDhParams extends index_js_1.TLObject { __response__; nonce; serverNonce; p; q; publicKeyFingerprint; encryptedData; constructor(params) { super(); this.classType = 'functions'; this.className = 'ReqDhParams'; this.constructorId = 0xd712e4be; this.subclassOfId = 0xa6188d9e; this._slots = ['nonce', 'serverNonce', 'p', 'q', 'publicKeyFingerprint', 'encryptedData']; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.p = params.p; this.q = params.q; this.publicKeyFingerprint = params.publicKeyFingerprint; this.encryptedData = params.encryptedData; } static async read(_data, ..._args) { let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let p = await index_js_1.Primitive.Bytes.read(_data); let q = await index_js_1.Primitive.Bytes.read(_data); let publicKeyFingerprint = await index_js_1.Primitive.Long.read(_data); let encryptedData = await index_js_1.Primitive.Bytes.read(_data); return new Raw.ReqDhParams({ nonce: nonce, serverNonce: serverNonce, p: p, q: q, publicKeyFingerprint: publicKeyFingerprint, encryptedData: encryptedData, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.p !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.p)); } if (this.q !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.q)); } if (this.publicKeyFingerprint !== undefined) { b.write(index_js_1.Primitive.Long.write(this.publicKeyFingerprint)); } if (this.encryptedData !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.encryptedData)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.ReqDhParams = ReqDhParams; class SetClientDhParams extends index_js_1.TLObject { __response__; nonce; serverNonce; encryptedData; constructor(params) { super(); this.classType = 'functions'; this.className = 'SetClientDhParams'; this.constructorId = 0xf5045f1f; this.subclassOfId = 0x55dd6cdb; this._slots = ['nonce', 'serverNonce', 'encryptedData']; this.nonce = params.nonce; this.serverNonce = params.serverNonce; this.encryptedData = params.encryptedData; } static async read(_data, ..._args) { let nonce = await index_js_1.Primitive.Int128.read(_data); let serverNonce = await index_js_1.Primitive.Int128.read(_data); let encryptedData = await index_js_1.Primitive.Bytes.read(_data); return new Raw.SetClientDhParams({ nonce: nonce, serverNonce: serverNonce, encryptedData: encryptedData, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.nonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.nonce)); } if (this.serverNonce !== undefined) { b.write(index_js_1.Primitive.Int128.write(this.serverNonce)); } if (this.encryptedData !== undefined) { b.write(index_js_1.Primitive.Bytes.write(this.encryptedData)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.SetClientDhParams = SetClientDhParams; class DestroyAuthKey extends index_js_1.TLObject { __response__; constructor() { super(); this.classType = 'functions'; this.className = 'DestroyAuthKey'; this.constructorId = 0xd1435160; this.subclassOfId = 0x8291e68e; this._slots = []; } static async read(_data, ..._args) { return new Raw.DestroyAuthKey(); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); return platform_node_js_1.Buffer.from(b.buffer); } } Raw.DestroyAuthKey = DestroyAuthKey; class MsgsAck extends index_js_1.TLObject { msgIds; constructor(params) { super(); this.classType = 'types'; this.className = 'MsgsAck'; this.constructorId = 0x62d6b459; this.subclassOfId = 0x827677c4; this._slots = ['msgIds']; this.msgIds = params.msgIds; } static async read(_data, ..._args) { let msgIds = await index_js_1.TLObject.read(_data, index_js_1.Primitive.Long); return new Raw.MsgsAck({ msgIds: msgIds }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.msgIds) { b.write(index_js_1.Primitive.Vector.write(this.msgIds, index_js_1.Primitive.Long)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.MsgsAck = MsgsAck; class BadMsgNotification extends index_js_1.TLObject { badMsgId; badMsgSeqno; errorCode; constructor(params) { super(); this.classType = 'types'; this.className = 'BadMsgNotification'; this.constructorId = 0xa7eff811; this.subclassOfId = 0xcebaa157; this._slots = ['badMsgId', 'badMsgSeqno', 'errorCode']; this.badMsgId = params.badMsgId; this.badMsgSeqno = params.badMsgSeqno; this.errorCode = params.errorCode; } static async read(_data, ..._args) { let badMsgId = await index_js_1.Primitive.Long.read(_data); let badMsgSeqno = await index_js_1.Primitive.Int.read(_data); let errorCode = await index_js_1.Primitive.Int.read(_data); return new Raw.BadMsgNotification({ badMsgId: badMsgId, badMsgSeqno: badMsgSeqno, errorCode: errorCode, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.badMsgId !== undefined) { b.write(index_js_1.Primitive.Long.write(this.badMsgId)); } if (this.badMsgSeqno !== undefined) { b.write(index_js_1.Primitive.Int.write(this.badMsgSeqno)); } if (this.errorCode !== undefined) { b.write(index_js_1.Primitive.Int.write(this.errorCode)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.BadMsgNotification = BadMsgNotification; class BadServerSalt extends index_js_1.TLObject { badMsgId; badMsgSeqno; errorCode; newServerSalt; constructor(params) { super(); this.classType = 'types'; this.className = 'BadServerSalt'; this.constructorId = 0xedab447b; this.subclassOfId = 0xcebaa157; this._slots = ['badMsgId', 'badMsgSeqno', 'errorCode', 'newServerSalt']; this.badMsgId = params.badMsgId; this.badMsgSeqno = params.badMsgSeqno; this.errorCode = params.errorCode; this.newServerSalt = params.newServerSalt; } static async read(_data, ..._args) { let badMsgId = await index_js_1.Primitive.Long.read(_data); let badMsgSeqno = await index_js_1.Primitive.Int.read(_data); let errorCode = await index_js_1.Primitive.Int.read(_data); let newServerSalt = await index_js_1.Primitive.Long.read(_data); return new Raw.BadServerSalt({ badMsgId: badMsgId, badMsgSeqno: badMsgSeqno, errorCode: errorCode, newServerSalt: newServerSalt, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.badMsgId !== undefined) { b.write(index_js_1.Primitive.Long.write(this.badMsgId)); } if (this.badMsgSeqno !== undefined) { b.write(index_js_1.Primitive.Int.write(this.badMsgSeqno)); } if (this.errorCode !== undefined) { b.write(index_js_1.Primitive.Int.write(this.errorCode)); } if (this.newServerSalt !== undefined) { b.write(index_js_1.Primitive.Long.write(this.newServerSalt)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.BadServerSalt = BadServerSalt; class MsgsStateReq extends index_js_1.TLObject { msgIds; constructor(params) { super(); this.classType = 'types'; this.className = 'MsgsStateReq'; this.constructorId = 0xda69fb52; this.subclassOfId = 0x18f01dd0; this._slots = ['msgIds']; this.msgIds = params.msgIds; } static async read(_data, ..._args) { let msgIds = await index_js_1.TLObject.read(_data, index_js_1.Primitive.Long); return new Raw.MsgsStateReq({ msgIds: msgIds }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.msgIds) { b.write(index_js_1.Primitive.Vector.write(this.msgIds, index_js_1.Primitive.Long)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.MsgsStateReq = MsgsStateReq; class MsgsStateInfo extends index_js_1.TLObject { reqMsgId; info; constructor(params) { super(); this.classType = 'types'; this.className = 'MsgsStateInfo'; this.constructorId = 0x04deb57d; this.subclassOfId = 0x70a0a64; this._slots = ['reqMsgId', 'info']; this.reqMsgId = params.reqMsgId; this.info = params.info; } static async read(_data, ..._args) { let reqMsgId = await index_js_1.Primitive.Long.read(_data); let info = await index_js_1.Primitive.String.read(_data); return new Raw.MsgsStateInfo({ reqMsgId: reqMsgId, info: info }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.reqMsgId !== undefined) { b.write(index_js_1.Primitive.Long.write(this.reqMsgId)); } if (this.info !== undefined) { b.write(index_js_1.Primitive.String.write(this.info)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.MsgsStateInfo = MsgsStateInfo; class MsgsAllInfo extends index_js_1.TLObject { msgIds; info; constructor(params) { super(); this.classType = 'types'; this.className = 'MsgsAllInfo'; this.constructorId = 0x8cc0d131; this.subclassOfId = 0xfa8fcb54; this._slots = ['msgIds', 'info']; this.msgIds = params.msgIds; this.info = params.info; } static async read(_data, ..._args) { let msgIds = await index_js_1.TLObject.read(_data, index_js_1.Primitive.Long); let info = await index_js_1.Primitive.String.read(_data); return new Raw.MsgsAllInfo({ msgIds: msgIds, info: info }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.msgIds) { b.write(index_js_1.Primitive.Vector.write(this.msgIds, index_js_1.Primitive.Long)); } if (this.info !== undefined) { b.write(index_js_1.Primitive.String.write(this.info)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.MsgsAllInfo = MsgsAllInfo; class MsgDetailedInfo extends index_js_1.TLObject { msgId; answerMsgId; bytes; status; constructor(params) { super(); this.classType = 'types'; this.className = 'MsgDetailedInfo'; this.constructorId = 0x276d3ec6; this.subclassOfId = 0x5f32d5ee; this._slots = ['msgId', 'answerMsgId', 'bytes', 'status']; this.msgId = params.msgId; this.answerMsgId = params.answerMsgId; this.bytes = params.bytes; this.status = params.status; } static async read(_data, ..._args) { let msgId = await index_js_1.Primitive.Long.read(_data); let answerMsgId = await index_js_1.Primitive.Long.read(_data); let bytes = await index_js_1.Primitive.Int.read(_data); let status = await index_js_1.Primitive.Int.read(_data); return new Raw.MsgDetailedInfo({ msgId: msgId, answerMsgId: answerMsgId, bytes: bytes, status: status, }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.msgId !== undefined) { b.write(index_js_1.Primitive.Long.write(this.msgId)); } if (this.answerMsgId !== undefined) { b.write(index_js_1.Primitive.Long.write(this.answerMsgId)); } if (this.bytes !== undefined) { b.write(index_js_1.Primitive.Int.write(this.bytes)); } if (this.status !== undefined) { b.write(index_js_1.Primitive.Int.write(this.status)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.MsgDetailedInfo = MsgDetailedInfo; class MsgNewDetailedInfo extends index_js_1.TLObject { answerMsgId; bytes; status; constructor(params) { super(); this.classType = 'types'; this.className = 'MsgNewDetailedInfo'; this.constructorId = 0x809db6df; this.subclassOfId = 0x5f32d5ee; this._slots = ['answerMsgId', 'bytes', 'status']; this.answerMsgId = params.answerMsgId; this.bytes = params.bytes; this.status = params.status; } static async read(_data, ..._args) { let answerMsgId = await index_js_1.Primitive.Long.read(_data); let bytes = await index_js_1.Primitive.Int.read(_data); let status = await index_js_1.Primitive.Int.read(_data); return new Raw.MsgNewDetailedInfo({ answerMsgId: answerMsgId, bytes: bytes, status: status }); } write() { const b = new index_js_1.BytesIO(); b.write(index_js_1.Primitive.Int.write(this.constructorId, false)); if (this.answerMsgId !== undefined) { b.write(index_js_1.Primitive.Long.write(this.answerMsgId)); } if (this.bytes !== undefined) { b.write(index_js_1.Primitive.Int.write(this.bytes)); } if (this.status !== undefined) { b.write(index_js_1.Primitive.Int.write(this.status)); } return platform_node_js_1.Buffer.from(b.buffer); } } Raw.MsgNewDetailedInfo = MsgNewDetailedInfo; class MsgResendReq extends index_js_1.TLObject { msgIds; constructor(params) { super(); this.classType = 'types'; this.className = 'MsgResendReq'; this.constructorId = 0x7d861a08; this.subclassOfId = 0x2024514; this._slots = ['msgIds']; this.msgIds = params.msgIds; } static async read(_data, ..._args) { let msgIds = await index_js_1.TLObject.read(_data, index_js_1.Primitive.Long); return new Raw.MsgResendReq({ msgIds: msgIds });