aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/decl/mithril.d.ts2
-rw-r--r--lib/wallet/types.ts63
-rw-r--r--lib/wallet/wallet.ts64
-rw-r--r--lib/wallet/wxMessaging.ts2
4 files changed, 67 insertions, 64 deletions
diff --git a/lib/decl/mithril.d.ts b/lib/decl/mithril.d.ts
index c87102260..c45633490 100644
--- a/lib/decl/mithril.d.ts
+++ b/lib/decl/mithril.d.ts
@@ -608,7 +608,7 @@ declare module _mithril {
*
* @see m.component
*/
- controller: MithrilControllerFunction<T> |
+ controller?: MithrilControllerFunction<T> |
MithrilControllerConstructor<T>;
/**
diff --git a/lib/wallet/types.ts b/lib/wallet/types.ts
index 748df6f4c..feab1bcb1 100644
--- a/lib/wallet/types.ts
+++ b/lib/wallet/types.ts
@@ -150,6 +150,69 @@ export interface Coin {
}
+@Checkable.Class
+export class ExchangeHandle {
+ @Checkable.String
+ master_pub: string;
+
+ @Checkable.String
+ url: string;
+
+ static checked: (obj: any) => ExchangeHandle;
+}
+
+
+@Checkable.Class
+export class Contract {
+ @Checkable.String
+ H_wire: string;
+
+ @Checkable.Value(AmountJson)
+ amount: AmountJson;
+
+ @Checkable.List(Checkable.AnyObject)
+ auditors: any[];
+
+ @Checkable.String
+ expiry: string;
+
+ @Checkable.Any
+ locations: any;
+
+ @Checkable.Value(AmountJson)
+ max_fee: AmountJson;
+
+ @Checkable.Any
+ merchant: any;
+
+ @Checkable.String
+ merchant_pub: string;
+
+ @Checkable.List(Checkable.Value(ExchangeHandle))
+ exchanges: ExchangeHandle[];
+
+ @Checkable.List(Checkable.AnyObject)
+ products: any[];
+
+ @Checkable.String
+ refund_deadline: string;
+
+ @Checkable.String
+ timestamp: string;
+
+ @Checkable.Number
+ transaction_id: number;
+
+ @Checkable.String
+ fulfillment_url: string;
+
+ @Checkable.Optional(Checkable.String)
+ repurchase_correlation_id: string;
+
+ static checked: (obj: any) => Contract;
+}
+
+
export type PayCoinInfo = Array<{ updatedCoin: Coin, sig: CoinPaySig }>;
diff --git a/lib/wallet/wallet.ts b/lib/wallet/wallet.ts
index 3764edfbc..0dc232bb0 100644
--- a/lib/wallet/wallet.ts
+++ b/lib/wallet/wallet.ts
@@ -33,6 +33,8 @@ import {CryptoApi} from "./cryptoApi";
import {Coin} from "./types";
import {PayCoinInfo} from "./types";
import {CheckRepurchaseResult} from "./types";
+import {Contract} from "./types";
+import {ExchangeHandle} from "./types";
"use strict";
@@ -182,68 +184,6 @@ export class ConfirmReserveRequest {
}
-@Checkable.Class
-export class ExchangeHandle {
- @Checkable.String
- master_pub: string;
-
- @Checkable.String
- url: string;
-
- static checked: (obj: any) => ExchangeHandle;
-}
-
-
-@Checkable.Class
-export class Contract {
- @Checkable.String
- H_wire: string;
-
- @Checkable.Value(AmountJson)
- amount: AmountJson;
-
- @Checkable.List(Checkable.AnyObject)
- auditors: any[];
-
- @Checkable.String
- expiry: string;
-
- @Checkable.Any
- locations: any;
-
- @Checkable.Value(AmountJson)
- max_fee: AmountJson;
-
- @Checkable.Any
- merchant: any;
-
- @Checkable.String
- merchant_pub: string;
-
- @Checkable.List(Checkable.Value(ExchangeHandle))
- exchanges: ExchangeHandle[];
-
- @Checkable.List(Checkable.AnyObject)
- products: any[];
-
- @Checkable.String
- refund_deadline: string;
-
- @Checkable.String
- timestamp: string;
-
- @Checkable.Number
- transaction_id: number;
-
- @Checkable.String
- fulfillment_url: string;
-
- @Checkable.Optional(Checkable.String)
- repurchase_correlation_id: string;
-
- static checked: (obj: any) => Contract;
-}
-
@Checkable.Class
export class Offer {
diff --git a/lib/wallet/wxMessaging.ts b/lib/wallet/wxMessaging.ts
index d49a80efb..4f496861d 100644
--- a/lib/wallet/wxMessaging.ts
+++ b/lib/wallet/wxMessaging.ts
@@ -22,7 +22,7 @@ import {Checkable} from "./checkable";
import {AmountJson} from "./types";
import Port = chrome.runtime.Port;
import {Notifier} from "./types";
-import {Contract} from "./wallet";
+import {Contract} from "./types";
"use strict";