@reyaxyz/community-sdk 0.1.13 → 0.1.15

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.
@@ -15,6 +15,10 @@ var CommunityClient = /** @class */ (function () {
15
15
  this._vote = new vote_1.default(CommunityClient.config.chainId);
16
16
  }
17
17
  CommunityClient.configure = function (params) {
18
+ if (!params.environment ||
19
+ ['test', 'production'].indexOf(params.environment) === -1) {
20
+ throw new Error('Client environment is incorrect or not provided. Consult the docs about ConfigureParams.');
21
+ }
18
22
  CommunityClient.instance = new CommunityClient(params);
19
23
  };
20
24
  CommunityClient.getInstance = function () {
@@ -1 +1 @@
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
+ {"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,IACE,CAAC,MAAM,CAAC,WAAW;YACnB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EACzD,CAAC;YACD,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;QACJ,CAAC;QACD,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;IA1Cc,sBAAM,GAAkB,0BAAc,CAAC,MAAM,CAAC,CAAC;IA2ChE,sBAAC;CAAA,AA7CD,IA6CC;AA7CY,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 if (\n !params.environment ||\n ['test', 'production'].indexOf(params.environment) === -1\n ) {\n throw new Error(\n 'Client environment is incorrect or not provided. Consult the docs about ConfigureParams.',\n );\n }\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 +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;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"}
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;IAYtD,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.13",
3
+ "version": "0.1.15",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/Reya-Labs/reya-off-chain-monorepo.git"
11
11
  },
12
12
  "dependencies": {
13
- "@reyaxyz/common": "0.8.0",
13
+ "@reyaxyz/common": "0.9.0",
14
14
  "ethers": "6.9.0"
15
15
  },
16
16
  "main": "dist/index.js",
@@ -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": "1c21fab331718ce5fb24cb5e6de3d90cc7994beb"
40
+ "gitHead": "64983505a52bbfaa37f97b979cc537eac6ba28af"
41
41
  }
@@ -19,6 +19,14 @@ export class CommunityClient {
19
19
  }
20
20
 
21
21
  public static configure(params: ConfigureParams): void {
22
+ if (
23
+ !params.environment ||
24
+ ['test', 'production'].indexOf(params.environment) === -1
25
+ ) {
26
+ throw new Error(
27
+ 'Client environment is incorrect or not provided. Consult the docs about ConfigureParams.',
28
+ );
29
+ }
22
30
  CommunityClient.instance = new CommunityClient(params);
23
31
  }
24
32