@overcast/solana-client
Classes
| Class | Description |
|---|---|
| SolanaChainSigner | Solana 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. |
| SolanaFactory | The 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 | - |
| SolanaOracleLayer | Solana'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. |
| SolanaPhysicalLayer | Solana'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. |
| SolanaReader | Solana 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 = [..]. |
| SolanaUtils | Solana 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. |
| SolanaWriter | Solana implementation of OvercastWriter. |
Interfaces
| Interface | Description |
|---|---|
| SolanaConfig | Solana-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. |
| SolanaLayer | The 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 Alias | Description |
|---|---|
| SolanaTx | A 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
| Variable | Description |
|---|---|
| DEFAULT_COMMITMENT | Commitment used for the connection and confirmations when unspecified. |
| DEFAULT_MAINNET_ORACLE_IDS | Default 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_CONFIG | The 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_URL | Local validator RPC — the default endpoint when none is supplied. |
| DEFAULT_SOLANA_CONFIG | The defaults a SolanaConfig falls back to. privateKey is omitted on purpose: a signing wallet must supply its own key — there is no safe default. |
| solanaUtils | Shared, stateless SolanaUtils — address validation needs no config. |
Functions
| Function | Description |
|---|---|
| loadKeypair | Parse 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. |
| solanaConfig | Build 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). |