Plutonomicon / cardano-transaction-lib

A Purescript library for building smart contract transactions on Cardano
https://plutonomicon.github.io/cardano-transaction-lib/
MIT License
93 stars 50 forks source link

Blockfrost exploration #524

Closed klntsky closed 1 year ago

klntsky commented 2 years ago

Here's how blockfrost API endpoints map to our needs:

ctl-server

apply-args - not supported, we will implement it eventually on frontend

ogmios

Example response:

{
    "epoch": 210,
    "start_time": 1654719616,
    "end_time": 1655151616,
    "first_block_time": 1654719619,
    "last_block_time": 1654786336,
    "block_count": 2002,
    "tx_count": 8121,
    "output": "56485150782946429",
    "fees": "2913192162",
    "active_stake": "15044495200974246"
}

Looks like we can get era summaries via blockfrost https://docs.blockfrost.io/#tag/Cardano-Network/paths/~1network~1eras/get

https://github.com/blockfrost/blockfrost-backend-ryo/issues/15

Example response:

{
    "time": 1654785927,
    "height": 3617406,
    "hash": "247b93ef3bbcdfeabdc8fd0ea1bae21d636f56246ebce0b9364e0f22fdda0e77",
    "slot": 60416711,
    "epoch": 210,
    "epoch_slot": 66311,
    "slot_leader": "pool18yslg3q320jex6gsmetukxvzm7a20qd90wsll9anlkrfua38flr",
    "size": 3543,
    "tx_count": 7,
    "output": "84480521968151",
    "fees": "1253244",
    "block_vrf": "vrf_vk1sleujze3zraykllkafvrxggcmpts3hp6zxrpazdkdzp9g07kkehsnmy8ka",
    "previous_block": "c519d70c1d08a9645648fb3cb36b218496b6c3dc342552f57e7c487a10320122",
    "next_block": null,
    "confirmations": 0
}

ogmios-datum-cache / Kupo

klntsky commented 2 years ago

Blockfrost can help with getting number of confirmations for transaction:

klntsky commented 2 years ago

This ended up being on Catalyst: https://cardano.ideascale.com/c/idea/420791/

klntsky commented 2 years ago

Note: this list is going to be expanded with staking-related endpoints when we merge #1135 TODO: find if/how we can use blockfrost for that.

jy14898 commented 1 year ago

Blockfrost has the /utils/txs/evaluate endpoint, which is just a wrapper around ogmios, but it doesn't support the additionaUtxos parameter

klntsky commented 1 year ago

@jy14898 how do you know it's using Ogmios?

jy14898 commented 1 year ago

@klntsky https://docs.blockfrost.io/#tag/Cardano-Utilities/paths/~1utils~1txs~1evaluate/post The response mentions its the same as Ogmios:

Returns result of EvaluateTx function from Ogmios see EvaluateTx and related errors

klntsky commented 1 year ago

Closing. We will be ready to merge #1260 soon