UNPKG

@aptos-labs/ts-sdk

Version:
91 lines (88 loc) 3.49 kB
import { MoveStructId, AnyNumber, PaginationArgs, OrderByArg, WhereArg } from '../types/index.mjs'; import { EventsBoolExp } from '../types/generated/types.mjs'; import { AccountAddressInput } from '../core/accountAddress.mjs'; import { AptosConfig } from './aptosConfig.mjs'; import { GetEventsResponse } from '../types/indexer.mjs'; import '../utils/apiEndpoints.mjs'; import '../types/generated/operations.mjs'; import '../bcs/serializer.mjs'; import '../core/hex.mjs'; import '../core/common.mjs'; import '../bcs/deserializer.mjs'; import '../transactions/instances/transactionArgument.mjs'; import '../utils/const.mjs'; /** * A class to query all `Event` Aptos related queries */ declare class Event { readonly config: AptosConfig; constructor(config: AptosConfig); /** * Get module events by event type * * @example * const events = await aptos.getModuleEventsByEventType({eventType:"0x1::transaction_fee::FeeStatement"}) * * @param args.eventType - The event type * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying * * @returns Promise<GetEventsResponse> */ getModuleEventsByEventType(args: { eventType: MoveStructId; minimumLedgerVersion?: AnyNumber; options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>; }): Promise<GetEventsResponse>; /** * Get events by creation number and an account address * * @example * const events = await aptos.getAccountEventsByCreationNumber({accountAddress:"0x123",creationNumber: 0}) * * @param args.accountAddress - The account address * @param args.creationNumber - The event creation number * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying * * @returns Promise<GetEventsResponse> */ getAccountEventsByCreationNumber(args: { accountAddress: AccountAddressInput; creationNumber: AnyNumber; minimumLedgerVersion?: AnyNumber; }): Promise<GetEventsResponse>; /** * Get events by event type and an account address * * @example * const events = await aptos.getAccountEventsByEventType({accountAddress:"0x123",eventType: "0x1::transaction_fee::FeeStatement"}) * * @param args.accountAddress - The account address * @param args.eventType - The event type * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying * * @returns Promise<GetEventsResponse> */ getAccountEventsByEventType(args: { accountAddress: AccountAddressInput; eventType: MoveStructId; minimumLedgerVersion?: AnyNumber; options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>; }): Promise<GetEventsResponse>; /** * Get all events * * An optional `where` can be passed in to filter out the response. * @param args.minimumLedgerVersion Optional ledger version to sync up to, before querying * @example * const events = await aptos.getEvents() * // with filtering * const events = await aptos.getEvents({options: { where: { account_address: { _eq: "0x123" } } }}); * * @returns GetEventsQuery response type */ getEvents(args?: { minimumLedgerVersion?: AnyNumber; options?: PaginationArgs & OrderByArg<GetEventsResponse[0]> & WhereArg<EventsBoolExp>; }): Promise<GetEventsResponse>; } export { Event };