Skip to content

SyncManager

SIP Protocol API Reference v0.12.0


SIP Protocol API Reference / SyncManager

Defined in: @sip-protocol/sdk/dist/index-rqQpCeVM.d.ts:23810

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-rqQpCeVM.d.ts:23816

ObliviousSyncProvider | ObliviousSyncProvider[]

Partial<SyncManagerConfig>

SyncManager

initialize(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-rqQpCeVM.d.ts:23820

Initialize the sync manager

Promise<void>


getState(): WalletSyncState | null

Defined in: @sip-protocol/sdk/dist/index-rqQpCeVM.d.ts:23824

Get current sync state

WalletSyncState | null


getSupportedChains(): string[]

Defined in: @sip-protocol/sdk/dist/index-rqQpCeVM.d.ts:23828

Get supported chains

string[]


getHealth(chainId): Promise<SyncServiceHealth[]>

Defined in: @sip-protocol/sdk/dist/index-rqQpCeVM.d.ts:23832

Check health of all providers for a chain

string

Promise<SyncServiceHealth[]>


sync(viewingKey, spendingKey, options?): Promise<EncryptedNote[]>

Defined in: @sip-protocol/sdk/dist/index-rqQpCeVM.d.ts:23844

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-rqQpCeVM.d.ts:23851

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-rqQpCeVM.d.ts:23860

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-rqQpCeVM.d.ts:23868

Start background sync

ViewingKey

Viewing key

`0x${string}`

Spending key

SyncOptions

Sync options

void


stopBackgroundSync(): void

Defined in: @sip-protocol/sdk/dist/index-rqQpCeVM.d.ts:23872

Stop background sync

void


shutdown(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-rqQpCeVM.d.ts:23876

Shutdown the sync manager

Promise<void>