🤖 Merge PR #45376 [bitcore-lib] added Message class by @hoonsubin

This commit is contained in:
Hoon Kim 2020-06-16 10:04:24 +09:00 committed by GitHub
parent d5ecb91362
commit 86a5308ae0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -33,3 +33,9 @@ tx.verify();
new bitcore.Unit(2, 'BTC').toSatoshis();
bitcore.Unit.fromMilis(1000).toBTC();
const message = new bitcore.Message('sign this message');
const signedMessageSig = message.sign(privateKey);
message.verify(privateKey.toAddress(), signedMessageSig);

View File

@ -252,6 +252,20 @@ export class Script {
toAddress(): Address;
}
export class Message {
constructor(message: string);
magicHash(): Buffer;
sign(privateKey: PrivateKey): string;
verify(bitcoinAddress: Address | string, signatureString: string): boolean;
fromString(str: string): Message;
fromJSON(json: string): Message;
toObject(): { message: string };
toJSON(): string;
toString(): string;
inspect(): string;
}
export interface Util {
readonly buffer: {
reverse(a: any): any;