New unconfirmed tokens transactions

Through this endpoint customers can create callback subscriptions for a specific event. In this case the event is when there are new unconfirmed tokens transactions for the user. By creating this subscription the user will be notified by Crypto APIs 2.0 when that event occurs. The information is returned per specified address.

Unconfirmed tokens transactions remain in the mempool (memory pool) until they are confirmed by miners and added to the next block. Sometimes spikes in transaction activity can cause delays in confirmations.

To have an operational callback subscription, you need to first verify a domain for the Callback URL. Please see more information on Callbacks here.

It is also important to note that just because pending unconfirmed transactions are in the mempool, doesn't necessarily mean they will get confirmed.

Crypto APIs will notify the user only when the event occurs. There are cases when the specific event doesn't happen at all, or takes a long time to do so. A callback notification will not be sent if the event does not or cannot occur, or will take long time to occur.

POST /blockchain-events/{blockchain}/{network}/subscriptions/address-tokens-transactions-unconfirmed

Path Parameters

  • 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

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.

  • Required
    data object
    • Required
      item object
      • Required
        address string

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

        Example : mho4jHBcrNCncKt38trJahXakuaBnS7LK5
      • Optional
        allowDuplicates boolean

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

        Default : False
        Example : True
      • Optional
        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.

        Example : yourSecretKey
      • 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.

        Example : http://example.com

Response schema

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

The resource has been successfully created.

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2.0
  • 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 : You can add any text here
  • Required
    data object
    • Required
      item object
      • Required
        address string

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

        Example : 15XyNC88pujwuuur8DCsXBCfEhJJMzHayU
      • 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.

        Example : yourSecretKey
      • 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.

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

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

        Example : 1611238648
      • Required
        eventType string

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

        Example : ADDRESS_TOKENS_TRANSACTION_UNCONFIRMED
      • 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 : c748624f-1843-4738-a7de-8258ada0f524
      • Required
        transactionId string

        Represents the unique identification string that defines the transaction.

        Example : f43676625cc8a8d0ccd98a3795ad5369187cd5b279c3d06f99601566713aa961

Callback parameters Method : POST

ADDRESS_TOKENS_TRANSACTION_UNCONFIRMED

Content-Type : application/json

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2.0
  • 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 : ADDRESS_TOKENS_TRANSACTION_UNCONFIRMED
    • 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
        address string

        Defines the specific address to which the token transaction has been sent and is pending confirmation.

        Example : bc1qj9k6mryqfyl9dghdwnxx29660nws90mfarld46
      • Required
        transactionId string

        Defines the unique ID of the specific transaction, i.e. its identification number.

        Example : ade174e0ff264094bfcf4a83789d3aa3e7d7ab423ffa89e21871aad849f302db
      • Required
        tokenType string

        Defines the type of token sent with the transaction, e.g. ERC 20.

        Example : ethereumERC20Token
        Possible Values : ethereumERC20Token ethereumERC721Token omniLayerToken
      • Required
        token object One Of
        object
        • Required
          name string

          Specifies the name of the token.

          Example : Tether USD
        • Required
          symbol string

          Specifies an identifier of the token, where up to five alphanumeric characters can be used for it.

          Example : USDT
        • Optional
          decimals string

          Defines how many decimals can be used to break the token.

          Example : 6
        • Required
          amount string

          Defines the amount of tokens sent with the transaction that is pending confirmation.

          Example : 10.5
        • Required
          contractAddress string

          Defines the address of the contract.

          Example : 0xdac17f958d2ee523a2206206994597c13d831ec7
      • Required
        direction string

        Defines whether the transaction is "incoming" or "outgoing".

        Example : incoming
        Possible Values : incoming outgoing
      • Required
        firstSeenInMempoolTimestamp integer

        Defines the exact time the transaction has been first accepted into the mempool to await confirmation as timestamp.

        Example : 1210363220
Try it out

Request Example

POST
https://rest.cryptoapis.io/v2/blockchain-events/bitcoin/testnet/subscriptions/address-tokens-transactions-unconfirmed
Headers
Host: https://rest.cryptoapis.io/v2
Content-Type: application/json
X-API-Key: my-api-key

Request Body
{
    "context": "",
    "data": {
        "item": {
            "address": "mho4jHBcrNCncKt38trJahXakuaBnS7LK5",
            "allowDuplicates": true,
            "callbackSecretKey": "yourSecretKey",
            "callbackUrl": "http://example.com"
        }
    }
}

Response Example

{
    "apiVersion": "2.0",
    "requestId": "601c1710034ed6d407996b30",
    "context": "You can add any text here",
    "data": {
        "item": {
            "address": "15XyNC88pujwuuur8DCsXBCfEhJJMzHayU",
            "callbackSecretKey": "yourSecretKey",
            "callbackUrl": "https://example.com",
            "createdTimestamp": 1611238648,
            "eventType": "ADDRESS_TOKENS_TRANSACTION_UNCONFIRMED",
            "isActive": true,
            "referenceId": "c748624f-1843-4738-a7de-8258ada0f524",
            "transactionId": "f43676625cc8a8d0ccd98a3795ad5369187cd5b279c3d06f99601566713aa961"
        }
    }
}

Callback Example

{
    "apiVersion": "2.0",
    "referenceId": "6038d09050653d1f0e40584c",
    "idempotencyKey": "e55bf7a4a7188855f1c27541a6c387d04cc3b22ee34d1304b0e6ecad61c9906c",
    "data": {
        "product": "Blockchain Events",
        "event": "ADDRESS_TOKENS_TRANSACTION_UNCONFIRMED",
        "item": {
            "blockchain": "bitcoin",
            "network": "testnet",
            "address": "bc1qj9k6mryqfyl9dghdwnxx29660nws90mfarld46",
            "transactionId": "ade174e0ff264094bfcf4a83789d3aa3e7d7ab423ffa89e21871aad849f302db",
            "tokenType": "ethereumERC20Token",
            "token": {
                "name": "Tether USD",
                "symbol": "USDT",
                "decimals": "6",
                "amount": "10.5",
                "contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7"
            }
        }
    }
}