@oobe-protocol-labs/synapse-sap-sdk 0.13.0 → 0.14.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 (654) hide show
  1. package/dist/cjs/accounts/index.js +286 -0
  2. package/dist/cjs/accounts/index.js.map +1 -0
  3. package/dist/cjs/client.js +108 -0
  4. package/dist/cjs/client.js.map +1 -0
  5. package/dist/cjs/constants.js +59 -0
  6. package/dist/cjs/constants.js.map +1 -0
  7. package/dist/cjs/errors.js +250 -0
  8. package/dist/cjs/errors.js.map +1 -0
  9. package/dist/cjs/events/index.js +38 -130
  10. package/dist/cjs/events/index.js.map +1 -1
  11. package/dist/cjs/idlTypes.js +4 -0
  12. package/dist/cjs/idlTypes.js.map +1 -0
  13. package/dist/cjs/index.js +75 -241
  14. package/dist/cjs/index.js.map +1 -1
  15. package/dist/cjs/instructions/agent.js +89 -0
  16. package/dist/cjs/instructions/agent.js.map +1 -0
  17. package/dist/cjs/instructions/attestation.js +112 -0
  18. package/dist/cjs/instructions/attestation.js.map +1 -0
  19. package/dist/cjs/instructions/digest.js +28 -0
  20. package/dist/cjs/instructions/digest.js.map +1 -0
  21. package/dist/cjs/instructions/dispute.js +116 -0
  22. package/dist/cjs/instructions/dispute.js.map +1 -0
  23. package/dist/cjs/instructions/escrow.js +101 -0
  24. package/dist/cjs/instructions/escrow.js.map +1 -0
  25. package/dist/cjs/instructions/global.js +28 -0
  26. package/dist/cjs/instructions/global.js.map +1 -0
  27. package/dist/cjs/instructions/index.js +31 -0
  28. package/dist/cjs/instructions/index.js.map +1 -0
  29. package/dist/cjs/instructions/indexing.js +221 -0
  30. package/dist/cjs/instructions/indexing.js.map +1 -0
  31. package/dist/cjs/instructions/misc.js +73 -0
  32. package/dist/cjs/instructions/misc.js.map +1 -0
  33. package/dist/cjs/instructions/session.js +89 -0
  34. package/dist/cjs/instructions/session.js.map +1 -0
  35. package/dist/cjs/instructions/staking.js +132 -0
  36. package/dist/cjs/instructions/staking.js.map +1 -0
  37. package/dist/cjs/instructions/subscription.js +80 -0
  38. package/dist/cjs/instructions/subscription.js.map +1 -0
  39. package/dist/cjs/instructions/tools.js +109 -0
  40. package/dist/cjs/instructions/tools.js.map +1 -0
  41. package/dist/cjs/instructions/vault.js +106 -0
  42. package/dist/cjs/instructions/vault.js.map +1 -0
  43. package/dist/cjs/pdas/index.js +120 -0
  44. package/dist/cjs/pdas/index.js.map +1 -0
  45. package/dist/cjs/types.js +42 -0
  46. package/dist/cjs/types.js.map +1 -0
  47. package/dist/cjs/utils/index.js +29 -86
  48. package/dist/cjs/utils/index.js.map +1 -1
  49. package/dist/cjs/utils/validate.js +236 -0
  50. package/dist/cjs/utils/validate.js.map +1 -0
  51. package/dist/esm/accounts/index.d.ts +11 -0
  52. package/dist/esm/accounts/index.d.ts.map +1 -0
  53. package/dist/esm/accounts/index.js +273 -0
  54. package/dist/esm/accounts/index.js.map +1 -0
  55. package/dist/esm/client.d.ts +55 -0
  56. package/dist/esm/client.d.ts.map +1 -0
  57. package/dist/esm/client.js +70 -0
  58. package/dist/esm/client.js.map +1 -0
  59. package/dist/esm/constants.d.ts +52 -0
  60. package/dist/esm/constants.d.ts.map +1 -0
  61. package/dist/esm/constants.js +56 -0
  62. package/dist/esm/constants.js.map +1 -0
  63. package/dist/esm/errors.d.ts +111 -0
  64. package/dist/esm/errors.d.ts.map +1 -0
  65. package/dist/esm/errors.js +244 -0
  66. package/dist/esm/errors.js.map +1 -0
  67. package/dist/esm/events/index.d.ts +13 -0
  68. package/dist/esm/events/index.d.ts.map +1 -0
  69. package/dist/esm/events/index.js +36 -128
  70. package/dist/esm/events/index.js.map +1 -1
  71. package/dist/esm/idlTypes.d.ts +925 -0
  72. package/dist/esm/idlTypes.d.ts.map +1 -0
  73. package/dist/esm/idlTypes.js +3 -0
  74. package/dist/esm/idlTypes.js.map +1 -0
  75. package/dist/esm/index.d.ts +12 -0
  76. package/dist/esm/index.d.ts.map +1 -0
  77. package/dist/esm/index.js +15 -88
  78. package/dist/esm/index.js.map +1 -1
  79. package/dist/esm/instructions/agent.d.ts +71 -0
  80. package/dist/esm/instructions/agent.d.ts.map +1 -0
  81. package/dist/esm/instructions/agent.js +85 -0
  82. package/dist/esm/instructions/agent.js.map +1 -0
  83. package/dist/esm/instructions/attestation.d.ts +76 -0
  84. package/dist/esm/instructions/attestation.d.ts.map +1 -0
  85. package/dist/esm/instructions/attestation.js +108 -0
  86. package/dist/esm/instructions/attestation.js.map +1 -0
  87. package/dist/esm/instructions/digest.d.ts +20 -0
  88. package/dist/esm/instructions/digest.d.ts.map +1 -0
  89. package/dist/esm/instructions/digest.js +24 -0
  90. package/dist/esm/instructions/digest.js.map +1 -0
  91. package/dist/esm/instructions/dispute.d.ts +81 -0
  92. package/dist/esm/instructions/dispute.d.ts.map +1 -0
  93. package/dist/esm/instructions/dispute.js +112 -0
  94. package/dist/esm/instructions/dispute.js.map +1 -0
  95. package/dist/esm/instructions/escrow.d.ts +79 -0
  96. package/dist/esm/instructions/escrow.d.ts.map +1 -0
  97. package/dist/esm/instructions/escrow.js +97 -0
  98. package/dist/esm/instructions/escrow.js.map +1 -0
  99. package/dist/esm/instructions/global.d.ts +14 -0
  100. package/dist/esm/instructions/global.d.ts.map +1 -0
  101. package/dist/esm/instructions/global.js +24 -0
  102. package/dist/esm/instructions/global.js.map +1 -0
  103. package/dist/esm/instructions/index.d.ts +14 -0
  104. package/dist/esm/instructions/index.d.ts.map +1 -0
  105. package/dist/esm/instructions/index.js +15 -0
  106. package/dist/esm/instructions/index.js.map +1 -0
  107. package/dist/esm/instructions/indexing.d.ts +150 -0
  108. package/dist/esm/instructions/indexing.d.ts.map +1 -0
  109. package/dist/esm/instructions/indexing.js +217 -0
  110. package/dist/esm/instructions/indexing.js.map +1 -0
  111. package/dist/esm/instructions/memory.d.ts +8 -0
  112. package/dist/esm/instructions/memory.d.ts.map +1 -0
  113. package/dist/esm/instructions/memory.js +234 -0
  114. package/dist/esm/instructions/memory.js.map +1 -0
  115. package/dist/esm/instructions/misc.d.ts +50 -0
  116. package/dist/esm/instructions/misc.d.ts.map +1 -0
  117. package/dist/esm/instructions/misc.js +69 -0
  118. package/dist/esm/instructions/misc.js.map +1 -0
  119. package/dist/esm/instructions/session.d.ts +57 -0
  120. package/dist/esm/instructions/session.d.ts.map +1 -0
  121. package/dist/esm/instructions/session.js +85 -0
  122. package/dist/esm/instructions/session.js.map +1 -0
  123. package/dist/esm/instructions/staking.d.ts +85 -0
  124. package/dist/esm/instructions/staking.d.ts.map +1 -0
  125. package/dist/esm/instructions/staking.js +128 -0
  126. package/dist/esm/instructions/staking.js.map +1 -0
  127. package/dist/esm/instructions/subscription.d.ts +50 -0
  128. package/dist/esm/instructions/subscription.d.ts.map +1 -0
  129. package/dist/esm/instructions/subscription.js +76 -0
  130. package/dist/esm/instructions/subscription.js.map +1 -0
  131. package/dist/esm/instructions/tools.d.ts +88 -0
  132. package/dist/esm/instructions/tools.d.ts.map +1 -0
  133. package/dist/esm/instructions/tools.js +105 -0
  134. package/dist/esm/instructions/tools.js.map +1 -0
  135. package/dist/esm/instructions/vault.d.ts +84 -0
  136. package/dist/esm/instructions/vault.d.ts.map +1 -0
  137. package/dist/esm/instructions/vault.js +102 -0
  138. package/dist/esm/instructions/vault.js.map +1 -0
  139. package/dist/esm/pdas/index.d.ts +37 -0
  140. package/dist/esm/pdas/index.d.ts.map +1 -0
  141. package/dist/esm/pdas/index.js +101 -0
  142. package/dist/esm/pdas/index.js.map +1 -0
  143. package/dist/esm/types.d.ts +208 -0
  144. package/dist/esm/types.d.ts.map +1 -0
  145. package/dist/esm/types.js +39 -0
  146. package/dist/esm/types.js.map +1 -0
  147. package/dist/esm/utils/index.d.ts +4 -0
  148. package/dist/esm/utils/index.d.ts.map +1 -0
  149. package/dist/esm/utils/index.js +13 -33
  150. package/dist/esm/utils/index.js.map +1 -1
  151. package/dist/esm/utils/validate.d.ts +66 -0
  152. package/dist/esm/utils/validate.d.ts.map +1 -0
  153. package/dist/esm/utils/validate.js +221 -0
  154. package/dist/esm/utils/validate.js.map +1 -0
  155. package/package.json +59 -183
  156. package/LICENSE +0 -21
  157. package/README.md +0 -986
  158. package/dist/cjs/constants/addresses.js +0 -143
  159. package/dist/cjs/constants/addresses.js.map +0 -1
  160. package/dist/cjs/constants/index.js +0 -64
  161. package/dist/cjs/constants/index.js.map +0 -1
  162. package/dist/cjs/constants/limits.js +0 -161
  163. package/dist/cjs/constants/limits.js.map +0 -1
  164. package/dist/cjs/constants/network.js +0 -81
  165. package/dist/cjs/constants/network.js.map +0 -1
  166. package/dist/cjs/constants/payments.js +0 -137
  167. package/dist/cjs/constants/payments.js.map +0 -1
  168. package/dist/cjs/constants/programs.js +0 -78
  169. package/dist/cjs/constants/programs.js.map +0 -1
  170. package/dist/cjs/constants/seeds.js +0 -76
  171. package/dist/cjs/constants/seeds.js.map +0 -1
  172. package/dist/cjs/core/client.js +0 -546
  173. package/dist/cjs/core/client.js.map +0 -1
  174. package/dist/cjs/core/connection.js +0 -350
  175. package/dist/cjs/core/connection.js.map +0 -1
  176. package/dist/cjs/core/index.js +0 -25
  177. package/dist/cjs/core/index.js.map +0 -1
  178. package/dist/cjs/errors/index.js +0 -334
  179. package/dist/cjs/errors/index.js.map +0 -1
  180. package/dist/cjs/events/geyser.js +0 -295
  181. package/dist/cjs/events/geyser.js.map +0 -1
  182. package/dist/cjs/idl/index.js +0 -63
  183. package/dist/cjs/idl/index.js.map +0 -1
  184. package/dist/cjs/idl/synapse_agent_sap.json +0 -14595
  185. package/dist/cjs/modules/agent.js +0 -272
  186. package/dist/cjs/modules/agent.js.map +0 -1
  187. package/dist/cjs/modules/attestation.js +0 -147
  188. package/dist/cjs/modules/attestation.js.map +0 -1
  189. package/dist/cjs/modules/base.js +0 -189
  190. package/dist/cjs/modules/base.js.map +0 -1
  191. package/dist/cjs/modules/escrow-v2.js +0 -607
  192. package/dist/cjs/modules/escrow-v2.js.map +0 -1
  193. package/dist/cjs/modules/escrow.js +0 -336
  194. package/dist/cjs/modules/escrow.js.map +0 -1
  195. package/dist/cjs/modules/feedback.js +0 -166
  196. package/dist/cjs/modules/feedback.js.map +0 -1
  197. package/dist/cjs/modules/index.js +0 -43
  198. package/dist/cjs/modules/index.js.map +0 -1
  199. package/dist/cjs/modules/indexing.js +0 -375
  200. package/dist/cjs/modules/indexing.js.map +0 -1
  201. package/dist/cjs/modules/ledger.js +0 -234
  202. package/dist/cjs/modules/ledger.js.map +0 -1
  203. package/dist/cjs/modules/receipt.js +0 -148
  204. package/dist/cjs/modules/receipt.js.map +0 -1
  205. package/dist/cjs/modules/staking.js +0 -159
  206. package/dist/cjs/modules/staking.js.map +0 -1
  207. package/dist/cjs/modules/subscription.js +0 -96
  208. package/dist/cjs/modules/subscription.js.map +0 -1
  209. package/dist/cjs/modules/tools.js +0 -345
  210. package/dist/cjs/modules/tools.js.map +0 -1
  211. package/dist/cjs/modules/vault.js +0 -427
  212. package/dist/cjs/modules/vault.js.map +0 -1
  213. package/dist/cjs/parser/client.js +0 -146
  214. package/dist/cjs/parser/client.js.map +0 -1
  215. package/dist/cjs/parser/complete.js +0 -177
  216. package/dist/cjs/parser/complete.js.map +0 -1
  217. package/dist/cjs/parser/index.js +0 -57
  218. package/dist/cjs/parser/index.js.map +0 -1
  219. package/dist/cjs/parser/inner.js +0 -185
  220. package/dist/cjs/parser/inner.js.map +0 -1
  221. package/dist/cjs/parser/instructions.js +0 -114
  222. package/dist/cjs/parser/instructions.js.map +0 -1
  223. package/dist/cjs/parser/transaction.js +0 -153
  224. package/dist/cjs/parser/transaction.js.map +0 -1
  225. package/dist/cjs/parser/types.js +0 -14
  226. package/dist/cjs/parser/types.js.map +0 -1
  227. package/dist/cjs/pda/index.js +0 -672
  228. package/dist/cjs/pda/index.js.map +0 -1
  229. package/dist/cjs/plugin/index.js +0 -952
  230. package/dist/cjs/plugin/index.js.map +0 -1
  231. package/dist/cjs/plugin/protocols.js +0 -282
  232. package/dist/cjs/plugin/protocols.js.map +0 -1
  233. package/dist/cjs/plugin/schemas.js +0 -863
  234. package/dist/cjs/plugin/schemas.js.map +0 -1
  235. package/dist/cjs/postgres/adapter.js +0 -715
  236. package/dist/cjs/postgres/adapter.js.map +0 -1
  237. package/dist/cjs/postgres/index.js +0 -50
  238. package/dist/cjs/postgres/index.js.map +0 -1
  239. package/dist/cjs/postgres/serializers.js +0 -381
  240. package/dist/cjs/postgres/serializers.js.map +0 -1
  241. package/dist/cjs/postgres/sync.js +0 -289
  242. package/dist/cjs/postgres/sync.js.map +0 -1
  243. package/dist/cjs/postgres/types.js +0 -44
  244. package/dist/cjs/postgres/types.js.map +0 -1
  245. package/dist/cjs/registries/builder.js +0 -414
  246. package/dist/cjs/registries/builder.js.map +0 -1
  247. package/dist/cjs/registries/discovery.js +0 -362
  248. package/dist/cjs/registries/discovery.js.map +0 -1
  249. package/dist/cjs/registries/fairscale.js +0 -639
  250. package/dist/cjs/registries/fairscale.js.map +0 -1
  251. package/dist/cjs/registries/index.js +0 -58
  252. package/dist/cjs/registries/index.js.map +0 -1
  253. package/dist/cjs/registries/metaplex-bridge.js +0 -743
  254. package/dist/cjs/registries/metaplex-bridge.js.map +0 -1
  255. package/dist/cjs/registries/session.js +0 -433
  256. package/dist/cjs/registries/session.js.map +0 -1
  257. package/dist/cjs/registries/x402.js +0 -668
  258. package/dist/cjs/registries/x402.js.map +0 -1
  259. package/dist/cjs/types/accounts.js +0 -13
  260. package/dist/cjs/types/accounts.js.map +0 -1
  261. package/dist/cjs/types/common.js +0 -13
  262. package/dist/cjs/types/common.js.map +0 -1
  263. package/dist/cjs/types/endpoint.js +0 -15
  264. package/dist/cjs/types/endpoint.js.map +0 -1
  265. package/dist/cjs/types/enums.js +0 -269
  266. package/dist/cjs/types/enums.js.map +0 -1
  267. package/dist/cjs/types/index.js +0 -41
  268. package/dist/cjs/types/index.js.map +0 -1
  269. package/dist/cjs/types/instructions.js +0 -92
  270. package/dist/cjs/types/instructions.js.map +0 -1
  271. package/dist/cjs/utils/anchor-errors.js +0 -453
  272. package/dist/cjs/utils/anchor-errors.js.map +0 -1
  273. package/dist/cjs/utils/endpoint-validator.js +0 -232
  274. package/dist/cjs/utils/endpoint-validator.js.map +0 -1
  275. package/dist/cjs/utils/escrow-validation.js +0 -219
  276. package/dist/cjs/utils/escrow-validation.js.map +0 -1
  277. package/dist/cjs/utils/hash.js +0 -109
  278. package/dist/cjs/utils/hash.js.map +0 -1
  279. package/dist/cjs/utils/merchant-validator.js +0 -246
  280. package/dist/cjs/utils/merchant-validator.js.map +0 -1
  281. package/dist/cjs/utils/network-normalizer.js +0 -236
  282. package/dist/cjs/utils/network-normalizer.js.map +0 -1
  283. package/dist/cjs/utils/priority-fee.js +0 -215
  284. package/dist/cjs/utils/priority-fee.js.map +0 -1
  285. package/dist/cjs/utils/rpc-strategy.js +0 -239
  286. package/dist/cjs/utils/rpc-strategy.js.map +0 -1
  287. package/dist/cjs/utils/schemas.js +0 -331
  288. package/dist/cjs/utils/schemas.js.map +0 -1
  289. package/dist/cjs/utils/serialization.js +0 -105
  290. package/dist/cjs/utils/serialization.js.map +0 -1
  291. package/dist/cjs/utils/validation.js +0 -36
  292. package/dist/cjs/utils/validation.js.map +0 -1
  293. package/dist/cjs/utils/volume-curve.js +0 -117
  294. package/dist/cjs/utils/volume-curve.js.map +0 -1
  295. package/dist/cjs/utils/x402-direct.js +0 -231
  296. package/dist/cjs/utils/x402-direct.js.map +0 -1
  297. package/dist/esm/constants/addresses.js +0 -140
  298. package/dist/esm/constants/addresses.js.map +0 -1
  299. package/dist/esm/constants/index.js +0 -35
  300. package/dist/esm/constants/index.js.map +0 -1
  301. package/dist/esm/constants/limits.js +0 -158
  302. package/dist/esm/constants/limits.js.map +0 -1
  303. package/dist/esm/constants/network.js +0 -78
  304. package/dist/esm/constants/network.js.map +0 -1
  305. package/dist/esm/constants/payments.js +0 -131
  306. package/dist/esm/constants/payments.js.map +0 -1
  307. package/dist/esm/constants/programs.js +0 -75
  308. package/dist/esm/constants/programs.js.map +0 -1
  309. package/dist/esm/constants/seeds.js +0 -73
  310. package/dist/esm/constants/seeds.js.map +0 -1
  311. package/dist/esm/core/client.js +0 -539
  312. package/dist/esm/core/client.js.map +0 -1
  313. package/dist/esm/core/connection.js +0 -345
  314. package/dist/esm/core/connection.js.map +0 -1
  315. package/dist/esm/core/index.js +0 -19
  316. package/dist/esm/core/index.js.map +0 -1
  317. package/dist/esm/errors/index.js +0 -325
  318. package/dist/esm/errors/index.js.map +0 -1
  319. package/dist/esm/events/geyser.js +0 -258
  320. package/dist/esm/events/geyser.js.map +0 -1
  321. package/dist/esm/idl/index.js +0 -57
  322. package/dist/esm/idl/index.js.map +0 -1
  323. package/dist/esm/idl/synapse_agent_sap.json +0 -14595
  324. package/dist/esm/modules/agent.js +0 -268
  325. package/dist/esm/modules/agent.js.map +0 -1
  326. package/dist/esm/modules/attestation.js +0 -143
  327. package/dist/esm/modules/attestation.js.map +0 -1
  328. package/dist/esm/modules/base.js +0 -185
  329. package/dist/esm/modules/base.js.map +0 -1
  330. package/dist/esm/modules/escrow-v2.js +0 -603
  331. package/dist/esm/modules/escrow-v2.js.map +0 -1
  332. package/dist/esm/modules/escrow.js +0 -332
  333. package/dist/esm/modules/escrow.js.map +0 -1
  334. package/dist/esm/modules/feedback.js +0 -162
  335. package/dist/esm/modules/feedback.js.map +0 -1
  336. package/dist/esm/modules/index.js +0 -27
  337. package/dist/esm/modules/index.js.map +0 -1
  338. package/dist/esm/modules/indexing.js +0 -371
  339. package/dist/esm/modules/indexing.js.map +0 -1
  340. package/dist/esm/modules/ledger.js +0 -230
  341. package/dist/esm/modules/ledger.js.map +0 -1
  342. package/dist/esm/modules/receipt.js +0 -144
  343. package/dist/esm/modules/receipt.js.map +0 -1
  344. package/dist/esm/modules/staking.js +0 -155
  345. package/dist/esm/modules/staking.js.map +0 -1
  346. package/dist/esm/modules/subscription.js +0 -92
  347. package/dist/esm/modules/subscription.js.map +0 -1
  348. package/dist/esm/modules/tools.js +0 -341
  349. package/dist/esm/modules/tools.js.map +0 -1
  350. package/dist/esm/modules/vault.js +0 -423
  351. package/dist/esm/modules/vault.js.map +0 -1
  352. package/dist/esm/parser/client.js +0 -142
  353. package/dist/esm/parser/client.js.map +0 -1
  354. package/dist/esm/parser/complete.js +0 -173
  355. package/dist/esm/parser/complete.js.map +0 -1
  356. package/dist/esm/parser/index.js +0 -43
  357. package/dist/esm/parser/index.js.map +0 -1
  358. package/dist/esm/parser/inner.js +0 -180
  359. package/dist/esm/parser/inner.js.map +0 -1
  360. package/dist/esm/parser/instructions.js +0 -109
  361. package/dist/esm/parser/instructions.js.map +0 -1
  362. package/dist/esm/parser/transaction.js +0 -149
  363. package/dist/esm/parser/transaction.js.map +0 -1
  364. package/dist/esm/parser/types.js +0 -13
  365. package/dist/esm/parser/types.js.map +0 -1
  366. package/dist/esm/pda/index.js +0 -638
  367. package/dist/esm/pda/index.js.map +0 -1
  368. package/dist/esm/plugin/index.js +0 -945
  369. package/dist/esm/plugin/index.js.map +0 -1
  370. package/dist/esm/plugin/protocols.js +0 -279
  371. package/dist/esm/plugin/protocols.js.map +0 -1
  372. package/dist/esm/plugin/schemas.js +0 -860
  373. package/dist/esm/plugin/schemas.js.map +0 -1
  374. package/dist/esm/postgres/adapter.js +0 -678
  375. package/dist/esm/postgres/adapter.js.map +0 -1
  376. package/dist/esm/postgres/index.js +0 -27
  377. package/dist/esm/postgres/index.js.map +0 -1
  378. package/dist/esm/postgres/serializers.js +0 -362
  379. package/dist/esm/postgres/serializers.js.map +0 -1
  380. package/dist/esm/postgres/sync.js +0 -285
  381. package/dist/esm/postgres/sync.js.map +0 -1
  382. package/dist/esm/postgres/types.js +0 -41
  383. package/dist/esm/postgres/types.js.map +0 -1
  384. package/dist/esm/registries/builder.js +0 -410
  385. package/dist/esm/registries/builder.js.map +0 -1
  386. package/dist/esm/registries/discovery.js +0 -358
  387. package/dist/esm/registries/discovery.js.map +0 -1
  388. package/dist/esm/registries/fairscale.js +0 -633
  389. package/dist/esm/registries/fairscale.js.map +0 -1
  390. package/dist/esm/registries/index.js +0 -46
  391. package/dist/esm/registries/index.js.map +0 -1
  392. package/dist/esm/registries/metaplex-bridge.js +0 -706
  393. package/dist/esm/registries/metaplex-bridge.js.map +0 -1
  394. package/dist/esm/registries/session.js +0 -429
  395. package/dist/esm/registries/session.js.map +0 -1
  396. package/dist/esm/registries/x402.js +0 -664
  397. package/dist/esm/registries/x402.js.map +0 -1
  398. package/dist/esm/types/accounts.js +0 -12
  399. package/dist/esm/types/accounts.js.map +0 -1
  400. package/dist/esm/types/common.js +0 -12
  401. package/dist/esm/types/common.js.map +0 -1
  402. package/dist/esm/types/endpoint.js +0 -14
  403. package/dist/esm/types/endpoint.js.map +0 -1
  404. package/dist/esm/types/enums.js +0 -266
  405. package/dist/esm/types/enums.js.map +0 -1
  406. package/dist/esm/types/index.js +0 -25
  407. package/dist/esm/types/index.js.map +0 -1
  408. package/dist/esm/types/instructions.js +0 -89
  409. package/dist/esm/types/instructions.js.map +0 -1
  410. package/dist/esm/utils/anchor-errors.js +0 -447
  411. package/dist/esm/utils/anchor-errors.js.map +0 -1
  412. package/dist/esm/utils/endpoint-validator.js +0 -226
  413. package/dist/esm/utils/endpoint-validator.js.map +0 -1
  414. package/dist/esm/utils/escrow-validation.js +0 -212
  415. package/dist/esm/utils/escrow-validation.js.map +0 -1
  416. package/dist/esm/utils/hash.js +0 -103
  417. package/dist/esm/utils/hash.js.map +0 -1
  418. package/dist/esm/utils/merchant-validator.js +0 -241
  419. package/dist/esm/utils/merchant-validator.js.map +0 -1
  420. package/dist/esm/utils/network-normalizer.js +0 -229
  421. package/dist/esm/utils/network-normalizer.js.map +0 -1
  422. package/dist/esm/utils/priority-fee.js +0 -209
  423. package/dist/esm/utils/priority-fee.js.map +0 -1
  424. package/dist/esm/utils/rpc-strategy.js +0 -231
  425. package/dist/esm/utils/rpc-strategy.js.map +0 -1
  426. package/dist/esm/utils/schemas.js +0 -320
  427. package/dist/esm/utils/schemas.js.map +0 -1
  428. package/dist/esm/utils/serialization.js +0 -98
  429. package/dist/esm/utils/serialization.js.map +0 -1
  430. package/dist/esm/utils/validation.js +0 -33
  431. package/dist/esm/utils/validation.js.map +0 -1
  432. package/dist/esm/utils/volume-curve.js +0 -114
  433. package/dist/esm/utils/volume-curve.js.map +0 -1
  434. package/dist/esm/utils/x402-direct.js +0 -228
  435. package/dist/esm/utils/x402-direct.js.map +0 -1
  436. package/dist/types/constants/addresses.d.ts +0 -117
  437. package/dist/types/constants/addresses.d.ts.map +0 -1
  438. package/dist/types/constants/index.d.ts +0 -31
  439. package/dist/types/constants/index.d.ts.map +0 -1
  440. package/dist/types/constants/limits.d.ts +0 -149
  441. package/dist/types/constants/limits.d.ts.map +0 -1
  442. package/dist/types/constants/network.d.ts +0 -81
  443. package/dist/types/constants/network.d.ts.map +0 -1
  444. package/dist/types/constants/payments.d.ts +0 -121
  445. package/dist/types/constants/payments.d.ts.map +0 -1
  446. package/dist/types/constants/programs.d.ts +0 -69
  447. package/dist/types/constants/programs.d.ts.map +0 -1
  448. package/dist/types/constants/seeds.d.ts +0 -80
  449. package/dist/types/constants/seeds.d.ts.map +0 -1
  450. package/dist/types/core/client.d.ts +0 -452
  451. package/dist/types/core/client.d.ts.map +0 -1
  452. package/dist/types/core/connection.d.ts +0 -305
  453. package/dist/types/core/connection.d.ts.map +0 -1
  454. package/dist/types/core/index.d.ts +0 -20
  455. package/dist/types/core/index.d.ts.map +0 -1
  456. package/dist/types/errors/index.d.ts +0 -276
  457. package/dist/types/errors/index.d.ts.map +0 -1
  458. package/dist/types/events/geyser.d.ts +0 -150
  459. package/dist/types/events/geyser.d.ts.map +0 -1
  460. package/dist/types/events/index.d.ts +0 -248
  461. package/dist/types/events/index.d.ts.map +0 -1
  462. package/dist/types/idl/index.d.ts +0 -70
  463. package/dist/types/idl/index.d.ts.map +0 -1
  464. package/dist/types/index.d.ts +0 -85
  465. package/dist/types/index.d.ts.map +0 -1
  466. package/dist/types/modules/agent.d.ts +0 -166
  467. package/dist/types/modules/agent.d.ts.map +0 -1
  468. package/dist/types/modules/attestation.d.ts +0 -96
  469. package/dist/types/modules/attestation.d.ts.map +0 -1
  470. package/dist/types/modules/base.d.ts +0 -161
  471. package/dist/types/modules/base.d.ts.map +0 -1
  472. package/dist/types/modules/escrow-v2.d.ts +0 -169
  473. package/dist/types/modules/escrow-v2.d.ts.map +0 -1
  474. package/dist/types/modules/escrow.d.ts +0 -168
  475. package/dist/types/modules/escrow.d.ts.map +0 -1
  476. package/dist/types/modules/feedback.d.ts +0 -105
  477. package/dist/types/modules/feedback.d.ts.map +0 -1
  478. package/dist/types/modules/index.d.ts +0 -28
  479. package/dist/types/modules/index.d.ts.map +0 -1
  480. package/dist/types/modules/indexing.d.ts +0 -200
  481. package/dist/types/modules/indexing.d.ts.map +0 -1
  482. package/dist/types/modules/ledger.d.ts +0 -150
  483. package/dist/types/modules/ledger.d.ts.map +0 -1
  484. package/dist/types/modules/receipt.d.ts +0 -77
  485. package/dist/types/modules/receipt.d.ts.map +0 -1
  486. package/dist/types/modules/staking.d.ts +0 -51
  487. package/dist/types/modules/staking.d.ts.map +0 -1
  488. package/dist/types/modules/subscription.d.ts +0 -33
  489. package/dist/types/modules/subscription.d.ts.map +0 -1
  490. package/dist/types/modules/tools.d.ts +0 -182
  491. package/dist/types/modules/tools.d.ts.map +0 -1
  492. package/dist/types/modules/vault.d.ts +0 -240
  493. package/dist/types/modules/vault.d.ts.map +0 -1
  494. package/dist/types/parser/client.d.ts +0 -123
  495. package/dist/types/parser/client.d.ts.map +0 -1
  496. package/dist/types/parser/complete.d.ts +0 -90
  497. package/dist/types/parser/complete.d.ts.map +0 -1
  498. package/dist/types/parser/index.d.ts +0 -40
  499. package/dist/types/parser/index.d.ts.map +0 -1
  500. package/dist/types/parser/inner.d.ts +0 -114
  501. package/dist/types/parser/inner.d.ts.map +0 -1
  502. package/dist/types/parser/instructions.d.ts +0 -76
  503. package/dist/types/parser/instructions.d.ts.map +0 -1
  504. package/dist/types/parser/transaction.d.ts +0 -77
  505. package/dist/types/parser/transaction.d.ts.map +0 -1
  506. package/dist/types/parser/types.d.ts +0 -154
  507. package/dist/types/parser/types.d.ts.map +0 -1
  508. package/dist/types/pda/index.d.ts +0 -510
  509. package/dist/types/pda/index.d.ts.map +0 -1
  510. package/dist/types/plugin/index.d.ts +0 -171
  511. package/dist/types/plugin/index.d.ts.map +0 -1
  512. package/dist/types/plugin/protocols.d.ts +0 -152
  513. package/dist/types/plugin/protocols.d.ts.map +0 -1
  514. package/dist/types/plugin/schemas.d.ts +0 -829
  515. package/dist/types/plugin/schemas.d.ts.map +0 -1
  516. package/dist/types/postgres/adapter.d.ts +0 -355
  517. package/dist/types/postgres/adapter.d.ts.map +0 -1
  518. package/dist/types/postgres/index.d.ts +0 -24
  519. package/dist/types/postgres/index.d.ts.map +0 -1
  520. package/dist/types/postgres/serializers.d.ts +0 -30
  521. package/dist/types/postgres/serializers.d.ts.map +0 -1
  522. package/dist/types/postgres/sync.d.ts +0 -156
  523. package/dist/types/postgres/sync.d.ts.map +0 -1
  524. package/dist/types/postgres/types.d.ts +0 -167
  525. package/dist/types/postgres/types.d.ts.map +0 -1
  526. package/dist/types/registries/builder.d.ts +0 -340
  527. package/dist/types/registries/builder.d.ts.map +0 -1
  528. package/dist/types/registries/discovery.d.ts +0 -333
  529. package/dist/types/registries/discovery.d.ts.map +0 -1
  530. package/dist/types/registries/fairscale.d.ts +0 -680
  531. package/dist/types/registries/fairscale.d.ts.map +0 -1
  532. package/dist/types/registries/index.d.ts +0 -52
  533. package/dist/types/registries/index.d.ts.map +0 -1
  534. package/dist/types/registries/metaplex-bridge.d.ts +0 -488
  535. package/dist/types/registries/metaplex-bridge.d.ts.map +0 -1
  536. package/dist/types/registries/session.d.ts +0 -323
  537. package/dist/types/registries/session.d.ts.map +0 -1
  538. package/dist/types/registries/x402.d.ts +0 -530
  539. package/dist/types/registries/x402.d.ts.map +0 -1
  540. package/dist/types/types/accounts.d.ts +0 -765
  541. package/dist/types/types/accounts.d.ts.map +0 -1
  542. package/dist/types/types/common.d.ts +0 -166
  543. package/dist/types/types/common.d.ts.map +0 -1
  544. package/dist/types/types/endpoint.d.ts +0 -161
  545. package/dist/types/types/endpoint.d.ts.map +0 -1
  546. package/dist/types/types/enums.d.ts +0 -353
  547. package/dist/types/types/enums.d.ts.map +0 -1
  548. package/dist/types/types/index.d.ts +0 -29
  549. package/dist/types/types/index.d.ts.map +0 -1
  550. package/dist/types/types/instructions.d.ts +0 -400
  551. package/dist/types/types/instructions.d.ts.map +0 -1
  552. package/dist/types/utils/anchor-errors.d.ts +0 -61
  553. package/dist/types/utils/anchor-errors.d.ts.map +0 -1
  554. package/dist/types/utils/endpoint-validator.d.ts +0 -110
  555. package/dist/types/utils/endpoint-validator.d.ts.map +0 -1
  556. package/dist/types/utils/escrow-validation.d.ts +0 -145
  557. package/dist/types/utils/escrow-validation.d.ts.map +0 -1
  558. package/dist/types/utils/hash.d.ts +0 -75
  559. package/dist/types/utils/hash.d.ts.map +0 -1
  560. package/dist/types/utils/index.d.ts +0 -36
  561. package/dist/types/utils/index.d.ts.map +0 -1
  562. package/dist/types/utils/merchant-validator.d.ts +0 -176
  563. package/dist/types/utils/merchant-validator.d.ts.map +0 -1
  564. package/dist/types/utils/network-normalizer.d.ts +0 -120
  565. package/dist/types/utils/network-normalizer.d.ts.map +0 -1
  566. package/dist/types/utils/priority-fee.d.ts +0 -205
  567. package/dist/types/utils/priority-fee.d.ts.map +0 -1
  568. package/dist/types/utils/rpc-strategy.d.ts +0 -172
  569. package/dist/types/utils/rpc-strategy.d.ts.map +0 -1
  570. package/dist/types/utils/schemas.d.ts +0 -351
  571. package/dist/types/utils/schemas.d.ts.map +0 -1
  572. package/dist/types/utils/serialization.d.ts +0 -69
  573. package/dist/types/utils/serialization.d.ts.map +0 -1
  574. package/dist/types/utils/validation.d.ts +0 -29
  575. package/dist/types/utils/validation.d.ts.map +0 -1
  576. package/dist/types/utils/volume-curve.d.ts +0 -60
  577. package/dist/types/utils/volume-curve.d.ts.map +0 -1
  578. package/dist/types/utils/x402-direct.d.ts +0 -114
  579. package/dist/types/utils/x402-direct.d.ts.map +0 -1
  580. package/src/constants/addresses.ts +0 -162
  581. package/src/constants/index.ts +0 -69
  582. package/src/constants/limits.ts +0 -165
  583. package/src/constants/network.ts +0 -89
  584. package/src/constants/payments.ts +0 -145
  585. package/src/constants/programs.ts +0 -83
  586. package/src/constants/seeds.ts +0 -85
  587. package/src/core/client.ts +0 -583
  588. package/src/core/connection.ts +0 -461
  589. package/src/core/index.ts +0 -20
  590. package/src/errors/index.ts +0 -346
  591. package/src/events/geyser.ts +0 -384
  592. package/src/events/index.ts +0 -335
  593. package/src/events/yellowstone.d.ts +0 -7
  594. package/src/idl/index.ts +0 -76
  595. package/src/idl/synapse_agent_sap.json +0 -14595
  596. package/src/index.ts +0 -421
  597. package/src/modules/agent.ts +0 -319
  598. package/src/modules/attestation.ts +0 -168
  599. package/src/modules/base.ts +0 -247
  600. package/src/modules/escrow-v2.ts +0 -871
  601. package/src/modules/escrow.ts +0 -439
  602. package/src/modules/feedback.ts +0 -186
  603. package/src/modules/index.ts +0 -28
  604. package/src/modules/indexing.ts +0 -444
  605. package/src/modules/ledger.ts +0 -262
  606. package/src/modules/receipt.ts +0 -212
  607. package/src/modules/staking.ts +0 -223
  608. package/src/modules/subscription.ts +0 -147
  609. package/src/modules/tools.ts +0 -454
  610. package/src/modules/vault.ts +0 -558
  611. package/src/parser/client.ts +0 -211
  612. package/src/parser/complete.ts +0 -232
  613. package/src/parser/index.ts +0 -71
  614. package/src/parser/inner.ts +0 -255
  615. package/src/parser/instructions.ts +0 -135
  616. package/src/parser/transaction.ts +0 -200
  617. package/src/parser/types.ts +0 -182
  618. package/src/pda/index.ts +0 -919
  619. package/src/plugin/index.ts +0 -1224
  620. package/src/plugin/protocols.ts +0 -404
  621. package/src/plugin/schemas.ts +0 -941
  622. package/src/postgres/adapter.ts +0 -904
  623. package/src/postgres/index.ts +0 -59
  624. package/src/postgres/schema.sql +0 -683
  625. package/src/postgres/serializers.ts +0 -485
  626. package/src/postgres/sync.ts +0 -340
  627. package/src/postgres/types.ts +0 -245
  628. package/src/registries/builder.ts +0 -607
  629. package/src/registries/discovery.ts +0 -572
  630. package/src/registries/fairscale.ts +0 -1278
  631. package/src/registries/index.ts +0 -143
  632. package/src/registries/metaplex-bridge.ts +0 -1199
  633. package/src/registries/session.ts +0 -613
  634. package/src/registries/x402.ts +0 -1048
  635. package/src/types/accounts.ts +0 -858
  636. package/src/types/common.ts +0 -187
  637. package/src/types/endpoint.ts +0 -181
  638. package/src/types/enums.ts +0 -333
  639. package/src/types/index.ts +0 -121
  640. package/src/types/instructions.ts +0 -453
  641. package/src/utils/anchor-errors.ts +0 -461
  642. package/src/utils/endpoint-validator.ts +0 -300
  643. package/src/utils/escrow-validation.ts +0 -301
  644. package/src/utils/hash.ts +0 -113
  645. package/src/utils/index.ts +0 -118
  646. package/src/utils/merchant-validator.ts +0 -359
  647. package/src/utils/network-normalizer.ts +0 -240
  648. package/src/utils/priority-fee.ts +0 -325
  649. package/src/utils/rpc-strategy.ts +0 -322
  650. package/src/utils/schemas.ts +0 -359
  651. package/src/utils/serialization.ts +0 -98
  652. package/src/utils/validation.ts +0 -36
  653. package/src/utils/volume-curve.ts +0 -131
  654. package/src/utils/x402-direct.ts +0 -370
@@ -1,941 +0,0 @@
1
- /**
2
- * @module plugin/schemas
3
- * @description Zod schemas for every SAP v2 plugin tool.
4
- *
5
- * Each schema is an `{ input, output }` pair that drives:
6
- * 1. Runtime validation (LLM → tool call)
7
- * 2. LangChain StructuredTool generation
8
- * 3. MCP/Vercel AI tool descriptors
9
- *
10
- * Conventions:
11
- * - Solana public keys → `z.string().describe('Base58 public key …')`
12
- * - BN/bigint amounts → `z.string().describe('Amount in lamports …')`
13
- * - Hashes ([u8;32]) → `z.array(z.number()).length(32)`
14
- * - Tool outputs always include `txSignature` for write ops
15
- *
16
- * @category Plugin
17
- * @since v0.1.0
18
- */
19
-
20
- import { z } from "zod";
21
-
22
- // ═══════════════════════════════════════════════════════════════════
23
- // Shared Primitives
24
- // ═══════════════════════════════════════════════════════════════════
25
-
26
- /** Base58-encoded Solana public key (32–44 chars). */
27
- const pubkey = z
28
- .string()
29
- .min(32)
30
- .max(44)
31
- .describe("Solana public key (base58)");
32
-
33
- /** Base58-encoded transaction signature. */
34
- const txSig = z.string().describe("Transaction signature (base58)");
35
- /** 32-byte SHA-256 hash represented as a fixed-length integer array. */
36
- const hash32 = z.array(z.number().int().min(0).max(255)).length(32);
37
- /** Token amount in the smallest unit, serialized as a string for BN safety. */
38
- const lamports = z.string().describe("Amount in smallest token unit (string)");
39
- /** Optional public key (nullable). */
40
- const optPubkey = pubkey.nullish();
41
-
42
- /** Standard write-operation output containing the transaction signature. */
43
- const writeOutput = z.object({ txSignature: txSig });
44
-
45
- // ═══════════════════════════════════════════════════════════════════
46
- // Nested Sub-schemas
47
- // ═══════════════════════════════════════════════════════════════════
48
-
49
- /** Reusable schema for an agent capability entry. */
50
- const capabilitySchema = z.object({
51
- id: z.string().describe("Capability identifier (e.g. 'jupiter:swap')"),
52
- description: z.string().nullish().describe("Human-readable description"),
53
- protocolId: z.string().nullish().describe("Protocol namespace"),
54
- version: z.string().nullish().describe("Semver version"),
55
- });
56
-
57
- /** Reusable schema for a volume curve breakpoint (tiered pricing). */
58
- const volumeBreakpointSchema = z.object({
59
- afterCalls: z.number().int().describe("Call threshold for this tier"),
60
- pricePerCall: lamports.describe("Price per call after threshold"),
61
- });
62
-
63
- /** Reusable schema for a pricing tier with token, settlement, and volume curve config. */
64
- const pricingTierSchema = z.object({
65
- tierId: z.string().describe("Pricing tier ID (e.g. 'standard')"),
66
- pricePerCall: lamports,
67
- minPricePerCall: lamports.nullish().describe("Price floor"),
68
- maxPricePerCall: lamports.nullish().describe("Price ceiling"),
69
- rateLimit: z.number().int().describe("Calls per second"),
70
- maxCallsPerSession: z.number().int().describe("0 = unlimited"),
71
- burstLimit: z.number().int().nullish(),
72
- tokenType: z
73
- .enum(["sol", "usdc", "spl"])
74
- .describe("Payment token type"),
75
- tokenMint: optPubkey.describe("SPL token mint address (when tokenType=spl)"),
76
- tokenDecimals: z.number().int().nullish(),
77
- settlementMode: z
78
- .enum(["instant", "escrow", "batched", "x402"])
79
- .nullish()
80
- .describe("Settlement mode"),
81
- minEscrowDeposit: lamports.nullish(),
82
- batchIntervalSec: z.number().int().nullish(),
83
- volumeCurve: z.array(volumeBreakpointSchema).nullish(),
84
- });
85
-
86
- /** Reusable schema for a settlement entry (calls + service hash). */
87
- const settlementSchema = z.object({
88
- callsToSettle: z.string().describe("Number of calls to settle"),
89
- serviceHash: hash32.describe("SHA-256 hash of the service rendered"),
90
- });
91
-
92
- // ═══════════════════════════════════════════════════════════════════
93
- // Agent Schemas
94
- // ═══════════════════════════════════════════════════════════════════
95
-
96
- /**
97
- * Zod input/output schemas for the **sap-agent** protocol (8 tools).
98
- *
99
- * @name agentSchemas
100
- * @description Covers agent registration, updates, activation lifecycle,
101
- * call reporting, reputation metrics, and on-chain data fetching.
102
- * @category Plugin
103
- * @since v0.1.0
104
- */
105
- export const agentSchemas = {
106
- registerAgent: {
107
- input: z.object({
108
- name: z.string().max(64).describe("Agent display name (max 64 chars)"),
109
- description: z
110
- .string()
111
- .max(512)
112
- .describe("Agent description (max 512 chars)"),
113
- capabilities: z
114
- .array(capabilitySchema)
115
- .describe("List of capabilities this agent offers"),
116
- pricing: z
117
- .array(pricingTierSchema)
118
- .describe("Pricing tiers for agent services"),
119
- protocols: z
120
- .array(z.string())
121
- .describe("Protocol IDs this agent supports"),
122
- agentId: z.string().nullish().describe("Optional DID-style agent ID"),
123
- agentUri: z
124
- .string()
125
- .url()
126
- .nullish()
127
- .describe("Optional agent metadata URI"),
128
- x402Endpoint: z
129
- .string()
130
- .url()
131
- .nullish()
132
- .describe("x402 payment endpoint URL"),
133
- }),
134
- output: writeOutput,
135
- },
136
-
137
- updateAgent: {
138
- input: z.object({
139
- name: z.string().max(64).nullish(),
140
- description: z.string().max(512).nullish(),
141
- capabilities: z.array(capabilitySchema).nullish(),
142
- pricing: z.array(pricingTierSchema).nullish(),
143
- protocols: z.array(z.string()).nullish(),
144
- agentId: z.string().nullish(),
145
- agentUri: z.string().url().nullish(),
146
- x402Endpoint: z.string().url().nullish(),
147
- }),
148
- output: writeOutput,
149
- },
150
-
151
- deactivateAgent: {
152
- input: z.object({}),
153
- output: writeOutput,
154
- },
155
-
156
- reactivateAgent: {
157
- input: z.object({}),
158
- output: writeOutput,
159
- },
160
-
161
- reportCalls: {
162
- input: z.object({
163
- callsServed: z.number().int().positive().describe("Number of calls served"),
164
- }),
165
- output: writeOutput,
166
- },
167
-
168
- updateReputation: {
169
- input: z.object({
170
- avgLatencyMs: z.number().int().min(0).describe("Average latency in ms"),
171
- uptimePercent: z
172
- .number()
173
- .int()
174
- .min(0)
175
- .max(100)
176
- .describe("Uptime percentage (0-100)"),
177
- }),
178
- output: writeOutput,
179
- },
180
-
181
- fetchAgent: {
182
- input: z.object({
183
- wallet: pubkey.nullish().describe("Agent wallet (defaults to caller)"),
184
- }),
185
- output: z.object({
186
- name: z.string(),
187
- description: z.string(),
188
- isActive: z.boolean(),
189
- reputationScore: z.number(),
190
- totalCallsServed: z.string(),
191
- totalFeedbacks: z.number(),
192
- avgLatencyMs: z.number(),
193
- uptimePercent: z.number(),
194
- wallet: pubkey,
195
- agentId: z.string().nullish(),
196
- x402Endpoint: z.string().nullish(),
197
- capabilities: z.array(capabilitySchema),
198
- pricing: z.array(pricingTierSchema),
199
- protocols: z.array(z.string()),
200
- }),
201
- },
202
-
203
- fetchGlobalRegistry: {
204
- input: z.object({}),
205
- output: z.object({
206
- totalAgents: z.string(),
207
- activeAgents: z.string(),
208
- totalFeedbacks: z.string(),
209
- totalCapabilities: z.number(),
210
- totalProtocols: z.number(),
211
- totalTools: z.number(),
212
- totalVaults: z.number(),
213
- totalEscrows: z.number(),
214
- totalAttestations: z.number(),
215
- authority: pubkey,
216
- }),
217
- },
218
- } as const;
219
-
220
- // ═══════════════════════════════════════════════════════════════════
221
- // Feedback Schemas
222
- // ═══════════════════════════════════════════════════════════════════
223
-
224
- /**
225
- * Zod input/output schemas for the **sap-feedback** protocol (4 tools).
226
- *
227
- * @name feedbackSchemas
228
- * @description Covers giving, updating, revoking, and fetching on-chain
229
- * feedback entries tied to agent identity PDAs.
230
- * @category Plugin
231
- * @since v0.1.0
232
- */
233
- export const feedbackSchemas = {
234
- giveFeedback: {
235
- input: z.object({
236
- agentWallet: pubkey.describe("Wallet of the agent to review"),
237
- score: z
238
- .number()
239
- .int()
240
- .min(1)
241
- .max(5)
242
- .describe("Feedback score (1-5)"),
243
- tag: z
244
- .string()
245
- .max(32)
246
- .describe("Short tag (e.g. 'reliable', 'fast', 'accurate')"),
247
- commentHash: hash32
248
- .nullish()
249
- .describe("Optional SHA-256 hash of off-chain comment"),
250
- }),
251
- output: writeOutput,
252
- },
253
-
254
- updateFeedback: {
255
- input: z.object({
256
- agentWallet: pubkey.describe("Wallet of the reviewed agent"),
257
- newScore: z.number().int().min(1).max(5).describe("Updated score (1-5)"),
258
- newTag: z.string().max(32).nullish().describe("Updated tag"),
259
- commentHash: hash32.nullish(),
260
- }),
261
- output: writeOutput,
262
- },
263
-
264
- revokeFeedback: {
265
- input: z.object({
266
- agentWallet: pubkey.describe("Wallet of the reviewed agent"),
267
- }),
268
- output: writeOutput,
269
- },
270
-
271
- fetchFeedback: {
272
- input: z.object({
273
- agentWallet: pubkey.describe("Wallet of the reviewed agent"),
274
- reviewer: pubkey.nullish().describe("Reviewer wallet (defaults to caller)"),
275
- }),
276
- output: z.object({
277
- agent: pubkey,
278
- reviewer: pubkey,
279
- score: z.number(),
280
- tag: z.string(),
281
- isRevoked: z.boolean(),
282
- createdAt: z.string(),
283
- updatedAt: z.string(),
284
- }),
285
- },
286
- } as const;
287
-
288
- // ═══════════════════════════════════════════════════════════════════
289
- // Attestation Schemas
290
- // ═══════════════════════════════════════════════════════════════════
291
-
292
- /**
293
- * Zod input/output schemas for the **sap-attestation** protocol (3 tools).
294
- *
295
- * @name attestationSchemas
296
- * @description Covers creating, revoking, and fetching on-chain attestations
297
- * between agents in the SAP Web of Trust.
298
- * @category Plugin
299
- * @since v0.1.0
300
- */
301
- export const attestationSchemas = {
302
- createAttestation: {
303
- input: z.object({
304
- agentWallet: pubkey.describe("Wallet of the agent to attest"),
305
- attestationType: z
306
- .string()
307
- .max(32)
308
- .describe(
309
- "Type of attestation (e.g. 'identity', 'capability', 'compliance')"
310
- ),
311
- metadataHash: hash32.describe(
312
- "SHA-256 hash of attestation metadata"
313
- ),
314
- expiresAt: z
315
- .string()
316
- .describe("Unix timestamp (seconds) when attestation expires"),
317
- }),
318
- output: writeOutput,
319
- },
320
-
321
- revokeAttestation: {
322
- input: z.object({
323
- agentWallet: pubkey.describe("Wallet of the attested agent"),
324
- }),
325
- output: writeOutput,
326
- },
327
-
328
- fetchAttestation: {
329
- input: z.object({
330
- agentWallet: pubkey.describe("Wallet of the attested agent"),
331
- attester: pubkey
332
- .nullish()
333
- .describe("Attester wallet (defaults to caller)"),
334
- }),
335
- output: z.object({
336
- agent: pubkey,
337
- attester: pubkey,
338
- attestationType: z.string(),
339
- isActive: z.boolean(),
340
- expiresAt: z.string(),
341
- createdAt: z.string(),
342
- }),
343
- },
344
- } as const;
345
-
346
- // ═══════════════════════════════════════════════════════════════════
347
- // Escrow Schemas
348
- // ═══════════════════════════════════════════════════════════════════
349
-
350
- /**
351
- * Zod input/output schemas for the **sap-escrow** protocol (6 tools).
352
- *
353
- * @name escrowSchemas
354
- * @description Covers escrow creation, deposits, settlement (single and batch),
355
- * withdrawal, and account data fetching for x402 micropayments.
356
- * @category Plugin
357
- * @since v0.1.0
358
- */
359
- export const escrowSchemas = {
360
- createEscrow: {
361
- input: z.object({
362
- agentWallet: pubkey.describe("Agent wallet to deposit escrow for"),
363
- pricePerCall: lamports.describe("Base price per call"),
364
- maxCalls: z.string().describe("Maximum calls allowed"),
365
- initialDeposit: lamports.describe("Initial deposit amount"),
366
- expiresAt: z.string().describe("Expiry timestamp (unix seconds)"),
367
- volumeCurve: z.array(volumeBreakpointSchema).default([]),
368
- tokenMint: optPubkey.describe(
369
- "SPL token mint (null = native SOL)"
370
- ),
371
- tokenDecimals: z
372
- .number()
373
- .int()
374
- .default(9)
375
- .describe("Token decimals (9=SOL, 6=USDC)"),
376
- }),
377
- output: writeOutput,
378
- },
379
-
380
- depositEscrow: {
381
- input: z.object({
382
- agentWallet: pubkey.describe("Agent wallet of the escrow"),
383
- amount: lamports.describe("Additional deposit amount"),
384
- }),
385
- output: writeOutput,
386
- },
387
-
388
- settleEscrow: {
389
- input: z.object({
390
- depositorWallet: pubkey.describe("Depositor (client) wallet"),
391
- callsToSettle: z.string().describe("Number of calls to settle"),
392
- serviceHash: hash32.describe("SHA-256 hash of the service rendered"),
393
- priorityFeeMicroLamports: z
394
- .number()
395
- .int()
396
- .min(0)
397
- .nullish()
398
- .describe("Priority fee in microlamports per CU (0 = none, 5000 = recommended)"),
399
- computeUnits: z
400
- .number()
401
- .int()
402
- .min(0)
403
- .nullish()
404
- .describe("Compute unit limit (default 200k, recommended 100k for settle)"),
405
- skipPreflight: z
406
- .boolean()
407
- .nullish()
408
- .describe("Skip Solana simulation before submitting (saves ~400ms)"),
409
- }),
410
- output: writeOutput,
411
- },
412
-
413
- withdrawEscrow: {
414
- input: z.object({
415
- agentWallet: pubkey.describe("Agent wallet of the escrow"),
416
- amount: lamports.describe("Amount to withdraw"),
417
- }),
418
- output: writeOutput,
419
- },
420
-
421
- batchSettle: {
422
- input: z.object({
423
- depositorWallet: pubkey.describe("Depositor (client) wallet"),
424
- settlements: z
425
- .array(settlementSchema)
426
- .min(1)
427
- .max(10)
428
- .describe("Up to 10 settlement entries"),
429
- priorityFeeMicroLamports: z
430
- .number()
431
- .int()
432
- .min(0)
433
- .nullish()
434
- .describe("Priority fee in microlamports per CU (0 = none, 5000 = recommended)"),
435
- computeUnits: z
436
- .number()
437
- .int()
438
- .min(0)
439
- .nullish()
440
- .describe("Compute unit limit (default 200k, recommended 300k for batch)"),
441
- skipPreflight: z
442
- .boolean()
443
- .nullish()
444
- .describe("Skip Solana simulation before submitting (saves ~400ms)"),
445
- }),
446
- output: writeOutput,
447
- },
448
-
449
- fetchEscrow: {
450
- input: z.object({
451
- agentWallet: pubkey.describe("Agent wallet"),
452
- depositor: pubkey.nullish().describe("Depositor wallet (defaults to caller)"),
453
- }),
454
- output: z.object({
455
- agent: pubkey,
456
- depositor: pubkey,
457
- agentWallet: pubkey,
458
- balance: z.string(),
459
- totalDeposited: z.string(),
460
- totalSettled: z.string(),
461
- totalCallsSettled: z.string(),
462
- pricePerCall: z.string(),
463
- maxCalls: z.string(),
464
- expiresAt: z.string(),
465
- tokenDecimals: z.number(),
466
- tokenMint: z.string().nullish(),
467
- }),
468
- },
469
- } as const;
470
-
471
- // ═══════════════════════════════════════════════════════════════════
472
- // Tools Schemas
473
- // ═══════════════════════════════════════════════════════════════════
474
-
475
- /**
476
- * Zod input/output schemas for the **sap-tools** protocol (7 tools).
477
- *
478
- * @name toolsSchemas
479
- * @description Covers tool publishing, schema inscription, updates,
480
- * activation lifecycle, invocation reporting, and descriptor fetching.
481
- * @category Plugin
482
- * @since v0.1.0
483
- */
484
- export const toolsSchemas = {
485
- publishToolByName: {
486
- input: z.object({
487
- toolName: z.string().max(64).describe("Tool name (e.g. 'swap')"),
488
- protocolId: z.string().describe("Protocol ID (e.g. 'jupiter')"),
489
- description: z
490
- .string()
491
- .max(256)
492
- .describe("Tool description for LLM consumption"),
493
- inputSchema: z
494
- .string()
495
- .describe("JSON schema string for tool input"),
496
- outputSchema: z
497
- .string()
498
- .describe("JSON schema string for tool output"),
499
- httpMethod: z
500
- .enum(["get", "post", "put", "delete", "compound"])
501
- .describe("HTTP method"),
502
- category: z
503
- .enum([
504
- "swap",
505
- "lend",
506
- "stake",
507
- "nft",
508
- "payment",
509
- "data",
510
- "governance",
511
- "bridge",
512
- "analytics",
513
- "custom",
514
- ])
515
- .describe("Tool category for discovery"),
516
- paramsCount: z.number().int().describe("Total parameter count"),
517
- requiredParams: z.number().int().describe("Required parameter count"),
518
- isCompound: z
519
- .boolean()
520
- .default(false)
521
- .describe("Whether tool chains multiple actions"),
522
- }),
523
- output: writeOutput,
524
- },
525
-
526
- inscribeToolSchema: {
527
- input: z.object({
528
- toolName: z.string().describe("Tool name"),
529
- schemaType: z
530
- .enum(["input", "output", "description"])
531
- .describe("Schema type to inscribe"),
532
- schemaData: z.string().describe("Schema content (JSON string)"),
533
- compression: z
534
- .enum(["none", "deflate", "gzip", "brotli"])
535
- .default("none")
536
- .describe("Compression algorithm"),
537
- }),
538
- output: writeOutput,
539
- },
540
-
541
- updateTool: {
542
- input: z.object({
543
- toolName: z.string().describe("Tool name to update"),
544
- httpMethod: z
545
- .enum(["get", "post", "put", "delete", "compound"])
546
- .nullish(),
547
- category: z
548
- .enum([
549
- "swap",
550
- "lend",
551
- "stake",
552
- "nft",
553
- "payment",
554
- "data",
555
- "governance",
556
- "bridge",
557
- "analytics",
558
- "custom",
559
- ])
560
- .nullish(),
561
- paramsCount: z.number().int().nullish(),
562
- requiredParams: z.number().int().nullish(),
563
- }),
564
- output: writeOutput,
565
- },
566
-
567
- deactivateTool: {
568
- input: z.object({
569
- toolName: z.string().describe("Tool name to deactivate"),
570
- }),
571
- output: writeOutput,
572
- },
573
-
574
- reactivateTool: {
575
- input: z.object({
576
- toolName: z.string().describe("Tool name to reactivate"),
577
- }),
578
- output: writeOutput,
579
- },
580
-
581
- reportInvocations: {
582
- input: z.object({
583
- toolName: z.string().describe("Tool name"),
584
- invocations: z
585
- .number()
586
- .int()
587
- .positive()
588
- .describe("Number of invocations to report"),
589
- }),
590
- output: writeOutput,
591
- },
592
-
593
- fetchTool: {
594
- input: z.object({
595
- agentWallet: pubkey.describe("Agent wallet that published the tool"),
596
- toolName: z.string().describe("Tool name"),
597
- }),
598
- output: z.object({
599
- toolName: z.string(),
600
- version: z.number(),
601
- isActive: z.boolean(),
602
- totalInvocations: z.string(),
603
- paramsCount: z.number(),
604
- requiredParams: z.number(),
605
- isCompound: z.boolean(),
606
- agent: pubkey,
607
- createdAt: z.string(),
608
- updatedAt: z.string(),
609
- }),
610
- },
611
- } as const;
612
-
613
- // ═══════════════════════════════════════════════════════════════════
614
- // Vault Schemas
615
- // ═══════════════════════════════════════════════════════════════════
616
-
617
- /**
618
- * Zod input/output schemas for the **sap-vault** protocol (10 tools).
619
- *
620
- * @name vaultSchemas
621
- * @description Covers vault initialization, session management, encrypted
622
- * memory inscription, nonce rotation, delegate authorization, and
623
- * vault/session data fetching.
624
- * @category Plugin
625
- * @since v0.1.0
626
- */
627
- export const vaultSchemas = {
628
- initVault: {
629
- input: z.object({
630
- vaultNonce: hash32.describe(
631
- "32-byte encryption nonce for vault initialization"
632
- ),
633
- }),
634
- output: writeOutput,
635
- },
636
-
637
- openSession: {
638
- input: z.object({
639
- sessionHash: hash32.describe(
640
- "32-byte session identifier hash"
641
- ),
642
- }),
643
- output: writeOutput,
644
- },
645
-
646
- inscribeMemory: {
647
- input: z.object({
648
- sessionHash: z
649
- .string()
650
- .describe("Hex-encoded session hash for PDA derivation"),
651
- sequence: z.number().int().describe("Sequence number within session"),
652
- encryptedData: z
653
- .string()
654
- .describe("Hex-encoded encrypted payload"),
655
- nonce: z
656
- .array(z.number().int().min(0).max(255))
657
- .length(12)
658
- .describe("12-byte AES-GCM nonce"),
659
- contentHash: hash32.describe("SHA-256 of plaintext content"),
660
- totalFragments: z
661
- .number()
662
- .int()
663
- .min(1)
664
- .default(1)
665
- .describe("Total fragments (1 = single)"),
666
- fragmentIndex: z.number().int().default(0).describe("Fragment index"),
667
- compression: z
668
- .number()
669
- .int()
670
- .default(0)
671
- .describe("Compression type (0=none, 1=deflate, 2=gzip, 3=brotli)"),
672
- epochIndex: z.number().int().default(0).describe("Epoch page index"),
673
- }),
674
- output: writeOutput,
675
- },
676
-
677
- closeSession: {
678
- input: z.object({
679
- sessionHash: z
680
- .string()
681
- .describe("Hex-encoded session hash for PDA derivation"),
682
- }),
683
- output: writeOutput,
684
- },
685
-
686
- closeVault: {
687
- input: z.object({}),
688
- output: writeOutput,
689
- },
690
-
691
- rotateNonce: {
692
- input: z.object({
693
- newNonce: hash32.describe("New 32-byte encryption nonce"),
694
- }),
695
- output: writeOutput,
696
- },
697
-
698
- addDelegate: {
699
- input: z.object({
700
- delegatePubkey: pubkey.describe("Wallet to authorize as delegate"),
701
- permissions: z
702
- .number()
703
- .int()
704
- .min(1)
705
- .max(7)
706
- .describe(
707
- "Permission bitmask (1=inscribe, 2=closeSession, 4=openSession, 7=all)"
708
- ),
709
- expiresAt: z
710
- .string()
711
- .describe("Delegation expiry (unix timestamp seconds)"),
712
- }),
713
- output: writeOutput,
714
- },
715
-
716
- revokeDelegate: {
717
- input: z.object({
718
- delegatePubkey: pubkey.describe("Delegate wallet to revoke"),
719
- }),
720
- output: writeOutput,
721
- },
722
-
723
- fetchVault: {
724
- input: z.object({
725
- agentWallet: pubkey
726
- .nullish()
727
- .describe("Agent wallet (defaults to caller)"),
728
- }),
729
- output: z.object({
730
- agent: pubkey,
731
- wallet: pubkey,
732
- totalSessions: z.number(),
733
- totalInscriptions: z.string(),
734
- totalBytesInscribed: z.string(),
735
- protocolVersion: z.number(),
736
- nonceVersion: z.number(),
737
- createdAt: z.string(),
738
- }),
739
- },
740
-
741
- fetchSession: {
742
- input: z.object({
743
- agentWallet: pubkey.describe("Agent wallet"),
744
- sessionHash: z
745
- .string()
746
- .describe("Hex-encoded session hash"),
747
- }),
748
- output: z.object({
749
- vault: pubkey,
750
- sequenceCounter: z.number(),
751
- totalBytes: z.string(),
752
- currentEpoch: z.number(),
753
- totalEpochs: z.number(),
754
- isClosed: z.boolean(),
755
- createdAt: z.string(),
756
- lastInscribedAt: z.string(),
757
- }),
758
- },
759
- } as const;
760
-
761
- // ═══════════════════════════════════════════════════════════════════
762
- // Indexing Schemas
763
- // ═══════════════════════════════════════════════════════════════════
764
-
765
- /**
766
- * Zod input/output schemas for the **sap-indexing** protocol (8 tools).
767
- *
768
- * @name indexingSchemas
769
- * @description Covers capability and protocol index creation, agent
770
- * registration/removal within indexes, and index data fetching.
771
- * @category Plugin
772
- * @since v0.1.0
773
- */
774
- export const indexingSchemas = {
775
- initCapabilityIndex: {
776
- input: z.object({
777
- capabilityId: z
778
- .string()
779
- .describe("Capability ID to index (e.g. 'jupiter:swap')"),
780
- }),
781
- output: writeOutput,
782
- },
783
-
784
- addToCapabilityIndex: {
785
- input: z.object({
786
- capabilityId: z.string().describe("Capability ID"),
787
- }),
788
- output: writeOutput,
789
- },
790
-
791
- removeFromCapabilityIndex: {
792
- input: z.object({
793
- capabilityId: z.string().describe("Capability ID"),
794
- }),
795
- output: writeOutput,
796
- },
797
-
798
- initProtocolIndex: {
799
- input: z.object({
800
- protocolId: z
801
- .string()
802
- .describe("Protocol ID to index (e.g. 'jupiter')"),
803
- }),
804
- output: writeOutput,
805
- },
806
-
807
- addToProtocolIndex: {
808
- input: z.object({
809
- protocolId: z.string().describe("Protocol ID"),
810
- }),
811
- output: writeOutput,
812
- },
813
-
814
- removeFromProtocolIndex: {
815
- input: z.object({
816
- protocolId: z.string().describe("Protocol ID"),
817
- }),
818
- output: writeOutput,
819
- },
820
-
821
- fetchCapabilityIndex: {
822
- input: z.object({
823
- capabilityId: z.string().describe("Capability ID to look up"),
824
- }),
825
- output: z.object({
826
- capabilityId: z.string(),
827
- agents: z.array(pubkey).describe("Agents registered for this capability"),
828
- totalPages: z.number(),
829
- lastUpdated: z.string(),
830
- }),
831
- },
832
-
833
- fetchProtocolIndex: {
834
- input: z.object({
835
- protocolId: z.string().describe("Protocol ID to look up"),
836
- }),
837
- output: z.object({
838
- protocolId: z.string(),
839
- agents: z.array(pubkey).describe("Agents registered for this protocol"),
840
- totalPages: z.number(),
841
- lastUpdated: z.string(),
842
- }),
843
- },
844
- } as const;
845
-
846
- // ═══════════════════════════════════════════════════════════════════
847
- // Ledger Schemas
848
- // ═══════════════════════════════════════════════════════════════════
849
-
850
- /**
851
- * Zod input/output schemas for the **sap-ledger** protocol (6 tools).
852
- *
853
- * @name ledgerSchemas
854
- * @description Covers ledger initialization, ring-buffer writes, sealing
855
- * to permanent pages, ledger closure, and metadata/page fetching.
856
- * @category Plugin
857
- * @since v0.1.0
858
- */
859
- export const ledgerSchemas = {
860
- initLedger: {
861
- input: z.object({
862
- sessionHash: z
863
- .string()
864
- .describe("Hex-encoded session hash (the session must exist)"),
865
- agentWallet: pubkey
866
- .nullish()
867
- .describe("Agent wallet (defaults to caller)"),
868
- }),
869
- output: writeOutput,
870
- },
871
-
872
- writeLedger: {
873
- input: z.object({
874
- sessionHash: z.string().describe("Hex-encoded session hash"),
875
- agentWallet: pubkey
876
- .nullish()
877
- .describe("Agent wallet (defaults to caller)"),
878
- data: z
879
- .string()
880
- .describe("Hex-encoded data to write to ring buffer"),
881
- contentHash: hash32.describe("SHA-256 of the plaintext data"),
882
- }),
883
- output: writeOutput,
884
- },
885
-
886
- sealLedger: {
887
- input: z.object({
888
- sessionHash: z.string().describe("Hex-encoded session hash"),
889
- agentWallet: pubkey
890
- .nullish()
891
- .describe("Agent wallet (defaults to caller)"),
892
- }),
893
- output: writeOutput,
894
- },
895
-
896
- closeLedger: {
897
- input: z.object({
898
- sessionHash: z.string().describe("Hex-encoded session hash"),
899
- agentWallet: pubkey
900
- .nullish()
901
- .describe("Agent wallet (defaults to caller)"),
902
- }),
903
- output: writeOutput,
904
- },
905
-
906
- fetchLedger: {
907
- input: z.object({
908
- sessionHash: z.string().describe("Hex-encoded session hash"),
909
- agentWallet: pubkey
910
- .nullish()
911
- .describe("Agent wallet (defaults to caller)"),
912
- }),
913
- output: z.object({
914
- session: pubkey,
915
- authority: pubkey,
916
- numEntries: z.number(),
917
- totalDataSize: z.string(),
918
- numPages: z.number(),
919
- createdAt: z.string(),
920
- updatedAt: z.string(),
921
- }),
922
- },
923
-
924
- fetchLedgerPage: {
925
- input: z.object({
926
- sessionHash: z.string().describe("Hex-encoded session hash"),
927
- agentWallet: pubkey
928
- .nullish()
929
- .describe("Agent wallet (defaults to caller)"),
930
- pageIndex: z.number().int().describe("Page index"),
931
- }),
932
- output: z.object({
933
- ledger: pubkey,
934
- pageIndex: z.number(),
935
- sealedAt: z.string(),
936
- entriesInPage: z.number(),
937
- dataSize: z.number(),
938
- data: z.array(z.number()).describe("Raw page data bytes"),
939
- }),
940
- },
941
- } as const;