integration

GetEntity - get balance of an address

To query the Balance of a specific Address you can use the REQUEST_ENTITY with type 31

Request Header

Request Payload

Response Header

RESPOND_ENTITY

Response Payload

struct Entity
{
    unsigned char publicKey[32];
    long long incomingAmount, outgoingAmount;
    unsigned int numberOfIncomingTransfers, numberOfOutgoingTransfers;
    unsigned int latestIncomingTransferTick, latestOutgoingTransferTick;
};
typedef struct
{
    ::Entity entity;
    unsigned int tick;
    int spectrumIndex;
    unsigned char siblings[SPECTRUM_DEPTH][32];
} RespondedEntity;

[!NOTE] To get current Balance for the given Address substract outgoingAmount from incomingAmount

[!NOTE] Keep track of tick in your application. Don’t update Balance if responded tick is lower than existing.

[!WARNING] A manipulated node may report wrong information. Only use trusted Peers!