Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Latest commit

 

History

History
80 lines (53 loc) · 1.43 KB

README.md

File metadata and controls

80 lines (53 loc) · 1.43 KB

Crypti JS

A client-side transactions library for Crypti. Allows transactions to be sent from within the browser, using a simple API.

Installation

git clone [email protected]:karmacoma/crypti-js.git
cd crypti-js
npm install

Tests

npm test

Tests written using mocha + schedule.js.

Usage

Each function call has secondSecret parameter, this parameter is optional.

Create transaction

Send 1000 XCR to 1859190791819301C

var crypti = require('crypti-js');
var transaction = crypti.transaction.createTransaction("1859190791819301C", 1000, "secret", "secondSecret");

Create second signature transaction

var crypti = require('crypti-js');
var transaction = crypti.transaction.createTransaction("secret", "secondSecret");

Create delegate transaction

var crypti = require('crypti-js');
var transaction = crypti.transaction.createDelegate("secret", "username", "secondSecret");

Create vote transaction

var crypti = require('crypti-js');
var transaction = createVote("secret", ["+58199578191950019299181920120128129"], "secondSecret");

Peers Communication

All transactions are sent to /api/peer/transactions using the POST method.

Example:

Method: POST
Content-Type: application/json

{
    "transaction" : {
        ...
    }
}

Authors

License

MIT