forked from cerc-io/laconic-wallet
Fix intents path to use namespace and chainId (#92)
This commit is contained in:
parent
3809ce88b1
commit
984cad8e48
2
index.js
2
index.js
@ -17,7 +17,7 @@ export default function Main() {
|
||||
config: {
|
||||
screens: {
|
||||
SignRequest: {
|
||||
path: 'sign/:network/:address/:message',
|
||||
path: 'sign/:namespace/:chaindId/:address/:message',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -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,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user