Skip to content

Commit

Permalink
Merge branch 'master' into fe/bridgeQuote-state
Browse files Browse the repository at this point in the history
  • Loading branch information
abtestingalpha committed Aug 14, 2024
2 parents d23cb0a + edaffaf commit 8d2d3f5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 44 deletions.
22 changes: 22 additions & 0 deletions packages/synapse-interface/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.34.4](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-08-14)


### Bug Fixes

* **synapse-interface:** don't adjust `payload.value` that SDK already handles ([#3015](https://github.com/synapsecns/sanguine/issues/3015)) ([77f5863](https://github.com/synapsecns/sanguine/commit/77f58637d948c981b9e26f51b2137fd2f1e0578f))





## [0.34.3](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-08-13)


### Bug Fixes

* **synapse-interface:** disable bridge ui pending wallet ([#3014](https://github.com/synapsecns/sanguine/issues/3014)) ([fbe4b60](https://github.com/synapsecns/sanguine/commit/fbe4b60b952b52b8f5cbec01eae8a35f100caf81))





## [0.34.2](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-08-13)

**Note:** Version bump only for package @synapsecns/synapse-interface
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.34.2",
"version": "0.34.4",
"private": true,
"engines": {
"node": ">=18.18.0"
Expand Down
16 changes: 1 addition & 15 deletions packages/synapse-interface/pages/state-managed-bridge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ const StateManagedBridge = () => {
? destinationAddress
: address

const data = await synapseSDK.bridge(
const payload = await synapseSDK.bridge(
toAddress,
bridgeQuote.routerAddress,
fromChainId,
Expand All @@ -300,20 +300,6 @@ const StateManagedBridge = () => {
bridgeQuote.destQuery
)

const payload =
fromToken?.addresses[fromChainId as keyof Token['addresses']] ===
zeroAddress ||
fromToken?.addresses[fromChainId as keyof Token['addresses']] === ''
? {
data: data.data,
to: data.to,
value: stringToBigInt(
debouncedFromValue,
fromToken?.decimals[fromChainId]
),
}
: data

/** Setting custom gas limit for only Polygon transactions */
let gasEstimate = undefined

Expand Down
16 changes: 1 addition & 15 deletions packages/synapse-interface/pages/swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,28 +278,14 @@ const StateManagedSwap = () => {
chainId: swapChainId,
})

const data = await synapseSDK.swap(
const payload = await synapseSDK.swap(
swapChainId,
address,
swapFromToken.addresses[swapChainId],
stringToBigInt(swapFromValue, swapFromToken.decimals[swapChainId]),
swapQuote.quote
)

const payload =
swapFromToken.addresses[swapChainId as keyof Token['addresses']] ===
zeroAddress ||
swapFromToken.addresses[swapChainId as keyof Token['addresses']] === ''
? {
data: data.data,
to: data.to,
value: stringToBigInt(
swapFromValue,
swapFromToken.decimals[swapChainId]
),
}
: data

const tx = await wallet.sendTransaction(payload)

const originChainName = CHAINS_BY_ID[swapChainId]?.name
Expand Down
14 changes: 1 addition & 13 deletions packages/synapse-interface/utils/hooks/useGasEstimator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const getBridgePayload = async (
if (!bridgeQuote) return null

try {
const data = await synapseSDK.bridge(
const payload = await synapseSDK.bridge(
address,
bridgeQuote.routerAddress,
fromChainId,
Expand All @@ -194,18 +194,6 @@ const getBridgePayload = async (
bridgeQuote.originQuery,
bridgeQuote.destQuery
)

const payload =
fromToken?.addresses[fromChainId as keyof Token['addresses']] ===
zeroAddress ||
fromToken?.addresses[fromChainId as keyof Token['addresses']] === ''
? {
data: data.data,
to: data.to,
value: stringToBigInt(amount, fromToken?.decimals[fromChainId]),
}
: data

return payload
} catch (error) {
console.error('getBridgePayload: ', error)
Expand Down

0 comments on commit 8d2d3f5

Please sign in to comment.