GenericProvider
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / GenericProvider
Class: GenericProvider
Section titled “Class: GenericProvider”Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15826
Generic RPC Provider implementation
Uses standard Solana RPC methods. Works with any RPC endpoint. Recommended for development, testing, or self-hosted nodes.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new GenericProvider(
config):GenericProvider
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15829
Parameters
Section titled “Parameters”config
Section titled “config”Returns
Section titled “Returns”GenericProvider
Properties
Section titled “Properties”
readonlyname:"generic"="generic"
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15827
Provider name for logging/debugging
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”getAssetsByOwner()
Section titled “getAssetsByOwner()”getAssetsByOwner(
owner):Promise<TokenAsset[]>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15836
Get all token assets owned by an address using getParsedTokenAccountsByOwner
Note: This is less efficient than Helius DAS API for large wallets, but works with any RPC endpoint.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<TokenAsset[]>
Implementation of
Section titled “Implementation of”SolanaRPCProvider.getAssetsByOwner
getTokenBalance()
Section titled “getTokenBalance()”getTokenBalance(
owner,mint):Promise<bigint>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15848
Get token balance for a specific mint
M1 FIX: Properly differentiate between missing accounts (return 0n) and actual RPC errors (throw NetworkError)
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”Promise<bigint>
Implementation of
Section titled “Implementation of”SolanaRPCProvider.getTokenBalance
supportsSubscriptions()
Section titled “supportsSubscriptions()”supportsSubscriptions():
boolean
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15855
Check if provider supports real-time subscriptions
Generic RPC supports WebSocket subscriptions but they’re not efficient for monitoring token transfers. Returns false.
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”SolanaRPCProvider.supportsSubscriptions
getConnection()
Section titled “getConnection()”getConnection():
Connection
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:15861
Get the underlying Connection object
Useful for advanced operations that need direct RPC access.
Returns
Section titled “Returns”Connection