@reyaxyz/community-sdk 0.12.0 → 0.13.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.
Files changed (43) hide show
  1. package/dist/client/index.js +1 -1
  2. package/dist/client/index.js.map +1 -1
  3. package/dist/index.js +1 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/modules/lge/index.js +29 -8
  6. package/dist/modules/lge/index.js.map +1 -1
  7. package/dist/modules/lge/types.js.map +1 -0
  8. package/dist/types/index.d.ts +1 -2
  9. package/dist/types/index.d.ts.map +1 -1
  10. package/dist/types/modules/lge/index.d.ts +5 -7
  11. package/dist/types/modules/lge/index.d.ts.map +1 -1
  12. package/dist/types/modules/lge/types.d.ts +2 -0
  13. package/dist/types/modules/lge/types.d.ts.map +1 -0
  14. package/package.json +4 -4
  15. package/src/client/index.ts +1 -1
  16. package/src/index.ts +1 -2
  17. package/src/modules/lge/index.ts +11 -14
  18. package/src/modules/lge/types.ts +6 -0
  19. package/dist/modules/lge/services/get-account-lge-status/index.js +0 -72
  20. package/dist/modules/lge/services/get-account-lge-status/index.js.map +0 -1
  21. package/dist/modules/lge/services/get-account-lge-status/types.js.map +0 -1
  22. package/dist/modules/lge/services/get-lge-boost-rate/index.js +0 -59
  23. package/dist/modules/lge/services/get-lge-boost-rate/index.js.map +0 -1
  24. package/dist/modules/lge/services/get-lge-boost-rate/types.js +0 -3
  25. package/dist/modules/lge/services/get-lge-boost-rate/types.js.map +0 -1
  26. package/dist/modules/lge/services/index.js +0 -21
  27. package/dist/modules/lge/services/index.js.map +0 -1
  28. package/dist/types/modules/lge/services/get-account-lge-status/index.d.ts +0 -3
  29. package/dist/types/modules/lge/services/get-account-lge-status/index.d.ts.map +0 -1
  30. package/dist/types/modules/lge/services/get-account-lge-status/types.d.ts +0 -14
  31. package/dist/types/modules/lge/services/get-account-lge-status/types.d.ts.map +0 -1
  32. package/dist/types/modules/lge/services/get-lge-boost-rate/index.d.ts +0 -3
  33. package/dist/types/modules/lge/services/get-lge-boost-rate/index.d.ts.map +0 -1
  34. package/dist/types/modules/lge/services/get-lge-boost-rate/types.d.ts +0 -3
  35. package/dist/types/modules/lge/services/get-lge-boost-rate/types.d.ts.map +0 -1
  36. package/dist/types/modules/lge/services/index.d.ts +0 -5
  37. package/dist/types/modules/lge/services/index.d.ts.map +0 -1
  38. package/src/modules/lge/services/get-account-lge-status/index.ts +0 -33
  39. package/src/modules/lge/services/get-account-lge-status/types.ts +0 -15
  40. package/src/modules/lge/services/get-lge-boost-rate/index.ts +0 -20
  41. package/src/modules/lge/services/get-lge-boost-rate/types.ts +0 -2
  42. package/src/modules/lge/services/index.ts +0 -4
  43. /package/dist/modules/lge/{services/get-account-lge-status/types.js → types.js} +0 -0
@@ -15,7 +15,7 @@ var trading_league_1 = __importDefault(require("../modules/trading-league"));
15
15
  var CommunityClient = /** @class */ (function () {
16
16
  function CommunityClient() {
17
17
  this._vote = new vote_1.default(CommunityClient.config.apiEndpoint);
18
- this._LGE = new lge_1.default(CommunityClient.config.chain);
18
+ this._LGE = new lge_1.default(CommunityClient.config.apiEndpoint);
19
19
  this._twitter = new twitter_1.default(CommunityClient.config.twitter.redirectURI, CommunityClient.config.twitter.clientId);
20
20
  this._tradingLeague = new trading_league_1.default();
21
21
  }
@@ -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,6EAA4D;AAE5D;;GAEG;AACH;IASE;QACE,IAAI,CAAC,KAAK,GAAG,IAAI,cAAU,CAAC,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAChE,IAAI,CAAC,IAAI,GAAG,IAAI,aAAS,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACxD,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAa,CAC/B,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAC1C,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CACxC,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,IAAI,wBAAmB,EAAE,CAAC;IAClD,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,KAAK,CAAC;QAC7C,CAAC;;;OAAA;IASD,sBAAkB,sBAAG;QAPrB;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC;QAC5C,CAAC;;;OAAA;IASD,sBAAkB,0BAAO;QAPzB;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;QAChD,CAAC;;;OAAA;IASD,sBAAkB,gCAAa;QAP/B;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC;QACtD,CAAC;;;OAAA;IAED,sBAAkB,iCAAc;aAAhC;YACE,OAAO,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC;QACtC,CAAC;;;OAAA;IA9Ec,sBAAM,GAAkB,2BAAkB,CAAC,MAAM,CAAC,CAAC;IA+EpE,sBAAC;CAAA,AAjFD,IAiFC;AAjFY,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 TradingLeagueModule from '../modules/trading-league';\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 _vote: VoteModule;\n private readonly _LGE: LGEModule;\n private readonly _twitter: TwitterModule;\n private readonly _tradingLeague: TradingLeagueModule;\n\n private constructor() {\n this._vote = new VoteModule(CommunityClient.config.apiEndpoint);\n this._LGE = new LGEModule(CommunityClient.config.chain);\n this._twitter = new TwitterModule(\n CommunityClient.config.twitter.redirectURI,\n CommunityClient.config.twitter.clientId,\n );\n this._tradingLeague = new TradingLeagueModule();\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()._vote;\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()._LGE;\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()._twitter;\n }\n\n /**\n * Provides access to the TradingLeagueModule instance.\n * This getter allows for interacting with trading-league-related functionalities.\n *\n * @returns {TradingLeagueModule} An instance of Trading League for twitter operations.\n * @memberof CommunityClient\n */\n public static get tradingLeague(): TradingLeagueModule {\n return CommunityClient.getInstance()._tradingLeague;\n }\n\n public static get supportedChain(): number {\n return CommunityClient.config.chain;\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAoE;AACpE,yDAAyC;AACzC,uDAAuC;AACvC,+DAA+C;AAC/C,6EAA4D;AAE5D;;GAEG;AACH;IASE;QACE,IAAI,CAAC,KAAK,GAAG,IAAI,cAAU,CAAC,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAChE,IAAI,CAAC,IAAI,GAAG,IAAI,aAAS,CAAC,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC9D,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAa,CAC/B,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAC1C,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CACxC,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,IAAI,wBAAmB,EAAE,CAAC;IAClD,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,KAAK,CAAC;QAC7C,CAAC;;;OAAA;IASD,sBAAkB,sBAAG;QAPrB;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC;QAC5C,CAAC;;;OAAA;IASD,sBAAkB,0BAAO;QAPzB;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;QAChD,CAAC;;;OAAA;IASD,sBAAkB,gCAAa;QAP/B;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC;QACtD,CAAC;;;OAAA;IAED,sBAAkB,iCAAc;aAAhC;YACE,OAAO,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC;QACtC,CAAC;;;OAAA;IA9Ec,sBAAM,GAAkB,2BAAkB,CAAC,MAAM,CAAC,CAAC;IA+EpE,sBAAC;CAAA,AAjFD,IAiFC;AAjFY,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 TradingLeagueModule from '../modules/trading-league';\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 _vote: VoteModule;\n private readonly _LGE: LGEModule;\n private readonly _twitter: TwitterModule;\n private readonly _tradingLeague: TradingLeagueModule;\n\n private constructor() {\n this._vote = new VoteModule(CommunityClient.config.apiEndpoint);\n this._LGE = new LGEModule(CommunityClient.config.apiEndpoint);\n this._twitter = new TwitterModule(\n CommunityClient.config.twitter.redirectURI,\n CommunityClient.config.twitter.clientId,\n );\n this._tradingLeague = new TradingLeagueModule();\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()._vote;\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()._LGE;\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()._twitter;\n }\n\n /**\n * Provides access to the TradingLeagueModule instance.\n * This getter allows for interacting with trading-league-related functionalities.\n *\n * @returns {TradingLeagueModule} An instance of Trading League for twitter operations.\n * @memberof CommunityClient\n */\n public static get tradingLeague(): TradingLeagueModule {\n return CommunityClient.getInstance()._tradingLeague;\n }\n\n public static get supportedChain(): number {\n return CommunityClient.config.chain;\n }\n}\n"]}
package/dist/index.js CHANGED
@@ -15,10 +15,9 @@ 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/lge/services/get-account-lge-status/types"), exports);
19
- __exportStar(require("./modules/lge/services/get-lge-boost-rate/types"), exports);
20
18
  __exportStar(require("./modules/twitter/services/get-auth-url/types"), exports);
21
19
  __exportStar(require("./modules/vote/types"), exports);
20
+ __exportStar(require("./modules/lge/types"), exports);
22
21
  __exportStar(require("./modules/trading-league/services/get-leaderboard/types"), exports);
23
22
  __exportStar(require("./modules/trading-league/services/get-user-leaderboard-data/types"), exports);
24
23
  //# 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,sFAAoE;AACpE,kFAAgE;AAChE,gFAA8D;AAC9D,uDAAqC;AACrC,0FAAwE;AACxE,oGAAkF","sourcesContent":["export * from './client';\nexport * from './modules/lge/services/get-account-lge-status/types';\nexport * from './modules/lge/services/get-lge-boost-rate/types';\nexport * from './modules/twitter/services/get-auth-url/types';\nexport * from './modules/vote/types';\nexport * from './modules/trading-league/services/get-leaderboard/types';\nexport * from './modules/trading-league/services/get-user-leaderboard-data/types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,gFAA8D;AAC9D,uDAAqC;AACrC,sDAAoC;AACpC,0FAAwE;AACxE,oGAAkF","sourcesContent":["export * from './client';\nexport * from './modules/twitter/services/get-auth-url/types';\nexport * from './modules/vote/types';\nexport * from './modules/lge/types';\nexport * from './modules/trading-league/services/get-leaderboard/types';\nexport * from './modules/trading-league/services/get-user-leaderboard-data/types';\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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
18
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
19
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -36,26 +51,32 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
51
  }
37
52
  };
38
53
  Object.defineProperty(exports, "__esModule", { value: true });
39
- var services_1 = require("./services");
40
- var LGEModule = /** @class */ (function () {
41
- function LGEModule(chainId) {
42
- this.chainId = chainId;
54
+ var common_1 = require("@reyaxyz/common");
55
+ var LGEModule = /** @class */ (function (_super) {
56
+ __extends(LGEModule, _super);
57
+ function LGEModule() {
58
+ return _super !== null && _super.apply(this, arguments) || this;
43
59
  }
44
- LGEModule.prototype.getLGEBoostRate = function (params) {
60
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
61
+ LGEModule.prototype.getLGEBoostRate = function (_) {
45
62
  return __awaiter(this, void 0, void 0, function () {
63
+ var uri;
46
64
  return __generator(this, function (_a) {
47
- return [2 /*return*/, (0, services_1.getLGEBoostRate)(params)];
65
+ uri = "/api/xp/lp-xp-boost";
66
+ return [2 /*return*/, this.get(uri)];
48
67
  });
49
68
  });
50
69
  };
51
70
  LGEModule.prototype.getAccountLGEStatus = function (params) {
52
71
  return __awaiter(this, void 0, void 0, function () {
72
+ var uri;
53
73
  return __generator(this, function (_a) {
54
- return [2 /*return*/, (0, services_1.getAccountLGEStatus)(params)];
74
+ uri = "/api/xp/lp-profile/".concat(params.address);
75
+ return [2 /*return*/, this.get(uri)];
55
76
  });
56
77
  });
57
78
  };
58
79
  return LGEModule;
59
- }());
80
+ }(common_1.RestClient));
60
81
  exports.default = LGEModule;
61
82
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uCAKoB;AAEpB;IAGE,mBAAY,OAAoB;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEK,mCAAe,GAArB,UAAsB,MAA6B;;;gBACjD,sBAAO,IAAA,0BAAe,EAAC,MAAM,CAAC,EAAC;;;KAChC;IAEK,uCAAmB,GAAzB,UAA0B,MAAiC;;;gBACzD,sBAAO,IAAA,8BAAmB,EAAC,MAAM,CAAC,EAAC;;;KACpC;IACH,gBAAC;AAAD,CAAC,AAdD,IAcC","sourcesContent":["import { ReyaChainId } from '@reyaxyz/common';\nimport {\n getAccountLGEStatus,\n GetAccountLGEStatusParams,\n getLGEBoostRate,\n GetLGEBoostRateParams,\n} from './services';\n\nexport default class LGEModule {\n private chainId: ReyaChainId;\n\n constructor(chainId: ReyaChainId) {\n this.chainId = chainId;\n }\n\n async getLGEBoostRate(params: GetLGEBoostRateParams) {\n return getLGEBoostRate(params);\n }\n\n async getAccountLGEStatus(params: GetAccountLGEStatusParams) {\n return getAccountLGEStatus(params);\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA6C;AAQ7C;IAAuC,6BAAU;IAAjD;;IAWA,CAAC;IAVC,6DAA6D;IACvD,mCAAe,GAArB,UAAsB,CAAwB;;;;gBACtC,GAAG,GAAG,qBAAqB,CAAC;gBAClC,sBAAO,IAAI,CAAC,GAAG,CAAwB,GAAG,CAAC,EAAC;;;KAC7C;IAEK,uCAAmB,GAAzB,UAA0B,MAAiC;;;;gBACnD,GAAG,GAAG,6BAAsB,MAAM,CAAC,OAAO,CAAE,CAAC;gBACnD,sBAAO,IAAI,CAAC,GAAG,CAA4B,GAAG,CAAC,EAAC;;;KACjD;IACH,gBAAC;AAAD,CAAC,AAXD,CAAuC,mBAAU,GAWhD","sourcesContent":["import { RestClient } from '@reyaxyz/common';\nimport {\n GetAccountLGEStatusParams,\n GetAccountLGEStatusResult,\n GetLGEBoostRateParams,\n GetLGEBoostRateResult,\n} from './types';\n\nexport default class LGEModule extends RestClient {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async getLGEBoostRate(_: GetLGEBoostRateParams) {\n const uri = `/api/xp/lp-xp-boost`;\n return this.get<GetLGEBoostRateResult>(uri);\n }\n\n async getAccountLGEStatus(params: GetAccountLGEStatusParams) {\n const uri = `/api/xp/lp-profile/${params.address}`;\n return this.get<GetAccountLGEStatusResult>(uri);\n }\n}\n"]}
@@ -0,0 +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} from '@reyaxyz/common';\n"]}
@@ -1,8 +1,7 @@
1
1
  export * from './client';
2
- export * from './modules/lge/services/get-account-lge-status/types';
3
- export * from './modules/lge/services/get-lge-boost-rate/types';
4
2
  export * from './modules/twitter/services/get-auth-url/types';
5
3
  export * from './modules/vote/types';
4
+ export * from './modules/lge/types';
6
5
  export * from './modules/trading-league/services/get-leaderboard/types';
7
6
  export * from './modules/trading-league/services/get-user-leaderboard-data/types';
8
7
  //# 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,qDAAqD,CAAC;AACpE,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,sBAAsB,CAAC;AACrC,cAAc,yDAAyD,CAAC;AACxE,cAAc,mEAAmE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,+CAA+C,CAAC;AAC9D,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yDAAyD,CAAC;AACxE,cAAc,mEAAmE,CAAC"}
@@ -1,9 +1,7 @@
1
- import { ReyaChainId } from '@reyaxyz/common';
2
- import { GetAccountLGEStatusParams, GetLGEBoostRateParams } from './services';
3
- export default class LGEModule {
4
- private chainId;
5
- constructor(chainId: ReyaChainId);
6
- getLGEBoostRate(params: GetLGEBoostRateParams): Promise<number>;
7
- getAccountLGEStatus(params: GetAccountLGEStatusParams): Promise<import("./services").GetAccountLGEStatusResult>;
1
+ import { RestClient } from '@reyaxyz/common';
2
+ import { GetAccountLGEStatusParams, GetAccountLGEStatusResult, GetLGEBoostRateParams } from './types';
3
+ export default class LGEModule extends RestClient {
4
+ getLGEBoostRate(_: GetLGEBoostRateParams): Promise<number>;
5
+ getAccountLGEStatus(params: GetAccountLGEStatusParams): Promise<GetAccountLGEStatusResult>;
8
6
  }
9
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAEL,yBAAyB,EAEzB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,OAAO,CAAC,OAAO,CAAc;gBAEjB,OAAO,EAAE,WAAW;IAI1B,eAAe,CAAC,MAAM,EAAE,qBAAqB;IAI7C,mBAAmB,CAAC,MAAM,EAAE,yBAAyB;CAG5D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EAEtB,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAU;IAEzC,eAAe,CAAC,CAAC,EAAE,qBAAqB;IAKxC,mBAAmB,CAAC,MAAM,EAAE,yBAAyB;CAI5D"}
@@ -0,0 +1,2 @@
1
+ export { GetAccountLGEStatusParams, GetAccountLGEStatusResult, GetLGEBoostRateParams, GetLGEBoostRateResult, } from '@reyaxyz/common';
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +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,GACtB,MAAM,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/community-sdk",
3
- "version": "0.12.0",
3
+ "version": "0.13.1",
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.41.0",
14
- "@reyaxyz/sdk": "0.32.3",
13
+ "@reyaxyz/common": "0.42.0",
14
+ "@reyaxyz/sdk": "0.32.4",
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": "bc68b5e03fb0fa634e0f4b41ec26bacf14cabf5a"
41
+ "gitHead": "d9441d9e3b4e3b2ad907a6733ef3d83dbd6e17e0"
42
42
  }
@@ -18,7 +18,7 @@ export class CommunityClient {
18
18
 
19
19
  private constructor() {
20
20
  this._vote = new VoteModule(CommunityClient.config.apiEndpoint);
21
- this._LGE = new LGEModule(CommunityClient.config.chain);
21
+ this._LGE = new LGEModule(CommunityClient.config.apiEndpoint);
22
22
  this._twitter = new TwitterModule(
23
23
  CommunityClient.config.twitter.redirectURI,
24
24
  CommunityClient.config.twitter.clientId,
package/src/index.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export * from './client';
2
- export * from './modules/lge/services/get-account-lge-status/types';
3
- export * from './modules/lge/services/get-lge-boost-rate/types';
4
2
  export * from './modules/twitter/services/get-auth-url/types';
5
3
  export * from './modules/vote/types';
4
+ export * from './modules/lge/types';
6
5
  export * from './modules/trading-league/services/get-leaderboard/types';
7
6
  export * from './modules/trading-league/services/get-user-leaderboard-data/types';
@@ -1,23 +1,20 @@
1
- import { ReyaChainId } from '@reyaxyz/common';
1
+ import { RestClient } from '@reyaxyz/common';
2
2
  import {
3
- getAccountLGEStatus,
4
3
  GetAccountLGEStatusParams,
5
- getLGEBoostRate,
4
+ GetAccountLGEStatusResult,
6
5
  GetLGEBoostRateParams,
7
- } from './services';
6
+ GetLGEBoostRateResult,
7
+ } from './types';
8
8
 
9
- export default class LGEModule {
10
- private chainId: ReyaChainId;
11
-
12
- constructor(chainId: ReyaChainId) {
13
- this.chainId = chainId;
14
- }
15
-
16
- async getLGEBoostRate(params: GetLGEBoostRateParams) {
17
- return getLGEBoostRate(params);
9
+ export default class LGEModule extends RestClient {
10
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+ async getLGEBoostRate(_: GetLGEBoostRateParams) {
12
+ const uri = `/api/xp/lp-xp-boost`;
13
+ return this.get<GetLGEBoostRateResult>(uri);
18
14
  }
19
15
 
20
16
  async getAccountLGEStatus(params: GetAccountLGEStatusParams) {
21
- return getAccountLGEStatus(params);
17
+ const uri = `/api/xp/lp-profile/${params.address}`;
18
+ return this.get<GetAccountLGEStatusResult>(uri);
22
19
  }
23
20
  }
@@ -0,0 +1,6 @@
1
+ export {
2
+ GetAccountLGEStatusParams,
3
+ GetAccountLGEStatusResult,
4
+ GetLGEBoostRateParams,
5
+ GetLGEBoostRateResult,
6
+ } from '@reyaxyz/common';
@@ -1,72 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.getAccountLGEStatus = void 0;
40
- // TODO: Costin write proper logic here
41
- function mockAccountLGEStatus() {
42
- return {
43
- currentBoost: Math.random() * 100,
44
- deposited: Math.floor(Math.random() * 10000) + 1000,
45
- xp: {
46
- value: Math.floor(Math.random() * 100) + 1000,
47
- valueTimestampMilliseconds: Date.now().valueOf() - 1000 * 5,
48
- rate: 0.03,
49
- },
50
- };
51
- }
52
- // TODO: Write proper implementation
53
- var getAccountLGEStatus = function (
54
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
55
- _) { return __awaiter(void 0, void 0, void 0, function () {
56
- return __generator(this, function (_a) {
57
- switch (_a.label) {
58
- case 0: return [4 /*yield*/, new Promise(function (resolve, reject) {
59
- setTimeout(function () {
60
- var error = Math.random() * 100 > 50;
61
- if (error) {
62
- reject(new Error('getAccountLGEStatus error'));
63
- }
64
- resolve(mockAccountLGEStatus());
65
- }, Math.random() * 100 + 1000);
66
- })];
67
- case 1: return [2 /*return*/, _a.sent()];
68
- }
69
- });
70
- }); };
71
- exports.getAccountLGEStatus = getAccountLGEStatus;
72
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/lge/services/get-account-lge-status/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,uCAAuC;AACvC,SAAS,oBAAoB;IAC3B,OAAO;QACL,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG;QACjC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,IAAI;QACnD,EAAE,EAAE;YACF,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,IAAI;YAC7C,0BAA0B,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,CAAC;YAC3D,IAAI,EAAE,IAAI;SACX;KACF,CAAC;AACJ,CAAC;AAED,oCAAoC;AAC7B,IAAM,mBAAmB,GAAG;AACjC,6DAA6D;AAC7D,CAA4B;;;oBAErB,qBAAM,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;oBACvC,UAAU,CACR;wBACE,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC;wBACvC,IAAI,KAAK,EAAE,CAAC;4BACV,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;wBACjD,CAAC;wBACD,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;oBAClC,CAAC,EACD,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,IAAI,CAC3B,CAAC;gBACJ,CAAC,CAAC,EAAA;oBAXF,sBAAO,SAWL,EAAC;;;KACJ,CAAC;AAhBW,QAAA,mBAAmB,uBAgB9B","sourcesContent":["import { GetAccountLGEStatusParams, GetAccountLGEStatusResult } from './types';\n\n// TODO: Costin write proper logic here\nfunction mockAccountLGEStatus(): GetAccountLGEStatusResult {\n return {\n currentBoost: Math.random() * 100,\n deposited: Math.floor(Math.random() * 10000) + 1000,\n xp: {\n value: Math.floor(Math.random() * 100) + 1000,\n valueTimestampMilliseconds: Date.now().valueOf() - 1000 * 5,\n rate: 0.03,\n },\n };\n}\n\n// TODO: Write proper implementation\nexport const getAccountLGEStatus = async (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _: GetAccountLGEStatusParams,\n): Promise<GetAccountLGEStatusResult> => {\n return await new Promise((resolve, reject) => {\n setTimeout(\n () => {\n const error = Math.random() * 100 > 50;\n if (error) {\n reject(new Error('getAccountLGEStatus error'));\n }\n resolve(mockAccountLGEStatus());\n },\n Math.random() * 100 + 1000,\n );\n });\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/lge/services/get-account-lge-status/types.ts"],"names":[],"mappings":"","sourcesContent":["export type GetAccountLGEStatusParams = {\n address: string; // wallet address\n};\n\nexport type XPEntity = {\n value: number;\n valueTimestampMilliseconds: number;\n rate: number;\n};\n\nexport type GetAccountLGEStatusResult = {\n xp: XPEntity;\n currentBoost: number;\n deposited: number;\n};\n"]}
@@ -1,59 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.getLGEBoostRate = void 0;
40
- function mockLGEBoostRate() {
41
- return Math.floor(Math.random() * 1000);
42
- }
43
- // TODO: Write proper implementation
44
- var getLGEBoostRate = function (
45
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
46
- _) { return __awaiter(void 0, void 0, void 0, function () {
47
- return __generator(this, function (_a) {
48
- switch (_a.label) {
49
- case 0: return [4 /*yield*/, new Promise(function (resolve) {
50
- setTimeout(function () {
51
- resolve(mockLGEBoostRate());
52
- }, Math.random() * 100 + 1000);
53
- })];
54
- case 1: return [2 /*return*/, _a.sent()];
55
- }
56
- });
57
- }); };
58
- exports.getLGEBoostRate = getLGEBoostRate;
59
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/lge/services/get-lge-boost-rate/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,gBAAgB;IACvB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,oCAAoC;AAC7B,IAAM,eAAe,GAAG;AAC7B,6DAA6D;AAC7D,CAAwB;;;oBAEjB,qBAAM,IAAI,OAAO,CAAC,UAAC,OAAO;oBAC/B,UAAU,CACR;wBACE,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;oBAC9B,CAAC,EACD,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,IAAI,CAC3B,CAAC;gBACJ,CAAC,CAAC,EAAA;oBAPF,sBAAO,SAOL,EAAC;;;KACJ,CAAC;AAZW,QAAA,eAAe,mBAY1B","sourcesContent":["import { GetLGEBoostRateParams, GetLGEBoostRateResult } from './types';\n\nfunction mockLGEBoostRate(): GetLGEBoostRateResult {\n return Math.floor(Math.random() * 1000);\n}\n\n// TODO: Write proper implementation\nexport const getLGEBoostRate = async (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _: GetLGEBoostRateParams,\n): Promise<GetLGEBoostRateResult> => {\n return await new Promise((resolve) => {\n setTimeout(\n () => {\n resolve(mockLGEBoostRate());\n },\n Math.random() * 100 + 1000,\n );\n });\n};\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/lge/services/get-lge-boost-rate/types.ts"],"names":[],"mappings":"","sourcesContent":["export type GetLGEBoostRateParams = void;\nexport type GetLGEBoostRateResult = number;\n"]}
@@ -1,21 +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-lge-boost-rate"), exports);
18
- __exportStar(require("./get-account-lge-status"), exports);
19
- __exportStar(require("./get-account-lge-status/types"), exports);
20
- __exportStar(require("./get-lge-boost-rate/types"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/lge/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,2DAAyC;AACzC,iEAA+C;AAC/C,6DAA2C","sourcesContent":["export * from './get-lge-boost-rate';\nexport * from './get-account-lge-status';\nexport * from './get-account-lge-status/types';\nexport * from './get-lge-boost-rate/types';\n"]}
@@ -1,3 +0,0 @@
1
- import { GetAccountLGEStatusParams, GetAccountLGEStatusResult } from './types';
2
- export declare const getAccountLGEStatus: (_: GetAccountLGEStatusParams) => Promise<GetAccountLGEStatusResult>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/lge/services/get-account-lge-status/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAgB/E,eAAO,MAAM,mBAAmB,MAE3B,yBAAyB,KAC3B,QAAQ,yBAAyB,CAanC,CAAC"}
@@ -1,14 +0,0 @@
1
- export type GetAccountLGEStatusParams = {
2
- address: string;
3
- };
4
- export type XPEntity = {
5
- value: number;
6
- valueTimestampMilliseconds: number;
7
- rate: number;
8
- };
9
- export type GetAccountLGEStatusResult = {
10
- xp: XPEntity;
11
- currentBoost: number;
12
- deposited: number;
13
- };
14
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/lge/services/get-account-lge-status/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B,EAAE,MAAM,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,EAAE,EAAE,QAAQ,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -1,3 +0,0 @@
1
- import { GetLGEBoostRateParams, GetLGEBoostRateResult } from './types';
2
- export declare const getLGEBoostRate: (_: GetLGEBoostRateParams) => Promise<GetLGEBoostRateResult>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/lge/services/get-lge-boost-rate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAOvE,eAAO,MAAM,eAAe,MAEvB,qBAAqB,KACvB,QAAQ,qBAAqB,CAS/B,CAAC"}
@@ -1,3 +0,0 @@
1
- export type GetLGEBoostRateParams = void;
2
- export type GetLGEBoostRateResult = number;
3
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/lge/services/get-lge-boost-rate/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACzC,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC"}
@@ -1,5 +0,0 @@
1
- export * from './get-lge-boost-rate';
2
- export * from './get-account-lge-status';
3
- export * from './get-account-lge-status/types';
4
- export * from './get-lge-boost-rate/types';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/lge/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC"}
@@ -1,33 +0,0 @@
1
- import { GetAccountLGEStatusParams, GetAccountLGEStatusResult } from './types';
2
-
3
- // TODO: Costin write proper logic here
4
- function mockAccountLGEStatus(): GetAccountLGEStatusResult {
5
- return {
6
- currentBoost: Math.random() * 100,
7
- deposited: Math.floor(Math.random() * 10000) + 1000,
8
- xp: {
9
- value: Math.floor(Math.random() * 100) + 1000,
10
- valueTimestampMilliseconds: Date.now().valueOf() - 1000 * 5,
11
- rate: 0.03,
12
- },
13
- };
14
- }
15
-
16
- // TODO: Write proper implementation
17
- export const getAccountLGEStatus = async (
18
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
19
- _: GetAccountLGEStatusParams,
20
- ): Promise<GetAccountLGEStatusResult> => {
21
- return await new Promise((resolve, reject) => {
22
- setTimeout(
23
- () => {
24
- const error = Math.random() * 100 > 50;
25
- if (error) {
26
- reject(new Error('getAccountLGEStatus error'));
27
- }
28
- resolve(mockAccountLGEStatus());
29
- },
30
- Math.random() * 100 + 1000,
31
- );
32
- });
33
- };
@@ -1,15 +0,0 @@
1
- export type GetAccountLGEStatusParams = {
2
- address: string; // wallet address
3
- };
4
-
5
- export type XPEntity = {
6
- value: number;
7
- valueTimestampMilliseconds: number;
8
- rate: number;
9
- };
10
-
11
- export type GetAccountLGEStatusResult = {
12
- xp: XPEntity;
13
- currentBoost: number;
14
- deposited: number;
15
- };
@@ -1,20 +0,0 @@
1
- import { GetLGEBoostRateParams, GetLGEBoostRateResult } from './types';
2
-
3
- function mockLGEBoostRate(): GetLGEBoostRateResult {
4
- return Math.floor(Math.random() * 1000);
5
- }
6
-
7
- // TODO: Write proper implementation
8
- export const getLGEBoostRate = async (
9
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
- _: GetLGEBoostRateParams,
11
- ): Promise<GetLGEBoostRateResult> => {
12
- return await new Promise((resolve) => {
13
- setTimeout(
14
- () => {
15
- resolve(mockLGEBoostRate());
16
- },
17
- Math.random() * 100 + 1000,
18
- );
19
- });
20
- };
@@ -1,2 +0,0 @@
1
- export type GetLGEBoostRateParams = void;
2
- export type GetLGEBoostRateResult = number;
@@ -1,4 +0,0 @@
1
- export * from './get-lge-boost-rate';
2
- export * from './get-account-lge-status';
3
- export * from './get-account-lge-status/types';
4
- export * from './get-lge-boost-rate/types';