Class: Filecoin::Types::StartDealParams
- Inherits:
-
Object
- Object
- Filecoin::Types::StartDealParams
- Defined in:
- lib/filecoin/types/start_deal_params.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#deal_start_epoch ⇒ Object
readonly
Returns the value of attribute deal_start_epoch.
-
#epoch_price ⇒ Object
readonly
Returns the value of attribute epoch_price.
-
#min_blocks_duration ⇒ Object
readonly
Returns the value of attribute min_blocks_duration.
-
#miner ⇒ Object
readonly
Returns the value of attribute miner.
-
#wallet ⇒ Object
readonly
Returns the value of attribute wallet.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(data:, wallet: nil, miner:, epoch_price:, min_blocks_duration: nil, deal_start_epoch: nil) ⇒ StartDealParams
constructor
A new instance of StartDealParams.
Constructor Details
#initialize(data:, wallet: nil, miner:, epoch_price:, min_blocks_duration: nil, deal_start_epoch: nil) ⇒ StartDealParams
Returns a new instance of StartDealParams.
6 7 8 9 10 11 12 13 |
# File 'lib/filecoin/types/start_deal_params.rb', line 6 def initialize(data:, wallet: nil, miner:, epoch_price:, min_blocks_duration: nil, deal_start_epoch: nil) @data = data @wallet = wallet || Filecoin.config.default_wallet @miner = miner @epoch_price = epoch_price @min_blocks_duration = min_blocks_duration @deal_start_epoch = deal_start_epoch end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/filecoin/types/start_deal_params.rb', line 4 def data @data end |
#deal_start_epoch ⇒ Object (readonly)
Returns the value of attribute deal_start_epoch.
4 5 6 |
# File 'lib/filecoin/types/start_deal_params.rb', line 4 def deal_start_epoch @deal_start_epoch end |
#epoch_price ⇒ Object (readonly)
Returns the value of attribute epoch_price.
4 5 6 |
# File 'lib/filecoin/types/start_deal_params.rb', line 4 def epoch_price @epoch_price end |
#min_blocks_duration ⇒ Object (readonly)
Returns the value of attribute min_blocks_duration.
4 5 6 |
# File 'lib/filecoin/types/start_deal_params.rb', line 4 def min_blocks_duration @min_blocks_duration end |
#miner ⇒ Object (readonly)
Returns the value of attribute miner.
4 5 6 |
# File 'lib/filecoin/types/start_deal_params.rb', line 4 def miner @miner end |
#wallet ⇒ Object (readonly)
Returns the value of attribute wallet.
4 5 6 |
# File 'lib/filecoin/types/start_deal_params.rb', line 4 def wallet @wallet end |
Instance Method Details
#as_json ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/filecoin/types/start_deal_params.rb', line 15 def as_json hash = { "Data" => data.as_json, "Wallet" => wallet, "Miner" => miner, "EpochPrice" => epoch_price.to_s, } hash["MinBlocksDuration"] = min_blocks_duration unless min_blocks_duration.nil? hash["DealStartEpoch"] = deal_start_epoch unless deal_start_epoch.nil? hash end |