@geoprotocol/geo-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 (301) hide show
  1. package/dist/scripts/test-publish.d.ts +6 -0
  2. package/dist/scripts/test-publish.d.ts.map +1 -0
  3. package/dist/scripts/test-publish.js +121 -0
  4. package/dist/scripts/test-publish.js.map +1 -0
  5. package/dist/src/dao-space/constants.d.ts +34 -0
  6. package/dist/src/dao-space/constants.d.ts.map +1 -0
  7. package/dist/src/dao-space/constants.js +47 -0
  8. package/dist/src/dao-space/constants.js.map +1 -0
  9. package/dist/src/dao-space/index.d.ts +2 -1
  10. package/dist/src/dao-space/index.d.ts.map +1 -1
  11. package/dist/src/dao-space/index.js +1 -0
  12. package/dist/src/dao-space/index.js.map +1 -1
  13. package/dist/src/dao-space/propose-edit.d.ts +37 -0
  14. package/dist/src/dao-space/propose-edit.d.ts.map +1 -0
  15. package/dist/src/dao-space/propose-edit.js +116 -0
  16. package/dist/src/dao-space/propose-edit.js.map +1 -0
  17. package/dist/src/dao-space/propose-edit.test.d.ts +2 -0
  18. package/dist/src/dao-space/propose-edit.test.d.ts.map +1 -0
  19. package/dist/src/dao-space/propose-edit.test.js +196 -0
  20. package/dist/src/dao-space/propose-edit.test.js.map +1 -0
  21. package/dist/src/dao-space/types.d.ts +54 -0
  22. package/dist/src/dao-space/types.d.ts.map +1 -1
  23. package/dist/src/full-flow-test.test.js +57 -2
  24. package/dist/src/full-flow-test.test.js.map +1 -1
  25. package/dist/src/personal-space/publish-edit.d.ts.map +1 -1
  26. package/dist/src/personal-space/publish-edit.js +5 -2
  27. package/dist/src/personal-space/publish-edit.js.map +1 -1
  28. package/package.json +1 -1
  29. package/dist/constants.d.ts +0 -7
  30. package/dist/constants.d.ts.map +0 -1
  31. package/dist/constants.js +0 -8
  32. package/dist/constants.js.map +0 -1
  33. package/dist/convert-ids.d.ts +0 -2
  34. package/dist/convert-ids.d.ts.map +0 -1
  35. package/dist/convert-ids.js +0 -42
  36. package/dist/convert-ids.js.map +0 -1
  37. package/dist/protov2.d.ts +0 -11
  38. package/dist/protov2.d.ts.map +0 -1
  39. package/dist/protov2.js +0 -11
  40. package/dist/protov2.js.map +0 -1
  41. package/dist/src/codec/convert.d.ts +0 -18
  42. package/dist/src/codec/convert.d.ts.map +0 -1
  43. package/dist/src/codec/convert.js +0 -188
  44. package/dist/src/codec/convert.js.map +0 -1
  45. package/dist/src/core/blocks/image.d.ts +0 -15
  46. package/dist/src/core/blocks/image.d.ts.map +0 -1
  47. package/dist/src/core/blocks/image.js +0 -15
  48. package/dist/src/core/blocks/image.js.map +0 -1
  49. package/dist/src/core/idsv2/content.d.ts +0 -59
  50. package/dist/src/core/idsv2/content.d.ts.map +0 -1
  51. package/dist/src/core/idsv2/content.js +0 -59
  52. package/dist/src/core/idsv2/content.js.map +0 -1
  53. package/dist/src/core/idsv2/network.d.ts +0 -5
  54. package/dist/src/core/idsv2/network.d.ts.map +0 -1
  55. package/dist/src/core/idsv2/network.js +0 -5
  56. package/dist/src/core/idsv2/network.js.map +0 -1
  57. package/dist/src/core/idsv2/system.d.ts +0 -222
  58. package/dist/src/core/idsv2/system.d.ts.map +0 -1
  59. package/dist/src/core/idsv2/system.js +0 -230
  60. package/dist/src/core/idsv2/system.js.map +0 -1
  61. package/dist/src/core/image.d.ts +0 -40
  62. package/dist/src/core/image.d.ts.map +0 -1
  63. package/dist/src/core/image.js +0 -76
  64. package/dist/src/core/image.js.map +0 -1
  65. package/dist/src/core/image.test.d.ts +0 -2
  66. package/dist/src/core/image.test.d.ts.map +0 -1
  67. package/dist/src/core/image.test.js +0 -52
  68. package/dist/src/core/image.test.js.map +0 -1
  69. package/dist/src/core/relation.d.ts +0 -88
  70. package/dist/src/core/relation.d.ts.map +0 -1
  71. package/dist/src/core/relation.js +0 -89
  72. package/dist/src/core/relation.js.map +0 -1
  73. package/dist/src/core/relation.test.d.ts +0 -2
  74. package/dist/src/core/relation.test.d.ts.map +0 -1
  75. package/dist/src/core/relation.test.js +0 -45
  76. package/dist/src/core/relation.test.js.map +0 -1
  77. package/dist/src/core/triple.d.ts +0 -50
  78. package/dist/src/core/triple.d.ts.map +0 -1
  79. package/dist/src/core/triple.js +0 -56
  80. package/dist/src/core/triple.js.map +0 -1
  81. package/dist/src/core/triple.test.d.ts +0 -2
  82. package/dist/src/core/triple.test.d.ts.map +0 -1
  83. package/dist/src/core/triple.test.js +0 -37
  84. package/dist/src/core/triple.test.js.map +0 -1
  85. package/dist/src/encodings/get-register-space-calldata.d.ts +0 -32
  86. package/dist/src/encodings/get-register-space-calldata.d.ts.map +0 -1
  87. package/dist/src/encodings/get-register-space-calldata.js +0 -39
  88. package/dist/src/encodings/get-register-space-calldata.js.map +0 -1
  89. package/dist/src/encodings/get-register-space-calldata.test.d.ts +0 -2
  90. package/dist/src/encodings/get-register-space-calldata.test.d.ts.map +0 -1
  91. package/dist/src/encodings/get-register-space-calldata.test.js +0 -15
  92. package/dist/src/encodings/get-register-space-calldata.test.js.map +0 -1
  93. package/dist/src/graph/graph.test.d.ts +0 -2
  94. package/dist/src/graph/graph.test.d.ts.map +0 -1
  95. package/dist/src/graph/graph.test.js +0 -46
  96. package/dist/src/graph/graph.test.js.map +0 -1
  97. package/dist/src/graph/helpers/create-default-properties.d.ts +0 -5
  98. package/dist/src/graph/helpers/create-default-properties.d.ts.map +0 -1
  99. package/dist/src/graph/helpers/create-default-properties.js +0 -44
  100. package/dist/src/graph/helpers/create-default-properties.js.map +0 -1
  101. package/dist/src/graph/helpers/create-properties.d.ts +0 -8
  102. package/dist/src/graph/helpers/create-properties.d.ts.map +0 -1
  103. package/dist/src/graph/helpers/create-properties.js +0 -53
  104. package/dist/src/graph/helpers/create-properties.js.map +0 -1
  105. package/dist/src/graph/serialize.d.ts +0 -5
  106. package/dist/src/graph/serialize.d.ts.map +0 -1
  107. package/dist/src/graph/serialize.js +0 -13
  108. package/dist/src/graph/serialize.js.map +0 -1
  109. package/dist/src/graph/serialize.test.d.ts +0 -2
  110. package/dist/src/graph/serialize.test.d.ts.map +0 -1
  111. package/dist/src/graph/serialize.test.js +0 -49
  112. package/dist/src/graph/serialize.test.js.map +0 -1
  113. package/dist/src/graph/unset-entity-values.d.ts +0 -21
  114. package/dist/src/graph/unset-entity-values.d.ts.map +0 -1
  115. package/dist/src/graph/unset-entity-values.js +0 -31
  116. package/dist/src/graph/unset-entity-values.js.map +0 -1
  117. package/dist/src/graph/unset-entity-values.test.d.ts +0 -2
  118. package/dist/src/graph/unset-entity-values.test.d.ts.map +0 -1
  119. package/dist/src/graph/unset-entity-values.test.js +0 -40
  120. package/dist/src/graph/unset-entity-values.test.js.map +0 -1
  121. package/dist/src/graph/unset-relation-fields.d.ts +0 -26
  122. package/dist/src/graph/unset-relation-fields.d.ts.map +0 -1
  123. package/dist/src/graph/unset-relation-fields.js +0 -38
  124. package/dist/src/graph/unset-relation-fields.js.map +0 -1
  125. package/dist/src/graph/unset-relation-fields.test.d.ts +0 -2
  126. package/dist/src/graph/unset-relation-fields.test.d.ts.map +0 -1
  127. package/dist/src/graph/unset-relation-fields.test.js +0 -70
  128. package/dist/src/graph/unset-relation-fields.test.js.map +0 -1
  129. package/dist/src/graphv2/constants.d.ts +0 -2
  130. package/dist/src/graphv2/constants.d.ts.map +0 -1
  131. package/dist/src/graphv2/constants.js +0 -2
  132. package/dist/src/graphv2/constants.js.map +0 -1
  133. package/dist/src/graphv2/create-entity.d.ts +0 -52
  134. package/dist/src/graphv2/create-entity.d.ts.map +0 -1
  135. package/dist/src/graphv2/create-entity.js +0 -140
  136. package/dist/src/graphv2/create-entity.js.map +0 -1
  137. package/dist/src/graphv2/create-entity.test.d.ts +0 -2
  138. package/dist/src/graphv2/create-entity.test.d.ts.map +0 -1
  139. package/dist/src/graphv2/create-entity.test.js +0 -158
  140. package/dist/src/graphv2/create-entity.test.js.map +0 -1
  141. package/dist/src/graphv2/create-image.d.ts +0 -28
  142. package/dist/src/graphv2/create-image.d.ts.map +0 -1
  143. package/dist/src/graphv2/create-image.js +0 -71
  144. package/dist/src/graphv2/create-image.js.map +0 -1
  145. package/dist/src/graphv2/create-image.test.d.ts +0 -2
  146. package/dist/src/graphv2/create-image.test.d.ts.map +0 -1
  147. package/dist/src/graphv2/create-image.test.js +0 -142
  148. package/dist/src/graphv2/create-image.test.js.map +0 -1
  149. package/dist/src/graphv2/create-property.d.ts +0 -22
  150. package/dist/src/graphv2/create-property.d.ts.map +0 -1
  151. package/dist/src/graphv2/create-property.js +0 -129
  152. package/dist/src/graphv2/create-property.js.map +0 -1
  153. package/dist/src/graphv2/create-property.test.d.ts +0 -2
  154. package/dist/src/graphv2/create-property.test.d.ts.map +0 -1
  155. package/dist/src/graphv2/create-property.test.js +0 -82
  156. package/dist/src/graphv2/create-property.test.js.map +0 -1
  157. package/dist/src/graphv2/create-relation.d.ts +0 -33
  158. package/dist/src/graphv2/create-relation.d.ts.map +0 -1
  159. package/dist/src/graphv2/create-relation.js +0 -66
  160. package/dist/src/graphv2/create-relation.js.map +0 -1
  161. package/dist/src/graphv2/create-relation.test.d.ts +0 -2
  162. package/dist/src/graphv2/create-relation.test.d.ts.map +0 -1
  163. package/dist/src/graphv2/create-relation.test.js +0 -208
  164. package/dist/src/graphv2/create-relation.test.js.map +0 -1
  165. package/dist/src/graphv2/create-space.d.ts +0 -13
  166. package/dist/src/graphv2/create-space.d.ts.map +0 -1
  167. package/dist/src/graphv2/create-space.js +0 -21
  168. package/dist/src/graphv2/create-space.js.map +0 -1
  169. package/dist/src/graphv2/create-type.d.ts +0 -22
  170. package/dist/src/graphv2/create-type.d.ts.map +0 -1
  171. package/dist/src/graphv2/create-type.js +0 -64
  172. package/dist/src/graphv2/create-type.js.map +0 -1
  173. package/dist/src/graphv2/create-type.test.d.ts +0 -2
  174. package/dist/src/graphv2/create-type.test.d.ts.map +0 -1
  175. package/dist/src/graphv2/create-type.test.js +0 -109
  176. package/dist/src/graphv2/create-type.test.js.map +0 -1
  177. package/dist/src/graphv2/delete-entity.d.ts +0 -14
  178. package/dist/src/graphv2/delete-entity.d.ts.map +0 -1
  179. package/dist/src/graphv2/delete-entity.js +0 -21
  180. package/dist/src/graphv2/delete-entity.js.map +0 -1
  181. package/dist/src/graphv2/delete-entity.test.d.ts +0 -2
  182. package/dist/src/graphv2/delete-entity.test.d.ts.map +0 -1
  183. package/dist/src/graphv2/delete-entity.test.js +0 -24
  184. package/dist/src/graphv2/delete-entity.test.js.map +0 -1
  185. package/dist/src/graphv2/delete-relation.d.ts +0 -14
  186. package/dist/src/graphv2/delete-relation.d.ts.map +0 -1
  187. package/dist/src/graphv2/delete-relation.js +0 -21
  188. package/dist/src/graphv2/delete-relation.js.map +0 -1
  189. package/dist/src/graphv2/delete-relation.test.d.ts +0 -2
  190. package/dist/src/graphv2/delete-relation.test.d.ts.map +0 -1
  191. package/dist/src/graphv2/delete-relation.test.js +0 -24
  192. package/dist/src/graphv2/delete-relation.test.js.map +0 -1
  193. package/dist/src/graphv2/index.d.ts +0 -12
  194. package/dist/src/graphv2/index.d.ts.map +0 -1
  195. package/dist/src/graphv2/index.js +0 -12
  196. package/dist/src/graphv2/index.js.map +0 -1
  197. package/dist/src/graphv2/remove-entity-properties.d.ts +0 -25
  198. package/dist/src/graphv2/remove-entity-properties.d.ts.map +0 -1
  199. package/dist/src/graphv2/remove-entity-properties.js +0 -24
  200. package/dist/src/graphv2/remove-entity-properties.js.map +0 -1
  201. package/dist/src/graphv2/unset-entity-values.d.ts +0 -21
  202. package/dist/src/graphv2/unset-entity-values.d.ts.map +0 -1
  203. package/dist/src/graphv2/unset-entity-values.js +0 -26
  204. package/dist/src/graphv2/unset-entity-values.js.map +0 -1
  205. package/dist/src/graphv2/unset-entity-values.test.d.ts +0 -2
  206. package/dist/src/graphv2/unset-entity-values.test.d.ts.map +0 -1
  207. package/dist/src/graphv2/unset-entity-values.test.js +0 -40
  208. package/dist/src/graphv2/unset-entity-values.test.js.map +0 -1
  209. package/dist/src/graphv2/unset-relation-fields.d.ts +0 -25
  210. package/dist/src/graphv2/unset-relation-fields.d.ts.map +0 -1
  211. package/dist/src/graphv2/unset-relation-fields.js +0 -34
  212. package/dist/src/graphv2/unset-relation-fields.js.map +0 -1
  213. package/dist/src/graphv2/unset-relation-fields.test.d.ts +0 -2
  214. package/dist/src/graphv2/unset-relation-fields.test.d.ts.map +0 -1
  215. package/dist/src/graphv2/unset-relation-fields.test.js +0 -64
  216. package/dist/src/graphv2/unset-relation-fields.test.js.map +0 -1
  217. package/dist/src/graphv2/update-entity.d.ts +0 -28
  218. package/dist/src/graphv2/update-entity.d.ts.map +0 -1
  219. package/dist/src/graphv2/update-entity.js +0 -73
  220. package/dist/src/graphv2/update-entity.js.map +0 -1
  221. package/dist/src/graphv2/update-entity.test.d.ts +0 -2
  222. package/dist/src/graphv2/update-entity.test.d.ts.map +0 -1
  223. package/dist/src/graphv2/update-entity.test.js +0 -116
  224. package/dist/src/graphv2/update-entity.test.js.map +0 -1
  225. package/dist/src/graphv2/update-relation.d.ts +0 -21
  226. package/dist/src/graphv2/update-relation.d.ts.map +0 -1
  227. package/dist/src/graphv2/update-relation.js +0 -37
  228. package/dist/src/graphv2/update-relation.js.map +0 -1
  229. package/dist/src/idv2.d.ts +0 -27
  230. package/dist/src/idv2.d.ts.map +0 -1
  231. package/dist/src/idv2.js +0 -88
  232. package/dist/src/idv2.js.map +0 -1
  233. package/dist/src/idv2.test.d.ts +0 -2
  234. package/dist/src/idv2.test.d.ts.map +0 -1
  235. package/dist/src/idv2.test.js +0 -26
  236. package/dist/src/idv2.test.js.map +0 -1
  237. package/dist/src/image.d.ts +0 -8
  238. package/dist/src/image.d.ts.map +0 -1
  239. package/dist/src/image.js +0 -8
  240. package/dist/src/image.js.map +0 -1
  241. package/dist/src/ipfsv2.d.ts +0 -96
  242. package/dist/src/ipfsv2.d.ts.map +0 -1
  243. package/dist/src/ipfsv2.js +0 -163
  244. package/dist/src/ipfsv2.js.map +0 -1
  245. package/dist/src/ipfsv2.test.d.ts +0 -2
  246. package/dist/src/ipfsv2.test.d.ts.map +0 -1
  247. package/dist/src/ipfsv2.test.js +0 -22
  248. package/dist/src/ipfsv2.test.js.map +0 -1
  249. package/dist/src/proto/edit.d.ts +0 -11
  250. package/dist/src/proto/edit.d.ts.map +0 -1
  251. package/dist/src/proto/edit.js +0 -210
  252. package/dist/src/proto/edit.js.map +0 -1
  253. package/dist/src/proto/edit.test.d.ts +0 -2
  254. package/dist/src/proto/edit.test.d.ts.map +0 -1
  255. package/dist/src/proto/edit.test.js +0 -326
  256. package/dist/src/proto/edit.test.js.map +0 -1
  257. package/dist/src/proto/editv2.d.ts +0 -11
  258. package/dist/src/proto/editv2.d.ts.map +0 -1
  259. package/dist/src/proto/editv2.js +0 -81
  260. package/dist/src/proto/editv2.js.map +0 -1
  261. package/dist/src/proto/editv2.test.d.ts +0 -2
  262. package/dist/src/proto/editv2.test.d.ts.map +0 -1
  263. package/dist/src/proto/editv2.test.js +0 -211
  264. package/dist/src/proto/editv2.test.js.map +0 -1
  265. package/dist/src/proto/gen/src/proto/ipfs_pb.d.ts +0 -530
  266. package/dist/src/proto/gen/src/proto/ipfs_pb.d.ts.map +0 -1
  267. package/dist/src/proto/gen/src/proto/ipfs_pb.js +0 -706
  268. package/dist/src/proto/gen/src/proto/ipfs_pb.js.map +0 -1
  269. package/dist/src/proto/gen/src/proto/ipfsv2_pb.d.ts +0 -410
  270. package/dist/src/proto/gen/src/proto/ipfsv2_pb.d.ts.map +0 -1
  271. package/dist/src/proto/gen/src/proto/ipfsv2_pb.js +0 -536
  272. package/dist/src/proto/gen/src/proto/ipfsv2_pb.js.map +0 -1
  273. package/dist/src/relation.d.ts +0 -7
  274. package/dist/src/relation.d.ts.map +0 -1
  275. package/dist/src/relation.js +0 -7
  276. package/dist/src/relation.js.map +0 -1
  277. package/dist/src/smart-wallet-2.test-invalid.d.ts +0 -2
  278. package/dist/src/smart-wallet-2.test-invalid.d.ts.map +0 -1
  279. package/dist/src/smart-wallet-2.test-invalid.js +0 -49
  280. package/dist/src/smart-wallet-2.test-invalid.js.map +0 -1
  281. package/dist/src/smart-wallet-2.test.d.ts +0 -2
  282. package/dist/src/smart-wallet-2.test.d.ts.map +0 -1
  283. package/dist/src/smart-wallet-2.test.js +0 -49
  284. package/dist/src/smart-wallet-2.test.js.map +0 -1
  285. package/dist/src/system-ids-v2.d.ts +0 -7
  286. package/dist/src/system-ids-v2.d.ts.map +0 -1
  287. package/dist/src/system-ids-v2.js +0 -7
  288. package/dist/src/system-ids-v2.js.map +0 -1
  289. package/dist/src/triple.d.ts +0 -7
  290. package/dist/src/triple.d.ts.map +0 -1
  291. package/dist/src/triple.js +0 -7
  292. package/dist/src/triple.js.map +0 -1
  293. package/dist/src/types-backup.d.ts +0 -134
  294. package/dist/src/types-backup.d.ts.map +0 -1
  295. package/dist/src/types-backup.js +0 -13
  296. package/dist/src/types-backup.js.map +0 -1
  297. package/dist/src/typesv2.d.ts +0 -173
  298. package/dist/src/typesv2.d.ts.map +0 -1
  299. package/dist/src/typesv2.js +0 -8
  300. package/dist/src/typesv2.js.map +0 -1
  301. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Test script to verify publish-edit encoding fix.
3
+ * Uses smart account for gas sponsorship on Geo testnet (L3).
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=test-publish.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-publish.d.ts","sourceRoot":"","sources":["../../scripts/test-publish.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Test script to verify publish-edit encoding fix.
3
+ * Uses smart account for gas sponsorship on Geo testnet (L3).
4
+ */
5
+ import { personalSpace, Graph } from '../index.js';
6
+ import { createPublicClient, http } from 'viem';
7
+ import { createSmartAccountClient } from 'permissionless';
8
+ import { toSafeSmartAccount } from 'permissionless/accounts';
9
+ import { createPimlicoClient } from 'permissionless/clients/pimlico';
10
+ import { entryPoint07Address } from 'viem/account-abstraction';
11
+ import { privateKeyToAccount } from 'viem/accounts';
12
+ const SPACE_ID = '7fc1dc5b76b8b69624b9abc6c7978c00';
13
+ const PIMLICO_API_KEY = 'pim_KqHm63txxhbCYjdDaWaHqH';
14
+ const TESTNET_RPC_URL = 'https://rpc-geo-test-zc16z3tcvf.t.conduit.xyz';
15
+ const TESTNET_CHAIN_ID = 19411;
16
+ // Custom Safe contract addresses deployed on Geo testnet
17
+ const TESTNET_SAFE_ADDRESSES = {
18
+ safeModuleSetupAddress: "0x2dd68b007B46fBe91B9A7c3EDa5A7a1063cB5b47",
19
+ safe4337ModuleAddress: "0x75cf11467937ce3F2f357CE24ffc3DBF8fD5c226",
20
+ safeProxyFactoryAddress: "0xd9d2Ba03a7754250FDD71333F444636471CACBC4",
21
+ safeSingletonAddress: "0x639245e8476E03e789a244f279b5843b9633b2E7",
22
+ multiSendAddress: "0x7B21BBDBdE8D01Df591fdc2dc0bE9956Dde1e16C",
23
+ multiSendCallOnlyAddress: "0x32228dDEA8b9A2bd7f2d71A958fF241D79ca5eEC",
24
+ };
25
+ // Define Geo testnet chain
26
+ const geoTestnet = {
27
+ id: TESTNET_CHAIN_ID,
28
+ name: 'Geo Testnet',
29
+ nativeCurrency: {
30
+ name: 'Ethereum',
31
+ symbol: 'ETH',
32
+ decimals: 18,
33
+ },
34
+ rpcUrls: {
35
+ default: { http: [TESTNET_RPC_URL] },
36
+ public: { http: [TESTNET_RPC_URL] },
37
+ },
38
+ };
39
+ async function main() {
40
+ const privateKey = process.env.GEO_PRIVATE_KEY || process.env.PRIVATE_KEY;
41
+ if (!privateKey) {
42
+ console.error('Set GEO_PRIVATE_KEY or PRIVATE_KEY environment variable');
43
+ process.exit(1);
44
+ }
45
+ const account = privateKeyToAccount(privateKey);
46
+ console.log('EOA address:', account.address);
47
+ const publicClient = createPublicClient({
48
+ chain: geoTestnet,
49
+ transport: http(TESTNET_RPC_URL),
50
+ });
51
+ const safeAccount = await toSafeSmartAccount({
52
+ client: publicClient,
53
+ owners: [account],
54
+ entryPoint: {
55
+ address: entryPoint07Address,
56
+ version: '0.7',
57
+ },
58
+ version: '1.4.1',
59
+ ...TESTNET_SAFE_ADDRESSES,
60
+ });
61
+ console.log('Smart account address:', safeAccount.address);
62
+ const bundlerUrl = `https://api.pimlico.io/v2/${TESTNET_CHAIN_ID}/rpc?apikey=${PIMLICO_API_KEY}`;
63
+ const paymasterClient = createPimlicoClient({
64
+ transport: http(bundlerUrl),
65
+ chain: geoTestnet,
66
+ entryPoint: {
67
+ address: entryPoint07Address,
68
+ version: '0.7',
69
+ },
70
+ });
71
+ const smartAccountClient = createSmartAccountClient({
72
+ chain: geoTestnet,
73
+ account: safeAccount,
74
+ paymaster: paymasterClient,
75
+ bundlerTransport: http(bundlerUrl),
76
+ userOperation: {
77
+ estimateFeesPerGas: async () => {
78
+ return (await paymasterClient.getUserOperationGasPrice()).fast;
79
+ },
80
+ },
81
+ });
82
+ const { id, ops } = Graph.createEntity({
83
+ name: 'SDK Test Entity ' + Date.now(),
84
+ types: [],
85
+ });
86
+ console.log('Created entity:', id);
87
+ console.log('\nPublishing to IPFS...');
88
+ const { editId, cid, to, calldata } = await personalSpace.publishEdit({
89
+ name: 'Test publish from SDK',
90
+ spaceId: SPACE_ID,
91
+ ops,
92
+ author: safeAccount.address,
93
+ network: 'TESTNET',
94
+ });
95
+ console.log('Edit ID:', editId);
96
+ console.log('CID:', cid);
97
+ console.log('Contract (to):', to);
98
+ console.log('\nSending transaction via smart account...');
99
+ const hash = await smartAccountClient.sendTransaction({
100
+ to,
101
+ data: calldata,
102
+ });
103
+ console.log('Transaction hash:', hash);
104
+ console.log('\nWaiting for transaction receipt...');
105
+ const receipt = await publicClient.waitForTransactionReceipt({ hash });
106
+ console.log('Receipt status:', receipt.status);
107
+ console.log('Block number:', receipt.blockNumber);
108
+ if (receipt.status === 'success') {
109
+ console.log('\n✅ Transaction confirmed!');
110
+ console.log('Edit ID:', editId);
111
+ console.log('CID:', cid);
112
+ }
113
+ else {
114
+ console.log('\n❌ Transaction reverted!');
115
+ }
116
+ }
117
+ main().catch(err => {
118
+ console.error('Error:', err.message || err);
119
+ process.exit(1);
120
+ });
121
+ //# sourceMappingURL=test-publish.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-publish.js","sourceRoot":"","sources":["../../scripts/test-publish.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAc,MAAM,MAAM,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,QAAQ,GAAG,kCAAkC,CAAC;AACpD,MAAM,eAAe,GAAG,4BAA4B,CAAC;AACrD,MAAM,eAAe,GAAG,+CAA+C,CAAC;AACxE,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAE/B,yDAAyD;AACzD,MAAM,sBAAsB,GAAG;IAC7B,sBAAsB,EAAE,4CAAqD;IAC7E,qBAAqB,EAAE,4CAAqD;IAC5E,uBAAuB,EAAE,4CAAqD;IAC9E,oBAAoB,EAAE,4CAAqD;IAC3E,gBAAgB,EAAE,4CAAqD;IACvE,wBAAwB,EAAE,4CAAqD;CAChF,CAAC;AAEF,2BAA2B;AAC3B,MAAM,UAAU,GAAU;IACxB,EAAE,EAAE,gBAAgB;IACpB,IAAI,EAAE,aAAa;IACnB,cAAc,EAAE;QACd,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,EAAE;KACb;IAC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C,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;IAEvC,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,yBAAyB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACvE,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAElD,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QAC1C,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC;IAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Action hash for GOVERNANCE.PROPOSAL_CREATED
3
+ * Used when creating proposals via SpaceRegistry.enter()
4
+ */
5
+ export declare const PROPOSAL_CREATED_ACTION: `0x${string}`;
6
+ /**
7
+ * Empty topic (bytes32(0)) used for proposals
8
+ */
9
+ export declare const EMPTY_TOPIC: "0x0000000000000000000000000000000000000000000000000000000000000000";
10
+ /**
11
+ * Empty signature used when msg.sender == fromSpace
12
+ */
13
+ export declare const EMPTY_SIGNATURE: "0x";
14
+ /**
15
+ * Regex for bytes16 hex: 0x prefix + 32 hex characters (16 bytes)
16
+ */
17
+ export declare const BYTES16_HEX_REGEX: RegExp;
18
+ /**
19
+ * Regex for bytes32 hex: 0x prefix + 64 hex characters (32 bytes)
20
+ */
21
+ export declare const BYTES32_HEX_REGEX: RegExp;
22
+ /**
23
+ * Checks if a string is a valid bytes16 hex (0x prefix + 32 hex chars).
24
+ */
25
+ export declare function isBytes16Hex(value: string): boolean;
26
+ /**
27
+ * Converts a bytes32 hex string to bytes16 by taking the first 16 bytes.
28
+ */
29
+ export declare function toBytes16(hex32: `0x${string}`): `0x${string}`;
30
+ /**
31
+ * Converts a bytes16 hex string to bytes32 (left-aligned, right-padded with zeros).
32
+ */
33
+ export declare function bytes16ToBytes32LeftAligned(bytes16Hex: `0x${string}`): `0x${string}`;
34
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/dao-space/constants.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,uBAAuB,eAAkD,CAAC;AAEvF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAG,oEAA6E,CAAC;AAEzG;;GAEG;AACH,eAAO,MAAM,eAAe,EAAG,IAAa,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAwB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAwB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,MAAM,EAAE,GAAG,KAAK,MAAM,EAAE,CAI7D;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,KAAK,MAAM,EAAE,GAAG,KAAK,MAAM,EAAE,CAIpF"}
@@ -0,0 +1,47 @@
1
+ import { keccak256, toHex } from 'viem';
2
+ /**
3
+ * Action hash for GOVERNANCE.PROPOSAL_CREATED
4
+ * Used when creating proposals via SpaceRegistry.enter()
5
+ */
6
+ export const PROPOSAL_CREATED_ACTION = keccak256(toHex('GOVERNANCE.PROPOSAL_CREATED'));
7
+ /**
8
+ * Empty topic (bytes32(0)) used for proposals
9
+ */
10
+ export const EMPTY_TOPIC = '0x0000000000000000000000000000000000000000000000000000000000000000';
11
+ /**
12
+ * Empty signature used when msg.sender == fromSpace
13
+ */
14
+ export const EMPTY_SIGNATURE = '0x';
15
+ /**
16
+ * Regex for bytes16 hex: 0x prefix + 32 hex characters (16 bytes)
17
+ */
18
+ export const BYTES16_HEX_REGEX = /^0x[0-9a-fA-F]{32}$/;
19
+ /**
20
+ * Regex for bytes32 hex: 0x prefix + 64 hex characters (32 bytes)
21
+ */
22
+ export const BYTES32_HEX_REGEX = /^0x[0-9a-fA-F]{64}$/;
23
+ /**
24
+ * Checks if a string is a valid bytes16 hex (0x prefix + 32 hex chars).
25
+ */
26
+ export function isBytes16Hex(value) {
27
+ return BYTES16_HEX_REGEX.test(value);
28
+ }
29
+ /**
30
+ * Converts a bytes32 hex string to bytes16 by taking the first 16 bytes.
31
+ */
32
+ export function toBytes16(hex32) {
33
+ const s = hex32.toLowerCase();
34
+ if (!BYTES32_HEX_REGEX.test(s))
35
+ throw new Error(`Invalid hex32: ${hex32}`);
36
+ return `0x${s.slice(2, 34)}`;
37
+ }
38
+ /**
39
+ * Converts a bytes16 hex string to bytes32 (left-aligned, right-padded with zeros).
40
+ */
41
+ export function bytes16ToBytes32LeftAligned(bytes16Hex) {
42
+ const s = bytes16Hex.toLowerCase();
43
+ if (!BYTES16_HEX_REGEX.test(s))
44
+ throw new Error(`Invalid bytes16 hex: ${bytes16Hex}`);
45
+ return `0x${s.slice(2)}${'0'.repeat(32)}`;
46
+ }
47
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/dao-space/constants.ts"],"names":[],"mappings":"AAAA,OAAO,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js';
2
- export type { CreateSpaceParams, CreateSpaceResult } from './types.js';
2
+ export { proposeEdit } from './propose-edit.js';
3
+ export type { CreateSpaceParams, CreateSpaceResult, ProposeEditParams, ProposeEditResult, VotingMode, } from './types.js';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dao-space/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dao-space/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,GACX,MAAM,YAAY,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { createSpace } from './create-space.js';
2
+ export { proposeEdit } from './propose-edit.js';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dao-space/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dao-space/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import type { ProposeEditParams, ProposeEditResult } from './types.js';
2
+ /**
3
+ * Creates a proposal to publish an edit to a DAO space.
4
+ *
5
+ * This function:
6
+ * 1. Publishes the ops to IPFS using the GRC-20 binary format
7
+ * 2. Generates a unique proposal ID (or uses the provided one)
8
+ * 3. Encodes the proposal data for the SpaceRegistry's `enter()` function
9
+ *
10
+ * The proposal, when executed, will call the DAO space's `publish()` function
11
+ * to publish the edit. Since `publish()` is a valid fast-path action, with
12
+ * FAST voting mode and sufficient votes, the proposal will auto-execute.
13
+ *
14
+ * @param params - The parameters for creating the proposal
15
+ * @returns Object containing `editId`, `cid`, `to` (Space Registry address),
16
+ * `calldata`, and `proposalId`
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * import { daoSpace, Graph } from '@geoprotocol/geo-sdk';
21
+ *
22
+ * const { ops } = Graph.createEntity({ name: 'New Entity' });
23
+ * const { editId, cid, to, calldata, proposalId } = await daoSpace.proposeEdit({
24
+ * name: 'Add new entity',
25
+ * ops,
26
+ * author: '0x1234...',
27
+ * daoSpaceAddress: '0xDAOSpaceContractAddress...',
28
+ * callerSpaceId: '0xCallerBytes16SpaceId...',
29
+ * daoSpaceId: '0xDAOBytes16SpaceId...',
30
+ * });
31
+ *
32
+ * // Submit the transaction using viem or another client
33
+ * await walletClient.sendTransaction({ to, data: calldata });
34
+ * ```
35
+ */
36
+ export declare function proposeEdit(params: ProposeEditParams): Promise<ProposeEditResult>;
37
+ //# sourceMappingURL=propose-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propose-edit.d.ts","sourceRoot":"","sources":["../../../src/dao-space/propose-edit.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAkGvF"}
@@ -0,0 +1,116 @@
1
+ import { v4 as uuidv4 } from 'uuid';
2
+ import { encodeAbiParameters, encodeFunctionData } from 'viem';
3
+ import { TESTNET } from '../../contracts.js';
4
+ import { DaoSpaceAbi, SpaceRegistryAbi } from '../abis/index.js';
5
+ import * as Ipfs from '../ipfs.js';
6
+ import { bytes16ToBytes32LeftAligned, EMPTY_SIGNATURE, EMPTY_TOPIC, isBytes16Hex, PROPOSAL_CREATED_ACTION, } from './constants.js';
7
+ /**
8
+ * Creates a proposal to publish an edit to a DAO space.
9
+ *
10
+ * This function:
11
+ * 1. Publishes the ops to IPFS using the GRC-20 binary format
12
+ * 2. Generates a unique proposal ID (or uses the provided one)
13
+ * 3. Encodes the proposal data for the SpaceRegistry's `enter()` function
14
+ *
15
+ * The proposal, when executed, will call the DAO space's `publish()` function
16
+ * to publish the edit. Since `publish()` is a valid fast-path action, with
17
+ * FAST voting mode and sufficient votes, the proposal will auto-execute.
18
+ *
19
+ * @param params - The parameters for creating the proposal
20
+ * @returns Object containing `editId`, `cid`, `to` (Space Registry address),
21
+ * `calldata`, and `proposalId`
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * import { daoSpace, Graph } from '@geoprotocol/geo-sdk';
26
+ *
27
+ * const { ops } = Graph.createEntity({ name: 'New Entity' });
28
+ * const { editId, cid, to, calldata, proposalId } = await daoSpace.proposeEdit({
29
+ * name: 'Add new entity',
30
+ * ops,
31
+ * author: '0x1234...',
32
+ * daoSpaceAddress: '0xDAOSpaceContractAddress...',
33
+ * callerSpaceId: '0xCallerBytes16SpaceId...',
34
+ * daoSpaceId: '0xDAOBytes16SpaceId...',
35
+ * });
36
+ *
37
+ * // Submit the transaction using viem or another client
38
+ * await walletClient.sendTransaction({ to, data: calldata });
39
+ * ```
40
+ */
41
+ export async function proposeEdit(params) {
42
+ const { name, ops, author, daoSpaceAddress, callerSpaceId, daoSpaceId, votingMode = 'FAST', proposalId: proposalIdInput, network = 'TESTNET', } = params;
43
+ // Validate space IDs
44
+ if (!isBytes16Hex(callerSpaceId)) {
45
+ throw new Error(`callerSpaceId must be bytes16 hex (0x followed by 32 hex chars). Received: ${callerSpaceId}`);
46
+ }
47
+ if (!isBytes16Hex(daoSpaceId)) {
48
+ throw new Error(`daoSpaceId must be bytes16 hex (0x followed by 32 hex chars). Received: ${daoSpaceId}`);
49
+ }
50
+ // Publish the edit to IPFS
51
+ const { cid, editId } = await Ipfs.publishEdit({
52
+ name,
53
+ ops,
54
+ author,
55
+ network,
56
+ });
57
+ // Generate or use provided proposal ID (UUID v4 as bytes16 hex)
58
+ const proposalId = proposalIdInput ?? `0x${uuidv4().replaceAll('-', '')}`;
59
+ if (!isBytes16Hex(proposalId)) {
60
+ throw new Error(`proposalId must be bytes16 hex (0x followed by 32 hex chars). Received: ${proposalId}`);
61
+ }
62
+ // Encode the CID as bytes for the editsContentUri parameter
63
+ const editsContentUri = encodeAbiParameters([{ type: 'string' }], [cid]);
64
+ const editsMetadata = '0x';
65
+ // Encode the publish function call: publish(bytes32 _topic, bytes _editsContentUri, bytes _editsMetadata)
66
+ const proposalActionCalldata = encodeFunctionData({
67
+ abi: DaoSpaceAbi,
68
+ functionName: 'publish',
69
+ args: [EMPTY_TOPIC, editsContentUri, editsMetadata],
70
+ });
71
+ // Create the proposal action (calling publish on the DAO space)
72
+ const proposalActions = [
73
+ {
74
+ to: daoSpaceAddress,
75
+ value: 0n,
76
+ data: proposalActionCalldata,
77
+ },
78
+ ];
79
+ // Encode the proposal data: abi.encode(bytes16 proposalId, VotingMode votingMode, Action[] actions)
80
+ const data = encodeAbiParameters([
81
+ { type: 'bytes16', name: 'proposalId' },
82
+ { type: 'uint8', name: 'votingMode' },
83
+ {
84
+ type: 'tuple[]',
85
+ name: 'actions',
86
+ components: [
87
+ { type: 'address', name: 'to' },
88
+ { type: 'uint256', name: 'value' },
89
+ { type: 'bytes', name: 'data' },
90
+ ],
91
+ },
92
+ ], [proposalId, votingMode === 'FAST' ? 1 : 0, proposalActions]);
93
+ // Convert proposalId to bytes32 for the topic (left-aligned)
94
+ const topic = bytes16ToBytes32LeftAligned(proposalId);
95
+ // Encode the SpaceRegistry.enter() call
96
+ const calldata = encodeFunctionData({
97
+ abi: SpaceRegistryAbi,
98
+ functionName: 'enter',
99
+ args: [
100
+ callerSpaceId, // fromSpaceId
101
+ daoSpaceId, // toSpaceId
102
+ PROPOSAL_CREATED_ACTION, // action
103
+ topic, // topic (proposalId left-aligned to bytes32)
104
+ data, // data (encoded proposal)
105
+ EMPTY_SIGNATURE, // signature (unused when msg.sender == fromSpace)
106
+ ],
107
+ });
108
+ return {
109
+ editId,
110
+ cid,
111
+ to: TESTNET.SPACE_REGISTRY_ADDRESS,
112
+ calldata,
113
+ proposalId,
114
+ };
115
+ }
116
+ //# sourceMappingURL=propose-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propose-edit.js","sourceRoot":"","sources":["../../../src/dao-space/propose-edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,WAAW,EACX,YAAY,EACZ,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAyB;IACzD,MAAM,EACJ,IAAI,EACJ,GAAG,EACH,MAAM,EACN,eAAe,EACf,aAAa,EACb,UAAU,EACV,UAAU,GAAG,MAAM,EACnB,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAG,SAAS,GACpB,GAAG,MAAM,CAAC;IAEX,qBAAqB;IACrB,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,8EAA8E,aAAa,EAAE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rC;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACV,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE;gBAC/B,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE;gBAClC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE;aAChC;SACF;KACF,EACD,CAAC,UAAU,EAAE,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAC7D,CAAC;IAEF,6DAA6D;IAC7D,MAAM,KAAK,GAAG,2BAA2B,CAAC,UAAU,CAAC,CAAC;IAEtD,wCAAwC;IACxC,MAAM,QAAQ,GAAG,kBAAkB,CAAC;QAClC,GAAG,EAAE,gBAAgB;QACrB,YAAY,EAAE,OAAO;QACrB,IAAI,EAAE;YACJ,aAAa,EAAE,cAAc;YAC7B,UAAU,EAAE,YAAY;YACxB,uBAAuB,EAAE,SAAS;YAClC,KAAK,EAAE,6CAA6C;YACpD,IAAI,EAAE,0BAA0B;YAChC,eAAe,EAAE,kDAAkD;SACpE;KACF,CAAC,CAAC;IAEH,OAAO;QACL,MAAM;QACN,GAAG;QACH,EAAE,EAAE,OAAO,CAAC,sBAAsB;QAClC,QAAQ;QACR,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=propose-edit.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propose-edit.test.d.ts","sourceRoot":"","sources":["../../../src/dao-space/propose-edit.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,196 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { TESTNET } from '../../contracts.js';
3
+ import { createEntity } from '../graph/create-entity.js';
4
+ import { proposeEdit } from './propose-edit.js';
5
+ describe('proposeEdit', () => {
6
+ // Valid test values
7
+ const validCallerSpaceId = '0x0eed5491b917cf58b33ac81255fe7ae9';
8
+ const validDaoSpaceId = '0xabcdef12345678901234567890abcdef';
9
+ const validDaoSpaceAddress = '0x1234567890123456789012345678901234567890';
10
+ const validAuthor = '0x0000000000000000000000000000000000000000';
11
+ it('should return correct structure', async () => {
12
+ const { ops } = createEntity({ name: 'Test Entity' });
13
+ const result = await proposeEdit({
14
+ name: 'Test Edit',
15
+ ops,
16
+ author: validAuthor,
17
+ daoSpaceAddress: validDaoSpaceAddress,
18
+ callerSpaceId: validCallerSpaceId,
19
+ daoSpaceId: validDaoSpaceId,
20
+ });
21
+ expect(result).toHaveProperty('editId');
22
+ expect(result).toHaveProperty('cid');
23
+ expect(result).toHaveProperty('to');
24
+ expect(result).toHaveProperty('calldata');
25
+ expect(result).toHaveProperty('proposalId');
26
+ });
27
+ it('should return the correct contract address (Space Registry)', async () => {
28
+ const { ops } = createEntity({ name: 'Test Entity' });
29
+ const { to } = await proposeEdit({
30
+ name: 'Test Edit',
31
+ ops,
32
+ author: validAuthor,
33
+ daoSpaceAddress: validDaoSpaceAddress,
34
+ callerSpaceId: validCallerSpaceId,
35
+ daoSpaceId: validDaoSpaceId,
36
+ });
37
+ expect(to).toBe(TESTNET.SPACE_REGISTRY_ADDRESS);
38
+ });
39
+ it('should return valid calldata', async () => {
40
+ const { ops } = createEntity({ name: 'Test Entity' });
41
+ const { calldata } = await proposeEdit({
42
+ name: 'Test Edit',
43
+ ops,
44
+ author: validAuthor,
45
+ daoSpaceAddress: validDaoSpaceAddress,
46
+ callerSpaceId: validCallerSpaceId,
47
+ daoSpaceId: validDaoSpaceId,
48
+ });
49
+ expect(calldata).toBeTypeOf('string');
50
+ expect(calldata.startsWith('0x')).toBe(true);
51
+ });
52
+ it('should return valid CID', async () => {
53
+ const { ops } = createEntity({ name: 'Test Entity' });
54
+ const { cid } = await proposeEdit({
55
+ name: 'Test Edit',
56
+ ops,
57
+ author: validAuthor,
58
+ daoSpaceAddress: validDaoSpaceAddress,
59
+ callerSpaceId: validCallerSpaceId,
60
+ daoSpaceId: validDaoSpaceId,
61
+ });
62
+ expect(cid).toMatch(/^ipfs:\/\//);
63
+ });
64
+ it('should return valid editId', async () => {
65
+ const { ops } = createEntity({ name: 'Test Entity' });
66
+ const { editId } = await proposeEdit({
67
+ name: 'Test Edit',
68
+ ops,
69
+ author: validAuthor,
70
+ daoSpaceAddress: validDaoSpaceAddress,
71
+ callerSpaceId: validCallerSpaceId,
72
+ daoSpaceId: validDaoSpaceId,
73
+ });
74
+ expect(editId).toBeTruthy();
75
+ expect(editId).toHaveLength(32);
76
+ });
77
+ it('should return valid proposalId (bytes16 hex)', async () => {
78
+ const { ops } = createEntity({ name: 'Test Entity' });
79
+ const { proposalId } = await proposeEdit({
80
+ name: 'Test Edit',
81
+ ops,
82
+ author: validAuthor,
83
+ daoSpaceAddress: validDaoSpaceAddress,
84
+ callerSpaceId: validCallerSpaceId,
85
+ daoSpaceId: validDaoSpaceId,
86
+ });
87
+ expect(proposalId).toMatch(/^0x[0-9a-fA-F]{32}$/);
88
+ });
89
+ it('should accept custom proposalId', async () => {
90
+ const { ops } = createEntity({ name: 'Test Entity' });
91
+ const customProposalId = '0x11111111111111111111111111111111';
92
+ const { proposalId } = await proposeEdit({
93
+ name: 'Test Edit',
94
+ ops,
95
+ author: validAuthor,
96
+ daoSpaceAddress: validDaoSpaceAddress,
97
+ callerSpaceId: validCallerSpaceId,
98
+ daoSpaceId: validDaoSpaceId,
99
+ proposalId: customProposalId,
100
+ });
101
+ expect(proposalId).toBe(customProposalId);
102
+ });
103
+ it('should default to FAST voting mode', async () => {
104
+ const { ops } = createEntity({ name: 'Test Entity' });
105
+ const result = await proposeEdit({
106
+ name: 'Test Edit',
107
+ ops,
108
+ author: validAuthor,
109
+ daoSpaceAddress: validDaoSpaceAddress,
110
+ callerSpaceId: validCallerSpaceId,
111
+ daoSpaceId: validDaoSpaceId,
112
+ });
113
+ // The calldata should contain encoded data with votingMode = 1 (FAST)
114
+ expect(result.calldata).toBeTruthy();
115
+ });
116
+ it('should accept SLOW voting mode', async () => {
117
+ const { ops } = createEntity({ name: 'Test Entity' });
118
+ const result = await proposeEdit({
119
+ name: 'Test Edit',
120
+ ops,
121
+ author: validAuthor,
122
+ daoSpaceAddress: validDaoSpaceAddress,
123
+ callerSpaceId: validCallerSpaceId,
124
+ daoSpaceId: validDaoSpaceId,
125
+ votingMode: 'SLOW',
126
+ });
127
+ expect(result.calldata).toBeTruthy();
128
+ });
129
+ it('should throw for invalid callerSpaceId format', async () => {
130
+ const { ops } = createEntity({ name: 'Test Entity' });
131
+ await expect(proposeEdit({
132
+ name: 'Test Edit',
133
+ ops,
134
+ author: validAuthor,
135
+ daoSpaceAddress: validDaoSpaceAddress,
136
+ callerSpaceId: '0xinvalid',
137
+ daoSpaceId: validDaoSpaceId,
138
+ })).rejects.toThrow('callerSpaceId must be bytes16 hex');
139
+ });
140
+ it('should throw for callerSpaceId without 0x prefix', async () => {
141
+ const { ops } = createEntity({ name: 'Test Entity' });
142
+ await expect(proposeEdit({
143
+ name: 'Test Edit',
144
+ ops,
145
+ author: validAuthor,
146
+ daoSpaceAddress: validDaoSpaceAddress,
147
+ callerSpaceId: '0eed5491b917cf58b33ac81255fe7ae9',
148
+ daoSpaceId: validDaoSpaceId,
149
+ })).rejects.toThrow('callerSpaceId must be bytes16 hex');
150
+ });
151
+ it('should throw for invalid daoSpaceId format', async () => {
152
+ const { ops } = createEntity({ name: 'Test Entity' });
153
+ await expect(proposeEdit({
154
+ name: 'Test Edit',
155
+ ops,
156
+ author: validAuthor,
157
+ daoSpaceAddress: validDaoSpaceAddress,
158
+ callerSpaceId: validCallerSpaceId,
159
+ daoSpaceId: '0xtooshort',
160
+ })).rejects.toThrow('daoSpaceId must be bytes16 hex');
161
+ });
162
+ it('should throw for invalid proposalId format', async () => {
163
+ const { ops } = createEntity({ name: 'Test Entity' });
164
+ await expect(proposeEdit({
165
+ name: 'Test Edit',
166
+ ops,
167
+ author: validAuthor,
168
+ daoSpaceAddress: validDaoSpaceAddress,
169
+ callerSpaceId: validCallerSpaceId,
170
+ daoSpaceId: validDaoSpaceId,
171
+ proposalId: '0xinvalidproposalid',
172
+ })).rejects.toThrow('proposalId must be bytes16 hex');
173
+ });
174
+ it('should generate unique proposalIds for the same input', async () => {
175
+ const { ops } = createEntity({ name: 'Test Entity' });
176
+ const result1 = await proposeEdit({
177
+ name: 'Test Edit',
178
+ ops,
179
+ author: validAuthor,
180
+ daoSpaceAddress: validDaoSpaceAddress,
181
+ callerSpaceId: validCallerSpaceId,
182
+ daoSpaceId: validDaoSpaceId,
183
+ });
184
+ const result2 = await proposeEdit({
185
+ name: 'Test Edit',
186
+ ops,
187
+ author: validAuthor,
188
+ daoSpaceAddress: validDaoSpaceAddress,
189
+ callerSpaceId: validCallerSpaceId,
190
+ daoSpaceId: validDaoSpaceId,
191
+ });
192
+ // Proposal IDs should be unique because they are generated using UUID v4
193
+ expect(result1.proposalId).not.toBe(result2.proposalId);
194
+ });
195
+ });
196
+ //# sourceMappingURL=propose-edit.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propose-edit.test.js","sourceRoot":"","sources":["../../../src/dao-space/propose-edit.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,oBAAoB;IACpB,MAAM,kBAAkB,GAAG,oCAA6C,CAAC;IACzE,MAAM,eAAe,GAAG,oCAA6C,CAAC;IACtE,MAAM,oBAAoB,GAAG,4CAAqD,CAAC;IACnF,MAAM,WAAW,GAAG,4CAAqD,CAAC;IAE1E,EAAE,CAAC,iCAAiC,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