Skip to content

SyncManager

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / SyncManager

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23510

Sync Manager

Coordinates oblivious synchronization across providers and chains.

  • 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 chains
const result = await manager.sync(viewingKey, spendingKey, {
listener: {
onProgress: (e) => console.log(`${e.percentComplete}%`),
onNotesFound: (notes) => console.log(`Found ${notes.length} notes`),
}
})

new SyncManager(providers, config?): SyncManager

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23516

ObliviousSyncProvider | ObliviousSyncProvider[]

Partial<SyncManagerConfig>

SyncManager

initialize(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23520

Initialize the sync manager

Promise<void>


getState(): WalletSyncState | null

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23524

Get current sync state

WalletSyncState | null


getSupportedChains(): string[]

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23528

Get supported chains

string[]


getHealth(chainId): Promise<SyncServiceHealth[]>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23532

Check health of all providers for a chain

string

Promise<SyncServiceHealth[]>


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.

ViewingKey

Viewing key for note detection

`0x${string}`

Spending key for nullifier derivation

SyncOptions

Sync options

Promise<EncryptedNote[]>

Notes found during sync


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)

ObliviousNullifier[]

Oblivious nullifiers to check

Promise<Map<`0x${string}`, boolean>>

Map of nullifier → spent status


deriveNullifier(noteCommitment, spendingKey, chainId): ObliviousNullifier

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23560

Derive oblivious nullifier for a note

`0x${string}`

Note commitment

`0x${string}`

Spending key

string

Chain ID

ObliviousNullifier

Oblivious nullifier


startBackgroundSync(viewingKey, spendingKey, options?): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23568

Start background sync

ViewingKey

Viewing key

`0x${string}`

Spending key

SyncOptions

Sync options

void


stopBackgroundSync(): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23572

Stop background sync

void


shutdown(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23576

Shutdown the sync manager

Promise<void>