Skip to content

Commit

Permalink
Remove callbackRoute from signMessage and upgrade to Message
Browse files Browse the repository at this point in the history
  • Loading branch information
arhtudormorar committed Sep 23, 2024
1 parent 8ce464a commit 4e1420f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-dapp-core",
"version": "0.0.0-alpha.9",
"version": "0.0.0-alpha.10",
"main": "out/index.js",
"module": "out/index.js",
"types": "out/index.d.ts",
Expand All @@ -21,7 +21,7 @@
"scripts": {
"compile": "tsc && tsc-alias",
"build-esbuild": "rimraf out && node esbuild.js",
"publish-verdaccio": "npm unpublish --registry http://localhost:4873 @multiversx/[email protected].3 && rimraf out && yarn compile && npm publish --registry http://localhost:4873",
"publish-verdaccio": "npm unpublish --registry http://localhost:4873 @multiversx/[email protected].11 && rimraf out && yarn compile && npm publish --registry http://localhost:4873",
"build": "yarn build-esbuild && yarn compile",
"test": "jest",
"compile-next": "rimraf out && tsc --p tsconfig.next.json && tsc-alias --project tsconfig.next.json"
Expand All @@ -32,7 +32,7 @@
"dependencies": {
"@lifeomic/axios-fetch": "3.0.1",
"@multiversx/sdk-extension-provider": "4.0.0-alpha.0",
"@multiversx/sdk-hw-provider": "7.0.0-alpha.0",
"@multiversx/sdk-hw-provider": "7.0.0",
"@multiversx/sdk-metamask-provider": "0.0.7",
"@multiversx/sdk-native-auth-client": "^1.0.8",
"@multiversx/sdk-opera-provider": "1.0.0-alpha.1",
Expand All @@ -41,22 +41,24 @@
"@multiversx/sdk-web-wallet-provider": "3.2.1",
"isomorphic-fetch": "3.0.0",
"lodash": "4.17.21",
"protobufjs": "7.3.0",
"socket.io-client": "4.7.5",
"zustand": "4.4.7"
},
"peerDependencies": {
"@multiversx/sdk-core": ">= 13.5.0",
"@multiversx/sdk-dapp-utils": ">= 0.1.0",
"@multiversx/sdk-dapp-utils": ">= 1.0.1",
"@multiversx/sdk-web-wallet-cross-window-provider": ">= 2.0.1",
"axios": ">=1.6.5",
"bignumber.js": "9.x"
"bignumber.js": "9.x",
"immer": "10.x"
},
"resolutions": {
"string-width": "4.1.0"
},
"devDependencies": {
"@multiversx/sdk-core": ">= 13.5.0",
"@multiversx/sdk-dapp-utils": ">= 0.1.0",
"@multiversx/sdk-dapp-utils": "1.0.1",
"@multiversx/sdk-web-wallet-cross-window-provider": ">= 2.0.1",
"@swc/core": "^1.4.17",
"@swc/jest": "^0.2.36",
Expand Down Expand Up @@ -85,7 +87,6 @@
"msw": "1.3.1",
"node-stdlib-browser": "1.2.0",
"prettier": "3.2.5",
"protobufjs": "^7.3.0",
"react": "^18.3.1",
"rimraf": "^5.0.6",
"ts-jest": "29.1.2",
Expand Down
7 changes: 1 addition & 6 deletions src/core/methods/signMessage/signMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ export interface SignMessageType {
};
}

// TODO: upgrade to Message
export const signMessage = async ({
message,
callbackRoute,
options
}: SignMessageType): Promise<Nullable<Message>> => {
const address = getAddress();
const provider = getAccountProvider();
const providerType = getProviderType(provider);

const callbackUrl = addOriginToLocationPath(callbackRoute);
const messageToSign = new Message({
address: new Address(address),
data: message.data
Expand All @@ -41,9 +38,7 @@ export const signMessage = async ({
}

// TODO upgrade sdk-dapp-utils to use Message as input for signMessage method and remove the cast
const signedMessage = await provider.signMessage(messageToSign as any, {
callbackUrl: encodeURIComponent(callbackUrl)
});
const signedMessage = await provider.signMessage(messageToSign, options);

// TODO upgrade sdk-dapp-utils to return Message instead of SignableMessage and remove the cast
return signedMessage as Nullable<Message>;
Expand Down
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -977,20 +977,20 @@
json-bigint "1.0.0"
keccak "3.0.2"

"@multiversx/sdk-dapp-utils@>= 0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@multiversx/sdk-dapp-utils/-/sdk-dapp-utils-0.1.0.tgz#3103c2ffc648703e75f96acd229af299cb0840ab"
integrity sha512-EFvktZ/S1WQ1ie02nnKZHARC4r23JZWwoTFd5py1qi/Z/UoLHIzJ394HLjXFb6gBTsp4wnvNwIXBA/DNrd2Yeg==
"@multiversx/[email protected].1":
version "1.0.1"
resolved "http://localhost:4873/@multiversx/sdk-dapp-utils/-/sdk-dapp-utils-1.0.1.tgz#242a82c1f523efdcdec9a0be7816e079216215f0"
integrity sha512-ccmRjbWyxbPqEITwAHdtJ10VXQS6R565gZILMXoyQU7M7yUDnauV15vOfMmYko4MnCJq40U/zxx4dN3mJW4Mgw==

"@multiversx/[email protected]":
version "4.0.0-alpha.0"
resolved "https://registry.yarnpkg.com/@multiversx/sdk-extension-provider/-/sdk-extension-provider-4.0.0-alpha.0.tgz#e00ba0df0d1ef8ac0330ff3f6f0c5ced8163c5b3"
integrity sha512-LPRy2sgWG1Ti3KMxembP0/13GHntenFK1kbXAfHUJiOH29s4nbGDqBlTI0p42en4c1BGlEbVJEfpUq1LtO5ZYA==

"@multiversx/[email protected]-alpha.0":
version "7.0.0-alpha.0"
resolved "https://registry.yarnpkg.com/@multiversx/sdk-hw-provider/-/sdk-hw-provider-7.0.0-alpha.0.tgz#449b96d63ec1efa945ae15a6f217b90338a7a131"
integrity sha512-Mrv+AKXoe95CvxoGRVSF7d1MLNjvI3ot+/1muuBc3cgiwcKBFTbdW9cp5P79mEEDizI5foy/Gscn1Qs5Nh2Hrg==
"@multiversx/[email protected]":
version "7.0.0"
resolved "http://localhost:4873/@multiversx/sdk-hw-provider/-/sdk-hw-provider-7.0.0.tgz#dafb239179949e23a75805c7cd386d618b1855cd"
integrity sha512-ZRGp5q985v5wvjnSZw+uvEXKGwe5YORuULhYMVoh63cPtGhyHIxl7H9D190KtSV0/LJfTcVUDDrtKoepOoKuVA==
dependencies:
"@ledgerhq/devices" "8.0.3"
"@ledgerhq/errors" "6.12.6"
Expand Down Expand Up @@ -5859,10 +5859,10 @@ prompts@^2.0.1:
kleur "^3.0.3"
sisteransi "^1.0.5"

protobufjs@^7.3.0:
version "7.4.0"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.4.0.tgz#7efe324ce9b3b61c82aae5de810d287bc08a248a"
integrity sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==
[email protected]:
version "7.3.0"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.3.0.tgz#a32ec0422c039798c41a0700306a6e305b9cb32c"
integrity sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
Expand Down

0 comments on commit 4e1420f

Please sign in to comment.