Class: Sdp::TokenTransaction

Inherits:
Struct
  • Object
show all
Defined in:
lib/sdp/resources/issuance.rb

Overview

An issuance transaction — the action record SDP returns for mint/burn —distinct from a payments Transfer (different shape, different endpoints). token_account is the associated token account SDP returns alongside a mint (a sibling of the transaction in the envelope, folded in here); nil when SDP didn’t send one (e.g. burn).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#block_timeObject

Returns the value of attribute block_time

Returns:

  • (Object)

    the current value of block_time



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def block_time
  @block_time
end

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def created_at
  @created_at
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def error
  @error
end

#feeObject

Returns the value of attribute fee

Returns:

  • (Object)

    the current value of fee



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def fee
  @fee
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def id
  @id
end

#paramsObject

Returns the value of attribute params

Returns:

  • (Object)

    the current value of params



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def params
  @params
end

#serialized_txObject

Returns the value of attribute serialized_tx

Returns:

  • (Object)

    the current value of serialized_tx



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def serialized_tx
  @serialized_tx
end

#signatureObject

Returns the value of attribute signature

Returns:

  • (Object)

    the current value of signature



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def signature
  @signature
end

#slotObject

Returns the value of attribute slot

Returns:

  • (Object)

    the current value of slot



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def slot
  @slot
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def status
  @status
end

#token_accountObject

Returns the value of attribute token_account

Returns:

  • (Object)

    the current value of token_account



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def 
  @token_account
end

#token_idObject

Returns the value of attribute token_id

Returns:

  • (Object)

    the current value of token_id



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def token_id
  @token_id
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def type
  @type
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



52
53
54
# File 'lib/sdp/resources/issuance.rb', line 52

def updated_at
  @updated_at
end

Class Method Details

.from_hash(hash, token_account: nil) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/sdp/resources/issuance.rb', line 56

def self.from_hash(hash, token_account: nil)
  hash ||= {}
  new(
    id: hash[:id],
    token_id: hash[:token_id],
    type: hash[:type],
    status: hash[:status],
    signature: hash[:signature],
    serialized_tx: hash[:serialized_tx],
    params: hash[:params],
    slot: hash[:slot],
    block_time: hash[:block_time],
    fee: hash[:fee],
    error: hash[:error],
    token_account: ,
    created_at: hash[:created_at],
    updated_at: hash[:updated_at]
  )
end