Skip to content

Commit

Permalink
Cross chain proxy info and error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Robiquet committed Feb 7, 2024
1 parent 3ae81c0 commit e2c7146
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/hooks/useCrossChainExtrinsic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ export const useCrossChainExtrinsic = <T>(
if (extrinsic && proxy?.enabled && proxy?.address) {
console.info("Proxying cross chain transaction");
extrinsic = sdk.api.tx.proxy.proxy(proxy?.address, null, extrinsic);
notifications.pushNotification(
"Proxies are not supported for cross chain transactions",
{
type: "Info",
},
);
}

if (!signer || !extrinsic || !sourceChainApi || !destinationChainApi)
Expand Down Expand Up @@ -116,7 +122,10 @@ export const useCrossChainExtrinsic = <T>(
},
}),
IOForeignAssetId.is(fee?.assetId) ? fee?.assetId.ForeignAsset : undefined,
).catch(() => {
).catch((error) => {
notifications.pushNotification(error?.toString() ?? "Unknown Error", {
type: "Error",
});
setIsLoading(false);
});
};
Expand Down

0 comments on commit e2c7146

Please sign in to comment.