magicblock-labs / magicblock-labs/Solana.Unity-SDK

[Bug] Cannot Swap Tokens With The SDK

Open
#222 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
C#
Stars
199
Forks
128
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Trying to do a swap with the SDK triggers security by Phantom and also says that no balances are changed, and they arn't when approved. It happened in my code and also on the live demo provided by this github at

https://magicblock-labs.github.io/Solana.Unity-SDK/

**To Reproduce**
Steps to reproduce the behavior:
Connect Phantom wallet
Do the basic Swap outlined by the docs
Swap any tokens
Wont work and get security warning as well as no token changes

**Expected behavior**
Code should allow swapping between tokens

**Screenshots**

![Screenshot 2024-04-16 173622](https://github.com/magicblock-labs/Solana.Unity-SDK/assets/113896751/31eddb49-2c00-428d-87e0-d7182b450658)
DK/assets/113896751/93b4c452-608b-4f2e-97d9-d90a61040a7f)

**Desktop (please complete the following information):**
- OS: Windows
- Browser : Brave

**Additional context**
Add any other context about the problem here.
![code](https://github.com/magicblock-labs/Solana.Unity-SDK/assets/113896751/25f12848-efb2-4222-aa5a-be97037d999d)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the swap from the linked live demo with a connected Phantom wallet, using the documented basic swap flow. Compare the security warning and token balances before and after approval; done means the swap completes without the warning and balances change as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.