Escrow SDK
A class that lets you create and manage Kleros Escrow transactions.
This class lets you create and manage Kleros Escrow transactions. Use this Kleros Escrow SDK to easily integrate on-chain escrow features on your platform.
Methods
constructor
constructor
Constructs a KlerosEscrow
instance.
Params (web3, archon)
(web3, archon)
Returns (KlerosEscrow)
(KlerosEscrow)
A KlerosEscrow
instance.
klerosEscrow.getAccount
klerosEscrow.getAccount
Returns (Promise<object>)
(Promise<object>)
A promise for the current account of the set Web3 instance or the one chosen in the prompt to connect when none is set.
klerosEscrow.setCourtAndCurrency
klerosEscrow.setCourtAndCurrency
Sets the court and currency that escrow transactions will use.
Params (court = "blockchain-non-technical", currency)
(court = "blockchain-non-technical", currency)
Returns (Promise)
(Promise)
A promise that resolves when the court and currency are set.
klerosEscrow.upload
klerosEscrow.upload
Uploads files to Kleros' IPFS node.
Params (fileName, bufferOrJSON)
(fileName, bufferOrJSON)
Returns (Promise<string>)
(Promise<string>)
A promise for the uploaded's file IPFS URI.
klerosEscrow.getTransactions
klerosEscrow.getTransactions
Gets the list of transactions an address is involved in.
Params (address)
(address)
Returns (Promise<object[]>)
(Promise<object[]>)
A promise for the list of transactions.
klerosEscrow.isSender
klerosEscrow.isSender
Checks if the current Web3 account is the sender of a transaction.
Params (transactionID)
(transactionID)
Returns (Promise<boolean>)
(Promise<boolean>)
A promise for the answer.
klerosEscrow.createTransaction
klerosEscrow.createTransaction
Creates an escrow transaction.
Params (amount, recipient, timeout, metaEvidence)
(amount, recipient, timeout, metaEvidence)
Returns (Promise<object>)
(Promise<object>)
A promise for the transaction's creation transaction.
klerosEscrow.pay
klerosEscrow.pay
Pays an amount of an escrowed transaction the current account is a sender in, to the recipient.
Params (transactionID, amount)
(transactionID, amount)
Returns (Promise<object>)
(Promise<object>)
A promise for the payment's transaction.
klerosEscrow.reimburse
klerosEscrow.reimburse
Pays an amount of an escrowed transaction the current account is a recipient in, to the sender.
Params (transactionID, amount)
(transactionID, amount)
Returns (Promise<object>)
(Promise<object>)
A promise for the payment's transaction.
klerosEscrow.executeTransaction
klerosEscrow.executeTransaction
Executes a transaction where the timeout has passed.
Params (transactionID)
(transactionID)
Returns (Promise<object>)
(Promise<object>)
A promise for the execution's transaction.
klerosEscrow.timeout
klerosEscrow.timeout
Timesout the other party of an escrowed transaction the current account is involved in. This is for when they miss the deadline to pay arbitration fees.
Params (transactionID)
(transactionID)
Returns (Promise<object>)
(Promise<object>)
A promise for the timeout's transaction.
klerosEscrow.payArbitrationFee
klerosEscrow.payArbitrationFee
Pays arbitration fees for a transaction the current account is involved in.
Params (transactionID, amount)
(transactionID, amount)
Returns (Promise<object>)
(Promise<object>)
A promise for the payment's transaction.
klerosEscrow.submitEvidence
klerosEscrow.submitEvidence
Uploads evidence to Kleros' IPFS node and submits it for a transaction.
Params (transactionID, evidence)
(transactionID, evidence)
Returns (Promise<object>)
(Promise<object>)
A promise for the submission's transaction.
Last updated