Socket
Socket
Sign inDemoInstall

@cosmjs/tendermint-rpc

Package Overview
Dependencies
Maintainers
2
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.28.9 to 0.28.10

12

build/tendermint34/adaptor/responses.d.ts

@@ -14,2 +14,14 @@ import { JsonRpcSuccessResponse } from "@cosmjs/json-rpc";

}
interface RpcAttribute {
/** base64 encoded */
readonly key: string;
/** base64 encoded */
readonly value: string;
}
interface RpcEvent {
readonly type: string;
/** Can be omitted (see https://github.com/cosmos/cosmjs/pull/1198) */
readonly attributes?: readonly RpcAttribute[];
}
export declare function decodeEvent(event: RpcEvent): responses.Event;
declare type RpcPubkey = {

@@ -16,0 +28,0 @@ readonly type: string;

5

build/tendermint34/adaptor/responses.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Responses = exports.decodeValidatorInfo = exports.decodeValidatorGenesis = exports.decodeValidatorUpdate = void 0;
exports.Responses = exports.decodeValidatorInfo = exports.decodeValidatorGenesis = exports.decodeValidatorUpdate = exports.decodeEvent = void 0;
/* eslint-disable @typescript-eslint/naming-convention */

@@ -50,5 +50,6 @@ const encoding_1 = require("@cosmjs/encoding");

type: event.type,
attributes: decodeAttributes(event.attributes),
attributes: event.attributes ? decodeAttributes(event.attributes) : [],
};
}
exports.decodeEvent = decodeEvent;
function decodeEvents(events) {

@@ -55,0 +56,0 @@ return (0, encodings_1.assertArray)(events).map(decodeEvent);

@@ -7,2 +7,26 @@ "use strict";

describe("Adaptor Responses", () => {
describe("decodeEvent", () => {
it("works with attributes", () => {
// from https://rpc.mainnet-1.tgrade.confio.run/tx?hash=0x2C44715748022DB2FB5F40105383719BFCFCEE51DBC02FF4088BE3F5924CD7BF
const event = (0, responses_1.decodeEvent)({
type: "coin_spent",
attributes: [
{ key: "c3BlbmRlcg==", value: "dGdyYWRlMWpzN2V6cm01NWZxZ3h1M3A2MmQ5eG42cGF0amt1Mno3bmU1ZHZn" },
{ key: "YW1vdW50", value: "NjAwMDAwMDAwMHV0Z2Q=" },
],
});
expect(event.type).toEqual("coin_spent");
expect(event.attributes).toEqual([
{ key: (0, encoding_1.toUtf8)("spender"), value: (0, encoding_1.toUtf8)("tgrade1js7ezrm55fqgxu3p62d9xn6patjku2z7ne5dvg") },
{ key: (0, encoding_1.toUtf8)("amount"), value: (0, encoding_1.toUtf8)("6000000000utgd") },
]);
});
it("works with no attribute", () => {
const event = (0, responses_1.decodeEvent)({
type: "cosmos.module.EmittedEvent",
});
expect(event.type).toEqual("cosmos.module.EmittedEvent");
expect(event.attributes).toEqual([]);
});
});
describe("decodeValidatorGenesis", () => {

@@ -9,0 +33,0 @@ it("works for genesis format", () => {

16

package.json
{
"name": "@cosmjs/tendermint-rpc",
"version": "0.28.9",
"version": "0.28.10",
"description": "Tendermint RPC clients",

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

"dependencies": {
"@cosmjs/crypto": "0.28.9",
"@cosmjs/encoding": "0.28.9",
"@cosmjs/json-rpc": "0.28.9",
"@cosmjs/math": "0.28.9",
"@cosmjs/socket": "0.28.9",
"@cosmjs/stream": "0.28.9",
"@cosmjs/utils": "0.28.9",
"@cosmjs/crypto": "0.28.10",
"@cosmjs/encoding": "0.28.10",
"@cosmjs/json-rpc": "0.28.10",
"@cosmjs/math": "0.28.10",
"@cosmjs/socket": "0.28.10",
"@cosmjs/stream": "0.28.10",
"@cosmjs/utils": "0.28.10",
"axios": "^0.21.2",

@@ -54,0 +54,0 @@ "readonly-date": "^1.0.0",

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