Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

beowulf-js

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beowulf-js

Beowulf the JavaScript API for Beowulf blockchain

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29
increased by7.41%
Maintainers
1
Weekly downloads
 
Created
Source

beowulf-js

beowulf-js is the official Beowulf library for Javascript.

Full Documentation

  • Please have a look at the Wiki for full documentation, examples, operational details and other information.
  • The api documentation can be found in the official beowulf developers portal: https://beowulfchain.com/developer-guide/javascript

Main Functions Supported

  1. CHAIN
  • get_block
  • get_transaction
  1. TRANSACTION
  • broadcast_transaction
  • create transaction transfer
  • create account
Requirements
  • npm minimum version 6.9.0
Install
// MainNet
npm i beowulf-js

// TestNet
npm i beowulf-js-testnet
Configuration
const beowulfjs = require('beowulf-js');
let url = beowulfjs.config.get('uri');
beowulfjs.api.setOptions({ url: url, useAppbaseApi: true });
Example Usage
Get a block
let blockNum = 232967;
beowulfjs.api.getBlock(blockNum, function(err, result) {
  console.log(err, result);
});
Get Transaction
let trxId = '60207c8e17f47bf2790c927701792d95d42e3f46';
beowulfjs.api.getTransaction(trxId, function(err, result) {
  console.log(err, result);
});
Generate a wallet

API

let wallet = beowulfjs.wallet.generateWallet();

Response Example

{
  "owner": "5JY3sGqkfoN7U6kee9HibnG6etQgLNCMqjhPqsVDRXRjGwFNKeA",
  "ownerPubkey": "BEO7GXMArUCaxq1kPNP4JkcnshVDyfpVTfEwL8e8FVAN6BgpU8Y1k"
}
Submit Wallet to Blockchain

API

beowulfjs.wallet.submitWallet({
  ownerPubkey,
  account,
  creator,
  creatorWif,
  fee
}, (err, result) => {

})

Params:

ownerPubkey: string // wallet public key
account: string // Name of Wallet
fee: string // Fee for creating wallet
creator: string // Wallet Name of father of account
creatorWif: string // Private key of father account
let ownerPubkey = 'BEO7GXMArUCaxq1kPNP4JkcnshVDyfpVTfEwL8e8FVAN6BgpU8Y1k';
let account = 'newwallet';
let creator = 'creatorwallet';
let creatorWif = '5Kxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; // replace by your wif
let fee = '0.00100 W';

beowulfjs.wallet.submitWallet({
  ownerPubkey,
  account,
  creator,
  creatorWif,
  fee
}, (err, result) => {

})
Submit Transaction

API

beowulfjs.broadcast.transfer(wif, from, to, amount, fee, memo, (err, result) => {
  console.log(err, result);
});

Params:

from: string // Wallet name of sender
wif: string // private key of sender
to: string // Wallet name of receiver
amount: string
memo: string
fee: string // Fee for submiting transaction
let from = 'examplewallet';
let wif = '5Jxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; // replace by your wif
let to = 'examplewallet2';
let amount = '4.00000 BWF';
let memo = 'example';
let fee = '0.00001 W';

beowulfjs.broadcast.transfer(wif, from, to, amount, fee, memo, (err, result) => {
  console.log(err, result);
});

Keywords

FAQs

Package last updated on 26 Nov 2019

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