import { BN } from "@project-serum/anchor"; import { PublicKey } from "@solana/web3.js"; import { BNIsh } from "."; import { MintWithAmount } from "./"; export declare type NonSpecificAtionOverride = { minOuts?: BNIsh[]; }; /** * @param minimumOutFraction - a number to multiply the estimate amounts out by to set to the minimum. This * will usually be 0 to 1 * * @param groupActionsTogether - specify action indices where the transaction to process the action * will be grouped together with the rest of the indices in the list into 1 transaction with multiple instructions. i.e. * [[0, 1], [2, 3]] will have 2 separate process tx transactions where 1 will be processing 0 and 1 in a single transaction * and the other 2 and 3 in an other tx */ export declare type NonSpecificConstructionOpts = { minimumOutToEstimateRatio?: number[]; }; declare type NextMap = { [actionId: string]: number; }; /** * @param nextActions - takes the next action as the key and the * fraction as the value */ export declare type NonSpecificAction = { actionTypeUID: string; actionPID: string; inputs: any; nextActions: NextMap[]; opts?: NonSpecificConstructionOpts; overrides?: NonSpecificAtionOverride; }; /** * A non specific action filled in with partial info after a build * * @param nextActions - takes the next action as the key and the * fraction as the value */ export interface _NonSpecificActionFilled extends NonSpecificAction { inMints?: PK[]; inAmounts?: string[]; inEstimates?: MintWithAmount[]; outEstimates?: MintWithAmount[]; outMints?: PK[]; } export declare const castToStandaloneAction: (action: NonSpecificConstruction["actionDatas"][string]) => NonSpecificAction; export declare const castToActionGroup: (action: NonSpecificConstruction["actionDatas"][string]) => NonSpecificActionGroup; export declare const isNonSpecificActionGroup: (action: NonSpecificConstruction["actionDatas"][string]) => boolean; /** * A group of actions. The actions in the map should only "hit each other" * and then whenever the group is called, the first action is called finishing with the last * * Action groups are meant to be grouped into 1 transaction and thought of as 1 action */ export declare type NonSpecificActionGroup = { first: string; actions: { [internalActionId: string]: NonSpecificAction; }; }; export declare type NonSpecificActionFilled = _NonSpecificActionFilled; declare type NonSpecificActionTypes = NonSpecificAction | _NonSpecificActionFilled | NonSpecificAction; declare type NonSpecificActionInternal = { action: NonSpecificAction; }; declare type NonSpecificActionGroupInternal = { actionGroup: NonSpecificActionGroup; }; declare type NonSpecificConstructionActionWrapper = NonSpecificActionInternal | NonSpecificActionGroupInternal; declare type _NonSpecificConstruction = { actionDatas: NonSpecificConstructionActionDatas; source: { nextActions: NextMap; mints: { [mint: string]: string; }; }; }; /** * The interface necessary to reconstruct a construction given a set of inputs to actions and the "shape" * of the construction * * All types in buildActionInputs should be easily JSON serializable except the provider * * NOTE: all action ids, including ones in action groups, must be unique */ export declare type NonSpecificConstruction = _NonSpecificConstruction; export declare type NonSpecificConstructionFilledUnserializable = _NonSpecificConstruction<_NonSpecificActionFilled>; export declare type NonSpecificConstructionFilled = _NonSpecificConstruction<_NonSpecificActionFilled>; export declare type NonSpecificConstructionNoInitMints = Omit & { source: Omit; }; export declare type NonSpecificConstructionActionDatas = { [actionId: string]: NonSpecificConstructionActionWrapper; }; export {};