Options
All
  • Public
  • Public/Protected
  • All
Menu

Module taler-util/src

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

AmountLike

AmountLike: AmountString | AmountJson

Type for things that are treated like amounts.

AmountString

AmountString: string

BackupCoinSource

Metadata about a coin depending on the origin.

BackupDenomSel

BackupDenomSel: { count: number; denom_pub_hash: string }[]

Denomination selection.

BackupRefundItem

State of one refund from the merchant, maintained by the wallet.

Base32String

Base32String: string

CoinPublicKeyString

CoinPublicKeyString: string

ConfirmPayResult

CoreApiEnvelope

CoreApiResponse

EddsaPublicKeyString

EddsaPublicKeyString: string

EddsaSignatureString

EddsaSignatureString: string

MerchantAbortPayRefundStatus

MerchantCoinRefundStatus

PreparePayResult

ReserveTransaction

Format of the exchange's transaction history for a reserve.

Transaction

Transaction: TransactionWithdrawal | TransactionPayment | TransactionRefund | TransactionTip | TransactionRefresh | TransactionDeposit

WalletNotification

WithdrawalDetails

WithdrawalDetails: WithdrawalDetailsForManualTransfer | WithdrawalDetailsForTalerBankIntegrationApi

Variables

Const amountFractionalBase

amountFractionalBase: 100000000 = 1e8

Number of fractional units that one value unit represents.

Const amountFractionalLength

amountFractionalLength: 8 = 8

How many digits behind the comma are required to represent the fractional value in human readable decimal format? Must match lg(fractionalBase)

Const amountMaxValue

amountMaxValue: number = ...

Maximum allowed value field of an amount.

Const codecForDuration

codecForDuration: Codec<Duration> = ...

Const codecForTimestamp

codecForTimestamp: Codec<Timestamp> = ...

Const withdrawTestBalanceDefaults

withdrawTestBalanceDefaults: { amount: string; bankBaseUrl: string; exchangeBaseUrl: string } = ...

Type declaration

  • amount: string
  • bankBaseUrl: string
  • exchangeBaseUrl: string

Functions

addPaytoQueryParams

  • addPaytoQueryParams(s: string, params: {}): string
  • Add query parameters to a payto URI

    Parameters

    • s: string
    • params: {}
      • [name: string]: string

    Returns string

amountToPretty

  • Show an amount in a form suitable for the user. FIXME: In the future, this should consider currency-specific settings such as significant digits or currency symbols.

    Parameters

    Returns string

buildCodecForObject

  • buildCodecForObject<T>(): ObjectCodecBuilder<T, {}>
  • Return a builder for a codec that decodes an object with properties.

    Type parameters

    • T

    Returns ObjectCodecBuilder<T, {}>

buildCodecForUnion

canonicalJson

  • canonicalJson(obj: any): string
  • Convert object to JSON with canonical ordering of keys and whitespace omitted.

    See RFC 4885 (https://tools.ietf.org/html/rfc8785).

    Parameters

    • obj: any

    Returns string

canonicalizeBaseUrl

  • canonicalizeBaseUrl(url: string): string

classifyTalerUri

  • Classify a taler:// URI.

    Parameters

    • s: string

    Returns TalerUriType

Const codecForAbortPayWithRefundRequest

Const codecForAbortProposalRequest

Const codecForAbortResponse

Const codecForAcceptBankIntegratedWithdrawalRequest

Const codecForAcceptExchangeTosRequest

Const codecForAcceptManualWithdrawalRequet

Const codecForAcceptTipRequest

Const codecForAccountInfo

  • Returns Codec<AccountInfo>

Const codecForAddExchangeRequest

Const codecForAmountJson

  • Returns Codec<AmountJson>

Const codecForAmountString

  • codecForAmountString(): Codec<string>
  • Returns Codec<string>

codecForAny

  • codecForAny(): Codec<any>
  • Codec that allows any value.

    Returns Codec<any>

Const codecForApplyRefundRequest

Const codecForApplyRefundResponse

Const codecForAuditor

  • Returns Codec<Auditor>

Const codecForAuditorDenomSig

Const codecForAuditorHandle

Const codecForBalance

  • Returns Codec<Balance>

Const codecForBalancesResponse

Const codecForBankWithdrawalOperationPostResponse

Const codecForBlindSigWrapper

codecForBoolean

  • codecForBoolean(): Codec<boolean>
  • Return a codec for a value that must be a number.

    Returns Codec<boolean>

Const codecForCheckPaymentResponse

Const codecForConfirmPayRequest

Const codecForConfirmPayResult

Const codecForConfirmPayResultDone

Const codecForConfirmPayResultPending

Const codecForConfirmReserveRequest

codecForConstFalse

  • codecForConstFalse(): Codec<false>
  • Return a codec for a boolean true constant.

    Returns Codec<false>

codecForConstNumber

  • codecForConstNumber<V>(n: V): Codec<V>
  • Return a codec for a value that must be a constant number.

    Type parameters

    • V: number

    Parameters

    • n: V

    Returns Codec<V>

codecForConstString

  • codecForConstString<V>(s: V): Codec<V>
  • Return a codec for a value that must be a string.

    Type parameters

    • V: string

    Parameters

    • s: V

    Returns Codec<V>

codecForConstTrue

  • codecForConstTrue(): Codec<true>
  • Return a codec for a boolean true constant.

    Returns Codec<true>

Const codecForContractTerms

Const codecForCreateDepositGroupRequest

Const codecForCreateReserveRequest

Const codecForDenomination

Const codecForExchangeHandle

Const codecForExchangeKeysJson

Const codecForExchangeListItem

Const codecForExchangeMeltResponse

Const codecForExchangeRevealItem

Const codecForExchangeRevealResponse

Const codecForExchangeSigningKey

Const codecForExchangeWireJson

Const codecForExchangesListResponse

Const codecForForceExchangeUpdateRequest

Const codecForForceRefreshRequest

Const codecForGetExchangeTosRequest

Const codecForGetWithdrawalDetailsForAmountRequest

Const codecForGetWithdrawalDetailsForUri

Const codecForIntegrationTestArgs

Const codecForInternationalizedString

codecForList

  • codecForList<T>(innerCodec: Codec<T>): Codec<T[]>
  • Return a codec for a list, containing values described by the inner codec.

    Type parameters

    • T

    Parameters

    Returns Codec<T[]>

Const codecForLocation

  • Returns Codec<Location>

codecForMap

  • Return a codec for a mapping from a string to values described by the inner codec.

    Type parameters

    • T

    Parameters

    Returns Codec<{}>

Const codecForMerchantAbortPayRefundFailureStatus

Const codecForMerchantAbortPayRefundStatus

Const codecForMerchantAbortPayRefundSuccessStatus

Const codecForMerchantCoinRefundFailureStatus

Const codecForMerchantCoinRefundStatus

Const codecForMerchantCoinRefundSuccessStatus

Const codecForMerchantInfo

Const codecForMerchantOrderRefundPickupResponse

  • codecForMerchantOrderRefundPickupResponse(): Codec<MerchantOrderRefundResponse>
  • Returns Codec<MerchantOrderRefundResponse>

Const codecForMerchantOrderStatusPaid

  • codecForMerchantOrderStatusPaid(): Codec<MerchantOrderStatusPaid>
  • Returns Codec<MerchantOrderStatusPaid>

Const codecForMerchantOrderStatusUnpaid

Const codecForMerchantPayResponse

Const codecForMerchantRefundPermission

Const codecForMerchantRefundResponse

codecForNumber

  • codecForNumber(): Codec<number>
  • Return a codec for a value that must be a number.

    Returns Codec<number>

Const codecForOrderShortInfo

Const codecForPreparePayRequest

Const codecForPreparePayResult

Const codecForPreparePayResultAlreadyConfirmed

Const codecForPreparePayResultInsufficientBalance

Const codecForPreparePayResultPaymentPossible

Const codecForPrepareTipRequest

Const codecForPrepareTipResult

Const codecForProduct

  • Returns Codec<Product>

Const codecForProposal

  • Returns Codec<Proposal>

Const codecForRecoup

  • Returns Codec<Recoup>

Const codecForRecoupConfirmation

Const codecForReserveClosingTransaction

Const codecForReserveCreditTransaction

Const codecForReserveRecoupTransaction

Const codecForReserveStatus

Const codecForReserveTransaction

Const codecForReserveWithdrawTransaction

Const codecForSetCoinSuspendedRequest

codecForString

  • codecForString(): Codec<string>
  • Return a codec for a value that must be a string.

    Returns Codec<string>

Const codecForTalerConfigResponse

Const codecForTax

  • Returns Codec<Tax>

Const codecForTestPayArgs

  • Returns Codec<TestPayArgs>

Const codecForTipPickupGetResponse

Const codecForTipResponse

  • Returns Codec<TipResponse>

Const codecForTrackDepositGroupRequest

Const codecForTransactionsRequest

Const codecForTransactionsResponse

Const codecForWireFeesJson

Const codecForWithdrawOperationStatusResponse

Const codecForWithdrawResponse

Const codecForWithdrawTestBalance

Const codecForWithdrawUriInfoResponse

codecOptional

  • codecOptional<V>(innerCodec: Codec<V>): Codec<V | undefined>
  • Type parameters

    • V

    Parameters

    Returns Codec<V | undefined>

compare

  • Compare two libtool-style version strings.

    Parameters

    • me: string
    • other: string

    Returns VersionMatchResult | undefined

durationAdd

durationFromSpec

  • durationFromSpec(spec: { days?: number; hours?: number; minutes?: number; months?: number; seconds?: number; years?: number }): Duration
  • Parameters

    • spec: { days?: number; hours?: number; minutes?: number; months?: number; seconds?: number; years?: number }
      • Optional days?: number
      • Optional hours?: number
      • Optional minutes?: number
      • Optional months?: number
      • Optional seconds?: number
      • Optional years?: number

    Returns Duration

durationMax

durationMin

durationMul

  • Parameters

    Returns Duration

getDurationRemaining

getTimestampNow

  • Returns Timestamp

isTimestampExpired

  • Parameters

    Returns boolean

j2s

  • j2s(x: any): string
  • Shorthand function for formatted JSON stringification.

    Parameters

    • x: any

    Returns string

mkAmount

  • mkAmount(value: number, fraction: number, currency: string): AmountJson
  • For terseness.

    Parameters

    • value: number
    • fraction: number
    • currency: string

    Returns AmountJson

parsePayUri

  • Parse a taler[+http]://pay URI. Return undefined if not passed a valid URI.

    Parameters

    • s: string

    Returns PayUriResult | undefined

parsePaytoUri

  • parsePaytoUri(s: string): PaytoUri | undefined
  • Parameters

    • s: string

    Returns PaytoUri | undefined

parseRefundUri

  • Parse a taler[+http]://refund URI. Return undefined if not passed a valid URI.

    Parameters

    • s: string

    Returns RefundUriResult | undefined

parseTipUri

  • Parse a taler[+http]://tip URI. Return undefined if not passed a valid URI.

    Parameters

    • s: string

    Returns TipUriResult | undefined

parseWithdrawUri

  • Parse a taler[+http]://withdraw URI. Return undefined if not passed a valid URI.

    Parameters

    • s: string

    Returns WithdrawUriResult | undefined

pathsub

  • pathsub(x: string, lookup: (s: string, depth: number) => string | undefined, depth?: number): string
  • Shell-style path substitution.

    Supported patterns: "$x" (look up "x") "${x}" (look up "x") "${x:-y}" (look up "x", fall back to expanded y)

    Parameters

    • x: string
    • lookup: (s: string, depth: number) => string | undefined
        • (s: string, depth: number): string | undefined
        • Parameters

          • s: string
          • depth: number

          Returns string | undefined

    • depth: number = 0

    Returns string

renderContext

  • renderContext(c?: Context): string
  • Parameters

    Returns string

setDangerousTimetravel

  • setDangerousTimetravel(dt: number): void
  • Parameters

    • dt: number

    Returns void

strcmp

  • strcmp(s1: string, s2: string): number
  • Lexically compare two strings.

    Parameters

    • s1: string
    • s2: string

    Returns number

stringifyTimestamp

  • Parameters

    Returns string

timestampAddDuration

timestampCmp

  • Parameters

    Returns number

timestampDifference

timestampIsBetween

timestampMax

timestampMin

timestampSubtractDuraction

timestampTruncateToSecond

  • Truncate a timestamp so that that it represents a multiple of seconds. The timestamp is always rounded down.

    Parameters

    Returns Timestamp

Generated using TypeDoc