
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@dharmaprotocol/dharma.js
Advanced tools
[](https://circleci.com/gh/dharmaprotocol/dharma.js/tree/master)
dharma.js
!This repository contains the dharma.js
client application development libraries. dharma.js
makes it easy for developers who may not be deeply familiar with smart contract development to interact with the various components of Dharma protocol and build hyper-flexible lending applications.
For more information, please check out the Dharma Developer Portal.
Add Dharma.js to your project using yarn:
yarn add @dharmaprotocol/dharma.js
Alternatively, add Dharma.js to your project using npm:
npm install @dharmaprotocol/dharma.js --save
Include Dharma.js in your project code using ES6 style imports (recommended):
import { Dharma } from "@dharmaprotocol/dharma.js";
Alternatively, include Dharma.js in your project code using require syntax:
const { Dharma } = require("@dharmaprotocol/dharma.js");
In order to instantiate Dharma.js, you need to specify a web3 provider.
The web3 provider can either be instantiated directly, or pulled from the browser's window object.
You'll want to instantiate a web3 provider directly if you're:
You'll first import Dharma and Web3 from the Dharma.js package:
import { Dharma, Web3 } from "@dharmaprotocol/dharma.js";
Assuming you're running a local blockchain on localhost port 8545, you'd specify the provider as follows:
const host = "http://localhost:8545";
const provider = new Web3.providers.HttpProvider(host);
You'd then pass the above provider to the Dharma constructor, using JavaScript's new
operator to construct an instance of Dharma connected to your local blockchain:
const dharma = new Dharma(provider);
If the user is interacting with your dApp via a web3 wallet (e.g., MetaMask, Coinbase Wallet, etc.), you can pull the web3 provider from the browser's window object and pass that to the Dharma constructor:
const provider = window.web3.currentProvider;
const dharma = new Dharma(provider);
FAQs
[](https://circleci.com/gh/dharmaprotocol/dharma.js/tree/master)
The npm package @dharmaprotocol/dharma.js receives a total of 1 weekly downloads. As such, @dharmaprotocol/dharma.js popularity was classified as not popular.
We found that @dharmaprotocol/dharma.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.