Debit the customer's USD balance and credit @FxUSD_Out for 100.00 USD. This is the first transaction in the atomic bulk, so the destination credit applies with it.
await blnk.Transactions.createBulk({
atomic: true,
inflight: false,
run_async: false,
skip_queue: true,
transactions: [
{
precise_amount: <source_precise_amount>,
precision: <source_precision>,
reference: "<source_reference>",
description: "Swap USD to EUR",
currency: "USD",
source: "<balance_id>",
destination: "@FxUSD_Out",
allow_overdraft: false,
skip_queue: true,
meta_data: {
"exchange_rate": "<rate>"
},
},
{
precise_amount: <destination_precise_amount>,
precision: <destination_precision>,
reference: "<destination_reference>",
description: "Swap USD to EUR",
currency: "EUR",
source: "@FxEUR_In",
destination: "<destination_balance_id>",
allow_overdraft: true,
skip_queue: true,
meta_data: {
"exchange_rate": "<rate>"
},
}
],
})