@reyaxyz/community-sdk 0.1.11 → 0.1.13

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.
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
@@ -23,7 +12,6 @@ var vote_1 = __importDefault(require("../modules/vote"));
23
12
  var CommunityClient = /** @class */ (function () {
24
13
  function CommunityClient(params) {
25
14
  CommunityClient.config = constants_1.SERVICE_CONFIG[params.environment];
26
- CommunityClient.config = __assign(__assign({}, CommunityClient.config), params);
27
15
  this._vote = new vote_1.default(CommunityClient.config.chainId);
28
16
  }
29
17
  CommunityClient.configure = function (params) {
@@ -49,9 +37,9 @@ var CommunityClient = /** @class */ (function () {
49
37
  enumerable: false,
50
38
  configurable: true
51
39
  });
52
- Object.defineProperty(CommunityClient, "supportedChains", {
40
+ Object.defineProperty(CommunityClient, "supportedChain", {
53
41
  get: function () {
54
- return [CommunityClient.config.chainId];
42
+ return CommunityClient.config.chainId;
55
43
  },
56
44
  enumerable: false,
57
45
  configurable: true
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAA4D;AAC5D,yDAAyC;AAOzC;;GAEG;AACH;IAKE,yBAAoB,MAAuB;QACzC,eAAe,CAAC,MAAM,GAAG,0BAAc,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC5D,eAAe,CAAC,MAAM,yBAAQ,eAAe,CAAC,MAAM,GAAK,MAAM,CAAE,CAAC;QAClE,IAAI,CAAC,KAAK,GAAG,IAAI,cAAU,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;IAEa,yBAAS,GAAvB,UAAwB,MAAuB;QAC7C,eAAe,CAAC,QAAQ,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IACzD,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;IAED,sBAAkB,kCAAe;aAAjC;YACE,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;;;OAAA;IAnCc,sBAAM,GAAkB,0BAAc,CAAC,MAAM,CAAC,CAAC;IAoChE,sBAAC;CAAA,AAtCD,IAsCC;AAtCY,0CAAe","sourcesContent":["import { SERVICE_CONFIG, ServiceConfig } from './constants';\nimport VoteModule from '../modules/vote';\nimport { ReyaChainId } from '@reyaxyz/common';\n\nexport type ConfigureParams = {\n environment: ServiceConfig['environment'];\n};\n\n/**\n * @description Client for Community SDK\n */\nexport class CommunityClient {\n private static instance: CommunityClient;\n private static config: ServiceConfig = SERVICE_CONFIG['test'];\n private readonly _vote: VoteModule;\n\n private constructor(params: ConfigureParams) {\n CommunityClient.config = SERVICE_CONFIG[params.environment];\n CommunityClient.config = { ...CommunityClient.config, ...params };\n this._vote = new VoteModule(CommunityClient.config.chainId);\n }\n\n public static configure(params: ConfigureParams): void {\n CommunityClient.instance = new CommunityClient(params);\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 public static get supportedChains(): ReyaChainId[] {\n return [CommunityClient.config.chainId];\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":";;;;;;AAAA,yCAA4D;AAC5D,yDAAyC;AAMzC;;GAEG;AACH;IAKE,yBAAoB,MAAuB;QACzC,eAAe,CAAC,MAAM,GAAG,0BAAc,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC5D,IAAI,CAAC,KAAK,GAAG,IAAI,cAAU,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;IAEa,yBAAS,GAAvB,UAAwB,MAAuB;QAC7C,eAAe,CAAC,QAAQ,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IACzD,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;IAED,sBAAkB,iCAAc;aAAhC;YACE,OAAO,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC;QACxC,CAAC;;;OAAA;IAlCc,sBAAM,GAAkB,0BAAc,CAAC,MAAM,CAAC,CAAC;IAmChE,sBAAC;CAAA,AArCD,IAqCC;AArCY,0CAAe","sourcesContent":["import { SERVICE_CONFIG, ServiceConfig } from './constants';\nimport VoteModule from '../modules/vote';\n\nexport type ConfigureParams = {\n environment: ServiceConfig['environment'];\n};\n\n/**\n * @description Client for Community SDK\n */\nexport class CommunityClient {\n private static instance: CommunityClient;\n private static config: ServiceConfig = SERVICE_CONFIG['test'];\n private readonly _vote: VoteModule;\n\n private constructor(params: ConfigureParams) {\n CommunityClient.config = SERVICE_CONFIG[params.environment];\n this._vote = new VoteModule(CommunityClient.config.chainId);\n }\n\n public static configure(params: ConfigureParams): void {\n CommunityClient.instance = new CommunityClient(params);\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 public static get supportedChain(): number {\n return CommunityClient.config.chainId;\n }\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  import { ServiceConfig } from './constants';
2
2
  import VoteModule from '../modules/vote';
3
- import { ReyaChainId } from '@reyaxyz/common';
4
3
  export type ConfigureParams = {
5
4
  environment: ServiceConfig['environment'];
6
5
  };
@@ -22,6 +21,6 @@ export declare class CommunityClient {
22
21
  * @memberof CommunityClient
23
22
  */
24
23
  static get vote(): VoteModule;
25
- static get supportedChains(): ReyaChainId[];
24
+ static get supportedChain(): number;
26
25
  }
27
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;CAC3C,CAAC;AAEF;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IACzC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAyC;IAC9D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IAEnC,OAAO;WAMO,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAItD,OAAO,CAAC,MAAM,CAAC,WAAW;IAS1B;;;;;;OAMG;IACH,WAAkB,IAAI,IAAI,UAAU,CAEnC;IAED,WAAkB,eAAe,IAAI,WAAW,EAAE,CAEjD;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;CAC3C,CAAC;AAEF;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IACzC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAyC;IAC9D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IAEnC,OAAO;WAKO,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAItD,OAAO,CAAC,MAAM,CAAC,WAAW;IAS1B;;;;;;OAMG;IACH,WAAkB,IAAI,IAAI,UAAU,CAEnC;IAED,WAAkB,cAAc,IAAI,MAAM,CAEzC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/community-sdk",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -37,5 +37,5 @@
37
37
  "generate:coverage-badges": "npx istanbul-badges-readme --silent"
38
38
  },
39
39
  "packageManager": "pnpm@8.10.4",
40
- "gitHead": "e0910e040a75b13194ebb5945242e400c9a9f4c1"
40
+ "gitHead": "1c21fab331718ce5fb24cb5e6de3d90cc7994beb"
41
41
  }
@@ -1,6 +1,5 @@
1
1
  import { SERVICE_CONFIG, ServiceConfig } from './constants';
2
2
  import VoteModule from '../modules/vote';
3
- import { ReyaChainId } from '@reyaxyz/common';
4
3
 
5
4
  export type ConfigureParams = {
6
5
  environment: ServiceConfig['environment'];
@@ -16,7 +15,6 @@ export class CommunityClient {
16
15
 
17
16
  private constructor(params: ConfigureParams) {
18
17
  CommunityClient.config = SERVICE_CONFIG[params.environment];
19
- CommunityClient.config = { ...CommunityClient.config, ...params };
20
18
  this._vote = new VoteModule(CommunityClient.config.chainId);
21
19
  }
22
20
 
@@ -44,7 +42,7 @@ export class CommunityClient {
44
42
  return CommunityClient.getInstance()._vote;
45
43
  }
46
44
 
47
- public static get supportedChains(): ReyaChainId[] {
48
- return [CommunityClient.config.chainId];
45
+ public static get supportedChain(): number {
46
+ return CommunityClient.config.chainId;
49
47
  }
50
48
  }