Hi I was working on making a contract that should support both SOL and SPL tokens.
Is there a recommended way to manage SOL and SPL token altogether? It looks like we need to wrap SOL to make it work. A way I an thinking to do is ask the user to wrap it first, but it doesn't feel really user friendly.
Is there a recommended way to do that? I was thinking a function that could look like that:
pub fn function_one(ctx: Context<Game>, amount: u64) -> Result<()> {
is_spl = detect_if_spl()
if not spl {
wrap_sol()
}
...
...
}
Thank you!