@desights/desights.js
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

desights.js

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()

Package Sidebar

Install

npm i @desights/desights.js

Weekly Downloads

11

Version

1.2.3

License

Apache-2.0

Unpacked Size

4.55 MB

Total Files

232

Last publish

Collaborators

  • 0xdatax