aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util/src/wallet-types.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-01-16 13:15:40 +0100
committerFlorian Dold <florian@dold.me>2024-01-16 13:15:40 +0100
commit1c286ebb2f1c817f5362517d47466c39826c8699 (patch)
treec0cfcee641529032ee06674b943036fe5c0a7cef /packages/taler-util/src/wallet-types.ts
parent2e2cf4049a771c82fcc520686de3ace7603baa05 (diff)
downloadwallet-core-1c286ebb2f1c817f5362517d47466c39826c8699.tar.xz
wallet-core: implement remaining DD48 calls, test
Diffstat (limited to 'packages/taler-util/src/wallet-types.ts')
-rw-r--r--packages/taler-util/src/wallet-types.ts63
1 files changed, 47 insertions, 16 deletions
diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts
index 583d5dff5..52156cf9e 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -577,11 +577,11 @@ export interface CoinDumpJson {
withdrawal_reserve_pub: string | undefined;
coin_status: CoinStatus;
spend_allocation:
- | {
- id: string;
- amount: AmountString;
- }
- | undefined;
+ | {
+ id: string;
+ amount: AmountString;
+ }
+ | undefined;
/**
* Information about the age restriction
*/
@@ -944,14 +944,14 @@ export interface PreparePayResultAlreadyConfirmed {
}
export interface BankWithdrawDetails {
- status: WithdrawalOperationStatus,
+ status: WithdrawalOperationStatus;
amount: AmountJson;
senderWire?: string;
suggestedExchange?: string;
confirmTransferUrl?: string;
wireTypes: string[];
- operationId: string,
- apiBaseUrl: string,
+ operationId: string;
+ apiBaseUrl: string;
}
export interface AcceptWithdrawalResponse {
@@ -1701,6 +1701,31 @@ export const codecForUpdateExchangeEntryRequest =
.property("exchangeBaseUrl", codecForString())
.build("UpdateExchangeEntryRequest");
+export interface GetExchangeResourcesRequest {
+ exchangeBaseUrl: string;
+}
+
+export const codecForGetExchangeResourcesRequest =
+ (): Codec<GetExchangeResourcesRequest> =>
+ buildCodecForObject<GetExchangeResourcesRequest>()
+ .property("exchangeBaseUrl", codecForString())
+ .build("GetExchangeResourcesRequest");
+
+export interface GetExchangeResourcesResponse {
+ hasResources: boolean;
+}
+
+export interface DeleteExchangeRequest {
+ exchangeBaseUrl: string;
+ purge?: boolean;
+}
+
+export const codecForDeleteExchangeRequest = (): Codec<DeleteExchangeRequest> =>
+ buildCodecForObject<DeleteExchangeRequest>()
+ .property("exchangeBaseUrl", codecForString())
+ .property("purge", codecOptional(codecForBoolean()))
+ .build("DeleteExchangeRequest");
+
export interface ForceExchangeUpdateRequest {
exchangeBaseUrl: string;
}
@@ -1810,7 +1835,10 @@ export const codecForGetWithdrawalDetailsForUri =
buildCodecForObject<GetWithdrawalDetailsForUriRequest>()
.property("talerWithdrawUri", codecForString())
.property("restrictAge", codecOptional(codecForNumber()))
- .property("notifyChangeFromPendingTimeoutMs", codecOptional(codecForNumber()))
+ .property(
+ "notifyChangeFromPendingTimeoutMs",
+ codecOptional(codecForNumber()),
+ )
.build("GetWithdrawalDetailsForUriRequest");
export interface ListKnownBankAccountsRequest {
@@ -2191,7 +2219,7 @@ export interface TxIdResponse {
export interface WithdrawUriInfoResponse {
operationId: string;
- status: WithdrawalOperationStatus,
+ status: WithdrawalOperationStatus;
confirmTransferUrl?: string;
amount: AmountString;
defaultExchangeBaseUrl?: string;
@@ -2203,12 +2231,15 @@ export const codecForWithdrawUriInfoResponse =
buildCodecForObject<WithdrawUriInfoResponse>()
.property("operationId", codecForString())
.property("confirmTransferUrl", codecOptional(codecForString()))
- .property("status", codecForEither(
- codecForConstString("pending"),
- codecForConstString("selected"),
- codecForConstString("aborted"),
- codecForConstString("confirmed"),
- ))
+ .property(
+ "status",
+ codecForEither(
+ codecForConstString("pending"),
+ codecForConstString("selected"),
+ codecForConstString("aborted"),
+ codecForConstString("confirmed"),
+ ),
+ )
.property("amount", codecForAmountString())
.property("defaultExchangeBaseUrl", codecOptional(codecForString()))
.property("possibleExchanges", codecForList(codecForExchangeListItem()))