otc-blockchain
v1.2.0
Published
OTC support libraries for use in Node.js and any (modern) browser
Downloads
73
Maintainers
Readme
OTC Blockchain - Nodejs / Browser libraries
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.
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("[email protected]","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("[email protected]","99.95")
.publicMessage("Happy birthday!")
.sign("my secret phrase")
.broadcast()
</script>
</head>
</html>