otc-sdk

OTC support libraries for use in Node.js and any (modern) browser


Keywords
otc, otc-sdk, blockchain, websocket, nodejs, npm-package, typescript, javascript, cryptography, microservices
License
MIT
Install
npm install otc-sdk@2.1.2

Documentation

OTC Blockchain - Nodejs / Browser libraries

Travis styled with prettier Dev Dependencies NPM version

OTC support libraries for Node.js and the browser

Links

GITHUB otc-sdk

Functionality

With OTC-SDK you get full client-side/offline functionality of everything involving OTC Blockchain. This includes but is not limited to:

  • Full OTC API wrapper
  • Support for real-time updates through OTC websocket API
  • Complete client side support for both constructing and parsing binary transaction data
  • Full client side encryption/decryption support for transaction attachments
  • Support for all other low-level OTC functionality. But all client side, no server needed! (publickeys, accountids, transaction signatures etc.)

Samples

All samples open in https://runkit.com/ which gives you a live Nodejs environment, feel free to play around change the code samples, click RUN and see the output.

NODEJS | API ACCESS

NODEJS | GENERATE ACCOUNT

BROWSER | GENERATE ACCOUNT

NODEJS | DEX USD to OTC

BROWSER | DEX USD to OTC

BROWSER | BLOCK WHEN?

BROWSER | WEBSOCKETS

Usage

Node

Install otc-sdk

npm install otc-sdk --save

When using TypeScript install @typings with

npm install @types/otc-sdk --save

Require otc-sdk and use it in your project

var {OtcSDK} = require('otc-sdk')
var sdk = new OtcSDK()
sdk.payment("mike@otc.network","99.95")
   .publicMessage("Happy birthday!")
   .sign("my secret phrase")
   .broadcast()

Browser

otc-sdk comes as an UMD module which means you could either require or import {otcsdk} from 'otc-sdk' or simply load as <script src=""> and access it through window.otcsdk

<html>
  <head>
    <script src="otc-sdk.js"></script>
    <script>
      var sdk = new otcsdk.OtcSDK()
      sdk.payment("mike@otc.network","99.95")
         .publicMessage("Happy birthday!")
         .sign("my secret phrase")
         .broadcast()
    </script>
  </head>
</html>