New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@liqwid2021/liqwid-sdk

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liqwid2021/liqwid-sdk

A JavaScript SDK for the Liqwid Protocol

latest
Source
npmnpm
Version
1.0.0-alpha.5
Version published
Maintainers
2
Created
Source

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 git@gitlab.com: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')

Keywords

liqwid finance

FAQs

Package last updated on 01 Apr 2021

Did you know?

Socket

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.

Install

Related posts