diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-08-15 13:47:29 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-08-15 13:47:29 +0200 |
commit | 819949d7f2cfcce8d334cbfdb701255daac64951 (patch) | |
tree | 592043554f59ec209f9afc1c31c20c4fb585c3ca /packages/taler-wallet-core/src | |
parent | 77ea209ddb6d457db0ce113f91247207cc29fbd8 (diff) | |
parent | adb0e70f151e63d103f27852312319520f4d0a84 (diff) |
Merge branch 'master' into age-withdraw
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r-- | packages/taler-wallet-core/src/db.ts | 5 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/wallet-api-types.ts | 10 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 13 |
3 files changed, 27 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts index 3d2878d93..c7d0b0bda 100644 --- a/packages/taler-wallet-core/src/db.ts +++ b/packages/taler-wallet-core/src/db.ts @@ -711,7 +711,10 @@ export interface RewardCoinSource { coinIndex: number; } -export type CoinSource = WithdrawCoinSource | RefreshCoinSource | RewardCoinSource; +export type CoinSource = + | WithdrawCoinSource + | RefreshCoinSource + | RewardCoinSource; /** * CoinRecord as stored in the "coins" data store diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts index eaa99a6c3..36c4809af 100644 --- a/packages/taler-wallet-core/src/wallet-api-types.ts +++ b/packages/taler-wallet-core/src/wallet-api-types.ts @@ -114,6 +114,8 @@ import { WithdrawUriInfoResponse, SharePaymentRequest, SharePaymentResult, + GetCurrencyInfoRequest, + GetCurrencyInfoResponse, } from "@gnu-taler/taler-util"; import { AuditorTrustRecord, WalletContractData } from "./db.js"; import { @@ -210,6 +212,7 @@ export enum WalletApiOperation { ApplyDevExperiment = "applyDevExperiment", ValidateIban = "validateIban", TestingWaitTransactionsFinal = "testingWaitTransactionsFinal", + GetScopedCurrencyInfo = "getScopedCurrencyInfo", } // group: Initialization @@ -601,6 +604,12 @@ export type ListCurrenciesOp = { response: WalletCurrencyInfo; }; +export type GetScopedCurrencyInfoOp = { + op: WalletApiOperation.GetScopedCurrencyInfo; + request: GetCurrencyInfoRequest; + response: GetCurrencyInfoResponse; +}; + // group: Deposits /** @@ -1072,6 +1081,7 @@ export type WalletOperations = { [WalletApiOperation.ApplyDevExperiment]: ApplyDevExperimentOp; [WalletApiOperation.ValidateIban]: ValidateIbanOp; [WalletApiOperation.TestingWaitTransactionsFinal]: TestingWaitTransactionsFinal; + [WalletApiOperation.GetScopedCurrencyInfo]: GetScopedCurrencyInfoOp; }; export type WalletCoreRequestType< diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index aab414e94..796a96f14 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -118,6 +118,8 @@ import { sampleWalletCoreTransactions, validateIban, codecForSharePaymentRequest, + GetCurrencyInfoResponse, + codecForGetCurrencyInfoRequest, } from "@gnu-taler/taler-util"; import { HttpRequestLibrary, @@ -1395,6 +1397,17 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( const resp = await getBackupRecovery(ws); return resp; } + case WalletApiOperation.GetScopedCurrencyInfo: { + // Ignore result, just validate in this mock implementation + codecForGetCurrencyInfoRequest().decode(payload); + const resp: GetCurrencyInfoResponse = { + decimalSeparator: ",", + isCurrencyNameLeading: false, + numFractionalDigits: 2, + numTinyDigits: 1, + }; + return resp; + } case WalletApiOperation.ImportBackupRecovery: { const req = codecForAny().decode(payload); await loadBackupRecovery(ws, req); |