Skip to content

Commit 2aedd0a

Browse files
committed
fix: type error with transfer
1 parent e1b2cf8 commit 2aedd0a

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

packages/apps/ability-hyperliquid/src/lib/vincent-ability.ts

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -391,22 +391,16 @@ export const vincentAbility = createVincentAbility({
391391
useTestnet: abilityParams.useTestnet ?? false,
392392
});
393393

394-
if (result.transferResult.status === 'err') {
395-
return fail({
396-
action,
397-
reason: result.transferResult.response as string,
398-
});
399-
}
400-
394+
// SuccessResponse always has status "ok", errors are thrown as exceptions
401395
if (result.transferResult.status === 'ok') {
402-
return succeed({ action });
403-
} else {
404-
// Unknown response
405-
return fail({
406-
action,
407-
reason: `Unknown response: ${JSON.stringify(result.transferResult, null, 2)}`,
408-
});
396+
return succeed({ action, transferResult: result.transferResult });
409397
}
398+
399+
// This should not happen with SuccessResponse type, but handle it for safety
400+
return fail({
401+
action,
402+
reason: `Unexpected response status: ${JSON.stringify(result.transferResult, null, 2)}`,
403+
});
410404
}
411405

412406
case 'spotBuy':

0 commit comments

Comments
 (0)