gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] 01/03: add payto type


From: gnunet
Subject: [taler-wallet-core] 01/03: add payto type
Date: Mon, 04 Sep 2023 19:18:06 +0200

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

commit 241a37c889d132423676b95af18f9349d0501298
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Mon Sep 4 12:20:39 2023 -0300

    add payto type
---
 packages/taler-util/src/bitcoin.ts | 8 ++++----
 packages/taler-util/src/payto.ts   | 6 ++++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/packages/taler-util/src/bitcoin.ts 
b/packages/taler-util/src/bitcoin.ts
index 8c22ba522..37b7ae6b9 100644
--- a/packages/taler-util/src/bitcoin.ts
+++ b/packages/taler-util/src/bitcoin.ts
@@ -69,10 +69,10 @@ export function generateFakeSegwitAddress(
     addr[0] === "t" && addr[1] == "b"
       ? "tb"
       : addr[0] === "b" && addr[1] == "c" && addr[2] === "r" && addr[3] == "t"
-      ? "bcrt"
-      : addr[0] === "b" && addr[1] == "c"
-      ? "bc"
-      : undefined;
+        ? "bcrt"
+        : addr[0] === "b" && addr[1] == "c"
+          ? "bc"
+          : undefined;
   if (prefix === undefined) throw new Error("unknown bitcoin net");
 
   const addr1 = segwit.default.encode(prefix, 0, first_part);
diff --git a/packages/taler-util/src/payto.ts b/packages/taler-util/src/payto.ts
index 2b0af4cc2..60c4ba838 100644
--- a/packages/taler-util/src/payto.ts
+++ b/packages/taler-util/src/payto.ts
@@ -24,7 +24,7 @@ export type PaytoUri =
   | PaytoUriBitcoin;
 
 export interface PaytoUriGeneric {
-  targetType: string;
+  targetType: PaytoType | string;
   targetPath: string;
   params: { [name: string]: string };
 }
@@ -55,6 +55,8 @@ export interface PaytoUriBitcoin extends PaytoUriGeneric {
 
 const paytoPfx = "payto://";
 
+export type PaytoType = "iban" | "bitcoin" | "x-taler-bank"
+
 export function buildPayto(
   type: "iban",
   iban: string,
@@ -71,7 +73,7 @@ export function buildPayto(
   account: string,
 ): PaytoUriTalerBank;
 export function buildPayto(
-  type: "iban" | "bitcoin" | "x-taler-bank",
+  type: PaytoType,
   first: string,
   second?: string,
 ): PaytoUriGeneric {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]