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

@ivanoliverfabra/flux

v1.0.9

Published

The Flux API Library provides a convenient way to interact with the Flux API for managing wallets, transactions, and names. This library simplifies the process of making API calls and handling responses, allowing developers to focus on building their appl

Downloads

0

Readme

Flux API Library

The Flux API Library provides a convenient way to interact with the Flux API for managing wallets, transactions, and names. This library simplifies the process of making API calls and handling responses, allowing developers to focus on building their applications.

Installation

To install the Flux API Library, you can use npm or yarn:

npm install @ivanoliverfabra/flux
# or
yarn add @ivanoliverfabra/flux
# or
pnpm add @ivanoliverfabra/flux
# or
bun add @ivanoliverfabra/flux

Usage

Initialization

To use the Flux API Library, first import it into your project:

import Flux from "@ivanoliverfabra/flux";

Then, create an instance of the Flux class with optional configuration options:

const flux = new Flux({
  apiUrl: "https://api.fabra.live",
  apiVersion: "v1",
});

Wallets

Get Wallets

Retrieve a list of wallets:

const wallets = await flux.wallets.get({ page: 1, limit: 10 });

Create Wallet

Create a new wallet:

const newWallet = await flux.wallets.create();

Get Rich Wallets

Retrieve a list of rich wallets:

const richWallets = await flux.wallets.rich({ page: 1, limit: 10 });

Get Wallet by Address

Retrieve information about a specific wallet by its address:

const wallet = await flux.wallets.getByAddress("wallet_address");

Get Wallet Transactions

Retrieve transactions associated with a specific wallet:

const transactions = await flux.wallets.getTransactions("wallet_address", {
  page: 1,
  limit: 10,
});

Get Wallet Names

Retrieve names associated with a specific wallet:

const names = await flux.wallets.getNames("wallet_address");

Transactions

Get Transactions

Retrieve a list of transactions:

const transactions = await flux.transactions.get({ page: 1, limit: 10 });

Create Transaction

Create a new transaction:

const newTransaction = await flux.transactions.create(
  privateKey,
  to,
  amount,
  metadata
);

Get Latest Transactions

Retrieve the latest transactions:

const latestTransactions = await flux.transactions.latest({
  page: 1,
  limit: 10,
});

Get Transaction by ID

Retrieve information about a specific transaction by its ID:

const transaction = await flux.transactions.getById("transaction_id");

Names

#Get Names Retrieve a list of names:

const names = await flux.names.get({ page: 1, limit: 10 });

Get Name Cost

Retrieve the cost of a name:

const cost = await flux.names.cost();

Get Latest Names

Retrieve the latest names:

const latestNames = await flux.names.latest({ page: 1, limit: 10 });

Get Name Logs

Retrieve logs associated with a name:

const logs = await flux.names.logs({ page: 1, limit: 10 });

Get Log by ID

Retrieve information about a specific log by its ID:

const log = await flux.names.logById("log_id");

Get Logs by Name

Retrieve logs associated with a specific name:

const logs = await flux.names.logsByName("name", { page: 1, limit: 10 });

Get Name by Name

Retrieve information about a specific name by its name:

const name = await flux.names.getByName("name");

Create Name

Create a new name:

const newName = await flux.names.create(privateKey, "name");

Transfer Name

Transfer ownership of a name:

const transfer = await flux.names.transfer(
  privateKey,
  "name",
  "new_owner_address"
);

Check Name Availability

Check if a name is available:

const isAvailable = await flux.names.isAvailable("name");

Contributing

Contributions are welcome! Feel free to open issues and pull requests on the GitHub repository.

License

This library is licensed under the MIT License.