@multiversx/sdk-core
Advanced tools
Comparing version 12.0.1 to 12.1.0
/// <reference types="node" /> | ||
import { Address } from "./address"; | ||
import { ISignature } from "./interface"; | ||
import { Address } from "./address"; | ||
export declare const MESSAGE_PREFIX = "\u0017Elrond Signed Message:\n"; | ||
@@ -13,3 +13,3 @@ export declare class SignableMessage { | ||
*/ | ||
signature: ISignature; | ||
signature: Buffer; | ||
/** | ||
@@ -30,6 +30,6 @@ * Address of the wallet that performed the signing operation | ||
serializeForSigningRaw(): Buffer; | ||
getSignature(): ISignature; | ||
applySignature(signature: ISignature): void; | ||
getSignature(): Buffer; | ||
applySignature(signature: ISignature | Buffer): void; | ||
getMessageSize(): Buffer; | ||
toJSON(): object; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SignableMessage = exports.MESSAGE_PREFIX = void 0; | ||
const signature_1 = require("./signature"); | ||
const address_1 = require("./address"); | ||
@@ -11,3 +10,3 @@ const createKeccakHash = require("keccak"); | ||
this.message = Buffer.from([]); | ||
this.signature = new signature_1.Signature(); | ||
this.signature = Buffer.from([]); | ||
this.version = 1; | ||
@@ -31,3 +30,8 @@ this.signer = "ErdJS"; | ||
applySignature(signature) { | ||
this.signature = signature; | ||
if (signature instanceof Buffer) { | ||
this.signature = signature; | ||
} | ||
else { | ||
this.signature = Buffer.from(signature.hex(), "hex"); | ||
} | ||
} | ||
@@ -42,4 +46,4 @@ getMessageSize() { | ||
address: this.address.bech32(), | ||
message: "0x" + this.message.toString('hex'), | ||
signature: "0x" + this.signature.hex(), | ||
message: "0x" + this.message.toString("hex"), | ||
signature: "0x" + this.signature.toString("hex"), | ||
version: this.version, | ||
@@ -46,0 +50,0 @@ signer: this.signer, |
{ | ||
"name": "@multiversx/sdk-core", | ||
"version": "12.0.1", | ||
"version": "12.1.0", | ||
"description": "MultiversX SDK for JavaScript and TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "out/index.js", |
Sorry, the diff of this file is not supported yet
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
700526
11927