JavaScript SDK to manage and interact with the safe claims on Safient protocol.
git clone https://github.com/safient/safient-contract-js.git
cd safient-contract-js
npm install
Create a .env file in the root directory with INFURA_API_KEY
for mainnet or testnet deployment.
npm run test:contract
Run a local blockchain
npm run chain
Deploy the contract, run the test on a different terminal
npm run deploy:sdk
npm run test:sdk
npm run deploy:sdk
npm run test
npm i @safient/contracts
// 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;
})();
import { SafientMain, Arbitrator, Types } from '@safient/contracts';
const safientMain = new SafientMain(signer, chainId);
const arbitrator = new Arbitrator(signer, chainId);
Update the docs markdown
npm run build:docs
Run the docusaurus website locally
npm run serve:docs