Gift Flow
How the gift flow looks like
// === SENDER SIDE ===
// 1. Create gift
const gift = await client.createPayment({
type: 'gift',
fiatAmount: 5000,
fiatCurrency: 'NGN',
crypto: 'USDT',
network: 'trc20',
payer: { chatId: '7389201648' },
metadata: { message: 'Happy Birthday!' },
});
// 2. Sender pays crypto
console.log(`Send ${gift.cryptoAmount} USDT to ${gift.depositAddress}`);
// 3. Share reference with recipient
const giftCode = gift.reference; // e.g., "2S-GIFT01"
console.log(`Share this code: ${giftCode}`);
// === RECIPIENT SIDE ===
// 4. Recipient claims gift
const claimed = await client.claimGift(giftCode, {
receiver: {
bankCode: '058',
accountNumber: '0123456789',
},
});
// 5. Settlement happens automatically
console.log('Gift claimed! Funds will be sent to your bank.');