Hive Devs, generate revenue through our Keychain Swap Widget

in #keychain3 months ago (edited)
Authored by @stoodkev

Swap Widget.png

Hive dApps can now integrate our Keychain Swap feature through an iframe and share commission fees on our swap. Keychain Swap find the best rate for any swap between HIVE, HBD and any Hive Engine token.
To make it easy to integrate, we've created a form which helps you build the widget you need.

1/ Fill the form with the following parameters:

  • Username (required): account that will perform the swap
  • Partner Username (optional): account that will receive the partner fee
  • Partner Fee (required if a partner username is specified): fee amount (0~1%)
  • Iframe width/height (optional): change the size to match your preferred design
  • From/To (optional): tokens shown during the initialization of the widget. Note that if the user doesn't have any balance for the from token, the next one on the list will be used instead.
  • Slippage (optional): slippage at which the swap is canceled

2/ Copy the resulting html code and include it in your code.
Screenshot 2024-06-14 at 9.53.03 AM.png
3/ Make sure your CORS policy authorizes our widget.
4/ That's it! You're good to go!

Discord

If you have any question, contact us in the #devs channel of our Discord:
https://discord.gg/3EM6YfRrGv

Team

@stoodkev : CEO - Witness
@cedricguillas : CTO - Witness
@theghost1980 : Front-end Developer
@manuphotos : Community Manager - Witness
@yabapmatt : Advisor - Witness


Support Hive Keychain development by voting for our proposal on PeakD or with HiveSigner.

Sort:  

Another great advantage for all the Hive Dapps! Keychain swap will find the best rate for you while swapping any tokens including HIve, HBD and L2 tokens! This will surely make a better environment on hive to build apps! Thanks, @Stoodkev and the whole team for your tireless effort!

HIVE seems to be losing value faster than I am collecting rewards. It's like I'm running in one place.

Has anyone integrated this yet / have you tested it as an embed yourselves?

I just launched it in the tokens section of Crypto Shots...

image.png

          vvv

image.png


How can the iframe communicate with the hive keychain that is installed in the parent window? AFAIK iframes by default don't have access to browser extensions. (PS. This is true only for Firefox, that we push because works best for wasm games)

I believe it can't work as is and that you guys also need to write an npm package that works as bridge on the hosting website.

I think there's a way to disable this restriction for specific browsers but probably not expected for end users to do that.
So the library/bridge should take care of sending postMessages from the iframe to the parent window and sending back postMessages for confirmation/failures.

3 more questions:

1. Is it true that the partner fee is applied on top of your usual fee? Meaning that users would simply save money by just clicking on the extension and swapping there instead of using the embedded widget?

2. Is the slippage URL parameter working correctly? It still shows 5 if I navigate to the generated link for the iframe

image.png
PS - seems to work in the iframe though

3. I can't select the token form the dropdown.

image.png
PS - works fine if I just add them directly as URL parameters.

Thx


Hey @gaottantacinque, here is a little bit of BEER from @isnochys for you. Enjoy it!

Learn how to earn FREE BEER each day by staking your BEER.

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

Nice one guys, your platform is my favorite for checking everything about my Hive account, thanks for this guys

This will certainly be of great use, it makes things much easier, congratulations to the Hive Keychain team.

This is awesome!

Thats amazing, we defintely implementing it on skatehive.app wallet

Can I use to trade ARB or CACAO to HIVE? That would be dope to

👏🏼❤️👏🏼