@windingtree/org.id-auth
Advanced tools
Comparing version 1.0.0-beta.23 to 1.0.0-beta.26
@@ -1,2 +0,2 @@ | ||
import type { VoidSigner } from 'ethers'; | ||
import type { VoidSigner, Wallet } from 'ethers'; | ||
import type { KeyLike, JWK } from './keys'; | ||
@@ -25,3 +25,3 @@ import type { VCTypedHolderReference, CredentialReference, VCProofReference, CryptographicSignatureSuiteReference } from '@windingtree/org.json-schema/types/vc'; | ||
sign(privateKey: KeyLike | Uint8Array | JWK): Promise<SignedVC>; | ||
signWithBlockchainAccount(blockchainAccountId: string, signer: VoidSigner): Promise<SignedVC>; | ||
signWithBlockchainAccount(blockchainAccountId: string, signer: VoidSigner | Wallet): Promise<SignedVC>; | ||
} | ||
@@ -74,3 +74,3 @@ export interface DidGroupedCheckResult extends RegExpExecArray { | ||
}; | ||
export declare const signWithSigner: (signer: VoidSigner, verificationMethod: string, payload: string | GenericObject) => Promise<string>; | ||
export declare const signWithSigner: (signer: VoidSigner | Wallet, verificationMethod: string, payload: string | GenericObject) => Promise<string>; | ||
export declare const parseBlockchainAccountId: (blockchainAccountId: string) => BlockchainAccountIdParsed; | ||
@@ -77,0 +77,0 @@ export declare const decodeJws: (jws: string) => DecodedJws; |
@@ -110,3 +110,3 @@ "use strict"; | ||
}, signature); | ||
if (accountId.toUpperCase() !== recoveredAccountId.toUpperCase()) { | ||
if (ethers_1.utils.getAddress(accountId) !== ethers_1.utils.getAddress(recoveredAccountId)) { | ||
throw new Error(`VC signed by different accountId: ${accountId} though expected: ${recoveredAccountId}`); | ||
@@ -367,3 +367,3 @@ } | ||
const signerAddress = await signer.getAddress(); | ||
if (signerAddress !== accountId) { | ||
if (signerAddress !== ethers_1.utils.getAddress(accountId)) { | ||
throw new Error('The signer address is different from blockchain account'); | ||
@@ -370,0 +370,0 @@ } |
{ | ||
"name": "@windingtree/org.id-auth", | ||
"version": "1.0.0-beta.23", | ||
"version": "1.0.0-beta.26", | ||
"description": "ORGiD authentication library", | ||
@@ -42,3 +42,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@windingtree/org.id-utils": "^1.0.0-beta.23", | ||
"@windingtree/org.id-utils": "^1.0.0-beta.26", | ||
"@windingtree/org.json-schema": "1.0.0-beta.5", | ||
@@ -68,3 +68,3 @@ "ethers": "5.5.1", | ||
}, | ||
"gitHead": "239e89200f58cf0a12b331ffdcc0f79df009adf0" | ||
"gitHead": "6488cacab3526de533a1d6106ba2756a8b800193" | ||
} |
@@ -12,10 +12,19 @@ [](https://www.npmjs.com/package/@windingtree/org.id-auth) | ||
```bash | ||
npm install @windingtree/org.id-auth | ||
yarn install | ||
``` | ||
## Documentation | ||
## Build | ||
[ORGiD authentication library documentation](docs/index.md) | ||
```bash | ||
yarn build | ||
``` | ||
## Linting & Testing | ||
```bash | ||
yarn lint | ||
yarn test | ||
``` | ||
Sorry, the diff of this file is not supported yet
59862
30