cosmos-client
Advanced tools
Comparing version 0.7.1 to 0.7.2
{ | ||
"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)); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
774957
181
18438