diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-29 16:27:53 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-29 16:27:53 +0200 |
commit | 1c3346cd534143f4dd56a625b963a1a3acfa83d1 (patch) | |
tree | e7c3571e63e35f745571b606e1d0db9bc80f6675 /src/types.ts | |
parent | d0e0c6baf274aab378233a7ae0d67307c03b3a7c (diff) | |
download | wallet-core-1c3346cd534143f4dd56a625b963a1a3acfa83d1.tar.xz |
less ad-hoc messaging, fix some lint warnings
Diffstat (limited to 'src/types.ts')
-rw-r--r-- | src/types.ts | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/types.ts b/src/types.ts index 0371aab77..8b5f4063b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1075,6 +1075,51 @@ export class Contract { /** + * Offer record, stored in the wallet's database. + */ +@Checkable.Class() +export class OfferRecord { + /** + * The contract that was offered by the merchant. + */ + @Checkable.Value(Contract) + contract: Contract; + + /** + * Signature by the merchant over the contract details. + */ + @Checkable.String + merchant_sig: string; + + /** + * Hash of the contract terms. + */ + @Checkable.String + H_contract: string; + + /** + * Time when the offer was made. + */ + @Checkable.Number + offer_time: number; + + /** + * Serial ID when the offer is stored in the wallet DB. + */ + @Checkable.Optional(Checkable.Number) + id?: number; + + /** + * Verify that a value matches the schema of this class and convert it into a + * member. + */ + static checked: (obj: any) => OfferRecord; +} + + + + +/** * Wire fee for one wire method as stored in the * wallet's database. */ @@ -1333,3 +1378,10 @@ export interface Notifier { export function mkAmount(value: number, fraction: number, currency: string): AmountJson { return {value, fraction, currency}; } + +/** + * Possible responses for checkPay. + */ +export type CheckPayResult = "paid" | "payment-possible" | "insufficient-balance"; + +export type ConfirmPayResult = "paid" | "insufficient-balance"; |