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

aftr-market

v1.1.77

Published

Library to interact with AFTR Market

Downloads

24

Readme

AFTR is a protocol that groups or encapsulates assets in the Arweave ecosystem. The first use case is called AFTR.Market which presets treasury management and governance for Arweave assets.

// When you update the repository(code), make sure you build it so that it's ready for the run

npm run build

// When you publish your code make sure your version(in package,json) always updated. and after that use followig command to pulish your library.

npm publish

Installation Package Command

npm install aftr-market

js

Library to interact with AFTR Market

Initialization

import Aftr from "aftr-market";

const client = new Aftr();

Usage

The library supports data requests and interactions with the protocol:

Create Vehicle

// example usage to access the create vehicle function await client.vehicle.createVehicle(...);

Adding a new vehicle.

await client.vehicle.createVehicle(vehicleObject, wallet, options)

The function takes three params:

  • vehicleObject: json object that defines the vehicle (the object should follow the state interface in the faces.ts file)
  • wallet: Optional. In order to create the contract (this is a keyfile object or the “use_wallet” string if the developer is using this in a browser with Arconnect).
  • options - optional object that defines optional parameters such as testnet.
    • Parameters - If the options object is specified, then the createVehicle method will use these values as opposed to the hardcoded values in the code.
      • aftrSourceContractId: string
      • aftrProtocolTag: string (the Protocol tag is hardcoded for production as “AFTR”) - The protocol tag is always required, so if it’s not specified in the options object, it is hardcoded in the code.
      • customTags: array of {name: “”, value: “”} - this gives the user the opportunity to add custom tags
      • Example options object:
      {
      	aftrSourceContractId: <string>,  // Allows user to add a contract Id for test purposes. If no value is supplied, then the hardcoded value is used.
      	aftrProtocolTag: "AFTR-BETA",    // Allows user to customize Protocol tag. If no value provided, "AFTR" is hardcoded.
      	customTags: [
      		{ "<CUSTOM_NAME>": "<CUSTOM_VALUE>" }, // Allows user to add tags
      	]
      }

The function returns the created vehicle ID.

Edit Vehicle

Edit the existing vehicle.

await client.vehicle.editVehicle(wallet, vehicleId, [{"name" : "test-2"}, {"ticker" : "CHILL-1"}])

The function takes three params:

  • wallet: Optional. In order to create the contract (this is a keyfile object or the “use_wallet” string if the developer is using this in a browser with Arconnect).
  • vehicleId - Contract ID of the vehicle to be edited
  • changeMap(Array of object) - map of items to be changed