// Execute deposit with Privy (sponsored transaction)
const txHash = await privyWallet.sendTransaction({
to: safeAddress,
data: transferData,
});
// Log the deposit to Zyfai backend
const result = await sdk.logDeposit(
8453, // chainId
txHash, // transaction hash from Privy
"100000000" // 100 USDC
);
console.log(result.success); // true
console.log(result.deposit.status); // "handover_pending" or "credited"
// Wait for credit when handover is still pending
if (result.deposit.status === "handover_pending") {
const credited = await sdk.waitForDepositCredit(result.deposit.id, 8453);
console.log("Deposit credited:", credited.id);
}