ErasureClient

ErasureClient

new ErasureClient(config)

ErasureClient
Parameters:
Name Type Description
config Object configuration for ErasureClient
Properties
Name Type Description
web3Provider string
protocolVersion string version of the erasure protocol

Methods

(async) login() → {Promise}

To initialize the client. This ought to be called before calling any client functions.
Returns:
receipt of registerUser
Type
Promise

(async) getObject(address) → {Promise.<(ErasureFeed|ErasurePost|ErasureEscrow|ErasureAgreement)>}

Get the Erasure object associated with a given address
Parameters:
Name Type Description
address string address to fetch
Returns:
Erasure object
Type
Promise.<(ErasureFeed|ErasurePost|ErasureEscrow|ErasureAgreement)>

(async) createFeed(config) → {Promise.<ErasureFeedWithReceipt>}

Create a new feed
Parameters:
Name Type Description
config Object
Properties
Name Type Attributes Description
operator string <optional>
optional operator
proofhash string <optional>
optional initial post
data string <optional>
optional initial post raw data
metadata string <optional>
optional metadata
Returns:
Type
Promise.<ErasureFeedWithReceipt>

(async) createEscrow(config) → {Promise.<ErasureEscrowWithReceipt>}

Create a new escrow
Parameters:
Name Type Description
config Object
Properties
Name Type Attributes Description
operator string <optional>
buyer string <optional>
seller string <optional>
paymentAmount string
stakeAmount string
escrowCountdown string
griefRatio string
griefRatioType string
agreementCountdown string
metadata string <optional>
Returns:
Type
Promise.<ErasureEscrowWithReceipt>

(async) createAgreement(config) → {Promise.<ErasureAgreementWithReceipt>}

Create a new agreement
Parameters:
Name Type Description
config Object
Properties
Name Type Attributes Description
operator string <optional>
staker string <optional>
counterparty string
griefRatio string
griefRatioType string
countdownLength string <optional>
creates a simple griefing agreement if not set
metadata string <optional>
Returns:
Type
Promise.<ErasureAgreementWithReceipt>