aboutsummaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/declaration.d.ts
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-09-22 18:34:49 -0300
committerSebastian <sebasjm@gmail.com>2023-09-22 18:34:49 -0300
commitf2bae9ac92b3ad7eb9be15b7014b80ef9fdd79cb (patch)
tree9ec044a7bfb173fd22acd6a68cad7484824c1122 /packages/demobank-ui/src/declaration.d.ts
parentc8d9b8d923b634acad3210bf7d25992b16f8c0c9 (diff)
downloadwallet-core-f2bae9ac92b3ad7eb9be15b7014b80ef9fdd79cb.tar.gz
wallet-core-f2bae9ac92b3ad7eb9be15b7014b80ef9fdd79cb.tar.bz2
wallet-core-f2bae9ac92b3ad7eb9be15b7014b80ef9fdd79cb.zip
towards new core bank api
Diffstat (limited to 'packages/demobank-ui/src/declaration.d.ts')
-rw-r--r--packages/demobank-ui/src/declaration.d.ts166
1 files changed, 140 insertions, 26 deletions
diff --git a/packages/demobank-ui/src/declaration.d.ts b/packages/demobank-ui/src/declaration.d.ts
index 462287c59..a9573fbcd 100644
--- a/packages/demobank-ui/src/declaration.d.ts
+++ b/packages/demobank-ui/src/declaration.d.ts
@@ -99,11 +99,6 @@ type Amount = string;
type UUID = string;
type Integer = number;
-interface Balance {
- amount: Amount;
- credit_debit_indicator: "credit" | "debit";
-}
-
namespace SandboxBackend {
export interface Config {
// Name of this API, always "circuit".
@@ -126,7 +121,7 @@ namespace SandboxBackend {
}
export interface SandboxError {
- error: SandboxErrorDetail;
+ error?: SandboxErrorDetail;
}
interface SandboxErrorDetail {
// String enum classifying the error.
@@ -152,26 +147,12 @@ namespace SandboxBackend {
UtilError = "util-error",
}
- namespace Access {
- interface PublicAccountsResponse {
- publicAccounts: PublicAccount[];
- }
- interface PublicAccount {
- iban: string;
- balance: string;
- // The account name _and_ the username of the
- // Sandbox customer that owns such a bank account.
- accountLabel: string;
- }
- interface BankAccountBalanceResponse {
- // Available balance on the account.
- balance: Balance;
- // payto://-URI of the account. (New)
- paytoUri: string;
- // Number indicating the max debit allowed for the requesting user.
- debitThreshold: Amount;
- }
+ type EmailAddress = string;
+ type PhoneNumber = string;
+
+ namespace CoreBank {
+
interface BankAccountCreateWithdrawalRequest {
// Amount to withdraw.
amount: Amount;
@@ -243,11 +224,144 @@ namespace SandboxBackend {
amount?: string;
}
- interface BankRegistrationRequest {
+ interface RegisterAccountRequest {
+ // Username
username: string;
+ // Password.
password: string;
+
+ // Legal name of the account owner
+ name: string;
+
+ // Defaults to false.
+ is_public?: boolean;
+
+ // Is this a taler exchange account?
+ // If true:
+ // - incoming transactions to the account that do not
+ // have a valid reserve public key are automatically
+ // - the account provides the taler-wire-gateway-api endpoints
+ // Defaults to false.
+ is_taler_exchange?: boolean;
+
+ // Addresses where to send the TAN for transactions.
+ // Currently only used for cashouts.
+ // If missing, cashouts will fail.
+ // In the future, might be used for other transactions
+ // as well.
+ challenge_contact_data?: ChallengeContactData;
+
+ // 'payto' address pointing a bank account
+ // external to the libeufin-bank.
+ // Payments will be sent to this bank account
+ // when the user wants to convert the local currency
+ // back to fiat currency outside libeufin-bank.
+ cashout_payto_uri?: string;
+
+ // Internal payto URI of this bank account.
+ // Used mostly for testing.
+ internal_payto_uri?: string;
+ }
+ interface ChallengeContactData {
+
+ // E-Mail address
+ email?: EmailAddress;
+
+ // Phone number.
+ phone?: PhoneNumber;
+ }
+
+ interface AccountReconfiguration {
+
+ // Addresses where to send the TAN for transactions.
+ // Currently only used for cashouts.
+ // If missing, cashouts will fail.
+ // In the future, might be used for other transactions
+ // as well.
+ challenge_contact_data?: ChallengeContactData;
+
+ // 'payto' address pointing a bank account
+ // external to the libeufin-bank.
+ // Payments will be sent to this bank account
+ // when the user wants to convert the local currency
+ // back to fiat currency outside libeufin-bank.
+ cashout_address?: string;
+
+ // Legal name associated with $username.
+ // When missing, the old name is kept.
+ name?: string;
+
+ // If present, change the is_exchange configuration.
+ // See RegisterAccountRequest
+ is_exchange?: boolean;
+ }
+
+
+ interface AccountPasswordChange {
+
+ // New password.
+ new_password: string;
+ }
+ interface PublicAccountsResponse {
+ public_accounts: PublicAccount[];
+ }
+ interface PublicAccount {
+ payto_uri: string;
+
+ balance: Balance;
+
+ // The account name (=username) of the
+ // libeufin-bank account.
+ account_name: string;
+ }
+
+ interface ListBankAccountsResponse {
+ accounts: AccountMinimalData[];
+ }
+ // interface Balance {
+ // amount: Amount;
+ // credit_debit_indicator: "credit" | "debit";
+ // }
+ type Balance = Amount
+ interface AccountMinimalData {
+ // Username
+ username: string;
+
+ // Legal name of the account owner.
+ name: string;
+
+ // current balance of the account
+ balance: Balance;
+
+ // Number indicating the max debit allowed for the requesting user.
+ debit_threshold: Amount;
+ }
+
+ interface AccountData {
+ // Legal name of the account owner.
+ name: string;
+
+ // Available balance on the account.
+ balance: Balance;
+
+ // payto://-URI of the account.
+ payto_uri: string;
+
+ // Number indicating the max debit allowed for the requesting user.
+ debit_threshold: Amount;
+
+ contact_data?: ChallengeContactData;
+
+ // 'payto' address pointing the bank account
+ // where to send cashouts. This field is optional
+ // because not all the accounts are required to participate
+ // in the merchants' circuit. One example is the exchange:
+ // that never cashouts. Registering these accounts can
+ // be done via the access API.
+ cashout_payto_uri?: string;
}
+
}
namespace Circuit {