Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mtproto/core

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mtproto/core - npm Package Compare versions

Comparing version 3.0.0-beta.6 to 3.0.0-beta.7

2

package.json
{
"name": "@mtproto/core",
"version": "3.0.0-beta.6",
"version": "3.0.0-beta.7",
"description": "Telegram API (MTProto) client library for browser and nodejs",

@@ -5,0 +5,0 @@ "keywords": [

@@ -112,22 +112,4 @@ # @mtproto/core

Example:
```js
mtproto
.call('auth.sendCode', {
phone_number: '+9996621111',
settings: {
_: 'codeSettings',
},
})
.catch(error => {
if (error.error_message.includes('_MIGRATE_')) {
const [item, dcId] = error.error_message.split('_MIGRATE_');
See the example in the [authentication](docs/authentication.md).
mtproto.setDefaultDc(+dcId);
// Repeat call this
}
});
```
### `getSRPParams({ g, p, salt1, salt2, gB, password }) => { A, M1 }`

@@ -134,0 +116,0 @@

@@ -15,2 +15,4 @@ const { Socket } = require('net');

this.stream = new Uint8Array();
this.connect();

@@ -34,5 +36,23 @@ }

const payload = this.getIntermediatePayload(deobfuscatedBytes);
this.stream = new Uint8Array([...this.stream, ...deobfuscatedBytes]);
this.emit('message', payload.buffer);
const dataView = new DataView(this.stream.buffer);
const payloadLength = dataView.getUint32(0, true);
if (payloadLength === this.stream.length - 4) {
const payload = this.stream.slice(4);
if (payloadLength === 4) {
const code = dataView.getInt32(4, true) * -1;
this.emit('error', {
type: 'transport',
code,
});
} else {
this.emit('message', payload.buffer);
}
this.stream = new Uint8Array();
}
}

@@ -39,0 +59,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc