Skip to content

estimateIntent ​

Select spendable notes and return fees, delivered amount, a sanitized route, and an in-memory handle that can be passed to executeIntent.

Import ​

ts
import { estimateIntent } from "@0xcurvy/curvy-sdk/actions";

Usage ​

ts
const estimation = await estimateIntent({ intent });

Signature ​

ts
function estimateIntent(parameters: EstimateIntentParameters): Promise<IntentEstimation>

Returns ​

Promise<IntentEstimation>

The action resolves or returns the value shown in the signature.

Parameters ​

intent ​

  • Type: Intent
  • Required: yes

The transfer intent to plan and estimate.

ts
const result = await estimateIntent({
  intent, 
});

accountId ​

  • Type: string
  • Required: no

Explicit account guard. This config has one bearer session, so it must be the active account.

ts
const result = await estimateIntent({
  intent,
  accountId, 
});

signal ​

  • Type: AbortSignal
  • Required: no

Cancel a superseded estimate; cancelled results are never published.

ts
const result = await estimateIntent({
  intent,
  signal, 
});

minimumInputFinalityPolicy ​

  • Type: InputFinalityPolicy
  • Required: no

Integration-level lower bound that account/intent settings cannot weaken.

ts
const result = await estimateIntent({
  intent,
  minimumInputFinalityPolicy, 
});

submissionMode ​

  • Type: SubmissionMode
  • Required: no

Override the config's submission path for this estimate and its prepared execution.

ts
const result = await estimateIntent({
  intent,
  submissionMode, 
});

config ​

  • Type: CurvyConfig
  • Required: no

Curvy config to use. Defaults to the ambient config.

ts
const result = await estimateIntent({
  intent,
  config, 
});

Errors ​

  • NoActiveAccountError when no account is active.
  • a typed CurvyError when selection or estimation fails.

Source ​

packages/@0xcurvy/sdk/src/actions/planner/estimateIntent.ts