MockObliviousSyncProvider
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / MockObliviousSyncProvider
Class: MockObliviousSyncProvider
Section titled “Class: 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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MockObliviousSyncProvider(
config?):MockObliviousSyncProvider
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23375
Parameters
Section titled “Parameters”config?
Section titled “config?”Partial<MockSyncProviderConfig>
Returns
Section titled “Returns”MockObliviousSyncProvider
Properties
Section titled “Properties”
readonlyname:"mock-oblivious-sync"="mock-oblivious-sync"
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23369
Get provider name/identifier
Implementation of
Section titled “Implementation of”supportedChains
Section titled “supportedChains”
readonlysupportedChains:string[]
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23370
Supported chains
Implementation of
Section titled “Implementation of”ObliviousSyncProvider.supportedChains
Methods
Section titled “Methods”initialize()
Section titled “initialize()”initialize():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23376
Initialize the provider
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”ObliviousSyncProvider.initialize
getHealth()
Section titled “getHealth()”getHealth(
chainId):Promise<SyncServiceHealth>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23377
Check health of sync service for a chain
Parameters
Section titled “Parameters”chainId
Section titled “chainId”string
Chain to check
Returns
Section titled “Returns”Promise<SyncServiceHealth>
Health information
Implementation of
Section titled “Implementation of”ObliviousSyncProvider.getHealth
scanForNotes()
Section titled “scanForNotes()”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.
Parameters
Section titled “Parameters”_viewingKeyPublic
Section titled “_viewingKeyPublic”`0x${string}`
blockRange
Section titled “blockRange”Blocks to scan
Returns
Section titled “Returns”Promise<EncryptedNote[]>
Encrypted notes that might belong to user
Implementation of
Section titled “Implementation of”ObliviousSyncProvider.scanForNotes
checkNullifiers()
Section titled “checkNullifiers()”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.
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
Implementation of
Section titled “Implementation of”ObliviousSyncProvider.checkNullifiers
getMerkleProofs()
Section titled “getMerkleProofs()”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
Parameters
Section titled “Parameters”commitments
Section titled “commitments”`0x${string}`[]
Note commitments to get proofs for
_chainId
Section titled “_chainId”string
Returns
Section titled “Returns”Promise<Map<`0x${string}`, MerkleProof>>
Merkle proofs for each commitment
Implementation of
Section titled “Implementation of”ObliviousSyncProvider.getMerkleProofs
executeObliviousQuery()
Section titled “executeObliviousQuery()”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.
Parameters
Section titled “Parameters”Encrypted oblivious query
Returns
Section titled “Returns”Promise<ObliviousSyncResponse>
Sync response with encrypted notes
Implementation of
Section titled “Implementation of”ObliviousSyncProvider.executeObliviousQuery
getCurrentHeight()
Section titled “getCurrentHeight()”getCurrentHeight(
chainId):Promise<bigint>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23382
Get current block height for a chain
Parameters
Section titled “Parameters”chainId
Section titled “chainId”string
Chain to query
Returns
Section titled “Returns”Promise<bigint>
Current block height
Implementation of
Section titled “Implementation of”ObliviousSyncProvider.getCurrentHeight
subscribeToNotes()
Section titled “subscribeToNotes()”subscribeToNotes(
viewingKeyPublic,chainId,callback): () =>void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23383
Subscribe to new notes (streaming)
Parameters
Section titled “Parameters”viewingKeyPublic
Section titled “viewingKeyPublic”`0x${string}`
Public viewing key
chainId
Section titled “chainId”string
Chain to watch
callback
Section titled “callback”(notes) => void
Called when new notes found
Returns
Section titled “Returns”Unsubscribe function
():
void
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”ObliviousSyncProvider.subscribeToNotes
shutdown()
Section titled “shutdown()”shutdown():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23384
Shutdown the provider
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”ObliviousSyncProvider.shutdown
markNullifierSpent()
Section titled “markNullifierSpent()”markNullifierSpent(
nullifier):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23388
Simulate a nullifier being spent (for testing)
Parameters
Section titled “Parameters”nullifier
Section titled “nullifier”`0x${string}`
Returns
Section titled “Returns”void
simulateNewNotes()
Section titled “simulateNewNotes()”simulateNewNotes(
chainId,viewingKeyPublic):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23392
Simulate new notes arriving (for testing subscriptions)
Parameters
Section titled “Parameters”chainId
Section titled “chainId”string
viewingKeyPublic
Section titled “viewingKeyPublic”`0x${string}`
Returns
Section titled “Returns”void
setBlockHeight()
Section titled “setBlockHeight()”setBlockHeight(
height):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:23396
Set simulated block height
Parameters
Section titled “Parameters”height
Section titled “height”bigint
Returns
Section titled “Returns”void