# @safient/contracts

> JavaScript SDK to manage and interact with the safe claims on Safient protocol.

Latest version **0.1.19-alpha** (published 2022-11-14) · 0 weekly downloads

## Install

```sh
npm install @safient/contracts
pnpm add @safient/contracts
yarn add @safient/contracts
bun add @safient/contracts
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.19-alpha |
| Published | 2022-11-14 |
| First published | 2021-09-16 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 20 |
| Unpacked size | 109.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Safient |
| Maintainers | consensolabs-ci |
| Keywords | Web3, Ethereum, Safient, IPFS, Crypto |

## Links

- npm: https://www.npmjs.com/package/@safient/contracts
- Repository: https://github.com/safient/safient-contract-js
- Homepage: https://github.com/safient/safient-contract-js#readme
- Issues: https://github.com/safient/safient-contract-js/issues
- npm.io page: https://npm.io/package/@safient/contracts

## Dependencies (20)

- [chai](https://npm.io/package/chai.md) ^4.3.4
- [bip39](https://npm.io/package/bip39.md) 2.5.0
- [ramda](https://npm.io/package/ramda.md) ^0.27.1
- [ethers](https://npm.io/package/ethers.md) ^5.4.3
- [did-jwt](https://npm.io/package/did-jwt.md) ^5.6.2
- [hardhat](https://npm.io/package/hardhat.md) ^2.5.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.0
- [@textile/hub](https://npm.io/package/@textile/hub.md) ^6.1.0
- [ethereum-waffle](https://npm.io/package/ethereum-waffle.md) ^3.3.0
- [qrcode-terminal](https://npm.io/package/qrcode-terminal.md) ^0.12.0
- [chai-as-promised](https://npm.io/package/chai-as-promised.md) ^7.1.1
- [ethereumjs-wallet](https://npm.io/package/ethereumjs-wallet.md) 0.6.5
- [@ethersproject/units](https://npm.io/package/@ethersproject/units.md) ^5.2.0
- [@ethersproject/logger](https://npm.io/package/@ethersproject/logger.md) ^5.2.0
- [@ethersproject/address](https://npm.io/package/@ethersproject/address.md) ^5.2.0
- [@ethersproject/bignumber](https://npm.io/package/@ethersproject/bignumber.md) ^5.2.0
- [@ethersproject/contracts](https://npm.io/package/@ethersproject/contracts.md) ^5.0.5
- [@ethersproject/providers](https://npm.io/package/@ethersproject/providers.md) ^5.4.4
- [@nomiclabs/hardhat-ethers](https://npm.io/package/@nomiclabs/hardhat-ethers.md) ^2.0.2
- [@nomiclabs/hardhat-waffle](https://npm.io/package/@nomiclabs/hardhat-waffle.md) ^2.0.1

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 0.1.19-alpha (latest) — 2022-11-14
- 0.1.18-alpha — 2022-09-08
- 0.1.17-alpha — 2022-07-22
- 0.1.16-alpha — 2022-04-26
- 0.1.15-alpha — 2022-04-15
- 0.1.14-alpha — 2022-02-23
- 0.1.13-alpha — 2022-02-03
- 0.1.12-alpha — 2022-01-21
- 0.1.11-alpha — 2021-11-19
- 0.1.10-alpha — 2021-10-29
- 0.1.9 — 2021-10-18
- 0.1.8 — 2021-09-28
- 0.1.7 — 2021-09-16

## README

# Safient Contracts SDK

JavaScript SDK to manage and interact with the safe claims on Safient protocol.

## Local installation

```bash
  git clone https://github.com/safient/safient-contract-js.git
  cd safient-contract-js
  npm install
```

## Running tests

Create a .env file in the root directory with `INFURA_API_KEY` for mainnet or testnet deployment.

#### Testing the contracts

```bash
  npm run test:contract
```

#### Testing the JS SDK

Run a local blockchain

```bash
  npm run chain
```

Deploy the contract, run the test on a different terminal

```bash
  npm run deploy:sdk
  npm run test:sdk
```

#### Testing the contract & SDK

```bash
  npm run deploy:sdk
  npm run test
```

## Getting started

```bash
  npm i @safient/contracts
```

## Usage

```javascript
// If not injected web3 provider, create a jsonRpcProvider
const { JsonRpcProvider } = require('@ethersproject/providers');
const provider = new JsonRpcProvider('http://localhost:8545');

// Get signer and chainId from provider
(async () => {
  const signer = await provider.getSigner();
  const providerNetwork = await provider.getNetwork();
  const chainId = providerNetwork.chainId;
})();
```

## Initialization

```javascript
import { SafientMain, Arbitrator, Types } from '@safient/contracts';

const safientMain = new SafientMain(signer, chainId);
const arbitrator = new Arbitrator(signer, chainId);
```

## Building docs

Update the docs markdown

```
npm run build:docs
```

Run the docusaurus website locally

```
npm run serve:docs
```

---
_Source: https://npm.io/package/@safient/contracts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
