@oanda/labs-sentiment-widget 1.0.67 → 1.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +260 -0
- package/dist/main/SentimentWidget/Tool.js +11 -4
- package/dist/main/SentimentWidget/Tool.js.map +1 -1
- package/dist/main/SentimentWidget/Widget.js +15 -5
- package/dist/main/SentimentWidget/Widget.js.map +1 -1
- package/dist/main/constant.js +2 -1
- package/dist/main/constant.js.map +1 -1
- package/dist/main/gql/getInstrumentSentiment.js +1 -1
- package/dist/main/gql/getInstrumentSentiment.js.map +1 -1
- package/dist/main/gql/getSentimentList.js +1 -1
- package/dist/main/gql/getSentimentList.js.map +1 -1
- package/dist/main/gql/types/gql.js +2 -2
- package/dist/main/gql/types/gql.js.map +1 -1
- package/dist/main/gql/types/graphql.js +55 -1
- package/dist/main/gql/types/graphql.js.map +1 -1
- package/dist/main/translations/sources/en.json +3 -1
- package/dist/main/translations/sources/zh_TW.json +3 -1
- package/dist/module/SentimentWidget/Tool.js +13 -6
- package/dist/module/SentimentWidget/Tool.js.map +1 -1
- package/dist/module/SentimentWidget/Widget.js +17 -7
- package/dist/module/SentimentWidget/Widget.js.map +1 -1
- package/dist/module/constant.js +2 -1
- package/dist/module/constant.js.map +1 -1
- package/dist/module/gql/getInstrumentSentiment.js +1 -1
- package/dist/module/gql/getInstrumentSentiment.js.map +1 -1
- package/dist/module/gql/getSentimentList.js +1 -1
- package/dist/module/gql/getSentimentList.js.map +1 -1
- package/dist/module/gql/types/gql.js +2 -2
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +54 -0
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/module/translations/sources/en.json +3 -1
- package/dist/module/translations/sources/zh_TW.json +3 -1
- package/dist/types/SentimentWidget/utils.d.ts +1 -0
- package/dist/types/constant.d.ts +2 -1
- package/dist/types/gql/types/gql.d.ts +4 -4
- package/dist/types/gql/types/graphql.d.ts +92 -15
- package/package.json +3 -3
- package/src/SentimentWidget/Tool.tsx +21 -4
- package/src/SentimentWidget/Widget.tsx +35 -23
- package/src/constant.ts +3 -1
- package/src/gql/getInstrumentSentiment.ts +1 -0
- package/src/gql/getSentimentList.ts +1 -0
- package/src/gql/types/gql.ts +4 -4
- package/src/gql/types/graphql.ts +108 -20
- package/src/translations/sources/en.json +3 -1
- package/src/translations/sources/zh_TW.json +3 -1
- package/test/Widget.test.tsx +4 -4
- package/test/sortData.test.ts +42 -12
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"data_unavailable": "Data unavailable",
|
|
3
|
+
"last_updated": "Last updated",
|
|
3
4
|
"net_long": "Net-long",
|
|
4
5
|
"net_short": "Net-short",
|
|
5
|
-
"pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} of {{itemCount}} entries"
|
|
6
|
+
"pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} of {{itemCount}} entries",
|
|
7
|
+
"today": "Today"
|
|
6
8
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"data_unavailable": "沒有數據",
|
|
3
|
+
"last_updated": "最後更新",
|
|
3
4
|
"net_long": "淨長倉",
|
|
4
5
|
"net_short": "淨短倉",
|
|
5
|
-
"pagination_entries_range": "{{itemCount}}个挂单中的{{firstItemOnPage}}-{{lastItemOnPage}}"
|
|
6
|
+
"pagination_entries_range": "{{itemCount}}个挂单中的{{firstItemOnPage}}-{{lastItemOnPage}}",
|
|
7
|
+
"today": "今日"
|
|
6
8
|
}
|
package/test/Widget.test.tsx
CHANGED
|
@@ -26,8 +26,8 @@ const mocks = [
|
|
|
26
26
|
longPercent: 34,
|
|
27
27
|
shortPercent: 66,
|
|
28
28
|
},
|
|
29
|
-
|
|
30
|
-
],
|
|
29
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
30
|
+
}],
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
},
|
|
@@ -51,8 +51,8 @@ const zeroPercentMocks = [
|
|
|
51
51
|
longPercent: 0,
|
|
52
52
|
shortPercent: 0,
|
|
53
53
|
},
|
|
54
|
-
|
|
55
|
-
],
|
|
54
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
55
|
+
}],
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
},
|
package/test/sortData.test.ts
CHANGED
|
@@ -10,6 +10,7 @@ const data = {
|
|
|
10
10
|
longPercent: 20,
|
|
11
11
|
shortPercent: 80,
|
|
12
12
|
},
|
|
13
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
13
14
|
},
|
|
14
15
|
{
|
|
15
16
|
name: 'GBP/USD',
|
|
@@ -18,6 +19,7 @@ const data = {
|
|
|
18
19
|
longPercent: 30,
|
|
19
20
|
shortPercent: 70,
|
|
20
21
|
},
|
|
22
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
21
23
|
},
|
|
22
24
|
{
|
|
23
25
|
name: 'USD/CHF',
|
|
@@ -26,6 +28,7 @@ const data = {
|
|
|
26
28
|
longPercent: 15,
|
|
27
29
|
shortPercent: 85,
|
|
28
30
|
},
|
|
31
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
29
32
|
},
|
|
30
33
|
{
|
|
31
34
|
name: 'EUR/USD',
|
|
@@ -34,6 +37,7 @@ const data = {
|
|
|
34
37
|
longPercent: 60,
|
|
35
38
|
shortPercent: 40,
|
|
36
39
|
},
|
|
40
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
37
41
|
},
|
|
38
42
|
{
|
|
39
43
|
name: 'US30/USD',
|
|
@@ -42,6 +46,7 @@ const data = {
|
|
|
42
46
|
longPercent: 55,
|
|
43
47
|
shortPercent: 45,
|
|
44
48
|
},
|
|
49
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
45
50
|
},
|
|
46
51
|
{
|
|
47
52
|
name: 'XAU/USD',
|
|
@@ -50,6 +55,7 @@ const data = {
|
|
|
50
55
|
longPercent: 90,
|
|
51
56
|
shortPercent: 10,
|
|
52
57
|
},
|
|
58
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
53
59
|
},
|
|
54
60
|
],
|
|
55
61
|
};
|
|
@@ -59,24 +65,48 @@ describe('sortData function', () => {
|
|
|
59
65
|
const path = sortData(data, Sort.Bullish);
|
|
60
66
|
|
|
61
67
|
expect(path).toEqual([
|
|
62
|
-
{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
{
|
|
69
|
+
name: 'XAU/USD', displayName: 'XAU/USD', sentiment: { longPercent: 90, shortPercent: 10 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'EUR/USD', displayName: 'EUR/USD', sentiment: { longPercent: 60, shortPercent: 40 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'US30/USD', displayName: 'US30/USD', sentiment: { longPercent: 55, shortPercent: 45 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'GBP/USD', displayName: 'GBP/USD', sentiment: { longPercent: 30, shortPercent: 70 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'AUD/CAD', displayName: 'AUD/CAD', sentiment: { longPercent: 20, shortPercent: 80 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'USD/CHF', displayName: 'USD/CHF', sentiment: { longPercent: 15, shortPercent: 85 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
85
|
+
},
|
|
68
86
|
]);
|
|
69
87
|
});
|
|
70
88
|
it('should return data sorted by bearish', () => {
|
|
71
89
|
const path = sortData(data, Sort.Bearish);
|
|
72
90
|
|
|
73
91
|
expect(path).toEqual([
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
|
|
92
|
+
{
|
|
93
|
+
name: 'USD/CHF', displayName: 'USD/CHF', sentiment: { longPercent: 15, shortPercent: 85 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'AUD/CAD', displayName: 'AUD/CAD', sentiment: { longPercent: 20, shortPercent: 80 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'GBP/USD', displayName: 'GBP/USD', sentiment: { longPercent: 30, shortPercent: 70 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'US30/USD', displayName: 'US30/USD', sentiment: { longPercent: 55, shortPercent: 45 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'EUR/USD', displayName: 'EUR/USD', sentiment: { longPercent: 60, shortPercent: 40 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'XAU/USD', displayName: 'XAU/USD', sentiment: { longPercent: 90, shortPercent: 10 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
109
|
+
},
|
|
80
110
|
]);
|
|
81
111
|
});
|
|
82
112
|
});
|