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

ulujs

v0.7.2

Published

Ulu AVM Smart Contract Library

Downloads

1,091

Readme

ulujs

ulujs is a JavaScript library for interacting with smart contracts on the AVM blockchains. It provides a convenient interface for interacting with the smart contract tokens, nfts, and dexes.

Features

  • Interaction with smart contract tokens (arc200, arc72)
  • Comprehensive methods for performing swaps and liquidity provision (swap200)

Installation

Install ulujs in your project with:

npm install ulujs

Implementations

  • arc200 - ARC200 Smart Contract Token
  • arc72 - ARC72 Smart Contract NFT
  • hsv2 - HumbleSwap Protocol (v2)
  • swap200 - ARC200 Bases Liqudity Pool (AMM)
  • nt200 - ARC200 Wrapped Network Token (wVOI)

Usage

Import and initialize the ulujs library in your project:

import algosdk from "algosdk";
import { arc200 as Contract } from "hsv2js";

// Initialize Algod client
const algodClient = new algosdk.Algodv2(algodToken, algodServer, algodPort);
const indexerClient = new algosdk.Indexer(
  indexerToken,
  indexerServer,
  indexerPort
);

// Initialize ARC200 Contract instance
const tokenId = 123456; // Replace with your token ID
const contract = new Contract.netTok(tokenId, algodClient, indexerClient);

Event queries

The query argument may be used to retrieve matching events:

const { minRound, maxRound, address, round, txid } = query || {};

minRound and maxRound may be used to specify a range of rounds to query events from. address may be used to filter events by address. round and txid may be used to retrieve events from a specific round or transaction ID.

The following events are available for extended ARC200 token functionalities:

getEvents

Retrieve all events of the ARC200 token.

await contract.getEvents();
//{
//   arc200_Transfer: {
//     name: "arc200_Transfer",
//     signature: "...",
//     selector: "...",
//     events: [
//       [
//         "WR4C7PMYKZ45ZWFWHTQRWHL424VDYXKYH4X2BX4J6KZ7BD3IQD4Q",
//         1519106,
//         1699029707,
//         "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ",
//         "VIAGCPULN6FUTHUNPQZDRQIHBT7IUVT264B3XDXLZNX7OZCJP6MEF7JFQU",
//         10000000000000000n,
//       ],
//       ...
//     ]
//   },
//   arc200_Approval: {
//     name: "arc200_Approval",
//     signature: "...",
//     selector: "...",
//     events: [
//       [
//         "WR4C7PMYKZ45ZWFWHTQRWHL424VDYXKYH4X2BX4J6KZ7BD3IQD4Q",
//         1519106,
//         1699029707,
//         "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ",
//         "VIAGCPULN6FUTHUNPQZDRQIHBT7IUVT264B3XDXLZNX7OZCJP6MEF7JFQU",
//         10000000000000000n,
//       ],
//       ...
//     ]
//   }
//}

standard methods

The following methods are available for standard ARC200 token functionalities:

API Reference

Each method provided by ulujs offers specific functionalities:

  • getEvents(): Retrieves all events of the smart contract.

Contributing

Contributions to ulujs are welcome. Please adhere to the existing code style and ensure all tests pass.

License

ulujs is MIT licensed.