aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-05-04 16:11:12 -0300
committerSebastian <sebasjm@gmail.com>2022-05-04 16:26:53 -0300
commit4491118494c332c9ce0a0c4533804744d63701f2 (patch)
tree883cef2f190321bf07d0d1b53f5842e9c9c6ddbd /packages/taler-util
parentf16d2e52d51b931d18abd9d87568be681339350f (diff)
add restricted option to manual withdraw
Diffstat (limited to 'packages/taler-util')
-rw-r--r--packages/taler-util/src/talerCrypto.ts6
-rw-r--r--packages/taler-util/src/talerTypes.ts7
-rw-r--r--packages/taler-util/src/walletTypes.ts2
3 files changed, 10 insertions, 5 deletions
diff --git a/packages/taler-util/src/talerCrypto.ts b/packages/taler-util/src/talerCrypto.ts
index 228dc3269..e27e329a9 100644
--- a/packages/taler-util/src/talerCrypto.ts
+++ b/packages/taler-util/src/talerCrypto.ts
@@ -664,7 +664,6 @@ export function hashDenomPub(pub: DenominationPubKey): Uint8Array {
const hashInputBuf = new ArrayBuffer(pubBuf.length + 4 + 4);
const uint8ArrayBuf = new Uint8Array(hashInputBuf);
const dv = new DataView(hashInputBuf);
- logger.info("age_mask", pub.age_mask);
dv.setUint32(0, pub.age_mask ?? 0);
dv.setUint32(4, DenomKeyType.toIntTag(pub.cipher));
uint8ArrayBuf.set(pubBuf, 8);
@@ -680,8 +679,7 @@ export function hashDenomPub(pub: DenominationPubKey): Uint8Array {
return nacl.hash(uint8ArrayBuf);
} else {
throw Error(
- `unsupported cipher (${
- (pub as DenominationPubKey).cipher
+ `unsupported cipher (${(pub as DenominationPubKey).cipher
}), unable to hash`,
);
}
@@ -785,7 +783,7 @@ export enum TalerSignaturePurpose {
export class SignaturePurposeBuilder {
private chunks: Uint8Array[] = [];
- constructor(private purposeNum: number) {}
+ constructor(private purposeNum: number) { }
put(bytes: Uint8Array): SignaturePurposeBuilder {
this.chunks.push(Uint8Array.from(bytes));
diff --git a/packages/taler-util/src/talerTypes.ts b/packages/taler-util/src/talerTypes.ts
index ffc1f5160..b21c6caec 100644
--- a/packages/taler-util/src/talerTypes.ts
+++ b/packages/taler-util/src/talerTypes.ts
@@ -47,7 +47,7 @@ import {
} from "./time.js";
import { codecForAmountString } from "./amounts.js";
import { strcmp } from "./helpers.js";
-import { Edx25519PublicKey } from "./talerCrypto.js";
+import { AgeCommitmentProof, Edx25519PublicKey } from "./talerCrypto.js";
/**
* Denomination as found in the /keys response from the exchange.
@@ -954,6 +954,11 @@ export interface CoinDumpJson {
* Suspended coins are not considered for payments.
*/
coin_suspended: boolean;
+
+ /**
+ * Information about the age restriction
+ */
+ ageCommitmentProof: AgeCommitmentProof | undefined;
}>;
}
diff --git a/packages/taler-util/src/walletTypes.ts b/packages/taler-util/src/walletTypes.ts
index d8696377a..a8946fbbb 100644
--- a/packages/taler-util/src/walletTypes.ts
+++ b/packages/taler-util/src/walletTypes.ts
@@ -738,6 +738,7 @@ export const codecForGetExchangeTosRequest = (): Codec<GetExchangeTosRequest> =>
export interface AcceptManualWithdrawalRequest {
exchangeBaseUrl: string;
amount: string;
+ restrictAge?: number,
}
export const codecForAcceptManualWithdrawalRequet =
@@ -745,6 +746,7 @@ export const codecForAcceptManualWithdrawalRequet =
buildCodecForObject<AcceptManualWithdrawalRequest>()
.property("exchangeBaseUrl", codecForString())
.property("amount", codecForString())
+ .property("restrictAge", codecOptional(codecForNumber()))
.build("AcceptManualWithdrawalRequest");
export interface GetWithdrawalDetailsForAmountRequest {