Skip to content

BrantaOps/branta-js

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 i @branta-ops/branta

Quick Start

For Wallets

import { V2BrantaClient, BrantaServerBaseUrl } from "@branta-ops/branta";

const client = new V2BrantaClient({
  baseUrl: BrantaServerBaseUrl.Production,
});

await client.getPayments("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa");

For Platforms

import { V2BrantaClient, BrantaServerBaseUrl } from "@branta-ops/branta";

const client = new V2BrantaClient({
  baseUrl: BrantaServerBaseUrl.Production,
  defaultApiKey: "<default-api-key>",
});

await client.addPayment({
  description: "Testing description",
  destinations: [
    {
      value: "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
      isZk: false,
    },
  ],
  ttl: 600,
});

For Parent Platforms

import { V2BrantaClient, BrantaServerBaseUrl } from "@branta-ops/branta";

const client = new V2BrantaClient({
  baseUrl: BrantaServerBaseUrl.Production,
  defaultApiKey: "<default-api-key>",
  hmacSecret: "<hmac-secret>",
});

await client.addPayment({
  description: "Testing description",
  destinations: [
    {
      value: "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
      isZk: 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

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors