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

@kava-labs/javascript-sdk

Package Overview
Dependencies
Maintainers
3
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kava-labs/javascript-sdk - npm Package Compare versions

Comparing version 2.0.0-beta.1 to 2.0.0-beta.2

2

package.json
{
"name": "@kava-labs/javascript-sdk",
"version": "2.0.0-beta.1",
"version": "2.0.0-beta.2",
"description": "Supports interaction with the Kava blockchain via a REST api",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -129,10 +129,2 @@ const sig = require("@kava-labs/sig");

/**
* Get information about the account's chain state
* @return {Promise}
*/
async getAccountData() {
return tx.loadMetaData(this.wallet.address, this.baseURI);
}
/***************************************************

@@ -139,0 +131,0 @@ * GET tx methods

@@ -21,12 +21,3 @@ const sig = require("@kava-labs/sig");

} catch (err) {
// Log status and error or network error
const status = _.get(err, "response.status");
const statusText = _.get(err, "response.statusText");
const error = _.get(err, "response.data.error");
status ? console.log("Status:", status) : null;
statusText ? console.log("Status text:", statusText) : null;
error ? console.log("Error:", error) : null;
if (!status && !statusText && !error) {
console.log("Network error:", err);
}
logErr(err)
}

@@ -42,5 +33,4 @@ }

async function loadMetaData(address, base) {
const path = api.getAccount + "/" + address;
const path = api.getAccount + "/" + address;
const res = await getTx(path, base);
accNum = _.get(res, "data.result.value.account_number");

@@ -89,12 +79,3 @@ seqNum = _.get(res, "data.result.value.sequence");

} catch (err) {
// Log status and error or network error
const status = _.get(err, "response.status");
const statusText = _.get(err, "response.statusText");
const error = _.get(err, "response.data.error");
status ? console.log("Status:", status) : null;
statusText ? console.log("Status text:", statusText) : null;
error ? console.log("Error:", error) : null;
if (!status && !statusText && !error) {
console.log("Network error:", err);
}
logErr(err)
}

@@ -116,2 +97,21 @@

/**
* Parses and logs tx-related errors
* @param {object} err an error resulting from a tx-related action
*/
const logErr = (err) => {
// Load status, status text, and error
const status = _.get(err, "response.status");
const statusText = _.get(err, "response.statusText");
const error = _.get(err, "response.data.error");
// Log status, status text, and error, or if unidentified, log network error
status ? console.log("Status:", status) : null;
statusText ? console.log("Status text:", statusText) : null;
error ? console.log("Error:", error) : null;
if (!status && !statusText && !error) {
console.log("Network error:", err);
}
};
module.exports.tx = {

@@ -121,3 +121,4 @@ getTx,

signTx,
broadcastTx
broadcastTx,
logErr
};
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