@reyaxyz/common 0.282.0 → 0.284.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incentives-api-types.js","sourceRoot":"/","sources":["incentives-api-types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n AddressParam,\n ApiEndpoint,\n ApiInfiniteListEndpoint,\n ApiListEndpoint,\n PaginatedQueryParams,\n Stringified,\n} from './api-types';\n\nexport type PointsBreakdown = {\n totalPoints: number;\n tradingPoints: number;\n stakingPoints: number;\n signalPoints: number;\n};\n\nexport type IncentivesUserPointsData = {\n weekly: PointsBreakdown;\n total: PointsBreakdown;\n};\n\nexport type IncentivesUserRanks = {\n walletAddress: string;\n tradingRank:
|
|
1
|
+
{"version":3,"file":"incentives-api-types.js","sourceRoot":"/","sources":["incentives-api-types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n AddressParam,\n ApiEndpoint,\n ApiInfiniteListEndpoint,\n ApiListEndpoint,\n PaginatedQueryParams,\n Stringified,\n} from './api-types';\nimport { Rank, RankTrading } from './types';\n\nexport type PointsBreakdown = {\n totalPoints: number;\n tradingPoints: number;\n stakingPoints: number;\n signalPoints: number;\n};\n\nexport type IncentivesUserPointsData = {\n weekly: PointsBreakdown;\n total: PointsBreakdown;\n};\n\nexport type IncentivesUserRanks = {\n walletAddress: string;\n tradingRank: RankTrading;\n stakingRank: Rank;\n};\n\nexport type IncentivesUserBoosts = {\n walletAddress: string;\n tradingBoost: number;\n stakingBoost: number;\n loyaltyBoost: number;\n};\n\nexport type IncentivesUserSummaryData = {\n walletAddress: string;\n points: IncentivesUserPointsData;\n ranks: Omit<IncentivesUserRanks, 'walletAddress'>;\n boosts: Omit<IncentivesUserBoosts, 'walletAddress'>;\n};\n\nexport type IncentivesLeaderBoardEntry = {\n rank: number;\n walletAddress: string;\n totalPoints: number;\n tradingPoints: number;\n stakingPoints: number;\n signalPoints: number;\n isCurrentUser?: boolean;\n};\n\nexport type IncentivesRankingHistoryEntry = {\n week: number;\n createdAt: Date;\n tradingRank: RankTrading;\n stakingRank: Rank;\n tradingPoints: number;\n stakingPoints: number;\n};\n\nexport type IncentivesApiSource = {\n 'incentives/leaderBoard/:type': ApiInfiniteListEndpoint<\n IncentivesLeaderBoardEntry,\n { type: 'weekly' | 'total' },\n PaginatedQueryParams\n >;\n\n 'incentives/wallet/:address': ApiEndpoint<\n IncentivesUserSummaryData,\n AddressParam\n >;\n\n 'incentives/wallet/:address/leaderBoard/:type': ApiEndpoint<\n IncentivesLeaderBoardEntry,\n AddressParam & { type: 'weekly' | 'total' }\n >;\n\n 'incentives/wallet/:address/ranksHistory': ApiListEndpoint<\n IncentivesRankingHistoryEntry,\n AddressParam\n >;\n};\n\nexport type IncentivesApi = {\n [K in keyof IncentivesApiSource]: {\n params: IncentivesApiSource[K]['params'];\n query: IncentivesApiSource[K]['query'];\n response: Stringified<IncentivesApiSource[K]['response']>;\n };\n};\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AddressParam, ApiEndpoint, ApiInfiniteListEndpoint, ApiListEndpoint, PaginatedQueryParams, Stringified } from './api-types';
|
|
2
|
+
import { Rank, RankTrading } from './types';
|
|
2
3
|
export type PointsBreakdown = {
|
|
3
4
|
totalPoints: number;
|
|
4
5
|
tradingPoints: number;
|
|
@@ -11,8 +12,8 @@ export type IncentivesUserPointsData = {
|
|
|
11
12
|
};
|
|
12
13
|
export type IncentivesUserRanks = {
|
|
13
14
|
walletAddress: string;
|
|
14
|
-
tradingRank:
|
|
15
|
-
stakingRank:
|
|
15
|
+
tradingRank: RankTrading;
|
|
16
|
+
stakingRank: Rank;
|
|
16
17
|
};
|
|
17
18
|
export type IncentivesUserBoosts = {
|
|
18
19
|
walletAddress: string;
|
|
@@ -26,7 +27,7 @@ export type IncentivesUserSummaryData = {
|
|
|
26
27
|
ranks: Omit<IncentivesUserRanks, 'walletAddress'>;
|
|
27
28
|
boosts: Omit<IncentivesUserBoosts, 'walletAddress'>;
|
|
28
29
|
};
|
|
29
|
-
export type
|
|
30
|
+
export type IncentivesLeaderBoardEntry = {
|
|
30
31
|
rank: number;
|
|
31
32
|
walletAddress: string;
|
|
32
33
|
totalPoints: number;
|
|
@@ -36,24 +37,22 @@ export type IncentivesLeaderboardEntry = {
|
|
|
36
37
|
isCurrentUser?: boolean;
|
|
37
38
|
};
|
|
38
39
|
export type IncentivesRankingHistoryEntry = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
tradingRank:
|
|
42
|
-
stakingRank:
|
|
40
|
+
week: number;
|
|
41
|
+
createdAt: Date;
|
|
42
|
+
tradingRank: RankTrading;
|
|
43
|
+
stakingRank: Rank;
|
|
43
44
|
tradingPoints: number;
|
|
44
45
|
stakingPoints: number;
|
|
45
46
|
};
|
|
46
47
|
export type IncentivesApiSource = {
|
|
47
|
-
'incentives/:
|
|
48
|
-
'incentives/points/leaderboard/:type': ApiInfiniteListEndpoint<IncentivesLeaderboardEntry, {
|
|
48
|
+
'incentives/leaderBoard/:type': ApiInfiniteListEndpoint<IncentivesLeaderBoardEntry, {
|
|
49
49
|
type: 'weekly' | 'total';
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
'incentives/
|
|
50
|
+
}, PaginatedQueryParams>;
|
|
51
|
+
'incentives/wallet/:address': ApiEndpoint<IncentivesUserSummaryData, AddressParam>;
|
|
52
|
+
'incentives/wallet/:address/leaderBoard/:type': ApiEndpoint<IncentivesLeaderBoardEntry, AddressParam & {
|
|
53
53
|
type: 'weekly' | 'total';
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
'incentives/ranks/history/:wallet': ApiListEndpoint<IncentivesRankingHistoryEntry, AddressParam>;
|
|
54
|
+
}>;
|
|
55
|
+
'incentives/wallet/:address/ranksHistory': ApiListEndpoint<IncentivesRankingHistoryEntry, AddressParam>;
|
|
57
56
|
};
|
|
58
57
|
export type IncentivesApi = {
|
|
59
58
|
[K in keyof IncentivesApiSource]: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incentives-api-types.d.ts","sourceRoot":"/","sources":["incentives-api-types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,WAAW,EACZ,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"incentives-api-types.d.ts","sourceRoot":"/","sources":["incentives-api-types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,wBAAwB,CAAC;IACjC,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;IAClD,MAAM,E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,CAAC,UAAU,CAAC,CAAC,CAAC;KAC3D;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.284.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"generate:coverage-badges": "npx istanbul-badges-readme --silent"
|
|
45
45
|
},
|
|
46
46
|
"packageManager": "pnpm@8.3.1",
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "9817c39f5ffd153d04e271837ae0477ce4ff321f"
|
|
48
48
|
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
PaginatedQueryParams,
|
|
7
7
|
Stringified,
|
|
8
8
|
} from './api-types';
|
|
9
|
+
import { Rank, RankTrading } from './types';
|
|
9
10
|
|
|
10
11
|
export type PointsBreakdown = {
|
|
11
12
|
totalPoints: number;
|
|
@@ -21,8 +22,8 @@ export type IncentivesUserPointsData = {
|
|
|
21
22
|
|
|
22
23
|
export type IncentivesUserRanks = {
|
|
23
24
|
walletAddress: string;
|
|
24
|
-
tradingRank:
|
|
25
|
-
stakingRank:
|
|
25
|
+
tradingRank: RankTrading;
|
|
26
|
+
stakingRank: Rank;
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export type IncentivesUserBoosts = {
|
|
@@ -39,7 +40,7 @@ export type IncentivesUserSummaryData = {
|
|
|
39
40
|
boosts: Omit<IncentivesUserBoosts, 'walletAddress'>;
|
|
40
41
|
};
|
|
41
42
|
|
|
42
|
-
export type
|
|
43
|
+
export type IncentivesLeaderBoardEntry = {
|
|
43
44
|
rank: number;
|
|
44
45
|
walletAddress: string;
|
|
45
46
|
totalPoints: number;
|
|
@@ -50,37 +51,37 @@ export type IncentivesLeaderboardEntry = {
|
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
export type IncentivesRankingHistoryEntry = {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
tradingRank:
|
|
56
|
-
stakingRank:
|
|
54
|
+
week: number;
|
|
55
|
+
createdAt: Date;
|
|
56
|
+
tradingRank: RankTrading;
|
|
57
|
+
stakingRank: Rank;
|
|
57
58
|
tradingPoints: number;
|
|
58
59
|
stakingPoints: number;
|
|
59
60
|
};
|
|
60
61
|
|
|
61
62
|
export type IncentivesApiSource = {
|
|
62
|
-
'incentives/:
|
|
63
|
+
'incentives/leaderBoard/:type': ApiInfiniteListEndpoint<
|
|
64
|
+
IncentivesLeaderBoardEntry,
|
|
65
|
+
{ type: 'weekly' | 'total' },
|
|
66
|
+
PaginatedQueryParams
|
|
67
|
+
>;
|
|
63
68
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
{ type: 'weekly' | 'total' }, // Path param
|
|
68
|
-
PaginatedQueryParams // Query params
|
|
69
|
+
'incentives/wallet/:address': ApiEndpoint<
|
|
70
|
+
IncentivesUserSummaryData,
|
|
71
|
+
AddressParam
|
|
69
72
|
>;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
|
|
74
|
+
'incentives/wallet/:address/leaderBoard/:type': ApiEndpoint<
|
|
75
|
+
IncentivesLeaderBoardEntry,
|
|
76
|
+
AddressParam & { type: 'weekly' | 'total' }
|
|
74
77
|
>;
|
|
75
78
|
|
|
76
|
-
|
|
77
|
-
'incentives/ranks/history/:wallet': ApiListEndpoint<
|
|
79
|
+
'incentives/wallet/:address/ranksHistory': ApiListEndpoint<
|
|
78
80
|
IncentivesRankingHistoryEntry,
|
|
79
81
|
AddressParam
|
|
80
82
|
>;
|
|
81
83
|
};
|
|
82
84
|
|
|
83
|
-
// The final API contract type
|
|
84
85
|
export type IncentivesApi = {
|
|
85
86
|
[K in keyof IncentivesApiSource]: {
|
|
86
87
|
params: IncentivesApiSource[K]['params'];
|