New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

exonum-bundle-client

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exonum-bundle-client

[![Build status][travis-image]][travis-url] [![npm version][npmjs-image]][npmjs-url]

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Bundle client

Build status npm version

Install https://www.npmjs.com/package/exonum-bundle-client package into your project.

npm install exonum-bundle-client

To include in Node.JS:

var bundle = require('exonum-bundle-client')

To use in browser include browser-ready library version into your page:

<script src="node_modules/exonum-bundle-client/dist/exonum-bundle-client.js"></script>

Init:

var apiRoot = 'http://127.0.0.1:8080';
var bundle = new ExonumBundle(apiRoot);

Also it is possible to use following root URL format:

var apiRoot = 'http://example.com';

API

Validate hexadecimal string

bundle.validateHexadecimal(hash, bytes)
ArgumentDescriptionType
hashHash as hexadecimal string.String
bytesExpected length in bytes. Optional, 32 by default.Number

Validate Bitcoin address

bundle.validateBTCAddress(address, networkType)
ArgumentDescriptionType
addressBitcoin address as string.String
networkTypeprod, testnet or both. Optional, prod by default.String

Validate Ethereum address

bundle.validateETHAddress(address)
ArgumentDescriptionType
addressEthereum address as string.String

Generate mnemonic phrase

bundle.generateMnemonic()

Generate a new random signing key pair

bundle.generateKeyPair(passphrase, password)

Returns:

{
  "publicKey": "...",
  "secretKey": "..."
}
ArgumentDescriptionType
passphraseMnemonic phrase as string.String
passwordPassword as string.String

Register new user

bundle.addUser(keyPair, BTCAddress, ETHAddress)
ArgumentDescriptionType
keyPairSigning key pair.Object
BTCAddressBitcoin address as string.String
ETHAddressEthereum address as string.String

Transfer ETH

bundle.transfer(keyPair, to, amount)
ArgumentDescriptionType
keyPairSigning key pair.Object
toEthereum address as string.String
amountUint64 number as string.String

getWithdraw

bundle.getWithdraw(publicKey)
ArgumentDescriptionType
publicKeyPublic key as hexadecimal string.String

Returns promise.

Fulfilled response:

{
  "btc_address": "...",
  "eth_address": "...",
  "pub_key": "..."
}

getShare

bundle.getShare(publicKey)
ArgumentDescriptionType
publicKeyPublic key as hexadecimal string.String

Returns promise.

Fulfilled response:

{
  "btc_address": "...",
  "btc_balance": "...",
  "eth_balance": "...",
  "eth_contract_address": "...",
  "pub_key": "..."
}

getDetail

bundle.getDetail(publicKey)
ArgumentDescriptionType
publicKeyPublic key as hexadecimal string.String

Returns promise.

Fulfilled response:

{
  "balance": "...",
  "history_hash": "...",
  "history_len": "...",
  "pub_key": "..."
}

getHistory

bundle.getHistory(publicKey)
ArgumentDescriptionType
publicKeyPublic key as hexadecimal string.String

Returns promise.

Fulfilled response:

{
  "block_info": {
    "block": {},
    "precommits": []
  },
  "wallet": {
    "mpt_proof": {},
    "value": {}
  },
  "wallet_history": {
    "mt_proof": {},
    "values": []
  }
}

FAQs

Package last updated on 21 Feb 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc