aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-10-14 01:40:50 -0300
committerSebastian <sebasjm@gmail.com>2023-10-14 01:40:50 -0300
commit53998741a6f280c5c56573c2db6ffd35ce5c34d9 (patch)
tree5425164817dc59c5a6de24cac2d04196522e5a89
parent592ecda944bf5b32e86f6c42ee8e1f17d9c86451 (diff)
downloadwallet-core-53998741a6f280c5c56573c2db6ffd35ce5c34d9.tar.xz
breaking api: currency spec as the doc mention
-rw-r--r--packages/taler-util/src/http-client/bank-integration.ts7
-rw-r--r--packages/taler-util/src/http-client/index.ts0
-rw-r--r--packages/taler-util/src/index.ts5
-rw-r--r--packages/taler-util/src/taler-types.ts8
-rw-r--r--packages/taler-util/src/wallet-types.ts21
-rw-r--r--packages/taler-wallet-core/src/versions.ts15
-rw-r--r--packages/taler-wallet-core/src/wallet.ts24
7 files changed, 43 insertions, 37 deletions
diff --git a/packages/taler-util/src/http-client/bank-integration.ts b/packages/taler-util/src/http-client/bank-integration.ts
index cdba66fa5..cd6462417 100644
--- a/packages/taler-util/src/http-client/bank-integration.ts
+++ b/packages/taler-util/src/http-client/bank-integration.ts
@@ -1,7 +1,10 @@
import { HttpRequestLibrary, readSuccessResponseJsonOrThrow } from "../http-common.js";
import { createPlatformHttpLib } from "../http.js";
-import { codecForBankWithdrawalOperationPostResponse } from "../taler-types.js";
-import { TalerBankIntegrationApi, codecForBankVersion, codecForBankWithdrawalOperationStatus } from "./types.js";
+import {
+ TalerBankIntegrationApi,
+ codecForBankWithdrawalOperationPostResponse,
+ codecForBankWithdrawalOperationStatus
+} from "./types.js";
export class TalerBankIntegrationHttpClient {
httpLib: HttpRequestLibrary;
diff --git a/packages/taler-util/src/http-client/index.ts b/packages/taler-util/src/http-client/index.ts
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/packages/taler-util/src/http-client/index.ts
diff --git a/packages/taler-util/src/index.ts b/packages/taler-util/src/index.ts
index 568e2f438..71d4253f0 100644
--- a/packages/taler-util/src/index.ts
+++ b/packages/taler-util/src/index.ts
@@ -42,3 +42,8 @@ export * from "./transaction-test-data.js";
export * from "./libeufin-api-types.js";
export * from "./MerchantApiClient.js";
export * from "./bank-api-client.js";
+export * from "./http-client/bank-core.js";
+export * from "./http-client/bank-integration.js";
+export * from "./http-client/bank-revenue.js";
+export * from "./http-client/bank-wire.js";
+export * from "./http-client/types.js";
diff --git a/packages/taler-util/src/taler-types.ts b/packages/taler-util/src/taler-types.ts
index d8fdc2519..767adb799 100644
--- a/packages/taler-util/src/taler-types.ts
+++ b/packages/taler-util/src/taler-types.ts
@@ -951,7 +951,7 @@ export interface AccountInfo {
/**
* @deprecated
*/
-export interface ExchangeWireJson {}
+export interface ExchangeWireJson { }
/**
* Proposal returned from the contract URL.
@@ -1310,12 +1310,6 @@ export const codecForDenominationPubKey = () =>
.alternative(DenomKeyType.ClauseSchnorr, codecForCsDenominationPubKey())
.build("DenominationPubKey");
-export const codecForBankWithdrawalOperationPostResponse =
- (): Codec<BankWithdrawalOperationPostResponse> =>
- buildCodecForObject<BankWithdrawalOperationPostResponse>()
- .property("transfer_done", codecForBoolean())
- .build("BankWithdrawalOperationPostResponse");
-
export type AmountString = string;
export type Base32String = string;
export type EddsaSignatureString = string;
diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts
index 9a4e15ae1..49dae9bd4 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -46,6 +46,7 @@ import {
codecOptional,
renderContext,
} from "./codec.js";
+import { CurrencySpecification } from "./index.js";
import { VersionMatchResult } from "./libtool-version.js";
import { PaytoUri } from "./payto.js";
import { AgeCommitmentProof } from "./taler-crypto.js";
@@ -429,16 +430,6 @@ export interface GetCurrencySpecificationResponse {
currencySpecification: CurrencySpecification;
}
-export interface CurrencySpecification {
- decimal_separator: string;
- fractional_input_digits: number;
- fractional_normal_digits: number;
- fractional_trailing_zero_digits: number;
- is_currency_name_leading: boolean;
- name: string;
- alt_unit_names: { [n: number]: string };
-}
-
export interface InitRequest {
skipDefaults?: boolean;
}
@@ -556,11 +547,11 @@ export interface CoinDumpJson {
withdrawal_reserve_pub: string | undefined;
coin_status: CoinStatus;
spend_allocation:
- | {
- id: string;
- amount: string;
- }
- | undefined;
+ | {
+ id: string;
+ amount: string;
+ }
+ | undefined;
/**
* Information about the age restriction
*/
diff --git a/packages/taler-wallet-core/src/versions.ts b/packages/taler-wallet-core/src/versions.ts
index e46c7ebe1..8e0e5561b 100644
--- a/packages/taler-wallet-core/src/versions.ts
+++ b/packages/taler-wallet-core/src/versions.ts
@@ -40,4 +40,17 @@ export const WALLET_BANK_INTEGRATION_PROTOCOL_VERSION = "0:0:0";
* Will be replaced with the value from package.json in a
* post-compilation step (inside lib/).
*/
-export const WALLET_CORE_IMPLEMENTATION_VERSION = "0:0:0";
+export const WALLET_CORE_IMPLEMENTATION_VERSION = "1:0:0";
+
+/**
+ * Libtool rules:
+ *
+ * If the library source code has changed at all since the last update,
+ * then increment revision (‘c:r:a’ becomes ‘c:r+1:a’).
+ * If any interfaces have been added, removed, or changed since the last
+ * update, increment current, and set revision to 0.
+ * If any interfaces have been added since the last public release, then
+ * increment age.
+ * If any interfaces have been removed or changed since the last public
+ * release, then set age to 0.
+ */ \ No newline at end of file
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index 571bf07ee..a8c2895f8 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -927,9 +927,9 @@ async function dumpCoins(ws: InternalWalletState): Promise<CoinDumpJson> {
ageCommitmentProof: c.ageCommitmentProof,
spend_allocation: c.spendAllocation
? {
- amount: c.spendAllocation.amount,
- id: c.spendAllocation.id,
- }
+ amount: c.spendAllocation.amount,
+ id: c.spendAllocation.id,
+ }
: undefined,
});
}
@@ -1436,9 +1436,9 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
currencySpecification: {
decimal_separator: ",",
name: "Kudos (Taler Demonstrator)",
- fractional_input_digits: 2,
- fractional_normal_digits: 2,
- fractional_trailing_zero_digits: 2,
+ num_fractional_input_digits: 2,
+ num_fractional_normal_digits: 2,
+ num_fractional_trailing_zero_digits: 2,
is_currency_name_leading: true,
alt_unit_names: {
"0": "ク",
@@ -1451,9 +1451,9 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
currencySpecification: {
decimal_separator: ",",
name: "Test (Taler Unstable Demonstrator)",
- fractional_input_digits: 0,
- fractional_normal_digits: 0,
- fractional_trailing_zero_digits: 0,
+ num_fractional_input_digits: 0,
+ num_fractional_normal_digits: 0,
+ num_fractional_trailing_zero_digits: 0,
is_currency_name_leading: false,
alt_unit_names: {},
},
@@ -1464,9 +1464,9 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
currencySpecification: {
decimal_separator: ",",
name: "Unknown",
- fractional_input_digits: 2,
- fractional_normal_digits: 2,
- fractional_trailing_zero_digits: 2,
+ num_fractional_input_digits: 2,
+ num_fractional_normal_digits: 2,
+ num_fractional_trailing_zero_digits: 2,
is_currency_name_leading: true,
alt_unit_names: {},
},