@tgsnake/skema 3.2.0 → 3.2.1-browser.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/deps.d.ts +4 -3
- package/dist/src/deps.js +4 -4
- package/dist/src/raw/class/All.d.ts +1 -1
- package/dist/src/raw/class/All.js +2783 -2783
- package/dist/src/raw/class/Raw.d.ts +7601 -7601
- package/dist/src/raw/class/Raw.js +26781 -20676
- package/dist/src/raw/class/tl/account.d.ts +841 -841
- package/dist/src/raw/class/tl/account.js +1983 -1813
- package/dist/src/raw/class/tl/aicompose.d.ts +51 -51
- package/dist/src/raw/class/tl/aicompose.js +128 -117
- package/dist/src/raw/class/tl/auth.d.ts +296 -296
- package/dist/src/raw/class/tl/auth.js +849 -714
- package/dist/src/raw/class/tl/bots.d.ts +256 -256
- package/dist/src/raw/class/tl/bots.js +661 -607
- package/dist/src/raw/class/tl/channels.d.ts +336 -336
- package/dist/src/raw/class/tl/channels.js +836 -745
- package/dist/src/raw/class/tl/chatlists.d.ts +81 -81
- package/dist/src/raw/class/tl/chatlists.js +196 -183
- package/dist/src/raw/class/tl/communities.d.ts +56 -56
- package/dist/src/raw/class/tl/communities.js +159 -138
- package/dist/src/raw/class/tl/contacts.d.ts +216 -216
- package/dist/src/raw/class/tl/contacts.js +537 -492
- package/dist/src/raw/class/tl/ephemeral.d.ts +51 -51
- package/dist/src/raw/class/tl/ephemeral.js +204 -152
- package/dist/src/raw/class/tl/feed.d.ts +71 -71
- package/dist/src/raw/class/tl/feed.js +214 -179
- package/dist/src/raw/class/tl/folders.d.ts +6 -6
- package/dist/src/raw/class/tl/folders.js +11 -11
- package/dist/src/raw/class/tl/fragment.d.ts +11 -11
- package/dist/src/raw/class/tl/fragment.js +32 -25
- package/dist/src/raw/class/tl/help.d.ts +286 -286
- package/dist/src/raw/class/tl/help.js +686 -618
- package/dist/src/raw/class/tl/langpack.d.ts +26 -26
- package/dist/src/raw/class/tl/langpack.js +57 -57
- package/dist/src/raw/class/tl/messages.d.ts +1866 -1866
- package/dist/src/raw/class/tl/messages.js +5965 -4886
- package/dist/src/raw/class/tl/payments.d.ts +646 -646
- package/dist/src/raw/class/tl/payments.js +2254 -1766
- package/dist/src/raw/class/tl/phone.d.ts +256 -256
- package/dist/src/raw/class/tl/phone.js +779 -644
- package/dist/src/raw/class/tl/photos.d.ts +41 -41
- package/dist/src/raw/class/tl/photos.js +139 -116
- package/dist/src/raw/class/tl/premium.d.ts +41 -41
- package/dist/src/raw/class/tl/premium.js +133 -111
- package/dist/src/raw/class/tl/smsjobs.d.ts +46 -46
- package/dist/src/raw/class/tl/smsjobs.js +115 -97
- package/dist/src/raw/class/tl/stats.d.ts +71 -71
- package/dist/src/raw/class/tl/stats.js +268 -169
- package/dist/src/raw/class/tl/stickers.d.ts +61 -61
- package/dist/src/raw/class/tl/stickers.js +173 -144
- package/dist/src/raw/class/tl/storage.d.ts +51 -51
- package/dist/src/raw/class/tl/storage.js +71 -71
- package/dist/src/raw/class/tl/stories.d.ts +221 -221
- package/dist/src/raw/class/tl/stories.js +781 -622
- package/dist/src/raw/class/tl/toncenter.d.ts +21 -21
- package/dist/src/raw/class/tl/toncenter.js +52 -47
- package/dist/src/raw/class/tl/updates.d.ts +56 -56
- package/dist/src/raw/class/tl/updates.js +246 -175
- package/dist/src/raw/class/tl/upload.d.ts +66 -66
- package/dist/src/raw/class/tl/upload.js +178 -155
- package/dist/src/raw/class/tl/users.d.ts +61 -61
- package/dist/src/raw/class/tl/users.js +124 -124
- package/dist/src/raw/class/tl/wallet.d.ts +221 -221
- package/dist/src/raw/class/tl/wallet.js +624 -558
- package/dist/src/raw/class/types.d.ts +1 -1
- package/dist/src/raw/class/types.js +1 -1
- package/package.json +6 -4
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* tgsnake is a free software: you can redistribute it and/or modify
|
|
8
8
|
* it under the terms of the MIT License as published.
|
|
9
|
-
*/
|
|
9
|
+
*/
|
|
10
10
|
// This file is auto generate. All change made in this file will be lost!
|
|
11
11
|
import { TLObject, Primitive } from '../../core/index.js';
|
|
12
12
|
import { BytesIO } from '../../../deps.js';
|
|
@@ -15,36 +15,36 @@ export class UserAddresses extends TLObject {
|
|
|
15
15
|
users;
|
|
16
16
|
constructor(params) {
|
|
17
17
|
super();
|
|
18
|
-
this.classType =
|
|
19
|
-
this.className =
|
|
18
|
+
this.classType = 'types';
|
|
19
|
+
this.className = 'wallet.UserAddresses';
|
|
20
20
|
this.constructorId = 0x928e7b55;
|
|
21
21
|
this.subclassOfId = 0xd6496be3;
|
|
22
|
-
this._slots = [
|
|
22
|
+
this._slots = ['addresses', 'users'];
|
|
23
23
|
this.addresses = params.addresses;
|
|
24
24
|
this.users = params.users;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
* Generate the TLObject from buffer.
|
|
28
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
29
|
+
*/
|
|
30
30
|
static async read(_data, ..._args) {
|
|
31
31
|
// no flags
|
|
32
32
|
let addresses = await TLObject.read(_data);
|
|
33
33
|
let users = await TLObject.read(_data);
|
|
34
|
-
return new UserAddresses({
|
|
34
|
+
return new UserAddresses({ addresses: addresses, users: users });
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
* Generate buffer from TLObject.
|
|
38
|
+
*/
|
|
39
39
|
write() {
|
|
40
40
|
const b = new BytesIO();
|
|
41
41
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
42
42
|
// no flags
|
|
43
43
|
if (this.addresses) {
|
|
44
|
-
b.write(
|
|
44
|
+
b.write(Primitive.Vector.write(this.addresses));
|
|
45
45
|
}
|
|
46
46
|
if (this.users) {
|
|
47
|
-
b.write(
|
|
47
|
+
b.write(Primitive.Vector.write(this.users));
|
|
48
48
|
}
|
|
49
49
|
return b.buffer;
|
|
50
50
|
}
|
|
@@ -57,11 +57,11 @@ export class Transactions extends TLObject {
|
|
|
57
57
|
users;
|
|
58
58
|
constructor(params) {
|
|
59
59
|
super();
|
|
60
|
-
this.classType =
|
|
61
|
-
this.className =
|
|
60
|
+
this.classType = 'types';
|
|
61
|
+
this.className = 'wallet.Transactions';
|
|
62
62
|
this.constructorId = 0x4322d5a5;
|
|
63
63
|
this.subclassOfId = 0xda517b1b;
|
|
64
|
-
this._slots = [
|
|
64
|
+
this._slots = ['balance', 'transactions', 'nextOffset', 'chats', 'users'];
|
|
65
65
|
this.balance = params.balance;
|
|
66
66
|
this.transactions = params.transactions;
|
|
67
67
|
this.nextOffset = params.nextOffset;
|
|
@@ -69,43 +69,49 @@ export class Transactions extends TLObject {
|
|
|
69
69
|
this.users = params.users;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
* Generate the TLObject from buffer.
|
|
73
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
74
|
+
*/
|
|
75
75
|
static async read(_data, ..._args) {
|
|
76
76
|
// @ts-ignore
|
|
77
77
|
let flags = await Primitive.Int.read(_data);
|
|
78
78
|
let balance = await Primitive.Long.read(_data);
|
|
79
79
|
let transactions = await TLObject.read(_data);
|
|
80
|
-
let nextOffset =
|
|
80
|
+
let nextOffset = flags & (1 << 0) ? await Primitive.String.read(_data) : undefined;
|
|
81
81
|
let chats = await TLObject.read(_data);
|
|
82
82
|
let users = await TLObject.read(_data);
|
|
83
|
-
return new Transactions({
|
|
83
|
+
return new Transactions({
|
|
84
|
+
balance: balance,
|
|
85
|
+
transactions: transactions,
|
|
86
|
+
nextOffset: nextOffset,
|
|
87
|
+
chats: chats,
|
|
88
|
+
users: users,
|
|
89
|
+
});
|
|
84
90
|
}
|
|
85
91
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
* Generate buffer from TLObject.
|
|
93
|
+
*/
|
|
88
94
|
write() {
|
|
89
95
|
const b = new BytesIO();
|
|
90
96
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
91
97
|
// @ts-ignore
|
|
92
98
|
let flags = 0;
|
|
93
|
-
flags |= this.nextOffset !== undefined ?
|
|
94
|
-
b.write(
|
|
99
|
+
flags |= this.nextOffset !== undefined ? 1 << 0 : 0;
|
|
100
|
+
b.write(Primitive.Int.write(flags));
|
|
95
101
|
if (this.balance !== undefined) {
|
|
96
|
-
b.write(
|
|
102
|
+
b.write(Primitive.Long.write(this.balance));
|
|
97
103
|
}
|
|
98
104
|
if (this.transactions) {
|
|
99
|
-
b.write(
|
|
105
|
+
b.write(Primitive.Vector.write(this.transactions));
|
|
100
106
|
}
|
|
101
107
|
if (this.nextOffset !== undefined) {
|
|
102
|
-
b.write(
|
|
108
|
+
b.write(Primitive.String.write(this.nextOffset));
|
|
103
109
|
}
|
|
104
110
|
if (this.chats) {
|
|
105
|
-
b.write(
|
|
111
|
+
b.write(Primitive.Vector.write(this.chats));
|
|
106
112
|
}
|
|
107
113
|
if (this.users) {
|
|
108
|
-
b.write(
|
|
114
|
+
b.write(Primitive.Vector.write(this.users));
|
|
109
115
|
}
|
|
110
116
|
return b.buffer;
|
|
111
117
|
}
|
|
@@ -115,36 +121,36 @@ export class SecretPhraseParts extends TLObject {
|
|
|
115
121
|
dcs;
|
|
116
122
|
constructor(params) {
|
|
117
123
|
super();
|
|
118
|
-
this.classType =
|
|
119
|
-
this.className =
|
|
124
|
+
this.classType = 'types';
|
|
125
|
+
this.className = 'wallet.SecretPhraseParts';
|
|
120
126
|
this.constructorId = 0xe6d0ef01;
|
|
121
127
|
this.subclassOfId = 0x2e71bb10;
|
|
122
|
-
this._slots = [
|
|
128
|
+
this._slots = ['token', 'dcs'];
|
|
123
129
|
this.token = params.token;
|
|
124
130
|
this.dcs = params.dcs;
|
|
125
131
|
}
|
|
126
132
|
/**
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
* Generate the TLObject from buffer.
|
|
134
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
135
|
+
*/
|
|
130
136
|
static async read(_data, ..._args) {
|
|
131
137
|
// no flags
|
|
132
138
|
let token = await Primitive.String.read(_data);
|
|
133
139
|
let dcs = await TLObject.read(_data, Primitive.Int);
|
|
134
|
-
return new SecretPhraseParts({
|
|
140
|
+
return new SecretPhraseParts({ token: token, dcs: dcs });
|
|
135
141
|
}
|
|
136
142
|
/**
|
|
137
|
-
|
|
138
|
-
|
|
143
|
+
* Generate buffer from TLObject.
|
|
144
|
+
*/
|
|
139
145
|
write() {
|
|
140
146
|
const b = new BytesIO();
|
|
141
147
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
142
148
|
// no flags
|
|
143
149
|
if (this.token !== undefined) {
|
|
144
|
-
b.write(
|
|
150
|
+
b.write(Primitive.String.write(this.token));
|
|
145
151
|
}
|
|
146
152
|
if (this.dcs) {
|
|
147
|
-
b.write(
|
|
153
|
+
b.write(Primitive.Vector.write(this.dcs, Primitive.Int));
|
|
148
154
|
}
|
|
149
155
|
return b.buffer;
|
|
150
156
|
}
|
|
@@ -153,31 +159,31 @@ export class EncryptedSecretPhrasePart extends TLObject {
|
|
|
153
159
|
data;
|
|
154
160
|
constructor(params) {
|
|
155
161
|
super();
|
|
156
|
-
this.classType =
|
|
157
|
-
this.className =
|
|
162
|
+
this.classType = 'types';
|
|
163
|
+
this.className = 'wallet.EncryptedSecretPhrasePart';
|
|
158
164
|
this.constructorId = 0x18e82537;
|
|
159
165
|
this.subclassOfId = 0xed624c52;
|
|
160
|
-
this._slots = [
|
|
166
|
+
this._slots = ['data'];
|
|
161
167
|
this.data = params.data;
|
|
162
168
|
}
|
|
163
169
|
/**
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
170
|
+
* Generate the TLObject from buffer.
|
|
171
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
172
|
+
*/
|
|
167
173
|
static async read(_data, ..._args) {
|
|
168
174
|
// no flags
|
|
169
175
|
let data = await Primitive.Bytes.read(_data);
|
|
170
|
-
return new EncryptedSecretPhrasePart({
|
|
176
|
+
return new EncryptedSecretPhrasePart({ data: data });
|
|
171
177
|
}
|
|
172
178
|
/**
|
|
173
|
-
|
|
174
|
-
|
|
179
|
+
* Generate buffer from TLObject.
|
|
180
|
+
*/
|
|
175
181
|
write() {
|
|
176
182
|
const b = new BytesIO();
|
|
177
183
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
178
184
|
// no flags
|
|
179
185
|
if (this.data !== undefined) {
|
|
180
|
-
b.write(
|
|
186
|
+
b.write(Primitive.Bytes.write(this.data));
|
|
181
187
|
}
|
|
182
188
|
return b.buffer;
|
|
183
189
|
}
|
|
@@ -187,36 +193,36 @@ export class HolderDc extends TLObject {
|
|
|
187
193
|
publicKey;
|
|
188
194
|
constructor(params) {
|
|
189
195
|
super();
|
|
190
|
-
this.classType =
|
|
191
|
-
this.className =
|
|
196
|
+
this.classType = 'types';
|
|
197
|
+
this.className = 'wallet.HolderDc';
|
|
192
198
|
this.constructorId = 0xf9d612ef;
|
|
193
199
|
this.subclassOfId = 0xf97e469f;
|
|
194
|
-
this._slots = [
|
|
200
|
+
this._slots = ['dc', 'publicKey'];
|
|
195
201
|
this.dc = params.dc;
|
|
196
202
|
this.publicKey = params.publicKey;
|
|
197
203
|
}
|
|
198
204
|
/**
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
205
|
+
* Generate the TLObject from buffer.
|
|
206
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
207
|
+
*/
|
|
202
208
|
static async read(_data, ..._args) {
|
|
203
209
|
// no flags
|
|
204
210
|
let dc = await Primitive.Int.read(_data);
|
|
205
211
|
let publicKey = await Primitive.Bytes.read(_data);
|
|
206
|
-
return new HolderDc({
|
|
212
|
+
return new HolderDc({ dc: dc, publicKey: publicKey });
|
|
207
213
|
}
|
|
208
214
|
/**
|
|
209
|
-
|
|
210
|
-
|
|
215
|
+
* Generate buffer from TLObject.
|
|
216
|
+
*/
|
|
211
217
|
write() {
|
|
212
218
|
const b = new BytesIO();
|
|
213
219
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
214
220
|
// no flags
|
|
215
221
|
if (this.dc !== undefined) {
|
|
216
|
-
b.write(
|
|
222
|
+
b.write(Primitive.Int.write(this.dc));
|
|
217
223
|
}
|
|
218
224
|
if (this.publicKey !== undefined) {
|
|
219
|
-
b.write(
|
|
225
|
+
b.write(Primitive.Bytes.write(this.publicKey));
|
|
220
226
|
}
|
|
221
227
|
return b.buffer;
|
|
222
228
|
}
|
|
@@ -227,41 +233,41 @@ export class ProofChallenge extends TLObject {
|
|
|
227
233
|
domain;
|
|
228
234
|
constructor(params) {
|
|
229
235
|
super();
|
|
230
|
-
this.classType =
|
|
231
|
-
this.className =
|
|
236
|
+
this.classType = 'types';
|
|
237
|
+
this.className = 'wallet.ProofChallenge';
|
|
232
238
|
this.constructorId = 0x99e41707;
|
|
233
239
|
this.subclassOfId = 0xd8d15305;
|
|
234
|
-
this._slots = [
|
|
240
|
+
this._slots = ['payload', 'expires', 'domain'];
|
|
235
241
|
this.payload = params.payload;
|
|
236
242
|
this.expires = params.expires;
|
|
237
243
|
this.domain = params.domain;
|
|
238
244
|
}
|
|
239
245
|
/**
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
246
|
+
* Generate the TLObject from buffer.
|
|
247
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
248
|
+
*/
|
|
243
249
|
static async read(_data, ..._args) {
|
|
244
250
|
// no flags
|
|
245
251
|
let payload = await Primitive.String.read(_data);
|
|
246
252
|
let expires = await Primitive.Int.read(_data);
|
|
247
253
|
let domain = await Primitive.String.read(_data);
|
|
248
|
-
return new ProofChallenge({
|
|
254
|
+
return new ProofChallenge({ payload: payload, expires: expires, domain: domain });
|
|
249
255
|
}
|
|
250
256
|
/**
|
|
251
|
-
|
|
252
|
-
|
|
257
|
+
* Generate buffer from TLObject.
|
|
258
|
+
*/
|
|
253
259
|
write() {
|
|
254
260
|
const b = new BytesIO();
|
|
255
261
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
256
262
|
// no flags
|
|
257
263
|
if (this.payload !== undefined) {
|
|
258
|
-
b.write(
|
|
264
|
+
b.write(Primitive.String.write(this.payload));
|
|
259
265
|
}
|
|
260
266
|
if (this.expires !== undefined) {
|
|
261
|
-
b.write(
|
|
267
|
+
b.write(Primitive.Int.write(this.expires));
|
|
262
268
|
}
|
|
263
269
|
if (this.domain !== undefined) {
|
|
264
|
-
b.write(
|
|
270
|
+
b.write(Primitive.String.write(this.domain));
|
|
265
271
|
}
|
|
266
272
|
return b.buffer;
|
|
267
273
|
}
|
|
@@ -271,36 +277,36 @@ export class TonConnectChallenge extends TLObject {
|
|
|
271
277
|
eventId;
|
|
272
278
|
constructor(params) {
|
|
273
279
|
super();
|
|
274
|
-
this.classType =
|
|
275
|
-
this.className =
|
|
280
|
+
this.classType = 'types';
|
|
281
|
+
this.className = 'wallet.TonConnectChallenge';
|
|
276
282
|
this.constructorId = 0x4bc89693;
|
|
277
283
|
this.subclassOfId = 0x6fc97efe;
|
|
278
|
-
this._slots = [
|
|
284
|
+
this._slots = ['challenge', 'eventId'];
|
|
279
285
|
this.challenge = params.challenge;
|
|
280
286
|
this.eventId = params.eventId;
|
|
281
287
|
}
|
|
282
288
|
/**
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
289
|
+
* Generate the TLObject from buffer.
|
|
290
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
291
|
+
*/
|
|
286
292
|
static async read(_data, ..._args) {
|
|
287
293
|
// no flags
|
|
288
294
|
let challenge = await Primitive.Bytes.read(_data);
|
|
289
295
|
let eventId = await Primitive.Long.read(_data);
|
|
290
|
-
return new TonConnectChallenge({
|
|
296
|
+
return new TonConnectChallenge({ challenge: challenge, eventId: eventId });
|
|
291
297
|
}
|
|
292
298
|
/**
|
|
293
|
-
|
|
294
|
-
|
|
299
|
+
* Generate buffer from TLObject.
|
|
300
|
+
*/
|
|
295
301
|
write() {
|
|
296
302
|
const b = new BytesIO();
|
|
297
303
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
298
304
|
// no flags
|
|
299
305
|
if (this.challenge !== undefined) {
|
|
300
|
-
b.write(
|
|
306
|
+
b.write(Primitive.Bytes.write(this.challenge));
|
|
301
307
|
}
|
|
302
308
|
if (this.eventId !== undefined) {
|
|
303
|
-
b.write(
|
|
309
|
+
b.write(Primitive.Long.write(this.eventId));
|
|
304
310
|
}
|
|
305
311
|
return b.buffer;
|
|
306
312
|
}
|
|
@@ -310,27 +316,27 @@ export class TonConnectPending extends TLObject {
|
|
|
310
316
|
requests;
|
|
311
317
|
constructor(params) {
|
|
312
318
|
super();
|
|
313
|
-
this.classType =
|
|
314
|
-
this.className =
|
|
319
|
+
this.classType = 'types';
|
|
320
|
+
this.className = 'wallet.TonConnectPending';
|
|
315
321
|
this.constructorId = 0x85c0f124;
|
|
316
322
|
this.subclassOfId = 0x81ebfc36;
|
|
317
|
-
this._slots = [
|
|
323
|
+
this._slots = ['session', 'requests'];
|
|
318
324
|
this.session = params.session;
|
|
319
325
|
this.requests = params.requests;
|
|
320
326
|
}
|
|
321
327
|
/**
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
328
|
+
* Generate the TLObject from buffer.
|
|
329
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
330
|
+
*/
|
|
325
331
|
static async read(_data, ..._args) {
|
|
326
332
|
// no flags
|
|
327
333
|
let session = await TLObject.read(_data);
|
|
328
334
|
let requests = await TLObject.read(_data);
|
|
329
|
-
return new TonConnectPending({
|
|
335
|
+
return new TonConnectPending({ session: session, requests: requests });
|
|
330
336
|
}
|
|
331
337
|
/**
|
|
332
|
-
|
|
333
|
-
|
|
338
|
+
* Generate buffer from TLObject.
|
|
339
|
+
*/
|
|
334
340
|
write() {
|
|
335
341
|
const b = new BytesIO();
|
|
336
342
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -339,7 +345,7 @@ export class TonConnectPending extends TLObject {
|
|
|
339
345
|
b.write(this.session.write());
|
|
340
346
|
}
|
|
341
347
|
if (this.requests) {
|
|
342
|
-
b.write(
|
|
348
|
+
b.write(Primitive.Vector.write(this.requests));
|
|
343
349
|
}
|
|
344
350
|
return b.buffer;
|
|
345
351
|
}
|
|
@@ -348,31 +354,31 @@ export class TonConnectSessions extends TLObject {
|
|
|
348
354
|
sessions;
|
|
349
355
|
constructor(params) {
|
|
350
356
|
super();
|
|
351
|
-
this.classType =
|
|
352
|
-
this.className =
|
|
357
|
+
this.classType = 'types';
|
|
358
|
+
this.className = 'wallet.TonConnectSessions';
|
|
353
359
|
this.constructorId = 0xe1f6896;
|
|
354
360
|
this.subclassOfId = 0xe7323d24;
|
|
355
|
-
this._slots = [
|
|
361
|
+
this._slots = ['sessions'];
|
|
356
362
|
this.sessions = params.sessions;
|
|
357
363
|
}
|
|
358
364
|
/**
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
365
|
+
* Generate the TLObject from buffer.
|
|
366
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
367
|
+
*/
|
|
362
368
|
static async read(_data, ..._args) {
|
|
363
369
|
// no flags
|
|
364
370
|
let sessions = await TLObject.read(_data);
|
|
365
|
-
return new TonConnectSessions({
|
|
371
|
+
return new TonConnectSessions({ sessions: sessions });
|
|
366
372
|
}
|
|
367
373
|
/**
|
|
368
|
-
|
|
369
|
-
|
|
374
|
+
* Generate buffer from TLObject.
|
|
375
|
+
*/
|
|
370
376
|
write() {
|
|
371
377
|
const b = new BytesIO();
|
|
372
378
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
373
379
|
// no flags
|
|
374
380
|
if (this.sessions) {
|
|
375
|
-
b.write(
|
|
381
|
+
b.write(Primitive.Vector.write(this.sessions));
|
|
376
382
|
}
|
|
377
383
|
return b.buffer;
|
|
378
384
|
}
|
|
@@ -382,37 +388,37 @@ export class ExistingBalance extends TLObject {
|
|
|
382
388
|
url;
|
|
383
389
|
constructor(params) {
|
|
384
390
|
super();
|
|
385
|
-
this.classType =
|
|
386
|
-
this.className =
|
|
391
|
+
this.classType = 'types';
|
|
392
|
+
this.className = 'wallet.ExistingBalance';
|
|
387
393
|
this.constructorId = 0xbde90a8d;
|
|
388
394
|
this.subclassOfId = 0xa739fa56;
|
|
389
|
-
this._slots = [
|
|
395
|
+
this._slots = ['hasBalance', 'url'];
|
|
390
396
|
this.hasBalance = params.hasBalance;
|
|
391
397
|
this.url = params.url;
|
|
392
398
|
}
|
|
393
399
|
/**
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
400
|
+
* Generate the TLObject from buffer.
|
|
401
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
402
|
+
*/
|
|
397
403
|
static async read(_data, ..._args) {
|
|
398
404
|
// @ts-ignore
|
|
399
405
|
let flags = await Primitive.Int.read(_data);
|
|
400
|
-
let hasBalance =
|
|
406
|
+
let hasBalance = flags & (1 << 0) ? true : false;
|
|
401
407
|
let url = await Primitive.String.read(_data);
|
|
402
|
-
return new ExistingBalance({
|
|
408
|
+
return new ExistingBalance({ hasBalance: hasBalance, url: url });
|
|
403
409
|
}
|
|
404
410
|
/**
|
|
405
|
-
|
|
406
|
-
|
|
411
|
+
* Generate buffer from TLObject.
|
|
412
|
+
*/
|
|
407
413
|
write() {
|
|
408
414
|
const b = new BytesIO();
|
|
409
415
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
410
416
|
// @ts-ignore
|
|
411
417
|
let flags = 0;
|
|
412
|
-
flags |= this.hasBalance ?
|
|
413
|
-
b.write(
|
|
418
|
+
flags |= this.hasBalance ? 1 << 0 : 0;
|
|
419
|
+
b.write(Primitive.Int.write(flags));
|
|
414
420
|
if (this.url !== undefined) {
|
|
415
|
-
b.write(
|
|
421
|
+
b.write(Primitive.String.write(this.url));
|
|
416
422
|
}
|
|
417
423
|
return b.buffer;
|
|
418
424
|
}
|
|
@@ -422,36 +428,36 @@ export class NftAttribute extends TLObject {
|
|
|
422
428
|
value;
|
|
423
429
|
constructor(params) {
|
|
424
430
|
super();
|
|
425
|
-
this.classType =
|
|
426
|
-
this.className =
|
|
431
|
+
this.classType = 'types';
|
|
432
|
+
this.className = 'wallet.NftAttribute';
|
|
427
433
|
this.constructorId = 0x4c1ef10e;
|
|
428
434
|
this.subclassOfId = 0x530e1841;
|
|
429
|
-
this._slots = [
|
|
435
|
+
this._slots = ['traitType', 'value'];
|
|
430
436
|
this.traitType = params.traitType;
|
|
431
437
|
this.value = params.value;
|
|
432
438
|
}
|
|
433
439
|
/**
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
440
|
+
* Generate the TLObject from buffer.
|
|
441
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
442
|
+
*/
|
|
437
443
|
static async read(_data, ..._args) {
|
|
438
444
|
// no flags
|
|
439
445
|
let traitType = await Primitive.String.read(_data);
|
|
440
446
|
let value = await Primitive.String.read(_data);
|
|
441
|
-
return new NftAttribute({
|
|
447
|
+
return new NftAttribute({ traitType: traitType, value: value });
|
|
442
448
|
}
|
|
443
449
|
/**
|
|
444
|
-
|
|
445
|
-
|
|
450
|
+
* Generate buffer from TLObject.
|
|
451
|
+
*/
|
|
446
452
|
write() {
|
|
447
453
|
const b = new BytesIO();
|
|
448
454
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
449
455
|
// no flags
|
|
450
456
|
if (this.traitType !== undefined) {
|
|
451
|
-
b.write(
|
|
457
|
+
b.write(Primitive.String.write(this.traitType));
|
|
452
458
|
}
|
|
453
459
|
if (this.value !== undefined) {
|
|
454
|
-
b.write(
|
|
460
|
+
b.write(Primitive.String.write(this.value));
|
|
455
461
|
}
|
|
456
462
|
return b.buffer;
|
|
457
463
|
}
|
|
@@ -472,11 +478,25 @@ export class NftItem extends TLObject {
|
|
|
472
478
|
gift;
|
|
473
479
|
constructor(params) {
|
|
474
480
|
super();
|
|
475
|
-
this.classType =
|
|
476
|
-
this.className =
|
|
481
|
+
this.classType = 'types';
|
|
482
|
+
this.className = 'wallet.NftItem';
|
|
477
483
|
this.constructorId = 0x173dfaf3;
|
|
478
484
|
this.subclassOfId = 0xd4319a36;
|
|
479
|
-
this._slots = [
|
|
485
|
+
this._slots = [
|
|
486
|
+
'collectionAddress',
|
|
487
|
+
'address',
|
|
488
|
+
'ownerAddress',
|
|
489
|
+
'index',
|
|
490
|
+
'name',
|
|
491
|
+
'description',
|
|
492
|
+
'image',
|
|
493
|
+
'imageSmall',
|
|
494
|
+
'contentUrl',
|
|
495
|
+
'lottie',
|
|
496
|
+
'attributes',
|
|
497
|
+
'extra',
|
|
498
|
+
'gift',
|
|
499
|
+
];
|
|
480
500
|
this.collectionAddress = params.collectionAddress;
|
|
481
501
|
this.address = params.address;
|
|
482
502
|
this.ownerAddress = params.ownerAddress;
|
|
@@ -492,63 +512,77 @@ export class NftItem extends TLObject {
|
|
|
492
512
|
this.gift = params.gift;
|
|
493
513
|
}
|
|
494
514
|
/**
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
515
|
+
* Generate the TLObject from buffer.
|
|
516
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
517
|
+
*/
|
|
498
518
|
static async read(_data, ..._args) {
|
|
499
519
|
// @ts-ignore
|
|
500
520
|
let flags = await Primitive.Int.read(_data);
|
|
501
|
-
let collectionAddress =
|
|
521
|
+
let collectionAddress = flags & (1 << 0) ? await Primitive.String.read(_data) : undefined;
|
|
502
522
|
let address = await Primitive.String.read(_data);
|
|
503
523
|
let ownerAddress = await Primitive.String.read(_data);
|
|
504
524
|
let index = await Primitive.String.read(_data);
|
|
505
|
-
let name =
|
|
506
|
-
let description =
|
|
507
|
-
let image =
|
|
508
|
-
let imageSmall =
|
|
509
|
-
let contentUrl =
|
|
510
|
-
let lottie =
|
|
511
|
-
let attributes =
|
|
512
|
-
let extra =
|
|
513
|
-
let gift =
|
|
514
|
-
return new NftItem({
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
525
|
+
let name = flags & (1 << 1) ? await Primitive.String.read(_data) : undefined;
|
|
526
|
+
let description = flags & (1 << 2) ? await Primitive.String.read(_data) : undefined;
|
|
527
|
+
let image = flags & (1 << 3) ? await TLObject.read(_data) : undefined;
|
|
528
|
+
let imageSmall = flags & (1 << 4) ? await TLObject.read(_data) : undefined;
|
|
529
|
+
let contentUrl = flags & (1 << 5) ? await TLObject.read(_data) : undefined;
|
|
530
|
+
let lottie = flags & (1 << 6) ? await TLObject.read(_data) : undefined;
|
|
531
|
+
let attributes = flags & (1 << 7) ? await TLObject.read(_data) : [];
|
|
532
|
+
let extra = flags & (1 << 8) ? await TLObject.read(_data) : undefined;
|
|
533
|
+
let gift = flags & (1 << 9) ? await TLObject.read(_data) : undefined;
|
|
534
|
+
return new NftItem({
|
|
535
|
+
collectionAddress: collectionAddress,
|
|
536
|
+
address: address,
|
|
537
|
+
ownerAddress: ownerAddress,
|
|
538
|
+
index: index,
|
|
539
|
+
name: name,
|
|
540
|
+
description: description,
|
|
541
|
+
image: image,
|
|
542
|
+
imageSmall: imageSmall,
|
|
543
|
+
contentUrl: contentUrl,
|
|
544
|
+
lottie: lottie,
|
|
545
|
+
attributes: attributes,
|
|
546
|
+
extra: extra,
|
|
547
|
+
gift: gift,
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Generate buffer from TLObject.
|
|
552
|
+
*/
|
|
519
553
|
write() {
|
|
520
554
|
const b = new BytesIO();
|
|
521
555
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
522
556
|
// @ts-ignore
|
|
523
557
|
let flags = 0;
|
|
524
|
-
flags |= this.collectionAddress !== undefined ?
|
|
525
|
-
flags |= this.name !== undefined ?
|
|
526
|
-
flags |= this.description !== undefined ?
|
|
527
|
-
flags |= this.image !== undefined ?
|
|
528
|
-
flags |= this.imageSmall !== undefined ?
|
|
529
|
-
flags |= this.contentUrl !== undefined ?
|
|
530
|
-
flags |= this.lottie !== undefined ?
|
|
531
|
-
flags |= this.attributes ?
|
|
532
|
-
flags |= this.extra !== undefined ?
|
|
533
|
-
flags |= this.gift !== undefined ?
|
|
534
|
-
b.write(
|
|
558
|
+
flags |= this.collectionAddress !== undefined ? 1 << 0 : 0;
|
|
559
|
+
flags |= this.name !== undefined ? 1 << 1 : 0;
|
|
560
|
+
flags |= this.description !== undefined ? 1 << 2 : 0;
|
|
561
|
+
flags |= this.image !== undefined ? 1 << 3 : 0;
|
|
562
|
+
flags |= this.imageSmall !== undefined ? 1 << 4 : 0;
|
|
563
|
+
flags |= this.contentUrl !== undefined ? 1 << 5 : 0;
|
|
564
|
+
flags |= this.lottie !== undefined ? 1 << 6 : 0;
|
|
565
|
+
flags |= this.attributes ? 1 << 7 : 0;
|
|
566
|
+
flags |= this.extra !== undefined ? 1 << 8 : 0;
|
|
567
|
+
flags |= this.gift !== undefined ? 1 << 9 : 0;
|
|
568
|
+
b.write(Primitive.Int.write(flags));
|
|
535
569
|
if (this.collectionAddress !== undefined) {
|
|
536
|
-
b.write(
|
|
570
|
+
b.write(Primitive.String.write(this.collectionAddress));
|
|
537
571
|
}
|
|
538
572
|
if (this.address !== undefined) {
|
|
539
|
-
b.write(
|
|
573
|
+
b.write(Primitive.String.write(this.address));
|
|
540
574
|
}
|
|
541
575
|
if (this.ownerAddress !== undefined) {
|
|
542
|
-
b.write(
|
|
576
|
+
b.write(Primitive.String.write(this.ownerAddress));
|
|
543
577
|
}
|
|
544
578
|
if (this.index !== undefined) {
|
|
545
|
-
b.write(
|
|
579
|
+
b.write(Primitive.String.write(this.index));
|
|
546
580
|
}
|
|
547
581
|
if (this.name !== undefined) {
|
|
548
|
-
b.write(
|
|
582
|
+
b.write(Primitive.String.write(this.name));
|
|
549
583
|
}
|
|
550
584
|
if (this.description !== undefined) {
|
|
551
|
-
b.write(
|
|
585
|
+
b.write(Primitive.String.write(this.description));
|
|
552
586
|
}
|
|
553
587
|
if (this.image !== undefined) {
|
|
554
588
|
b.write(this.image.write());
|
|
@@ -563,7 +597,7 @@ export class NftItem extends TLObject {
|
|
|
563
597
|
b.write(this.lottie.write());
|
|
564
598
|
}
|
|
565
599
|
if (this.attributes) {
|
|
566
|
-
b.write(
|
|
600
|
+
b.write(Primitive.Vector.write(this.attributes));
|
|
567
601
|
}
|
|
568
602
|
if (this.extra !== undefined) {
|
|
569
603
|
b.write(this.extra.write());
|
|
@@ -579,40 +613,40 @@ export class NftItems extends TLObject {
|
|
|
579
613
|
nextOffset;
|
|
580
614
|
constructor(params) {
|
|
581
615
|
super();
|
|
582
|
-
this.classType =
|
|
583
|
-
this.className =
|
|
616
|
+
this.classType = 'types';
|
|
617
|
+
this.className = 'wallet.NftItems';
|
|
584
618
|
this.constructorId = 0x794d486f;
|
|
585
619
|
this.subclassOfId = 0xd4606b08;
|
|
586
|
-
this._slots = [
|
|
620
|
+
this._slots = ['items', 'nextOffset'];
|
|
587
621
|
this.items = params.items;
|
|
588
622
|
this.nextOffset = params.nextOffset;
|
|
589
623
|
}
|
|
590
624
|
/**
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
625
|
+
* Generate the TLObject from buffer.
|
|
626
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
627
|
+
*/
|
|
594
628
|
static async read(_data, ..._args) {
|
|
595
629
|
// @ts-ignore
|
|
596
630
|
let flags = await Primitive.Int.read(_data);
|
|
597
631
|
let items = await TLObject.read(_data);
|
|
598
|
-
let nextOffset =
|
|
599
|
-
return new NftItems({
|
|
632
|
+
let nextOffset = flags & (1 << 0) ? await Primitive.String.read(_data) : undefined;
|
|
633
|
+
return new NftItems({ items: items, nextOffset: nextOffset });
|
|
600
634
|
}
|
|
601
635
|
/**
|
|
602
|
-
|
|
603
|
-
|
|
636
|
+
* Generate buffer from TLObject.
|
|
637
|
+
*/
|
|
604
638
|
write() {
|
|
605
639
|
const b = new BytesIO();
|
|
606
640
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
607
641
|
// @ts-ignore
|
|
608
642
|
let flags = 0;
|
|
609
|
-
flags |= this.nextOffset !== undefined ?
|
|
610
|
-
b.write(
|
|
643
|
+
flags |= this.nextOffset !== undefined ? 1 << 0 : 0;
|
|
644
|
+
b.write(Primitive.Int.write(flags));
|
|
611
645
|
if (this.items) {
|
|
612
|
-
b.write(
|
|
646
|
+
b.write(Primitive.Vector.write(this.items));
|
|
613
647
|
}
|
|
614
648
|
if (this.nextOffset !== undefined) {
|
|
615
|
-
b.write(
|
|
649
|
+
b.write(Primitive.String.write(this.nextOffset));
|
|
616
650
|
}
|
|
617
651
|
return b.buffer;
|
|
618
652
|
}
|
|
@@ -622,27 +656,27 @@ export class CardSticker extends TLObject {
|
|
|
622
656
|
nft;
|
|
623
657
|
constructor(params) {
|
|
624
658
|
super();
|
|
625
|
-
this.classType =
|
|
626
|
-
this.className =
|
|
659
|
+
this.classType = 'types';
|
|
660
|
+
this.className = 'wallet.CardSticker';
|
|
627
661
|
this.constructorId = 0xf3010cba;
|
|
628
662
|
this.subclassOfId = 0x87c28f79;
|
|
629
|
-
this._slots = [
|
|
663
|
+
this._slots = ['coordinates', 'nft'];
|
|
630
664
|
this.coordinates = params.coordinates;
|
|
631
665
|
this.nft = params.nft;
|
|
632
666
|
}
|
|
633
667
|
/**
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
668
|
+
* Generate the TLObject from buffer.
|
|
669
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
670
|
+
*/
|
|
637
671
|
static async read(_data, ..._args) {
|
|
638
672
|
// no flags
|
|
639
673
|
let coordinates = await TLObject.read(_data);
|
|
640
674
|
let nft = await TLObject.read(_data);
|
|
641
|
-
return new CardSticker({
|
|
675
|
+
return new CardSticker({ coordinates: coordinates, nft: nft });
|
|
642
676
|
}
|
|
643
677
|
/**
|
|
644
|
-
|
|
645
|
-
|
|
678
|
+
* Generate buffer from TLObject.
|
|
679
|
+
*/
|
|
646
680
|
write() {
|
|
647
681
|
const b = new BytesIO();
|
|
648
682
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -663,51 +697,56 @@ export class Card extends TLObject {
|
|
|
663
697
|
balance;
|
|
664
698
|
constructor(params) {
|
|
665
699
|
super();
|
|
666
|
-
this.classType =
|
|
667
|
-
this.className =
|
|
700
|
+
this.classType = 'types';
|
|
701
|
+
this.className = 'wallet.Card';
|
|
668
702
|
this.constructorId = 0x8ed043b1;
|
|
669
703
|
this.subclassOfId = 0x1f060b97;
|
|
670
|
-
this._slots = [
|
|
704
|
+
this._slots = ['stickers', 'bgNftItem', 'address', 'balance'];
|
|
671
705
|
this.stickers = params.stickers;
|
|
672
706
|
this.bgNftItem = params.bgNftItem;
|
|
673
707
|
this.address = params.address;
|
|
674
708
|
this.balance = params.balance;
|
|
675
709
|
}
|
|
676
710
|
/**
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
711
|
+
* Generate the TLObject from buffer.
|
|
712
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
713
|
+
*/
|
|
680
714
|
static async read(_data, ..._args) {
|
|
681
715
|
// @ts-ignore
|
|
682
716
|
let flags = await Primitive.Int.read(_data);
|
|
683
|
-
let stickers =
|
|
684
|
-
let bgNftItem =
|
|
717
|
+
let stickers = flags & (1 << 0) ? await TLObject.read(_data) : [];
|
|
718
|
+
let bgNftItem = flags & (1 << 1) ? await TLObject.read(_data) : undefined;
|
|
685
719
|
let address = await Primitive.String.read(_data);
|
|
686
720
|
let balance = await Primitive.Long.read(_data);
|
|
687
|
-
return new Card({
|
|
721
|
+
return new Card({
|
|
722
|
+
stickers: stickers,
|
|
723
|
+
bgNftItem: bgNftItem,
|
|
724
|
+
address: address,
|
|
725
|
+
balance: balance,
|
|
726
|
+
});
|
|
688
727
|
}
|
|
689
728
|
/**
|
|
690
|
-
|
|
691
|
-
|
|
729
|
+
* Generate buffer from TLObject.
|
|
730
|
+
*/
|
|
692
731
|
write() {
|
|
693
732
|
const b = new BytesIO();
|
|
694
733
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
695
734
|
// @ts-ignore
|
|
696
735
|
let flags = 0;
|
|
697
|
-
flags |= this.stickers ?
|
|
698
|
-
flags |= this.bgNftItem !== undefined ?
|
|
699
|
-
b.write(
|
|
736
|
+
flags |= this.stickers ? 1 << 0 : 0;
|
|
737
|
+
flags |= this.bgNftItem !== undefined ? 1 << 1 : 0;
|
|
738
|
+
b.write(Primitive.Int.write(flags));
|
|
700
739
|
if (this.stickers) {
|
|
701
|
-
b.write(
|
|
740
|
+
b.write(Primitive.Vector.write(this.stickers));
|
|
702
741
|
}
|
|
703
742
|
if (this.bgNftItem !== undefined) {
|
|
704
743
|
b.write(this.bgNftItem.write());
|
|
705
744
|
}
|
|
706
745
|
if (this.address !== undefined) {
|
|
707
|
-
b.write(
|
|
746
|
+
b.write(Primitive.String.write(this.address));
|
|
708
747
|
}
|
|
709
748
|
if (this.balance !== undefined) {
|
|
710
|
-
b.write(
|
|
749
|
+
b.write(Primitive.Long.write(this.balance));
|
|
711
750
|
}
|
|
712
751
|
return b.buffer;
|
|
713
752
|
}
|
|
@@ -716,23 +755,23 @@ export class GetState extends TLObject {
|
|
|
716
755
|
__response__;
|
|
717
756
|
constructor() {
|
|
718
757
|
super();
|
|
719
|
-
this.classType =
|
|
720
|
-
this.className =
|
|
758
|
+
this.classType = 'functions';
|
|
759
|
+
this.className = 'wallet.GetState';
|
|
721
760
|
this.constructorId = 0xab83b33a;
|
|
722
761
|
this.subclassOfId = 0xd479f736;
|
|
723
762
|
this._slots = [];
|
|
724
763
|
}
|
|
725
764
|
/**
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
765
|
+
* Generate the TLObject from buffer.
|
|
766
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
767
|
+
*/
|
|
729
768
|
static async read(_data, ..._args) {
|
|
730
769
|
// no flags
|
|
731
770
|
return new GetState();
|
|
732
771
|
}
|
|
733
772
|
/**
|
|
734
|
-
|
|
735
|
-
|
|
773
|
+
* Generate buffer from TLObject.
|
|
774
|
+
*/
|
|
736
775
|
write() {
|
|
737
776
|
const b = new BytesIO();
|
|
738
777
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -747,42 +786,42 @@ export class GetUserAddresses extends TLObject {
|
|
|
747
786
|
addresses;
|
|
748
787
|
constructor(params) {
|
|
749
788
|
super();
|
|
750
|
-
this.classType =
|
|
751
|
-
this.className =
|
|
789
|
+
this.classType = 'functions';
|
|
790
|
+
this.className = 'wallet.GetUserAddresses';
|
|
752
791
|
this.constructorId = 0x5275dfdd;
|
|
753
792
|
this.subclassOfId = 0xd6496be3;
|
|
754
|
-
this._slots = [
|
|
793
|
+
this._slots = ['force', 'id', 'addresses'];
|
|
755
794
|
this.force = params.force;
|
|
756
795
|
this.id = params.id;
|
|
757
796
|
this.addresses = params.addresses;
|
|
758
797
|
}
|
|
759
798
|
/**
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
799
|
+
* Generate the TLObject from buffer.
|
|
800
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
801
|
+
*/
|
|
763
802
|
static async read(_data, ..._args) {
|
|
764
803
|
// @ts-ignore
|
|
765
804
|
let flags = await Primitive.Int.read(_data);
|
|
766
|
-
let force =
|
|
805
|
+
let force = flags & (1 << 0) ? true : false;
|
|
767
806
|
let id = await TLObject.read(_data);
|
|
768
807
|
let addresses = await TLObject.read(_data, Primitive.String);
|
|
769
|
-
return new GetUserAddresses({
|
|
808
|
+
return new GetUserAddresses({ force: force, id: id, addresses: addresses });
|
|
770
809
|
}
|
|
771
810
|
/**
|
|
772
|
-
|
|
773
|
-
|
|
811
|
+
* Generate buffer from TLObject.
|
|
812
|
+
*/
|
|
774
813
|
write() {
|
|
775
814
|
const b = new BytesIO();
|
|
776
815
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
777
816
|
// @ts-ignore
|
|
778
817
|
let flags = 0;
|
|
779
|
-
flags |= this.force ?
|
|
780
|
-
b.write(
|
|
818
|
+
flags |= this.force ? 1 << 0 : 0;
|
|
819
|
+
b.write(Primitive.Int.write(flags));
|
|
781
820
|
if (this.id) {
|
|
782
|
-
b.write(
|
|
821
|
+
b.write(Primitive.Vector.write(this.id));
|
|
783
822
|
}
|
|
784
823
|
if (this.addresses) {
|
|
785
|
-
b.write(
|
|
824
|
+
b.write(Primitive.Vector.write(this.addresses, Primitive.String));
|
|
786
825
|
}
|
|
787
826
|
return b.buffer;
|
|
788
827
|
}
|
|
@@ -795,45 +834,50 @@ export class GetTransactions extends TLObject {
|
|
|
795
834
|
limit;
|
|
796
835
|
constructor(params) {
|
|
797
836
|
super();
|
|
798
|
-
this.classType =
|
|
799
|
-
this.className =
|
|
837
|
+
this.classType = 'functions';
|
|
838
|
+
this.className = 'wallet.GetTransactions';
|
|
800
839
|
this.constructorId = 0xa8830a83;
|
|
801
840
|
this.subclassOfId = 0xda517b1b;
|
|
802
|
-
this._slots = [
|
|
841
|
+
this._slots = ['inbound', 'outbound', 'offset', 'limit'];
|
|
803
842
|
this.inbound = params.inbound;
|
|
804
843
|
this.outbound = params.outbound;
|
|
805
844
|
this.offset = params.offset;
|
|
806
845
|
this.limit = params.limit;
|
|
807
846
|
}
|
|
808
847
|
/**
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
848
|
+
* Generate the TLObject from buffer.
|
|
849
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
850
|
+
*/
|
|
812
851
|
static async read(_data, ..._args) {
|
|
813
852
|
// @ts-ignore
|
|
814
853
|
let flags = await Primitive.Int.read(_data);
|
|
815
|
-
let inbound =
|
|
816
|
-
let outbound =
|
|
854
|
+
let inbound = flags & (1 << 0) ? true : false;
|
|
855
|
+
let outbound = flags & (1 << 1) ? true : false;
|
|
817
856
|
let offset = await Primitive.String.read(_data);
|
|
818
857
|
let limit = await Primitive.Int.read(_data);
|
|
819
|
-
return new GetTransactions({
|
|
858
|
+
return new GetTransactions({
|
|
859
|
+
inbound: inbound,
|
|
860
|
+
outbound: outbound,
|
|
861
|
+
offset: offset,
|
|
862
|
+
limit: limit,
|
|
863
|
+
});
|
|
820
864
|
}
|
|
821
865
|
/**
|
|
822
|
-
|
|
823
|
-
|
|
866
|
+
* Generate buffer from TLObject.
|
|
867
|
+
*/
|
|
824
868
|
write() {
|
|
825
869
|
const b = new BytesIO();
|
|
826
870
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
827
871
|
// @ts-ignore
|
|
828
872
|
let flags = 0;
|
|
829
|
-
flags |= this.inbound ?
|
|
830
|
-
flags |= this.outbound ?
|
|
831
|
-
b.write(
|
|
873
|
+
flags |= this.inbound ? 1 << 0 : 0;
|
|
874
|
+
flags |= this.outbound ? 1 << 1 : 0;
|
|
875
|
+
b.write(Primitive.Int.write(flags));
|
|
832
876
|
if (this.offset !== undefined) {
|
|
833
|
-
b.write(
|
|
877
|
+
b.write(Primitive.String.write(this.offset));
|
|
834
878
|
}
|
|
835
879
|
if (this.limit !== undefined) {
|
|
836
|
-
b.write(
|
|
880
|
+
b.write(Primitive.Int.write(this.limit));
|
|
837
881
|
}
|
|
838
882
|
return b.buffer;
|
|
839
883
|
}
|
|
@@ -843,31 +887,31 @@ export class GetTransactionsByIDs extends TLObject {
|
|
|
843
887
|
id;
|
|
844
888
|
constructor(params) {
|
|
845
889
|
super();
|
|
846
|
-
this.classType =
|
|
847
|
-
this.className =
|
|
890
|
+
this.classType = 'functions';
|
|
891
|
+
this.className = 'wallet.GetTransactionsByIDs';
|
|
848
892
|
this.constructorId = 0x811ceab6;
|
|
849
893
|
this.subclassOfId = 0xda517b1b;
|
|
850
|
-
this._slots = [
|
|
894
|
+
this._slots = ['id'];
|
|
851
895
|
this.id = params.id;
|
|
852
896
|
}
|
|
853
897
|
/**
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
898
|
+
* Generate the TLObject from buffer.
|
|
899
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
900
|
+
*/
|
|
857
901
|
static async read(_data, ..._args) {
|
|
858
902
|
// no flags
|
|
859
903
|
let id = await TLObject.read(_data, Primitive.String);
|
|
860
|
-
return new GetTransactionsByIDs({
|
|
904
|
+
return new GetTransactionsByIDs({ id: id });
|
|
861
905
|
}
|
|
862
906
|
/**
|
|
863
|
-
|
|
864
|
-
|
|
907
|
+
* Generate buffer from TLObject.
|
|
908
|
+
*/
|
|
865
909
|
write() {
|
|
866
910
|
const b = new BytesIO();
|
|
867
911
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
868
912
|
// no flags
|
|
869
913
|
if (this.id) {
|
|
870
|
-
b.write(
|
|
914
|
+
b.write(Primitive.Vector.write(this.id, Primitive.String));
|
|
871
915
|
}
|
|
872
916
|
return b.buffer;
|
|
873
917
|
}
|
|
@@ -877,31 +921,31 @@ export class GetTransactionsByMsgHash extends TLObject {
|
|
|
877
921
|
msgHash;
|
|
878
922
|
constructor(params) {
|
|
879
923
|
super();
|
|
880
|
-
this.classType =
|
|
881
|
-
this.className =
|
|
924
|
+
this.classType = 'functions';
|
|
925
|
+
this.className = 'wallet.GetTransactionsByMsgHash';
|
|
882
926
|
this.constructorId = 0xa6bb795d;
|
|
883
927
|
this.subclassOfId = 0xda517b1b;
|
|
884
|
-
this._slots = [
|
|
928
|
+
this._slots = ['msgHash'];
|
|
885
929
|
this.msgHash = params.msgHash;
|
|
886
930
|
}
|
|
887
931
|
/**
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
932
|
+
* Generate the TLObject from buffer.
|
|
933
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
934
|
+
*/
|
|
891
935
|
static async read(_data, ..._args) {
|
|
892
936
|
// no flags
|
|
893
937
|
let msgHash = await TLObject.read(_data, Primitive.String);
|
|
894
|
-
return new GetTransactionsByMsgHash({
|
|
938
|
+
return new GetTransactionsByMsgHash({ msgHash: msgHash });
|
|
895
939
|
}
|
|
896
940
|
/**
|
|
897
|
-
|
|
898
|
-
|
|
941
|
+
* Generate buffer from TLObject.
|
|
942
|
+
*/
|
|
899
943
|
write() {
|
|
900
944
|
const b = new BytesIO();
|
|
901
945
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
902
946
|
// no flags
|
|
903
947
|
if (this.msgHash) {
|
|
904
|
-
b.write(
|
|
948
|
+
b.write(Primitive.Vector.write(this.msgHash, Primitive.String));
|
|
905
949
|
}
|
|
906
950
|
return b.buffer;
|
|
907
951
|
}
|
|
@@ -911,33 +955,33 @@ export class ExportSecretPhrase extends TLObject {
|
|
|
911
955
|
password;
|
|
912
956
|
constructor(params) {
|
|
913
957
|
super();
|
|
914
|
-
this.classType =
|
|
915
|
-
this.className =
|
|
958
|
+
this.classType = 'functions';
|
|
959
|
+
this.className = 'wallet.ExportSecretPhrase';
|
|
916
960
|
this.constructorId = 0x9077c9ac;
|
|
917
961
|
this.subclassOfId = 0x2e71bb10;
|
|
918
|
-
this._slots = [
|
|
962
|
+
this._slots = ['password'];
|
|
919
963
|
this.password = params.password;
|
|
920
964
|
}
|
|
921
965
|
/**
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
966
|
+
* Generate the TLObject from buffer.
|
|
967
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
968
|
+
*/
|
|
925
969
|
static async read(_data, ..._args) {
|
|
926
970
|
// @ts-ignore
|
|
927
971
|
let flags = await Primitive.Int.read(_data);
|
|
928
|
-
let password =
|
|
929
|
-
return new ExportSecretPhrase({
|
|
972
|
+
let password = flags & (1 << 0) ? await TLObject.read(_data) : undefined;
|
|
973
|
+
return new ExportSecretPhrase({ password: password });
|
|
930
974
|
}
|
|
931
975
|
/**
|
|
932
|
-
|
|
933
|
-
|
|
976
|
+
* Generate buffer from TLObject.
|
|
977
|
+
*/
|
|
934
978
|
write() {
|
|
935
979
|
const b = new BytesIO();
|
|
936
980
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
937
981
|
// @ts-ignore
|
|
938
982
|
let flags = 0;
|
|
939
|
-
flags |= this.password !== undefined ?
|
|
940
|
-
b.write(
|
|
983
|
+
flags |= this.password !== undefined ? 1 << 0 : 0;
|
|
984
|
+
b.write(Primitive.Int.write(flags));
|
|
941
985
|
if (this.password !== undefined) {
|
|
942
986
|
b.write(this.password.write());
|
|
943
987
|
}
|
|
@@ -950,36 +994,36 @@ export class FetchEncryptedSecretPhrasePart extends TLObject {
|
|
|
950
994
|
publicKey;
|
|
951
995
|
constructor(params) {
|
|
952
996
|
super();
|
|
953
|
-
this.classType =
|
|
954
|
-
this.className =
|
|
997
|
+
this.classType = 'functions';
|
|
998
|
+
this.className = 'wallet.FetchEncryptedSecretPhrasePart';
|
|
955
999
|
this.constructorId = 0xf53925cf;
|
|
956
1000
|
this.subclassOfId = 0xed624c52;
|
|
957
|
-
this._slots = [
|
|
1001
|
+
this._slots = ['token', 'publicKey'];
|
|
958
1002
|
this.token = params.token;
|
|
959
1003
|
this.publicKey = params.publicKey;
|
|
960
1004
|
}
|
|
961
1005
|
/**
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1006
|
+
* Generate the TLObject from buffer.
|
|
1007
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1008
|
+
*/
|
|
965
1009
|
static async read(_data, ..._args) {
|
|
966
1010
|
// no flags
|
|
967
1011
|
let token = await Primitive.String.read(_data);
|
|
968
1012
|
let publicKey = await Primitive.Bytes.read(_data);
|
|
969
|
-
return new FetchEncryptedSecretPhrasePart({
|
|
1013
|
+
return new FetchEncryptedSecretPhrasePart({ token: token, publicKey: publicKey });
|
|
970
1014
|
}
|
|
971
1015
|
/**
|
|
972
|
-
|
|
973
|
-
|
|
1016
|
+
* Generate buffer from TLObject.
|
|
1017
|
+
*/
|
|
974
1018
|
write() {
|
|
975
1019
|
const b = new BytesIO();
|
|
976
1020
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
977
1021
|
// no flags
|
|
978
1022
|
if (this.token !== undefined) {
|
|
979
|
-
b.write(
|
|
1023
|
+
b.write(Primitive.String.write(this.token));
|
|
980
1024
|
}
|
|
981
1025
|
if (this.publicKey !== undefined) {
|
|
982
|
-
b.write(
|
|
1026
|
+
b.write(Primitive.Bytes.write(this.publicKey));
|
|
983
1027
|
}
|
|
984
1028
|
return b.buffer;
|
|
985
1029
|
}
|
|
@@ -990,35 +1034,35 @@ export class ReplaceWallet extends TLObject {
|
|
|
990
1034
|
password;
|
|
991
1035
|
constructor(params) {
|
|
992
1036
|
super();
|
|
993
|
-
this.classType =
|
|
994
|
-
this.className =
|
|
1037
|
+
this.classType = 'functions';
|
|
1038
|
+
this.className = 'wallet.ReplaceWallet';
|
|
995
1039
|
this.constructorId = 0xd8c72eec;
|
|
996
1040
|
this.subclassOfId = 0xd479f736;
|
|
997
|
-
this._slots = [
|
|
1041
|
+
this._slots = ['wallet', 'password'];
|
|
998
1042
|
this.wallet = params.wallet;
|
|
999
1043
|
this.password = params.password;
|
|
1000
1044
|
}
|
|
1001
1045
|
/**
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1046
|
+
* Generate the TLObject from buffer.
|
|
1047
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1048
|
+
*/
|
|
1005
1049
|
static async read(_data, ..._args) {
|
|
1006
1050
|
// @ts-ignore
|
|
1007
1051
|
let flags = await Primitive.Int.read(_data);
|
|
1008
1052
|
let wallet = await TLObject.read(_data);
|
|
1009
|
-
let password =
|
|
1010
|
-
return new ReplaceWallet({
|
|
1053
|
+
let password = flags & (1 << 0) ? await TLObject.read(_data) : undefined;
|
|
1054
|
+
return new ReplaceWallet({ wallet: wallet, password: password });
|
|
1011
1055
|
}
|
|
1012
1056
|
/**
|
|
1013
|
-
|
|
1014
|
-
|
|
1057
|
+
* Generate buffer from TLObject.
|
|
1058
|
+
*/
|
|
1015
1059
|
write() {
|
|
1016
1060
|
const b = new BytesIO();
|
|
1017
1061
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1018
1062
|
// @ts-ignore
|
|
1019
1063
|
let flags = 0;
|
|
1020
|
-
flags |= this.password !== undefined ?
|
|
1021
|
-
b.write(
|
|
1064
|
+
flags |= this.password !== undefined ? 1 << 0 : 0;
|
|
1065
|
+
b.write(Primitive.Int.write(flags));
|
|
1022
1066
|
if (this.wallet !== undefined) {
|
|
1023
1067
|
b.write(this.wallet.write());
|
|
1024
1068
|
}
|
|
@@ -1035,44 +1079,44 @@ export class DisableBackup extends TLObject {
|
|
|
1035
1079
|
proof;
|
|
1036
1080
|
constructor(params) {
|
|
1037
1081
|
super();
|
|
1038
|
-
this.classType =
|
|
1039
|
-
this.className =
|
|
1082
|
+
this.classType = 'functions';
|
|
1083
|
+
this.className = 'wallet.DisableBackup';
|
|
1040
1084
|
this.constructorId = 0xb0bf0da;
|
|
1041
1085
|
this.subclassOfId = 0xd479f736;
|
|
1042
|
-
this._slots = [
|
|
1086
|
+
this._slots = ['password', 'newPublicKey', 'proof'];
|
|
1043
1087
|
this.password = params.password;
|
|
1044
1088
|
this.newPublicKey = params.newPublicKey;
|
|
1045
1089
|
this.proof = params.proof;
|
|
1046
1090
|
}
|
|
1047
1091
|
/**
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1092
|
+
* Generate the TLObject from buffer.
|
|
1093
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1094
|
+
*/
|
|
1051
1095
|
static async read(_data, ..._args) {
|
|
1052
1096
|
// @ts-ignore
|
|
1053
1097
|
let flags = await Primitive.Int.read(_data);
|
|
1054
|
-
let password =
|
|
1055
|
-
let newPublicKey =
|
|
1056
|
-
let proof =
|
|
1057
|
-
return new DisableBackup({
|
|
1098
|
+
let password = flags & (1 << 0) ? await TLObject.read(_data) : undefined;
|
|
1099
|
+
let newPublicKey = flags & (1 << 1) ? await Primitive.Bytes.read(_data) : undefined;
|
|
1100
|
+
let proof = flags & (1 << 2) ? await TLObject.read(_data) : undefined;
|
|
1101
|
+
return new DisableBackup({ password: password, newPublicKey: newPublicKey, proof: proof });
|
|
1058
1102
|
}
|
|
1059
1103
|
/**
|
|
1060
|
-
|
|
1061
|
-
|
|
1104
|
+
* Generate buffer from TLObject.
|
|
1105
|
+
*/
|
|
1062
1106
|
write() {
|
|
1063
1107
|
const b = new BytesIO();
|
|
1064
1108
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1065
1109
|
// @ts-ignore
|
|
1066
1110
|
let flags = 0;
|
|
1067
|
-
flags |= this.password !== undefined ?
|
|
1068
|
-
flags |= this.newPublicKey !== undefined ?
|
|
1069
|
-
flags |= this.proof !== undefined ?
|
|
1070
|
-
b.write(
|
|
1111
|
+
flags |= this.password !== undefined ? 1 << 0 : 0;
|
|
1112
|
+
flags |= this.newPublicKey !== undefined ? 1 << 1 : 0;
|
|
1113
|
+
flags |= this.proof !== undefined ? 1 << 2 : 0;
|
|
1114
|
+
b.write(Primitive.Int.write(flags));
|
|
1071
1115
|
if (this.password !== undefined) {
|
|
1072
1116
|
b.write(this.password.write());
|
|
1073
1117
|
}
|
|
1074
1118
|
if (this.newPublicKey !== undefined) {
|
|
1075
|
-
b.write(
|
|
1119
|
+
b.write(Primitive.Bytes.write(this.newPublicKey));
|
|
1076
1120
|
}
|
|
1077
1121
|
if (this.proof !== undefined) {
|
|
1078
1122
|
b.write(this.proof.write());
|
|
@@ -1084,23 +1128,23 @@ export class GetBackupHolderDcs extends TLObject {
|
|
|
1084
1128
|
__response__;
|
|
1085
1129
|
constructor() {
|
|
1086
1130
|
super();
|
|
1087
|
-
this.classType =
|
|
1088
|
-
this.className =
|
|
1131
|
+
this.classType = 'functions';
|
|
1132
|
+
this.className = 'wallet.GetBackupHolderDcs';
|
|
1089
1133
|
this.constructorId = 0xd179d494;
|
|
1090
1134
|
this.subclassOfId = 0xdc46ac22;
|
|
1091
1135
|
this._slots = [];
|
|
1092
1136
|
}
|
|
1093
1137
|
/**
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1138
|
+
* Generate the TLObject from buffer.
|
|
1139
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1140
|
+
*/
|
|
1097
1141
|
static async read(_data, ..._args) {
|
|
1098
1142
|
// no flags
|
|
1099
1143
|
return new GetBackupHolderDcs();
|
|
1100
1144
|
}
|
|
1101
1145
|
/**
|
|
1102
|
-
|
|
1103
|
-
|
|
1146
|
+
* Generate buffer from TLObject.
|
|
1147
|
+
*/
|
|
1104
1148
|
write() {
|
|
1105
1149
|
const b = new BytesIO();
|
|
1106
1150
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1115,43 +1159,43 @@ export class EnableBackup extends TLObject {
|
|
|
1115
1159
|
proof;
|
|
1116
1160
|
constructor(params) {
|
|
1117
1161
|
super();
|
|
1118
|
-
this.classType =
|
|
1119
|
-
this.className =
|
|
1162
|
+
this.classType = 'functions';
|
|
1163
|
+
this.className = 'wallet.EnableBackup';
|
|
1120
1164
|
this.constructorId = 0x4500c525;
|
|
1121
1165
|
this.subclassOfId = 0xd479f736;
|
|
1122
|
-
this._slots = [
|
|
1166
|
+
this._slots = ['parts', 'newPublicKey', 'proof'];
|
|
1123
1167
|
this.parts = params.parts;
|
|
1124
1168
|
this.newPublicKey = params.newPublicKey;
|
|
1125
1169
|
this.proof = params.proof;
|
|
1126
1170
|
}
|
|
1127
1171
|
/**
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1172
|
+
* Generate the TLObject from buffer.
|
|
1173
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1174
|
+
*/
|
|
1131
1175
|
static async read(_data, ..._args) {
|
|
1132
1176
|
// @ts-ignore
|
|
1133
1177
|
let flags = await Primitive.Int.read(_data);
|
|
1134
1178
|
let parts = await TLObject.read(_data, Primitive.Bytes);
|
|
1135
|
-
let newPublicKey =
|
|
1136
|
-
let proof =
|
|
1137
|
-
return new EnableBackup({
|
|
1179
|
+
let newPublicKey = flags & (1 << 1) ? await Primitive.Bytes.read(_data) : undefined;
|
|
1180
|
+
let proof = flags & (1 << 2) ? await TLObject.read(_data) : undefined;
|
|
1181
|
+
return new EnableBackup({ parts: parts, newPublicKey: newPublicKey, proof: proof });
|
|
1138
1182
|
}
|
|
1139
1183
|
/**
|
|
1140
|
-
|
|
1141
|
-
|
|
1184
|
+
* Generate buffer from TLObject.
|
|
1185
|
+
*/
|
|
1142
1186
|
write() {
|
|
1143
1187
|
const b = new BytesIO();
|
|
1144
1188
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1145
1189
|
// @ts-ignore
|
|
1146
1190
|
let flags = 0;
|
|
1147
|
-
flags |= this.newPublicKey !== undefined ?
|
|
1148
|
-
flags |= this.proof !== undefined ?
|
|
1149
|
-
b.write(
|
|
1191
|
+
flags |= this.newPublicKey !== undefined ? 1 << 1 : 0;
|
|
1192
|
+
flags |= this.proof !== undefined ? 1 << 2 : 0;
|
|
1193
|
+
b.write(Primitive.Int.write(flags));
|
|
1150
1194
|
if (this.parts) {
|
|
1151
|
-
b.write(
|
|
1195
|
+
b.write(Primitive.Vector.write(this.parts, Primitive.Bytes));
|
|
1152
1196
|
}
|
|
1153
1197
|
if (this.newPublicKey !== undefined) {
|
|
1154
|
-
b.write(
|
|
1198
|
+
b.write(Primitive.Bytes.write(this.newPublicKey));
|
|
1155
1199
|
}
|
|
1156
1200
|
if (this.proof !== undefined) {
|
|
1157
1201
|
b.write(this.proof.write());
|
|
@@ -1163,23 +1207,23 @@ export class GetProofChallenge extends TLObject {
|
|
|
1163
1207
|
__response__;
|
|
1164
1208
|
constructor() {
|
|
1165
1209
|
super();
|
|
1166
|
-
this.classType =
|
|
1167
|
-
this.className =
|
|
1210
|
+
this.classType = 'functions';
|
|
1211
|
+
this.className = 'wallet.GetProofChallenge';
|
|
1168
1212
|
this.constructorId = 0x2025e697;
|
|
1169
1213
|
this.subclassOfId = 0xd8d15305;
|
|
1170
1214
|
this._slots = [];
|
|
1171
1215
|
}
|
|
1172
1216
|
/**
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1217
|
+
* Generate the TLObject from buffer.
|
|
1218
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1219
|
+
*/
|
|
1176
1220
|
static async read(_data, ..._args) {
|
|
1177
1221
|
// no flags
|
|
1178
1222
|
return new GetProofChallenge();
|
|
1179
1223
|
}
|
|
1180
1224
|
/**
|
|
1181
|
-
|
|
1182
|
-
|
|
1225
|
+
* Generate buffer from TLObject.
|
|
1226
|
+
*/
|
|
1183
1227
|
write() {
|
|
1184
1228
|
const b = new BytesIO();
|
|
1185
1229
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1195,50 +1239,55 @@ export class SendTransfer extends TLObject {
|
|
|
1195
1239
|
randomId;
|
|
1196
1240
|
constructor(params) {
|
|
1197
1241
|
super();
|
|
1198
|
-
this.classType =
|
|
1199
|
-
this.className =
|
|
1242
|
+
this.classType = 'functions';
|
|
1243
|
+
this.className = 'wallet.SendTransfer';
|
|
1200
1244
|
this.constructorId = 0xd9e5d9e2;
|
|
1201
1245
|
this.subclassOfId = 0x8af52aac;
|
|
1202
|
-
this._slots = [
|
|
1246
|
+
this._slots = ['dataNormal', 'dataGasless', 'userId', 'randomId'];
|
|
1203
1247
|
this.dataNormal = params.dataNormal;
|
|
1204
1248
|
this.dataGasless = params.dataGasless;
|
|
1205
1249
|
this.userId = params.userId;
|
|
1206
1250
|
this.randomId = params.randomId;
|
|
1207
1251
|
}
|
|
1208
1252
|
/**
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1253
|
+
* Generate the TLObject from buffer.
|
|
1254
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1255
|
+
*/
|
|
1212
1256
|
static async read(_data, ..._args) {
|
|
1213
1257
|
// @ts-ignore
|
|
1214
1258
|
let flags = await Primitive.Int.read(_data);
|
|
1215
1259
|
let dataNormal = await Primitive.Bytes.read(_data);
|
|
1216
|
-
let dataGasless =
|
|
1260
|
+
let dataGasless = flags & (1 << 0) ? await Primitive.Bytes.read(_data) : undefined;
|
|
1217
1261
|
let userId = await TLObject.read(_data);
|
|
1218
1262
|
let randomId = await Primitive.Long.read(_data);
|
|
1219
|
-
return new SendTransfer({
|
|
1263
|
+
return new SendTransfer({
|
|
1264
|
+
dataNormal: dataNormal,
|
|
1265
|
+
dataGasless: dataGasless,
|
|
1266
|
+
userId: userId,
|
|
1267
|
+
randomId: randomId,
|
|
1268
|
+
});
|
|
1220
1269
|
}
|
|
1221
1270
|
/**
|
|
1222
|
-
|
|
1223
|
-
|
|
1271
|
+
* Generate buffer from TLObject.
|
|
1272
|
+
*/
|
|
1224
1273
|
write() {
|
|
1225
1274
|
const b = new BytesIO();
|
|
1226
1275
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1227
1276
|
// @ts-ignore
|
|
1228
1277
|
let flags = 0;
|
|
1229
|
-
flags |= this.dataGasless !== undefined ?
|
|
1230
|
-
b.write(
|
|
1278
|
+
flags |= this.dataGasless !== undefined ? 1 << 0 : 0;
|
|
1279
|
+
b.write(Primitive.Int.write(flags));
|
|
1231
1280
|
if (this.dataNormal !== undefined) {
|
|
1232
|
-
b.write(
|
|
1281
|
+
b.write(Primitive.Bytes.write(this.dataNormal));
|
|
1233
1282
|
}
|
|
1234
1283
|
if (this.dataGasless !== undefined) {
|
|
1235
|
-
b.write(
|
|
1284
|
+
b.write(Primitive.Bytes.write(this.dataGasless));
|
|
1236
1285
|
}
|
|
1237
1286
|
if (this.userId !== undefined) {
|
|
1238
1287
|
b.write(this.userId.write());
|
|
1239
1288
|
}
|
|
1240
1289
|
if (this.randomId !== undefined) {
|
|
1241
|
-
b.write(
|
|
1290
|
+
b.write(Primitive.Long.write(this.randomId));
|
|
1242
1291
|
}
|
|
1243
1292
|
return b.buffer;
|
|
1244
1293
|
}
|
|
@@ -1247,23 +1296,23 @@ export class GetGaslessInfo extends TLObject {
|
|
|
1247
1296
|
__response__;
|
|
1248
1297
|
constructor() {
|
|
1249
1298
|
super();
|
|
1250
|
-
this.classType =
|
|
1251
|
-
this.className =
|
|
1299
|
+
this.classType = 'functions';
|
|
1300
|
+
this.className = 'wallet.GetGaslessInfo';
|
|
1252
1301
|
this.constructorId = 0x742df0a1;
|
|
1253
1302
|
this.subclassOfId = 0x8af52aac;
|
|
1254
1303
|
this._slots = [];
|
|
1255
1304
|
}
|
|
1256
1305
|
/**
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1306
|
+
* Generate the TLObject from buffer.
|
|
1307
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1308
|
+
*/
|
|
1260
1309
|
static async read(_data, ..._args) {
|
|
1261
1310
|
// no flags
|
|
1262
1311
|
return new GetGaslessInfo();
|
|
1263
1312
|
}
|
|
1264
1313
|
/**
|
|
1265
|
-
|
|
1266
|
-
|
|
1314
|
+
* Generate buffer from TLObject.
|
|
1315
|
+
*/
|
|
1267
1316
|
write() {
|
|
1268
1317
|
const b = new BytesIO();
|
|
1269
1318
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1275,23 +1324,23 @@ export class GetExistingWaltBalance extends TLObject {
|
|
|
1275
1324
|
__response__;
|
|
1276
1325
|
constructor() {
|
|
1277
1326
|
super();
|
|
1278
|
-
this.classType =
|
|
1279
|
-
this.className =
|
|
1327
|
+
this.classType = 'functions';
|
|
1328
|
+
this.className = 'wallet.GetExistingWaltBalance';
|
|
1280
1329
|
this.constructorId = 0x691f4360;
|
|
1281
1330
|
this.subclassOfId = 0xa739fa56;
|
|
1282
1331
|
this._slots = [];
|
|
1283
1332
|
}
|
|
1284
1333
|
/**
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1334
|
+
* Generate the TLObject from buffer.
|
|
1335
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1336
|
+
*/
|
|
1288
1337
|
static async read(_data, ..._args) {
|
|
1289
1338
|
// no flags
|
|
1290
1339
|
return new GetExistingWaltBalance();
|
|
1291
1340
|
}
|
|
1292
1341
|
/**
|
|
1293
|
-
|
|
1294
|
-
|
|
1342
|
+
* Generate buffer from TLObject.
|
|
1343
|
+
*/
|
|
1295
1344
|
write() {
|
|
1296
1345
|
const b = new BytesIO();
|
|
1297
1346
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1305,36 +1354,36 @@ export class GetNfts extends TLObject {
|
|
|
1305
1354
|
limit;
|
|
1306
1355
|
constructor(params) {
|
|
1307
1356
|
super();
|
|
1308
|
-
this.classType =
|
|
1309
|
-
this.className =
|
|
1357
|
+
this.classType = 'functions';
|
|
1358
|
+
this.className = 'wallet.GetNfts';
|
|
1310
1359
|
this.constructorId = 0x8c12f3a4;
|
|
1311
1360
|
this.subclassOfId = 0xd4606b08;
|
|
1312
|
-
this._slots = [
|
|
1361
|
+
this._slots = ['offset', 'limit'];
|
|
1313
1362
|
this.offset = params.offset;
|
|
1314
1363
|
this.limit = params.limit;
|
|
1315
1364
|
}
|
|
1316
1365
|
/**
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1366
|
+
* Generate the TLObject from buffer.
|
|
1367
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1368
|
+
*/
|
|
1320
1369
|
static async read(_data, ..._args) {
|
|
1321
1370
|
// no flags
|
|
1322
1371
|
let offset = await Primitive.String.read(_data);
|
|
1323
1372
|
let limit = await Primitive.Int.read(_data);
|
|
1324
|
-
return new GetNfts({
|
|
1373
|
+
return new GetNfts({ offset: offset, limit: limit });
|
|
1325
1374
|
}
|
|
1326
1375
|
/**
|
|
1327
|
-
|
|
1328
|
-
|
|
1376
|
+
* Generate buffer from TLObject.
|
|
1377
|
+
*/
|
|
1329
1378
|
write() {
|
|
1330
1379
|
const b = new BytesIO();
|
|
1331
1380
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1332
1381
|
// no flags
|
|
1333
1382
|
if (this.offset !== undefined) {
|
|
1334
|
-
b.write(
|
|
1383
|
+
b.write(Primitive.String.write(this.offset));
|
|
1335
1384
|
}
|
|
1336
1385
|
if (this.limit !== undefined) {
|
|
1337
|
-
b.write(
|
|
1386
|
+
b.write(Primitive.Int.write(this.limit));
|
|
1338
1387
|
}
|
|
1339
1388
|
return b.buffer;
|
|
1340
1389
|
}
|
|
@@ -1345,36 +1394,36 @@ export class TonConnectCreateSession extends TLObject {
|
|
|
1345
1394
|
manifestUrl;
|
|
1346
1395
|
constructor(params) {
|
|
1347
1396
|
super();
|
|
1348
|
-
this.classType =
|
|
1349
|
-
this.className =
|
|
1397
|
+
this.classType = 'functions';
|
|
1398
|
+
this.className = 'wallet.TonConnectCreateSession';
|
|
1350
1399
|
this.constructorId = 0xcc931046;
|
|
1351
1400
|
this.subclassOfId = 0xc7239cb0;
|
|
1352
|
-
this._slots = [
|
|
1401
|
+
this._slots = ['dappClientId', 'manifestUrl'];
|
|
1353
1402
|
this.dappClientId = params.dappClientId;
|
|
1354
1403
|
this.manifestUrl = params.manifestUrl;
|
|
1355
1404
|
}
|
|
1356
1405
|
/**
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1406
|
+
* Generate the TLObject from buffer.
|
|
1407
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1408
|
+
*/
|
|
1360
1409
|
static async read(_data, ..._args) {
|
|
1361
1410
|
// no flags
|
|
1362
1411
|
let dappClientId = await Primitive.String.read(_data);
|
|
1363
1412
|
let manifestUrl = await Primitive.String.read(_data);
|
|
1364
|
-
return new TonConnectCreateSession({
|
|
1413
|
+
return new TonConnectCreateSession({ dappClientId: dappClientId, manifestUrl: manifestUrl });
|
|
1365
1414
|
}
|
|
1366
1415
|
/**
|
|
1367
|
-
|
|
1368
|
-
|
|
1416
|
+
* Generate buffer from TLObject.
|
|
1417
|
+
*/
|
|
1369
1418
|
write() {
|
|
1370
1419
|
const b = new BytesIO();
|
|
1371
1420
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1372
1421
|
// no flags
|
|
1373
1422
|
if (this.dappClientId !== undefined) {
|
|
1374
|
-
b.write(
|
|
1423
|
+
b.write(Primitive.String.write(this.dappClientId));
|
|
1375
1424
|
}
|
|
1376
1425
|
if (this.manifestUrl !== undefined) {
|
|
1377
|
-
b.write(
|
|
1426
|
+
b.write(Primitive.String.write(this.manifestUrl));
|
|
1378
1427
|
}
|
|
1379
1428
|
return b.buffer;
|
|
1380
1429
|
}
|
|
@@ -1385,36 +1434,36 @@ export class TonConnectRegisterKey extends TLObject {
|
|
|
1385
1434
|
clientId;
|
|
1386
1435
|
constructor(params) {
|
|
1387
1436
|
super();
|
|
1388
|
-
this.classType =
|
|
1389
|
-
this.className =
|
|
1437
|
+
this.classType = 'functions';
|
|
1438
|
+
this.className = 'wallet.TonConnectRegisterKey';
|
|
1390
1439
|
this.constructorId = 0x338bcf1c;
|
|
1391
1440
|
this.subclassOfId = 0x6fc97efe;
|
|
1392
|
-
this._slots = [
|
|
1441
|
+
this._slots = ['sessionId', 'clientId'];
|
|
1393
1442
|
this.sessionId = params.sessionId;
|
|
1394
1443
|
this.clientId = params.clientId;
|
|
1395
1444
|
}
|
|
1396
1445
|
/**
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1446
|
+
* Generate the TLObject from buffer.
|
|
1447
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1448
|
+
*/
|
|
1400
1449
|
static async read(_data, ..._args) {
|
|
1401
1450
|
// no flags
|
|
1402
1451
|
let sessionId = await Primitive.Long.read(_data);
|
|
1403
1452
|
let clientId = await Primitive.String.read(_data);
|
|
1404
|
-
return new TonConnectRegisterKey({
|
|
1453
|
+
return new TonConnectRegisterKey({ sessionId: sessionId, clientId: clientId });
|
|
1405
1454
|
}
|
|
1406
1455
|
/**
|
|
1407
|
-
|
|
1408
|
-
|
|
1456
|
+
* Generate buffer from TLObject.
|
|
1457
|
+
*/
|
|
1409
1458
|
write() {
|
|
1410
1459
|
const b = new BytesIO();
|
|
1411
1460
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1412
1461
|
// no flags
|
|
1413
1462
|
if (this.sessionId !== undefined) {
|
|
1414
|
-
b.write(
|
|
1463
|
+
b.write(Primitive.Long.write(this.sessionId));
|
|
1415
1464
|
}
|
|
1416
1465
|
if (this.clientId !== undefined) {
|
|
1417
|
-
b.write(
|
|
1466
|
+
b.write(Primitive.String.write(this.clientId));
|
|
1418
1467
|
}
|
|
1419
1468
|
return b.buffer;
|
|
1420
1469
|
}
|
|
@@ -1428,11 +1477,11 @@ export class TonConnectSubmitConnectResult extends TLObject {
|
|
|
1428
1477
|
traceId;
|
|
1429
1478
|
constructor(params) {
|
|
1430
1479
|
super();
|
|
1431
|
-
this.classType =
|
|
1432
|
-
this.className =
|
|
1480
|
+
this.classType = 'functions';
|
|
1481
|
+
this.className = 'wallet.TonConnectSubmitConnectResult';
|
|
1433
1482
|
this.constructorId = 0xc2c00779;
|
|
1434
1483
|
this.subclassOfId = 0xf5b399ac;
|
|
1435
|
-
this._slots = [
|
|
1484
|
+
this._slots = ['error', 'sessionId', 'challengeAnswer', 'body', 'traceId'];
|
|
1436
1485
|
this.error = params.error;
|
|
1437
1486
|
this.sessionId = params.sessionId;
|
|
1438
1487
|
this.challengeAnswer = params.challengeAnswer;
|
|
@@ -1440,41 +1489,47 @@ export class TonConnectSubmitConnectResult extends TLObject {
|
|
|
1440
1489
|
this.traceId = params.traceId;
|
|
1441
1490
|
}
|
|
1442
1491
|
/**
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1492
|
+
* Generate the TLObject from buffer.
|
|
1493
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1494
|
+
*/
|
|
1446
1495
|
static async read(_data, ..._args) {
|
|
1447
1496
|
// @ts-ignore
|
|
1448
1497
|
let flags = await Primitive.Int.read(_data);
|
|
1449
|
-
let error =
|
|
1498
|
+
let error = flags & (1 << 0) ? true : false;
|
|
1450
1499
|
let sessionId = await Primitive.Long.read(_data);
|
|
1451
1500
|
let challengeAnswer = await Primitive.Bytes.read(_data);
|
|
1452
1501
|
let body = await Primitive.Bytes.read(_data);
|
|
1453
|
-
let traceId =
|
|
1454
|
-
return new TonConnectSubmitConnectResult({
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1502
|
+
let traceId = flags & (1 << 1) ? await Primitive.String.read(_data) : undefined;
|
|
1503
|
+
return new TonConnectSubmitConnectResult({
|
|
1504
|
+
error: error,
|
|
1505
|
+
sessionId: sessionId,
|
|
1506
|
+
challengeAnswer: challengeAnswer,
|
|
1507
|
+
body: body,
|
|
1508
|
+
traceId: traceId,
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Generate buffer from TLObject.
|
|
1513
|
+
*/
|
|
1459
1514
|
write() {
|
|
1460
1515
|
const b = new BytesIO();
|
|
1461
1516
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1462
1517
|
// @ts-ignore
|
|
1463
1518
|
let flags = 0;
|
|
1464
|
-
flags |= this.error ?
|
|
1465
|
-
flags |= this.traceId !== undefined ?
|
|
1466
|
-
b.write(
|
|
1519
|
+
flags |= this.error ? 1 << 0 : 0;
|
|
1520
|
+
flags |= this.traceId !== undefined ? 1 << 1 : 0;
|
|
1521
|
+
b.write(Primitive.Int.write(flags));
|
|
1467
1522
|
if (this.sessionId !== undefined) {
|
|
1468
|
-
b.write(
|
|
1523
|
+
b.write(Primitive.Long.write(this.sessionId));
|
|
1469
1524
|
}
|
|
1470
1525
|
if (this.challengeAnswer !== undefined) {
|
|
1471
|
-
b.write(
|
|
1526
|
+
b.write(Primitive.Bytes.write(this.challengeAnswer));
|
|
1472
1527
|
}
|
|
1473
1528
|
if (this.body !== undefined) {
|
|
1474
|
-
b.write(
|
|
1529
|
+
b.write(Primitive.Bytes.write(this.body));
|
|
1475
1530
|
}
|
|
1476
1531
|
if (this.traceId !== undefined) {
|
|
1477
|
-
b.write(
|
|
1532
|
+
b.write(Primitive.String.write(this.traceId));
|
|
1478
1533
|
}
|
|
1479
1534
|
return b.buffer;
|
|
1480
1535
|
}
|
|
@@ -1485,41 +1540,41 @@ export class TonConnectGetPending extends TLObject {
|
|
|
1485
1540
|
sessionId;
|
|
1486
1541
|
constructor(params) {
|
|
1487
1542
|
super();
|
|
1488
|
-
this.classType =
|
|
1489
|
-
this.className =
|
|
1543
|
+
this.classType = 'functions';
|
|
1544
|
+
this.className = 'wallet.TonConnectGetPending';
|
|
1490
1545
|
this.constructorId = 0x11aee065;
|
|
1491
1546
|
this.subclassOfId = 0x81ebfc36;
|
|
1492
|
-
this._slots = [
|
|
1547
|
+
this._slots = ['dappClientId', 'sessionId'];
|
|
1493
1548
|
this.dappClientId = params.dappClientId;
|
|
1494
1549
|
this.sessionId = params.sessionId;
|
|
1495
1550
|
}
|
|
1496
1551
|
/**
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1552
|
+
* Generate the TLObject from buffer.
|
|
1553
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1554
|
+
*/
|
|
1500
1555
|
static async read(_data, ..._args) {
|
|
1501
1556
|
// @ts-ignore
|
|
1502
1557
|
let flags = await Primitive.Int.read(_data);
|
|
1503
|
-
let dappClientId =
|
|
1504
|
-
let sessionId =
|
|
1505
|
-
return new TonConnectGetPending({
|
|
1558
|
+
let dappClientId = flags & (1 << 0) ? await Primitive.String.read(_data) : undefined;
|
|
1559
|
+
let sessionId = flags & (1 << 1) ? await Primitive.Long.read(_data) : undefined;
|
|
1560
|
+
return new TonConnectGetPending({ dappClientId: dappClientId, sessionId: sessionId });
|
|
1506
1561
|
}
|
|
1507
1562
|
/**
|
|
1508
|
-
|
|
1509
|
-
|
|
1563
|
+
* Generate buffer from TLObject.
|
|
1564
|
+
*/
|
|
1510
1565
|
write() {
|
|
1511
1566
|
const b = new BytesIO();
|
|
1512
1567
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1513
1568
|
// @ts-ignore
|
|
1514
1569
|
let flags = 0;
|
|
1515
|
-
flags |= this.dappClientId !== undefined ?
|
|
1516
|
-
flags |= this.sessionId !== undefined ?
|
|
1517
|
-
b.write(
|
|
1570
|
+
flags |= this.dappClientId !== undefined ? 1 << 0 : 0;
|
|
1571
|
+
flags |= this.sessionId !== undefined ? 1 << 1 : 0;
|
|
1572
|
+
b.write(Primitive.Int.write(flags));
|
|
1518
1573
|
if (this.dappClientId !== undefined) {
|
|
1519
|
-
b.write(
|
|
1574
|
+
b.write(Primitive.String.write(this.dappClientId));
|
|
1520
1575
|
}
|
|
1521
1576
|
if (this.sessionId !== undefined) {
|
|
1522
|
-
b.write(
|
|
1577
|
+
b.write(Primitive.Long.write(this.sessionId));
|
|
1523
1578
|
}
|
|
1524
1579
|
return b.buffer;
|
|
1525
1580
|
}
|
|
@@ -1533,11 +1588,11 @@ export class TonConnectClaimRequest extends TLObject {
|
|
|
1533
1588
|
challengeAnswer;
|
|
1534
1589
|
constructor(params) {
|
|
1535
1590
|
super();
|
|
1536
|
-
this.classType =
|
|
1537
|
-
this.className =
|
|
1591
|
+
this.classType = 'functions';
|
|
1592
|
+
this.className = 'wallet.TonConnectClaimRequest';
|
|
1538
1593
|
this.constructorId = 0x66b57b41;
|
|
1539
1594
|
this.subclassOfId = 0xf5b399ac;
|
|
1540
|
-
this._slots = [
|
|
1595
|
+
this._slots = ['declined', 'sessionId', 'msgId', 'appRequestId', 'challengeAnswer'];
|
|
1541
1596
|
this.declined = params.declined;
|
|
1542
1597
|
this.sessionId = params.sessionId;
|
|
1543
1598
|
this.msgId = params.msgId;
|
|
@@ -1545,41 +1600,47 @@ export class TonConnectClaimRequest extends TLObject {
|
|
|
1545
1600
|
this.challengeAnswer = params.challengeAnswer;
|
|
1546
1601
|
}
|
|
1547
1602
|
/**
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1603
|
+
* Generate the TLObject from buffer.
|
|
1604
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1605
|
+
*/
|
|
1551
1606
|
static async read(_data, ..._args) {
|
|
1552
1607
|
// @ts-ignore
|
|
1553
1608
|
let flags = await Primitive.Int.read(_data);
|
|
1554
|
-
let declined =
|
|
1609
|
+
let declined = flags & (1 << 1) ? true : false;
|
|
1555
1610
|
let sessionId = await Primitive.Long.read(_data);
|
|
1556
1611
|
let msgId = await Primitive.Int.read(_data);
|
|
1557
1612
|
let appRequestId = await Primitive.String.read(_data);
|
|
1558
|
-
let challengeAnswer =
|
|
1559
|
-
return new TonConnectClaimRequest({
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1613
|
+
let challengeAnswer = flags & (1 << 0) ? await Primitive.Bytes.read(_data) : undefined;
|
|
1614
|
+
return new TonConnectClaimRequest({
|
|
1615
|
+
declined: declined,
|
|
1616
|
+
sessionId: sessionId,
|
|
1617
|
+
msgId: msgId,
|
|
1618
|
+
appRequestId: appRequestId,
|
|
1619
|
+
challengeAnswer: challengeAnswer,
|
|
1620
|
+
});
|
|
1621
|
+
}
|
|
1622
|
+
/**
|
|
1623
|
+
* Generate buffer from TLObject.
|
|
1624
|
+
*/
|
|
1564
1625
|
write() {
|
|
1565
1626
|
const b = new BytesIO();
|
|
1566
1627
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1567
1628
|
// @ts-ignore
|
|
1568
1629
|
let flags = 0;
|
|
1569
|
-
flags |= this.declined ?
|
|
1570
|
-
flags |= this.challengeAnswer !== undefined ?
|
|
1571
|
-
b.write(
|
|
1630
|
+
flags |= this.declined ? 1 << 1 : 0;
|
|
1631
|
+
flags |= this.challengeAnswer !== undefined ? 1 << 0 : 0;
|
|
1632
|
+
b.write(Primitive.Int.write(flags));
|
|
1572
1633
|
if (this.sessionId !== undefined) {
|
|
1573
|
-
b.write(
|
|
1634
|
+
b.write(Primitive.Long.write(this.sessionId));
|
|
1574
1635
|
}
|
|
1575
1636
|
if (this.msgId !== undefined) {
|
|
1576
|
-
b.write(
|
|
1637
|
+
b.write(Primitive.Int.write(this.msgId));
|
|
1577
1638
|
}
|
|
1578
1639
|
if (this.appRequestId !== undefined) {
|
|
1579
|
-
b.write(
|
|
1640
|
+
b.write(Primitive.String.write(this.appRequestId));
|
|
1580
1641
|
}
|
|
1581
1642
|
if (this.challengeAnswer !== undefined) {
|
|
1582
|
-
b.write(
|
|
1643
|
+
b.write(Primitive.Bytes.write(this.challengeAnswer));
|
|
1583
1644
|
}
|
|
1584
1645
|
return b.buffer;
|
|
1585
1646
|
}
|
|
@@ -1592,50 +1653,55 @@ export class TonConnectSubmitResponse extends TLObject {
|
|
|
1592
1653
|
traceId;
|
|
1593
1654
|
constructor(params) {
|
|
1594
1655
|
super();
|
|
1595
|
-
this.classType =
|
|
1596
|
-
this.className =
|
|
1656
|
+
this.classType = 'functions';
|
|
1657
|
+
this.className = 'wallet.TonConnectSubmitResponse';
|
|
1597
1658
|
this.constructorId = 0xfac67d3c;
|
|
1598
1659
|
this.subclassOfId = 0xf5b399ac;
|
|
1599
|
-
this._slots = [
|
|
1660
|
+
this._slots = ['sessionId', 'msgId', 'body', 'traceId'];
|
|
1600
1661
|
this.sessionId = params.sessionId;
|
|
1601
1662
|
this.msgId = params.msgId;
|
|
1602
1663
|
this.body = params.body;
|
|
1603
1664
|
this.traceId = params.traceId;
|
|
1604
1665
|
}
|
|
1605
1666
|
/**
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1667
|
+
* Generate the TLObject from buffer.
|
|
1668
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1669
|
+
*/
|
|
1609
1670
|
static async read(_data, ..._args) {
|
|
1610
1671
|
// @ts-ignore
|
|
1611
1672
|
let flags = await Primitive.Int.read(_data);
|
|
1612
1673
|
let sessionId = await Primitive.Long.read(_data);
|
|
1613
1674
|
let msgId = await Primitive.Int.read(_data);
|
|
1614
1675
|
let body = await Primitive.Bytes.read(_data);
|
|
1615
|
-
let traceId =
|
|
1616
|
-
return new TonConnectSubmitResponse({
|
|
1676
|
+
let traceId = flags & (1 << 0) ? await Primitive.String.read(_data) : undefined;
|
|
1677
|
+
return new TonConnectSubmitResponse({
|
|
1678
|
+
sessionId: sessionId,
|
|
1679
|
+
msgId: msgId,
|
|
1680
|
+
body: body,
|
|
1681
|
+
traceId: traceId,
|
|
1682
|
+
});
|
|
1617
1683
|
}
|
|
1618
1684
|
/**
|
|
1619
|
-
|
|
1620
|
-
|
|
1685
|
+
* Generate buffer from TLObject.
|
|
1686
|
+
*/
|
|
1621
1687
|
write() {
|
|
1622
1688
|
const b = new BytesIO();
|
|
1623
1689
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1624
1690
|
// @ts-ignore
|
|
1625
1691
|
let flags = 0;
|
|
1626
|
-
flags |= this.traceId !== undefined ?
|
|
1627
|
-
b.write(
|
|
1692
|
+
flags |= this.traceId !== undefined ? 1 << 0 : 0;
|
|
1693
|
+
b.write(Primitive.Int.write(flags));
|
|
1628
1694
|
if (this.sessionId !== undefined) {
|
|
1629
|
-
b.write(
|
|
1695
|
+
b.write(Primitive.Long.write(this.sessionId));
|
|
1630
1696
|
}
|
|
1631
1697
|
if (this.msgId !== undefined) {
|
|
1632
|
-
b.write(
|
|
1698
|
+
b.write(Primitive.Int.write(this.msgId));
|
|
1633
1699
|
}
|
|
1634
1700
|
if (this.body !== undefined) {
|
|
1635
|
-
b.write(
|
|
1701
|
+
b.write(Primitive.Bytes.write(this.body));
|
|
1636
1702
|
}
|
|
1637
1703
|
if (this.traceId !== undefined) {
|
|
1638
|
-
b.write(
|
|
1704
|
+
b.write(Primitive.String.write(this.traceId));
|
|
1639
1705
|
}
|
|
1640
1706
|
return b.buffer;
|
|
1641
1707
|
}
|
|
@@ -1645,31 +1711,31 @@ export class TonConnectNextEventId extends TLObject {
|
|
|
1645
1711
|
sessionId;
|
|
1646
1712
|
constructor(params) {
|
|
1647
1713
|
super();
|
|
1648
|
-
this.classType =
|
|
1649
|
-
this.className =
|
|
1714
|
+
this.classType = 'functions';
|
|
1715
|
+
this.className = 'wallet.TonConnectNextEventId';
|
|
1650
1716
|
this.constructorId = 0x775d7244;
|
|
1651
1717
|
this.subclassOfId = 0x2615ce73;
|
|
1652
|
-
this._slots = [
|
|
1718
|
+
this._slots = ['sessionId'];
|
|
1653
1719
|
this.sessionId = params.sessionId;
|
|
1654
1720
|
}
|
|
1655
1721
|
/**
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1722
|
+
* Generate the TLObject from buffer.
|
|
1723
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1724
|
+
*/
|
|
1659
1725
|
static async read(_data, ..._args) {
|
|
1660
1726
|
// no flags
|
|
1661
1727
|
let sessionId = await Primitive.Long.read(_data);
|
|
1662
|
-
return new TonConnectNextEventId({
|
|
1728
|
+
return new TonConnectNextEventId({ sessionId: sessionId });
|
|
1663
1729
|
}
|
|
1664
1730
|
/**
|
|
1665
|
-
|
|
1666
|
-
|
|
1731
|
+
* Generate buffer from TLObject.
|
|
1732
|
+
*/
|
|
1667
1733
|
write() {
|
|
1668
1734
|
const b = new BytesIO();
|
|
1669
1735
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1670
1736
|
// no flags
|
|
1671
1737
|
if (this.sessionId !== undefined) {
|
|
1672
|
-
b.write(
|
|
1738
|
+
b.write(Primitive.Long.write(this.sessionId));
|
|
1673
1739
|
}
|
|
1674
1740
|
return b.buffer;
|
|
1675
1741
|
}
|
|
@@ -1680,40 +1746,40 @@ export class TonConnectCloseSession extends TLObject {
|
|
|
1680
1746
|
body;
|
|
1681
1747
|
constructor(params) {
|
|
1682
1748
|
super();
|
|
1683
|
-
this.classType =
|
|
1684
|
-
this.className =
|
|
1749
|
+
this.classType = 'functions';
|
|
1750
|
+
this.className = 'wallet.TonConnectCloseSession';
|
|
1685
1751
|
this.constructorId = 0xd63f61ce;
|
|
1686
1752
|
this.subclassOfId = 0xf5b399ac;
|
|
1687
|
-
this._slots = [
|
|
1753
|
+
this._slots = ['sessionId', 'body'];
|
|
1688
1754
|
this.sessionId = params.sessionId;
|
|
1689
1755
|
this.body = params.body;
|
|
1690
1756
|
}
|
|
1691
1757
|
/**
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1758
|
+
* Generate the TLObject from buffer.
|
|
1759
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1760
|
+
*/
|
|
1695
1761
|
static async read(_data, ..._args) {
|
|
1696
1762
|
// @ts-ignore
|
|
1697
1763
|
let flags = await Primitive.Int.read(_data);
|
|
1698
1764
|
let sessionId = await Primitive.Long.read(_data);
|
|
1699
|
-
let body =
|
|
1700
|
-
return new TonConnectCloseSession({
|
|
1765
|
+
let body = flags & (1 << 0) ? await Primitive.Bytes.read(_data) : undefined;
|
|
1766
|
+
return new TonConnectCloseSession({ sessionId: sessionId, body: body });
|
|
1701
1767
|
}
|
|
1702
1768
|
/**
|
|
1703
|
-
|
|
1704
|
-
|
|
1769
|
+
* Generate buffer from TLObject.
|
|
1770
|
+
*/
|
|
1705
1771
|
write() {
|
|
1706
1772
|
const b = new BytesIO();
|
|
1707
1773
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1708
1774
|
// @ts-ignore
|
|
1709
1775
|
let flags = 0;
|
|
1710
|
-
flags |= this.body !== undefined ?
|
|
1711
|
-
b.write(
|
|
1776
|
+
flags |= this.body !== undefined ? 1 << 0 : 0;
|
|
1777
|
+
b.write(Primitive.Int.write(flags));
|
|
1712
1778
|
if (this.sessionId !== undefined) {
|
|
1713
|
-
b.write(
|
|
1779
|
+
b.write(Primitive.Long.write(this.sessionId));
|
|
1714
1780
|
}
|
|
1715
1781
|
if (this.body !== undefined) {
|
|
1716
|
-
b.write(
|
|
1782
|
+
b.write(Primitive.Bytes.write(this.body));
|
|
1717
1783
|
}
|
|
1718
1784
|
return b.buffer;
|
|
1719
1785
|
}
|
|
@@ -1722,23 +1788,23 @@ export class TonConnectGetSessions extends TLObject {
|
|
|
1722
1788
|
__response__;
|
|
1723
1789
|
constructor() {
|
|
1724
1790
|
super();
|
|
1725
|
-
this.classType =
|
|
1726
|
-
this.className =
|
|
1791
|
+
this.classType = 'functions';
|
|
1792
|
+
this.className = 'wallet.TonConnectGetSessions';
|
|
1727
1793
|
this.constructorId = 0xa7ffb56e;
|
|
1728
1794
|
this.subclassOfId = 0xe7323d24;
|
|
1729
1795
|
this._slots = [];
|
|
1730
1796
|
}
|
|
1731
1797
|
/**
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1798
|
+
* Generate the TLObject from buffer.
|
|
1799
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1800
|
+
*/
|
|
1735
1801
|
static async read(_data, ..._args) {
|
|
1736
1802
|
// no flags
|
|
1737
1803
|
return new TonConnectGetSessions();
|
|
1738
1804
|
}
|
|
1739
1805
|
/**
|
|
1740
|
-
|
|
1741
|
-
|
|
1806
|
+
* Generate buffer from TLObject.
|
|
1807
|
+
*/
|
|
1742
1808
|
write() {
|
|
1743
1809
|
const b = new BytesIO();
|
|
1744
1810
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1752,40 +1818,40 @@ export class SetCardStickers extends TLObject {
|
|
|
1752
1818
|
bgNftAddress;
|
|
1753
1819
|
constructor(params) {
|
|
1754
1820
|
super();
|
|
1755
|
-
this.classType =
|
|
1756
|
-
this.className =
|
|
1821
|
+
this.classType = 'functions';
|
|
1822
|
+
this.className = 'wallet.SetCardStickers';
|
|
1757
1823
|
this.constructorId = 0x68509ac;
|
|
1758
1824
|
this.subclassOfId = 0x1f060b97;
|
|
1759
|
-
this._slots = [
|
|
1825
|
+
this._slots = ['stickers', 'bgNftAddress'];
|
|
1760
1826
|
this.stickers = params.stickers;
|
|
1761
1827
|
this.bgNftAddress = params.bgNftAddress;
|
|
1762
1828
|
}
|
|
1763
1829
|
/**
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1830
|
+
* Generate the TLObject from buffer.
|
|
1831
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1832
|
+
*/
|
|
1767
1833
|
static async read(_data, ..._args) {
|
|
1768
1834
|
// @ts-ignore
|
|
1769
1835
|
let flags = await Primitive.Int.read(_data);
|
|
1770
1836
|
let stickers = await TLObject.read(_data);
|
|
1771
|
-
let bgNftAddress =
|
|
1772
|
-
return new SetCardStickers({
|
|
1837
|
+
let bgNftAddress = flags & (1 << 0) ? await Primitive.String.read(_data) : undefined;
|
|
1838
|
+
return new SetCardStickers({ stickers: stickers, bgNftAddress: bgNftAddress });
|
|
1773
1839
|
}
|
|
1774
1840
|
/**
|
|
1775
|
-
|
|
1776
|
-
|
|
1841
|
+
* Generate buffer from TLObject.
|
|
1842
|
+
*/
|
|
1777
1843
|
write() {
|
|
1778
1844
|
const b = new BytesIO();
|
|
1779
1845
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1780
1846
|
// @ts-ignore
|
|
1781
1847
|
let flags = 0;
|
|
1782
|
-
flags |= this.bgNftAddress !== undefined ?
|
|
1783
|
-
b.write(
|
|
1848
|
+
flags |= this.bgNftAddress !== undefined ? 1 << 0 : 0;
|
|
1849
|
+
b.write(Primitive.Int.write(flags));
|
|
1784
1850
|
if (this.stickers) {
|
|
1785
|
-
b.write(
|
|
1851
|
+
b.write(Primitive.Vector.write(this.stickers));
|
|
1786
1852
|
}
|
|
1787
1853
|
if (this.bgNftAddress !== undefined) {
|
|
1788
|
-
b.write(
|
|
1854
|
+
b.write(Primitive.String.write(this.bgNftAddress));
|
|
1789
1855
|
}
|
|
1790
1856
|
return b.buffer;
|
|
1791
1857
|
}
|
|
@@ -1794,23 +1860,23 @@ export class GetStakingInfo extends TLObject {
|
|
|
1794
1860
|
__response__;
|
|
1795
1861
|
constructor() {
|
|
1796
1862
|
super();
|
|
1797
|
-
this.classType =
|
|
1798
|
-
this.className =
|
|
1863
|
+
this.classType = 'functions';
|
|
1864
|
+
this.className = 'wallet.GetStakingInfo';
|
|
1799
1865
|
this.constructorId = 0xa75d90fb;
|
|
1800
1866
|
this.subclassOfId = 0x34dfba2d;
|
|
1801
1867
|
this._slots = [];
|
|
1802
1868
|
}
|
|
1803
1869
|
/**
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1870
|
+
* Generate the TLObject from buffer.
|
|
1871
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1872
|
+
*/
|
|
1807
1873
|
static async read(_data, ..._args) {
|
|
1808
1874
|
// no flags
|
|
1809
1875
|
return new GetStakingInfo();
|
|
1810
1876
|
}
|
|
1811
1877
|
/**
|
|
1812
|
-
|
|
1813
|
-
|
|
1878
|
+
* Generate buffer from TLObject.
|
|
1879
|
+
*/
|
|
1814
1880
|
write() {
|
|
1815
1881
|
const b = new BytesIO();
|
|
1816
1882
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
@@ -1824,37 +1890,37 @@ export class Stake extends TLObject {
|
|
|
1824
1890
|
amount;
|
|
1825
1891
|
constructor(params) {
|
|
1826
1892
|
super();
|
|
1827
|
-
this.classType =
|
|
1828
|
-
this.className =
|
|
1893
|
+
this.classType = 'functions';
|
|
1894
|
+
this.className = 'wallet.Stake';
|
|
1829
1895
|
this.constructorId = 0x321d6b4f;
|
|
1830
1896
|
this.subclassOfId = 0xbdd546e0;
|
|
1831
|
-
this._slots = [
|
|
1897
|
+
this._slots = ['stakeAll', 'amount'];
|
|
1832
1898
|
this.stakeAll = params.stakeAll;
|
|
1833
1899
|
this.amount = params.amount;
|
|
1834
1900
|
}
|
|
1835
1901
|
/**
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1902
|
+
* Generate the TLObject from buffer.
|
|
1903
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1904
|
+
*/
|
|
1839
1905
|
static async read(_data, ..._args) {
|
|
1840
1906
|
// @ts-ignore
|
|
1841
1907
|
let flags = await Primitive.Int.read(_data);
|
|
1842
|
-
let stakeAll =
|
|
1908
|
+
let stakeAll = flags & (1 << 0) ? true : false;
|
|
1843
1909
|
let amount = await Primitive.Long.read(_data);
|
|
1844
|
-
return new Stake({
|
|
1910
|
+
return new Stake({ stakeAll: stakeAll, amount: amount });
|
|
1845
1911
|
}
|
|
1846
1912
|
/**
|
|
1847
|
-
|
|
1848
|
-
|
|
1913
|
+
* Generate buffer from TLObject.
|
|
1914
|
+
*/
|
|
1849
1915
|
write() {
|
|
1850
1916
|
const b = new BytesIO();
|
|
1851
1917
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1852
1918
|
// @ts-ignore
|
|
1853
1919
|
let flags = 0;
|
|
1854
|
-
flags |= this.stakeAll ?
|
|
1855
|
-
b.write(
|
|
1920
|
+
flags |= this.stakeAll ? 1 << 0 : 0;
|
|
1921
|
+
b.write(Primitive.Int.write(flags));
|
|
1856
1922
|
if (this.amount !== undefined) {
|
|
1857
|
-
b.write(
|
|
1923
|
+
b.write(Primitive.Long.write(this.amount));
|
|
1858
1924
|
}
|
|
1859
1925
|
return b.buffer;
|
|
1860
1926
|
}
|
|
@@ -1865,37 +1931,37 @@ export class Unstake extends TLObject {
|
|
|
1865
1931
|
amount;
|
|
1866
1932
|
constructor(params) {
|
|
1867
1933
|
super();
|
|
1868
|
-
this.classType =
|
|
1869
|
-
this.className =
|
|
1934
|
+
this.classType = 'functions';
|
|
1935
|
+
this.className = 'wallet.Unstake';
|
|
1870
1936
|
this.constructorId = 0xf46f432c;
|
|
1871
1937
|
this.subclassOfId = 0xbdd546e0;
|
|
1872
|
-
this._slots = [
|
|
1938
|
+
this._slots = ['withdrawAll', 'amount'];
|
|
1873
1939
|
this.withdrawAll = params.withdrawAll;
|
|
1874
1940
|
this.amount = params.amount;
|
|
1875
1941
|
}
|
|
1876
1942
|
/**
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1943
|
+
* Generate the TLObject from buffer.
|
|
1944
|
+
* @param {Object} _data - BytesIO class from TLObject will be convert to TLObject class.
|
|
1945
|
+
*/
|
|
1880
1946
|
static async read(_data, ..._args) {
|
|
1881
1947
|
// @ts-ignore
|
|
1882
1948
|
let flags = await Primitive.Int.read(_data);
|
|
1883
|
-
let withdrawAll =
|
|
1949
|
+
let withdrawAll = flags & (1 << 0) ? true : false;
|
|
1884
1950
|
let amount = await Primitive.Long.read(_data);
|
|
1885
|
-
return new Unstake({
|
|
1951
|
+
return new Unstake({ withdrawAll: withdrawAll, amount: amount });
|
|
1886
1952
|
}
|
|
1887
1953
|
/**
|
|
1888
|
-
|
|
1889
|
-
|
|
1954
|
+
* Generate buffer from TLObject.
|
|
1955
|
+
*/
|
|
1890
1956
|
write() {
|
|
1891
1957
|
const b = new BytesIO();
|
|
1892
1958
|
b.write(Primitive.Int.write(this.constructorId, false));
|
|
1893
1959
|
// @ts-ignore
|
|
1894
1960
|
let flags = 0;
|
|
1895
|
-
flags |= this.withdrawAll ?
|
|
1896
|
-
b.write(
|
|
1961
|
+
flags |= this.withdrawAll ? 1 << 0 : 0;
|
|
1962
|
+
b.write(Primitive.Int.write(flags));
|
|
1897
1963
|
if (this.amount !== undefined) {
|
|
1898
|
-
b.write(
|
|
1964
|
+
b.write(Primitive.Long.write(this.amount));
|
|
1899
1965
|
}
|
|
1900
1966
|
return b.buffer;
|
|
1901
1967
|
}
|