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

@depay/verify-payment

v1.3.1

Published

A light JavaScript/TypeScript package to decode payment instructions for the DePay payment protocol.

Downloads

25

Readme

Installation

yarn add @depay/verify-payment

or

npm install --save @depay/verify-payment

Functionality

Decode payment

import { decodePayment } from '@depay/verify-payment'

const payment = decodePayment({
  blockchain: 'ethereum',
  address: '0xF491525C7655f362716335D526E57b387799d058',
  transaction: '0x422feecb000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000243cd890b58000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000001c232f01118cb8b424793ae03f870aa7d0ac7f770000000000000000000000004ecaba5870353805a9f068101a40e0f32ed605c600000000000000000000000008b277154218ccf3380cae48d630da13462e395000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000064f2fb0400000000000000000000000000000000000000000000000000000000000000e47ff36ab5000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000800000000000000000000000005ec3153bacebb5e49136cf2d457f26f5df1b67800000000000000000000000000000000000000000000000000000000064f2fb030000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d0000000000000000000000004ecaba5870353805a9f068101a40e0f32ed605c60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000'
});

// payment = {
//   amount: BigInt('10200000000000000'),
//   token: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
//   receiver: '0x08b277154218ccf3380cae48d630da13462e3950'
// }

The decodePayment function will return a payment with the following attributes:

amount: Amount paid as BigInt

token: Address of the token used to perform the payment

receiver: Address of the payment receiver

Blockchain

You can pass blockchains in 3 different formats:

names: e.g. ethereum, bsc, polygon etc. check web3-blockchains for a list of names.

id: e.g. 1 (ethereum), 137 (polygon), 10 (optimism) etc.

hexId (lowercase): e.g. 0x1 (ethereum), 0x89 (polygon), 0xa (optimism) etc.

Address

Please make sure you pass addresses correctly checksum-formatted as it will be verified case-sensitive.

If the given address does not match the given blockchain, undefined is returned.

Transaction

The transaction needs

If the given transaction can't be decoded, undefined is returned.

Development

Get started

yarn install
yarn test