aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util/src/http-client/types.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-util/src/http-client/types.ts')
-rw-r--r--packages/taler-util/src/http-client/types.ts53
1 files changed, 38 insertions, 15 deletions
diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts
index d9cc8ec90..e25bd6ebd 100644
--- a/packages/taler-util/src/http-client/types.ts
+++ b/packages/taler-util/src/http-client/types.ts
@@ -274,6 +274,7 @@ export const codecForCoreBankConfig = (): Codec<TalerCorebankApi.Config> =>
.property("allow_conversion", codecForBoolean())
.property("allow_deletions", codecForBoolean())
.property("allow_registrations", codecForBoolean())
+ .property("default_debit_threshold", codecForAmountString())
.property("currency_specification", codecForCurrencySpecificiation())
.property("currency", codecForString())
.build("TalerCorebankApi.Config");
@@ -358,6 +359,15 @@ export const codecForWithdrawalPublicInfo =
(): Codec<TalerCorebankApi.WithdrawalPublicInfo> =>
buildCodecForObject<TalerCorebankApi.WithdrawalPublicInfo>()
.property("username", codecForString(),)
+ .property("amount", codecForAmountString(),)
+ .property("selected_exchange_account", codecOptional(codecForPaytoString()))
+ .property("selected_reserve_pub", codecOptional(codecForString()))
+ .property("status", codecForEither(
+ codecForConstString("pending"),
+ codecForConstString("selected"),
+ codecForConstString("aborted"),
+ codecForConstString("confirmed"),
+ ),)
.build("TalerCorebankApi.WithdrawalPublicInfo");
export const codecForBankAccountTransactionsResponse =
@@ -408,20 +418,6 @@ export const codecForBankAccountCreateWithdrawalResponse =
.property("withdrawal_id", codecForString())
.build("TalerCorebankApi.BankAccountCreateWithdrawalResponse");
-// export const codecForBankAccountGetWithdrawalResponse =
-// (): Codec<TalerCorebankApi.BankAccountGetWithdrawalResponse> =>
-// buildCodecForObject<TalerCorebankApi.BankAccountGetWithdrawalResponse>()
-// .property("amount", codecForAmountString())
-// .property("aborted", codecForBoolean())
-// .property("confirmation_done", codecForBoolean())
-// .property(
-// "selected_exchange_account",
-// codecOptional(codecForPaytoString()),
-// )
-// .property("selected_reserve_pub", codecOptional(codecForString()))
-// .property("selection_done", codecForBoolean())
-// .build("TalerCorebankApi.BankAccountGetWithdrawalResponse");
-
export const codecForCashoutPending =
(): Codec<TalerCorebankApi.CashoutPending> =>
buildCodecForObject<TalerCorebankApi.CashoutPending>()
@@ -874,6 +870,8 @@ enum TanChannel {
SMS = "sms",
EMAIL = "email",
}
+export type WithdrawalOperationStatus = "pending" | "selected" | "aborted" | "confirmed"
+
export namespace TalerWireGatewayApi {
export interface TransferResponse {
@@ -1199,7 +1197,6 @@ export namespace TalerBankIntegrationApi {
name: "taler-bank-integration";
}
- export type WithdrawalOperationStatus = "pending" | "selected" | "aborted" | "confirmed"
export interface BankWithdrawalOperationStatus {
// Current status of the operation
// pending: the operation is pending parameters selection (exchange and reserve public key)
@@ -1292,6 +1289,9 @@ 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;
@@ -1315,8 +1315,27 @@ export namespace TalerCorebankApi {
taler_withdraw_uri: TalerActionString;
}
export interface WithdrawalPublicInfo {
+ // Current status of the operation
+ // pending: the operation is pending parameters selection (exchange and reserve public key)
+ // selected: the operations has been selected and is pending confirmation
+ // aborted: the operation has been aborted
+ // confirmed: the transfer has been confirmed and registered by the bank
+ status: WithdrawalOperationStatus;
+
+ // Amount that will be withdrawn with this operation
+ // (raw amount without fee considerations).
+ amount: AmountString;
+
// Account username
username: string;
+
+ // Reserve public key selected by the exchange,
+ // only non-null if status is selected or confirmed.
+ selected_reserve_pub?: string;
+
+ // Exchange account selected by the wallet
+ // only non-null if status is selected or confirmed.
+ selected_exchange_account?: PaytoString;
}
@@ -1398,6 +1417,10 @@ export namespace TalerCorebankApi {
// Internal payto URI of this bank account.
// Used mostly for testing.
internal_payto_uri?: PaytoString;
+
+ // If present, set the max debit allowed for this user
+ // Only admin can change this property.
+ debit_threshold?: AmountString;
}
export interface ChallengeContactData {