Skip to content

Get deposit id for across from settlement tx#5

Draft
anxolin wants to merge 7 commits intomainfrom
get-deposit-id
Draft

Get deposit id for across from settlement tx#5
anxolin wants to merge 7 commits intomainfrom
get-deposit-id

Conversation

@anxolin
Copy link
Owner

@anxolin anxolin commented Mar 27, 2025

This PR obtains the deposit id from across bridging using just the events of the settlement and the orderbook API.

Input:

  • tx hash of the settlement
  • orderId of the order you want to get the depositId into the across spook contract
  • chainId

Main algorithm is:

  • Get all across deposits events (ordered by logindex)
  • Get all trade events in the settlement (ordered by logindex)
  • Extract the orderId from the trades, fetch the order details from Orderbook API
  • Filter the orders, leaving only the ones that have a post-hook to bridge using across
  • Get the relative position of the orderId you are particularly interested from the settlement. Use that relative order to return the deposit details.

} from "@cowprotocol/cow-sdk";

export async function run() {
const orderBookApi = new OrderBookApi({
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated to this PR. pls ignore this file...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments