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

#decode_tvc(payload, &block) ⇒ Object

INPUT: ParamsOfDecodeTvc tvc: String - # # Contract TVC image BOC encoded as base64 or BOC handle boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided. RESPONSE: ResultOfDecodeTvc code: String<Optional> - # # Contract code BOC encoded as base64 or BOC handle data: String<Optional> - # # Contract data BOC encoded as base64 or BOC handle library: String<Optional> - # # Contract library BOC encoded as base64 or BOC handle tick: Boolean<Optional> - # # special.tick field. # # Specifies the contract ability to handle tick transactions tock: Boolean<Optional> - # # special.tock field. # # Specifies the contract ability to handle tock transactions split_depth: Number<Optional> - # # Is present and non-zero only in instances of large smart contracts



142
143
144
# File 'lib/ton-client-ruby/Client/Boc.rb', line 142

def decode_tvc(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

#encode_tvc(payload, &block) ⇒ Object

INPUT: ParamsOfEncodeTvc code: String<Optional> - # # Contract code BOC encoded as base64 or BOC handle data: String<Optional> - # # Contract data BOC encoded as base64 or BOC handle library: String<Optional> - # # Contract library BOC encoded as base64 or BOC handle tick: Boolean<Optional> - # # special.tick field. # # Specifies the contract ability to handle tick transactions tock: Boolean<Optional> - # # special.tock field. # # Specifies the contract ability to handle tock transactions split_depth: Number<Optional> - # # Is present and non-zero only in instances of large smart contracts boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided. RESPONSE: ResultOfEncodeTvc tvc: String - # # Contract TVC image BOC encoded as base64 or BOC handle of boc_cache parameter was specified



156
157
158
# File 'lib/ton-client-ruby/Client/Boc.rb', line 156

def encode_tvc(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 or image BOC handle 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

#get_code_salt(payload, &block) ⇒ Object

INPUT: ParamsOfGetCodeSalt code: String - # # Contract code BOC encoded as base64 or code BOC handle boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided. RESPONSE: ResultOfGetCodeSalt salt: String<Optional> - # # Contract code salt if present. # # BOC encoded as base64 or BOC handle



118
119
120
# File 'lib/ton-client-ruby/Client/Boc.rb', line 118

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

#get_compiler_version(payload, &block) ⇒ Object

INPUT: ParamsOfGetCompilerVersion code: String - # # Contract code BOC encoded as base64 or code BOC handle RESPONSE: ResultOfGetCompilerVersion version: String<Optional> - # # Compiler version, for example ‘sol 0.49.0’



164
165
166
# File 'lib/ton-client-ruby/Client/Boc.rb', line 164

def get_compiler_version(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

#set_code_salt(payload, &block) ⇒ Object

INPUT: ParamsOfSetCodeSalt code: String - # # Contract code BOC encoded as base64 or code BOC handle salt: String - # # Code salt to set. # # BOC encoded as base64 or BOC handle boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided. RESPONSE: ResultOfSetCodeSalt code: String - # # Contract code with salt set. # # BOC encoded as base64 or BOC handle



128
129
130
# File 'lib/ton-client-ruby/Client/Boc.rb', line 128

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