Giveth / impact-graph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fetch status of Solana donations/transactions

divine-comedian opened this issue · comments

We will need to be able to track & verify successful donations made on the Solana network via the Giveth dapp - similar to how we currently handle Ethereum donations.

@jainkrati needs to check in with @CarlosQ96 or @mohammadranjbarz to see how we handle this on the dapp with Ethereum and see if it presents any challenges with doing this on Solana

Most likely this "get transaction details" api will help us confirm exact amount transfered, token type transferred https://docs.solana.com/api/http#gettransaction

@aminlatifi please use the above API and let me know if you need to discuss on this. I am assuming that you are very comfortable with Impact graph; else we can get pointers from Mohammad or Carlos

@jainkrati @divine-comedian I played with the JSON RPC node and could have progressed to some extent. But, it's not still straightforward to me how to deduct transferred value! I made test transfers and got API output. It's a simple 1 native token transfer!

{
    "jsonrpc": "2.0",
    "result": {
        "blockTime": 1701350064,
        "meta": {
            "computeUnitsConsumed": 150,
            "err": null,
            "fee": 5000,
            "innerInstructions": [],
            "loadedAddresses": {
                "readonly": [],
                "writable": []
            },
            "logMessages": [
                "Program 11111111111111111111111111111111 invoke [1]",
                "Program 11111111111111111111111111111111 success"
            ],
            "postBalances": [
                30589135362421630,
                1000000000,
                1
            ],
            "postTokenBalances": [],
            "preBalances": [
                30589136362426630,
                0,
                1
            ],
            "preTokenBalances": [],
            "rewards": [],
            "status": {
                "Ok": null
            }
        },
        "slot": 262018390,
        "transaction": {
            "message": {
                "accountKeys": [
                    "9B5XszUGdMaxCZ7uSQhPzdks5ZQSmWxrmzCSvtJ6Ns6g",
                    "GEhUKKZeENY1TmaavqvLJ5GbbQs9GkzECFSE2bpjzz3k",
                    "11111111111111111111111111111111"
                ],
                "header": {
                    "numReadonlySignedAccounts": 0,
                    "numReadonlyUnsignedAccounts": 1,
                    "numRequiredSignatures": 1
                },
                "instructions": [
                    {
                        "accounts": [
                            0,
                            1
                        ],
                        "data": "3Bxs3zzLZLuLQEYX",
                        "programIdIndex": 2,
                        "stackHeight": null
                    }
                ],
                "recentBlockhash": "6GALxakMoRAcx5k1uGuEjqtKhgQZycvdpaEnZzbkH37D"
            },
            "signatures": [
                "3nzHwgxAu7mKw1dhGTVmqzY8Yet3kGWWqP5kr5D2fw1HzqPjqDGDe6xT5PguKXk8nAJcK4GpBEKWw7EzoLykKkCx"
            ]
        }
    },
    "id": 1
}

I may need to read more or discuss it with an experienced guy.

Who is working on this @CarlosQ96 or @mohammadranjbarz

Who is working on this @CarlosQ96 or @mohammadranjbarz

@jainkrati I started working on this

@divine-comedian @MoeNick @jainkrati @maryjaf

Can you give me a simple token transfer for each token we want to support ( I looked in block explorer but all of them that I checked were batch transfer not a single transfer) I need it to write test cases, but I just had SOL transfer, and also MaryJaf will need it during manual tests

@jainkrati sent you some solutions to create some test tokens. https://spl.solana.com/token

@mohammadranjbarz thinks it would be half a day!

to check donation verification