@multiversx/sdk-wallet
Advanced tools
Comparing version 2.1.3 to 4.0.0-alpha.0
@@ -7,3 +7,4 @@ export * from "./mnemonic"; | ||
export * from "./userSigner"; | ||
export * from "./guardianSigner"; | ||
export * from "./userVerifier"; | ||
export * from "./validatorSigner"; |
@@ -19,4 +19,5 @@ "use strict"; | ||
__exportStar(require("./userSigner"), exports); | ||
__exportStar(require("./guardianSigner"), exports); | ||
__exportStar(require("./userVerifier"), exports); | ||
__exportStar(require("./validatorSigner"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -23,2 +23,15 @@ /// <reference types="node" /> | ||
} | ||
/** | ||
* An interface that defines a signing-capable object. | ||
*/ | ||
export interface IGuardianSigner { | ||
/** | ||
* Gets the {@link Address} of the signer. | ||
*/ | ||
getAddress(): IAddress; | ||
/** | ||
* Signs a message (e.g. a transaction). | ||
*/ | ||
guard(signable: ISignable): Promise<void>; | ||
} | ||
export interface IVerifier { | ||
@@ -34,10 +47,19 @@ verify(message: IVerifiable): boolean; | ||
*/ | ||
serializeForSigning(signedBy: IAddress): Buffer; | ||
serializeForSigning(): Buffer; | ||
/** | ||
* Returns the signature of the sender. | ||
*/ | ||
getSignature(): ISignature; | ||
/** | ||
* Applies the computed signature on the object itself. | ||
* | ||
* @param signature The computed signature | ||
* @param signedBy The address of the {@link ISignature} | ||
*/ | ||
applySignature(signature: ISignature, signedBy: IAddress): void; | ||
*/ | ||
applySignature(signature: ISignature): void; | ||
/** | ||
* Applies the guardian signature on the transaction. | ||
* | ||
* @param guardianSignature The signature, as computed by a guardian. | ||
*/ | ||
applyGuardianSignature(guardianSignature: ISignature): void; | ||
} | ||
@@ -44,0 +66,0 @@ /** |
@@ -7,3 +7,3 @@ import { IAddress, ISignable, ISigner } from "./interface"; | ||
export declare class UserSigner implements ISigner { | ||
private readonly secretKey; | ||
protected readonly secretKey: UserSecretKey; | ||
constructor(secretKey: UserSecretKey); | ||
@@ -10,0 +10,0 @@ static fromWallet(keyFileObject: any, password: string): ISigner; |
@@ -47,7 +47,6 @@ "use strict"; | ||
trySign(signable) { | ||
let signedBy = this.getAddress(); | ||
let bufferToSign = signable.serializeForSigning(signedBy); | ||
let bufferToSign = signable.serializeForSigning(); | ||
let signatureBuffer = this.secretKey.sign(bufferToSign); | ||
let signature = new signature_1.Signature(signatureBuffer); | ||
signable.applySignature(signature, signedBy); | ||
signable.applySignature(signature); | ||
} | ||
@@ -54,0 +53,0 @@ /** |
{ | ||
"name": "@multiversx/sdk-wallet", | ||
"version": "2.1.3", | ||
"version": "4.0.0-alpha.0", | ||
"description": "Wallet components for MultiversX", | ||
@@ -5,0 +5,0 @@ "main": "out/index.js", |
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
84342
78
1448
2