taler-typescript-core

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

commit 1beb305d231e8e5632d1d3e2072c39bb74049924
parent fda35976e44b8dad3249124cd3a8cd8e0f723020
Author: Sebastian <sebasjm@gmail.com>
Date:   Mon,  3 Jun 2024 12:03:48 -0300

account letter

Diffstat:
Mpackages/taler-util/src/payto.ts | 20+++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/packages/taler-util/src/payto.ts b/packages/taler-util/src/payto.ts @@ -15,7 +15,7 @@ */ import { generateFakeSegwitAddress } from "./bitcoin.js"; -import { Codec, Context, DecodingError, renderContext } from "./codec.js"; +import { Codec, Context, DecodingError, buildCodecForObject, codecForStringURL, renderContext } from "./codec.js"; import { URLSearchParams } from "./url.js"; export type PaytoUri = @@ -291,3 +291,21 @@ export function talerPaytoFromExchangeReserve( return `payto://${proto}/${url.host}${url.pathname}${reservePub}`; } + +/** + * The account letter is all the information + * the merchant backend requires from the + * bank account to check transfer. + * + */ +export type AccountLetter = { + accountURI: PaytoString; + infoURL: string; +}; + +export const codecForAccountLetter = + (): Codec<AccountLetter> => + buildCodecForObject<AccountLetter>() + .property("infoURL", codecForStringURL(true)) + .property("accountURI", codecForPaytoString()) + .build("AccountLetter");