Class: Sdp::PreparedTransfer

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

Overview

Result of POST /v1/payments/transfers/prepare: the provisional transfer plus the unsigned transaction the caller must sign and submit before blockhash expiry. simulation is SDP’s simulation result passed through as a hash when present.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#blockhashObject

Returns the value of attribute blockhash

Returns:

  • (Object)

    the current value of blockhash



34
35
36
# File 'lib/sdp/resources/payments.rb', line 34

def blockhash
  @blockhash
end

#last_valid_block_heightObject

Returns the value of attribute last_valid_block_height

Returns:

  • (Object)

    the current value of last_valid_block_height



34
35
36
# File 'lib/sdp/resources/payments.rb', line 34

def last_valid_block_height
  @last_valid_block_height
end

#serializedObject

Returns the value of attribute serialized

Returns:

  • (Object)

    the current value of serialized



34
35
36
# File 'lib/sdp/resources/payments.rb', line 34

def serialized
  @serialized
end

#simulationObject

Returns the value of attribute simulation

Returns:

  • (Object)

    the current value of simulation



34
35
36
# File 'lib/sdp/resources/payments.rb', line 34

def simulation
  @simulation
end

#transferObject

Returns the value of attribute transfer

Returns:

  • (Object)

    the current value of transfer



34
35
36
# File 'lib/sdp/resources/payments.rb', line 34

def transfer
  @transfer
end

Class Method Details

.from_hash(hash) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/sdp/resources/payments.rb', line 36

def self.from_hash(hash)
  hash ||= {}
  prepared = hash[:prepared_transaction] || {}
  new(
    transfer: Transfer.from_hash(hash[:transfer]),
    serialized: prepared[:serialized],
    blockhash: prepared[:blockhash],
    last_valid_block_height: prepared[:last_valid_block_height],
    simulation: hash[:simulation]
  )
end