diff --git a/package.json b/package.json index e00ca72..4eab503 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dcorejs-sdk", - "version": "3.0.2", + "version": "3.0.3", "homepage": "https://decent.ch/", "description": "DcoreJS SDK.", "main": "./dist/index.js", diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 878d9cc..0ae93de 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -1,5 +1,5 @@ import * as BaseX from "base-x"; -import { serialize } from "class-transformer"; +import { classToPlain, serialize } from "class-transformer"; import * as Crypto from "crypto"; import { createHash } from "crypto"; import * as Long from "long"; @@ -42,6 +42,10 @@ export class Utils { return typeof value === "string" ? value : serialize(value); } + public static toPlain(value: any): object { + return classToPlain(value); + } + public static generateNonce(power: number = 250): Long { return Long.fromString(Utils.generateEntropy(power).toString("hex"), true, 16); }