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 🙏

© 2026 – Pkg Stats / Ryan Hefner

decash-utils

v3.0.0

Published

Utilities for DeCash tokens

Downloads

22

Readme

NPM version LICENSE Build & publish

decash-utils

Utilities for building on top of DeCash - the most easy-to-use and technically perfected stablecoin.

Read more about DeCash at docs.decash.com. Find the DeCash API reference here.

Installation

npm install --save decash-utils

Usage

algorandDecodeSignature({ logicsig })

This example demonstrates how to decode a logic signature, which:

  1. Shows whether the sender is a Delegated Wallet (when senderDelegatedWallet is returned).
  2. Gets properties (like the owner or seed) of this Delegated Wallet.
import { algorandDecodeSignature } from 'decash-utils';

// A part of the response from {Algorand Indexer (testnet)}/v2/blocks/21198914
const { senderDelegatedWallet } = algorandDecodeSignature({
  logicsig: {
    args: ['AA=='],
    logic:
      'BSACAAEmASDK6flECgvcY5MQRC3FjvVNKytcXjCk4eLKQJV+0fIxjShIgYCAgICAgICAAEgxIDIDEkQtFyMSQACHLRciEkAAeAAiNQA0ADIEDEEAfjQAOBCBBhJAAA8iQAAJNAAjCDUAQv/hI0M0ADgYgeCq7qGAgICAABJAAAQiQv/cNAA4GzEWDUAABCJC/840ADEWwhoiI1I0AUAAG4ABThJAAAQiQv+1NAA0AMIaIiNSgAF2EkL/pYABWUL/4ogAEDUBQv+BLjEXKAQ1AUL/dwAiNQA0ADIEDEEAFDQAOAAoEkAACTQAIwg1AEL/5iOJIok=',
  },
});

if (senderDelegatedWallet) {
  console.log(`
    The transaction sender is DeCash Delegated Wallet, owned by ${senderDelegatedWallet.owner};
    Wallet's seed: ${senderDelegatedWallet.seed};
    Validator smart contract ID: ${senderDelegatedWallet.validatorAppId}.
  `);
} else {
  console.log('The transaction sender is not a DeCash Delegated Wallet.');
}

algorandGetDelegatedWalletAddress({ owner, seed, validatorAppId })

Returns the address of the Delegated Wallet with the given owner, validatorAppId and optional seed.

import { algorandGetDelegatedWalletAddress } from 'decash-utils';

const address = algorandGetDelegatedWalletAddress({
  owner: 'ZLU7SRAKBPOGHEYQIQW4LDXVJUVSWXC6GCSODYWKICKX5UPSGGGYQCH654',
  validatorAppId: 71013728, // Network-dependent. Get the validator APP ID from https://docs.decash.com/docs/concepts/delegated-wallets#verifier
});
// address = 'QCLGDBMIGC5EV4WA4J4TZCUKZURQ5BORMC3WQYBWJCXDILCDQFLPMT4ZCE'

algorandGetDelegatedWalletLogicSig({ owner, seed, validatorAppId })

This example demonstrates how to get the logic signature of a DeCash Delegated Wallet, which then can be used to sing transaction outgoing from the Delegated Wallet.

import { LogicSigAccount, signLogicSigTransaction } from 'algosdk';
import { algorandGetDelegatedWalletLogicSig } from 'decash-utils';

const delegatedWalletCode = algorandGetDelegatedWalletLogicSig({
  owner: '6E63EKJYUPLL4SKM5FNX3PD7HSWZ26XPS7BXYLVWJAPDEK3VA7DERTFV4E', // The owner of the delegated wallet.
  seed: 0, // Optional. Default is 0.
  validatorAppId: 71013728, // Network-dependent. Get the validator APP ID from https://docs.decash.com/docs/concepts/delegated-wallets#verifier
});

const logicSigAccount: LogicSigAccount = new LogicSigAccount(
  delegatedWalletCode,
  [new Buffer.from('\x00')] // "Self-sign"
);
const signedTx = signLogicSigTransaction(txn, logicSigAccount).blob;

Utility functions

You can use these exported utility functions for various purposes.

import {
  algorandAddressToUInt8Array,
  base32ToUInt8Array,
  base64ToUInt8Array,
  uInt8ArrayToAlgorandAddress,
  uInt8ArrayToBase32,
  uInt8ArrayToBase64,
  uInt8ArrayToVarInt,
  varIntToUInt8Array,
} from 'decash-utils';

Development

To make a new package version,

  1. Add your new code and tests.
  2. Update the package version in package.json.
  3. Push or pull request to main. The package will be deployed by GitHub Workflows.

License

MIT © DeCash