Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@depay/verify-payment

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@depay/verify-payment

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

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
2
Created
Source

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

Keywords

verify

FAQs

Package last updated on 04 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts