DevStakePool / thoth-bot

THOTH - Telegram Cardano BOT that is able to notify users about wallet TXs
Apache License 2.0
10 stars 1 forks source link

Recognize a TX as pool redelegation #5

Closed DevStakePool closed 1 year ago

DevStakePool commented 1 year ago

Here's an example

curl -X POST "https://api.koios.rest/api/v0/tx_info" \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 -d '{"_tx_hashes":["559508ea65e38bcf208b7155b0e5ca9aeade561c6a86d5a29f8dd9d97c660027"]}' \

The certificate has the TX type "delegation"

🔑 stake1u...usv5fmtz ✉ 1 new transaction(s)

Sent Funds 06.01.2023, 11:24 AM 🔹Fee 0.18 ₳ 🔹Output -0.18 ₳

DevStakePool commented 1 year ago

The certificates if any, indicate the pool delegation


"certificates": [
      {
        "info": {
          "pool_id_hex": "4ebf3e184e2bf7b6c4a5998126088432369ade380fa5a08690f1b618",
          "stake_address": "stake1u9ttjzthgk2y7x55c9f363a6vpcthv0ukl2d5mhtxvv4kusv5fmtz",
          "pool_id_bech32": "pool1f6lnuxzw90mmd399nxqjvzyyxgmf4h3cp7j6pp5s7xmps86arct"
        },
        "type": "delegation",
        "index": 0
      }
    ],
DevStakePool commented 1 year ago

The bot will show a message of this kind:

🔁 Internal Transfer 08.11.2022, 08:56 AM 🔹Fee 0.18 ₳ 🏛 Delegated to pool1...kqq6yjvr (or pool name when possible)