Skip to content
Open
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
5 changes: 5 additions & 0 deletions .changeset/sour-items-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@exactly/mobile": patch
---

🐛 avoid chain mismatch on bridge transfer
5 changes: 3 additions & 2 deletions src/components/add-funds/Bridge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -421,16 +421,17 @@ export default function Bridge() {
mutationFn: async () => {
if (!senderAddress || !source || !account) throw new Error("missing transfer context");
if (!isSameChain) throw new Error("transfer mutation invoked for different chains");
await switchChain(senderConfig, { chainId: source.chain });
setBridgeStatus(t("Submitting transfer transaction..."));
const recipient = getAddress(account);
let hash: Hex;
if (isNativeSource) {
hash = await sendTx({ chainId: source.chain, to: recipient, value: sourceAmount });
} else {
if (!transferSimulation) throw new Error("missing transfer simulation");
hash = await transfer(transferSimulation.request);
hash = await transfer({ ...transferSimulation.request, chainId: source.chain });
}
await waitForTransactionReceipt(senderConfig, { hash });
await waitForTransactionReceipt(senderConfig, { hash, chainId: source.chain });
setBridgeStatus(t("Transfer transaction submitted"));
},
onSuccess: async () => {
Expand Down
Loading