Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions packages/bridge-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add `MONAD` network support ([#6828](https://github.com/MetaMask/core/pull/6828))
- Add `MONAD` into constants `ALLOWED_BRIDGE_CHAIN_IDS`, `SWAPS_TOKEN_OBJECT` and `NETWORK_TO_NAME_MAP`
- Implement `fetchServerEvents` util that parses server events and parses them into JSON ([#6892](https://github.com/MetaMask/core/pull/6892))

### Changed

- **BREAKING:** Add BitcoinTradeData to QuoteResponse validation ([#6892](https://github.com/MetaMask/core/pull/6892))
- Replace `fetchEventSource` with `fetchServerEvents` ([#6892](https://github.com/MetaMask/core/pull/6892))

### Removed

- Removed dependency on `@microsoft/fetch-event-source` at `^2.0.1` ([#6892](https://github.com/MetaMask/core/pull/6892))

## [53.0.0]

Expand Down
1 change: 0 additions & 1 deletion packages/bridge-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"@metamask/multichain-network-controller": "^1.0.1",
"@metamask/polling-controller": "^14.0.1",
"@metamask/utils": "^11.8.1",
"@microsoft/fetch-event-source": "^2.0.1",
"bignumber.js": "^9.1.2",
"reselect": "^5.1.1",
"uuid": "^8.3.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`BridgeController SSE should publish validation failures 3`] = `
exports[`BridgeController SSE should publish validation failures 4`] = `
Array [
Array [
"Unified SwapBridge Quotes Failed Validation",
Expand All @@ -24,6 +24,20 @@ Array [
"token_address_source": "eip155:1/slip44:60",
},
],
Array [
"Unified SwapBridge Quotes Failed Validation",
Object {
"action_type": "swapbridge-v1",
"chain_id_destination": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"chain_id_source": "eip155:1",
"failures": Array [
"unknown|unknown",
],
"refresh_count": 1,
"token_address_destination": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:123d1",
"token_address_source": "eip155:1/slip44:60",
},
],
Array [
"Unified SwapBridge Quotes Failed Validation",
Object {
Expand All @@ -33,7 +47,7 @@ Array [
"failures": Array [
"unknown|quote",
],
"refresh_count": 2,
"refresh_count": 1,
"token_address_destination": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:123d1",
"token_address_source": "eip155:1/slip44:60",
},
Expand Down Expand Up @@ -137,6 +151,114 @@ Array [
]
`;

exports[`BridgeController SSE should rethrow error from server 1`] = `
Object {
"assetExchangeRates": Object {
"eip155:10/erc20:0x1f9840a85d5af5bf1d1762f925bdaddc4201f984": Object {
"exchangeRate": undefined,
"usdExchangeRate": "100",
},
},
"minimumBalanceForRentExemptionInLamports": "0",
"quoteFetchError": null,
"quoteRequest": Object {
"destChainId": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"destTokenAddress": "123d1",
"destWalletAddress": "SolanaWalletAddres1234",
"insufficientBal": false,
"slippage": 0.5,
"srcChainId": "0x1",
"srcTokenAddress": "0x0000000000000000000000000000000000000000",
"srcTokenAmount": "1000000000000000000",
"walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294",
},
"quotes": Array [],
"quotesInitialLoadTime": null,
"quotesLoadingStatus": 0,
"quotesRefreshCount": 0,
}
`;

exports[`BridgeController SSE should rethrow error from server 3`] = `
Array [
Array [
"Unified SwapBridge Input Changed",
Object {
"action_type": "swapbridge-v1",
"input": "chain_source",
"input_value": "eip155:1",
},
],
Array [
"Unified SwapBridge Input Changed",
Object {
"action_type": "swapbridge-v1",
"input": "chain_destination",
"input_value": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
},
],
Array [
"Unified SwapBridge Input Changed",
Object {
"action_type": "swapbridge-v1",
"input": "token_destination",
"input_value": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:123d1",
},
],
Array [
"Unified SwapBridge Input Changed",
Object {
"action_type": "swapbridge-v1",
"input": "slippage",
"input_value": 0.5,
},
],
Array [
"Unified SwapBridge Quotes Requested",
Object {
"action_type": "swapbridge-v1",
"chain_id_destination": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"chain_id_source": "eip155:1",
"custom_slippage": true,
"has_sufficient_funds": true,
"is_hardware_wallet": false,
"security_warnings": Array [],
"slippage_limit": 0.5,
"stx_enabled": true,
"swap_type": "crosschain",
"token_address_destination": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:123d1",
"token_address_source": "eip155:1/slip44:60",
"token_symbol_destination": "USDC",
"token_symbol_source": "ETH",
"usd_amount_source": 100,
"warnings": Array [],
},
],
Array [
"Unified SwapBridge Quotes Error",
Object {
"action_type": "swapbridge-v1",
"chain_id_destination": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"chain_id_source": "eip155:1",
"custom_slippage": true,
"error_message": "Bridge-api error: timeout from server",
"has_sufficient_funds": true,
"is_hardware_wallet": false,
"security_warnings": Array [],
"slippage_limit": 0.5,
"stx_enabled": true,
"swap_type": "crosschain",
"token_address_destination": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:123d1",
"token_address_source": "eip155:1/slip44:60",
"token_symbol_destination": "USDC",
"token_symbol_source": "ETH",
"usd_amount_source": 100,
"warnings": Array [],
},
],
]
`;

exports[`BridgeController SSE should trigger quote polling if request is valid 1`] = `
Object {
"assetExchangeRates": Object {
Expand Down
Loading
Loading