SyncManager
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / SyncManager
Class: SyncManager
Section titled “Class: SyncManager”Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23510
Sync Manager
Coordinates oblivious synchronization across providers and chains.
Features
Section titled “Features”- Multi-provider support (fallback on failure)
- Multi-chain parallel sync
- Automatic randomness rotation
- Background sync option
- Event-driven progress updates
const manager = new SyncManager(provider)await manager.initialize()
// Sync all chainsconst result = await manager.sync(viewingKey, spendingKey, { listener: { onProgress: (e) => console.log(`${e.percentComplete}%`), onNotesFound: (notes) => console.log(`Found ${notes.length} notes`), }})Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SyncManager(
providers,config?):SyncManager
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23516
Parameters
Section titled “Parameters”providers
Section titled “providers”ObliviousSyncProvider | ObliviousSyncProvider[]
config?
Section titled “config?”Partial<SyncManagerConfig>
Returns
Section titled “Returns”SyncManager
Methods
Section titled “Methods”initialize()
Section titled “initialize()”initialize():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23520
Initialize the sync manager
Returns
Section titled “Returns”Promise<void>
getState()
Section titled “getState()”getState():
WalletSyncState|null
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23524
Get current sync state
Returns
Section titled “Returns”WalletSyncState | null
getSupportedChains()
Section titled “getSupportedChains()”getSupportedChains():
string[]
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23528
Get supported chains
Returns
Section titled “Returns”string[]
getHealth()
Section titled “getHealth()”getHealth(
chainId):Promise<SyncServiceHealth[]>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23532
Check health of all providers for a chain
Parameters
Section titled “Parameters”chainId
Section titled “chainId”string
Returns
Section titled “Returns”Promise<SyncServiceHealth[]>
sync()
Section titled “sync()”sync(
viewingKey,spendingKey,options?):Promise<EncryptedNote[]>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23544
Sync obliviously
Main method for oblivious synchronization. The sync service learns nothing about which notes belong to you or your spending patterns.
Parameters
Section titled “Parameters”viewingKey
Section titled “viewingKey”Viewing key for note detection
spendingKey
Section titled “spendingKey”`0x${string}`
Spending key for nullifier derivation
options?
Section titled “options?”Sync options
Returns
Section titled “Returns”Promise<EncryptedNote[]>
Notes found during sync
checkNullifiersSpent()
Section titled “checkNullifiersSpent()”checkNullifiersSpent(
nullifiers):Promise<Map<`0x${string}`,boolean>>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23551
Check if nullifiers have been spent (obliviously)
Parameters
Section titled “Parameters”nullifiers
Section titled “nullifiers”Oblivious nullifiers to check
Returns
Section titled “Returns”Promise<Map<`0x${string}`, boolean>>
Map of nullifier → spent status
deriveNullifier()
Section titled “deriveNullifier()”deriveNullifier(
noteCommitment,spendingKey,chainId):ObliviousNullifier
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23560
Derive oblivious nullifier for a note
Parameters
Section titled “Parameters”noteCommitment
Section titled “noteCommitment”`0x${string}`
Note commitment
spendingKey
Section titled “spendingKey”`0x${string}`
Spending key
chainId
Section titled “chainId”string
Chain ID
Returns
Section titled “Returns”Oblivious nullifier
startBackgroundSync()
Section titled “startBackgroundSync()”startBackgroundSync(
viewingKey,spendingKey,options?):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23568
Start background sync
Parameters
Section titled “Parameters”viewingKey
Section titled “viewingKey”Viewing key
spendingKey
Section titled “spendingKey”`0x${string}`
Spending key
options?
Section titled “options?”Sync options
Returns
Section titled “Returns”void
stopBackgroundSync()
Section titled “stopBackgroundSync()”stopBackgroundSync():
void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23572
Stop background sync
Returns
Section titled “Returns”void
shutdown()
Section titled “shutdown()”shutdown():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23576
Shutdown the sync manager
Returns
Section titled “Returns”Promise<void>