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.
- package/LICENSE +21 -0
- package/README.md +468 -0
- package/dist/acp/agreement.d.ts +110 -0
- package/dist/acp/agreement.js +514 -0
- package/dist/acp/agreement.js.map +1 -0
- package/dist/acp/discovery.d.ts +84 -0
- package/dist/acp/discovery.js +332 -0
- package/dist/acp/discovery.js.map +1 -0
- package/dist/acp/escrow.d.ts +139 -0
- package/dist/acp/escrow.js +880 -0
- package/dist/acp/escrow.js.map +1 -0
- package/dist/acp/identity.d.ts +135 -0
- package/dist/acp/identity.js +716 -0
- package/dist/acp/identity.js.map +1 -0
- package/dist/acp/index.d.ts +205 -0
- package/dist/acp/index.js +583 -0
- package/dist/acp/index.js.map +1 -0
- package/dist/acp/persistence.d.ts +59 -0
- package/dist/acp/persistence.js +590 -0
- package/dist/acp/persistence.js.map +1 -0
- package/dist/acp/predictions.d.ts +89 -0
- package/dist/acp/predictions.js +417 -0
- package/dist/acp/predictions.js.map +1 -0
- package/dist/acp/registry.d.ts +143 -0
- package/dist/acp/registry.js +584 -0
- package/dist/acp/registry.js.map +1 -0
- package/dist/agents/handlers/acp.d.ts +12 -0
- package/dist/agents/handlers/acp.js +987 -0
- package/dist/agents/handlers/acp.js.map +1 -0
- package/dist/agents/handlers/agentbets.d.ts +8 -0
- package/dist/agents/handlers/agentbets.js +63 -0
- package/dist/agents/handlers/agentbets.js.map +1 -0
- package/dist/agents/handlers/arbitrage.d.ts +16 -0
- package/dist/agents/handlers/arbitrage.js +187 -0
- package/dist/agents/handlers/arbitrage.js.map +1 -0
- package/dist/agents/handlers/betfair.d.ts +11 -0
- package/dist/agents/handlers/betfair.js +214 -0
- package/dist/agents/handlers/betfair.js.map +1 -0
- package/dist/agents/handlers/binance.d.ts +9 -0
- package/dist/agents/handlers/binance.js +227 -0
- package/dist/agents/handlers/binance.js.map +1 -0
- package/dist/agents/handlers/bittensor.d.ts +10 -0
- package/dist/agents/handlers/bittensor.js +90 -0
- package/dist/agents/handlers/bittensor.js.map +1 -0
- package/dist/agents/handlers/bybit.d.ts +9 -0
- package/dist/agents/handlers/bybit.js +226 -0
- package/dist/agents/handlers/bybit.js.map +1 -0
- package/dist/agents/handlers/credentials.d.ts +8 -0
- package/dist/agents/handlers/credentials.js +103 -0
- package/dist/agents/handlers/credentials.js.map +1 -0
- package/dist/agents/handlers/hyperliquid.d.ts +9 -0
- package/dist/agents/handlers/hyperliquid.js +326 -0
- package/dist/agents/handlers/hyperliquid.js.map +1 -0
- package/dist/agents/handlers/index.d.ts +82 -0
- package/dist/agents/handlers/index.js +143 -0
- package/dist/agents/handlers/index.js.map +1 -0
- package/dist/agents/handlers/kalshi.d.ts +10 -0
- package/dist/agents/handlers/kalshi.js +1377 -0
- package/dist/agents/handlers/kalshi.js.map +1 -0
- package/dist/agents/handlers/manifold.d.ts +9 -0
- package/dist/agents/handlers/manifold.js +1001 -0
- package/dist/agents/handlers/manifold.js.map +1 -0
- package/dist/agents/handlers/markets.d.ts +8 -0
- package/dist/agents/handlers/markets.js +321 -0
- package/dist/agents/handlers/markets.js.map +1 -0
- package/dist/agents/handlers/opinion.d.ts +11 -0
- package/dist/agents/handlers/opinion.js +374 -0
- package/dist/agents/handlers/opinion.js.map +1 -0
- package/dist/agents/handlers/paper-trading.d.ts +8 -0
- package/dist/agents/handlers/paper-trading.js +124 -0
- package/dist/agents/handlers/paper-trading.js.map +1 -0
- package/dist/agents/handlers/polymarket.d.ts +17 -0
- package/dist/agents/handlers/polymarket.js +455 -0
- package/dist/agents/handlers/polymarket.js.map +1 -0
- package/dist/agents/handlers/predictfun.d.ts +9 -0
- package/dist/agents/handlers/predictfun.js +488 -0
- package/dist/agents/handlers/predictfun.js.map +1 -0
- package/dist/agents/handlers/smarkets.d.ts +11 -0
- package/dist/agents/handlers/smarkets.js +205 -0
- package/dist/agents/handlers/smarkets.js.map +1 -0
- package/dist/agents/handlers/solana.d.ts +14 -0
- package/dist/agents/handlers/solana.js +1530 -0
- package/dist/agents/handlers/solana.js.map +1 -0
- package/dist/agents/handlers/types.d.ts +58 -0
- package/dist/agents/handlers/types.js +34 -0
- package/dist/agents/handlers/types.js.map +1 -0
- package/dist/agents/handlers/virtuals.d.ts +11 -0
- package/dist/agents/handlers/virtuals.js +135 -0
- package/dist/agents/handlers/virtuals.js.map +1 -0
- package/dist/agents/handlers/wallets.d.ts +9 -0
- package/dist/agents/handlers/wallets.js +222 -0
- package/dist/agents/handlers/wallets.js.map +1 -0
- package/dist/agents/index.d.ts +79 -0
- package/dist/agents/index.js +16690 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/subagents.d.ts +219 -0
- package/dist/agents/subagents.js +736 -0
- package/dist/agents/subagents.js.map +1 -0
- package/dist/alerts/index.d.ts +110 -0
- package/dist/alerts/index.js +421 -0
- package/dist/alerts/index.js.map +1 -0
- package/dist/alerts/realtime.d.ts +114 -0
- package/dist/alerts/realtime.js +262 -0
- package/dist/alerts/realtime.js.map +1 -0
- package/dist/api/apikeys.d.ts +74 -0
- package/dist/api/apikeys.js +319 -0
- package/dist/api/apikeys.js.map +1 -0
- package/dist/api/compute/code.d.ts +28 -0
- package/dist/api/compute/code.js +257 -0
- package/dist/api/compute/code.js.map +1 -0
- package/dist/api/compute/data.d.ts +72 -0
- package/dist/api/compute/data.js +264 -0
- package/dist/api/compute/data.js.map +1 -0
- package/dist/api/compute/gateway.d.ts +185 -0
- package/dist/api/compute/gateway.js +958 -0
- package/dist/api/compute/gateway.js.map +1 -0
- package/dist/api/compute/index.d.ts +21 -0
- package/dist/api/compute/index.js +46 -0
- package/dist/api/compute/index.js.map +1 -0
- package/dist/api/compute/llm.d.ts +64 -0
- package/dist/api/compute/llm.js +602 -0
- package/dist/api/compute/llm.js.map +1 -0
- package/dist/api/compute/persistence.d.ts +77 -0
- package/dist/api/compute/persistence.js +251 -0
- package/dist/api/compute/persistence.js.map +1 -0
- package/dist/api/compute/storage.d.ts +48 -0
- package/dist/api/compute/storage.js +283 -0
- package/dist/api/compute/storage.js.map +1 -0
- package/dist/api/compute/trade.d.ts +69 -0
- package/dist/api/compute/trade.js +460 -0
- package/dist/api/compute/trade.js.map +1 -0
- package/dist/api/compute/types.d.ts +271 -0
- package/dist/api/compute/types.js +87 -0
- package/dist/api/compute/types.js.map +1 -0
- package/dist/api/compute/web.d.ts +29 -0
- package/dist/api/compute/web.js +255 -0
- package/dist/api/compute/web.js.map +1 -0
- package/dist/api/custody.d.ts +48 -0
- package/dist/api/custody.js +272 -0
- package/dist/api/custody.js.map +1 -0
- package/dist/api/fees.d.ts +91 -0
- package/dist/api/fees.js +155 -0
- package/dist/api/fees.js.map +1 -0
- package/dist/api/gateway.d.ts +40 -0
- package/dist/api/gateway.js +569 -0
- package/dist/api/gateway.js.map +1 -0
- package/dist/api/index.d.ts +29 -0
- package/dist/api/index.js +55 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/jobs.d.ts +59 -0
- package/dist/api/jobs.js +362 -0
- package/dist/api/jobs.js.map +1 -0
- package/dist/api/middleware.d.ts +60 -0
- package/dist/api/middleware.js +315 -0
- package/dist/api/middleware.js.map +1 -0
- package/dist/api/prompt.d.ts +44 -0
- package/dist/api/prompt.js +345 -0
- package/dist/api/prompt.js.map +1 -0
- package/dist/api/sdk.d.ts +258 -0
- package/dist/api/sdk.js +341 -0
- package/dist/api/sdk.js.map +1 -0
- package/dist/api/server.d.ts +17 -0
- package/dist/api/server.js +852 -0
- package/dist/api/server.js.map +1 -0
- package/dist/api/types.d.ts +307 -0
- package/dist/api/types.js +64 -0
- package/dist/api/types.js.map +1 -0
- package/dist/arbitrage/index.d.ts +124 -0
- package/dist/arbitrage/index.js +482 -0
- package/dist/arbitrage/index.js.map +1 -0
- package/dist/auth/copilot.d.ts +87 -0
- package/dist/auth/copilot.js +328 -0
- package/dist/auth/copilot.js.map +1 -0
- package/dist/auth/google.d.ts +121 -0
- package/dist/auth/google.js +479 -0
- package/dist/auth/google.js.map +1 -0
- package/dist/auth/index.d.ts +8 -0
- package/dist/auth/index.js +25 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/oauth.d.ts +94 -0
- package/dist/auth/oauth.js +502 -0
- package/dist/auth/oauth.js.map +1 -0
- package/dist/auth/qwen.d.ts +110 -0
- package/dist/auth/qwen.js +351 -0
- package/dist/auth/qwen.js.map +1 -0
- package/dist/auto-reply/index.d.ts +143 -0
- package/dist/auto-reply/index.js +391 -0
- package/dist/auto-reply/index.js.map +1 -0
- package/dist/automation/cron.d.ts +66 -0
- package/dist/automation/cron.js +226 -0
- package/dist/automation/cron.js.map +1 -0
- package/dist/automation/heartbeats.d.ts +63 -0
- package/dist/automation/heartbeats.js +144 -0
- package/dist/automation/heartbeats.js.map +1 -0
- package/dist/automation/index.d.ts +9 -0
- package/dist/automation/index.js +15 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/automation/webhooks.d.ts +60 -0
- package/dist/automation/webhooks.js +225 -0
- package/dist/automation/webhooks.js.map +1 -0
- package/dist/bankr/client.d.ts +86 -0
- package/dist/bankr/client.js +177 -0
- package/dist/bankr/client.js.map +1 -0
- package/dist/bankr/index.d.ts +6 -0
- package/dist/bankr/index.js +23 -0
- package/dist/bankr/index.js.map +1 -0
- package/dist/base/index.d.ts +6 -0
- package/dist/base/index.js +23 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/provider.d.ts +27 -0
- package/dist/base/provider.js +128 -0
- package/dist/base/provider.js.map +1 -0
- package/dist/bin/worker.d.ts +31 -0
- package/dist/bin/worker.js +127 -0
- package/dist/bin/worker.js.map +1 -0
- package/dist/bittensor/chutes.d.ts +14 -0
- package/dist/bittensor/chutes.js +141 -0
- package/dist/bittensor/chutes.js.map +1 -0
- package/dist/bittensor/index.d.ts +7 -0
- package/dist/bittensor/index.js +13 -0
- package/dist/bittensor/index.js.map +1 -0
- package/dist/bittensor/persistence.d.ts +8 -0
- package/dist/bittensor/persistence.js +188 -0
- package/dist/bittensor/persistence.js.map +1 -0
- package/dist/bittensor/plugin.d.ts +30 -0
- package/dist/bittensor/plugin.js +134 -0
- package/dist/bittensor/plugin.js.map +1 -0
- package/dist/bittensor/python-runner.d.ts +7 -0
- package/dist/bittensor/python-runner.js +83 -0
- package/dist/bittensor/python-runner.js.map +1 -0
- package/dist/bittensor/server.d.ts +7 -0
- package/dist/bittensor/server.js +110 -0
- package/dist/bittensor/server.js.map +1 -0
- package/dist/bittensor/service.d.ts +7 -0
- package/dist/bittensor/service.js +291 -0
- package/dist/bittensor/service.js.map +1 -0
- package/dist/bittensor/tool.d.ts +45 -0
- package/dist/bittensor/tool.js +147 -0
- package/dist/bittensor/tool.js.map +1 -0
- package/dist/bittensor/types.d.ts +188 -0
- package/dist/bittensor/types.js +6 -0
- package/dist/bittensor/types.js.map +1 -0
- package/dist/bittensor/wallet.d.ts +18 -0
- package/dist/bittensor/wallet.js +192 -0
- package/dist/bittensor/wallet.js.map +1 -0
- package/dist/bridge/wormhole.d.ts +239 -0
- package/dist/bridge/wormhole.js +404 -0
- package/dist/bridge/wormhole.js.map +1 -0
- package/dist/browser/index.d.ts +67 -0
- package/dist/browser/index.js +458 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/cache/index.d.ts +105 -0
- package/dist/cache/index.js +306 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/canvas/index.d.ts +66 -0
- package/dist/canvas/index.js +391 -0
- package/dist/canvas/index.js.map +1 -0
- package/dist/channels/base-adapter.d.ts +126 -0
- package/dist/channels/base-adapter.js +416 -0
- package/dist/channels/base-adapter.js.map +1 -0
- package/dist/channels/bluebubbles/index.d.ts +23 -0
- package/dist/channels/bluebubbles/index.js +182 -0
- package/dist/channels/bluebubbles/index.js.map +1 -0
- package/dist/channels/discord/index.d.ts +25 -0
- package/dist/channels/discord/index.js +419 -0
- package/dist/channels/discord/index.js.map +1 -0
- package/dist/channels/googlechat/index.d.ts +35 -0
- package/dist/channels/googlechat/index.js +223 -0
- package/dist/channels/googlechat/index.js.map +1 -0
- package/dist/channels/imessage/index.d.ts +28 -0
- package/dist/channels/imessage/index.js +340 -0
- package/dist/channels/imessage/index.js.map +1 -0
- package/dist/channels/index.d.ts +58 -0
- package/dist/channels/index.js +382 -0
- package/dist/channels/index.js.map +1 -0
- package/dist/channels/line/index.d.ts +307 -0
- package/dist/channels/line/index.js +760 -0
- package/dist/channels/line/index.js.map +1 -0
- package/dist/channels/matrix/index.d.ts +35 -0
- package/dist/channels/matrix/index.js +328 -0
- package/dist/channels/matrix/index.js.map +1 -0
- package/dist/channels/mattermost/index.d.ts +25 -0
- package/dist/channels/mattermost/index.js +239 -0
- package/dist/channels/mattermost/index.js.map +1 -0
- package/dist/channels/nextcloud-talk/index.d.ts +25 -0
- package/dist/channels/nextcloud-talk/index.js +175 -0
- package/dist/channels/nextcloud-talk/index.js.map +1 -0
- package/dist/channels/nostr/index.d.ts +21 -0
- package/dist/channels/nostr/index.js +278 -0
- package/dist/channels/nostr/index.js.map +1 -0
- package/dist/channels/signal/index.d.ts +33 -0
- package/dist/channels/signal/index.js +333 -0
- package/dist/channels/signal/index.js.map +1 -0
- package/dist/channels/slack/index.d.ts +26 -0
- package/dist/channels/slack/index.js +266 -0
- package/dist/channels/slack/index.js.map +1 -0
- package/dist/channels/teams/index.d.ts +42 -0
- package/dist/channels/teams/index.js +312 -0
- package/dist/channels/teams/index.js.map +1 -0
- package/dist/channels/telegram/index.d.ts +9 -0
- package/dist/channels/telegram/index.js +761 -0
- package/dist/channels/telegram/index.js.map +1 -0
- package/dist/channels/tlon/index.d.ts +25 -0
- package/dist/channels/tlon/index.js +236 -0
- package/dist/channels/tlon/index.js.map +1 -0
- package/dist/channels/twitch/index.d.ts +25 -0
- package/dist/channels/twitch/index.js +182 -0
- package/dist/channels/twitch/index.js.map +1 -0
- package/dist/channels/voice/index.d.ts +31 -0
- package/dist/channels/voice/index.js +208 -0
- package/dist/channels/voice/index.js.map +1 -0
- package/dist/channels/webchat/index.d.ts +29 -0
- package/dist/channels/webchat/index.js +366 -0
- package/dist/channels/webchat/index.js.map +1 -0
- package/dist/channels/whatsapp/index.d.ts +72 -0
- package/dist/channels/whatsapp/index.js +767 -0
- package/dist/channels/whatsapp/index.js.map +1 -0
- package/dist/channels/zalo/index.d.ts +45 -0
- package/dist/channels/zalo/index.js +285 -0
- package/dist/channels/zalo/index.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +23 -0
- package/dist/cli/commands/doctor.js +649 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/gateway.d.ts +6 -0
- package/dist/cli/commands/gateway.js +32 -0
- package/dist/cli/commands/gateway.js.map +1 -0
- package/dist/cli/commands/index.d.ts +31 -0
- package/dist/cli/commands/index.js +3743 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/onboard.d.ts +4 -0
- package/dist/cli/commands/onboard.js +334 -0
- package/dist/cli/commands/onboard.js.map +1 -0
- package/dist/cli/commands/repl.d.ts +11 -0
- package/dist/cli/commands/repl.js +185 -0
- package/dist/cli/commands/repl.js.map +1 -0
- package/dist/cli/commands/skills.d.ts +29 -0
- package/dist/cli/commands/skills.js +297 -0
- package/dist/cli/commands/skills.js.map +1 -0
- package/dist/cli/index.d.ts +12 -0
- package/dist/cli/index.js +449 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/secure.d.ts +14 -0
- package/dist/cli/secure.js +626 -0
- package/dist/cli/secure.js.map +1 -0
- package/dist/commands/index.d.ts +61 -0
- package/dist/commands/index.js +290 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/registry.d.ts +69 -0
- package/dist/commands/registry.js +3142 -0
- package/dist/commands/registry.js.map +1 -0
- package/dist/config/index.d.ts +465 -0
- package/dist/config/index.js +1451 -0
- package/dist/config/index.js.map +1 -0
- package/dist/credentials/index.d.ts +51 -0
- package/dist/credentials/index.js +270 -0
- package/dist/credentials/index.js.map +1 -0
- package/dist/cron/index.d.ts +151 -0
- package/dist/cron/index.js +1283 -0
- package/dist/cron/index.js.map +1 -0
- package/dist/cron/types.d.ts +102 -0
- package/dist/cron/types.js +6 -0
- package/dist/cron/types.js.map +1 -0
- package/dist/daemon/index.d.ts +23 -0
- package/dist/daemon/index.js +159 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/db/index.d.ts +825 -0
- package/dist/db/index.js +3382 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +70 -0
- package/dist/db/migrations.js +1373 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/docker/index.d.ts +188 -0
- package/dist/docker/index.js +571 -0
- package/dist/docker/index.js.map +1 -0
- package/dist/doctor/index.d.ts +47 -0
- package/dist/doctor/index.js +379 -0
- package/dist/doctor/index.js.map +1 -0
- package/dist/embeddings/index.d.ts +65 -0
- package/dist/embeddings/index.js +399 -0
- package/dist/embeddings/index.js.map +1 -0
- package/dist/evm/contracts.d.ts +112 -0
- package/dist/evm/contracts.js +332 -0
- package/dist/evm/contracts.js.map +1 -0
- package/dist/evm/index.d.ts +21 -0
- package/dist/evm/index.js +45 -0
- package/dist/evm/index.js.map +1 -0
- package/dist/evm/multichain.d.ts +87 -0
- package/dist/evm/multichain.js +308 -0
- package/dist/evm/multichain.js.map +1 -0
- package/dist/evm/odos.d.ts +62 -0
- package/dist/evm/odos.js +261 -0
- package/dist/evm/odos.js.map +1 -0
- package/dist/evm/oneinch.d.ts +55 -0
- package/dist/evm/oneinch.js +324 -0
- package/dist/evm/oneinch.js.map +1 -0
- package/dist/evm/transfers.d.ts +83 -0
- package/dist/evm/transfers.js +393 -0
- package/dist/evm/transfers.js.map +1 -0
- package/dist/evm/uniswap.d.ts +56 -0
- package/dist/evm/uniswap.js +307 -0
- package/dist/evm/uniswap.js.map +1 -0
- package/dist/evm/virtuals.d.ts +220 -0
- package/dist/evm/virtuals.js +735 -0
- package/dist/evm/virtuals.js.map +1 -0
- package/dist/evm/wallet.d.ts +96 -0
- package/dist/evm/wallet.js +258 -0
- package/dist/evm/wallet.js.map +1 -0
- package/dist/exchanges/binance-futures/index.d.ts +83 -0
- package/dist/exchanges/binance-futures/index.js +394 -0
- package/dist/exchanges/binance-futures/index.js.map +1 -0
- package/dist/exchanges/bybit/index.d.ts +78 -0
- package/dist/exchanges/bybit/index.js +379 -0
- package/dist/exchanges/bybit/index.js.map +1 -0
- package/dist/exchanges/hyperliquid/index.d.ts +594 -0
- package/dist/exchanges/hyperliquid/index.js +1101 -0
- package/dist/exchanges/hyperliquid/index.js.map +1 -0
- package/dist/exchanges/mexc/index.d.ts +80 -0
- package/dist/exchanges/mexc/index.js +389 -0
- package/dist/exchanges/mexc/index.js.map +1 -0
- package/dist/exchanges/opinion/index.d.ts +128 -0
- package/dist/exchanges/opinion/index.js +443 -0
- package/dist/exchanges/opinion/index.js.map +1 -0
- package/dist/exchanges/predictfun/index.d.ts +107 -0
- package/dist/exchanges/predictfun/index.js +398 -0
- package/dist/exchanges/predictfun/index.js.map +1 -0
- package/dist/execution/auto-redeem.d.ts +55 -0
- package/dist/execution/auto-redeem.js +324 -0
- package/dist/execution/auto-redeem.js.map +1 -0
- package/dist/execution/bracket-orders.d.ts +84 -0
- package/dist/execution/bracket-orders.js +387 -0
- package/dist/execution/bracket-orders.js.map +1 -0
- package/dist/execution/circuit-breaker.d.ts +87 -0
- package/dist/execution/circuit-breaker.js +274 -0
- package/dist/execution/circuit-breaker.js.map +1 -0
- package/dist/execution/dca-persistence.d.ts +47 -0
- package/dist/execution/dca-persistence.js +159 -0
- package/dist/execution/dca-persistence.js.map +1 -0
- package/dist/execution/dca.d.ts +60 -0
- package/dist/execution/dca.js +273 -0
- package/dist/execution/dca.js.map +1 -0
- package/dist/execution/futures.d.ts +162 -0
- package/dist/execution/futures.js +1336 -0
- package/dist/execution/futures.js.map +1 -0
- package/dist/execution/index.d.ts +346 -0
- package/dist/execution/index.js +2532 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/mev-protection.d.ts +150 -0
- package/dist/execution/mev-protection.js +377 -0
- package/dist/execution/mev-protection.js.map +1 -0
- package/dist/execution/order-persistence.d.ts +81 -0
- package/dist/execution/order-persistence.js +350 -0
- package/dist/execution/order-persistence.js.map +1 -0
- package/dist/execution/position-manager.d.ts +142 -0
- package/dist/execution/position-manager.js +404 -0
- package/dist/execution/position-manager.js.map +1 -0
- package/dist/execution/smart-router.d.ts +90 -0
- package/dist/execution/smart-router.js +323 -0
- package/dist/execution/smart-router.js.map +1 -0
- package/dist/execution/trigger-orders.d.ts +81 -0
- package/dist/execution/trigger-orders.js +266 -0
- package/dist/execution/trigger-orders.js.map +1 -0
- package/dist/execution/twap.d.ts +87 -0
- package/dist/execution/twap.js +405 -0
- package/dist/execution/twap.js.map +1 -0
- package/dist/extensions/copilot-proxy/index.d.ts +49 -0
- package/dist/extensions/copilot-proxy/index.js +204 -0
- package/dist/extensions/copilot-proxy/index.js.map +1 -0
- package/dist/extensions/diagnostics-otel/index.d.ts +54 -0
- package/dist/extensions/diagnostics-otel/index.js +290 -0
- package/dist/extensions/diagnostics-otel/index.js.map +1 -0
- package/dist/extensions/google-auth/index.d.ts +71 -0
- package/dist/extensions/google-auth/index.js +350 -0
- package/dist/extensions/google-auth/index.js.map +1 -0
- package/dist/extensions/index.d.ts +11 -0
- package/dist/extensions/index.js +29 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/llm-task/index.d.ts +80 -0
- package/dist/extensions/llm-task/index.js +248 -0
- package/dist/extensions/llm-task/index.js.map +1 -0
- package/dist/extensions/lobster/index.d.ts +69 -0
- package/dist/extensions/lobster/index.js +178 -0
- package/dist/extensions/lobster/index.js.map +1 -0
- package/dist/extensions/memory-lancedb/index.d.ts +62 -0
- package/dist/extensions/memory-lancedb/index.js +343 -0
- package/dist/extensions/memory-lancedb/index.js.map +1 -0
- package/dist/extensions/open-prose/index.d.ts +82 -0
- package/dist/extensions/open-prose/index.js +565 -0
- package/dist/extensions/open-prose/index.js.map +1 -0
- package/dist/extensions/qwen-portal/index.d.ts +48 -0
- package/dist/extensions/qwen-portal/index.js +161 -0
- package/dist/extensions/qwen-portal/index.js.map +1 -0
- package/dist/extensions/task-runner/index.d.ts +121 -0
- package/dist/extensions/task-runner/index.js +640 -0
- package/dist/extensions/task-runner/index.js.map +1 -0
- package/dist/farcaster/client.d.ts +101 -0
- package/dist/farcaster/client.js +282 -0
- package/dist/farcaster/client.js.map +1 -0
- package/dist/farcaster/index.d.ts +4 -0
- package/dist/farcaster/index.js +21 -0
- package/dist/farcaster/index.js.map +1 -0
- package/dist/feeds/acled/index.d.ts +86 -0
- package/dist/feeds/acled/index.js +215 -0
- package/dist/feeds/acled/index.js.map +1 -0
- package/dist/feeds/agentbets/index.d.ts +17 -0
- package/dist/feeds/agentbets/index.js +137 -0
- package/dist/feeds/agentbets/index.js.map +1 -0
- package/dist/feeds/betfair/index.d.ts +132 -0
- package/dist/feeds/betfair/index.js +640 -0
- package/dist/feeds/betfair/index.js.map +1 -0
- package/dist/feeds/crypto/index.d.ts +101 -0
- package/dist/feeds/crypto/index.js +506 -0
- package/dist/feeds/crypto/index.js.map +1 -0
- package/dist/feeds/crypto/whale-tracker.d.ts +138 -0
- package/dist/feeds/crypto/whale-tracker.js +685 -0
- package/dist/feeds/crypto/whale-tracker.js.map +1 -0
- package/dist/feeds/descriptors.d.ts +14 -0
- package/dist/feeds/descriptors.js +582 -0
- package/dist/feeds/descriptors.js.map +1 -0
- package/dist/feeds/drift/index.d.ts +23 -0
- package/dist/feeds/drift/index.js +182 -0
- package/dist/feeds/drift/index.js.map +1 -0
- package/dist/feeds/drift/trading.d.ts +75 -0
- package/dist/feeds/drift/trading.js +457 -0
- package/dist/feeds/drift/trading.js.map +1 -0
- package/dist/feeds/external/index.d.ts +48 -0
- package/dist/feeds/external/index.js +575 -0
- package/dist/feeds/external/index.js.map +1 -0
- package/dist/feeds/fred/index.d.ts +134 -0
- package/dist/feeds/fred/index.js +263 -0
- package/dist/feeds/fred/index.js.map +1 -0
- package/dist/feeds/freshness.d.ts +79 -0
- package/dist/feeds/freshness.js +259 -0
- package/dist/feeds/freshness.js.map +1 -0
- package/dist/feeds/hedgehog/index.d.ts +24 -0
- package/dist/feeds/hedgehog/index.js +589 -0
- package/dist/feeds/hedgehog/index.js.map +1 -0
- package/dist/feeds/hedgehog/types.d.ts +215 -0
- package/dist/feeds/hedgehog/types.js +7 -0
- package/dist/feeds/hedgehog/types.js.map +1 -0
- package/dist/feeds/index.d.ts +38 -0
- package/dist/feeds/index.js +469 -0
- package/dist/feeds/index.js.map +1 -0
- package/dist/feeds/kalshi/index.d.ts +116 -0
- package/dist/feeds/kalshi/index.js +970 -0
- package/dist/feeds/kalshi/index.js.map +1 -0
- package/dist/feeds/manifold/index.d.ts +15 -0
- package/dist/feeds/manifold/index.js +269 -0
- package/dist/feeds/manifold/index.js.map +1 -0
- package/dist/feeds/metaculus/index.d.ts +22 -0
- package/dist/feeds/metaculus/index.js +149 -0
- package/dist/feeds/metaculus/index.js.map +1 -0
- package/dist/feeds/news/index.d.ts +20 -0
- package/dist/feeds/news/index.js +308 -0
- package/dist/feeds/news/index.js.map +1 -0
- package/dist/feeds/opinion/index.d.ts +31 -0
- package/dist/feeds/opinion/index.js +389 -0
- package/dist/feeds/opinion/index.js.map +1 -0
- package/dist/feeds/polymarket/index.d.ts +21 -0
- package/dist/feeds/polymarket/index.js +501 -0
- package/dist/feeds/polymarket/index.js.map +1 -0
- package/dist/feeds/polymarket/rtds.d.ts +40 -0
- package/dist/feeds/polymarket/rtds.js +159 -0
- package/dist/feeds/polymarket/rtds.js.map +1 -0
- package/dist/feeds/polymarket/user-ws.d.ts +64 -0
- package/dist/feeds/polymarket/user-ws.js +230 -0
- package/dist/feeds/polymarket/user-ws.js.map +1 -0
- package/dist/feeds/polymarket/whale-tracker.d.ts +152 -0
- package/dist/feeds/polymarket/whale-tracker.js +709 -0
- package/dist/feeds/polymarket/whale-tracker.js.map +1 -0
- package/dist/feeds/predictfun/index.d.ts +24 -0
- package/dist/feeds/predictfun/index.js +234 -0
- package/dist/feeds/predictfun/index.js.map +1 -0
- package/dist/feeds/predictit/index.d.ts +14 -0
- package/dist/feeds/predictit/index.js +88 -0
- package/dist/feeds/predictit/index.js.map +1 -0
- package/dist/feeds/registry.d.ts +148 -0
- package/dist/feeds/registry.js +197 -0
- package/dist/feeds/registry.js.map +1 -0
- package/dist/feeds/smarkets/index.d.ts +76 -0
- package/dist/feeds/smarkets/index.js +415 -0
- package/dist/feeds/smarkets/index.js.map +1 -0
- package/dist/feeds/virtuals/index.d.ts +92 -0
- package/dist/feeds/virtuals/index.js +341 -0
- package/dist/feeds/virtuals/index.js.map +1 -0
- package/dist/feeds/weather-nws/index.d.ts +73 -0
- package/dist/feeds/weather-nws/index.js +162 -0
- package/dist/feeds/weather-nws/index.js.map +1 -0
- package/dist/feeds/weather-openmeteo/index.d.ts +80 -0
- package/dist/feeds/weather-openmeteo/index.js +197 -0
- package/dist/feeds/weather-openmeteo/index.js.map +1 -0
- package/dist/gateway/alerts-routes.d.ts +15 -0
- package/dist/gateway/alerts-routes.js +188 -0
- package/dist/gateway/alerts-routes.js.map +1 -0
- package/dist/gateway/alt-data-routes.d.ts +15 -0
- package/dist/gateway/alt-data-routes.js +67 -0
- package/dist/gateway/alt-data-routes.js.map +1 -0
- package/dist/gateway/api-routes.d.ts +39 -0
- package/dist/gateway/api-routes.js +1028 -0
- package/dist/gateway/api-routes.js.map +1 -0
- package/dist/gateway/audit-routes.d.ts +8 -0
- package/dist/gateway/audit-routes.js +61 -0
- package/dist/gateway/audit-routes.js.map +1 -0
- package/dist/gateway/bracket-routes.d.ts +12 -0
- package/dist/gateway/bracket-routes.js +122 -0
- package/dist/gateway/bracket-routes.js.map +1 -0
- package/dist/gateway/control-ui.d.ts +45 -0
- package/dist/gateway/control-ui.js +301 -0
- package/dist/gateway/control-ui.js.map +1 -0
- package/dist/gateway/copy-trading-routes.d.ts +12 -0
- package/dist/gateway/copy-trading-routes.js +159 -0
- package/dist/gateway/copy-trading-routes.js.map +1 -0
- package/dist/gateway/cron-routes.d.ts +14 -0
- package/dist/gateway/cron-routes.js +132 -0
- package/dist/gateway/cron-routes.js.map +1 -0
- package/dist/gateway/dca-routes.d.ts +8 -0
- package/dist/gateway/dca-routes.js +179 -0
- package/dist/gateway/dca-routes.js.map +1 -0
- package/dist/gateway/embeddings-routes.d.ts +12 -0
- package/dist/gateway/embeddings-routes.js +102 -0
- package/dist/gateway/embeddings-routes.js.map +1 -0
- package/dist/gateway/feeds-routes.d.ts +34 -0
- package/dist/gateway/feeds-routes.js +167 -0
- package/dist/gateway/feeds-routes.js.map +1 -0
- package/dist/gateway/index.d.ts +100 -0
- package/dist/gateway/index.js +2321 -0
- package/dist/gateway/index.js.map +1 -0
- package/dist/gateway/monitoring-routes.d.ts +12 -0
- package/dist/gateway/monitoring-routes.js +73 -0
- package/dist/gateway/monitoring-routes.js.map +1 -0
- package/dist/gateway/opportunity-routes.d.ts +12 -0
- package/dist/gateway/opportunity-routes.js +238 -0
- package/dist/gateway/opportunity-routes.js.map +1 -0
- package/dist/gateway/payments-routes.d.ts +14 -0
- package/dist/gateway/payments-routes.js +82 -0
- package/dist/gateway/payments-routes.js.map +1 -0
- package/dist/gateway/percolator-routes.d.ts +16 -0
- package/dist/gateway/percolator-routes.js +139 -0
- package/dist/gateway/percolator-routes.js.map +1 -0
- package/dist/gateway/queue-routes.d.ts +12 -0
- package/dist/gateway/queue-routes.js +47 -0
- package/dist/gateway/queue-routes.js.map +1 -0
- package/dist/gateway/risk-routes.d.ts +12 -0
- package/dist/gateway/risk-routes.js +119 -0
- package/dist/gateway/risk-routes.js.map +1 -0
- package/dist/gateway/routing-routes.d.ts +12 -0
- package/dist/gateway/routing-routes.js +86 -0
- package/dist/gateway/routing-routes.js.map +1 -0
- package/dist/gateway/server.d.ts +215 -0
- package/dist/gateway/server.js +2287 -0
- package/dist/gateway/server.js.map +1 -0
- package/dist/gateway/shield-routes.d.ts +8 -0
- package/dist/gateway/shield-routes.js +88 -0
- package/dist/gateway/shield-routes.js.map +1 -0
- package/dist/gateway/signal-bus.d.ts +51 -0
- package/dist/gateway/signal-bus.js +64 -0
- package/dist/gateway/signal-bus.js.map +1 -0
- package/dist/gateway/trigger-routes.d.ts +12 -0
- package/dist/gateway/trigger-routes.js +127 -0
- package/dist/gateway/trigger-routes.js.map +1 -0
- package/dist/gateway/twap-routes.d.ts +12 -0
- package/dist/gateway/twap-routes.js +142 -0
- package/dist/gateway/twap-routes.js.map +1 -0
- package/dist/gateway/webhooks-routes.d.ts +31 -0
- package/dist/gateway/webhooks-routes.js +107 -0
- package/dist/gateway/webhooks-routes.js.map +1 -0
- package/dist/gateway/whale-routes.d.ts +12 -0
- package/dist/gateway/whale-routes.js +204 -0
- package/dist/gateway/whale-routes.js.map +1 -0
- package/dist/history/index.d.ts +81 -0
- package/dist/history/index.js +362 -0
- package/dist/history/index.js.map +1 -0
- package/dist/hooks/index.d.ts +279 -0
- package/dist/hooks/index.js +739 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/i18n/index.d.ts +65 -0
- package/dist/i18n/index.js +183 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/identity/erc8004.d.ts +104 -0
- package/dist/identity/erc8004.js +493 -0
- package/dist/identity/erc8004.js.map +1 -0
- package/dist/identity/index.d.ts +1 -0
- package/dist/identity/index.js +18 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +240 -0
- package/dist/index.js.map +1 -0
- package/dist/infra/index.d.ts +133 -0
- package/dist/infra/index.js +481 -0
- package/dist/infra/index.js.map +1 -0
- package/dist/infra/retry.d.ts +132 -0
- package/dist/infra/retry.js +450 -0
- package/dist/infra/retry.js.map +1 -0
- package/dist/ledger/anchor.d.ts +45 -0
- package/dist/ledger/anchor.js +271 -0
- package/dist/ledger/anchor.js.map +1 -0
- package/dist/ledger/hash.d.ts +26 -0
- package/dist/ledger/hash.js +69 -0
- package/dist/ledger/hash.js.map +1 -0
- package/dist/ledger/hooks.d.ts +107 -0
- package/dist/ledger/hooks.js +314 -0
- package/dist/ledger/hooks.js.map +1 -0
- package/dist/ledger/index.d.ts +67 -0
- package/dist/ledger/index.js +221 -0
- package/dist/ledger/index.js.map +1 -0
- package/dist/ledger/storage.d.ts +57 -0
- package/dist/ledger/storage.js +368 -0
- package/dist/ledger/storage.js.map +1 -0
- package/dist/ledger/types.d.ts +138 -0
- package/dist/ledger/types.js +16 -0
- package/dist/ledger/types.js.map +1 -0
- package/dist/link-understanding/index.d.ts +61 -0
- package/dist/link-understanding/index.js +320 -0
- package/dist/link-understanding/index.js.map +1 -0
- package/dist/logging/index.d.ts +50 -0
- package/dist/logging/index.js +255 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/macos/index.d.ts +143 -0
- package/dist/macos/index.js +587 -0
- package/dist/macos/index.js.map +1 -0
- package/dist/markdown/index.d.ts +43 -0
- package/dist/markdown/index.js +305 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/market-index/index.d.ts +51 -0
- package/dist/market-index/index.js +553 -0
- package/dist/market-index/index.js.map +1 -0
- package/dist/mcp/index.d.ts +263 -0
- package/dist/mcp/index.js +940 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/installer.d.ts +11 -0
- package/dist/mcp/installer.js +128 -0
- package/dist/mcp/installer.js.map +1 -0
- package/dist/mcp/server.d.ts +7 -0
- package/dist/mcp/server.js +172 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/media/index.d.ts +119 -0
- package/dist/media/index.js +740 -0
- package/dist/media/index.js.map +1 -0
- package/dist/memory/context.d.ts +189 -0
- package/dist/memory/context.js +541 -0
- package/dist/memory/context.js.map +1 -0
- package/dist/memory/index.d.ts +74 -0
- package/dist/memory/index.js +352 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/summarizer.d.ts +10 -0
- package/dist/memory/summarizer.js +51 -0
- package/dist/memory/summarizer.js.map +1 -0
- package/dist/memory/tokenizer.d.ts +4 -0
- package/dist/memory/tokenizer.js +61 -0
- package/dist/memory/tokenizer.js.map +1 -0
- package/dist/messages/unified.d.ts +7 -0
- package/dist/messages/unified.js +77 -0
- package/dist/messages/unified.js.map +1 -0
- package/dist/ml-pipeline/collector.d.ts +23 -0
- package/dist/ml-pipeline/collector.js +176 -0
- package/dist/ml-pipeline/collector.js.map +1 -0
- package/dist/ml-pipeline/index.d.ts +21 -0
- package/dist/ml-pipeline/index.js +72 -0
- package/dist/ml-pipeline/index.js.map +1 -0
- package/dist/ml-pipeline/trainer.d.ts +32 -0
- package/dist/ml-pipeline/trainer.js +228 -0
- package/dist/ml-pipeline/trainer.js.map +1 -0
- package/dist/ml-pipeline/types.d.ts +51 -0
- package/dist/ml-pipeline/types.js +23 -0
- package/dist/ml-pipeline/types.js.map +1 -0
- package/dist/models/adaptive.d.ts +11 -0
- package/dist/models/adaptive.js +64 -0
- package/dist/models/adaptive.js.map +1 -0
- package/dist/models/failover.d.ts +51 -0
- package/dist/models/failover.js +151 -0
- package/dist/models/failover.js.map +1 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.js +13 -0
- package/dist/models/index.js.map +1 -0
- package/dist/monitoring/alerts.d.ts +185 -0
- package/dist/monitoring/alerts.js +565 -0
- package/dist/monitoring/alerts.js.map +1 -0
- package/dist/monitoring/health.d.ts +151 -0
- package/dist/monitoring/health.js +423 -0
- package/dist/monitoring/health.js.map +1 -0
- package/dist/monitoring/index.d.ts +25 -0
- package/dist/monitoring/index.js +258 -0
- package/dist/monitoring/index.js.map +1 -0
- package/dist/monitoring/metrics.d.ts +147 -0
- package/dist/monitoring/metrics.js +519 -0
- package/dist/monitoring/metrics.js.map +1 -0
- package/dist/nodes/index.d.ts +81 -0
- package/dist/nodes/index.js +475 -0
- package/dist/nodes/index.js.map +1 -0
- package/dist/opportunity/analytics.d.ts +221 -0
- package/dist/opportunity/analytics.js +678 -0
- package/dist/opportunity/analytics.js.map +1 -0
- package/dist/opportunity/combinatorial.d.ts +147 -0
- package/dist/opportunity/combinatorial.js +765 -0
- package/dist/opportunity/combinatorial.js.map +1 -0
- package/dist/opportunity/correlation.d.ts +107 -0
- package/dist/opportunity/correlation.js +410 -0
- package/dist/opportunity/correlation.js.map +1 -0
- package/dist/opportunity/executor.d.ts +108 -0
- package/dist/opportunity/executor.js +356 -0
- package/dist/opportunity/executor.js.map +1 -0
- package/dist/opportunity/index.d.ts +285 -0
- package/dist/opportunity/index.js +839 -0
- package/dist/opportunity/index.js.map +1 -0
- package/dist/opportunity/links.d.ts +87 -0
- package/dist/opportunity/links.js +344 -0
- package/dist/opportunity/links.js.map +1 -0
- package/dist/opportunity/matching.d.ts +101 -0
- package/dist/opportunity/matching.js +551 -0
- package/dist/opportunity/matching.js.map +1 -0
- package/dist/opportunity/outcomes.d.ts +74 -0
- package/dist/opportunity/outcomes.js +321 -0
- package/dist/opportunity/outcomes.js.map +1 -0
- package/dist/opportunity/risk.d.ts +128 -0
- package/dist/opportunity/risk.js +381 -0
- package/dist/opportunity/risk.js.map +1 -0
- package/dist/opportunity/scoring.d.ts +151 -0
- package/dist/opportunity/scoring.js +421 -0
- package/dist/opportunity/scoring.js.map +1 -0
- package/dist/pairing/index.d.ts +108 -0
- package/dist/pairing/index.js +431 -0
- package/dist/pairing/index.js.map +1 -0
- package/dist/payments/index.d.ts +12 -0
- package/dist/payments/index.js +34 -0
- package/dist/payments/index.js.map +1 -0
- package/dist/payments/x402/evm.d.ts +53 -0
- package/dist/payments/x402/evm.js +282 -0
- package/dist/payments/x402/evm.js.map +1 -0
- package/dist/payments/x402/index.d.ts +158 -0
- package/dist/payments/x402/index.js +531 -0
- package/dist/payments/x402/index.js.map +1 -0
- package/dist/payments/x402/solana.d.ts +51 -0
- package/dist/payments/x402/solana.js +397 -0
- package/dist/payments/x402/solana.js.map +1 -0
- package/dist/percolator/accounts.d.ts +21 -0
- package/dist/percolator/accounts.js +76 -0
- package/dist/percolator/accounts.js.map +1 -0
- package/dist/percolator/encode.d.ts +14 -0
- package/dist/percolator/encode.js +90 -0
- package/dist/percolator/encode.js.map +1 -0
- package/dist/percolator/execution.d.ts +29 -0
- package/dist/percolator/execution.js +239 -0
- package/dist/percolator/execution.js.map +1 -0
- package/dist/percolator/feed.d.ts +15 -0
- package/dist/percolator/feed.js +160 -0
- package/dist/percolator/feed.js.map +1 -0
- package/dist/percolator/index.d.ts +20 -0
- package/dist/percolator/index.js +24 -0
- package/dist/percolator/index.js.map +1 -0
- package/dist/percolator/instructions.d.ts +29 -0
- package/dist/percolator/instructions.js +52 -0
- package/dist/percolator/instructions.js.map +1 -0
- package/dist/percolator/keeper.d.ts +11 -0
- package/dist/percolator/keeper.js +83 -0
- package/dist/percolator/keeper.js.map +1 -0
- package/dist/percolator/pda.d.ts +15 -0
- package/dist/percolator/pda.js +26 -0
- package/dist/percolator/pda.js.map +1 -0
- package/dist/percolator/slab.d.ts +122 -0
- package/dist/percolator/slab.js +325 -0
- package/dist/percolator/slab.js.map +1 -0
- package/dist/percolator/tx.d.ts +27 -0
- package/dist/percolator/tx.js +77 -0
- package/dist/percolator/tx.js.map +1 -0
- package/dist/percolator/types.d.ts +51 -0
- package/dist/percolator/types.js +9 -0
- package/dist/percolator/types.js.map +1 -0
- package/dist/permissions/index.d.ts +262 -0
- package/dist/permissions/index.js +929 -0
- package/dist/permissions/index.js.map +1 -0
- package/dist/plugins/index.d.ts +158 -0
- package/dist/plugins/index.js +444 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/portfolio/index.d.ts +170 -0
- package/dist/portfolio/index.js +970 -0
- package/dist/portfolio/index.js.map +1 -0
- package/dist/presence/index.d.ts +34 -0
- package/dist/presence/index.js +124 -0
- package/dist/presence/index.js.map +1 -0
- package/dist/process/index.d.ts +82 -0
- package/dist/process/index.js +402 -0
- package/dist/process/index.js.map +1 -0
- package/dist/providers/discovery.d.ts +209 -0
- package/dist/providers/discovery.js +751 -0
- package/dist/providers/discovery.js.map +1 -0
- package/dist/providers/health.d.ts +27 -0
- package/dist/providers/health.js +80 -0
- package/dist/providers/health.js.map +1 -0
- package/dist/providers/index.d.ts +154 -0
- package/dist/providers/index.js +897 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/queue/index.d.ts +36 -0
- package/dist/queue/index.js +146 -0
- package/dist/queue/index.js.map +1 -0
- package/dist/queue/jobs/index.d.ts +11 -0
- package/dist/queue/jobs/index.js +32 -0
- package/dist/queue/jobs/index.js.map +1 -0
- package/dist/queue/jobs/producer.d.ts +43 -0
- package/dist/queue/jobs/producer.js +233 -0
- package/dist/queue/jobs/producer.js.map +1 -0
- package/dist/queue/jobs/types.d.ts +128 -0
- package/dist/queue/jobs/types.js +14 -0
- package/dist/queue/jobs/types.js.map +1 -0
- package/dist/queue/jobs/worker.d.ts +22 -0
- package/dist/queue/jobs/worker.js +220 -0
- package/dist/queue/jobs/worker.js.map +1 -0
- package/dist/remote/index.d.ts +136 -0
- package/dist/remote/index.js +456 -0
- package/dist/remote/index.js.map +1 -0
- package/dist/risk/circuit-breaker.d.ts +99 -0
- package/dist/risk/circuit-breaker.js +300 -0
- package/dist/risk/circuit-breaker.js.map +1 -0
- package/dist/risk/dashboard.d.ts +69 -0
- package/dist/risk/dashboard.js +127 -0
- package/dist/risk/dashboard.js.map +1 -0
- package/dist/risk/engine.d.ts +128 -0
- package/dist/risk/engine.js +311 -0
- package/dist/risk/engine.js.map +1 -0
- package/dist/risk/index.d.ts +10 -0
- package/dist/risk/index.js +38 -0
- package/dist/risk/index.js.map +1 -0
- package/dist/risk/stress.d.ts +70 -0
- package/dist/risk/stress.js +215 -0
- package/dist/risk/stress.js.map +1 -0
- package/dist/risk/var.d.ts +72 -0
- package/dist/risk/var.js +173 -0
- package/dist/risk/var.js.map +1 -0
- package/dist/risk/volatility.d.ts +61 -0
- package/dist/risk/volatility.js +132 -0
- package/dist/risk/volatility.js.map +1 -0
- package/dist/routing/index.d.ts +116 -0
- package/dist/routing/index.js +371 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/search/index.d.ts +30 -0
- package/dist/search/index.js +129 -0
- package/dist/search/index.js.map +1 -0
- package/dist/security/address-checker.d.ts +6 -0
- package/dist/security/address-checker.js +213 -0
- package/dist/security/address-checker.js.map +1 -0
- package/dist/security/code-scanner.d.ts +3 -0
- package/dist/security/code-scanner.js +190 -0
- package/dist/security/code-scanner.js.map +1 -0
- package/dist/security/index.d.ts +176 -0
- package/dist/security/index.js +498 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/sanitizer.d.ts +2 -0
- package/dist/security/sanitizer.js +135 -0
- package/dist/security/sanitizer.js.map +1 -0
- package/dist/security/scam-db.d.ts +5 -0
- package/dist/security/scam-db.js +116 -0
- package/dist/security/scam-db.js.map +1 -0
- package/dist/security/shield.d.ts +12 -0
- package/dist/security/shield.js +80 -0
- package/dist/security/shield.js.map +1 -0
- package/dist/security/tx-validator.d.ts +5 -0
- package/dist/security/tx-validator.js +115 -0
- package/dist/security/tx-validator.js.map +1 -0
- package/dist/security/types.d.ts +84 -0
- package/dist/security/types.js +6 -0
- package/dist/security/types.js.map +1 -0
- package/dist/services/alt-data/feeds/fear-greed.d.ts +14 -0
- package/dist/services/alt-data/feeds/fear-greed.js +81 -0
- package/dist/services/alt-data/feeds/fear-greed.js.map +1 -0
- package/dist/services/alt-data/feeds/funding-rates.d.ts +13 -0
- package/dist/services/alt-data/feeds/funding-rates.js +90 -0
- package/dist/services/alt-data/feeds/funding-rates.js.map +1 -0
- package/dist/services/alt-data/feeds/reddit.d.ts +13 -0
- package/dist/services/alt-data/feeds/reddit.js +112 -0
- package/dist/services/alt-data/feeds/reddit.js.map +1 -0
- package/dist/services/alt-data/index.d.ts +31 -0
- package/dist/services/alt-data/index.js +278 -0
- package/dist/services/alt-data/index.js.map +1 -0
- package/dist/services/alt-data/market-matcher.d.ts +29 -0
- package/dist/services/alt-data/market-matcher.js +157 -0
- package/dist/services/alt-data/market-matcher.js.map +1 -0
- package/dist/services/alt-data/sentiment.d.ts +11 -0
- package/dist/services/alt-data/sentiment.js +277 -0
- package/dist/services/alt-data/sentiment.js.map +1 -0
- package/dist/services/alt-data/types.d.ts +86 -0
- package/dist/services/alt-data/types.js +9 -0
- package/dist/services/alt-data/types.js.map +1 -0
- package/dist/services/feature-engineering/accessor.d.ts +19 -0
- package/dist/services/feature-engineering/accessor.js +31 -0
- package/dist/services/feature-engineering/accessor.js.map +1 -0
- package/dist/services/feature-engineering/index.d.ts +15 -0
- package/dist/services/feature-engineering/index.js +345 -0
- package/dist/services/feature-engineering/index.js.map +1 -0
- package/dist/services/feature-engineering/indicators.d.ts +90 -0
- package/dist/services/feature-engineering/indicators.js +254 -0
- package/dist/services/feature-engineering/indicators.js.map +1 -0
- package/dist/services/feature-engineering/rolling-window.d.ts +89 -0
- package/dist/services/feature-engineering/rolling-window.js +173 -0
- package/dist/services/feature-engineering/rolling-window.js.map +1 -0
- package/dist/services/feature-engineering/thresholds.d.ts +137 -0
- package/dist/services/feature-engineering/thresholds.js +280 -0
- package/dist/services/feature-engineering/thresholds.js.map +1 -0
- package/dist/services/feature-engineering/types.d.ts +138 -0
- package/dist/services/feature-engineering/types.js +6 -0
- package/dist/services/feature-engineering/types.js.map +1 -0
- package/dist/services/tick-recorder/index.d.ts +12 -0
- package/dist/services/tick-recorder/index.js +200 -0
- package/dist/services/tick-recorder/index.js.map +1 -0
- package/dist/services/tick-recorder/queries.d.ts +46 -0
- package/dist/services/tick-recorder/queries.js +291 -0
- package/dist/services/tick-recorder/queries.js.map +1 -0
- package/dist/services/tick-recorder/schema.d.ts +27 -0
- package/dist/services/tick-recorder/schema.js +185 -0
- package/dist/services/tick-recorder/schema.js.map +1 -0
- package/dist/services/tick-recorder/timescale.d.ts +27 -0
- package/dist/services/tick-recorder/timescale.js +105 -0
- package/dist/services/tick-recorder/timescale.js.map +1 -0
- package/dist/services/tick-recorder/types.d.ts +113 -0
- package/dist/services/tick-recorder/types.js +7 -0
- package/dist/services/tick-recorder/types.js.map +1 -0
- package/dist/services/tick-streamer/index.d.ts +12 -0
- package/dist/services/tick-streamer/index.js +317 -0
- package/dist/services/tick-streamer/index.js.map +1 -0
- package/dist/services/tick-streamer/types.d.ts +134 -0
- package/dist/services/tick-streamer/types.js +6 -0
- package/dist/services/tick-streamer/types.js.map +1 -0
- package/dist/session/index.d.ts +147 -0
- package/dist/session/index.js +429 -0
- package/dist/session/index.js.map +1 -0
- package/dist/sessions/index.d.ts +69 -0
- package/dist/sessions/index.js +447 -0
- package/dist/sessions/index.js.map +1 -0
- package/dist/signal-router/index.d.ts +2 -0
- package/dist/signal-router/index.js +6 -0
- package/dist/signal-router/index.js.map +1 -0
- package/dist/signal-router/router.d.ts +25 -0
- package/dist/signal-router/router.js +391 -0
- package/dist/signal-router/router.js.map +1 -0
- package/dist/signal-router/types.d.ts +64 -0
- package/dist/signal-router/types.js +9 -0
- package/dist/signal-router/types.js.map +1 -0
- package/dist/skills/bundled/acp/index.d.ts +25 -0
- package/dist/skills/bundled/acp/index.js +472 -0
- package/dist/skills/bundled/acp/index.js.map +1 -0
- package/dist/skills/bundled/agentbets/index.d.ts +15 -0
- package/dist/skills/bundled/agentbets/index.js +168 -0
- package/dist/skills/bundled/agentbets/index.js.map +1 -0
- package/dist/skills/bundled/ai-strategy/index.d.ts +21 -0
- package/dist/skills/bundled/ai-strategy/index.js +647 -0
- package/dist/skills/bundled/ai-strategy/index.js.map +1 -0
- package/dist/skills/bundled/alerts/index.d.ts +20 -0
- package/dist/skills/bundled/alerts/index.js +249 -0
- package/dist/skills/bundled/alerts/index.js.map +1 -0
- package/dist/skills/bundled/analytics/index.d.ts +17 -0
- package/dist/skills/bundled/analytics/index.js +112 -0
- package/dist/skills/bundled/analytics/index.js.map +1 -0
- package/dist/skills/bundled/arbitrage/index.d.ts +24 -0
- package/dist/skills/bundled/arbitrage/index.js +253 -0
- package/dist/skills/bundled/arbitrage/index.js.map +1 -0
- package/dist/skills/bundled/auto-reply/index.d.ts +18 -0
- package/dist/skills/bundled/auto-reply/index.js +215 -0
- package/dist/skills/bundled/auto-reply/index.js.map +1 -0
- package/dist/skills/bundled/automation/index.d.ts +19 -0
- package/dist/skills/bundled/automation/index.js +160 -0
- package/dist/skills/bundled/automation/index.js.map +1 -0
- package/dist/skills/bundled/backtest/index.d.ts +18 -0
- package/dist/skills/bundled/backtest/index.js +250 -0
- package/dist/skills/bundled/backtest/index.js.map +1 -0
- package/dist/skills/bundled/bags/index.d.ts +49 -0
- package/dist/skills/bundled/bags/index.js +1069 -0
- package/dist/skills/bundled/bags/index.js.map +1 -0
- package/dist/skills/bundled/bankr/index.d.ts +161 -0
- package/dist/skills/bundled/bankr/index.js +271 -0
- package/dist/skills/bundled/bankr/index.js.map +1 -0
- package/dist/skills/bundled/betfair/index.d.ts +24 -0
- package/dist/skills/bundled/betfair/index.js +511 -0
- package/dist/skills/bundled/betfair/index.js.map +1 -0
- package/dist/skills/bundled/binance-futures/index.d.ts +15 -0
- package/dist/skills/bundled/binance-futures/index.js +485 -0
- package/dist/skills/bundled/binance-futures/index.js.map +1 -0
- package/dist/skills/bundled/botchan/index.d.ts +130 -0
- package/dist/skills/bundled/botchan/index.js +427 -0
- package/dist/skills/bundled/botchan/index.js.map +1 -0
- package/dist/skills/bundled/bridge/index.d.ts +17 -0
- package/dist/skills/bundled/bridge/index.js +297 -0
- package/dist/skills/bundled/bridge/index.js.map +1 -0
- package/dist/skills/bundled/bybit-futures/index.d.ts +15 -0
- package/dist/skills/bundled/bybit-futures/index.js +380 -0
- package/dist/skills/bundled/bybit-futures/index.js.map +1 -0
- package/dist/skills/bundled/clanker/index.d.ts +236 -0
- package/dist/skills/bundled/clanker/index.js +759 -0
- package/dist/skills/bundled/clanker/index.js.map +1 -0
- package/dist/skills/bundled/copy-trading/index.d.ts +20 -0
- package/dist/skills/bundled/copy-trading/index.js +213 -0
- package/dist/skills/bundled/copy-trading/index.js.map +1 -0
- package/dist/skills/bundled/copy-trading-solana/index.d.ts +21 -0
- package/dist/skills/bundled/copy-trading-solana/index.js +421 -0
- package/dist/skills/bundled/copy-trading-solana/index.js.map +1 -0
- package/dist/skills/bundled/credentials/index.d.ts +17 -0
- package/dist/skills/bundled/credentials/index.js +137 -0
- package/dist/skills/bundled/credentials/index.js.map +1 -0
- package/dist/skills/bundled/crypto-hft/index.d.ts +26 -0
- package/dist/skills/bundled/crypto-hft/index.js +361 -0
- package/dist/skills/bundled/crypto-hft/index.js.map +1 -0
- package/dist/skills/bundled/dca/index.d.ts +26 -0
- package/dist/skills/bundled/dca/index.js +1342 -0
- package/dist/skills/bundled/dca/index.js.map +1 -0
- package/dist/skills/bundled/divergence/index.d.ts +19 -0
- package/dist/skills/bundled/divergence/index.js +272 -0
- package/dist/skills/bundled/divergence/index.js.map +1 -0
- package/dist/skills/bundled/doctor/index.d.ts +18 -0
- package/dist/skills/bundled/doctor/index.js +78 -0
- package/dist/skills/bundled/doctor/index.js.map +1 -0
- package/dist/skills/bundled/drift/index.d.ts +13 -0
- package/dist/skills/bundled/drift/index.js +378 -0
- package/dist/skills/bundled/drift/index.js.map +1 -0
- package/dist/skills/bundled/drift-sdk/index.d.ts +17 -0
- package/dist/skills/bundled/drift-sdk/index.js +501 -0
- package/dist/skills/bundled/drift-sdk/index.js.map +1 -0
- package/dist/skills/bundled/edge/index.d.ts +16 -0
- package/dist/skills/bundled/edge/index.js +91 -0
- package/dist/skills/bundled/edge/index.js.map +1 -0
- package/dist/skills/bundled/embeddings/index.d.ts +19 -0
- package/dist/skills/bundled/embeddings/index.js +215 -0
- package/dist/skills/bundled/embeddings/index.js.map +1 -0
- package/dist/skills/bundled/endaoment/index.d.ts +105 -0
- package/dist/skills/bundled/endaoment/index.js +285 -0
- package/dist/skills/bundled/endaoment/index.js.map +1 -0
- package/dist/skills/bundled/ens/index.d.ts +151 -0
- package/dist/skills/bundled/ens/index.js +278 -0
- package/dist/skills/bundled/ens/index.js.map +1 -0
- package/dist/skills/bundled/erc8004/index.d.ts +123 -0
- package/dist/skills/bundled/erc8004/index.js +301 -0
- package/dist/skills/bundled/erc8004/index.js.map +1 -0
- package/dist/skills/bundled/execution/index.d.ts +18 -0
- package/dist/skills/bundled/execution/index.js +358 -0
- package/dist/skills/bundled/execution/index.js.map +1 -0
- package/dist/skills/bundled/farcaster/index.d.ts +121 -0
- package/dist/skills/bundled/farcaster/index.js +314 -0
- package/dist/skills/bundled/farcaster/index.js.map +1 -0
- package/dist/skills/bundled/features/index.d.ts +17 -0
- package/dist/skills/bundled/features/index.js +305 -0
- package/dist/skills/bundled/features/index.js.map +1 -0
- package/dist/skills/bundled/feeds/index.d.ts +26 -0
- package/dist/skills/bundled/feeds/index.js +462 -0
- package/dist/skills/bundled/feeds/index.js.map +1 -0
- package/dist/skills/bundled/harden/index.d.ts +55 -0
- package/dist/skills/bundled/harden/index.js +510 -0
- package/dist/skills/bundled/harden/index.js.map +1 -0
- package/dist/skills/bundled/history/index.d.ts +21 -0
- package/dist/skills/bundled/history/index.js +195 -0
- package/dist/skills/bundled/history/index.js.map +1 -0
- package/dist/skills/bundled/hyperliquid/index.d.ts +19 -0
- package/dist/skills/bundled/hyperliquid/index.js +1280 -0
- package/dist/skills/bundled/hyperliquid/index.js.map +1 -0
- package/dist/skills/bundled/identity/index.d.ts +17 -0
- package/dist/skills/bundled/identity/index.js +223 -0
- package/dist/skills/bundled/identity/index.js.map +1 -0
- package/dist/skills/bundled/integrations/index.d.ts +17 -0
- package/dist/skills/bundled/integrations/index.js +138 -0
- package/dist/skills/bundled/integrations/index.js.map +1 -0
- package/dist/skills/bundled/jupiter/index.d.ts +41 -0
- package/dist/skills/bundled/jupiter/index.js +872 -0
- package/dist/skills/bundled/jupiter/index.js.map +1 -0
- package/dist/skills/bundled/kamino/index.d.ts +33 -0
- package/dist/skills/bundled/kamino/index.js +578 -0
- package/dist/skills/bundled/kamino/index.js.map +1 -0
- package/dist/skills/bundled/ledger/index.d.ts +14 -0
- package/dist/skills/bundled/ledger/index.js +186 -0
- package/dist/skills/bundled/ledger/index.js.map +1 -0
- package/dist/skills/bundled/market-index/index.d.ts +18 -0
- package/dist/skills/bundled/market-index/index.js +182 -0
- package/dist/skills/bundled/market-index/index.js.map +1 -0
- package/dist/skills/bundled/markets/index.d.ts +16 -0
- package/dist/skills/bundled/markets/index.js +95 -0
- package/dist/skills/bundled/markets/index.js.map +1 -0
- package/dist/skills/bundled/mcp/index.d.ts +19 -0
- package/dist/skills/bundled/mcp/index.js +212 -0
- package/dist/skills/bundled/mcp/index.js.map +1 -0
- package/dist/skills/bundled/memory/index.d.ts +20 -0
- package/dist/skills/bundled/memory/index.js +210 -0
- package/dist/skills/bundled/memory/index.js.map +1 -0
- package/dist/skills/bundled/metaculus/index.d.ts +17 -0
- package/dist/skills/bundled/metaculus/index.js +168 -0
- package/dist/skills/bundled/metaculus/index.js.map +1 -0
- package/dist/skills/bundled/meteora/index.d.ts +39 -0
- package/dist/skills/bundled/meteora/index.js +837 -0
- package/dist/skills/bundled/meteora/index.js.map +1 -0
- package/dist/skills/bundled/meteora-dbc/index.d.ts +33 -0
- package/dist/skills/bundled/meteora-dbc/index.js +993 -0
- package/dist/skills/bundled/meteora-dbc/index.js.map +1 -0
- package/dist/skills/bundled/metrics/index.d.ts +18 -0
- package/dist/skills/bundled/metrics/index.js +91 -0
- package/dist/skills/bundled/metrics/index.js.map +1 -0
- package/dist/skills/bundled/mev/index.d.ts +17 -0
- package/dist/skills/bundled/mev/index.js +108 -0
- package/dist/skills/bundled/mev/index.js.map +1 -0
- package/dist/skills/bundled/mexc-futures/index.d.ts +16 -0
- package/dist/skills/bundled/mexc-futures/index.js +389 -0
- package/dist/skills/bundled/mexc-futures/index.js.map +1 -0
- package/dist/skills/bundled/mm/index.d.ts +18 -0
- package/dist/skills/bundled/mm/index.js +315 -0
- package/dist/skills/bundled/mm/index.js.map +1 -0
- package/dist/skills/bundled/monitoring/index.d.ts +18 -0
- package/dist/skills/bundled/monitoring/index.js +146 -0
- package/dist/skills/bundled/monitoring/index.js.map +1 -0
- package/dist/skills/bundled/news/index.d.ts +17 -0
- package/dist/skills/bundled/news/index.js +161 -0
- package/dist/skills/bundled/news/index.js.map +1 -0
- package/dist/skills/bundled/onchainkit/index.d.ts +92 -0
- package/dist/skills/bundled/onchainkit/index.js +429 -0
- package/dist/skills/bundled/onchainkit/index.js.map +1 -0
- package/dist/skills/bundled/opinion/index.d.ts +12 -0
- package/dist/skills/bundled/opinion/index.js +429 -0
- package/dist/skills/bundled/opinion/index.js.map +1 -0
- package/dist/skills/bundled/opportunity/index.d.ts +25 -0
- package/dist/skills/bundled/opportunity/index.js +289 -0
- package/dist/skills/bundled/opportunity/index.js.map +1 -0
- package/dist/skills/bundled/orca/index.d.ts +12 -0
- package/dist/skills/bundled/orca/index.js +663 -0
- package/dist/skills/bundled/orca/index.js.map +1 -0
- package/dist/skills/bundled/pairing/index.d.ts +24 -0
- package/dist/skills/bundled/pairing/index.js +228 -0
- package/dist/skills/bundled/pairing/index.js.map +1 -0
- package/dist/skills/bundled/percolator/index.d.ts +20 -0
- package/dist/skills/bundled/percolator/index.js +229 -0
- package/dist/skills/bundled/percolator/index.js.map +1 -0
- package/dist/skills/bundled/permissions/index.d.ts +21 -0
- package/dist/skills/bundled/permissions/index.js +204 -0
- package/dist/skills/bundled/permissions/index.js.map +1 -0
- package/dist/skills/bundled/plugins/index.d.ts +20 -0
- package/dist/skills/bundled/plugins/index.js +209 -0
- package/dist/skills/bundled/plugins/index.js.map +1 -0
- package/dist/skills/bundled/portfolio/index.d.ts +20 -0
- package/dist/skills/bundled/portfolio/index.js +367 -0
- package/dist/skills/bundled/portfolio/index.js.map +1 -0
- package/dist/skills/bundled/portfolio-sync/index.d.ts +17 -0
- package/dist/skills/bundled/portfolio-sync/index.js +116 -0
- package/dist/skills/bundled/portfolio-sync/index.js.map +1 -0
- package/dist/skills/bundled/positions/index.d.ts +18 -0
- package/dist/skills/bundled/positions/index.js +161 -0
- package/dist/skills/bundled/positions/index.js.map +1 -0
- package/dist/skills/bundled/predictfun/index.d.ts +13 -0
- package/dist/skills/bundled/predictfun/index.js +612 -0
- package/dist/skills/bundled/predictfun/index.js.map +1 -0
- package/dist/skills/bundled/predictit/index.d.ts +16 -0
- package/dist/skills/bundled/predictit/index.js +138 -0
- package/dist/skills/bundled/predictit/index.js.map +1 -0
- package/dist/skills/bundled/presence/index.d.ts +18 -0
- package/dist/skills/bundled/presence/index.js +151 -0
- package/dist/skills/bundled/presence/index.js.map +1 -0
- package/dist/skills/bundled/processes/index.d.ts +17 -0
- package/dist/skills/bundled/processes/index.js +121 -0
- package/dist/skills/bundled/processes/index.js.map +1 -0
- package/dist/skills/bundled/pump-swarm/index.d.ts +16 -0
- package/dist/skills/bundled/pump-swarm/index.js +2235 -0
- package/dist/skills/bundled/pump-swarm/index.js.map +1 -0
- package/dist/skills/bundled/pumpfun/index.d.ts +47 -0
- package/dist/skills/bundled/pumpfun/index.js +1400 -0
- package/dist/skills/bundled/pumpfun/index.js.map +1 -0
- package/dist/skills/bundled/qmd/index.d.ts +18 -0
- package/dist/skills/bundled/qmd/index.js +116 -0
- package/dist/skills/bundled/qmd/index.js.map +1 -0
- package/dist/skills/bundled/qrcoin/index.d.ts +92 -0
- package/dist/skills/bundled/qrcoin/index.js +328 -0
- package/dist/skills/bundled/qrcoin/index.js.map +1 -0
- package/dist/skills/bundled/raydium/index.d.ts +35 -0
- package/dist/skills/bundled/raydium/index.js +695 -0
- package/dist/skills/bundled/raydium/index.js.map +1 -0
- package/dist/skills/bundled/remote/index.d.ts +19 -0
- package/dist/skills/bundled/remote/index.js +186 -0
- package/dist/skills/bundled/remote/index.js.map +1 -0
- package/dist/skills/bundled/research/index.d.ts +17 -0
- package/dist/skills/bundled/research/index.js +185 -0
- package/dist/skills/bundled/research/index.js.map +1 -0
- package/dist/skills/bundled/risk/index.d.ts +31 -0
- package/dist/skills/bundled/risk/index.js +379 -0
- package/dist/skills/bundled/risk/index.js.map +1 -0
- package/dist/skills/bundled/router/index.d.ts +17 -0
- package/dist/skills/bundled/router/index.js +160 -0
- package/dist/skills/bundled/router/index.js.map +1 -0
- package/dist/skills/bundled/routing/index.d.ts +23 -0
- package/dist/skills/bundled/routing/index.js +257 -0
- package/dist/skills/bundled/routing/index.js.map +1 -0
- package/dist/skills/bundled/sandbox/index.d.ts +18 -0
- package/dist/skills/bundled/sandbox/index.js +119 -0
- package/dist/skills/bundled/sandbox/index.js.map +1 -0
- package/dist/skills/bundled/search-config/index.d.ts +18 -0
- package/dist/skills/bundled/search-config/index.js +170 -0
- package/dist/skills/bundled/search-config/index.js.map +1 -0
- package/dist/skills/bundled/sessions/index.d.ts +29 -0
- package/dist/skills/bundled/sessions/index.js +193 -0
- package/dist/skills/bundled/sessions/index.js.map +1 -0
- package/dist/skills/bundled/shield/index.d.ts +22 -0
- package/dist/skills/bundled/shield/index.js +245 -0
- package/dist/skills/bundled/shield/index.js.map +1 -0
- package/dist/skills/bundled/signals/index.d.ts +24 -0
- package/dist/skills/bundled/signals/index.js +776 -0
- package/dist/skills/bundled/signals/index.js.map +1 -0
- package/dist/skills/bundled/sizing/index.d.ts +16 -0
- package/dist/skills/bundled/sizing/index.js +168 -0
- package/dist/skills/bundled/sizing/index.js.map +1 -0
- package/dist/skills/bundled/slippage/index.d.ts +16 -0
- package/dist/skills/bundled/slippage/index.js +111 -0
- package/dist/skills/bundled/slippage/index.js.map +1 -0
- package/dist/skills/bundled/smarkets/index.d.ts +23 -0
- package/dist/skills/bundled/smarkets/index.js +473 -0
- package/dist/skills/bundled/smarkets/index.js.map +1 -0
- package/dist/skills/bundled/strategy/index.d.ts +18 -0
- package/dist/skills/bundled/strategy/index.js +168 -0
- package/dist/skills/bundled/strategy/index.js.map +1 -0
- package/dist/skills/bundled/streaming/index.d.ts +19 -0
- package/dist/skills/bundled/streaming/index.js +147 -0
- package/dist/skills/bundled/streaming/index.js.map +1 -0
- package/dist/skills/bundled/tailscale/index.d.ts +18 -0
- package/dist/skills/bundled/tailscale/index.js +173 -0
- package/dist/skills/bundled/tailscale/index.js.map +1 -0
- package/dist/skills/bundled/ticks/index.d.ts +17 -0
- package/dist/skills/bundled/ticks/index.js +287 -0
- package/dist/skills/bundled/ticks/index.js.map +1 -0
- package/dist/skills/bundled/token-security/index.d.ts +19 -0
- package/dist/skills/bundled/token-security/index.js +138 -0
- package/dist/skills/bundled/token-security/index.js.map +1 -0
- package/dist/skills/bundled/trading-evm/index.d.ts +19 -0
- package/dist/skills/bundled/trading-evm/index.js +302 -0
- package/dist/skills/bundled/trading-evm/index.js.map +1 -0
- package/dist/skills/bundled/trading-futures/index.d.ts +14 -0
- package/dist/skills/bundled/trading-futures/index.js +874 -0
- package/dist/skills/bundled/trading-futures/index.js.map +1 -0
- package/dist/skills/bundled/trading-kalshi/index.d.ts +36 -0
- package/dist/skills/bundled/trading-kalshi/index.js +1199 -0
- package/dist/skills/bundled/trading-kalshi/index.js.map +1 -0
- package/dist/skills/bundled/trading-manifold/index.d.ts +23 -0
- package/dist/skills/bundled/trading-manifold/index.js +391 -0
- package/dist/skills/bundled/trading-manifold/index.js.map +1 -0
- package/dist/skills/bundled/trading-polymarket/index.d.ts +27 -0
- package/dist/skills/bundled/trading-polymarket/index.js +1321 -0
- package/dist/skills/bundled/trading-polymarket/index.js.map +1 -0
- package/dist/skills/bundled/trading-solana/index.d.ts +19 -0
- package/dist/skills/bundled/trading-solana/index.js +383 -0
- package/dist/skills/bundled/trading-solana/index.js.map +1 -0
- package/dist/skills/bundled/trading-system/index.d.ts +22 -0
- package/dist/skills/bundled/trading-system/index.js +355 -0
- package/dist/skills/bundled/trading-system/index.js.map +1 -0
- package/dist/skills/bundled/triggers/index.d.ts +18 -0
- package/dist/skills/bundled/triggers/index.js +172 -0
- package/dist/skills/bundled/triggers/index.js.map +1 -0
- package/dist/skills/bundled/tts/index.d.ts +16 -0
- package/dist/skills/bundled/tts/index.js +150 -0
- package/dist/skills/bundled/tts/index.js.map +1 -0
- package/dist/skills/bundled/tweet-ideas/index.d.ts +20 -0
- package/dist/skills/bundled/tweet-ideas/index.js +470 -0
- package/dist/skills/bundled/tweet-ideas/index.js.map +1 -0
- package/dist/skills/bundled/usage/index.d.ts +17 -0
- package/dist/skills/bundled/usage/index.js +145 -0
- package/dist/skills/bundled/usage/index.js.map +1 -0
- package/dist/skills/bundled/veil/index.d.ts +79 -0
- package/dist/skills/bundled/veil/index.js +322 -0
- package/dist/skills/bundled/veil/index.js.map +1 -0
- package/dist/skills/bundled/verify/index.d.ts +20 -0
- package/dist/skills/bundled/verify/index.js +157 -0
- package/dist/skills/bundled/verify/index.js.map +1 -0
- package/dist/skills/bundled/virtuals/index.d.ts +20 -0
- package/dist/skills/bundled/virtuals/index.js +255 -0
- package/dist/skills/bundled/virtuals/index.js.map +1 -0
- package/dist/skills/bundled/voice/index.d.ts +18 -0
- package/dist/skills/bundled/voice/index.js +190 -0
- package/dist/skills/bundled/voice/index.js.map +1 -0
- package/dist/skills/bundled/weather/index.d.ts +20 -0
- package/dist/skills/bundled/weather/index.js +475 -0
- package/dist/skills/bundled/weather/index.js.map +1 -0
- package/dist/skills/bundled/webhooks/index.d.ts +18 -0
- package/dist/skills/bundled/webhooks/index.js +136 -0
- package/dist/skills/bundled/webhooks/index.js.map +1 -0
- package/dist/skills/bundled/whale-tracking/index.d.ts +18 -0
- package/dist/skills/bundled/whale-tracking/index.js +441 -0
- package/dist/skills/bundled/whale-tracking/index.js.map +1 -0
- package/dist/skills/bundled/yoink/index.d.ts +78 -0
- package/dist/skills/bundled/yoink/index.js +236 -0
- package/dist/skills/bundled/yoink/index.js.map +1 -0
- package/dist/skills/executor.d.ts +117 -0
- package/dist/skills/executor.js +469 -0
- package/dist/skills/executor.js.map +1 -0
- package/dist/skills/frontmatter.d.ts +69 -0
- package/dist/skills/frontmatter.js +187 -0
- package/dist/skills/frontmatter.js.map +1 -0
- package/dist/skills/index.d.ts +150 -0
- package/dist/skills/index.js +531 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/loader.d.ts +48 -0
- package/dist/skills/loader.js +594 -0
- package/dist/skills/loader.js.map +1 -0
- package/dist/skills/registry.d.ts +94 -0
- package/dist/skills/registry.js +308 -0
- package/dist/skills/registry.js.map +1 -0
- package/dist/solana/copytrade.d.ts +116 -0
- package/dist/solana/copytrade.js +493 -0
- package/dist/solana/copytrade.js.map +1 -0
- package/dist/solana/drift.d.ts +154 -0
- package/dist/solana/drift.js +599 -0
- package/dist/solana/drift.js.map +1 -0
- package/dist/solana/jupiter.d.ts +283 -0
- package/dist/solana/jupiter.js +553 -0
- package/dist/solana/jupiter.js.map +1 -0
- package/dist/solana/kamino.d.ts +206 -0
- package/dist/solana/kamino.js +546 -0
- package/dist/solana/kamino.js.map +1 -0
- package/dist/solana/meteora-dbc.d.ts +430 -0
- package/dist/solana/meteora-dbc.js +1105 -0
- package/dist/solana/meteora-dbc.js.map +1 -0
- package/dist/solana/meteora.d.ts +232 -0
- package/dist/solana/meteora.js +682 -0
- package/dist/solana/meteora.js.map +1 -0
- package/dist/solana/orca.d.ts +163 -0
- package/dist/solana/orca.js +378 -0
- package/dist/solana/orca.js.map +1 -0
- package/dist/solana/pools.d.ts +26 -0
- package/dist/solana/pools.js +96 -0
- package/dist/solana/pools.js.map +1 -0
- package/dist/solana/pump-swarm.d.ts +349 -0
- package/dist/solana/pump-swarm.js +1663 -0
- package/dist/solana/pump-swarm.js.map +1 -0
- package/dist/solana/pumpapi.d.ts +196 -0
- package/dist/solana/pumpapi.js +462 -0
- package/dist/solana/pumpapi.js.map +1 -0
- package/dist/solana/raydium.d.ts +170 -0
- package/dist/solana/raydium.js +673 -0
- package/dist/solana/raydium.js.map +1 -0
- package/dist/solana/swarm-ai-builder.d.ts +97 -0
- package/dist/solana/swarm-ai-builder.js +571 -0
- package/dist/solana/swarm-ai-builder.js.map +1 -0
- package/dist/solana/swarm-arbitrage.d.ts +111 -0
- package/dist/solana/swarm-arbitrage.js +437 -0
- package/dist/solana/swarm-arbitrage.js.map +1 -0
- package/dist/solana/swarm-builders.d.ts +71 -0
- package/dist/solana/swarm-builders.js +402 -0
- package/dist/solana/swarm-builders.js.map +1 -0
- package/dist/solana/swarm-copytrade.d.ts +103 -0
- package/dist/solana/swarm-copytrade.js +420 -0
- package/dist/solana/swarm-copytrade.js.map +1 -0
- package/dist/solana/swarm-presets.d.ts +49 -0
- package/dist/solana/swarm-presets.js +282 -0
- package/dist/solana/swarm-presets.js.map +1 -0
- package/dist/solana/swarm-signals.d.ts +128 -0
- package/dist/solana/swarm-signals.js +529 -0
- package/dist/solana/swarm-signals.js.map +1 -0
- package/dist/solana/swarm-strategies.d.ts +230 -0
- package/dist/solana/swarm-strategies.js +611 -0
- package/dist/solana/swarm-strategies.js.map +1 -0
- package/dist/solana/tokenlist.d.ts +10 -0
- package/dist/solana/tokenlist.js +54 -0
- package/dist/solana/tokenlist.js.map +1 -0
- package/dist/solana/wallet.d.ts +12 -0
- package/dist/solana/wallet.js +90 -0
- package/dist/solana/wallet.js.map +1 -0
- package/dist/strategies/crypto-hft/index.d.ts +46 -0
- package/dist/strategies/crypto-hft/index.js +469 -0
- package/dist/strategies/crypto-hft/index.js.map +1 -0
- package/dist/strategies/crypto-hft/market-scanner.d.ts +26 -0
- package/dist/strategies/crypto-hft/market-scanner.js +177 -0
- package/dist/strategies/crypto-hft/market-scanner.js.map +1 -0
- package/dist/strategies/crypto-hft/orderbook.d.ts +37 -0
- package/dist/strategies/crypto-hft/orderbook.js +184 -0
- package/dist/strategies/crypto-hft/orderbook.js.map +1 -0
- package/dist/strategies/crypto-hft/positions.d.ts +49 -0
- package/dist/strategies/crypto-hft/positions.js +376 -0
- package/dist/strategies/crypto-hft/positions.js.map +1 -0
- package/dist/strategies/crypto-hft/presets.d.ts +11 -0
- package/dist/strategies/crypto-hft/presets.js +164 -0
- package/dist/strategies/crypto-hft/presets.js.map +1 -0
- package/dist/strategies/crypto-hft/strategies.d.ts +96 -0
- package/dist/strategies/crypto-hft/strategies.js +330 -0
- package/dist/strategies/crypto-hft/strategies.js.map +1 -0
- package/dist/strategies/crypto-hft/types.d.ts +196 -0
- package/dist/strategies/crypto-hft/types.js +32 -0
- package/dist/strategies/crypto-hft/types.js.map +1 -0
- package/dist/strategies/hft-divergence/detector.d.ts +29 -0
- package/dist/strategies/hft-divergence/detector.js +182 -0
- package/dist/strategies/hft-divergence/detector.js.map +1 -0
- package/dist/strategies/hft-divergence/index.d.ts +12 -0
- package/dist/strategies/hft-divergence/index.js +19 -0
- package/dist/strategies/hft-divergence/index.js.map +1 -0
- package/dist/strategies/hft-divergence/market-rotator.d.ts +17 -0
- package/dist/strategies/hft-divergence/market-rotator.js +128 -0
- package/dist/strategies/hft-divergence/market-rotator.js.map +1 -0
- package/dist/strategies/hft-divergence/position-manager.d.ts +35 -0
- package/dist/strategies/hft-divergence/position-manager.js +188 -0
- package/dist/strategies/hft-divergence/position-manager.js.map +1 -0
- package/dist/strategies/hft-divergence/strategy.d.ts +31 -0
- package/dist/strategies/hft-divergence/strategy.js +295 -0
- package/dist/strategies/hft-divergence/strategy.js.map +1 -0
- package/dist/strategies/hft-divergence/types.d.ts +114 -0
- package/dist/strategies/hft-divergence/types.js +10 -0
- package/dist/strategies/hft-divergence/types.js.map +1 -0
- package/dist/streaming/index.d.ts +70 -0
- package/dist/streaming/index.js +296 -0
- package/dist/streaming/index.js.map +1 -0
- package/dist/tailscale/index.d.ts +139 -0
- package/dist/tailscale/index.js +345 -0
- package/dist/tailscale/index.js.map +1 -0
- package/dist/telemetry/index.d.ts +143 -0
- package/dist/telemetry/index.js +535 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/terminal/index.d.ts +121 -0
- package/dist/terminal/index.js +548 -0
- package/dist/terminal/index.js.map +1 -0
- package/dist/token-security/index.d.ts +36 -0
- package/dist/token-security/index.js +253 -0
- package/dist/token-security/index.js.map +1 -0
- package/dist/tools/browser.d.ts +128 -0
- package/dist/tools/browser.js +459 -0
- package/dist/tools/browser.js.map +1 -0
- package/dist/tools/canvas.d.ts +93 -0
- package/dist/tools/canvas.js +349 -0
- package/dist/tools/canvas.js.map +1 -0
- package/dist/tools/docker.d.ts +59 -0
- package/dist/tools/docker.js +191 -0
- package/dist/tools/docker.js.map +1 -0
- package/dist/tools/email.d.ts +25 -0
- package/dist/tools/email.js +131 -0
- package/dist/tools/email.js.map +1 -0
- package/dist/tools/exec.d.ts +81 -0
- package/dist/tools/exec.js +373 -0
- package/dist/tools/exec.js.map +1 -0
- package/dist/tools/files.d.ts +46 -0
- package/dist/tools/files.js +185 -0
- package/dist/tools/files.js.map +1 -0
- package/dist/tools/git.d.ts +29 -0
- package/dist/tools/git.js +105 -0
- package/dist/tools/git.js.map +1 -0
- package/dist/tools/image.d.ts +57 -0
- package/dist/tools/image.js +308 -0
- package/dist/tools/image.js.map +1 -0
- package/dist/tools/index.d.ts +39 -0
- package/dist/tools/index.js +46 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/message.d.ts +99 -0
- package/dist/tools/message.js +200 -0
- package/dist/tools/message.js.map +1 -0
- package/dist/tools/nodes.d.ts +134 -0
- package/dist/tools/nodes.js +357 -0
- package/dist/tools/nodes.js.map +1 -0
- package/dist/tools/sessions.d.ts +60 -0
- package/dist/tools/sessions.js +119 -0
- package/dist/tools/sessions.js.map +1 -0
- package/dist/tools/shell-history.d.ts +17 -0
- package/dist/tools/shell-history.js +118 -0
- package/dist/tools/shell-history.js.map +1 -0
- package/dist/tools/sms.d.ts +18 -0
- package/dist/tools/sms.js +66 -0
- package/dist/tools/sms.js.map +1 -0
- package/dist/tools/sql.d.ts +19 -0
- package/dist/tools/sql.js +91 -0
- package/dist/tools/sql.js.map +1 -0
- package/dist/tools/transcription.d.ts +13 -0
- package/dist/tools/transcription.js +99 -0
- package/dist/tools/transcription.js.map +1 -0
- package/dist/tools/web-fetch.d.ts +69 -0
- package/dist/tools/web-fetch.js +251 -0
- package/dist/tools/web-fetch.js.map +1 -0
- package/dist/tools/web-search.d.ts +58 -0
- package/dist/tools/web-search.js +204 -0
- package/dist/tools/web-search.js.map +1 -0
- package/dist/tools/webhooks.d.ts +74 -0
- package/dist/tools/webhooks.js +165 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/dist/trading/accounts.d.ts +167 -0
- package/dist/trading/accounts.js +394 -0
- package/dist/trading/accounts.js.map +1 -0
- package/dist/trading/adapters/index.d.ts +27 -0
- package/dist/trading/adapters/index.js +165 -0
- package/dist/trading/adapters/index.js.map +1 -0
- package/dist/trading/backtest.d.ts +161 -0
- package/dist/trading/backtest.js +665 -0
- package/dist/trading/backtest.js.map +1 -0
- package/dist/trading/bots/index.d.ts +196 -0
- package/dist/trading/bots/index.js +688 -0
- package/dist/trading/bots/index.js.map +1 -0
- package/dist/trading/bridge.d.ts +33 -0
- package/dist/trading/bridge.js +121 -0
- package/dist/trading/bridge.js.map +1 -0
- package/dist/trading/builder.d.ts +102 -0
- package/dist/trading/builder.js +430 -0
- package/dist/trading/builder.js.map +1 -0
- package/dist/trading/copy-trading.d.ts +125 -0
- package/dist/trading/copy-trading.js +611 -0
- package/dist/trading/copy-trading.js.map +1 -0
- package/dist/trading/devtools.d.ts +172 -0
- package/dist/trading/devtools.js +425 -0
- package/dist/trading/devtools.js.map +1 -0
- package/dist/trading/futures/index.d.ts +981 -0
- package/dist/trading/futures/index.js +4011 -0
- package/dist/trading/futures/index.js.map +1 -0
- package/dist/trading/index.d.ts +102 -0
- package/dist/trading/index.js +310 -0
- package/dist/trading/index.js.map +1 -0
- package/dist/trading/kelly.d.ts +137 -0
- package/dist/trading/kelly.js +328 -0
- package/dist/trading/kelly.js.map +1 -0
- package/dist/trading/logger.d.ts +163 -0
- package/dist/trading/logger.js +424 -0
- package/dist/trading/logger.js.map +1 -0
- package/dist/trading/market-making/engine.d.ts +44 -0
- package/dist/trading/market-making/engine.js +165 -0
- package/dist/trading/market-making/engine.js.map +1 -0
- package/dist/trading/market-making/index.d.ts +10 -0
- package/dist/trading/market-making/index.js +29 -0
- package/dist/trading/market-making/index.js.map +1 -0
- package/dist/trading/market-making/strategy.d.ts +25 -0
- package/dist/trading/market-making/strategy.js +250 -0
- package/dist/trading/market-making/strategy.js.map +1 -0
- package/dist/trading/market-making/types.d.ts +92 -0
- package/dist/trading/market-making/types.js +6 -0
- package/dist/trading/market-making/types.js.map +1 -0
- package/dist/trading/ml-signals.d.ts +175 -0
- package/dist/trading/ml-signals.js +548 -0
- package/dist/trading/ml-signals.js.map +1 -0
- package/dist/trading/orchestrator.d.ts +59 -0
- package/dist/trading/orchestrator.js +199 -0
- package/dist/trading/orchestrator.js.map +1 -0
- package/dist/trading/position-bridge.d.ts +41 -0
- package/dist/trading/position-bridge.js +178 -0
- package/dist/trading/position-bridge.js.map +1 -0
- package/dist/trading/resilience.d.ts +81 -0
- package/dist/trading/resilience.js +257 -0
- package/dist/trading/resilience.js.map +1 -0
- package/dist/trading/risk.d.ts +18 -0
- package/dist/trading/risk.js +91 -0
- package/dist/trading/risk.js.map +1 -0
- package/dist/trading/safety.d.ts +114 -0
- package/dist/trading/safety.js +372 -0
- package/dist/trading/safety.js.map +1 -0
- package/dist/trading/secrets.d.ts +48 -0
- package/dist/trading/secrets.js +243 -0
- package/dist/trading/secrets.js.map +1 -0
- package/dist/trading/state.d.ts +88 -0
- package/dist/trading/state.js +221 -0
- package/dist/trading/state.js.map +1 -0
- package/dist/trading/stream.d.ts +121 -0
- package/dist/trading/stream.js +396 -0
- package/dist/trading/stream.js.map +1 -0
- package/dist/trading/tracking.d.ts +136 -0
- package/dist/trading/tracking.js +512 -0
- package/dist/trading/tracking.js.map +1 -0
- package/dist/tts/index.d.ts +28 -0
- package/dist/tts/index.js +64 -0
- package/dist/tts/index.js.map +1 -0
- package/dist/tui/index.d.ts +159 -0
- package/dist/tui/index.js +580 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/types.d.ts +1373 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/usage/index.d.ts +57 -0
- package/dist/usage/index.js +191 -0
- package/dist/usage/index.js.map +1 -0
- package/dist/utils/attachments.d.ts +12 -0
- package/dist/utils/attachments.js +104 -0
- package/dist/utils/attachments.js.map +1 -0
- package/dist/utils/config.d.ts +14 -0
- package/dist/utils/config.js +474 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/http.d.ts +22 -0
- package/dist/utils/http.js +191 -0
- package/dist/utils/http.js.map +1 -0
- package/dist/utils/id.d.ts +21 -0
- package/dist/utils/id.js +41 -0
- package/dist/utils/id.js.map +1 -0
- package/dist/utils/json-utils.d.ts +201 -0
- package/dist/utils/json-utils.js +151 -0
- package/dist/utils/json-utils.js.map +1 -0
- package/dist/utils/kalshi-auth.d.ts +10 -0
- package/dist/utils/kalshi-auth.js +48 -0
- package/dist/utils/kalshi-auth.js.map +1 -0
- package/dist/utils/kelly.d.ts +153 -0
- package/dist/utils/kelly.js +322 -0
- package/dist/utils/kelly.js.map +1 -0
- package/dist/utils/logger.d.ts +7 -0
- package/dist/utils/logger.js +26 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/opinion-auth.d.ts +17 -0
- package/dist/utils/opinion-auth.js +25 -0
- package/dist/utils/opinion-auth.js.map +1 -0
- package/dist/utils/polymarket-auth.d.ts +11 -0
- package/dist/utils/polymarket-auth.js +32 -0
- package/dist/utils/polymarket-auth.js.map +1 -0
- package/dist/utils/polymarket-order-signer.d.ts +118 -0
- package/dist/utils/polymarket-order-signer.js +329 -0
- package/dist/utils/polymarket-order-signer.js.map +1 -0
- package/dist/utils/polymarket-setup.d.ts +70 -0
- package/dist/utils/polymarket-setup.js +288 -0
- package/dist/utils/polymarket-setup.js.map +1 -0
- package/dist/utils/production.d.ts +112 -0
- package/dist/utils/production.js +294 -0
- package/dist/utils/production.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +77 -0
- package/dist/utils/rate-limiter.js +271 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/dist/utils/webhook-security.d.ts +63 -0
- package/dist/utils/webhook-security.js +183 -0
- package/dist/utils/webhook-security.js.map +1 -0
- package/dist/voice/index.d.ts +125 -0
- package/dist/voice/index.js +557 -0
- package/dist/voice/index.js.map +1 -0
- package/dist/weather/edge.d.ts +70 -0
- package/dist/weather/edge.js +281 -0
- package/dist/weather/edge.js.map +1 -0
- package/dist/weather/index.d.ts +6 -0
- package/dist/weather/index.js +23 -0
- package/dist/weather/index.js.map +1 -0
- package/dist/weather/markets.d.ts +84 -0
- package/dist/weather/markets.js +320 -0
- package/dist/weather/markets.js.map +1 -0
- package/dist/weather/noaa.d.ts +113 -0
- package/dist/weather/noaa.js +287 -0
- package/dist/weather/noaa.js.map +1 -0
- package/dist/web/index.d.ts +112 -0
- package/dist/web/index.js +639 -0
- package/dist/web/index.js.map +1 -0
- package/dist/wizard/index.d.ts +27 -0
- package/dist/wizard/index.js +186 -0
- package/dist/wizard/index.js.map +1 -0
- package/dist/workspace/index.d.ts +73 -0
- package/dist/workspace/index.js +403 -0
- package/dist/workspace/index.js.map +1 -0
- package/package.json +168 -0
|
@@ -0,0 +1,958 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Compute Gateway - Main entry point for agent compute marketplace
|
|
4
|
+
*
|
|
5
|
+
* Agents pay USDC for compute resources. No API keys needed - just a wallet.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.createComputeGateway = createComputeGateway;
|
|
9
|
+
const crypto_1 = require("crypto");
|
|
10
|
+
const eventemitter3_1 = require("eventemitter3");
|
|
11
|
+
const logger_1 = require("../../utils/logger");
|
|
12
|
+
const persistence_1 = require("./persistence");
|
|
13
|
+
const types_1 = require("./types");
|
|
14
|
+
// =============================================================================
|
|
15
|
+
// CONSTANTS
|
|
16
|
+
// =============================================================================
|
|
17
|
+
const DEFAULT_CONFIG = {
|
|
18
|
+
minBalance: 0.001,
|
|
19
|
+
jobTimeout: 300000,
|
|
20
|
+
maxConcurrent: 10,
|
|
21
|
+
maxRetries: 3,
|
|
22
|
+
retryDelayMs: 1000,
|
|
23
|
+
retryBackoffMultiplier: 2,
|
|
24
|
+
circuitBreakerThreshold: 5,
|
|
25
|
+
circuitBreakerResetMs: 30000,
|
|
26
|
+
usdcAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC on Base
|
|
27
|
+
treasuryWallet: process.env.CLODDS_TREASURY_WALLET || '',
|
|
28
|
+
walletRateLimit: 60, // 60 requests per minute
|
|
29
|
+
ipRateLimit: 100, // 100 requests per minute
|
|
30
|
+
dbPath: '',
|
|
31
|
+
supportedNetworks: ['base', 'ethereum', 'polygon'],
|
|
32
|
+
};
|
|
33
|
+
// Transient errors that should trigger retry
|
|
34
|
+
const RETRYABLE_ERRORS = [
|
|
35
|
+
'ECONNRESET',
|
|
36
|
+
'ETIMEDOUT',
|
|
37
|
+
'ECONNREFUSED',
|
|
38
|
+
'ENOTFOUND',
|
|
39
|
+
'EAI_AGAIN',
|
|
40
|
+
'socket hang up',
|
|
41
|
+
'network error',
|
|
42
|
+
'rate limit',
|
|
43
|
+
'429',
|
|
44
|
+
'502',
|
|
45
|
+
'503',
|
|
46
|
+
'504',
|
|
47
|
+
];
|
|
48
|
+
// RPC endpoints for payment verification
|
|
49
|
+
const RPC_ENDPOINTS = {
|
|
50
|
+
base: 'https://mainnet.base.org',
|
|
51
|
+
ethereum: 'https://eth.llamarpc.com',
|
|
52
|
+
polygon: 'https://polygon-rpc.com',
|
|
53
|
+
};
|
|
54
|
+
// USDC addresses per network
|
|
55
|
+
const USDC_ADDRESSES = {
|
|
56
|
+
base: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
|
|
57
|
+
ethereum: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
|
|
58
|
+
polygon: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
|
|
59
|
+
};
|
|
60
|
+
// ERC20 Transfer event signature
|
|
61
|
+
const TRANSFER_EVENT_SIG = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef';
|
|
62
|
+
// =============================================================================
|
|
63
|
+
// IMPLEMENTATION
|
|
64
|
+
// =============================================================================
|
|
65
|
+
function createComputeGateway(config = {}, pricing) {
|
|
66
|
+
const cfg = { ...DEFAULT_CONFIG, ...config };
|
|
67
|
+
const events = new eventemitter3_1.EventEmitter();
|
|
68
|
+
const startTime = Date.now();
|
|
69
|
+
// Initialize persistence
|
|
70
|
+
const db = (0, persistence_1.createPersistenceLayer)(cfg.dbPath || undefined);
|
|
71
|
+
// Service handlers
|
|
72
|
+
const handlers = new Map();
|
|
73
|
+
// In-memory job tracking for active jobs
|
|
74
|
+
const activeJobs = new Map();
|
|
75
|
+
const circuitBreakers = new Map();
|
|
76
|
+
// Recent errors tracking (keep last 100)
|
|
77
|
+
const recentErrors = [];
|
|
78
|
+
const MAX_RECENT_ERRORS = 100;
|
|
79
|
+
function recordError(service, error) {
|
|
80
|
+
recentErrors.push({ service, error, timestamp: Date.now() });
|
|
81
|
+
if (recentErrors.length > MAX_RECENT_ERRORS) {
|
|
82
|
+
recentErrors.shift();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function getCircuitBreaker(service) {
|
|
86
|
+
if (!circuitBreakers.has(service)) {
|
|
87
|
+
circuitBreakers.set(service, {
|
|
88
|
+
state: 'closed',
|
|
89
|
+
failures: 0,
|
|
90
|
+
lastFailure: 0,
|
|
91
|
+
lastSuccess: Date.now(),
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return circuitBreakers.get(service);
|
|
95
|
+
}
|
|
96
|
+
function checkCircuitBreaker(service) {
|
|
97
|
+
const cb = getCircuitBreaker(service);
|
|
98
|
+
if (cb.state === 'closed') {
|
|
99
|
+
return { allowed: true };
|
|
100
|
+
}
|
|
101
|
+
if (cb.state === 'open') {
|
|
102
|
+
// Check if reset timeout has passed
|
|
103
|
+
if (Date.now() - cb.lastFailure > cfg.circuitBreakerResetMs) {
|
|
104
|
+
cb.state = 'half-open';
|
|
105
|
+
logger_1.logger.info({ service }, 'Circuit breaker entering half-open state');
|
|
106
|
+
return { allowed: true };
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
allowed: false,
|
|
110
|
+
reason: `Service ${service} is temporarily unavailable (circuit breaker open). Retry after ${Math.ceil((cfg.circuitBreakerResetMs - (Date.now() - cb.lastFailure)) / 1000)}s`,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
// half-open - allow one request through
|
|
114
|
+
return { allowed: true };
|
|
115
|
+
}
|
|
116
|
+
function recordCircuitSuccess(service) {
|
|
117
|
+
const cb = getCircuitBreaker(service);
|
|
118
|
+
cb.failures = 0;
|
|
119
|
+
cb.lastSuccess = Date.now();
|
|
120
|
+
if (cb.state === 'half-open') {
|
|
121
|
+
cb.state = 'closed';
|
|
122
|
+
logger_1.logger.info({ service }, 'Circuit breaker closed after successful request');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function recordCircuitFailure(service) {
|
|
126
|
+
const cb = getCircuitBreaker(service);
|
|
127
|
+
cb.failures++;
|
|
128
|
+
cb.lastFailure = Date.now();
|
|
129
|
+
if (cb.state === 'half-open') {
|
|
130
|
+
cb.state = 'open';
|
|
131
|
+
logger_1.logger.warn({ service, failures: cb.failures }, 'Circuit breaker re-opened after failure in half-open state');
|
|
132
|
+
}
|
|
133
|
+
else if (cb.failures >= cfg.circuitBreakerThreshold) {
|
|
134
|
+
cb.state = 'open';
|
|
135
|
+
logger_1.logger.warn({ service, failures: cb.failures, threshold: cfg.circuitBreakerThreshold }, 'Circuit breaker opened');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
// Metrics
|
|
139
|
+
let totalRequests = 0;
|
|
140
|
+
let totalRevenue = 0;
|
|
141
|
+
const requestsByService = {};
|
|
142
|
+
const jobsByStatus = { pending: 0, processing: 0, completed: 0, failed: 0 };
|
|
143
|
+
function generateJobId() {
|
|
144
|
+
return `job_${Date.now()}_${(0, crypto_1.randomBytes)(8).toString('hex')}`;
|
|
145
|
+
}
|
|
146
|
+
function registerHandler(service, handler) {
|
|
147
|
+
handlers.set(service, handler);
|
|
148
|
+
logger_1.logger.info({ service }, 'Service handler registered');
|
|
149
|
+
}
|
|
150
|
+
function isRetryableError(error) {
|
|
151
|
+
const errorStr = String(error).toLowerCase();
|
|
152
|
+
return RETRYABLE_ERRORS.some(e => errorStr.includes(e.toLowerCase()));
|
|
153
|
+
}
|
|
154
|
+
async function withRetry(fn, context) {
|
|
155
|
+
let lastError;
|
|
156
|
+
let delay = cfg.retryDelayMs;
|
|
157
|
+
for (let attempt = 0; attempt <= cfg.maxRetries; attempt++) {
|
|
158
|
+
try {
|
|
159
|
+
return await fn();
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
lastError = error;
|
|
163
|
+
if (attempt < cfg.maxRetries && isRetryableError(error)) {
|
|
164
|
+
logger_1.logger.warn({
|
|
165
|
+
jobId: context.jobId,
|
|
166
|
+
service: context.service,
|
|
167
|
+
attempt: attempt + 1,
|
|
168
|
+
maxRetries: cfg.maxRetries,
|
|
169
|
+
error: String(error),
|
|
170
|
+
nextRetryMs: delay,
|
|
171
|
+
}, 'Retrying after transient error');
|
|
172
|
+
await new Promise(resolve => setTimeout(resolve, delay));
|
|
173
|
+
delay *= cfg.retryBackoffMultiplier;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
throw error;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
throw lastError;
|
|
181
|
+
}
|
|
182
|
+
function getOrCreateBalance(wallet) {
|
|
183
|
+
const row = db.getBalance(wallet);
|
|
184
|
+
if (row) {
|
|
185
|
+
return {
|
|
186
|
+
wallet: row.wallet,
|
|
187
|
+
available: row.available,
|
|
188
|
+
pending: row.pending,
|
|
189
|
+
totalDeposited: row.total_deposited,
|
|
190
|
+
totalSpent: row.total_spent,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
wallet: wallet.toLowerCase(),
|
|
195
|
+
available: 0,
|
|
196
|
+
pending: 0,
|
|
197
|
+
totalDeposited: 0,
|
|
198
|
+
totalSpent: 0,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function saveBalance(balance) {
|
|
202
|
+
db.upsertBalance(balance.wallet, balance.available, balance.pending, balance.totalDeposited, balance.totalSpent);
|
|
203
|
+
}
|
|
204
|
+
function calculateUnits(service, payload) {
|
|
205
|
+
let units = 1;
|
|
206
|
+
if (service === 'llm') {
|
|
207
|
+
const messages = payload?.messages || [];
|
|
208
|
+
const totalChars = messages.reduce((sum, m) => sum + (m.content?.length || 0), 0);
|
|
209
|
+
units = Math.ceil(totalChars / 4);
|
|
210
|
+
}
|
|
211
|
+
else if (service === 'code') {
|
|
212
|
+
const timeout = payload?.timeout || 30000;
|
|
213
|
+
units = Math.ceil(timeout / 1000);
|
|
214
|
+
}
|
|
215
|
+
else if (service === 'storage') {
|
|
216
|
+
const content = payload?.content || '';
|
|
217
|
+
units = Math.max(1, Math.ceil(content.length / 1024 / 1024));
|
|
218
|
+
}
|
|
219
|
+
else if (service === 'data') {
|
|
220
|
+
units = 1;
|
|
221
|
+
}
|
|
222
|
+
else if (service === 'web') {
|
|
223
|
+
units = 1;
|
|
224
|
+
}
|
|
225
|
+
else if (service === 'trade') {
|
|
226
|
+
units = 1;
|
|
227
|
+
}
|
|
228
|
+
return units;
|
|
229
|
+
}
|
|
230
|
+
function estimateCostInternal(service, payload, priority = 'normal') {
|
|
231
|
+
const price = pricing[service];
|
|
232
|
+
if (!price)
|
|
233
|
+
return 0;
|
|
234
|
+
const units = calculateUnits(service, payload);
|
|
235
|
+
const baseCost = price.basePrice + (units * price.pricePerUnit);
|
|
236
|
+
const clampedCost = Math.min(Math.max(baseCost, price.minCharge), price.maxCharge);
|
|
237
|
+
// Apply priority multiplier
|
|
238
|
+
const priorityMultiplier = types_1.PRIORITY_MULTIPLIERS[priority];
|
|
239
|
+
return clampedCost * priorityMultiplier;
|
|
240
|
+
}
|
|
241
|
+
function estimateCost(service, payload) {
|
|
242
|
+
const price = pricing[service];
|
|
243
|
+
// Extract priority from payload if present
|
|
244
|
+
const priority = payload?.priority || 'normal';
|
|
245
|
+
const priorityMultiplier = types_1.PRIORITY_MULTIPLIERS[priority] || 1.0;
|
|
246
|
+
if (!price) {
|
|
247
|
+
return {
|
|
248
|
+
service,
|
|
249
|
+
estimatedCost: 0,
|
|
250
|
+
breakdown: { base: 0, usage: 0, total: 0, priorityMultiplier },
|
|
251
|
+
units: 0,
|
|
252
|
+
unitType: 'unknown',
|
|
253
|
+
minCharge: 0,
|
|
254
|
+
maxCharge: 0,
|
|
255
|
+
priority,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
const units = calculateUnits(service, payload);
|
|
259
|
+
const baseCost = price.basePrice;
|
|
260
|
+
const usageCost = units * price.pricePerUnit;
|
|
261
|
+
const subtotal = Math.min(Math.max(baseCost + usageCost, price.minCharge), price.maxCharge);
|
|
262
|
+
const total = subtotal * priorityMultiplier;
|
|
263
|
+
return {
|
|
264
|
+
service,
|
|
265
|
+
estimatedCost: total,
|
|
266
|
+
breakdown: {
|
|
267
|
+
base: baseCost,
|
|
268
|
+
usage: usageCost,
|
|
269
|
+
subtotal,
|
|
270
|
+
priorityMultiplier,
|
|
271
|
+
total,
|
|
272
|
+
},
|
|
273
|
+
units,
|
|
274
|
+
unitType: price.unit,
|
|
275
|
+
minCharge: price.minCharge * priorityMultiplier,
|
|
276
|
+
maxCharge: price.maxCharge * priorityMultiplier,
|
|
277
|
+
priority,
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
async function verifyPayment(proof) {
|
|
281
|
+
if (!proof.txHash || !proof.network) {
|
|
282
|
+
return { valid: false, amount: 0, error: 'Missing txHash or network' };
|
|
283
|
+
}
|
|
284
|
+
// Check supported network
|
|
285
|
+
if (!cfg.supportedNetworks.includes(proof.network)) {
|
|
286
|
+
return { valid: false, amount: 0, error: `Unsupported network: ${proof.network}` };
|
|
287
|
+
}
|
|
288
|
+
// Check for replay attack
|
|
289
|
+
if (db.isTransactionUsed(proof.txHash)) {
|
|
290
|
+
return { valid: false, amount: 0, error: 'Transaction already used' };
|
|
291
|
+
}
|
|
292
|
+
const rpcUrl = RPC_ENDPOINTS[proof.network];
|
|
293
|
+
const usdcAddress = USDC_ADDRESSES[proof.network];
|
|
294
|
+
if (!rpcUrl || !usdcAddress) {
|
|
295
|
+
return { valid: false, amount: 0, error: `Network ${proof.network} not configured` };
|
|
296
|
+
}
|
|
297
|
+
try {
|
|
298
|
+
// Get transaction receipt
|
|
299
|
+
const response = await fetch(rpcUrl, {
|
|
300
|
+
method: 'POST',
|
|
301
|
+
headers: { 'Content-Type': 'application/json' },
|
|
302
|
+
body: JSON.stringify({
|
|
303
|
+
jsonrpc: '2.0',
|
|
304
|
+
method: 'eth_getTransactionReceipt',
|
|
305
|
+
params: [proof.txHash],
|
|
306
|
+
id: 1,
|
|
307
|
+
}),
|
|
308
|
+
});
|
|
309
|
+
const data = await response.json();
|
|
310
|
+
if (!data.result) {
|
|
311
|
+
return { valid: false, amount: 0, error: 'Transaction not found' };
|
|
312
|
+
}
|
|
313
|
+
// Check success status
|
|
314
|
+
if (data.result.status !== '0x1') {
|
|
315
|
+
return { valid: false, amount: 0, error: 'Transaction failed' };
|
|
316
|
+
}
|
|
317
|
+
// Find USDC Transfer event to our treasury
|
|
318
|
+
const treasury = cfg.treasuryWallet.toLowerCase();
|
|
319
|
+
let transferAmount = 0;
|
|
320
|
+
for (const log of data.result.logs) {
|
|
321
|
+
// Check if it's USDC contract
|
|
322
|
+
if (log.address.toLowerCase() !== usdcAddress.toLowerCase())
|
|
323
|
+
continue;
|
|
324
|
+
// Check if it's Transfer event
|
|
325
|
+
if (log.topics[0] !== TRANSFER_EVENT_SIG)
|
|
326
|
+
continue;
|
|
327
|
+
// topics[2] is the 'to' address (padded to 32 bytes)
|
|
328
|
+
const toAddress = '0x' + log.topics[2].slice(26).toLowerCase();
|
|
329
|
+
if (toAddress === treasury) {
|
|
330
|
+
// Decode amount from data (USDC has 6 decimals)
|
|
331
|
+
const amountHex = log.data;
|
|
332
|
+
const amountRaw = BigInt(amountHex);
|
|
333
|
+
transferAmount = Number(amountRaw) / 1e6;
|
|
334
|
+
break;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
if (transferAmount === 0) {
|
|
338
|
+
return { valid: false, amount: 0, error: 'No transfer to treasury found' };
|
|
339
|
+
}
|
|
340
|
+
// Verify amount matches (with 1% tolerance for gas)
|
|
341
|
+
if (Math.abs(transferAmount - proof.amountUsd) / proof.amountUsd > 0.01) {
|
|
342
|
+
return { valid: false, amount: transferAmount, error: `Amount mismatch: expected ${proof.amountUsd}, got ${transferAmount}` };
|
|
343
|
+
}
|
|
344
|
+
return { valid: true, amount: transferAmount };
|
|
345
|
+
}
|
|
346
|
+
catch (error) {
|
|
347
|
+
logger_1.logger.error({ error, txHash: proof.txHash }, 'Payment verification failed');
|
|
348
|
+
return { valid: false, amount: 0, error: 'Verification failed' };
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
function checkRateLimit(wallet, ip) {
|
|
352
|
+
const windowMs = 60000; // 1 minute
|
|
353
|
+
const walletCount = db.getRequestCount(wallet, windowMs);
|
|
354
|
+
if (walletCount >= cfg.walletRateLimit) {
|
|
355
|
+
return {
|
|
356
|
+
allowed: false,
|
|
357
|
+
retryAfter: 60,
|
|
358
|
+
remaining: 0,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
const ipCount = db.getIpRequestCount(ip, windowMs);
|
|
362
|
+
if (ipCount >= cfg.ipRateLimit) {
|
|
363
|
+
return {
|
|
364
|
+
allowed: false,
|
|
365
|
+
retryAfter: 60,
|
|
366
|
+
remaining: 0,
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
db.recordRequest(wallet, ip);
|
|
370
|
+
return {
|
|
371
|
+
allowed: true,
|
|
372
|
+
remaining: Math.min(cfg.walletRateLimit - walletCount - 1, cfg.ipRateLimit - ipCount - 1),
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
async function submit(request) {
|
|
376
|
+
const jobId = generateJobId();
|
|
377
|
+
const startTime = Date.now();
|
|
378
|
+
totalRequests++;
|
|
379
|
+
requestsByService[request.service] = (requestsByService[request.service] || 0) + 1;
|
|
380
|
+
try {
|
|
381
|
+
// Validate service
|
|
382
|
+
if (!pricing[request.service]) {
|
|
383
|
+
return {
|
|
384
|
+
id: request.id,
|
|
385
|
+
jobId,
|
|
386
|
+
service: request.service,
|
|
387
|
+
status: 'failed',
|
|
388
|
+
error: `Unknown service: ${request.service}`,
|
|
389
|
+
cost: 0,
|
|
390
|
+
timestamp: startTime,
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
// Check handler exists
|
|
394
|
+
if (!handlers.has(request.service)) {
|
|
395
|
+
return {
|
|
396
|
+
id: request.id,
|
|
397
|
+
jobId,
|
|
398
|
+
service: request.service,
|
|
399
|
+
status: 'failed',
|
|
400
|
+
error: `Service ${request.service} not available`,
|
|
401
|
+
cost: 0,
|
|
402
|
+
timestamp: startTime,
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
// Check circuit breaker
|
|
406
|
+
const cbCheck = checkCircuitBreaker(request.service);
|
|
407
|
+
if (!cbCheck.allowed) {
|
|
408
|
+
return {
|
|
409
|
+
id: request.id,
|
|
410
|
+
jobId,
|
|
411
|
+
service: request.service,
|
|
412
|
+
status: 'failed',
|
|
413
|
+
error: cbCheck.reason || 'Service temporarily unavailable',
|
|
414
|
+
cost: 0,
|
|
415
|
+
timestamp: startTime,
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
// Check balance (with priority pricing)
|
|
419
|
+
const balance = getOrCreateBalance(request.wallet);
|
|
420
|
+
const priority = request.priority || 'normal';
|
|
421
|
+
const estimatedCost = estimateCostInternal(request.service, request.payload, priority);
|
|
422
|
+
if (balance.available < estimatedCost) {
|
|
423
|
+
// Check for payment proof
|
|
424
|
+
if (request.paymentProof) {
|
|
425
|
+
const verification = await verifyPayment(request.paymentProof);
|
|
426
|
+
if (verification.valid) {
|
|
427
|
+
// Mark transaction as used
|
|
428
|
+
db.markTransactionUsed(request.paymentProof.txHash, request.wallet, verification.amount);
|
|
429
|
+
balance.available += verification.amount;
|
|
430
|
+
balance.totalDeposited += verification.amount;
|
|
431
|
+
saveBalance(balance);
|
|
432
|
+
}
|
|
433
|
+
else {
|
|
434
|
+
return {
|
|
435
|
+
id: request.id,
|
|
436
|
+
jobId,
|
|
437
|
+
service: request.service,
|
|
438
|
+
status: 'failed',
|
|
439
|
+
error: verification.error || 'Invalid payment proof',
|
|
440
|
+
cost: 0,
|
|
441
|
+
timestamp: startTime,
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
// Re-check after payment
|
|
446
|
+
if (balance.available < estimatedCost) {
|
|
447
|
+
return {
|
|
448
|
+
id: request.id,
|
|
449
|
+
jobId,
|
|
450
|
+
service: request.service,
|
|
451
|
+
status: 'failed',
|
|
452
|
+
error: `Insufficient balance. Need $${estimatedCost.toFixed(4)}, have $${balance.available.toFixed(4)}`,
|
|
453
|
+
cost: 0,
|
|
454
|
+
timestamp: startTime,
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
// Check spending limits
|
|
459
|
+
const spendingCheck = checkSpendingLimits(request.wallet, estimatedCost);
|
|
460
|
+
if (!spendingCheck.allowed) {
|
|
461
|
+
return {
|
|
462
|
+
id: request.id,
|
|
463
|
+
jobId,
|
|
464
|
+
service: request.service,
|
|
465
|
+
status: 'failed',
|
|
466
|
+
error: spendingCheck.reason || 'Spending limit exceeded',
|
|
467
|
+
cost: 0,
|
|
468
|
+
timestamp: startTime,
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
// Reserve balance
|
|
472
|
+
balance.available -= estimatedCost;
|
|
473
|
+
balance.pending += estimatedCost;
|
|
474
|
+
saveBalance(balance);
|
|
475
|
+
// Create job in database
|
|
476
|
+
db.createJob({
|
|
477
|
+
job_id: jobId,
|
|
478
|
+
request_id: request.id,
|
|
479
|
+
wallet: request.wallet,
|
|
480
|
+
service: request.service,
|
|
481
|
+
status: 'pending',
|
|
482
|
+
payload: JSON.stringify(request.payload),
|
|
483
|
+
result: null,
|
|
484
|
+
error: null,
|
|
485
|
+
cost: estimatedCost,
|
|
486
|
+
usage: null,
|
|
487
|
+
created_at: startTime,
|
|
488
|
+
started_at: null,
|
|
489
|
+
completed_at: null,
|
|
490
|
+
});
|
|
491
|
+
jobsByStatus.pending++;
|
|
492
|
+
logger_1.logger.info({
|
|
493
|
+
jobId,
|
|
494
|
+
service: request.service,
|
|
495
|
+
wallet: request.wallet,
|
|
496
|
+
estimatedCost,
|
|
497
|
+
}, 'Compute job created');
|
|
498
|
+
// Execute async
|
|
499
|
+
executeJob(jobId, request, estimatedCost).catch(error => {
|
|
500
|
+
logger_1.logger.error({ error, jobId }, 'Job execution failed');
|
|
501
|
+
});
|
|
502
|
+
return {
|
|
503
|
+
id: request.id,
|
|
504
|
+
jobId,
|
|
505
|
+
service: request.service,
|
|
506
|
+
status: 'pending',
|
|
507
|
+
cost: estimatedCost,
|
|
508
|
+
timestamp: startTime,
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
catch (error) {
|
|
512
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
513
|
+
return {
|
|
514
|
+
id: request.id,
|
|
515
|
+
jobId,
|
|
516
|
+
service: request.service,
|
|
517
|
+
status: 'failed',
|
|
518
|
+
error: errorMsg,
|
|
519
|
+
cost: 0,
|
|
520
|
+
timestamp: startTime,
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
async function executeJob(jobId, request, estimatedCost) {
|
|
525
|
+
const startedAt = Date.now();
|
|
526
|
+
// Update status to processing
|
|
527
|
+
db.updateJob(jobId, { status: 'processing', started_at: startedAt });
|
|
528
|
+
jobsByStatus.pending--;
|
|
529
|
+
jobsByStatus.processing++;
|
|
530
|
+
activeJobs.set(jobId, { wallet: request.wallet, startedAt });
|
|
531
|
+
events.emit('job:started', { jobId, wallet: request.wallet, service: request.service });
|
|
532
|
+
try {
|
|
533
|
+
const handler = handlers.get(request.service);
|
|
534
|
+
if (!handler) {
|
|
535
|
+
throw new Error(`No handler for service: ${request.service}`);
|
|
536
|
+
}
|
|
537
|
+
// Execute with timeout and retry
|
|
538
|
+
const result = await withRetry(() => Promise.race([
|
|
539
|
+
handler(request),
|
|
540
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error('Job timeout')), cfg.jobTimeout)),
|
|
541
|
+
]), { jobId, service: request.service });
|
|
542
|
+
const completedAt = Date.now();
|
|
543
|
+
const durationMs = completedAt - startedAt;
|
|
544
|
+
// Calculate actual usage
|
|
545
|
+
const usage = calculateUsage(request.service, durationMs, request.payload);
|
|
546
|
+
// Update balance
|
|
547
|
+
const balance = getOrCreateBalance(request.wallet);
|
|
548
|
+
const actualCost = usage.breakdown.total;
|
|
549
|
+
const refund = estimatedCost - actualCost;
|
|
550
|
+
balance.pending -= estimatedCost;
|
|
551
|
+
balance.available += refund;
|
|
552
|
+
balance.totalSpent += actualCost;
|
|
553
|
+
saveBalance(balance);
|
|
554
|
+
// Update job
|
|
555
|
+
db.updateJob(jobId, {
|
|
556
|
+
status: 'completed',
|
|
557
|
+
result: JSON.stringify(result),
|
|
558
|
+
cost: actualCost,
|
|
559
|
+
usage: JSON.stringify(usage),
|
|
560
|
+
completed_at: completedAt,
|
|
561
|
+
});
|
|
562
|
+
// Record usage stats
|
|
563
|
+
db.recordUsage(request.wallet, request.service, actualCost, durationMs);
|
|
564
|
+
jobsByStatus.processing--;
|
|
565
|
+
jobsByStatus.completed++;
|
|
566
|
+
totalRevenue += actualCost;
|
|
567
|
+
activeJobs.delete(jobId);
|
|
568
|
+
events.emit('job:completed', { jobId, wallet: request.wallet, service: request.service, cost: actualCost });
|
|
569
|
+
// Send callback if configured
|
|
570
|
+
if (request.callbackUrl) {
|
|
571
|
+
sendCallback(request.callbackUrl, {
|
|
572
|
+
id: request.id,
|
|
573
|
+
jobId,
|
|
574
|
+
service: request.service,
|
|
575
|
+
status: 'completed',
|
|
576
|
+
result,
|
|
577
|
+
cost: actualCost,
|
|
578
|
+
usage,
|
|
579
|
+
timestamp: completedAt,
|
|
580
|
+
}).catch(err => {
|
|
581
|
+
logger_1.logger.error({ err, jobId }, 'Callback failed');
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
logger_1.logger.info({
|
|
585
|
+
jobId,
|
|
586
|
+
service: request.service,
|
|
587
|
+
cost: actualCost,
|
|
588
|
+
durationMs,
|
|
589
|
+
}, 'Job completed');
|
|
590
|
+
// Record success for circuit breaker
|
|
591
|
+
recordCircuitSuccess(request.service);
|
|
592
|
+
}
|
|
593
|
+
catch (error) {
|
|
594
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
595
|
+
const completedAt = Date.now();
|
|
596
|
+
// Track error for admin metrics
|
|
597
|
+
recordError(request.service, errorMsg);
|
|
598
|
+
// Refund on failure
|
|
599
|
+
const balance = getOrCreateBalance(request.wallet);
|
|
600
|
+
balance.pending -= estimatedCost;
|
|
601
|
+
balance.available += estimatedCost;
|
|
602
|
+
saveBalance(balance);
|
|
603
|
+
db.updateJob(jobId, {
|
|
604
|
+
status: 'failed',
|
|
605
|
+
error: errorMsg,
|
|
606
|
+
cost: 0,
|
|
607
|
+
completed_at: completedAt,
|
|
608
|
+
});
|
|
609
|
+
jobsByStatus.processing--;
|
|
610
|
+
jobsByStatus.failed++;
|
|
611
|
+
activeJobs.delete(jobId);
|
|
612
|
+
events.emit('job:failed', { jobId, wallet: request.wallet, error: errorMsg });
|
|
613
|
+
// Record failure for circuit breaker (only for non-user errors)
|
|
614
|
+
if (isRetryableError(error)) {
|
|
615
|
+
recordCircuitFailure(request.service);
|
|
616
|
+
}
|
|
617
|
+
logger_1.logger.error({ jobId, error: errorMsg }, 'Job failed');
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
function calculateUsage(service, durationMs, payload) {
|
|
621
|
+
const price = pricing[service];
|
|
622
|
+
let units;
|
|
623
|
+
switch (service) {
|
|
624
|
+
case 'llm': {
|
|
625
|
+
// Would get actual tokens from result, estimate for now
|
|
626
|
+
const messages = payload?.messages || [];
|
|
627
|
+
const totalChars = messages.reduce((sum, m) => sum + (m.content?.length || 0), 0);
|
|
628
|
+
units = Math.ceil(totalChars / 4);
|
|
629
|
+
break;
|
|
630
|
+
}
|
|
631
|
+
case 'code':
|
|
632
|
+
units = Math.ceil(durationMs / 1000);
|
|
633
|
+
break;
|
|
634
|
+
case 'storage': {
|
|
635
|
+
const content = payload?.content || '';
|
|
636
|
+
units = Math.max(1, Math.ceil(content.length / 1024 / 1024));
|
|
637
|
+
break;
|
|
638
|
+
}
|
|
639
|
+
default:
|
|
640
|
+
units = 1;
|
|
641
|
+
}
|
|
642
|
+
const baseCost = price.basePrice;
|
|
643
|
+
const usageCost = units * price.pricePerUnit;
|
|
644
|
+
const total = Math.min(Math.max(baseCost + usageCost, price.minCharge), price.maxCharge);
|
|
645
|
+
return {
|
|
646
|
+
units,
|
|
647
|
+
unitType: price.unit,
|
|
648
|
+
durationMs,
|
|
649
|
+
breakdown: {
|
|
650
|
+
base: baseCost,
|
|
651
|
+
usage: usageCost,
|
|
652
|
+
total,
|
|
653
|
+
},
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
async function sendCallback(url, data) {
|
|
657
|
+
const secret = process.env.CLODDS_WEBHOOK_SECRET || 'default-secret';
|
|
658
|
+
const signature = (0, crypto_1.createHmac)('sha256', secret)
|
|
659
|
+
.update(JSON.stringify(data))
|
|
660
|
+
.digest('hex');
|
|
661
|
+
await fetch(url, {
|
|
662
|
+
method: 'POST',
|
|
663
|
+
headers: {
|
|
664
|
+
'Content-Type': 'application/json',
|
|
665
|
+
'X-Clodds-Signature': signature,
|
|
666
|
+
'X-Clodds-Timestamp': Date.now().toString(),
|
|
667
|
+
},
|
|
668
|
+
body: JSON.stringify(data),
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
async function getJob(jobId, wallet) {
|
|
672
|
+
const row = db.getJob(jobId);
|
|
673
|
+
if (!row)
|
|
674
|
+
return null;
|
|
675
|
+
// Verify ownership if wallet provided
|
|
676
|
+
if (wallet && row.wallet.toLowerCase() !== wallet.toLowerCase()) {
|
|
677
|
+
return null; // Don't reveal job exists to non-owner
|
|
678
|
+
}
|
|
679
|
+
return {
|
|
680
|
+
id: row.request_id,
|
|
681
|
+
jobId: row.job_id,
|
|
682
|
+
service: row.service,
|
|
683
|
+
status: row.status,
|
|
684
|
+
result: row.result ? JSON.parse(row.result) : undefined,
|
|
685
|
+
error: row.error || undefined,
|
|
686
|
+
cost: row.cost,
|
|
687
|
+
usage: row.usage ? JSON.parse(row.usage) : undefined,
|
|
688
|
+
timestamp: row.completed_at || row.started_at || row.created_at,
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
async function getJobsByWallet(wallet, limit = 50) {
|
|
692
|
+
const rows = db.getJobsByWallet(wallet, limit);
|
|
693
|
+
return rows.map(row => ({
|
|
694
|
+
id: row.request_id,
|
|
695
|
+
jobId: row.job_id,
|
|
696
|
+
service: row.service,
|
|
697
|
+
status: row.status,
|
|
698
|
+
result: row.result ? JSON.parse(row.result) : undefined,
|
|
699
|
+
error: row.error || undefined,
|
|
700
|
+
cost: row.cost,
|
|
701
|
+
usage: row.usage ? JSON.parse(row.usage) : undefined,
|
|
702
|
+
timestamp: row.completed_at || row.started_at || row.created_at,
|
|
703
|
+
}));
|
|
704
|
+
}
|
|
705
|
+
async function cancelJob(jobId, wallet) {
|
|
706
|
+
const row = db.getJob(jobId);
|
|
707
|
+
if (!row)
|
|
708
|
+
return false;
|
|
709
|
+
// Verify ownership
|
|
710
|
+
if (row.wallet.toLowerCase() !== wallet.toLowerCase()) {
|
|
711
|
+
return false;
|
|
712
|
+
}
|
|
713
|
+
// Can only cancel pending jobs
|
|
714
|
+
if (row.status !== 'pending') {
|
|
715
|
+
return false;
|
|
716
|
+
}
|
|
717
|
+
// Refund
|
|
718
|
+
const balance = getOrCreateBalance(wallet);
|
|
719
|
+
balance.pending -= row.cost;
|
|
720
|
+
balance.available += row.cost;
|
|
721
|
+
saveBalance(balance);
|
|
722
|
+
db.updateJob(jobId, {
|
|
723
|
+
status: 'failed',
|
|
724
|
+
error: 'Cancelled by user',
|
|
725
|
+
cost: 0,
|
|
726
|
+
completed_at: Date.now(),
|
|
727
|
+
});
|
|
728
|
+
jobsByStatus.pending--;
|
|
729
|
+
jobsByStatus.failed++;
|
|
730
|
+
events.emit('job:cancelled', { jobId, wallet });
|
|
731
|
+
return true;
|
|
732
|
+
}
|
|
733
|
+
function getPricing(service) {
|
|
734
|
+
return pricing[service];
|
|
735
|
+
}
|
|
736
|
+
async function getBalance(wallet) {
|
|
737
|
+
return getOrCreateBalance(wallet);
|
|
738
|
+
}
|
|
739
|
+
async function depositCredits(wallet, proof) {
|
|
740
|
+
const verification = await verifyPayment(proof);
|
|
741
|
+
if (!verification.valid) {
|
|
742
|
+
return {
|
|
743
|
+
success: false,
|
|
744
|
+
credits: 0,
|
|
745
|
+
txHash: proof.txHash,
|
|
746
|
+
error: verification.error,
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
// Mark as used
|
|
750
|
+
db.markTransactionUsed(proof.txHash, wallet, verification.amount);
|
|
751
|
+
// Update balance
|
|
752
|
+
const balance = getOrCreateBalance(wallet);
|
|
753
|
+
balance.available += verification.amount;
|
|
754
|
+
balance.totalDeposited += verification.amount;
|
|
755
|
+
saveBalance(balance);
|
|
756
|
+
logger_1.logger.info({
|
|
757
|
+
wallet,
|
|
758
|
+
amount: verification.amount,
|
|
759
|
+
txHash: proof.txHash,
|
|
760
|
+
}, 'Credits deposited');
|
|
761
|
+
return {
|
|
762
|
+
success: true,
|
|
763
|
+
credits: verification.amount,
|
|
764
|
+
txHash: proof.txHash,
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
async function getUsage(wallet, period = 'all') {
|
|
768
|
+
const rows = db.getUsage(wallet, period);
|
|
769
|
+
const byService = {};
|
|
770
|
+
let totalCost = 0;
|
|
771
|
+
let totalRequests = 0;
|
|
772
|
+
for (const row of rows) {
|
|
773
|
+
byService[row.service] = {
|
|
774
|
+
requests: row.requests,
|
|
775
|
+
cost: row.total_cost,
|
|
776
|
+
avgDuration: row.total_duration_ms / row.requests,
|
|
777
|
+
};
|
|
778
|
+
totalCost += row.total_cost;
|
|
779
|
+
totalRequests += row.requests;
|
|
780
|
+
}
|
|
781
|
+
return {
|
|
782
|
+
wallet,
|
|
783
|
+
period,
|
|
784
|
+
byService,
|
|
785
|
+
totalCost,
|
|
786
|
+
totalRequests,
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
function getMetrics() {
|
|
790
|
+
return {
|
|
791
|
+
uptime: Date.now() - startTime,
|
|
792
|
+
totalRequests,
|
|
793
|
+
totalRevenue,
|
|
794
|
+
activeJobs: activeJobs.size,
|
|
795
|
+
jobsByStatus: { ...jobsByStatus },
|
|
796
|
+
requestsByService: { ...requestsByService },
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
function getAdminMetrics() {
|
|
800
|
+
const base = getMetrics();
|
|
801
|
+
// Build circuit breaker status for all services
|
|
802
|
+
const cbStatus = {};
|
|
803
|
+
for (const service of Object.keys(pricing)) {
|
|
804
|
+
const cb = circuitBreakers.get(service);
|
|
805
|
+
if (cb) {
|
|
806
|
+
cbStatus[service] = {
|
|
807
|
+
state: cb.state,
|
|
808
|
+
failures: cb.failures,
|
|
809
|
+
lastFailure: cb.lastFailure || null,
|
|
810
|
+
cooldownUntil: cb.state === 'open' && cb.lastFailure
|
|
811
|
+
? cb.lastFailure + cfg.circuitBreakerResetMs
|
|
812
|
+
: null,
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
else {
|
|
816
|
+
cbStatus[service] = {
|
|
817
|
+
state: 'closed',
|
|
818
|
+
failures: 0,
|
|
819
|
+
lastFailure: null,
|
|
820
|
+
cooldownUntil: null,
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
// Get system info
|
|
825
|
+
const memUsage = process.memoryUsage();
|
|
826
|
+
return {
|
|
827
|
+
...base,
|
|
828
|
+
circuitBreakers: cbStatus,
|
|
829
|
+
recentErrors: [...recentErrors].reverse().slice(0, 50), // Most recent first
|
|
830
|
+
systemInfo: {
|
|
831
|
+
nodeVersion: process.version,
|
|
832
|
+
platform: process.platform,
|
|
833
|
+
memoryUsageMB: Math.round(memUsage.heapUsed / 1024 / 1024),
|
|
834
|
+
cpuUsagePercent: 0, // Would need async measurement
|
|
835
|
+
},
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
function shutdown() {
|
|
839
|
+
db.close();
|
|
840
|
+
}
|
|
841
|
+
async function getSpendingLimits(wallet) {
|
|
842
|
+
const limits = db.getSpendingLimits(wallet);
|
|
843
|
+
const dailySpent = db.getSpentInPeriod(wallet, 86400000); // 24 hours
|
|
844
|
+
const monthlySpent = db.getSpentInPeriod(wallet, 2592000000); // 30 days
|
|
845
|
+
return {
|
|
846
|
+
wallet: wallet.toLowerCase(),
|
|
847
|
+
dailyLimit: limits?.daily_limit ?? null,
|
|
848
|
+
monthlyLimit: limits?.monthly_limit ?? null,
|
|
849
|
+
dailySpent,
|
|
850
|
+
monthlySpent,
|
|
851
|
+
dailyRemaining: limits?.daily_limit != null ? Math.max(0, limits.daily_limit - dailySpent) : null,
|
|
852
|
+
monthlyRemaining: limits?.monthly_limit != null ? Math.max(0, limits.monthly_limit - monthlySpent) : null,
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
async function setSpendingLimits(wallet, limits) {
|
|
856
|
+
const current = db.getSpendingLimits(wallet);
|
|
857
|
+
db.setSpendingLimits(wallet, limits.dailyLimit !== undefined ? limits.dailyLimit : (current?.daily_limit ?? null), limits.monthlyLimit !== undefined ? limits.monthlyLimit : (current?.monthly_limit ?? null));
|
|
858
|
+
logger_1.logger.info({ wallet, limits }, 'Spending limits updated');
|
|
859
|
+
}
|
|
860
|
+
function checkSpendingLimits(wallet, amount) {
|
|
861
|
+
const limits = db.getSpendingLimits(wallet);
|
|
862
|
+
if (!limits) {
|
|
863
|
+
return { allowed: true };
|
|
864
|
+
}
|
|
865
|
+
const dailySpent = db.getSpentInPeriod(wallet, 86400000);
|
|
866
|
+
const monthlySpent = db.getSpentInPeriod(wallet, 2592000000);
|
|
867
|
+
if (limits.daily_limit != null && dailySpent + amount > limits.daily_limit) {
|
|
868
|
+
return {
|
|
869
|
+
allowed: false,
|
|
870
|
+
reason: `Daily spending limit exceeded. Limit: $${limits.daily_limit}, spent: $${dailySpent.toFixed(4)}, requested: $${amount.toFixed(4)}`,
|
|
871
|
+
dailyLimit: limits.daily_limit,
|
|
872
|
+
dailySpent,
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
if (limits.monthly_limit != null && monthlySpent + amount > limits.monthly_limit) {
|
|
876
|
+
return {
|
|
877
|
+
allowed: false,
|
|
878
|
+
reason: `Monthly spending limit exceeded. Limit: $${limits.monthly_limit}, spent: $${monthlySpent.toFixed(4)}, requested: $${amount.toFixed(4)}`,
|
|
879
|
+
monthlyLimit: limits.monthly_limit,
|
|
880
|
+
monthlySpent,
|
|
881
|
+
};
|
|
882
|
+
}
|
|
883
|
+
return {
|
|
884
|
+
allowed: true,
|
|
885
|
+
dailyLimit: limits.daily_limit ?? undefined,
|
|
886
|
+
dailySpent,
|
|
887
|
+
monthlyLimit: limits.monthly_limit ?? undefined,
|
|
888
|
+
monthlySpent,
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
// Cleanup old jobs periodically (keep 7 days)
|
|
892
|
+
setInterval(() => {
|
|
893
|
+
const cleaned = db.cleanupOldJobs(7 * 24 * 60 * 60 * 1000);
|
|
894
|
+
if (cleaned > 0) {
|
|
895
|
+
logger_1.logger.info({ count: cleaned }, 'Cleaned up old jobs');
|
|
896
|
+
}
|
|
897
|
+
}, 3600000); // Every hour
|
|
898
|
+
// ==========================================================================
|
|
899
|
+
// API KEY MANAGEMENT
|
|
900
|
+
// ==========================================================================
|
|
901
|
+
async function createApiKey(wallet, name) {
|
|
902
|
+
const apiKey = `clodds_${(0, crypto_1.randomBytes)(24).toString('hex')}`;
|
|
903
|
+
db.createApiKey(apiKey, wallet, name);
|
|
904
|
+
logger_1.logger.info({ wallet, name }, 'API key created');
|
|
905
|
+
return { apiKey, wallet: wallet.toLowerCase(), name };
|
|
906
|
+
}
|
|
907
|
+
function getApiKeyWallet(apiKey) {
|
|
908
|
+
const row = db.getApiKey(apiKey);
|
|
909
|
+
return row?.wallet || null;
|
|
910
|
+
}
|
|
911
|
+
function listApiKeys(wallet) {
|
|
912
|
+
const rows = db.getApiKeysByWallet(wallet);
|
|
913
|
+
return rows.map(row => ({
|
|
914
|
+
apiKey: row.api_key.slice(0, 12) + '...' + row.api_key.slice(-4), // Masked
|
|
915
|
+
name: row.name,
|
|
916
|
+
createdAt: row.created_at,
|
|
917
|
+
lastUsedAt: row.last_used_at,
|
|
918
|
+
revoked: row.revoked_at != null,
|
|
919
|
+
}));
|
|
920
|
+
}
|
|
921
|
+
function revokeApiKey(wallet, apiKey) {
|
|
922
|
+
// Verify the key belongs to this wallet
|
|
923
|
+
const row = db.getApiKey(apiKey);
|
|
924
|
+
if (!row || row.wallet.toLowerCase() !== wallet.toLowerCase()) {
|
|
925
|
+
return false;
|
|
926
|
+
}
|
|
927
|
+
const success = db.revokeApiKey(apiKey);
|
|
928
|
+
if (success) {
|
|
929
|
+
logger_1.logger.info({ wallet, apiKey: apiKey.slice(0, 12) }, 'API key revoked');
|
|
930
|
+
}
|
|
931
|
+
return success;
|
|
932
|
+
}
|
|
933
|
+
return {
|
|
934
|
+
submit,
|
|
935
|
+
getJob,
|
|
936
|
+
getJobsByWallet,
|
|
937
|
+
cancelJob,
|
|
938
|
+
getPricing,
|
|
939
|
+
estimateCost,
|
|
940
|
+
getBalance,
|
|
941
|
+
depositCredits,
|
|
942
|
+
getUsage,
|
|
943
|
+
getSpendingLimits,
|
|
944
|
+
setSpendingLimits,
|
|
945
|
+
checkSpendingLimits,
|
|
946
|
+
registerHandler,
|
|
947
|
+
checkRateLimit,
|
|
948
|
+
getMetrics,
|
|
949
|
+
getAdminMetrics,
|
|
950
|
+
events,
|
|
951
|
+
createApiKey,
|
|
952
|
+
getApiKeyWallet,
|
|
953
|
+
listApiKeys,
|
|
954
|
+
revokeApiKey,
|
|
955
|
+
shutdown,
|
|
956
|
+
};
|
|
957
|
+
}
|
|
958
|
+
//# sourceMappingURL=gateway.js.map
|