PrivacySmartRouter
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / PrivacySmartRouter
Class: PrivacySmartRouter
Section titled “Class: PrivacySmartRouter”Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:21612
SmartRouter for automatic backend selection
Analyzes available backends and selects the optimal one based on user preferences and transfer requirements.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PrivacySmartRouter(
registry):SmartRouter
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:21619
Create a new SmartRouter
Parameters
Section titled “Parameters”registry
Section titled “registry”Backend registry to use for selection
Returns
Section titled “Returns”SmartRouter
Methods
Section titled “Methods”selectBackend()
Section titled “selectBackend()”selectBackend(
params,config?):Promise<PrivacyBackendSelectionResult>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:21628
Select the best backend for a transfer
Parameters
Section titled “Parameters”params
Section titled “params”Transfer parameters
config?
Section titled “config?”Partial<PrivacySmartRouterConfig>
Router configuration
Returns
Section titled “Returns”Promise<PrivacyBackendSelectionResult>
Selection result with backend and reasoning
Throws
Section titled “Throws”Error if no suitable backend is found
execute()
Section titled “execute()”execute(
params,config?):Promise<PrivacyTransactionResult>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:21640
Execute a transfer using the best available backend
Includes automatic fallback to alternatives if the primary backend fails (when enableFallback is true). Records success/failure for health tracking.
Parameters
Section titled “Parameters”params
Section titled “params”Transfer parameters
config?
Section titled “config?”Partial<PrivacySmartRouterConfig>
Router configuration
Returns
Section titled “Returns”Promise<PrivacyTransactionResult>
Transaction result
Throws
Section titled “Throws”AllBackendsFailedError if all backends fail
executeComputation()
Section titled “executeComputation()”executeComputation(
params,config?):Promise<ComputationResult>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:21669
Execute a computation using the best available compute backend
Selects from compute-type backends (Arcium, Inco) and executes the computation via MPC/FHE.
Parameters
Section titled “Parameters”params
Section titled “params”ComputationParams
Computation parameters
config?
Section titled “config?”Partial<PrivacySmartRouterConfig>
Router configuration
Returns
Section titled “Returns”Promise<ComputationResult>
Computation result
Throws
Section titled “Throws”Error if no compute backend is available or supports the computation
Example
Section titled “Example”const result = await router.executeComputation({ chain: 'solana', circuitId: 'private-swap', encryptedInputs: [encryptedAmount, encryptedPrice],})selectComputeBackend()
Section titled “selectComputeBackend()”selectComputeBackend(
params,config?):Promise<PrivacyBackendSelectionResult>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:21678
Select the best compute backend for a computation
Parameters
Section titled “Parameters”params
Section titled “params”ComputationParams
Computation parameters
config?
Section titled “config?”Partial<PrivacySmartRouterConfig>
Router configuration
Returns
Section titled “Returns”Promise<PrivacyBackendSelectionResult>
Selection result with backend and reasoning
Throws
Section titled “Throws”Error if no suitable compute backend is found
getAvailableBackends()
Section titled “getAvailableBackends()”getAvailableBackends(
params):Promise<object[]>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:21685
Get available backends for a transfer (without selecting)
Parameters
Section titled “Parameters”params
Section titled “params”Transfer parameters
Returns
Section titled “Returns”Promise<object[]>
Array of available backends with scores