Function createDepositEventListener

  • Creates an event listener for deposit events on the specified Bridge contract.

    Example

    const bridge = new Bridge(...); // Instantiate your Bridge contract instance.
    const userAddress = "0x123...";

    function depositCallback(destinationDomainId, resourceId, depositNonce, user, data, handleResponse, tx) {
    console.log("Deposit event triggered:");
    console.log("destinationDomainId", destinationDomainId);
    console.log("resourceId", resourceId);
    console.log("depositNonce", depositNonce.toString());
    console.log("user", user);
    console.log("data", data);
    console.log("handleResponse", handleResponse);
    console.log("tx", tx);
    }
    const eventBridge = createDepositEventListener(bridge, userAddress, depositCallback);

    Returns

    • The Bridge contract instance with the event listener attached.

    Parameters

    • bridge: Bridge

      The Bridge contract instance.

    • userAddress: string

      The user address to filter deposit events for.

    • callbackFn: ((destinationDomainId: number, resourceId: string, depositNonce: BigNumber, user: string, data: string, handleResponse: string, tx: Event) => void)

      The callback function to be executed when a deposit event is triggered.

        • (destinationDomainId: number, resourceId: string, depositNonce: BigNumber, user: string, data: string, handleResponse: string, tx: Event): void
        • Parameters

          • destinationDomainId: number
          • resourceId: string
          • depositNonce: BigNumber
          • user: string
          • data: string
          • handleResponse: string
          • tx: Event

          Returns void

    Returns Bridge

Generated using TypeDoc