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

@cosmjs/tendermint-rpc

Package Overview
Dependencies
Maintainers
3
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cosmjs/tendermint-rpc - npm Package Compare versions

Comparing version 0.26.1 to 0.26.2

6

build/rpcclients/httpclient.d.ts
import { JsonRpcRequest, JsonRpcSuccessResponse } from "@cosmjs/json-rpc";
import { RpcClient } from "./rpcclient";
/**
* Helper to work around missing CORS support in Tendermint (https://github.com/tendermint/tendermint/pull/2800)
*
* For some reason, fetch does not complain about missing server-side CORS support.
*/
export declare function http(method: "POST", url: string, request?: any): Promise<any>;
export declare class HttpClient implements RpcClient {

@@ -4,0 +10,0 @@ protected readonly url: string;

4

build/rpcclients/httpclient.js

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpClient = void 0;
exports.HttpClient = exports.http = void 0;
const json_rpc_1 = require("@cosmjs/json-rpc");

@@ -22,2 +22,3 @@ const axios_1 = __importDefault(require("axios"));

*/
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
async function http(method, url, request) {

@@ -34,2 +35,3 @@ if (typeof fetch !== "undefined") {

}
exports.http = http;
class HttpClient {

@@ -36,0 +38,0 @@ constructor(url = "http://localhost:46657") {

@@ -11,4 +11,14 @@ "use strict";

}
const tendermintUrl = testutil_spec_1.defaultInstance.url;
describe("http", () => {
it("can send a health request", async () => {
pendingWithoutTendermint();
const response = await httpclient_1.http("POST", `http://${tendermintUrl}`, jsonrpc_1.createJsonRpcRequest("health"));
expect(response).toEqual(jasmine.objectContaining({ jsonrpc: "2.0" }));
});
it("errors for non-open port", async () => {
await expectAsync(httpclient_1.http("POST", `http://localhost:56745`, jsonrpc_1.createJsonRpcRequest("health"))).toBeRejectedWithError(/(ECONNREFUSED|Failed to fetch)/i);
});
});
describe("HttpClient", () => {
const tendermintUrl = testutil_spec_1.defaultInstance.url;
it("can make a simple call", async () => {

@@ -15,0 +25,0 @@ pendingWithoutTendermint();

{
"name": "@cosmjs/tendermint-rpc",
"version": "0.26.1",
"version": "0.26.2",
"description": "Tendermint RPC clients",

@@ -45,8 +45,8 @@ "contributors": [

"dependencies": {
"@cosmjs/crypto": "0.26.1",
"@cosmjs/encoding": "0.26.1",
"@cosmjs/json-rpc": "0.26.1",
"@cosmjs/math": "0.26.1",
"@cosmjs/socket": "0.26.1",
"@cosmjs/stream": "0.26.1",
"@cosmjs/crypto": "0.26.2",
"@cosmjs/encoding": "0.26.2",
"@cosmjs/json-rpc": "0.26.2",
"@cosmjs/math": "0.26.2",
"@cosmjs/socket": "0.26.2",
"@cosmjs/stream": "0.26.2",
"axios": "^0.21.2",

@@ -57,3 +57,3 @@ "readonly-date": "^1.0.0",

"devDependencies": {
"@cosmjs/utils": "0.26.1",
"@cosmjs/utils": "0.26.2",
"@istanbuljs/nyc-config-typescript": "^1.0.1",

@@ -60,0 +60,0 @@ "@types/eslint-plugin-prettier": "^3",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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