From d29fe028678713d958bb9f1627f8eb4401594547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20=C4=86wirko?= Date: Sat, 4 May 2024 15:58:26 +0200 Subject: [PATCH] fix sign message callback path --- CHANGELOG.md | 3 +++ package-lock.json | 16 ++++++++-------- package.json | 2 +- src/hooks/useSignMessage.tsx | 5 ++--- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 382545b..9713ce4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### [0.19.3](https://github.com/useElven/core/releases/tag/v0.19.3) (2024-05-04) +- fix callback path in `useSignMessage` + ### [0.19.2](https://github.com/useElven/core/releases/tag/v0.19.2) (2024-05-03) - export missing type - update dependencies diff --git a/package-lock.json b/package-lock.json index 3321732..6459281 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@useelven/core", - "version": "0.19.2", + "version": "0.19.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@useelven/core", - "version": "0.19.2", + "version": "0.19.3", "license": "MIT", "dependencies": { "@multiversx/sdk-extension-provider": "3.0.0", @@ -1632,9 +1632,9 @@ "dev": true }, "node_modules/@types/lodash": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.0.tgz", - "integrity": "sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==", + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.1.tgz", + "integrity": "sha512-X+2qazGS3jxLAIz5JDXDzglAF3KpijdhFxlf/V1+hEsOUc+HnWi81L/uv/EvGuV90WY+7mPGFCUDGfQC3Gj95Q==", "dev": true }, "node_modules/@types/lodash.clonedeep": { @@ -5023,9 +5023,9 @@ } }, "node_modules/minipass": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", - "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.0.tgz", + "integrity": "sha512-oGZRv2OT1lO2UF1zUcwdTb3wqUwI0kBGTgt/T7OdSj6M6N5m3o5uPf0AIW6lVxGGoiWUR7e2AwTE+xiwK8WQig==", "dev": true, "engines": { "node": ">=16 || 14 >=14.17" diff --git a/package.json b/package.json index 49ca3f0..38e481f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@useelven/core", - "version": "0.19.2", + "version": "0.19.3", "description": "Core React hooks for MultiversX DApps", "license": "MIT", "author": "Julian Ćwirko ", diff --git a/src/hooks/useSignMessage.tsx b/src/hooks/useSignMessage.tsx index 973d4ab..3066352 100644 --- a/src/hooks/useSignMessage.tsx +++ b/src/hooks/useSignMessage.tsx @@ -7,6 +7,7 @@ import { SignableMessage } from '@multiversx/sdk-core'; import { errorParse } from '../utils/errorParse'; import { getParamFromUrl } from '../utils/getParamFromUrl'; import { HWProvider } from '@multiversx/sdk-hw-provider'; +import { getCallbackUrl } from '../utils/getCallbackUrl'; export type SignMessageArgs = { message: string; @@ -79,9 +80,7 @@ export const useSignMessage = () => { ); }; - const url = - `${window.location.origin}${options?.callbackUrl || ''}` || - window?.location.href; + const url = getCallbackUrl(options?.callbackUrl); await networkStateSnap.dappProvider.signMessage( // TODO: SignableMessage is deprecated, replace when signing providers are ready new SignableMessage({ message: Buffer.from(message) }),