import { AccountMeta, ConfirmOptions, PublicKey, Signer, Transaction, TransactionInstruction, TransactionSignature } from "@solana/web3.js"; import { Idl, IdlAccountItem, IdlAccounts, IdlTypeDef } from "../../idl.js"; import Provider from "../../provider.js"; import { AccountsGeneric, CustomAccountResolver } from "../accounts-resolver.js"; import { Address } from "../common.js"; import { Accounts } from "../context.js"; import { AccountNamespace } from "./account.js"; import { InstructionFn } from "./instruction.js"; import { RpcFn } from "./rpc.js"; import { SimulateFn, SimulateResponse } from "./simulate.js"; import { TransactionFn } from "./transaction.js"; import { AllInstructions, InstructionAccountAddresses, MakeMethodsNamespace, MethodsFn } from "./types.js"; import { ViewFn } from "./views.js"; export type MethodsNamespace = AllInstructions> = MakeMethodsNamespace; export declare class MethodsBuilderFactory { static build>(provider: Provider, programId: PublicKey, idlIx: AllInstructions, ixFn: InstructionFn, txFn: TransactionFn, rpcFn: RpcFn, simulateFn: SimulateFn, viewFn: ViewFn | undefined, accountNamespace: AccountNamespace, idlTypes: IdlTypeDef[], customResolver?: CustomAccountResolver): MethodsFn>; } export type PartialAccounts = Partial<{ [N in A["name"]]: PartialAccount; }>; type PartialAccount = A extends IdlAccounts ? PartialAccounts : A extends { isOptional: true; } ? Address | null : Address; export declare function isPartialAccounts(partialAccount: PartialAccount): partialAccount is PartialAccounts; export declare function flattenPartialAccounts(partialAccounts: PartialAccounts, throwOnNull: boolean): AccountsGeneric; export declare class MethodsBuilder> { private _ixFn; private _txFn; private _rpcFn; private _simulateFn; private _viewFn; private _programId; private readonly _accounts; private _remainingAccounts; private _signers; private _preInstructions; private _postInstructions; private _accountsResolver; private _autoResolveAccounts; private _args; constructor(_args: Array, _ixFn: InstructionFn, _txFn: TransactionFn, _rpcFn: RpcFn, _simulateFn: SimulateFn, _viewFn: ViewFn | undefined, _provider: Provider, _programId: PublicKey, _idlIx: AllInstructions, _accountNamespace: AccountNamespace, _idlTypes: IdlTypeDef[], _customResolver?: CustomAccountResolver); args(_args: Array): void; pubkeys(): Promise>>; accounts(accounts: PartialAccounts): MethodsBuilder; accountsStrict(accounts: Accounts): MethodsBuilder; signers(signers: Array): MethodsBuilder; remainingAccounts(accounts: Array): MethodsBuilder; preInstructions(ixs: Array): MethodsBuilder; postInstructions(ixs: Array): MethodsBuilder; rpc(options?: ConfirmOptions): Promise; rpcAndKeys(options?: ConfirmOptions): Promise<{ pubkeys: Partial>; signature: TransactionSignature; }>; view(options?: ConfirmOptions): Promise; simulate(options?: ConfirmOptions): Promise>; instruction(): Promise; /** * Convenient shortcut to get instructions and pubkeys via * const { pubkeys, instructions } = await prepare(); */ prepare(): Promise<{ pubkeys: Partial>; instruction: TransactionInstruction; signers: Signer[]; }>; transaction(): Promise; } export {}; //# sourceMappingURL=methods.d.ts.map