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

@zbd/node

v0.6.4

Published

ZBD NodeJS SDK

Downloads

814

Readme

Node.js library for the ZBD API

bitcoin ln payments

license npm latest package latest build PRs Welcome


Introduction

This is the SDK for NodeJS that interacts with the ZBD API.

ZBD is the payments platform for modern developers, providing the speed and reliability innovators need to create monetized and meaningfully-engaging user experiences.

We enable businesses and consumers to quickly introduce instantaneous Bitcoin payments to the fabric of their applications, games, and platforms. ZBD has the most comprehensive set of Bitcoin Lightning API capabilities and is industry-leader in supporting companies in the fields of gaming, social, adtech and fintech.

With ZBD, it's easy! Anyone can do it. What are YOU building?


Installation

If you're an npm user:

npm install @zbd/node

Or if you're a Yarn user:

npm install @zbd/node

Available API Methods

Below you can find source code examples of how to use each of the available API methods in the @zbd/node SDK library.

createCharge

// Construct payload
const payload = {
  amount: '15000',
  expiresIn: 300,
  internalId: '1b8h1-h1675',
  description: 'Charge description',
  callbackUrl: 'https://your-domain.com/zbd-callback'
}

// Create Charge / Payment Request
const data = await zbd.createCharge(payload);

getCharge

// Get Charge Details
const data = await zbd.getCharge('1907b0fe-789b-4e27-b18a-0c3c0f5cced7');

decodeCharge

// Construct payload
const payload = {
  invoice: 'lnbc2123250n1pjpr2qmpp526234tljpx5756pa2fyj2zrdmn2tnz9rhj54km2s7dv0pap3vtkqhp5extcuyp2x0ydfwnfhrc5cwx8azxeen2g7hxr29464ezvn3k6w2fqcqzpgxqzjcsp5xzelh2w3twt4ysvva2ugu2klurmrl7nk8h46x2hcthf9cvee24jq9qyyssq6an9tjftjymjeklerjmw8cv4ccpsvd2vzuzxn5upt9s37hnw2r0z0n5cd8cqq8jq5ems00tugt5jnw5jn03tr84945nd6j4hsfsu7kqp9hptk2'
}

// Decode Charge
const data = await zbd.decodeCharge(payload);

createStaticCharge

// Construct payload
const payload = {
  maxAmount: '20000',
  minAmount: '10000',
  internalId: '1b8h1-h1675',
  description: 'Static Charge API Ref',
  callbackUrl: 'https://your-domain.com/zbd-callback',
  successMessage: 'Congratulations your payment was successful!'
}

// Create Static Charge QR
const data = await zbd.createStaticCharge(payload);

getStaticCharge

// Get Static Charge Details
const data = await zbd.getCharge('6557a0fe-7a9b-4e27-b18a-0c3c0f5cced7');

updateStaticCharge

// Construct update payload
const updatePayload = {
  maxAmount: '5000000',
  minAmount: '10000',
  ...
}

// Update Static Charge Details
const data = await zbd.updateStaticCharge(
  '6557a0fe-7a9b-4e27-b18a-0c3c0f5cced7',
  updatePayload,
);

createWithdrawalRequest

// Construct payload
const payload = {
  amount: '15000',
  description: 'Withdraw QR!',
  expiresIn: 300,
  internalId: '1b8h1-h1675',
  callbackUrl: 'https://your-domain.com/zbd-callback'
}

// Create Withdrawal Request 
const data = await zbd.createWithdrawalRequest(payload);

getWithdrawalRequest

// Get Withdrawal Request Details
const data = await zbd.getWithdrawalRequest('6557a0fe-7a9b-4e27-b18a-0c3c0f5cced7');

sendLightningAddressPayment

// Construct payload
const payload = {
  amount: '15000',
  lnAddress: '[email protected]',
  comment: 'Lightning fast!',
  internalId: '1b8h1-h1675',
  callbackUrl: 'https://your-domain.com/zbd-callback'
}

// Sending Lightning Address Payment
const data = await zbd.sendLightningAddressPayment(payload);

validateLightningAddress

// Validate Lightning Address
const data = await zbd.validateLightningAddress('[email protected]');

createChargeFromLightningAddress

// Construct payload
const payload = {
  amount: '15000',
  lnAddress: '[email protected]',
  description: 'Lightning fast!',
}

// Create Charge / Payment Request for given ZBD Gamertag
const data = await zbd.createChargeFromLightningAddress(payload);

getWallet

// Get Wallet Balance
const data = await zbd.getWallet();

internalTransfer

// Construct payload
const payload = {
  amount: '10000',
  receiverWalletId: 'b994ee02-dc0b-4f14-b99f-1f2d3daa01a6'
}

// Initiate Internal Transfer
const data = await zbd.internalTransfer(payload);

sendKeysendPayment

// Construct payload
const payload = {
  amount: '10000',
  callbackUrl: 'https://your-domain.com/zbd-callback',
  pubkey: '0332d57355d673e217238ce3e4be8491aa6b2a13f95494133ee243e57df1653ace',
}

// Sending Keysend Payment
const data = await zbd.sendKeysendPayment(payload);

sendPayment

// Construct payload
const payload = {
  description: 'Lightning fast!',
  invoice: 'lnbc2123250n1pjpr2qmpp526234tljpx5756pa2fyj2zrdmn2tnz9rhj54km2s7dv0pap3vtkqhp5extcuyp2x0ydfwnfhrc5cwx8azxeen2g7hxr29464ezvn3k6w2fqcqzpgxqzjcsp5xzelh2w3twt4ysvva2ugu2klurmrl7nk8h46x2hcthf9cvee24jq9qyyssq6an9tjftjymjeklerjmw8cv4ccpsvd2vzuzxn5upt9s37hnw2r0z0n5cd8cqq8jq5ems00tugt5jnw5jn03tr84945nd6j4hsfsu7kqp9hptk2',
  internalId: '1b8h1-h1675',
  callbackUrl: 'https://your-domain.com/zbd-callback'
}

// Make Payment
const data = await zbd.sendPayment(payload);

getPayment

// Get Payment Transaction Details
const data = await zbd.getPayment('6557a0fe-7a9b-4e27-b18a-0c3c0f5cced7');

sendGamertagPayment

// Construct payload
const payload = {
  amount: '10000',
  gamertag: 'andre',
  description: 'Sending to ZBD Gamertag',
}

// Sending ZBD Gamertag Payment
const data = await zbd.sendGamertagPayment(payload);

getGamertagTransaction

// Get Gamertag Payment Transaction Details
const data = await zbd.getGamertagTransaction('6557a0fe-7a9b-4e27-b18a-0c3c0f5cced7');

getUserIdByGamertag

// Get User ID
const data = await zbd.getUserIdByGamertag('satoshi');

getGamertagByUserId

// Get User ID
const data = await zbd.getGamertagByUserId('6557a0fe-7a9b-4e27-b18a-0c3c0f5cced7');

isSupportedRegion

// Is Supported Region
const data = await zbd.isSupportedRegion('12.110.139.14');

getZBDProdIps

// Get ZBD API Production IPs
const data = await zbd.getZBDProdIps();

getBtcUsdExchangeRate

// Get BTC USD Exchange Rate
const data = await zbd.getBtcUsdExchangeRate();

Full API Reference & Configuration

View full documentation and API reference for the @zbd/node library.

HTTP REST API

Reminder that while you should use the @zbd/node library if you're in a Node.js environment, you can also work with the HTTP API directly. Full API reference and details can be found here.

Support

Join our Discord