Class: TonClient::Boc

Inherits:
Object show all
Includes:
CommonInstanceHelpers
Defined in:
lib/ton-client-ruby/Client/Boc.rb

Constant Summary collapse

MODULE =
self.to_s.downcase.gsub(/^(.+::|)(\w+)$/, '\2').freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CommonInstanceHelpers

#base64?, #encode_to_base64, #full_method_name

Constructor Details

#initialize(context: Context.new, core: TonClient::TonBinding) ⇒ Boc

Returns a new instance of Boc.



9
10
11
12
# File 'lib/ton-client-ruby/Client/Boc.rb', line 9

def initialize(context: Context.new, core: TonClient::TonBinding)
  @context = context
  @core = core
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



6
7
8
# File 'lib/ton-client-ruby/Client/Boc.rb', line 6

def context
  @context
end

#coreObject (readonly)

Returns the value of attribute core.



6
7
8
# File 'lib/ton-client-ruby/Client/Boc.rb', line 6

def core
  @core
end

Instance Method Details

#cache_get(payload, &block) ⇒ Object

INPUT: ParamsOfBocCacheGet boc_ref: String - # # Reference to the cached BOC RESPONSE: ResultOfBocCacheGet boc: String<Optional> - # # BOC encoded as base64.



84
85
86
# File 'lib/ton-client-ruby/Client/Boc.rb', line 84

def cache_get(payload, &block)
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
end

#cache_set(payload, &block) ⇒ Object

INPUT: ParamsOfBocCacheSet boc: String - # # BOC encoded as base64 or BOC reference cache_type: BocCacheType - # # Cache type RESPONSE: ResultOfBocCacheSet boc_ref: String - # # Reference to the cached BOC



93
94
95
# File 'lib/ton-client-ruby/Client/Boc.rb', line 93

def cache_set(payload, &block)
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
end

#cache_unpin(payload, &block) ⇒ Object

INPUT: ParamsOfBocCacheUnpin pin: String - # # Pinned name boc_ref: String<Optional> - # # Reference to the cached BOC. # # If it is provided then only referenced BOC is unpinned



100
101
102
# File 'lib/ton-client-ruby/Client/Boc.rb', line 100

def cache_unpin(payload, &block)
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
end

#encode_boc(payload, &block) ⇒ Object

INPUT: ParamsOfEncodeBoc builder: Array - # # Cell builder operations. boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided. RESPONSE: ResultOfEncodeBoc boc: String - # # Encoded cell BOC or BOC cache key.



109
110
111
# File 'lib/ton-client-ruby/Client/Boc.rb', line 109

def encode_boc(payload, &block)
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
end

#get_blockchain_config(payload, &block) ⇒ Object

INPUT: ParamsOfGetBlockchainConfig block_boc: String - # # Key block BOC or zerostate BOC encoded as base64 RESPONSE: ResultOfGetBlockchainConfig config_boc: String - # # Blockchain config BOC encoded as base64



60
61
62
# File 'lib/ton-client-ruby/Client/Boc.rb', line 60

def get_blockchain_config(payload, &block)
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
end

#get_boc_hash(payload, &block) ⇒ Object

INPUT: ParamsOfGetBocHash boc: String - # # BOC encoded as base64 RESPONSE: ResultOfGetBocHash hash: String - # # BOC root hash encoded with hex



68
69
70
# File 'lib/ton-client-ruby/Client/Boc.rb', line 68

def get_boc_hash(payload, &block)
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
end

#get_code_from_tvc(payload, &block) ⇒ Object

INPUT: ParamsOfGetCodeFromTvc tvc: String - # # Contract TVC image encoded as base64 RESPONSE: ResultOfGetCodeFromTvc code: String - # # Contract code encoded as base64



76
77
78
# File 'lib/ton-client-ruby/Client/Boc.rb', line 76

def get_code_from_tvc(payload, &block)
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
end

#parse_account(payload, &block) ⇒ Object

INPUT: ParamsOfParse boc: String - # # BOC encoded as base64 RESPONSE: ResultOfParse parsed: Value - # # JSON containing parsed BOC



34
35
36
# File 'lib/ton-client-ruby/Client/Boc.rb', line 34

def (payload, &block)
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
end

#parse_block(payload, &block) ⇒ Object

INPUT: ParamsOfParse boc: String - # # BOC encoded as base64 RESPONSE: ResultOfParse parsed: Value - # # JSON containing parsed BOC



42
43
44
# File 'lib/ton-client-ruby/Client/Boc.rb', line 42

def parse_block(payload, &block)
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
end

#parse_message(payload, &block) ⇒ Object

INPUT: ParamsOfParse boc: String - # # BOC encoded as base64 RESPONSE: ResultOfParse parsed: Value - # # JSON containing parsed BOC



18
19
20
# File 'lib/ton-client-ruby/Client/Boc.rb', line 18

def parse_message(payload, &block)
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
end

#parse_shardstate(payload, &block) ⇒ Object

INPUT: ParamsOfParseShardstate boc: String - # # BOC encoded as base64 id: String - # # Shardstate identificator workchain_id: Number - # # Workchain shardstate belongs to RESPONSE: ResultOfParse parsed: Value - # # JSON containing parsed BOC



52
53
54
# File 'lib/ton-client-ruby/Client/Boc.rb', line 52

def parse_shardstate(payload, &block)
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
end

#parse_transaction(payload, &block) ⇒ Object

INPUT: ParamsOfParse boc: String - # # BOC encoded as base64 RESPONSE: ResultOfParse parsed: Value - # # JSON containing parsed BOC



26
27
28
# File 'lib/ton-client-ruby/Client/Boc.rb', line 26

def parse_transaction(payload, &block)
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
end