diff --git a/components/dashboard/withdrawal/WithdrawalReview.tsx b/components/dashboard/withdrawal/WithdrawalReview.tsx index 3c264a2..88db0d5 100644 --- a/components/dashboard/withdrawal/WithdrawalReview.tsx +++ b/components/dashboard/withdrawal/WithdrawalReview.tsx @@ -28,8 +28,8 @@ export function WithdrawalReview() { try { const response = await createWithdrawal({ currency, - amount, - walletAddress, + amount: parseFloat(amount), + destinationAddress: walletAddress, }); setTransactionResult(response.transactionId, 'success'); diff --git a/lib/api/transactions.ts b/lib/api/transactions.ts index 18e1963..9decb81 100644 --- a/lib/api/transactions.ts +++ b/lib/api/transactions.ts @@ -144,10 +144,16 @@ export async function getTransactionById(id: string): Promise { // ==================== Withdrawal ==================== +// Confirmed against backend src/transactions/dtos/transaction.dto.ts: +// - field is `destinationAddress` (not `walletAddress`) +// - `amount` must be a number, not a string +// - `beneficiaryId` and `walletId` are optional alternative targeting fields export interface CreateWithdrawalDto { currency: string; - amount: string; - walletAddress: string; + amount: number; + destinationAddress?: string; + beneficiaryId?: string; + walletId?: string; } export interface WithdrawalResponse {