The Buburuza Core Banking APIs provide comprehensive financial services including account management, transaction processing, and balance operations. Built on our Layer 3 blockchain infrastructure with AI-powered features for enhanced user experiences.
// Interact with a lending smart contract
const lendingContract = await buburuza.blockchain.contract.interact({
contractAddress: '0xabcdef1234567890abcdef1234567890abcdef12',
function: 'deposit',
parameters: {
amount: '1000000000000000000', // 1 token (18 decimals)
duration: 2592000 // 30 days in seconds
},
fromAccount: 'acc_1234567890abcdef'
});
try {
const transaction = await buburuza.transactions.create({
type: 'transfer',
fromAccount: 'acc_1234567890abcdef',
toAccount: 'acc_0987654321fedcba',
amount: 1000000, // $10,000
currency: 'USD'
});
} catch (error) {
switch (error.code) {
case 'insufficient_funds':
console.log('Not enough money in account');
console.log('Available:', error.details.availableBalance);
console.log('Requested:', error.details.requestedAmount);
break;
case 'account_frozen':
console.log('Account is temporarily frozen');
console.log('Reason:', error.details.reason);
break;
case 'daily_limit_exceeded':
console.log('Daily withdrawal limit exceeded');
console.log('Limit:', error.details.dailyLimit);
console.log('Used today:', error.details.usedToday);
break;
case 'invalid_recipient':
console.log('Recipient account not found or invalid');
break;
default:
console.log('Unexpected error:', error.message);
}
}
{
"error": {
"code": "insufficient_funds",
"message": "The account does not have sufficient funds for this transaction",
"details": {
"availableBalance": 5000,
"requestedAmount": 10000,
"accountId": "acc_1234567890abcdef"
},
"requestId": "req_1234567890abcdef"
}
}