Fix intents path to use namespace and chainId (#92)

This commit is contained in:
IshaVenikar
2024-04-25 17:08:27 +05:30
committed by Nabarun Gogoi
parent 3809ce88b1
commit 984cad8e48
2 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ export default function Main() {
config: {
screens: {
SignRequest: {
path: 'sign/:network/:address/:message',
path: 'sign/:namespace/:chaindId/:address/:message',
},
},
},
+6 -6
View File
@@ -103,12 +103,13 @@ const SignRequest = ({ route }: SignRequestProps) => {
const sanitizePath = useCallback(
(path: string) => {
const regex = /^\/sign\/(eip155|cosmos)\/(.+)\/(.+)$/;
const regex = /^\/sign\/(eip155|cosmos)\/(.+)\/(.+)\/(.+)$/;
const match = path.match(regex);
if (match) {
const [, network, address, message] = match;
const [, namespace, chainId, address, message] = match;
return {
network,
namespace,
chainId,
address,
message,
};
@@ -125,9 +126,8 @@ const SignRequest = ({ route }: SignRequestProps) => {
const sanitizedRoute = sanitizePath(route.path);
sanitizedRoute &&
retrieveData(
sanitizedRoute.network,
// TODO: Take chainId from route.path
selectedNetwork!.chainId!,
sanitizedRoute.namespace,
sanitizedRoute.chainId,
sanitizedRoute.address,
sanitizedRoute.message,
);