Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/dashboard/withdrawal/WithdrawalReview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export function WithdrawalReview() {
try {
const response = await createWithdrawal({
currency,
amount,
walletAddress,
amount: parseFloat(amount),
destinationAddress: walletAddress,
});

setTransactionResult(response.transactionId, 'success');
Expand Down
10 changes: 8 additions & 2 deletions lib/api/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,16 @@ export async function getTransactionById(id: string): Promise<Transaction> {

// ==================== 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 {
Expand Down