Skip to content

Commit

Permalink
add erc20 and erc721 event type
Browse files Browse the repository at this point in the history
yarn lock
  • Loading branch information
chaoyaji-cb committed Sep 6, 2024
1 parent a4d67dc commit 8a1382a
Show file tree
Hide file tree
Showing 2 changed files with 3,691 additions and 3 deletions.
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

0 comments on commit 8a1382a

Please sign in to comment.