Function executeDeposit

  • Executes a deposit operation using the specified parameters and returns a contract receipt.

    Example

    const domainId = '1';
    const resourceId = '0x1234567890123456789012345678901234567890';
    const depositData = '0xabcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789';
    const feeData = { type: 'basic', fee: ethers.BigNumber.from('1000000000000000'), feeData: {} }; // fee data is madatory
    const bridgeInstance = new Bridge() // Bridge instance from sygma-contracts package;
    const confirmations = 3;
    const provider = new ethers.providers.JsonRpcProvider();
    const overrides = { gasLimit: 200000 };

    const transaction = executeDeposit(domainId, resourceId, depositData, feeData, bridgeInstance, confirmations, provider, overrides)
    .then((receipt) => console.log('Deposit executed:', receipt))
    .catch((error) => console.error('Error on deposit execution:', error));
    // wait for 10 confiramtions to finalize the transaction
    const receipt = await transaction.wait(10)

    Returns

    A promise that resolves to a contract receipt once the deposit is executed.

    Parameters

    • domainId: string

      The unique identifier for destination network.

    • resourceId: string

      The resource ID associated with the token.

    • depositData: string

      The deposit data required for the operation.

    • feeData: FeeDataResult

      The fee data result for the deposit operation.

    • bridgeInstance: Bridge

      The bridge instance used to perform the deposit operation.

    • provider: Provider

      The provider used for the Ethereum network connection.

    • Optional overrides: PayableOverrides

      Optional transaction overrides to be applied.

    Returns Promise<ContractTransaction>

Generated using TypeDoc