wrappers.d.ts 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. import { Block, Log, TransactionReceipt, TransactionResponse } from "../providers/provider.js";
  2. import { EventPayload } from "../utils/index.js";
  3. import type { EventFragment, Interface, Result } from "../abi/index.js";
  4. import type { Listener } from "../utils/index.js";
  5. import type { Provider } from "../providers/index.js";
  6. import type { BaseContract } from "./contract.js";
  7. import type { ContractEventName } from "./types.js";
  8. /**
  9. * An **EventLog** contains additional properties parsed from the [[Log]].
  10. */
  11. export declare class EventLog extends Log {
  12. /**
  13. * The Contract Interface.
  14. */
  15. readonly interface: Interface;
  16. /**
  17. * The matching event.
  18. */
  19. readonly fragment: EventFragment;
  20. /**
  21. * The parsed arguments passed to the event by ``emit``.
  22. */
  23. readonly args: Result;
  24. /**
  25. * @_ignore:
  26. */
  27. constructor(log: Log, iface: Interface, fragment: EventFragment);
  28. /**
  29. * The name of the event.
  30. */
  31. get eventName(): string;
  32. /**
  33. * The signature of the event.
  34. */
  35. get eventSignature(): string;
  36. }
  37. /**
  38. * An **EventLog** contains additional properties parsed from the [[Log]].
  39. */
  40. export declare class UndecodedEventLog extends Log {
  41. /**
  42. * The error encounted when trying to decode the log.
  43. */
  44. readonly error: Error;
  45. /**
  46. * @_ignore:
  47. */
  48. constructor(log: Log, error: Error);
  49. }
  50. /**
  51. * A **ContractTransactionReceipt** includes the parsed logs from a
  52. * [[TransactionReceipt]].
  53. */
  54. export declare class ContractTransactionReceipt extends TransactionReceipt {
  55. #private;
  56. /**
  57. * @_ignore:
  58. */
  59. constructor(iface: Interface, provider: Provider, tx: TransactionReceipt);
  60. /**
  61. * The parsed logs for any [[Log]] which has a matching event in the
  62. * Contract ABI.
  63. */
  64. get logs(): Array<EventLog | Log>;
  65. }
  66. /**
  67. * A **ContractTransactionResponse** will return a
  68. * [[ContractTransactionReceipt]] when waited on.
  69. */
  70. export declare class ContractTransactionResponse extends TransactionResponse {
  71. #private;
  72. /**
  73. * @_ignore:
  74. */
  75. constructor(iface: Interface, provider: Provider, tx: TransactionResponse);
  76. /**
  77. * Resolves once this transaction has been mined and has
  78. * %%confirms%% blocks including it (default: ``1``) with an
  79. * optional %%timeout%%.
  80. *
  81. * This can resolve to ``null`` only if %%confirms%% is ``0``
  82. * and the transaction has not been mined, otherwise this will
  83. * wait until enough confirmations have completed.
  84. */
  85. wait(confirms?: number, timeout?: number): Promise<null | ContractTransactionReceipt>;
  86. }
  87. /**
  88. * A **ContractUnknownEventPayload** is included as the last parameter to
  89. * Contract Events when the event does not match any events in the ABI.
  90. */
  91. export declare class ContractUnknownEventPayload extends EventPayload<ContractEventName> {
  92. /**
  93. * The log with no matching events.
  94. */
  95. readonly log: Log;
  96. /**
  97. * @_event:
  98. */
  99. constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, log: Log);
  100. /**
  101. * Resolves to the block the event occured in.
  102. */
  103. getBlock(): Promise<Block>;
  104. /**
  105. * Resolves to the transaction the event occured in.
  106. */
  107. getTransaction(): Promise<TransactionResponse>;
  108. /**
  109. * Resolves to the transaction receipt the event occured in.
  110. */
  111. getTransactionReceipt(): Promise<TransactionReceipt>;
  112. }
  113. /**
  114. * A **ContractEventPayload** is included as the last parameter to
  115. * Contract Events when the event is known.
  116. */
  117. export declare class ContractEventPayload extends ContractUnknownEventPayload {
  118. /**
  119. * The matching event.
  120. */
  121. readonly fragment: EventFragment;
  122. /**
  123. * The log, with parsed properties.
  124. */
  125. readonly log: EventLog;
  126. /**
  127. * The parsed arguments passed to the event by ``emit``.
  128. */
  129. readonly args: Result;
  130. /**
  131. * @_ignore:
  132. */
  133. constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, fragment: EventFragment, _log: Log);
  134. /**
  135. * The event name.
  136. */
  137. get eventName(): string;
  138. /**
  139. * The event signature.
  140. */
  141. get eventSignature(): string;
  142. }
  143. //# sourceMappingURL=wrappers.d.ts.map