Skip to main content

Documentation Index

Fetch the complete documentation index at: https://0xcaptain.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

IntentClient wraps the IntentRouter contract. Access it via client.intent.

Methods

postIntent

Post a new deposit intent to the auction system.
const txHash = await client.intent.postIntent({
  asset: "0x...",
  amount: "10000",
  minApyBps: 500,
  maxDrawdownBps: 200,
  duration: 30 * 86400,
});
Parameters (PostIntentParams):
FieldTypeDescription
assetAddressDeposit token
amountstringHuman-readable deposit amount
minApyBpsnumberMinimum APY in basis points
maxDrawdownBpsnumberMax acceptable drawdown in bps
durationnumberLock duration in seconds
decimalsnumberAsset decimals (default 18)
Returns: Promise<Hash>

submitBid

Submit a solver bid on an open intent.
const txHash = await client.intent.submitBid({
  intentId: 42n,
  tierVault: "0xC44C061D257Af305dEAea2eD093E878a615d856d",
  promisedApy: 650,
  bondAmount: "1000",
});
Parameters (SubmitBidParams):
FieldTypeDescription
intentIdbigintThe intent to bid on
tierVaultAddressVault address the solver proposes
promisedApynumberPromised APY in bps
bondAmountstringBond amount (human-readable)
decimalsnumberBond token decimals (default 18)
Returns: Promise<Hash>

settleAuction

Settle the auction for an intent (callable by anyone after the deadline).
await client.intent.settleAuction(42n);
Returns: Promise<Hash>

cancelIntent

Cancel an open intent before the deadline (intent creator only).
await client.intent.cancelIntent(42n);
Returns: Promise<Hash>

getOpenIntents

Fetch recent open intents by scanning backwards from the latest ID.
const intents = await client.intent.getOpenIntents(50);
For production use, query the The Graph subgraph instead of using this method — it scans the chain directly and can be slow for large intent counts.
Returns: Promise<IntentData[]>

getIntent / getBid

const intent = await client.intent.getIntent(42n);
// intent.status: IntentStatus enum (Open=0, Filled=1, Expired=2, Cancelled=3)

const bid = await client.intent.getBid(7n);
// bid.solver, bid.promisedApy, bid.bondPosted, etc.