From 04b9894a40b8f77c4e5fda73f2ef0a7cc4384067 Mon Sep 17 00:00:00 2001 From: trajan0x <83933037+trajan0x@users.noreply.github.com> Date: Thu, 21 Mar 2024 10:50:40 +0100 Subject: [PATCH 01/10] 2024-03-21 FE Release (#2329) --- packages/synapse-interface/CHANGELOG.md | 19 +++ .../Events/example/EcotoneForkUpgrade.tsx | 41 ++++--- .../Events/template/MaintenanceEvent.tsx | 114 ++++++++++++++++++ packages/synapse-interface/package.json | 2 +- packages/synapse-interface/pages/index.tsx | 4 +- .../pages/state-managed-bridge/index.tsx | 15 +-- packages/synapse-interface/public/next.svg | 1 - .../synapse-interface/public/thirteen.svg | 1 - packages/synapse-interface/public/vercel.svg | 1 - 9 files changed, 170 insertions(+), 28 deletions(-) create mode 100644 packages/synapse-interface/components/Maintenance/Events/template/MaintenanceEvent.tsx delete mode 100644 packages/synapse-interface/public/next.svg delete mode 100644 packages/synapse-interface/public/thirteen.svg delete mode 100644 packages/synapse-interface/public/vercel.svg diff --git a/packages/synapse-interface/CHANGELOG.md b/packages/synapse-interface/CHANGELOG.md index e91e5d952d..13f15b8f5c 100644 --- a/packages/synapse-interface/CHANGELOG.md +++ b/packages/synapse-interface/CHANGELOG.md @@ -3,6 +3,25 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.11.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.10.7...@synapsecns/synapse-interface@0.11.0) (2024-03-21) + + +### Features + +* **synapse-interface:** improve maintenance event template, remove Metis pause ([#2328](https://github.com/synapsecns/sanguine/issues/2328)) ([b9b84a2](https://github.com/synapsecns/sanguine/commit/b9b84a229045a6c34f8dbc124fc10367480f6fb3)) + + + + + +## [0.10.7](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.10.6...@synapsecns/synapse-interface@0.10.7) (2024-03-20) + +**Note:** Version bump only for package @synapsecns/synapse-interface + + + + + ## [0.10.6](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.10.5...@synapsecns/synapse-interface@0.10.6) (2024-03-20) **Note:** Version bump only for package @synapsecns/synapse-interface diff --git a/packages/synapse-interface/components/Maintenance/Events/example/EcotoneForkUpgrade.tsx b/packages/synapse-interface/components/Maintenance/Events/example/EcotoneForkUpgrade.tsx index c57e6405c4..f8da18a9e7 100644 --- a/packages/synapse-interface/components/Maintenance/Events/example/EcotoneForkUpgrade.tsx +++ b/packages/synapse-interface/components/Maintenance/Events/example/EcotoneForkUpgrade.tsx @@ -1,6 +1,6 @@ import { useBridgeState } from '@/slices/bridge/hooks' import { useIntervalTimer } from '@/utils/hooks/useIntervalTimer' -import { METIS } from '@/constants/chains/master' +import { OPTIMISM, BASE } from '@/constants/chains/master' import { useEventCountdownProgressBar, getCountdownTimeStatus, @@ -19,10 +19,12 @@ import { WarningMessage } from '../../../Warning' * End: 50 min after start of Ecotone Fork Upgrade Time */ export const ECOTONE_FORK_BANNERS_START = new Date( - Date.UTC(2024, 2, 20, 16, 0, 0) + Date.UTC(2024, 2, 13, 23, 20, 0) ) -export const ECOTONE_FORK_START_DATE = new Date(Date.UTC(2024, 2, 20, 18, 0, 0)) -export const ECOTONE_FORK_END_DATE = new Date(Date.UTC(2024, 2, 20, 21, 0, 0)) +export const ECOTONE_FORK_START_DATE = new Date( + Date.UTC(2024, 2, 13, 23, 35, 0) +) +export const ECOTONE_FORK_END_DATE = new Date(Date.UTC(2024, 2, 14, 0, 25, 0)) /** Previous implementation can be seen here: https://github.com/synapsecns/sanguine/pull/2294/files#diff-bbe6298d3dfbc80e46e2ff8b399a3e1822cede80f392b1af91875145ad4eeb19R19 */ export const EcotoneForkUpgradeBanner = () => { @@ -35,9 +37,13 @@ export const EcotoneForkUpgradeBanner = () => { return ( Metis Bridging is paused. Will be back online shortly. + <> + Optimism + Base Bridging will be paused 10 minutes ahead of Ecotone + (March 14, 00:00 UTC, 20:00 EST). Will be back online shortly + following the network upgrade. + } startDate={ECOTONE_FORK_BANNERS_START} endDate={ECOTONE_FORK_END_DATE} @@ -54,14 +60,18 @@ export const EcotoneForkUpgradeBanner = () => { export const EcotoneForkWarningMessage = () => { const { fromChainId, toChainId } = useBridgeState() - const isToChainMetis = toChainId === METIS.id + const isChainOptimism = [fromChainId, toChainId].includes(OPTIMISM.id) + const isChainBase = [fromChainId, toChainId].includes(BASE.id) - if (isToChainMetis) { + if (isChainOptimism || isChainBase) { return ( -

Metis Chain bridging are paused.

+

+ Optimism Chain and Base Chain bridging are paused until the + Ecotone Fork upgrade completes. +

} /> @@ -95,22 +105,23 @@ export const EcotoneForkWarningMessage = () => { export const useEcotoneForkCountdownProgress = () => { const { fromChainId, toChainId } = useBridgeState() - const isToChainMetis = toChainId === METIS.id + const isChainOptimism = [fromChainId, toChainId].includes(OPTIMISM.id) + const isChainBase = [fromChainId, toChainId].includes(BASE.id) const { isPending: isEcotoneForkUpgradePending, EventCountdownProgressBar: EcotoneForkCountdownProgressBar, } = useEventCountdownProgressBar( - 'Metis Bridging is paused', + 'Ecotone Fork upgrade in progress', ECOTONE_FORK_START_DATE, // Countdown Bar will automatically appear after start time ECOTONE_FORK_END_DATE // Countdown Bar will automatically disappear when end time is reached ) return { isEcotoneForkUpgradePending, - isCurrentChainDisabled: isToChainMetis, // Used to pause Bridge - EcotoneForkCountdownProgressBar: isToChainMetis - ? EcotoneForkCountdownProgressBar - : null, + isCurrentChainDisabled: + (isChainOptimism || isChainBase) && isEcotoneForkUpgradePending, // Used to pause Bridge + EcotoneForkCountdownProgressBar: + isChainOptimism || isChainBase ? EcotoneForkCountdownProgressBar : null, } } diff --git a/packages/synapse-interface/components/Maintenance/Events/template/MaintenanceEvent.tsx b/packages/synapse-interface/components/Maintenance/Events/template/MaintenanceEvent.tsx new file mode 100644 index 0000000000..e6d623781e --- /dev/null +++ b/packages/synapse-interface/components/Maintenance/Events/template/MaintenanceEvent.tsx @@ -0,0 +1,114 @@ +import { useBridgeState } from '@/slices/bridge/hooks' +import { useIntervalTimer } from '@/utils/hooks/useIntervalTimer' +import { OPTIMISM, BASE } from '@/constants/chains/master' +import { + useEventCountdownProgressBar, + getCountdownTimeStatus, +} from '../../EventCountdownProgressBar' +import { AnnouncementBanner } from '../../AnnouncementBanner' +import { WarningMessage } from '../../../Warning' + +/** + * Edit this file for Website Maintenance, components already placed on Bridge page + * + * If require multiple maintenance events, create another file using this file as a template + * and add another instance of components on relevant pages + */ + +/** Banner start time */ +const MAINTENANCE_BANNERS_START = new Date(Date.UTC(2024, 2, 20, 20, 20, 0)) +/** Countdown Progress Bar, Bridge Warning Message + Bridge Pause start time */ +const MAINTENANCE_START_DATE = new Date(Date.UTC(2024, 2, 20, 20, 20, 0)) +/** Ends Banner, Countdown Progress Bar, Bridge Warning Message, Bridge Pause */ +const MAINTENANCE_END_DATE = new Date(Date.UTC(2024, 2, 20, 22, 0, 0)) + +export const MaintenanceBanner = () => { + const { isComplete } = getCountdownTimeStatus( + MAINTENANCE_BANNERS_START, // Banner will automatically appear after start time + MAINTENANCE_END_DATE // Banner will automatically disappear when end time is reached + ) + + useIntervalTimer(60000, isComplete) + + return ( + +

+ Bridging is paused until maintenance is complete. +

+ + } + startDate={MAINTENANCE_BANNERS_START} + endDate={MAINTENANCE_END_DATE} + /> + ) +} + +export const MaintenanceWarningMessage = () => { + const { fromChainId, toChainId } = useBridgeState() + + const isWarningChain = isChainIncluded( + [fromChainId, toChainId], + [OPTIMISM.id, BASE.id] // Update for Chains to show warning on + ) + + const { isComplete } = getCountdownTimeStatus( + MAINTENANCE_BANNERS_START, // Banner will automatically appear after start time + MAINTENANCE_END_DATE // Banner will automatically disappear when end time is reached + ) + + if (isComplete) return null + + if (isWarningChain) { + return ( + +

Bridging is paused until maintenance is complete.

+ + } + /> + ) + } + + return null +} + +export const useMaintenanceCountdownProgress = () => { + const { fromChainId, toChainId } = useBridgeState() + + const isCurrentChain = isChainIncluded( + [fromChainId, toChainId], + [OPTIMISM.id, BASE.id] // Update for Chains to show maintenance on + ) + + const { + isPending: isMaintenancePending, + EventCountdownProgressBar: MaintenanceCountdownProgressBar, + } = useEventCountdownProgressBar( + 'Maintenance in progress', + MAINTENANCE_START_DATE, // Countdown Bar will automatically appear after start time + MAINTENANCE_END_DATE // Countdown Bar will automatically disappear when end time is reached + ) + + return { + isMaintenancePending, + isCurrentChainDisabled: isCurrentChain && isMaintenancePending, // Used to pause Bridge + MaintenanceCountdownProgressBar: isCurrentChain + ? MaintenanceCountdownProgressBar + : null, + } +} + +/** + * Checks if any of the chain IDs in `hasChains` are found within the `chainList` array. + * + * @param {number[]} chainList - The array of chain IDs to check against. + * @param {number[]} hasChains - The array of chain IDs to find within `checkChains`. + * @returns {boolean} - True if any chain ID from `hasChains` is found in `checkChains`, otherwise false. + */ +const isChainIncluded = (chainList: number[], hasChains: number[]) => { + return hasChains.some((chainId) => chainList.includes(chainId)) +} diff --git a/packages/synapse-interface/package.json b/packages/synapse-interface/package.json index 135252e035..d3506689c8 100644 --- a/packages/synapse-interface/package.json +++ b/packages/synapse-interface/package.json @@ -1,6 +1,6 @@ { "name": "@synapsecns/synapse-interface", - "version": "0.10.6", + "version": "0.11.0", "private": true, "engines": { "node": ">=16.0.0" diff --git a/packages/synapse-interface/pages/index.tsx b/packages/synapse-interface/pages/index.tsx index aabf660aaa..818fb52ca6 100644 --- a/packages/synapse-interface/pages/index.tsx +++ b/packages/synapse-interface/pages/index.tsx @@ -3,7 +3,7 @@ import { Portfolio } from '@/components/Portfolio/Portfolio' import { LandingPageWrapper } from '@/components/layouts/LandingPageWrapper' import ReactGA from 'react-ga' import useSyncQueryParamsWithBridgeState from '@/utils/hooks/useSyncQueryParamsWithBridgeState' -import { EcotoneForkUpgradeBanner } from '@/components/Maintenance/Events/example/EcotoneForkUpgrade' +import { MaintenanceBanner } from '@/components/Maintenance/Events/template/MaintenanceEvent' // TODO: someone should add this to the .env, disable if blank, etc. // this is being added as a hotfix to assess user load on the synapse explorer api @@ -16,7 +16,7 @@ const Home = () => { return ( <> - +
{ const { address } = useAccount() @@ -522,10 +522,10 @@ const StateManagedBridge = () => { '-mt-4 fixed z-50 w-full h-full bg-opacity-50 bg-[#343036]' const { - isEcotoneForkUpgradePending, + isMaintenancePending, isCurrentChainDisabled, - EcotoneForkCountdownProgressBar, - } = useEcotoneForkCountdownProgress() + MaintenanceCountdownProgressBar, + } = useMaintenanceCountdownProgress() return (
@@ -564,7 +564,7 @@ const StateManagedBridge = () => { transition-all duration-100 transform rounded-md `} > - {EcotoneForkCountdownProgressBar} + {MaintenanceCountdownProgressBar}
@@ -602,6 +602,7 @@ const StateManagedBridge = () => { /> + {isMaintenancePending && } \ No newline at end of file diff --git a/packages/synapse-interface/public/thirteen.svg b/packages/synapse-interface/public/thirteen.svg deleted file mode 100644 index 8977c1bd12..0000000000 --- a/packages/synapse-interface/public/thirteen.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/synapse-interface/public/vercel.svg b/packages/synapse-interface/public/vercel.svg deleted file mode 100644 index d2f8422273..0000000000 --- a/packages/synapse-interface/public/vercel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From ddabd698901454c4c89d300ec41bb9df3a1c1a2d Mon Sep 17 00:00:00 2001 From: abtestingalpha <104046418+abtestingalpha@users.noreply.github.com> Date: Fri, 22 Mar 2024 12:05:14 -0400 Subject: [PATCH 02/10] Adds ETH to RFQ (#2351) --- packages/synapse-interface/utils/hooks/useStipEligibility.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/synapse-interface/utils/hooks/useStipEligibility.ts b/packages/synapse-interface/utils/hooks/useStipEligibility.ts index eca7eea08d..4cc3d65ec3 100644 --- a/packages/synapse-interface/utils/hooks/useStipEligibility.ts +++ b/packages/synapse-interface/utils/hooks/useStipEligibility.ts @@ -236,10 +236,10 @@ export const isRfqEligible = ( return ( (bridgeQuote.bridgeModuleName === BridgeModules.SYNAPSE_RFQ && - token.swapableType === 'USD' && + (token.swapableType === 'USD' || token.routeSymbol === 'ETH') && toChainId === ARBITRUM.id) || (bridgeQuote.bridgeModuleName === BridgeModules.SYNAPSE_RFQ && - token.swapableType === 'USD' && + (token.swapableType === 'USD' || token.routeSymbol === 'ETH') && fromChainId === ARBITRUM.id && toChainId === ETH.id) ) From 198dc4882a411d8dfeebcce6890d13f975a1b76f Mon Sep 17 00:00:00 2001 From: abtestingalpha Date: Fri, 22 Mar 2024 16:09:25 +0000 Subject: [PATCH 03/10] Publish - @synapsecns/synapse-interface@0.11.4 --- packages/synapse-interface/CHANGELOG.md | 8 ++++++++ packages/synapse-interface/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/synapse-interface/CHANGELOG.md b/packages/synapse-interface/CHANGELOG.md index c5f5c34ab1..ddf14ceb9a 100644 --- a/packages/synapse-interface/CHANGELOG.md +++ b/packages/synapse-interface/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.11.4](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.11.3...@synapsecns/synapse-interface@0.11.4) (2024-03-22) + +**Note:** Version bump only for package @synapsecns/synapse-interface + + + + + ## [0.11.3](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.11.2...@synapsecns/synapse-interface@0.11.3) (2024-03-21) **Note:** Version bump only for package @synapsecns/synapse-interface diff --git a/packages/synapse-interface/package.json b/packages/synapse-interface/package.json index c27e4b167b..34a00405a7 100644 --- a/packages/synapse-interface/package.json +++ b/packages/synapse-interface/package.json @@ -1,6 +1,6 @@ { "name": "@synapsecns/synapse-interface", - "version": "0.11.3", + "version": "0.11.4", "private": true, "engines": { "node": ">=16.0.0" From 8c9f38222efcb4a911b0dd0e3c7db9914bf2a544 Mon Sep 17 00:00:00 2001 From: abtestingalpha <104046418+abtestingalpha@users.noreply.github.com> Date: Fri, 22 Mar 2024 15:40:29 -0400 Subject: [PATCH 04/10] fix(widget): Fixes decimal input with no leading zeros, wallet cancel on send (#2354) * Fixes decimal input with no leading zeros, wallet cancel on send --- .../state/slices/bridgeTransaction/hooks.ts | 72 +++++++++---------- packages/widget/src/utils/isOnlyZeroes.ts | 11 ++- 2 files changed, 44 insertions(+), 39 deletions(-) diff --git a/packages/widget/src/state/slices/bridgeTransaction/hooks.ts b/packages/widget/src/state/slices/bridgeTransaction/hooks.ts index a3059a271e..341868d530 100644 --- a/packages/widget/src/state/slices/bridgeTransaction/hooks.ts +++ b/packages/widget/src/state/slices/bridgeTransaction/hooks.ts @@ -42,50 +42,46 @@ export const executeBridgeTxn = createAsyncThunk( signer: any synapseSDK: any }) => { - try { - const data = await synapseSDK.bridge( - destinationAddress, - originRouterAddress, - originChainId, - destinationChainId, - tokenAddress, - amount, - originQuery, - destQuery - ) + const data = await synapseSDK.bridge( + destinationAddress, + originRouterAddress, + originChainId, + destinationChainId, + tokenAddress, + amount, + originQuery, + destQuery + ) - const payload = - tokenAddress === ZeroAddress - ? { - data: data.data, - to: data.to, - value: amount, - } - : { - data: data.data, - to: data.to, - } + const payload = + tokenAddress === ZeroAddress + ? { + data: data.data, + to: data.to, + value: amount, + } + : { + data: data.data, + to: data.to, + } - const tx = await signer.sendTransaction(payload) + const tx = await signer.sendTransaction(payload) - const receipt = await tx.wait() + const receipt = await tx.wait() - const txHash = receipt?.hash ?? receipt?.transactionHash + const txHash = receipt?.hash ?? receipt?.transactionHash - const timestamp = getTimeMinutesFromNow(0) + const timestamp = getTimeMinutesFromNow(0) - return { - txHash, - bridgeModuleName, - parsedOriginAmount, - originTokenSymbol, - originChainId, - destinationChainId, - estimatedTime, - timestamp, - } - } catch (error) { - console.error('Error executing bridge: ', error) + return { + txHash, + bridgeModuleName, + parsedOriginAmount, + originTokenSymbol, + originChainId, + destinationChainId, + estimatedTime, + timestamp, } } ) diff --git a/packages/widget/src/utils/isOnlyZeroes.ts b/packages/widget/src/utils/isOnlyZeroes.ts index b32991e924..7db255403d 100644 --- a/packages/widget/src/utils/isOnlyZeroes.ts +++ b/packages/widget/src/utils/isOnlyZeroes.ts @@ -1,3 +1,12 @@ +/** + * This regex matches a string that either: + * 1. consists only of one or more '0' characters + * 2. consists of a single '0' followed by a '.' and zero or more '0' characters + * 3. consists solely of a '.' followed by one or more '0' characters + */ + export const isOnlyZeroes = (input: string): boolean => { - return /^(0+(\.0*)?|\.\d+)$/.test(input.trim()) + const regex = /^(0+|0?\.0+)$/ + + return regex.test(input.trim()) } From 1e0c559bd4235653a7a46266dbd203a5711b1238 Mon Sep 17 00:00:00 2001 From: abtestingalpha Date: Fri, 22 Mar 2024 19:44:26 +0000 Subject: [PATCH 05/10] Publish - @synapsecns/widget@0.1.10 --- packages/widget/CHANGELOG.md | 11 +++++++++++ packages/widget/package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/widget/CHANGELOG.md b/packages/widget/CHANGELOG.md index 915ba9ce8a..eacf87b32c 100644 --- a/packages/widget/CHANGELOG.md +++ b/packages/widget/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.10](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget@0.1.9...@synapsecns/widget@0.1.10) (2024-03-22) + + +### Bug Fixes + +* **widget:** Fixes decimal input with no leading zeros, wallet cancel on send ([#2354](https://github.com/synapsecns/sanguine/issues/2354)) ([8c9f382](https://github.com/synapsecns/sanguine/commit/8c9f38222efcb4a911b0dd0e3c7db9914bf2a544)) + + + + + ## [0.1.9](https://github.com/synapsecns/sanguine/compare/@synapsecns/widget@0.1.8...@synapsecns/widget@0.1.9) (2024-03-21) **Note:** Version bump only for package @synapsecns/widget diff --git a/packages/widget/package.json b/packages/widget/package.json index 6abaa2506a..a16dacb49b 100644 --- a/packages/widget/package.json +++ b/packages/widget/package.json @@ -1,7 +1,7 @@ { "name": "@synapsecns/widget", "description": "Widget library for interacting with the Synapse Protocol", - "version": "0.1.9", + "version": "0.1.10", "license": "MIT", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", From b1df3846b9f6b51b50dd391c814b61939252e669 Mon Sep 17 00:00:00 2001 From: trajan0x <83933037+trajan0x@users.noreply.github.com> Date: Sun, 24 Mar 2024 16:44:49 +0100 Subject: [PATCH 06/10] fix go workflow (#2358) Co-authored-by: Trajan0x --- .github/workflows/go.yml | 4 ++-- .github/workflows/goreleaser-actions.yml | 2 +- .github/workflows/scan.yml | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 03a7b5b0e7..a32e9927da 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -49,7 +49,7 @@ jobs: - uses: docker://ghcr.io/synapsecns/sanguine/git-changes-action:latest id: filter_go with: - github_token: ${{ secrets.WORKFLOW_PAT }} + github_token: ${{ secrets.WORKFLOW_PAT || secrets.GITHUB_TOKEN }} timeout: '10m' - name: Check For Solidity Changes @@ -349,7 +349,7 @@ jobs: args: --timeout=60m env: # GitHub token for annotations (optional) - GITHUB_TOKEN: ${{ secrets.WORKFLOW_PAT }} + GITHUB_TOKEN: ${{ secrets.WORKFLOW_PAT || secrets.GITHUB_TOKEN }} GOMEMLIMIT: 6GiB GOGC: -1 diff --git a/.github/workflows/goreleaser-actions.yml b/.github/workflows/goreleaser-actions.yml index e248f41555..e5c1b0df71 100644 --- a/.github/workflows/goreleaser-actions.yml +++ b/.github/workflows/goreleaser-actions.yml @@ -100,7 +100,7 @@ jobs: - uses: docker://ghcr.io/synapsecns/sanguine/git-changes-action:latest id: filter_go with: - github_token: ${{ secrets.WORKFLOW_PAT }} + github_token: ${{ secrets.WORKFLOW_PAT || secrets.GITHUB_TOKEN }} - id: length run: | diff --git a/.github/workflows/scan.yml b/.github/workflows/scan.yml index 30e89afdba..fccfac5350 100644 --- a/.github/workflows/scan.yml +++ b/.github/workflows/scan.yml @@ -12,7 +12,8 @@ jobs: sonarcloud: name: SonarCloud runs-on: ubuntu-latest -# these are pretty disruptive + if: github.repository_owner == 'synapsecns' + # these are pretty disruptive # permissions: # contents: write # pull-requests: write From fe868ccda7608ead617ea1efa42c02b5ca74e700 Mon Sep 17 00:00:00 2001 From: bigboydiamonds <57741810+bigboydiamonds@users.noreply.github.com> Date: Mon, 25 Mar 2024 13:52:04 -0700 Subject: [PATCH 07/10] feat(synapse-interface): link destination address in transaction (#2353) * Add destinationAddress prop to pendingBridgeTransaction * Add destinationAddress prop to _TransactionDetails * Use destinationAddress to determine dest explorer link * Rm log * Fix destination address in historical tx * Improve address comparison * Destination address hover --- .../components/Activity/Activity.tsx | 2 +- .../Transaction/components/Completed.tsx | 21 +++++++++++-------- .../components/_Transaction/_Transaction.tsx | 4 +++- .../components/_Transaction/_Transactions.tsx | 1 + .../pages/state-managed-bridge/index.tsx | 1 + .../slices/_transactions/reducer.ts | 2 ++ .../slices/transactions/actions.ts | 2 ++ .../utils/hooks/use_TransactionsListener.ts | 1 + 8 files changed, 23 insertions(+), 11 deletions(-) diff --git a/packages/synapse-interface/components/Activity/Activity.tsx b/packages/synapse-interface/components/Activity/Activity.tsx index f4c135cd0b..4e3e9aea67 100644 --- a/packages/synapse-interface/components/Activity/Activity.tsx +++ b/packages/synapse-interface/components/Activity/Activity.tsx @@ -102,7 +102,7 @@ const renderTransaction = ( {isDestinationValid && !isDestinationSender && (
to {shortenAddress(destinationAddress)}
)} {isToday ? ( -
- Today -
+
Today
) : ( -
- {formattedTime ? formattedTime : 'Completed'} -
+
{formattedTime ? formattedTime : 'Completed'}
)}
) diff --git a/packages/synapse-interface/components/_Transaction/_Transaction.tsx b/packages/synapse-interface/components/_Transaction/_Transaction.tsx index 506493e69d..e7f231f32c 100644 --- a/packages/synapse-interface/components/_Transaction/_Transaction.tsx +++ b/packages/synapse-interface/components/_Transaction/_Transaction.tsx @@ -20,6 +20,7 @@ import { useIsTxReverted } from './helpers/useIsTxReverted' interface _TransactionProps { connectedAddress: string + destinationAddress: Address | null originValue: number originChain: Chain originToken: Token @@ -37,6 +38,7 @@ interface _TransactionProps { /** TODO: Update naming after refactoring existing Activity / Transaction flow */ export const _Transaction = ({ connectedAddress, + destinationAddress, originValue, originChain, originToken, @@ -62,7 +64,7 @@ export const _Transaction = ({ ) const [destExplorerAddressLink, destExplorerName] = getExplorerAddressLink( destinationChain?.id, - connectedAddress + destinationAddress ?? connectedAddress ) const { diff --git a/packages/synapse-interface/components/_Transaction/_Transactions.tsx b/packages/synapse-interface/components/_Transaction/_Transactions.tsx index 100e81461e..89119cb8fe 100644 --- a/packages/synapse-interface/components/_Transaction/_Transactions.tsx +++ b/packages/synapse-interface/components/_Transaction/_Transactions.tsx @@ -46,6 +46,7 @@ export const _Transactions = ({ <_Transaction key={tx.timestamp} connectedAddress={connectedAddress} + destinationAddress={tx.destinationAddress} originValue={Number(tx.originValue)} originChain={originChain} originToken={originToken} diff --git a/packages/synapse-interface/pages/state-managed-bridge/index.tsx b/packages/synapse-interface/pages/state-managed-bridge/index.tsx index 576c4d1af6..5f0c33caee 100644 --- a/packages/synapse-interface/pages/state-managed-bridge/index.tsx +++ b/packages/synapse-interface/pages/state-managed-bridge/index.tsx @@ -372,6 +372,7 @@ const StateManagedBridge = () => { isSubmitted: false, estimatedTime: bridgeQuote.estimatedTime, bridgeModuleName: bridgeQuote.bridgeModuleName, + destinationAddress: destinationAddress, }) ) try { diff --git a/packages/synapse-interface/slices/_transactions/reducer.ts b/packages/synapse-interface/slices/_transactions/reducer.ts index 221825bd59..2225c8ead0 100644 --- a/packages/synapse-interface/slices/_transactions/reducer.ts +++ b/packages/synapse-interface/slices/_transactions/reducer.ts @@ -1,10 +1,12 @@ import { PayloadAction, createSlice } from '@reduxjs/toolkit' +import { Address } from 'viem' import { Chain, Token } from '@/utils/types' /** TODO: Rename entire slice once done refactoring prior Activity flow */ export interface _TransactionDetails { address: string + destinationAddress: Address | null originChain: Chain originToken: Token destinationChain: Chain diff --git a/packages/synapse-interface/slices/transactions/actions.ts b/packages/synapse-interface/slices/transactions/actions.ts index 042f25fe06..cb4ef22cc7 100644 --- a/packages/synapse-interface/slices/transactions/actions.ts +++ b/packages/synapse-interface/slices/transactions/actions.ts @@ -1,4 +1,5 @@ import { createAction } from '@reduxjs/toolkit' +import { Address } from 'viem' import { BridgeTransaction } from '../api/generated' import { Chain, Token } from '@/utils/types' @@ -15,6 +16,7 @@ export interface PendingBridgeTransaction { isSubmitted: boolean estimatedTime: number bridgeModuleName: string + destinationAddress: Address | null } export const addPendingBridgeTransaction = diff --git a/packages/synapse-interface/utils/hooks/use_TransactionsListener.ts b/packages/synapse-interface/utils/hooks/use_TransactionsListener.ts index 4e429fee0a..b82d6ca8fe 100644 --- a/packages/synapse-interface/utils/hooks/use_TransactionsListener.ts +++ b/packages/synapse-interface/utils/hooks/use_TransactionsListener.ts @@ -42,6 +42,7 @@ export const use_TransactionsListener = () => { dispatch( addTransaction({ address, + destinationAddress: tx.destinationAddress, originTxHash: tx.transactionHash, originValue: tx.originValue, originChain: tx.originChain, From 0e6d76cacfae2db432e48abe7d50f1e8010da2e0 Mon Sep 17 00:00:00 2001 From: bigboydiamonds Date: Mon, 25 Mar 2024 20:56:13 +0000 Subject: [PATCH 08/10] Publish - @synapsecns/synapse-interface@0.12.0 --- packages/synapse-interface/CHANGELOG.md | 11 +++++++++++ packages/synapse-interface/package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/synapse-interface/CHANGELOG.md b/packages/synapse-interface/CHANGELOG.md index ddf14ceb9a..99400cd67e 100644 --- a/packages/synapse-interface/CHANGELOG.md +++ b/packages/synapse-interface/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.12.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.11.4...@synapsecns/synapse-interface@0.12.0) (2024-03-25) + + +### Features + +* **synapse-interface:** link destination address in transaction ([#2353](https://github.com/synapsecns/sanguine/issues/2353)) ([fe868cc](https://github.com/synapsecns/sanguine/commit/fe868ccda7608ead617ea1efa42c02b5ca74e700)) + + + + + ## [0.11.4](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.11.3...@synapsecns/synapse-interface@0.11.4) (2024-03-22) **Note:** Version bump only for package @synapsecns/synapse-interface diff --git a/packages/synapse-interface/package.json b/packages/synapse-interface/package.json index 34a00405a7..e028859069 100644 --- a/packages/synapse-interface/package.json +++ b/packages/synapse-interface/package.json @@ -1,6 +1,6 @@ { "name": "@synapsecns/synapse-interface", - "version": "0.11.4", + "version": "0.12.0", "private": true, "engines": { "node": ">=16.0.0" From 8a8258999913dac6ff9842725f3605e98e1eb04c Mon Sep 17 00:00:00 2001 From: abtestingalpha <104046418+abtestingalpha@users.noreply.github.com> Date: Tue, 26 Mar 2024 15:29:24 -0400 Subject: [PATCH 09/10] Banner for pausing USDB/WETH on Blast (#2361) --- .../components/Maintenance/AnnouncementBanner.tsx | 4 ++-- .../components/StateManagedSwap/SwapExchangeRateInfo.tsx | 2 +- packages/synapse-interface/pages/index.tsx | 7 +++++++ packages/synapse-interface/pages/swap/index.tsx | 7 +++++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/synapse-interface/components/Maintenance/AnnouncementBanner.tsx b/packages/synapse-interface/components/Maintenance/AnnouncementBanner.tsx index 046cc0426c..b9dcb30677 100644 --- a/packages/synapse-interface/components/Maintenance/AnnouncementBanner.tsx +++ b/packages/synapse-interface/components/Maintenance/AnnouncementBanner.tsx @@ -54,10 +54,10 @@ export const AnnouncementBanner = ({ if (!showBanner || !hasMounted || !isStarted || isComplete) return null return ( -
+