@reyaxyz/community-sdk 0.32.5 → 0.32.7

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.
@@ -98,10 +98,21 @@ var VoteModule = /** @class */ (function (_super) {
98
98
  // READ
99
99
  VoteModule.prototype.getVoteDetails = function (params) {
100
100
  return __awaiter(this, void 0, void 0, function () {
101
- var uri;
101
+ var uri, voteDetails, markdownDescription;
102
102
  return __generator(this, function (_a) {
103
- uri = "/api/vote/".concat(params.slug);
104
- return [2 /*return*/, this.get(uri)];
103
+ switch (_a.label) {
104
+ case 0:
105
+ uri = "/api/vote/".concat(params.slug);
106
+ return [4 /*yield*/, this.get(uri)];
107
+ case 1:
108
+ voteDetails = _a.sent();
109
+ markdownDescription = '';
110
+ voteDetails.description.split('\n ').forEach(function (i) {
111
+ markdownDescription = "".concat(markdownDescription, "\n\n").concat(i);
112
+ });
113
+ voteDetails.description = markdownDescription;
114
+ return [2 /*return*/, voteDetails];
115
+ }
105
116
  });
106
117
  });
107
118
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/vote/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA6C;AAS7C,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;;;;;;wBACrB,GAAG,GAAG,qCAA8B,MAAM,CAAC,IAAI,CAAE,CAAC;wBACvC,qBAAM,IAAI,CAAC,GAAG,CAA+B,GAAG,CAAC,EAAA;;wBAA5D,QAAQ,GAAG,SAAiD;wBAClE,sBAAO,IAAA,eAAI,wBAAM,MAAM,KAAE,eAAe,EAAE,QAAQ,CAAC,eAAe,IAAG,EAAC;;;;KACvE;IAED,OAAO;IAED,mCAAc,GAAd,UAAe,MAA4B;;;;gBACzC,GAAG,GAAG,oBAAa,MAAM,CAAC,IAAI,CAAE,CAAC;gBACvC,sBAAO,IAAI,CAAC,GAAG,CAAuB,GAAG,CAAC,EAAC;;;KAC5C;IAGK,kCAAa,GAAb,UAAc,MAA2B;;;;gBACvC,GAAG,GAAG,oBAAa,MAAM,CAAC,IAAI,mBAAS,MAAM,CAAC,OAAO,CAAE,CAAC;gBAC9D,sBAAO,IAAI,CAAC,GAAG,CAAsB,GAAG,CAAC,EAAC;;;KAC3C;IAjBK;QADL,IAAA,eAAM,EAAC,iBAAiB,CAAC;0CAKzB;IAIK;QADL,IAAA,eAAM,EAAC,2BAA2B,CAAC;oDAInC;IAGK;QADL,IAAA,eAAM,EAAC,0BAA0B,CAAC;mDAIlC;IACH,iBAAC;CAAA,AA5BD,CAAwC,mBAAU,GA4BjD;kBA5BoB,UAAU","sourcesContent":["import { RestClient } from '@reyaxyz/common';\nimport {\n GetVoteContractDetailsResult,\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 const uri = `/api/vote/contract-details/${params.slug}`;\n const metadata = await this.get<GetVoteContractDetailsResult>(uri);\n return vote({ ...params, contractAddress: metadata.contractAddress });\n }\n\n // READ\n @Logger('VoteModule.getVoteDetails')\n async getVoteDetails(params: GetVoteDetailsParams) {\n const uri = `/api/vote/${params.slug}`;\n return this.get<GetVoteDetailsResult>(uri);\n }\n\n @Logger('VoteModule.getVoteStatus')\n async getVoteStatus(params: GetVoteStatusParams) {\n const uri = `/api/vote/${params.slug}/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;AAS7C,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;;;;;;wBACrB,GAAG,GAAG,qCAA8B,MAAM,CAAC,IAAI,CAAE,CAAC;wBACvC,qBAAM,IAAI,CAAC,GAAG,CAA+B,GAAG,CAAC,EAAA;;wBAA5D,QAAQ,GAAG,SAAiD;wBAClE,sBAAO,IAAA,eAAI,wBAAM,MAAM,KAAE,eAAe,EAAE,QAAQ,CAAC,eAAe,IAAG,EAAC;;;;KACvE;IAED,OAAO;IAED,mCAAc,GAAd,UAAe,MAA4B;;;;;;wBACzC,GAAG,GAAG,oBAAa,MAAM,CAAC,IAAI,CAAE,CAAC;wBACnB,qBAAM,IAAI,CAAC,GAAG,CAAuB,GAAG,CAAC,EAAA;;wBAAvD,WAAW,GAAG,SAAyC;wBACzD,mBAAmB,GAAG,EAAE,CAAC;wBAC7B,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,UAAC,CAAC;4BAChD,mBAAmB,GAAG,UAAG,mBAAmB,iBAEhD,CAAC,CAAE,CAAC;wBACF,CAAC,CAAC,CAAC;wBACH,WAAW,CAAC,WAAW,GAAG,mBAAmB,CAAC;wBAC9C,sBAAO,WAAW,EAAC;;;;KACpB;IAGK,kCAAa,GAAb,UAAc,MAA2B;;;;gBACvC,GAAG,GAAG,oBAAa,MAAM,CAAC,IAAI,mBAAS,MAAM,CAAC,OAAO,CAAE,CAAC;gBAC9D,sBAAO,IAAI,CAAC,GAAG,CAAsB,GAAG,CAAC,EAAC;;;KAC3C;IAzBK;QADL,IAAA,eAAM,EAAC,iBAAiB,CAAC;0CAKzB;IAIK;QADL,IAAA,eAAM,EAAC,2BAA2B,CAAC;oDAYnC;IAGK;QADL,IAAA,eAAM,EAAC,0BAA0B,CAAC;mDAIlC;IACH,iBAAC;CAAA,AApCD,CAAwC,mBAAU,GAoCjD;kBApCoB,UAAU","sourcesContent":["import { RestClient } from '@reyaxyz/common';\nimport {\n GetVoteContractDetailsResult,\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 const uri = `/api/vote/contract-details/${params.slug}`;\n const metadata = await this.get<GetVoteContractDetailsResult>(uri);\n return vote({ ...params, contractAddress: metadata.contractAddress });\n }\n\n // READ\n @Logger('VoteModule.getVoteDetails')\n async getVoteDetails(params: GetVoteDetailsParams) {\n const uri = `/api/vote/${params.slug}`;\n const voteDetails = await this.get<GetVoteDetailsResult>(uri);\n let markdownDescription = '';\n voteDetails.description.split('\\n ').forEach((i) => {\n markdownDescription = `${markdownDescription}\n\n${i}`;\n });\n voteDetails.description = markdownDescription;\n return voteDetails;\n }\n\n @Logger('VoteModule.getVoteStatus')\n async getVoteStatus(params: GetVoteStatusParams) {\n const uri = `/api/vote/${params.slug}/user/${params.address}`;\n return this.get<GetVoteStatusResult>(uri);\n }\n}\n"]}
@@ -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,EAEL,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;IAQvB,cAAc,CAAC,MAAM,EAAE,oBAAoB;IAM3C,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,EAEL,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;IAQvB,cAAc,CAAC,MAAM,EAAE,oBAAoB;IAc3C,aAAa,CAAC,MAAM,EAAE,mBAAmB;CAIhD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/community-sdk",
3
- "version": "0.32.5",
3
+ "version": "0.32.7",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@reyaxyz/common": "0.93.1",
14
- "@reyaxyz/sdk": "0.78.2",
14
+ "@reyaxyz/sdk": "0.79.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": "4cb15327562c48491a5d1313386d207447f76772"
41
+ "gitHead": "5c333630b1decb78e085f0305bfe66cc86f03ee1"
42
42
  }
@@ -30,7 +30,15 @@ export default class VoteModule extends RestClient implements Loggable {
30
30
  @Logger('VoteModule.getVoteDetails')
31
31
  async getVoteDetails(params: GetVoteDetailsParams) {
32
32
  const uri = `/api/vote/${params.slug}`;
33
- return this.get<GetVoteDetailsResult>(uri);
33
+ const voteDetails = await this.get<GetVoteDetailsResult>(uri);
34
+ let markdownDescription = '';
35
+ voteDetails.description.split('\n ').forEach((i) => {
36
+ markdownDescription = `${markdownDescription}
37
+
38
+ ${i}`;
39
+ });
40
+ voteDetails.description = markdownDescription;
41
+ return voteDetails;
34
42
  }
35
43
 
36
44
  @Logger('VoteModule.getVoteStatus')