Skip to content

Commit

Permalink
Add
Browse files Browse the repository at this point in the history
  • Loading branch information
Akamig committed Oct 30, 2023
1 parent 383eb2c commit 5b32895
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion @planetarium/account-aws-kms/src/AwsKmsAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ export class AwsKmsAccount implements Account {
return Promise.resolve(this.publicKey);
}

async sign(message: Message): Promise<Signature> {
async sign(message: Message, isDigest: boolean = false): Promise<Signature> {
const cmd = new SignCommand({
KeyId: this.keyId,
Message: message,
MessageType: isDigest ? "DIGEST" : "RAW",
SigningAlgorithm: "ECDSA_SHA_256",
});
const response = await this.#client.send(cmd);
Expand Down
2 changes: 1 addition & 1 deletion @planetarium/account/src/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Signature from "./Signature.js";
export interface Account {
getAddress(): Promise<Address>;
getPublicKey(): Promise<PublicKey>;
sign(message: Message): Promise<Signature>;
sign(message: Message, isDigest?: boolean): Promise<Signature>;
}

export function isAccount(account: unknown): account is Account {
Expand Down

0 comments on commit 5b32895

Please sign in to comment.