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 🙏

© 2025 – Pkg Stats / Ryan Hefner

liqwid-sdk

v1.2.2

Published

A React widget for displaying Liqwid Finance yield earnings data

Readme

💧 Liqwid SDK

A plug-and-play React SDK for displaying Liqwid Finance yield earnings data. Easily embed yield tracking functionality into any website or React application.

Live demo available at: https://liqwid-sdk-demo.vercel.app/

npm version License: MIT

✨ Features

  • 🎨 Beautiful UI: Custom-designed SDK with Liqwid Finance branding
  • 📱 Responsive: Works perfectly on desktop, tablet, and mobile
  • 🔌 Easy Integration: Use as React component or vanilla JavaScript
  • 💰 Multi-Currency: Support for GBP, USD, EUR
  • Real-time Data: Fetches live yield data from Liqwid Finance API

🏗️ Installation

NPM/Yarn (React Projects)

npm install liqwid-sdk

CDN (HTML/Vanilla JS)

<!-- React Dependencies -->
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>

<!-- Liqwid SDK -->
<script src="https://unpkg.com/liqwid-sdk/dist/liqwid-sdk.umd.js"></script>

🚀 Quick Start

React Component

import React from 'react';
import { LiqwidSDK } from 'liqwid-sdk';

function App() {
  return (
    <div>
      <h1>My DeFi Dashboard</h1>
      
      {/* Basic SDK - user enters their address */}
      <LiqwidSDK currency="USD" />
      
      {/* Pre-filled SDK */}
      <LiqwidSDK
        addresses={['address1','address2?']}
        currency="GBP" 
      />
    </div>
  );
}

HTML + JavaScript

<!DOCTYPE html>
<html>
<head>
  <title>My Website</title>
</head>
<body>
  <!-- SDK container -->
  <div id="liqwid-sdk"></div>

  <!-- Scripts -->
  <script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
  <script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
  <script src="https://unpkg.com/liqwid-sdk/dist/liqwid-sdk.umd.js"></script>
  
  <script>
    // Initialize the SDK
    LiqwidSDK.create({
      elementId: 'liqwid-sdk',
      currency: 'USD'
    });
  </script>
</body>
</html>

⚙️ Configuration

| Prop | Type | Default | Description | |------|------|---------|-------------| | addresses | string[] | [] | Array of Cardano addresses to fetch yield data for | | currency | 'GBP' \| 'USD' \| 'EUR' | 'GBP' | Display currency for yield amounts |

📖 Examples

Next.js Integration

// components/LiqwidSDK.tsx
import dynamic from 'next/dynamic';

const LiqwidSDK = dynamic(() => import('liqwid-sdk'), {
  ssr: false,
  loading: () => <p>Loading Liqwid SDK...</p>
});

export default function DashboardPage() {
  return (
    <div>
      <h1>Portfolio Dashboard</h1>
      <LiqwidSDK currency="USD" />
    </div>
  );
}

WordPress Integration

Add this to your theme or use a code injection plugin:

<!-- Add to your post/page -->
<div id="liqwid-sdk" style="margin: 20px 0;"></div>

<script>
  // Load dependencies if not already loaded
  if (!window.React) {
    document.head.appendChild(Object.assign(document.createElement('script'), {
      src: 'https://unpkg.com/react@18/umd/react.production.min.js',
      crossOrigin: 'anonymous'
    }));
  }
  
  if (!window.ReactDOM) {
    document.head.appendChild(Object.assign(document.createElement('script'), {
      src: 'https://unpkg.com/react-dom@18/umd/react-dom.production.min.js',
      crossOrigin: 'anonymous'
    }));
  }
  
  // Load SDK
  document.head.appendChild(Object.assign(document.createElement('script'), {
    src: 'https://unpkg.com/liqwid-sdk/dist/liqwid-sdk.umd.js',
    onload: () => {
      LiqwidSDK.create({
        elementId: 'liqwid-sdk',
        currency: 'USD'
      });
    }
  }));
</script>

Vue.js Integration

<template>
  <div ref="sdkContainer" id="liqwid-sdk"></div>
</template>

<script>
export default {
  name: 'LiqwidSDK',
  async mounted() {
    // Dynamically import the SDK
    const { LiqwidSDK } = await import('liqwid-sdk/dist/liqwid-sdk.umd.js');
    
    LiqwidSDK.create({
      elementId: 'liqwid-sdk',
      currency: 'EUR'
    });
  }
}
</script>

🎨 Customization

The SDK uses CSS custom properties for easy theming:

.liqwid-sdk {
  --sdk-max-width: 400px;
  --sdk-border-radius: 12px;
  --sdk-primary-color: #667eea;
  --sdk-text-color: white;
}

🔧 Development

# Clone the repository
git clone https://github.com/yourusername/liqwid-sdk.git
cd liqwid-sdk

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Run tests
npm test

📊 API Reference

The SDK integrates with the Liqwid Finance GraphQL API:

Endpoint: https://v2.api.liqwid.finance/graphql

Query: GetYieldEarned

query GetYieldEarned($input: YieldEarnedInput!, $currencyInput: InCurrencyInput) {
  historical {
    yieldEarned(input: $input) {
      totalYieldEarned(input: $currencyInput)
      markets {
        id
        amount
        amountInCurrency(input: $currencyInput)
      }
    }
  }
}

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

🏷️ Changelog

v0.1.0

  • Initial release
  • React component and vanilla JS support
  • Multi-currency display
  • Responsive design
  • Real-time data fetching

Built with ❤️ by @itzdanny for the Cardano ecosystem