Socket
Socket
Sign inDemoInstall

@emeris/chain-config

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emeris/chain-config - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3-pr-170-c95057c2d1a7eac3bc5f0c9c2ba22e7e83c09e2b.0

12

lib/index.js

@@ -6,2 +6,3 @@ "use strict";

class ChainConfig {
endpoint;
constructor(endpoint) {

@@ -21,6 +22,5 @@ this.endpoint = endpoint;

async getChain(chain_name) {
var _a;
try {
const result = (await (await fetch(this.endpoint + '/chain/' + chain_name)).json());
return (_a = result.chain) !== null && _a !== void 0 ? _a : null;
return result.chain ?? null;
}

@@ -32,6 +32,5 @@ catch (e) {

async getChainId(chain_name) {
var _a, _b;
try {
const chain = await this.getChain(chain_name);
return (_b = (_a = chain === null || chain === void 0 ? void 0 : chain.node_info) === null || _a === void 0 ? void 0 : _a.chain_id) !== null && _b !== void 0 ? _b : null;
return chain?.node_info?.chain_id ?? null;
}

@@ -67,6 +66,5 @@ catch (e) {

async getNumbers(chain_name, key_hash) {
var _a;
try {
const result = (await (await fetch(this.endpoint + '/chain/' + chain_name + '/numbers/' + key_hash)).json());
return (_a = result.numbers) !== null && _a !== void 0 ? _a : null;
return result.numbers ?? null;
}

@@ -87,3 +85,3 @@ catch (e) {

})).json());
return result !== null && result !== void 0 ? result : null;
return result ?? null;
}

@@ -90,0 +88,0 @@ catch (e) {

{
"name": "@emeris/chain-config",
"version": "0.2.2",
"version": "0.2.3-pr-170-c95057c2d1a7eac3bc5f0c9c2ba22e7e83c09e2b.0+c95057c",
"description": "Emeris chain config api Library",

@@ -29,3 +29,3 @@ "author": "Ignite, Inc <hello@ignt.com>",

"devDependencies": {
"@emeris/types": "^0.2.2",
"@emeris/types": "^0.2.3-pr-170-c95057c2d1a7eac3bc5f0c9c2ba22e7e83c09e2b.0+c95057c",
"@types/node": "^17.0.23",

@@ -37,3 +37,3 @@ "typescript": "^4.6.3"

},
"gitHead": "e611fe47722136c46eeb24f067200c50bcf67a5d"
"gitHead": "c95057c2d1a7eac3bc5f0c9c2ba22e7e83c09e2b"
}
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