import { BN, Provider } from "@project-serum/anchor"; import { PublicKey, Cluster } from "@solana/web3.js"; import { BuildActionMap, Construction } from "./interfaces"; import { BuildEphemeralOpts, CleanupOpts, ConstructionCompiled, ConstructionInstr, ConstructionOnChainSerialized, MintWithAmount, NonSpecificConstruction, NonSpecificConstructionFilled, RunConstructionOpts } from "."; import { MallocRunnerError } from "./interfaces/errors"; export declare class MallocSdk { private readonly provider; private readonly cluster; private readonly mallocProgram; private readonly MALLOC_PROGRAM_ID; constructor(_MALLOC_PROGRAM_ID: PublicKey | string, provider: Provider, cluster: Cluster); buildWithFill(nonspecific: NonSpecificConstruction, buildActionMap: BuildActionMap, buildCompileOpts?: BuildEphemeralOpts): Promise<{ constructionBuilt: Construction; filledNonSpecific: NonSpecificConstructionFilled; }>; build(nonspecific: NonSpecificConstruction, buildActionMap: BuildActionMap, buildCompileOpts?: BuildEphemeralOpts): Promise; buildCompileRun(nonspecific: NonSpecificConstruction, inputTokenAccounts: PublicKey[], buildActionMap: BuildActionMap, buildCompileOpts?: BuildEphemeralOpts, runOpts?: RunConstructionOpts): Promise; getErrorInfo(construction: Construction, error: MallocRunnerError): { successful: string[]; errored?: string; notRan: string[]; }; compileConstruction(inst: ConstructionInstr): Promise; getConstructionState(data: ConstructionCompiled): Promise; /** * Close the ephemeral accounts such that the caller reclaims more rent then * is spent on the transaction of closing the account. * * As a note: this may mean that result accounts are not closed as they have next to * no rent */ cleanup(constructionData: ConstructionCompiled, options?: CleanupOpts): Promise; runConstruction(construction: ConstructionCompiled, options?: RunConstructionOpts): Promise; /** * Run a construction starting with the transaction for a specific action */ runConstructionFromAction(construction: ConstructionCompiled, actionName: string, options?: RunConstructionOpts): Promise; getEstimates(builtConstruction: Construction, actionName: string): { estimateIns: MintWithAmount[]; estimateOuts: MintWithAmount[]; }; }