Skip to content

MockObliviousSyncProvider

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / MockObliviousSyncProvider

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

Mock Oblivious Sync Provider

Simulates an oblivious sync service for testing. Demonstrates the interface contract without real blockchain data.

new MockObliviousSyncProvider(config?): MockObliviousSyncProvider

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

Partial<MockSyncProviderConfig>

MockObliviousSyncProvider

readonly name: "mock-oblivious-sync" = "mock-oblivious-sync"

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

Get provider name/identifier

ObliviousSyncProvider.name


readonly supportedChains: string[]

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

Supported chains

ObliviousSyncProvider.supportedChains

initialize(): Promise<void>

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

Initialize the provider

Promise<void>

ObliviousSyncProvider.initialize


getHealth(chainId): Promise<SyncServiceHealth>

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

Check health of sync service for a chain

string

Chain to check

Promise<SyncServiceHealth>

Health information

ObliviousSyncProvider.getHealth


scanForNotes(_viewingKeyPublic, blockRange): Promise<EncryptedNote[]>

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

Scan for notes belonging to a viewing key (oblivious)

The service returns ALL notes that COULD belong to the viewing key, without knowing which ones actually do. The user filters locally.

`0x${string}`

BlockRange

Blocks to scan

Promise<EncryptedNote[]>

Encrypted notes that might belong to user

ObliviousSyncProvider.scanForNotes


checkNullifiers(nullifiers): Promise<Map<`0x${string}`, boolean>>

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

Check if nullifiers have been spent (oblivious)

The service checks nullifiers but cannot correlate them to specific notes due to the sync randomness included in derivation.

ObliviousNullifier[]

Oblivious nullifiers to check

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

Map of nullifier → spent status

ObliviousSyncProvider.checkNullifiers


getMerkleProofs(commitments, _chainId): Promise<Map<`0x${string}`, MerkleProof>>

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

Get Merkle proofs for note inclusion

`0x${string}`[]

Note commitments to get proofs for

string

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

Merkle proofs for each commitment

ObliviousSyncProvider.getMerkleProofs


executeObliviousQuery(query): Promise<ObliviousSyncResponse>

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

Execute oblivious sync query

This is the fully oblivious query method where the query itself is encrypted and the service learns nothing.

ObliviousSyncQuery

Encrypted oblivious query

Promise<ObliviousSyncResponse>

Sync response with encrypted notes

ObliviousSyncProvider.executeObliviousQuery


getCurrentHeight(chainId): Promise<bigint>

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

Get current block height for a chain

string

Chain to query

Promise<bigint>

Current block height

ObliviousSyncProvider.getCurrentHeight


subscribeToNotes(viewingKeyPublic, chainId, callback): () => void

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

Subscribe to new notes (streaming)

`0x${string}`

Public viewing key

string

Chain to watch

(notes) => void

Called when new notes found

Unsubscribe function

(): void

void

ObliviousSyncProvider.subscribeToNotes


shutdown(): Promise<void>

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

Shutdown the provider

Promise<void>

ObliviousSyncProvider.shutdown


markNullifierSpent(nullifier): void

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

Simulate a nullifier being spent (for testing)

`0x${string}`

void


simulateNewNotes(chainId, viewingKeyPublic): void

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

Simulate new notes arriving (for testing subscriptions)

string

`0x${string}`

void


setBlockHeight(height): void

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

Set simulated block height

bigint

void