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
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)>
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>
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>
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>