clodds 1.1.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 (1719) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +468 -0
  3. package/dist/acp/agreement.d.ts +110 -0
  4. package/dist/acp/agreement.js +514 -0
  5. package/dist/acp/agreement.js.map +1 -0
  6. package/dist/acp/discovery.d.ts +84 -0
  7. package/dist/acp/discovery.js +332 -0
  8. package/dist/acp/discovery.js.map +1 -0
  9. package/dist/acp/escrow.d.ts +139 -0
  10. package/dist/acp/escrow.js +880 -0
  11. package/dist/acp/escrow.js.map +1 -0
  12. package/dist/acp/identity.d.ts +135 -0
  13. package/dist/acp/identity.js +716 -0
  14. package/dist/acp/identity.js.map +1 -0
  15. package/dist/acp/index.d.ts +205 -0
  16. package/dist/acp/index.js +583 -0
  17. package/dist/acp/index.js.map +1 -0
  18. package/dist/acp/persistence.d.ts +59 -0
  19. package/dist/acp/persistence.js +590 -0
  20. package/dist/acp/persistence.js.map +1 -0
  21. package/dist/acp/predictions.d.ts +89 -0
  22. package/dist/acp/predictions.js +417 -0
  23. package/dist/acp/predictions.js.map +1 -0
  24. package/dist/acp/registry.d.ts +143 -0
  25. package/dist/acp/registry.js +584 -0
  26. package/dist/acp/registry.js.map +1 -0
  27. package/dist/agents/handlers/acp.d.ts +12 -0
  28. package/dist/agents/handlers/acp.js +987 -0
  29. package/dist/agents/handlers/acp.js.map +1 -0
  30. package/dist/agents/handlers/agentbets.d.ts +8 -0
  31. package/dist/agents/handlers/agentbets.js +63 -0
  32. package/dist/agents/handlers/agentbets.js.map +1 -0
  33. package/dist/agents/handlers/arbitrage.d.ts +16 -0
  34. package/dist/agents/handlers/arbitrage.js +187 -0
  35. package/dist/agents/handlers/arbitrage.js.map +1 -0
  36. package/dist/agents/handlers/betfair.d.ts +11 -0
  37. package/dist/agents/handlers/betfair.js +214 -0
  38. package/dist/agents/handlers/betfair.js.map +1 -0
  39. package/dist/agents/handlers/binance.d.ts +9 -0
  40. package/dist/agents/handlers/binance.js +227 -0
  41. package/dist/agents/handlers/binance.js.map +1 -0
  42. package/dist/agents/handlers/bittensor.d.ts +10 -0
  43. package/dist/agents/handlers/bittensor.js +90 -0
  44. package/dist/agents/handlers/bittensor.js.map +1 -0
  45. package/dist/agents/handlers/bybit.d.ts +9 -0
  46. package/dist/agents/handlers/bybit.js +226 -0
  47. package/dist/agents/handlers/bybit.js.map +1 -0
  48. package/dist/agents/handlers/credentials.d.ts +8 -0
  49. package/dist/agents/handlers/credentials.js +103 -0
  50. package/dist/agents/handlers/credentials.js.map +1 -0
  51. package/dist/agents/handlers/hyperliquid.d.ts +9 -0
  52. package/dist/agents/handlers/hyperliquid.js +326 -0
  53. package/dist/agents/handlers/hyperliquid.js.map +1 -0
  54. package/dist/agents/handlers/index.d.ts +82 -0
  55. package/dist/agents/handlers/index.js +143 -0
  56. package/dist/agents/handlers/index.js.map +1 -0
  57. package/dist/agents/handlers/kalshi.d.ts +10 -0
  58. package/dist/agents/handlers/kalshi.js +1377 -0
  59. package/dist/agents/handlers/kalshi.js.map +1 -0
  60. package/dist/agents/handlers/manifold.d.ts +9 -0
  61. package/dist/agents/handlers/manifold.js +1001 -0
  62. package/dist/agents/handlers/manifold.js.map +1 -0
  63. package/dist/agents/handlers/markets.d.ts +8 -0
  64. package/dist/agents/handlers/markets.js +321 -0
  65. package/dist/agents/handlers/markets.js.map +1 -0
  66. package/dist/agents/handlers/opinion.d.ts +11 -0
  67. package/dist/agents/handlers/opinion.js +374 -0
  68. package/dist/agents/handlers/opinion.js.map +1 -0
  69. package/dist/agents/handlers/paper-trading.d.ts +8 -0
  70. package/dist/agents/handlers/paper-trading.js +124 -0
  71. package/dist/agents/handlers/paper-trading.js.map +1 -0
  72. package/dist/agents/handlers/polymarket.d.ts +17 -0
  73. package/dist/agents/handlers/polymarket.js +455 -0
  74. package/dist/agents/handlers/polymarket.js.map +1 -0
  75. package/dist/agents/handlers/predictfun.d.ts +9 -0
  76. package/dist/agents/handlers/predictfun.js +488 -0
  77. package/dist/agents/handlers/predictfun.js.map +1 -0
  78. package/dist/agents/handlers/smarkets.d.ts +11 -0
  79. package/dist/agents/handlers/smarkets.js +205 -0
  80. package/dist/agents/handlers/smarkets.js.map +1 -0
  81. package/dist/agents/handlers/solana.d.ts +14 -0
  82. package/dist/agents/handlers/solana.js +1530 -0
  83. package/dist/agents/handlers/solana.js.map +1 -0
  84. package/dist/agents/handlers/types.d.ts +58 -0
  85. package/dist/agents/handlers/types.js +34 -0
  86. package/dist/agents/handlers/types.js.map +1 -0
  87. package/dist/agents/handlers/virtuals.d.ts +11 -0
  88. package/dist/agents/handlers/virtuals.js +135 -0
  89. package/dist/agents/handlers/virtuals.js.map +1 -0
  90. package/dist/agents/handlers/wallets.d.ts +9 -0
  91. package/dist/agents/handlers/wallets.js +222 -0
  92. package/dist/agents/handlers/wallets.js.map +1 -0
  93. package/dist/agents/index.d.ts +79 -0
  94. package/dist/agents/index.js +16690 -0
  95. package/dist/agents/index.js.map +1 -0
  96. package/dist/agents/subagents.d.ts +219 -0
  97. package/dist/agents/subagents.js +736 -0
  98. package/dist/agents/subagents.js.map +1 -0
  99. package/dist/alerts/index.d.ts +110 -0
  100. package/dist/alerts/index.js +421 -0
  101. package/dist/alerts/index.js.map +1 -0
  102. package/dist/alerts/realtime.d.ts +114 -0
  103. package/dist/alerts/realtime.js +262 -0
  104. package/dist/alerts/realtime.js.map +1 -0
  105. package/dist/api/apikeys.d.ts +74 -0
  106. package/dist/api/apikeys.js +319 -0
  107. package/dist/api/apikeys.js.map +1 -0
  108. package/dist/api/compute/code.d.ts +28 -0
  109. package/dist/api/compute/code.js +257 -0
  110. package/dist/api/compute/code.js.map +1 -0
  111. package/dist/api/compute/data.d.ts +72 -0
  112. package/dist/api/compute/data.js +264 -0
  113. package/dist/api/compute/data.js.map +1 -0
  114. package/dist/api/compute/gateway.d.ts +185 -0
  115. package/dist/api/compute/gateway.js +958 -0
  116. package/dist/api/compute/gateway.js.map +1 -0
  117. package/dist/api/compute/index.d.ts +21 -0
  118. package/dist/api/compute/index.js +46 -0
  119. package/dist/api/compute/index.js.map +1 -0
  120. package/dist/api/compute/llm.d.ts +64 -0
  121. package/dist/api/compute/llm.js +602 -0
  122. package/dist/api/compute/llm.js.map +1 -0
  123. package/dist/api/compute/persistence.d.ts +77 -0
  124. package/dist/api/compute/persistence.js +251 -0
  125. package/dist/api/compute/persistence.js.map +1 -0
  126. package/dist/api/compute/storage.d.ts +48 -0
  127. package/dist/api/compute/storage.js +283 -0
  128. package/dist/api/compute/storage.js.map +1 -0
  129. package/dist/api/compute/trade.d.ts +69 -0
  130. package/dist/api/compute/trade.js +460 -0
  131. package/dist/api/compute/trade.js.map +1 -0
  132. package/dist/api/compute/types.d.ts +271 -0
  133. package/dist/api/compute/types.js +87 -0
  134. package/dist/api/compute/types.js.map +1 -0
  135. package/dist/api/compute/web.d.ts +29 -0
  136. package/dist/api/compute/web.js +255 -0
  137. package/dist/api/compute/web.js.map +1 -0
  138. package/dist/api/custody.d.ts +48 -0
  139. package/dist/api/custody.js +272 -0
  140. package/dist/api/custody.js.map +1 -0
  141. package/dist/api/fees.d.ts +91 -0
  142. package/dist/api/fees.js +155 -0
  143. package/dist/api/fees.js.map +1 -0
  144. package/dist/api/gateway.d.ts +40 -0
  145. package/dist/api/gateway.js +569 -0
  146. package/dist/api/gateway.js.map +1 -0
  147. package/dist/api/index.d.ts +29 -0
  148. package/dist/api/index.js +55 -0
  149. package/dist/api/index.js.map +1 -0
  150. package/dist/api/jobs.d.ts +59 -0
  151. package/dist/api/jobs.js +362 -0
  152. package/dist/api/jobs.js.map +1 -0
  153. package/dist/api/middleware.d.ts +60 -0
  154. package/dist/api/middleware.js +315 -0
  155. package/dist/api/middleware.js.map +1 -0
  156. package/dist/api/prompt.d.ts +44 -0
  157. package/dist/api/prompt.js +345 -0
  158. package/dist/api/prompt.js.map +1 -0
  159. package/dist/api/sdk.d.ts +258 -0
  160. package/dist/api/sdk.js +341 -0
  161. package/dist/api/sdk.js.map +1 -0
  162. package/dist/api/server.d.ts +17 -0
  163. package/dist/api/server.js +852 -0
  164. package/dist/api/server.js.map +1 -0
  165. package/dist/api/types.d.ts +307 -0
  166. package/dist/api/types.js +64 -0
  167. package/dist/api/types.js.map +1 -0
  168. package/dist/arbitrage/index.d.ts +124 -0
  169. package/dist/arbitrage/index.js +482 -0
  170. package/dist/arbitrage/index.js.map +1 -0
  171. package/dist/auth/copilot.d.ts +87 -0
  172. package/dist/auth/copilot.js +328 -0
  173. package/dist/auth/copilot.js.map +1 -0
  174. package/dist/auth/google.d.ts +121 -0
  175. package/dist/auth/google.js +479 -0
  176. package/dist/auth/google.js.map +1 -0
  177. package/dist/auth/index.d.ts +8 -0
  178. package/dist/auth/index.js +25 -0
  179. package/dist/auth/index.js.map +1 -0
  180. package/dist/auth/oauth.d.ts +94 -0
  181. package/dist/auth/oauth.js +502 -0
  182. package/dist/auth/oauth.js.map +1 -0
  183. package/dist/auth/qwen.d.ts +110 -0
  184. package/dist/auth/qwen.js +351 -0
  185. package/dist/auth/qwen.js.map +1 -0
  186. package/dist/auto-reply/index.d.ts +143 -0
  187. package/dist/auto-reply/index.js +391 -0
  188. package/dist/auto-reply/index.js.map +1 -0
  189. package/dist/automation/cron.d.ts +66 -0
  190. package/dist/automation/cron.js +226 -0
  191. package/dist/automation/cron.js.map +1 -0
  192. package/dist/automation/heartbeats.d.ts +63 -0
  193. package/dist/automation/heartbeats.js +144 -0
  194. package/dist/automation/heartbeats.js.map +1 -0
  195. package/dist/automation/index.d.ts +9 -0
  196. package/dist/automation/index.js +15 -0
  197. package/dist/automation/index.js.map +1 -0
  198. package/dist/automation/webhooks.d.ts +60 -0
  199. package/dist/automation/webhooks.js +225 -0
  200. package/dist/automation/webhooks.js.map +1 -0
  201. package/dist/bankr/client.d.ts +86 -0
  202. package/dist/bankr/client.js +177 -0
  203. package/dist/bankr/client.js.map +1 -0
  204. package/dist/bankr/index.d.ts +6 -0
  205. package/dist/bankr/index.js +23 -0
  206. package/dist/bankr/index.js.map +1 -0
  207. package/dist/base/index.d.ts +6 -0
  208. package/dist/base/index.js +23 -0
  209. package/dist/base/index.js.map +1 -0
  210. package/dist/base/provider.d.ts +27 -0
  211. package/dist/base/provider.js +128 -0
  212. package/dist/base/provider.js.map +1 -0
  213. package/dist/bin/worker.d.ts +31 -0
  214. package/dist/bin/worker.js +127 -0
  215. package/dist/bin/worker.js.map +1 -0
  216. package/dist/bittensor/chutes.d.ts +14 -0
  217. package/dist/bittensor/chutes.js +141 -0
  218. package/dist/bittensor/chutes.js.map +1 -0
  219. package/dist/bittensor/index.d.ts +7 -0
  220. package/dist/bittensor/index.js +13 -0
  221. package/dist/bittensor/index.js.map +1 -0
  222. package/dist/bittensor/persistence.d.ts +8 -0
  223. package/dist/bittensor/persistence.js +188 -0
  224. package/dist/bittensor/persistence.js.map +1 -0
  225. package/dist/bittensor/plugin.d.ts +30 -0
  226. package/dist/bittensor/plugin.js +134 -0
  227. package/dist/bittensor/plugin.js.map +1 -0
  228. package/dist/bittensor/python-runner.d.ts +7 -0
  229. package/dist/bittensor/python-runner.js +83 -0
  230. package/dist/bittensor/python-runner.js.map +1 -0
  231. package/dist/bittensor/server.d.ts +7 -0
  232. package/dist/bittensor/server.js +110 -0
  233. package/dist/bittensor/server.js.map +1 -0
  234. package/dist/bittensor/service.d.ts +7 -0
  235. package/dist/bittensor/service.js +291 -0
  236. package/dist/bittensor/service.js.map +1 -0
  237. package/dist/bittensor/tool.d.ts +45 -0
  238. package/dist/bittensor/tool.js +147 -0
  239. package/dist/bittensor/tool.js.map +1 -0
  240. package/dist/bittensor/types.d.ts +188 -0
  241. package/dist/bittensor/types.js +6 -0
  242. package/dist/bittensor/types.js.map +1 -0
  243. package/dist/bittensor/wallet.d.ts +18 -0
  244. package/dist/bittensor/wallet.js +192 -0
  245. package/dist/bittensor/wallet.js.map +1 -0
  246. package/dist/bridge/wormhole.d.ts +239 -0
  247. package/dist/bridge/wormhole.js +404 -0
  248. package/dist/bridge/wormhole.js.map +1 -0
  249. package/dist/browser/index.d.ts +67 -0
  250. package/dist/browser/index.js +458 -0
  251. package/dist/browser/index.js.map +1 -0
  252. package/dist/cache/index.d.ts +105 -0
  253. package/dist/cache/index.js +306 -0
  254. package/dist/cache/index.js.map +1 -0
  255. package/dist/canvas/index.d.ts +66 -0
  256. package/dist/canvas/index.js +391 -0
  257. package/dist/canvas/index.js.map +1 -0
  258. package/dist/channels/base-adapter.d.ts +126 -0
  259. package/dist/channels/base-adapter.js +416 -0
  260. package/dist/channels/base-adapter.js.map +1 -0
  261. package/dist/channels/bluebubbles/index.d.ts +23 -0
  262. package/dist/channels/bluebubbles/index.js +182 -0
  263. package/dist/channels/bluebubbles/index.js.map +1 -0
  264. package/dist/channels/discord/index.d.ts +25 -0
  265. package/dist/channels/discord/index.js +419 -0
  266. package/dist/channels/discord/index.js.map +1 -0
  267. package/dist/channels/googlechat/index.d.ts +35 -0
  268. package/dist/channels/googlechat/index.js +223 -0
  269. package/dist/channels/googlechat/index.js.map +1 -0
  270. package/dist/channels/imessage/index.d.ts +28 -0
  271. package/dist/channels/imessage/index.js +340 -0
  272. package/dist/channels/imessage/index.js.map +1 -0
  273. package/dist/channels/index.d.ts +58 -0
  274. package/dist/channels/index.js +382 -0
  275. package/dist/channels/index.js.map +1 -0
  276. package/dist/channels/line/index.d.ts +307 -0
  277. package/dist/channels/line/index.js +760 -0
  278. package/dist/channels/line/index.js.map +1 -0
  279. package/dist/channels/matrix/index.d.ts +35 -0
  280. package/dist/channels/matrix/index.js +328 -0
  281. package/dist/channels/matrix/index.js.map +1 -0
  282. package/dist/channels/mattermost/index.d.ts +25 -0
  283. package/dist/channels/mattermost/index.js +239 -0
  284. package/dist/channels/mattermost/index.js.map +1 -0
  285. package/dist/channels/nextcloud-talk/index.d.ts +25 -0
  286. package/dist/channels/nextcloud-talk/index.js +175 -0
  287. package/dist/channels/nextcloud-talk/index.js.map +1 -0
  288. package/dist/channels/nostr/index.d.ts +21 -0
  289. package/dist/channels/nostr/index.js +278 -0
  290. package/dist/channels/nostr/index.js.map +1 -0
  291. package/dist/channels/signal/index.d.ts +33 -0
  292. package/dist/channels/signal/index.js +333 -0
  293. package/dist/channels/signal/index.js.map +1 -0
  294. package/dist/channels/slack/index.d.ts +26 -0
  295. package/dist/channels/slack/index.js +266 -0
  296. package/dist/channels/slack/index.js.map +1 -0
  297. package/dist/channels/teams/index.d.ts +42 -0
  298. package/dist/channels/teams/index.js +312 -0
  299. package/dist/channels/teams/index.js.map +1 -0
  300. package/dist/channels/telegram/index.d.ts +9 -0
  301. package/dist/channels/telegram/index.js +761 -0
  302. package/dist/channels/telegram/index.js.map +1 -0
  303. package/dist/channels/tlon/index.d.ts +25 -0
  304. package/dist/channels/tlon/index.js +236 -0
  305. package/dist/channels/tlon/index.js.map +1 -0
  306. package/dist/channels/twitch/index.d.ts +25 -0
  307. package/dist/channels/twitch/index.js +182 -0
  308. package/dist/channels/twitch/index.js.map +1 -0
  309. package/dist/channels/voice/index.d.ts +31 -0
  310. package/dist/channels/voice/index.js +208 -0
  311. package/dist/channels/voice/index.js.map +1 -0
  312. package/dist/channels/webchat/index.d.ts +29 -0
  313. package/dist/channels/webchat/index.js +366 -0
  314. package/dist/channels/webchat/index.js.map +1 -0
  315. package/dist/channels/whatsapp/index.d.ts +72 -0
  316. package/dist/channels/whatsapp/index.js +767 -0
  317. package/dist/channels/whatsapp/index.js.map +1 -0
  318. package/dist/channels/zalo/index.d.ts +45 -0
  319. package/dist/channels/zalo/index.js +285 -0
  320. package/dist/channels/zalo/index.js.map +1 -0
  321. package/dist/cli/commands/doctor.d.ts +23 -0
  322. package/dist/cli/commands/doctor.js +649 -0
  323. package/dist/cli/commands/doctor.js.map +1 -0
  324. package/dist/cli/commands/gateway.d.ts +6 -0
  325. package/dist/cli/commands/gateway.js +32 -0
  326. package/dist/cli/commands/gateway.js.map +1 -0
  327. package/dist/cli/commands/index.d.ts +31 -0
  328. package/dist/cli/commands/index.js +3743 -0
  329. package/dist/cli/commands/index.js.map +1 -0
  330. package/dist/cli/commands/onboard.d.ts +4 -0
  331. package/dist/cli/commands/onboard.js +334 -0
  332. package/dist/cli/commands/onboard.js.map +1 -0
  333. package/dist/cli/commands/repl.d.ts +11 -0
  334. package/dist/cli/commands/repl.js +185 -0
  335. package/dist/cli/commands/repl.js.map +1 -0
  336. package/dist/cli/commands/skills.d.ts +29 -0
  337. package/dist/cli/commands/skills.js +297 -0
  338. package/dist/cli/commands/skills.js.map +1 -0
  339. package/dist/cli/index.d.ts +12 -0
  340. package/dist/cli/index.js +449 -0
  341. package/dist/cli/index.js.map +1 -0
  342. package/dist/cli/secure.d.ts +14 -0
  343. package/dist/cli/secure.js +626 -0
  344. package/dist/cli/secure.js.map +1 -0
  345. package/dist/commands/index.d.ts +61 -0
  346. package/dist/commands/index.js +290 -0
  347. package/dist/commands/index.js.map +1 -0
  348. package/dist/commands/registry.d.ts +69 -0
  349. package/dist/commands/registry.js +3142 -0
  350. package/dist/commands/registry.js.map +1 -0
  351. package/dist/config/index.d.ts +465 -0
  352. package/dist/config/index.js +1451 -0
  353. package/dist/config/index.js.map +1 -0
  354. package/dist/credentials/index.d.ts +51 -0
  355. package/dist/credentials/index.js +270 -0
  356. package/dist/credentials/index.js.map +1 -0
  357. package/dist/cron/index.d.ts +151 -0
  358. package/dist/cron/index.js +1283 -0
  359. package/dist/cron/index.js.map +1 -0
  360. package/dist/cron/types.d.ts +102 -0
  361. package/dist/cron/types.js +6 -0
  362. package/dist/cron/types.js.map +1 -0
  363. package/dist/daemon/index.d.ts +23 -0
  364. package/dist/daemon/index.js +159 -0
  365. package/dist/daemon/index.js.map +1 -0
  366. package/dist/db/index.d.ts +825 -0
  367. package/dist/db/index.js +3382 -0
  368. package/dist/db/index.js.map +1 -0
  369. package/dist/db/migrations.d.ts +70 -0
  370. package/dist/db/migrations.js +1373 -0
  371. package/dist/db/migrations.js.map +1 -0
  372. package/dist/docker/index.d.ts +188 -0
  373. package/dist/docker/index.js +571 -0
  374. package/dist/docker/index.js.map +1 -0
  375. package/dist/doctor/index.d.ts +47 -0
  376. package/dist/doctor/index.js +379 -0
  377. package/dist/doctor/index.js.map +1 -0
  378. package/dist/embeddings/index.d.ts +65 -0
  379. package/dist/embeddings/index.js +399 -0
  380. package/dist/embeddings/index.js.map +1 -0
  381. package/dist/evm/contracts.d.ts +112 -0
  382. package/dist/evm/contracts.js +332 -0
  383. package/dist/evm/contracts.js.map +1 -0
  384. package/dist/evm/index.d.ts +21 -0
  385. package/dist/evm/index.js +45 -0
  386. package/dist/evm/index.js.map +1 -0
  387. package/dist/evm/multichain.d.ts +87 -0
  388. package/dist/evm/multichain.js +308 -0
  389. package/dist/evm/multichain.js.map +1 -0
  390. package/dist/evm/odos.d.ts +62 -0
  391. package/dist/evm/odos.js +261 -0
  392. package/dist/evm/odos.js.map +1 -0
  393. package/dist/evm/oneinch.d.ts +55 -0
  394. package/dist/evm/oneinch.js +324 -0
  395. package/dist/evm/oneinch.js.map +1 -0
  396. package/dist/evm/transfers.d.ts +83 -0
  397. package/dist/evm/transfers.js +393 -0
  398. package/dist/evm/transfers.js.map +1 -0
  399. package/dist/evm/uniswap.d.ts +56 -0
  400. package/dist/evm/uniswap.js +307 -0
  401. package/dist/evm/uniswap.js.map +1 -0
  402. package/dist/evm/virtuals.d.ts +220 -0
  403. package/dist/evm/virtuals.js +735 -0
  404. package/dist/evm/virtuals.js.map +1 -0
  405. package/dist/evm/wallet.d.ts +96 -0
  406. package/dist/evm/wallet.js +258 -0
  407. package/dist/evm/wallet.js.map +1 -0
  408. package/dist/exchanges/binance-futures/index.d.ts +83 -0
  409. package/dist/exchanges/binance-futures/index.js +394 -0
  410. package/dist/exchanges/binance-futures/index.js.map +1 -0
  411. package/dist/exchanges/bybit/index.d.ts +78 -0
  412. package/dist/exchanges/bybit/index.js +379 -0
  413. package/dist/exchanges/bybit/index.js.map +1 -0
  414. package/dist/exchanges/hyperliquid/index.d.ts +594 -0
  415. package/dist/exchanges/hyperliquid/index.js +1101 -0
  416. package/dist/exchanges/hyperliquid/index.js.map +1 -0
  417. package/dist/exchanges/mexc/index.d.ts +80 -0
  418. package/dist/exchanges/mexc/index.js +389 -0
  419. package/dist/exchanges/mexc/index.js.map +1 -0
  420. package/dist/exchanges/opinion/index.d.ts +128 -0
  421. package/dist/exchanges/opinion/index.js +443 -0
  422. package/dist/exchanges/opinion/index.js.map +1 -0
  423. package/dist/exchanges/predictfun/index.d.ts +107 -0
  424. package/dist/exchanges/predictfun/index.js +398 -0
  425. package/dist/exchanges/predictfun/index.js.map +1 -0
  426. package/dist/execution/auto-redeem.d.ts +55 -0
  427. package/dist/execution/auto-redeem.js +324 -0
  428. package/dist/execution/auto-redeem.js.map +1 -0
  429. package/dist/execution/bracket-orders.d.ts +84 -0
  430. package/dist/execution/bracket-orders.js +387 -0
  431. package/dist/execution/bracket-orders.js.map +1 -0
  432. package/dist/execution/circuit-breaker.d.ts +87 -0
  433. package/dist/execution/circuit-breaker.js +274 -0
  434. package/dist/execution/circuit-breaker.js.map +1 -0
  435. package/dist/execution/dca-persistence.d.ts +47 -0
  436. package/dist/execution/dca-persistence.js +159 -0
  437. package/dist/execution/dca-persistence.js.map +1 -0
  438. package/dist/execution/dca.d.ts +60 -0
  439. package/dist/execution/dca.js +273 -0
  440. package/dist/execution/dca.js.map +1 -0
  441. package/dist/execution/futures.d.ts +162 -0
  442. package/dist/execution/futures.js +1336 -0
  443. package/dist/execution/futures.js.map +1 -0
  444. package/dist/execution/index.d.ts +346 -0
  445. package/dist/execution/index.js +2532 -0
  446. package/dist/execution/index.js.map +1 -0
  447. package/dist/execution/mev-protection.d.ts +150 -0
  448. package/dist/execution/mev-protection.js +377 -0
  449. package/dist/execution/mev-protection.js.map +1 -0
  450. package/dist/execution/order-persistence.d.ts +81 -0
  451. package/dist/execution/order-persistence.js +350 -0
  452. package/dist/execution/order-persistence.js.map +1 -0
  453. package/dist/execution/position-manager.d.ts +142 -0
  454. package/dist/execution/position-manager.js +404 -0
  455. package/dist/execution/position-manager.js.map +1 -0
  456. package/dist/execution/smart-router.d.ts +90 -0
  457. package/dist/execution/smart-router.js +323 -0
  458. package/dist/execution/smart-router.js.map +1 -0
  459. package/dist/execution/trigger-orders.d.ts +81 -0
  460. package/dist/execution/trigger-orders.js +266 -0
  461. package/dist/execution/trigger-orders.js.map +1 -0
  462. package/dist/execution/twap.d.ts +87 -0
  463. package/dist/execution/twap.js +405 -0
  464. package/dist/execution/twap.js.map +1 -0
  465. package/dist/extensions/copilot-proxy/index.d.ts +49 -0
  466. package/dist/extensions/copilot-proxy/index.js +204 -0
  467. package/dist/extensions/copilot-proxy/index.js.map +1 -0
  468. package/dist/extensions/diagnostics-otel/index.d.ts +54 -0
  469. package/dist/extensions/diagnostics-otel/index.js +290 -0
  470. package/dist/extensions/diagnostics-otel/index.js.map +1 -0
  471. package/dist/extensions/google-auth/index.d.ts +71 -0
  472. package/dist/extensions/google-auth/index.js +350 -0
  473. package/dist/extensions/google-auth/index.js.map +1 -0
  474. package/dist/extensions/index.d.ts +11 -0
  475. package/dist/extensions/index.js +29 -0
  476. package/dist/extensions/index.js.map +1 -0
  477. package/dist/extensions/llm-task/index.d.ts +80 -0
  478. package/dist/extensions/llm-task/index.js +248 -0
  479. package/dist/extensions/llm-task/index.js.map +1 -0
  480. package/dist/extensions/lobster/index.d.ts +69 -0
  481. package/dist/extensions/lobster/index.js +178 -0
  482. package/dist/extensions/lobster/index.js.map +1 -0
  483. package/dist/extensions/memory-lancedb/index.d.ts +62 -0
  484. package/dist/extensions/memory-lancedb/index.js +343 -0
  485. package/dist/extensions/memory-lancedb/index.js.map +1 -0
  486. package/dist/extensions/open-prose/index.d.ts +82 -0
  487. package/dist/extensions/open-prose/index.js +565 -0
  488. package/dist/extensions/open-prose/index.js.map +1 -0
  489. package/dist/extensions/qwen-portal/index.d.ts +48 -0
  490. package/dist/extensions/qwen-portal/index.js +161 -0
  491. package/dist/extensions/qwen-portal/index.js.map +1 -0
  492. package/dist/extensions/task-runner/index.d.ts +121 -0
  493. package/dist/extensions/task-runner/index.js +640 -0
  494. package/dist/extensions/task-runner/index.js.map +1 -0
  495. package/dist/farcaster/client.d.ts +101 -0
  496. package/dist/farcaster/client.js +282 -0
  497. package/dist/farcaster/client.js.map +1 -0
  498. package/dist/farcaster/index.d.ts +4 -0
  499. package/dist/farcaster/index.js +21 -0
  500. package/dist/farcaster/index.js.map +1 -0
  501. package/dist/feeds/acled/index.d.ts +86 -0
  502. package/dist/feeds/acled/index.js +215 -0
  503. package/dist/feeds/acled/index.js.map +1 -0
  504. package/dist/feeds/agentbets/index.d.ts +17 -0
  505. package/dist/feeds/agentbets/index.js +137 -0
  506. package/dist/feeds/agentbets/index.js.map +1 -0
  507. package/dist/feeds/betfair/index.d.ts +132 -0
  508. package/dist/feeds/betfair/index.js +640 -0
  509. package/dist/feeds/betfair/index.js.map +1 -0
  510. package/dist/feeds/crypto/index.d.ts +101 -0
  511. package/dist/feeds/crypto/index.js +506 -0
  512. package/dist/feeds/crypto/index.js.map +1 -0
  513. package/dist/feeds/crypto/whale-tracker.d.ts +138 -0
  514. package/dist/feeds/crypto/whale-tracker.js +685 -0
  515. package/dist/feeds/crypto/whale-tracker.js.map +1 -0
  516. package/dist/feeds/descriptors.d.ts +14 -0
  517. package/dist/feeds/descriptors.js +582 -0
  518. package/dist/feeds/descriptors.js.map +1 -0
  519. package/dist/feeds/drift/index.d.ts +23 -0
  520. package/dist/feeds/drift/index.js +182 -0
  521. package/dist/feeds/drift/index.js.map +1 -0
  522. package/dist/feeds/drift/trading.d.ts +75 -0
  523. package/dist/feeds/drift/trading.js +457 -0
  524. package/dist/feeds/drift/trading.js.map +1 -0
  525. package/dist/feeds/external/index.d.ts +48 -0
  526. package/dist/feeds/external/index.js +575 -0
  527. package/dist/feeds/external/index.js.map +1 -0
  528. package/dist/feeds/fred/index.d.ts +134 -0
  529. package/dist/feeds/fred/index.js +263 -0
  530. package/dist/feeds/fred/index.js.map +1 -0
  531. package/dist/feeds/freshness.d.ts +79 -0
  532. package/dist/feeds/freshness.js +259 -0
  533. package/dist/feeds/freshness.js.map +1 -0
  534. package/dist/feeds/hedgehog/index.d.ts +24 -0
  535. package/dist/feeds/hedgehog/index.js +589 -0
  536. package/dist/feeds/hedgehog/index.js.map +1 -0
  537. package/dist/feeds/hedgehog/types.d.ts +215 -0
  538. package/dist/feeds/hedgehog/types.js +7 -0
  539. package/dist/feeds/hedgehog/types.js.map +1 -0
  540. package/dist/feeds/index.d.ts +38 -0
  541. package/dist/feeds/index.js +469 -0
  542. package/dist/feeds/index.js.map +1 -0
  543. package/dist/feeds/kalshi/index.d.ts +116 -0
  544. package/dist/feeds/kalshi/index.js +970 -0
  545. package/dist/feeds/kalshi/index.js.map +1 -0
  546. package/dist/feeds/manifold/index.d.ts +15 -0
  547. package/dist/feeds/manifold/index.js +269 -0
  548. package/dist/feeds/manifold/index.js.map +1 -0
  549. package/dist/feeds/metaculus/index.d.ts +22 -0
  550. package/dist/feeds/metaculus/index.js +149 -0
  551. package/dist/feeds/metaculus/index.js.map +1 -0
  552. package/dist/feeds/news/index.d.ts +20 -0
  553. package/dist/feeds/news/index.js +308 -0
  554. package/dist/feeds/news/index.js.map +1 -0
  555. package/dist/feeds/opinion/index.d.ts +31 -0
  556. package/dist/feeds/opinion/index.js +389 -0
  557. package/dist/feeds/opinion/index.js.map +1 -0
  558. package/dist/feeds/polymarket/index.d.ts +21 -0
  559. package/dist/feeds/polymarket/index.js +501 -0
  560. package/dist/feeds/polymarket/index.js.map +1 -0
  561. package/dist/feeds/polymarket/rtds.d.ts +40 -0
  562. package/dist/feeds/polymarket/rtds.js +159 -0
  563. package/dist/feeds/polymarket/rtds.js.map +1 -0
  564. package/dist/feeds/polymarket/user-ws.d.ts +64 -0
  565. package/dist/feeds/polymarket/user-ws.js +230 -0
  566. package/dist/feeds/polymarket/user-ws.js.map +1 -0
  567. package/dist/feeds/polymarket/whale-tracker.d.ts +152 -0
  568. package/dist/feeds/polymarket/whale-tracker.js +709 -0
  569. package/dist/feeds/polymarket/whale-tracker.js.map +1 -0
  570. package/dist/feeds/predictfun/index.d.ts +24 -0
  571. package/dist/feeds/predictfun/index.js +234 -0
  572. package/dist/feeds/predictfun/index.js.map +1 -0
  573. package/dist/feeds/predictit/index.d.ts +14 -0
  574. package/dist/feeds/predictit/index.js +88 -0
  575. package/dist/feeds/predictit/index.js.map +1 -0
  576. package/dist/feeds/registry.d.ts +148 -0
  577. package/dist/feeds/registry.js +197 -0
  578. package/dist/feeds/registry.js.map +1 -0
  579. package/dist/feeds/smarkets/index.d.ts +76 -0
  580. package/dist/feeds/smarkets/index.js +415 -0
  581. package/dist/feeds/smarkets/index.js.map +1 -0
  582. package/dist/feeds/virtuals/index.d.ts +92 -0
  583. package/dist/feeds/virtuals/index.js +341 -0
  584. package/dist/feeds/virtuals/index.js.map +1 -0
  585. package/dist/feeds/weather-nws/index.d.ts +73 -0
  586. package/dist/feeds/weather-nws/index.js +162 -0
  587. package/dist/feeds/weather-nws/index.js.map +1 -0
  588. package/dist/feeds/weather-openmeteo/index.d.ts +80 -0
  589. package/dist/feeds/weather-openmeteo/index.js +197 -0
  590. package/dist/feeds/weather-openmeteo/index.js.map +1 -0
  591. package/dist/gateway/alerts-routes.d.ts +15 -0
  592. package/dist/gateway/alerts-routes.js +188 -0
  593. package/dist/gateway/alerts-routes.js.map +1 -0
  594. package/dist/gateway/alt-data-routes.d.ts +15 -0
  595. package/dist/gateway/alt-data-routes.js +67 -0
  596. package/dist/gateway/alt-data-routes.js.map +1 -0
  597. package/dist/gateway/api-routes.d.ts +39 -0
  598. package/dist/gateway/api-routes.js +1028 -0
  599. package/dist/gateway/api-routes.js.map +1 -0
  600. package/dist/gateway/audit-routes.d.ts +8 -0
  601. package/dist/gateway/audit-routes.js +61 -0
  602. package/dist/gateway/audit-routes.js.map +1 -0
  603. package/dist/gateway/bracket-routes.d.ts +12 -0
  604. package/dist/gateway/bracket-routes.js +122 -0
  605. package/dist/gateway/bracket-routes.js.map +1 -0
  606. package/dist/gateway/control-ui.d.ts +45 -0
  607. package/dist/gateway/control-ui.js +301 -0
  608. package/dist/gateway/control-ui.js.map +1 -0
  609. package/dist/gateway/copy-trading-routes.d.ts +12 -0
  610. package/dist/gateway/copy-trading-routes.js +159 -0
  611. package/dist/gateway/copy-trading-routes.js.map +1 -0
  612. package/dist/gateway/cron-routes.d.ts +14 -0
  613. package/dist/gateway/cron-routes.js +132 -0
  614. package/dist/gateway/cron-routes.js.map +1 -0
  615. package/dist/gateway/dca-routes.d.ts +8 -0
  616. package/dist/gateway/dca-routes.js +179 -0
  617. package/dist/gateway/dca-routes.js.map +1 -0
  618. package/dist/gateway/embeddings-routes.d.ts +12 -0
  619. package/dist/gateway/embeddings-routes.js +102 -0
  620. package/dist/gateway/embeddings-routes.js.map +1 -0
  621. package/dist/gateway/feeds-routes.d.ts +34 -0
  622. package/dist/gateway/feeds-routes.js +167 -0
  623. package/dist/gateway/feeds-routes.js.map +1 -0
  624. package/dist/gateway/index.d.ts +100 -0
  625. package/dist/gateway/index.js +2321 -0
  626. package/dist/gateway/index.js.map +1 -0
  627. package/dist/gateway/monitoring-routes.d.ts +12 -0
  628. package/dist/gateway/monitoring-routes.js +73 -0
  629. package/dist/gateway/monitoring-routes.js.map +1 -0
  630. package/dist/gateway/opportunity-routes.d.ts +12 -0
  631. package/dist/gateway/opportunity-routes.js +238 -0
  632. package/dist/gateway/opportunity-routes.js.map +1 -0
  633. package/dist/gateway/payments-routes.d.ts +14 -0
  634. package/dist/gateway/payments-routes.js +82 -0
  635. package/dist/gateway/payments-routes.js.map +1 -0
  636. package/dist/gateway/percolator-routes.d.ts +16 -0
  637. package/dist/gateway/percolator-routes.js +139 -0
  638. package/dist/gateway/percolator-routes.js.map +1 -0
  639. package/dist/gateway/queue-routes.d.ts +12 -0
  640. package/dist/gateway/queue-routes.js +47 -0
  641. package/dist/gateway/queue-routes.js.map +1 -0
  642. package/dist/gateway/risk-routes.d.ts +12 -0
  643. package/dist/gateway/risk-routes.js +119 -0
  644. package/dist/gateway/risk-routes.js.map +1 -0
  645. package/dist/gateway/routing-routes.d.ts +12 -0
  646. package/dist/gateway/routing-routes.js +86 -0
  647. package/dist/gateway/routing-routes.js.map +1 -0
  648. package/dist/gateway/server.d.ts +215 -0
  649. package/dist/gateway/server.js +2287 -0
  650. package/dist/gateway/server.js.map +1 -0
  651. package/dist/gateway/shield-routes.d.ts +8 -0
  652. package/dist/gateway/shield-routes.js +88 -0
  653. package/dist/gateway/shield-routes.js.map +1 -0
  654. package/dist/gateway/signal-bus.d.ts +51 -0
  655. package/dist/gateway/signal-bus.js +64 -0
  656. package/dist/gateway/signal-bus.js.map +1 -0
  657. package/dist/gateway/trigger-routes.d.ts +12 -0
  658. package/dist/gateway/trigger-routes.js +127 -0
  659. package/dist/gateway/trigger-routes.js.map +1 -0
  660. package/dist/gateway/twap-routes.d.ts +12 -0
  661. package/dist/gateway/twap-routes.js +142 -0
  662. package/dist/gateway/twap-routes.js.map +1 -0
  663. package/dist/gateway/webhooks-routes.d.ts +31 -0
  664. package/dist/gateway/webhooks-routes.js +107 -0
  665. package/dist/gateway/webhooks-routes.js.map +1 -0
  666. package/dist/gateway/whale-routes.d.ts +12 -0
  667. package/dist/gateway/whale-routes.js +204 -0
  668. package/dist/gateway/whale-routes.js.map +1 -0
  669. package/dist/history/index.d.ts +81 -0
  670. package/dist/history/index.js +362 -0
  671. package/dist/history/index.js.map +1 -0
  672. package/dist/hooks/index.d.ts +279 -0
  673. package/dist/hooks/index.js +739 -0
  674. package/dist/hooks/index.js.map +1 -0
  675. package/dist/i18n/index.d.ts +65 -0
  676. package/dist/i18n/index.js +183 -0
  677. package/dist/i18n/index.js.map +1 -0
  678. package/dist/identity/erc8004.d.ts +104 -0
  679. package/dist/identity/erc8004.js +493 -0
  680. package/dist/identity/erc8004.js.map +1 -0
  681. package/dist/identity/index.d.ts +1 -0
  682. package/dist/identity/index.js +18 -0
  683. package/dist/identity/index.js.map +1 -0
  684. package/dist/index.d.ts +7 -0
  685. package/dist/index.js +240 -0
  686. package/dist/index.js.map +1 -0
  687. package/dist/infra/index.d.ts +133 -0
  688. package/dist/infra/index.js +481 -0
  689. package/dist/infra/index.js.map +1 -0
  690. package/dist/infra/retry.d.ts +132 -0
  691. package/dist/infra/retry.js +450 -0
  692. package/dist/infra/retry.js.map +1 -0
  693. package/dist/ledger/anchor.d.ts +45 -0
  694. package/dist/ledger/anchor.js +271 -0
  695. package/dist/ledger/anchor.js.map +1 -0
  696. package/dist/ledger/hash.d.ts +26 -0
  697. package/dist/ledger/hash.js +69 -0
  698. package/dist/ledger/hash.js.map +1 -0
  699. package/dist/ledger/hooks.d.ts +107 -0
  700. package/dist/ledger/hooks.js +314 -0
  701. package/dist/ledger/hooks.js.map +1 -0
  702. package/dist/ledger/index.d.ts +67 -0
  703. package/dist/ledger/index.js +221 -0
  704. package/dist/ledger/index.js.map +1 -0
  705. package/dist/ledger/storage.d.ts +57 -0
  706. package/dist/ledger/storage.js +368 -0
  707. package/dist/ledger/storage.js.map +1 -0
  708. package/dist/ledger/types.d.ts +138 -0
  709. package/dist/ledger/types.js +16 -0
  710. package/dist/ledger/types.js.map +1 -0
  711. package/dist/link-understanding/index.d.ts +61 -0
  712. package/dist/link-understanding/index.js +320 -0
  713. package/dist/link-understanding/index.js.map +1 -0
  714. package/dist/logging/index.d.ts +50 -0
  715. package/dist/logging/index.js +255 -0
  716. package/dist/logging/index.js.map +1 -0
  717. package/dist/macos/index.d.ts +143 -0
  718. package/dist/macos/index.js +587 -0
  719. package/dist/macos/index.js.map +1 -0
  720. package/dist/markdown/index.d.ts +43 -0
  721. package/dist/markdown/index.js +305 -0
  722. package/dist/markdown/index.js.map +1 -0
  723. package/dist/market-index/index.d.ts +51 -0
  724. package/dist/market-index/index.js +553 -0
  725. package/dist/market-index/index.js.map +1 -0
  726. package/dist/mcp/index.d.ts +263 -0
  727. package/dist/mcp/index.js +940 -0
  728. package/dist/mcp/index.js.map +1 -0
  729. package/dist/mcp/installer.d.ts +11 -0
  730. package/dist/mcp/installer.js +128 -0
  731. package/dist/mcp/installer.js.map +1 -0
  732. package/dist/mcp/server.d.ts +7 -0
  733. package/dist/mcp/server.js +172 -0
  734. package/dist/mcp/server.js.map +1 -0
  735. package/dist/media/index.d.ts +119 -0
  736. package/dist/media/index.js +740 -0
  737. package/dist/media/index.js.map +1 -0
  738. package/dist/memory/context.d.ts +189 -0
  739. package/dist/memory/context.js +541 -0
  740. package/dist/memory/context.js.map +1 -0
  741. package/dist/memory/index.d.ts +74 -0
  742. package/dist/memory/index.js +352 -0
  743. package/dist/memory/index.js.map +1 -0
  744. package/dist/memory/summarizer.d.ts +10 -0
  745. package/dist/memory/summarizer.js +51 -0
  746. package/dist/memory/summarizer.js.map +1 -0
  747. package/dist/memory/tokenizer.d.ts +4 -0
  748. package/dist/memory/tokenizer.js +61 -0
  749. package/dist/memory/tokenizer.js.map +1 -0
  750. package/dist/messages/unified.d.ts +7 -0
  751. package/dist/messages/unified.js +77 -0
  752. package/dist/messages/unified.js.map +1 -0
  753. package/dist/ml-pipeline/collector.d.ts +23 -0
  754. package/dist/ml-pipeline/collector.js +176 -0
  755. package/dist/ml-pipeline/collector.js.map +1 -0
  756. package/dist/ml-pipeline/index.d.ts +21 -0
  757. package/dist/ml-pipeline/index.js +72 -0
  758. package/dist/ml-pipeline/index.js.map +1 -0
  759. package/dist/ml-pipeline/trainer.d.ts +32 -0
  760. package/dist/ml-pipeline/trainer.js +228 -0
  761. package/dist/ml-pipeline/trainer.js.map +1 -0
  762. package/dist/ml-pipeline/types.d.ts +51 -0
  763. package/dist/ml-pipeline/types.js +23 -0
  764. package/dist/ml-pipeline/types.js.map +1 -0
  765. package/dist/models/adaptive.d.ts +11 -0
  766. package/dist/models/adaptive.js +64 -0
  767. package/dist/models/adaptive.js.map +1 -0
  768. package/dist/models/failover.d.ts +51 -0
  769. package/dist/models/failover.js +151 -0
  770. package/dist/models/failover.js.map +1 -0
  771. package/dist/models/index.d.ts +7 -0
  772. package/dist/models/index.js +13 -0
  773. package/dist/models/index.js.map +1 -0
  774. package/dist/monitoring/alerts.d.ts +185 -0
  775. package/dist/monitoring/alerts.js +565 -0
  776. package/dist/monitoring/alerts.js.map +1 -0
  777. package/dist/monitoring/health.d.ts +151 -0
  778. package/dist/monitoring/health.js +423 -0
  779. package/dist/monitoring/health.js.map +1 -0
  780. package/dist/monitoring/index.d.ts +25 -0
  781. package/dist/monitoring/index.js +258 -0
  782. package/dist/monitoring/index.js.map +1 -0
  783. package/dist/monitoring/metrics.d.ts +147 -0
  784. package/dist/monitoring/metrics.js +519 -0
  785. package/dist/monitoring/metrics.js.map +1 -0
  786. package/dist/nodes/index.d.ts +81 -0
  787. package/dist/nodes/index.js +475 -0
  788. package/dist/nodes/index.js.map +1 -0
  789. package/dist/opportunity/analytics.d.ts +221 -0
  790. package/dist/opportunity/analytics.js +678 -0
  791. package/dist/opportunity/analytics.js.map +1 -0
  792. package/dist/opportunity/combinatorial.d.ts +147 -0
  793. package/dist/opportunity/combinatorial.js +765 -0
  794. package/dist/opportunity/combinatorial.js.map +1 -0
  795. package/dist/opportunity/correlation.d.ts +107 -0
  796. package/dist/opportunity/correlation.js +410 -0
  797. package/dist/opportunity/correlation.js.map +1 -0
  798. package/dist/opportunity/executor.d.ts +108 -0
  799. package/dist/opportunity/executor.js +356 -0
  800. package/dist/opportunity/executor.js.map +1 -0
  801. package/dist/opportunity/index.d.ts +285 -0
  802. package/dist/opportunity/index.js +839 -0
  803. package/dist/opportunity/index.js.map +1 -0
  804. package/dist/opportunity/links.d.ts +87 -0
  805. package/dist/opportunity/links.js +344 -0
  806. package/dist/opportunity/links.js.map +1 -0
  807. package/dist/opportunity/matching.d.ts +101 -0
  808. package/dist/opportunity/matching.js +551 -0
  809. package/dist/opportunity/matching.js.map +1 -0
  810. package/dist/opportunity/outcomes.d.ts +74 -0
  811. package/dist/opportunity/outcomes.js +321 -0
  812. package/dist/opportunity/outcomes.js.map +1 -0
  813. package/dist/opportunity/risk.d.ts +128 -0
  814. package/dist/opportunity/risk.js +381 -0
  815. package/dist/opportunity/risk.js.map +1 -0
  816. package/dist/opportunity/scoring.d.ts +151 -0
  817. package/dist/opportunity/scoring.js +421 -0
  818. package/dist/opportunity/scoring.js.map +1 -0
  819. package/dist/pairing/index.d.ts +108 -0
  820. package/dist/pairing/index.js +431 -0
  821. package/dist/pairing/index.js.map +1 -0
  822. package/dist/payments/index.d.ts +12 -0
  823. package/dist/payments/index.js +34 -0
  824. package/dist/payments/index.js.map +1 -0
  825. package/dist/payments/x402/evm.d.ts +53 -0
  826. package/dist/payments/x402/evm.js +282 -0
  827. package/dist/payments/x402/evm.js.map +1 -0
  828. package/dist/payments/x402/index.d.ts +158 -0
  829. package/dist/payments/x402/index.js +531 -0
  830. package/dist/payments/x402/index.js.map +1 -0
  831. package/dist/payments/x402/solana.d.ts +51 -0
  832. package/dist/payments/x402/solana.js +397 -0
  833. package/dist/payments/x402/solana.js.map +1 -0
  834. package/dist/percolator/accounts.d.ts +21 -0
  835. package/dist/percolator/accounts.js +76 -0
  836. package/dist/percolator/accounts.js.map +1 -0
  837. package/dist/percolator/encode.d.ts +14 -0
  838. package/dist/percolator/encode.js +90 -0
  839. package/dist/percolator/encode.js.map +1 -0
  840. package/dist/percolator/execution.d.ts +29 -0
  841. package/dist/percolator/execution.js +239 -0
  842. package/dist/percolator/execution.js.map +1 -0
  843. package/dist/percolator/feed.d.ts +15 -0
  844. package/dist/percolator/feed.js +160 -0
  845. package/dist/percolator/feed.js.map +1 -0
  846. package/dist/percolator/index.d.ts +20 -0
  847. package/dist/percolator/index.js +24 -0
  848. package/dist/percolator/index.js.map +1 -0
  849. package/dist/percolator/instructions.d.ts +29 -0
  850. package/dist/percolator/instructions.js +52 -0
  851. package/dist/percolator/instructions.js.map +1 -0
  852. package/dist/percolator/keeper.d.ts +11 -0
  853. package/dist/percolator/keeper.js +83 -0
  854. package/dist/percolator/keeper.js.map +1 -0
  855. package/dist/percolator/pda.d.ts +15 -0
  856. package/dist/percolator/pda.js +26 -0
  857. package/dist/percolator/pda.js.map +1 -0
  858. package/dist/percolator/slab.d.ts +122 -0
  859. package/dist/percolator/slab.js +325 -0
  860. package/dist/percolator/slab.js.map +1 -0
  861. package/dist/percolator/tx.d.ts +27 -0
  862. package/dist/percolator/tx.js +77 -0
  863. package/dist/percolator/tx.js.map +1 -0
  864. package/dist/percolator/types.d.ts +51 -0
  865. package/dist/percolator/types.js +9 -0
  866. package/dist/percolator/types.js.map +1 -0
  867. package/dist/permissions/index.d.ts +262 -0
  868. package/dist/permissions/index.js +929 -0
  869. package/dist/permissions/index.js.map +1 -0
  870. package/dist/plugins/index.d.ts +158 -0
  871. package/dist/plugins/index.js +444 -0
  872. package/dist/plugins/index.js.map +1 -0
  873. package/dist/portfolio/index.d.ts +170 -0
  874. package/dist/portfolio/index.js +970 -0
  875. package/dist/portfolio/index.js.map +1 -0
  876. package/dist/presence/index.d.ts +34 -0
  877. package/dist/presence/index.js +124 -0
  878. package/dist/presence/index.js.map +1 -0
  879. package/dist/process/index.d.ts +82 -0
  880. package/dist/process/index.js +402 -0
  881. package/dist/process/index.js.map +1 -0
  882. package/dist/providers/discovery.d.ts +209 -0
  883. package/dist/providers/discovery.js +751 -0
  884. package/dist/providers/discovery.js.map +1 -0
  885. package/dist/providers/health.d.ts +27 -0
  886. package/dist/providers/health.js +80 -0
  887. package/dist/providers/health.js.map +1 -0
  888. package/dist/providers/index.d.ts +154 -0
  889. package/dist/providers/index.js +897 -0
  890. package/dist/providers/index.js.map +1 -0
  891. package/dist/queue/index.d.ts +36 -0
  892. package/dist/queue/index.js +146 -0
  893. package/dist/queue/index.js.map +1 -0
  894. package/dist/queue/jobs/index.d.ts +11 -0
  895. package/dist/queue/jobs/index.js +32 -0
  896. package/dist/queue/jobs/index.js.map +1 -0
  897. package/dist/queue/jobs/producer.d.ts +43 -0
  898. package/dist/queue/jobs/producer.js +233 -0
  899. package/dist/queue/jobs/producer.js.map +1 -0
  900. package/dist/queue/jobs/types.d.ts +128 -0
  901. package/dist/queue/jobs/types.js +14 -0
  902. package/dist/queue/jobs/types.js.map +1 -0
  903. package/dist/queue/jobs/worker.d.ts +22 -0
  904. package/dist/queue/jobs/worker.js +220 -0
  905. package/dist/queue/jobs/worker.js.map +1 -0
  906. package/dist/remote/index.d.ts +136 -0
  907. package/dist/remote/index.js +456 -0
  908. package/dist/remote/index.js.map +1 -0
  909. package/dist/risk/circuit-breaker.d.ts +99 -0
  910. package/dist/risk/circuit-breaker.js +300 -0
  911. package/dist/risk/circuit-breaker.js.map +1 -0
  912. package/dist/risk/dashboard.d.ts +69 -0
  913. package/dist/risk/dashboard.js +127 -0
  914. package/dist/risk/dashboard.js.map +1 -0
  915. package/dist/risk/engine.d.ts +128 -0
  916. package/dist/risk/engine.js +311 -0
  917. package/dist/risk/engine.js.map +1 -0
  918. package/dist/risk/index.d.ts +10 -0
  919. package/dist/risk/index.js +38 -0
  920. package/dist/risk/index.js.map +1 -0
  921. package/dist/risk/stress.d.ts +70 -0
  922. package/dist/risk/stress.js +215 -0
  923. package/dist/risk/stress.js.map +1 -0
  924. package/dist/risk/var.d.ts +72 -0
  925. package/dist/risk/var.js +173 -0
  926. package/dist/risk/var.js.map +1 -0
  927. package/dist/risk/volatility.d.ts +61 -0
  928. package/dist/risk/volatility.js +132 -0
  929. package/dist/risk/volatility.js.map +1 -0
  930. package/dist/routing/index.d.ts +116 -0
  931. package/dist/routing/index.js +371 -0
  932. package/dist/routing/index.js.map +1 -0
  933. package/dist/search/index.d.ts +30 -0
  934. package/dist/search/index.js +129 -0
  935. package/dist/search/index.js.map +1 -0
  936. package/dist/security/address-checker.d.ts +6 -0
  937. package/dist/security/address-checker.js +213 -0
  938. package/dist/security/address-checker.js.map +1 -0
  939. package/dist/security/code-scanner.d.ts +3 -0
  940. package/dist/security/code-scanner.js +190 -0
  941. package/dist/security/code-scanner.js.map +1 -0
  942. package/dist/security/index.d.ts +176 -0
  943. package/dist/security/index.js +498 -0
  944. package/dist/security/index.js.map +1 -0
  945. package/dist/security/sanitizer.d.ts +2 -0
  946. package/dist/security/sanitizer.js +135 -0
  947. package/dist/security/sanitizer.js.map +1 -0
  948. package/dist/security/scam-db.d.ts +5 -0
  949. package/dist/security/scam-db.js +116 -0
  950. package/dist/security/scam-db.js.map +1 -0
  951. package/dist/security/shield.d.ts +12 -0
  952. package/dist/security/shield.js +80 -0
  953. package/dist/security/shield.js.map +1 -0
  954. package/dist/security/tx-validator.d.ts +5 -0
  955. package/dist/security/tx-validator.js +115 -0
  956. package/dist/security/tx-validator.js.map +1 -0
  957. package/dist/security/types.d.ts +84 -0
  958. package/dist/security/types.js +6 -0
  959. package/dist/security/types.js.map +1 -0
  960. package/dist/services/alt-data/feeds/fear-greed.d.ts +14 -0
  961. package/dist/services/alt-data/feeds/fear-greed.js +81 -0
  962. package/dist/services/alt-data/feeds/fear-greed.js.map +1 -0
  963. package/dist/services/alt-data/feeds/funding-rates.d.ts +13 -0
  964. package/dist/services/alt-data/feeds/funding-rates.js +90 -0
  965. package/dist/services/alt-data/feeds/funding-rates.js.map +1 -0
  966. package/dist/services/alt-data/feeds/reddit.d.ts +13 -0
  967. package/dist/services/alt-data/feeds/reddit.js +112 -0
  968. package/dist/services/alt-data/feeds/reddit.js.map +1 -0
  969. package/dist/services/alt-data/index.d.ts +31 -0
  970. package/dist/services/alt-data/index.js +278 -0
  971. package/dist/services/alt-data/index.js.map +1 -0
  972. package/dist/services/alt-data/market-matcher.d.ts +29 -0
  973. package/dist/services/alt-data/market-matcher.js +157 -0
  974. package/dist/services/alt-data/market-matcher.js.map +1 -0
  975. package/dist/services/alt-data/sentiment.d.ts +11 -0
  976. package/dist/services/alt-data/sentiment.js +277 -0
  977. package/dist/services/alt-data/sentiment.js.map +1 -0
  978. package/dist/services/alt-data/types.d.ts +86 -0
  979. package/dist/services/alt-data/types.js +9 -0
  980. package/dist/services/alt-data/types.js.map +1 -0
  981. package/dist/services/feature-engineering/accessor.d.ts +19 -0
  982. package/dist/services/feature-engineering/accessor.js +31 -0
  983. package/dist/services/feature-engineering/accessor.js.map +1 -0
  984. package/dist/services/feature-engineering/index.d.ts +15 -0
  985. package/dist/services/feature-engineering/index.js +345 -0
  986. package/dist/services/feature-engineering/index.js.map +1 -0
  987. package/dist/services/feature-engineering/indicators.d.ts +90 -0
  988. package/dist/services/feature-engineering/indicators.js +254 -0
  989. package/dist/services/feature-engineering/indicators.js.map +1 -0
  990. package/dist/services/feature-engineering/rolling-window.d.ts +89 -0
  991. package/dist/services/feature-engineering/rolling-window.js +173 -0
  992. package/dist/services/feature-engineering/rolling-window.js.map +1 -0
  993. package/dist/services/feature-engineering/thresholds.d.ts +137 -0
  994. package/dist/services/feature-engineering/thresholds.js +280 -0
  995. package/dist/services/feature-engineering/thresholds.js.map +1 -0
  996. package/dist/services/feature-engineering/types.d.ts +138 -0
  997. package/dist/services/feature-engineering/types.js +6 -0
  998. package/dist/services/feature-engineering/types.js.map +1 -0
  999. package/dist/services/tick-recorder/index.d.ts +12 -0
  1000. package/dist/services/tick-recorder/index.js +200 -0
  1001. package/dist/services/tick-recorder/index.js.map +1 -0
  1002. package/dist/services/tick-recorder/queries.d.ts +46 -0
  1003. package/dist/services/tick-recorder/queries.js +291 -0
  1004. package/dist/services/tick-recorder/queries.js.map +1 -0
  1005. package/dist/services/tick-recorder/schema.d.ts +27 -0
  1006. package/dist/services/tick-recorder/schema.js +185 -0
  1007. package/dist/services/tick-recorder/schema.js.map +1 -0
  1008. package/dist/services/tick-recorder/timescale.d.ts +27 -0
  1009. package/dist/services/tick-recorder/timescale.js +105 -0
  1010. package/dist/services/tick-recorder/timescale.js.map +1 -0
  1011. package/dist/services/tick-recorder/types.d.ts +113 -0
  1012. package/dist/services/tick-recorder/types.js +7 -0
  1013. package/dist/services/tick-recorder/types.js.map +1 -0
  1014. package/dist/services/tick-streamer/index.d.ts +12 -0
  1015. package/dist/services/tick-streamer/index.js +317 -0
  1016. package/dist/services/tick-streamer/index.js.map +1 -0
  1017. package/dist/services/tick-streamer/types.d.ts +134 -0
  1018. package/dist/services/tick-streamer/types.js +6 -0
  1019. package/dist/services/tick-streamer/types.js.map +1 -0
  1020. package/dist/session/index.d.ts +147 -0
  1021. package/dist/session/index.js +429 -0
  1022. package/dist/session/index.js.map +1 -0
  1023. package/dist/sessions/index.d.ts +69 -0
  1024. package/dist/sessions/index.js +447 -0
  1025. package/dist/sessions/index.js.map +1 -0
  1026. package/dist/signal-router/index.d.ts +2 -0
  1027. package/dist/signal-router/index.js +6 -0
  1028. package/dist/signal-router/index.js.map +1 -0
  1029. package/dist/signal-router/router.d.ts +25 -0
  1030. package/dist/signal-router/router.js +391 -0
  1031. package/dist/signal-router/router.js.map +1 -0
  1032. package/dist/signal-router/types.d.ts +64 -0
  1033. package/dist/signal-router/types.js +9 -0
  1034. package/dist/signal-router/types.js.map +1 -0
  1035. package/dist/skills/bundled/acp/index.d.ts +25 -0
  1036. package/dist/skills/bundled/acp/index.js +472 -0
  1037. package/dist/skills/bundled/acp/index.js.map +1 -0
  1038. package/dist/skills/bundled/agentbets/index.d.ts +15 -0
  1039. package/dist/skills/bundled/agentbets/index.js +168 -0
  1040. package/dist/skills/bundled/agentbets/index.js.map +1 -0
  1041. package/dist/skills/bundled/ai-strategy/index.d.ts +21 -0
  1042. package/dist/skills/bundled/ai-strategy/index.js +647 -0
  1043. package/dist/skills/bundled/ai-strategy/index.js.map +1 -0
  1044. package/dist/skills/bundled/alerts/index.d.ts +20 -0
  1045. package/dist/skills/bundled/alerts/index.js +249 -0
  1046. package/dist/skills/bundled/alerts/index.js.map +1 -0
  1047. package/dist/skills/bundled/analytics/index.d.ts +17 -0
  1048. package/dist/skills/bundled/analytics/index.js +112 -0
  1049. package/dist/skills/bundled/analytics/index.js.map +1 -0
  1050. package/dist/skills/bundled/arbitrage/index.d.ts +24 -0
  1051. package/dist/skills/bundled/arbitrage/index.js +253 -0
  1052. package/dist/skills/bundled/arbitrage/index.js.map +1 -0
  1053. package/dist/skills/bundled/auto-reply/index.d.ts +18 -0
  1054. package/dist/skills/bundled/auto-reply/index.js +215 -0
  1055. package/dist/skills/bundled/auto-reply/index.js.map +1 -0
  1056. package/dist/skills/bundled/automation/index.d.ts +19 -0
  1057. package/dist/skills/bundled/automation/index.js +160 -0
  1058. package/dist/skills/bundled/automation/index.js.map +1 -0
  1059. package/dist/skills/bundled/backtest/index.d.ts +18 -0
  1060. package/dist/skills/bundled/backtest/index.js +250 -0
  1061. package/dist/skills/bundled/backtest/index.js.map +1 -0
  1062. package/dist/skills/bundled/bags/index.d.ts +49 -0
  1063. package/dist/skills/bundled/bags/index.js +1069 -0
  1064. package/dist/skills/bundled/bags/index.js.map +1 -0
  1065. package/dist/skills/bundled/bankr/index.d.ts +161 -0
  1066. package/dist/skills/bundled/bankr/index.js +271 -0
  1067. package/dist/skills/bundled/bankr/index.js.map +1 -0
  1068. package/dist/skills/bundled/betfair/index.d.ts +24 -0
  1069. package/dist/skills/bundled/betfair/index.js +511 -0
  1070. package/dist/skills/bundled/betfair/index.js.map +1 -0
  1071. package/dist/skills/bundled/binance-futures/index.d.ts +15 -0
  1072. package/dist/skills/bundled/binance-futures/index.js +485 -0
  1073. package/dist/skills/bundled/binance-futures/index.js.map +1 -0
  1074. package/dist/skills/bundled/botchan/index.d.ts +130 -0
  1075. package/dist/skills/bundled/botchan/index.js +427 -0
  1076. package/dist/skills/bundled/botchan/index.js.map +1 -0
  1077. package/dist/skills/bundled/bridge/index.d.ts +17 -0
  1078. package/dist/skills/bundled/bridge/index.js +297 -0
  1079. package/dist/skills/bundled/bridge/index.js.map +1 -0
  1080. package/dist/skills/bundled/bybit-futures/index.d.ts +15 -0
  1081. package/dist/skills/bundled/bybit-futures/index.js +380 -0
  1082. package/dist/skills/bundled/bybit-futures/index.js.map +1 -0
  1083. package/dist/skills/bundled/clanker/index.d.ts +236 -0
  1084. package/dist/skills/bundled/clanker/index.js +759 -0
  1085. package/dist/skills/bundled/clanker/index.js.map +1 -0
  1086. package/dist/skills/bundled/copy-trading/index.d.ts +20 -0
  1087. package/dist/skills/bundled/copy-trading/index.js +213 -0
  1088. package/dist/skills/bundled/copy-trading/index.js.map +1 -0
  1089. package/dist/skills/bundled/copy-trading-solana/index.d.ts +21 -0
  1090. package/dist/skills/bundled/copy-trading-solana/index.js +421 -0
  1091. package/dist/skills/bundled/copy-trading-solana/index.js.map +1 -0
  1092. package/dist/skills/bundled/credentials/index.d.ts +17 -0
  1093. package/dist/skills/bundled/credentials/index.js +137 -0
  1094. package/dist/skills/bundled/credentials/index.js.map +1 -0
  1095. package/dist/skills/bundled/crypto-hft/index.d.ts +26 -0
  1096. package/dist/skills/bundled/crypto-hft/index.js +361 -0
  1097. package/dist/skills/bundled/crypto-hft/index.js.map +1 -0
  1098. package/dist/skills/bundled/dca/index.d.ts +26 -0
  1099. package/dist/skills/bundled/dca/index.js +1342 -0
  1100. package/dist/skills/bundled/dca/index.js.map +1 -0
  1101. package/dist/skills/bundled/divergence/index.d.ts +19 -0
  1102. package/dist/skills/bundled/divergence/index.js +272 -0
  1103. package/dist/skills/bundled/divergence/index.js.map +1 -0
  1104. package/dist/skills/bundled/doctor/index.d.ts +18 -0
  1105. package/dist/skills/bundled/doctor/index.js +78 -0
  1106. package/dist/skills/bundled/doctor/index.js.map +1 -0
  1107. package/dist/skills/bundled/drift/index.d.ts +13 -0
  1108. package/dist/skills/bundled/drift/index.js +378 -0
  1109. package/dist/skills/bundled/drift/index.js.map +1 -0
  1110. package/dist/skills/bundled/drift-sdk/index.d.ts +17 -0
  1111. package/dist/skills/bundled/drift-sdk/index.js +501 -0
  1112. package/dist/skills/bundled/drift-sdk/index.js.map +1 -0
  1113. package/dist/skills/bundled/edge/index.d.ts +16 -0
  1114. package/dist/skills/bundled/edge/index.js +91 -0
  1115. package/dist/skills/bundled/edge/index.js.map +1 -0
  1116. package/dist/skills/bundled/embeddings/index.d.ts +19 -0
  1117. package/dist/skills/bundled/embeddings/index.js +215 -0
  1118. package/dist/skills/bundled/embeddings/index.js.map +1 -0
  1119. package/dist/skills/bundled/endaoment/index.d.ts +105 -0
  1120. package/dist/skills/bundled/endaoment/index.js +285 -0
  1121. package/dist/skills/bundled/endaoment/index.js.map +1 -0
  1122. package/dist/skills/bundled/ens/index.d.ts +151 -0
  1123. package/dist/skills/bundled/ens/index.js +278 -0
  1124. package/dist/skills/bundled/ens/index.js.map +1 -0
  1125. package/dist/skills/bundled/erc8004/index.d.ts +123 -0
  1126. package/dist/skills/bundled/erc8004/index.js +301 -0
  1127. package/dist/skills/bundled/erc8004/index.js.map +1 -0
  1128. package/dist/skills/bundled/execution/index.d.ts +18 -0
  1129. package/dist/skills/bundled/execution/index.js +358 -0
  1130. package/dist/skills/bundled/execution/index.js.map +1 -0
  1131. package/dist/skills/bundled/farcaster/index.d.ts +121 -0
  1132. package/dist/skills/bundled/farcaster/index.js +314 -0
  1133. package/dist/skills/bundled/farcaster/index.js.map +1 -0
  1134. package/dist/skills/bundled/features/index.d.ts +17 -0
  1135. package/dist/skills/bundled/features/index.js +305 -0
  1136. package/dist/skills/bundled/features/index.js.map +1 -0
  1137. package/dist/skills/bundled/feeds/index.d.ts +26 -0
  1138. package/dist/skills/bundled/feeds/index.js +462 -0
  1139. package/dist/skills/bundled/feeds/index.js.map +1 -0
  1140. package/dist/skills/bundled/harden/index.d.ts +55 -0
  1141. package/dist/skills/bundled/harden/index.js +510 -0
  1142. package/dist/skills/bundled/harden/index.js.map +1 -0
  1143. package/dist/skills/bundled/history/index.d.ts +21 -0
  1144. package/dist/skills/bundled/history/index.js +195 -0
  1145. package/dist/skills/bundled/history/index.js.map +1 -0
  1146. package/dist/skills/bundled/hyperliquid/index.d.ts +19 -0
  1147. package/dist/skills/bundled/hyperliquid/index.js +1280 -0
  1148. package/dist/skills/bundled/hyperliquid/index.js.map +1 -0
  1149. package/dist/skills/bundled/identity/index.d.ts +17 -0
  1150. package/dist/skills/bundled/identity/index.js +223 -0
  1151. package/dist/skills/bundled/identity/index.js.map +1 -0
  1152. package/dist/skills/bundled/integrations/index.d.ts +17 -0
  1153. package/dist/skills/bundled/integrations/index.js +138 -0
  1154. package/dist/skills/bundled/integrations/index.js.map +1 -0
  1155. package/dist/skills/bundled/jupiter/index.d.ts +41 -0
  1156. package/dist/skills/bundled/jupiter/index.js +872 -0
  1157. package/dist/skills/bundled/jupiter/index.js.map +1 -0
  1158. package/dist/skills/bundled/kamino/index.d.ts +33 -0
  1159. package/dist/skills/bundled/kamino/index.js +578 -0
  1160. package/dist/skills/bundled/kamino/index.js.map +1 -0
  1161. package/dist/skills/bundled/ledger/index.d.ts +14 -0
  1162. package/dist/skills/bundled/ledger/index.js +186 -0
  1163. package/dist/skills/bundled/ledger/index.js.map +1 -0
  1164. package/dist/skills/bundled/market-index/index.d.ts +18 -0
  1165. package/dist/skills/bundled/market-index/index.js +182 -0
  1166. package/dist/skills/bundled/market-index/index.js.map +1 -0
  1167. package/dist/skills/bundled/markets/index.d.ts +16 -0
  1168. package/dist/skills/bundled/markets/index.js +95 -0
  1169. package/dist/skills/bundled/markets/index.js.map +1 -0
  1170. package/dist/skills/bundled/mcp/index.d.ts +19 -0
  1171. package/dist/skills/bundled/mcp/index.js +212 -0
  1172. package/dist/skills/bundled/mcp/index.js.map +1 -0
  1173. package/dist/skills/bundled/memory/index.d.ts +20 -0
  1174. package/dist/skills/bundled/memory/index.js +210 -0
  1175. package/dist/skills/bundled/memory/index.js.map +1 -0
  1176. package/dist/skills/bundled/metaculus/index.d.ts +17 -0
  1177. package/dist/skills/bundled/metaculus/index.js +168 -0
  1178. package/dist/skills/bundled/metaculus/index.js.map +1 -0
  1179. package/dist/skills/bundled/meteora/index.d.ts +39 -0
  1180. package/dist/skills/bundled/meteora/index.js +837 -0
  1181. package/dist/skills/bundled/meteora/index.js.map +1 -0
  1182. package/dist/skills/bundled/meteora-dbc/index.d.ts +33 -0
  1183. package/dist/skills/bundled/meteora-dbc/index.js +993 -0
  1184. package/dist/skills/bundled/meteora-dbc/index.js.map +1 -0
  1185. package/dist/skills/bundled/metrics/index.d.ts +18 -0
  1186. package/dist/skills/bundled/metrics/index.js +91 -0
  1187. package/dist/skills/bundled/metrics/index.js.map +1 -0
  1188. package/dist/skills/bundled/mev/index.d.ts +17 -0
  1189. package/dist/skills/bundled/mev/index.js +108 -0
  1190. package/dist/skills/bundled/mev/index.js.map +1 -0
  1191. package/dist/skills/bundled/mexc-futures/index.d.ts +16 -0
  1192. package/dist/skills/bundled/mexc-futures/index.js +389 -0
  1193. package/dist/skills/bundled/mexc-futures/index.js.map +1 -0
  1194. package/dist/skills/bundled/mm/index.d.ts +18 -0
  1195. package/dist/skills/bundled/mm/index.js +315 -0
  1196. package/dist/skills/bundled/mm/index.js.map +1 -0
  1197. package/dist/skills/bundled/monitoring/index.d.ts +18 -0
  1198. package/dist/skills/bundled/monitoring/index.js +146 -0
  1199. package/dist/skills/bundled/monitoring/index.js.map +1 -0
  1200. package/dist/skills/bundled/news/index.d.ts +17 -0
  1201. package/dist/skills/bundled/news/index.js +161 -0
  1202. package/dist/skills/bundled/news/index.js.map +1 -0
  1203. package/dist/skills/bundled/onchainkit/index.d.ts +92 -0
  1204. package/dist/skills/bundled/onchainkit/index.js +429 -0
  1205. package/dist/skills/bundled/onchainkit/index.js.map +1 -0
  1206. package/dist/skills/bundled/opinion/index.d.ts +12 -0
  1207. package/dist/skills/bundled/opinion/index.js +429 -0
  1208. package/dist/skills/bundled/opinion/index.js.map +1 -0
  1209. package/dist/skills/bundled/opportunity/index.d.ts +25 -0
  1210. package/dist/skills/bundled/opportunity/index.js +289 -0
  1211. package/dist/skills/bundled/opportunity/index.js.map +1 -0
  1212. package/dist/skills/bundled/orca/index.d.ts +12 -0
  1213. package/dist/skills/bundled/orca/index.js +663 -0
  1214. package/dist/skills/bundled/orca/index.js.map +1 -0
  1215. package/dist/skills/bundled/pairing/index.d.ts +24 -0
  1216. package/dist/skills/bundled/pairing/index.js +228 -0
  1217. package/dist/skills/bundled/pairing/index.js.map +1 -0
  1218. package/dist/skills/bundled/percolator/index.d.ts +20 -0
  1219. package/dist/skills/bundled/percolator/index.js +229 -0
  1220. package/dist/skills/bundled/percolator/index.js.map +1 -0
  1221. package/dist/skills/bundled/permissions/index.d.ts +21 -0
  1222. package/dist/skills/bundled/permissions/index.js +204 -0
  1223. package/dist/skills/bundled/permissions/index.js.map +1 -0
  1224. package/dist/skills/bundled/plugins/index.d.ts +20 -0
  1225. package/dist/skills/bundled/plugins/index.js +209 -0
  1226. package/dist/skills/bundled/plugins/index.js.map +1 -0
  1227. package/dist/skills/bundled/portfolio/index.d.ts +20 -0
  1228. package/dist/skills/bundled/portfolio/index.js +367 -0
  1229. package/dist/skills/bundled/portfolio/index.js.map +1 -0
  1230. package/dist/skills/bundled/portfolio-sync/index.d.ts +17 -0
  1231. package/dist/skills/bundled/portfolio-sync/index.js +116 -0
  1232. package/dist/skills/bundled/portfolio-sync/index.js.map +1 -0
  1233. package/dist/skills/bundled/positions/index.d.ts +18 -0
  1234. package/dist/skills/bundled/positions/index.js +161 -0
  1235. package/dist/skills/bundled/positions/index.js.map +1 -0
  1236. package/dist/skills/bundled/predictfun/index.d.ts +13 -0
  1237. package/dist/skills/bundled/predictfun/index.js +612 -0
  1238. package/dist/skills/bundled/predictfun/index.js.map +1 -0
  1239. package/dist/skills/bundled/predictit/index.d.ts +16 -0
  1240. package/dist/skills/bundled/predictit/index.js +138 -0
  1241. package/dist/skills/bundled/predictit/index.js.map +1 -0
  1242. package/dist/skills/bundled/presence/index.d.ts +18 -0
  1243. package/dist/skills/bundled/presence/index.js +151 -0
  1244. package/dist/skills/bundled/presence/index.js.map +1 -0
  1245. package/dist/skills/bundled/processes/index.d.ts +17 -0
  1246. package/dist/skills/bundled/processes/index.js +121 -0
  1247. package/dist/skills/bundled/processes/index.js.map +1 -0
  1248. package/dist/skills/bundled/pump-swarm/index.d.ts +16 -0
  1249. package/dist/skills/bundled/pump-swarm/index.js +2235 -0
  1250. package/dist/skills/bundled/pump-swarm/index.js.map +1 -0
  1251. package/dist/skills/bundled/pumpfun/index.d.ts +47 -0
  1252. package/dist/skills/bundled/pumpfun/index.js +1400 -0
  1253. package/dist/skills/bundled/pumpfun/index.js.map +1 -0
  1254. package/dist/skills/bundled/qmd/index.d.ts +18 -0
  1255. package/dist/skills/bundled/qmd/index.js +116 -0
  1256. package/dist/skills/bundled/qmd/index.js.map +1 -0
  1257. package/dist/skills/bundled/qrcoin/index.d.ts +92 -0
  1258. package/dist/skills/bundled/qrcoin/index.js +328 -0
  1259. package/dist/skills/bundled/qrcoin/index.js.map +1 -0
  1260. package/dist/skills/bundled/raydium/index.d.ts +35 -0
  1261. package/dist/skills/bundled/raydium/index.js +695 -0
  1262. package/dist/skills/bundled/raydium/index.js.map +1 -0
  1263. package/dist/skills/bundled/remote/index.d.ts +19 -0
  1264. package/dist/skills/bundled/remote/index.js +186 -0
  1265. package/dist/skills/bundled/remote/index.js.map +1 -0
  1266. package/dist/skills/bundled/research/index.d.ts +17 -0
  1267. package/dist/skills/bundled/research/index.js +185 -0
  1268. package/dist/skills/bundled/research/index.js.map +1 -0
  1269. package/dist/skills/bundled/risk/index.d.ts +31 -0
  1270. package/dist/skills/bundled/risk/index.js +379 -0
  1271. package/dist/skills/bundled/risk/index.js.map +1 -0
  1272. package/dist/skills/bundled/router/index.d.ts +17 -0
  1273. package/dist/skills/bundled/router/index.js +160 -0
  1274. package/dist/skills/bundled/router/index.js.map +1 -0
  1275. package/dist/skills/bundled/routing/index.d.ts +23 -0
  1276. package/dist/skills/bundled/routing/index.js +257 -0
  1277. package/dist/skills/bundled/routing/index.js.map +1 -0
  1278. package/dist/skills/bundled/sandbox/index.d.ts +18 -0
  1279. package/dist/skills/bundled/sandbox/index.js +119 -0
  1280. package/dist/skills/bundled/sandbox/index.js.map +1 -0
  1281. package/dist/skills/bundled/search-config/index.d.ts +18 -0
  1282. package/dist/skills/bundled/search-config/index.js +170 -0
  1283. package/dist/skills/bundled/search-config/index.js.map +1 -0
  1284. package/dist/skills/bundled/sessions/index.d.ts +29 -0
  1285. package/dist/skills/bundled/sessions/index.js +193 -0
  1286. package/dist/skills/bundled/sessions/index.js.map +1 -0
  1287. package/dist/skills/bundled/shield/index.d.ts +22 -0
  1288. package/dist/skills/bundled/shield/index.js +245 -0
  1289. package/dist/skills/bundled/shield/index.js.map +1 -0
  1290. package/dist/skills/bundled/signals/index.d.ts +24 -0
  1291. package/dist/skills/bundled/signals/index.js +776 -0
  1292. package/dist/skills/bundled/signals/index.js.map +1 -0
  1293. package/dist/skills/bundled/sizing/index.d.ts +16 -0
  1294. package/dist/skills/bundled/sizing/index.js +168 -0
  1295. package/dist/skills/bundled/sizing/index.js.map +1 -0
  1296. package/dist/skills/bundled/slippage/index.d.ts +16 -0
  1297. package/dist/skills/bundled/slippage/index.js +111 -0
  1298. package/dist/skills/bundled/slippage/index.js.map +1 -0
  1299. package/dist/skills/bundled/smarkets/index.d.ts +23 -0
  1300. package/dist/skills/bundled/smarkets/index.js +473 -0
  1301. package/dist/skills/bundled/smarkets/index.js.map +1 -0
  1302. package/dist/skills/bundled/strategy/index.d.ts +18 -0
  1303. package/dist/skills/bundled/strategy/index.js +168 -0
  1304. package/dist/skills/bundled/strategy/index.js.map +1 -0
  1305. package/dist/skills/bundled/streaming/index.d.ts +19 -0
  1306. package/dist/skills/bundled/streaming/index.js +147 -0
  1307. package/dist/skills/bundled/streaming/index.js.map +1 -0
  1308. package/dist/skills/bundled/tailscale/index.d.ts +18 -0
  1309. package/dist/skills/bundled/tailscale/index.js +173 -0
  1310. package/dist/skills/bundled/tailscale/index.js.map +1 -0
  1311. package/dist/skills/bundled/ticks/index.d.ts +17 -0
  1312. package/dist/skills/bundled/ticks/index.js +287 -0
  1313. package/dist/skills/bundled/ticks/index.js.map +1 -0
  1314. package/dist/skills/bundled/token-security/index.d.ts +19 -0
  1315. package/dist/skills/bundled/token-security/index.js +138 -0
  1316. package/dist/skills/bundled/token-security/index.js.map +1 -0
  1317. package/dist/skills/bundled/trading-evm/index.d.ts +19 -0
  1318. package/dist/skills/bundled/trading-evm/index.js +302 -0
  1319. package/dist/skills/bundled/trading-evm/index.js.map +1 -0
  1320. package/dist/skills/bundled/trading-futures/index.d.ts +14 -0
  1321. package/dist/skills/bundled/trading-futures/index.js +874 -0
  1322. package/dist/skills/bundled/trading-futures/index.js.map +1 -0
  1323. package/dist/skills/bundled/trading-kalshi/index.d.ts +36 -0
  1324. package/dist/skills/bundled/trading-kalshi/index.js +1199 -0
  1325. package/dist/skills/bundled/trading-kalshi/index.js.map +1 -0
  1326. package/dist/skills/bundled/trading-manifold/index.d.ts +23 -0
  1327. package/dist/skills/bundled/trading-manifold/index.js +391 -0
  1328. package/dist/skills/bundled/trading-manifold/index.js.map +1 -0
  1329. package/dist/skills/bundled/trading-polymarket/index.d.ts +27 -0
  1330. package/dist/skills/bundled/trading-polymarket/index.js +1321 -0
  1331. package/dist/skills/bundled/trading-polymarket/index.js.map +1 -0
  1332. package/dist/skills/bundled/trading-solana/index.d.ts +19 -0
  1333. package/dist/skills/bundled/trading-solana/index.js +383 -0
  1334. package/dist/skills/bundled/trading-solana/index.js.map +1 -0
  1335. package/dist/skills/bundled/trading-system/index.d.ts +22 -0
  1336. package/dist/skills/bundled/trading-system/index.js +355 -0
  1337. package/dist/skills/bundled/trading-system/index.js.map +1 -0
  1338. package/dist/skills/bundled/triggers/index.d.ts +18 -0
  1339. package/dist/skills/bundled/triggers/index.js +172 -0
  1340. package/dist/skills/bundled/triggers/index.js.map +1 -0
  1341. package/dist/skills/bundled/tts/index.d.ts +16 -0
  1342. package/dist/skills/bundled/tts/index.js +150 -0
  1343. package/dist/skills/bundled/tts/index.js.map +1 -0
  1344. package/dist/skills/bundled/tweet-ideas/index.d.ts +20 -0
  1345. package/dist/skills/bundled/tweet-ideas/index.js +470 -0
  1346. package/dist/skills/bundled/tweet-ideas/index.js.map +1 -0
  1347. package/dist/skills/bundled/usage/index.d.ts +17 -0
  1348. package/dist/skills/bundled/usage/index.js +145 -0
  1349. package/dist/skills/bundled/usage/index.js.map +1 -0
  1350. package/dist/skills/bundled/veil/index.d.ts +79 -0
  1351. package/dist/skills/bundled/veil/index.js +322 -0
  1352. package/dist/skills/bundled/veil/index.js.map +1 -0
  1353. package/dist/skills/bundled/verify/index.d.ts +20 -0
  1354. package/dist/skills/bundled/verify/index.js +157 -0
  1355. package/dist/skills/bundled/verify/index.js.map +1 -0
  1356. package/dist/skills/bundled/virtuals/index.d.ts +20 -0
  1357. package/dist/skills/bundled/virtuals/index.js +255 -0
  1358. package/dist/skills/bundled/virtuals/index.js.map +1 -0
  1359. package/dist/skills/bundled/voice/index.d.ts +18 -0
  1360. package/dist/skills/bundled/voice/index.js +190 -0
  1361. package/dist/skills/bundled/voice/index.js.map +1 -0
  1362. package/dist/skills/bundled/weather/index.d.ts +20 -0
  1363. package/dist/skills/bundled/weather/index.js +475 -0
  1364. package/dist/skills/bundled/weather/index.js.map +1 -0
  1365. package/dist/skills/bundled/webhooks/index.d.ts +18 -0
  1366. package/dist/skills/bundled/webhooks/index.js +136 -0
  1367. package/dist/skills/bundled/webhooks/index.js.map +1 -0
  1368. package/dist/skills/bundled/whale-tracking/index.d.ts +18 -0
  1369. package/dist/skills/bundled/whale-tracking/index.js +441 -0
  1370. package/dist/skills/bundled/whale-tracking/index.js.map +1 -0
  1371. package/dist/skills/bundled/yoink/index.d.ts +78 -0
  1372. package/dist/skills/bundled/yoink/index.js +236 -0
  1373. package/dist/skills/bundled/yoink/index.js.map +1 -0
  1374. package/dist/skills/executor.d.ts +117 -0
  1375. package/dist/skills/executor.js +469 -0
  1376. package/dist/skills/executor.js.map +1 -0
  1377. package/dist/skills/frontmatter.d.ts +69 -0
  1378. package/dist/skills/frontmatter.js +187 -0
  1379. package/dist/skills/frontmatter.js.map +1 -0
  1380. package/dist/skills/index.d.ts +150 -0
  1381. package/dist/skills/index.js +531 -0
  1382. package/dist/skills/index.js.map +1 -0
  1383. package/dist/skills/loader.d.ts +48 -0
  1384. package/dist/skills/loader.js +594 -0
  1385. package/dist/skills/loader.js.map +1 -0
  1386. package/dist/skills/registry.d.ts +94 -0
  1387. package/dist/skills/registry.js +308 -0
  1388. package/dist/skills/registry.js.map +1 -0
  1389. package/dist/solana/copytrade.d.ts +116 -0
  1390. package/dist/solana/copytrade.js +493 -0
  1391. package/dist/solana/copytrade.js.map +1 -0
  1392. package/dist/solana/drift.d.ts +154 -0
  1393. package/dist/solana/drift.js +599 -0
  1394. package/dist/solana/drift.js.map +1 -0
  1395. package/dist/solana/jupiter.d.ts +283 -0
  1396. package/dist/solana/jupiter.js +553 -0
  1397. package/dist/solana/jupiter.js.map +1 -0
  1398. package/dist/solana/kamino.d.ts +206 -0
  1399. package/dist/solana/kamino.js +546 -0
  1400. package/dist/solana/kamino.js.map +1 -0
  1401. package/dist/solana/meteora-dbc.d.ts +430 -0
  1402. package/dist/solana/meteora-dbc.js +1105 -0
  1403. package/dist/solana/meteora-dbc.js.map +1 -0
  1404. package/dist/solana/meteora.d.ts +232 -0
  1405. package/dist/solana/meteora.js +682 -0
  1406. package/dist/solana/meteora.js.map +1 -0
  1407. package/dist/solana/orca.d.ts +163 -0
  1408. package/dist/solana/orca.js +378 -0
  1409. package/dist/solana/orca.js.map +1 -0
  1410. package/dist/solana/pools.d.ts +26 -0
  1411. package/dist/solana/pools.js +96 -0
  1412. package/dist/solana/pools.js.map +1 -0
  1413. package/dist/solana/pump-swarm.d.ts +349 -0
  1414. package/dist/solana/pump-swarm.js +1663 -0
  1415. package/dist/solana/pump-swarm.js.map +1 -0
  1416. package/dist/solana/pumpapi.d.ts +196 -0
  1417. package/dist/solana/pumpapi.js +462 -0
  1418. package/dist/solana/pumpapi.js.map +1 -0
  1419. package/dist/solana/raydium.d.ts +170 -0
  1420. package/dist/solana/raydium.js +673 -0
  1421. package/dist/solana/raydium.js.map +1 -0
  1422. package/dist/solana/swarm-ai-builder.d.ts +97 -0
  1423. package/dist/solana/swarm-ai-builder.js +571 -0
  1424. package/dist/solana/swarm-ai-builder.js.map +1 -0
  1425. package/dist/solana/swarm-arbitrage.d.ts +111 -0
  1426. package/dist/solana/swarm-arbitrage.js +437 -0
  1427. package/dist/solana/swarm-arbitrage.js.map +1 -0
  1428. package/dist/solana/swarm-builders.d.ts +71 -0
  1429. package/dist/solana/swarm-builders.js +402 -0
  1430. package/dist/solana/swarm-builders.js.map +1 -0
  1431. package/dist/solana/swarm-copytrade.d.ts +103 -0
  1432. package/dist/solana/swarm-copytrade.js +420 -0
  1433. package/dist/solana/swarm-copytrade.js.map +1 -0
  1434. package/dist/solana/swarm-presets.d.ts +49 -0
  1435. package/dist/solana/swarm-presets.js +282 -0
  1436. package/dist/solana/swarm-presets.js.map +1 -0
  1437. package/dist/solana/swarm-signals.d.ts +128 -0
  1438. package/dist/solana/swarm-signals.js +529 -0
  1439. package/dist/solana/swarm-signals.js.map +1 -0
  1440. package/dist/solana/swarm-strategies.d.ts +230 -0
  1441. package/dist/solana/swarm-strategies.js +611 -0
  1442. package/dist/solana/swarm-strategies.js.map +1 -0
  1443. package/dist/solana/tokenlist.d.ts +10 -0
  1444. package/dist/solana/tokenlist.js +54 -0
  1445. package/dist/solana/tokenlist.js.map +1 -0
  1446. package/dist/solana/wallet.d.ts +12 -0
  1447. package/dist/solana/wallet.js +90 -0
  1448. package/dist/solana/wallet.js.map +1 -0
  1449. package/dist/strategies/crypto-hft/index.d.ts +46 -0
  1450. package/dist/strategies/crypto-hft/index.js +469 -0
  1451. package/dist/strategies/crypto-hft/index.js.map +1 -0
  1452. package/dist/strategies/crypto-hft/market-scanner.d.ts +26 -0
  1453. package/dist/strategies/crypto-hft/market-scanner.js +177 -0
  1454. package/dist/strategies/crypto-hft/market-scanner.js.map +1 -0
  1455. package/dist/strategies/crypto-hft/orderbook.d.ts +37 -0
  1456. package/dist/strategies/crypto-hft/orderbook.js +184 -0
  1457. package/dist/strategies/crypto-hft/orderbook.js.map +1 -0
  1458. package/dist/strategies/crypto-hft/positions.d.ts +49 -0
  1459. package/dist/strategies/crypto-hft/positions.js +376 -0
  1460. package/dist/strategies/crypto-hft/positions.js.map +1 -0
  1461. package/dist/strategies/crypto-hft/presets.d.ts +11 -0
  1462. package/dist/strategies/crypto-hft/presets.js +164 -0
  1463. package/dist/strategies/crypto-hft/presets.js.map +1 -0
  1464. package/dist/strategies/crypto-hft/strategies.d.ts +96 -0
  1465. package/dist/strategies/crypto-hft/strategies.js +330 -0
  1466. package/dist/strategies/crypto-hft/strategies.js.map +1 -0
  1467. package/dist/strategies/crypto-hft/types.d.ts +196 -0
  1468. package/dist/strategies/crypto-hft/types.js +32 -0
  1469. package/dist/strategies/crypto-hft/types.js.map +1 -0
  1470. package/dist/strategies/hft-divergence/detector.d.ts +29 -0
  1471. package/dist/strategies/hft-divergence/detector.js +182 -0
  1472. package/dist/strategies/hft-divergence/detector.js.map +1 -0
  1473. package/dist/strategies/hft-divergence/index.d.ts +12 -0
  1474. package/dist/strategies/hft-divergence/index.js +19 -0
  1475. package/dist/strategies/hft-divergence/index.js.map +1 -0
  1476. package/dist/strategies/hft-divergence/market-rotator.d.ts +17 -0
  1477. package/dist/strategies/hft-divergence/market-rotator.js +128 -0
  1478. package/dist/strategies/hft-divergence/market-rotator.js.map +1 -0
  1479. package/dist/strategies/hft-divergence/position-manager.d.ts +35 -0
  1480. package/dist/strategies/hft-divergence/position-manager.js +188 -0
  1481. package/dist/strategies/hft-divergence/position-manager.js.map +1 -0
  1482. package/dist/strategies/hft-divergence/strategy.d.ts +31 -0
  1483. package/dist/strategies/hft-divergence/strategy.js +295 -0
  1484. package/dist/strategies/hft-divergence/strategy.js.map +1 -0
  1485. package/dist/strategies/hft-divergence/types.d.ts +114 -0
  1486. package/dist/strategies/hft-divergence/types.js +10 -0
  1487. package/dist/strategies/hft-divergence/types.js.map +1 -0
  1488. package/dist/streaming/index.d.ts +70 -0
  1489. package/dist/streaming/index.js +296 -0
  1490. package/dist/streaming/index.js.map +1 -0
  1491. package/dist/tailscale/index.d.ts +139 -0
  1492. package/dist/tailscale/index.js +345 -0
  1493. package/dist/tailscale/index.js.map +1 -0
  1494. package/dist/telemetry/index.d.ts +143 -0
  1495. package/dist/telemetry/index.js +535 -0
  1496. package/dist/telemetry/index.js.map +1 -0
  1497. package/dist/terminal/index.d.ts +121 -0
  1498. package/dist/terminal/index.js +548 -0
  1499. package/dist/terminal/index.js.map +1 -0
  1500. package/dist/token-security/index.d.ts +36 -0
  1501. package/dist/token-security/index.js +253 -0
  1502. package/dist/token-security/index.js.map +1 -0
  1503. package/dist/tools/browser.d.ts +128 -0
  1504. package/dist/tools/browser.js +459 -0
  1505. package/dist/tools/browser.js.map +1 -0
  1506. package/dist/tools/canvas.d.ts +93 -0
  1507. package/dist/tools/canvas.js +349 -0
  1508. package/dist/tools/canvas.js.map +1 -0
  1509. package/dist/tools/docker.d.ts +59 -0
  1510. package/dist/tools/docker.js +191 -0
  1511. package/dist/tools/docker.js.map +1 -0
  1512. package/dist/tools/email.d.ts +25 -0
  1513. package/dist/tools/email.js +131 -0
  1514. package/dist/tools/email.js.map +1 -0
  1515. package/dist/tools/exec.d.ts +81 -0
  1516. package/dist/tools/exec.js +373 -0
  1517. package/dist/tools/exec.js.map +1 -0
  1518. package/dist/tools/files.d.ts +46 -0
  1519. package/dist/tools/files.js +185 -0
  1520. package/dist/tools/files.js.map +1 -0
  1521. package/dist/tools/git.d.ts +29 -0
  1522. package/dist/tools/git.js +105 -0
  1523. package/dist/tools/git.js.map +1 -0
  1524. package/dist/tools/image.d.ts +57 -0
  1525. package/dist/tools/image.js +308 -0
  1526. package/dist/tools/image.js.map +1 -0
  1527. package/dist/tools/index.d.ts +39 -0
  1528. package/dist/tools/index.js +46 -0
  1529. package/dist/tools/index.js.map +1 -0
  1530. package/dist/tools/message.d.ts +99 -0
  1531. package/dist/tools/message.js +200 -0
  1532. package/dist/tools/message.js.map +1 -0
  1533. package/dist/tools/nodes.d.ts +134 -0
  1534. package/dist/tools/nodes.js +357 -0
  1535. package/dist/tools/nodes.js.map +1 -0
  1536. package/dist/tools/sessions.d.ts +60 -0
  1537. package/dist/tools/sessions.js +119 -0
  1538. package/dist/tools/sessions.js.map +1 -0
  1539. package/dist/tools/shell-history.d.ts +17 -0
  1540. package/dist/tools/shell-history.js +118 -0
  1541. package/dist/tools/shell-history.js.map +1 -0
  1542. package/dist/tools/sms.d.ts +18 -0
  1543. package/dist/tools/sms.js +66 -0
  1544. package/dist/tools/sms.js.map +1 -0
  1545. package/dist/tools/sql.d.ts +19 -0
  1546. package/dist/tools/sql.js +91 -0
  1547. package/dist/tools/sql.js.map +1 -0
  1548. package/dist/tools/transcription.d.ts +13 -0
  1549. package/dist/tools/transcription.js +99 -0
  1550. package/dist/tools/transcription.js.map +1 -0
  1551. package/dist/tools/web-fetch.d.ts +69 -0
  1552. package/dist/tools/web-fetch.js +251 -0
  1553. package/dist/tools/web-fetch.js.map +1 -0
  1554. package/dist/tools/web-search.d.ts +58 -0
  1555. package/dist/tools/web-search.js +204 -0
  1556. package/dist/tools/web-search.js.map +1 -0
  1557. package/dist/tools/webhooks.d.ts +74 -0
  1558. package/dist/tools/webhooks.js +165 -0
  1559. package/dist/tools/webhooks.js.map +1 -0
  1560. package/dist/trading/accounts.d.ts +167 -0
  1561. package/dist/trading/accounts.js +394 -0
  1562. package/dist/trading/accounts.js.map +1 -0
  1563. package/dist/trading/adapters/index.d.ts +27 -0
  1564. package/dist/trading/adapters/index.js +165 -0
  1565. package/dist/trading/adapters/index.js.map +1 -0
  1566. package/dist/trading/backtest.d.ts +161 -0
  1567. package/dist/trading/backtest.js +665 -0
  1568. package/dist/trading/backtest.js.map +1 -0
  1569. package/dist/trading/bots/index.d.ts +196 -0
  1570. package/dist/trading/bots/index.js +688 -0
  1571. package/dist/trading/bots/index.js.map +1 -0
  1572. package/dist/trading/bridge.d.ts +33 -0
  1573. package/dist/trading/bridge.js +121 -0
  1574. package/dist/trading/bridge.js.map +1 -0
  1575. package/dist/trading/builder.d.ts +102 -0
  1576. package/dist/trading/builder.js +430 -0
  1577. package/dist/trading/builder.js.map +1 -0
  1578. package/dist/trading/copy-trading.d.ts +125 -0
  1579. package/dist/trading/copy-trading.js +611 -0
  1580. package/dist/trading/copy-trading.js.map +1 -0
  1581. package/dist/trading/devtools.d.ts +172 -0
  1582. package/dist/trading/devtools.js +425 -0
  1583. package/dist/trading/devtools.js.map +1 -0
  1584. package/dist/trading/futures/index.d.ts +981 -0
  1585. package/dist/trading/futures/index.js +4011 -0
  1586. package/dist/trading/futures/index.js.map +1 -0
  1587. package/dist/trading/index.d.ts +102 -0
  1588. package/dist/trading/index.js +310 -0
  1589. package/dist/trading/index.js.map +1 -0
  1590. package/dist/trading/kelly.d.ts +137 -0
  1591. package/dist/trading/kelly.js +328 -0
  1592. package/dist/trading/kelly.js.map +1 -0
  1593. package/dist/trading/logger.d.ts +163 -0
  1594. package/dist/trading/logger.js +424 -0
  1595. package/dist/trading/logger.js.map +1 -0
  1596. package/dist/trading/market-making/engine.d.ts +44 -0
  1597. package/dist/trading/market-making/engine.js +165 -0
  1598. package/dist/trading/market-making/engine.js.map +1 -0
  1599. package/dist/trading/market-making/index.d.ts +10 -0
  1600. package/dist/trading/market-making/index.js +29 -0
  1601. package/dist/trading/market-making/index.js.map +1 -0
  1602. package/dist/trading/market-making/strategy.d.ts +25 -0
  1603. package/dist/trading/market-making/strategy.js +250 -0
  1604. package/dist/trading/market-making/strategy.js.map +1 -0
  1605. package/dist/trading/market-making/types.d.ts +92 -0
  1606. package/dist/trading/market-making/types.js +6 -0
  1607. package/dist/trading/market-making/types.js.map +1 -0
  1608. package/dist/trading/ml-signals.d.ts +175 -0
  1609. package/dist/trading/ml-signals.js +548 -0
  1610. package/dist/trading/ml-signals.js.map +1 -0
  1611. package/dist/trading/orchestrator.d.ts +59 -0
  1612. package/dist/trading/orchestrator.js +199 -0
  1613. package/dist/trading/orchestrator.js.map +1 -0
  1614. package/dist/trading/position-bridge.d.ts +41 -0
  1615. package/dist/trading/position-bridge.js +178 -0
  1616. package/dist/trading/position-bridge.js.map +1 -0
  1617. package/dist/trading/resilience.d.ts +81 -0
  1618. package/dist/trading/resilience.js +257 -0
  1619. package/dist/trading/resilience.js.map +1 -0
  1620. package/dist/trading/risk.d.ts +18 -0
  1621. package/dist/trading/risk.js +91 -0
  1622. package/dist/trading/risk.js.map +1 -0
  1623. package/dist/trading/safety.d.ts +114 -0
  1624. package/dist/trading/safety.js +372 -0
  1625. package/dist/trading/safety.js.map +1 -0
  1626. package/dist/trading/secrets.d.ts +48 -0
  1627. package/dist/trading/secrets.js +243 -0
  1628. package/dist/trading/secrets.js.map +1 -0
  1629. package/dist/trading/state.d.ts +88 -0
  1630. package/dist/trading/state.js +221 -0
  1631. package/dist/trading/state.js.map +1 -0
  1632. package/dist/trading/stream.d.ts +121 -0
  1633. package/dist/trading/stream.js +396 -0
  1634. package/dist/trading/stream.js.map +1 -0
  1635. package/dist/trading/tracking.d.ts +136 -0
  1636. package/dist/trading/tracking.js +512 -0
  1637. package/dist/trading/tracking.js.map +1 -0
  1638. package/dist/tts/index.d.ts +28 -0
  1639. package/dist/tts/index.js +64 -0
  1640. package/dist/tts/index.js.map +1 -0
  1641. package/dist/tui/index.d.ts +159 -0
  1642. package/dist/tui/index.js +580 -0
  1643. package/dist/tui/index.js.map +1 -0
  1644. package/dist/types.d.ts +1373 -0
  1645. package/dist/types.js +7 -0
  1646. package/dist/types.js.map +1 -0
  1647. package/dist/usage/index.d.ts +57 -0
  1648. package/dist/usage/index.js +191 -0
  1649. package/dist/usage/index.js.map +1 -0
  1650. package/dist/utils/attachments.d.ts +12 -0
  1651. package/dist/utils/attachments.js +104 -0
  1652. package/dist/utils/attachments.js.map +1 -0
  1653. package/dist/utils/config.d.ts +14 -0
  1654. package/dist/utils/config.js +474 -0
  1655. package/dist/utils/config.js.map +1 -0
  1656. package/dist/utils/http.d.ts +22 -0
  1657. package/dist/utils/http.js +191 -0
  1658. package/dist/utils/http.js.map +1 -0
  1659. package/dist/utils/id.d.ts +21 -0
  1660. package/dist/utils/id.js +41 -0
  1661. package/dist/utils/id.js.map +1 -0
  1662. package/dist/utils/json-utils.d.ts +201 -0
  1663. package/dist/utils/json-utils.js +151 -0
  1664. package/dist/utils/json-utils.js.map +1 -0
  1665. package/dist/utils/kalshi-auth.d.ts +10 -0
  1666. package/dist/utils/kalshi-auth.js +48 -0
  1667. package/dist/utils/kalshi-auth.js.map +1 -0
  1668. package/dist/utils/kelly.d.ts +153 -0
  1669. package/dist/utils/kelly.js +322 -0
  1670. package/dist/utils/kelly.js.map +1 -0
  1671. package/dist/utils/logger.d.ts +7 -0
  1672. package/dist/utils/logger.js +26 -0
  1673. package/dist/utils/logger.js.map +1 -0
  1674. package/dist/utils/opinion-auth.d.ts +17 -0
  1675. package/dist/utils/opinion-auth.js +25 -0
  1676. package/dist/utils/opinion-auth.js.map +1 -0
  1677. package/dist/utils/polymarket-auth.d.ts +11 -0
  1678. package/dist/utils/polymarket-auth.js +32 -0
  1679. package/dist/utils/polymarket-auth.js.map +1 -0
  1680. package/dist/utils/polymarket-order-signer.d.ts +118 -0
  1681. package/dist/utils/polymarket-order-signer.js +329 -0
  1682. package/dist/utils/polymarket-order-signer.js.map +1 -0
  1683. package/dist/utils/polymarket-setup.d.ts +70 -0
  1684. package/dist/utils/polymarket-setup.js +288 -0
  1685. package/dist/utils/polymarket-setup.js.map +1 -0
  1686. package/dist/utils/production.d.ts +112 -0
  1687. package/dist/utils/production.js +294 -0
  1688. package/dist/utils/production.js.map +1 -0
  1689. package/dist/utils/rate-limiter.d.ts +77 -0
  1690. package/dist/utils/rate-limiter.js +271 -0
  1691. package/dist/utils/rate-limiter.js.map +1 -0
  1692. package/dist/utils/webhook-security.d.ts +63 -0
  1693. package/dist/utils/webhook-security.js +183 -0
  1694. package/dist/utils/webhook-security.js.map +1 -0
  1695. package/dist/voice/index.d.ts +125 -0
  1696. package/dist/voice/index.js +557 -0
  1697. package/dist/voice/index.js.map +1 -0
  1698. package/dist/weather/edge.d.ts +70 -0
  1699. package/dist/weather/edge.js +281 -0
  1700. package/dist/weather/edge.js.map +1 -0
  1701. package/dist/weather/index.d.ts +6 -0
  1702. package/dist/weather/index.js +23 -0
  1703. package/dist/weather/index.js.map +1 -0
  1704. package/dist/weather/markets.d.ts +84 -0
  1705. package/dist/weather/markets.js +320 -0
  1706. package/dist/weather/markets.js.map +1 -0
  1707. package/dist/weather/noaa.d.ts +113 -0
  1708. package/dist/weather/noaa.js +287 -0
  1709. package/dist/weather/noaa.js.map +1 -0
  1710. package/dist/web/index.d.ts +112 -0
  1711. package/dist/web/index.js +639 -0
  1712. package/dist/web/index.js.map +1 -0
  1713. package/dist/wizard/index.d.ts +27 -0
  1714. package/dist/wizard/index.js +186 -0
  1715. package/dist/wizard/index.js.map +1 -0
  1716. package/dist/workspace/index.d.ts +73 -0
  1717. package/dist/workspace/index.js +403 -0
  1718. package/dist/workspace/index.js.map +1 -0
  1719. package/package.json +168 -0
@@ -0,0 +1,1663 @@
1
+ "use strict";
2
+ /**
3
+ * Pump.fun Swarm Trading System
4
+ *
5
+ * Coordinates up to 20 wallets to execute trades simultaneously on Pump.fun tokens.
6
+ *
7
+ * Execution modes:
8
+ * - Parallel: All wallets execute simultaneously (fastest, default for >5 wallets)
9
+ * - Jito Bundle: Atomic execution for up to 5 wallets per bundle
10
+ * - Multi-Bundle: Multiple Jito bundles in parallel for >5 wallets
11
+ * - Sequential: Staggered execution with delays (for stealth)
12
+ */
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.PumpFunSwarm = void 0;
18
+ exports.loadWalletsFromEnv = loadWalletsFromEnv;
19
+ exports.getSwarm = getSwarm;
20
+ exports.createSwarm = createSwarm;
21
+ exports.resetSwarm = resetSwarm;
22
+ const web3_js_1 = require("@solana/web3.js");
23
+ const events_1 = require("events");
24
+ const bs58_1 = __importDefault(require("bs58"));
25
+ // ============================================================================
26
+ // Builder Imports
27
+ // ============================================================================
28
+ const swarm_builders_1 = require("./swarm-builders");
29
+ // ============================================================================
30
+ // Constants
31
+ // ============================================================================
32
+ const PUMPFUN_FRONTEND_API = 'https://frontend-api-v3.pump.fun';
33
+ const JITO_BLOCK_ENGINE = 'https://mainnet.block-engine.jito.wtf';
34
+ const JITO_TIP_ACCOUNTS = [
35
+ '96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5',
36
+ 'HFqU5x63VTqvQss8hp11i4bVmkdzeF3DY3kfvJf3hXba',
37
+ 'Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY',
38
+ 'ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49',
39
+ 'DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh',
40
+ 'ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt',
41
+ 'DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL',
42
+ '3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT',
43
+ ];
44
+ const MAX_BUNDLE_SIZE = 5; // Jito limit
45
+ const MAX_WALLETS = 20;
46
+ // ============================================================================
47
+ // Wallet Pool Management
48
+ // ============================================================================
49
+ function loadWalletsFromEnv() {
50
+ const wallets = [];
51
+ // Load SOLANA_PRIVATE_KEY as wallet 0
52
+ const mainKey = process.env.SOLANA_PRIVATE_KEY;
53
+ if (mainKey) {
54
+ try {
55
+ const keypair = loadKeypairFromString(mainKey);
56
+ wallets.push(createWallet('wallet_0', keypair));
57
+ }
58
+ catch (e) {
59
+ console.error('Failed to load SOLANA_PRIVATE_KEY:', e);
60
+ }
61
+ }
62
+ // Load SOLANA_SWARM_KEY_1 through SOLANA_SWARM_KEY_20
63
+ for (let i = 1; i <= MAX_WALLETS; i++) {
64
+ const key = process.env[`SOLANA_SWARM_KEY_${i}`];
65
+ if (!key)
66
+ continue;
67
+ try {
68
+ const keypair = loadKeypairFromString(key);
69
+ wallets.push(createWallet(`wallet_${i}`, keypair));
70
+ }
71
+ catch (e) {
72
+ console.error(`Failed to load SOLANA_SWARM_KEY_${i}:`, e);
73
+ }
74
+ }
75
+ return wallets;
76
+ }
77
+ function createWallet(id, keypair) {
78
+ return {
79
+ id,
80
+ keypair,
81
+ publicKey: keypair.publicKey.toBase58(),
82
+ solBalance: 0,
83
+ positions: new Map(),
84
+ lastTradeAt: 0,
85
+ enabled: true,
86
+ };
87
+ }
88
+ function loadKeypairFromString(keyStr) {
89
+ // Try base58
90
+ try {
91
+ const decoded = bs58_1.default.decode(keyStr);
92
+ if (decoded.length === 64)
93
+ return web3_js_1.Keypair.fromSecretKey(decoded);
94
+ }
95
+ catch { }
96
+ // Try JSON array
97
+ try {
98
+ const arr = JSON.parse(keyStr);
99
+ if (Array.isArray(arr))
100
+ return web3_js_1.Keypair.fromSecretKey(Uint8Array.from(arr));
101
+ }
102
+ catch { }
103
+ // Try hex
104
+ try {
105
+ const hex = keyStr.replace(/^0x/, '');
106
+ const bytes = Buffer.from(hex, 'hex');
107
+ if (bytes.length === 64)
108
+ return web3_js_1.Keypair.fromSecretKey(bytes);
109
+ }
110
+ catch { }
111
+ throw new Error('Invalid key format');
112
+ }
113
+ // ============================================================================
114
+ // PumpFun Swarm Class
115
+ // ============================================================================
116
+ class PumpFunSwarm extends events_1.EventEmitter {
117
+ connection;
118
+ wallets;
119
+ config;
120
+ constructor(config = {}) {
121
+ super();
122
+ const rpcUrl = config.rpcUrl || process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com';
123
+ this.connection = new web3_js_1.Connection(rpcUrl, 'confirmed');
124
+ const loadedWallets = config.wallets || loadWalletsFromEnv();
125
+ this.wallets = new Map(loadedWallets.map(w => [w.id, w]));
126
+ this.config = {
127
+ rpcUrl,
128
+ wallets: loadedWallets,
129
+ maxWallets: config.maxWallets ?? MAX_WALLETS,
130
+ rateLimitMs: config.rateLimitMs ?? 5000,
131
+ bundleEnabled: config.bundleEnabled ?? true,
132
+ jitoTipLamports: config.jitoTipLamports ?? 10000,
133
+ defaultSlippageBps: config.defaultSlippageBps ?? 500,
134
+ staggerDelayMs: config.staggerDelayMs ?? 200,
135
+ amountVariancePct: config.amountVariancePct ?? 5,
136
+ minSolBalance: config.minSolBalance ?? 0.01,
137
+ confirmTimeoutMs: config.confirmTimeoutMs ?? 60000,
138
+ parallelBatches: config.parallelBatches ?? 4,
139
+ };
140
+ }
141
+ // --------------------------------------------------------------------------
142
+ // Public API - Wallet Management
143
+ // --------------------------------------------------------------------------
144
+ getWallets() {
145
+ return Array.from(this.wallets.values());
146
+ }
147
+ getWallet(id) {
148
+ return this.wallets.get(id);
149
+ }
150
+ getEnabledWallets() {
151
+ return this.getWallets().filter(w => w.enabled);
152
+ }
153
+ enableWallet(id) {
154
+ const wallet = this.wallets.get(id);
155
+ if (wallet)
156
+ wallet.enabled = true;
157
+ }
158
+ disableWallet(id) {
159
+ const wallet = this.wallets.get(id);
160
+ if (wallet)
161
+ wallet.enabled = false;
162
+ }
163
+ enableAll() {
164
+ for (const wallet of this.wallets.values()) {
165
+ wallet.enabled = true;
166
+ }
167
+ }
168
+ disableAll() {
169
+ for (const wallet of this.wallets.values()) {
170
+ wallet.enabled = false;
171
+ }
172
+ }
173
+ getWalletCount() {
174
+ const all = this.getWallets();
175
+ return {
176
+ total: all.length,
177
+ enabled: all.filter(w => w.enabled).length,
178
+ };
179
+ }
180
+ // --------------------------------------------------------------------------
181
+ // Public API - Balance & Position Fetching
182
+ // --------------------------------------------------------------------------
183
+ async refreshBalances() {
184
+ const balances = new Map();
185
+ const wallets = this.getWallets();
186
+ // Fetch all balances in parallel
187
+ const results = await Promise.allSettled(wallets.map(async (wallet) => {
188
+ const balance = await this.connection.getBalance(wallet.keypair.publicKey);
189
+ return { id: wallet.id, balance: balance / 1e9 };
190
+ }));
191
+ for (let i = 0; i < results.length; i++) {
192
+ const result = results[i];
193
+ const wallet = wallets[i];
194
+ if (result.status === 'fulfilled') {
195
+ wallet.solBalance = result.value.balance;
196
+ balances.set(wallet.id, result.value.balance);
197
+ }
198
+ else {
199
+ balances.set(wallet.id, wallet.solBalance);
200
+ }
201
+ }
202
+ return balances;
203
+ }
204
+ async refreshTokenPositions(mint) {
205
+ const mintPubkey = new web3_js_1.PublicKey(mint);
206
+ const byWallet = new Map();
207
+ let totalTokens = 0;
208
+ const wallets = this.getWallets();
209
+ // Fetch all token balances in parallel
210
+ const results = await Promise.allSettled(wallets.map(async (wallet) => {
211
+ const balance = await this.getTokenBalance(wallet.keypair.publicKey, mintPubkey);
212
+ return { id: wallet.id, balance };
213
+ }));
214
+ for (let i = 0; i < results.length; i++) {
215
+ const result = results[i];
216
+ const wallet = wallets[i];
217
+ if (result.status === 'fulfilled' && result.value.balance > 0) {
218
+ wallet.positions.set(mint, result.value.balance);
219
+ byWallet.set(wallet.id, result.value.balance);
220
+ totalTokens += result.value.balance;
221
+ }
222
+ else {
223
+ wallet.positions.delete(mint);
224
+ }
225
+ }
226
+ return { mint, totalTokens, byWallet, lastUpdated: Date.now() };
227
+ }
228
+ async getTokenBalance(owner, mint) {
229
+ const accounts = await this.connection.getTokenAccountsByOwner(owner, { mint });
230
+ if (accounts.value.length === 0)
231
+ return 0;
232
+ let total = 0;
233
+ for (const acc of accounts.value) {
234
+ const data = acc.account.data;
235
+ const amount = data.readBigUInt64LE(64);
236
+ total += Number(amount);
237
+ }
238
+ return total;
239
+ }
240
+ getSwarmPosition(mint) {
241
+ const byWallet = new Map();
242
+ let totalTokens = 0;
243
+ for (const wallet of this.wallets.values()) {
244
+ const amount = wallet.positions.get(mint) || 0;
245
+ if (amount > 0) {
246
+ byWallet.set(wallet.id, amount);
247
+ totalTokens += amount;
248
+ }
249
+ }
250
+ return { mint, totalTokens, byWallet, lastUpdated: Date.now() };
251
+ }
252
+ // --------------------------------------------------------------------------
253
+ // Coordinated Trading - Main Entry Points
254
+ // --------------------------------------------------------------------------
255
+ async coordinatedBuy(params) {
256
+ const startTime = Date.now();
257
+ const errors = [];
258
+ // Refresh balances first
259
+ await this.refreshBalances();
260
+ // Select and filter wallets
261
+ let wallets = this.selectWallets(params.walletIds);
262
+ const solNeeded = typeof params.amountPerWallet === 'number'
263
+ ? params.amountPerWallet
264
+ : parseFloat(params.amountPerWallet);
265
+ wallets = wallets.filter(w => {
266
+ if (w.solBalance < solNeeded + this.config.minSolBalance) {
267
+ errors.push(`${w.id}: insufficient SOL (${w.solBalance.toFixed(4)})`);
268
+ return false;
269
+ }
270
+ return true;
271
+ });
272
+ if (wallets.length === 0) {
273
+ return this.emptyResult(params, 'buy', startTime, errors, 'No wallets with sufficient balance');
274
+ }
275
+ const mode = this.selectExecutionMode(params, wallets.length);
276
+ return this.executeWithMode(mode, params, wallets, startTime, errors);
277
+ }
278
+ async coordinatedSell(params) {
279
+ const startTime = Date.now();
280
+ const errors = [];
281
+ // Fetch actual token positions from chain
282
+ await this.refreshTokenPositions(params.mint);
283
+ // Select wallets with positions
284
+ let wallets = this.selectWallets(params.walletIds);
285
+ wallets = wallets.filter(w => {
286
+ const pos = w.positions.get(params.mint) || 0;
287
+ if (pos <= 0) {
288
+ errors.push(`${w.id}: no position`);
289
+ return false;
290
+ }
291
+ return true;
292
+ });
293
+ if (wallets.length === 0) {
294
+ return this.emptyResult(params, 'sell', startTime, errors, 'No wallets with positions');
295
+ }
296
+ const mode = this.selectExecutionMode(params, wallets.length);
297
+ return this.executeWithMode(mode, params, wallets, startTime, errors);
298
+ }
299
+ // --------------------------------------------------------------------------
300
+ // Execution Mode Selection & Dispatch
301
+ // --------------------------------------------------------------------------
302
+ selectExecutionMode(params, walletCount) {
303
+ // User specified mode takes priority
304
+ if (params.executionMode)
305
+ return params.executionMode;
306
+ // Default logic:
307
+ // - 1 wallet: parallel (just one)
308
+ // - 2-5 wallets: bundle (atomic)
309
+ // - 6-20 wallets: multi-bundle (multiple atomic bundles in parallel)
310
+ // - If bundles disabled: parallel
311
+ if (!this.config.bundleEnabled)
312
+ return 'parallel';
313
+ if (walletCount <= 1)
314
+ return 'parallel';
315
+ if (walletCount <= MAX_BUNDLE_SIZE)
316
+ return 'bundle';
317
+ return 'multi-bundle';
318
+ }
319
+ async executeWithMode(mode, params, wallets, startTime, errors) {
320
+ switch (mode) {
321
+ case 'bundle':
322
+ return this.executeSingleBundle(params, wallets, startTime, errors);
323
+ case 'multi-bundle':
324
+ return this.executeMultiBundles(params, wallets, startTime, errors);
325
+ case 'sequential':
326
+ return this.executeSequential(params, wallets, startTime, errors);
327
+ case 'parallel':
328
+ default:
329
+ return this.executeParallel(params, wallets, startTime, errors);
330
+ }
331
+ }
332
+ // --------------------------------------------------------------------------
333
+ // Execution Mode: PARALLEL (All at once, no bundles)
334
+ // --------------------------------------------------------------------------
335
+ async executeParallel(params, wallets, startTime, errors) {
336
+ // Build all transactions in parallel
337
+ const txPromises = wallets.map(async (wallet) => {
338
+ try {
339
+ const amount = this.calculateAmount(params.amountPerWallet, wallet, params.mint);
340
+ if (amount <= 0)
341
+ return { wallet, tx: null, amount, error: 'Amount is zero' };
342
+ const tx = await this.buildTransaction(wallet, params, amount);
343
+ return { wallet, tx, amount, error: null };
344
+ }
345
+ catch (e) {
346
+ return { wallet, tx: null, amount: 0, error: e instanceof Error ? e.message : String(e) };
347
+ }
348
+ });
349
+ const txResults = await Promise.all(txPromises);
350
+ // Sign all transactions
351
+ for (const result of txResults) {
352
+ if (result.tx) {
353
+ result.tx.sign([result.wallet.keypair]);
354
+ }
355
+ }
356
+ // Send all transactions in parallel
357
+ const sendPromises = txResults.map(async (result) => {
358
+ if (!result.tx) {
359
+ return {
360
+ walletId: result.wallet.id,
361
+ publicKey: result.wallet.publicKey,
362
+ success: false,
363
+ error: result.error || 'No transaction',
364
+ };
365
+ }
366
+ try {
367
+ const signature = await this.connection.sendRawTransaction(result.tx.serialize(), {
368
+ skipPreflight: true,
369
+ maxRetries: 3,
370
+ });
371
+ return {
372
+ walletId: result.wallet.id,
373
+ publicKey: result.wallet.publicKey,
374
+ success: true,
375
+ signature,
376
+ solAmount: params.action === 'buy' ? result.amount : undefined,
377
+ tokenAmount: params.action === 'sell' ? result.amount : undefined,
378
+ };
379
+ }
380
+ catch (e) {
381
+ return {
382
+ walletId: result.wallet.id,
383
+ publicKey: result.wallet.publicKey,
384
+ success: false,
385
+ error: e instanceof Error ? e.message : String(e),
386
+ };
387
+ }
388
+ });
389
+ const walletResults = await Promise.all(sendPromises);
390
+ // Confirm all successful sends in parallel (don't wait for full confirmation to return)
391
+ this.confirmAllAsync(walletResults.filter(r => r.success && r.signature).map(r => r.signature));
392
+ // Schedule position refresh
393
+ setTimeout(() => this.refreshTokenPositions(params.mint), 5000);
394
+ return this.buildResult(params, walletResults, startTime, errors, 'parallel');
395
+ }
396
+ // --------------------------------------------------------------------------
397
+ // Execution Mode: SINGLE BUNDLE (Atomic, up to 5 wallets)
398
+ // --------------------------------------------------------------------------
399
+ async executeSingleBundle(params, wallets, startTime, errors) {
400
+ const { signedTxs, walletResults, tipWallet } = await this.buildAndSignTransactions(params, wallets, errors);
401
+ if (signedTxs.length === 0) {
402
+ return this.buildResult(params, walletResults, startTime, errors, 'bundle');
403
+ }
404
+ // Add tip transaction
405
+ try {
406
+ const tipTx = await this.buildTipTransaction(tipWallet);
407
+ tipTx.sign([tipWallet.keypair]);
408
+ signedTxs.push(tipTx);
409
+ }
410
+ catch (e) {
411
+ errors.push(`Tip failed: ${e instanceof Error ? e.message : String(e)}`);
412
+ }
413
+ // Submit bundle
414
+ try {
415
+ const bundleId = await this.submitJitoBundle(signedTxs);
416
+ // Mark all as successful
417
+ for (const result of walletResults) {
418
+ if (!result.error)
419
+ result.success = true;
420
+ }
421
+ setTimeout(() => this.refreshTokenPositions(params.mint), 5000);
422
+ return this.buildResult(params, walletResults, startTime, errors, 'bundle', [bundleId]);
423
+ }
424
+ catch (e) {
425
+ errors.push(`Bundle failed: ${e instanceof Error ? e.message : String(e)}`);
426
+ // Fallback to parallel
427
+ return this.executeParallel(params, wallets, startTime, errors);
428
+ }
429
+ }
430
+ // --------------------------------------------------------------------------
431
+ // Execution Mode: MULTI-BUNDLE (Multiple bundles in parallel for >5 wallets)
432
+ // --------------------------------------------------------------------------
433
+ async executeMultiBundles(params, wallets, startTime, errors) {
434
+ // Split wallets into chunks of MAX_BUNDLE_SIZE
435
+ const chunks = this.chunkArray(wallets, MAX_BUNDLE_SIZE);
436
+ const bundleIds = [];
437
+ const allWalletResults = [];
438
+ // Execute all bundles in parallel
439
+ const bundlePromises = chunks.map(async (chunk, index) => {
440
+ const chunkErrors = [];
441
+ const { signedTxs, walletResults, tipWallet } = await this.buildAndSignTransactions(params, chunk, chunkErrors);
442
+ if (signedTxs.length === 0) {
443
+ return { walletResults, bundleId: null, errors: chunkErrors };
444
+ }
445
+ // Add tip transaction
446
+ try {
447
+ const tipTx = await this.buildTipTransaction(tipWallet);
448
+ tipTx.sign([tipWallet.keypair]);
449
+ signedTxs.push(tipTx);
450
+ }
451
+ catch (e) {
452
+ chunkErrors.push(`Chunk ${index} tip failed`);
453
+ }
454
+ // Submit bundle
455
+ try {
456
+ const bundleId = await this.submitJitoBundle(signedTxs);
457
+ for (const result of walletResults) {
458
+ if (!result.error)
459
+ result.success = true;
460
+ }
461
+ return { walletResults, bundleId, errors: chunkErrors };
462
+ }
463
+ catch (e) {
464
+ chunkErrors.push(`Chunk ${index} bundle failed: ${e instanceof Error ? e.message : String(e)}`);
465
+ // Try parallel for this chunk
466
+ const parallelResults = await this.executeParallelForChunk(params, chunk);
467
+ return { walletResults: parallelResults, bundleId: null, errors: chunkErrors };
468
+ }
469
+ });
470
+ const results = await Promise.all(bundlePromises);
471
+ for (const result of results) {
472
+ allWalletResults.push(...result.walletResults);
473
+ if (result.bundleId)
474
+ bundleIds.push(result.bundleId);
475
+ errors.push(...result.errors);
476
+ }
477
+ setTimeout(() => this.refreshTokenPositions(params.mint), 5000);
478
+ return this.buildResult(params, allWalletResults, startTime, errors, 'multi-bundle', bundleIds);
479
+ }
480
+ async executeParallelForChunk(params, wallets) {
481
+ const results = [];
482
+ const promises = wallets.map(async (wallet) => {
483
+ try {
484
+ const amount = this.calculateAmount(params.amountPerWallet, wallet, params.mint);
485
+ if (amount <= 0) {
486
+ return { walletId: wallet.id, publicKey: wallet.publicKey, success: false, error: 'Zero amount' };
487
+ }
488
+ const tx = await this.buildTransaction(wallet, params, amount);
489
+ if (!tx) {
490
+ return { walletId: wallet.id, publicKey: wallet.publicKey, success: false, error: 'Build failed' };
491
+ }
492
+ tx.sign([wallet.keypair]);
493
+ const signature = await this.connection.sendRawTransaction(tx.serialize(), {
494
+ skipPreflight: true,
495
+ maxRetries: 3,
496
+ });
497
+ return {
498
+ walletId: wallet.id,
499
+ publicKey: wallet.publicKey,
500
+ success: true,
501
+ signature,
502
+ solAmount: params.action === 'buy' ? amount : undefined,
503
+ tokenAmount: params.action === 'sell' ? amount : undefined,
504
+ };
505
+ }
506
+ catch (e) {
507
+ return {
508
+ walletId: wallet.id,
509
+ publicKey: wallet.publicKey,
510
+ success: false,
511
+ error: e instanceof Error ? e.message : String(e),
512
+ };
513
+ }
514
+ });
515
+ return Promise.all(promises);
516
+ }
517
+ // --------------------------------------------------------------------------
518
+ // Execution Mode: SEQUENTIAL (Staggered, for stealth)
519
+ // --------------------------------------------------------------------------
520
+ async executeSequential(params, wallets, startTime, errors) {
521
+ const walletResults = [];
522
+ for (let i = 0; i < wallets.length; i++) {
523
+ const wallet = wallets[i];
524
+ // Rate limiting
525
+ const timeSinceLastTrade = Date.now() - wallet.lastTradeAt;
526
+ if (timeSinceLastTrade < this.config.rateLimitMs) {
527
+ await sleep(this.config.rateLimitMs - timeSinceLastTrade);
528
+ }
529
+ // Stagger delay
530
+ if (i > 0) {
531
+ const delay = this.config.staggerDelayMs + Math.random() * this.config.staggerDelayMs;
532
+ await sleep(delay);
533
+ }
534
+ try {
535
+ const amount = this.calculateAmount(params.amountPerWallet, wallet, params.mint);
536
+ if (amount <= 0) {
537
+ walletResults.push({ walletId: wallet.id, publicKey: wallet.publicKey, success: false, error: 'Zero amount' });
538
+ continue;
539
+ }
540
+ const result = await this.executeSingleTrade(wallet, params, amount);
541
+ walletResults.push(result);
542
+ wallet.lastTradeAt = Date.now();
543
+ this.emit('trade', { wallet: wallet.id, ...result });
544
+ }
545
+ catch (e) {
546
+ errors.push(`${wallet.id}: ${e instanceof Error ? e.message : String(e)}`);
547
+ walletResults.push({
548
+ walletId: wallet.id,
549
+ publicKey: wallet.publicKey,
550
+ success: false,
551
+ error: e instanceof Error ? e.message : String(e),
552
+ });
553
+ }
554
+ }
555
+ setTimeout(() => this.refreshTokenPositions(params.mint), 5000);
556
+ return this.buildResult(params, walletResults, startTime, errors, 'sequential');
557
+ }
558
+ async executeSingleTrade(wallet, params, amount) {
559
+ const tx = await this.buildTransaction(wallet, params, amount);
560
+ if (!tx) {
561
+ return { walletId: wallet.id, publicKey: wallet.publicKey, success: false, error: 'Build failed' };
562
+ }
563
+ tx.sign([wallet.keypair]);
564
+ const signature = await this.connection.sendRawTransaction(tx.serialize(), {
565
+ skipPreflight: true,
566
+ maxRetries: 3,
567
+ });
568
+ try {
569
+ await this.confirmWithTimeout(signature, this.config.confirmTimeoutMs);
570
+ }
571
+ catch (e) {
572
+ return {
573
+ walletId: wallet.id,
574
+ publicKey: wallet.publicKey,
575
+ success: false,
576
+ signature,
577
+ error: `Confirm failed: ${e instanceof Error ? e.message : String(e)}`,
578
+ };
579
+ }
580
+ return {
581
+ walletId: wallet.id,
582
+ publicKey: wallet.publicKey,
583
+ success: true,
584
+ signature,
585
+ solAmount: params.action === 'buy' ? amount : undefined,
586
+ tokenAmount: params.action === 'sell' ? amount : undefined,
587
+ };
588
+ }
589
+ // --------------------------------------------------------------------------
590
+ // Transaction Building & Jito
591
+ // --------------------------------------------------------------------------
592
+ async buildAndSignTransactions(params, wallets, errors) {
593
+ const signedTxs = [];
594
+ const walletResults = [];
595
+ for (const wallet of wallets) {
596
+ try {
597
+ const amount = this.calculateAmount(params.amountPerWallet, wallet, params.mint);
598
+ if (amount <= 0) {
599
+ walletResults.push({ walletId: wallet.id, publicKey: wallet.publicKey, success: false, error: 'Zero amount' });
600
+ continue;
601
+ }
602
+ const tx = await this.buildTransaction(wallet, params, amount);
603
+ if (tx) {
604
+ tx.sign([wallet.keypair]);
605
+ signedTxs.push(tx);
606
+ walletResults.push({
607
+ walletId: wallet.id,
608
+ publicKey: wallet.publicKey,
609
+ success: false,
610
+ solAmount: params.action === 'buy' ? amount : undefined,
611
+ tokenAmount: params.action === 'sell' ? amount : undefined,
612
+ });
613
+ }
614
+ }
615
+ catch (e) {
616
+ const errMsg = e instanceof Error ? e.message : String(e);
617
+ errors.push(`${wallet.id}: ${errMsg}`);
618
+ walletResults.push({ walletId: wallet.id, publicKey: wallet.publicKey, success: false, error: errMsg });
619
+ }
620
+ }
621
+ return { signedTxs, walletResults, tipWallet: wallets[0] };
622
+ }
623
+ async buildTransaction(wallet, params, amount) {
624
+ // Get the appropriate builder for the DEX
625
+ const dex = params.dex ?? 'pumpfun';
626
+ const builder = (0, swarm_builders_1.getBuilder)(dex);
627
+ const options = {
628
+ slippageBps: params.slippageBps ?? this.config.defaultSlippageBps,
629
+ priorityFeeLamports: params.priorityFeeLamports,
630
+ poolAddress: params.poolAddress,
631
+ pool: params.pool,
632
+ };
633
+ // Cast wallet to builder's expected type (they're compatible)
634
+ const builderWallet = wallet;
635
+ if (params.action === 'buy') {
636
+ return builder.buildBuyTransaction(this.connection, builderWallet, params.mint, amount, options);
637
+ }
638
+ else {
639
+ return builder.buildSellTransaction(this.connection, builderWallet, params.mint, amount, options);
640
+ }
641
+ }
642
+ async buildTipTransaction(wallet) {
643
+ const tipAccount = new web3_js_1.PublicKey(JITO_TIP_ACCOUNTS[Math.floor(Math.random() * JITO_TIP_ACCOUNTS.length)]);
644
+ const { blockhash } = await this.connection.getLatestBlockhash();
645
+ const instruction = web3_js_1.SystemProgram.transfer({
646
+ fromPubkey: wallet.keypair.publicKey,
647
+ toPubkey: tipAccount,
648
+ lamports: this.config.jitoTipLamports,
649
+ });
650
+ const messageV0 = new web3_js_1.TransactionMessage({
651
+ payerKey: wallet.keypair.publicKey,
652
+ recentBlockhash: blockhash,
653
+ instructions: [instruction],
654
+ }).compileToV0Message();
655
+ return new web3_js_1.VersionedTransaction(messageV0);
656
+ }
657
+ async submitJitoBundle(transactions) {
658
+ const serializedTxs = transactions.map(tx => bs58_1.default.encode(tx.serialize()));
659
+ const response = await fetch(`${JITO_BLOCK_ENGINE}/api/v1/bundles`, {
660
+ method: 'POST',
661
+ headers: { 'Content-Type': 'application/json' },
662
+ body: JSON.stringify({
663
+ jsonrpc: '2.0',
664
+ id: 1,
665
+ method: 'sendBundle',
666
+ params: [serializedTxs],
667
+ }),
668
+ });
669
+ if (!response.ok) {
670
+ const text = await response.text();
671
+ throw new Error(`Jito ${response.status}: ${text}`);
672
+ }
673
+ const result = await response.json();
674
+ if (result.error)
675
+ throw new Error(`Jito: ${result.error.message}`);
676
+ return result.result || 'bundle_submitted';
677
+ }
678
+ // --------------------------------------------------------------------------
679
+ // Helpers
680
+ // --------------------------------------------------------------------------
681
+ selectWallets(walletIds) {
682
+ if (walletIds && walletIds.length > 0) {
683
+ return walletIds
684
+ .map(id => this.wallets.get(id))
685
+ .filter((w) => w !== undefined && w.enabled);
686
+ }
687
+ return this.getEnabledWallets();
688
+ }
689
+ calculateAmount(baseAmount, wallet, mint) {
690
+ let amount;
691
+ if (typeof baseAmount === 'string' && baseAmount.endsWith('%')) {
692
+ const pct = parseFloat(baseAmount) / 100;
693
+ const position = wallet.positions.get(mint) || 0;
694
+ amount = Math.floor(position * pct);
695
+ }
696
+ else {
697
+ amount = typeof baseAmount === 'string' ? parseFloat(baseAmount) : baseAmount;
698
+ }
699
+ // Apply variance (only for buys)
700
+ if (this.config.amountVariancePct > 0 && !(typeof baseAmount === 'string' && baseAmount.endsWith('%'))) {
701
+ const variance = amount * (this.config.amountVariancePct / 100);
702
+ amount += (Math.random() - 0.5) * 2 * variance;
703
+ }
704
+ return Math.max(0, amount);
705
+ }
706
+ async confirmWithTimeout(signature, timeoutMs) {
707
+ const start = Date.now();
708
+ while (Date.now() - start < timeoutMs) {
709
+ const status = await this.connection.getSignatureStatus(signature);
710
+ if (status.value?.confirmationStatus === 'confirmed' || status.value?.confirmationStatus === 'finalized') {
711
+ if (status.value.err)
712
+ throw new Error(`TX failed: ${JSON.stringify(status.value.err)}`);
713
+ return;
714
+ }
715
+ await sleep(1000);
716
+ }
717
+ throw new Error('Timeout');
718
+ }
719
+ confirmAllAsync(signatures) {
720
+ // Fire and forget - confirms in background
721
+ for (const sig of signatures) {
722
+ this.confirmWithTimeout(sig, this.config.confirmTimeoutMs).catch(() => { });
723
+ }
724
+ }
725
+ chunkArray(array, size) {
726
+ const chunks = [];
727
+ for (let i = 0; i < array.length; i += size) {
728
+ chunks.push(array.slice(i, i + size));
729
+ }
730
+ return chunks;
731
+ }
732
+ emptyResult(params, action, startTime, errors, defaultError) {
733
+ return {
734
+ success: false,
735
+ mint: params.mint,
736
+ action,
737
+ walletResults: [],
738
+ executionTimeMs: Date.now() - startTime,
739
+ executionMode: 'parallel',
740
+ errors: errors.length > 0 ? errors : [defaultError],
741
+ };
742
+ }
743
+ buildResult(params, walletResults, startTime, errors, mode, bundleIds) {
744
+ const successCount = walletResults.filter(r => r.success).length;
745
+ const totalSol = walletResults
746
+ .filter(r => r.success && r.solAmount)
747
+ .reduce((sum, r) => sum + (r.solAmount || 0), 0);
748
+ return {
749
+ success: successCount > 0,
750
+ mint: params.mint,
751
+ action: params.action,
752
+ walletResults,
753
+ bundleIds: bundleIds && bundleIds.length > 0 ? bundleIds : undefined,
754
+ totalSolSpent: params.action === 'buy' ? totalSol : undefined,
755
+ executionTimeMs: Date.now() - startTime,
756
+ executionMode: mode,
757
+ errors: errors.length > 0 ? errors : undefined,
758
+ };
759
+ }
760
+ // --------------------------------------------------------------------------
761
+ // SOL Distribution & Consolidation
762
+ // --------------------------------------------------------------------------
763
+ /**
764
+ * Distribute SOL from main wallet to all other wallets
765
+ */
766
+ async distributeSOL(amountPerWallet, fromWalletId = 'wallet_0') {
767
+ const fromWallet = this.wallets.get(fromWalletId);
768
+ if (!fromWallet) {
769
+ return {
770
+ success: false,
771
+ fromWallet: fromWalletId,
772
+ totalDistributed: 0,
773
+ distributions: [],
774
+ errors: [`Wallet ${fromWalletId} not found`],
775
+ };
776
+ }
777
+ // Refresh balances first
778
+ await this.refreshBalances();
779
+ const targetWallets = this.getWallets().filter(w => w.id !== fromWalletId && w.enabled);
780
+ if (targetWallets.length === 0) {
781
+ return {
782
+ success: false,
783
+ fromWallet: fromWalletId,
784
+ totalDistributed: 0,
785
+ distributions: [],
786
+ errors: ['No target wallets available'],
787
+ };
788
+ }
789
+ const totalNeeded = amountPerWallet * targetWallets.length;
790
+ if (fromWallet.solBalance < totalNeeded + 0.01) {
791
+ return {
792
+ success: false,
793
+ fromWallet: fromWalletId,
794
+ totalDistributed: 0,
795
+ distributions: [],
796
+ errors: [`Insufficient balance. Need ${totalNeeded.toFixed(4)} SOL, have ${fromWallet.solBalance.toFixed(4)}`],
797
+ };
798
+ }
799
+ const distributions = [];
800
+ const errors = [];
801
+ let totalDistributed = 0;
802
+ // Build and send transfer transactions
803
+ for (const targetWallet of targetWallets) {
804
+ try {
805
+ const { blockhash } = await this.connection.getLatestBlockhash();
806
+ const lamports = Math.floor(amountPerWallet * 1e9);
807
+ const instruction = web3_js_1.SystemProgram.transfer({
808
+ fromPubkey: fromWallet.keypair.publicKey,
809
+ toPubkey: targetWallet.keypair.publicKey,
810
+ lamports,
811
+ });
812
+ const messageV0 = new web3_js_1.TransactionMessage({
813
+ payerKey: fromWallet.keypair.publicKey,
814
+ recentBlockhash: blockhash,
815
+ instructions: [instruction],
816
+ }).compileToV0Message();
817
+ const tx = new web3_js_1.VersionedTransaction(messageV0);
818
+ tx.sign([fromWallet.keypair]);
819
+ const signature = await this.connection.sendRawTransaction(tx.serialize(), {
820
+ skipPreflight: true,
821
+ maxRetries: 3,
822
+ });
823
+ distributions.push({
824
+ toWallet: targetWallet.id,
825
+ amount: amountPerWallet,
826
+ signature,
827
+ });
828
+ totalDistributed += amountPerWallet;
829
+ // Small delay between transfers
830
+ await sleep(100);
831
+ }
832
+ catch (e) {
833
+ const errMsg = e instanceof Error ? e.message : String(e);
834
+ distributions.push({
835
+ toWallet: targetWallet.id,
836
+ amount: amountPerWallet,
837
+ error: errMsg,
838
+ });
839
+ errors.push(`${targetWallet.id}: ${errMsg}`);
840
+ }
841
+ }
842
+ // Refresh balances after distribution
843
+ setTimeout(() => this.refreshBalances(), 3000);
844
+ return {
845
+ success: distributions.some(d => d.signature),
846
+ fromWallet: fromWalletId,
847
+ totalDistributed,
848
+ distributions,
849
+ errors: errors.length > 0 ? errors : undefined,
850
+ };
851
+ }
852
+ /**
853
+ * Consolidate SOL from all wallets to one wallet
854
+ */
855
+ async consolidateSOL(toWalletId = 'wallet_0', leaveAmount = 0.005) {
856
+ const toWallet = this.wallets.get(toWalletId);
857
+ if (!toWallet) {
858
+ return {
859
+ success: false,
860
+ toWallet: toWalletId,
861
+ totalConsolidated: 0,
862
+ consolidations: [],
863
+ errors: [`Wallet ${toWalletId} not found`],
864
+ };
865
+ }
866
+ await this.refreshBalances();
867
+ const sourceWallets = this.getWallets().filter(w => w.id !== toWalletId && w.solBalance > leaveAmount + 0.001);
868
+ if (sourceWallets.length === 0) {
869
+ return {
870
+ success: false,
871
+ toWallet: toWalletId,
872
+ totalConsolidated: 0,
873
+ consolidations: [],
874
+ errors: ['No wallets with sufficient balance to consolidate'],
875
+ };
876
+ }
877
+ const consolidations = [];
878
+ const errors = [];
879
+ let totalConsolidated = 0;
880
+ for (const sourceWallet of sourceWallets) {
881
+ try {
882
+ const amountToSend = sourceWallet.solBalance - leaveAmount;
883
+ if (amountToSend <= 0)
884
+ continue;
885
+ const { blockhash } = await this.connection.getLatestBlockhash();
886
+ const lamports = Math.floor(amountToSend * 1e9);
887
+ const instruction = web3_js_1.SystemProgram.transfer({
888
+ fromPubkey: sourceWallet.keypair.publicKey,
889
+ toPubkey: toWallet.keypair.publicKey,
890
+ lamports,
891
+ });
892
+ const messageV0 = new web3_js_1.TransactionMessage({
893
+ payerKey: sourceWallet.keypair.publicKey,
894
+ recentBlockhash: blockhash,
895
+ instructions: [instruction],
896
+ }).compileToV0Message();
897
+ const tx = new web3_js_1.VersionedTransaction(messageV0);
898
+ tx.sign([sourceWallet.keypair]);
899
+ const signature = await this.connection.sendRawTransaction(tx.serialize(), {
900
+ skipPreflight: true,
901
+ maxRetries: 3,
902
+ });
903
+ consolidations.push({
904
+ fromWallet: sourceWallet.id,
905
+ amount: amountToSend,
906
+ signature,
907
+ });
908
+ totalConsolidated += amountToSend;
909
+ await sleep(100);
910
+ }
911
+ catch (e) {
912
+ const errMsg = e instanceof Error ? e.message : String(e);
913
+ consolidations.push({
914
+ fromWallet: sourceWallet.id,
915
+ amount: sourceWallet.solBalance - leaveAmount,
916
+ error: errMsg,
917
+ });
918
+ errors.push(`${sourceWallet.id}: ${errMsg}`);
919
+ }
920
+ }
921
+ setTimeout(() => this.refreshBalances(), 3000);
922
+ return {
923
+ success: consolidations.some(c => c.signature),
924
+ toWallet: toWalletId,
925
+ totalConsolidated,
926
+ consolidations,
927
+ errors: errors.length > 0 ? errors : undefined,
928
+ };
929
+ }
930
+ /**
931
+ * Consolidate all tokens of a specific mint to one wallet
932
+ */
933
+ async consolidateTokens(mint, toWalletId = 'wallet_0', options) {
934
+ const toWallet = this.wallets.get(toWalletId);
935
+ if (!toWallet) {
936
+ return {
937
+ success: false,
938
+ toWallet: toWalletId,
939
+ totalConsolidated: 0,
940
+ consolidations: [],
941
+ errors: [`Wallet ${toWalletId} not found`],
942
+ };
943
+ }
944
+ // Refresh positions first
945
+ await this.refreshTokenPositions(mint);
946
+ const sourceWallets = this.getWallets().filter(w => {
947
+ const pos = w.positions.get(mint) || 0;
948
+ return w.id !== toWalletId && pos > 0;
949
+ });
950
+ if (sourceWallets.length === 0) {
951
+ return {
952
+ success: false,
953
+ toWallet: toWalletId,
954
+ totalConsolidated: 0,
955
+ consolidations: [],
956
+ errors: ['No wallets with token positions to consolidate'],
957
+ };
958
+ }
959
+ const consolidations = [];
960
+ const errors = [];
961
+ let totalConsolidated = 0;
962
+ // For tokens, we need to sell from source and buy to target
963
+ // This is done through the trading mechanism
964
+ for (const sourceWallet of sourceWallets) {
965
+ const tokenAmount = sourceWallet.positions.get(mint) || 0;
966
+ if (tokenAmount <= 0)
967
+ continue;
968
+ try {
969
+ // Execute sell from this wallet
970
+ const sellResult = await this.executeSingleTrade(sourceWallet, {
971
+ mint,
972
+ action: 'sell',
973
+ amountPerWallet: tokenAmount,
974
+ denominatedInSol: false,
975
+ slippageBps: this.config.defaultSlippageBps,
976
+ dex: options?.dex,
977
+ poolAddress: options?.poolAddress,
978
+ }, tokenAmount);
979
+ if (sellResult.success) {
980
+ consolidations.push({
981
+ fromWallet: sourceWallet.id,
982
+ amount: tokenAmount,
983
+ signature: sellResult.signature,
984
+ });
985
+ totalConsolidated += tokenAmount;
986
+ }
987
+ else {
988
+ consolidations.push({
989
+ fromWallet: sourceWallet.id,
990
+ amount: tokenAmount,
991
+ error: sellResult.error || 'Sell failed',
992
+ });
993
+ errors.push(`${sourceWallet.id}: ${sellResult.error}`);
994
+ }
995
+ await sleep(500);
996
+ }
997
+ catch (e) {
998
+ const errMsg = e instanceof Error ? e.message : String(e);
999
+ consolidations.push({
1000
+ fromWallet: sourceWallet.id,
1001
+ amount: tokenAmount,
1002
+ error: errMsg,
1003
+ });
1004
+ errors.push(`${sourceWallet.id}: ${errMsg}`);
1005
+ }
1006
+ }
1007
+ setTimeout(() => this.refreshTokenPositions(mint), 5000);
1008
+ return {
1009
+ success: consolidations.some(c => c.signature),
1010
+ toWallet: toWalletId,
1011
+ totalConsolidated,
1012
+ consolidations,
1013
+ errors: errors.length > 0 ? errors : undefined,
1014
+ };
1015
+ }
1016
+ // --------------------------------------------------------------------------
1017
+ // Status & Monitoring
1018
+ // --------------------------------------------------------------------------
1019
+ /**
1020
+ * Get comprehensive swarm status
1021
+ */
1022
+ async getSwarmStatus(mints) {
1023
+ await this.refreshBalances();
1024
+ const balanceByWallet = new Map();
1025
+ let totalSolBalance = 0;
1026
+ for (const wallet of this.wallets.values()) {
1027
+ balanceByWallet.set(wallet.id, wallet.solBalance);
1028
+ totalSolBalance += wallet.solBalance;
1029
+ }
1030
+ const positions = new Map();
1031
+ if (mints && mints.length > 0) {
1032
+ for (const mint of mints) {
1033
+ const pos = await this.refreshTokenPositions(mint);
1034
+ positions.set(mint, pos);
1035
+ }
1036
+ }
1037
+ return {
1038
+ totalWallets: this.wallets.size,
1039
+ enabledWallets: this.getEnabledWallets().length,
1040
+ totalSolBalance,
1041
+ balanceByWallet,
1042
+ positions,
1043
+ lastUpdated: Date.now(),
1044
+ };
1045
+ }
1046
+ // --------------------------------------------------------------------------
1047
+ // Quotes & Simulation
1048
+ // --------------------------------------------------------------------------
1049
+ /**
1050
+ * Get quotes for a coordinated trade without executing
1051
+ */
1052
+ async coordinatedQuote(params) {
1053
+ const wallets = this.selectWallets(params.walletIds);
1054
+ const quotes = [];
1055
+ let totalInput = 0;
1056
+ let totalOutput = 0;
1057
+ let totalPriceImpact = 0;
1058
+ let priceImpactCount = 0;
1059
+ // Get the builder for the specified DEX
1060
+ const dex = params.dex ?? 'pumpfun';
1061
+ const builder = (0, swarm_builders_1.getBuilder)(dex);
1062
+ for (const wallet of wallets) {
1063
+ try {
1064
+ const amount = this.calculateAmount(params.amountPerWallet, wallet, params.mint);
1065
+ if (amount <= 0) {
1066
+ quotes.push({ walletId: wallet.id, inputAmount: 0, outputAmount: 0, error: 'Zero amount' });
1067
+ continue;
1068
+ }
1069
+ // Use builder's getQuote if available, otherwise fallback to estimate
1070
+ if (builder.getQuote) {
1071
+ try {
1072
+ const quoteResult = await builder.getQuote(this.connection, params.mint, amount, params.action === 'buy', {
1073
+ slippageBps: params.slippageBps ?? this.config.defaultSlippageBps,
1074
+ poolAddress: params.poolAddress,
1075
+ pool: params.pool,
1076
+ });
1077
+ quotes.push({
1078
+ walletId: wallet.id,
1079
+ inputAmount: quoteResult.inputAmount,
1080
+ outputAmount: quoteResult.outputAmount,
1081
+ priceImpact: quoteResult.priceImpact,
1082
+ });
1083
+ totalInput += quoteResult.inputAmount;
1084
+ totalOutput += quoteResult.outputAmount;
1085
+ if (quoteResult.priceImpact !== undefined) {
1086
+ totalPriceImpact += quoteResult.priceImpact;
1087
+ priceImpactCount++;
1088
+ }
1089
+ }
1090
+ catch (quoteError) {
1091
+ quotes.push({
1092
+ walletId: wallet.id,
1093
+ inputAmount: amount,
1094
+ outputAmount: 0,
1095
+ error: `Quote failed: ${quoteError instanceof Error ? quoteError.message : String(quoteError)}`,
1096
+ });
1097
+ totalInput += amount;
1098
+ }
1099
+ }
1100
+ else {
1101
+ // Builder doesn't support quotes, use input amount as estimate
1102
+ quotes.push({ walletId: wallet.id, inputAmount: amount, outputAmount: 0, error: 'Quotes not supported for this DEX' });
1103
+ totalInput += amount;
1104
+ }
1105
+ }
1106
+ catch (e) {
1107
+ quotes.push({
1108
+ walletId: wallet.id,
1109
+ inputAmount: 0,
1110
+ outputAmount: 0,
1111
+ error: e instanceof Error ? e.message : String(e)
1112
+ });
1113
+ }
1114
+ }
1115
+ return {
1116
+ mint: params.mint,
1117
+ action: params.action,
1118
+ quotes,
1119
+ totalInput,
1120
+ totalOutput,
1121
+ avgPriceImpact: priceImpactCount > 0 ? totalPriceImpact / priceImpactCount : undefined,
1122
+ };
1123
+ }
1124
+ /**
1125
+ * Simulate a trade without executing
1126
+ */
1127
+ async simulate(params) {
1128
+ const warnings = [];
1129
+ const errors = [];
1130
+ // Refresh data
1131
+ await this.refreshBalances();
1132
+ if (params.action === 'sell') {
1133
+ await this.refreshTokenPositions(params.mint);
1134
+ }
1135
+ // Select wallets
1136
+ let wallets = this.selectWallets(params.walletIds);
1137
+ const originalCount = wallets.length;
1138
+ if (wallets.length === 0) {
1139
+ errors.push('No enabled wallets available');
1140
+ return {
1141
+ wouldSucceed: false,
1142
+ params,
1143
+ walletsUsed: 0,
1144
+ estimatedTotalSol: 0,
1145
+ estimatedFees: 0,
1146
+ warnings,
1147
+ errors,
1148
+ };
1149
+ }
1150
+ // Filter based on action
1151
+ if (params.action === 'buy') {
1152
+ const solNeeded = typeof params.amountPerWallet === 'number'
1153
+ ? params.amountPerWallet
1154
+ : parseFloat(params.amountPerWallet);
1155
+ wallets = wallets.filter(w => {
1156
+ if (w.solBalance < solNeeded + this.config.minSolBalance) {
1157
+ warnings.push(`${w.id}: insufficient SOL (${w.solBalance.toFixed(4)})`);
1158
+ return false;
1159
+ }
1160
+ return true;
1161
+ });
1162
+ }
1163
+ else {
1164
+ wallets = wallets.filter(w => {
1165
+ const pos = w.positions.get(params.mint) || 0;
1166
+ if (pos <= 0) {
1167
+ warnings.push(`${w.id}: no position`);
1168
+ return false;
1169
+ }
1170
+ return true;
1171
+ });
1172
+ }
1173
+ if (wallets.length < originalCount) {
1174
+ warnings.push(`${originalCount - wallets.length} wallets filtered out`);
1175
+ }
1176
+ // Calculate estimates
1177
+ let estimatedTotalSol = 0;
1178
+ let estimatedTotalTokens = 0;
1179
+ for (const wallet of wallets) {
1180
+ const amount = this.calculateAmount(params.amountPerWallet, wallet, params.mint);
1181
+ if (params.action === 'buy') {
1182
+ estimatedTotalSol += amount;
1183
+ }
1184
+ else {
1185
+ estimatedTotalTokens += amount;
1186
+ }
1187
+ }
1188
+ // Estimate fees (priority fee + Jito tip if bundled)
1189
+ const mode = this.selectExecutionMode(params, wallets.length);
1190
+ let estimatedFees = wallets.length * (params.priorityFeeLamports || 10000) / 1e9;
1191
+ if (mode === 'bundle' || mode === 'multi-bundle') {
1192
+ const bundleCount = mode === 'bundle' ? 1 : Math.ceil(wallets.length / MAX_BUNDLE_SIZE);
1193
+ estimatedFees += bundleCount * this.config.jitoTipLamports / 1e9;
1194
+ }
1195
+ return {
1196
+ wouldSucceed: wallets.length > 0 && errors.length === 0,
1197
+ params,
1198
+ walletsUsed: wallets.length,
1199
+ estimatedTotalSol: params.action === 'buy' ? estimatedTotalSol : 0,
1200
+ estimatedTotalTokens: params.action === 'sell' ? estimatedTotalTokens : undefined,
1201
+ estimatedFees,
1202
+ warnings,
1203
+ errors,
1204
+ };
1205
+ }
1206
+ /**
1207
+ * Estimate fees for a trade
1208
+ */
1209
+ estimateFees(walletCount, mode) {
1210
+ const effectiveMode = mode || this.selectExecutionMode({ mint: '', action: 'buy', amountPerWallet: 0 }, walletCount);
1211
+ let fees = walletCount * 10000 / 1e9; // Base priority fee
1212
+ if (effectiveMode === 'bundle') {
1213
+ fees += this.config.jitoTipLamports / 1e9;
1214
+ }
1215
+ else if (effectiveMode === 'multi-bundle') {
1216
+ const bundleCount = Math.ceil(walletCount / MAX_BUNDLE_SIZE);
1217
+ fees += bundleCount * this.config.jitoTipLamports / 1e9;
1218
+ }
1219
+ return fees;
1220
+ }
1221
+ // --------------------------------------------------------------------------
1222
+ // Stop Loss & Take Profit
1223
+ // --------------------------------------------------------------------------
1224
+ stopLossConfigs = new Map();
1225
+ takeProfitConfigs = new Map();
1226
+ priceMonitorInterval = null;
1227
+ /**
1228
+ * Set up a stop loss for a token
1229
+ */
1230
+ setStopLoss(config) {
1231
+ const key = `sl_${config.mint}`;
1232
+ this.stopLossConfigs.set(key, config);
1233
+ this.startPriceMonitor();
1234
+ this.emit('stopLossSet', config);
1235
+ }
1236
+ /**
1237
+ * Remove a stop loss
1238
+ */
1239
+ removeStopLoss(mint) {
1240
+ const key = `sl_${mint}`;
1241
+ const existed = this.stopLossConfigs.delete(key);
1242
+ if (this.stopLossConfigs.size === 0 && this.takeProfitConfigs.size === 0) {
1243
+ this.stopPriceMonitor();
1244
+ }
1245
+ return existed;
1246
+ }
1247
+ /**
1248
+ * Get all stop loss configs
1249
+ */
1250
+ getStopLossConfigs() {
1251
+ return Array.from(this.stopLossConfigs.values());
1252
+ }
1253
+ /**
1254
+ * Set up a take profit for a token
1255
+ */
1256
+ setTakeProfit(config) {
1257
+ const key = `tp_${config.mint}`;
1258
+ this.takeProfitConfigs.set(key, config);
1259
+ this.startPriceMonitor();
1260
+ this.emit('takeProfitSet', config);
1261
+ }
1262
+ /**
1263
+ * Remove a take profit
1264
+ */
1265
+ removeTakeProfit(mint) {
1266
+ const key = `tp_${mint}`;
1267
+ const existed = this.takeProfitConfigs.delete(key);
1268
+ if (this.stopLossConfigs.size === 0 && this.takeProfitConfigs.size === 0) {
1269
+ this.stopPriceMonitor();
1270
+ }
1271
+ return existed;
1272
+ }
1273
+ /**
1274
+ * Get all take profit configs
1275
+ */
1276
+ getTakeProfitConfigs() {
1277
+ return Array.from(this.takeProfitConfigs.values());
1278
+ }
1279
+ startPriceMonitor() {
1280
+ if (this.priceMonitorInterval)
1281
+ return;
1282
+ this.priceMonitorInterval = setInterval(async () => {
1283
+ await this.checkPriceTriggers();
1284
+ }, 5000); // Check every 5 seconds
1285
+ }
1286
+ stopPriceMonitor() {
1287
+ if (this.priceMonitorInterval) {
1288
+ clearInterval(this.priceMonitorInterval);
1289
+ this.priceMonitorInterval = null;
1290
+ }
1291
+ }
1292
+ async checkPriceTriggers() {
1293
+ // Collect all mints we need to check
1294
+ const mints = new Set();
1295
+ for (const config of this.stopLossConfigs.values()) {
1296
+ if (config.enabled)
1297
+ mints.add(config.mint);
1298
+ }
1299
+ for (const config of this.takeProfitConfigs.values()) {
1300
+ if (config.enabled)
1301
+ mints.add(config.mint);
1302
+ }
1303
+ for (const mint of mints) {
1304
+ try {
1305
+ // Get current price from Pump.fun frontend API
1306
+ const priceHeaders = {
1307
+ 'Accept': 'application/json',
1308
+ 'Origin': 'https://pump.fun',
1309
+ };
1310
+ const jwt = process.env.PUMPFUN_JWT;
1311
+ if (jwt) {
1312
+ priceHeaders['Authorization'] = `Bearer ${jwt}`;
1313
+ }
1314
+ const response = await fetch(`${PUMPFUN_FRONTEND_API}/coins/${mint}`, { headers: priceHeaders });
1315
+ if (!response.ok)
1316
+ continue;
1317
+ const data = await response.json();
1318
+ // Estimate price from reserves: price ≈ solReserves / tokenReserves
1319
+ const solReserves = data.virtual_sol_reserves ?? 0;
1320
+ const tokenReserves = data.virtual_token_reserves ?? 0;
1321
+ const currentPrice = (solReserves > 0 && tokenReserves > 0) ? solReserves / tokenReserves : undefined;
1322
+ if (!currentPrice)
1323
+ continue;
1324
+ // Check stop loss
1325
+ const slConfig = this.stopLossConfigs.get(`sl_${mint}`);
1326
+ if (slConfig && slConfig.enabled && currentPrice <= slConfig.triggerPrice) {
1327
+ this.emit('stopLossTriggered', { mint, price: currentPrice, config: slConfig });
1328
+ slConfig.enabled = false; // Disable after triggering
1329
+ // Execute sell
1330
+ await this.coordinatedSell({
1331
+ mint,
1332
+ action: 'sell',
1333
+ amountPerWallet: `${slConfig.sellPercent}%`,
1334
+ walletIds: slConfig.walletIds,
1335
+ slippageBps: 1000, // Higher slippage for stop loss
1336
+ dex: slConfig.dex,
1337
+ poolAddress: slConfig.poolAddress,
1338
+ });
1339
+ }
1340
+ // Check take profit
1341
+ const tpConfig = this.takeProfitConfigs.get(`tp_${mint}`);
1342
+ if (tpConfig && tpConfig.enabled && currentPrice >= tpConfig.triggerPrice) {
1343
+ this.emit('takeProfitTriggered', { mint, price: currentPrice, config: tpConfig });
1344
+ tpConfig.enabled = false; // Disable after triggering
1345
+ // Execute sell
1346
+ await this.coordinatedSell({
1347
+ mint,
1348
+ action: 'sell',
1349
+ amountPerWallet: `${tpConfig.sellPercent}%`,
1350
+ walletIds: tpConfig.walletIds,
1351
+ slippageBps: 500,
1352
+ dex: tpConfig.dex,
1353
+ poolAddress: tpConfig.poolAddress,
1354
+ });
1355
+ }
1356
+ }
1357
+ catch (e) {
1358
+ // Silently continue on errors
1359
+ }
1360
+ }
1361
+ }
1362
+ // --------------------------------------------------------------------------
1363
+ // DCA (Dollar Cost Averaging)
1364
+ // --------------------------------------------------------------------------
1365
+ dcaConfigs = new Map();
1366
+ dcaIntervals = new Map();
1367
+ /**
1368
+ * Schedule a DCA buy strategy
1369
+ */
1370
+ scheduleDCA(config) {
1371
+ const id = `dca_${config.mint}_${Date.now()}`;
1372
+ const fullConfig = {
1373
+ ...config,
1374
+ id,
1375
+ completedIntervals: 0,
1376
+ nextExecutionAt: Date.now() + config.intervalMs,
1377
+ };
1378
+ this.dcaConfigs.set(id, fullConfig);
1379
+ if (fullConfig.enabled) {
1380
+ this.startDCAInterval(fullConfig);
1381
+ }
1382
+ this.emit('dcaScheduled', fullConfig);
1383
+ return fullConfig;
1384
+ }
1385
+ /**
1386
+ * Cancel a DCA schedule
1387
+ */
1388
+ cancelDCA(id) {
1389
+ const config = this.dcaConfigs.get(id);
1390
+ if (!config)
1391
+ return false;
1392
+ const interval = this.dcaIntervals.get(id);
1393
+ if (interval) {
1394
+ clearInterval(interval);
1395
+ this.dcaIntervals.delete(id);
1396
+ }
1397
+ this.dcaConfigs.delete(id);
1398
+ this.emit('dcaCancelled', { id });
1399
+ return true;
1400
+ }
1401
+ /**
1402
+ * Pause a DCA schedule
1403
+ */
1404
+ pauseDCA(id) {
1405
+ const config = this.dcaConfigs.get(id);
1406
+ if (!config)
1407
+ return false;
1408
+ config.enabled = false;
1409
+ const interval = this.dcaIntervals.get(id);
1410
+ if (interval) {
1411
+ clearInterval(interval);
1412
+ this.dcaIntervals.delete(id);
1413
+ }
1414
+ return true;
1415
+ }
1416
+ /**
1417
+ * Resume a paused DCA schedule
1418
+ */
1419
+ resumeDCA(id) {
1420
+ const config = this.dcaConfigs.get(id);
1421
+ if (!config)
1422
+ return false;
1423
+ config.enabled = true;
1424
+ config.nextExecutionAt = Date.now() + config.intervalMs;
1425
+ this.startDCAInterval(config);
1426
+ return true;
1427
+ }
1428
+ /**
1429
+ * Get all DCA configs
1430
+ */
1431
+ getDCAConfigs() {
1432
+ return Array.from(this.dcaConfigs.values());
1433
+ }
1434
+ startDCAInterval(config) {
1435
+ const interval = setInterval(async () => {
1436
+ if (!config.enabled)
1437
+ return;
1438
+ if (config.completedIntervals >= config.totalIntervals) {
1439
+ this.cancelDCA(config.id);
1440
+ return;
1441
+ }
1442
+ try {
1443
+ const result = await this.coordinatedBuy({
1444
+ mint: config.mint,
1445
+ action: 'buy',
1446
+ amountPerWallet: config.amountPerInterval,
1447
+ denominatedInSol: true,
1448
+ walletIds: config.walletIds,
1449
+ executionMode: config.executionMode,
1450
+ dex: config.dex,
1451
+ poolAddress: config.poolAddress,
1452
+ });
1453
+ config.completedIntervals++;
1454
+ config.nextExecutionAt = Date.now() + config.intervalMs;
1455
+ this.emit('dcaExecuted', { config, result });
1456
+ if (config.completedIntervals >= config.totalIntervals) {
1457
+ this.emit('dcaCompleted', { config });
1458
+ this.cancelDCA(config.id);
1459
+ }
1460
+ }
1461
+ catch (e) {
1462
+ this.emit('dcaError', { config, error: e instanceof Error ? e.message : String(e) });
1463
+ }
1464
+ }, config.intervalMs);
1465
+ this.dcaIntervals.set(config.id, interval);
1466
+ }
1467
+ // --------------------------------------------------------------------------
1468
+ // Trade History
1469
+ // --------------------------------------------------------------------------
1470
+ tradeHistory = [];
1471
+ maxHistorySize = 1000;
1472
+ /**
1473
+ * Record a trade in history
1474
+ */
1475
+ recordTrade(entry) {
1476
+ this.tradeHistory.unshift(entry);
1477
+ if (this.tradeHistory.length > this.maxHistorySize) {
1478
+ this.tradeHistory = this.tradeHistory.slice(0, this.maxHistorySize);
1479
+ }
1480
+ }
1481
+ /**
1482
+ * Get trade history
1483
+ */
1484
+ getTradeHistory(options) {
1485
+ let history = this.tradeHistory;
1486
+ if (options?.mint) {
1487
+ history = history.filter(h => h.mint === options.mint);
1488
+ }
1489
+ if (options?.walletId) {
1490
+ history = history.filter(h => h.walletId === options.walletId);
1491
+ }
1492
+ if (options?.action) {
1493
+ history = history.filter(h => h.action === options.action);
1494
+ }
1495
+ if (options?.since) {
1496
+ const sinceTime = options.since;
1497
+ history = history.filter(h => h.timestamp >= sinceTime);
1498
+ }
1499
+ return history.slice(0, options?.limit || 100);
1500
+ }
1501
+ /**
1502
+ * Clear trade history
1503
+ */
1504
+ clearTradeHistory() {
1505
+ this.tradeHistory = [];
1506
+ }
1507
+ // --------------------------------------------------------------------------
1508
+ // Rebalancing
1509
+ // --------------------------------------------------------------------------
1510
+ /**
1511
+ * Rebalance token positions across wallets to target equal distribution
1512
+ */
1513
+ async rebalance(mint, targetWalletIds, options) {
1514
+ await this.refreshTokenPositions(mint);
1515
+ const wallets = targetWalletIds
1516
+ ? targetWalletIds.map(id => this.wallets.get(id)).filter((w) => w !== undefined)
1517
+ : this.getEnabledWallets();
1518
+ if (wallets.length < 2) {
1519
+ return {
1520
+ success: false,
1521
+ mint,
1522
+ transfers: [],
1523
+ errors: ['Need at least 2 wallets to rebalance'],
1524
+ };
1525
+ }
1526
+ // Calculate current positions and target
1527
+ const positions = wallets.map(w => ({
1528
+ wallet: w,
1529
+ amount: w.positions.get(mint) || 0,
1530
+ }));
1531
+ const totalTokens = positions.reduce((sum, p) => sum + p.amount, 0);
1532
+ if (totalTokens === 0) {
1533
+ return {
1534
+ success: false,
1535
+ mint,
1536
+ transfers: [],
1537
+ errors: ['No tokens to rebalance'],
1538
+ };
1539
+ }
1540
+ const targetAmount = totalTokens / wallets.length;
1541
+ const threshold = targetAmount * 0.05; // 5% threshold
1542
+ // Find wallets that need to send and receive
1543
+ const senders = positions.filter(p => p.amount > targetAmount + threshold)
1544
+ .sort((a, b) => b.amount - a.amount);
1545
+ const receivers = positions.filter(p => p.amount < targetAmount - threshold)
1546
+ .sort((a, b) => a.amount - b.amount);
1547
+ if (senders.length === 0 || receivers.length === 0) {
1548
+ return {
1549
+ success: true,
1550
+ mint,
1551
+ transfers: [],
1552
+ errors: ['Positions already balanced'],
1553
+ };
1554
+ }
1555
+ const transfers = [];
1556
+ const errors = [];
1557
+ // Execute rebalancing trades
1558
+ // This is done by selling from senders and buying to receivers
1559
+ for (const sender of senders) {
1560
+ const excessAmount = sender.amount - targetAmount;
1561
+ if (excessAmount <= 0)
1562
+ continue;
1563
+ try {
1564
+ const sellResult = await this.executeSingleTrade(sender.wallet, {
1565
+ mint,
1566
+ action: 'sell',
1567
+ amountPerWallet: Math.floor(excessAmount),
1568
+ denominatedInSol: false,
1569
+ slippageBps: this.config.defaultSlippageBps,
1570
+ dex: options?.dex,
1571
+ poolAddress: options?.poolAddress,
1572
+ }, Math.floor(excessAmount));
1573
+ if (sellResult.success) {
1574
+ // Find a receiver for this amount
1575
+ const receiver = receivers.find(r => r.amount < targetAmount);
1576
+ if (receiver) {
1577
+ const deficit = targetAmount - receiver.amount;
1578
+ const solToSpend = (sellResult.solAmount || 0) * (deficit / excessAmount);
1579
+ // Buy for the receiver
1580
+ const buyResult = await this.executeSingleTrade(receiver.wallet, {
1581
+ mint,
1582
+ action: 'buy',
1583
+ amountPerWallet: solToSpend,
1584
+ denominatedInSol: true,
1585
+ slippageBps: this.config.defaultSlippageBps,
1586
+ dex: options?.dex,
1587
+ poolAddress: options?.poolAddress,
1588
+ }, solToSpend);
1589
+ transfers.push({
1590
+ fromWallet: sender.wallet.id,
1591
+ toWallet: receiver.wallet.id,
1592
+ amount: Math.floor(excessAmount),
1593
+ signature: buyResult.signature,
1594
+ error: buyResult.success ? undefined : buyResult.error,
1595
+ });
1596
+ receiver.amount += deficit;
1597
+ }
1598
+ }
1599
+ else {
1600
+ transfers.push({
1601
+ fromWallet: sender.wallet.id,
1602
+ toWallet: 'N/A',
1603
+ amount: Math.floor(excessAmount),
1604
+ error: sellResult.error,
1605
+ });
1606
+ errors.push(`${sender.wallet.id}: ${sellResult.error}`);
1607
+ }
1608
+ }
1609
+ catch (e) {
1610
+ const errMsg = e instanceof Error ? e.message : String(e);
1611
+ errors.push(`${sender.wallet.id}: ${errMsg}`);
1612
+ }
1613
+ await sleep(500);
1614
+ }
1615
+ setTimeout(() => this.refreshTokenPositions(mint), 5000);
1616
+ return {
1617
+ success: transfers.some(t => t.signature),
1618
+ mint,
1619
+ transfers,
1620
+ errors: errors.length > 0 ? errors : undefined,
1621
+ };
1622
+ }
1623
+ // --------------------------------------------------------------------------
1624
+ // Cleanup
1625
+ // --------------------------------------------------------------------------
1626
+ /**
1627
+ * Cleanup resources (intervals, monitors)
1628
+ */
1629
+ cleanup() {
1630
+ this.stopPriceMonitor();
1631
+ for (const interval of this.dcaIntervals.values()) {
1632
+ clearInterval(interval);
1633
+ }
1634
+ this.dcaIntervals.clear();
1635
+ this.dcaConfigs.clear();
1636
+ this.stopLossConfigs.clear();
1637
+ this.takeProfitConfigs.clear();
1638
+ }
1639
+ }
1640
+ exports.PumpFunSwarm = PumpFunSwarm;
1641
+ // ============================================================================
1642
+ // Utilities
1643
+ // ============================================================================
1644
+ function sleep(ms) {
1645
+ return new Promise(resolve => setTimeout(resolve, ms));
1646
+ }
1647
+ // ============================================================================
1648
+ // Factory
1649
+ // ============================================================================
1650
+ let swarmInstance = null;
1651
+ function getSwarm(config) {
1652
+ if (!swarmInstance || config) {
1653
+ swarmInstance = new PumpFunSwarm(config);
1654
+ }
1655
+ return swarmInstance;
1656
+ }
1657
+ function createSwarm(config) {
1658
+ return new PumpFunSwarm(config);
1659
+ }
1660
+ function resetSwarm() {
1661
+ swarmInstance = null;
1662
+ }
1663
+ //# sourceMappingURL=pump-swarm.js.map