jup-ag / terminal

Jupiter Terminal is an open-sourced, lite version of Jupiter that provides end-to-end swap flow by linking it in your HTML.
https://terminal.jup.ag
70 stars 34 forks source link

Support referralAccount for platform fees #52

Closed worlddlckgh closed 6 months ago

worlddlckgh commented 6 months ago

Support referralAccount mode, so integrator can just pass in their referral key, and Terminal will resolve to the respective feeAccounts.

Note: You will need to create the Token fee accounts to collect the platform fee.

By referral key referralAccount

const TEST_PLATFORM_FEE_AND_ACCOUNTS = {
  referralAccount: new PublicKey('2XEYFwLBkLUxkQx5ZpFAAMzWhQxS4A9QzjhcPhUwhfwy'),
  feeBps: 100,
};

window.Jupiter.init({
  // ...
  platformFeeAndAccounts: TEST_PLATFORM_FEE_AND_ACCOUNTS,
})
vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
jupiter-terminal ✅ Ready (Inspect) Visit Preview Dec 29, 2023 1:47am