Giter Site home page Giter Site logo

zbd-node's Introduction

ZEBEDEE Node.js SDK


Node.js library for the ZEBEDEE API


bitcoin ln payments

license npm latest package latest build PRs Welcome


Documentation · Developer Dashboard · Dev Playground · API Status



Introduction

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

ZEBEDEE 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. ZEBEDEE 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 ZEBEDEE, 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 ZEBEDEE 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

zbd-node's People

Contributors

andrerfneves avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.