Skip to content

MockObliviousSyncProvider

SIP Protocol API Reference v0.15.1


SIP Protocol API Reference / MockObliviousSyncProvider

Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:23704

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-GLbkPPho.d.ts:23711

Partial<MockSyncProviderConfig>

MockObliviousSyncProvider

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

Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:23705

Get provider name/identifier

ObliviousSyncProvider.name


readonly supportedChains: string[]

Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:23706

Supported chains

ObliviousSyncProvider.supportedChains

initialize(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:23712

Initialize the provider

Promise<void>

ObliviousSyncProvider.initialize


getHealth(chainId): Promise<SyncServiceHealth>

Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:23713

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-GLbkPPho.d.ts:23714

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-GLbkPPho.d.ts:23715

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-GLbkPPho.d.ts:23716

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-GLbkPPho.d.ts:23717

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-GLbkPPho.d.ts:23718

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-GLbkPPho.d.ts:23719

Subscribe to new notes (streaming)

`0x${string}`

Public viewing key

string

Chain to watch

(notes) => void

Called when new notes found

Unsubscribe function

() => void

ObliviousSyncProvider.subscribeToNotes


shutdown(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:23720

Shutdown the provider

Promise<void>

ObliviousSyncProvider.shutdown


markNullifierSpent(nullifier): void

Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:23724

Simulate a nullifier being spent (for testing)

`0x${string}`

void


simulateNewNotes(chainId, viewingKeyPublic): void

Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:23728

Simulate new notes arriving (for testing subscriptions)

string

`0x${string}`

void


setBlockHeight(height): void

Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:23732

Set simulated block height

bigint

void