createSmartRouter()
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / createSmartRouter
Function: createSmartRouter()
Section titled “Function: createSmartRouter()”createSmartRouter(
registry,options?):SmartRouter
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:8018
Create a new SmartRouter instance
Parameters
Section titled “Parameters”registry
Section titled “registry”Settlement registry with registered backends
options?
Section titled “options?”SmartRouterOptions
Router configuration options
Returns
Section titled “Returns”SmartRouter instance
Example
Section titled “Example”const registry = new SettlementRegistry()registry.register(nearIntentsBackend)registry.register(zcashBackend)
const router = createSmartRouter(registry, { cacheTtlMs: 30_000, backendTimeoutMs: 5_000,})const routes = await router.findBestRoute({ ... })