Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@notabene/nodejs

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@notabene/nodejs

Client for Notabene's API

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

Notabene JavaScript Client SDK

A JavaScript library for the Notabene API. It helps you to easily manage transactions managed through the Notabene platform.

Core Features

  • Transactions
  • TrustFramework

Getting Started

Installation

npm install @notabene/nodejs

Initialize the client

const Notabene = require("@notabene/nodejs");

const client = new Notabene({
  baseURL: "https://api-demo.notabene.id",
  auth0_audience: "https://api-demo.notabene.id",
  auth0_url: "https://notabene-eu.eu.auth0.com/oauth/token",
  clientId: "{CLIENT_ID}", // Add your own client ID
  clientSecret: "{CLIENT_SECRET}", // Add your own client secret
});

Test mode

You can use the SDK against any environment (production, demo, localhost) by setting the baseURL. The auth0_audience variable will depend on the Auth0 Application configuration.

const Notabene = require("@notabene/nodejs");

const client = new Notabene({
  baseURL: "http://localhost:3000",
  auth0_audience: "http://localhost:3000",
  auth0_url: "https://notabene-eu.eu.auth0.com/oauth/token",
  clientId: "{CLIENT_ID}", // Add your own client ID
  clientSecret: "{CLIENT_SECRET}", // Add your own client secret
});

Transactions

Creating a transaction

await client.transaction.create({
  assset: "ETH",
  amount: 1.2,
  originatorVASPdid: "did:ethr:0x6e80b82341bdf19ee43fd2fe21aca662b127e64a",
});

Approve a transaction

await client.transaction.approve("088adcf5-0693-48bf-9de4-5279ed61e0a0");

Cancel a transaction

await client.transaction.cancel("088adcf5-0693-48bf-9de4-5279ed61e0a0");

Confirm a transaction

await client.transaction.confirm("088adcf5-0693-48bf-9de4-5279ed61e0a0");

Reject a transaction

await client.transaction.reject("088adcf5-0693-48bf-9de4-5279ed61e0a0");

Accept a transaction

await client.transaction.accept("088adcf5-0693-48bf-9de4-5279ed61e0a0");

Decline a transaction

await client.transaction.decline("088adcf5-0693-48bf-9de4-5279ed61e0a0");

Redirect a transaction

await client.transaction.redirect(
  "088adcf5-0693-48bf-9de4-5279ed61e0a0",
  "did:ethr:0x842ed6cfea0dd3cb9ab707df2d86c229321b331"
);

FAQs

Package last updated on 01 Jun 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc