@oobe-protocol-labs/synapse-sap-sdk 0.14.0 → 0.15.1

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 (513) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +986 -0
  3. package/dist/cjs/client.js +31 -14
  4. package/dist/cjs/client.js.map +1 -1
  5. package/dist/cjs/constants/addresses.js +143 -0
  6. package/dist/cjs/constants/addresses.js.map +1 -0
  7. package/dist/cjs/constants/index.js +64 -0
  8. package/dist/cjs/constants/index.js.map +1 -0
  9. package/dist/cjs/constants/limits.js +161 -0
  10. package/dist/cjs/constants/limits.js.map +1 -0
  11. package/dist/cjs/constants/network.js +81 -0
  12. package/dist/cjs/constants/network.js.map +1 -0
  13. package/dist/cjs/constants/payments.js +137 -0
  14. package/dist/cjs/constants/payments.js.map +1 -0
  15. package/dist/cjs/constants/programs.js +78 -0
  16. package/dist/cjs/constants/programs.js.map +1 -0
  17. package/dist/cjs/constants/seeds.js +76 -0
  18. package/dist/cjs/constants/seeds.js.map +1 -0
  19. package/dist/cjs/constants.js +39 -32
  20. package/dist/cjs/constants.js.map +1 -1
  21. package/dist/cjs/core/client.js +546 -0
  22. package/dist/cjs/core/client.js.map +1 -0
  23. package/dist/cjs/core/connection.js +350 -0
  24. package/dist/cjs/core/connection.js.map +1 -0
  25. package/dist/cjs/core/index.js +25 -0
  26. package/dist/cjs/core/index.js.map +1 -0
  27. package/dist/cjs/errors/index.js +334 -0
  28. package/dist/cjs/errors/index.js.map +1 -0
  29. package/dist/cjs/errors.js +15 -5
  30. package/dist/cjs/errors.js.map +1 -1
  31. package/dist/cjs/events/geyser.js +295 -0
  32. package/dist/cjs/events/geyser.js.map +1 -0
  33. package/dist/cjs/events/index.js +32 -26
  34. package/dist/cjs/events/index.js.map +1 -1
  35. package/dist/cjs/idl/index.js +63 -0
  36. package/dist/cjs/idl/index.js.map +1 -0
  37. package/dist/cjs/idl/synapse_agent_sap.json +14595 -0
  38. package/dist/cjs/instructions/agent.js +1 -0
  39. package/dist/cjs/instructions/agent.js.map +1 -1
  40. package/dist/cjs/instructions/attestation.js +1 -0
  41. package/dist/cjs/instructions/attestation.js.map +1 -1
  42. package/dist/cjs/instructions/digest.js +1 -0
  43. package/dist/cjs/instructions/digest.js.map +1 -1
  44. package/dist/cjs/instructions/dispute.js +1 -0
  45. package/dist/cjs/instructions/dispute.js.map +1 -1
  46. package/dist/cjs/instructions/escrow.js +1 -0
  47. package/dist/cjs/instructions/escrow.js.map +1 -1
  48. package/dist/cjs/instructions/global.js +1 -0
  49. package/dist/cjs/instructions/global.js.map +1 -1
  50. package/dist/cjs/instructions/indexing.js +1 -0
  51. package/dist/cjs/instructions/indexing.js.map +1 -1
  52. package/dist/cjs/instructions/misc.js +1 -0
  53. package/dist/cjs/instructions/misc.js.map +1 -1
  54. package/dist/cjs/instructions/session.js +1 -0
  55. package/dist/cjs/instructions/session.js.map +1 -1
  56. package/dist/cjs/instructions/staking.js +1 -0
  57. package/dist/cjs/instructions/staking.js.map +1 -1
  58. package/dist/cjs/instructions/subscription.js +1 -0
  59. package/dist/cjs/instructions/subscription.js.map +1 -1
  60. package/dist/cjs/instructions/tools.js +1 -0
  61. package/dist/cjs/instructions/tools.js.map +1 -1
  62. package/dist/cjs/instructions/vault.js +1 -0
  63. package/dist/cjs/instructions/vault.js.map +1 -1
  64. package/dist/cjs/modules/agent.js +272 -0
  65. package/dist/cjs/modules/agent.js.map +1 -0
  66. package/dist/cjs/modules/attestation.js +147 -0
  67. package/dist/cjs/modules/attestation.js.map +1 -0
  68. package/dist/cjs/modules/base.js +189 -0
  69. package/dist/cjs/modules/base.js.map +1 -0
  70. package/dist/cjs/modules/escrow-v2.js +607 -0
  71. package/dist/cjs/modules/escrow-v2.js.map +1 -0
  72. package/dist/cjs/modules/escrow.js +336 -0
  73. package/dist/cjs/modules/escrow.js.map +1 -0
  74. package/dist/cjs/modules/feedback.js +166 -0
  75. package/dist/cjs/modules/feedback.js.map +1 -0
  76. package/dist/cjs/modules/index.js +43 -0
  77. package/dist/cjs/modules/index.js.map +1 -0
  78. package/dist/cjs/modules/indexing.js +375 -0
  79. package/dist/cjs/modules/indexing.js.map +1 -0
  80. package/dist/cjs/modules/ledger.js +234 -0
  81. package/dist/cjs/modules/ledger.js.map +1 -0
  82. package/dist/cjs/modules/receipt.js +148 -0
  83. package/dist/cjs/modules/receipt.js.map +1 -0
  84. package/dist/cjs/modules/staking.js +159 -0
  85. package/dist/cjs/modules/staking.js.map +1 -0
  86. package/dist/cjs/modules/subscription.js +96 -0
  87. package/dist/cjs/modules/subscription.js.map +1 -0
  88. package/dist/cjs/modules/tools.js +345 -0
  89. package/dist/cjs/modules/tools.js.map +1 -0
  90. package/dist/cjs/modules/vault.js +427 -0
  91. package/dist/cjs/modules/vault.js.map +1 -0
  92. package/dist/cjs/parser/client.js +146 -0
  93. package/dist/cjs/parser/client.js.map +1 -0
  94. package/dist/cjs/parser/complete.js +177 -0
  95. package/dist/cjs/parser/complete.js.map +1 -0
  96. package/dist/cjs/parser/index.js +57 -0
  97. package/dist/cjs/parser/index.js.map +1 -0
  98. package/dist/cjs/parser/inner.js +185 -0
  99. package/dist/cjs/parser/inner.js.map +1 -0
  100. package/dist/cjs/parser/instructions.js +114 -0
  101. package/dist/cjs/parser/instructions.js.map +1 -0
  102. package/dist/cjs/parser/transaction.js +153 -0
  103. package/dist/cjs/parser/transaction.js.map +1 -0
  104. package/dist/cjs/parser/types.js +14 -0
  105. package/dist/cjs/parser/types.js.map +1 -0
  106. package/dist/cjs/pda/index.js +672 -0
  107. package/dist/cjs/pda/index.js.map +1 -0
  108. package/dist/cjs/plugin/index.js +952 -0
  109. package/dist/cjs/plugin/index.js.map +1 -0
  110. package/dist/cjs/plugin/protocols.js +282 -0
  111. package/dist/cjs/plugin/protocols.js.map +1 -0
  112. package/dist/cjs/plugin/schemas.js +863 -0
  113. package/dist/cjs/plugin/schemas.js.map +1 -0
  114. package/dist/cjs/postgres/adapter.js +715 -0
  115. package/dist/cjs/postgres/adapter.js.map +1 -0
  116. package/dist/cjs/postgres/index.js +50 -0
  117. package/dist/cjs/postgres/index.js.map +1 -0
  118. package/dist/cjs/postgres/serializers.js +381 -0
  119. package/dist/cjs/postgres/serializers.js.map +1 -0
  120. package/dist/cjs/postgres/sync.js +289 -0
  121. package/dist/cjs/postgres/sync.js.map +1 -0
  122. package/dist/cjs/postgres/types.js +44 -0
  123. package/dist/cjs/postgres/types.js.map +1 -0
  124. package/dist/cjs/registries/builder.js +414 -0
  125. package/dist/cjs/registries/builder.js.map +1 -0
  126. package/dist/cjs/registries/discovery.js +362 -0
  127. package/dist/cjs/registries/discovery.js.map +1 -0
  128. package/dist/cjs/registries/fairscale.js +639 -0
  129. package/dist/cjs/registries/fairscale.js.map +1 -0
  130. package/dist/cjs/registries/index.js +58 -0
  131. package/dist/cjs/registries/index.js.map +1 -0
  132. package/dist/cjs/registries/metaplex-bridge.js +743 -0
  133. package/dist/cjs/registries/metaplex-bridge.js.map +1 -0
  134. package/dist/cjs/registries/session.js +433 -0
  135. package/dist/cjs/registries/session.js.map +1 -0
  136. package/dist/cjs/registries/x402.js +668 -0
  137. package/dist/cjs/registries/x402.js.map +1 -0
  138. package/dist/cjs/types/accounts.js +13 -0
  139. package/dist/cjs/types/accounts.js.map +1 -0
  140. package/dist/cjs/types/common.js +13 -0
  141. package/dist/cjs/types/common.js.map +1 -0
  142. package/dist/cjs/types/endpoint.js +15 -0
  143. package/dist/cjs/types/endpoint.js.map +1 -0
  144. package/dist/cjs/types/enums.js +269 -0
  145. package/dist/cjs/types/enums.js.map +1 -0
  146. package/dist/cjs/types/index.js +41 -0
  147. package/dist/cjs/types/index.js.map +1 -0
  148. package/dist/cjs/types/instructions.js +92 -0
  149. package/dist/cjs/types/instructions.js.map +1 -0
  150. package/dist/cjs/types.js +4 -1
  151. package/dist/cjs/types.js.map +1 -1
  152. package/dist/cjs/utils/anchor-errors.js +453 -0
  153. package/dist/cjs/utils/anchor-errors.js.map +1 -0
  154. package/dist/cjs/utils/endpoint-validator.js +232 -0
  155. package/dist/cjs/utils/endpoint-validator.js.map +1 -0
  156. package/dist/cjs/utils/escrow-validation.js +219 -0
  157. package/dist/cjs/utils/escrow-validation.js.map +1 -0
  158. package/dist/cjs/utils/hash.js +109 -0
  159. package/dist/cjs/utils/hash.js.map +1 -0
  160. package/dist/cjs/utils/index.js +10 -4
  161. package/dist/cjs/utils/index.js.map +1 -1
  162. package/dist/cjs/utils/merchant-validator.js +246 -0
  163. package/dist/cjs/utils/merchant-validator.js.map +1 -0
  164. package/dist/cjs/utils/network-normalizer.js +236 -0
  165. package/dist/cjs/utils/network-normalizer.js.map +1 -0
  166. package/dist/cjs/utils/priority-fee.js +215 -0
  167. package/dist/cjs/utils/priority-fee.js.map +1 -0
  168. package/dist/cjs/utils/rpc-strategy.js +239 -0
  169. package/dist/cjs/utils/rpc-strategy.js.map +1 -0
  170. package/dist/cjs/utils/schemas.js +331 -0
  171. package/dist/cjs/utils/schemas.js.map +1 -0
  172. package/dist/cjs/utils/serialization.js +105 -0
  173. package/dist/cjs/utils/serialization.js.map +1 -0
  174. package/dist/cjs/utils/validate.js +1 -1
  175. package/dist/cjs/utils/validate.js.map +1 -1
  176. package/dist/cjs/utils/validation.js +36 -0
  177. package/dist/cjs/utils/validation.js.map +1 -0
  178. package/dist/cjs/utils/volume-curve.js +117 -0
  179. package/dist/cjs/utils/volume-curve.js.map +1 -0
  180. package/dist/cjs/utils/x402-direct.js +231 -0
  181. package/dist/cjs/utils/x402-direct.js.map +1 -0
  182. package/dist/esm/client.js +31 -14
  183. package/dist/esm/client.js.map +1 -1
  184. package/dist/esm/constants/addresses.d.ts +117 -0
  185. package/dist/esm/constants/addresses.d.ts.map +1 -0
  186. package/dist/esm/constants/addresses.js +140 -0
  187. package/dist/esm/constants/addresses.js.map +1 -0
  188. package/dist/esm/constants/index.d.ts +31 -0
  189. package/dist/esm/constants/index.d.ts.map +1 -0
  190. package/dist/esm/constants/index.js +35 -0
  191. package/dist/esm/constants/index.js.map +1 -0
  192. package/dist/esm/constants/limits.d.ts +149 -0
  193. package/dist/esm/constants/limits.d.ts.map +1 -0
  194. package/dist/esm/constants/limits.js +158 -0
  195. package/dist/esm/constants/limits.js.map +1 -0
  196. package/dist/esm/constants/network.d.ts +81 -0
  197. package/dist/esm/constants/network.d.ts.map +1 -0
  198. package/dist/esm/constants/network.js +78 -0
  199. package/dist/esm/constants/network.js.map +1 -0
  200. package/dist/esm/constants/payments.d.ts +121 -0
  201. package/dist/esm/constants/payments.d.ts.map +1 -0
  202. package/dist/esm/constants/payments.js +131 -0
  203. package/dist/esm/constants/payments.js.map +1 -0
  204. package/dist/esm/constants/programs.d.ts +69 -0
  205. package/dist/esm/constants/programs.d.ts.map +1 -0
  206. package/dist/esm/constants/programs.js +75 -0
  207. package/dist/esm/constants/programs.js.map +1 -0
  208. package/dist/esm/constants/seeds.d.ts +80 -0
  209. package/dist/esm/constants/seeds.d.ts.map +1 -0
  210. package/dist/esm/constants/seeds.js +73 -0
  211. package/dist/esm/constants/seeds.js.map +1 -0
  212. package/dist/esm/constants.d.ts +14 -27
  213. package/dist/esm/constants.d.ts.map +1 -1
  214. package/dist/esm/constants.js +16 -31
  215. package/dist/esm/constants.js.map +1 -1
  216. package/dist/esm/core/client.d.ts +452 -0
  217. package/dist/esm/core/client.d.ts.map +1 -0
  218. package/dist/esm/core/client.js +539 -0
  219. package/dist/esm/core/client.js.map +1 -0
  220. package/dist/esm/core/connection.d.ts +305 -0
  221. package/dist/esm/core/connection.d.ts.map +1 -0
  222. package/dist/esm/core/connection.js +345 -0
  223. package/dist/esm/core/connection.js.map +1 -0
  224. package/dist/esm/core/index.d.ts +20 -0
  225. package/dist/esm/core/index.d.ts.map +1 -0
  226. package/dist/esm/core/index.js +19 -0
  227. package/dist/esm/core/index.js.map +1 -0
  228. package/dist/esm/errors/index.d.ts +276 -0
  229. package/dist/esm/errors/index.d.ts.map +1 -0
  230. package/dist/esm/errors/index.js +325 -0
  231. package/dist/esm/errors/index.js.map +1 -0
  232. package/dist/esm/errors.d.ts +8 -0
  233. package/dist/esm/errors.d.ts.map +1 -1
  234. package/dist/esm/errors.js +8 -0
  235. package/dist/esm/errors.js.map +1 -1
  236. package/dist/esm/events/geyser.d.ts +150 -0
  237. package/dist/esm/events/geyser.d.ts.map +1 -0
  238. package/dist/esm/events/geyser.js +258 -0
  239. package/dist/esm/events/geyser.js.map +1 -0
  240. package/dist/esm/events/index.d.ts +11 -7
  241. package/dist/esm/events/index.d.ts.map +1 -1
  242. package/dist/esm/events/index.js +30 -26
  243. package/dist/esm/events/index.js.map +1 -1
  244. package/dist/esm/idl/index.d.ts +70 -0
  245. package/dist/esm/idl/index.d.ts.map +1 -0
  246. package/dist/esm/idl/index.js +57 -0
  247. package/dist/esm/idl/index.js.map +1 -0
  248. package/dist/esm/idl/synapse_agent_sap.json +14595 -0
  249. package/dist/esm/instructions/agent.js +1 -0
  250. package/dist/esm/instructions/agent.js.map +1 -1
  251. package/dist/esm/instructions/attestation.js +1 -0
  252. package/dist/esm/instructions/attestation.js.map +1 -1
  253. package/dist/esm/instructions/digest.js +1 -0
  254. package/dist/esm/instructions/digest.js.map +1 -1
  255. package/dist/esm/instructions/dispute.js +1 -0
  256. package/dist/esm/instructions/dispute.js.map +1 -1
  257. package/dist/esm/instructions/escrow.js +1 -0
  258. package/dist/esm/instructions/escrow.js.map +1 -1
  259. package/dist/esm/instructions/global.js +1 -0
  260. package/dist/esm/instructions/global.js.map +1 -1
  261. package/dist/esm/instructions/indexing.js +1 -0
  262. package/dist/esm/instructions/indexing.js.map +1 -1
  263. package/dist/esm/instructions/misc.js +1 -0
  264. package/dist/esm/instructions/misc.js.map +1 -1
  265. package/dist/esm/instructions/session.js +1 -0
  266. package/dist/esm/instructions/session.js.map +1 -1
  267. package/dist/esm/instructions/staking.js +1 -0
  268. package/dist/esm/instructions/staking.js.map +1 -1
  269. package/dist/esm/instructions/subscription.js +1 -0
  270. package/dist/esm/instructions/subscription.js.map +1 -1
  271. package/dist/esm/instructions/tools.js +1 -0
  272. package/dist/esm/instructions/tools.js.map +1 -1
  273. package/dist/esm/instructions/vault.js +1 -0
  274. package/dist/esm/instructions/vault.js.map +1 -1
  275. package/dist/esm/modules/agent.d.ts +166 -0
  276. package/dist/esm/modules/agent.d.ts.map +1 -0
  277. package/dist/esm/modules/agent.js +268 -0
  278. package/dist/esm/modules/agent.js.map +1 -0
  279. package/dist/esm/modules/attestation.d.ts +96 -0
  280. package/dist/esm/modules/attestation.d.ts.map +1 -0
  281. package/dist/esm/modules/attestation.js +143 -0
  282. package/dist/esm/modules/attestation.js.map +1 -0
  283. package/dist/esm/modules/base.d.ts +161 -0
  284. package/dist/esm/modules/base.d.ts.map +1 -0
  285. package/dist/esm/modules/base.js +185 -0
  286. package/dist/esm/modules/base.js.map +1 -0
  287. package/dist/esm/modules/escrow-v2.d.ts +169 -0
  288. package/dist/esm/modules/escrow-v2.d.ts.map +1 -0
  289. package/dist/esm/modules/escrow-v2.js +603 -0
  290. package/dist/esm/modules/escrow-v2.js.map +1 -0
  291. package/dist/esm/modules/escrow.d.ts +168 -0
  292. package/dist/esm/modules/escrow.d.ts.map +1 -0
  293. package/dist/esm/modules/escrow.js +332 -0
  294. package/dist/esm/modules/escrow.js.map +1 -0
  295. package/dist/esm/modules/feedback.d.ts +105 -0
  296. package/dist/esm/modules/feedback.d.ts.map +1 -0
  297. package/dist/esm/modules/feedback.js +162 -0
  298. package/dist/esm/modules/feedback.js.map +1 -0
  299. package/dist/esm/modules/index.d.ts +28 -0
  300. package/dist/esm/modules/index.d.ts.map +1 -0
  301. package/dist/esm/modules/index.js +27 -0
  302. package/dist/esm/modules/index.js.map +1 -0
  303. package/dist/esm/modules/indexing.d.ts +200 -0
  304. package/dist/esm/modules/indexing.d.ts.map +1 -0
  305. package/dist/esm/modules/indexing.js +371 -0
  306. package/dist/esm/modules/indexing.js.map +1 -0
  307. package/dist/esm/modules/ledger.d.ts +150 -0
  308. package/dist/esm/modules/ledger.d.ts.map +1 -0
  309. package/dist/esm/modules/ledger.js +230 -0
  310. package/dist/esm/modules/ledger.js.map +1 -0
  311. package/dist/esm/modules/receipt.d.ts +77 -0
  312. package/dist/esm/modules/receipt.d.ts.map +1 -0
  313. package/dist/esm/modules/receipt.js +144 -0
  314. package/dist/esm/modules/receipt.js.map +1 -0
  315. package/dist/esm/modules/staking.d.ts +51 -0
  316. package/dist/esm/modules/staking.d.ts.map +1 -0
  317. package/dist/esm/modules/staking.js +155 -0
  318. package/dist/esm/modules/staking.js.map +1 -0
  319. package/dist/esm/modules/subscription.d.ts +33 -0
  320. package/dist/esm/modules/subscription.d.ts.map +1 -0
  321. package/dist/esm/modules/subscription.js +92 -0
  322. package/dist/esm/modules/subscription.js.map +1 -0
  323. package/dist/esm/modules/tools.d.ts +182 -0
  324. package/dist/esm/modules/tools.d.ts.map +1 -0
  325. package/dist/esm/modules/tools.js +341 -0
  326. package/dist/esm/modules/tools.js.map +1 -0
  327. package/dist/esm/modules/vault.d.ts +240 -0
  328. package/dist/esm/modules/vault.d.ts.map +1 -0
  329. package/dist/esm/modules/vault.js +423 -0
  330. package/dist/esm/modules/vault.js.map +1 -0
  331. package/dist/esm/parser/client.d.ts +123 -0
  332. package/dist/esm/parser/client.d.ts.map +1 -0
  333. package/dist/esm/parser/client.js +142 -0
  334. package/dist/esm/parser/client.js.map +1 -0
  335. package/dist/esm/parser/complete.d.ts +90 -0
  336. package/dist/esm/parser/complete.d.ts.map +1 -0
  337. package/dist/esm/parser/complete.js +173 -0
  338. package/dist/esm/parser/complete.js.map +1 -0
  339. package/dist/esm/parser/index.d.ts +40 -0
  340. package/dist/esm/parser/index.d.ts.map +1 -0
  341. package/dist/esm/parser/index.js +43 -0
  342. package/dist/esm/parser/index.js.map +1 -0
  343. package/dist/esm/parser/inner.d.ts +114 -0
  344. package/dist/esm/parser/inner.d.ts.map +1 -0
  345. package/dist/esm/parser/inner.js +180 -0
  346. package/dist/esm/parser/inner.js.map +1 -0
  347. package/dist/esm/parser/instructions.d.ts +76 -0
  348. package/dist/esm/parser/instructions.d.ts.map +1 -0
  349. package/dist/esm/parser/instructions.js +109 -0
  350. package/dist/esm/parser/instructions.js.map +1 -0
  351. package/dist/esm/parser/transaction.d.ts +77 -0
  352. package/dist/esm/parser/transaction.d.ts.map +1 -0
  353. package/dist/esm/parser/transaction.js +149 -0
  354. package/dist/esm/parser/transaction.js.map +1 -0
  355. package/dist/esm/parser/types.d.ts +154 -0
  356. package/dist/esm/parser/types.d.ts.map +1 -0
  357. package/dist/esm/parser/types.js +13 -0
  358. package/dist/esm/parser/types.js.map +1 -0
  359. package/dist/esm/pda/index.d.ts +510 -0
  360. package/dist/esm/pda/index.d.ts.map +1 -0
  361. package/dist/esm/pda/index.js +638 -0
  362. package/dist/esm/pda/index.js.map +1 -0
  363. package/dist/esm/plugin/index.d.ts +171 -0
  364. package/dist/esm/plugin/index.d.ts.map +1 -0
  365. package/dist/esm/plugin/index.js +945 -0
  366. package/dist/esm/plugin/index.js.map +1 -0
  367. package/dist/esm/plugin/protocols.d.ts +152 -0
  368. package/dist/esm/plugin/protocols.d.ts.map +1 -0
  369. package/dist/esm/plugin/protocols.js +279 -0
  370. package/dist/esm/plugin/protocols.js.map +1 -0
  371. package/dist/esm/plugin/schemas.d.ts +829 -0
  372. package/dist/esm/plugin/schemas.d.ts.map +1 -0
  373. package/dist/esm/plugin/schemas.js +860 -0
  374. package/dist/esm/plugin/schemas.js.map +1 -0
  375. package/dist/esm/postgres/adapter.d.ts +355 -0
  376. package/dist/esm/postgres/adapter.d.ts.map +1 -0
  377. package/dist/esm/postgres/adapter.js +678 -0
  378. package/dist/esm/postgres/adapter.js.map +1 -0
  379. package/dist/esm/postgres/index.d.ts +24 -0
  380. package/dist/esm/postgres/index.d.ts.map +1 -0
  381. package/dist/esm/postgres/index.js +27 -0
  382. package/dist/esm/postgres/index.js.map +1 -0
  383. package/dist/esm/postgres/serializers.d.ts +30 -0
  384. package/dist/esm/postgres/serializers.d.ts.map +1 -0
  385. package/dist/esm/postgres/serializers.js +362 -0
  386. package/dist/esm/postgres/serializers.js.map +1 -0
  387. package/dist/esm/postgres/sync.d.ts +156 -0
  388. package/dist/esm/postgres/sync.d.ts.map +1 -0
  389. package/dist/esm/postgres/sync.js +285 -0
  390. package/dist/esm/postgres/sync.js.map +1 -0
  391. package/dist/esm/postgres/types.d.ts +167 -0
  392. package/dist/esm/postgres/types.d.ts.map +1 -0
  393. package/dist/esm/postgres/types.js +41 -0
  394. package/dist/esm/postgres/types.js.map +1 -0
  395. package/dist/esm/registries/builder.d.ts +340 -0
  396. package/dist/esm/registries/builder.d.ts.map +1 -0
  397. package/dist/esm/registries/builder.js +410 -0
  398. package/dist/esm/registries/builder.js.map +1 -0
  399. package/dist/esm/registries/discovery.d.ts +333 -0
  400. package/dist/esm/registries/discovery.d.ts.map +1 -0
  401. package/dist/esm/registries/discovery.js +358 -0
  402. package/dist/esm/registries/discovery.js.map +1 -0
  403. package/dist/esm/registries/fairscale.d.ts +680 -0
  404. package/dist/esm/registries/fairscale.d.ts.map +1 -0
  405. package/dist/esm/registries/fairscale.js +633 -0
  406. package/dist/esm/registries/fairscale.js.map +1 -0
  407. package/dist/esm/registries/index.d.ts +52 -0
  408. package/dist/esm/registries/index.d.ts.map +1 -0
  409. package/dist/esm/registries/index.js +46 -0
  410. package/dist/esm/registries/index.js.map +1 -0
  411. package/dist/esm/registries/metaplex-bridge.d.ts +489 -0
  412. package/dist/esm/registries/metaplex-bridge.d.ts.map +1 -0
  413. package/dist/esm/registries/metaplex-bridge.js +706 -0
  414. package/dist/esm/registries/metaplex-bridge.js.map +1 -0
  415. package/dist/esm/registries/session.d.ts +323 -0
  416. package/dist/esm/registries/session.d.ts.map +1 -0
  417. package/dist/esm/registries/session.js +429 -0
  418. package/dist/esm/registries/session.js.map +1 -0
  419. package/dist/esm/registries/x402.d.ts +530 -0
  420. package/dist/esm/registries/x402.d.ts.map +1 -0
  421. package/dist/esm/registries/x402.js +664 -0
  422. package/dist/esm/registries/x402.js.map +1 -0
  423. package/dist/esm/types/accounts.d.ts +765 -0
  424. package/dist/esm/types/accounts.d.ts.map +1 -0
  425. package/dist/esm/types/accounts.js +12 -0
  426. package/dist/esm/types/accounts.js.map +1 -0
  427. package/dist/esm/types/common.d.ts +166 -0
  428. package/dist/esm/types/common.d.ts.map +1 -0
  429. package/dist/esm/types/common.js +12 -0
  430. package/dist/esm/types/common.js.map +1 -0
  431. package/dist/esm/types/endpoint.d.ts +161 -0
  432. package/dist/esm/types/endpoint.d.ts.map +1 -0
  433. package/dist/esm/types/endpoint.js +14 -0
  434. package/dist/esm/types/endpoint.js.map +1 -0
  435. package/dist/esm/types/enums.d.ts +353 -0
  436. package/dist/esm/types/enums.d.ts.map +1 -0
  437. package/dist/esm/types/enums.js +266 -0
  438. package/dist/esm/types/enums.js.map +1 -0
  439. package/dist/esm/types/index.d.ts +29 -0
  440. package/dist/esm/types/index.d.ts.map +1 -0
  441. package/dist/esm/types/index.js +25 -0
  442. package/dist/esm/types/index.js.map +1 -0
  443. package/dist/esm/types/instructions.d.ts +400 -0
  444. package/dist/esm/types/instructions.d.ts.map +1 -0
  445. package/dist/esm/types/instructions.js +89 -0
  446. package/dist/esm/types/instructions.js.map +1 -0
  447. package/dist/esm/types.d.ts +28 -0
  448. package/dist/esm/types.d.ts.map +1 -1
  449. package/dist/esm/types.js +1 -0
  450. package/dist/esm/types.js.map +1 -1
  451. package/dist/esm/utils/anchor-errors.d.ts +61 -0
  452. package/dist/esm/utils/anchor-errors.d.ts.map +1 -0
  453. package/dist/esm/utils/anchor-errors.js +447 -0
  454. package/dist/esm/utils/anchor-errors.js.map +1 -0
  455. package/dist/esm/utils/endpoint-validator.d.ts +110 -0
  456. package/dist/esm/utils/endpoint-validator.d.ts.map +1 -0
  457. package/dist/esm/utils/endpoint-validator.js +226 -0
  458. package/dist/esm/utils/endpoint-validator.js.map +1 -0
  459. package/dist/esm/utils/escrow-validation.d.ts +145 -0
  460. package/dist/esm/utils/escrow-validation.d.ts.map +1 -0
  461. package/dist/esm/utils/escrow-validation.js +212 -0
  462. package/dist/esm/utils/escrow-validation.js.map +1 -0
  463. package/dist/esm/utils/hash.d.ts +75 -0
  464. package/dist/esm/utils/hash.d.ts.map +1 -0
  465. package/dist/esm/utils/hash.js +103 -0
  466. package/dist/esm/utils/hash.js.map +1 -0
  467. package/dist/esm/utils/index.d.ts +3 -1
  468. package/dist/esm/utils/index.d.ts.map +1 -1
  469. package/dist/esm/utils/index.js +6 -3
  470. package/dist/esm/utils/index.js.map +1 -1
  471. package/dist/esm/utils/merchant-validator.d.ts +176 -0
  472. package/dist/esm/utils/merchant-validator.d.ts.map +1 -0
  473. package/dist/esm/utils/merchant-validator.js +241 -0
  474. package/dist/esm/utils/merchant-validator.js.map +1 -0
  475. package/dist/esm/utils/network-normalizer.d.ts +120 -0
  476. package/dist/esm/utils/network-normalizer.d.ts.map +1 -0
  477. package/dist/esm/utils/network-normalizer.js +229 -0
  478. package/dist/esm/utils/network-normalizer.js.map +1 -0
  479. package/dist/esm/utils/priority-fee.d.ts +205 -0
  480. package/dist/esm/utils/priority-fee.d.ts.map +1 -0
  481. package/dist/esm/utils/priority-fee.js +209 -0
  482. package/dist/esm/utils/priority-fee.js.map +1 -0
  483. package/dist/esm/utils/rpc-strategy.d.ts +172 -0
  484. package/dist/esm/utils/rpc-strategy.d.ts.map +1 -0
  485. package/dist/esm/utils/rpc-strategy.js +231 -0
  486. package/dist/esm/utils/rpc-strategy.js.map +1 -0
  487. package/dist/esm/utils/schemas.d.ts +351 -0
  488. package/dist/esm/utils/schemas.d.ts.map +1 -0
  489. package/dist/esm/utils/schemas.js +320 -0
  490. package/dist/esm/utils/schemas.js.map +1 -0
  491. package/dist/esm/utils/serialization.d.ts +69 -0
  492. package/dist/esm/utils/serialization.d.ts.map +1 -0
  493. package/dist/esm/utils/serialization.js +98 -0
  494. package/dist/esm/utils/serialization.js.map +1 -0
  495. package/dist/esm/utils/validate.js +1 -1
  496. package/dist/esm/utils/validate.js.map +1 -1
  497. package/dist/esm/utils/validation.d.ts +29 -0
  498. package/dist/esm/utils/validation.d.ts.map +1 -0
  499. package/dist/esm/utils/validation.js +33 -0
  500. package/dist/esm/utils/validation.js.map +1 -0
  501. package/dist/esm/utils/volume-curve.d.ts +60 -0
  502. package/dist/esm/utils/volume-curve.d.ts.map +1 -0
  503. package/dist/esm/utils/volume-curve.js +114 -0
  504. package/dist/esm/utils/volume-curve.js.map +1 -0
  505. package/dist/esm/utils/x402-direct.d.ts +114 -0
  506. package/dist/esm/utils/x402-direct.d.ts.map +1 -0
  507. package/dist/esm/utils/x402-direct.js +228 -0
  508. package/dist/esm/utils/x402-direct.js.map +1 -0
  509. package/package.json +2 -2
  510. package/dist/esm/instructions/memory.d.ts +0 -8
  511. package/dist/esm/instructions/memory.d.ts.map +0 -1
  512. package/dist/esm/instructions/memory.js +0 -234
  513. package/dist/esm/instructions/memory.js.map +0 -1
@@ -0,0 +1,952 @@
1
+ "use strict";
2
+ /**
3
+ * @module plugin
4
+ * @description SynapsePlugin adapter for SAP v2.
5
+ *
6
+ * Exposes 52 tools across 8 on-chain protocol domains as a drop-in
7
+ * `SynapsePlugin` for `SynapseAgentKit`:
8
+ *
9
+ * ```ts
10
+ * import { SynapseAgentKit } from '@oobe-protocol-labs/synapse-client-sdk/ai/plugins';
11
+ * import { createSAPPlugin } from '@synapse-sap/sdk/plugin';
12
+ *
13
+ * const sapPlugin = createSAPPlugin({ provider });
14
+ * const kit = new SynapseAgentKit({ rpcUrl })
15
+ * .use(sapPlugin);
16
+ *
17
+ * const tools = kit.getTools(); // → StructuredTool[] (LangChain)
18
+ * ```
19
+ *
20
+ * Architecture:
21
+ * 1. Schemas (Zod) → runtime validation + LLM-friendly descriptions
22
+ * 2. Protocols → 8 domain method registries (agent, feedback, …)
23
+ * 3. Executor → dispatches tool calls to SapClient module methods
24
+ * 4. Serialization → PublicKey↔string, BN↔string bridging
25
+ *
26
+ * @category Plugin
27
+ * @since v0.1.0
28
+ */
29
+ var __importDefault = (this && this.__importDefault) || function (mod) {
30
+ return (mod && mod.__esModule) ? mod : { "default": mod };
31
+ };
32
+ Object.defineProperty(exports, "__esModule", { value: true });
33
+ exports.SAPPlugin = void 0;
34
+ exports.createSAPPlugin = createSAPPlugin;
35
+ const web3_js_1 = require("@solana/web3.js");
36
+ const bn_js_1 = __importDefault(require("bn.js"));
37
+ const client_1 = require("../core/client");
38
+ const protocols_1 = require("./protocols");
39
+ const pda_1 = require("../pda");
40
+ const utils_1 = require("../utils");
41
+ // ═══════════════════════════════════════════════════════════════════
42
+ // Version
43
+ // ═══════════════════════════════════════════════════════════════════
44
+ /**
45
+ * Current SAP plugin version string.
46
+ *
47
+ * @name SAP_PLUGIN_VERSION
48
+ * @description Semver version embedded in the plugin’s {@link PluginMeta}.
49
+ * @internal
50
+ * @since v0.1.0
51
+ */
52
+ const SAP_PLUGIN_VERSION = "0.1.0";
53
+ // ═══════════════════════════════════════════════════════════════════
54
+ // Serialization Helpers
55
+ // ═══════════════════════════════════════════════════════════════════
56
+ /**
57
+ * Convert a base58 string to PublicKey.
58
+ *
59
+ * @name toPubkey
60
+ * @description Returns `undefined` for nullish input, otherwise wraps
61
+ * the base58 string in a Solana `PublicKey`.
62
+ * @param value - Base58-encoded public key or nullish
63
+ * @returns A `PublicKey` instance, or `undefined`
64
+ * @internal
65
+ * @since v0.1.0
66
+ */
67
+ function toPubkey(value) {
68
+ return value ? new web3_js_1.PublicKey(value) : undefined;
69
+ }
70
+ /**
71
+ * Convert a string amount to BN.
72
+ *
73
+ * @name toBN
74
+ * @description Returns `undefined` for nullish input, otherwise parses
75
+ * the string as a `BN` (big number) instance.
76
+ * @param value - Numeric string or nullish
77
+ * @returns A `BN` instance, or `undefined`
78
+ * @internal
79
+ * @since v0.1.0
80
+ */
81
+ function toBN(value) {
82
+ return value ? new bn_js_1.default(value) : undefined;
83
+ }
84
+ /**
85
+ * Convert a hex string to a Node.js Buffer.
86
+ *
87
+ * @name hexToBuffer
88
+ * @description Used for encrypted data payloads before sending to
89
+ * on-chain instructions.
90
+ * @param hex - Hex-encoded string
91
+ * @returns Buffer of decoded bytes
92
+ * @internal
93
+ * @since v0.1.0
94
+ */
95
+ function hexToBuffer(hex) {
96
+ return Buffer.from(hex, "hex");
97
+ }
98
+ /**
99
+ * Convert a hex string to Uint8Array for PDA seed derivation.
100
+ *
101
+ * @name hexToBytes
102
+ * @description Wraps `Buffer.from(hex, 'hex')` into a `Uint8Array`
103
+ * suitable for Solana PDA seed arrays.
104
+ * @param hex - Hex-encoded string
105
+ * @returns Uint8Array of decoded bytes
106
+ * @internal
107
+ * @since v0.1.0
108
+ */
109
+ function hexToBytes(hex) {
110
+ return new Uint8Array(Buffer.from(hex, "hex"));
111
+ }
112
+ /**
113
+ * Map token type strings to Anchor enum variant objects.
114
+ *
115
+ * @name toTokenType
116
+ * @description Converts `"sol"`, `"usdc"`, or `"spl"` to the
117
+ * corresponding Anchor enum variant. Defaults to `{ sol: {} }`.
118
+ * @param s - Token type string
119
+ * @returns Anchor-compatible enum variant object
120
+ * @internal
121
+ * @since v0.1.0
122
+ */
123
+ function toTokenType(s) {
124
+ const map = {
125
+ sol: { sol: {} },
126
+ usdc: { usdc: {} },
127
+ spl: { spl: {} },
128
+ };
129
+ return map[s] ?? { sol: {} };
130
+ }
131
+ /**
132
+ * Map settlement mode strings to Anchor enum variant objects.
133
+ *
134
+ * @name toSettlementMode
135
+ * @description Converts `"instant"`, `"escrow"`, `"batched"`, or `"x402"`
136
+ * to the corresponding Anchor enum variant. Returns `null` for nullish input.
137
+ * @param s - Settlement mode string or nullish
138
+ * @returns Anchor-compatible enum variant object, or `null`
139
+ * @internal
140
+ * @since v0.1.0
141
+ */
142
+ function toSettlementMode(s) {
143
+ if (!s)
144
+ return null;
145
+ const map = {
146
+ instant: { instant: {} },
147
+ escrow: { escrow: {} },
148
+ batched: { batched: {} },
149
+ x402: { x402: {} },
150
+ };
151
+ return map[s] ?? null;
152
+ }
153
+ /**
154
+ * Map HTTP method strings to numeric enum values.
155
+ *
156
+ * @name toHttpMethodNum
157
+ * @description Converts lowercase method names (`"get"`, `"post"`, etc.)
158
+ * to their on-chain numeric representation. Defaults to `0` (GET).
159
+ * @param s - HTTP method string
160
+ * @returns Numeric enum value
161
+ * @internal
162
+ * @since v0.1.0
163
+ */
164
+ function toHttpMethodNum(s) {
165
+ const map = {
166
+ get: 0,
167
+ post: 1,
168
+ put: 2,
169
+ delete: 3,
170
+ compound: 4,
171
+ };
172
+ return map[s] ?? 0;
173
+ }
174
+ /**
175
+ * Map category strings to numeric enum values.
176
+ *
177
+ * @name toCategoryNum
178
+ * @description Converts category names (`"swap"`, `"lend"`, etc.)
179
+ * to their on-chain numeric representation. Defaults to `9` (custom).
180
+ * @param s - Category string
181
+ * @returns Numeric enum value
182
+ * @internal
183
+ * @since v0.1.0
184
+ */
185
+ function toCategoryNum(s) {
186
+ const map = {
187
+ swap: 0,
188
+ lend: 1,
189
+ stake: 2,
190
+ nft: 3,
191
+ payment: 4,
192
+ data: 5,
193
+ governance: 6,
194
+ bridge: 7,
195
+ analytics: 8,
196
+ custom: 9,
197
+ };
198
+ return map[s] ?? 9;
199
+ }
200
+ /**
201
+ * Map schema type strings to numeric enum values.
202
+ *
203
+ * @name toSchemaTypeNum
204
+ * @description Converts `"input"`, `"output"`, or `"description"`
205
+ * to their on-chain numeric representation. Defaults to `0` (input).
206
+ * @param s - Schema type string
207
+ * @returns Numeric enum value
208
+ * @internal
209
+ * @since v0.1.0
210
+ */
211
+ function toSchemaTypeNum(s) {
212
+ const map = { input: 0, output: 1, description: 2 };
213
+ return map[s] ?? 0;
214
+ }
215
+ /**
216
+ * Map compression type strings to numeric enum values.
217
+ *
218
+ * @name toCompressionNum
219
+ * @description Converts `"none"`, `"deflate"`, `"gzip"`, or `"brotli"`
220
+ * to their on-chain numeric representation. Defaults to `0` (none).
221
+ * @param s - Compression type string
222
+ * @returns Numeric enum value
223
+ * @internal
224
+ * @since v0.1.0
225
+ */
226
+ function toCompressionNum(s) {
227
+ const map = {
228
+ none: 0,
229
+ deflate: 1,
230
+ gzip: 2,
231
+ brotli: 3,
232
+ };
233
+ return map[s] ?? 0;
234
+ }
235
+ /**
236
+ * Convert a JSON-serialized pricing tier from plugin input
237
+ * into the SDK’s PricingTier shape with BN/PublicKey/enum conversions.
238
+ *
239
+ * @name toPricingTier
240
+ * @description Transforms raw JSON input (string amounts, string enums)
241
+ * into the native Anchor-compatible shape with `BN`, `PublicKey`,
242
+ * and enum variant objects.
243
+ * @param raw - Raw pricing tier object from Zod-validated plugin input
244
+ * @returns Anchor-compatible PricingTier object
245
+ * @internal
246
+ * @since v0.1.0
247
+ */
248
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
249
+ function toPricingTier(raw) {
250
+ return {
251
+ tierId: raw.tierId,
252
+ pricePerCall: new bn_js_1.default(raw.pricePerCall),
253
+ minPricePerCall: toBN(raw.minPricePerCall) ?? null,
254
+ maxPricePerCall: toBN(raw.maxPricePerCall) ?? null,
255
+ rateLimit: raw.rateLimit,
256
+ maxCallsPerSession: raw.maxCallsPerSession,
257
+ burstLimit: raw.burstLimit ?? null,
258
+ tokenType: toTokenType(raw.tokenType),
259
+ tokenMint: toPubkey(raw.tokenMint) ?? null,
260
+ tokenDecimals: raw.tokenDecimals ?? null,
261
+ settlementMode: toSettlementMode(raw.settlementMode),
262
+ minEscrowDeposit: toBN(raw.minEscrowDeposit) ?? null,
263
+ batchIntervalSec: raw.batchIntervalSec ?? null,
264
+ volumeCurve: raw.volumeCurve
265
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
266
+ ? raw.volumeCurve.map((v) => ({
267
+ afterCalls: v.afterCalls,
268
+ pricePerCall: new bn_js_1.default(v.pricePerCall),
269
+ }))
270
+ : null,
271
+ };
272
+ }
273
+ /**
274
+ * Serialize an on-chain account object to a JSON-safe shape.
275
+ *
276
+ * @name serializeAccount
277
+ * @description Recursively converts `PublicKey` → base58 string,
278
+ * `BN` → decimal string, and nested objects/arrays. Used to
279
+ * return tool output that is JSON-serializable for LLMs.
280
+ * @param obj - Raw account data record from Anchor deserialization
281
+ * @returns JSON-safe record with all Solana types converted to strings
282
+ * @internal
283
+ * @since v0.1.0
284
+ */
285
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
286
+ function serializeAccount(obj) {
287
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
288
+ const result = {};
289
+ for (const [key, value] of Object.entries(obj)) {
290
+ if (value === null || value === undefined) {
291
+ result[key] = null;
292
+ }
293
+ else if (value instanceof web3_js_1.PublicKey) {
294
+ result[key] = value.toBase58();
295
+ }
296
+ else if (bn_js_1.default.isBN(value)) {
297
+ result[key] = value.toString();
298
+ }
299
+ else if (Array.isArray(value)) {
300
+ result[key] = value.map((item) => {
301
+ if (item instanceof web3_js_1.PublicKey)
302
+ return item.toBase58();
303
+ if (bn_js_1.default.isBN(item))
304
+ return item.toString();
305
+ if (typeof item === "object" && item !== null)
306
+ return serializeAccount(item);
307
+ return item;
308
+ });
309
+ }
310
+ else if (typeof value === "object") {
311
+ result[key] = serializeAccount(value);
312
+ }
313
+ else {
314
+ result[key] = value;
315
+ }
316
+ }
317
+ return result;
318
+ }
319
+ // ═══════════════════════════════════════════════════════════════════
320
+ // Executor Builder
321
+ // ═══════════════════════════════════════════════════════════════════
322
+ /**
323
+ * Build the executor function that dispatches incoming tool calls
324
+ * to the appropriate SapClient module method.
325
+ *
326
+ * @name buildExecutor
327
+ * @description Creates a closure over a `SapClient` instance that routes
328
+ * each incoming `ProtocolMethod` to the correct per-protocol dispatcher
329
+ * based on `method.protocol`.
330
+ * @param client - Initialized SapClient for the configured provider
331
+ * @returns Async executor function `(method, input) => Promise<unknown>`
332
+ * @internal
333
+ * @since v0.1.0
334
+ */
335
+ function buildExecutor(client) {
336
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
337
+ return async (method, raw) => {
338
+ switch (method.protocol) {
339
+ // ────────────────────── Agent ──────────────────────
340
+ case "sap-agent":
341
+ return executeAgent(client, method.name, raw);
342
+ // ────────────────────── Feedback ───────────────────
343
+ case "sap-feedback":
344
+ return executeFeedback(client, method.name, raw);
345
+ // ────────────────────── Attestation ────────────────
346
+ case "sap-attestation":
347
+ return executeAttestation(client, method.name, raw);
348
+ // ────────────────────── Escrow ─────────────────────
349
+ case "sap-escrow":
350
+ return executeEscrow(client, method.name, raw);
351
+ // ────────────────────── Tools ──────────────────────
352
+ case "sap-tools":
353
+ return executeTools(client, method.name, raw);
354
+ // ────────────────────── Vault ──────────────────────
355
+ case "sap-vault":
356
+ return executeVault(client, method.name, raw);
357
+ // ────────────────────── Indexing ───────────────────
358
+ case "sap-indexing":
359
+ return executeIndexing(client, method.name, raw);
360
+ // ────────────────────── Ledger ─────────────────────
361
+ case "sap-ledger":
362
+ return executeLedger(client, method.name, raw);
363
+ default:
364
+ throw new Error(`Unknown SAP protocol: ${method.protocol}`);
365
+ }
366
+ };
367
+ }
368
+ // ═══════════════════════════════════════════════════════════════════
369
+ // Per-Protocol Dispatchers
370
+ // ═══════════════════════════════════════════════════════════════════
371
+ /**
372
+ * Dispatch tool calls for the **sap-agent** protocol.
373
+ *
374
+ * @name executeAgent
375
+ * @description Routes agent-domain method names to `client.agent.*` calls,
376
+ * handling argument conversion and account serialization.
377
+ * @param client - SapClient instance
378
+ * @param name - Method name (e.g. `"registerAgent"`)
379
+ * @param input - Zod-validated input from the LLM tool call
380
+ * @returns Transaction signature or serialized account data
381
+ * @internal
382
+ * @since v0.1.0
383
+ */
384
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
385
+ async function executeAgent(client, name, input) {
386
+ switch (name) {
387
+ case "registerAgent": {
388
+ const args = {
389
+ name: input.name,
390
+ description: input.description,
391
+ capabilities: input.capabilities,
392
+ pricing: (input.pricing ?? []).map(toPricingTier),
393
+ protocols: input.protocols ?? [],
394
+ agentId: input.agentId ?? null,
395
+ agentUri: input.agentUri ?? null,
396
+ x402Endpoint: input.x402Endpoint ?? null,
397
+ };
398
+ const tx = await client.agent.register(args);
399
+ return { txSignature: tx };
400
+ }
401
+ case "updateAgent": {
402
+ const args = {
403
+ name: input.name ?? null,
404
+ description: input.description ?? null,
405
+ capabilities: input.capabilities ?? null,
406
+ pricing: input.pricing ? input.pricing.map(toPricingTier) : null,
407
+ protocols: input.protocols ?? null,
408
+ agentId: input.agentId ?? null,
409
+ agentUri: input.agentUri ?? null,
410
+ x402Endpoint: input.x402Endpoint ?? null,
411
+ };
412
+ const tx = await client.agent.update(args);
413
+ return { txSignature: tx };
414
+ }
415
+ case "deactivateAgent": {
416
+ const tx = await client.agent.deactivate();
417
+ return { txSignature: tx };
418
+ }
419
+ case "reactivateAgent": {
420
+ const tx = await client.agent.reactivate();
421
+ return { txSignature: tx };
422
+ }
423
+ case "reportCalls": {
424
+ const tx = await client.agent.reportCalls(input.callsServed);
425
+ return { txSignature: tx };
426
+ }
427
+ case "updateReputation": {
428
+ const tx = await client.agent.updateReputation(input.avgLatencyMs, input.uptimePercent);
429
+ return { txSignature: tx };
430
+ }
431
+ case "fetchAgent": {
432
+ const wallet = toPubkey(input.wallet);
433
+ const data = await client.agent.fetch(wallet);
434
+ return serializeAccount(data);
435
+ }
436
+ case "fetchGlobalRegistry": {
437
+ const data = await client.agent.fetchGlobalRegistry();
438
+ return serializeAccount(data);
439
+ }
440
+ default:
441
+ throw new Error(`Unknown sap-agent method: ${name}`);
442
+ }
443
+ }
444
+ /**
445
+ * Dispatch tool calls for the **sap-feedback** protocol.
446
+ *
447
+ * @name executeFeedback
448
+ * @description Routes feedback-domain method names to `client.feedback.*` calls.
449
+ * @param client - SapClient instance
450
+ * @param name - Method name (e.g. `"giveFeedback"`)
451
+ * @param input - Zod-validated input from the LLM tool call
452
+ * @returns Transaction signature or serialized account data
453
+ * @internal
454
+ * @since v0.1.0
455
+ */
456
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
457
+ async function executeFeedback(client, name, input) {
458
+ switch (name) {
459
+ case "giveFeedback": {
460
+ const agentWallet = new web3_js_1.PublicKey(input.agentWallet);
461
+ const args = {
462
+ score: input.score,
463
+ tag: input.tag,
464
+ commentHash: input.commentHash ?? null,
465
+ };
466
+ const tx = await client.feedback.give(agentWallet, args);
467
+ return { txSignature: tx };
468
+ }
469
+ case "updateFeedback": {
470
+ const agentWallet = new web3_js_1.PublicKey(input.agentWallet);
471
+ const args = {
472
+ newScore: input.newScore,
473
+ newTag: input.newTag ?? null,
474
+ commentHash: input.commentHash ?? null,
475
+ };
476
+ const tx = await client.feedback.update(agentWallet, args);
477
+ return { txSignature: tx };
478
+ }
479
+ case "revokeFeedback": {
480
+ const tx = await client.feedback.revoke(new web3_js_1.PublicKey(input.agentWallet));
481
+ return { txSignature: tx };
482
+ }
483
+ case "fetchFeedback": {
484
+ const [agentPda] = (0, pda_1.deriveAgent)(new web3_js_1.PublicKey(input.agentWallet));
485
+ const reviewer = toPubkey(input.reviewer);
486
+ const data = await client.feedback.fetch(agentPda, reviewer);
487
+ return serializeAccount(data);
488
+ }
489
+ default:
490
+ throw new Error(`Unknown sap-feedback method: ${name}`);
491
+ }
492
+ }
493
+ /**
494
+ * Dispatch tool calls for the **sap-attestation** protocol.
495
+ *
496
+ * @name executeAttestation
497
+ * @description Routes attestation-domain method names to `client.attestation.*` calls.
498
+ * @param client - SapClient instance
499
+ * @param name - Method name (e.g. `"createAttestation"`)
500
+ * @param input - Zod-validated input from the LLM tool call
501
+ * @returns Transaction signature or serialized account data
502
+ * @internal
503
+ * @since v0.1.0
504
+ */
505
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
506
+ async function executeAttestation(client, name, input) {
507
+ switch (name) {
508
+ case "createAttestation": {
509
+ const args = {
510
+ attestationType: input.attestationType,
511
+ metadataHash: input.metadataHash,
512
+ expiresAt: new bn_js_1.default(input.expiresAt),
513
+ };
514
+ const tx = await client.attestation.create(new web3_js_1.PublicKey(input.agentWallet), args);
515
+ return { txSignature: tx };
516
+ }
517
+ case "revokeAttestation": {
518
+ const tx = await client.attestation.revoke(new web3_js_1.PublicKey(input.agentWallet));
519
+ return { txSignature: tx };
520
+ }
521
+ case "fetchAttestation": {
522
+ const [agentPda] = (0, pda_1.deriveAgent)(new web3_js_1.PublicKey(input.agentWallet));
523
+ const attester = toPubkey(input.attester);
524
+ const data = await client.attestation.fetch(agentPda, attester);
525
+ return serializeAccount(data);
526
+ }
527
+ default:
528
+ throw new Error(`Unknown sap-attestation method: ${name}`);
529
+ }
530
+ }
531
+ /**
532
+ * Dispatch tool calls for the **sap-escrow** protocol.
533
+ *
534
+ * @name executeEscrow
535
+ * @description Routes escrow-domain method names to `client.escrow.*` calls,
536
+ * including BN conversion for amounts and volume curves.
537
+ * @param client - SapClient instance
538
+ * @param name - Method name (e.g. `"createEscrow"`)
539
+ * @param input - Zod-validated input from the LLM tool call
540
+ * @returns Transaction signature or serialized account data
541
+ * @internal
542
+ * @since v0.1.0
543
+ */
544
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
545
+ async function executeEscrow(client, name, input) {
546
+ switch (name) {
547
+ case "createEscrow": {
548
+ const args = {
549
+ pricePerCall: new bn_js_1.default(input.pricePerCall),
550
+ maxCalls: new bn_js_1.default(input.maxCalls),
551
+ initialDeposit: new bn_js_1.default(input.initialDeposit),
552
+ expiresAt: new bn_js_1.default(input.expiresAt),
553
+ volumeCurve: (input.volumeCurve ?? []).map(
554
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
555
+ (v) => ({
556
+ afterCalls: v.afterCalls,
557
+ pricePerCall: new bn_js_1.default(v.pricePerCall),
558
+ })),
559
+ tokenMint: toPubkey(input.tokenMint) ?? null,
560
+ tokenDecimals: input.tokenDecimals ?? 9,
561
+ };
562
+ const tx = await client.escrow.create(new web3_js_1.PublicKey(input.agentWallet), args);
563
+ return { txSignature: tx };
564
+ }
565
+ case "depositEscrow": {
566
+ const tx = await client.escrow.deposit(new web3_js_1.PublicKey(input.agentWallet), new bn_js_1.default(input.amount));
567
+ return { txSignature: tx };
568
+ }
569
+ case "settleEscrow": {
570
+ // Build settle options from optional priority fee fields
571
+ const settleOpts = (input.priorityFeeMicroLamports || input.computeUnits || input.skipPreflight)
572
+ ? {
573
+ priorityFeeMicroLamports: input.priorityFeeMicroLamports ?? undefined,
574
+ computeUnits: input.computeUnits ?? undefined,
575
+ skipPreflight: input.skipPreflight ?? undefined,
576
+ }
577
+ : undefined;
578
+ const tx = await client.escrow.settle(new web3_js_1.PublicKey(input.depositorWallet), new bn_js_1.default(input.callsToSettle), input.serviceHash, [], settleOpts);
579
+ return { txSignature: tx };
580
+ }
581
+ case "withdrawEscrow": {
582
+ const tx = await client.escrow.withdraw(new web3_js_1.PublicKey(input.agentWallet), new bn_js_1.default(input.amount));
583
+ return { txSignature: tx };
584
+ }
585
+ case "batchSettle": {
586
+ const settlements = input.settlements.map(
587
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
588
+ (s) => ({
589
+ callsToSettle: new bn_js_1.default(s.callsToSettle),
590
+ serviceHash: s.serviceHash,
591
+ }));
592
+ // Build settle options from optional priority fee fields
593
+ const batchOpts = (input.priorityFeeMicroLamports || input.computeUnits || input.skipPreflight)
594
+ ? {
595
+ priorityFeeMicroLamports: input.priorityFeeMicroLamports ?? undefined,
596
+ computeUnits: input.computeUnits ?? undefined,
597
+ skipPreflight: input.skipPreflight ?? undefined,
598
+ }
599
+ : undefined;
600
+ const tx = await client.escrow.settleBatch(new web3_js_1.PublicKey(input.depositorWallet), settlements,
601
+ // batchRoot omitted \u2192 SDK auto-derives sha256(s_0 || ... || s_N)
602
+ undefined, [], batchOpts);
603
+ return { txSignature: tx };
604
+ }
605
+ case "fetchEscrow": {
606
+ const [agentPda] = (0, pda_1.deriveAgent)(new web3_js_1.PublicKey(input.agentWallet));
607
+ const depositor = toPubkey(input.depositor);
608
+ const data = await client.escrow.fetch(agentPda, depositor);
609
+ return serializeAccount(data);
610
+ }
611
+ default:
612
+ throw new Error(`Unknown sap-escrow method: ${name}`);
613
+ }
614
+ }
615
+ /**
616
+ * Dispatch tool calls for the **sap-tools** protocol.
617
+ *
618
+ * @name executeTools
619
+ * @description Routes tools-domain method names to `client.tools.*` calls,
620
+ * handling schema hashing and enum conversions.
621
+ * @param client - SapClient instance
622
+ * @param name - Method name (e.g. `"publishToolByName"`)
623
+ * @param input - Zod-validated input from the LLM tool call
624
+ * @returns Transaction signature or serialized account data
625
+ * @internal
626
+ * @since v0.1.0
627
+ */
628
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
629
+ async function executeTools(client, name, input) {
630
+ switch (name) {
631
+ case "publishToolByName": {
632
+ const tx = await client.tools.publishByName(input.toolName, input.protocolId, input.description, input.inputSchema, input.outputSchema, toHttpMethodNum(input.httpMethod), toCategoryNum(input.category), input.paramsCount, input.requiredParams, input.isCompound ?? false);
633
+ return { txSignature: tx };
634
+ }
635
+ case "inscribeToolSchema": {
636
+ const args = {
637
+ schemaType: toSchemaTypeNum(input.schemaType),
638
+ schemaData: Buffer.from(input.schemaData, "utf-8"),
639
+ schemaHash: (0, utils_1.hashToArray)((0, utils_1.sha256)(input.schemaData)),
640
+ compression: toCompressionNum(input.compression ?? "none"),
641
+ };
642
+ const tx = await client.tools.inscribeSchema(input.toolName, args);
643
+ return { txSignature: tx };
644
+ }
645
+ case "updateTool": {
646
+ const args = {
647
+ descriptionHash: null,
648
+ inputSchemaHash: null,
649
+ outputSchemaHash: null,
650
+ httpMethod: input.httpMethod != null ? toHttpMethodNum(input.httpMethod) : null,
651
+ category: input.category != null ? toCategoryNum(input.category) : null,
652
+ paramsCount: input.paramsCount ?? null,
653
+ requiredParams: input.requiredParams ?? null,
654
+ };
655
+ const tx = await client.tools.update(input.toolName, args);
656
+ return { txSignature: tx };
657
+ }
658
+ case "deactivateTool": {
659
+ const tx = await client.tools.deactivate(input.toolName);
660
+ return { txSignature: tx };
661
+ }
662
+ case "reactivateTool": {
663
+ const tx = await client.tools.reactivate(input.toolName);
664
+ return { txSignature: tx };
665
+ }
666
+ case "reportInvocations": {
667
+ const tx = await client.tools.reportInvocations(input.toolName, input.invocations);
668
+ return { txSignature: tx };
669
+ }
670
+ case "fetchTool": {
671
+ const [agentPda] = (0, pda_1.deriveAgent)(new web3_js_1.PublicKey(input.agentWallet));
672
+ const data = await client.tools.fetch(agentPda, input.toolName);
673
+ return serializeAccount(data);
674
+ }
675
+ default:
676
+ throw new Error(`Unknown sap-tools method: ${name}`);
677
+ }
678
+ }
679
+ /**
680
+ * Dispatch tool calls for the **sap-vault** protocol.
681
+ *
682
+ * @name executeVault
683
+ * @description Routes vault-domain method names to `client.vault.*` calls,
684
+ * handling hex-to-bytes conversion and PDA derivation for sessions.
685
+ * @param client - SapClient instance
686
+ * @param name - Method name (e.g. `"initVault"`)
687
+ * @param input - Zod-validated input from the LLM tool call
688
+ * @returns Transaction signature or serialized account data
689
+ * @internal
690
+ * @since v0.1.0
691
+ */
692
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
693
+ async function executeVault(client, name, input) {
694
+ switch (name) {
695
+ case "initVault": {
696
+ const tx = await client.vault.initVault(input.vaultNonce);
697
+ return { txSignature: tx };
698
+ }
699
+ case "openSession": {
700
+ const tx = await client.vault.openSession(input.sessionHash);
701
+ return { txSignature: tx };
702
+ }
703
+ case "inscribeMemory": {
704
+ const args = {
705
+ sequence: input.sequence,
706
+ encryptedData: hexToBuffer(input.encryptedData),
707
+ nonce: input.nonce,
708
+ contentHash: input.contentHash,
709
+ totalFragments: input.totalFragments ?? 1,
710
+ fragmentIndex: input.fragmentIndex ?? 0,
711
+ compression: input.compression ?? 0,
712
+ epochIndex: input.epochIndex ?? 0,
713
+ };
714
+ const tx = await client.vault.inscribe(args);
715
+ return { txSignature: tx };
716
+ }
717
+ case "closeSession": {
718
+ const [agentPda] = (0, pda_1.deriveAgent)(client.walletPubkey);
719
+ const [vaultPda] = (0, pda_1.deriveVault)(agentPda);
720
+ const sessionHashBytes = hexToBytes(input.sessionHash);
721
+ const [sessionPda] = (0, pda_1.deriveSession)(vaultPda, sessionHashBytes);
722
+ const tx = await client.vault.closeSession(vaultPda, sessionPda);
723
+ return { txSignature: tx };
724
+ }
725
+ case "closeVault": {
726
+ const tx = await client.vault.closeVault();
727
+ return { txSignature: tx };
728
+ }
729
+ case "rotateNonce": {
730
+ const tx = await client.vault.rotateNonce(input.newNonce);
731
+ return { txSignature: tx };
732
+ }
733
+ case "addDelegate": {
734
+ const tx = await client.vault.addDelegate(new web3_js_1.PublicKey(input.delegatePubkey), input.permissions, BigInt(input.expiresAt));
735
+ return { txSignature: tx };
736
+ }
737
+ case "revokeDelegate": {
738
+ const tx = await client.vault.revokeDelegate(new web3_js_1.PublicKey(input.delegatePubkey));
739
+ return { txSignature: tx };
740
+ }
741
+ case "fetchVault": {
742
+ const wallet = toPubkey(input.agentWallet) ?? client.walletPubkey;
743
+ const [agentPda] = (0, pda_1.deriveAgent)(wallet);
744
+ const data = await client.vault.fetchVault(agentPda);
745
+ return serializeAccount(data);
746
+ }
747
+ case "fetchSession": {
748
+ const wallet = new web3_js_1.PublicKey(input.agentWallet);
749
+ const [agentPda] = (0, pda_1.deriveAgent)(wallet);
750
+ const [vaultPda] = (0, pda_1.deriveVault)(agentPda);
751
+ const sessionHashBytes = hexToBytes(input.sessionHash);
752
+ const data = await client.vault.fetchSession(vaultPda, sessionHashBytes);
753
+ return serializeAccount(data);
754
+ }
755
+ default:
756
+ throw new Error(`Unknown sap-vault method: ${name}`);
757
+ }
758
+ }
759
+ /**
760
+ * Dispatch tool calls for the **sap-indexing** protocol.
761
+ *
762
+ * @name executeIndexing
763
+ * @description Routes indexing-domain method names to `client.indexing.*` calls
764
+ * for capability and protocol index management.
765
+ * @param client - SapClient instance
766
+ * @param name - Method name (e.g. `"initCapabilityIndex"`)
767
+ * @param input - Zod-validated input from the LLM tool call
768
+ * @returns Transaction signature or serialized account data
769
+ * @internal
770
+ * @since v0.1.0
771
+ */
772
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
773
+ async function executeIndexing(client, name, input) {
774
+ switch (name) {
775
+ case "initCapabilityIndex": {
776
+ const tx = await client.indexing.initCapabilityIndex(input.capabilityId);
777
+ return { txSignature: tx };
778
+ }
779
+ case "addToCapabilityIndex": {
780
+ const tx = await client.indexing.addToCapabilityIndex(input.capabilityId);
781
+ return { txSignature: tx };
782
+ }
783
+ case "removeFromCapabilityIndex": {
784
+ const tx = await client.indexing.removeFromCapabilityIndex(input.capabilityId);
785
+ return { txSignature: tx };
786
+ }
787
+ case "initProtocolIndex": {
788
+ const tx = await client.indexing.initProtocolIndex(input.protocolId);
789
+ return { txSignature: tx };
790
+ }
791
+ case "addToProtocolIndex": {
792
+ const tx = await client.indexing.addToProtocolIndex(input.protocolId);
793
+ return { txSignature: tx };
794
+ }
795
+ case "removeFromProtocolIndex": {
796
+ const tx = await client.indexing.removeFromProtocolIndex(input.protocolId);
797
+ return { txSignature: tx };
798
+ }
799
+ case "fetchCapabilityIndex": {
800
+ const data = await client.indexing.fetchCapabilityIndex(input.capabilityId);
801
+ return serializeAccount(data);
802
+ }
803
+ case "fetchProtocolIndex": {
804
+ const data = await client.indexing.fetchProtocolIndex(input.protocolId);
805
+ return serializeAccount(data);
806
+ }
807
+ default:
808
+ throw new Error(`Unknown sap-indexing method: ${name}`);
809
+ }
810
+ }
811
+ /**
812
+ * Dispatch tool calls for the **sap-ledger** protocol.
813
+ *
814
+ * @name executeLedger
815
+ * @description Routes ledger-domain method names to `client.ledger.*` calls,
816
+ * deriving session PDAs from hex-encoded session hashes.
817
+ * @param client - SapClient instance
818
+ * @param name - Method name (e.g. `"initLedger"`)
819
+ * @param input - Zod-validated input from the LLM tool call
820
+ * @returns Transaction signature or serialized account data
821
+ * @internal
822
+ * @since v0.1.0
823
+ */
824
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
825
+ async function executeLedger(client, name, input) {
826
+ const resolveSessionPda = (sessionHash, agentWallet) => {
827
+ const wallet = toPubkey(agentWallet) ?? client.walletPubkey;
828
+ const [agentPda] = (0, pda_1.deriveAgent)(wallet);
829
+ const [vaultPda] = (0, pda_1.deriveVault)(agentPda);
830
+ const sessionHashBytes = hexToBytes(sessionHash);
831
+ const [sessionPda] = (0, pda_1.deriveSession)(vaultPda, sessionHashBytes);
832
+ return sessionPda;
833
+ };
834
+ switch (name) {
835
+ case "initLedger": {
836
+ const sessionPda = resolveSessionPda(input.sessionHash, input.agentWallet);
837
+ const tx = await client.ledger.init(sessionPda);
838
+ return { txSignature: tx };
839
+ }
840
+ case "writeLedger": {
841
+ const sessionPda = resolveSessionPda(input.sessionHash, input.agentWallet);
842
+ const data = hexToBuffer(input.data);
843
+ const tx = await client.ledger.write(sessionPda, data, input.contentHash);
844
+ return { txSignature: tx };
845
+ }
846
+ case "sealLedger": {
847
+ const sessionPda = resolveSessionPda(input.sessionHash, input.agentWallet);
848
+ const tx = await client.ledger.seal(sessionPda);
849
+ return { txSignature: tx };
850
+ }
851
+ case "closeLedger": {
852
+ const sessionPda = resolveSessionPda(input.sessionHash, input.agentWallet);
853
+ const tx = await client.ledger.close(sessionPda);
854
+ return { txSignature: tx };
855
+ }
856
+ case "fetchLedger": {
857
+ const sessionPda = resolveSessionPda(input.sessionHash, input.agentWallet);
858
+ const data = await client.ledger.fetchLedger(sessionPda);
859
+ return serializeAccount(data);
860
+ }
861
+ case "fetchLedgerPage": {
862
+ const sessionPda = resolveSessionPda(input.sessionHash, input.agentWallet);
863
+ const [ledgerPda] = (0, pda_1.deriveLedger)(sessionPda);
864
+ const data = await client.ledger.fetchPage(ledgerPda, input.pageIndex);
865
+ return serializeAccount(data);
866
+ }
867
+ default:
868
+ throw new Error(`Unknown sap-ledger method: ${name}`);
869
+ }
870
+ }
871
+ // ═══════════════════════════════════════════════════════════════════
872
+ // Plugin Factory
873
+ // ═══════════════════════════════════════════════════════════════════
874
+ /**
875
+ * Create a SynapsePlugin for SAP v2.
876
+ *
877
+ * @name createSAPPlugin
878
+ * @description Factory function that returns a fully configured
879
+ * {@link SynapsePlugin} exposing 52 tools across 8 on-chain
880
+ * protocol domains. The plugin can be installed into a
881
+ * `SynapseAgentKit` instance or used standalone.
882
+ * @param config - Plugin configuration with Anchor provider and optional program ID
883
+ * @returns A configured {@link SynapsePlugin} instance
884
+ * @category Plugin
885
+ * @since v0.1.0
886
+ *
887
+ * @example
888
+ * ```ts
889
+ * import { createSAPPlugin } from '@synapse-sap/sdk/plugin';
890
+ *
891
+ * const sapPlugin = createSAPPlugin({ provider });
892
+ *
893
+ * // Use with SynapseAgentKit:
894
+ * kit.use(sapPlugin);
895
+ *
896
+ * // Or standalone:
897
+ * const executor = sapPlugin.install({ client, config: {} }).executor;
898
+ * await executor(someMethod, someInput);
899
+ * ```
900
+ */
901
+ function createSAPPlugin(config) {
902
+ return {
903
+ meta: {
904
+ id: "sap",
905
+ name: "SAP v2 — Synapse Agent Protocol",
906
+ version: SAP_PLUGIN_VERSION,
907
+ description: "On-chain agent identity, reputation, tool registry, encrypted memory vault, x402 escrow, attestation, discovery indexes, and unified memory ledger on Solana",
908
+ tags: [
909
+ "solana",
910
+ "agent",
911
+ "identity",
912
+ "reputation",
913
+ "x402",
914
+ "escrow",
915
+ "vault",
916
+ "memory",
917
+ "tools",
918
+ "attestation",
919
+ "erc-8004",
920
+ ],
921
+ },
922
+ protocols: protocols_1.SAP_PROTOCOLS,
923
+ install(_context) {
924
+ const client = client_1.SapClient.from(config.provider, config.programId);
925
+ const executor = buildExecutor(client);
926
+ return { executor };
927
+ },
928
+ };
929
+ }
930
+ /**
931
+ * Pre-built plugin object for static use patterns.
932
+ *
933
+ * @name SAPPlugin
934
+ * @description Convenience namespace exposing a `configure` method
935
+ * that delegates to {@link createSAPPlugin}. Useful for concise
936
+ * one-liner instantiation.
937
+ * @category Plugin
938
+ * @since v0.1.0
939
+ *
940
+ * @example
941
+ * ```ts
942
+ * import { SAPPlugin } from '@synapse-sap/sdk/plugin';
943
+ *
944
+ * const plugin = SAPPlugin.configure({ provider });
945
+ * kit.use(plugin);
946
+ * ```
947
+ */
948
+ exports.SAPPlugin = {
949
+ /** Create a configured SynapsePlugin from an AnchorProvider. */
950
+ configure: createSAPPlugin,
951
+ };
952
+ //# sourceMappingURL=index.js.map