From 5b3289554573f72c8ebf9f440dee3837e67fceb8 Mon Sep 17 00:00:00 2001 From: Akamig Date: Mon, 30 Oct 2023 15:23:12 +0900 Subject: [PATCH] Add --- @planetarium/account-aws-kms/src/AwsKmsAccount.ts | 3 ++- @planetarium/account/src/Account.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/@planetarium/account-aws-kms/src/AwsKmsAccount.ts b/@planetarium/account-aws-kms/src/AwsKmsAccount.ts index 1e54663fff9..5b775cc5044 100644 --- a/@planetarium/account-aws-kms/src/AwsKmsAccount.ts +++ b/@planetarium/account-aws-kms/src/AwsKmsAccount.ts @@ -35,10 +35,11 @@ export class AwsKmsAccount implements Account { return Promise.resolve(this.publicKey); } - async sign(message: Message): Promise { + async sign(message: Message, isDigest: boolean = false): Promise { const cmd = new SignCommand({ KeyId: this.keyId, Message: message, + MessageType: isDigest ? "DIGEST" : "RAW", SigningAlgorithm: "ECDSA_SHA_256", }); const response = await this.#client.send(cmd); diff --git a/@planetarium/account/src/Account.ts b/@planetarium/account/src/Account.ts index 087a2352320..f56e1ec29e7 100644 --- a/@planetarium/account/src/Account.ts +++ b/@planetarium/account/src/Account.ts @@ -7,7 +7,7 @@ import Signature from "./Signature.js"; export interface Account { getAddress(): Promise
; getPublicKey(): Promise; - sign(message: Message): Promise; + sign(message: Message, isDigest?: boolean): Promise; } export function isAccount(account: unknown): account is Account {