@reyaxyz/community-sdk 0.23.13 → 0.24.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.
- package/dist/client/index.js +2 -2
- package/dist/client/index.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/modules/lge/index.js +19 -8
- package/dist/modules/lge/index.js.map +1 -1
- package/dist/modules/lge/types.js.map +1 -1
- package/dist/modules/referral/index.js +42 -14
- package/dist/modules/referral/index.js.map +1 -1
- package/dist/modules/referral/types.js.map +1 -0
- package/dist/modules/twitter/index.js +27 -38
- package/dist/modules/twitter/index.js.map +1 -1
- package/dist/modules/twitter/types.js.map +1 -0
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/lge/index.d.ts +3 -3
- package/dist/types/modules/lge/index.d.ts.map +1 -1
- package/dist/types/modules/lge/types.d.ts +1 -1
- package/dist/types/modules/lge/types.d.ts.map +1 -1
- package/dist/types/modules/referral/index.d.ts +6 -5
- package/dist/types/modules/referral/index.d.ts.map +1 -1
- package/dist/types/modules/referral/types.d.ts +2 -0
- package/dist/types/modules/referral/types.d.ts.map +1 -0
- package/dist/types/modules/twitter/index.d.ts +5 -10
- package/dist/types/modules/twitter/index.d.ts.map +1 -1
- package/dist/types/modules/twitter/types.d.ts +2 -0
- package/dist/types/modules/twitter/types.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/client/index.ts +5 -4
- package/src/index.ts +2 -2
- package/src/modules/lge/index.ts +17 -11
- package/src/modules/lge/types.ts +2 -0
- package/src/modules/referral/index.ts +17 -6
- package/src/modules/referral/types.ts +6 -0
- package/src/modules/twitter/index.ts +14 -45
- package/src/modules/twitter/types.ts +4 -0
- package/dist/modules/referral/services/get-wallet-referral-details/index.js +0 -18
- package/dist/modules/referral/services/get-wallet-referral-details/index.js.map +0 -1
- package/dist/modules/referral/services/get-wallet-referral-details/types.js.map +0 -1
- package/dist/modules/referral/services/index.js +0 -19
- package/dist/modules/referral/services/index.js.map +0 -1
- package/dist/modules/twitter/services/get-auth-url/index.js +0 -20
- package/dist/modules/twitter/services/get-auth-url/index.js.map +0 -1
- package/dist/modules/twitter/services/get-auth-url/types.js.map +0 -1
- package/dist/modules/twitter/services/index.js +0 -19
- package/dist/modules/twitter/services/index.js.map +0 -1
- package/dist/types/modules/referral/services/get-wallet-referral-details/index.d.ts +0 -3
- package/dist/types/modules/referral/services/get-wallet-referral-details/index.d.ts.map +0 -1
- package/dist/types/modules/referral/services/get-wallet-referral-details/types.d.ts +0 -9
- package/dist/types/modules/referral/services/get-wallet-referral-details/types.d.ts.map +0 -1
- package/dist/types/modules/referral/services/index.d.ts +0 -3
- package/dist/types/modules/referral/services/index.d.ts.map +0 -1
- package/dist/types/modules/twitter/services/get-auth-url/index.d.ts +0 -3
- package/dist/types/modules/twitter/services/get-auth-url/index.d.ts.map +0 -1
- package/dist/types/modules/twitter/services/get-auth-url/types.d.ts +0 -6
- package/dist/types/modules/twitter/services/get-auth-url/types.d.ts.map +0 -1
- package/dist/types/modules/twitter/services/index.d.ts +0 -3
- package/dist/types/modules/twitter/services/index.d.ts.map +0 -1
- package/src/modules/referral/services/get-wallet-referral-details/index.ts +0 -21
- package/src/modules/referral/services/get-wallet-referral-details/types.ts +0 -9
- package/src/modules/referral/services/index.ts +0 -2
- package/src/modules/twitter/services/get-auth-url/index.ts +0 -23
- package/src/modules/twitter/services/get-auth-url/types.ts +0 -5
- package/src/modules/twitter/services/index.ts +0 -2
- /package/dist/modules/referral/{services/get-wallet-referral-details/types.js → types.js} +0 -0
- /package/dist/modules/twitter/{services/get-auth-url/types.js → types.js} +0 -0
package/dist/client/index.js
CHANGED
|
@@ -16,8 +16,8 @@ var CommunityClient = /** @class */ (function () {
|
|
|
16
16
|
function CommunityClient() {
|
|
17
17
|
this._voteModule = new vote_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
|
|
18
18
|
this._lgeModule = new lge_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
|
|
19
|
-
this._twitterModule = new twitter_1.default(CommunityClient.config.
|
|
20
|
-
this._referralModule = new referral_1.default(CommunityClient.config.logging);
|
|
19
|
+
this._twitterModule = new twitter_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
|
|
20
|
+
this._referralModule = new referral_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
|
|
21
21
|
}
|
|
22
22
|
CommunityClient.configure = function (environment) {
|
|
23
23
|
CommunityClient.config =
|
package/dist/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAoE;AACpE,yDAAyC;AACzC,uDAAuC;AACvC,+DAA+C;AAC/C,iEAAiD;AAEjD;;GAEG;AACH;IASE;QACE,IAAI,CAAC,WAAW,GAAG,IAAI,cAAU,CAC/B,eAAe,CAAC,MAAM,CAAC,WAAW,EAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,IAAI,aAAS,CAC7B,eAAe,CAAC,MAAM,CAAC,WAAW,EAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,IAAI,iBAAa,CACrC,eAAe,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAoE;AACpE,yDAAyC;AACzC,uDAAuC;AACvC,+DAA+C;AAC/C,iEAAiD;AAEjD;;GAEG;AACH;IASE;QACE,IAAI,CAAC,WAAW,GAAG,IAAI,cAAU,CAC/B,eAAe,CAAC,MAAM,CAAC,WAAW,EAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,IAAI,aAAS,CAC7B,eAAe,CAAC,MAAM,CAAC,WAAW,EAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,IAAI,iBAAa,CACrC,eAAe,CAAC,MAAM,CAAC,WAAW,EAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,IAAI,kBAAc,CACvC,eAAe,CAAC,MAAM,CAAC,WAAW,EAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;IACJ,CAAC;IAEa,yBAAS,GAAvB,UAAwB,WAAyC;QAC/D,eAAe,CAAC,MAAM;YACpB,2BAAkB,CAAC,WAAW,CAAC,IAAI,2BAAkB,CAAC,MAAM,CAAC,CAAC;QAChE,eAAe,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;IACnD,CAAC;IAEc,2BAAW,GAA1B;QACE,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;QACJ,CAAC;QACD,OAAO,eAAe,CAAC,QAAQ,CAAC;IAClC,CAAC;IASD,sBAAkB,uBAAI;QAPtB;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC;QACnD,CAAC;;;OAAA;IASD,sBAAkB,sBAAG;QAPrB;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC;QAClD,CAAC;;;OAAA;IAGD,sBAAkB,8BAAW;QAD7B,yBAAyB;aACzB;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC;QAClD,CAAC;;;OAAA;IASD,sBAAkB,0BAAO;QAPzB;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC;QACtD,CAAC;;;OAAA;IASD,sBAAkB,2BAAQ;QAP1B;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC;QACvD,CAAC;;;OAAA;IAED,sBAAkB,iCAAc;aAAhC;YACE,OAAO,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC;QACtC,CAAC;;;OAAA;IA5Fc,sBAAM,GAAkB,2BAAkB,CAAC,MAAM,CAAC,CAAC;IA6FpE,sBAAC;CAAA,AA/FD,IA+FC;AA/FY,0CAAe","sourcesContent":["import { API_CLIENT_CONFIGS, ServiceConfig } from '@reyaxyz/common';\nimport VoteModule from '../modules/vote';\nimport LGEModule from '../modules/lge';\nimport TwitterModule from '../modules/twitter';\nimport ReferralModule from '../modules/referral';\n\n/**\n * @description Client for Community SDK\n */\nexport class CommunityClient {\n private static instance: CommunityClient;\n private static config: ServiceConfig = API_CLIENT_CONFIGS['test'];\n\n private readonly _voteModule: VoteModule;\n private readonly _lgeModule: LGEModule;\n private readonly _twitterModule: TwitterModule;\n private readonly _referralModule: ReferralModule;\n\n private constructor() {\n this._voteModule = new VoteModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._lgeModule = new LGEModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._twitterModule = new TwitterModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._referralModule = new ReferralModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n }\n\n public static configure(environment: ServiceConfig['environment']): void {\n CommunityClient.config =\n API_CLIENT_CONFIGS[environment] || API_CLIENT_CONFIGS['test'];\n CommunityClient.instance = new CommunityClient();\n }\n\n private static getInstance(): CommunityClient {\n if (!CommunityClient.instance) {\n throw new Error(\n 'Client is not configured. Please configure it before using.',\n );\n }\n return CommunityClient.instance;\n }\n\n /**\n * Provides access to the VoteModule instance.\n * This getter allows for interacting with vote-related functionalities.\n *\n * @returns {VoteModule} An instance of VoteModule for vote operations.\n * @memberof CommunityClient\n */\n public static get vote(): VoteModule {\n return CommunityClient.getInstance()._voteModule;\n }\n\n /**\n * Provides access to the LGEModule instance.\n * This getter allows for interacting with LGE-related functionalities.\n *\n * @returns {LGEModule} An instance of LGEModule for LGE operations.\n * @memberof CommunityClient\n */\n public static get lge(): LGEModule {\n return CommunityClient.getInstance()._lgeModule;\n }\n\n // TODO: Costin deprecate\n public static get leaderboard(): LGEModule {\n return CommunityClient.getInstance()._lgeModule;\n }\n\n /**\n * Provides access to the TwitterModule instance.\n * This getter allows for interacting with twitter-related functionalities.\n *\n * @returns {TwitterModule} An instance of Twitter for twitter operations.\n * @memberof CommunityClient\n */\n public static get twitter(): TwitterModule {\n return CommunityClient.getInstance()._twitterModule;\n }\n\n /**\n * Provides access to the ReferralModule instance.\n * This getter allows for interacting with referral related functionalities.\n *\n * @returns {ReferralModule} An instance of ReferralModule .\n * @memberof CommunityClient\n */\n public static get referral(): ReferralModule {\n return CommunityClient.getInstance()._referralModule;\n }\n\n public static get supportedChain(): number {\n return CommunityClient.config.chain;\n }\n}\n"]}
|
package/dist/index.js
CHANGED
|
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./client"), exports);
|
|
18
|
-
__exportStar(require("./modules/twitter/
|
|
18
|
+
__exportStar(require("./modules/twitter/types"), exports);
|
|
19
19
|
__exportStar(require("./modules/vote/types"), exports);
|
|
20
20
|
__exportStar(require("./modules/lge/types"), exports);
|
|
21
|
-
__exportStar(require("./modules/referral/
|
|
21
|
+
__exportStar(require("./modules/referral/types"), exports);
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0DAAwC;AACxC,uDAAqC;AACrC,sDAAoC;AACpC,2DAAyC","sourcesContent":["export * from './client';\nexport * from './modules/twitter/types';\nexport * from './modules/vote/types';\nexport * from './modules/lge/types';\nexport * from './modules/referral/types';\n"]}
|
|
@@ -58,7 +58,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
58
58
|
};
|
|
59
59
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
60
|
var common_1 = require("@reyaxyz/common");
|
|
61
|
-
var common_2 = require("@reyaxyz/common");
|
|
62
61
|
var LGEModule = /** @class */ (function (_super) {
|
|
63
62
|
__extends(LGEModule, _super);
|
|
64
63
|
function LGEModule(apiUrl, loggingEnabled) {
|
|
@@ -143,28 +142,40 @@ var LGEModule = /** @class */ (function (_super) {
|
|
|
143
142
|
});
|
|
144
143
|
});
|
|
145
144
|
};
|
|
145
|
+
LGEModule.prototype.lockGameBoostRate = function (params) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
147
|
+
var uri;
|
|
148
|
+
return __generator(this, function (_a) {
|
|
149
|
+
uri = "/api/xp/lock-game-boost-rate/".concat(params.address);
|
|
150
|
+
return [2 /*return*/, this.get(uri)];
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
};
|
|
146
154
|
__decorate([
|
|
147
|
-
(0,
|
|
155
|
+
(0, common_1.Logger)('LGEModule.claimRank')
|
|
148
156
|
], LGEModule.prototype, "claimRank", null);
|
|
149
157
|
__decorate([
|
|
150
|
-
(0,
|
|
158
|
+
(0, common_1.Logger)('LGEModule.getLGEBoostRate')
|
|
151
159
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
152
160
|
], LGEModule.prototype, "getLGEBoostRate", null);
|
|
153
161
|
__decorate([
|
|
154
|
-
(0,
|
|
162
|
+
(0, common_1.Logger)('LGEModule.getAccountLGEStatus')
|
|
155
163
|
], LGEModule.prototype, "getAccountLGEStatus", null);
|
|
156
164
|
__decorate([
|
|
157
|
-
(0,
|
|
165
|
+
(0, common_1.Logger)('LGEModule.getLeaderboard')
|
|
158
166
|
], LGEModule.prototype, "getLeaderboard", null);
|
|
159
167
|
__decorate([
|
|
160
|
-
(0,
|
|
168
|
+
(0, common_1.Logger)('LGEModule.getUserLeaderboardData')
|
|
161
169
|
], LGEModule.prototype, "getUserLeaderboardData", null);
|
|
162
170
|
__decorate([
|
|
163
|
-
(0,
|
|
171
|
+
(0, common_1.Logger)('LGEModule.getUserGameStatus')
|
|
164
172
|
], LGEModule.prototype, "getUserGameStatus", null);
|
|
165
173
|
__decorate([
|
|
166
|
-
(0,
|
|
174
|
+
(0, common_1.Logger)('LGEModule.generateGameBoostRate')
|
|
167
175
|
], LGEModule.prototype, "generateGameBoostRate", null);
|
|
176
|
+
__decorate([
|
|
177
|
+
(0, common_1.Logger)('LGEModule.lockGameBoostRate')
|
|
178
|
+
], LGEModule.prototype, "lockGameBoostRate", null);
|
|
168
179
|
return LGEModule;
|
|
169
180
|
}(common_1.RestClient));
|
|
170
181
|
exports.default = LGEModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA+D;AAqB/D;IAAuC,6BAAU;IAG/C,mBAAY,MAAc,EAAE,cAAuB;QACjD,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QAHhB,oBAAc,GAAY,KAAK,CAAC;QAI9B,KAAI,CAAC,cAAc,GAAG,cAAc,CAAC;;IACvC,CAAC;IAGK,6BAAS,GAAT,UAAU,MAAuB;;;;4BAE9B,qBAAM,IAAI,OAAO,CACtB,UAAC,OAAqC,EAAE,MAAM;4BAC5C,UAAU,CACR;gCACE,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC;gCACvC,IAAI,KAAK,EAAE,CAAC;oCACV,MAAM,CAAC,IAAI,KAAK,CAAC,yBAAkB,MAAM,CAAC,OAAO,WAAQ,CAAC,CAAC,CAAC;gCAC9D,CAAC;gCACD,OAAO,CAAC;oCACN,OAAO,EAAE,IAAI;iCACd,CAAC,CAAC;4BACL,CAAC,EACD,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,IAAI,CAC3B,CAAC;wBACJ,CAAC,CACF,EAAA;;oBAhBD,4CAA4C;oBAC5C,sBAAO,SAeN,EAAC;;;;KACH;IAIK,mCAAe,GAAf,UAAgB,CAAwB;;;;gBACtC,GAAG,GAAG,kBAAkB,CAAC;gBAC/B,sBAAO,IAAI,CAAC,GAAG,CAAwB,GAAG,CAAC,EAAC;;;KAC7C;IAGK,uCAAmB,GAAnB,UAAoB,MAAiC;;;;gBACnD,GAAG,GAAG,6BAAsB,MAAM,CAAC,OAAO,CAAE,CAAC;gBACnD,sBAAO,IAAI,CAAC,GAAG,CAA4B,GAAG,CAAC,EAAC;;;KACjD;IAGK,kCAAc,GAAd,UAAe,MAA4B;;;;gBACzC,GAAG,GAAG,8BAAuB,MAAM,CAAC,OAAO,cAAI,MAAM,CAAC,IAAI,CAAE,CAAC;gBACnE,sBAAO,IAAI,CAAC,GAAG,CAAuB,GAAG,CAAC,EAAC;;;KAC5C;IAGK,0CAAsB,GAAtB,UAAuB,MAAoC;;;;gBACzD,GAAG,GAAG,wCAAiC,MAAM,CAAC,OAAO,CAAE,CAAC;gBAC9D,sBAAO,IAAI,CAAC,GAAG,CAA+B,GAAG,CAAC,EAAC;;;KACpD;IAGK,qCAAiB,GAAjB,UACJ,MAA+B;;;;gBAEzB,GAAG,GAAG,mCAA4B,MAAM,CAAC,OAAO,CAAE,CAAC;gBACzD,sBAAO,IAAI,CAAC,GAAG,CAA0B,GAAG,CAAC,EAAC;;;KAC/C;IAGK,yCAAqB,GAArB,UACJ,MAAmC;;;;gBAE7B,GAAG,GAAG,2CAAoC,MAAM,CAAC,OAAO,cAAI,MAAM,CAAC,MAAM,CAAE,CAAC;gBAClF,sBAAO,IAAI,CAAC,GAAG,CAA8B,GAAG,CAAC,EAAC;;;KACnD;IAGK,qCAAiB,GAAjB,UACJ,MAA+B;;;;gBAEzB,GAAG,GAAG,uCAAgC,MAAM,CAAC,OAAO,CAAE,CAAC;gBAC7D,sBAAO,IAAI,CAAC,GAAG,CAA0B,GAAG,CAAC,EAAC;;;KAC/C;IAnEK;QADL,IAAA,eAAM,EAAC,qBAAqB,CAAC;8CAmB7B;IAIK;QAFL,IAAA,eAAM,EAAC,2BAA2B,CAAC;QACpC,6DAA6D;oDAI5D;IAGK;QADL,IAAA,eAAM,EAAC,+BAA+B,CAAC;wDAIvC;IAGK;QADL,IAAA,eAAM,EAAC,0BAA0B,CAAC;mDAIlC;IAGK;QADL,IAAA,eAAM,EAAC,kCAAkC,CAAC;2DAI1C;IAGK;QADL,IAAA,eAAM,EAAC,6BAA6B,CAAC;sDAMrC;IAGK;QADL,IAAA,eAAM,EAAC,iCAAiC,CAAC;0DAMzC;IAGK;QADL,IAAA,eAAM,EAAC,6BAA6B,CAAC;sDAMrC;IACH,gBAAC;CAAA,AA7ED,CAAuC,mBAAU,GA6EhD;kBA7EoB,SAAS","sourcesContent":["import { RestClient, Loggable, Logger } from '@reyaxyz/common';\n\nimport {\n GenerateGameBoostRateParams,\n GenerateGameBoostRateResult,\n GetAccountLGEStatusParams,\n GetAccountLGEStatusResult,\n GetLGEBoostRateParams,\n GetLGEBoostRateResult,\n GetUserGameStatusParams,\n GetUserGameStatusResult,\n ClaimRankParams,\n ClaimRankResult,\n GetLeaderboardParams,\n GetLeaderboardResult,\n GetUserLeaderboardDataParams,\n GetUserLeaderboardDataResult,\n LockGameBoostRateParams,\n LockGameBoostRateResult,\n} from './types';\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.claimRank')\n async claimRank(params: ClaimRankParams) {\n // TODO: Costin, Write proper implementation\n return await new Promise(\n (resolve: (_: ClaimRankResult) => void, reject) => {\n setTimeout(\n () => {\n const error = Math.random() * 100 > 50;\n if (error) {\n reject(new Error(`Claim Rank for ${params.address} error`));\n }\n resolve({\n success: true,\n });\n },\n Math.random() * 100 + 1000,\n );\n },\n );\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/xp-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 @Logger('LGEModule.getUserGameStatus')\n async getUserGameStatus(\n params: GetUserGameStatusParams,\n ): Promise<GetUserGameStatusResult> {\n const uri = `/api/xp/user-game-status/${params.address}`;\n return this.get<GetUserGameStatusResult>(uri);\n }\n\n @Logger('LGEModule.generateGameBoostRate')\n async generateGameBoostRate(\n params: GenerateGameBoostRateParams,\n ): Promise<GenerateGameBoostRateResult> {\n const uri = `/api/xp/generate-game-boost-rate/${params.address}/${params.bodyId}`;\n return this.get<GenerateGameBoostRateResult>(uri);\n }\n\n @Logger('LGEModule.lockGameBoostRate')\n async lockGameBoostRate(\n params: LockGameBoostRateParams,\n ): Promise<LockGameBoostRateResult> {\n const uri = `/api/xp/lock-game-boost-rate/${params.address}`;\n return this.get<LockGameBoostRateResult>(uri);\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 GetUserGameStatusParams,\n GetUserGameStatusResult,\n GenerateGameBoostRateParams,\n GenerateGameBoostRateResult,\n GetLeaderboardParams,\n GetLeaderboardResult,\n GetUserLeaderboardDataParams,\n GetUserLeaderboardDataResult,\n LeaderboardEntity,\n UserLeaderboardDataEntity,\n ClaimRankParams,\n ClaimRankResult,\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 GetUserGameStatusParams,\n GetUserGameStatusResult,\n GenerateGameBoostRateParams,\n GenerateGameBoostRateResult,\n GetLeaderboardParams,\n GetLeaderboardResult,\n GetUserLeaderboardDataParams,\n GetUserLeaderboardDataResult,\n LeaderboardEntity,\n UserLeaderboardDataEntity,\n ClaimRankParams,\n ClaimRankResult,\n LockGameBoostRateParams,\n LockGameBoostRateResult,\n XPEntity,\n} from '@reyaxyz/common';\n"]}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
18
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
19
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -42,27 +57,40 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
42
57
|
}
|
|
43
58
|
};
|
|
44
59
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
var services_1 = require("./services");
|
|
46
60
|
var common_1 = require("@reyaxyz/common");
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
var LGEModule = /** @class */ (function (_super) {
|
|
62
|
+
__extends(LGEModule, _super);
|
|
63
|
+
function LGEModule(apiUrl, loggingEnabled) {
|
|
64
|
+
var _this = _super.call(this, apiUrl) || this;
|
|
65
|
+
_this.loggingEnabled = false;
|
|
66
|
+
_this.loggingEnabled = loggingEnabled;
|
|
67
|
+
return _this;
|
|
51
68
|
}
|
|
52
|
-
|
|
69
|
+
LGEModule.prototype.getWalletReferralDetails = function (params) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
+
var uri;
|
|
72
|
+
return __generator(this, function (_a) {
|
|
73
|
+
uri = "/api/xp/get-referral-profile/".concat(params.address);
|
|
74
|
+
return [2 /*return*/, this.get(uri)];
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
LGEModule.prototype.registerReferral = function (params) {
|
|
53
79
|
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
+
var uri;
|
|
54
81
|
return __generator(this, function (_a) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
58
|
-
}
|
|
82
|
+
uri = "/api/xp/register-referral/".concat(params.beneficiary, "/").concat(params.referral);
|
|
83
|
+
return [2 /*return*/, this.get(uri)];
|
|
59
84
|
});
|
|
60
85
|
});
|
|
61
86
|
};
|
|
62
87
|
__decorate([
|
|
63
88
|
(0, common_1.Logger)('ReferralModule.getWalletReferralDetails')
|
|
64
|
-
],
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
89
|
+
], LGEModule.prototype, "getWalletReferralDetails", null);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, common_1.Logger)('ReferralModule.registerReferral')
|
|
92
|
+
], LGEModule.prototype, "registerReferral", null);
|
|
93
|
+
return LGEModule;
|
|
94
|
+
}(common_1.RestClient));
|
|
95
|
+
exports.default = LGEModule;
|
|
68
96
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/referral/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/referral/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA+D;AAS/D;IAAuC,6BAAU;IAG/C,mBAAY,MAAc,EAAE,cAAuB;QACjD,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QAHhB,oBAAc,GAAY,KAAK,CAAC;QAI9B,KAAI,CAAC,cAAc,GAAG,cAAc,CAAC;;IACvC,CAAC;IAGK,4CAAwB,GAAxB,UAAyB,MAAsC;;;;gBAC7D,GAAG,GAAG,uCAAgC,MAAM,CAAC,OAAO,CAAE,CAAC;gBAC7D,sBAAO,IAAI,CAAC,GAAG,CAAiC,GAAG,CAAC,EAAC;;;KACtD;IAGK,oCAAgB,GAAhB,UAAiB,MAA8B;;;;gBAC7C,GAAG,GAAG,oCAA6B,MAAM,CAAC,WAAW,cAAI,MAAM,CAAC,QAAQ,CAAE,CAAC;gBACjF,sBAAO,IAAI,CAAC,GAAG,CAAyB,GAAG,CAAC,EAAC;;;KAC9C;IATK;QADL,IAAA,eAAM,EAAC,yCAAyC,CAAC;6DAIjD;IAGK;QADL,IAAA,eAAM,EAAC,iCAAiC,CAAC;qDAIzC;IACH,gBAAC;CAAA,AAnBD,CAAuC,mBAAU,GAmBhD;kBAnBoB,SAAS","sourcesContent":["import { Loggable, Logger, RestClient } from '@reyaxyz/common';\n\nimport {\n GetWalletReferralDetailsParams,\n GetWalletReferralDetailsResult,\n RegisterReferralParams,\n RegisterReferralResult,\n} from './types';\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('ReferralModule.getWalletReferralDetails')\n async getWalletReferralDetails(params: GetWalletReferralDetailsParams) {\n const uri = `/api/xp/get-referral-profile/${params.address}`;\n return this.get<GetWalletReferralDetailsResult>(uri);\n }\n\n @Logger('ReferralModule.registerReferral')\n async registerReferral(params: RegisterReferralParams) {\n const uri = `/api/xp/register-referral/${params.beneficiary}/${params.referral}`;\n return this.get<RegisterReferralResult>(uri);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/referral/types.ts"],"names":[],"mappings":"","sourcesContent":["export {\n GetWalletReferralDetailsParams,\n GetWalletReferralDetailsResult,\n RegisterReferralParams,\n RegisterReferralResult,\n} from '@reyaxyz/common';\n"]}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
for (var p in
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
10
8
|
};
|
|
11
|
-
return
|
|
12
|
-
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
13
17
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
14
18
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15
19
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -17,38 +21,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
17
21
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18
22
|
};
|
|
19
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
var services_1 = require("./services");
|
|
21
24
|
var common_1 = require("@reyaxyz/common");
|
|
22
|
-
var TwitterModule = /** @class */ (function () {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
var TwitterModule = /** @class */ (function (_super) {
|
|
26
|
+
__extends(TwitterModule, _super);
|
|
27
|
+
function TwitterModule(apiUrl, loggingEnabled) {
|
|
28
|
+
var _this = _super.call(this, apiUrl) || this;
|
|
29
|
+
_this.loggingEnabled = false;
|
|
30
|
+
_this.loggingEnabled = loggingEnabled;
|
|
31
|
+
return _this;
|
|
29
32
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
_) {
|
|
34
|
-
return 'NONE';
|
|
35
|
-
};
|
|
36
|
-
TwitterModule.prototype.getLockGameBoostTwitterLink = function (params) {
|
|
37
|
-
return (0, services_1.getTwitterOauthUrl)(__assign(__assign({}, params), { redirectURI: this.getLockGameBoostTwitterApiURI, twitterClientId: this.twitterClientId }));
|
|
33
|
+
TwitterModule.prototype.getLockGameBoostTwitterURL = function (params) {
|
|
34
|
+
var uri = "/api/twitter/lock-game-boost-twitter-url/".concat(params.walletAddress, "/").concat(params.lockedInBoost);
|
|
35
|
+
return this.get(uri);
|
|
38
36
|
};
|
|
39
|
-
TwitterModule.prototype.getShareReferralTwitterLink = function (params) {
|
|
40
|
-
return (0, services_1.getTwitterOauthUrl)(__assign(__assign({}, params), { redirectURI: this.getShareReferralTwitterApiURI, twitterClientId: this.twitterClientId }));
|
|
41
|
-
};
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, common_1.Logger)('TwitterModule.getExtraBoostTwitterLink')
|
|
44
|
-
], TwitterModule.prototype, "getExtraBoostTwitterLink", null);
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, common_1.Logger)('TwitterModule.getLockGameBoostTwitterLink')
|
|
47
|
-
], TwitterModule.prototype, "getLockGameBoostTwitterLink", null);
|
|
48
37
|
__decorate([
|
|
49
|
-
(0, common_1.Logger)('TwitterModule.
|
|
50
|
-
], TwitterModule.prototype, "
|
|
38
|
+
(0, common_1.Logger)('TwitterModule.getLockGameBoostTwitterURL')
|
|
39
|
+
], TwitterModule.prototype, "getLockGameBoostTwitterURL", null);
|
|
51
40
|
return TwitterModule;
|
|
52
|
-
}());
|
|
41
|
+
}(common_1.RestClient));
|
|
53
42
|
exports.default = TwitterModule;
|
|
54
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/twitter/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/twitter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA+D;AAM/D;IAA2C,iCAAU;IAGnD,uBAAY,MAAc,EAAE,cAAuB;QACjD,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QAHhB,oBAAc,GAAY,KAAK,CAAC;QAI9B,KAAI,CAAC,cAAc,GAAG,cAAc,CAAC;;IACvC,CAAC;IAGD,kDAA0B,GAA1B,UACE,MAAwC;QAExC,IAAM,GAAG,GAAG,mDAA4C,MAAM,CAAC,aAAa,cAAI,MAAM,CAAC,aAAa,CAAE,CAAC;QACvG,OAAO,IAAI,CAAC,GAAG,CAAmC,GAAG,CAAC,CAAC;IACzD,CAAC;IALD;QADC,IAAA,eAAM,EAAC,0CAA0C,CAAC;mEAMlD;IACH,oBAAC;CAAA,AAfD,CAA2C,mBAAU,GAepD;kBAfoB,aAAa","sourcesContent":["import { Loggable, Logger, RestClient } from '@reyaxyz/common';\nimport {\n GetLockGameBoostTwitterUrlResult,\n GetLockGameBoostTwitterUrlParams,\n} from './types';\n\nexport default class TwitterModule 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('TwitterModule.getLockGameBoostTwitterURL')\n getLockGameBoostTwitterURL(\n params: GetLockGameBoostTwitterUrlParams,\n ): Promise<GetLockGameBoostTwitterUrlResult> {\n const uri = `/api/twitter/lock-game-boost-twitter-url/${params.walletAddress}/${params.lockedInBoost}`;\n return this.get<GetLockGameBoostTwitterUrlResult>(uri);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/twitter/types.ts"],"names":[],"mappings":"","sourcesContent":["export {\n GetLockGameBoostTwitterUrlResult,\n GetLockGameBoostTwitterUrlParams,\n} from '@reyaxyz/common';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IACzC,OAAO,CAAC,MAAM,CAAC,MAAM,CAA6C;IAElE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;IAC/C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IAEjD,OAAO;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IACzC,OAAO,CAAC,MAAM,CAAC,MAAM,CAA6C;IAElE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;IAC/C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IAEjD,OAAO;WAmBO,SAAS,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,IAAI;IAMxE,OAAO,CAAC,MAAM,CAAC,WAAW;IAS1B;;;;;;OAMG;IACH,WAAkB,IAAI,IAAI,UAAU,CAEnC;IAED;;;;;;OAMG;IACH,WAAkB,GAAG,IAAI,SAAS,CAEjC;IAGD,WAAkB,WAAW,IAAI,SAAS,CAEzC;IAED;;;;;;OAMG;IACH,WAAkB,OAAO,IAAI,aAAa,CAEzC;IAED;;;;;;OAMG;IACH,WAAkB,QAAQ,IAAI,cAAc,CAE3C;IAED,WAAkB,cAAc,IAAI,MAAM,CAEzC;CACF"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './client';
|
|
2
|
-
export * from './modules/twitter/
|
|
2
|
+
export * from './modules/twitter/types';
|
|
3
3
|
export * from './modules/vote/types';
|
|
4
4
|
export * from './modules/lge/types';
|
|
5
|
-
export * from './modules/referral/
|
|
5
|
+
export * from './modules/referral/types';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GenerateGameBoostRateParams, GenerateGameBoostRateResult, GetAccountLGEStatusParams, GetAccountLGEStatusResult, GetLGEBoostRateParams, GetLGEBoostRateResult, GetUserGameStatusParams, GetUserGameStatusResult } from './types';
|
|
3
|
-
import { Loggable } from '@reyaxyz/common';
|
|
1
|
+
import { RestClient, Loggable } from '@reyaxyz/common';
|
|
2
|
+
import { GenerateGameBoostRateParams, GenerateGameBoostRateResult, GetAccountLGEStatusParams, GetAccountLGEStatusResult, GetLGEBoostRateParams, GetLGEBoostRateResult, GetUserGameStatusParams, GetUserGameStatusResult, ClaimRankParams, ClaimRankResult, GetLeaderboardParams, GetLeaderboardResult, GetUserLeaderboardDataParams, LockGameBoostRateParams, LockGameBoostRateResult } from './types';
|
|
4
3
|
export default class LGEModule extends RestClient implements Loggable {
|
|
5
4
|
loggingEnabled: boolean;
|
|
6
5
|
constructor(apiUrl: string, loggingEnabled: boolean);
|
|
@@ -11,5 +10,6 @@ export default class LGEModule extends RestClient implements Loggable {
|
|
|
11
10
|
getUserLeaderboardData(params: GetUserLeaderboardDataParams): Promise<import("@reyaxyz/common").UserLeaderboardDataEntity>;
|
|
12
11
|
getUserGameStatus(params: GetUserGameStatusParams): Promise<GetUserGameStatusResult>;
|
|
13
12
|
generateGameBoostRate(params: GenerateGameBoostRateParams): Promise<GenerateGameBoostRateResult>;
|
|
13
|
+
lockGameBoostRate(params: LockGameBoostRateParams): Promise<LockGameBoostRateResult>;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AAE/D,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,4BAA4B,EAE5B,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAW,YAAW,QAAQ;IACnE,cAAc,EAAE,OAAO,CAAS;gBAEpB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO;IAM7C,SAAS,CAAC,MAAM,EAAE,eAAe;IAsBjC,eAAe,CAAC,CAAC,EAAE,qBAAqB;IAMxC,mBAAmB,CAAC,MAAM,EAAE,yBAAyB;IAMrD,cAAc,CAAC,MAAM,EAAE,oBAAoB;IAM3C,sBAAsB,CAAC,MAAM,EAAE,4BAA4B;IAM3D,iBAAiB,CACrB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC;IAM7B,qBAAqB,CACzB,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,2BAA2B,CAAC;IAMjC,iBAAiB,CACrB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC;CAIpC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { GetAccountLGEStatusParams, GetAccountLGEStatusResult, GetLGEBoostRateParams, GetLGEBoostRateResult, GetUserGameStatusParams, GetUserGameStatusResult, GenerateGameBoostRateParams, GenerateGameBoostRateResult, GetLeaderboardParams, GetLeaderboardResult, GetUserLeaderboardDataParams, GetUserLeaderboardDataResult, LeaderboardEntity, UserLeaderboardDataEntity, ClaimRankParams, ClaimRankResult, XPEntity, } from '@reyaxyz/common';
|
|
1
|
+
export { GetAccountLGEStatusParams, GetAccountLGEStatusResult, GetLGEBoostRateParams, GetLGEBoostRateResult, GetUserGameStatusParams, GetUserGameStatusResult, GenerateGameBoostRateParams, GenerateGameBoostRateResult, GetLeaderboardParams, GetLeaderboardResult, GetUserLeaderboardDataParams, GetUserLeaderboardDataResult, LeaderboardEntity, UserLeaderboardDataEntity, ClaimRankParams, ClaimRankResult, LockGameBoostRateParams, LockGameBoostRateResult, XPEntity, } from '@reyaxyz/common';
|
|
2
2
|
//# 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,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,2BAA2B,EAC3B,oBAAoB,EACpB,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC5B,iBAAiB,EACjB,yBAAyB,EACzB,eAAe,EACf,eAAe,EACf,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,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,2BAA2B,EAC3B,oBAAoB,EACpB,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC5B,iBAAiB,EACjB,yBAAyB,EACzB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,QAAQ,GACT,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export default class
|
|
1
|
+
import { Loggable, RestClient } from '@reyaxyz/common';
|
|
2
|
+
import { GetWalletReferralDetailsParams, GetWalletReferralDetailsResult, RegisterReferralParams } from './types';
|
|
3
|
+
export default class LGEModule extends RestClient implements Loggable {
|
|
4
4
|
loggingEnabled: boolean;
|
|
5
|
-
constructor(loggingEnabled: boolean);
|
|
6
|
-
getWalletReferralDetails(params: GetWalletReferralDetailsParams): Promise<
|
|
5
|
+
constructor(apiUrl: string, loggingEnabled: boolean);
|
|
6
|
+
getWalletReferralDetails(params: GetWalletReferralDetailsParams): Promise<GetWalletReferralDetailsResult>;
|
|
7
|
+
registerReferral(params: RegisterReferralParams): Promise<void>;
|
|
7
8
|
}
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/referral/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/referral/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE/D,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAW,YAAW,QAAQ;IACnE,cAAc,EAAE,OAAO,CAAS;gBAEpB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO;IAM7C,wBAAwB,CAAC,MAAM,EAAE,8BAA8B;IAM/D,gBAAgB,CAAC,MAAM,EAAE,sBAAsB;CAItD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/referral/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export default class TwitterModule implements Loggable {
|
|
4
|
-
private getLockGameBoostTwitterApiURI;
|
|
5
|
-
private getShareReferralTwitterApiURI;
|
|
6
|
-
private twitterClientId;
|
|
1
|
+
import { Loggable, RestClient } from '@reyaxyz/common';
|
|
2
|
+
import { GetLockGameBoostTwitterUrlResult, GetLockGameBoostTwitterUrlParams } from './types';
|
|
3
|
+
export default class TwitterModule extends RestClient implements Loggable {
|
|
7
4
|
loggingEnabled: boolean;
|
|
8
|
-
constructor(
|
|
9
|
-
|
|
10
|
-
getLockGameBoostTwitterLink(params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>): string;
|
|
11
|
-
getShareReferralTwitterLink(params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>): string;
|
|
5
|
+
constructor(apiUrl: string, loggingEnabled: boolean);
|
|
6
|
+
getLockGameBoostTwitterURL(params: GetLockGameBoostTwitterUrlParams): Promise<GetLockGameBoostTwitterUrlResult>;
|
|
12
7
|
}
|
|
13
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/twitter/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/twitter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EACL,gCAAgC,EAChC,gCAAgC,EACjC,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAW,YAAW,QAAQ;IACvE,cAAc,EAAE,OAAO,CAAS;gBAEpB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO;IAMnD,0BAA0B,CACxB,MAAM,EAAE,gCAAgC,GACvC,OAAO,CAAC,gCAAgC,CAAC;CAI7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/twitter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/community-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"url": "https://github.com/Reya-Labs/reya-off-chain-monorepo.git"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@reyaxyz/common": "0.
|
|
14
|
-
"@reyaxyz/sdk": "0.66.
|
|
13
|
+
"@reyaxyz/common": "0.69.0",
|
|
14
|
+
"@reyaxyz/sdk": "0.66.2",
|
|
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": "0148531c86060de801845046185674855c0e51b0"
|
|
42
42
|
}
|
package/src/client/index.ts
CHANGED
|
@@ -26,12 +26,13 @@ export class CommunityClient {
|
|
|
26
26
|
CommunityClient.config.logging,
|
|
27
27
|
);
|
|
28
28
|
this._twitterModule = new TwitterModule(
|
|
29
|
-
CommunityClient.config.
|
|
30
|
-
CommunityClient.config.
|
|
31
|
-
|
|
29
|
+
CommunityClient.config.apiEndpoint,
|
|
30
|
+
CommunityClient.config.logging,
|
|
31
|
+
);
|
|
32
|
+
this._referralModule = new ReferralModule(
|
|
33
|
+
CommunityClient.config.apiEndpoint,
|
|
32
34
|
CommunityClient.config.logging,
|
|
33
35
|
);
|
|
34
|
-
this._referralModule = new ReferralModule(CommunityClient.config.logging);
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
public static configure(environment: ServiceConfig['environment']): void {
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './client';
|
|
2
|
-
export * from './modules/twitter/
|
|
2
|
+
export * from './modules/twitter/types';
|
|
3
3
|
export * from './modules/vote/types';
|
|
4
4
|
export * from './modules/lge/types';
|
|
5
|
-
export * from './modules/referral/
|
|
5
|
+
export * from './modules/referral/types';
|
package/src/modules/lge/index.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ClaimRankParams,
|
|
3
|
-
ClaimRankResult,
|
|
4
|
-
GetLeaderboardParams,
|
|
5
|
-
GetLeaderboardResult,
|
|
6
|
-
GetUserLeaderboardDataParams,
|
|
7
|
-
GetUserLeaderboardDataResult,
|
|
8
|
-
RestClient,
|
|
9
|
-
} from '@reyaxyz/common';
|
|
1
|
+
import { RestClient, Loggable, Logger } from '@reyaxyz/common';
|
|
10
2
|
|
|
11
3
|
import {
|
|
12
4
|
GenerateGameBoostRateParams,
|
|
@@ -17,10 +9,16 @@ import {
|
|
|
17
9
|
GetLGEBoostRateResult,
|
|
18
10
|
GetUserGameStatusParams,
|
|
19
11
|
GetUserGameStatusResult,
|
|
12
|
+
ClaimRankParams,
|
|
13
|
+
ClaimRankResult,
|
|
14
|
+
GetLeaderboardParams,
|
|
15
|
+
GetLeaderboardResult,
|
|
16
|
+
GetUserLeaderboardDataParams,
|
|
17
|
+
GetUserLeaderboardDataResult,
|
|
18
|
+
LockGameBoostRateParams,
|
|
19
|
+
LockGameBoostRateResult,
|
|
20
20
|
} from './types';
|
|
21
21
|
|
|
22
|
-
import { Loggable, Logger } from '@reyaxyz/common';
|
|
23
|
-
|
|
24
22
|
export default class LGEModule extends RestClient implements Loggable {
|
|
25
23
|
loggingEnabled: boolean = false;
|
|
26
24
|
|
|
@@ -90,4 +88,12 @@ export default class LGEModule extends RestClient implements Loggable {
|
|
|
90
88
|
const uri = `/api/xp/generate-game-boost-rate/${params.address}/${params.bodyId}`;
|
|
91
89
|
return this.get<GenerateGameBoostRateResult>(uri);
|
|
92
90
|
}
|
|
91
|
+
|
|
92
|
+
@Logger('LGEModule.lockGameBoostRate')
|
|
93
|
+
async lockGameBoostRate(
|
|
94
|
+
params: LockGameBoostRateParams,
|
|
95
|
+
): Promise<LockGameBoostRateResult> {
|
|
96
|
+
const uri = `/api/xp/lock-game-boost-rate/${params.address}`;
|
|
97
|
+
return this.get<LockGameBoostRateResult>(uri);
|
|
98
|
+
}
|
|
93
99
|
}
|
package/src/modules/lge/types.ts
CHANGED
|
@@ -1,18 +1,29 @@
|
|
|
1
|
+
import { Loggable, Logger, RestClient } from '@reyaxyz/common';
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
|
-
getWalletReferralDetails,
|
|
3
4
|
GetWalletReferralDetailsParams,
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
GetWalletReferralDetailsResult,
|
|
6
|
+
RegisterReferralParams,
|
|
7
|
+
RegisterReferralResult,
|
|
8
|
+
} from './types';
|
|
6
9
|
|
|
7
|
-
export default class
|
|
10
|
+
export default class LGEModule extends RestClient implements Loggable {
|
|
8
11
|
loggingEnabled: boolean = false;
|
|
9
12
|
|
|
10
|
-
constructor(loggingEnabled: boolean) {
|
|
13
|
+
constructor(apiUrl: string, loggingEnabled: boolean) {
|
|
14
|
+
super(apiUrl);
|
|
11
15
|
this.loggingEnabled = loggingEnabled;
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
@Logger('ReferralModule.getWalletReferralDetails')
|
|
15
19
|
async getWalletReferralDetails(params: GetWalletReferralDetailsParams) {
|
|
16
|
-
|
|
20
|
+
const uri = `/api/xp/get-referral-profile/${params.address}`;
|
|
21
|
+
return this.get<GetWalletReferralDetailsResult>(uri);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Logger('ReferralModule.registerReferral')
|
|
25
|
+
async registerReferral(params: RegisterReferralParams) {
|
|
26
|
+
const uri = `/api/xp/register-referral/${params.beneficiary}/${params.referral}`;
|
|
27
|
+
return this.get<RegisterReferralResult>(uri);
|
|
17
28
|
}
|
|
18
29
|
}
|
|
@@ -1,53 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Loggable, Logger, RestClient } from '@reyaxyz/common';
|
|
2
|
+
import {
|
|
3
|
+
GetLockGameBoostTwitterUrlResult,
|
|
4
|
+
GetLockGameBoostTwitterUrlParams,
|
|
5
|
+
} from './types';
|
|
3
6
|
|
|
4
|
-
export default class TwitterModule implements Loggable {
|
|
5
|
-
private getLockGameBoostTwitterApiURI: string;
|
|
6
|
-
private getShareReferralTwitterApiURI: string;
|
|
7
|
-
|
|
8
|
-
private twitterClientId: string;
|
|
7
|
+
export default class TwitterModule extends RestClient implements Loggable {
|
|
9
8
|
loggingEnabled: boolean = false;
|
|
10
9
|
|
|
11
|
-
constructor(
|
|
12
|
-
|
|
13
|
-
getShareReferralTwitterApiURI: string,
|
|
14
|
-
twitterClientId: string,
|
|
15
|
-
loggingEnabled: boolean,
|
|
16
|
-
) {
|
|
17
|
-
this.getLockGameBoostTwitterApiURI = getLockGameBoostTwitterApiURI;
|
|
18
|
-
this.getShareReferralTwitterApiURI = getShareReferralTwitterApiURI;
|
|
19
|
-
this.twitterClientId = twitterClientId;
|
|
10
|
+
constructor(apiUrl: string, loggingEnabled: boolean) {
|
|
11
|
+
super(apiUrl);
|
|
20
12
|
this.loggingEnabled = loggingEnabled;
|
|
21
13
|
}
|
|
22
14
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return 'NONE';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@Logger('TwitterModule.getLockGameBoostTwitterLink')
|
|
33
|
-
getLockGameBoostTwitterLink(
|
|
34
|
-
params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>,
|
|
35
|
-
): string {
|
|
36
|
-
return getTwitterOauthUrl({
|
|
37
|
-
...params,
|
|
38
|
-
redirectURI: this.getLockGameBoostTwitterApiURI,
|
|
39
|
-
twitterClientId: this.twitterClientId,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
@Logger('TwitterModule.getShareReferralTwitterLink')
|
|
44
|
-
getShareReferralTwitterLink(
|
|
45
|
-
params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>,
|
|
46
|
-
): string {
|
|
47
|
-
return getTwitterOauthUrl({
|
|
48
|
-
...params,
|
|
49
|
-
redirectURI: this.getShareReferralTwitterApiURI,
|
|
50
|
-
twitterClientId: this.twitterClientId,
|
|
51
|
-
});
|
|
15
|
+
@Logger('TwitterModule.getLockGameBoostTwitterURL')
|
|
16
|
+
getLockGameBoostTwitterURL(
|
|
17
|
+
params: GetLockGameBoostTwitterUrlParams,
|
|
18
|
+
): Promise<GetLockGameBoostTwitterUrlResult> {
|
|
19
|
+
const uri = `/api/twitter/lock-game-boost-twitter-url/${params.walletAddress}/${params.lockedInBoost}`;
|
|
20
|
+
return this.get<GetLockGameBoostTwitterUrlResult>(uri);
|
|
52
21
|
}
|
|
53
22
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getWalletReferralDetails = void 0;
|
|
4
|
-
// TODO: Costin fix implementation (PUBLIC)
|
|
5
|
-
function getWalletReferralDetails(_a) {
|
|
6
|
-
var address = _a.address;
|
|
7
|
-
return new Promise(function (resolve) {
|
|
8
|
-
return setTimeout(function () {
|
|
9
|
-
return resolve({
|
|
10
|
-
referralLink: "https://reya.network/".concat(address),
|
|
11
|
-
totalReferralXP: Math.random() * 100000,
|
|
12
|
-
totalReferralsCount: Math.random() * 1000,
|
|
13
|
-
});
|
|
14
|
-
}, Math.random() * 2000);
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
exports.getWalletReferralDetails = getWalletReferralDetails;
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/referral/services/get-wallet-referral-details/index.ts"],"names":[],"mappings":";;;AAKA,2CAA2C;AAC3C,SAAgB,wBAAwB,CAAC,EAER;QAD/B,OAAO,aAAA;IAEP,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO;QACzB,OAAA,UAAU,CACR;YACE,OAAA,OAAO,CAAC;gBACN,YAAY,EAAE,+BAAwB,OAAO,CAAE;gBAC/C,eAAe,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM;gBACvC,mBAAmB,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI;aAC1C,CAAC;QAJF,CAIE,EACJ,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CACrB;IARD,CAQC,CACF,CAAC;AACJ,CAAC;AAdD,4DAcC","sourcesContent":["import {\n GetWalletReferralDetailsParams,\n GetWalletReferralDetailsResult,\n} from './types';\n\n// TODO: Costin fix implementation (PUBLIC)\nexport function getWalletReferralDetails({\n address,\n}: GetWalletReferralDetailsParams): Promise<GetWalletReferralDetailsResult> {\n return new Promise((resolve) =>\n setTimeout(\n () =>\n resolve({\n referralLink: `https://reya.network/${address}`,\n totalReferralXP: Math.random() * 100000,\n totalReferralsCount: Math.random() * 1000,\n }),\n Math.random() * 2000,\n ),\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/referral/services/get-wallet-referral-details/types.ts"],"names":[],"mappings":"","sourcesContent":["export type GetWalletReferralDetailsParams = {\n address: string;\n};\n\nexport type GetWalletReferralDetailsResult = {\n referralLink: string;\n totalReferralsCount: number;\n totalReferralXP: number;\n};\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./get-wallet-referral-details"), exports);
|
|
18
|
-
__exportStar(require("./get-wallet-referral-details/types"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/referral/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C;AAC9C,sEAAoD","sourcesContent":["export * from './get-wallet-referral-details';\nexport * from './get-wallet-referral-details/types';\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTwitterOauthUrl = void 0;
|
|
4
|
-
var rootUrl = 'https://twitter.com/i/oauth2/authorize';
|
|
5
|
-
function getTwitterOauthUrl(_a) {
|
|
6
|
-
var walletAddress = _a.walletAddress, twitterClientId = _a.twitterClientId, redirectURI = _a.redirectURI;
|
|
7
|
-
var options = {
|
|
8
|
-
redirect_uri: redirectURI,
|
|
9
|
-
client_id: twitterClientId,
|
|
10
|
-
state: JSON.stringify({ walletAddress: walletAddress }),
|
|
11
|
-
response_type: 'code',
|
|
12
|
-
code_challenge: 'challenge',
|
|
13
|
-
code_challenge_method: 'plain',
|
|
14
|
-
scope: ['users.read', 'tweet.write', 'tweet.read', 'follows.read'].join(' '),
|
|
15
|
-
};
|
|
16
|
-
var qs = new URLSearchParams(options).toString();
|
|
17
|
-
return "".concat(rootUrl, "?").concat(qs);
|
|
18
|
-
}
|
|
19
|
-
exports.getTwitterOauthUrl = getTwitterOauthUrl;
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/twitter/services/get-auth-url/index.ts"],"names":[],"mappings":";;;AAEA,IAAM,OAAO,GAAW,wCAAwC,CAAC;AAEjE,SAAgB,kBAAkB,CAAC,EAIR;QAHzB,aAAa,mBAAA,EACb,eAAe,qBAAA,EACf,WAAW,iBAAA;IAEX,IAAM,OAAO,GAAG;QACd,YAAY,EAAE,WAAW;QACzB,SAAS,EAAE,eAAe;QAC1B,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,aAAa,eAAA,EAAE,CAAC;QACxC,aAAa,EAAE,MAAM;QACrB,cAAc,EAAE,WAAW;QAC3B,qBAAqB,EAAE,OAAO;QAC9B,KAAK,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC,IAAI,CACrE,GAAG,CACJ;KACF,CAAC;IACF,IAAM,EAAE,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;IACnD,OAAO,UAAG,OAAO,cAAI,EAAE,CAAE,CAAC;AAC5B,CAAC;AAlBD,gDAkBC","sourcesContent":["import { GetTwitterOauthUrlParams } from './types';\n\nconst rootUrl: string = 'https://twitter.com/i/oauth2/authorize';\n\nexport function getTwitterOauthUrl({\n walletAddress,\n twitterClientId,\n redirectURI,\n}: GetTwitterOauthUrlParams): string {\n const options = {\n redirect_uri: redirectURI,\n client_id: twitterClientId,\n state: JSON.stringify({ walletAddress }),\n response_type: 'code',\n code_challenge: 'challenge',\n code_challenge_method: 'plain',\n scope: ['users.read', 'tweet.write', 'tweet.read', 'follows.read'].join(\n ' ',\n ),\n };\n const qs = new URLSearchParams(options).toString();\n return `${rootUrl}?${qs}`;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/twitter/services/get-auth-url/types.ts"],"names":[],"mappings":"","sourcesContent":["export type GetTwitterOauthUrlParams = {\n walletAddress: string;\n twitterClientId: string;\n redirectURI: string;\n};\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./get-auth-url"), exports);
|
|
18
|
-
__exportStar(require("./get-auth-url/types"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/twitter/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC","sourcesContent":["export * from './get-auth-url';\nexport * from './get-auth-url/types';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/referral/services/get-wallet-referral-details/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,SAAS,CAAC;AAGjB,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,GACR,EAAE,8BAA8B,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAY1E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/referral/services/get-wallet-referral-details/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,8BAA8B,GAAG;IAC3C,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/referral/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/twitter/services/get-auth-url/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAInD,wBAAgB,kBAAkB,CAAC,EACjC,aAAa,EACb,eAAe,EACf,WAAW,GACZ,EAAE,wBAAwB,GAAG,MAAM,CAcnC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/twitter/services/get-auth-url/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/twitter/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GetWalletReferralDetailsParams,
|
|
3
|
-
GetWalletReferralDetailsResult,
|
|
4
|
-
} from './types';
|
|
5
|
-
|
|
6
|
-
// TODO: Costin fix implementation (PUBLIC)
|
|
7
|
-
export function getWalletReferralDetails({
|
|
8
|
-
address,
|
|
9
|
-
}: GetWalletReferralDetailsParams): Promise<GetWalletReferralDetailsResult> {
|
|
10
|
-
return new Promise((resolve) =>
|
|
11
|
-
setTimeout(
|
|
12
|
-
() =>
|
|
13
|
-
resolve({
|
|
14
|
-
referralLink: `https://reya.network/${address}`,
|
|
15
|
-
totalReferralXP: Math.random() * 100000,
|
|
16
|
-
totalReferralsCount: Math.random() * 1000,
|
|
17
|
-
}),
|
|
18
|
-
Math.random() * 2000,
|
|
19
|
-
),
|
|
20
|
-
);
|
|
21
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { GetTwitterOauthUrlParams } from './types';
|
|
2
|
-
|
|
3
|
-
const rootUrl: string = 'https://twitter.com/i/oauth2/authorize';
|
|
4
|
-
|
|
5
|
-
export function getTwitterOauthUrl({
|
|
6
|
-
walletAddress,
|
|
7
|
-
twitterClientId,
|
|
8
|
-
redirectURI,
|
|
9
|
-
}: GetTwitterOauthUrlParams): string {
|
|
10
|
-
const options = {
|
|
11
|
-
redirect_uri: redirectURI,
|
|
12
|
-
client_id: twitterClientId,
|
|
13
|
-
state: JSON.stringify({ walletAddress }),
|
|
14
|
-
response_type: 'code',
|
|
15
|
-
code_challenge: 'challenge',
|
|
16
|
-
code_challenge_method: 'plain',
|
|
17
|
-
scope: ['users.read', 'tweet.write', 'tweet.read', 'follows.read'].join(
|
|
18
|
-
' ',
|
|
19
|
-
),
|
|
20
|
-
};
|
|
21
|
-
const qs = new URLSearchParams(options).toString();
|
|
22
|
-
return `${rootUrl}?${qs}`;
|
|
23
|
-
}
|
|
File without changes
|
|
File without changes
|