diff options
author | Florian Dold <florian@dold.me> | 2022-10-14 22:38:40 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-10-14 22:38:40 +0200 |
commit | eec6695be0409669fcad36c6cc7ea01f48d41c97 (patch) | |
tree | 7e2611df26011b60eb6425d40f3c2d789b5cac9b /packages/taler-util/src | |
parent | a57fcb144d8de40fe50b825d34a27e415ef3fec3 (diff) | |
download | wallet-core-eec6695be0409669fcad36c6cc7ea01f48d41c97.tar.xz |
wallet-core: DB tweaks, consistent file naming convention
Diffstat (limited to 'packages/taler-util/src')
-rw-r--r-- | packages/taler-util/src/ReserveStatus.ts | 2 | ||||
-rw-r--r-- | packages/taler-util/src/ReserveTransaction.ts | 2 | ||||
-rw-r--r-- | packages/taler-util/src/amounts.ts | 2 | ||||
-rw-r--r-- | packages/taler-util/src/backup-types.ts (renamed from packages/taler-util/src/backupTypes.ts) | 2 | ||||
-rw-r--r-- | packages/taler-util/src/bitcoin.ts | 2 | ||||
-rw-r--r-- | packages/taler-util/src/contract-terms.test.ts (renamed from packages/taler-util/src/contractTerms.test.ts) | 2 | ||||
-rw-r--r-- | packages/taler-util/src/contract-terms.ts (renamed from packages/taler-util/src/contractTerms.ts) | 2 | ||||
-rw-r--r-- | packages/taler-util/src/index.ts | 12 | ||||
-rw-r--r-- | packages/taler-util/src/notifications.ts | 2 | ||||
-rw-r--r-- | packages/taler-util/src/taler-crypto.test.ts (renamed from packages/taler-util/src/talerCrypto.test.ts) | 2 | ||||
-rw-r--r-- | packages/taler-util/src/taler-crypto.ts (renamed from packages/taler-util/src/talerCrypto.ts) | 2 | ||||
-rw-r--r-- | packages/taler-util/src/taler-types.ts (renamed from packages/taler-util/src/talerTypes.ts) | 2 | ||||
-rw-r--r-- | packages/taler-util/src/transactions-types.ts (renamed from packages/taler-util/src/transactionsTypes.ts) | 10 | ||||
-rw-r--r-- | packages/taler-util/src/types-test.ts | 2 | ||||
-rw-r--r-- | packages/taler-util/src/wallet-types.ts (renamed from packages/taler-util/src/walletTypes.ts) | 18 |
15 files changed, 39 insertions, 25 deletions
diff --git a/packages/taler-util/src/ReserveStatus.ts b/packages/taler-util/src/ReserveStatus.ts index eb147da2d..be9fa9e8e 100644 --- a/packages/taler-util/src/ReserveStatus.ts +++ b/packages/taler-util/src/ReserveStatus.ts @@ -27,7 +27,7 @@ import { codecForList, Codec, } from "./codec.js"; -import { AmountString } from "./talerTypes.js"; +import { AmountString } from "./taler-types.js"; import { ReserveTransaction, codecForReserveTransaction, diff --git a/packages/taler-util/src/ReserveTransaction.ts b/packages/taler-util/src/ReserveTransaction.ts index 8f3e16da2..5d3f86b1a 100644 --- a/packages/taler-util/src/ReserveTransaction.ts +++ b/packages/taler-util/src/ReserveTransaction.ts @@ -37,7 +37,7 @@ import { EddsaSignatureString, EddsaPublicKeyString, CoinPublicKeyString, -} from "./talerTypes.js"; +} from "./taler-types.js"; import { AbsoluteTime, codecForTimestamp, diff --git a/packages/taler-util/src/amounts.ts b/packages/taler-util/src/amounts.ts index d4de4ca53..337f342a3 100644 --- a/packages/taler-util/src/amounts.ts +++ b/packages/taler-util/src/amounts.ts @@ -27,7 +27,7 @@ import { codecForNumber, Codec, } from "./codec.js"; -import { AmountString } from "./talerTypes.js"; +import { AmountString } from "./taler-types.js"; /** * Number of fractional units that one value unit represents. diff --git a/packages/taler-util/src/backupTypes.ts b/packages/taler-util/src/backup-types.ts index 0270f2586..6c7b203b5 100644 --- a/packages/taler-util/src/backupTypes.ts +++ b/packages/taler-util/src/backup-types.ts @@ -62,7 +62,7 @@ /** * Imports. */ -import { DenominationPubKey, UnblindedSignature } from "./talerTypes.js"; +import { DenominationPubKey, UnblindedSignature } from "./taler-types.js"; import { TalerProtocolDuration, TalerProtocolTimestamp } from "./time.js"; export const BACKUP_TAG = "gnu-taler-wallet-backup-content" as const; diff --git a/packages/taler-util/src/bitcoin.ts b/packages/taler-util/src/bitcoin.ts index ede3cbcdc..8c22ba522 100644 --- a/packages/taler-util/src/bitcoin.ts +++ b/packages/taler-util/src/bitcoin.ts @@ -23,7 +23,7 @@ * Imports. */ import { AmountJson, Amounts } from "./amounts.js"; -import { decodeCrock } from "./talerCrypto.js"; +import { decodeCrock } from "./taler-crypto.js"; import * as segwit from "./segwit_addr.js"; function buf2hex(buffer: Uint8Array) { diff --git a/packages/taler-util/src/contractTerms.test.ts b/packages/taler-util/src/contract-terms.test.ts index d021495d0..fc0920501 100644 --- a/packages/taler-util/src/contractTerms.test.ts +++ b/packages/taler-util/src/contract-terms.test.ts @@ -19,7 +19,7 @@ */ import test from "ava"; import { initNodePrng } from "./prng-node.js"; -import { ContractTermsUtil } from "./contractTerms.js"; +import { ContractTermsUtil } from "./contract-terms.js"; // Since we import nacl-fast directly (and not via index.node.ts), we need to // init the PRNG manually. diff --git a/packages/taler-util/src/contractTerms.ts b/packages/taler-util/src/contract-terms.ts index aa6bf7baf..3567b50d8 100644 --- a/packages/taler-util/src/contractTerms.ts +++ b/packages/taler-util/src/contract-terms.ts @@ -23,7 +23,7 @@ import { getRandomBytes, hash, stringToBytes, -} from "./talerCrypto.js"; +} from "./taler-crypto.js"; const logger = new Logger("contractTerms.ts"); diff --git a/packages/taler-util/src/index.ts b/packages/taler-util/src/index.ts index cf48ba803..1d55da068 100644 --- a/packages/taler-util/src/index.ts +++ b/packages/taler-util/src/index.ts @@ -3,7 +3,7 @@ import { TalerErrorCode } from "./taler-error-codes.js"; export { TalerErrorCode }; export * from "./amounts.js"; -export * from "./backupTypes.js"; +export * from "./backup-types.js"; export * from "./codec.js"; export * from "./helpers.js"; export * from "./libtool-version.js"; @@ -11,17 +11,17 @@ export * from "./notifications.js"; export * from "./payto.js"; export * from "./ReserveStatus.js"; export * from "./ReserveTransaction.js"; -export * from "./talerTypes.js"; +export * from "./taler-types.js"; export * from "./taleruri.js"; export * from "./time.js"; -export * from "./transactionsTypes.js"; -export * from "./walletTypes.js"; +export * from "./transactions-types.js"; +export * from "./wallet-types.js"; export * from "./i18n.js"; export * from "./logging.js"; export * from "./url.js"; export { fnutil } from "./fnutils.js"; export * from "./kdf.js"; -export * from "./talerCrypto.js"; +export * from "./taler-crypto.js"; export * from "./http-status-codes.js"; export * from "./bitcoin.js"; export { @@ -32,4 +32,4 @@ export { } from "./nacl-fast.js"; export { RequestThrottler } from "./RequestThrottler.js"; export * from "./CancellationToken.js"; -export * from "./contractTerms.js"; +export * from "./contract-terms.js"; diff --git a/packages/taler-util/src/notifications.ts b/packages/taler-util/src/notifications.ts index b3d9ad1dc..17019237a 100644 --- a/packages/taler-util/src/notifications.ts +++ b/packages/taler-util/src/notifications.ts @@ -22,7 +22,7 @@ /** * Imports. */ -import { TalerErrorDetail } from "./walletTypes.js"; +import { TalerErrorDetail } from "./wallet-types.js"; export enum NotificationType { CoinWithdrawn = "coin-withdrawn", diff --git a/packages/taler-util/src/talerCrypto.test.ts b/packages/taler-util/src/taler-crypto.test.ts index 29458ac37..e90516cc4 100644 --- a/packages/taler-util/src/talerCrypto.test.ts +++ b/packages/taler-util/src/taler-crypto.test.ts @@ -38,7 +38,7 @@ import { getRandomBytes, bigintToNaclArr, bigintFromNaclArr, -} from "./talerCrypto.js"; +} from "./taler-crypto.js"; import { sha512, kdf } from "./kdf.js"; import * as nacl from "./nacl-fast.js"; import { initNodePrng } from "./prng-node.js"; diff --git a/packages/taler-util/src/talerCrypto.ts b/packages/taler-util/src/taler-crypto.ts index 84842a69f..d7e9a0c06 100644 --- a/packages/taler-util/src/talerCrypto.ts +++ b/packages/taler-util/src/taler-crypto.ts @@ -30,7 +30,7 @@ import { DenominationPubKey, DenomKeyType, HashCodeString, -} from "./talerTypes.js"; +} from "./taler-types.js"; import { Logger } from "./logging.js"; import { secretbox } from "./nacl-fast.js"; import * as fflate from "fflate"; diff --git a/packages/taler-util/src/talerTypes.ts b/packages/taler-util/src/taler-types.ts index 1cb4e2bde..de88fef69 100644 --- a/packages/taler-util/src/talerTypes.ts +++ b/packages/taler-util/src/taler-types.ts @@ -41,7 +41,7 @@ import { codecOptional, } from "./codec.js"; import { strcmp } from "./helpers.js"; -import { AgeCommitmentProof, Edx25519PublicKeyEnc } from "./talerCrypto.js"; +import { AgeCommitmentProof, Edx25519PublicKeyEnc } from "./taler-crypto.js"; import { codecForAbsoluteTime, codecForDuration, diff --git a/packages/taler-util/src/transactionsTypes.ts b/packages/taler-util/src/transactions-types.ts index 5fd01448c..c1870e2e0 100644 --- a/packages/taler-util/src/transactionsTypes.ts +++ b/packages/taler-util/src/transactions-types.ts @@ -34,7 +34,7 @@ import { codecForMerchantInfo, codecForProduct, Location, -} from "./talerTypes.js"; +} from "./taler-types.js"; import { Codec, buildCodecForObject, @@ -43,7 +43,11 @@ import { codecForList, codecForAny, } from "./codec.js"; -import { RefreshReason, TalerErrorDetail } from "./walletTypes.js"; +import { + RefreshReason, + TalerErrorDetail, + TransactionIdStr, +} from "./wallet-types.js"; export interface TransactionsRequest { /** @@ -68,7 +72,7 @@ export interface TransactionsResponse { export interface TransactionCommon { // opaque unique ID for the transaction, used as a starting point for paginating queries // and for invoking actions on the transaction (e.g. deleting/hiding it from the history) - transactionId: string; + transactionId: TransactionIdStr; // the type of the transaction; different types might provide additional information type: TransactionType; diff --git a/packages/taler-util/src/types-test.ts b/packages/taler-util/src/types-test.ts index e8af13119..2915106c2 100644 --- a/packages/taler-util/src/types-test.ts +++ b/packages/taler-util/src/types-test.ts @@ -15,7 +15,7 @@ */ import test from "ava"; -import { codecForContractTerms } from "./talerTypes.js"; +import { codecForContractTerms } from "./taler-types.js"; test("contract terms validation", (t) => { const c = { diff --git a/packages/taler-util/src/walletTypes.ts b/packages/taler-util/src/wallet-types.ts index 0b2ef1d5f..cd6c2202e 100644 --- a/packages/taler-util/src/walletTypes.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -62,15 +62,25 @@ import { DenomKeyType, ExchangeAuditor, UnblindedSignature, -} from "./talerTypes.js"; -import { OrderShortInfo, codecForOrderShortInfo } from "./transactionsTypes.js"; -import { BackupRecovery } from "./backupTypes.js"; +} from "./taler-types.js"; +import { OrderShortInfo, codecForOrderShortInfo } from "./transactions-types.js"; +import { BackupRecovery } from "./backup-types.js"; import { PaytoUri } from "./payto.js"; import { TalerErrorCode } from "./taler-error-codes.js"; -import { AgeCommitmentProof } from "./talerCrypto.js"; +import { AgeCommitmentProof } from "./taler-crypto.js"; import { VersionMatchResult } from "./libtool-version.js"; /** + * Identifier for a transaction in the wallet. + */ +export type TransactionIdStr = `tx:${string}:${string}`; + +/** + * Identifier for a pending task in the wallet. + */ +export type PendingIdStr = `pd:${string}:string`; + +/** * Response for the create reserve request to the wallet. */ export class CreateReserveResponse { |