Class: TonClient::Proofs

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

Returns a new instance of Proofs.



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

def context
  @context
end

#coreObject (readonly)

Returns the value of attribute core.



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

def core
  @core
end

Instance Method Details

#proof_block_data(payload, &block) ⇒ Object

INPUT: ParamsOfProofBlockData block: Value - # # Single block’s data, retrieved from TONOS API, that needs proof. Required fields are ‘id` and/or top-level `boc` (for block identification), others are optional.



16
17
18
# File 'lib/ton-client-ruby/Client/Proofs.rb', line 16

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

#proof_message_data(payload, &block) ⇒ Object

INPUT: ParamsOfProofMessageData message: Value - # # Single message’s data as queried from DApp server, without modifications. The required fields are ‘id` and/or top-level `boc`, others are optional. In order to reduce network requests count, it is recommended to provide at least `boc` of message and non-null `src_transaction.id` or `dst_transaction.id`.



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

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

#proof_transaction_data(payload, &block) ⇒ Object

INPUT: ParamsOfProofTransactionData transaction: Value - # # Single transaction’s data as queried from DApp server, without modifications. The required fields are ‘id` and/or top-level `boc`, others are optional. In order to reduce network requests count, it is recommended to provide `block_id` and `boc` of transaction.



22
23
24
# File 'lib/ton-client-ruby/Client/Proofs.rb', line 22

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