diff options
author | Florian Dold <florian@dold.me> | 2022-04-19 17:12:43 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-04-27 00:50:17 +0200 |
commit | a165afa6824980c409d7c2e22e24171e536800e0 (patch) | |
tree | 0e8491f092aba2280655ee4728fef0ca02bb8387 /packages/taler-util/src/walletTypes.ts | |
parent | 9b85d139bf7bdc360ea0894e09f6115cd9d472d8 (diff) | |
download | wallet-core-a165afa6824980c409d7c2e22e24171e536800e0.tar.xz |
wallet-core: implement age restriction support
Diffstat (limited to 'packages/taler-util/src/walletTypes.ts')
-rw-r--r-- | packages/taler-util/src/walletTypes.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/taler-util/src/walletTypes.ts b/packages/taler-util/src/walletTypes.ts index 818ba37fe..e094bc385 100644 --- a/packages/taler-util/src/walletTypes.ts +++ b/packages/taler-util/src/walletTypes.ts @@ -47,6 +47,7 @@ import { codecForConstString, codecForAny, buildCodecForUnion, + codecForNumber, } from "./codec.js"; import { AmountString, @@ -61,6 +62,7 @@ import { OrderShortInfo, codecForOrderShortInfo } from "./transactionsTypes.js"; import { BackupRecovery } from "./backupTypes.js"; import { PaytoUri } from "./payto.js"; import { TalerErrorCode } from "./taler-error-codes.js"; +import { AgeCommitmentProof } from "./talerCrypto.js"; /** * Response for the create reserve request to the wallet. @@ -218,6 +220,8 @@ export interface CreateReserveRequest { * from this reserve, only used for testing. */ forcedDenomSel?: ForcedDenomSel; + + restrictAge?: number; } export const codecForCreateReserveRequest = (): Codec<CreateReserveRequest> => @@ -489,6 +493,7 @@ export interface WithdrawalPlanchet { coinEv: CoinEnvelope; coinValue: AmountJson; coinEvHash: string; + ageCommitmentProof?: AgeCommitmentProof; } export interface PlanchetCreationRequest { @@ -499,6 +504,7 @@ export interface PlanchetCreationRequest { denomPub: DenominationPubKey; reservePub: string; reservePriv: string; + restrictAge?: number; } /** @@ -545,6 +551,10 @@ export interface DepositInfo { denomKeyType: DenomKeyType; denomPubHash: string; denomSig: UnblindedSignature; + + requiredMinimumAge?: number; + + ageCommitmentProof?: AgeCommitmentProof; } export interface ExchangesListRespose { @@ -728,12 +738,14 @@ export const codecForAcceptManualWithdrawalRequet = export interface GetWithdrawalDetailsForAmountRequest { exchangeBaseUrl: string; amount: string; + restrictAge?: number; } export interface AcceptBankIntegratedWithdrawalRequest { talerWithdrawUri: string; exchangeBaseUrl: string; forcedDenomSel?: ForcedDenomSel; + restrictAge?: number; } export const codecForAcceptBankIntegratedWithdrawalRequest = @@ -742,6 +754,7 @@ export const codecForAcceptBankIntegratedWithdrawalRequest = .property("exchangeBaseUrl", codecForString()) .property("talerWithdrawUri", codecForString()) .property("forcedDenomSel", codecForAny()) + .property("restrictAge", codecOptional(codecForNumber())) .build("AcceptBankIntegratedWithdrawalRequest"); export const codecForGetWithdrawalDetailsForAmountRequest = @@ -774,11 +787,13 @@ export const codecForApplyRefundRequest = (): Codec<ApplyRefundRequest> => export interface GetWithdrawalDetailsForUriRequest { talerWithdrawUri: string; + restrictAge?: number; } export const codecForGetWithdrawalDetailsForUri = (): Codec<GetWithdrawalDetailsForUriRequest> => buildCodecForObject<GetWithdrawalDetailsForUriRequest>() .property("talerWithdrawUri", codecForString()) + .property("restrictAge", codecOptional(codecForNumber())) .build("GetWithdrawalDetailsForUriRequest"); export interface ListKnownBankAccountsRequest { |