@reyaxyz/community-sdk 0.14.1 → 0.16.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.
Files changed (30) hide show
  1. package/dist/client/index.js +4 -4
  2. package/dist/client/index.js.map +1 -1
  3. package/dist/modules/lge/index.js +19 -3
  4. package/dist/modules/lge/index.js.map +1 -1
  5. package/dist/modules/trading-league/index.js +19 -1
  6. package/dist/modules/trading-league/index.js.map +1 -1
  7. package/dist/modules/twitter/index.js +13 -1
  8. package/dist/modules/twitter/index.js.map +1 -1
  9. package/dist/modules/vote/index.js +21 -2
  10. package/dist/modules/vote/index.js.map +1 -1
  11. package/dist/modules/vote/services/executeTransaction.js +4 -2
  12. package/dist/modules/vote/services/executeTransaction.js.map +1 -1
  13. package/dist/types/client/index.d.ts.map +1 -1
  14. package/dist/types/modules/lge/index.d.ts +4 -1
  15. package/dist/types/modules/lge/index.d.ts.map +1 -1
  16. package/dist/types/modules/trading-league/index.d.ts +4 -1
  17. package/dist/types/modules/trading-league/index.d.ts.map +1 -1
  18. package/dist/types/modules/twitter/index.d.ts +4 -2
  19. package/dist/types/modules/twitter/index.d.ts.map +1 -1
  20. package/dist/types/modules/vote/index.d.ts +4 -1
  21. package/dist/types/modules/vote/index.d.ts.map +1 -1
  22. package/dist/types/modules/vote/services/executeTransaction.d.ts +2 -0
  23. package/dist/types/modules/vote/services/executeTransaction.d.ts.map +1 -1
  24. package/package.json +4 -4
  25. package/src/client/index.ts +12 -3
  26. package/src/modules/lge/index.ts +11 -1
  27. package/src/modules/trading-league/index.ts +11 -1
  28. package/src/modules/twitter/index.ts +10 -2
  29. package/src/modules/vote/index.ts +12 -1
  30. package/src/modules/vote/services/executeTransaction.ts +10 -2
@@ -14,10 +14,10 @@ var trading_league_1 = __importDefault(require("../modules/trading-league"));
14
14
  */
15
15
  var CommunityClient = /** @class */ (function () {
16
16
  function CommunityClient() {
17
- this._vote = new vote_1.default(CommunityClient.config.apiEndpoint);
18
- this._LGE = new lge_1.default(CommunityClient.config.apiEndpoint);
19
- this._twitter = new twitter_1.default(CommunityClient.config.twitter.redirectURI, CommunityClient.config.twitter.clientId);
20
- this._tradingLeague = new trading_league_1.default();
17
+ this._vote = new vote_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
18
+ this._LGE = new lge_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
19
+ this._twitter = new twitter_1.default(CommunityClient.config.twitter.redirectURI, CommunityClient.config.twitter.clientId, CommunityClient.config.logging);
20
+ this._tradingLeague = new trading_league_1.default(CommunityClient.config.logging);
21
21
  }
22
22
  CommunityClient.configure = function (environment) {
23
23
  CommunityClient.config =
@@ -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,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"]}
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,CACzB,eAAe,CAAC,MAAM,CAAC,WAAW,EAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,IAAI,aAAS,CACvB,eAAe,CAAC,MAAM,CAAC,WAAW,EAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAa,CAC/B,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAC1C,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EACvC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,IAAI,wBAAmB,CAC3C,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,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;IAvFc,sBAAM,GAAkB,2BAAkB,CAAC,MAAM,CAAC,CAAC;IAwFpE,sBAAC;CAAA,AA1FD,IA0FC;AA1FY,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(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._LGE = new LGEModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._twitter = new TwitterModule(\n CommunityClient.config.twitter.redirectURI,\n CommunityClient.config.twitter.clientId,\n CommunityClient.config.logging,\n );\n this._tradingLeague = new TradingLeagueModule(\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()._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"]}
@@ -14,6 +14,12 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
17
23
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
24
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
25
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -52,12 +58,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
52
58
  };
53
59
  Object.defineProperty(exports, "__esModule", { value: true });
54
60
  var common_1 = require("@reyaxyz/common");
61
+ var common_2 = require("@reyaxyz/common");
55
62
  var LGEModule = /** @class */ (function (_super) {
56
63
  __extends(LGEModule, _super);
57
- function LGEModule() {
58
- return _super !== null && _super.apply(this, arguments) || this;
64
+ function LGEModule(apiUrl, loggingEnabled) {
65
+ var _this = _super.call(this, apiUrl) || this;
66
+ _this.loggingEnabled = false;
67
+ _this.loggingEnabled = loggingEnabled;
68
+ return _this;
59
69
  }
60
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
61
70
  LGEModule.prototype.getLGEBoostRate = function (_) {
62
71
  return __awaiter(this, void 0, void 0, function () {
63
72
  var uri;
@@ -76,6 +85,13 @@ var LGEModule = /** @class */ (function (_super) {
76
85
  });
77
86
  });
78
87
  };
88
+ __decorate([
89
+ (0, common_2.Logger)('LGEModule.getLGEBoostRate')
90
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
91
+ ], LGEModule.prototype, "getLGEBoostRate", null);
92
+ __decorate([
93
+ (0, common_2.Logger)('LGEModule.getLGEBoostRate')
94
+ ], LGEModule.prototype, "getAccountLGEStatus", null);
79
95
  return LGEModule;
80
96
  }(common_1.RestClient));
81
97
  exports.default = LGEModule;
@@ -1 +1 @@
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,kBAAkB,CAAC;gBAC/B,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-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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA6C;AAO7C,0CAAmD;AAEnD;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;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;IATK;QAFL,IAAA,eAAM,EAAC,2BAA2B,CAAC;QACpC,6DAA6D;oDAI5D;IAGK;QADL,IAAA,eAAM,EAAC,2BAA2B,CAAC;wDAInC;IACH,gBAAC;CAAA,AApBD,CAAuC,mBAAU,GAoBhD;kBApBoB,SAAS","sourcesContent":["import { RestClient } from '@reyaxyz/common';\nimport {\n GetAccountLGEStatusParams,\n GetAccountLGEStatusResult,\n GetLGEBoostRateParams,\n GetLGEBoostRateResult,\n} from './types';\nimport { Loggable, Logger } from '@reyaxyz/common';\n\nexport default class LGEModule extends RestClient implements Loggable {\n loggingEnabled: boolean = false;\n\n constructor(apiUrl: string, loggingEnabled: boolean) {\n super(apiUrl);\n this.loggingEnabled = loggingEnabled;\n }\n\n @Logger('LGEModule.getLGEBoostRate')\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async getLGEBoostRate(_: GetLGEBoostRateParams) {\n const uri = `/api/xp/lp-boost`;\n return this.get<GetLGEBoostRateResult>(uri);\n }\n\n @Logger('LGEModule.getLGEBoostRate')\n async getAccountLGEStatus(params: GetAccountLGEStatusParams) {\n const uri = `/api/xp/lp-profile/${params.address}`;\n return this.get<GetAccountLGEStatusResult>(uri);\n }\n}\n"]}
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
9
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
10
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -37,8 +43,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
43
  };
38
44
  Object.defineProperty(exports, "__esModule", { value: true });
39
45
  var services_1 = require("./services");
46
+ var common_1 = require("@reyaxyz/common");
40
47
  var TradingLeagueModule = /** @class */ (function () {
41
- function TradingLeagueModule() {
48
+ function TradingLeagueModule(loggingEnabled) {
49
+ this.loggingEnabled = false;
50
+ this.loggingEnabled = loggingEnabled;
42
51
  }
43
52
  TradingLeagueModule.prototype.claimRank = function (params) {
44
53
  return __awaiter(this, void 0, void 0, function () {
@@ -61,6 +70,15 @@ var TradingLeagueModule = /** @class */ (function () {
61
70
  });
62
71
  });
63
72
  };
73
+ __decorate([
74
+ (0, common_1.Logger)('TradingLeagueModule.claimRank')
75
+ ], TradingLeagueModule.prototype, "claimRank", null);
76
+ __decorate([
77
+ (0, common_1.Logger)('TradingLeagueModule.getLeaderboard')
78
+ ], TradingLeagueModule.prototype, "getLeaderboard", null);
79
+ __decorate([
80
+ (0, common_1.Logger)('TradingLeagueModule.getUserLeaderboardData')
81
+ ], TradingLeagueModule.prototype, "getUserLeaderboardData", null);
64
82
  return TradingLeagueModule;
65
83
  }());
66
84
  exports.default = TradingLeagueModule;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/trading-league/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAOoB;AAEpB;IAAA;IAYA,CAAC;IAXO,uCAAS,GAAf,UAAgB,MAAuB;;;gBACrC,sBAAO,IAAA,oBAAS,EAAC,MAAM,CAAC,EAAC;;;KAC1B;IAEK,4CAAc,GAApB,UAAqB,MAA4B;;;gBAC/C,sBAAO,IAAA,yBAAc,EAAC,MAAM,CAAC,EAAC;;;KAC/B;IAEK,oDAAsB,GAA5B,UAA6B,MAAoC;;;gBAC/D,sBAAO,IAAA,iCAAsB,EAAC,MAAM,CAAC,EAAC;;;KACvC;IACH,0BAAC;AAAD,CAAC,AAZD,IAYC","sourcesContent":["import {\n getLeaderboard,\n GetLeaderboardParams,\n getUserLeaderboardData,\n GetUserLeaderboardDataParams,\n claimRank,\n ClaimRankParams,\n} from './services';\n\nexport default class TradingLeagueModule {\n async claimRank(params: ClaimRankParams) {\n return claimRank(params);\n }\n\n async getLeaderboard(params: GetLeaderboardParams) {\n return getLeaderboard(params);\n }\n\n async getUserLeaderboardData(params: GetUserLeaderboardDataParams) {\n return getUserLeaderboardData(params);\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/trading-league/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAOoB;AACpB,0CAAmD;AAEnD;IAGE,6BAAY,cAAuB;QAFnC,mBAAc,GAAY,KAAK,CAAC;QAG9B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAGK,uCAAS,GAAT,UAAU,MAAuB;;;gBACrC,sBAAO,IAAA,oBAAS,EAAC,MAAM,CAAC,EAAC;;;KAC1B;IAGK,4CAAc,GAAd,UAAe,MAA4B;;;gBAC/C,sBAAO,IAAA,yBAAc,EAAC,MAAM,CAAC,EAAC;;;KAC/B;IAGK,oDAAsB,GAAtB,UAAuB,MAAoC;;;gBAC/D,sBAAO,IAAA,iCAAsB,EAAC,MAAM,CAAC,EAAC;;;KACvC;IAZK;QADL,IAAA,eAAM,EAAC,+BAA+B,CAAC;wDAGvC;IAGK;QADL,IAAA,eAAM,EAAC,oCAAoC,CAAC;6DAG5C;IAGK;QADL,IAAA,eAAM,EAAC,4CAA4C,CAAC;qEAGpD;IACH,0BAAC;CAAA,AArBD,IAqBC;kBArBoB,mBAAmB","sourcesContent":["import {\n getLeaderboard,\n GetLeaderboardParams,\n getUserLeaderboardData,\n GetUserLeaderboardDataParams,\n claimRank,\n ClaimRankParams,\n} from './services';\nimport { Loggable, Logger } from '@reyaxyz/common';\n\nexport default class TradingLeagueModule implements Loggable {\n loggingEnabled: boolean = false;\n\n constructor(loggingEnabled: boolean) {\n this.loggingEnabled = loggingEnabled;\n }\n\n @Logger('TradingLeagueModule.claimRank')\n async claimRank(params: ClaimRankParams) {\n return claimRank(params);\n }\n\n @Logger('TradingLeagueModule.getLeaderboard')\n async getLeaderboard(params: GetLeaderboardParams) {\n return getLeaderboard(params);\n }\n\n @Logger('TradingLeagueModule.getUserLeaderboardData')\n async getUserLeaderboardData(params: GetUserLeaderboardDataParams) {\n return getUserLeaderboardData(params);\n }\n}\n"]}
@@ -10,16 +10,28 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
14
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
17
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
18
+ };
13
19
  Object.defineProperty(exports, "__esModule", { value: true });
14
20
  var services_1 = require("./services");
21
+ var common_1 = require("@reyaxyz/common");
15
22
  var TwitterModule = /** @class */ (function () {
16
- function TwitterModule(redirectURI, twitterClientId) {
23
+ function TwitterModule(redirectURI, twitterClientId, loggingEnabled) {
24
+ this.loggingEnabled = false;
17
25
  this.redirectURI = redirectURI;
18
26
  this.twitterClientId = twitterClientId;
27
+ this.loggingEnabled = loggingEnabled;
19
28
  }
20
29
  TwitterModule.prototype.getTwitterOauthUrl = function (params) {
21
30
  return (0, services_1.getTwitterOauthUrl)(__assign(__assign({}, params), { redirectURI: this.redirectURI, twitterClientId: this.twitterClientId }));
22
31
  };
32
+ __decorate([
33
+ (0, common_1.Logger)('TwitterModule.getTwitterOauthUrl')
34
+ ], TwitterModule.prototype, "getTwitterOauthUrl", null);
23
35
  return TwitterModule;
24
36
  }());
25
37
  exports.default = TwitterModule;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/twitter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,uCAA0E;AAE1E;IAIE,uBAAY,WAAmB,EAAE,eAAuB;QACtD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAED,0CAAkB,GAAlB,UACE,MAAuD;QAEvD,OAAO,IAAA,6BAAkB,wBACpB,MAAM,KACT,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,eAAe,EAAE,IAAI,CAAC,eAAe,IACrC,CAAC;IACL,CAAC;IACH,oBAAC;AAAD,CAAC,AAlBD,IAkBC","sourcesContent":["import { getTwitterOauthUrl, GetTwitterOauthUrlParams } from './services';\n\nexport default class TwitterModule {\n private redirectURI: string;\n private twitterClientId: string;\n\n constructor(redirectURI: string, twitterClientId: string) {\n this.redirectURI = redirectURI;\n this.twitterClientId = twitterClientId;\n }\n\n getTwitterOauthUrl(\n params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>,\n ): string {\n return getTwitterOauthUrl({\n ...params,\n redirectURI: this.redirectURI,\n twitterClientId: this.twitterClientId,\n });\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/twitter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,uCAA0E;AAC1E,0CAAmD;AAEnD;IAKE,uBACE,WAAmB,EACnB,eAAuB,EACvB,cAAuB;QALzB,mBAAc,GAAY,KAAK,CAAC;QAO9B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAGD,0CAAkB,GAAlB,UACE,MAAuD;QAEvD,OAAO,IAAA,6BAAkB,wBACpB,MAAM,KACT,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,eAAe,EAAE,IAAI,CAAC,eAAe,IACrC,CAAC;IACL,CAAC;IARD;QADC,IAAA,eAAM,EAAC,kCAAkC,CAAC;2DAS1C;IACH,oBAAC;CAAA,AAzBD,IAyBC;kBAzBoB,aAAa","sourcesContent":["import { getTwitterOauthUrl, GetTwitterOauthUrlParams } from './services';\nimport { Loggable, Logger } from '@reyaxyz/common';\n\nexport default class TwitterModule implements Loggable {\n private redirectURI: string;\n private twitterClientId: string;\n loggingEnabled: boolean = false;\n\n constructor(\n redirectURI: string,\n twitterClientId: string,\n loggingEnabled: boolean,\n ) {\n this.redirectURI = redirectURI;\n this.twitterClientId = twitterClientId;\n this.loggingEnabled = loggingEnabled;\n }\n\n @Logger('TwitterModule.getTwitterOauthUrl')\n getTwitterOauthUrl(\n params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>,\n ): string {\n return getTwitterOauthUrl({\n ...params,\n redirectURI: this.redirectURI,\n twitterClientId: this.twitterClientId,\n });\n }\n}\n"]}
@@ -14,6 +14,12 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
17
23
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
24
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
25
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -53,10 +59,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
53
59
  Object.defineProperty(exports, "__esModule", { value: true });
54
60
  var common_1 = require("@reyaxyz/common");
55
61
  var services_1 = require("./services");
62
+ var common_2 = require("@reyaxyz/common");
56
63
  var VoteModule = /** @class */ (function (_super) {
57
64
  __extends(VoteModule, _super);
58
- function VoteModule() {
59
- return _super !== null && _super.apply(this, arguments) || this;
65
+ function VoteModule(apiUrl, loggingEnabled) {
66
+ var _this = _super.call(this, apiUrl) || this;
67
+ _this.loggingEnabled = false;
68
+ _this.loggingEnabled = loggingEnabled;
69
+ return _this;
60
70
  }
61
71
  // WRITE
62
72
  VoteModule.prototype.vote = function (params) {
@@ -85,6 +95,15 @@ var VoteModule = /** @class */ (function (_super) {
85
95
  });
86
96
  });
87
97
  };
98
+ __decorate([
99
+ (0, common_2.Logger)('VoteModule.vote')
100
+ ], VoteModule.prototype, "vote", null);
101
+ __decorate([
102
+ (0, common_2.Logger)('VoteModule.getVoteDetails')
103
+ ], VoteModule.prototype, "getVoteDetails", null);
104
+ __decorate([
105
+ (0, common_2.Logger)('VoteModule.getVoteStatus')
106
+ ], VoteModule.prototype, "getVoteStatus", null);
88
107
  return VoteModule;
89
108
  }(common_1.RestClient));
90
109
  exports.default = VoteModule;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/vote/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA6C;AAQ7C,uCAAkC;AAElC;IAAwC,8BAAU;IAAlD;;IAgBA,CAAC;IAfC,QAAQ;IACF,yBAAI,GAAV,UAAW,MAAkB;;;gBAC3B,sBAAO,IAAA,eAAI,EAAC,MAAM,CAAC,EAAC;;;KACrB;IAED,OAAO;IACD,mCAAc,GAApB,UAAqB,MAA4B;;;;gBACzC,GAAG,GAAG,oBAAa,MAAM,CAAC,EAAE,CAAE,CAAC;gBACrC,sBAAO,IAAI,CAAC,GAAG,CAAuB,GAAG,CAAC,EAAC;;;KAC5C;IAEK,kCAAa,GAAnB,UAAoB,MAA2B;;;;gBACvC,GAAG,GAAG,oBAAa,MAAM,CAAC,EAAE,mBAAS,MAAM,CAAC,OAAO,CAAE,CAAC;gBAC5D,sBAAO,IAAI,CAAC,GAAG,CAAsB,GAAG,CAAC,EAAC;;;KAC3C;IACH,iBAAC;AAAD,CAAC,AAhBD,CAAwC,mBAAU,GAgBjD","sourcesContent":["import { RestClient } from '@reyaxyz/common';\nimport {\n GetVoteDetailsParams,\n GetVoteDetailsResult,\n GetVoteStatusParams,\n GetVoteStatusResult,\n VoteParams,\n} from './types';\nimport { vote } from './services';\n\nexport default class VoteModule extends RestClient {\n // WRITE\n async vote(params: VoteParams) {\n return vote(params);\n }\n\n // READ\n async getVoteDetails(params: GetVoteDetailsParams) {\n const uri = `/api/vote/${params.id}`;\n return this.get<GetVoteDetailsResult>(uri);\n }\n\n async getVoteStatus(params: GetVoteStatusParams) {\n const uri = `/api/vote/${params.id}/user/${params.address}`;\n return this.get<GetVoteStatusResult>(uri);\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/vote/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA6C;AAQ7C,uCAAkC;AAClC,0CAAmD;AAEnD;IAAwC,8BAAU;IAGhD,oBAAY,MAAc,EAAE,cAAuB;QACjD,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QAHhB,oBAAc,GAAY,KAAK,CAAC;QAI9B,KAAI,CAAC,cAAc,GAAG,cAAc,CAAC;;IACvC,CAAC;IAED,QAAQ;IAEF,yBAAI,GAAJ,UAAK,MAAkB;;;gBAC3B,sBAAO,IAAA,eAAI,EAAC,MAAM,CAAC,EAAC;;;KACrB;IAED,OAAO;IAED,mCAAc,GAAd,UAAe,MAA4B;;;;gBACzC,GAAG,GAAG,oBAAa,MAAM,CAAC,EAAE,CAAE,CAAC;gBACrC,sBAAO,IAAI,CAAC,GAAG,CAAuB,GAAG,CAAC,EAAC;;;KAC5C;IAGK,kCAAa,GAAb,UAAc,MAA2B;;;;gBACvC,GAAG,GAAG,oBAAa,MAAM,CAAC,EAAE,mBAAS,MAAM,CAAC,OAAO,CAAE,CAAC;gBAC5D,sBAAO,IAAI,CAAC,GAAG,CAAsB,GAAG,CAAC,EAAC;;;KAC3C;IAfK;QADL,IAAA,eAAM,EAAC,iBAAiB,CAAC;0CAGzB;IAIK;QADL,IAAA,eAAM,EAAC,2BAA2B,CAAC;oDAInC;IAGK;QADL,IAAA,eAAM,EAAC,0BAA0B,CAAC;mDAIlC;IACH,iBAAC;CAAA,AA1BD,CAAwC,mBAAU,GA0BjD;kBA1BoB,UAAU","sourcesContent":["import { RestClient } from '@reyaxyz/common';\nimport {\n GetVoteDetailsParams,\n GetVoteDetailsResult,\n GetVoteStatusParams,\n GetVoteStatusResult,\n VoteParams,\n} from './types';\nimport { vote } from './services';\nimport { Logger, Loggable } from '@reyaxyz/common';\n\nexport default class VoteModule 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 // WRITE\n @Logger('VoteModule.vote')\n async vote(params: VoteParams) {\n return vote(params);\n }\n\n // READ\n @Logger('VoteModule.getVoteDetails')\n async getVoteDetails(params: GetVoteDetailsParams) {\n const uri = `/api/vote/${params.id}`;\n return this.get<GetVoteDetailsResult>(uri);\n }\n\n @Logger('VoteModule.getVoteStatus')\n async getVoteStatus(params: GetVoteStatusParams) {\n const uri = `/api/vote/${params.id}/user/${params.address}`;\n return this.get<GetVoteStatusResult>(uri);\n }\n}\n"]}
@@ -51,7 +51,7 @@ exports.executeTransaction = exports.estimateGas = void 0;
51
51
  var contractAddresses_1 = require("../../../utils/contractAddresses");
52
52
  function estimateGas(signer, data, value, chainId, targetContract) {
53
53
  return __awaiter(this, void 0, void 0, function () {
54
- var accountAddress, contractAddress, tx, gasLimit;
54
+ var accountAddress, contractAddress, tx, gasLimit, maxPriorityFeePerGas, maxFeePerGas;
55
55
  return __generator(this, function (_a) {
56
56
  switch (_a.label) {
57
57
  case 0: return [4 /*yield*/, signer.getAddress()];
@@ -62,7 +62,9 @@ function estimateGas(signer, data, value, chainId, targetContract) {
62
62
  : targetContract;
63
63
  tx = __assign({ from: accountAddress, to: contractAddress, data: data }, (value && value !== '0' ? { value: value } : {}));
64
64
  gasLimit = BigInt('5000000');
65
- return [2 /*return*/, __assign(__assign({}, tx), { gasLimit: gasLimit })];
65
+ maxPriorityFeePerGas = BigInt('0');
66
+ maxFeePerGas = BigInt('0');
67
+ return [2 /*return*/, __assign(__assign({}, tx), { gasLimit: gasLimit, maxPriorityFeePerGas: maxPriorityFeePerGas, maxFeePerGas: maxFeePerGas })];
66
68
  }
67
69
  });
68
70
  });
@@ -1 +1 @@
1
- {"version":3,"file":"executeTransaction.js","sourceRoot":"/","sources":["modules/vote/services/executeTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,sEAA4E;AAS5E,SAAsB,WAAW,CAC/B,MAA8B,EAC9B,IAAY,EACZ,KAAa,EACb,OAAe,EACf,cAAqC;;;;;wBAEd,qBAAM,MAAM,CAAC,UAAU,EAAE,EAAA;;oBAA1C,cAAc,GAAG,SAAyB;oBAC1C,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,gCAAY,CAAC,CAAC,QAAQ,CAC1D,cAA8B,CAC/B;wBACC,CAAC,CAAC,IAAA,8BAAU,EAAC,OAAO,EAAE,cAA8B,CAAC;wBACrD,CAAC,CAAC,cAAc,CAAC;oBACb,EAAE,cACN,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,eAAe,EACnB,IAAI,MAAA,IACD,CAAC,KAAK,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACpD,CAAC;oBAEI,QAAQ,GAAW,MAAM,CAAC,SAAS,CAAC,CAAC;oBAC3C,4CAAY,EAAE,KAAE,QAAQ,UAAA,KAAG;;;;CAC5B;AAtBD,kCAsBC;AAED,SAAsB,kBAAkB,CACtC,MAA8B,EAC9B,IAAY,EACZ,KAAa,EACb,OAAe,EACf,cAAqC;;;;;wBAEtB,qBAAM,WAAW,CAC9B,MAAM,EACN,IAAI,EACJ,KAAK,EACL,OAAO,EACP,cAAc,CACf,EAAA;;oBANK,MAAM,GAAG,SAMd;;;;oBAGoB,qBAAM,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,EAAA;;oBAAjD,UAAU,GAAG,SAAoC;oBACrC,qBAAM,UAAU,CAAC,IAAI,EAAE,EAAA;;oBAAnC,SAAS,GAAG,SAAuB;oBACzC,sBAAO,SAAS,EAAC;;;oBAEjB,OAAO,CAAC,IAAI,CAAC,OAAK,CAAC,CAAC;oBACpB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;;;;;CAElD;AAvBD,gDAuBC","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport { ContractType, getAddress } from '../../../utils/contractAddresses';\n\nexport type Transaction = {\n from: string;\n to: string;\n data: string;\n value?: string;\n};\n\nexport async function estimateGas(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<Transaction & { gasLimit: bigint }> {\n const accountAddress = await signer.getAddress();\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n const tx = {\n from: accountAddress,\n to: contractAddress,\n data,\n ...(value && value !== '0' ? { value: value } : {}),\n };\n\n const gasLimit: bigint = BigInt('5000000'); // hardcode to 5m gas limit\n return { ...tx, gasLimit };\n}\n\nexport async function executeTransaction(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n) {\n const txData = await estimateGas(\n signer,\n data,\n value,\n chainId,\n targetContract,\n );\n\n try {\n const txResponse = await signer.sendTransaction(txData);\n const txReceipt = await txResponse.wait();\n return txReceipt;\n } catch (error) {\n console.warn(error);\n throw new Error('Transaction Execution Error');\n }\n}\n"]}
1
+ {"version":3,"file":"executeTransaction.js","sourceRoot":"/","sources":["modules/vote/services/executeTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,sEAA4E;AAS5E,SAAsB,WAAW,CAC/B,MAA8B,EAC9B,IAAY,EACZ,KAAa,EACb,OAAe,EACf,cAAqC;;;;;wBAQd,qBAAM,MAAM,CAAC,UAAU,EAAE,EAAA;;oBAA1C,cAAc,GAAG,SAAyB;oBAC1C,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,gCAAY,CAAC,CAAC,QAAQ,CAC1D,cAA8B,CAC/B;wBACC,CAAC,CAAC,IAAA,8BAAU,EAAC,OAAO,EAAE,cAA8B,CAAC;wBACrD,CAAC,CAAC,cAAc,CAAC;oBACb,EAAE,cACN,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,eAAe,EACnB,IAAI,MAAA,IACD,CAAC,KAAK,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACpD,CAAC;oBAEI,QAAQ,GAAW,MAAM,CAAC,SAAS,CAAC,CAAC;oBACrC,oBAAoB,GAAW,MAAM,CAAC,GAAG,CAAC,CAAC;oBAC3C,YAAY,GAAW,MAAM,CAAC,GAAG,CAAC,CAAC;oBACzC,4CAAY,EAAE,KAAE,QAAQ,UAAA,EAAE,oBAAoB,sBAAA,EAAE,YAAY,cAAA,KAAG;;;;CAChE;AA9BD,kCA8BC;AAED,SAAsB,kBAAkB,CACtC,MAA8B,EAC9B,IAAY,EACZ,KAAa,EACb,OAAe,EACf,cAAqC;;;;;wBAEtB,qBAAM,WAAW,CAC9B,MAAM,EACN,IAAI,EACJ,KAAK,EACL,OAAO,EACP,cAAc,CACf,EAAA;;oBANK,MAAM,GAAG,SAMd;;;;oBAGoB,qBAAM,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,EAAA;;oBAAjD,UAAU,GAAG,SAAoC;oBACrC,qBAAM,UAAU,CAAC,IAAI,EAAE,EAAA;;oBAAnC,SAAS,GAAG,SAAuB;oBACzC,sBAAO,SAAS,EAAC;;;oBAEjB,OAAO,CAAC,IAAI,CAAC,OAAK,CAAC,CAAC;oBACpB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;;;;;CAElD;AAvBD,gDAuBC","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport { ContractType, getAddress } from '../../../utils/contractAddresses';\n\nexport type Transaction = {\n from: string;\n to: string;\n data: string;\n value?: string;\n};\n\nexport async function estimateGas(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas: bigint;\n maxFeePerGas: bigint;\n }\n> {\n const accountAddress = await signer.getAddress();\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n const tx = {\n from: accountAddress,\n to: contractAddress,\n data,\n ...(value && value !== '0' ? { value: value } : {}),\n };\n\n const gasLimit: bigint = BigInt('5000000'); // hardcode to 5m gas limit\n const maxPriorityFeePerGas: bigint = BigInt('0');\n const maxFeePerGas: bigint = BigInt('0');\n return { ...tx, gasLimit, maxPriorityFeePerGas, maxFeePerGas };\n}\n\nexport async function executeTransaction(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n) {\n const txData = await estimateGas(\n signer,\n data,\n value,\n chainId,\n targetContract,\n );\n\n try {\n const txResponse = await signer.sendTransaction(txData);\n const txReceipt = await txResponse.wait();\n return txReceipt;\n } catch (error) {\n console.warn(error);\n throw new Error('Transaction Execution Error');\n }\n}\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,mBAAmB,MAAM,2BAA2B,CAAC;AAE5D;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IACzC,OAAO,CAAC,MAAM,CAAC,MAAM,CAA6C;IAElE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAsB;IAErD,OAAO;WAUO,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;IAED;;;;;;OAMG;IACH,WAAkB,OAAO,IAAI,aAAa,CAEzC;IAED;;;;;;OAMG;IACH,WAAkB,aAAa,IAAI,mBAAmB,CAErD;IAED,WAAkB,cAAc,IAAI,MAAM,CAEzC;CACF"}
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,mBAAmB,MAAM,2BAA2B,CAAC;AAE5D;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IACzC,OAAO,CAAC,MAAM,CAAC,MAAM,CAA6C;IAElE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAsB;IAErD,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;IAED;;;;;;OAMG;IACH,WAAkB,OAAO,IAAI,aAAa,CAEzC;IAED;;;;;;OAMG;IACH,WAAkB,aAAa,IAAI,mBAAmB,CAErD;IAED,WAAkB,cAAc,IAAI,MAAM,CAEzC;CACF"}
@@ -1,6 +1,9 @@
1
1
  import { RestClient } from '@reyaxyz/common';
2
2
  import { GetAccountLGEStatusParams, GetAccountLGEStatusResult, GetLGEBoostRateParams } from './types';
3
- export default class LGEModule extends RestClient {
3
+ import { Loggable } from '@reyaxyz/common';
4
+ export default class LGEModule extends RestClient implements Loggable {
5
+ loggingEnabled: boolean;
6
+ constructor(apiUrl: string, loggingEnabled: boolean);
4
7
  getLGEBoostRate(_: GetLGEBoostRateParams): Promise<number>;
5
8
  getAccountLGEStatus(params: GetAccountLGEStatusParams): Promise<GetAccountLGEStatusResult>;
6
9
  }
@@ -1 +1 @@
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"}
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;AACjB,OAAO,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAW,YAAW,QAAQ;IACnE,cAAc,EAAE,OAAO,CAAS;gBAEpB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO;IAO7C,eAAe,CAAC,CAAC,EAAE,qBAAqB;IAMxC,mBAAmB,CAAC,MAAM,EAAE,yBAAyB;CAI5D"}
@@ -1,5 +1,8 @@
1
1
  import { GetLeaderboardParams, GetUserLeaderboardDataParams, ClaimRankParams } from './services';
2
- export default class TradingLeagueModule {
2
+ import { Loggable } from '@reyaxyz/common';
3
+ export default class TradingLeagueModule implements Loggable {
4
+ loggingEnabled: boolean;
5
+ constructor(loggingEnabled: boolean);
3
6
  claimRank(params: ClaimRankParams): Promise<import("./services").ClaimRankResult>;
4
7
  getLeaderboard(params: GetLeaderboardParams): Promise<import("./services").GetLeaderboardResult>;
5
8
  getUserLeaderboardData(params: GetUserLeaderboardDataParams): Promise<import("./services").UserLeaderboardDataEntity>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/trading-league/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EAEpB,4BAA4B,EAE5B,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,OAAO,OAAO,mBAAmB;IAChC,SAAS,CAAC,MAAM,EAAE,eAAe;IAIjC,cAAc,CAAC,MAAM,EAAE,oBAAoB;IAI3C,sBAAsB,CAAC,MAAM,EAAE,4BAA4B;CAGlE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/trading-league/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EAEpB,4BAA4B,EAE5B,eAAe,EAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,mBAAoB,YAAW,QAAQ;IAC1D,cAAc,EAAE,OAAO,CAAS;gBAEpB,cAAc,EAAE,OAAO;IAK7B,SAAS,CAAC,MAAM,EAAE,eAAe;IAKjC,cAAc,CAAC,MAAM,EAAE,oBAAoB;IAK3C,sBAAsB,CAAC,MAAM,EAAE,4BAA4B;CAGlE"}
@@ -1,8 +1,10 @@
1
1
  import { GetTwitterOauthUrlParams } from './services';
2
- export default class TwitterModule {
2
+ import { Loggable } from '@reyaxyz/common';
3
+ export default class TwitterModule implements Loggable {
3
4
  private redirectURI;
4
5
  private twitterClientId;
5
- constructor(redirectURI: string, twitterClientId: string);
6
+ loggingEnabled: boolean;
7
+ constructor(redirectURI: string, twitterClientId: string, loggingEnabled: boolean);
6
8
  getTwitterOauthUrl(params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>): string;
7
9
  }
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/twitter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE1E,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,eAAe,CAAS;gBAEpB,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM;IAKxD,kBAAkB,CAChB,MAAM,EAAE,IAAI,CAAC,wBAAwB,EAAE,eAAe,CAAC,GACtD,MAAM;CAOV"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/twitter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,QAAQ;IACpD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,eAAe,CAAS;IAChC,cAAc,EAAE,OAAO,CAAS;gBAG9B,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,OAAO;IAQzB,kBAAkB,CAChB,MAAM,EAAE,IAAI,CAAC,wBAAwB,EAAE,eAAe,CAAC,GACtD,MAAM;CAOV"}
@@ -1,6 +1,9 @@
1
1
  import { RestClient } from '@reyaxyz/common';
2
2
  import { GetVoteDetailsParams, GetVoteStatusParams, VoteParams } from './types';
3
- export default class VoteModule extends RestClient {
3
+ import { Loggable } from '@reyaxyz/common';
4
+ export default class VoteModule extends RestClient implements Loggable {
5
+ loggingEnabled: boolean;
6
+ constructor(apiUrl: string, loggingEnabled: boolean);
4
7
  vote(params: VoteParams): Promise<import("./types").VoteResult>;
5
8
  getVoteDetails(params: GetVoteDetailsParams): Promise<import("@reyaxyz/common").VoteDetailsEntity>;
6
9
  getVoteStatus(params: GetVoteStatusParams): Promise<import("@reyaxyz/common").VoteStatusEntity>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/vote/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,oBAAoB,EAEpB,mBAAmB,EAEnB,UAAU,EACX,MAAM,SAAS,CAAC;AAGjB,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,UAAU;IAE1C,IAAI,CAAC,MAAM,EAAE,UAAU;IAKvB,cAAc,CAAC,MAAM,EAAE,oBAAoB;IAK3C,aAAa,CAAC,MAAM,EAAE,mBAAmB;CAIhD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/vote/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,oBAAoB,EAEpB,mBAAmB,EAEnB,UAAU,EACX,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAU,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,UAAW,YAAW,QAAQ;IACpE,cAAc,EAAE,OAAO,CAAS;gBAEpB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO;IAO7C,IAAI,CAAC,MAAM,EAAE,UAAU;IAMvB,cAAc,CAAC,MAAM,EAAE,oBAAoB;IAM3C,aAAa,CAAC,MAAM,EAAE,mBAAmB;CAIhD"}
@@ -8,6 +8,8 @@ export type Transaction = {
8
8
  };
9
9
  export declare function estimateGas(signer: Signer | JsonRpcSigner, data: string, value: string, chainId: number, targetContract: ContractType | string): Promise<Transaction & {
10
10
  gasLimit: bigint;
11
+ maxPriorityFeePerGas: bigint;
12
+ maxFeePerGas: bigint;
11
13
  }>;
12
14
  export declare function executeTransaction(signer: Signer | JsonRpcSigner, data: string, value: string, chainId: number, targetContract: ContractType | string): Promise<import("ethers").TransactionReceipt | null>;
13
15
  //# sourceMappingURL=executeTransaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"executeTransaction.d.ts","sourceRoot":"/","sources":["modules/vote/services/executeTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAc,MAAM,kCAAkC,CAAC;AAE5E,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,GAAG,aAAa,EAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,YAAY,GAAG,MAAM,GACpC,OAAO,CAAC,WAAW,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAgB7C;AAED,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,GAAG,aAAa,EAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,YAAY,GAAG,MAAM,uDAkBtC"}
1
+ {"version":3,"file":"executeTransaction.d.ts","sourceRoot":"/","sources":["modules/vote/services/executeTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAc,MAAM,kCAAkC,CAAC;AAE5E,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,GAAG,aAAa,EAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,YAAY,GAAG,MAAM,GACpC,OAAO,CACR,WAAW,GAAG;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;CACtB,CACF,CAkBA;AAED,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,GAAG,aAAa,EAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,YAAY,GAAG,MAAM,uDAkBtC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/community-sdk",
3
- "version": "0.14.1",
3
+ "version": "0.16.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.44.0",
14
- "@reyaxyz/sdk": "0.33.0",
13
+ "@reyaxyz/common": "0.45.0",
14
+ "@reyaxyz/sdk": "0.34.1",
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": "f7a7fb222350c5b90a298f91aa07e79bb574b1b8"
41
+ "gitHead": "450faab59074149c97db18a8d3330b5e1a9c73d7"
42
42
  }
@@ -17,13 +17,22 @@ export class CommunityClient {
17
17
  private readonly _tradingLeague: TradingLeagueModule;
18
18
 
19
19
  private constructor() {
20
- this._vote = new VoteModule(CommunityClient.config.apiEndpoint);
21
- this._LGE = new LGEModule(CommunityClient.config.apiEndpoint);
20
+ this._vote = new VoteModule(
21
+ CommunityClient.config.apiEndpoint,
22
+ CommunityClient.config.logging,
23
+ );
24
+ this._LGE = new LGEModule(
25
+ CommunityClient.config.apiEndpoint,
26
+ CommunityClient.config.logging,
27
+ );
22
28
  this._twitter = new TwitterModule(
23
29
  CommunityClient.config.twitter.redirectURI,
24
30
  CommunityClient.config.twitter.clientId,
31
+ CommunityClient.config.logging,
32
+ );
33
+ this._tradingLeague = new TradingLeagueModule(
34
+ CommunityClient.config.logging,
25
35
  );
26
- this._tradingLeague = new TradingLeagueModule();
27
36
  }
28
37
 
29
38
  public static configure(environment: ServiceConfig['environment']): void {
@@ -5,14 +5,24 @@ import {
5
5
  GetLGEBoostRateParams,
6
6
  GetLGEBoostRateResult,
7
7
  } from './types';
8
+ import { Loggable, Logger } from '@reyaxyz/common';
8
9
 
9
- export default class LGEModule extends RestClient {
10
+ export default class LGEModule extends RestClient implements Loggable {
11
+ loggingEnabled: boolean = false;
12
+
13
+ constructor(apiUrl: string, loggingEnabled: boolean) {
14
+ super(apiUrl);
15
+ this.loggingEnabled = loggingEnabled;
16
+ }
17
+
18
+ @Logger('LGEModule.getLGEBoostRate')
10
19
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
20
  async getLGEBoostRate(_: GetLGEBoostRateParams) {
12
21
  const uri = `/api/xp/lp-boost`;
13
22
  return this.get<GetLGEBoostRateResult>(uri);
14
23
  }
15
24
 
25
+ @Logger('LGEModule.getLGEBoostRate')
16
26
  async getAccountLGEStatus(params: GetAccountLGEStatusParams) {
17
27
  const uri = `/api/xp/lp-profile/${params.address}`;
18
28
  return this.get<GetAccountLGEStatusResult>(uri);
@@ -6,16 +6,26 @@ import {
6
6
  claimRank,
7
7
  ClaimRankParams,
8
8
  } from './services';
9
+ import { Loggable, Logger } from '@reyaxyz/common';
9
10
 
10
- export default class TradingLeagueModule {
11
+ export default class TradingLeagueModule implements Loggable {
12
+ loggingEnabled: boolean = false;
13
+
14
+ constructor(loggingEnabled: boolean) {
15
+ this.loggingEnabled = loggingEnabled;
16
+ }
17
+
18
+ @Logger('TradingLeagueModule.claimRank')
11
19
  async claimRank(params: ClaimRankParams) {
12
20
  return claimRank(params);
13
21
  }
14
22
 
23
+ @Logger('TradingLeagueModule.getLeaderboard')
15
24
  async getLeaderboard(params: GetLeaderboardParams) {
16
25
  return getLeaderboard(params);
17
26
  }
18
27
 
28
+ @Logger('TradingLeagueModule.getUserLeaderboardData')
19
29
  async getUserLeaderboardData(params: GetUserLeaderboardDataParams) {
20
30
  return getUserLeaderboardData(params);
21
31
  }
@@ -1,14 +1,22 @@
1
1
  import { getTwitterOauthUrl, GetTwitterOauthUrlParams } from './services';
2
+ import { Loggable, Logger } from '@reyaxyz/common';
2
3
 
3
- export default class TwitterModule {
4
+ export default class TwitterModule implements Loggable {
4
5
  private redirectURI: string;
5
6
  private twitterClientId: string;
7
+ loggingEnabled: boolean = false;
6
8
 
7
- constructor(redirectURI: string, twitterClientId: string) {
9
+ constructor(
10
+ redirectURI: string,
11
+ twitterClientId: string,
12
+ loggingEnabled: boolean,
13
+ ) {
8
14
  this.redirectURI = redirectURI;
9
15
  this.twitterClientId = twitterClientId;
16
+ this.loggingEnabled = loggingEnabled;
10
17
  }
11
18
 
19
+ @Logger('TwitterModule.getTwitterOauthUrl')
12
20
  getTwitterOauthUrl(
13
21
  params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>,
14
22
  ): string {
@@ -7,19 +7,30 @@ import {
7
7
  VoteParams,
8
8
  } from './types';
9
9
  import { vote } from './services';
10
+ import { Logger, Loggable } from '@reyaxyz/common';
11
+
12
+ export default class VoteModule extends RestClient implements Loggable {
13
+ loggingEnabled: boolean = false;
14
+
15
+ constructor(apiUrl: string, loggingEnabled: boolean) {
16
+ super(apiUrl);
17
+ this.loggingEnabled = loggingEnabled;
18
+ }
10
19
 
11
- export default class VoteModule extends RestClient {
12
20
  // WRITE
21
+ @Logger('VoteModule.vote')
13
22
  async vote(params: VoteParams) {
14
23
  return vote(params);
15
24
  }
16
25
 
17
26
  // READ
27
+ @Logger('VoteModule.getVoteDetails')
18
28
  async getVoteDetails(params: GetVoteDetailsParams) {
19
29
  const uri = `/api/vote/${params.id}`;
20
30
  return this.get<GetVoteDetailsResult>(uri);
21
31
  }
22
32
 
33
+ @Logger('VoteModule.getVoteStatus')
23
34
  async getVoteStatus(params: GetVoteStatusParams) {
24
35
  const uri = `/api/vote/${params.id}/user/${params.address}`;
25
36
  return this.get<GetVoteStatusResult>(uri);
@@ -14,7 +14,13 @@ export async function estimateGas(
14
14
  value: string,
15
15
  chainId: number,
16
16
  targetContract: ContractType | string,
17
- ): Promise<Transaction & { gasLimit: bigint }> {
17
+ ): Promise<
18
+ Transaction & {
19
+ gasLimit: bigint;
20
+ maxPriorityFeePerGas: bigint;
21
+ maxFeePerGas: bigint;
22
+ }
23
+ > {
18
24
  const accountAddress = await signer.getAddress();
19
25
  const contractAddress = Object.values(ContractType).includes(
20
26
  targetContract as ContractType,
@@ -29,7 +35,9 @@ export async function estimateGas(
29
35
  };
30
36
 
31
37
  const gasLimit: bigint = BigInt('5000000'); // hardcode to 5m gas limit
32
- return { ...tx, gasLimit };
38
+ const maxPriorityFeePerGas: bigint = BigInt('0');
39
+ const maxFeePerGas: bigint = BigInt('0');
40
+ return { ...tx, gasLimit, maxPriorityFeePerGas, maxFeePerGas };
33
41
  }
34
42
 
35
43
  export async function executeTransaction(