Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ERC20TransferEvent and ERC721TransferEvent models #219

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 173 additions & 3 deletions src/client/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,176 @@ export interface CreateWebhookRequest {
}


/**
* Represents an event triggered by an ERC-20 token transfer on the blockchain. Contains information about the transaction, block, and involved addresses.
* @export
* @interface ERC20TransferEvent
*/
export interface ERC20TransferEvent {
/**
* Unique identifier for the webhook that triggered this event.
* @type {string}
* @memberof ERC20TransferEvent
*/
'webhookId'?: string;
/**
* Type of event, in this case, an ERC-20 token transfer.
* @type {string}
* @memberof ERC20TransferEvent
*/
'eventType'?: string;
/**
* Blockchain network where the event occurred.
* @type {string}
* @memberof ERC20TransferEvent
*/
'network'?: string;
/**
* Hash of the block containing the transaction.
* @type {string}
* @memberof ERC20TransferEvent
*/
'blockHash'?: string;
/**
* Number of the block containing the transaction.
* @type {number}
* @memberof ERC20TransferEvent
*/
'blockNumber'?: number;
/**
* Timestamp when the block was mined.
* @type {string}
* @memberof ERC20TransferEvent
*/
'blockTime'?: string;
/**
* Hash of the transaction that triggered the event.
* @type {string}
* @memberof ERC20TransferEvent
*/
'transactionHash'?: string;
/**
* Position of the transaction within the block.
* @type {number}
* @memberof ERC20TransferEvent
*/
'transactionIndex'?: number;
/**
* Position of the event log within the transaction.
* @type {number}
* @memberof ERC20TransferEvent
*/
'logIndex'?: number;
/**
* Address of the ERC-20 token contract.
* @type {string}
* @memberof ERC20TransferEvent
*/
'contractAddress'?: string;
/**
* Address of the sender in the token transfer.
* @type {string}
* @memberof ERC20TransferEvent
*/
'from'?: string;
/**
* Address of the recipient in the token transfer.
* @type {string}
* @memberof ERC20TransferEvent
*/
'to'?: string;
/**
* Amount of tokens transferred, typically in the smallest unit (e.g., wei for Ethereum).
* @type {string}
* @memberof ERC20TransferEvent
*/
'value'?: string;
}
/**
* Represents an event triggered by an ERC-721 token transfer on the blockchain. Contains information about the transaction, block, and involved addresses.
* @export
* @interface ERC721TransferEvent
*/
export interface ERC721TransferEvent {
/**
* Unique identifier for the webhook that triggered this event.
* @type {string}
* @memberof ERC721TransferEvent
*/
'webhookId'?: string;
/**
* Type of event, in this case, an ERC-721 token transfer.
* @type {string}
* @memberof ERC721TransferEvent
*/
'eventType'?: string;
/**
* Blockchain network where the event occurred.
* @type {string}
* @memberof ERC721TransferEvent
*/
'network'?: string;
/**
* Hash of the block containing the transaction.
* @type {string}
* @memberof ERC721TransferEvent
*/
'blockHash'?: string;
/**
* Number of the block containing the transaction.
* @type {number}
* @memberof ERC721TransferEvent
*/
'blockNumber'?: number;
/**
* Timestamp when the block was mined.
* @type {string}
* @memberof ERC721TransferEvent
*/
'blockTime'?: string;
/**
* Hash of the transaction that triggered the event.
* @type {string}
* @memberof ERC721TransferEvent
*/
'transactionHash'?: string;
/**
* Position of the transaction within the block.
* @type {number}
* @memberof ERC721TransferEvent
*/
'transactionIndex'?: number;
/**
* Position of the event log within the transaction.
* @type {number}
* @memberof ERC721TransferEvent
*/
'logIndex'?: number;
/**
* Address of the ERC-721 token contract.
* @type {string}
* @memberof ERC721TransferEvent
*/
'contractAddress'?: string;
/**
* Address of the sender in the token transfer.
* @type {string}
* @memberof ERC721TransferEvent
*/
'from'?: string;
/**
* Address of the recipient in the token transfer.
* @type {string}
* @memberof ERC721TransferEvent
*/
'to'?: string;
/**
* Unique identifier of the NFT being transferred.
* @type {string}
* @memberof ERC721TransferEvent
*/
'tokenId'?: string;
}
/**
*
* @export
Expand Down Expand Up @@ -2704,19 +2874,19 @@ export interface Webhook {
*/
export interface WebhookEventFilter {
/**
* The onchain contract address of the token being transferred.
* The onchain contract address of the token for which the events should be tracked.
* @type {string}
* @memberof WebhookEventFilter
*/
'contract_address'?: string;
/**
* The onchain address of the sender.
* The onchain address of the sender. Set this filter to track all transfer events originating from your address.
* @type {string}
* @memberof WebhookEventFilter
*/
'from_address'?: string;
/**
* The onchain address of the receiver.
* The onchain address of the receiver. Set this filter to track all transfer events sent to your address.
* @type {string}
* @memberof WebhookEventFilter
*/
Expand Down
Loading