Class: Offers

Offers

Manages a stream of offers for a given storage contract publication

new Offers(contract [, options])

Parameters:
Name Type Argument Description
contract Contract Storage contract published to network
options Object <optional>
Properties
Name Type Argument Description
maxOffers Number <optional>
Maximum number of offers to process
farmerBlacklist Array.<String> <optional>
Reject offers from nodeID
Source:

Methods


destroy()

Tears down listeners and ends the stream
Source:

queue(contact, contract, callback)

Adds the offer to the internal queue if there is room
Parameters:
Name Type Description
contact array The sending farmer for the offer
contract object The received offer contract
callback function
Source:

Events


data

Triggered when an offer is received
Parameters:
Name Type Description
data Object
Properties
Name Type Description
contact Contact The sending farmer for the offer
contract Contract The received offer contract
Source:

end

Triggered when the maximum number of offers are received and processed
Source:

error

Triggered if an error occurs
Parameters:
Name Type Description
error Error The error object with message
Source: