Skip to main content

@overcast/solana-client

Classes

ClassDescription
SolanaChainSignerSolana implementation of OvercastChainSigner. From a SolanaConfig it resolves the signing keypair and builds the shared connection / provider / Anchor program, then signs and confirms the transactions an SolanaWriter builder produces.
SolanaFactoryThe Solana ProtocolFactory: a single SolanaConfig is all the SDK needs to build every per-layer piece — the SolanaChainSigner, the transaction-building SolanaWriter, the SolanaReader and the SolanaIndexerClient. Hand it to OvercastApp.create and the rest of the SDK stays chain-agnostic. (Protocol-payload signing is chain-agnostic and lives in core — see createProtocolSigner.)
SolanaIndexerClient-
SolanaOracleLayerSolana's oracle-gated settlement layer: settlement is priced off an oracle feed per asset, so its config PDA binds the collateral and settlement mints together with each mint's oracle OracleKindByte kind and 32-byte feed id. That full binding is baked into the config address (see getOracleSettlementConfigPda), so the derived pubkey alone identifies exactly which (mints, oracles) the option settles against.
SolanaPhysicalLayerSolana's physical settlement layer: settlement happens in the underlying asset, so it carries no metadata (inherited from PhysicalSettlementLayer) and commits to DEFAULT_PHYSICAL_CONFIG by default.
SolanaReaderSolana implementation of OvercastReader: the read-only side of the protocol. It needs only an RPC Connection (no wallet), so it serves read-only clients too. PDAs are derived locally via the get*Pda helpers, mirroring the program's seeds = [..].
SolanaUtilsSolana implementation of OvercastUtils: an address is valid iff it parses as a base58 PublicKey. Stateless (no connection / key), so a single shared instance is enough — see solanaUtils.
SolanaWriterSolana implementation of OvercastWriter.

Interfaces

InterfaceDescription
SolanaConfigSolana-specific OvercastConfig. Adds the RPC endpoint (and an optional commitment) the SolanaChainSigner connects with; privateKey (inherited) is the wallet's signing key and is required for a signing wallet.
SolanaLayerThe Solana OvercastLayer: a built Solana transaction (SolanaTx) is submitted to yield a TxInfo receipt, configured by a SolanaConfig. Passed as the single generic argument to the core abstractions instead of spelling out <SolanaTx, TxInfo, SolanaConfig>.

Type Aliases

Type AliasDescription
SolanaTxA built-but-unsigned Solana transaction. Methods on SolanaWriter return one of these so the caller owns signing / sending (and can attach a recent blockhash, fee payer, additional signers, etc.).

Variables

VariableDescription
DEFAULT_COMMITMENTCommitment used for the connection and confirmations when unspecified.
DEFAULT_MAINNET_ORACLE_IDSDefault mainnet oracle feed ids, keyed by asset (mint) Id. Each value is the 32-byte oracle feed id the on-chain config binds that mint to (for the default ORACLE_KIND.Pyth kind, a Pyth price-feed id). Callers settling a pair whose mints aren't listed here pass their own map to SolanaOracleLayer.
DEFAULT_PHYSICAL_CONFIGThe default physical settlement-layer config account. A settlement-config PDA whose owner is the physical layer program; written into option_details.settlement_layer when a caller selects the physical layer without naming a specific config.
DEFAULT_RPC_URLLocal validator RPC — the default endpoint when none is supplied.
DEFAULT_SOLANA_CONFIGThe defaults a SolanaConfig falls back to. privateKey is omitted on purpose: a signing wallet must supply its own key — there is no safe default.
solanaUtilsShared, stateless SolanaUtils — address validation needs no config.

Functions

FunctionDescription
loadKeypairParse a Solana keypair from inlined key material (no filesystem access, so the package stays browser-bundlable). Accepts a raw secret-key byte array, the contents of a Solana CLI id.json (a JSON byte-array string), or a base58-encoded secret key. Resolving a file path is the caller's job.
solanaConfigBuild a complete SolanaConfig from a partial one, filling unset fields from DEFAULT_SOLANA_CONFIG. Pass nothing for an all-defaults config (e.g. a read-only client against the local validator).