-
Notifications
You must be signed in to change notification settings - Fork 22
/
LibraryUsage.aes
125 lines (86 loc) · 4.32 KB
/
LibraryUsage.aes
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
@compiler >=6
// default, see https://github.com/aeternity/aesophia/blob/v6.0.2/docs/sophia_stdlib.md
include "String.aes"
// custom
include "./lib/BaseConverter.aes"
include "./lib/DateTime.aes"
contract LibraryUsage =
// BaseConverter
entrypoint dec_to_binary(x : int) : string =
BaseConverter.dec_to_binary(x)
entrypoint dec_to_oct(x : int) : string =
BaseConverter.dec_to_oct(x)
entrypoint dec_to_hex(x : int) : string =
BaseConverter.dec_to_hex(x)
entrypoint binary_to_dec(x : int) : int =
BaseConverter.binary_to_dec(x)
entrypoint oct_to_dec(x : int) : int =
BaseConverter.oct_to_dec(x)
// DateTime
entrypoint get_year(timestamp : int) : int =
DateTime.get_year(timestamp)
entrypoint get_month(timestamp : int) : int =
DateTime.get_month(timestamp)
entrypoint get_day(timestamp : int) : int =
DateTime.get_day(timestamp)
entrypoint get_hour(timestamp : int) : int =
DateTime.get_hour(timestamp)
entrypoint get_minute(timestamp : int) : int =
DateTime.get_minute(timestamp)
entrypoint get_second(timestamp : int) : int =
DateTime.get_second(timestamp)
entrypoint get_weekday(timestamp : int) : int =
DateTime.get_weekday(timestamp)
entrypoint is_leap_year(year : int) : bool =
DateTime.is_leap_year(year)
entrypoint to_timestamp(year : int,
month : int,
day : int,
hour : int,
minute : int,
second : int) : int =
DateTime.to_timestamp(year,month,day,hour,minute,second)
entrypoint add_years(timestamp : int, years : int) : int =
DateTime.add_years(timestamp, years)
entrypoint sub_years(timestamp : int, years : int) : int =
DateTime.sub_years(timestamp, years)
entrypoint add_months(timestamp : int, months : int) : int =
DateTime.add_months(timestamp, months)
entrypoint sub_months(timestamp : int, months : int) : int =
DateTime.sub_months(timestamp, months)
entrypoint add_days(timestamp: int, days : int) : int =
DateTime.add_days(timestamp, days)
entrypoint sub_days(timestamp: int, days : int) : int =
DateTime.sub_days(timestamp, days)
entrypoint add_hours(timestamp : int, hours : int) : int =
DateTime.add_hours(timestamp, hours)
entrypoint sub_hours(timestamp : int, hours : int) : int =
DateTime.sub_hours(timestamp, hours)
entrypoint add_minutes(timestamp : int, minutes : int) : int =
DateTime.add_minutes(timestamp, minutes)
entrypoint sub_minutes(timestamp : int, minutes : int) : int =
DateTime.sub_minutes(timestamp, minutes)
entrypoint add_seconds(timestamp : int, seconds : int) : int =
DateTime.add_seconds(timestamp, seconds)
entrypoint sub_seconds(timestamp : int, seconds : int) : int =
DateTime.sub_seconds(timestamp, seconds)
entrypoint diff_years(from_timestamp : int, to_timestamp : int) : int =
DateTime.diff_years(from_timestamp, to_timestamp)
entrypoint diff_months(from_timestamp : int, to_timestamp : int) : int =
DateTime.diff_months(from_timestamp, to_timestamp)
entrypoint diff_days(from_timestamp : int, to_timestamp : int) : int =
DateTime.diff_days(from_timestamp, to_timestamp)
entrypoint diff_hours(from_timestamp : int, to_timestamp : int) : int =
DateTime.diff_hours(from_timestamp, to_timestamp)
entrypoint diff_minutes(from_timestamp : int, to_timestamp : int) : int =
DateTime.diff_minutes(from_timestamp, to_timestamp)
entrypoint diff_seconds(from_timestamp : int, to_timestamp : int) : int =
DateTime.diff_seconds(from_timestamp, to_timestamp)
entrypoint is_valid_date(year : int, month : int, day : int) : bool =
DateTime.is_valid_date(year, month, day)
entrypoint is_valid_date_time(year : int, month : int, day : int, hour : int, minute : int, second : int) : bool =
DateTime.is_valid_date_time(year, month, day, hour, minute, second)
entrypoint is_week_day(timestamp : int) : bool =
DateTime.is_week_day(timestamp)
entrypoint is_week_end(timestamp : int) : bool =
DateTime.is_week_end(timestamp)