diff options
Diffstat (limited to 'packages/aml-backoffice-ui/src/account.ts')
-rw-r--r-- | packages/aml-backoffice-ui/src/account.ts | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/packages/aml-backoffice-ui/src/account.ts b/packages/aml-backoffice-ui/src/account.ts index 1c8cd7f53..2225bf2ff 100644 --- a/packages/aml-backoffice-ui/src/account.ts +++ b/packages/aml-backoffice-ui/src/account.ts @@ -1,6 +1,7 @@ import { - PaytoUri, + Amounts, TalerSignaturePurpose, + amountToBuffer, bufferForUint32, buildSigPS, createEddsaKeyPair, @@ -11,8 +12,10 @@ import { encodeCrock, encryptWithDerivedKey, getRandomBytesF, + hash, + hashTruncate32, stringToBytes, - stringifyPaytoUri, + timestampRoundedToBuffer } from "@gnu-taler/taler-util"; import { AmlExchangeBackend } from "./types.js"; @@ -60,12 +63,16 @@ export function buildQuerySignature(key: SigningKey): string { } export function buildDecisionSignature( key: SigningKey, - payto: PaytoUri, - state: AmlExchangeBackend.AmlState, + decision: AmlExchangeBackend.AmlDecision, ): string { + const sigBlob = buildSigPS(TalerSignaturePurpose.TALER_SIGNATURE_AML_DECISION) - .put(decodeCrock(stringifyPaytoUri(payto))) - .put(bufferForUint32(state)) + .put(hash(stringToBytes(decision.justification))) + // .put(timestampRoundedToBuffer(decision.decision_time)) + .put(amountToBuffer(decision.new_threshold)) + .put(decodeCrock(decision.h_payto)) + // .put(hash(stringToBytes(decision.kyc_requirements))) + .put(bufferForUint32(decision.new_state)) .build(); return encodeCrock(eddsaSign(sigBlob, key)); |