Skip to content

Commit 9bdac8d

Browse files
author
Dmitrii Korchagin
committed
Support getLibraries
1 parent 480b758 commit 9bdac8d

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

liteapi/src/tl/common.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,11 @@ pub struct TransactionId {
190190
#[tl(flags_bit = "mode.2")]
191191
pub hash: Option<Int256>,
192192
}
193+
194+
/// liteServer.libraryEntry hash:int256 data:bytes = liteServer.LibraryEntry;
195+
#[derive(TlRead, TlWrite, Derivative)]
196+
#[derivative(Debug, Clone, PartialEq)]
197+
pub struct LibraryEntry {
198+
pub hash: Int256,
199+
pub data: Vec<u8>,
200+
}

liteapi/src/tl/request.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,12 @@ pub struct GetValidatorStats {
256256
pub modified_after: Option<u32>,
257257
}
258258

259+
#[derive(TlRead, TlWrite, Derivative)]
260+
#[derivative(Debug, Clone, PartialEq)]
261+
pub struct GetLibraries {
262+
pub library_list: Vec<Int256>,
263+
}
264+
259265
#[derive(TlRead, TlWrite, Derivative)]
260266
#[derivative(Debug, Clone, PartialEq)]
261267
#[tl(boxed)]
@@ -339,4 +345,8 @@ pub enum Request {
339345
/// liteServer.getValidatorStats#091a58bc mode:# id:tonNode.blockIdExt limit:int start_after:mode.0?int256 modified_after:mode.2?int = liteServer.ValidatorStats;
340346
#[tl(id = 0xe7253699)]
341347
GetValidatorStats(GetValidatorStats),
348+
349+
/// liteServer.getLibraries library_list:(vector int256) = liteServer.LibraryResult;
350+
#[tl(id = 0xd122b662)]
351+
GetLibraries(GetLibraries),
342352
}

liteapi/src/tl/response.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@ pub struct ValidatorStats {
225225
pub data_proof: Vec<u8>,
226226
}
227227

228+
#[derive(TlRead, TlWrite, Derivative)]
229+
#[derivative(Debug, Clone, PartialEq)]
230+
pub struct LibraryResult {
231+
pub result: Vec<LibraryEntry>,
232+
}
233+
228234
#[derive(TlRead, TlWrite, Derivative)]
229235
#[derivative(Debug, Clone, PartialEq)]
230236
pub struct Error {
@@ -313,6 +319,10 @@ pub enum Response {
313319
#[tl(id = 0xb9f796d8)]
314320
ValidatorStats(ValidatorStats),
315321

322+
/// liteServer.libraryResult result:(vector liteServer.libraryEntry) = liteServer.LibraryResult;
323+
#[tl(id = 0x117ab96b)]
324+
LibraryResult(LibraryResult),
325+
316326
/// liteServer.error code:int message:string = liteServer.Error;
317327
#[tl(id = 0xbba9e148)]
318328
Error(Error),

0 commit comments

Comments
 (0)