import { VersionedTransaction, TransactionSignature, PublicKey, TransactionInstruction } from "@solana/web3.js"; import { BaseClient, BaseTxBuilder, TxOptions } from "./base"; import { StateIdlModel, StateAccountType } from "../models"; export type InitStateParams = { accountType: StateAccountType; name: number[]; baseAssetMint: PublicKey; } & Partial; /** * A subset of StateIdlModel fields that are updatable using updateState instruction */ export type UpdateStateParams = { name?: number[]; owner?: PublicKey; portfolioManagerName?: number[]; timelockDuration?: number; assets?: PublicKey[]; borrowable?: PublicKey[]; }; declare class TxBuilder extends BaseTxBuilder { initializeIx(params: InitStateParams, glamSigner: PublicKey): Promise<[TransactionInstruction, PublicKey]>; initializeTx(params: InitStateParams, txOptions?: TxOptions): Promise<[VersionedTransaction, PublicKey]>; updateIx(params: UpdateStateParams, glamSigner: PublicKey): Promise; updateTx(params: UpdateStateParams, txOptions: TxOptions): Promise; extendIx(newBytes: number, glamSigner: PublicKey): Promise; extendTx(newBytes: number, txOptions?: TxOptions): Promise; closeIx(glamSigner: PublicKey): Promise; closeTx(txOptions?: TxOptions): Promise; } export declare class StateClient { readonly base: BaseClient; readonly txBuilder: TxBuilder; constructor(base: BaseClient); /** * Creates a new GLAM state */ initialize(params: InitStateParams, txOptions?: TxOptions): Promise; /** * Updates the GLAM state account. * * If no timelock , the updates will be applied immediately. * If timelock is enabled, the updates will be staged and can be applied after the timelock period. * * Only the fields provided in `params` will be updated; omitted fields remain unchanged. */ update(params: UpdateStateParams, txOptions?: TxOptions): Promise; /** * Extends GLAM state account size */ extend(newBytes: number, txOptions?: TxOptions): Promise; /** * Closes GLAM state account */ close(txOptions?: TxOptions): Promise; } export {};