Class: TonClient::Tvm

Inherits:
Object show all
Includes:
CommonInstanceHelpers
Defined in:
lib/ton-client-ruby/Client/Tvm.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) ⇒ Tvm

Returns a new instance of Tvm.



9
10
11
12
# File 'lib/ton-client-ruby/Client/Tvm.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/Tvm.rb', line 6

def context
  @context
end

#coreObject (readonly)

Returns the value of attribute core.



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

def core
  @core
end

Instance Method Details

#run_executor(payload, &block) ⇒ Object

INPUT: ParamsOfRunExecutor message: String - # # Input message BOC. # # Must be encoded as base64. account: AccountForExecutor - # # Account to run on executor execution_options: ExecutionOptions<Optional> - # # Execution options. abi: Value<Optional> - # # Contract ABI for decoding output messages skip_transaction_check: Boolean<Optional> - # # Skip transaction check flag boc_cache: BocCacheType<Optional> - # # Cache type to put the result. # # The BOC itself returned if no cache type provided return_updated_account: Boolean<Optional> - # # Return updated account flag. # # Empty string is returned if the flag is ‘false` RESPONSE: ResultOfRunExecutor transaction: Value - # # Parsed transaction. # # In addition to the regular transaction fields there is a`boc` field encoded with `base64` which contains sourcetransaction BOC. out_messages: Array - # # List of output messages’ BOCs. # # Encoded as ‘base64` decoded: DecodedOutput<Optional> - # # Optional decoded message bodies according to the optional `abi` parameter. account: String - # # Updated account state BOC. # # Encoded as `base64` fees: TransactionFees - # # Transaction fees



28
29
30
# File 'lib/ton-client-ruby/Client/Tvm.rb', line 28

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

#run_get(payload, &block) ⇒ Object

INPUT: ParamsOfRunGet account: String - # # Account BOC in ‘base64` function_name: String - # # Function name input: Value - # # Input parameters execution_options: ExecutionOptions<Optional> - # # Execution options tuple_list_as_array: Boolean<Optional> - # # Convert lists based on nested tuples in the result into plain arrays. # # Default is `false`. Input parameters may use any of lists representationsIf you receive this error on Web: “Runtime error. Unreachable code should not be executed…”,set this flag to true. This may happen, for example, when elector contract contains too many participants RESPONSE: ResultOfRunGet output: Value - # # Values returned by get-method on stack



56
57
58
# File 'lib/ton-client-ruby/Client/Tvm.rb', line 56

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

#run_tvm(payload, &block) ⇒ Object

INPUT: ParamsOfRunTvm message: String - # # Input message BOC. # # Must be encoded as base64. account: String - # # Account BOC. # # Must be encoded as base64. execution_options: ExecutionOptions<Optional> - # # Execution options. abi: Value<Optional> - # # Contract ABI for decoding output messages boc_cache: BocCacheType<Optional> - # # Cache type to put the result. # # The BOC itself returned if no cache type provided return_updated_account: Boolean<Optional> - # # Return updated account flag. # # Empty string is returned if the flag is ‘false` RESPONSE: ResultOfRunTvm out_messages: Array - # # List of output messages’ BOCs. # # Encoded as ‘base64` decoded: DecodedOutput<Optional> - # # Optional decoded message bodies according to the optional `abi` parameter. account: String - # # Updated account state BOC. # # Encoded as `base64`. Attention! Only `account_state.storage.state.data` part of the BOC is updated.



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

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