Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

JavaScript SDK to manage and interact with the safient contracts (Claims, Incentivization) on Safient protocol

License

NotificationsYou must be signed in to change notification settings

safient/contract-js

Repository files navigation

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

Local installation

  git clone https://github.com/safient/safient-contract-js.gitcd safient-contract-js  npm install

Running tests

Create a .env file in the root directory withINFURA_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 runtest

Getting started

  npm i @safient/contracts

Usage

// If not injected web3 provider, create a jsonRpcProviderconst{ JsonRpcProvider}=require('@ethersproject/providers');constprovider=newJsonRpcProvider('http://localhost:8545');// Get signer and chainId from provider(async()=>{constsigner=awaitprovider.getSigner();constproviderNetwork=awaitprovider.getNetwork();constchainId=providerNetwork.chainId;})();

Initialization

import{SafientMain,Arbitrator,Types}from'@safient/contracts';constsafientMain=newSafientMain(signer,chainId);constarbitrator=newArbitrator(signer,chainId);

Building docs

Update the docs markdown

npm run build:docs

Run the docusaurus website locally

npm run serve:docs

About

JavaScript SDK to manage and interact with the safient contracts (Claims, Incentivization) on Safient protocol

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp