Skip to main content

carp (3.0.0)

Download OpenAPI specification:Download

License: MIT

API for the Postgres database generated by Carp

AddressUsed

Ordered lexicographically (order is not maintained)

Warning: the pagination on this endpoint is NOT whether or not an address was used during this block interval, but rather whether or not the address was first used within this interval.

Note: this endpoint only returns addresses that are in a block. Use another tool to see mempool information

Request Body schema: application/json
required
Array of CredentialHex (string) or Bech32FullAddress (string) or Bech32Credential (string) or Base58Address (string) (Address)
object (BlockTxPair)
untilBlock
required
string[0-9a-fA-F]{64}

block hash - inclusive

Responses

Request samples

Content type
application/json
{
  • "addresses": [
    ],
  • "after": {
    },
  • "untilBlock": "cf8c63a909d91776e27f7d05457e823a9dba606a7ab499ac435e7904ee70d7c8"
}

Response samples

Content type
application/json
{
  • "addresses": [
    ]
}

AssetUtxos

Returns utxo entries filtered either by cip 14 fingerprint or by policy id.

This is useful to keep track of the utxo set of a particular asset.

Request Body schema: application/json
limit
number <double>
object (SlotLimits)
policyIds
Array of strings (PolicyId)
fingerprints
Array of strings (Cip14Fingerprint)
object (BlockTxPair)
untilBlock
required
string[0-9a-fA-F]{64}

block hash - inclusive

Responses

Request samples

Content type
application/json
{
  • "limit": 0,
  • "slotLimits": {
    },
  • "policyIds": [
    ],
  • "fingerprints": [
    ],
  • "after": {
    },
  • "untilBlock": "cf8c63a909d91776e27f7d05457e823a9dba606a7ab499ac435e7904ee70d7c8"
}

Response samples

Content type
application/json
[
  • {
    }
]

BlockLatest

Get the latest block. Useful for checking synchronization process and pagination

Request Body schema: application/json
offset
required
number <double>

Note: an offset of -1 is treated the same as an offset of +1

It's usually best to avoid pagination on the latest block as in Cardano, small rollbacks of 1~2 block are very frequent and expected (read Ouroboros for why) That means that using this block for pagination will often lead to your pagination being invalidated by a rollback To avoid this, you can pass an offset from the tip for more stable pagination

Responses

Request samples

Content type
application/json
{
  • "offset": 0
}

Response samples

Content type
application/json
{
  • "block": {
    }
}

AddressesForCredential

Ordered by the first time the address was seen on-chain

Note: this endpoint only returns addresses that are in a block. Use another tool to see mempool information

Request Body schema: application/json
after
string (Bech32FullAddress)
required
Array of CredentialHex (string) or Bech32Credential (string) (Credential)
untilBlock
required
string[0-9a-fA-F]{64}

block hash - inclusive

Responses

Request samples

Content type
application/json
{
  • "after": "stake1ux236z4g4r4pztn5v69txyj2yq6a3esq5x4p4stxydra7zsnv25ue",
  • "credentials": [
    ],
  • "untilBlock": "cf8c63a909d91776e27f7d05457e823a9dba606a7ab499ac435e7904ee70d7c8"
}

Response samples

Content type
application/json
{
  • "addresses": [
    ],
  • "pageInfo": {
    }
}

DelegationForAddress

Returns the pool of the last delegation for this address.

Note: the tx can be in the current epoch, so the delegation may not be in effect yet.

Request Body schema: application/json
required
object
required
CredentialHex (string) or Bech32FullAddress (string) or Bech32Credential (string) or Base58Address (string) (Address)

Supported types:

  • Credential hex (8200581c...) - note this is not a keyhash (it contains a credential type prefix)
  • Bech32 full address (addr / addr_test / stake / stake_test)
  • Bech32 credentials ( addr_vkh, script, etc.) - this is the recommended approach
  • Legacy Byron format (Ae2, Dd, etc.)

Note: we recommend avoiding to query base addresses history using bech32 As Cardano UTXO spendability depends only on the payment credential and not the full base address The result will also miss transactions that are only related to the payment key of the address ex: the payment key is used in a multisig

Note: using two different address representations in the same query will hurt performance (ex: addr1 and addr_vkh1) This because under-the-hood this will run multiple independent SQL queries for the different formats

Warning: querying reward bech32 addresses is equivalent to querying the stake credential inside it This may return more results than expected (ex: a multisig containing the staking key of the wallet)

Responses

Request samples

Content type
application/json
{
  • "until": {
    },
  • "address": "addr1qxzksn47upfu4fwqfmxx29rn5znlkw3ag98ul8rgndwm79aaql88xw6ez84k2ln6lawnt79sdqh7qwq0wcs672auktmsawshfe"
}

Response samples

Content type
application/json
{
  • "txId": "string",
  • "pool": "string"
}

DelegationForPool

Returns the list of delegations for the provided pools. The pool field in the response will be null when the address was previously delegating to a pool in the input, but now the delegation is moved to a pool outside the list, or when the staking key is unregistered.

This is useful to keep track of the delegators for a particular pool.

Request Body schema: application/json
limit
number <double>
object (SlotLimits)
pools
required
Array of strings (Pool)
object (BlockTxPair)
untilBlock
required
string[0-9a-fA-F]{64}

block hash - inclusive

Responses

Request samples

Content type
application/json
{
  • "limit": 0,
  • "slotLimits": {
    },
  • "pools": [
    ],
  • "after": {
    },
  • "untilBlock": "cf8c63a909d91776e27f7d05457e823a9dba606a7ab499ac435e7904ee70d7c8"
}

Response samples

Content type
application/json
[
  • {
    }
]

DexLastPrice

Gets the swap prices for the given liquidity pool and asset pairs. Operation "mean" is not AVG from the last values, but the remaining amount of assets on the pool output

Request Body schema: application/json
type
required
string (PriceType)
Enum: "buy" "sell" "mean"
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "type": "buy",
  • "assetPairs": [
    ]
}

Response samples

Content type
application/json
{
  • "lastPrice": [
    ]
}

DexMeanPrice

Gets the mean prices for the given liquidity pool and asset pairs. Mean is not AVG from the last values, but the remaining amount of assets on the pool output

Request Body schema: application/json
limit
number <double>

Defaults to DEX_PRICE_LIMIT.RESPONSE

dexes
required
Array of strings (Dex)
Items Enum: "WingRiders" "SundaeSwap" "MinSwap"
required
Array of objects
object (BlockTxPair)
untilBlock
required
string[0-9a-fA-F]{64}

block hash - inclusive

Responses

Request samples

Content type
application/json
{
  • "limit": 0,
  • "dexes": [
    ],
  • "assetPairs": [
    ],
  • "after": {
    },
  • "untilBlock": "cf8c63a909d91776e27f7d05457e823a9dba606a7ab499ac435e7904ee70d7c8"
}

Response samples

Content type
application/json
{
  • "meanPrices": [
    ]
}

DexSwap

Gets the swap prices for the given liquidity pool and asset pairs.

Request Body schema: application/json
limit
number <double>

Defaults to DEX_PRICE_LIMIT.RESPONSE

required
Array of objects
dexes
required
Array of strings (Dex)
Items Enum: "WingRiders" "SundaeSwap" "MinSwap"
object (BlockTxPair)
untilBlock
required
string[0-9a-fA-F]{64}

block hash - inclusive

Responses

Request samples

Content type
application/json
{
  • "limit": 0,
  • "assetPairs": [
    ],
  • "dexes": [
    ],
  • "after": {
    },
  • "untilBlock": "cf8c63a909d91776e27f7d05457e823a9dba606a7ab499ac435e7904ee70d7c8"
}

Response samples

Content type
application/json
{
  • "swap": [
    ]
}

MetadataNft

Gets the CIP25 metadata for given <policy, asset_name> pairs

Note: policy IDs and asset names MUST be in hex strings. Do not use UTF8 asset names.

Note: This endpoint returns the NFT metadata as a CBOR object and NOT JSON. You may expect a JSON object, but actually Cardano has no concept of on-chain JSON. In fact, on-chain JSON is not even possible! Instead, Cardano stores metadata as CBOR which can then be converted to JSON The conversion of CBOR to JSON is project-dependent, and so Carp instead returns the raw cbor It's up to you to choose how you want to do the JSON conversion. The common case is handled inside the Carp client library.

Request Body schema: application/json
assets
required
object

Responses

Request samples

Content type
application/json
{
  • "assets": {
    }
}

Response samples

Content type
application/json
{
  • "cip25": {
    }
}

MintBurnHistory

Gets mint and burn events in the provided slot range, optionally filtering by policyId(s). A burn event is a mint with a negative value.

Request Body schema: application/json
limit
number <double>
object (SlotLimits)
policyIds
Array of strings (PolicyId)
object (BlockTxPair)
untilBlock
required
string[0-9a-fA-F]{64}

block hash - inclusive

Responses

Request samples

Content type
application/json
{
  • "limit": 0,
  • "slotLimits": {
    },
  • "policyIds": [
    ],
  • "after": {
    },
  • "untilBlock": "cf8c63a909d91776e27f7d05457e823a9dba606a7ab499ac435e7904ee70d7c8"
}

Response samples

Content type
application/json
[
  • {
    }
]

ProjectedNftRange

Query any projected NFT. Learn morehere.

Request Body schema: application/json
limit
number <double>
object (SlotLimits)
address
string
object (BlockTxPair)
untilBlock
required
string[0-9a-fA-F]{64}

block hash - inclusive

Responses

Request samples

Content type
application/json
{
  • "limit": 0,
  • "slotLimits": {
    },
  • "address": "string",
  • "after": {
    },
  • "untilBlock": "cf8c63a909d91776e27f7d05457e823a9dba606a7ab499ac435e7904ee70d7c8"
}

Response samples

Content type
application/json
[
  • {
    }
]

TransactionHistory

Ordered by <block.height, transaction.tx_index>

Note: this endpoint only returns txs that are in a block. Use another tool to see mempool for txs not in a block

Request Body schema: application/json
withInputContext
boolean

If this is set to true, the result includes the input addresses (which are not part of the tx), and the metadata (if any)

object (SlotLimits)
limit
number <double>

Defaults to ADDRESS_LIMIT.RESPONSE

relationFilter
number <double> (RelationFilter) ([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])

Filter which uses of the address are considered relevant for the query.

This is a bitmask, so you can combine multiple options ex: RelationFilterType.Input | RelationFilterType.Output

Note: relations only apply to credentials and not to full bech32 addresses

required
Array of CredentialHex (string) or Bech32FullAddress (string) or Bech32Credential (string) or Base58Address (string) (Address)
object (BlockTxPair)
untilBlock
required
string[0-9a-fA-F]{64}

block hash - inclusive

Responses

Request samples

Content type
application/json
{
  • "withInputContext": true,
  • "slotLimits": {
    },
  • "limit": 0,
  • "relationFilter": 255,
  • "addresses": [
    ],
  • "after": {
    },
  • "untilBlock": "cf8c63a909d91776e27f7d05457e823a9dba606a7ab499ac435e7904ee70d7c8"
}

Response samples

Content type
application/json
{
  • "transactions": [
    ]
}

TransactionOutput

Get the outputs for given <tx hash, output index> pairs.

This endpoint will return both used AND unused outputs

Note: this endpoint only returns txs that are in a block. Use another tool to see mempool for txs not in a block

Request Body schema: application/json
required
Array of objects (UtxoPointer)
Array
index
required
number <double>
txHash
required
string[0-9a-fA-F]{64}

Responses

Request samples

Content type
application/json
{
  • "utxoPointers": [
    ]
}

Response samples

Content type
application/json
{
  • "utxos": [
    ]
}