1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
|
/*
This file is part of TALER
(C) 2015-2017 GNUnet e.V. and INRIA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3, or (at your option) any later version.
TALER is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
/**
* Common types that are used by Taler and some helper functions
* to deal with them.
*
* Note most types are defined in wallet.ts, types that
* are defined in types.ts are intended to be used by components
* that do not depend on the whole wallet implementation.
*/
/**
* Imports.
*/
import { Checkable } from "./checkable";
import * as LibtoolVersion from "./libtoolVersion";
/**
* Non-negative financial amount. Fractional values are expressed as multiples
* of 1e-8.
*/
@Checkable.Class()
export class AmountJson {
/**
* Value, must be an integer.
*/
@Checkable.Number
readonly value: number;
/**
* Fraction, must be an integer. Represent 1/1e8 of a unit.
*/
@Checkable.Number
readonly fraction: number;
/**
* Currency of the amount.
*/
@Checkable.String
readonly currency: string;
/**
* Verify that a value matches the schema of this class and convert it into a
* member.
*/
static checked: (obj: any) => AmountJson;
}
/**
* Amount with a sign.
*/
export interface SignedAmountJson {
/**
* The absolute amount.
*/
amount: AmountJson;
/**
* Sign.
*/
isNegative: boolean;
}
/**
* A reserve record as stored in the wallet's database.
*/
export interface ReserveRecord {
/**
* The reserve public key.
*/
reserve_pub: string;
/**
* The reserve private key.
*/
reserve_priv: string;
/**
* The exchange base URL.
*/
exchange_base_url: string;
/**
* Time when the reserve was created.
*/
created: number;
/**
* Time when the reserve was depleted.
* Set to 0 if not depleted yet.
*/
timestamp_depleted: number;
/**
* Time when the reserve was confirmed.
*
* Set to 0 if not confirmed yet.
*/
timestamp_confirmed: number;
/**
* Current amount left in the reserve
*/
current_amount: AmountJson | null;
/**
* Amount requested when the reserve was created.
* When a reserve is re-used (rare!) the current_amount can
* be higher than the requested_amount
*/
requested_amount: AmountJson;
/**
* What's the current amount that sits
* in precoins?
*/
precoin_amount: AmountJson;
/**
* We got some payback to this reserve. We'll cease to automatically
* withdraw money from it.
*/
hasPayback: boolean;
/**
* Wire information for the bank account that
* transfered funds for this reserve.
*/
senderWire?: object;
}
/**
* Auditor record as stored with currencies in the exchange database.
*/
export interface AuditorRecord {
/**
* Base url of the auditor.
*/
baseUrl: string;
/**
* Public signing key of the auditor.
*/
auditorPub: string;
/**
* Time when the auditing expires.
*/
expirationStamp: number;
}
/**
* Exchange for currencies as stored in the wallet's currency
* information database.
*/
export interface ExchangeForCurrencyRecord {
/**
* FIXME: unused?
*/
exchangePub: string;
/**
* Base URL of the exchange.
*/
baseUrl: string;
}
/**
* Information about a currency as displayed in the wallet's database.
*/
export interface CurrencyRecord {
/**
* Name of the currency.
*/
name: string;
/**
* Number of fractional digits to show when rendering the currency.
*/
fractionalDigits: number;
/**
* Auditors that the wallet trusts for this currency.
*/
auditors: AuditorRecord[];
/**
* Exchanges that the wallet trusts for this currency.
*/
exchanges: ExchangeForCurrencyRecord[];
}
/**
* Response for the create reserve request to the wallet.
*/
@Checkable.Class()
export class CreateReserveResponse {
/**
* Exchange URL where the bank should create the reserve.
* The URL is canonicalized in the response.
*/
@Checkable.String
exchange: string;
/**
* Reserve public key of the newly created reserve.
*/
@Checkable.String
reservePub: string;
/**
* Verify that a value matches the schema of this class and convert it into a
* member.
*/
static checked: (obj: any) => CreateReserveResponse;
}
/**
* Status of a denomination.
*/
export enum DenominationStatus {
/**
* Verification was delayed.
*/
Unverified,
/**
* Verified as valid.
*/
VerifiedGood,
/**
* Verified as invalid.
*/
VerifiedBad,
}
/**
* Denomination record as stored in the wallet's database.
*/
@Checkable.Class()
export class DenominationRecord {
/**
* Value of one coin of the denomination.
*/
@Checkable.Value(AmountJson)
value: AmountJson;
/**
* The denomination public key.
*/
@Checkable.String
denomPub: string;
/**
* Hash of the denomination public key.
* Stored in the database for faster lookups.
*/
@Checkable.String
denomPubHash: string;
/**
* Fee for withdrawing.
*/
@Checkable.Value(AmountJson)
feeWithdraw: AmountJson;
/**
* Fee for depositing.
*/
@Checkable.Value(AmountJson)
feeDeposit: AmountJson;
/**
* Fee for refreshing.
*/
@Checkable.Value(AmountJson)
feeRefresh: AmountJson;
/**
* Fee for refunding.
*/
@Checkable.Value(AmountJson)
feeRefund: AmountJson;
/**
* Validity start date of the denomination.
*/
@Checkable.String
stampStart: string;
/**
* Date after which the currency can't be withdrawn anymore.
*/
@Checkable.String
stampExpireWithdraw: string;
/**
* Date after the denomination officially doesn't exist anymore.
*/
@Checkable.String
stampExpireLegal: string;
/**
* Data after which coins of this denomination can't be deposited anymore.
*/
@Checkable.String
stampExpireDeposit: string;
/**
* Signature by the exchange's master key over the denomination
* information.
*/
@Checkable.String
masterSig: string;
/**
* Did we verify the signature on the denomination?
*/
@Checkable.Number
status: DenominationStatus;
/**
* Was this denomination still offered by the exchange the last time
* we checked?
* Only false when the exchange redacts a previously published denomination.
*/
@Checkable.Boolean
isOffered: boolean;
/**
* Base URL of the exchange.
*/
@Checkable.String
exchangeBaseUrl: string;
/**
* Verify that a value matches the schema of this class and convert it into a
* member.
*/
static checked: (obj: any) => Denomination;
}
/**
* Denomination as found in the /keys response from the exchange.
*/
@Checkable.Class()
export class Denomination {
/**
* Value of one coin of the denomination.
*/
@Checkable.Value(AmountJson)
value: AmountJson;
/**
* Public signing key of the denomination.
*/
@Checkable.String
denom_pub: string;
/**
* Fee for withdrawing.
*/
@Checkable.Value(AmountJson)
fee_withdraw: AmountJson;
/**
* Fee for depositing.
*/
@Checkable.Value(AmountJson)
fee_deposit: AmountJson;
/**
* Fee for refreshing.
*/
@Checkable.Value(AmountJson)
fee_refresh: AmountJson;
/**
* Fee for refunding.
*/
@Checkable.Value(AmountJson)
fee_refund: AmountJson;
/**
* Start date from which withdraw is allowed.
*/
@Checkable.String
stamp_start: string;
/**
* End date for withdrawing.
*/
@Checkable.String
stamp_expire_withdraw: string;
/**
* Expiration date after which the exchange can forget about
* the currency.
*/
@Checkable.String
stamp_expire_legal: string;
/**
* Date after which the coins of this denomination can't be
* deposited anymore.
*/
@Checkable.String
stamp_expire_deposit: string;
/**
* Signature over the denomination information by the exchange's master
* signing key.
*/
@Checkable.String
master_sig: string;
/**
* Verify that a value matches the schema of this class and convert it into a
* member.
*/
static checked: (obj: any) => Denomination;
}
/**
* Signature by the auditor that a particular denomination key is audited.
*/
@Checkable.Class()
export class AuditorDenomSig {
/**
* Denomination public key's hash.
*/
@Checkable.String
denom_pub_h: string;
/**
* The signature.
*/
@Checkable.String
auditor_sig: string;
}
/**
* Auditor information as given by the exchange in /keys.
*/
@Checkable.Class()
export class Auditor {
/**
* Auditor's public key.
*/
@Checkable.String
auditor_pub: string;
/**
* Base URL of the auditor.
*/
@Checkable.String
auditor_url: string;
/**
* List of signatures for denominations by the auditor.
*/
@Checkable.List(Checkable.Value(AuditorDenomSig))
denomination_keys: AuditorDenomSig[];
}
/**
* Exchange record as stored in the wallet's database.
*/
export interface ExchangeRecord {
/**
* Base url of the exchange.
*/
baseUrl: string;
/**
* Master public key of the exchange.
*/
masterPublicKey: string;
/**
* Auditors (partially) auditing the exchange.
*/
auditors: Auditor[];
/**
* Currency that the exchange offers.
*/
currency: string;
/**
* Timestamp for last update.
*/
lastUpdateTime: number;
/**
* When did we actually use this exchange last (in milliseconds). If we
* never used the exchange for anything but just updated its info, this is
* set to 0. (Currently only updated when reserves are created.)
*/
lastUsedTime: number;
/**
* Last observed protocol version.
*/
protocolVersion?: string;
}
/**
* Wire info, sent to the bank when creating a reserve. Fee information will
* be filtered out. Only methods that the bank also supports should be sent.
*/
export interface WireInfo {
/**
* Mapping from wire method type to the exchange's wire info,
* excluding fees.
*/
[type: string]: any;
}
/**
* Information about what will happen when creating a reserve.
*
* Sent to the wallet frontend to be rendered and shown to the user.
*/
export interface ReserveCreationInfo {
/**
* Exchange that the reserve will be created at.
*/
exchangeInfo: ExchangeRecord;
/**
* Filtered wire info to send to the bank.
*/
wireInfo: WireInfo;
/**
* Selected denominations for withdraw.
*/
selectedDenoms: DenominationRecord[];
/**
* Fees for withdraw.
*/
withdrawFee: AmountJson;
/**
* Remaining balance that is too small to be withdrawn.
*/
overhead: AmountJson;
/**
* Wire fees from the exchange.
*/
wireFees: ExchangeWireFeesRecord;
/**
* Does the wallet know about an auditor for
* the exchange that the reserve.
*/
isAudited: boolean;
/**
* The exchange is trusted directly.
*/
isTrusted: boolean;
/**
* The earliest deposit expiration of the selected coins.
*/
earliestDepositExpiration: number;
/**
* Number of currently offered denominations.
*/
numOfferedDenoms: number;
/**
* Public keys of trusted auditors for the currency we're withdrawing.
*/
trustedAuditorPubs: string[];
/**
* Result of checking the wallet's version
* against the exchange's version.
*
* Older exchanges don't return version information.
*/
versionMatch: LibtoolVersion.VersionMatchResult|undefined;
/**
* Libtool-style version string for the exchange or "unknown"
* for older exchanges.
*/
exchangeVersion: string;
/**
* Libtool-style version string for the wallet.
*/
walletVersion: string;
}
/**
* A coin that isn't yet signed by an exchange.
*/
export interface PreCoinRecord {
coinPub: string;
coinPriv: string;
reservePub: string;
denomPub: string;
blindingKey: string;
withdrawSig: string;
coinEv: string;
exchangeBaseUrl: string;
coinValue: AmountJson;
/**
* Set to true if this pre-coin came from a tip.
* Until the tip is marked as "accepted", the resulting
* coin will not be used for payments.
*/
isFromTip: boolean;
}
/**
* Planchet for a coin during refrehs.
*/
export interface RefreshPreCoinRecord {
/**
* Public key for the coin.
*/
publicKey: string;
/**
* Private key for the coin.
*/
privateKey: string;
/**
* Blinded public key.
*/
coinEv: string;
/**
* Blinding key used.
*/
blindingKey: string;
}
/**
* Request that we send to the exchange to get a payback.
*/
export interface PaybackRequest {
/**
* Denomination public key of the coin we want to get
* paid back.
*/
denom_pub: string;
/**
* Signature over the coin public key by the denomination.
*/
denom_sig: string;
/**
* Coin public key of the coin we want to refund.
*/
coin_pub: string;
/**
* Blinding key that was used during withdraw,
* used to prove that we were actually withdrawing the coin.
*/
coin_blind_key_secret: string;
/**
* Signature made by the coin, authorizing the payback.
*/
coin_sig: string;
}
/**
* Response that we get from the exchange for a payback request.
*/
@Checkable.Class()
export class PaybackConfirmation {
/**
* public key of the reserve that will receive the payback.
*/
@Checkable.String
reserve_pub: string;
/**
* How much will the exchange pay back (needed by wallet in
* case coin was partially spent and wallet got restored from backup)
*/
@Checkable.Value(AmountJson)
amount: AmountJson;
/**
* Time by which the exchange received the /payback request.
*/
@Checkable.String
timestamp: string;
/**
* the EdDSA signature of TALER_PaybackConfirmationPS using a current
* signing key of the exchange affirming the successful
* payback request, and that the exchange promises to transfer the funds
* by the date specified (this allows the exchange delaying the transfer
* a bit to aggregate additional payback requests into a larger one).
*/
@Checkable.String
exchange_sig: string;
/**
* Public EdDSA key of the exchange that was used to generate the signature.
* Should match one of the exchange's signing keys from /keys. It is given
* explicitly as the client might otherwise be confused by clock skew as to
* which signing key was used.
*/
@Checkable.String
exchange_pub: string;
/**
* Verify that a value matches the schema of this class and convert it into a
* member.
*/
static checked: (obj: any) => PaybackConfirmation;
}
/**
* Ongoing refresh
*/
export interface RefreshSessionRecord {
/**
* Public key that's being melted in this session.
*/
meltCoinPub: string;
/**
* How much of the coin's value is melted away
* with this refresh session?
*/
valueWithFee: AmountJson;
/**
* Sum of the value of denominations we want
* to withdraw in this session, without fees.
*/
valueOutput: AmountJson;
/**
* Signature to confirm the melting.
*/
confirmSig: string;
/**
* Hased denominations of the newly requested coins.
*/
newDenomHashes: string[];
/**
* Denominations of the newly requested coins.
*/
newDenoms: string[];
/**
* Precoins for each cut-and-choose instance.
*/
preCoinsForGammas: RefreshPreCoinRecord[][];
/**
* The transfer keys, kappa of them.
*/
transferPubs: string[];
/**
* Private keys for the transfer public keys.
*/
transferPrivs: string[];
/**
* The no-reveal-index after we've done the melting.
*/
norevealIndex?: number;
/**
* Hash of the session.
*/
hash: string;
/**
* Base URL for the exchange we're doing the refresh with.
*/
exchangeBaseUrl: string;
/**
* Is this session finished?
*/
finished: boolean;
/**
* Record ID when retrieved from the DB.
*/
id?: number;
}
/**
* Deposit permission for a single coin.
*/
export interface CoinPaySig {
/**
* Signature by the coin.
*/
coin_sig: string;
/**
* Public key of the coin being spend.
*/
coin_pub: string;
/**
* Signature made by the denomination public key.
*/
ub_sig: string;
/**
* The denomination public key associated with this coin.
*/
denom_pub: string;
/**
* The amount that is subtracted from this coin with this payment.
*/
f: AmountJson;
}
/**
* Status of a coin.
*/
export enum CoinStatus {
/**
* Withdrawn and never shown to anybody.
*/
Fresh,
/**
* Currently planned to be sent to a merchant for a purchase.
*/
PurchasePending,
/**
* Used for a completed transaction and now dirty.
*/
Dirty,
/**
* A coin that was refreshed.
*/
Refreshed,
/**
* Coin marked to be paid back, but payback not finished.
*/
PaybackPending,
/**
* Coin fully paid back.
*/
PaybackDone,
/**
* Coin was dirty but can't be refreshed.
*/
Useless,
/**
* The coin was withdrawn for a tip that the user hasn't accepted yet.
*/
TainedByTip,
}
/**
* State of returning a list of coins
* to the customer's bank account.
*/
export interface CoinsReturnRecord {
/**
* Coins that we're returning.
*/
coins: CoinPaySig[];
/**
* Responses to the deposit requests.
*/
responses: any;
/**
* Ephemeral dummy merchant key for
* the coins returns operation.
*/
dummyMerchantPub: string;
/**
* Ephemeral dummy merchant key for
* the coins returns operation.
*/
dummyMerchantPriv: string;
/**
* Contract terms.
*/
contractTerms: string;
/**
* Hash of contract terms.
*/
contractTermsHash: string;
/**
* Wire info to send the money for the coins to.
*/
wire: object;
/**
* Hash of the wire object.
*/
wireHash: string;
/**
* All coins were deposited.
*/
finished: boolean;
}
/**
* CoinRecord as stored in the "coins" data store
* of the wallet database.
*/
export interface CoinRecord {
/**
* Public key of the coin.
*/
coinPub: string;
/**
* Private key to authorize operations on the coin.
*/
coinPriv: string;
/**
* Key used by the exchange used to sign the coin.
*/
denomPub: string;
/**
* Unblinded signature by the exchange.
*/
denomSig: string;
/**
* Amount that's left on the coin.
*/
currentAmount: AmountJson;
/**
* Base URL that identifies the exchange from which we got the
* coin.
*/
exchangeBaseUrl: string;
/**
* We have withdrawn the coin, but it's not accepted by the exchange anymore.
* We have to tell an auditor and wait for compensation or for the exchange
* to fix it.
*/
suspended?: boolean;
/**
* Blinding key used when withdrawing the coin.
* Potentionally sed again during payback.
*/
blindingKey: string;
/**
* Reserve public key for the reserve we got this coin from,
* or zero when we got the coin from refresh.
*/
reservePub: string|undefined;
/**
* Status of the coin.
*/
status: CoinStatus;
}
/**
* Information about an exchange as stored inside a
* merchant's contract terms.
*/
@Checkable.Class()
export class ExchangeHandle {
/**
* Master public signing key of the exchange.
*/
@Checkable.String
master_pub: string;
/**
* Base URL of the exchange.
*/
@Checkable.String
url: string;
/**
* Verify that a value matches the schema of this class and convert it into a
* member.
*/
static checked: (obj: any) => ExchangeHandle;
}
/**
* Mapping from currency/exchange to detailed balance
* information.
*/
export interface WalletBalance {
/**
* Mapping from currency name to detailed balance info.
*/
byExchange: { [exchangeBaseUrl: string]: WalletBalanceEntry };
/**
* Mapping from currency name to detailed balance info.
*/
byCurrency: { [currency: string]: WalletBalanceEntry };
}
/**
* Detailed wallet balance for a particular currency.
*/
export interface WalletBalanceEntry {
/**
* Directly available amount.
*/
available: AmountJson;
/**
* Amount that we're waiting for (refresh, withdrawal).
*/
pendingIncoming: AmountJson;
/**
* Amount that's marked for a pending payment.
*/
pendingPayment: AmountJson;
/**
* Amount that was paid back and we could withdraw again.
*/
paybackAmount: AmountJson;
}
/**
* Contract terms from a merchant.
*/
@Checkable.Class({validate: true})
export class ContractTerms {
static validate(x: ContractTerms) {
if (x.exchanges.length === 0) {
throw Error("no exchanges in contract terms");
}
}
/**
* Hash of the merchant's wire details.
*/
@Checkable.String
H_wire: string;
/**
* Wire method the merchant wants to use.
*/
@Checkable.String
wire_method: string;
/**
* Human-readable short summary of the contract.
*/
@Checkable.Optional(Checkable.String)
summary?: string;
/**
* Nonce used to ensure freshness.
*/
@Checkable.Optional(Checkable.String)
nonce?: string;
/**
* Total amount payable.
*/
@Checkable.Value(AmountJson)
amount: AmountJson;
/**
* Auditors accepted by the merchant.
*/
@Checkable.List(Checkable.AnyObject)
auditors: any[];
/**
* Deadline to pay for the contract.
*/
@Checkable.Optional(Checkable.String)
pay_deadline: string;
/**
* Delivery locations.
*/
@Checkable.Any
locations: any;
/**
* Maximum deposit fee covered by the merchant.
*/
@Checkable.Value(AmountJson)
max_fee: AmountJson;
/**
* Information about the merchant.
*/
@Checkable.Any
merchant: any;
/**
* Public key of the merchant.
*/
@Checkable.String
merchant_pub: string;
/**
* List of accepted exchanges.
*/
@Checkable.List(Checkable.Value(ExchangeHandle))
exchanges: ExchangeHandle[];
/**
* Products that are sold in this contract.
*/
@Checkable.List(Checkable.AnyObject)
products: any[];
/**
* Deadline for refunds.
*/
@Checkable.String
refund_deadline: string;
/**
* Time when the contract was generated by the merchant.
*/
@Checkable.String
timestamp: string;
/**
* Order id to uniquely identify the purchase within
* one merchant instance.
*/
@Checkable.String
order_id: string;
/**
* URL to post the payment to.
*/
@Checkable.String
pay_url: string;
/**
* Fulfillment URL to view the product or
* delivery status.
*/
@Checkable.String
fulfillment_url: string;
/**
* Share of the wire fee that must be settled with one payment.
*/
@Checkable.Optional(Checkable.Number)
wire_fee_amortization?: number;
/**
* Maximum wire fee that the merchant agrees to pay for.
*/
@Checkable.Optional(Checkable.Value(AmountJson))
max_wire_fee?: AmountJson;
/**
* Extra data, interpreted by the mechant only.
*/
@Checkable.Any
extra: any;
/**
* Verify that a value matches the schema of this class and convert it into a
* member.
*/
static checked: (obj: any) => ContractTerms;
}
/**
* Proposal record, stored in the wallet's database.
*/
@Checkable.Class()
export class ProposalRecord {
/**
* The contract that was offered by the merchant.
*/
@Checkable.Value(ContractTerms)
contractTerms: ContractTerms;
/**
* Signature by the merchant over the contract details.
*/
@Checkable.String
merchantSig: string;
/**
* Hash of the contract terms.
*/
@Checkable.String
contractTermsHash: string;
/**
* Serial ID when the offer is stored in the wallet DB.
*/
@Checkable.Optional(Checkable.Number)
id?: number;
/**
* Timestamp (in ms) of when the record
* was created.
*/
@Checkable.Number
timestamp: number;
/**
* Verify that a value matches the schema of this class and convert it into a
* member.
*/
static checked: (obj: any) => ProposalRecord;
}
/**
* Wire fee for one wire method as stored in the
* wallet's database.
*/
export interface WireFee {
/**
* Fee for wire transfers.
*/
wireFee: AmountJson;
/**
* Fees to close and refund a reserve.
*/
closingFee: AmountJson;
/**
* Start date of the fee.
*/
startStamp: number;
/**
* End date of the fee.
*/
endStamp: number;
/**
* Signature made by the exchange master key.
*/
sig: string;
}
/**
* Wire fees for an exchange.
*/
export interface ExchangeWireFeesRecord {
/**
* Base URL of the exchange.
*/
exchangeBaseUrl: string;
/**
* Mapping from wire method type to the wire fee.
*/
feesForType: { [wireMethod: string]: WireFee[] };
}
/**
* Coins used for a payment, with signatures authorizing the payment and the
* coins with remaining value updated to accomodate for a payment.
*/
export type PayCoinInfo = Array<{ updatedCoin: CoinRecord, sig: CoinPaySig }>;
/**
* Amount helpers.
*/
export namespace Amounts {
/**
* Number of fractional units that one value unit represents.
*/
export const fractionalBase = 1e8;
/**
* Result of a possibly overflowing operation.
*/
export interface Result {
/**
* Resulting, possibly saturated amount.
*/
amount: AmountJson;
/**
* Was there an over-/underflow?
*/
saturated: boolean;
}
/**
* Get the largest amount that is safely representable.
*/
export function getMaxAmount(currency: string): AmountJson {
return {
currency,
fraction: 2 ** 32,
value: Number.MAX_SAFE_INTEGER,
};
}
/**
* Get an amount that represents zero units of a currency.
*/
export function getZero(currency: string): AmountJson {
return {
currency,
fraction: 0,
value: 0,
};
}
/**
* Add two amounts. Return the result and whether
* the addition overflowed. The overflow is always handled
* by saturating and never by wrapping.
*
* Throws when currencies don't match.
*/
export function add(first: AmountJson, ...rest: AmountJson[]): Result {
const currency = first.currency;
let value = first.value + Math.floor(first.fraction / fractionalBase);
if (value > Number.MAX_SAFE_INTEGER) {
return { amount: getMaxAmount(currency), saturated: true };
}
let fraction = first.fraction % fractionalBase;
for (const x of rest) {
if (x.currency !== currency) {
throw Error(`Mismatched currency: ${x.currency} and ${currency}`);
}
value = value + x.value + Math.floor((fraction + x.fraction) / fractionalBase);
fraction = Math.floor((fraction + x.fraction) % fractionalBase);
if (value > Number.MAX_SAFE_INTEGER) {
return { amount: getMaxAmount(currency), saturated: true };
}
}
return { amount: { currency, value, fraction }, saturated: false };
}
/**
* Subtract two amounts. Return the result and whether
* the subtraction overflowed. The overflow is always handled
* by saturating and never by wrapping.
*
* Throws when currencies don't match.
*/
export function sub(a: AmountJson, ...rest: AmountJson[]): Result {
const currency = a.currency;
let value = a.value;
let fraction = a.fraction;
for (const b of rest) {
if (b.currency !== currency) {
throw Error(`Mismatched currency: ${b.currency} and ${currency}`);
}
if (fraction < b.fraction) {
if (value < 1) {
return { amount: { currency, value: 0, fraction: 0 }, saturated: true };
}
value--;
fraction += fractionalBase;
}
console.assert(fraction >= b.fraction);
fraction -= b.fraction;
if (value < b.value) {
return { amount: { currency, value: 0, fraction: 0 }, saturated: true };
}
value -= b.value;
}
return { amount: { currency, value, fraction }, saturated: false };
}
/**
* Compare two amounts. Returns 0 when equal, -1 when a < b
* and +1 when a > b. Throws when currencies don't match.
*/
export function cmp(a: AmountJson, b: AmountJson): number {
if (a.currency !== b.currency) {
throw Error(`Mismatched currency: ${a.currency} and ${b.currency}`);
}
const av = a.value + Math.floor(a.fraction / fractionalBase);
const af = a.fraction % fractionalBase;
const bv = b.value + Math.floor(b.fraction / fractionalBase);
const bf = b.fraction % fractionalBase;
switch (true) {
case av < bv:
return -1;
case av > bv:
return 1;
case af < bf:
return -1;
case af > bf:
return 1;
case af === bf:
return 0;
default:
throw Error("assertion failed");
}
}
/**
* Create a copy of an amount.
*/
export function copy(a: AmountJson): AmountJson {
return {
currency: a.currency,
fraction: a.fraction,
value: a.value,
};
}
/**
* Divide an amount. Throws on division by zero.
*/
export function divide(a: AmountJson, n: number): AmountJson {
if (n === 0) {
throw Error(`Division by 0`);
}
if (n === 1) {
return {value: a.value, fraction: a.fraction, currency: a.currency};
}
const r = a.value % n;
return {
currency: a.currency,
fraction: Math.floor(((r * fractionalBase) + a.fraction) / n),
value: Math.floor(a.value / n),
};
}
/**
* Check if an amount is non-zero.
*/
export function isNonZero(a: AmountJson): boolean {
return a.value > 0 || a.fraction > 0;
}
/**
* Parse an amount like 'EUR:20.5' for 20 Euros and 50 ct.
*/
export function parse(s: string): AmountJson|undefined {
const res = s.match(/([a-zA-Z0-9_*-]+):([0-9])+([.][0-9]+)?/);
if (!res) {
return undefined;
}
return {
currency: res[1],
fraction: Math.round(fractionalBase * Number.parseFloat(res[3] || "0")),
value: Number.parseInt(res[2]),
};
}
/**
* 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,
fraction: Math.floor((floatVal - Math.floor(floatVal)) * fractionalBase),
value: Math.floor(floatVal),
};
}
}
/**
* Listener for notifications from the wallet.
*/
export interface Notifier {
/**
* Called when a new notification arrives.
*/
notify(): void;
}
/**
* For terseness.
*/
export function mkAmount(value: number, fraction: number, currency: string): AmountJson {
return {value, fraction, currency};
}
/**
* Possible results for checkPay.
*/
export interface CheckPayResult {
status: "paid" | "payment-possible" | "insufficient-balance";
coinSelection?: CoinSelectionResult;
}
/**
* Possible results for confirmPay.
*/
export type ConfirmPayResult = "paid" | "insufficient-balance";
/**
* Activity history record.
*/
export interface HistoryRecord {
/**
* Type of the history event.
*/
type: string;
/**
* Time when the activity was recorded.
*/
timestamp: number;
/**
* Subject of the entry. Used to group multiple history records together.
* Only the latest history record with the same subjectId will be shown.
*/
subjectId?: string;
/**
* Details used when rendering the history record.
*/
detail: any;
}
/**
* Payment body sent to the merchant's /pay.
*/
export interface PayReq {
/**
* Coins with signature.
*/
coins: CoinPaySig[];
/**
* The merchant public key, used to uniquely
* identify the merchant instance.
*/
merchant_pub: string;
/**
* Order ID that's being payed for.
*/
order_id: string;
/**
* Exchange that the coins are from (base URL).
*/
exchange: string;
}
/**
* Response to a query payment request. Tagged union over the 'found' field.
*/
export type QueryPaymentResult = QueryPaymentNotFound | QueryPaymentFound;
/**
* Query payment response when the payment was found.
*/
export interface QueryPaymentNotFound {
found: false;
}
/**
* Query payment response when the payment wasn't found.
*/
export interface QueryPaymentFound {
found: true;
contractTermsHash: string;
contractTerms: ContractTerms;
payReq: PayReq;
}
/**
* Information about all sender wire details known to the wallet,
* as well as exchanges that accept these wire types.
*/
export interface SenderWireInfos {
/**
* Mapping from exchange base url to list of accepted
* wire types.
*/
exchangeWireTypes: { [exchangeBaseUrl: string]: string[] };
/**
* Sender wire types stored in the wallet.
*/
senderWires: object[];
}
/**
* Request to mark a reserve as confirmed.
*/
@Checkable.Class()
export class CreateReserveRequest {
/**
* The initial amount for the reserve.
*/
@Checkable.Value(AmountJson)
amount: AmountJson;
/**
* Exchange URL where the bank should create the reserve.
*/
@Checkable.String
exchange: string;
/**
* Wire details for the bank account that sent the funds to the exchange.
*/
@Checkable.Optional(Checkable.Any)
senderWire?: object;
/**
* Verify that a value matches the schema of this class and convert it into a
* member.
*/
static checked: (obj: any) => CreateReserveRequest;
}
/**
* Request to mark a reserve as confirmed.
*/
@Checkable.Class()
export class ConfirmReserveRequest {
/**
* Public key of then reserve that should be marked
* as confirmed.
*/
@Checkable.String
reservePub: string;
/**
* Verify that a value matches the schema of this class and convert it into a
* member.
*/
static checked: (obj: any) => ConfirmReserveRequest;
}
/**
* Wire coins to the user's own bank account.
*/
@Checkable.Class()
export class ReturnCoinsRequest {
/**
* The amount to wire.
*/
@Checkable.Value(AmountJson)
amount: AmountJson;
/**
* The exchange to take the coins from.
*/
@Checkable.String
exchange: string;
/**
* Wire details for the bank account of the customer that will
* receive the funds.
*/
@Checkable.Any
senderWire?: object;
/**
* Verify that a value matches the schema of this class and convert it into a
* member.
*/
static checked: (obj: any) => 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;
payReq: PayReq;
merchantSig: string;
/**
* The purchase isn't active anymore, it's either successfully paid or
* refunded/aborted.
*/
finished: boolean;
refundsPending: { [refundSig: string]: RefundPermission };
refundsDone: { [refundSig: string]: RefundPermission };
/**
* When was the purchase made?
* Refers to the time that the user accepted.
*/
timestamp: number;
/**
* When was the last refund made?
* Set to 0 if no refund was made on the purchase.
*/
timestamp_refund: number;
}
/**
* Result of selecting coins, contains the exchange, and selected
* coins with their denomination.
*/
export interface CoinSelectionResult {
exchangeUrl: string;
cds: CoinWithDenom[];
totalFees: AmountJson;
}
/**
* Named tuple of coin and denomination.
*/
export interface CoinWithDenom {
/**
* A coin. Must have the same denomination public key as the associated
* denomination.
*/
coin: CoinRecord;
/**
* An associated denomination.
*/
denom: DenominationRecord;
}
/**
* Planchet detail sent to the merchant.
*/
export interface TipPlanchetDetail {
/**
* Hashed denomination public key.
*/
denom_pub_hash: string;
/**
* Coin's blinded public key.
*/
coin_ev: string;
}
export interface TipPickupRequest {
/**
* Identifier of the tip.
*/
tip_id: string;
/**
* List of planchets the wallet wants to use for the tip.
*/
planchets: TipPlanchetDetail[];
}
@Checkable.Class()
export class ReserveSigSingleton {
@Checkable.String
reserve_sig: string;
static checked: (obj: any) => ReserveSigSingleton;
}
/**
* Response of the merchant
* to the TipPickupRequest.
*/
@Checkable.Class()
export class TipResponse {
/**
* Public key of the reserve
*/
@Checkable.String
reserve_pub: string;
/**
* The order of the signatures matches the planchets list.
*/
@Checkable.List(Checkable.Value(ReserveSigSingleton))
reserve_sigs: ReserveSigSingleton[];
static checked: (obj: any) => TipResponse;
}
/**
* Tipping planchet stored in the database.
*/
export interface TipPlanchet {
blindingKey: string;
coinEv: string;
coinPriv: string;
coinPub: string;
coinValue: AmountJson;
denomPubHash: string;
denomPub: string;
}
/**
* Status of a tip we got from a merchant.
*/
export interface TipRecord {
/**
* Has the user accepted the tip? Only after the tip has been accepted coins
* withdrawn from the tip may be used.
*/
accepted: boolean;
/**
* The tipped amount.
*/
amount: AmountJson;
/**
* Coin public keys from the planchets.
* This field is redundant and used for indexing the record via
* a multi-entry index to look up tip records by coin public key.
*/
coinPubs: string[];
/**
* Timestamp, the tip can't be picked up anymore after this deadline.
*/
deadline: number;
/**
* The exchange that will sign our coins, chosen by the merchant.
*/
exchangeUrl: string;
/**
* Domain of the merchant, necessary to uniquely identify the tip since
* merchants can freely choose the ID and a malicious merchant might cause a
* collision.
*/
merchantDomain: string;
/**
* Planchets, the members included in TipPlanchetDetail will be sent to the
* merchant.
*/
planchets: TipPlanchet[];
/**
* Response if the merchant responded,
* undefined otherwise.
*/
response?: TipResponse[];
/**
* Identifier for the tip, chosen by the merchant.
*/
tipId: string;
/**
* URL to go to once the tip has been accepted.
*/
nextUrl: string;
timestamp: number;
}
export interface TipStatus {
tip: TipRecord;
rci?: ReserveCreationInfo;
}
@Checkable.Class()
export class TipStatusRequest {
@Checkable.String
tipId: string;
@Checkable.String
merchantDomain: string;
static checked: (obj: any) => TipStatusRequest;
}
@Checkable.Class()
export class AcceptTipRequest {
@Checkable.String
tipId: string;
@Checkable.String
merchantDomain: string;
static checked: (obj: any) => AcceptTipRequest;
}
@Checkable.Class()
export class ProcessTipResponseRequest {
@Checkable.String
tipId: string;
@Checkable.String
merchantDomain: string;
@Checkable.Value(TipResponse)
tipResponse: TipResponse;
static checked: (obj: any) => ProcessTipResponseRequest;
}
@Checkable.Class()
export class GetTipPlanchetsRequest {
@Checkable.String
tipId: string;
@Checkable.String
merchantDomain: string;
@Checkable.Optional(Checkable.Value(AmountJson))
amount: AmountJson;
@Checkable.Number
deadline: number;
@Checkable.String
exchangeUrl: string;
@Checkable.String
nextUrl: string;
static checked: (obj: any) => GetTipPlanchetsRequest;
}
@Checkable.Class()
export class TipToken {
@Checkable.String
expiration: string;
@Checkable.String
exchange_url: string;
@Checkable.String
pickup_url: string;
@Checkable.String
tip_id: string;
@Checkable.Value(AmountJson)
amount: AmountJson;
@Checkable.String
next_url: string;
static checked: (obj: any) => TipToken;
}
|