Skip to main content

StateModel

Enriched state model built from multiple onchain accounts. Represents the complete state of a GLAM vault.
id
PublicKey
required
State account public key
vault
PublicKey
required
Vault PDA associated with this state
accountType
StateAccountType
required
Type of state account (vault, tokenizedVault, mint, or singleAssetVault)
name
number[]
required
Raw vault name as character codes
nameStr
string
Vault name as string (getter)
uri
string | null
Metadata URI
enabled
boolean
required
Whether the vault is enabled
assets
PublicKey[]
required
Allowed asset mints for the vault
created
CreatedModel
required
Creation metadata
owner
PublicKey
required
Vault owner public key
portfolioManagerName
number[]
required
Portfolio manager name as character codes
borrowable
PublicKey[] | null
Borrowable asset mints
reduceOnly
boolean | null
Whether the vault is in reduce-only mode
anyLst
boolean | null
Whether any LST is allowed
timelockDuration
number
required
Timelock duration in seconds
integrationAcls
IntegrationAcl[]
required
Integration access control lists
delegateAcls
DelegateAcl[]
required
Delegate access control lists
feeStructure
FeeStructure | null
Fee configuration
mint
PublicKey | null
Associated share mint (for tokenized vaults)
mintModel
MintModel | null
Associated mint model (for tokenized vaults)
baseAssetMint
PublicKey
required
Base asset mint (e.g., USDC or SOL)
baseAssetTokenProgram
number
required
Token program ID for base asset (0 = Token Program, 1 = Token-2022)
baseAssetTokenProgramId
PublicKey
Token program PublicKey for base asset (getter)
baseAssetDecimals
number
required
Decimals for base asset
pendingStateUpdates
any | null
Pending state updates (during timelock)
pendingMintUpdates
any | null
Pending mint updates (during timelock)
timelockExpiresAt
number | null
Timestamp when timelock expires
externalPositions
PublicKey[]
required
External position accounts
pricedProtocols
any[]
required
Priced protocol positions
productType
string
Human-readable product type (getter)
launchDate
string
ISO date string of vault creation (getter)
sparkleKey
string
Unique key for vault identification (getter)
assetsForPricing
PublicKey[]
Union set of assets and borrowable assets (getter)

Static methods

fromOnchainAccounts
function
static fromOnchainAccounts(
  statePda: PublicKey,
  stateAccount: StateAccount,
  staging: boolean,
  glamMint?: Mint,
  requestQueue?: RequestQueue,
): StateModel
Builds a StateModel from onchain data.

StateAccountType

Enum representing the type of state account.
VAULT
{ vault: {} }
Standard vault type
TOKENIZED_VAULT
{ tokenizedVault: {} }
Tokenized vault with share tokens
MINT
{ mint: {} }
Mint-only account
SINGLE_ASSET_VAULT
{ singleAssetVault: {} }
Single asset vault type

Static methods

equals
function
static equals(a: StateAccountType, b: StateAccountType): boolean
Compares two StateAccountType instances.
from
function
static from(s: string): StateAccountType
Creates StateAccountType from string (“vault”, “tokenizedVault”, “singleAssetVault”, or “mint”).

CreatedModel

Metadata about vault creation.
key
number[]
required
Initialization key as byte array
createdBy
PublicKey
required
Public key of vault creator
createdAt
BN
required
Unix timestamp of creation

Build docs developers (and LLMs) love