aboutsummaryrefslogtreecommitdiff
path: root/src/emscriptif.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/emscriptif.ts')
-rw-r--r--src/emscriptif.ts39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/emscriptif.ts b/src/emscriptif.ts
index 3a34f6451..3f23476aa 100644
--- a/src/emscriptif.ts
+++ b/src/emscriptif.ts
@@ -207,6 +207,7 @@ export enum SignaturePurpose {
WALLET_COIN_MELT = 1202,
TEST = 4242,
MERCHANT_PAYMENT_OK = 1104,
+ MASTER_WIRE_FEES = 1028,
}
@@ -993,6 +994,35 @@ export class RefreshMeltCoinAffirmationPS extends SignatureStruct {
}
+interface MasterWireFeePS_Args {
+ h_wire_method: HashCode;
+ start_date: AbsoluteTimeNbo;
+ end_date: AbsoluteTimeNbo;
+ wire_fee: AmountNbo;
+ closing_fee: AmountNbo;
+}
+
+export class MasterWireFeePS extends SignatureStruct {
+ constructor(w: MasterWireFeePS_Args) {
+ super(w);
+ }
+
+ purpose() {
+ return SignaturePurpose.MASTER_WIRE_FEES;
+ }
+
+ fieldTypes() {
+ return [
+ ["h_wire_method", HashCode],
+ ["start_date", AbsoluteTimeNbo],
+ ["end_date", AbsoluteTimeNbo],
+ ["wire_fee", AmountNbo],
+ ["closing_fee", AmountNbo],
+ ];
+ }
+}
+
+
export class AbsoluteTimeNbo extends PackedArenaObject {
static fromTalerString(s: string): AbsoluteTimeNbo {
let x = new AbsoluteTimeNbo();
@@ -1008,6 +1038,15 @@ export class AbsoluteTimeNbo extends PackedArenaObject {
return x;
}
+ static fromStamp(stamp: number): AbsoluteTimeNbo {
+ let x = new AbsoluteTimeNbo();
+ x.alloc();
+ // XXX: This only works up to 54 bit numbers.
+ set64(x.nativePtr, stamp);
+ return x;
+ }
+
+
size() {
return 8;
}