Skip to content

Commit

Permalink
fix sign message callback path
Browse files Browse the repository at this point in the history
  • Loading branch information
juliancwirko committed May 4, 2024
1 parent c06e015 commit d29fe02
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <julian.io>",
Expand Down
5 changes: 2 additions & 3 deletions src/hooks/useSignMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) }),
Expand Down

0 comments on commit d29fe02

Please sign in to comment.