@desights/desights.js
v1.3.2
Published
Javascript library for Desights Platform
Downloads
657
Maintainers
Readme
JavaScript library for the Desights Platform.
🏗 Installation
npm install @desights/desights.js
🏄 Quickstart
import { ethers } from 'ethers'
import { UserProfile, OrganisationProfile, Registry } from '@desights/desights.js'
//inject web3 provider from browser wallet or mobile wallet
const provider = new ethers.providers.Web3Provider(window.ethereum)
//get signer
const signer = provider.getSigner()
const registry = new Registry(provider, signer)
//fetches all organisation profiles registered on Desights
let orgs = await registry.fetchAllOrgProfiles()
//fetches all users profiles registered on Desights
let users = await registry.fetchAllUserProfiles()
//then use each of them individually
let userProfile = new UserProfile(users[0], provider, signer)
userProfile.fetchProfileData()