Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.22 KB

simulateUpdateDepositTx.md

File metadata and controls

48 lines (35 loc) · 1.22 KB

@across-protocol/app-sdk / simulateUpdateDepositTx

Function: simulateUpdateDepositTx()

simulateUpdateDepositTx(params): Promise<SimulateContractReturnType>

This function simulates the update of a deposit on the origin chain. Can be used to update:

  • the recipient address
  • the output amount, i.e. the fees
  • the cross-chain message Note that this requires a signature from the depositor.

Parameters

params: SimulateUpdateDepositTxParams

See SimulateUpdateDepositTxParams.

Returns

Promise<SimulateContractReturnType>

The result of the simulation.

Example

const result = await simulateUpdateDepositTx({
  walletClient,
. originChainClient,
  destinationChainClient,
  deposit: {
    // deposit details
  },
  update: {
    recipient: "0xNEW_RECIPIENT_ADDRESS",
  },
 });
const txHash = await walletClient.writeContract({
  account,
  ...txRequest,
});

Defined in

packages/sdk/src/actions/simulateUpdateDepositTx.ts:62