diff --git a/recipes/borrow.ts b/recipes/borrow.ts index d109344..6f28f68 100644 --- a/recipes/borrow.ts +++ b/recipes/borrow.ts @@ -451,7 +451,9 @@ async function promptFromSchema( type: "input", name: "value", message, - initial: (prop.placeholder || prop.default) as string, + ...(isRequired && (prop.placeholder || prop.default) + ? { initial: (prop.placeholder || prop.default) as string } + : {}), validate: (input: string) => { if (!isRequired && input === "") return true; if (isRequired && input === "") return `${prop.label || name} is required`; diff --git a/recipes/perps.ts b/recipes/perps.ts index 4356bab..f6d161b 100644 --- a/recipes/perps.ts +++ b/recipes/perps.ts @@ -1104,6 +1104,10 @@ async function executeTrade( return false; } + if (!ACTION_LABELS[actionType]) { + return false; + } + return !POSITION_ONLY_ACTIONS.includes(actionType) || !!existingPosition; }) as PerpActionTypes[];