auto-approve
WIP - This is a work in progress
How to auto approve transaction for fast game play and great ux
To have a fluid game play for on-chain games it is beneficial to have an auto approve wallet.
- Solflare wallet offers auto-approve functionality with burner wallets, but this limits your players to only one wallet.
- Another way to do it is to create a key pair in your game and let the player transfer some sol to that wallet and then use it to pay for transaction fees. Only problem with this is that you need to handle the security for this wallet and the players would need to have access to their seed phrase.
Example Source Code
Example Game
You can pay the fees yourself, by creating and signing the transactions in the backend and interact with it via an API. For that you send parameters to your backend and sign the transaction there and send a confirmation to the client as soon as it is done.
There is a protocol called @gumisfunn and they released a feature called session keys. Session Keys are ephemeral keys with fine-grained program/instruction scoping for tiered access in your @solana programs. They allow users to interact with apps under particular parameters like duration, max tokens, amount of posts or any other function specific to an app. Link