- events happen chronologically
- events apply to an address
- an address is either the sender or receiver of an event
- different blockchains support different events
- event payloads are based on event type payload interface
- a single transaction can produce multiple events
Based on Transactions
Event lookup is mostly based on processing transactions. Plugin code processes lists of transactions and returns lists of events.
Examples of events
- funds are send
- funds are received
- an utxo was spend
- an utxo was received
- fee was paid
- buy order was placed on dex
- sell order was placed on dex
- balance was staked
Plugin Input
Please see
heat-server-common/src/constants.ts
for type definitions
interface {
/**
* Enum of blockchain identifiers
*/
blockchain: Blockchains,
/**
* Enum of asset or token types
*/
assetType: AssetTypes,
/**
* Unique identifier (erc20 contract addr, or '0' for native currency)
*/
assetId: string;
/**
* Address or public key
*/
addrXpub: string,
/**
* Zero indexed, events are ordered chronologically.
* The zero'd event is the newest
*/
from: number,
/**
* Events in range [from, to] are returned
*/
to: number,
/**
* Optional. Minimal indicates no event details are returned, only event identifiers
*/
minimal?: boolean,
}
Plugin Output
Please see
heat-server-common/src/event-builders.ts
for type definitions
interface {
/**
* Result is an array
*/
[index: number]: {
/**
* Unix timestamp (ms since epoch)
*/
timestamp: number;
/**
* The tranasaction id
*/
sourceId: string;
/**
* Enum of sourcetypes, always 0=TRANSACTION at this stage
*/
sourceType: SourceTypes;
/**
* Number of confirmations.
* 0 means unconfirmed/in mem-pool
* 1 in latest block
* 2 in previous block
* etc ..
*/
confirmations: number;
/**
* Lists events related to the input address, event contents always
* are relative to the input address. If for instance this transaction
* was send by the input address, the address in the event will be the
* recipient and vice versa.
*/
events: Array<{
/**
* Enum event type (see Event Types)
*/
type: EventTypes;
/**
* Enum of asset or token types
*/
assetType: AssetTypes;
/**
* Unique identifier (erc20 contract addr, or '0' for native currency)
*/
assetId: string;
/**
* Event data payload which differs based on the event type (see Event Types)
*/
data: EventStandardTypeData | EventFeeTypeData | EventOrderTypeData |
EventLeaseBalanceTypeData | EventMessageTypeData |
etc..;
}>;
}
}