New Reverted Block

By subscribing to this event, customers will receive callbacks from Crypto APIs every time when a block is reverted on a specific blockchain. This can happen in cases when two blocks are mined at the same time and the nodes cannot agree on which one was first. This occurs as part of the chain reorganization process.

Supports Callback Functionality Single Result - This endpoint returns only one single result. POST /blockchain-events/{blockchain}/{network}/subscriptions/reverted-block

Path Parameters

  • Required
    blockchain string

    Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

    Example : ethereum
    Possible Values : bitcoin bitcoin-cash litecoin dogecoin dash ethereum ethereum-classic binance-smart-chain
  • Required
    network string

    Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten" are test networks.

    Example : goerli
    Possible Values : mainnet testnet mordor mumbai goerli

Query parameters

  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

    Example : yourExampleString

Request body schema application/json

  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

    Example : yourExampleString
  • Required
    data object
    • Required
      item object
      • Optional
        allowDuplicates string

        Specifies a flag that permits or denies the creation of duplicate addresses.

        Example : False
      • Required
        callbackSecretKey string

        Represents the Secret Key value provided by the customer. This field is used for security purposes during the callback notification, in order to prove the sender of the callback as Crypto APIs. For more information please see our Documentation.

        Example : yourSecretString
      • Required
        callbackUrl string

        Represents the URL that is set by the customer where the callback will be received at. The callback notification will be received only if and when the event occurs. We support ONLY httpS type of protocol.

        Example : https://example.com

Response schema

201 400 401 402 403 409 415 422 429 500
HTTP Status Code: 201
Content-Type: application/json

The request has been successful.

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2023-04-25
  • Required
    requestId string

    Defines the ID of the request. The requestId is generated by Crypto APIs and it's unique for every request.

    Example : 601c1710034ed6d407996b30
  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

    Example : yourExampleString
  • Required
    data object
    • Required
      item object
      • Required
        address string

        Represents the address of the transaction, per which the result is returned.

        Example : 0xc6d46aba0c6e2eb6358c4e24804158cc4d847922
      • Required
        callbackSecretKey string

        Represents the Secret Key value provided by the customer. This field is used for security purposes during the callback notification, in order to prove the sender of the callback as Crypto APIs. For more information please see our Documentation.

        Example : yourSecretKey
      • Optional
        callbackUrl string

        Represents the URL that is set by the customer where the callback will be received at. The callback notification will be received only if and when the event occurs. We support ONLY httpS type of protocol.

        Example : https://example.com
      • Required
        createdTimestamp integer

        Defines the specific time/date when the subscription was created in Unix Timestamp.

        Example : 1236238648
      • Required
        eventType string

        Defines the type of the specific event available for the customer to subscribe to for callback notification.

        Example : BLOCK_REVERTED
      • Required
        isActive boolean

        Defines whether the subscription is active or not. Set as boolean.

        Example : True
      • Required
        referenceId string

        Represents a unique ID used to reference the specific callback subscription.

        Example : bc243c86-0902-4386-b30d-e6b30fa1f2aa

Callback parameters Method : POST

You can use the optional parameter callbackSecretKey in your request for additional security. It is then used to create a unique hash string in the x-signature response header in the callback request itself. For more information, please see our Documentation.
BLOCK_REVERTED

Content-Type : application/json

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2021-03-20
  • Required
    referenceId string

    Represents a unique identifier that serves as reference to the specific request which prompts a callback, e.g. Blockchain Events Subscription, Blockchain Automation, etc.

    Example : 6038d09050653d1f0e40584c
  • Required
    idempotencyKey string

    Specifies a unique ID generated by the system and attached to each callback. It is used by the server to recognize consecutive requests with the same data with the purpose not to perform the same operation twice.

    Example : e55bf7a4a7188855f1c27541a6c387d04cc3b22ee34d1304b0e6ecad61c9906c
  • Required
    data object

    Specifies all data, as attributes, included into the callback notification, which depends on the event.

    • Required
      product string

      Represents the Crypto APIs 2.0 product which sends the callback.

      Example : BLOCKCHAIN_EVENTS
    • Required
      event string

      Defines the specific event, for which a callback subscription is set.

      Example : BLOCK_REVERTED
    • Required
      item object

      Defines an item as one result.

      • Required
        blockchain string

        Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

        Example : bitcoin
      • Required
        network string

        Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten", "rinkeby" are test networks.

        Example : testnet
      • Required
        height integer

        Defines the number of blocks in the blockchain preceding this specific block.

        Example : 570008
      • Required
        hash string

        Represents the hash of the block's header, i.e. an output that has a fixed length.

        Example : 00000000000000000006ddb5e854505f8b792122b0ac9469c07eb26db414f6fb
      • Required
        timestamp integer

        Defines the exact date/time when this block was mined in seconds since Unix Epoch time.

        Example : 1610365615

Credits Cost : 10000 Credits For 1 Result(s)

Try it out

Request Example

POST
https://rest.cryptoapis.io/blockchain-events/ethereum/goerli/subscriptions/reverted-block?context=yourExampleString
Headers
Content-Type: application/json
X-API-Key: my-api-key

Request Body
{
    "context": "yourExampleString",
    "data": {
        "item": {
            "allowDuplicates": "False",
            "callbackSecretKey": "yourSecretString",
            "callbackUrl": "https://example.com"
        }
    }
}

Response Example

{
    "apiVersion": "2023-04-25",
    "requestId": "601c1710034ed6d407996b30",
    "context": "yourExampleString",
    "data": {
        "item": {
            "address": "0xc6d46aba0c6e2eb6358c4e24804158cc4d847922",
            "callbackSecretKey": "yourSecretKey",
            "callbackUrl": "https://example.com",
            "createdTimestamp": 1236238648,
            "eventType": "BLOCK_REVERTED",
            "isActive": true,
            "referenceId": "bc243c86-0902-4386-b30d-e6b30fa1f2aa"
        }
    }
}

Callback Example

{
    "apiVersion": "2021-03-20",
    "referenceId": "6038d09050653d1f0e40584c",
    "idempotencyKey": "e55bf7a4a7188855f1c27541a6c387d04cc3b22ee34d1304b0e6ecad61c9906c",
    "data": {
        "product": "BLOCKCHAIN_EVENTS",
        "event": "BLOCK_REVERTED",
        "item": {
            "blockchain": "bitcoin",
            "network": "testnet",
            "height": 570008,
            "hash": "00000000000000000006ddb5e854505f8b792122b0ac9469c07eb26db414f6fb",
            "timestamp": 1610365615
        }
    }
}