Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

tezos-sign

yugasun333MIT1.4.1

Offline tool for tezos

readme

tezos-sign

license Build Status NPM downloads

English | 简体中文

Offline sign tool for tezos divided from eztz

Directory

.
├── demo use demo
├── dist build output dir
├── doc docs
├── src source code
├── test unit test
├── CHANGELOG.md change log
└── TODO.md todo

Usage Guide

Install by npm:

$ npm install --save tezos-sign

For node:

var TezosSign = require('tezos-sign');

For webpack:

import TezosSign from 'tezos-sign';

Demo

import TezosSign from 'tezos-sign';

// sign transaction
// opbytes is operation bytes
// privateKey is your account private key
const siged = TezosSign.sign(opbytes, privateKey);

// generate transaction hash
// sopbytes = signed.sbytes
const hash = TezosSign.generateTxHash(sopbytes);

// generate keys
const keys = TezosSign.generateKeys('yugasun');
/*
keys {
    mnemonic: 'memory key words',
    passphrase: 'yugasun',
    sk: 'private key',
    pk: 'public key',
    pkh: 'address',
}
*/

// generate keys without seed
const keysNoSeed = TezosSign.generateKeysNoSeed();
/*
keysNoSeed {
    sk: 'private key',
    pk: 'public key',
    pkh: 'address',
}
*/

// extract keys
const extractKeys = TezosSign.extractKeys(keys.sk);
/*
extractKeys {
    sk: 'private key',
    pk: 'public key',
    pkh: 'address',
}
*/

Develop

Install dependencies:

$ npm install

Build:

$ npm run build

Unit test:

$ npm test

Modify version in package.json, README.md, and release it

$ npm run release

Npm publish:

$ npm publish

License

MIT

changelog

Change Log

1.3.0 / 2018-11-15

  • Offline sign
  • Generate public/private keys with seed or no seed.
  • Decrypt private keys.
  • Generate transaction hash.