ErasurePost

ErasurePost

new ErasurePost(config)

Parameters:
Name Type Description
config Object
Properties
Name Type Description
owner address
proofhash string
feedAddress address
web3Provider Object
protocolVersion string

Methods

(static) proofhash() → {string|string}

Get the proofhash of this post
Returns:
  • bytes32 sha256 proofhash
    Type
    string
  • base58 multihash format of the proofhash
    Type
    string

(static) owner() → {Promise}

Get the address of the owner of this post
Returns:
address of the owner
Type
Promise

(static) offerSell(config) → {Promise|Promise|Promise}

Create a new CountdownGriefingEscrow and deposit stake - only called by owner of post - add proofhash to metadata - add Post owner as staker
Parameters:
Name Type Description
config Object configuration for escrow
Properties
Name Type Attributes Description
buyer string <optional>
paymentAmount string
stakeAmount string
escrowCountdown number
griefRatio string
griefRatioType number
agreementCountdown number
Returns:
  • address of the escrow
    Type
    Promise
  • address of the agreement
    Type
    Promise
  • transaction receipts
    Type
    Promise

(static) getSellOffers() → {Promise}

Get all escrows to sell this Post
Returns:
array of Escrow objects
Type
Promise

(static) offerBuy(config) → {Promise|Promise|Promise}

Create a new CountdownGriefingEscrow and deposit payment - add proofhash to metadata - add Post owner as staker - add caller as buyer
Parameters:
Name Type Description
config Object configuration for escrow
Properties
Name Type Description
paymentAmount string
stakeAmount string
escrowCountdown number
ratio string
ratioType number
agreementCountdown number
Returns:
  • address of the escrow
    Type
    Promise
  • address of the agreement
    Type
    Promise
  • transaction receipts
    Type
    Promise

(static) getBuyOffers() → {Promise}

Get all escrows to buy this Post
Returns:
array of Escrow objects
Type
Promise

(static) reveal() → {Promise}

Reveal this post publicly - fetch symkey and upload to ipfs - should be called by feed creator
Returns:
base58 multihash format of the ipfs address of the revealed key
Type
Promise

(static) checkStatus() → {boolean|integer}

Get the status of the post
Returns:
  • revealed bool true if the post is revealed
    Type
    boolean
  • numSold number of times the post was sold
    Type
    integer