taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 7a718a5230f2bc376eb97b8e3eaef40b3d2996f2
parent 62f72d086d182d6c9fa7ecb41045e8a699e7bcf0
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Sat, 24 Oct 2026 14:07:52 +0200

mailbox: Harmonize mailbox responses

Diffstat:
Mpackages/taler-util/src/types-taler-wallet.ts | 2+-
Mpackages/taler-wallet-core/src/mailbox.ts | 10+++++-----
Mpackages/taler-wallet-core/src/wallet-api-types.ts | 6+++---
3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/packages/taler-util/src/types-taler-wallet.ts b/packages/taler-util/src/types-taler-wallet.ts @@ -1717,7 +1717,7 @@ export const codecForTaldirGetSupportedAliasesRequest = (): Codec<TaldirGetSuppo .property("progressToken", codecOptional(codecForString())) .build("TaldirGetSupportedAliasesRequest"); -export interface GetMailboxResponse { +export interface MailboxResponse { mailboxConfiguration?: MailboxConfiguration; } diff --git a/packages/taler-wallet-core/src/mailbox.ts b/packages/taler-wallet-core/src/mailbox.ts @@ -26,7 +26,7 @@ import { DeleteMailboxMessageRequest, Duration, EmptyObject, - GetMailboxResponse, + MailboxResponse, HttpStatusCode, Logger, MailboxConfiguration, @@ -218,7 +218,7 @@ async function internalRegisterMailbox( export async function getMailbox( wex: WalletExecutionContext, mailboxReq: GetMailboxRequest, -): Promise<GetMailboxResponse> { +): Promise<MailboxResponse> { return await wex.runWalletDbTx(async (tx) => { return { mailboxConfiguration: await tx.getMailboxConfiguration( @@ -235,7 +235,7 @@ export async function getMailbox( export async function initializeMailbox( wex: WalletExecutionContext, req: MailboxInitializationRequest, -): Promise<MailboxConfiguration> { +): Promise<MailboxResponse> { return runWithMaybeProgressContext( wex, "mailboxInitializationRequest", @@ -247,7 +247,7 @@ export async function initializeMailbox( async function internalInitializeMailbox( wex: WalletExecutionContext, req: MailboxInitializationRequest, -): Promise<MailboxConfiguration> { +): Promise<MailboxResponse> { const keys = createEddsaKeyPair(); const hpkeKey = encodeCrock(hpkeCreateSecretKey()); const privKey = encodeCrock(keys.eddsaPriv); @@ -292,7 +292,7 @@ async function internalInitializeMailbox( await wex.runWalletDbTx(async (tx) => { return await tx.upsertMailboxConfiguration(mailboxConf); }); - return mailboxConf; + return { mailboxConfiguration: mailboxConf }; } function decryptTalerUriMessage( diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts @@ -114,7 +114,7 @@ import { GetExchangeResourcesResponse, GetExchangeTosRequest, GetExchangeTosResult, - GetMailboxResponse, + MailboxResponse, GetMaxDepositAmountRequest, GetMaxDepositAmountResponse, GetMaxPeerPushDebitAmountRequest, @@ -659,7 +659,7 @@ export type RefreshMailboxOp = { export type InitializeMailboxOp = { op: WalletApiOperation.InitializeMailbox; request: MailboxInitializationRequest; - response: MailboxConfiguration; + response: MailboxResponse; }; /** @@ -668,7 +668,7 @@ export type InitializeMailboxOp = { export type GetMailboxOp = { op: WalletApiOperation.GetMailbox; request: GetMailboxRequest; - response: GetMailboxResponse; + response: MailboxResponse; }; /**