breaking api: currency spec as the doc mention

This commit is contained in:
Sebastian 2023-10-14 01:40:50 -03:00
parent 592ecda944
commit 53998741a6
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069
7 changed files with 43 additions and 37 deletions

View File

@ -1,7 +1,10 @@
import { HttpRequestLibrary, readSuccessResponseJsonOrThrow } from "../http-common.js"; import { HttpRequestLibrary, readSuccessResponseJsonOrThrow } from "../http-common.js";
import { createPlatformHttpLib } from "../http.js"; import { createPlatformHttpLib } from "../http.js";
import { codecForBankWithdrawalOperationPostResponse } from "../taler-types.js"; import {
import { TalerBankIntegrationApi, codecForBankVersion, codecForBankWithdrawalOperationStatus } from "./types.js"; TalerBankIntegrationApi,
codecForBankWithdrawalOperationPostResponse,
codecForBankWithdrawalOperationStatus
} from "./types.js";
export class TalerBankIntegrationHttpClient { export class TalerBankIntegrationHttpClient {
httpLib: HttpRequestLibrary; httpLib: HttpRequestLibrary;

View File

@ -42,3 +42,8 @@ export * from "./transaction-test-data.js";
export * from "./libeufin-api-types.js"; export * from "./libeufin-api-types.js";
export * from "./MerchantApiClient.js"; export * from "./MerchantApiClient.js";
export * from "./bank-api-client.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";

View File

@ -1310,12 +1310,6 @@ export const codecForDenominationPubKey = () =>
.alternative(DenomKeyType.ClauseSchnorr, codecForCsDenominationPubKey()) .alternative(DenomKeyType.ClauseSchnorr, codecForCsDenominationPubKey())
.build("DenominationPubKey"); .build("DenominationPubKey");
export const codecForBankWithdrawalOperationPostResponse =
(): Codec<BankWithdrawalOperationPostResponse> =>
buildCodecForObject<BankWithdrawalOperationPostResponse>()
.property("transfer_done", codecForBoolean())
.build("BankWithdrawalOperationPostResponse");
export type AmountString = string; export type AmountString = string;
export type Base32String = string; export type Base32String = string;
export type EddsaSignatureString = string; export type EddsaSignatureString = string;

View File

@ -46,6 +46,7 @@ import {
codecOptional, codecOptional,
renderContext, renderContext,
} from "./codec.js"; } from "./codec.js";
import { CurrencySpecification } from "./index.js";
import { VersionMatchResult } from "./libtool-version.js"; import { VersionMatchResult } from "./libtool-version.js";
import { PaytoUri } from "./payto.js"; import { PaytoUri } from "./payto.js";
import { AgeCommitmentProof } from "./taler-crypto.js"; import { AgeCommitmentProof } from "./taler-crypto.js";
@ -429,16 +430,6 @@ export interface GetCurrencySpecificationResponse {
currencySpecification: CurrencySpecification; 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 { export interface InitRequest {
skipDefaults?: boolean; skipDefaults?: boolean;
} }

View File

@ -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 * Will be replaced with the value from package.json in a
* post-compilation step (inside lib/). * 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.
*/

View File

@ -1436,9 +1436,9 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
currencySpecification: { currencySpecification: {
decimal_separator: ",", decimal_separator: ",",
name: "Kudos (Taler Demonstrator)", name: "Kudos (Taler Demonstrator)",
fractional_input_digits: 2, num_fractional_input_digits: 2,
fractional_normal_digits: 2, num_fractional_normal_digits: 2,
fractional_trailing_zero_digits: 2, num_fractional_trailing_zero_digits: 2,
is_currency_name_leading: true, is_currency_name_leading: true,
alt_unit_names: { alt_unit_names: {
"0": "ク", "0": "ク",
@ -1451,9 +1451,9 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
currencySpecification: { currencySpecification: {
decimal_separator: ",", decimal_separator: ",",
name: "Test (Taler Unstable Demonstrator)", name: "Test (Taler Unstable Demonstrator)",
fractional_input_digits: 0, num_fractional_input_digits: 0,
fractional_normal_digits: 0, num_fractional_normal_digits: 0,
fractional_trailing_zero_digits: 0, num_fractional_trailing_zero_digits: 0,
is_currency_name_leading: false, is_currency_name_leading: false,
alt_unit_names: {}, alt_unit_names: {},
}, },
@ -1464,9 +1464,9 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
currencySpecification: { currencySpecification: {
decimal_separator: ",", decimal_separator: ",",
name: "Unknown", name: "Unknown",
fractional_input_digits: 2, num_fractional_input_digits: 2,
fractional_normal_digits: 2, num_fractional_normal_digits: 2,
fractional_trailing_zero_digits: 2, num_fractional_trailing_zero_digits: 2,
is_currency_name_leading: true, is_currency_name_leading: true,
alt_unit_names: {}, alt_unit_names: {},
}, },