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

cosmos-client

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cosmos-client - npm Package Compare versions

Comparing version 0.7.1 to 0.7.2

x/auth/types/canonicalize-json.d.ts

2

package.json
{
"name": "cosmos-client",
"description": "REST API Client for Cosmos SDK Blockchain",
"version": "0.7.1",
"version": "0.7.2",
"author": "LCNEM, Inc.",

@@ -6,0 +6,0 @@ "bugs": {

@@ -23,5 +23,4 @@ /// <reference types="node" />

constructor(msg: (Msg | codec.AminoWrapping)[], fee: StdTxFee, signatures: StdSignature[] | null, memo: string);
canonicalizeJSON(value: any): any;
getSignBytes(chainID: string, accountNumber: number, sequence: number): Buffer;
static fromJSON(value: any): StdTx;
}

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

var codec_1 = require("../../../codec");
var canonicalize_json_1 = require("./canonicalize-json");
/**

@@ -39,21 +40,2 @@ *

}
StdTx.prototype.canonicalizeJSON = function (value) {
if (Object.prototype.toString.call(value) === "[object Object]") {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var sorted = {};
var keys = Object.keys(value).sort();
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
var key = keys_1[_i];
var keyValue = value[key];
if (keyValue != null) {
sorted[key] = this.canonicalizeJSON(keyValue);
}
}
return sorted;
}
if (Array.isArray(value)) {
return value.map(this.canonicalizeJSON);
}
return value === undefined ? null : value;
};
StdTx.prototype.getSignBytes = function (chainID, accountNumber, sequence) {

@@ -69,3 +51,3 @@ var stdSignMsg = {

var obj = JSON.parse(codec_1.codec.toJSONString(stdSignMsg));
var canonicalized = this.canonicalizeJSON(obj);
var canonicalized = canonicalize_json_1.canonicalizeJSON(obj);
var encoder = new TextEncoder();

@@ -72,0 +54,0 @@ var encoded = encoder.encode(JSON.stringify(canonicalized));

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