Skip to content

Commit 346a925

Browse files
committed
chore: copolit feedback
1 parent 67ccdea commit 346a925

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

packages/apps/ability-hyperliquid/src/lib/ability-checks/deposit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ export const depositPrechecks = async ({
2929
}): Promise<DepositPrechecksResult> => {
3030
const usdcAddress = useTestnet ? ARBITRUM_USDC_ADDRESS_TESTNET : ARBITRUM_USDC_ADDRESS_MAINNET;
3131
const usdcContract = new ethers.Contract(usdcAddress, ERC20_ABI, provider);
32-
const amountWei = ethers.utils.parseUnits(depositAmount, 6);
32+
const amountInMicroUsdc = ethers.utils.parseUnits(depositAmount, 6);
3333

3434
const balance = await usdcContract.balanceOf(agentWalletPkpEthAddress);
3535

36-
if (balance.lt(amountWei)) {
36+
if (balance.lt(amountInMicroUsdc)) {
3737
return {
3838
success: false,
3939
reason: `Insufficient USDC balance. Required: ${depositAmount} USDC, Available: ${ethers.utils.formatUnits(balance, 6)} USDC`,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const transferParamsSchema = z.object({
2020
amount: z
2121
.string()
2222
.describe(
23-
'Amount of USDC to transfer to spot or perp in smallest USDC units (e.g. "1000000" for 1.0 USDC)',
23+
'Amount of USDC to transfer to spot or perp, specified in micro-units as a string (e.g., "1000000" means 1.0 USDC; 1 USDC = 1,000,000 micro-units).',
2424
),
2525
});
2626

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,6 @@ export const vincentAbility = createVincentAbility({
333333
return fail({ action, reason: 'Deposit parameters are required' });
334334
}
335335

336-
const useTestnet = abilityParams.useTestnet ?? false;
337-
338336
// Get Arbitrum RPC URL
339337
const rpcUrl = await Lit.Actions.getRpcUrl({ chain: 'arbitrum' });
340338

packages/apps/ability-hyperliquid/test/e2e/spot/buy.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ describe('Hyperliquid Ability E2E Spot Trading Tests', () => {
184184
expect(precheckResult.result.action).toBe(HyperliquidAction.SPOT_BUY);
185185
});
186186

187-
it('should execute spot buy to purchase SOL with USDC', async () => {
187+
it(`[Spot Buy] should execute spot buy to purchase ${TOKEN_OUT_NAME} with ${SPOT_BUY_AMOUNT_USDC} USDC`, async () => {
188188
const hyperliquidAbilityClient = getVincentAbilityClient({
189189
bundledVincentAbility: hyperliquidBundledAbility,
190190
ethersSigner: wallets.appDelegatee,
@@ -259,10 +259,10 @@ describe('Hyperliquid Ability E2E Spot Trading Tests', () => {
259259
console.log(`[Spot Buy] Initial ${TOKEN_OUT_NAME}:`, initialTokenOutBalance);
260260
console.log(`[Spot Buy] Final ${TOKEN_OUT_NAME}:`, finalTokenOutBalance);
261261

262-
// Store BTC amount for sell test
262+
// Store TOKEN_OUT_NAME amount for sell test
263263
tokenOutAmountReceived = finalTokenOutBalance;
264264

265-
// BTC balance should increase (order might not fill immediately)
265+
// TOKEN_OUT_NAME balance should increase (order might not fill immediately)
266266
// We just check that the order was placed successfully
267267
expect(parseFloat(finalTokenOutBalance)).toBeGreaterThanOrEqual(
268268
parseFloat(initialTokenOutBalance),

0 commit comments

Comments
 (0)