@reyaxyz/community-sdk 0.19.0 → 0.20.1
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/dist/modules/lge/index.js +46 -0
- package/dist/modules/lge/index.js.map +1 -1
- package/dist/modules/lge/types.js.map +1 -1
- package/dist/types/modules/lge/index.d.ts +3 -1
- package/dist/types/modules/lge/index.d.ts.map +1 -1
- package/dist/types/modules/lge/types.d.ts +17 -0
- package/dist/types/modules/lge/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/modules/lge/index.ts +46 -4
- package/src/modules/lge/types.ts +11 -0
|
@@ -103,6 +103,46 @@ var LGEModule = /** @class */ (function (_super) {
|
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
105
|
};
|
|
106
|
+
// TODO: Costin fix implementation
|
|
107
|
+
LGEModule.prototype.getUserGameStatus = function (
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
109
|
+
params) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
111
|
+
return __generator(this, function (_a) {
|
|
112
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
113
|
+
return setTimeout(function () {
|
|
114
|
+
return resolve({
|
|
115
|
+
status: Math.random() > 50
|
|
116
|
+
? 'notStarted'
|
|
117
|
+
: Math.random() > 50
|
|
118
|
+
? 'notLockedIn'
|
|
119
|
+
: 'lockedIn',
|
|
120
|
+
boostRate: Math.random() * 15,
|
|
121
|
+
bodyId: Math.floor(Math.random() * 10).toString(),
|
|
122
|
+
nextBoostStartTimestampMilliseconds: Date.now() + Math.random() * 1000 * 60 * 60,
|
|
123
|
+
});
|
|
124
|
+
}, Math.random() * 2000);
|
|
125
|
+
})];
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
// TODO: Costin fix implementation
|
|
130
|
+
LGEModule.prototype.generateGameBoostRate = function (
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
132
|
+
params) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
+
return __generator(this, function (_a) {
|
|
135
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
136
|
+
return setTimeout(function () {
|
|
137
|
+
return resolve({
|
|
138
|
+
boostRate: Math.random() * 15,
|
|
139
|
+
bodyId: Math.floor(Math.random() * 10).toString(),
|
|
140
|
+
});
|
|
141
|
+
}, Math.random() * 2000);
|
|
142
|
+
})];
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
};
|
|
106
146
|
__decorate([
|
|
107
147
|
(0, common_2.Logger)('LGEModule.getLGEBoostRate')
|
|
108
148
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -116,6 +156,12 @@ var LGEModule = /** @class */ (function (_super) {
|
|
|
116
156
|
__decorate([
|
|
117
157
|
(0, common_2.Logger)('LGEModule.getUserLeaderboardData')
|
|
118
158
|
], LGEModule.prototype, "getUserLeaderboardData", null);
|
|
159
|
+
__decorate([
|
|
160
|
+
(0, common_2.Logger)('LGEModule.getUserGameStatus')
|
|
161
|
+
], LGEModule.prototype, "getUserGameStatus", null);
|
|
162
|
+
__decorate([
|
|
163
|
+
(0, common_2.Logger)('LGEModule.generateGameBoostRate')
|
|
164
|
+
], LGEModule.prototype, "generateGameBoostRate", null);
|
|
119
165
|
return LGEModule;
|
|
120
166
|
}(common_1.RestClient));
|
|
121
167
|
exports.default = LGEModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAMyB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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aderboardDataParams,\n GetUserLeaderboardDataResult,\n RestClient,\n} from '@reyaxyz/common';\n\nimport {\n GenerateGameBoostRateParams,\n GenerateGameBoostRateResult,\n GetAccountLGEStatusParams,\n GetAccountLGEStatusResult,\n GetLGEBoostRateParams,\n GetLGEBoostRateResult,\n GetUserGameStatusParams,\n GetUserGameStatusResult,\n} from './types';\n\nimport { Loggable, Logger } from '@reyaxyz/common';\n\nexport default class LGEModule extends RestClient implements Loggable {\n loggingEnabled: boolean = false;\n\n constructor(apiUrl: string, loggingEnabled: boolean) {\n super(apiUrl);\n this.loggingEnabled = loggingEnabled;\n }\n\n @Logger('LGEModule.getLGEBoostRate')\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async getLGEBoostRate(_: GetLGEBoostRateParams) {\n const uri = `/api/xp/lp-boost`;\n return this.get<GetLGEBoostRateResult>(uri);\n }\n\n @Logger('LGEModule.getAccountLGEStatus')\n async getAccountLGEStatus(params: GetAccountLGEStatusParams) {\n const uri = `/api/xp/lp-profile/${params.address}`;\n return this.get<GetAccountLGEStatusResult>(uri);\n }\n\n @Logger('LGEModule.getLeaderboard')\n async getLeaderboard(params: GetLeaderboardParams) {\n const uri = `/api/xp/leaderboard/${params.perPage}/${params.page}`;\n return this.get<GetLeaderboardResult>(uri);\n }\n\n @Logger('LGEModule.getUserLeaderboardData')\n async getUserLeaderboardData(params: GetUserLeaderboardDataParams) {\n const uri = `/api/xp/leaderboard-user-data/${params.address}`;\n return this.get<GetUserLeaderboardDataResult>(uri);\n }\n\n // TODO: Costin fix implementation\n @Logger('LGEModule.getUserGameStatus')\n async getUserGameStatus(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n params: GetUserGameStatusParams,\n ): Promise<GetUserGameStatusResult> {\n return new Promise((resolve) =>\n setTimeout(\n () =>\n resolve({\n status:\n Math.random() > 50\n ? 'notStarted'\n : Math.random() > 50\n ? 'notLockedIn'\n : 'lockedIn',\n boostRate: Math.random() * 15,\n bodyId: Math.floor(Math.random() * 10).toString(),\n nextBoostStartTimestampMilliseconds:\n Date.now() + Math.random() * 1000 * 60 * 60,\n }),\n Math.random() * 2000,\n ),\n );\n }\n\n // TODO: Costin fix implementation\n @Logger('LGEModule.generateGameBoostRate')\n async generateGameBoostRate(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n params: GenerateGameBoostRateParams,\n ): Promise<GenerateGameBoostRateResult> {\n return new Promise((resolve) =>\n setTimeout(\n () =>\n resolve({\n boostRate: Math.random() * 15,\n bodyId: Math.floor(Math.random() * 10).toString(),\n }),\n Math.random() * 2000,\n ),\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/lge/types.ts"],"names":[],"mappings":"","sourcesContent":["export {\n GetAccountLGEStatusParams,\n GetAccountLGEStatusResult,\n GetLGEBoostRateParams,\n GetLGEBoostRateResult,\n XPEntity,\n} from '@reyaxyz/common';\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/lge/types.ts"],"names":[],"mappings":"","sourcesContent":["export {\n GetAccountLGEStatusParams,\n GetAccountLGEStatusResult,\n GetLGEBoostRateParams,\n GetLGEBoostRateResult,\n XPEntity,\n} from '@reyaxyz/common';\n\n// TODO: Costin fix implementation, review if needed to be moved to common\nexport type GetUserGameStatusParams = { address: string };\nexport type GetUserGameStatusResult = {\n bodyId: string;\n status: 'notStarted' | 'notLockedIn' | 'lockedIn';\n boostRate: number;\n nextBoostStartTimestampMilliseconds: number;\n};\nexport type GenerateGameBoostRateParams = { address: string; bodyId: string };\nexport type GenerateGameBoostRateResult = { boostRate: number; bodyId: string };\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GetLeaderboardParams, GetLeaderboardResult, GetUserLeaderboardDataParams, RestClient } from '@reyaxyz/common';
|
|
2
|
-
import { GetAccountLGEStatusParams, GetAccountLGEStatusResult, GetLGEBoostRateParams, GetLGEBoostRateResult } from './types';
|
|
2
|
+
import { GenerateGameBoostRateParams, GenerateGameBoostRateResult, GetAccountLGEStatusParams, GetAccountLGEStatusResult, GetLGEBoostRateParams, GetLGEBoostRateResult, GetUserGameStatusParams, GetUserGameStatusResult } from './types';
|
|
3
3
|
import { Loggable } from '@reyaxyz/common';
|
|
4
4
|
export default class LGEModule extends RestClient implements Loggable {
|
|
5
5
|
loggingEnabled: boolean;
|
|
@@ -8,5 +8,7 @@ export default class LGEModule extends RestClient implements Loggable {
|
|
|
8
8
|
getAccountLGEStatus(params: GetAccountLGEStatusParams): Promise<GetAccountLGEStatusResult>;
|
|
9
9
|
getLeaderboard(params: GetLeaderboardParams): Promise<GetLeaderboardResult>;
|
|
10
10
|
getUserLeaderboardData(params: GetUserLeaderboardDataParams): Promise<import("@reyaxyz/common").UserLeaderboardDataEntity>;
|
|
11
|
+
getUserGameStatus(params: GetUserGameStatusParams): Promise<GetUserGameStatusResult>;
|
|
12
|
+
generateGameBoostRate(params: GenerateGameBoostRateParams): Promise<GenerateGameBoostRateResult>;
|
|
11
13
|
}
|
|
12
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,4BAA4B,EAE5B,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,4BAA4B,EAE5B,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAW,YAAW,QAAQ;IACnE,cAAc,EAAE,OAAO,CAAS;gBAEpB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO;IAO7C,eAAe,CAAC,CAAC,EAAE,qBAAqB;IAMxC,mBAAmB,CAAC,MAAM,EAAE,yBAAyB;IAMrD,cAAc,CAAC,MAAM,EAAE,oBAAoB;IAM3C,sBAAsB,CAAC,MAAM,EAAE,4BAA4B;IAO3D,iBAAiB,CAErB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC;IAuB7B,qBAAqB,CAEzB,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,2BAA2B,CAAC;CAYxC"}
|
|
@@ -1,2 +1,19 @@
|
|
|
1
1
|
export { GetAccountLGEStatusParams, GetAccountLGEStatusResult, GetLGEBoostRateParams, GetLGEBoostRateResult, XPEntity, } from '@reyaxyz/common';
|
|
2
|
+
export type GetUserGameStatusParams = {
|
|
3
|
+
address: string;
|
|
4
|
+
};
|
|
5
|
+
export type GetUserGameStatusResult = {
|
|
6
|
+
bodyId: string;
|
|
7
|
+
status: 'notStarted' | 'notLockedIn' | 'lockedIn';
|
|
8
|
+
boostRate: number;
|
|
9
|
+
nextBoostStartTimestampMilliseconds: number;
|
|
10
|
+
};
|
|
11
|
+
export type GenerateGameBoostRateParams = {
|
|
12
|
+
address: string;
|
|
13
|
+
bodyId: string;
|
|
14
|
+
};
|
|
15
|
+
export type GenerateGameBoostRateResult = {
|
|
16
|
+
boostRate: number;
|
|
17
|
+
bodyId: string;
|
|
18
|
+
};
|
|
2
19
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/lge/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,QAAQ,GACT,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/lge/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,QAAQ,GACT,MAAM,iBAAiB,CAAC;AAGzB,MAAM,MAAM,uBAAuB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1D,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,GAAG,aAAa,GAAG,UAAU,CAAC;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,mCAAmC,EAAE,MAAM,CAAC;CAC7C,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC9E,MAAM,MAAM,2BAA2B,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/community-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@reyaxyz/common": "0.57.0",
|
|
14
|
-
"@reyaxyz/sdk": "0.
|
|
14
|
+
"@reyaxyz/sdk": "0.50.0",
|
|
15
15
|
"ethers": "6.9.0"
|
|
16
16
|
},
|
|
17
17
|
"main": "dist/index.js",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"generate:coverage-badges": "npx istanbul-badges-readme --silent"
|
|
39
39
|
},
|
|
40
40
|
"packageManager": "pnpm@8.10.4",
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "a19318fced92ef568e74f90f46ce38591034531d"
|
|
42
42
|
}
|
package/src/modules/lge/index.ts
CHANGED
|
@@ -7,10 +7,14 @@ import {
|
|
|
7
7
|
} from '@reyaxyz/common';
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
|
+
GenerateGameBoostRateParams,
|
|
11
|
+
GenerateGameBoostRateResult,
|
|
10
12
|
GetAccountLGEStatusParams,
|
|
11
13
|
GetAccountLGEStatusResult,
|
|
12
14
|
GetLGEBoostRateParams,
|
|
13
15
|
GetLGEBoostRateResult,
|
|
16
|
+
GetUserGameStatusParams,
|
|
17
|
+
GetUserGameStatusResult,
|
|
14
18
|
} from './types';
|
|
15
19
|
|
|
16
20
|
import { Loggable, Logger } from '@reyaxyz/common';
|
|
@@ -48,9 +52,47 @@ export default class LGEModule extends RestClient implements Loggable {
|
|
|
48
52
|
return this.get<GetUserLeaderboardDataResult>(uri);
|
|
49
53
|
}
|
|
50
54
|
|
|
51
|
-
// TODO:
|
|
52
|
-
|
|
55
|
+
// TODO: Costin fix implementation
|
|
56
|
+
@Logger('LGEModule.getUserGameStatus')
|
|
57
|
+
async getUserGameStatus(
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
59
|
+
params: GetUserGameStatusParams,
|
|
60
|
+
): Promise<GetUserGameStatusResult> {
|
|
61
|
+
return new Promise((resolve) =>
|
|
62
|
+
setTimeout(
|
|
63
|
+
() =>
|
|
64
|
+
resolve({
|
|
65
|
+
status:
|
|
66
|
+
Math.random() > 50
|
|
67
|
+
? 'notStarted'
|
|
68
|
+
: Math.random() > 50
|
|
69
|
+
? 'notLockedIn'
|
|
70
|
+
: 'lockedIn',
|
|
71
|
+
boostRate: Math.random() * 15,
|
|
72
|
+
bodyId: Math.floor(Math.random() * 10).toString(),
|
|
73
|
+
nextBoostStartTimestampMilliseconds:
|
|
74
|
+
Date.now() + Math.random() * 1000 * 60 * 60,
|
|
75
|
+
}),
|
|
76
|
+
Math.random() * 2000,
|
|
77
|
+
),
|
|
78
|
+
);
|
|
79
|
+
}
|
|
53
80
|
|
|
54
|
-
// TODO:
|
|
55
|
-
|
|
81
|
+
// TODO: Costin fix implementation
|
|
82
|
+
@Logger('LGEModule.generateGameBoostRate')
|
|
83
|
+
async generateGameBoostRate(
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
85
|
+
params: GenerateGameBoostRateParams,
|
|
86
|
+
): Promise<GenerateGameBoostRateResult> {
|
|
87
|
+
return new Promise((resolve) =>
|
|
88
|
+
setTimeout(
|
|
89
|
+
() =>
|
|
90
|
+
resolve({
|
|
91
|
+
boostRate: Math.random() * 15,
|
|
92
|
+
bodyId: Math.floor(Math.random() * 10).toString(),
|
|
93
|
+
}),
|
|
94
|
+
Math.random() * 2000,
|
|
95
|
+
),
|
|
96
|
+
);
|
|
97
|
+
}
|
|
56
98
|
}
|
package/src/modules/lge/types.ts
CHANGED
|
@@ -5,3 +5,14 @@ export {
|
|
|
5
5
|
GetLGEBoostRateResult,
|
|
6
6
|
XPEntity,
|
|
7
7
|
} from '@reyaxyz/common';
|
|
8
|
+
|
|
9
|
+
// TODO: Costin fix implementation, review if needed to be moved to common
|
|
10
|
+
export type GetUserGameStatusParams = { address: string };
|
|
11
|
+
export type GetUserGameStatusResult = {
|
|
12
|
+
bodyId: string;
|
|
13
|
+
status: 'notStarted' | 'notLockedIn' | 'lockedIn';
|
|
14
|
+
boostRate: number;
|
|
15
|
+
nextBoostStartTimestampMilliseconds: number;
|
|
16
|
+
};
|
|
17
|
+
export type GenerateGameBoostRateParams = { address: string; bodyId: string };
|
|
18
|
+
export type GenerateGameBoostRateResult = { boostRate: number; bodyId: string };
|