https://github.com/creativechain/trantor-js
Creativechain Trantor Lib for JS
https://github.com/creativechain/trantor-js
blockchain content creativechain creativecoin ledger trantor
Last synced: 5 months ago
JSON representation
Creativechain Trantor Lib for JS
- Host: GitHub
- URL: https://github.com/creativechain/trantor-js
- Owner: creativechain
- License: gpl-3.0
- Created: 2018-03-30T18:51:46.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-15T21:07:06.000Z (about 8 years ago)
- Last Synced: 2025-10-21T12:14:59.723Z (8 months ago)
- Topics: blockchain, content, creativechain, creativecoin, ledger, trantor
- Language: JavaScript
- Homepage:
- Size: 83 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Trantor-JS
#### Installation
```
npm install trantor-js
```
#### Serialization of data
```js
let {Author} = require("trantor-js")
//Serialize author data
let author = new Author('CSoY2vaLcZXRhgMsDGq86V9J9n3rVLhYAE', 'nick', 'email@example.com', 'example.com', 'description', '/IPFS/CID', ['tags']);
let bufferData = author.serialize();
console.log(bufferData.toString('hex'));
//Output: 01000271686f1f3c14aa547b824091445ab99fabc56928046e69636b11656d61696c406578616d706c652e636f6d0b6578616d706c652e636f6d0b6465736372697074696f6e092f495046532f434944085b2274616773225d
```
#### Deserialization
```js
let {Author, ContentData} = require("trantor-js");
let bufferData = Buffer.from('01000271686f1f3c14aa547b824091445ab99fabc56928046e69636b11656d61696c406578616d706c652e636f6d0b6578616d706c652e636f6d0b6465736372697074696f6e092f495046532f434944085b2274616773225d', 'hex');
let author = ContentData.deserialize(bufferData);
console.log(author); //Must be a Author Object
```
#### License
```
GNU GPLv3
Trantor-JS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Trantor-JS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Trantor-JS. If not, see .
```