@show-karma/karma-gap-sdk 0.4.14 → 0.4.16

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 (189) hide show
  1. package/.cursorrules +43 -0
  2. package/core/abi/AirdropNFT.json +1 -1
  3. package/core/abi/Allo.json +860 -860
  4. package/core/abi/AlloRegistry.json +578 -578
  5. package/core/abi/CommunityResolverABI.json +506 -506
  6. package/core/abi/Donations.json +251 -251
  7. package/core/abi/EAS.json +1 -1
  8. package/core/abi/MultiAttester.json +746 -746
  9. package/core/abi/ProjectResolver.json +574 -574
  10. package/core/abi/SchemaRegistry.json +1 -1
  11. package/core/abi/index.ts +21 -0
  12. package/core/class/AllGapSchemas.ts +21 -0
  13. package/core/class/Attestation.ts +429 -0
  14. package/core/class/Fetcher.ts +224 -0
  15. package/core/class/GAP.ts +481 -0
  16. package/core/class/GapSchema.ts +93 -0
  17. package/core/class/Gelato/{Gelato.js → Gelato.ts} +23 -0
  18. package/core/class/GrantProgramRegistry/Allo.ts +188 -0
  19. package/core/class/GrantProgramRegistry/AlloRegistry.ts +101 -0
  20. package/core/class/GraphQL/AxiosGQL.ts +29 -0
  21. package/core/class/GraphQL/EASClient.ts +34 -0
  22. package/core/class/GraphQL/GapEasClient.ts +869 -0
  23. package/core/class/Schema.ts +659 -0
  24. package/core/class/SchemaError.ts +42 -0
  25. package/core/class/contract/GapContract.ts +457 -0
  26. package/core/class/entities/Community.ts +148 -0
  27. package/core/class/entities/ContributorProfile.ts +108 -0
  28. package/core/class/entities/Grant.ts +321 -0
  29. package/core/class/entities/GrantUpdate.ts +187 -0
  30. package/core/class/entities/MemberOf.ts +52 -0
  31. package/core/class/entities/Milestone.ts +898 -0
  32. package/core/class/entities/Project.ts +672 -0
  33. package/core/class/entities/ProjectImpact.ts +170 -0
  34. package/core/class/entities/ProjectMilestone.ts +254 -0
  35. package/core/class/entities/ProjectPointer.ts +39 -0
  36. package/core/class/entities/ProjectUpdate.ts +176 -0
  37. package/core/class/entities/Track.ts +32 -0
  38. package/core/class/karma-indexer/GapIndexerClient.ts +383 -0
  39. package/core/class/karma-indexer/api/GapIndexerApi.ts +446 -0
  40. package/core/class/karma-indexer/api/types.ts +313 -0
  41. package/core/class/remote-storage/IpfsStorage.ts +76 -0
  42. package/core/class/remote-storage/RemoteStorage.ts +65 -0
  43. package/core/class/types/allo.ts +93 -0
  44. package/core/class/types/attestations.ts +223 -0
  45. package/core/consts.ts +775 -0
  46. package/core/scripts/create-grant.ts +102 -0
  47. package/core/scripts/create-program.ts +43 -0
  48. package/core/scripts/create-schemas.ts +65 -0
  49. package/core/scripts/deploy.ts +65 -0
  50. package/core/scripts/index.ts +1 -0
  51. package/core/scripts/milestone-multi-grants.ts +125 -0
  52. package/core/shared/types.ts +13 -0
  53. package/core/types.ts +224 -0
  54. package/core/utils/gelato/send-gelato-txn.ts +114 -0
  55. package/core/utils/gelato/sponsor-handler.ts +77 -0
  56. package/core/utils/gelato/watch-gelato-txn.ts +67 -0
  57. package/core/utils/get-date.ts +3 -0
  58. package/core/utils/get-ipfs-data.ts +13 -0
  59. package/core/utils/get-web3-provider.ts +18 -0
  60. package/core/utils/gql-queries.ts +133 -0
  61. package/core/utils/map-filter.ts +21 -0
  62. package/core/utils/serialize-bigint.ts +7 -0
  63. package/core/utils/to-unix.ts +18 -0
  64. package/create-community-example.ts +119 -0
  65. package/csv-upload/README.md +74 -0
  66. package/csv-upload/config.ts +41 -0
  67. package/csv-upload/example.csv +2 -0
  68. package/csv-upload/keys.example.json +8 -0
  69. package/csv-upload/scripts/run.ts +417 -0
  70. package/csv-upload/types.ts +39 -0
  71. package/docs/.gitkeep +0 -0
  72. package/docs/images/attestation-architecture.png +0 -0
  73. package/docs/images/dfd-get-projects.png +0 -0
  74. package/gap-schema.yaml +155 -0
  75. package/milestone-workflow-example.ts +353 -0
  76. package/package.json +45 -39
  77. package/readme.md +872 -0
  78. package/schemas/.gitkeep +0 -0
  79. package/schemas/GAP-schemas-1692135812877.json +33 -0
  80. package/test-file-indexer-api.ts +25 -0
  81. package/tsconfig.json +26 -0
  82. package/core/abi/AlloCaller.json +0 -117
  83. package/core/abi/index.d.ts +0 -1114
  84. package/core/abi/index.js +0 -26
  85. package/core/class/AllGapSchemas.d.ts +0 -9
  86. package/core/class/AllGapSchemas.js +0 -19
  87. package/core/class/Attestation.d.ts +0 -173
  88. package/core/class/Attestation.js +0 -333
  89. package/core/class/Fetcher.d.ts +0 -175
  90. package/core/class/Fetcher.js +0 -13
  91. package/core/class/GAP.d.ts +0 -254
  92. package/core/class/GAP.js +0 -289
  93. package/core/class/GapSchema.d.ts +0 -34
  94. package/core/class/GapSchema.js +0 -62
  95. package/core/class/GrantProgramRegistry/Allo.d.ts +0 -17
  96. package/core/class/GrantProgramRegistry/Allo.js +0 -137
  97. package/core/class/GrantProgramRegistry/AlloRegistry.d.ts +0 -15
  98. package/core/class/GrantProgramRegistry/AlloRegistry.js +0 -70
  99. package/core/class/GraphQL/AxiosGQL.d.ts +0 -6
  100. package/core/class/GraphQL/AxiosGQL.js +0 -25
  101. package/core/class/GraphQL/EASClient.d.ts +0 -16
  102. package/core/class/GraphQL/EASClient.js +0 -26
  103. package/core/class/GraphQL/GapEasClient.d.ts +0 -71
  104. package/core/class/GraphQL/GapEasClient.js +0 -451
  105. package/core/class/GraphQL/index.js +0 -19
  106. package/core/class/Schema.d.ts +0 -233
  107. package/core/class/Schema.js +0 -488
  108. package/core/class/SchemaError.d.ts +0 -30
  109. package/core/class/SchemaError.js +0 -39
  110. package/core/class/contract/GapContract.d.ts +0 -102
  111. package/core/class/contract/GapContract.js +0 -285
  112. package/core/class/entities/Community.d.ts +0 -34
  113. package/core/class/entities/Community.js +0 -109
  114. package/core/class/entities/ContributorProfile.d.ts +0 -41
  115. package/core/class/entities/ContributorProfile.js +0 -69
  116. package/core/class/entities/Grant.d.ts +0 -54
  117. package/core/class/entities/Grant.js +0 -223
  118. package/core/class/entities/GrantUpdate.d.ts +0 -40
  119. package/core/class/entities/GrantUpdate.js +0 -114
  120. package/core/class/entities/MemberOf.d.ts +0 -11
  121. package/core/class/entities/MemberOf.js +0 -33
  122. package/core/class/entities/Milestone.d.ts +0 -168
  123. package/core/class/entities/Milestone.js +0 -657
  124. package/core/class/entities/Project.d.ts +0 -92
  125. package/core/class/entities/Project.js +0 -418
  126. package/core/class/entities/ProjectImpact.d.ts +0 -50
  127. package/core/class/entities/ProjectImpact.js +0 -112
  128. package/core/class/entities/ProjectMilestone.d.ts +0 -60
  129. package/core/class/entities/ProjectMilestone.js +0 -174
  130. package/core/class/entities/ProjectPointer.d.ts +0 -12
  131. package/core/class/entities/ProjectPointer.js +0 -22
  132. package/core/class/entities/ProjectUpdate.d.ts +0 -50
  133. package/core/class/entities/ProjectUpdate.js +0 -110
  134. package/core/class/entities/Track.d.ts +0 -16
  135. package/core/class/entities/Track.js +0 -21
  136. package/core/class/entities/index.js +0 -26
  137. package/core/class/index.js +0 -26
  138. package/core/class/karma-indexer/GapIndexerClient.d.ts +0 -66
  139. package/core/class/karma-indexer/GapIndexerClient.js +0 -207
  140. package/core/class/karma-indexer/api/GapIndexerApi.d.ts +0 -73
  141. package/core/class/karma-indexer/api/GapIndexerApi.js +0 -256
  142. package/core/class/karma-indexer/api/types.d.ts +0 -295
  143. package/core/class/karma-indexer/api/types.js +0 -2
  144. package/core/class/remote-storage/IpfsStorage.d.ts +0 -23
  145. package/core/class/remote-storage/IpfsStorage.js +0 -56
  146. package/core/class/remote-storage/RemoteStorage.d.ts +0 -41
  147. package/core/class/remote-storage/RemoteStorage.js +0 -38
  148. package/core/class/types/allo.d.ts +0 -78
  149. package/core/class/types/allo.js +0 -2
  150. package/core/class/types/attestations.d.ts +0 -168
  151. package/core/class/types/attestations.js +0 -66
  152. package/core/consts.d.ts +0 -48
  153. package/core/consts.js +0 -641
  154. package/core/index.js +0 -24
  155. package/core/shared/types.d.ts +0 -6
  156. package/core/shared/types.js +0 -2
  157. package/core/types.d.ts +0 -131
  158. package/core/types.js +0 -13
  159. package/core/utils/gelato/index.js +0 -19
  160. package/core/utils/gelato/send-gelato-txn.d.ts +0 -55
  161. package/core/utils/gelato/send-gelato-txn.js +0 -100
  162. package/core/utils/gelato/sponsor-handler.d.ts +0 -9
  163. package/core/utils/gelato/sponsor-handler.js +0 -60
  164. package/core/utils/gelato/watch-gelato-txn.d.ts +0 -7
  165. package/core/utils/gelato/watch-gelato-txn.js +0 -63
  166. package/core/utils/get-date.d.ts +0 -1
  167. package/core/utils/get-date.js +0 -7
  168. package/core/utils/get-ipfs-data.d.ts +0 -1
  169. package/core/utils/get-ipfs-data.js +0 -20
  170. package/core/utils/get-web3-provider.d.ts +0 -2
  171. package/core/utils/get-web3-provider.js +0 -18
  172. package/core/utils/gql-queries.d.ts +0 -12
  173. package/core/utils/gql-queries.js +0 -90
  174. package/core/utils/index.js +0 -23
  175. package/core/utils/map-filter.d.ts +0 -8
  176. package/core/utils/map-filter.js +0 -20
  177. package/core/utils/serialize-bigint.d.ts +0 -1
  178. package/core/utils/serialize-bigint.js +0 -8
  179. package/core/utils/to-unix.d.ts +0 -1
  180. package/core/utils/to-unix.js +0 -25
  181. package/index.js +0 -17
  182. /package/core/class/GraphQL/{index.d.ts → index.ts} +0 -0
  183. /package/core/class/entities/{index.d.ts → index.ts} +0 -0
  184. /package/core/class/{index.d.ts → index.ts} +0 -0
  185. /package/core/{index.d.ts → index.ts} +0 -0
  186. /package/core/utils/gelato/{index.d.ts → index.ts} +0 -0
  187. /package/core/utils/{index.d.ts → index.ts} +0 -0
  188. /package/{core/class/Gelato/Gelato.d.ts → csv-upload/.gitkeep} +0 -0
  189. /package/{index.d.ts → index.ts} +0 -0
File without changes
@@ -0,0 +1,33 @@
1
+ [
2
+ {
3
+ "type": 2,
4
+ "chainId": 11155111,
5
+ "nonce": 30,
6
+ "maxPriorityFeePerGas": {
7
+ "type": "BigNumber",
8
+ "hex": "0x59682f00"
9
+ },
10
+ "maxFeePerGas": {
11
+ "type": "BigNumber",
12
+ "hex": "0x70f1f3e4"
13
+ },
14
+ "gasPrice": null,
15
+ "gasLimit": {
16
+ "type": "BigNumber",
17
+ "hex": "0x4c4b40"
18
+ },
19
+ "to": "0x0a7E2Ff54e76B8E6659aedc9103FB21c038050D0",
20
+ "value": {
21
+ "type": "BigNumber",
22
+ "hex": "0x00"
23
+ },
24
+ "data": "0x60d7a278000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000c626f6f6c206772616e7465650000000000000000000000000000000000000000",
25
+ "accessList": [],
26
+ "hash": "0x0ac97981eefc8212d7e69a9cc035787195f90ebed1ebbd77d013b1baec943b73",
27
+ "v": 1,
28
+ "r": "0x19b4fbc082c1a8bd83ea660822a9d0a862791c905ca59ee4e49a016409df2436",
29
+ "s": "0x69c5955bbf676c31fd6b60fda6159a12db5bfcd3ad2acba40022869567a35f8b",
30
+ "from": "0x5A4830885f12438E00D8f4d98e9Fe083e707698C",
31
+ "confirmations": 0
32
+ }
33
+ ]
@@ -0,0 +1,25 @@
1
+ import { GAP } from "./core/class/GAP";
2
+ import { GapIndexerClient } from "./core/class/karma-indexer/GapIndexerClient";
3
+ import { Hex } from "./core/types";
4
+
5
+ const apiUrl = "https://gapstagapi.karmahq.xyz";
6
+ const projectId = "my-awesome-project";
7
+
8
+ async function test() {
9
+ // const indexer = new GapIndexerApi('https://gapstagapi.karmahq.xyz');
10
+ const gap = new GAP({
11
+ globalSchemas: false,
12
+ network: "optimism-sepolia",
13
+ apiClient: new GapIndexerClient(apiUrl),
14
+ });
15
+
16
+ const fetchedProject = await (projectId.startsWith("0x")
17
+ ? gap.fetch.projectById(projectId as Hex)
18
+ : gap.fetch.projectBySlug(projectId));
19
+
20
+ console.log(fetchedProject);
21
+
22
+ return fetchedProject;
23
+ }
24
+
25
+ test();
package/tsconfig.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["es2020"],
4
+ "module": "commonjs",
5
+ "target": "es2020",
6
+ "outDir": "./.dist",
7
+ "baseUrl": ".",
8
+ "declaration": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "resolveJsonModule": true
12
+ },
13
+ "exclude": [
14
+ "**/.dist",
15
+ "**/config",
16
+ "**/config/*",
17
+ "**/scripts",
18
+ "**/scripts/*",
19
+ "node_modules",
20
+ "./node_modules",
21
+ "./node_modules/*",
22
+ "./node_modules/@types/node/index.d.ts"
23
+ ],
24
+ "include": ["core/**/*.ts"],
25
+ "files": ["./index.ts"]
26
+ }
@@ -1,117 +0,0 @@
1
- [
2
- {
3
- "inputs": [
4
- {
5
- "internalType": "bytes32",
6
- "name": "_profileId",
7
- "type": "bytes32"
8
- },
9
- {
10
- "internalType": "address",
11
- "name": "_strategy",
12
- "type": "address"
13
- },
14
- {
15
- "internalType": "bytes",
16
- "name": "_initStrategyData",
17
- "type": "bytes"
18
- },
19
- {
20
- "internalType": "address",
21
- "name": "_token",
22
- "type": "address"
23
- },
24
- {
25
- "internalType": "uint256",
26
- "name": "_amount",
27
- "type": "uint256"
28
- },
29
- {
30
- "components": [
31
- {
32
- "internalType": "uint256",
33
- "name": "protocol",
34
- "type": "uint256"
35
- },
36
- {
37
- "internalType": "string",
38
- "name": "pointer",
39
- "type": "string"
40
- }
41
- ],
42
- "internalType": "struct IAllo.Metadata",
43
- "name": "_metadata",
44
- "type": "tuple"
45
- },
46
- {
47
- "internalType": "address[]",
48
- "name": "_managers",
49
- "type": "address[]"
50
- }
51
- ],
52
- "name": "createPool",
53
- "outputs": [
54
- {
55
- "internalType": "uint256",
56
- "name": "poolId",
57
- "type": "uint256"
58
- }
59
- ],
60
- "stateMutability": "payable",
61
- "type": "function"
62
- },
63
- {
64
- "inputs": [
65
- {
66
- "internalType": "uint256",
67
- "name": "_poolId",
68
- "type": "uint256"
69
- },
70
- {
71
- "components": [
72
- {
73
- "internalType": "uint256",
74
- "name": "protocol",
75
- "type": "uint256"
76
- },
77
- {
78
- "internalType": "string",
79
- "name": "pointer",
80
- "type": "string"
81
- }
82
- ],
83
- "internalType": "struct IAllo.Metadata",
84
- "name": "_metadata",
85
- "type": "tuple"
86
- }
87
- ],
88
- "name": "updatePoolMetadata",
89
- "outputs": [],
90
- "stateMutability": "nonpayable",
91
- "type": "function"
92
- },
93
- {
94
- "inputs": [
95
- {
96
- "internalType": "address",
97
- "name": "_alloAddress",
98
- "type": "address"
99
- }
100
- ],
101
- "stateMutability": "nonpayable",
102
- "type": "constructor"
103
- },
104
- {
105
- "inputs": [],
106
- "name": "allo",
107
- "outputs": [
108
- {
109
- "internalType": "contract IAllo",
110
- "name": "",
111
- "type": "address"
112
- }
113
- ],
114
- "stateMutability": "view",
115
- "type": "function"
116
- }
117
- ]