Class: Solana::Ruby::Kit::Accounts::MaybeAccount
- Inherits:
-
T::Struct
- Object
- T::Struct
- Solana::Ruby::Kit::Accounts::MaybeAccount
- Defined in:
- lib/solana/ruby/kit/accounts/maybe_account.rb
Overview
Represents an account that may or may not exist on-chain. Mirrors TypeScript’s discriminated union:
MaybeAccount<TData, TAddress> = Account<TData, TAddress> & { exists: true }
| { address: Address<TAddress>; exists: false }
In Ruby we use a single class with an exists flag rather than a union type, since Sorbet cannot narrow struct unions at runtime as easily.