@reyaxyz/community-sdk 0.53.5 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +16 -0
- package/dist/client/index.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/index.js +1 -0
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/lge/index.js +0 -22
- package/dist/modules/lge/index.js.map +1 -1
- package/dist/modules/lge/types.js.map +1 -1
- package/dist/modules/tge/index.js +84 -0
- package/dist/modules/tge/index.js.map +1 -0
- package/dist/modules/tge/types.js +3 -0
- package/dist/modules/tge/types.js.map +1 -0
- package/dist/types/client/index.d.ts +10 -0
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/index.d.ts +1 -0
- package/dist/types/modules/index.d.ts.map +1 -1
- package/dist/types/modules/lge/index.d.ts +1 -7
- package/dist/types/modules/lge/index.d.ts.map +1 -1
- package/dist/types/modules/lge/types.d.ts +0 -9
- package/dist/types/modules/lge/types.d.ts.map +1 -1
- package/dist/types/modules/tge/index.d.ts +8 -0
- package/dist/types/modules/tge/index.d.ts.map +1 -0
- package/dist/types/modules/tge/types.d.ts +5 -0
- package/dist/types/modules/tge/types.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/client/index.ts +17 -0
- package/src/index.ts +1 -0
- package/src/modules/index.ts +1 -0
- package/src/modules/lge/index.ts +1 -17
- package/src/modules/lge/types.ts +0 -11
- package/src/modules/tge/index.ts +18 -0
- package/src/modules/tge/types.ts +5 -0
package/dist/client/index.js
CHANGED
|
@@ -11,6 +11,7 @@ var sbt_1 = __importDefault(require("../modules/sbt"));
|
|
|
11
11
|
var referral_1 = __importDefault(require("../modules/referral"));
|
|
12
12
|
var discord_1 = __importDefault(require("../modules/discord"));
|
|
13
13
|
var vltz_1 = __importDefault(require("../modules/vltz"));
|
|
14
|
+
var tge_1 = __importDefault(require("../modules/tge"));
|
|
14
15
|
/**
|
|
15
16
|
* @description Client for Community SDK, used to interact with the Reya community.
|
|
16
17
|
*/
|
|
@@ -22,6 +23,7 @@ var CommunityClient = /** @class */ (function () {
|
|
|
22
23
|
this._lgeModule = new lge_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
|
|
23
24
|
this._referralModule = new referral_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
|
|
24
25
|
this._discordModule = new discord_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
|
|
26
|
+
this._tgeModule = new tge_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
|
|
25
27
|
}
|
|
26
28
|
CommunityClient.configure = function (environment) {
|
|
27
29
|
CommunityClient.config = (0, common_1.getApiClientConfig)(environment);
|
|
@@ -89,6 +91,20 @@ var CommunityClient = /** @class */ (function () {
|
|
|
89
91
|
enumerable: false,
|
|
90
92
|
configurable: true
|
|
91
93
|
});
|
|
94
|
+
Object.defineProperty(CommunityClient, "tge", {
|
|
95
|
+
/**
|
|
96
|
+
* Provides access to the TGEModule instance.
|
|
97
|
+
* This getter allows for interacting with TGE-related functionalities.
|
|
98
|
+
*
|
|
99
|
+
* @returns {TGEModule} An instance of TGEModule for TGE operations.
|
|
100
|
+
* @memberof CommunityClient
|
|
101
|
+
*/
|
|
102
|
+
get: function () {
|
|
103
|
+
return CommunityClient.getInstance()._tgeModule;
|
|
104
|
+
},
|
|
105
|
+
enumerable: false,
|
|
106
|
+
configurable: true
|
|
107
|
+
});
|
|
92
108
|
Object.defineProperty(CommunityClient, "referral", {
|
|
93
109
|
/**
|
|
94
110
|
* Provides access to the ReferralModule instance.
|
package/dist/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAoE;AACpE,yDAAyC;AACzC,uDAAuC;AAC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AM,GAAkB,IAAA,2BAAkB,EAAC,MAAM,CAAC,CAAC;IAuIpE,sBAAC;CAAA,AAzID,IAyIC;AAzIY,0CAAe","sourcesContent":["import { getApiClientConfig, ServiceConfig } from '@reyaxyz/common';\nimport VoteModule from '../modules/vote';\nimport LGEModule from '../modules/lge';\nimport SbtModule from '../modules/sbt';\nimport ReferralModule from '../modules/referral';\nimport DiscordModule from '../modules/discord';\nimport VltzModule from '../modules/vltz';\nimport TGEModule from '../modules/tge';\n\n/**\n * @description Client for Community SDK, used to interact with the Reya community.\n */\nexport class CommunityClient {\n private static instance: CommunityClient;\n private static config: ServiceConfig = getApiClientConfig('test');\n\n private readonly _voteModule: VoteModule;\n private readonly _sbtModule: SbtModule;\n private readonly _vltzModule: VltzModule;\n private readonly _lgeModule: LGEModule;\n private readonly _referralModule: ReferralModule;\n private readonly _discordModule: DiscordModule;\n private readonly _tgeModule: TGEModule;\n\n private constructor() {\n this._voteModule = new VoteModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._sbtModule = new SbtModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._vltzModule = new VltzModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._lgeModule = new LGEModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._referralModule = new ReferralModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._discordModule = new DiscordModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._tgeModule = new TGEModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n }\n\n public static configure(environment: ServiceConfig['environment']): void {\n CommunityClient.config = getApiClientConfig(environment);\n CommunityClient.instance = new CommunityClient();\n }\n\n private static getInstance(): CommunityClient {\n if (!CommunityClient.instance) {\n throw new Error(\n 'Client is not configured. Please configure it before using.',\n );\n }\n return CommunityClient.instance;\n }\n\n /**\n * Provides access to the VoteModule instance.\n * This getter allows for interacting with vote-related functionalities.\n *\n * @returns {VoteModule} An instance of VoteModule for vote operations.\n * @memberof CommunityClient\n */\n public static get vote(): VoteModule {\n return CommunityClient.getInstance()._voteModule;\n }\n\n /**\n * Provides access to the SbtModule instance.\n * This getter allows for interacting with vote-related functionalities.\n *\n * @returns {SbtModule} An instance of SbtModule for vote operations.\n * @memberof CommunityClient\n */\n public static get sbt(): SbtModule {\n return CommunityClient.getInstance()._sbtModule;\n }\n\n /**\n * Provides access to the VltzModule instance.\n * This getter allows for interacting with vote-related functionalities.\n *\n * @returns {VltzModule} An instance of VltzModule for vote operations.\n * @memberof CommunityClient\n */\n public static get vltz(): VltzModule {\n return CommunityClient.getInstance()._vltzModule;\n }\n\n /**\n * Provides access to the LGEModule instance.\n * This getter allows for interacting with LGE-related functionalities.\n *\n * @returns {LGEModule} An instance of LGEModule for LGE operations.\n * @memberof CommunityClient\n */\n public static get lge(): LGEModule {\n return CommunityClient.getInstance()._lgeModule;\n }\n\n /**\n * Provides access to the TGEModule instance.\n * This getter allows for interacting with TGE-related functionalities.\n *\n * @returns {TGEModule} An instance of TGEModule for TGE operations.\n * @memberof CommunityClient\n */\n public static get tge(): TGEModule {\n return CommunityClient.getInstance()._tgeModule;\n }\n\n /**\n * Provides access to the ReferralModule instance.\n * This getter allows for interacting with referral related functionalities.\n *\n * @returns {ReferralModule} An instance of ReferralModule .\n * @memberof CommunityClient\n */\n public static get referral(): ReferralModule {\n return CommunityClient.getInstance()._referralModule;\n }\n\n /**\n * Provides access to the DiscordModule instance.\n * This getter allows for interacting with discord-related functionalities.\n *\n * @returns {DiscordModule} An instance of DiscordModule.\n * @memberof CommunityClient\n */\n public static get discord(): DiscordModule {\n return CommunityClient.getInstance()._discordModule;\n }\n\n public static get supportedChain(): number {\n return CommunityClient.config.chain;\n }\n}\n"]}
|
package/dist/index.js
CHANGED
|
@@ -21,4 +21,5 @@ __exportStar(require("./modules/referral/types"), exports);
|
|
|
21
21
|
__exportStar(require("./modules/discord/types"), exports);
|
|
22
22
|
__exportStar(require("./modules/sbt/types"), exports);
|
|
23
23
|
__exportStar(require("./modules/vltz/types"), exports);
|
|
24
|
+
__exportStar(require("./modules/tge/types"), exports);
|
|
24
25
|
//# 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,uDAAqC;AACrC,sDAAoC;AACpC,2DAAyC;AACzC,0DAAwC;AACxC,sDAAoC;AACpC,uDAAqC","sourcesContent":["export * from './client';\nexport * from './modules/vote/types';\nexport * from './modules/lge/types';\nexport * from './modules/referral/types';\nexport * from './modules/discord/types';\nexport * from './modules/sbt/types';\nexport * from './modules/vltz/types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,uDAAqC;AACrC,sDAAoC;AACpC,2DAAyC;AACzC,0DAAwC;AACxC,sDAAoC;AACpC,uDAAqC;AACrC,sDAAoC","sourcesContent":["export * from './client';\nexport * from './modules/vote/types';\nexport * from './modules/lge/types';\nexport * from './modules/referral/types';\nexport * from './modules/discord/types';\nexport * from './modules/sbt/types';\nexport * from './modules/vltz/types';\nexport * from './modules/tge/types';\n"]}
|
package/dist/modules/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,wCAAsB;AACtB,6CAA2B;AAC3B,4CAA0B;AAC1B,wCAAsB;AACtB,yCAAuB","sourcesContent":["export * from './vote';\nexport * from './lge';\nexport * from './referral';\nexport * from './discord';\nexport * from './sbt';\nexport * from './vltz';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,wCAAsB;AACtB,6CAA2B;AAC3B,4CAA0B;AAC1B,wCAAsB;AACtB,yCAAuB;AACvB,wCAAsB","sourcesContent":["export * from './vote';\nexport * from './lge';\nexport * from './referral';\nexport * from './discord';\nexport * from './sbt';\nexport * from './vltz';\nexport * from './tge';\n"]}
|
|
@@ -75,31 +75,9 @@ var LGEModule = /** @class */ (function (_super) {
|
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
|
-
// TODO: implement this mock
|
|
79
|
-
LGEModule.prototype.getReyaChecker = function (params) {
|
|
80
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
81
|
-
var walletNumber, isEligibleForRcp, isEligibleForVltz, isEligibleForOgNft, isEligibleForOthers;
|
|
82
|
-
return __generator(this, function (_a) {
|
|
83
|
-
walletNumber = parseInt(params.wallet.slice(-1));
|
|
84
|
-
isEligibleForRcp = walletNumber % 2 === 0;
|
|
85
|
-
isEligibleForVltz = walletNumber % 3 === 0;
|
|
86
|
-
isEligibleForOgNft = walletNumber % 4 === 0;
|
|
87
|
-
isEligibleForOthers = walletNumber % 5 === 0;
|
|
88
|
-
return [2 /*return*/, {
|
|
89
|
-
isEligibleForRcp: isEligibleForRcp,
|
|
90
|
-
isEligibleForVltz: isEligibleForVltz,
|
|
91
|
-
isEligibleForOgNft: isEligibleForOgNft,
|
|
92
|
-
isEligibleForOthers: isEligibleForOthers,
|
|
93
|
-
}];
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
78
|
__decorate([
|
|
98
79
|
(0, common_1.Logger)('LGEModule.getLpTvl')
|
|
99
80
|
], LGEModule.prototype, "getLpTvl", null);
|
|
100
|
-
__decorate([
|
|
101
|
-
(0, common_1.Logger)('LGEModule.getReyaChecker')
|
|
102
|
-
], LGEModule.prototype, "getReyaChecker", null);
|
|
103
81
|
return LGEModule;
|
|
104
82
|
}(common_1.RestClient));
|
|
105
83
|
exports.default = LGEModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA+D;AAI/D;IAAuC,6BAAU;IAG/C,mBAAY,MAAc,EAAE,cAAuB;QACjD,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QAHhB,oBAAc,GAAY,KAAK,CAAC;QAI9B,KAAI,CAAC,cAAc,GAAG,cAAc,CAAC;;IACvC,CAAC;IAGK,4BAAQ,GAAR;;;;gBACE,GAAG,GAAG,gBAAgB,CAAC;gBAC7B,sBAAO,IAAI,CAAC,GAAG,CAAiB,GAAG,CAAC,EAAC;;;KACtC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA+D;AAI/D;IAAuC,6BAAU;IAG/C,mBAAY,MAAc,EAAE,cAAuB;QACjD,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QAHhB,oBAAc,GAAY,KAAK,CAAC;QAI9B,KAAI,CAAC,cAAc,GAAG,cAAc,CAAC;;IACvC,CAAC;IAGK,4BAAQ,GAAR;;;;gBACE,GAAG,GAAG,gBAAgB,CAAC;gBAC7B,sBAAO,IAAI,CAAC,GAAG,CAAiB,GAAG,CAAC,EAAC;;;KACtC;IAHK;QADL,IAAA,eAAM,EAAC,oBAAoB,CAAC;6CAI5B;IACH,gBAAC;CAAA,AAbD,CAAuC,mBAAU,GAahD;kBAboB,SAAS","sourcesContent":["import { RestClient, Loggable, Logger } from '@reyaxyz/common';\n\nimport { GetLpTvlResult } from './types';\n\nexport default class LGEModule extends RestClient implements Loggable {\n loggingEnabled: boolean = false;\n\n constructor(apiUrl: string, loggingEnabled: boolean) {\n super(apiUrl);\n this.loggingEnabled = loggingEnabled;\n }\n\n @Logger('LGEModule.getLpTvl')\n async getLpTvl() {\n const uri = `/api/xp/lp-tvl`;\n return this.get<GetLpTvlResult>(uri);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/lge/types.ts"],"names":[],"mappings":"","sourcesContent":["export { GetLpTvlResult, Rank, RankTrading } from '@reyaxyz/common';\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/lge/types.ts"],"names":[],"mappings":"","sourcesContent":["export { GetLpTvlResult, Rank, RankTrading } from '@reyaxyz/common';\n"]}
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
})();
|
|
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
|
+
};
|
|
23
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
24
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
25
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
26
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
27
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
28
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
29
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
33
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
34
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
35
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
36
|
+
function step(op) {
|
|
37
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
38
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
39
|
+
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;
|
|
40
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
41
|
+
switch (op[0]) {
|
|
42
|
+
case 0: case 1: t = op; break;
|
|
43
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
44
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
45
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
46
|
+
default:
|
|
47
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
48
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
49
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
50
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
51
|
+
if (t[2]) _.ops.pop();
|
|
52
|
+
_.trys.pop(); continue;
|
|
53
|
+
}
|
|
54
|
+
op = body.call(thisArg, _);
|
|
55
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
56
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
+
var common_1 = require("@reyaxyz/common");
|
|
61
|
+
var TGEModule = /** @class */ (function (_super) {
|
|
62
|
+
__extends(TGEModule, _super);
|
|
63
|
+
function TGEModule(apiUrl, loggingEnabled) {
|
|
64
|
+
var _this = _super.call(this, apiUrl) || this;
|
|
65
|
+
_this.loggingEnabled = false;
|
|
66
|
+
_this.loggingEnabled = loggingEnabled;
|
|
67
|
+
return _this;
|
|
68
|
+
}
|
|
69
|
+
TGEModule.prototype.getReyaChecker = function (params) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
+
var uri;
|
|
72
|
+
return __generator(this, function (_a) {
|
|
73
|
+
uri = "/api/tge/eligibility-check/".concat(params.wallet);
|
|
74
|
+
return [2 /*return*/, this.get(uri)];
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, common_1.Logger)('TGEModule.getReyaChecker')
|
|
80
|
+
], TGEModule.prototype, "getReyaChecker", null);
|
|
81
|
+
return TGEModule;
|
|
82
|
+
}(common_1.RestClient));
|
|
83
|
+
exports.default = TGEModule;
|
|
84
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/tge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA+D;AAI/D;IAAuC,6BAAU;IAG/C,mBAAY,MAAc,EAAE,cAAuB;QACjD,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QAHhB,oBAAc,GAAY,KAAK,CAAC;QAI9B,KAAI,CAAC,cAAc,GAAG,cAAc,CAAC;;IACvC,CAAC;IAGK,kCAAc,GAAd,UAAe,MAA4B;;;;gBACzC,GAAG,GAAG,qCAA8B,MAAM,CAAC,MAAM,CAAE,CAAC;gBAC1D,sBAAO,IAAI,CAAC,GAAG,CAAuB,GAAG,CAAC,EAAC;;;KAC5C;IAHK;QADL,IAAA,eAAM,EAAC,0BAA0B,CAAC;mDAIlC;IACH,gBAAC;CAAA,AAbD,CAAuC,mBAAU,GAahD;kBAboB,SAAS","sourcesContent":["import { RestClient, Loggable, Logger } from '@reyaxyz/common';\n\nimport { GetReyaCheckerResult, GetReyaCheckerParams } from './types';\n\nexport default class TGEModule 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('TGEModule.getReyaChecker')\n async getReyaChecker(params: GetReyaCheckerParams) {\n const uri = `/api/tge/eligibility-check/${params.wallet}`;\n return this.get<GetReyaCheckerResult>(uri);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/tge/types.ts"],"names":[],"mappings":"","sourcesContent":["export { GetReyaCheckerResult } from '@reyaxyz/common';\n\nexport type GetReyaCheckerParams = {\n wallet: string;\n};\n"]}
|
|
@@ -5,6 +5,7 @@ import SbtModule from '../modules/sbt';
|
|
|
5
5
|
import ReferralModule from '../modules/referral';
|
|
6
6
|
import DiscordModule from '../modules/discord';
|
|
7
7
|
import VltzModule from '../modules/vltz';
|
|
8
|
+
import TGEModule from '../modules/tge';
|
|
8
9
|
/**
|
|
9
10
|
* @description Client for Community SDK, used to interact with the Reya community.
|
|
10
11
|
*/
|
|
@@ -17,6 +18,7 @@ export declare class CommunityClient {
|
|
|
17
18
|
private readonly _lgeModule;
|
|
18
19
|
private readonly _referralModule;
|
|
19
20
|
private readonly _discordModule;
|
|
21
|
+
private readonly _tgeModule;
|
|
20
22
|
private constructor();
|
|
21
23
|
static configure(environment: ServiceConfig['environment']): void;
|
|
22
24
|
private static getInstance;
|
|
@@ -52,6 +54,14 @@ export declare class CommunityClient {
|
|
|
52
54
|
* @memberof CommunityClient
|
|
53
55
|
*/
|
|
54
56
|
static get lge(): LGEModule;
|
|
57
|
+
/**
|
|
58
|
+
* Provides access to the TGEModule instance.
|
|
59
|
+
* This getter allows for interacting with TGE-related functionalities.
|
|
60
|
+
*
|
|
61
|
+
* @returns {TGEModule} An instance of TGEModule for TGE operations.
|
|
62
|
+
* @memberof CommunityClient
|
|
63
|
+
*/
|
|
64
|
+
static get tge(): TGEModule;
|
|
55
65
|
/**
|
|
56
66
|
* Provides access to the ReferralModule instance.
|
|
57
67
|
* This getter allows for interacting with referral related functionalities.
|
|
@@ -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,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,cAAc,MAA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AAG,IAAI,SAAS,CAEjC;IAED;;;;;;OAMG;IACH,WAAkB,GAAG,IAAI,SAAS,CAEjC;IAED;;;;;;OAMG;IACH,WAAkB,QAAQ,IAAI,cAAc,CAE3C;IAED;;;;;;OAMG;IACH,WAAkB,OAAO,IAAI,aAAa,CAEzC;IAED,WAAkB,cAAc,IAAI,MAAM,CAEzC;CACF"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC"}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { RestClient, Loggable } from '@reyaxyz/common';
|
|
2
|
-
import { GetLpTvlResult
|
|
2
|
+
import { GetLpTvlResult } from './types';
|
|
3
3
|
export default class LGEModule extends RestClient implements Loggable {
|
|
4
4
|
loggingEnabled: boolean;
|
|
5
5
|
constructor(apiUrl: string, loggingEnabled: boolean);
|
|
6
6
|
getLpTvl(): Promise<GetLpTvlResult>;
|
|
7
|
-
getReyaChecker(params: GetReyaCheckerParams): Promise<{
|
|
8
|
-
isEligibleForRcp: boolean;
|
|
9
|
-
isEligibleForVltz: boolean;
|
|
10
|
-
isEligibleForOgNft: boolean;
|
|
11
|
-
isEligibleForOthers: boolean;
|
|
12
|
-
}>;
|
|
13
7
|
}
|
|
14
8
|
//# 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,UAAU,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/lge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAW,YAAW,QAAQ;IACnE,cAAc,EAAE,OAAO,CAAS;gBAEpB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO;IAM7C,QAAQ;CAIf"}
|
|
@@ -1,11 +1,2 @@
|
|
|
1
1
|
export { GetLpTvlResult, Rank, RankTrading } from '@reyaxyz/common';
|
|
2
|
-
export type GetReyaCheckerParams = {
|
|
3
|
-
wallet: string;
|
|
4
|
-
};
|
|
5
|
-
export type GetReyaCheckerResult = {
|
|
6
|
-
isEligibleForRcp: boolean;
|
|
7
|
-
isEligibleForVltz: boolean;
|
|
8
|
-
isEligibleForOgNft: boolean;
|
|
9
|
-
isEligibleForOthers: boolean;
|
|
10
|
-
};
|
|
11
2
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/lge/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/lge/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RestClient, Loggable } from '@reyaxyz/common';
|
|
2
|
+
import { GetReyaCheckerResult, GetReyaCheckerParams } from './types';
|
|
3
|
+
export default class TGEModule extends RestClient implements Loggable {
|
|
4
|
+
loggingEnabled: boolean;
|
|
5
|
+
constructor(apiUrl: string, loggingEnabled: boolean);
|
|
6
|
+
getReyaChecker(params: GetReyaCheckerParams): Promise<GetReyaCheckerResult>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/tge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AAE/D,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAErE,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAW,YAAW,QAAQ;IACnE,cAAc,EAAE,OAAO,CAAS;gBAEpB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO;IAM7C,cAAc,CAAC,MAAM,EAAE,oBAAoB;CAIlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/tge/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/community-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"url": "https://github.com/Reya-Labs/reya-off-chain-monorepo.git"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@reyaxyz/common": "0.
|
|
14
|
-
"@reyaxyz/sdk": "0.
|
|
13
|
+
"@reyaxyz/common": "0.326.0",
|
|
14
|
+
"@reyaxyz/sdk": "0.141.0",
|
|
15
15
|
"ethers": "6.9.0"
|
|
16
16
|
},
|
|
17
17
|
"main": "dist/index.js",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"generate:coverage-badges": "npx istanbul-badges-readme --silent"
|
|
39
39
|
},
|
|
40
40
|
"packageManager": "pnpm@8.3.1",
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "4d924b28d12054826de4c30e13522d832bd8b618"
|
|
42
42
|
}
|
package/src/client/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ import SbtModule from '../modules/sbt';
|
|
|
5
5
|
import ReferralModule from '../modules/referral';
|
|
6
6
|
import DiscordModule from '../modules/discord';
|
|
7
7
|
import VltzModule from '../modules/vltz';
|
|
8
|
+
import TGEModule from '../modules/tge';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* @description Client for Community SDK, used to interact with the Reya community.
|
|
@@ -19,6 +20,7 @@ export class CommunityClient {
|
|
|
19
20
|
private readonly _lgeModule: LGEModule;
|
|
20
21
|
private readonly _referralModule: ReferralModule;
|
|
21
22
|
private readonly _discordModule: DiscordModule;
|
|
23
|
+
private readonly _tgeModule: TGEModule;
|
|
22
24
|
|
|
23
25
|
private constructor() {
|
|
24
26
|
this._voteModule = new VoteModule(
|
|
@@ -45,6 +47,10 @@ export class CommunityClient {
|
|
|
45
47
|
CommunityClient.config.apiEndpoint,
|
|
46
48
|
CommunityClient.config.logging,
|
|
47
49
|
);
|
|
50
|
+
this._tgeModule = new TGEModule(
|
|
51
|
+
CommunityClient.config.apiEndpoint,
|
|
52
|
+
CommunityClient.config.logging,
|
|
53
|
+
);
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
public static configure(environment: ServiceConfig['environment']): void {
|
|
@@ -105,6 +111,17 @@ export class CommunityClient {
|
|
|
105
111
|
return CommunityClient.getInstance()._lgeModule;
|
|
106
112
|
}
|
|
107
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Provides access to the TGEModule instance.
|
|
116
|
+
* This getter allows for interacting with TGE-related functionalities.
|
|
117
|
+
*
|
|
118
|
+
* @returns {TGEModule} An instance of TGEModule for TGE operations.
|
|
119
|
+
* @memberof CommunityClient
|
|
120
|
+
*/
|
|
121
|
+
public static get tge(): TGEModule {
|
|
122
|
+
return CommunityClient.getInstance()._tgeModule;
|
|
123
|
+
}
|
|
124
|
+
|
|
108
125
|
/**
|
|
109
126
|
* Provides access to the ReferralModule instance.
|
|
110
127
|
* This getter allows for interacting with referral related functionalities.
|
package/src/index.ts
CHANGED
package/src/modules/index.ts
CHANGED
package/src/modules/lge/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RestClient, Loggable, Logger } from '@reyaxyz/common';
|
|
2
2
|
|
|
3
|
-
import { GetLpTvlResult
|
|
3
|
+
import { GetLpTvlResult } from './types';
|
|
4
4
|
|
|
5
5
|
export default class LGEModule extends RestClient implements Loggable {
|
|
6
6
|
loggingEnabled: boolean = false;
|
|
@@ -15,20 +15,4 @@ export default class LGEModule extends RestClient implements Loggable {
|
|
|
15
15
|
const uri = `/api/xp/lp-tvl`;
|
|
16
16
|
return this.get<GetLpTvlResult>(uri);
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
// TODO: implement this mock
|
|
20
|
-
@Logger('LGEModule.getReyaChecker')
|
|
21
|
-
async getReyaChecker(params: GetReyaCheckerParams) {
|
|
22
|
-
const walletNumber = parseInt(params.wallet.slice(-1));
|
|
23
|
-
const isEligibleForRcp = walletNumber % 2 === 0;
|
|
24
|
-
const isEligibleForVltz = walletNumber % 3 === 0;
|
|
25
|
-
const isEligibleForOgNft = walletNumber % 4 === 0;
|
|
26
|
-
const isEligibleForOthers = walletNumber % 5 === 0;
|
|
27
|
-
return {
|
|
28
|
-
isEligibleForRcp,
|
|
29
|
-
isEligibleForVltz,
|
|
30
|
-
isEligibleForOgNft,
|
|
31
|
-
isEligibleForOthers,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
18
|
}
|
package/src/modules/lge/types.ts
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
1
|
export { GetLpTvlResult, Rank, RankTrading } from '@reyaxyz/common';
|
|
2
|
-
|
|
3
|
-
export type GetReyaCheckerParams = {
|
|
4
|
-
wallet: string;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export type GetReyaCheckerResult = {
|
|
8
|
-
isEligibleForRcp: boolean;
|
|
9
|
-
isEligibleForVltz: boolean;
|
|
10
|
-
isEligibleForOgNft: boolean;
|
|
11
|
-
isEligibleForOthers: boolean;
|
|
12
|
-
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RestClient, Loggable, Logger } from '@reyaxyz/common';
|
|
2
|
+
|
|
3
|
+
import { GetReyaCheckerResult, GetReyaCheckerParams } from './types';
|
|
4
|
+
|
|
5
|
+
export default class TGEModule extends RestClient implements Loggable {
|
|
6
|
+
loggingEnabled: boolean = false;
|
|
7
|
+
|
|
8
|
+
constructor(apiUrl: string, loggingEnabled: boolean) {
|
|
9
|
+
super(apiUrl);
|
|
10
|
+
this.loggingEnabled = loggingEnabled;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@Logger('TGEModule.getReyaChecker')
|
|
14
|
+
async getReyaChecker(params: GetReyaCheckerParams) {
|
|
15
|
+
const uri = `/api/tge/eligibility-check/${params.wallet}`;
|
|
16
|
+
return this.get<GetReyaCheckerResult>(uri);
|
|
17
|
+
}
|
|
18
|
+
}
|