@reyaxyz/community-sdk 0.4.0 → 0.6.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 (86) hide show
  1. package/dist/client/index.js +10 -13
  2. package/dist/client/index.js.map +1 -1
  3. package/dist/index.js +0 -4
  4. package/dist/index.js.map +1 -1
  5. package/dist/modules/twitter/services/get-auth-url/index.js +1 -1
  6. package/dist/modules/twitter/services/get-auth-url/index.js.map +1 -1
  7. package/dist/modules/vote/index.js +33 -10
  8. package/dist/modules/vote/index.js.map +1 -1
  9. package/dist/modules/vote/services/executeTransaction.js +99 -0
  10. package/dist/modules/vote/services/executeTransaction.js.map +1 -0
  11. package/dist/modules/vote/services/get-vote-details/index.js.map +1 -1
  12. package/dist/modules/vote/services/get-vote-status/index.js.map +1 -1
  13. package/dist/modules/vote/services/index.js +0 -3
  14. package/dist/modules/vote/services/index.js.map +1 -1
  15. package/dist/modules/vote/services/vote/encode.js +14 -0
  16. package/dist/modules/vote/services/vote/encode.js.map +1 -0
  17. package/dist/modules/vote/services/vote/index.js +22 -21
  18. package/dist/modules/vote/services/vote/index.js.map +1 -1
  19. package/dist/modules/vote/types.js.map +1 -0
  20. package/dist/types/client/index.d.ts +2 -5
  21. package/dist/types/client/index.d.ts.map +1 -1
  22. package/dist/types/index.d.ts +0 -4
  23. package/dist/types/index.d.ts.map +1 -1
  24. package/dist/types/modules/twitter/services/get-auth-url/index.d.ts.map +1 -1
  25. package/dist/types/modules/vote/index.d.ts +6 -8
  26. package/dist/types/modules/vote/index.d.ts.map +1 -1
  27. package/dist/types/modules/vote/services/executeTransaction.d.ts +13 -0
  28. package/dist/types/modules/vote/services/executeTransaction.d.ts.map +1 -0
  29. package/dist/types/modules/vote/services/get-vote-details/index.d.ts +1 -1
  30. package/dist/types/modules/vote/services/get-vote-details/index.d.ts.map +1 -1
  31. package/dist/types/modules/vote/services/get-vote-status/index.d.ts +1 -1
  32. package/dist/types/modules/vote/services/get-vote-status/index.d.ts.map +1 -1
  33. package/dist/types/modules/vote/services/index.d.ts +0 -3
  34. package/dist/types/modules/vote/services/index.d.ts.map +1 -1
  35. package/dist/types/modules/vote/services/vote/encode.d.ts +3 -0
  36. package/dist/types/modules/vote/services/vote/encode.d.ts.map +1 -0
  37. package/dist/types/modules/vote/services/vote/index.d.ts +2 -2
  38. package/dist/types/modules/vote/services/vote/index.d.ts.map +1 -1
  39. package/dist/types/modules/vote/types.d.ts +20 -0
  40. package/dist/types/modules/vote/types.d.ts.map +1 -0
  41. package/dist/types/utils/action.d.ts +11 -0
  42. package/dist/types/utils/action.d.ts.map +1 -0
  43. package/dist/types/utils/contractAddresses.d.ts +7 -0
  44. package/dist/types/utils/contractAddresses.d.ts.map +1 -0
  45. package/dist/{modules/vote/services/get-vote-status/types.js → utils/action.js} +1 -1
  46. package/dist/utils/action.js.map +1 -0
  47. package/dist/utils/contractAddresses.js +39 -0
  48. package/dist/utils/contractAddresses.js.map +1 -0
  49. package/package.json +4 -3
  50. package/src/client/index.ts +11 -21
  51. package/src/index.ts +0 -4
  52. package/src/modules/twitter/services/get-auth-url/index.ts +3 -1
  53. package/src/modules/vote/index.ts +13 -19
  54. package/src/modules/vote/services/executeTransaction.ts +58 -0
  55. package/src/modules/vote/services/get-vote-details/index.ts +2 -2
  56. package/src/modules/vote/services/get-vote-status/index.ts +2 -2
  57. package/src/modules/vote/services/index.ts +0 -3
  58. package/src/modules/vote/services/vote/encode.ts +12 -0
  59. package/src/modules/vote/services/vote/index.ts +21 -17
  60. package/src/modules/vote/types.ts +23 -0
  61. package/src/utils/action.ts +10 -0
  62. package/src/utils/contractAddresses.ts +43 -0
  63. package/dist/client/constants.js +0 -24
  64. package/dist/client/constants.js.map +0 -1
  65. package/dist/modules/vote/services/get-vote-details/types.js.map +0 -1
  66. package/dist/modules/vote/services/get-vote-status/types.js.map +0 -1
  67. package/dist/modules/vote/services/vote/types.js +0 -3
  68. package/dist/modules/vote/services/vote/types.js.map +0 -1
  69. package/dist/types/client/constants.d.ts +0 -12
  70. package/dist/types/client/constants.d.ts.map +0 -1
  71. package/dist/types/modules/vote/services/get-vote-details/types.d.ts +0 -6
  72. package/dist/types/modules/vote/services/get-vote-details/types.d.ts.map +0 -1
  73. package/dist/types/modules/vote/services/get-vote-status/types.d.ts +0 -7
  74. package/dist/types/modules/vote/services/get-vote-status/types.d.ts.map +0 -1
  75. package/dist/types/modules/vote/services/vote/types.d.ts +0 -11
  76. package/dist/types/modules/vote/services/vote/types.d.ts.map +0 -1
  77. package/dist/types/types.d.ts +0 -13
  78. package/dist/types/types.d.ts.map +0 -1
  79. package/dist/types.js +0 -3
  80. package/dist/types.js.map +0 -1
  81. package/src/client/constants.ts +0 -34
  82. package/src/modules/vote/services/get-vote-details/types.ts +0 -6
  83. package/src/modules/vote/services/get-vote-status/types.ts +0 -7
  84. package/src/modules/vote/services/vote/types.ts +0 -11
  85. package/src/types.ts +0 -13
  86. /package/dist/modules/vote/{services/get-vote-details/types.js → types.js} +0 -0
@@ -1,34 +0,0 @@
1
- import { ReyaChainId } from '@reyaxyz/common';
2
-
3
- export type ServiceEnvironment = 'production' | 'test';
4
-
5
- export type ServiceConfig = {
6
- chainId: ReyaChainId;
7
- twitter: {
8
- clientId: string;
9
- redirectURI: string;
10
- };
11
- environment: ServiceEnvironment;
12
- };
13
-
14
- export const SERVICE_CONFIG: Record<ServiceEnvironment, ServiceConfig> = {
15
- production: {
16
- environment: 'production',
17
- chainId: ReyaChainId.reyaNetwork,
18
- // todo: change to production creds when new app is created
19
- twitter: {
20
- clientId: 'LTBKa25VWkpjaEtSMzRGVEZaYmU6MTpjaQ',
21
- redirectURI:
22
- 'https://m8mjgmqmte.eu-central-1.awsapprunner.com/api/twitter/share',
23
- },
24
- },
25
- test: {
26
- environment: 'test',
27
- chainId: ReyaChainId.reyaCronos,
28
- twitter: {
29
- clientId: 'LTBKa25VWkpjaEtSMzRGVEZaYmU6MTpjaQ',
30
- redirectURI:
31
- 'https://m8mjgmqmte.eu-central-1.awsapprunner.com/api/twitter/share',
32
- },
33
- },
34
- };
@@ -1,6 +0,0 @@
1
- import { VoteDetailsEntity } from '../../../../types';
2
-
3
- export type GetVoteDetailsParams = {
4
- id: VoteDetailsEntity['id'];
5
- };
6
- export type GetVoteDetailsResult = VoteDetailsEntity;
@@ -1,7 +0,0 @@
1
- import { VoteDetailsEntity, VoteStatusEntity } from '../../../../types';
2
-
3
- export type GetVoteStatusParams = {
4
- address: string;
5
- id: VoteDetailsEntity['id'];
6
- };
7
- export type GetVoteStatusResult = VoteStatusEntity;
@@ -1,11 +0,0 @@
1
- import { VoteDetailsEntity } from '../../../../types';
2
- import { JsonRpcSigner, Signer } from 'ethers';
3
-
4
- export type VoteParams = {
5
- id: VoteDetailsEntity['id'];
6
- voted: 'yes' | 'no';
7
- signer: Signer | JsonRpcSigner;
8
- };
9
- export type VoteResult = {
10
- transactionHash: string;
11
- };
package/src/types.ts DELETED
@@ -1,13 +0,0 @@
1
- export type VoteDetailsEntity = {
2
- id: number;
3
- startDate: number; // timestamp in UTC milliseconds
4
- endDate: number; // timestamp in UTC milliseconds
5
- percentageToPass: number; // Example: 4%
6
- yesCount: number;
7
- noCount: number;
8
- };
9
-
10
- export type VoteStatusEntity = {
11
- votingPower: number;
12
- hasVoted: boolean;
13
- };