Skip to content

Commit

Permalink
Merge branch 'master' into feat/communication
Browse files Browse the repository at this point in the history
  • Loading branch information
trajan0x committed Mar 27, 2024
2 parents b69d0ea + 970d5a9 commit ba2ffa7
Show file tree
Hide file tree
Showing 22 changed files with 131 additions and 61 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions packages/synapse-interface/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,33 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.12.1](https://github.com/synapsecns/sanguine/compare/@synapsecns/synapse-interface@0.12.0...@synapsecns/synapse-interface@0.12.1) (2024-03-26)

**Note:** Version bump only for package @synapsecns/synapse-interface





# [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





## [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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const renderTransaction = (
<Transaction
key={transaction?.kappa}
connectedAddress={viewingAddress}
destinationAddress={transaction?.fromInfo?.address as Address}
destinationAddress={transaction?.toInfo?.address as Address}
startedTimestamp={transaction?.fromInfo?.time}
completedTimestamp={transaction?.toInfo?.time}
transactionHash={transaction?.fromInfo?.txnHash}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ export const AnnouncementBanner = ({
if (!showBanner || !hasMounted || !isStarted || isComplete) return null

return (
<div className="flex items-center justify-center mx-auto lg:flex-row text-sm text-left bg-gradient-to-r from-fuchsia-600/25 to-purple-600/25">
<div className="flex items-center justify-center mx-auto text-sm text-left lg:flex-row bg-gradient-to-r from-fuchsia-600/25 to-purple-600/25">
<div
id="banner-default"
className="flex items-center gap-4 px-4 py-2 w-full max-w-[1111px] text-primaryTextColor justify-between leading-normal"
className="flex items-center gap-4 px-4 py-2 w-full max-w-[1111px] text-primaryTextColor justify-center leading-normal"
role="alert"
>
{bannerContents}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Address } from 'viem'
import { shortenAddress } from '@/utils/shortenAddress'
import { convertUnixTimestampToMonthAndDate } from '@/utils/time'
import { isTimestampToday } from '@/utils/time'
import { isValidAddress } from '@/utils/isValidAddress'
import { isValidAddress, getValidAddress } from '@/utils/isValidAddress'

export const Completed = ({
transactionCompletedTime,
Expand All @@ -22,27 +22,30 @@ export const Completed = ({
const isToday: boolean = isTimestampToday(transactionCompletedTime)

const isDestinationSender: boolean =
String(connectedAddress) === String(destinationAddress)
getValidAddress(connectedAddress) === getValidAddress(destinationAddress)

const isDestinationValid: boolean = isValidAddress(destinationAddress)

return (
<div
data-test-id="completed"
className="flex flex-col text-right text-[#C2C2D6] gap-1 text-sm whitespace-nowrap"
onClick={handleExplorerClick}
className={`
flex flex-col text-right gap-1 text-sm whitespace-nowrap
${
isToday
? 'text-[#3BDD77] hover:underline cursor-pointer'
: 'text-[#C2C2D6] cursor-pointer hover:underline'
}
`}
>
{isDestinationValid && !isDestinationSender && (
<div>to {shortenAddress(destinationAddress)} </div>
)}
{isToday ? (
<div className="text-[#3BDD77] hover:underline cursor-pointer">
Today
</div>
<div>Today</div>
) : (
<div className="cursor-pointer hover:underline">
{formattedTime ? formattedTime : 'Completed'}
</div>
<div>{formattedTime ? formattedTime : 'Completed'}</div>
)}
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const SwapExchangeRateInfo = ({
{safeFromAmount != 0n ? (
<>
{formattedExchangeRate}{' '}
<span className="text-white">{toToken.symbol}</span>
<span className="text-white">{toToken?.symbol}</span>
</>
) : (
'—'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { useIsTxReverted } from './helpers/useIsTxReverted'

interface _TransactionProps {
connectedAddress: string
destinationAddress: Address | null
originValue: number
originChain: Chain
originToken: Token
Expand All @@ -37,6 +38,7 @@ interface _TransactionProps {
/** TODO: Update naming after refactoring existing Activity / Transaction flow */
export const _Transaction = ({
connectedAddress,
destinationAddress,
originValue,
originChain,
originToken,
Expand All @@ -62,7 +64,7 @@ export const _Transaction = ({
)
const [destExplorerAddressLink, destExplorerName] = getExplorerAddressLink(
destinationChain?.id,
connectedAddress
destinationAddress ?? connectedAddress
)

const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const _Transactions = ({
<_Transaction
key={tx.timestamp}
connectedAddress={connectedAddress}
destinationAddress={tx.destinationAddress}
originValue={Number(tx.originValue)}
originChain={originChain}
originToken={originToken}
Expand Down
2 changes: 1 addition & 1 deletion packages/synapse-interface/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@synapsecns/synapse-interface",
"version": "0.11.3",
"version": "0.12.1",
"private": true,
"engines": {
"node": ">=16.0.0"
Expand Down
7 changes: 7 additions & 0 deletions packages/synapse-interface/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { LandingPageWrapper } from '@/components/layouts/LandingPageWrapper'
import ReactGA from 'react-ga'
import useSyncQueryParamsWithBridgeState from '@/utils/hooks/useSyncQueryParamsWithBridgeState'
import { MaintenanceBanner } from '@/components/Maintenance/Events/template/MaintenanceEvent'
import { AnnouncementBanner } from '@/components/Maintenance/AnnouncementBanner'

// 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
Expand All @@ -22,6 +23,12 @@ const Home = () => {
data-test-id="bridge-page"
className="relative z-0 flex-1 h-full overflow-y-auto focus:outline-none"
>
<AnnouncementBanner
bannerId="2024-03-26-blast-bridge-pause"
bannerContents="Bridging USDB and WETH on Blast paused."
startDate={new Date(Date.UTC(2024, 2, 20, 20, 20, 0))}
endDate={new Date(Date.UTC(2026, 2, 20, 22, 0, 0))}
/>
<div className="flex flex-col-reverse justify-center gap-16 px-4 py-20 mx-auto lg:flex-row 2xl:w-3/4 sm:mt-6 sm:px-8 md:px-12">
<Portfolio />
<StateManagedBridge />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ const StateManagedBridge = () => {
isSubmitted: false,
estimatedTime: bridgeQuote.estimatedTime,
bridgeModuleName: bridgeQuote.bridgeModuleName,
destinationAddress: destinationAddress,
})
)
try {
Expand Down
7 changes: 7 additions & 0 deletions packages/synapse-interface/pages/swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import { SwapToTokenListOverlay } from '@/components/StateManagedSwap/SwapToToke
import { LandingPageWrapper } from '@/components/layouts/LandingPageWrapper'
import useSyncQueryParamsWithSwapState from '@/utils/hooks/useSyncQueryParamsWithSwapState'
import { isTransactionReceiptError } from '@/utils/isTransactionReceiptError'
import { AnnouncementBanner } from '@/components/Maintenance/AnnouncementBanner'

const StateManagedSwap = () => {
const { address } = useAccount()
Expand Down Expand Up @@ -359,6 +360,12 @@ const StateManagedSwap = () => {

return (
<LandingPageWrapper>
<AnnouncementBanner
bannerId="2024-03-26-blast-swap-pause"
bannerContents="Swapping on Blast paused."
startDate={new Date(Date.UTC(2024, 2, 20, 20, 20, 0))}
endDate={new Date(Date.UTC(2026, 2, 20, 22, 0, 0))}
/>
<div className="flex justify-center px-4 py-16 mx-auto lg:mx-0">
<div className="flex flex-col">
<div className="flex items-center justify-between">
Expand Down
2 changes: 2 additions & 0 deletions packages/synapse-interface/slices/_transactions/reducer.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions packages/synapse-interface/slices/transactions/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createAction } from '@reduxjs/toolkit'
import { Address } from 'viem'

import { BridgeTransaction } from '../api/generated'
import { Chain, Token } from '@/utils/types'
Expand All @@ -15,6 +16,7 @@ export interface PendingBridgeTransaction {
isSubmitted: boolean
estimatedTime: number
bridgeModuleName: string
destinationAddress: Address | null
}

export const addPendingBridgeTransaction =
Expand Down
4 changes: 2 additions & 2 deletions packages/synapse-interface/utils/hooks/useStipEligibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const use_TransactionsListener = () => {
dispatch(
addTransaction({
address,
destinationAddress: tx.destinationAddress,
originTxHash: tx.transactionHash,
originValue: tx.originValue,
originChain: tx.originChain,
Expand Down
11 changes: 11 additions & 0 deletions packages/widget/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/widget/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Loading

0 comments on commit ba2ffa7

Please sign in to comment.