diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-10-11 13:44:41 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-10-11 13:44:41 +0200 |
commit | e13278315c99eaafda0c6dc59adc2511f04bb1ba (patch) | |
tree | 8facae92e3c8966a8ea3cce7622f0e3726b9043f /packages/taler-util | |
parent | 490b813f77b3806343bbdd453d5abd29db9ea037 (diff) | |
parent | 0631187f42921fab0e20be91a95c1d7eacda277f (diff) |
Merge branch 'master' into age-withdraw
Diffstat (limited to 'packages/taler-util')
-rw-r--r-- | packages/taler-util/Makefile | 42 | ||||
-rw-r--r-- | packages/taler-util/src/wallet-types.ts | 37 |
2 files changed, 63 insertions, 16 deletions
diff --git a/packages/taler-util/Makefile b/packages/taler-util/Makefile new file mode 100644 index 000000000..def16c823 --- /dev/null +++ b/packages/taler-util/Makefile @@ -0,0 +1,42 @@ +# This Makefile has been placed in the public domain. + +ifeq ($(TOPLEVEL), yes) + $(info top-level build) + -include ../../.config.mk + override DESTDIR := $(TOP_DESTDIR) +else + $(info package-level build) + -include ../../.config.mk + -include .config.mk +endif + +$(info prefix is $(prefix)) + +all: + @echo use 'make install' to build and install taler-util + +ifndef prefix +.PHONY: warn-noprefix install +warn-noprefix: + @echo "no prefix configured, did you run ./configure?" +install: warn-noprefix +else +LIBDIR = $(prefix)/share/taler-js/taler-util +NODE_DEPS = $(shell jq "(.dependencies|keys|map(\"node_modules/\" + .)|join(\" \"))" package.json -r) +.PHONY: install install-nodeps deps +install-nodeps: + pnpm compile + @echo installing taler-util to $(DESTDIR)$(prefix) + install -d $(DESTDIR)$(LIBDIR)/lib/globbing + install lib/*.* $(DESTDIR)$(LIBDIR)/lib + install lib/globbing/*.* $(DESTDIR)$(LIBDIR)/lib/globbing + install package.json $(DESTDIR)$(LIBDIR) + tar hcf - $(NODE_DEPS) | (cd $(DESTDIR)$(LIBDIR); tar xf -) + +deps: + pnpm install --frozen-lockfile --filter @gnu-taler/taler-util... + pnpm run --filter @gnu-taler/taler-util... compile +install: + $(MAKE) deps + $(MAKE) install-nodeps +endif diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 4811d674f..9a4e15ae1 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -415,24 +415,28 @@ export const codecForScopeInfo = (): Codec<ScopeInfo> => .alternative(ScopeType.Auditor, codecForScopeInfoAuditor()) .build("ScopeInfo"); -export interface GetCurrencyInfoRequest { +export interface GetCurrencySpecificationRequest { scope: ScopeInfo; } export const codecForGetCurrencyInfoRequest = - (): Codec<GetCurrencyInfoRequest> => - buildCodecForObject<GetCurrencyInfoRequest>() + (): Codec<GetCurrencySpecificationRequest> => + buildCodecForObject<GetCurrencySpecificationRequest>() .property("scope", codecForScopeInfo()) - .build("GetCurrencyInfoRequest"); + .build("GetCurrencySpecificationRequest"); -export interface GetCurrencyInfoResponse { - decimalSeparator: string; - numFractionalDigits: number; - numTinyDigits: number; - /** - * Is the currency name leading or trailing? - */ - isCurrencyNameLeading: boolean; +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 { @@ -1605,10 +1609,11 @@ export interface UpdateExchangeEntryRequest { exchangeBaseUrl: string; } -export const codecForUpdateExchangeEntryRequest = (): Codec<UpdateExchangeEntryRequest> => - buildCodecForObject<UpdateExchangeEntryRequest>() - .property("exchangeBaseUrl", codecForString()) - .build("UpdateExchangeEntryRequest"); +export const codecForUpdateExchangeEntryRequest = + (): Codec<UpdateExchangeEntryRequest> => + buildCodecForObject<UpdateExchangeEntryRequest>() + .property("exchangeBaseUrl", codecForString()) + .build("UpdateExchangeEntryRequest"); export interface ForceExchangeUpdateRequest { exchangeBaseUrl: string; |