Package Exports
- sotez
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sotez) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Sotez - A JS Library for Tezos
Getting Started
npm install sotez
// Import library or individual modules
import { Sotez, utility, forge, cryptoUtils, ledger, Key } from 'sotez';
import { Sotez } from 'sotez';
const tezos = new Sotez('http://127.0.0.1:8732');
const example = async () => {
// A secret key or a ledger must be imported to sign transactions
// import TransportNodeHid from "@ledgerhq/hw-transport-node-hid";
//
// await tezos.importLedger(TransportNodeHid, "44'/1729'/0'/0'");
await tezos.importKey('...');
// A simple 1ꜩ transfer operation
const { hash } = await tezos.transfer({
to: 'tz1RvhdZ5pcjD19vCCK9PgZpnmErTba3dsBs',
amount: 1000000,
});
console.log(`Injected Operation Hash: ${hash}`);
// Await confirmation of included operation
const block = await tezos.awaitOperation(hash);
console.log(`Operation found in block ${block}`);
};
sotez
.query('/chains/main/blocks/head')
.then((response) => console.log(response));
cryptoUtils.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.
License
MIT
Credits
Credits to Stephen Andrews and EZTZ.