Kleros Moderate
  • Introduction to Kleros
  • Kleros FAQ
  • Governance
  • PNK Token
  • They talk about Kleros
  • Products
    • Court
      • Kleros Juror Tutorial
      • Famous Kleros Cases
      • What happens during a dispute?
      • Kleros & Credible Neutrality
    • Proof of Humanity
      • Proof of Humanity Tutorial (Register & Vouch)
      • Proof Humanity Tutorial (Remove & Challenge)
      • Proof of Humanity FAQ
    • Tokens
      • Kleros Tokens Tutorial
    • Curate
      • Kleros Curate Tutorial
    • Oracle
    • Governor
    • Escrow
      • Kleros Escrow Tutorial
      • Kleros Escrow Specifications
    • Linguo
      • Kleros Linguo Tutorial
      • Step-by-step Tutorial
        • Requesting translations
        • Working as a translator
        • Reviewing translations
      • F.A.Q
      • High-level Overview
    • Moderate
      • Susie
        • Getting Started
          • Add Susie
          • Start Susie
        • Basics
          • Welcome
          • Language
          • Notifications
        • Rules
        • Reports
        • Evidence
        • Federations
  • INTEGRATIONS
    • Overview
    • Types of Integrations
      • 1. Dispute resolution integration plan
        • Smart contract integration with Kleros Court (Arbitrator)
        • Use Cases
          • DeFi Insurance
          • Gaming
        • Channel partners
          • How to use Reality.eth + Kleros as an oracle
          • Safe Zodiac integration
        • Integration Tools
          • Escrow React
          • Escrow SDK
          • Centralized Arbitrator
      • 2. Curated-data integration plan
        • Interact with Arbitrable apps built on top of Kleros Court
    • Policy writing guide
    • Live & Upcoming Integrations
    • Kleros Analytics
    • Scalability & Cross-chain
      • Using Kleros arbitration for Dapps on xDai/Gnosis
    • Integrations FAQ
  • Developers
    • Arbitration Development
      • ERC-792: Arbitration Standard
      • ERC 1497: Evidence Standard
    • Arbitration by Example
      • ArbitrableDeposit.sol
      • TwoPartyArbitrable.sol
      • Rental.sol
      • ArbitrableTransaction.sol
      • MultipleArbitrableTransaction.sol
      • MultipleArbitrableTokenTransaction.sol
    • Archon: Ethereum Arbitration Standard Interaction Library
    • Deployment Addresses
    • Curate Classic: Integration for Devs
    • Light Curate: Integration for Devs
    • Guide for Preparing Transactions
  • Contribution Guidelines
    • Overview
    • General Dev. Workflow
      • Task Tracking & Lifecycle
      • Releases
    • Smart Contract Workflow
      • Task Tracking & Lifecycle
      • RAB - Review, Audit, Bounty
      • RABd (+ Deploy)
      • Reporting Vulnerabilities
    • Code Style and Guidelines
      • Git
      • Solidity
      • Web Languages
    • License & Code of Conduct
      • License
      • Code of Conduct
  • Additional Resources
    • Discord
    • Telegram
    • Governance Forum
    • Twitter
    • Blog
    • Reddit
    • Github
    • Slack
Powered by GitBook
On this page
  • Methods
  • constructor
  • Params (web3, archon)
  • Returns (KlerosEscrow)
  • klerosEscrow.getAccount
  • Returns (Promise<object>)
  • klerosEscrow.setCourtAndCurrency
  • Params (court = "blockchain-non-technical", currency)
  • Returns (Promise)
  • klerosEscrow.upload
  • Params (fileName, bufferOrJSON)
  • Returns (Promise<string>)
  • klerosEscrow.getTransactions
  • Params (address)
  • Returns (Promise<object[]>)
  • klerosEscrow.isSender
  • Params (transactionID)
  • Returns (Promise<boolean>)
  • klerosEscrow.createTransaction
  • Params (amount, recipient, timeout, metaEvidence)
  • Returns (Promise<object>)
  • klerosEscrow.pay
  • Params (transactionID, amount)
  • Returns (Promise<object>)
  • klerosEscrow.reimburse
  • Params (transactionID, amount)
  • Returns (Promise<object>)
  • klerosEscrow.executeTransaction
  • Params (transactionID)
  • Returns (Promise<object>)
  • klerosEscrow.timeout
  • Params (transactionID)
  • Returns (Promise<object>)
  • klerosEscrow.payArbitrationFee
  • Params (transactionID, amount)
  • Returns (Promise<object>)
  • klerosEscrow.submitEvidence
  • Params (transactionID, evidence)
  • Returns (Promise<object>)
  1. INTEGRATIONS
  2. Types of Integrations
  3. 1. Dispute resolution integration plan
  4. Integration Tools

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.

npm i @kleros/components
import KlerosEscrow from "@kleros/components/kleros-escrow";

//...

Methods

constructor

Constructs a KlerosEscrow instance.

Params (web3, archon)

Name
Type
Description
Default

web3*

Web3

A Web3 instance.

archon

Archon

new Archon(web3.currentProvider, "https://ipfs.kleros.io")

Returns (KlerosEscrow)

A KlerosEscrow instance.

klerosEscrow.getAccount

Returns (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

Sets the court and currency that escrow transactions will use.

Params (court = "blockchain-non-technical", currency)

Name
Type
Description
Default

court

string

"blockchain-non-technical"

currency

string

The address of the token the transaction should be paid in. Leave this undefined to use ETH.

Returns (Promise)

A promise that resolves when the court and currency are set.

klerosEscrow.upload

Uploads files to Kleros' IPFS node.

Params (fileName, bufferOrJSON)

Name
Type
Description
Default

fileName*

string

The file name of the file to upload.

bufferOrJSON*

`string

Buffer

object`

The file to upload.

Returns (Promise<string>)

A promise for the uploaded's file IPFS URI.

klerosEscrow.getTransactions

Gets the list of transactions an address is involved in.

Params (address)

Name
Type
Description
Default

address

string

The address to get transactions for.

(await web3.eth.getAccounts())[0]

Returns (Promise<object[]>)

A promise for the list of transactions.

klerosEscrow.isSender

Checks if the current Web3 account is the sender of a transaction.

Params (transactionID)

Name
Type
Description
Default

transactionID*

string

The ID of the transaction.

Returns (Promise<boolean>)

A promise for the answer.

klerosEscrow.createTransaction

Creates an escrow transaction.

Params (amount, recipient, timeout, metaEvidence)

Name
Type
Description
Default

amount*

`number

string

BN`

The amount escrowed.

recipient*

string

The address of the recipient.

timeout*

`number

string

BN`

The time in seconds until the transaction becomes executable.

metaEvidence*

object

Returns (Promise<object>)

A promise for the transaction's creation transaction.

klerosEscrow.pay

Pays an amount of an escrowed transaction the current account is a sender in, to the recipient.

Params (transactionID, amount)

Name
Type
Description
Default

transactionID*

string

The ID of the transaction.

amount*

`number

string

BN`

The amount to pay.

Returns (Promise<object>)

A promise for the payment's transaction.

klerosEscrow.reimburse

Pays an amount of an escrowed transaction the current account is a recipient in, to the sender.

Params (transactionID, amount)

Name
Type
Description
Default

transactionID*

string

The ID of the transaction.

amount*

`number

string

BN`

The amount to pay.

Returns (Promise<object>)

A promise for the payment's transaction.

klerosEscrow.executeTransaction

Executes a transaction where the timeout has passed.

Params (transactionID)

Name
Type
Description
Default

transactionID*

string

The ID of the transaction.

Returns (Promise<object>)

A promise for the execution's transaction.

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)

Name
Type
Description
Default

transactionID*

string

The ID of the transaction.

Returns (Promise<object>)

A promise for the timeout's transaction.

klerosEscrow.payArbitrationFee

Pays arbitration fees for a transaction the current account is involved in.

Params (transactionID, amount)

Name
Type
Description
Default

transactionID*

string

The ID of the transaction.

amount*

`number

string

BN`

The amount to pay.

Returns (Promise<object>)

A promise for the payment's transaction.

klerosEscrow.submitEvidence

Uploads evidence to Kleros' IPFS node and submits it for a transaction.

Params (transactionID, evidence)

Name
Type
Description
Default

transactionID*

string

The ID of the transaction.

evidence*

object

Returns (Promise<object>)

A promise for the submission's transaction.

PreviousEscrow ReactNextCentralized Arbitrator

Last updated 2 years ago

An instance.

The court that will rule over any disputes arising from a transaction. "general" or "blockchain-non-technical", or a custom address.

The for any potential disputes arising. You can add an additional file property with a buffer, string, or object, and it will be uploaded to IPFS and fileURI will be set appropiately.

The for any potential disputes arising. You can add an additional file property with a buffer, string, or object, and it will be uploaded to IPFS and fileURI will be set appropiately.

Archon
arbitrable transaction contract
meta evidence object
evidence object