import { IdlTypes, IdlAccounts } from "@coral-xyz/anchor"; import { GlamProtocol } from "../glamExports"; import { PublicKey } from "@solana/web3.js"; import { Mint } from "@solana/spl-token"; import { BN } from "@coral-xyz/anchor"; import { MintModel } from "./mint"; import type { RequestQueue } from "./types"; import type { IntegrationAcl, DelegateAcl } from "./acl"; export type StateAccount = IdlAccounts["stateAccount"]; export type StateModelType = IdlTypes["stateModel"]; export type StateAccountType = NonNullable; export type OracleConfigsType = IdlTypes["oracleConfigs"]; type StateIdlModelInput = Partial & { oracleConfigs?: OracleConfigsType | null; }; /** * State model class as defined in the IDL. */ export declare class StateIdlModel implements StateModelType { accountType: StateAccountType | null; name: number[] | null; uri: string | null; enabled: boolean | null; oracleConfigs: OracleConfigsType | null; assets: PublicKey[] | null; created: CreatedModel | null; owner: PublicKey | null; portfolioManagerName: number[] | null; borrowable: PublicKey[] | null; timelockDuration: number | null; integrationAcls: IntegrationAcl[] | null; delegateAcls: DelegateAcl[] | null; constructor(data: StateIdlModelInput); } /** * Enriched state model built from multiple onchain accounts */ export declare class StateModel extends StateIdlModel { accountType: StateAccountType; name: number[]; enabled: boolean; assets: PublicKey[]; created: CreatedModel; owner: PublicKey; portfolioManagerName: number[]; timelockDuration: number; integrationAcls: IntegrationAcl[]; delegateAcls: DelegateAcl[]; id: PublicKey; vault: PublicKey; mint: PublicKey | null; mintModel: MintModel | null; baseAssetMint: PublicKey; baseAssetTokenProgram: number; baseAssetDecimals: number; pendingStateUpdates: any | null; pendingMintUpdates: any | null; timelockExpiresAt: number | null; externalPositions: PublicKey[]; pricedProtocols: any[]; constructor(data: Partial); get idStr(): string; get nameStr(): string; get productType(): string; get launchDate(): string; get sparkleKey(): string; get baseAssetTokenProgramId(): PublicKey; get assetsForPricing(): PublicKey[]; /** * Build a StateModel from onchain data * * @param stateAccount provides core fund data * @param openfundsMetadataAccount includes fund rawOpenfunds data and share class rawOpenfunds data * @param glamMint */ static fromOnchainAccounts(statePda: PublicKey, stateAccount: StateAccount, staging: boolean, glamMint?: Mint, requestQueue?: RequestQueue): StateModel; } export type CreatedModelType = IdlTypes["createdModel"]; export declare class CreatedModel implements CreatedModelType { key: number[]; createdBy: PublicKey; createdAt: BN; constructor(obj: Partial); } export declare const StateAccountType: { VAULT: StateAccountType; TOKENIZED_VAULT: StateAccountType; MINT: StateAccountType; SINGLE_ASSET_VAULT: StateAccountType; equals(a: StateAccountType, b: StateAccountType): boolean; from(s: string): StateAccountType; hasRequestQueue(accountType: StateAccountType): boolean; }; export {};