From 3d1e7cc1da32df237e76c8065cd0c6e997500f3c Mon Sep 17 00:00:00 2001 From: Rodolphe Marques Date: Thu, 26 Oct 2023 14:12:04 +0200 Subject: [PATCH] fix: issue where ethers signTypedData was not being called correctly - bump version to 2.0.2 --- integration/nevermined/MarketplaceAPIAuth.test.ts | 9 +++++++++ package.json | 7 ++++--- src/nevermined/utils/JwtUtils.ts | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/integration/nevermined/MarketplaceAPIAuth.test.ts b/integration/nevermined/MarketplaceAPIAuth.test.ts index 6fabf3ff3..64870df81 100644 --- a/integration/nevermined/MarketplaceAPIAuth.test.ts +++ b/integration/nevermined/MarketplaceAPIAuth.test.ts @@ -33,6 +33,15 @@ describe('Marketplace api auth', () => { } }) + it('should login using a message', async () => { + const clientAssertion = await nevermined.utils.jwt.generateClientAssertion( + account1, + 'Nevermined', + ) + const accessToken = await nevermined.services.marketplace.login(clientAssertion) + assert.isDefined(accessToken) + }) + it('should add new address to the account', async () => { const clientAssertion = await nevermined.utils.jwt.generateClientAssertion(account2) diff --git a/package.json b/package.json index a4ebc81be..047fbecc7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nevermined-io/sdk", - "version": "2.0.1", + "version": "2.0.2", "description": "Javascript SDK for connecting with Nevermined Data Platform ", "main": "./dist/node/sdk.js", "typings": "./dist/node/sdk.d.ts", @@ -51,9 +51,10 @@ }, "homepage": "https://github.com/nevermined-io/sdk-js#readme", "dependencies": { - "@alchemy/aa-core": "0.1.0", + "@alchemy/aa-core": "0.1.1", "@apollo/client": "^3.7.16", - "@zerodev/sdk": "4.0.30", + "@turnkey/ethers": "0.17.4", + "@zerodev/sdk": "4.0.31", "assert": "^2.0.0", "cross-fetch": "^4.0.0", "crypto-browserify": "^3.12.0", diff --git a/src/nevermined/utils/JwtUtils.ts b/src/nevermined/utils/JwtUtils.ts index 3ac99c984..5dc7204e5 100644 --- a/src/nevermined/utils/JwtUtils.ts +++ b/src/nevermined/utils/JwtUtils.ts @@ -122,7 +122,7 @@ export class EthSignJWT extends SignJWT { primaryType: '', }) } - return EthSignJWT.signTypedMessage(domain, types, value, signer) + return signer.signTypedData(domain, types as any, value) } private base64url(input: Uint8Array | string): string {