cuprumtez
TypeScript icon, indicating that this package has built-in type declarations

0.6.2 • Public • Published

Sotez - A JS Library for Tezos

npm Build Status

Getting Started

npm install sotez
// Import library or individual modules
import Sotez, { utility, forge, crypto, ledger } from 'sotez';

// Or using require
const Sotez = require('sotez').default;
const { utility, forge, crypto, ledger } = require('sotez');
const sotez = new Sotez('http://127.0.0.1:8732');

const example = async () => {
  // A secret key or a ledger must be imported to sign transactions
  // await sotez.importLedger();
  await sotez.importKey('...');

  // A simple transfer operation
  const { hash } = await sotez.transfer({
    to: 'tz1RvhdZ5pcjD19vCCK9PgZpnmErTba3dsBs',
    amount: '1000000',
  });

  console.log(`Injected Operation Hash: ${hash}`);

  // Await confirmation of included operation
  const block = await sotez.awaitOperation(hash);
  console.log(`Operation found in block ${block}`);
};

sotez.query('/chains/main/blocks/head')
  .then(response => console.log(response));

crypto.generateMnemonic()
  .then(mnemonic => console.log(mnemonic));

Documentation

Documentation can be found HERE.

Development

npm install
npm run build

Compiled files will be located in the lib folder. Distribution files will be located in the dist/node and dist/web folders.

License

MIT

Credits

Credits to Stephen Andrews and EZTZ.

Package Sidebar

Install

npm i cuprumtez

Weekly Downloads

0

Version

0.6.2

License

MIT

Unpacked Size

1.66 MB

Total Files

30

Last publish

Collaborators

  • researchdv