npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@liqwid2021/liqwid-sdk

v1.0.0-alpha.5

Published

A JavaScript SDK for the Liqwid Protocol

Downloads

2

Readme

Liqwid SDK

A JavaScript SDK for Ethereum and the Liqwid Protocol. Wraps around Ethers.js. Works in the web browser and Node.js.

This SDK is in open beta, and is constantly under development.

Liqwid Protocol

Simple methods for using the Liqwid protocol.

const liqwid = new Liqwid(window.ethereum) // in a web browser

// Ethers.js overrides are an optional 3rd parameter for `supply`
const trxOptions = { gasLimit: 250000, mantissa: false }

(async function() {

  console.log('Supplying ADA to the Liqwid protocol...')
  const trx = await liqwid.supply(Liqwid.ADA, 1)
  console.log('Ethers.js transaction object', trx, trxOptions)

})().catch(console.error)

Install / Import

Web Browser


<script type="text/javascript"
        src="https://cdn.jsdelivr.net/npm/@liqwid2021/liqwid-sdk@latest/dist/browser/liqwid.min.js"></script>

<script type="text/javascript">
    window.Liqwid; // or `Liqwid`
</script>

Node.js

npm install @liqwid2021/liqwid-sdk
const Liqwid = require('@liqwid2021/liqwid-sdk');

// or, when using ES6

import Liqwid from '@liqwid2021/liqwid-sdk';

Instance Creation

The following are valid Ethereum providers for initialization of the SDK.

new Liqwid(window.ethereum)

new Liqwid('http://127.0.0.1:8545')

new Liqwid()

new Liqwid('rinkeby')

// Init with private key (server side)
new Liqwid('https://rinkeby.infura.io/v3/_your_project_id_', {
  privateKey: '0x_your_private_key_', // preferably with environment variable
});

// Init with HD mnemonic (server side)
new Liqwid('rinkeby', {
  mnemonic: 'clutch captain shoe...', // preferably with environment variable
})

Constants and Contract Addresses

Names of contracts, their addresses, ABIs, token decimals, and more can be found in src/constants.ts.

Addresses, for all networks, can be easily fetched using the getAddress function, combined with contract name constants.

console.log(Liqwid.LQ, Liqwid.qLQ, Liqwid.ADA, Liqwid.qADA)
// LQ, qLQ, ADA, qADA

const address = Liqwid.util.getAddress(Liqwid.ADA);

Build for Node.js & Web Browser

git clone [email protected]:liqwid/liqwid-sdk.git
cd liqwid-sdk
nvm use
yarn install
yarn build

Web Browser Build

<!-- Local build (do `npm install` first) -->
<script type="text/javascript" src="./dist/browser/liqwid.min.js"></script>

<!-- Public NPM -> jsdeliver build -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@liqwid2021/liqwid-sdk@latest/dist/browser/liqwid.min.js"></script>

Node.js Build

// Local build (do `npm install` first)
const Liqwid = require('./dist/nodejs/index.js')

// Public NPM build
const Liqwid = require('@liqwid2021/liqwid-sdk')