diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-10-15 19:28:35 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-10-15 20:30:33 +0200 |
commit | 8b2f53e3ed810a0539f76feb993f0044bc8c0f38 (patch) | |
tree | f88687b498f133e8e7c0743def7ef7929f6173c6 /src/types.ts | |
parent | 353eeca339e060eb4a03e0b67343086854a5e5d7 (diff) | |
download | wallet-core-8b2f53e3ed810a0539f76feb993f0044bc8c0f38.tar.xz |
fix tslint warnings
Diffstat (limited to 'src/types.ts')
-rw-r--r-- | src/types.ts | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/src/types.ts b/src/types.ts index 4dea8f3b4..20517b7a2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -839,7 +839,6 @@ export enum CoinStatus { } - /** * State of returning a list of coins * to the customer's bank account. @@ -1198,6 +1197,10 @@ export class ProposalRecord { @Checkable.Optional(Checkable.Number) id?: number; + /** + * Timestamp (in ms) of when the record + * was created. + */ @Checkable.Number timestamp: number; @@ -1450,10 +1453,17 @@ export namespace Amounts { }; } + /** + * Convert the amount to a float. + */ export function toFloat(a: AmountJson): number { return a.value + (a.fraction / fractionalBase); } + /** + * Convert a float to a Taler amount. + * Loss of precision possible. + */ export function fromFloat(floatVal: number, currency: string) { return { currency, @@ -1495,7 +1505,7 @@ export interface CheckPayResult { export type ConfirmPayResult = "paid" | "insufficient-balance"; -/* +/** * Activity history record. */ export interface HistoryRecord { @@ -1672,17 +1682,52 @@ export class ReturnCoinsRequest { } +/** + * Refund permission in the format that the merchant gives it to us. + */ export interface RefundPermission { + /** + * Amount to be refunded. + */ refund_amount: AmountJson; + + /** + * Fee for the refund. + */ refund_fee: AmountJson; + + /** + * Contract terms hash to identify the contract that this + * refund is for. + */ h_contract_terms: string; + + /** + * Public key of the coin being refunded. + */ coin_pub: string; + + /** + * Refund transaction ID between merchant and exchange. + */ rtransaction_id: number; + + /** + * Public key of the merchant. + */ merchant_pub: string; + + /** + * Signature made by the merchant over the refund permission. + */ merchant_sig: string; } +/** + * Record that stores status information about one purchase, starting from when + * the customer accepts a proposal. Includes refund status if applicable. + */ export interface PurchaseRecord { contractTermsHash: string; contractTerms: ContractTerms; |