Skip to content

Commit

Permalink
Merge pull request #605 from nevermined-io/fix/signTypeMessages-with-…
Browse files Browse the repository at this point in the history
…ethers

fix: issue where ethers signTypedData was not being called correctly
  • Loading branch information
r-marques authored Oct 26, 2023
2 parents 025d112 + 3d1e7cc commit f55dffd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 9 additions & 0 deletions integration/nevermined/MarketplaceAPIAuth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/nevermined/utils/JwtUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f55dffd

Please sign in to comment.