Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
1ef8df6
chore: add assetId, aggregators, occurrences to BridgeToken type
micaelae Jul 14, 2025
e406715
fix: select default destToken instead of setting it in bridge state
micaelae Jul 14, 2025
d8e72a1
fix: unset toToken when toChainId changes
micaelae Jul 14, 2025
5e08e4b
fix: ZeroAddress as default destTokenAddress
micaelae Jul 14, 2025
ee383d7
fix: lint error
micaelae Jul 14, 2025
2578d90
refactor: set tokens based on query params using useBridgeQueryParams…
micaelae Jul 14, 2025
f8e99a4
fix: lint errors
micaelae Jul 14, 2025
a09706f
fix: unit tests
micaelae Jul 14, 2025
fb108b3
fix: check if from/to tokens are defined before comparison
micaelae Jul 14, 2025
5e060cf
chore: set BridgeToken.chainId type in caip format
micaelae Jul 14, 2025
0ded627
fix: dest token is unset when src token is selected
micaelae Jul 14, 2025
34441fa
fix: assetId condition
micaelae Jul 14, 2025
527943b
Merge branch 'swaps43186-swap-to-native' into swaps2601-deep-link
micaelae Jul 14, 2025
3123d14
fix: unit tests
micaelae Jul 14, 2025
9422431
fix: undo type change
micaelae Jul 14, 2025
49880d7
fix: unit tests
micaelae Jul 15, 2025
bc293bd
fix: unit tests
micaelae Jul 15, 2025
dc2c43b
Merge branch 'swaps43186-swap-to-native' into swaps2601-deep-link
micaelae Jul 15, 2025
a016da2
fix: unit test
micaelae Jul 15, 2025
69e1477
fix: e2e metrics test
micaelae Jul 15, 2025
3f595ab
fix: rm dest events
micaelae Jul 15, 2025
1757523
fix: undo e2e test change
micaelae Jul 15, 2025
e9a2d69
fix: set toToken native address
micaelae Jul 15, 2025
77e315e
Merge branch 'main' into swaps43186-swap-to-native
micaelae Jul 15, 2025
f5a866c
Merge branch 'swaps43186-swap-to-native' into swaps2601-deep-link
micaelae Jul 15, 2025
2d9ec23
chore: remove portfolio fallback
micaelae Jul 15, 2025
3118712
Merge branch 'main' into swaps2601-deep-link
micaelae Jul 15, 2025
d39f7cb
fix: unused imports
micaelae Jul 14, 2025
78524e1
chore: BridgeQueryParams
micaelae Jul 14, 2025
65d2f6a
chore: remove portfolio fallback
micaelae Jul 15, 2025
7ef3462
refactor: setFromChain action
micaelae Jul 15, 2025
69a46a5
chore: use token-api v3 spot-prices for EVM
micaelae Jul 15, 2025
5392413
chore: useBridgeQueryParams
micaelae Jul 15, 2025
71d90b5
chore: remove response caching for fetchAssetMetadata
micaelae Jul 15, 2025
e87f649
chore: replace token query param with from
micaelae Jul 16, 2025
cf5b5b9
fix: remove legacy swap feature-toggled route
micaelae Jul 16, 2025
b83d3a4
fix: fetch EVM balances after setting fromToken from url
micaelae Jul 16, 2025
e93f61d
chore: fetchAssetMetadataForAssetIds util
micaelae Jul 16, 2025
d5445f4
Merge branch 'main' into swaps2601-rm-portfolio-fallback
micaelae Jul 16, 2025
52838b8
fix: remove legacy swap feature-toggled route
micaelae Jul 16, 2025
1bda828
Merge branch 'swaps2601-rm-portfolio-fallback' into swaps2601-deep-link
micaelae Jul 16, 2025
a7af5ca
chore: rm e2e tests
micaelae Jul 16, 2025
23af816
chore: reduce fetchAssetMetadata calls
micaelae Jul 16, 2025
358dc31
fix: pass abort signal to spot-prices and token scan fetch calls
micaelae Jul 16, 2025
6efe464
fix: lint errors
micaelae Jul 16, 2025
983dba7
fix: unit tests
micaelae Jul 16, 2025
794bada
Merge branch 'swaps2601-rm-portfolio-fallback' into swaps2601-deep-link
micaelae Jul 16, 2025
cce912a
fix: lint errors
micaelae Jul 16, 2025
69d9431
Merge branch 'main' into swaps2601-deep-link
micaelae Jul 16, 2025
0292b74
chore: make signal optional in fetchTokenExchangeRates
micaelae Jul 16, 2025
1edd919
fix: rm hook tests
micaelae Jul 16, 2025
3e3518e
fix: lowercase hex addresses in toAssetId
micaelae Jul 16, 2025
8e67d88
chore: bump bridge controllers
micaelae Jul 16, 2025
d37b51c
Merge branch 'swaps2601-bump-controllers' into swaps2601-deep-link
micaelae Jul 16, 2025
5d9ce2e
chore: dedupe controller-utils package
micaelae Jul 16, 2025
4a4c91d
Merge branch 'swaps2601-bump-controllers' into swaps2601-deep-link
micaelae Jul 16, 2025
a18bbfc
Update LavaMoat policies
metamaskbot Jul 16, 2025
9a3af29
fix: asset-utils unit test
micaelae Jul 16, 2025
821747b
fix: bridge reducer tests
micaelae Jul 16, 2025
b8b4d9c
fix: exchange rate util
micaelae Jul 16, 2025
ff6a17d
Merge branch 'swaps2601-bump-controllers' into swaps2601-deep-link
micaelae Jul 16, 2025
0e6bcbd
test: fetchAssetMetadataForAssetIds
micaelae Jul 16, 2025
e9f1cfa
Merge branch 'main' into swaps2601-bump-controllers
micaelae Jul 16, 2025
40c06cd
Merge branch 'swaps2601-bump-controllers' into swaps2601-deep-link
micaelae Jul 16, 2025
0fb10da
Merge branch 'main' into swaps2601-deep-link
micaelae Jul 16, 2025
b16e260
wip
micaelae Jul 16, 2025
c601428
Revert "wip"
micaelae Jul 16, 2025
1e1b8b4
fix: lint errors
micaelae Jul 16, 2025
4a33088
fix: useBridging unit tests
micaelae Jul 16, 2025
ddefc32
Merge branch 'main' into swaps2601-deep-link
micaelae Jul 16, 2025
4ba14af
Merge branch 'main' into swaps2601-deep-link
micaelae Jul 17, 2025
186c981
Merge branch 'main' into swaps2601-deep-link
micaelae Jul 17, 2025
41f355d
fix: clear query params after parsing
micaelae Jul 16, 2025
831fe91
Revert "Update LavaMoat policies"
micaelae Jul 17, 2025
fa7ce13
Revert "chore: dedupe controller-utils package"
micaelae Jul 17, 2025
acf2eb8
Revert "chore: bump bridge controllers"
micaelae Jul 17, 2025
8995e77
chore: clean up hook
micaelae Jul 17, 2025
8087755
fix: lint errors
micaelae Jul 17, 2025
54907d9
test: return store from renderHookWithProvider
micaelae Jul 17, 2025
5104072
test: useBridgeQueryParams hook unit tests
micaelae Jul 17, 2025
0e4aa3e
fix: add separate abort controller for dest exchange rates
micaelae Jul 17, 2025
09df9f2
fix: stale cleanup closure
micaelae Jul 17, 2025
16060d3
fix: use isStrictHexString in toAssetId
micaelae Jul 17, 2025
0ded87c
fix: fetchAssetMetadata abort
micaelae Jul 17, 2025
b24a2e9
Merge branch 'main' into swaps2601-deep-link
micaelae Jul 17, 2025
bc75aea
chore: add more unit tests
micaelae Jul 17, 2025
ef28ceb
Merge branch 'main' into swaps2601-deep-link
micaelae Jul 17, 2025
0f043b8
Merge branch 'main' into swaps2601-deep-link
micaelae Jul 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: set toToken native address
  • Loading branch information
micaelae committed Jul 15, 2025
commit e9a2d69c8077d262dbd9a67fa409565fcd7cdd24
11 changes: 10 additions & 1 deletion ui/ducks/bridge/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
isSolanaChainId,
formatChainIdToHex,
isNativeAddress,
getNativeAssetForChainId,
} from '@metamask/bridge-controller';
import { getAssetImageUrl, toAssetId } from '../../../shared/lib/asset-utils';
import { MULTICHAIN_TOKEN_IMAGE_MAP } from '../../../shared/constants/multichain/networks';
Expand Down Expand Up @@ -117,7 +118,15 @@ const bridgeSlice = createSlice({
}
},
setToToken: (state, { payload }: TokenPayload) => {
state.toToken = toBridgeToken(payload);
const toToken = toBridgeToken(payload);
state.toToken = toToken
? {
...toToken,
address:
toToken.address ||
getNativeAssetForChainId(toToken.chainId)?.address,
}
: toToken;
},
setFromTokenInputValue: (state, action) => {
state.fromTokenInputValue = action.payload;
Expand Down
6 changes: 1 addition & 5 deletions ui/pages/bridge/prepare/prepare-bridge-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import classnames from 'classnames';
import { debounce } from 'lodash';
import { useHistory, useLocation } from 'react-router-dom';
import { type TokenListMap } from '@metamask/assets-controllers';
import { ethers } from 'ethers';
import { toChecksumAddress, zeroAddress } from 'ethereumjs-util';
import {
formatChainIdToCaip,
Expand Down Expand Up @@ -389,10 +388,7 @@ const PrepareBridgePage = () => {
const quoteParams: Partial<GenericQuoteRequest> = useMemo(
() => ({
srcTokenAddress: fromToken?.address,
destTokenAddress:
toToken && isNativeAddress(toToken.address)
? ethers.constants.AddressZero
: toToken?.address,
destTokenAddress: toToken?.address,
srcTokenAmount:
fromAmount && fromToken?.decimals
? calcTokenValue(
Expand Down
Loading