Giter Site home page Giter Site logo

sotez's Introduction

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.

sotez's People

Contributors

andrewkishino avatar neocybereth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.