@ravnexchange/widget-connector lets it use the wallet already connected on your page. To earn from
it, set your fee and your site on your key, then give the widget your public key: you put your own
fee on top, and RAVN shares it with you 60/40 (Pricing).
1
Embed the iframe
Set Keep
?origin= to your page’s exact origin.allow-same-origin: without it the widget can’t talk to your page. It needs no
allow-popups or allow-top-navigation. v1 stays stable; a breaking change ships as v2.2
Wrap your wallet
3
Connect the bridge
4
Earn your fee
Run this once from your server, with your secret key (get a key if you
don’t have one). It sets your fee, where RAVN pays your share, and the sites your key works on:List the origin you set in
?origin=, plus every other site that uses the key in a browser.
Your fee and site list take effect within a minute. Then add apiKey: "rvn_live_your_key" to
the bridge’s config. On a page the key doesn’t list, the widget stops quoting and says why. The widget collects your fee and
reports each swap itself, and widget swaps reach your webhook too. Details:
Set your fee and Getting paid.Pass your public key (rvn_live_…), never your secret key. A secret key stops the widget:
rotate it. A key from before secret keys existed
works once you claim its secret key.?origin= is your page’s exact origin and that you created the bridge.
For tighter framing, set your page’s CSP frame-src to https://app.ravn.exchange. To match your
brand, see Theming.
Open on a pair
Add these toconfig to open the widget on your pair. The widget reads them once, when it starts,
and the visitor can change them.
Give each side its chain and its token: a side missing either, or with a token the widget can’t
find, opens on the default.
Change the theme live
bridge.updateConfig(config) merges config into the one the bridge has and re-applies the
theme without reloading the widget. Only the theme changes live: apiKey
and the starting pair keep the values the widget started with. A light or dark object replaces
the previous one whole, and a theme field set to undefined goes back to its default.
Reference
Your Solana wallet, or
null. signTransaction gets an unsigned base64 versioned transaction and returns it signed.Your public key as
apiKey, so widget swaps carry your fee, plus an optional starting pair and the widget’s theme.WALLET_NOT_CONNECTED or
SOLANA_WALLET_NOT_CONNECTED.
