diff options
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"; |