Skip to content

Commit

Permalink
fix(deps): bump did-jwt to v6
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis committed Apr 6, 2022
1 parent 0681024 commit 55cbf43
Show file tree
Hide file tree
Showing 3 changed files with 792 additions and 355 deletions.
28 changes: 13 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@
"scripts": {
"test": "jest",
"test:ci": "jest --coverage && codecov",
"build:js": "microbundle --compress=false",
"build": "yarn lint && yarn build:js && yarn test",
"build": "microbundle --compress=false",
"format": "prettier --write \"src/**/*.[jt]s\"",
"lint": "eslint --ignore-pattern \"src/**/*.test.[jt]s\" \"src/**/*.[jt]s\"",
"prepare": "yarn build",
"prepublishOnly": "yarn test:ci && yarn format && yarn lint",
"release": "semantic-release --debug"
},
Expand All @@ -50,7 +48,7 @@
"@babel/core": "7.16.7",
"@babel/preset-env": "7.16.7",
"@babel/preset-typescript": "7.16.7",
"@ethersproject/contracts": "5.5.0",
"@ethersproject/contracts": "5.6.0",
"@semantic-release/changelog": "6.0.1",
"@semantic-release/git": "10.0.1",
"@types/jest": "27.4.0",
Expand All @@ -70,17 +68,17 @@
"typescript": "4.5.4"
},
"dependencies": {
"@ethersproject/abstract-signer": "^5.5.0",
"@ethersproject/base64": "^5.5.0",
"@ethersproject/basex": "^5.5.0",
"@ethersproject/bytes": "^5.5.0",
"@ethersproject/providers": "^5.5.0",
"@ethersproject/signing-key": "^5.5.0",
"@ethersproject/strings": "^5.5.0",
"@ethersproject/transactions": "^5.5.0",
"@ethersproject/abstract-signer": "^5.6.0",
"@ethersproject/base64": "^5.6.0",
"@ethersproject/basex": "^5.6.0",
"@ethersproject/bytes": "^5.6.1",
"@ethersproject/providers": "^5.6.2",
"@ethersproject/signing-key": "^5.6.0",
"@ethersproject/strings": "^5.6.0",
"@ethersproject/transactions": "^5.6.0",
"@ethersproject/wallet": "^5.5.0",
"did-jwt": "^5.12.3",
"did-resolver": "^3.1.5",
"ethr-did-resolver": "^5.0.3"
"did-jwt": "^6.0.0",
"did-resolver": "^3.2.0",
"ethr-did-resolver": "^5.0.4"
}
}
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createJWT, ES256KSigner, JWTVerified, Signer as JWTSigner, verifyJWT } from 'did-jwt'
import { createJWT, ES256KSigner, hexToBytes, JWTVerified, Signer as JWTSigner, verifyJWT } from 'did-jwt'
import { Signer as TxSigner } from '@ethersproject/abstract-signer'
import { CallOverrides } from '@ethersproject/contracts'
import { computeAddress } from '@ethersproject/transactions'
Expand Down Expand Up @@ -92,7 +92,7 @@ export class EthrDID {
)
}
} else if (conf.privateKey) {
this.signer = ES256KSigner(conf.privateKey, true)
this.signer = ES256KSigner(hexToBytes(conf.privateKey), true)
this.alg = 'ES256K-R'
}
}
Expand Down Expand Up @@ -204,7 +204,7 @@ export class EthrDID {
expiresIn = 86400
): Promise<{ kp: KeyPair; txHash: string }> {
const kp = EthrDID.createKeyPair()
this.signer = ES256KSigner(kp.privateKey, true)
this.signer = ES256KSigner(hexToBytes(kp.privateKey), true)
const txHash = await this.addDelegate(kp.address, {
delegateType,
expiresIn,
Expand Down
Loading

0 comments on commit 55cbf43

Please sign in to comment.