Constructor
AI model configuration. The agent cannot run without a provider and API key.
URL of the running Rust sidecar. Change this if you’ve configured a non-default port
or are connecting to a remote sidecar over a tunnel.
HTTP request timeout in milliseconds. Does not apply to SSE streams (those reconnect automatically).
In-memory guardrails for the AI agent — tip caps, retry limits, escalation controls.
All keys are optional; omitted keys fall back to built-in defaults.
The constructor throws See the Policy reference for full documentation, validation rules,
and the relationship to
SinkerPolicyError if the policy has hard contradictions.sinker.policy.json./internal/events. All sinker.on() handlers receive events from this single connection.
Methods
sinker.enqueue()
Enqueue a pre-signed transaction and return a Transaction handle.Base64-encoded wire transaction bytes. The transaction must be fully signed before
enqueueing — Sinker never handles keypairs.
Scheduling hint used by the agent when selecting which transactions to bundle first.
Promise<Transaction>
Example:
sinker.enqueueBatch()
Enqueue multiple transactions in parallel. Useful for batching up to 4 txs into a single Jito bundle.Array of transactions to enqueue. Each is assigned an independent
tx_id.Promise<Transaction[]>
sinker.submit()
Manually trigger a bundle submission. Normally the AI agent calls this automatically — use this only when you’re running without the agent (or in bypass mode) and need direct control over tip and timing.Tip amount in lamports. Use
sinker.getTip() to get live percentile values.One or more
tx_id values from pending transactions. Get them via sinker.getPending().Human-readable rationale string. Written to the lifecycle entry’s
ai_decision_trace.Promise<SubmitResult>
Bundle identifier assigned by Jito (or a synthetic ID on error/fault).
Slot at which the bundle was submitted.
Present and
true when the submission was intercepted by the fault injector.sinker.getMode() / sinker.setMode()
Read or flip the agent’s decision tier at runtime — no restart.cortex reasons on every
submission (the default); reflex runs the deterministic fast-path and escalates to the LLM only on
exceptions. See AI Agent → Two-tier router.
Promise<ModeState> — { supervised: boolean, decision_mode: 'reflex' | 'cortex' }
sinker.getTip()
Latest tip floor percentiles from the Jito oracle (refreshed every 10 seconds).Promise<TipFloor>
sinker.getSlot()
Current slot and the validator identity scheduled to lead it.Promise<ChainState>
sinker.getLifecycle()
Full lifecycle log for all bundle submissions in this sidecar session.Promise<LifecycleLog>
sinker.getPending()
Current pending transaction queue snapshot.Promise<PendingTxQueue>
sinker.on()
Subscribe to a specific SSE event type. See Events for the full list.this (chainable)
sinker.off()
Remove a previously registered handler.sinker.validatePolicy()
Check the current policy for contradictions and dangerous values without throwing. Returns{ errors, warnings, valid }.
PolicyValidationResult
See the Policy reference for the full list of checks.
sinker.destroy()
Disconnect the SSE stream and free resources. Call this when you’re done with the instance.Properties
sinker.model
TheModelConfig passed at construction. Read-only.
sinker.policy
The fully resolved policy — all defaults filled in. Read-only.ResolvedPolicy — all 8 fields present, no optionals.