Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK: add RFQ #1695

Merged
merged 71 commits into from
Jan 8, 2024
Merged

SDK: add RFQ #1695

merged 71 commits into from
Jan 8, 2024

Conversation

ChiTimesChi
Copy link
Collaborator

@ChiTimesChi ChiTimesChi commented Dec 21, 2023

Description

Adds support for basic RFQ implementation, without additional swaps on origin chain.

TODO items

  • Basic implementation
    • Implement SDK classes for interacting with FastBridge contract
    • Return quotes from RFQ in bridgeQuote()
    • Add estimated time for RFQ
    • Optional gas rebate
  • FastBridge:
    • Generate binding
    • Sending tokens
    • Decoding origin event
    • Checking tx status
  • Quoter API
    • Ticket marshalling
    • Get the list of supported token pairs between two chains
    • Get the quote for a specific token pair and amount
    • Get the full list of quotes
    • Use only recent quotes
  • Tests, tests, tests

Summary by CodeRabbit

  • New Features

    • Implemented a new Fast Bridge feature for cross-chain swaps, including support for Request for Quote (RFQ).
    • Added median time constants for SynapseRFQ transactions to improve user estimates.
    • Introduced a new Query object for no-swap bridge actions.
  • Enhancements

    • Expanded chain support to include Optimism and Arbitrum for RFQ transactions.
    • Updated the SynapseSDK to include the new fastBridgeSet functionality.
  • Bug Fixes

    • Adjusted the calculation of minimum amounts with slippage for bridge transactions to handle RFQ cases.
  • Documentation

    • Added TODO comments to address future improvements for RFQ handling without slippage.
  • UI/UX Improvements

    • Modified the BridgeExchangeRateInfo component to accommodate the new RFQ bridge type.
    • Updated the Portfolio components to better manage and display transaction statuses, especially for pending transactions.
  • Testing

    • Added comprehensive tests for the new FastBridge and RFQ functionalities, including bridge routes, swap times, fees, and quote handling.
    • Improved testing for the SDK router's quote module and API interactions.
  • Refactor

    • Enhanced the structure of transaction-related components for better state management and user experience.
    • Consolidated transaction-related constants and helper functions for cleaner code organization.

dcc652b01dfd213c6070a5dadf96f5e6829b8c1f: synapse-interface preview link
888f6b9418e954f1b056193ce414b0fdd4ea2cd8: synapse-interface preview link
5e2bfc1584a29f241da4d57904e97cbed0298e1e: synapse-interface preview link
01a3cd8ec7e01f94157a22f2c3d0693202a78edb: synapse-interface preview link
09dd857c720aa2fecf36ae7292cb3b2d6f229f86: synapse-interface preview link
493dcae4e1cee85aa3008ff08690f1496e0332da: synapse-interface preview link
eefbf499b0c420c2e0cc0a78da91047347d19852: synapse-interface preview link
38207219484062b3e06c14841189df981f7d2182: synapse-interface preview link
1ad091b8bb19cf47485b1c7079361a3b978f140e: synapse-interface preview link
6137733e2b3b3a650d4c5c9e81660a27a4b94874: synapse-interface preview link
0546a9674d28a83c82046fb00bf1127bf4559f6e: synapse-interface preview link
98ebd1ab9d032684b5aa2a2fc533a2310afdaed8: synapse-interface preview link
994a2d028f5ed98a2a5a8e61297c26c6924cb172: synapse-interface preview link
6f496eaaede3c5ab2db76f71ad8f885f68dec652: synapse-interface preview link
041ef39d54491e2129f2aaba8d4d5e520d5ba911: synapse-interface preview link
a5fc1382b5832e3d2d38e9329c69659cee1fe83c: synapse-interface preview link
f2a68072e4a071d958f197ed6187e93aee39a58a: synapse-interface preview link
82b3f8af84631ace0ccab6a777aa4a8f549b2def: synapse-interface preview link
99b918ee0f071cd48d01245be3df187e3573b411: synapse-interface preview link
8eb4a6e4a23d838837eb6b49bc92f04cd4fb736a: synapse-interface preview link
d7fcf1409f3fa0ea98e4d7952bb88d4ce9206034: synapse-interface preview link
eb34f5531535dbb80520073946dfd659e3f16596: synapse-interface preview link
c6b49c6e2ac5ad55f2728dec12b5e661008f9c46: synapse-interface preview link

Copy link
Contributor

coderabbitai bot commented Dec 21, 2023

Walkthrough

The updates introduce a new FastBridgeSet class, managing fast bridges for cross-chain swaps, and include extensive test coverage for the new functionality. Enhancements to the Synapse SDK add support for new chain IDs and bridge types, particularly for RFQ-supported chains. The interface components and store are updated to handle new transaction types, improve UX for pending transactions, and incorporate the new bridge logic.

Changes

File Path Change Summary
packages/sdk-router/src/constants/... Added constants for RFQ_SUPPORTED_CHAIN_IDS, FAST_BRIDGE_ADDRESS, and related maps.
packages/sdk-router/src/rfq/... Introduced FastBridgeSet class and related tests; added FastBridge class and quote handling functionality.
packages/sdk-router/src/module/... Added createNoSwapQuery function and related tests.
packages/sdk-router/src/sdk.ts, packages/sdk-router/src/sdk.test.ts Updated SynapseSDK class with fastBridgeSet and tests for RFQ transactions.
packages/sdk-router/src/typechain/..., packages/sdk-router/src/utils/... Updated FastBridge interface and added time constants.
packages/synapse-interface/... (various) Updated components and pages to handle new RFQ bridge type and transaction status logic. Added _Transaction components and helpers.
packages/synapse-interface/slices/... Added new slices for _transactions handling in the Redux store.

"In the land of code where the smart contracts lie,
A rabbit hopped through with an upgrade so spry.
🌉 Bridges built fast, across chains they span,
A whisk of a tail, and the new era began."

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

codecov bot commented Dec 21, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (e7d8595) 51.86177% compared to head (139c512) 52.05070%.
Report is 1 commits behind head on master.

Files Patch % Lines
packages/sdk-router/src/rfq/fastBridgeSet.ts 95.34884% 2 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##              master       #1695         +/-   ##
===================================================
+ Coverage   51.86177%   52.05070%   +0.18892%     
===================================================
  Files            360         366          +6     
  Lines          24654       24772        +118     
  Branches         285         295         +10     
===================================================
+ Hits           12786       12894        +108     
- Misses         10630       10636          +6     
- Partials        1238        1242          +4     
Flag Coverage Δ
packages 92.93044% <98.42520%> (+0.91979%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ChiTimesChi
Copy link
Collaborator Author

This PR was rebased to separate the changes to the bindings in #1706

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 032f4c0 and ad6e838.
Files selected for processing (2)
  • packages/sdk-router/src/constants/medianTime.ts (1 hunks)
  • packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (2 hunks)
Files skipped from review due to trivial changes (1)
  • packages/sdk-router/src/constants/medianTime.ts
Files skipped from review as they are similar to previous changes (1)
  • packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between ad6e838 and 2f990a6.
Files selected for processing (1)
  • packages/sdk-router/src/rfq/fastBridgeSet.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/sdk-router/src/rfq/fastBridgeSet.ts

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 2f990a6 and d9ae90e.
Files selected for processing (13)
  • packages/synapse-interface/components/Portfolio/Activity.tsx (2 hunks)
  • packages/synapse-interface/components/Portfolio/PortfolioTabManager.tsx (2 hunks)
  • packages/synapse-interface/components/_Transaction/_Transaction.tsx (1 hunks)
  • packages/synapse-interface/components/_Transaction/_Transactions.tsx (1 hunks)
  • packages/synapse-interface/components/_Transaction/helpers/constants.ts (1 hunks)
  • packages/synapse-interface/components/_Transaction/helpers/getExplorerAddressLink.ts (1 hunks)
  • packages/synapse-interface/components/_Transaction/helpers/getTxBlockExplorerLink.ts (1 hunks)
  • packages/synapse-interface/components/_Transaction/helpers/useBridgeTxStatus.tsx (1 hunks)
  • packages/synapse-interface/pages/_app.tsx (2 hunks)
  • packages/synapse-interface/slices/_transactions/hooks.ts (1 hunks)
  • packages/synapse-interface/slices/_transactions/reducer.ts (1 hunks)
  • packages/synapse-interface/slices/_transactions/updater.tsx (1 hunks)
  • packages/synapse-interface/store/reducer.ts (2 hunks)
Additional comments: 12
packages/synapse-interface/slices/_transactions/hooks.ts (1)
  • 4-6: The use_TransactionsState hook is a simple selector hook for the _transactions slice of the Redux state. It looks correct and follows best practices for Redux hooks.
packages/synapse-interface/components/_Transaction/helpers/getExplorerAddressLink.ts (1)
  • 3-14: The getExplorerAddressLink function correctly constructs a URL to a block explorer for a given chain ID and address. It also handles the case where the chain ID or address is missing by logging an error and returning null values. This is a good practice for error handling.
packages/synapse-interface/components/_Transaction/helpers/getTxBlockExplorerLink.ts (1)
  • 3-14: The getTxBlockExplorerLink function is similar to getExplorerAddressLink but for transaction hashes. It also correctly handles missing chain IDs or transaction hashes by logging an error and returning null values.
packages/synapse-interface/components/_Transaction/helpers/constants.ts (2)
  • 1-21: The ExplorerLinks constant provides a mapping of chain IDs to their respective block explorer URLs. It's important to ensure that these URLs are kept up-to-date and that the list includes all supported chains.

  • 23-43: The ExplorerNames constant provides a mapping of chain IDs to the human-readable names of their respective block explorers. This is useful for UI purposes where the name of the block explorer is displayed to the user.

packages/synapse-interface/store/reducer.ts (1)
  • 24-24: The _transactions reducer has been added to the persistedReducers object, which means that the _transactions state will be persisted across sessions. This is a significant change and should be verified to ensure that only the necessary parts of the _transactions state are persisted and that sensitive information is not stored in local storage.
Verification successful

The review of the _transactions reducer file reveals the following:

  • The _TransactionDetails interface includes fields such as originChain, originToken, destinationChain, destinationToken, originValue, originTxHash, bridgeModuleName, estimatedTime, timestamp, kappa, and isComplete.
  • The _TransactionsState interface is a mapping from transaction hashes to _TransactionDetails.
  • The initialState for the reducer is an empty object.
  • The reducer includes actions to add, remove, update, and complete transactions, as well as to clear all transactions.

The data stored in the _transactions reducer appears to be related to transaction details and does not include any sensitive information such as private keys or personal user data. The persistence of this data across sessions would be typical for a transaction history feature in a financial application, allowing users to see past transactions after restarting the application.

Based on the contents of the reducer file, the PR comment regarding the persistence of the _transactions state seems to be addressed appropriately, as the persisted data is relevant to the application's functionality and does not include sensitive information.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that only necessary parts of the _transactions state are persisted.
rg --type javascript "persistedReducers"

Length of output: 75



Script:

#!/bin/bash
# Verify that only necessary parts of the _transactions state are persisted.
rg "persistedReducers" --type js

Length of output: 32



Script:

#!/bin/bash
# Search for "persistedReducers" in all files to verify the _transactions state persistence.
rg "persistedReducers"

Length of output: 251



Script:

#!/bin/bash
# Output the lines around the definition of `persistedReducers` to understand its structure and contents.
rg "const persistedReducers =" -A 10 -B 2 packages/synapse-interface/store/reducer.ts

Length of output: 438



Script:

#!/bin/bash
# Search for the definition of the `_transactions` reducer to understand what data it contains.
rg "_transactions" -A 10 -B 2 packages/synapse-interface/store/reducer.ts

Length of output: 1016



Script:

#!/bin/bash
# Find the `_transactions` reducer file and output its contents.
fd "_transactions" --exec rg --type js

Length of output: 38



Script:

#!/bin/bash
# Find the file path of the `_transactions` reducer.
fd "_transactions\.js$"

Length of output: 25



Script:

#!/bin/bash
# Find any file that contains `_transactions` in its name.
fd "_transactions"

Length of output: 136



Script:

#!/bin/bash
# List the contents of the _transactions directory to find the reducer file.
ls packages/synapse-interface/slices/_transactions/

Length of output: 85



Script:

#!/bin/bash
# Display the contents of the _transactions reducer file.
cat packages/synapse-interface/slices/_transactions/reducer.ts

Length of output: 2413

packages/synapse-interface/components/_Transaction/_Transactions.tsx (1)
  • 9-60: The _Transactions component is responsible for rendering a list of transaction components. It uses several hooks to get the necessary data and correctly updates the current time every 5 seconds to trigger re-checks of transaction statuses. The component also handles the case where there are no transactions to display. Ensure that the interval is cleared correctly on component unmount to prevent memory leaks.
packages/synapse-interface/components/Portfolio/PortfolioTabManager.tsx (1)
  • 1-15: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [2-40]

The PortfolioTabManager component now includes the _Transactions component, passing the connectedAddress prop obtained from the useAccount hook. This change integrates the new _Transactions component into the portfolio tab manager, allowing users to view their transactions within the portfolio UI.

packages/synapse-interface/slices/_transactions/reducer.ts (1)
  • 26-102: The transactionsSlice reducer has been defined with actions to add, remove, update, and complete transactions. The reducer's actions are well-defined and handle the necessary updates to the state. Ensure that the reducer's actions are covered by unit tests to verify their behavior.
packages/synapse-interface/pages/_app.tsx (1)
  • 56-56: The _TransactionsUpdater component has been added to the Updaters function, which is responsible for running various updaters that sync the application state with external data. This change ensures that the _transactions state is kept up-to-date.
packages/synapse-interface/components/_Transaction/_Transaction.tsx (1)
  • 58-208: The _Transaction component is responsible for rendering individual transaction details and status. It uses several hooks to get the necessary data and correctly updates the transaction status. The component also provides a dropdown menu with options related to the transaction, such as viewing on a block explorer or contacting support. Ensure that the handleClearTransaction function is tested to confirm that it correctly removes transactions from the state.
packages/synapse-interface/components/Portfolio/Activity.tsx (1)
  • 232-238: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [235-279]

The conditional rendering of the "Pending" section within the Activity component has been commented out. This change affects the logic for displaying pending transactions. If this is intentional and the pending transactions are now handled elsewhere, this change is acceptable. However, if this is a temporary change for testing or development purposes, it should be noted, and the original code should be restored before merging.

Comment on lines 9 to 37
export default function Updater() {
const dispatch = useAppDispatch()
const { pendingBridgeTransactions } = useTransactionsState()
const transactions = use_TransactionsState()

/** Add transaction if not in _transactions store */
useEffect(() => {
if (checkTransactionsExist(pendingBridgeTransactions)) {
pendingBridgeTransactions.forEach((tx: PendingBridgeTransaction) => {
if (!transactions[tx.transactionHash]) {
dispatch(
addTransaction({
originTxHash: tx.transactionHash,
originValue: tx.originValue,
originChain: tx.originChain,
originToken: tx.originToken,
destinationChain: tx.destinationChain,
destinationToken: tx.destinationToken,
bridgeModuleName: tx.bridgeModuleName,
estimatedTime: tx.estimatedTime,
timestamp: tx.id,
})
)
}
})
}
}, [pendingBridgeTransactions])

return null
Copy link
Contributor

Choose a reason for hiding this comment

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

The checkTransactionsExist function checks if the transactions parameter is not null or undefined, is an array, and has a length greater than zero. It does not, however, check for uniqueness of transactions within the array. This could potentially lead to duplicates if the same transaction is added multiple times to the array that is passed to this function.

Analysis chain

The Updater component is using a React effect to add transactions to the _transactions slice if they are not already present. It correctly checks for the existence of transactions before dispatching the addTransaction action. However, it's important to ensure that the checkTransactionsExist utility function is correctly identifying unique transactions to prevent duplicates.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that checkTransactionsExist correctly identifies unique transactions.
ast-grep --lang javascript --pattern $'function checkTransactionsExist($_) {
  $$$
}'

Length of output: 86



Script:

#!/bin/bash
# Search for any function or method that includes 'checkTransactionsExist' to verify its implementation.
rg "checkTransactionsExist"

Length of output: 4478



Script:

#!/bin/bash
# Display the contents of the checkTransactionsExist.ts file to verify the implementation of the function.
cat packages/synapse-interface/utils/checkTransactionsExist.ts

Length of output: 280

Comment on lines 15 to 79
export const useBridgeTxStatus = ({
originChainId,
destinationChainId,
originTxHash,
bridgeModuleName,
kappa,
checkStatus = false,
currentTime,
}: UseBridgeTxStatusProps) => {
const { synapseSDK } = useSynapseContext()
const [isComplete, setIsComplete] = useState<boolean>(false)
const [fetchedKappa, setFetchedKappa] = useState<string>(null)

const getKappa = async (): Promise<string> => {
if (!synapseSDK) return null
if (!bridgeModuleName || !originChainId || !originTxHash) return null
return await synapseSDK.getSynapseTxId(
originChainId,
bridgeModuleName,
originTxHash
)
}

const getBridgeTxStatus = async (
destinationChainId: number,
bridgeModuleName: string,
kappa: string
) => {
if (!synapseSDK) return null
if (!destinationChainId || !bridgeModuleName || !kappa) return null
return await synapseSDK.getBridgeTxStatus(
destinationChainId,
bridgeModuleName,
kappa
)
}

useEffect(() => {
if (!checkStatus) return
if (isComplete) return
;(async () => {
let _kappa

if (!kappa) {
console.log('fetching kappa')
_kappa = await getKappa()
setFetchedKappa(_kappa)
} else {
_kappa = kappa
}

console.log('fetching tx status')
const txStatus = await getBridgeTxStatus(
destinationChainId,
bridgeModuleName,
_kappa
)

if (txStatus !== null) {
setIsComplete(txStatus)
}
})()
}, [currentTime, checkStatus])

return [isComplete, fetchedKappa]
Copy link
Contributor

Choose a reason for hiding this comment

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

The useBridgeTxStatus hook is used to fetch the status of a bridge transaction and the associated kappa value. It correctly handles the case where the transaction is already complete or if the necessary parameters are not provided. However, the hook relies on the currentTime prop to trigger updates, which could lead to unnecessary re-renders or fetches. Consider optimizing this by using more specific dependencies for the useEffect hook.

-  }, [currentTime, checkStatus])
+  }, [checkStatus, isTxComplete, kappa])

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
export const useBridgeTxStatus = ({
originChainId,
destinationChainId,
originTxHash,
bridgeModuleName,
kappa,
checkStatus = false,
currentTime,
}: UseBridgeTxStatusProps) => {
const { synapseSDK } = useSynapseContext()
const [isComplete, setIsComplete] = useState<boolean>(false)
const [fetchedKappa, setFetchedKappa] = useState<string>(null)
const getKappa = async (): Promise<string> => {
if (!synapseSDK) return null
if (!bridgeModuleName || !originChainId || !originTxHash) return null
return await synapseSDK.getSynapseTxId(
originChainId,
bridgeModuleName,
originTxHash
)
}
const getBridgeTxStatus = async (
destinationChainId: number,
bridgeModuleName: string,
kappa: string
) => {
if (!synapseSDK) return null
if (!destinationChainId || !bridgeModuleName || !kappa) return null
return await synapseSDK.getBridgeTxStatus(
destinationChainId,
bridgeModuleName,
kappa
)
}
useEffect(() => {
if (!checkStatus) return
if (isComplete) return
;(async () => {
let _kappa
if (!kappa) {
console.log('fetching kappa')
_kappa = await getKappa()
setFetchedKappa(_kappa)
} else {
_kappa = kappa
}
console.log('fetching tx status')
const txStatus = await getBridgeTxStatus(
destinationChainId,
bridgeModuleName,
_kappa
)
if (txStatus !== null) {
setIsComplete(txStatus)
}
})()
}, [currentTime, checkStatus])
return [isComplete, fetchedKappa]
useEffect(() => {
if (!checkStatus) return
if (isComplete) return
;(async () => {
let _kappa
if (!kappa) {
console.log('fetching kappa')
_kappa = await getKappa()
setFetchedKappa(_kappa)
} else {
_kappa = kappa
}
console.log('fetching tx status')
const txStatus = await getBridgeTxStatus(
destinationChainId,
bridgeModuleName,
_kappa
)
if (txStatus !== null) {
setIsComplete(txStatus)
}
})()
}, [checkStatus, isTxComplete, kappa])

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between d9ae90e and 410ebdb.
Files selected for processing (1)
  • packages/synapse-interface/components/_Transaction/helpers/useBridgeTxStatus.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/synapse-interface/components/_Transaction/helpers/useBridgeTxStatus.tsx

* Sorting wip

* Show by latest

* Merging sorting-j

* Hides debugging related kappa and time

* debug why new type isnt recognized

* Convert transactions object to list

* Render transactions in list

* Check tx is stored before adding into _transaction

* Check tx has been confirmed before adding to _transaction store

* Sorting by descending timestamp

* Allow clear tx functionality to persist

* back to optimism mainnet rpc

* Prevent refiring tx sdk queries if already complete

* Mark tx as complete once kappa and isTxComplete avail

* Check if store marked Tx complete before firing tx status hook, render persisted tx status

* `useBridgeTxStatus` hook initialized to set isComplete to true if kappa exists, save call

* Revert prev commit, require check on tx status beyond kappa avail

* Utilize `checkStatus` as guardrail check in `useBridgeTxStatus`

* removes unused prop

* removes another unused prop

* Hide debugging meta

* Hide debugging meta

* limits to 5 txns

* align time

---------

Co-authored-by: bigboydiamonds <57741810+bigboydiamonds@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 410ebdb and d0e6a01.
Files selected for processing (5)
  • packages/synapse-interface/components/_Transaction/_Transaction.tsx (1 hunks)
  • packages/synapse-interface/components/_Transaction/_Transactions.tsx (1 hunks)
  • packages/synapse-interface/components/_Transaction/helpers/useBridgeTxStatus.tsx (1 hunks)
  • packages/synapse-interface/slices/_transactions/reducer.ts (1 hunks)
  • packages/synapse-interface/slices/_transactions/updater.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (5)
  • packages/synapse-interface/components/_Transaction/_Transaction.tsx
  • packages/synapse-interface/components/_Transaction/_Transactions.tsx
  • packages/synapse-interface/components/_Transaction/helpers/useBridgeTxStatus.tsx
  • packages/synapse-interface/slices/_transactions/reducer.ts
  • packages/synapse-interface/slices/_transactions/updater.tsx

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between d0e6a01 and 139c512.
Files ignored due to filter (1)
  • yarn.lock
Files selected for processing (1)
  • packages/synapse-interface/slices/_transactions/reducer.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/synapse-interface/slices/_transactions/reducer.ts

@ChiTimesChi ChiTimesChi changed the title [DO NOT MERGE] SDK: add RFQ SDK: add RFQ Jan 8, 2024
@ChiTimesChi ChiTimesChi merged commit 07fc2fc into master Jan 8, 2024
41 checks passed
@ChiTimesChi ChiTimesChi deleted the sdk/add-rfq branch January 8, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants