UNPKG

@biconomy/abstractjs

Version:

SDK for Biconomy integration with support for account abstraction, smart accounts, ERC-4337.

23 lines 861 B
/** * Builds a base set of instructions by combining existing instructions with new ones * * @param baseParams - {@link BaseInstructionsParams} Base configuration * @param params - {@link BuildDefaultParams} Instructions configuration * @returns Promise resolving to an array of {@link Instruction} * * @example * // Adding a single instruction * const instructions = await buildDefaultInstructions( * { currentInstructions: existingInstructions }, * { instructions: newInstruction } * ); */ export const buildDefaultInstructions = async (baseParams, instructions) => { const { currentInstructions = [] } = baseParams; return [ ...currentInstructions, ...(Array.isArray(instructions) ? instructions : [instructions]) ]; }; export default buildDefaultInstructions; //# sourceMappingURL=buildDefaultInstructions.js.map