@reclaimprotocol/client 0.1.0-dev.1 → 0.1.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +256 -0
- package/lib/attestor-proof.d.ts +16 -0
- package/lib/attestor-proof.js +121 -0
- package/lib/canonical.d.ts +1 -0
- package/lib/canonical.js +18 -0
- package/lib/eip712.d.ts +20 -0
- package/lib/eip712.js +108 -0
- package/lib/enckeys.d.ts +33 -0
- package/lib/enckeys.js +14 -0
- package/lib/encoding.d.ts +11 -0
- package/lib/encoding.js +34 -0
- package/lib/index.d.ts +11 -3
- package/lib/index.js +10 -2
- package/lib/jwks.d.ts +26 -0
- package/lib/jwks.js +63 -0
- package/lib/keypair.d.ts +12 -0
- package/lib/keypair.js +18 -17
- package/lib/reclaim.d.ts +128 -0
- package/lib/reclaim.js +155 -0
- package/lib/result.d.ts +132 -0
- package/lib/result.js +298 -0
- package/lib/routes.gen.d.ts +121 -21
- package/lib/routes.gen.js +32 -7
- package/lib/secp.d.ts +6 -0
- package/lib/secp.js +21 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.js +1 -0
- package/lib/types/openapi.d.ts +18 -1
- package/lib/types/openapi.gen.d.ts +2657 -1148
- package/package.json +14 -5
- package/src/attestor-proof.ts +148 -0
- package/src/canonical.ts +20 -0
- package/src/enckeys.ts +46 -0
- package/src/encoding.ts +39 -0
- package/src/index.ts +60 -2
- package/src/jwks.ts +86 -0
- package/src/keypair.ts +22 -20
- package/src/reclaim.ts +332 -0
- package/src/result.ts +448 -0
- package/src/routes.gen.ts +32 -7
- package/src/secp.ts +24 -0
- package/src/types/index.ts +1 -1
- package/src/types/openapi.gen.ts +2657 -1148
- package/src/types/openapi.ts +48 -18
package/lib/secp.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared `@noble/secp256k1` instance with the v3 hash hooks wired once
|
|
3
|
+
* (sign + recover need SHA-256 / HMAC-SHA256). Import `secp` from here — never
|
|
4
|
+
* set `secp.hashes` ad-hoc — so the hooks are guaranteed initialised before any
|
|
5
|
+
* sign/verify/recover call, regardless of import order.
|
|
6
|
+
*/
|
|
7
|
+
import { hmac } from '@noble/hashes/hmac.js';
|
|
8
|
+
import { sha256 } from '@noble/hashes/sha2.js';
|
|
9
|
+
import { keccak_256 } from '@noble/hashes/sha3.js';
|
|
10
|
+
import * as secp from '@noble/secp256k1';
|
|
11
|
+
import { bytesToHex } from "./encoding.js";
|
|
12
|
+
secp.hashes.sha256 = sha256;
|
|
13
|
+
secp.hashes.hmacSha256 = (key, msg) => {
|
|
14
|
+
return hmac(sha256, key, msg);
|
|
15
|
+
};
|
|
16
|
+
export { keccak_256, secp };
|
|
17
|
+
/** Lowercase 0x ETH address from an uncompressed (65-byte) public key:
|
|
18
|
+
* keccak256 of the 64-byte X‖Y (drop the 0x04 prefix), last 20 bytes. */
|
|
19
|
+
export function addressFromUncompressedPubkey(pub) {
|
|
20
|
+
return '0x' + bytesToHex(keccak_256(pub.slice(1))).slice(-40);
|
|
21
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './openapi.ts';
|
|
2
|
-
export
|
|
2
|
+
export * from './openapi.gen.ts';
|
package/lib/types/index.js
CHANGED
package/lib/types/openapi.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { components, operations } from './openapi.gen.ts';
|
|
2
2
|
export type IOperationId = keyof operations;
|
|
3
|
-
type RequestBodyContent<T> = T extends {
|
|
3
|
+
export type RequestBodyContent<T> = T extends {
|
|
4
4
|
content: {
|
|
5
5
|
'application/json': infer R;
|
|
6
6
|
};
|
|
@@ -71,4 +71,21 @@ export type IOperationResponse<T extends IOperationId> = IJsonResponseBody<T>;
|
|
|
71
71
|
export type ProblemDetails = components['schemas']['Problem'] & {
|
|
72
72
|
[key: string]: unknown;
|
|
73
73
|
};
|
|
74
|
+
export type VerificationSession = components['schemas']['VerificationSession'];
|
|
75
|
+
export type VerificationStatus = components['schemas']['VerificationStatus'];
|
|
76
|
+
export type VerificationEventRecord = components['schemas']['VerificationEventRecord'];
|
|
77
|
+
export type CallbackSubscription = components['schemas']['CallbackSubscription'];
|
|
78
|
+
export type CallbackDeliveryStatus = components['schemas']['CallbackDeliveryStatus'];
|
|
79
|
+
export type VerificationResultDelivery = components['schemas']['VerificationResultDelivery'];
|
|
80
|
+
export type ProviderRequiredContext = components['schemas']['ProviderRequiredContext'];
|
|
81
|
+
export type Provider = components['schemas']['Provider'];
|
|
82
|
+
export type ProviderVersion = components['schemas']['ProviderVersion'];
|
|
83
|
+
export type OrgCredential = components['schemas']['OrgCredential'];
|
|
84
|
+
export type JwkX25519Public = components['schemas']['JwkX25519Public'];
|
|
85
|
+
export type OrgToken = components['schemas']['OrgToken'];
|
|
86
|
+
export type OrgTokenMeta = components['schemas']['OrgTokenMeta'];
|
|
87
|
+
export type Organization = components['schemas']['Organization'];
|
|
88
|
+
export type CredentialAttachSession = components['schemas']['CredentialAttachSession'];
|
|
89
|
+
export type CreateProviderVersionRequest = components['schemas']['CreateProviderVersionRequest'];
|
|
90
|
+
export type ProviderVersionRef = components['schemas']['ProviderVersionRef'];
|
|
74
91
|
export {};
|