@reyaxyz/common 0.282.0 → 0.283.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: string;\n stakingRank: string;\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 weekNumber: number;\n weekTimestamp: number;\n tradingRank: string;\n stakingRank: string;\n tradingPoints: number;\n stakingPoints: number;\n};\n\nexport type IncentivesApiSource = {\n 'incentives/:wallet': ApiEndpoint<IncentivesUserSummaryData, AddressParam>;\n\n // Points Leaderboard\n 'incentives/points/leaderboard/:type': ApiInfiniteListEndpoint<\n IncentivesLeaderboardEntry,\n { type: 'weekly' | 'total' }, // Path param\n PaginatedQueryParams // Query params\n >;\n 'incentives/points/leaderboard/wallet/:address/:type': ApiInfiniteListEndpoint<\n IncentivesLeaderboardEntry,\n AddressParam & { type: 'weekly' | 'total' }, // Path params\n PaginatedQueryParams // Query params\n >;\n\n // Rank History\n 'incentives/ranks/history/:wallet': ApiListEndpoint<\n IncentivesRankingHistoryEntry,\n AddressParam\n >;\n};\n\n// The final API contract type\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
+ {"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 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: string;
15
- stakingRank: string;
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 IncentivesLeaderboardEntry = {
30
+ export type IncentivesLeaderBoardEntry = {
30
31
  rank: number;
31
32
  walletAddress: string;
32
33
  totalPoints: number;
@@ -36,24 +37,21 @@ export type IncentivesLeaderboardEntry = {
36
37
  isCurrentUser?: boolean;
37
38
  };
38
39
  export type IncentivesRankingHistoryEntry = {
39
- weekNumber: number;
40
- weekTimestamp: number;
41
- tradingRank: string;
42
- stakingRank: string;
40
+ createdAt: Date;
41
+ tradingRank: RankTrading;
42
+ stakingRank: Rank;
43
43
  tradingPoints: number;
44
44
  stakingPoints: number;
45
45
  };
46
46
  export type IncentivesApiSource = {
47
- 'incentives/:wallet': ApiEndpoint<IncentivesUserSummaryData, AddressParam>;
48
- 'incentives/points/leaderboard/:type': ApiInfiniteListEndpoint<IncentivesLeaderboardEntry, {
47
+ 'incentives/leaderBoard/:type': ApiInfiniteListEndpoint<IncentivesLeaderBoardEntry, {
49
48
  type: 'weekly' | 'total';
50
- }, // Path param
51
- PaginatedQueryParams>;
52
- 'incentives/points/leaderboard/wallet/:address/:type': ApiInfiniteListEndpoint<IncentivesLeaderboardEntry, AddressParam & {
49
+ }, PaginatedQueryParams>;
50
+ 'incentives/wallet/:address': ApiEndpoint<IncentivesUserSummaryData, AddressParam>;
51
+ 'incentives/wallet/:address/leaderBoard/:type': ApiEndpoint<IncentivesLeaderBoardEntry, AddressParam & {
53
52
  type: 'weekly' | 'total';
54
- }, // Path params
55
- PaginatedQueryParams>;
56
- 'incentives/ranks/history/:wallet': ApiListEndpoint<IncentivesRankingHistoryEntry, AddressParam>;
53
+ }>;
54
+ 'incentives/wallet/:address/ranksHistory': ApiListEndpoint<IncentivesRankingHistoryEntry, AddressParam>;
57
55
  };
58
56
  export type IncentivesApi = {
59
57
  [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;AAErB,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,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AAE,eAAe,CACxD,6BAA6B,EAC7B,YAAY,CACb,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;KACzB,CAAC,IAAI,MAAM,mBAAmB,GAAG;QAChC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACzC,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACvC,QAAQ,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAC,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.282.0",
3
+ "version": "0.283.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": "0b25fd0ba43a48d5c10a238d96a025d6ccf136d4"
47
+ "gitHead": "1475dd97efe325c8aa2f48134d93799643552610"
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: string;
25
- stakingRank: string;
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 IncentivesLeaderboardEntry = {
43
+ export type IncentivesLeaderBoardEntry = {
43
44
  rank: number;
44
45
  walletAddress: string;
45
46
  totalPoints: number;
@@ -50,37 +51,36 @@ export type IncentivesLeaderboardEntry = {
50
51
  };
51
52
 
52
53
  export type IncentivesRankingHistoryEntry = {
53
- weekNumber: number;
54
- weekTimestamp: number;
55
- tradingRank: string;
56
- stakingRank: string;
54
+ createdAt: Date;
55
+ tradingRank: RankTrading;
56
+ stakingRank: Rank;
57
57
  tradingPoints: number;
58
58
  stakingPoints: number;
59
59
  };
60
60
 
61
61
  export type IncentivesApiSource = {
62
- 'incentives/:wallet': ApiEndpoint<IncentivesUserSummaryData, AddressParam>;
62
+ 'incentives/leaderBoard/:type': ApiInfiniteListEndpoint<
63
+ IncentivesLeaderBoardEntry,
64
+ { type: 'weekly' | 'total' },
65
+ PaginatedQueryParams
66
+ >;
63
67
 
64
- // Points Leaderboard
65
- 'incentives/points/leaderboard/:type': ApiInfiniteListEndpoint<
66
- IncentivesLeaderboardEntry,
67
- { type: 'weekly' | 'total' }, // Path param
68
- PaginatedQueryParams // Query params
68
+ 'incentives/wallet/:address': ApiEndpoint<
69
+ IncentivesUserSummaryData,
70
+ AddressParam
69
71
  >;
70
- 'incentives/points/leaderboard/wallet/:address/:type': ApiInfiniteListEndpoint<
71
- IncentivesLeaderboardEntry,
72
- AddressParam & { type: 'weekly' | 'total' }, // Path params
73
- PaginatedQueryParams // Query params
72
+
73
+ 'incentives/wallet/:address/leaderBoard/:type': ApiEndpoint<
74
+ IncentivesLeaderBoardEntry,
75
+ AddressParam & { type: 'weekly' | 'total' }
74
76
  >;
75
77
 
76
- // Rank History
77
- 'incentives/ranks/history/:wallet': ApiListEndpoint<
78
+ 'incentives/wallet/:address/ranksHistory': ApiListEndpoint<
78
79
  IncentivesRankingHistoryEntry,
79
80
  AddressParam
80
81
  >;
81
82
  };
82
83
 
83
- // The final API contract type
84
84
  export type IncentivesApi = {
85
85
  [K in keyof IncentivesApiSource]: {
86
86
  params: IncentivesApiSource[K]['params'];