Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
kleros-api-2
Advanced tools
Readme
This repository contains a Javascript library that provides methods to interact with Kleros arbitrator and Arbitrable contracts. It can be used to develop Relayers or DApps that use Kleros smart contracts.
yarn add kleros-api
See the full API docs here.
The base Kleros object initializes all of the different kleros api's with the contract addresses you pass. This object is useful if your application interacts with both arbitrators, arbitrable contracts and uses an off chain store to provide metadata on the different disputes for the UI.
// pay arbitration fee.
import Kleros from 'kleros-api'
const KlerosInstance = new Kleros(
ETH_PROVIDER, // ethereum provider object
KLEROS_STORE_URI, // uri of off chain storage e.g. https://kleros.in
ARITRATOR_CONTRACT_ADDRESS, // address of a deployed Kleros arbitrator contract
ARBITRABLE_CONTRACT_ADDRESS // address of a deployed arbitrable transaction contract
)
KlerosInstance.arbitrable.payArbitrationFeeByPartyA() // pay arbitration fee for an arbitrable contract
You can also use the specific api that best suits your needs.
// deploy a new contract and pay the arbitration fee.
import ArbitrableTransaction from 'kleros-api/contracts/implementations/arbitrable/ArbitrableTransaction'
// deploy methods are static
const contractInstance = ArbitrableTransaction.deploy(
"0x67a3f2BB8B4B2060875Bd6543156401B817bEd22", // users address
0.15, // amount of ETH to escrow
"0x0", // hash of the off chain contract
"0x3af76ef44932695a33ba2af52018cd24a74c904f", // arbitrator address
3600, // number of seconds until there is a timeout
"0x0474b723bd4986808366E0DcC2E301515Aa742B4", // the other party in the contract
"0x0", // extra data in bytes. This can be used to interact with the arbitrator contract
ETH_PROVIDER, // provider object to be used to interact with the network
)
const address = contractInstance.address // get the address of your newly created contract
const ArbitrableTransactionInstance = new ArbitrableTransaction(address) // instantiate instance of the api
ArbitrableTransactionInstance.payArbitrationFeeByPartyA() // pay arbitration fee
If you want to contribute to our api or modify it for your usage
We assume that you have node and yarn installed.
yarn install
yarn ganache
yarn test
yarn run build
FAQs
A Javascript library that makes it easy to build relayers and other DApps that use the Kleros protocol.
The npm package kleros-api-2 receives a total of 0 weekly downloads. As such, kleros-api-2 popularity was classified as not popular.
We found that kleros-api-2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.