Deposit USDC
How to deposit USDC into the exchange
Deposit USDC
Deposit USDC into the exchange for trading.
Endpoint: POST /v1/account/deposit
Example:
import axios from "axios";
import { apiClient } from "./risex-core";
const depositUSDC = async (
account: string,
amount: string, // Amount in plain decimal (e.g., "100" for 100 USDC)
) => {
try {
const response = await apiClient.post('/v1/account/deposit', {
account: account,
amount: amount,
});
const { data } = response.data;
console.log('Deposit successful!');
console.log('Transaction Hash:', data.transaction_hash);
console.log('Block Number:', data.block_number);
return data;
} catch (error) {
if (axios.isAxiosError(error)) {
console.error('Deposit failed:', error.response?.data?.message || error.message);
} else {
console.error('Deposit failed:', (error as Error).message);
}
throw error;
}
};
// Example usage:
// await depositUSDC(
// '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', // Your account address
// '100' // Deposit 100 USDC
// );Important Notes
- Amount Format: The amount should be in plain decimal format (e.g., "100" for 100 USDC), not with 18 decimals
- Gas Sponsored: Deposit transactions are gas-sponsored by the API service
- Balance Update: After deposit, your balance will be updated in the exchange and can be used for trading