SIPSolver
SIP Protocol API Reference v0.7.0
SIP Protocol API Reference / SIPSolver
Interface: SIPSolver
Section titled “Interface: SIPSolver”Defined in: @sip-protocol/types/dist/index.d.ts:471
SIP Solver interface - what solvers must implement
Solvers receive intents with hidden sender/amount information and must fulfill output requirements based only on public data.
Properties
Section titled “Properties”
readonlyinfo:Solver
Defined in: @sip-protocol/types/dist/index.d.ts:473
Solver information
capabilities
Section titled “capabilities”
readonlycapabilities:SolverCapabilities
Defined in: @sip-protocol/types/dist/index.d.ts:475
Solver capabilities
Methods
Section titled “Methods”canHandle()
Section titled “canHandle()”canHandle(
intent):Promise<boolean>
Defined in: @sip-protocol/types/dist/index.d.ts:482
Evaluate if solver can fulfill an intent
Parameters
Section titled “Parameters”intent
Section titled “intent”Visible portion of the shielded intent
Returns
Section titled “Returns”Promise<boolean>
true if solver can potentially fulfill, false otherwise
generateQuote()
Section titled “generateQuote()”generateQuote(
intent):Promise<SolverQuote|null>
Defined in: @sip-protocol/types/dist/index.d.ts:494
Generate a quote for fulfilling an intent
Solvers only see public fields - they cannot determine:
- Who is sending
- Exact input amount
- Recipient’s real identity
Parameters
Section titled “Parameters”intent
Section titled “intent”Visible portion of the shielded intent
Returns
Section titled “Returns”Promise<SolverQuote | null>
Quote if solver can fulfill, null otherwise
fulfill()
Section titled “fulfill()”fulfill(
intent,quote):Promise<FulfillmentResult>
Defined in: @sip-protocol/types/dist/index.d.ts:502
Fulfill an intent after user accepts quote
Parameters
Section titled “Parameters”intent
Section titled “intent”Full shielded intent (still privacy-preserving)
The accepted quote
Returns
Section titled “Returns”Promise<FulfillmentResult>
Fulfillment result with proof
cancel()?
Section titled “cancel()?”
optionalcancel(intentId):Promise<boolean>
Defined in: @sip-protocol/types/dist/index.d.ts:509
Cancel a pending fulfillment
Parameters
Section titled “Parameters”intentId
Section titled “intentId”string
Intent to cancel
Returns
Section titled “Returns”Promise<boolean>
true if cancelled, false if already fulfilled
getStatus()?
Section titled “getStatus()?”
optionalgetStatus(intentId):Promise<FulfillmentStatus|null>
Defined in: @sip-protocol/types/dist/index.d.ts:516
Get status of a fulfillment
Parameters
Section titled “Parameters”intentId
Section titled “intentId”string
Intent to check
Returns
Section titled “Returns”Promise<FulfillmentStatus | null>
Current status or null if not found