Attribute a referral
Carry a wallet's referral code from its link into a cleanup's quote and rounds.
A wallet's referral link carries its code as ?ref=. Keep the code from the link the person followed and pass it as referralCode on the quote and on every round, beside burner. The server looks the code up; a request never names the referrer's address. Referrals and referral partners explains registration and earnings.
const quote = await bnc.quote({ wallet, items, burner, referralCode, donationBps: 0 })
console.log(quote.referrer?.address ?? 'no referrer')
for (const warning of quote.warnings) console.log(warning.code, warning.message)The quote's referrer is the referrer the server found, or null. An unknown code, a wallet referring itself and a referrer that can't receive SOL each come back as a warning (referrer_unknown, self_referral, referrer_cannot_receive), and the cleanup goes ahead without the share.
await reclaim(bnc, {
wallet,
items,
burner,
referralCode,
donationBps: 0,
signTransactions: signWithYourWallet,
})A partner's ?rc= code is for organizations' subscriptions, never a referralCode.