Skip to content

Commit d01e06a

Browse files
Glory MatthewGlory Matthew
authored andcommitted
Fix flash loan args: use cvToHex(Cl.uint/Cl.principal) for wallet compatibility
1 parent b2ce96d commit d01e06a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

web/src/lib/hooks/useFlashLoan.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ export function useFlashLoan() {
3030

3131
try {
3232
const { request } = await import("@stacks/connect");
33+
const { Cl, cvToHex } = await import("@stacks/transactions");
3334
const result = await request("stx_callContract", {
3435
contract: `${CONTRACT_ADDRESS}.${CONTRACT_NAME}`,
3536
functionName: "flash-mint",
3637
functionArgs: [
37-
`u${amountMicroSbtc}`,
38-
`'${CONTRACT_ADDRESS}.${receiverContract}`,
38+
cvToHex(Cl.uint(BigInt(amountMicroSbtc))),
39+
cvToHex(Cl.principal(`${CONTRACT_ADDRESS}.${receiverContract}`)),
3940
],
4041
});
4142

0 commit comments

Comments
 (0)