Function createProposalExecutionEventListener

  • Creates a ProposalExecution event listener for a given Bridge instance. Proposal execution event usually emits after funds are transferred from the bridge contract on the destination chain.

    Example

    const depositNonce = 42 // get your depositNonce from deposit event
    const bridgeInstance = Bridge__factory.connect(...) // your bridge contract instance from sygma-contracts
    createProposalExecutionEventListener(
    depositNonce,
    bridgeInstance,
    (originDomainId, depositNonce, dataHash, tx) => {
    console.log(
    "execution events callback",
    originDomainId,
    depositNonce,
    dataHash,
    tx
    );
    }
    );

    Returns

    The Bridge Contract instance with the event listener attached.

    Parameters

    • homeDepositNonce: number

      The deposit nonce of the home chain.

    • bridge: Bridge

      The Bridge Contract instance to listen to.

    • callbackFn: ((originDomainId: number, depositNonce: BigNumber, dataHash: string, tx: Event) => void)

      Callback function to execute when a ProposalExecution event is emitted.

        • (originDomainId: number, depositNonce: BigNumber, dataHash: string, tx: Event): void
        • Parameters

          • originDomainId: number
          • depositNonce: BigNumber
          • dataHash: string
          • tx: Event

          Returns void

    Returns Bridge

Generated using TypeDoc