0.1.19-alpha • Published 3 years ago
@safient/contracts v0.1.19-alpha
Safient Contracts SDK
JavaScript SDK to manage and interact with the safe claims on Safient protocol.
Local installation
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
npm run test:contract
Testing the JS SDK
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
Testing the contract & SDK
npm run deploy:sdk
npm run test
Getting started
npm i @safient/contracts
Usage
// 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
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
0.1.19-alpha
3 years ago
0.1.18-alpha
3 years ago
0.1.17-alpha
3 years ago
0.1.16-alpha
3 years ago
0.1.15-alpha
3 years ago
0.1.14-alpha
3 years ago
0.1.12-alpha
3 years ago
0.1.13-alpha
3 years ago
0.1.11-alpha
3 years ago
0.1.10-alpha
4 years ago
0.1.9
4 years ago
0.1.8
4 years ago
0.1.7
4 years ago