import EventEmitter from "eventemitter3"; import { PublicKey, Commitment } from "@solana/web3.js"; import Provider from "../../provider.js"; import { Idl, IdlInstruction, IdlTypeDef } from "../../idl.js"; import { Coder } from "../../coder/index.js"; import { RpcNamespace, InstructionNamespace, TransactionNamespace } from "./index.js"; import { IdlTypes, TypeDef } from "./types.js"; export default class StateFactory { static build(idl: IDL, coder: Coder, programId: PublicKey, provider?: Provider): StateClient | undefined; } type NullableMethods = IDL["state"] extends undefined ? IdlInstruction[] : NonNullable["methods"]; /** * A client for the program state. Similar to the base [[Program]] client, * one can use this to send transactions and read accounts for the state * abstraction. */ export declare class StateClient { /** * Returns the client's wallet and network provider. */ readonly provider: Provider; /** * Returns the coder. */ readonly coder: Coder; /** * [[RpcNamespace]] for all state methods. */ readonly rpc: RpcNamespace[number]>; /** * [[InstructionNamespace]] for all state methods. */ readonly instruction: InstructionNamespace[number]>; /** * [[TransactionNamespace]] for all state methods. */ readonly transaction: TransactionNamespace[number]>; /** * Returns the program ID owning the state. */ get programId(): PublicKey; private _programId; private _address; private _coder; private _idl; private _sub; constructor(idl: IDL, programId: PublicKey, /** * Returns the client's wallet and network provider. */ provider?: Provider, /** * Returns the coder. */ coder?: Coder); /** * Returns the deserialized state account. */ fetch(): Promise["struct"], IdlTypes>>; /** * Returns the state address. */ address(): PublicKey; /** * Returns an `EventEmitter` with a `"change"` event that's fired whenever * the state account cahnges. */ subscribe(commitment?: Commitment): EventEmitter; /** * Unsubscribes to state changes. */ unsubscribe(): void; } export {}; //# sourceMappingURL=state.d.ts.map