PrivateWalletAdapter
SIP Protocol API Reference v0.7.0
SIP Protocol API Reference / PrivateWalletAdapter
Interface: PrivateWalletAdapter
Section titled “Interface: PrivateWalletAdapter”Defined in: @sip-protocol/types/dist/index.d.ts:2751
Privacy-enhanced wallet adapter
Extends WalletAdapter with privacy features:
- Stealth address generation and scanning
- Viewing key export for compliance
- Shielded transaction support
Example
Section titled “Example”class ZcashPrivateWallet implements PrivateWalletAdapter { // ... WalletAdapter methods ...
getStealthMetaAddress(): StealthMetaAddress { return this.stealthMeta }
async shieldedSend(params: ShieldedSendParams): Promise<ShieldedSendResult> { // Use Zcash shielded pool }}Extends
Section titled “Extends”Properties
Section titled “Properties”
readonlychain:ChainId
Defined in: @sip-protocol/types/dist/index.d.ts:2617
Chain this adapter connects to
Inherited from
Section titled “Inherited from”
readonlyname:string
Defined in: @sip-protocol/types/dist/index.d.ts:2619
Wallet name/identifier (e.g., ‘phantom’, ‘metamask’)
Inherited from
Section titled “Inherited from”address
Section titled “address”
readonlyaddress:string
Defined in: @sip-protocol/types/dist/index.d.ts:2621
Current address (empty string if not connected)
Inherited from
Section titled “Inherited from”publicKey
Section titled “publicKey”
readonlypublicKey:""|`0x${string}`
Defined in: @sip-protocol/types/dist/index.d.ts:2623
Public key (hex encoded, empty string if not connected)
Inherited from
Section titled “Inherited from”connectionState
Section titled “connectionState”
readonlyconnectionState:WalletConnectionState
Defined in: @sip-protocol/types/dist/index.d.ts:2627
Current connection state
Inherited from
Section titled “Inherited from”IWalletAdapter.connectionState
Methods
Section titled “Methods”connect()
Section titled “connect()”connect():
Promise<void>
Defined in: @sip-protocol/types/dist/index.d.ts:2633
Connect to the wallet
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”If connection fails
Inherited from
Section titled “Inherited from”disconnect()
Section titled “disconnect()”disconnect():
Promise<void>
Defined in: @sip-protocol/types/dist/index.d.ts:2637
Disconnect from the wallet
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”isConnected()
Section titled “isConnected()”isConnected():
boolean
Defined in: @sip-protocol/types/dist/index.d.ts:2641
Check if wallet is connected
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”signMessage()
Section titled “signMessage()”signMessage(
message):Promise<Signature>
Defined in: @sip-protocol/types/dist/index.d.ts:2649
Sign an arbitrary message
Parameters
Section titled “Parameters”message
Section titled “message”Uint8Array
The message bytes to sign
Returns
Section titled “Returns”Promise<Signature>
The signature
Throws
Section titled “Throws”If signing fails or wallet not connected
Inherited from
Section titled “Inherited from”signTransaction()
Section titled “signTransaction()”signTransaction(
tx):Promise<SignedTransaction>
Defined in: @sip-protocol/types/dist/index.d.ts:2657
Sign a transaction
Parameters
Section titled “Parameters”The unsigned transaction
Returns
Section titled “Returns”Promise<SignedTransaction>
The signed transaction
Throws
Section titled “Throws”If signing fails or wallet not connected
Inherited from
Section titled “Inherited from”IWalletAdapter.signTransaction
signAndSendTransaction()
Section titled “signAndSendTransaction()”signAndSendTransaction(
tx):Promise<TransactionReceipt>
Defined in: @sip-protocol/types/dist/index.d.ts:2665
Sign and broadcast a transaction
Parameters
Section titled “Parameters”The unsigned transaction
Returns
Section titled “Returns”Promise<TransactionReceipt>
The transaction receipt
Throws
Section titled “Throws”If signing or broadcast fails
Inherited from
Section titled “Inherited from”IWalletAdapter.signAndSendTransaction
getBalance()
Section titled “getBalance()”getBalance():
Promise<bigint>
Defined in: @sip-protocol/types/dist/index.d.ts:2672
Get native token balance
Returns
Section titled “Returns”Promise<bigint>
Balance in smallest unit (lamports, wei, etc.)
Throws
Section titled “Throws”If query fails
Inherited from
Section titled “Inherited from”getTokenBalance()
Section titled “getTokenBalance()”getTokenBalance(
asset):Promise<bigint>
Defined in: @sip-protocol/types/dist/index.d.ts:2680
Get token balance for a specific asset
Parameters
Section titled “Parameters”The asset to query balance for
Returns
Section titled “Returns”Promise<bigint>
Balance in smallest unit
Throws
Section titled “Throws”If query fails or asset not supported
Inherited from
Section titled “Inherited from”IWalletAdapter.getTokenBalance
on<
T>(event,handler):void
Defined in: @sip-protocol/types/dist/index.d.ts:2687
Subscribe to wallet events
Type Parameters
Section titled “Type Parameters”T extends WalletEventType
Parameters
Section titled “Parameters”T
Event type to subscribe to
handler
Section titled “handler”WalletEventHandler<Extract<WalletConnectEvent, { type: T; }> | Extract<WalletDisconnectEvent, { type: T; }> | Extract<WalletAccountChangedEvent, { type: T; }> | Extract<WalletChainChangedEvent, { type: T; }> | Extract<WalletErrorEvent, { type: T; }>>
Event handler function
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”off<
T>(event,handler):void
Defined in: @sip-protocol/types/dist/index.d.ts:2696
Unsubscribe from wallet events
Type Parameters
Section titled “Type Parameters”T extends WalletEventType
Parameters
Section titled “Parameters”T
Event type to unsubscribe from
handler
Section titled “handler”WalletEventHandler<Extract<WalletConnectEvent, { type: T; }> | Extract<WalletDisconnectEvent, { type: T; }> | Extract<WalletAccountChangedEvent, { type: T; }> | Extract<WalletChainChangedEvent, { type: T; }> | Extract<WalletErrorEvent, { type: T; }>>
Event handler to remove
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”supportsStealthAddresses()
Section titled “supportsStealthAddresses()”supportsStealthAddresses():
boolean
Defined in: @sip-protocol/types/dist/index.d.ts:2755
Check if wallet supports stealth addresses
Returns
Section titled “Returns”boolean
getStealthMetaAddress()
Section titled “getStealthMetaAddress()”getStealthMetaAddress():
StealthMetaAddress
Defined in: @sip-protocol/types/dist/index.d.ts:2765
Get the stealth meta-address for receiving private payments
The meta-address contains spending and viewing public keys that senders use to derive one-time stealth addresses.
Returns
Section titled “Returns”The stealth meta-address
Throws
Section titled “Throws”If stealth addresses not supported
deriveStealthAddress()
Section titled “deriveStealthAddress()”deriveStealthAddress(
ephemeralPubKey):StealthAddress
Defined in: @sip-protocol/types/dist/index.d.ts:2774
Generate a one-time stealth address from an ephemeral public key
Used by senders to derive a unique receiving address.
Parameters
Section titled “Parameters”ephemeralPubKey
Section titled “ephemeralPubKey”`0x${string}`
Sender’s ephemeral public key
Returns
Section titled “Returns”The derived stealth address
checkStealthAddress()
Section titled “checkStealthAddress()”checkStealthAddress(
stealthAddress,ephemeralPubKey):boolean
Defined in: @sip-protocol/types/dist/index.d.ts:2782
Check if a stealth address belongs to this wallet
Parameters
Section titled “Parameters”stealthAddress
Section titled “stealthAddress”`0x${string}`
The address to check
ephemeralPubKey
Section titled “ephemeralPubKey”`0x${string}`
The ephemeral public key used
Returns
Section titled “Returns”boolean
True if this wallet can spend from the address
scanStealthPayments()
Section titled “scanStealthPayments()”scanStealthPayments(
fromBlock?,toBlock?):Promise<object[]>
Defined in: @sip-protocol/types/dist/index.d.ts:2793
Scan for received stealth payments
Scans announcements/transactions to find payments to this wallet’s stealth addresses.
Parameters
Section titled “Parameters”fromBlock?
Section titled “fromBlock?”bigint
Optional starting block
toBlock?
Section titled “toBlock?”bigint
Optional ending block
Returns
Section titled “Returns”Promise<object[]>
Array of detected stealth addresses with amounts
supportsViewingKeys()
Section titled “supportsViewingKeys()”supportsViewingKeys():
boolean
Defined in: @sip-protocol/types/dist/index.d.ts:2803
Check if wallet supports viewing key export
Returns
Section titled “Returns”boolean
exportViewingKey()
Section titled “exportViewingKey()”exportViewingKey():
ViewingKey
Defined in: @sip-protocol/types/dist/index.d.ts:2813
Export viewing key for selective disclosure
Allows third parties (auditors, regulators) to view transaction details without spending capability.
Returns
Section titled “Returns”The viewing key
Throws
Section titled “Throws”If viewing keys not supported
supportsShieldedTransactions()
Section titled “supportsShieldedTransactions()”supportsShieldedTransactions():
boolean
Defined in: @sip-protocol/types/dist/index.d.ts:2817
Check if wallet supports shielded transactions
Returns
Section titled “Returns”boolean
getShieldedBalance()
Section titled “getShieldedBalance()”getShieldedBalance():
Promise<bigint>
Defined in: @sip-protocol/types/dist/index.d.ts:2823
Get shielded balance (in shielded pools, if applicable)
Returns
Section titled “Returns”Promise<bigint>
Shielded balance in smallest unit
shieldedSend()
Section titled “shieldedSend()”shieldedSend(
params):Promise<WalletShieldedSendResult>
Defined in: @sip-protocol/types/dist/index.d.ts:2834
Send tokens with maximum privacy
Uses shielded pools and/or stealth addresses depending on the target chain’s capabilities.
Parameters
Section titled “Parameters”params
Section titled “params”Shielded send parameters
Returns
Section titled “Returns”Promise<WalletShieldedSendResult>
The transaction result
Throws
Section titled “Throws”If shielded send fails