SDK Components
The GLAM SDK follows a modular architecture with a mainGlamClient
that provides access to specialized sub-clients for different functionalities:
- BaseClient: Foundation class providing core Solana functionality
- GlamClient: Main entry point with lazy-loaded sub-clients
- Sub-clients: Specialized clients for specific protocol features
- Models: Type definitions and data structures
- Utils: Helper functions and utilities
GlamClient
TheGlamClient
is the main entry point for the GLAM SDK. It uses lazy initialization to load sub-clients only when needed, optimizing performance and resource usage.
Initialization
TheGlamClient
can be initialized using default Anchor provider and wallet:
Core Features
TheGlamClient
extends BaseClient
and provides:
- Connection Management: Handles Solana RPC connections
- Transaction Processing: Sign, send, and confirm transactions
- Program Integration: Interfaces with GLAM protocol programs
- Sub-client Access: Lazy-loaded specialized clients
Sub-clients
Sub-clients are loaded on first use.Transaction Options
Most client methods accept an optionalTxOptions
parameter:
TxOptions
allows client methods to provide additional options that configure the transaction. Here is the type definition:
signer
: Overrides the default signer for the transactioncomputeUnitLimit
: Sets the compute unit limit for the transactiongetPriorityFeeMicroLamports
: A callback function for getting the dynamic priority fee for the transactionmaxFeeLamports
: Sets the maximum priority fee for the transactionuseMaxFee
: If true, uses the maximum priority feepreInstructions
: Adds instructions to the transaction before the main instructionlookupTables
: Adds lookup tables to the transactionsimulate
: If true, simulates the transaction before sending it