Hatchfi API Objects

Overview

This is a list of Hatchfi's API objects that are currently available. Currently, our API supports accounts, transactions, providers, scopes,balances, and parts.

Account Object

Hatchfi's Account object lives within the User model and contains important data about each connection.

FieldDescription
balancesAn array of objects with data about the balances
blockchainIf blockchain, the blockchain name will go here; if applicable, it defaults to null
resourceTypeType of object, always balance
addressThe address of the connection, if applicable, defaults to null
tickerThe ticker of the chain type, if applicable, defaults to nullThe address of the connection, if applicable, defaults to null
idAutogenerated id of the object
statusStatus of the account. Enum values: syncing, synced, failed
providerThe provider the balance comes from, if applicable, defaults to null

Below is an example of the Account object

[
    {
        "balances": [
            {
                "ticker": "BNB",
                "providerTicker": "BNB",
                "name": "Binance Coin",
                "fiatTicker": "USD",
                "fiatValue": "32.614",
                "logo": https://nomics-api.s3.us-east-2.amazonaws.com/static/images/currencies/BNB.jpg,
                "resourceType": "balance",
                "misc": [],
                "amount": "0.10610489920078668",
                "decimals": 18
            }
        ],
        "blockchain": "bsc",
        "resourceType": "account",
        "address": "0x151cB406371aB758594da2e619Ae305Ba247C7a7",
        "ticker": "BNB",
        "id": "5f907a4c-7c6e-42c9-8ffa-a6e6d9978961",
        "status": "synced",
        "provider": "bsc"
    }
]

Transaction Object

Hatchfi's Transaction contains important data about each connection's transaction.

FieldDescription
partsAn array of objects with data about the parts of a transaction
feesThe Providers ticker or symbol
miscAn array that holds data that is unique to a particular protocol, exchange, or wallet that we currently do not parse, I.E., for Solana, we put parsed instructions here
fiatCalculatedAtThe timestamp when the fiat price was calculated at
InitiatedAtA timestamp of when the Transaction was initiated
ConfirmedAtA timestamp confirmed at Transaction was confirmed by the blockchain
ResourceTypeType of object, always transaction
txIdThe hash or ID of the transaction
accountIdThe id of the Account that owns this Transaction
userIdThe user ID the transaction belongs to
statusThis indicates the status of the transaction. Possible values: success, pending, failed, or unknown
transactionTypeThe type of Transaction defaults to other

Below is an example of the Transaction object

{
        "parts": [
            {
                "amount": "20",
                "direction": "sent",
                "fiatTicker": "USD",
                "fiatValue": "29.51",
                "otherParties": [
                    null
                ],
                "providerTicker": "coinbase",
                "ticker": "OP",
                "resourceType": "part"
            }
        ],
        "fees": null,
        "misc": [],
        "fiatCalculatedAt": null,
        "initiatedAt": 1654262763,
        "confirmedAt": 1654262763,
        "resourceType": "transaction",
        "txId": "8a92533a-cded-5737-ac7a-8ac7f1d6d912",
        "accountId": "d832d0cf-6f52-4dff-b605-85161a4e594a",
        "userId": "helloMoto2121",
        "status": "completed",
        "transactionType": "buy"
    }

Provider Object

Hatchfi's Provider contains important metadata about each provider Hatchfi offers.

FieldDescription
scopesAn array of objects with data about scope permissions
currenciesAn array of currencies the Provider may contain
inputsAn array of inputs that the Provider will need to access user data
notesNotes for the end-user on Hatchfi Link
networksNetworks available to connect to, I.E., a wallet might have multiple networks to choose from and connect to
resourceTypeType of object, always provider
_idid of this provider object
nameA lowercase and no spaces format of the Provider
displayNameThe name of the Provider for user display
logoThe link to the Provider logo
authTypeType of auth that the Provider requires there are three types: address, token, and passPhrase

Below is an example of the Provider object

{
    "scopes": [
        {
            "name": "read_balances",
            "displayName": "Read Balances",
            "description": "Can read all balance information."
        },
        {
            "name": "read_transactions",
            "displayName": "Read Transactions",
            "description": "Can read all transaction information."
        }
    ],
    "currencies": null,
    "inputs": [
        "apiKey",
        "secretKey"
    ],
    "notes": "Please enter your API and Secret Key.",
    "networks": [],
    "resourceType": "provider",
    "_id": "62eb104e6f205cb754397d4b",
    "name": "gemini",
    "displayName": "Gemini",
    "logo": "https://hatchfi.co/providers/standard/gemini.png",
    "authType": "token"
}

Scopes Object

Hatchfi's scope object lives within the providers object and contains important data regarding permissions to access user data.

FieldDescription
nameThe name of the permission scope
displayNameThe stringified name of the permission scope
descriptionThe description of what permissions the scope allows
{
    "name": "read_transactions",
    "displayName": "Read Transactions",
    "description": "Can read all transaction information."
}

Balance Object

Hatchfi's Balance object lives within the Account model and contains important data about each connection's balance.

FieldDescription
tickerThe currency's ticker or symbol
providerTickerThe Providers ticker or symbol
nameThe currencies name
fiatTickerThe fiat currency's ticker or symbol
fiatValueThe fiat value of the currency
logoA URL for the logo of the currency
resourceTypeType of object, always balance
assetTypeThe type of asset depends on the Provider
miscUnused at this time
amountThe amount in decimal format
decimalsThe number of decimals for this currency

Below is an example of the Balance object

{
    "ticker": "BNB",
    "providerTicker": "BNB",
    "name": "Binance Coin",
    "fiatTicker": "USD",
    "fiatValue": "32.614",
    "logo": https://nomics-api.s3.us-east-2.amazonaws.com/static/images/currencies/BNB.jpg,
    "resourceType": "balance",
    "misc": [],
    "amount": "0.10610489920078668",
    "decimals": 18
}

Parts Object

Hatchfi's parts object lives within the transaction object and contain important data about each connection's transaction.

FieldDescription
amount The amount in decimal format
directionSent or received defaults to null
fiatTickerThe fiat currency's ticker or symbol
fiatValueThe fiat value of the currency
otherPartiesAn array of addresses involved in the transaction; defaults to null
providerTickerThe Providers ticker or symbol
tickerThe currency's ticker or symbol
resourceTypeType of object, always transaction

Below is an example of the parts object

"parts": [
    {
        "amount": "20",
        "direction": "sent",
        "fiatTicker": "USD",
        "fiatValue": "29.51",
        "otherParties": [
            null
        ],
        "providerTicker": "coinbase",
        "ticker": "OP",
        "resourceType": "part"
    }