0.0.15 • Published 3 years ago

ztakio-lib v0.0.15

Weekly downloads
19
License
ISC
Repository
-
Last release
3 years ago

ztakio-lib:

A quick and easy library to connect and interact with a ztakio-server.

Usage:

const ztaklib = require('ztakio-lib')
const wif = 'YOUR WIF'

ztaklib.connect('ws://localhost:3041', async () => {
  ztaklib.watch('.*', console.log) // To watch all changes
  await ztaklib.get('/_/mempool') // Get the mempool state
  await ztaklib.get('/ztak/coin/ZfEfwe...') // Get a balance for a token

  let code = await ztaklib.template('nft_send', { // Get a template to send an NFT
    path: '/ztak/nft',
    name: 'test1',
    destination: 'ZaswWd....'
  })
  let compiled = ztaklib.compile(code) // Compile your template
  let envelope = ztaklib.envelope(compiled, wif) // Sign and envelope

  try {
    let result = await ztaklib.tx(envelope) // Send your transaction
    console.log(result)
  } catch(e) {
    console.log(e)
  }
})
0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago