Before you start
- The TypeScript project.
- A wallet to receive your share on each kind of source chain you support, for example one EVM wallet and one Solana wallet. Your share is paid on the source chain.
Script
This script quotes a Base to Solana transfer with a 10 bps referral fee, then shows how to check the payout on a finished transfer. Save it assrc/earn-referral-fees.ts and run npx tsx src/earn-referral-fees.ts <transferId>.
src/earn-referral-fees.ts
Notes
- Send both fields or neither.
referralBpscan be0to15, and your share of a single transfer is capped at $10. - Your share is paid in the same transaction as the bridge: as an extra instruction in the Solana transaction, or in the
feestep next to the EVM bridge step. Nothing is paid out later. - You are paid even on transfers where BRDG charges no platform fee.
fees.referralisnullonly when the quote named no referrer. - A fee’s status moves from
offeredtoexpectedtosettled, or tovoidif the transfer is refunded or fails. See Referrals.