Skip to content

BrantaOps/branta-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Branta JavaScript SDK

Package contains functionality to assist JavaScript projects with making requests to Branta's server.

Installation

Install via npm:

npm install branta

Quick Start

import * as branta from "branta";

const client = new branta.V2BrantaClient(
  new branta.BrantaClientOptions({
    baseUrl: branta.BrantaBaseServerUrl.Localhost,
    defaultApiKey:
      "<api-key-here>",
  }),
);

var payments = await client.getPayments(
  "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
);
console.log(payments);

if (payments.length == 0) {
  console.log("Creating Payment...");
  await client.addPayment({
    description: "Testing description",
    destinations: [
      {
        value: "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
        zk: false,
      },
    ],
    ttl: "600",
  });
}

Feature Support

  • Per Environment configuration
  • V2 Get Payment by address
  • V2 Get Payment by QR Code
  • V2 Get decrypted Zero Knowledge by address and secret
  • V2 Add Payment
  • V2 Payment by Parent Platform with HMAC
  • V2 Add Zero Knowledge Payment with secret
  • V2 Check API key valid

About

A JavaScript SDK for the Branta API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published