Skip to content

Commit

Permalink
Merge pull request #615 from nevermined-io/feat/udpate-lastest-zerode…
Browse files Browse the repository at this point in the history
…v-sdk

feat: update zerodev/sdk to latest
  • Loading branch information
r-marques authored Nov 23, 2023
2 parents 43a0c05 + e99c3c8 commit eb00cf5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
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.4",
"version": "2.0.5",
"description": "Javascript SDK for connecting with Nevermined Data Platform ",
"main": "./dist/node/sdk.js",
"typings": "./dist/node/sdk.d.ts",
Expand Down Expand Up @@ -53,8 +53,9 @@
"dependencies": {
"@alchemy/aa-core": "0.1.1",
"@apollo/client": "^3.7.16",
"@turnkey/ethers": "0.17.4",
"@zerodev/sdk": "4.0.31",
"@turnkey/ethers": "^0.18.3",
"@turnkey/viem": "^0.3.4",
"@zerodev/sdk": "^4.3.3",
"assert": "^2.0.0",
"cross-fetch": "^4.0.0",
"crypto-browserify": "^3.12.0",
Expand Down
12 changes: 6 additions & 6 deletions src/nevermined/utils/JwtUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ export class EthSignJWT extends SignJWT {
message: string | Uint8Array,
signer: ethers.Signer | ZeroDevAccountSigner<'ECDSA'>,
): Promise<string> {
if (signer instanceof ZeroDevAccountSigner) {
return signer.signMessageWith6492(message)
if ((signer as ZeroDevAccountSigner<'ECDSA'>).signMessageWith6492) {
return (signer as ZeroDevAccountSigner<'ECDSA'>).signMessageWith6492(message)
}

return EthSignJWT.signText(message, signer)
return EthSignJWT.signText(message, signer as ethers.Signer)
}

private static async signTypedMessage(
Expand All @@ -114,15 +114,15 @@ export class EthSignJWT extends SignJWT {
value: Record<string, any>,
signer: ethers.Signer | ZeroDevAccountSigner<'ECDSA'>,
): Promise<string> {
if (signer instanceof ZeroDevAccountSigner) {
return signer.signTypedDataWith6492({
if ((signer as ZeroDevAccountSigner<'ECDSA'>).signTypedDataWith6492) {
return (signer as ZeroDevAccountSigner<'ECDSA'>).signTypedDataWith6492({
domain,
types: types as any,
message: value,
primaryType: '',
})
}
return signer.signTypedData(domain, types as any, value)
return signer.signTypedData(domain as any, types as any, value)
}

private base64url(input: Uint8Array | string): string {
Expand Down

0 comments on commit eb00cf5

Please sign in to comment.