Socket
Socket
Sign inDemoInstall

dfinity-tx

Package Overview
Dependencies
66
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dfinity-tx

This libary provides basic functions for creating and validating txs


Version published
Maintainers
1
Created

Readme

Source

NPM Package Build Status Coverage Status

js-standard-style

Synopsis

This libary provides basic functions for creating and validating tx's

Installation

npm install dfinity-tx

Usage

const DfinityTx = require('dfinity-tx')
const crypto = require('crypto')

// create a new tx
const tx = new DfinityTx({
  version: 0,
  to: new Uint8Array(20),
  caps: 4,
  ticks: 1000,
  ticksPrice: 0,
  nonce: 0,
  data: new Uint8Array([])
})

// get properties from
tx.ticks // 1000

// set properties
tx.nonce = 1

const secretKey = crypto.randomBytes(32)

// sign the tx, this returns a signed serialized tx
const signedTx = await tx.sign(sk)

// parse a tx
const tx2 = DfinityTx.deserialize(signedTx)

// get the public key used to sign the message
tx2.publicKey

API

./docs/

Specification

./docs/

License

(C) 2017 DFINITY STIFTUNG

All code and designs are open sourced under GPL V3.

image

Keywords

FAQs

Last updated on 28 Nov 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc