Module: TonSdk::Boc

Defined in:
lib/ton_sdk_client/boc.rb

Defined Under Namespace

Classes: BocCacheType

Constant Summary collapse

ParamsOfParse =

types

KwStruct.new(:boc)
ResultOfParse =
KwStruct.new(:parsed)
ParamsOfParseShardstate =
KwStruct.new(:boc, :id, :workchain_id)
ParamsOfGetBlockchainConfig =
KwStruct.new(:block_boc)
ResultOfGetBlockchainConfig =
KwStruct.new(:config_boc)
ParamsOfGetBocHash =
KwStruct.new(:boc)
ResultOfGetBocHash =
KwStruct.new(:hash)
ParamsOfGetBocDepth =
KwStruct.new(:boc)
ResultOfGetBocDepth =
KwStruct.new(:depth)
ParamsOfGetCodeFromTvc =
KwStruct.new(:tvc)
ResultOfGetCodeFromTvc =
KwStruct.new(:code)
ParamsOfBocCacheGet =
KwStruct.new(:boc_ref)
ResultOfBocCacheGet =
KwStruct.new(:boc)
ParamsOfBocCacheSet =
KwStruct.new(:boc, :cache_type) do
  def to_h
    {
      boc: boc,
      cache_type: cache_type.to_h
    }
  end
end
ResultOfBocCacheSet =
KwStruct.new(:boc_ref)
ParamsOfBocCacheUnpin =
KwStruct.new(:pin, :boc_ref)
ParamsOfEncodeBoc =
KwStruct.new(:builder, :boc_cache)
ResultOfEncodeBoc =
KwStruct.new(:boc)
ParamsOfGetCodeSalt =
KwStruct.new(:code, :boc_cache) do
  def to_h
    {
      code: code,
      boc_cache: boc_cache&.to_h
    }
  end
end
ResultOfGetCodeSalt =
KwStruct.new(:salt)
ParamsOfSetCodeSalt =
KwStruct.new(:code, :salt, :boc_cache) do
  def to_h
    {
      code: code,
      salt: salt,
      boc_cache: boc_cache&.to_h
    }
  end
end
ResultOfSetCodeSalt =
KwStruct.new(:code)
ParamsOfDecodeTvc =
KwStruct.new(:tvc, :boc_cache) do
  def to_h
    {
      tvc: tvc,
      boc_cache: boc_cache&.to_h
    }
  end
end
ResultOfDecodeTvc =
KwStruct.new(
  :code,
  :code_hash,
  :code_depth,
  :data,
  :data_hash,
  :data_depth,
  :library,
  :tick,
  :tock,
  :split_depth,
  :compiler_version
)
ParamsOfEncodeTvc =
KwStruct.new(
  :code,
  :data,
  :library,
  :tick,
  :tock,
  :split_depth,
  :boc_cache
) do
  def to_h
    {
      code: code,
      data: data,
      library: library,
      tick: tick,
      tock: tock,
      split_depth: split_depth,
      boc_cache: boc_cache&.to_h
    }
  end
end
ResultOfEncodeTvc =
KwStruct.new(:tvc)
ParamsOfEncodeExternalInMessage =
KwStruct.new(:src, :dst, :init, :body, :boc_cache) do
  def to_h
    {
      src: src,
      dst: dst,
      init: init,
      body: body,
      boc_cache: boc_cache&.to_h
    }
  end
end
ResultOfEncodeExternalInMessage =
KwStruct.new(:message, :message_id)
ParamsOfGetCompilerVersion =
KwStruct.new(:code)
ResultOfGetCompilerVersion =
KwStruct.new(:version)

Class Method Summary collapse

Class Method Details

.cache_get(ctx, params) ⇒ Object



267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/ton_sdk_client/boc.rb', line 267

def self.cache_get(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.cache_get", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfBocCacheGet.new(
          boc: resp.result["boc"]
        )
      )
    else
      yield resp
    end
  end
end

.cache_set(ctx, params) ⇒ Object



281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/ton_sdk_client/boc.rb', line 281

def self.cache_set(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.cache_set", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfBocCacheSet.new(
          boc_ref: resp.result["boc_ref"]
        )
      )
    else
      yield resp
    end
  end
end

.cache_unpin(ctx, params) ⇒ Object



295
296
297
298
299
300
301
302
303
304
305
# File 'lib/ton_sdk_client/boc.rb', line 295

def self.cache_unpin(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.cache_unpin", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: nil
      )
    else
      yield resp
    end
  end
end

.decode_tvc(ctx, params) ⇒ Object



349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/ton_sdk_client/boc.rb', line 349

def self.decode_tvc(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.decode_tvc", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfDecodeTvc.new(
          code: resp.result["code"],
          code_depth: resp.result["code_depth"],
          code_hash: resp.result["code_hash"],
          data: resp.result["data"],
          data_depth: resp.result["data_depth"],
          data_hash: resp.result["data_hash"],
          library: resp.result["library"],
          tick: resp.result["tick"],
          tock: resp.result["tock"],
          split_depth: resp.result["split_depth"],
          compiler_version: resp.result["compiler_version"]
        )
      )
    else
      yield resp
    end
  end
end

.encode_boc(ctx, params) ⇒ Object



307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/ton_sdk_client/boc.rb', line 307

def self.encode_boc(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.encode_boc", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfEncodeBoc.new(
          boc: resp.result["boc"]
        )
      )
    else
      yield resp
    end
  end
end

.encode_external_in_message(ctx, params) ⇒ Object



387
388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/ton_sdk_client/boc.rb', line 387

def self.encode_external_in_message(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.encode_external_in_message", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfEncodeExternalInMessage.new(
          message: resp.result["message"],
          message_id: resp.result["message_id"]
        )
      )
    else
      yield resp
    end
  end
end

.encode_tvc(ctx, params) ⇒ Object



373
374
375
376
377
378
379
380
381
382
383
384
385
# File 'lib/ton_sdk_client/boc.rb', line 373

def self.encode_tvc(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.encode_tvc", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfEncodeTvc.new(
          tvc: resp.result["tvc"]
        )
      )
    else
      yield resp
    end
  end
end

.get_blockchain_config(ctx, params) ⇒ Object



227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/ton_sdk_client/boc.rb', line 227

def self.get_blockchain_config(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.get_blockchain_config", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfGetBlockchainConfig.new(
          config_boc: resp.result["config_boc"]
        )
      )
    else
      yield resp
    end
  end
end

.get_boc_depth(ctx, params) ⇒ Object



241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/ton_sdk_client/boc.rb', line 241

def self.get_boc_depth(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.get_boc_depth", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfGetBocDepth.new(
          depth: resp.result["depth"]
        )
      )
    else
      yield resp
    end
  end
end

.get_boc_hash(ctx, params) ⇒ Object



215
216
217
218
219
220
221
222
223
224
225
# File 'lib/ton_sdk_client/boc.rb', line 215

def self.get_boc_hash(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.get_boc_hash", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfGetBocHash.new(hash: resp.result["hash"])
      )
    else
      yield resp
    end
  end
end

.get_code_from_tvc(ctx, params) ⇒ Object



255
256
257
258
259
260
261
262
263
264
265
# File 'lib/ton_sdk_client/boc.rb', line 255

def self.get_code_from_tvc(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.get_code_from_tvc", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfGetCodeFromTvc.new(code: resp.result["code"])
      )
    else
      yield resp
    end
  end
end

.get_code_salt(ctx, params) ⇒ Object



321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/ton_sdk_client/boc.rb', line 321

def self.get_code_salt(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.get_code_salt", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfGetCodeSalt.new(
          salt: resp.result["salt"]
        )
      )
    else
      yield resp
    end
  end
end

.get_compiler_version(ctx, params) ⇒ Object



402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/ton_sdk_client/boc.rb', line 402

def self.get_compiler_version(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.get_compiler_version", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfGetCompilerVersion.new(
          version: resp.result["version"]
        )
      )
    else
      yield resp
    end
  end
end

.parse_account(ctx, params) ⇒ Object



179
180
181
182
183
184
185
186
187
188
189
# File 'lib/ton_sdk_client/boc.rb', line 179

def self.(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.parse_account", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfParse.new(parsed: resp.result["parsed"])
      )
    else
      yield resp
    end
  end
end

.parse_block(ctx, params) ⇒ Object



191
192
193
194
195
196
197
198
199
200
201
# File 'lib/ton_sdk_client/boc.rb', line 191

def self.parse_block(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.parse_block", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfParse.new(parsed: resp.result["parsed"])
      )
    else
      yield resp
    end
  end
end

.parse_message(ctx, params) ⇒ Object

functions



155
156
157
158
159
160
161
162
163
164
165
# File 'lib/ton_sdk_client/boc.rb', line 155

def self.parse_message(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.parse_message", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfParse.new(parsed: resp.result["parsed"])
      )
    else
      yield resp
    end
  end
end

.parse_shardstate(ctx, params) ⇒ Object



203
204
205
206
207
208
209
210
211
212
213
# File 'lib/ton_sdk_client/boc.rb', line 203

def self.parse_shardstate(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.parse_shardstate", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfParse.new(parsed: resp.result["parsed"])
      )
    else
      yield resp
    end
  end
end

.parse_transaction(ctx, params) ⇒ Object



167
168
169
170
171
172
173
174
175
176
177
# File 'lib/ton_sdk_client/boc.rb', line 167

def self.parse_transaction(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.parse_transaction", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfParse.new(parsed: resp.result["parsed"])
      )
    else
      yield resp
    end
  end
end

.set_code_salt(ctx, params) ⇒ Object



335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/ton_sdk_client/boc.rb', line 335

def self.set_code_salt(ctx, params)
  Interop::request_to_native_lib(ctx, "boc.set_code_salt", params) do |resp|
    if resp.success?
      yield NativeLibResponseResult.new(
        result: ResultOfSetCodeSalt.new(
          code: resp.result["code"]
        )
      )
    else
      yield resp
    end
  end
end