class TonSdk::Abi::AbiEvent

Attributes

id_[R]
inputs[R]
name[R]

Public Class Methods

from_json(j) click to toggle source
# File lib/ton_sdk_client/abi.rb, line 426
def self.from_json(j)
  return nil if j.nil?

  inp_s = if j["inputs"].nil?
    []
  else
    j["inputs"].compact.map do |x|
      # TODO recursive parsing of AbiParam
      AbiParam.from_json(x)
    end
  end

  self.new(
    name: j["name"],
    inputs: inp_s,
    id_: j["id"],
  )
end
new(name:, inputs:, id_:) click to toggle source
# File lib/ton_sdk_client/abi.rb, line 406
def initialize(name:, inputs:, id_:)
  @name = name
  @inputs = inputs
  @id_ = id_
end

Public Instance Methods

to_h() click to toggle source
# File lib/ton_sdk_client/abi.rb, line 412
def to_h
  in_h_s = if !@inputs.nil?
    @inputs.compact.map(&:to_h)
  else
    []
  end

  {
    name: @name,
    inputs: in_h_s,
    id: @id_
  }
end