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

@algodex/algodex-sdk

v2.2.5

Published

API calls for interacting with the Algorand blockchain

Downloads

142

Readme

@algodex/algodex-sdk

semantic-release

algodex/algodex-sdk:main

Client-side JavaScript API calls for Algodex as an npm package

Github

SDK Reference

Examples

Algodex Documentation

⚙ Getting Started

✨ Prerequisites

📦 Installing

NPM

npm install @algodex/algodex-sdk

Yarn

yarn add @algodex/algodex-sdk

⚗ Usage

🔧 Configuration:

⚠ The API resources must be accessible with valid credentials (where necessary).

The SDK fetches data from the following API resources:

The service URIs, token, port are passed into the AlgodexAPI constructor. See API Properties for more information

⚙ Example Testnet config.json

{
  "config": {
    "algod": {
      "uri": "https://testnet-algorand.api.purestake.io/ps2",
      "token": "<TOKEN>"
    },
    "indexer": {
      "uri": "https://algoindexer.testnet.algoexplorerapi.io",
      "token": ""
    },
    "explorer": {
      "uri": "https://indexer.testnet.algoexplorerapi.io",
      "port": ""
    },
    "dexd": {
      "apiVersion": 2,
      "uri": "https://testnet.algodex.com/api/v2",
      "token": ""
    }
  }
}

⚙ Example Mainnet config.json

{
  "config": {
    "algod": {
      "uri": "https://mainnet-algorand.api.purestake.io/ps2",
      "token": "<TOKEN>"
    },
    "indexer": {
      "uri": "https://algoindexer.algoexplorerapi.io",
      "token": ""
    },
    "explorer": {
      "uri": "https://indexer.algoexplorerapi.io",
      "port": ""
    },
    "dexd": {
      "apiVersion": 2,
      "uri": "https://app.algodex.com/api/v2",
      "token": ""
    }
  }
}

🏗 Constructing

 const config = require('./config.json')
 const AlgodexAPI = require('@algodex/algodex-sdk')
 const api = new AlgodexAPI(config)

💱 Placing Orders:

💡️ We recommend reading the following links before placing your first order: Maker Order | Taker Order | Orderbook

Maker Buy Order

// Configure wallet
api.setWallet({
  "type": "sdk",
  "address": "WYWRYK42XADLY3O62N52BOLT27DMPRA3WNBT2OBRT65N6OEZQWD4OSH6PI",
  "connector": require('@algodex/algodex-sdk/lib/wallet/connector/AlgoSDK'),
  "mnemonic": "Your 25 word mneumonic goes here"
})


// Placing an Order
const orders = await api.placeOrder({
  "asset": {
    "id": 15322902, // Asset Index
    "decimals": 6, // Asset Decimals
  },
  "address": "WYWRYK42XADLY3O62N52BOLT27DMPRA3WNBT2OBRT65N6OEZQWD4OSH6PI",
  "price": 2.22, // Price in ALGOs
  "amount": 1, // Amount to Buy or Sell
  "execution": "maker", // Type of exeuction
  "type": "buy", // Order Type
})

// Closing an Order
await api.closeOrder(orders[0])

📚 Documentation

All available execution types are found in the Place Order Tutorial

🏘 Community

🕸 Links