
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@depay/verify-payment
Advanced tools
A light JavaScript/TypeScript package to decode payment instructions for the DePay payment protocol.
yarn add @depay/verify-payment
or
npm install --save @depay/verify-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
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.
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.
The transaction needs
If the given transaction can't be decoded, undefined is returned.
yarn install
yarn test
FAQs
A light JavaScript/TypeScript package to decode payment instructions for the DePay payment protocol.
The npm package @depay/verify-payment receives a total of 23 weekly downloads. As such, @depay/verify-payment popularity was classified as not popular.
We found that @depay/verify-payment demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.