summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-12-06 13:04:36 -0300
committerSebastian <sebasjm@gmail.com>2023-12-06 14:10:09 -0300
commitf576bf0eb1c4643356683dfbc4f882dcc670d295 (patch)
treef90a5c4e610e495b2e4fb472ed1891d4b42f468c
parentcb9c115becb7fafb89f64d02f3555efddaeba03e (diff)
downloadwallet-core-f576bf0eb1c4643356683dfbc4f882dcc670d295.tar.gz
wallet-core-f576bf0eb1c4643356683dfbc4f882dcc670d295.tar.bz2
wallet-core-f576bf0eb1c4643356683dfbc4f882dcc670d295.zip
sync api with libeufin
-rw-r--r--packages/taler-util/src/http-client/types.ts67
1 files changed, 52 insertions, 15 deletions
diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts
index 436a06874..efff7bb0a 100644
--- a/packages/taler-util/src/http-client/types.ts
+++ b/packages/taler-util/src/http-client/types.ts
@@ -274,9 +274,15 @@ export const codecForCoreBankConfig = (): Codec<TalerCorebankApi.Config> =>
.property("allow_conversion", codecForBoolean())
.property("allow_deletions", codecForBoolean())
.property("allow_registrations", codecForBoolean())
+ .property("allow_edit_cashout_payto_uri", codecForBoolean())
+ .property("allow_edit_name", codecForBoolean())
.property("default_debit_threshold", codecForAmountString())
.property("currency_specification", codecForCurrencySpecificiation())
.property("currency", codecForString())
+ .property("supported_tan_channels", codecForList(codecForEither(
+ codecForConstString(TanChannel.SMS),
+ codecForConstString(TanChannel.EMAIL),
+ )))
.build("TalerCorebankApi.Config");
export const codecForMerchantConfig =
@@ -312,9 +318,10 @@ const codecForBalance = (): Codec<TalerCorebankApi.Balance> =>
const codecForPublicAccount = (): Codec<TalerCorebankApi.PublicAccount> =>
buildCodecForObject<TalerCorebankApi.PublicAccount>()
- .property("account_name", codecForString())
+ .property("username", codecForString())
.property("balance", codecForBalance())
.property("payto_uri", codecForPaytoString())
+ .property("is_taler_exchange", codecForBoolean())
.build("TalerCorebankApi.PublicAccount");
export const codecForPublicAccountsResponse =
@@ -330,6 +337,8 @@ export const codecForAccountMinimalData =
.property("debit_threshold", codecForAmountString())
.property("name", codecForString())
.property("username", codecForString())
+ .property("is_public", codecForBoolean())
+ .property("is_taler_exchange", codecForBoolean())
.build("TalerCorebankApi.AccountMinimalData");
export const codecForListBankAccountsResponse =
@@ -346,6 +355,8 @@ export const codecForAccountData = (): Codec<TalerCorebankApi.AccountData> =>
.property("debit_threshold", codecForAmountString())
.property("contact_data", codecOptional(codecForChallengeContactData()))
.property("cashout_payto_uri", codecOptional(codecForPaytoString()))
+ .property("is_public", codecForBoolean())
+ .property("is_taler_exchange", codecForBoolean())
.build("TalerCorebankApi.AccountData");
export const codecForChallengeContactData =
@@ -1308,18 +1319,29 @@ export namespace TalerCorebankApi {
// If 'false' only the admin can
allow_registrations: boolean;
- // Default debt limit for newly created accounts
- default_debit_threshold: AmountString;
-
// If 'true' account can delete themselves
// If 'false' only the admin can delete accounts
allow_deletions: boolean;
+ // If 'true' anyone can edit their name
+ // If 'false' only admin can
+ allow_edit_name: boolean;
+
+ // If 'true' anyone can edit their cashout account
+ // If 'false' only the admin
+ allow_edit_cashout_payto_uri: boolean;
+
+ // Default debt limit for newly created accounts
+ default_debit_threshold: AmountString;
+
// Currency used by this bank.
currency: string;
// How the bank SPA should render this currency.
currency_specification: CurrencySpecification;
+
+ // TAN channels supported by the server
+ supported_tan_channels: TanChannel[];
}
export interface BankAccountCreateWithdrawalRequest {
@@ -1424,7 +1446,7 @@ export namespace TalerCorebankApi {
// If missing, cashouts will fail.
// In the future, might be used for other transactions
// as well.
- challenge_contact_data?: ChallengeContactData;
+ contact_data?: ChallengeContactData;
// 'payto' address of a fiat bank account.
// Payments will be sent to this bank account
@@ -1434,7 +1456,7 @@ export namespace TalerCorebankApi {
// Internal payto URI of this bank account.
// Used mostly for testing.
- internal_payto_uri?: PaytoString;
+ payto_uri?: PaytoString;
// If present, set the max debit allowed for this user
// Only admin can change this property.
@@ -1455,7 +1477,7 @@ export namespace TalerCorebankApi {
// If missing, cashouts will fail.
// In the future, might be used for other transactions
// as well.
- challenge_contact_data?: ChallengeContactData;
+ contact_data?: ChallengeContactData;
// 'payto' address pointing a bank account
// external to the libeufin-bank.
@@ -1464,14 +1486,13 @@ export namespace TalerCorebankApi {
// back to fiat currency outside libeufin-bank.
cashout_payto_uri?: PaytoString;
+ // Make this account visible to anyone?
+ is_public?: boolean;
+
// Legal name associated with $username.
// When missing, the old name is kept.
name?: string;
- // If present, change the is_exchange configuration.
- // See RegisterAccountRequest
- is_taler_exchange?: boolean;
-
// If present, change the max debit allowed for this user
// Only admin can change this property.
debit_threshold?: AmountString;
@@ -1489,13 +1510,17 @@ export namespace TalerCorebankApi {
public_accounts: PublicAccount[];
}
export interface PublicAccount {
- payto_uri: PaytoString;
+ // Username of the account
+ username: string;
+ // Internal payto URI of this bank account.
+ payto_uri: string;
+
+ // Current balance of the account
balance: Balance;
- // The account name (=username) of the
- // libeufin-bank account.
- account_name: string;
+ // Is this a taler exchange account?
+ is_taler_exchange: boolean;
}
export interface ListBankAccountsResponse {
@@ -1517,6 +1542,12 @@ export namespace TalerCorebankApi {
// Number indicating the max debit allowed for the requesting user.
debit_threshold: AmountString;
+
+ // Is this account visible to anyone?
+ is_public: boolean;
+
+ // Is this a taler exchange account?
+ is_taler_exchange: boolean;
}
export interface AccountData {
@@ -1541,6 +1572,12 @@ export namespace TalerCorebankApi {
// that never cashouts. Registering these accounts can
// be done via the access API.
cashout_payto_uri?: PaytoString;
+
+ // Is this account visible to anyone?
+ is_public: boolean;
+
+ // Is this a taler exchange account?
+ is_taler_exchange: boolean;
}
export interface CashoutRequest {