ox 0.12.4 → 0.13.1
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/CHANGELOG.md +21 -0
- package/_cjs/core/P256.js +1 -1
- package/_cjs/core/P256.js.map +1 -1
- package/_cjs/core/WebAuthnP256.js +15 -256
- package/_cjs/core/WebAuthnP256.js.map +1 -1
- package/_cjs/core/WebCryptoP256.js +3 -1
- package/_cjs/core/WebCryptoP256.js.map +1 -1
- package/_cjs/core/internal/webauthn.js +5 -13
- package/_cjs/core/internal/webauthn.js.map +1 -1
- package/_cjs/index.docs.js +1 -0
- package/_cjs/index.docs.js.map +1 -1
- package/_cjs/tempo/KeyAuthorization.js +18 -3
- package/_cjs/tempo/KeyAuthorization.js.map +1 -1
- package/_cjs/tempo/SignatureEnvelope.js +26 -0
- package/_cjs/tempo/SignatureEnvelope.js.map +1 -1
- package/_cjs/tempo/TxEnvelopeTempo.js +5 -10
- package/_cjs/tempo/TxEnvelopeTempo.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_cjs/webauthn/Authentication.js +246 -0
- package/_cjs/webauthn/Authentication.js.map +1 -0
- package/_cjs/webauthn/Authenticator.js +55 -0
- package/_cjs/webauthn/Authenticator.js.map +1 -0
- package/_cjs/webauthn/Credential.js +53 -0
- package/_cjs/webauthn/Credential.js.map +1 -0
- package/_cjs/webauthn/Registration.js +349 -0
- package/_cjs/webauthn/Registration.js.map +1 -0
- package/_cjs/webauthn/Types.js +3 -0
- package/_cjs/webauthn/Types.js.map +1 -0
- package/_cjs/webauthn/index.js +9 -0
- package/_cjs/webauthn/index.js.map +1 -0
- package/_cjs/webauthn/internal/utils.js +53 -0
- package/_cjs/webauthn/internal/utils.js.map +1 -0
- package/_esm/core/P256.js +1 -1
- package/_esm/core/P256.js.map +1 -1
- package/_esm/core/WebAuthnP256.js +13 -261
- package/_esm/core/WebAuthnP256.js.map +1 -1
- package/_esm/core/WebCryptoP256.js +4 -1
- package/_esm/core/WebCryptoP256.js.map +1 -1
- package/_esm/core/internal/webauthn.js +5 -13
- package/_esm/core/internal/webauthn.js.map +1 -1
- package/_esm/erc8021/index.js +2 -2
- package/_esm/index.docs.js +1 -0
- package/_esm/index.docs.js.map +1 -1
- package/_esm/tempo/KeyAuthorization.js +66 -3
- package/_esm/tempo/KeyAuthorization.js.map +1 -1
- package/_esm/tempo/SignatureEnvelope.js +74 -0
- package/_esm/tempo/SignatureEnvelope.js.map +1 -1
- package/_esm/tempo/TransactionReceipt.js +1 -1
- package/_esm/tempo/TransactionRequest.js +1 -1
- package/_esm/tempo/TxEnvelopeTempo.js +5 -10
- package/_esm/tempo/TxEnvelopeTempo.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_esm/webauthn/Authentication.js +453 -0
- package/_esm/webauthn/Authentication.js.map +1 -0
- package/_esm/webauthn/Authenticator.js +176 -0
- package/_esm/webauthn/Authenticator.js.map +1 -0
- package/_esm/webauthn/Credential.js +95 -0
- package/_esm/webauthn/Credential.js.map +1 -0
- package/_esm/webauthn/Registration.js +512 -0
- package/_esm/webauthn/Registration.js.map +1 -0
- package/_esm/webauthn/Types.js +2 -0
- package/_esm/webauthn/Types.js.map +1 -0
- package/_esm/webauthn/index.js +31 -0
- package/_esm/webauthn/index.js.map +1 -0
- package/_esm/webauthn/internal/utils.js +52 -0
- package/_esm/webauthn/internal/utils.js.map +1 -0
- package/_types/core/WebAuthnP256.d.ts +33 -208
- package/_types/core/WebAuthnP256.d.ts.map +1 -1
- package/_types/core/WebCryptoP256.d.ts +2 -0
- package/_types/core/WebCryptoP256.d.ts.map +1 -1
- package/_types/core/internal/webauthn.d.ts +2 -110
- package/_types/core/internal/webauthn.d.ts.map +1 -1
- package/_types/erc8021/index.d.ts +2 -2
- package/_types/index.docs.d.ts +1 -0
- package/_types/index.docs.d.ts.map +1 -1
- package/_types/tempo/KeyAuthorization.d.ts +57 -0
- package/_types/tempo/KeyAuthorization.d.ts.map +1 -1
- package/_types/tempo/SignatureEnvelope.d.ts +75 -0
- package/_types/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/_types/tempo/Transaction.d.ts +2 -2
- package/_types/tempo/TransactionReceipt.d.ts +2 -2
- package/_types/tempo/TransactionRequest.d.ts +2 -2
- package/_types/tempo/TxEnvelopeTempo.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/_types/webauthn/Authentication.d.ts +324 -0
- package/_types/webauthn/Authentication.d.ts.map +1 -0
- package/_types/webauthn/Authenticator.d.ts +182 -0
- package/_types/webauthn/Authenticator.d.ts.map +1 -0
- package/_types/webauthn/Credential.d.ts +77 -0
- package/_types/webauthn/Credential.d.ts.map +1 -0
- package/_types/webauthn/Registration.d.ts +308 -0
- package/_types/webauthn/Registration.d.ts.map +1 -0
- package/_types/webauthn/Types.d.ts +106 -0
- package/_types/webauthn/Types.d.ts.map +1 -0
- package/_types/webauthn/index.d.ts +33 -0
- package/_types/webauthn/index.d.ts.map +1 -0
- package/_types/webauthn/internal/utils.d.ts +17 -0
- package/_types/webauthn/internal/utils.d.ts.map +1 -0
- package/core/P256.ts +1 -1
- package/core/WebAuthnP256.ts +37 -582
- package/core/WebCryptoP256.ts +6 -1
- package/core/internal/webauthn.ts +6 -165
- package/erc8021/index.ts +2 -2
- package/index.docs.ts +1 -0
- package/package.json +31 -1
- package/tempo/KeyAuthorization.test.ts +139 -0
- package/tempo/KeyAuthorization.ts +82 -3
- package/tempo/SignatureEnvelope.test.ts +147 -0
- package/tempo/SignatureEnvelope.ts +113 -0
- package/tempo/Transaction.ts +2 -2
- package/tempo/TransactionReceipt.ts +2 -2
- package/tempo/TransactionRequest.ts +2 -2
- package/tempo/TxEnvelopeTempo.ts +5 -12
- package/tempo/e2e.test.ts +265 -0
- package/version.ts +1 -1
- package/webauthn/Authentication/package.json +6 -0
- package/webauthn/Authentication.ts +673 -0
- package/webauthn/Authenticator/package.json +6 -0
- package/webauthn/Authenticator.ts +259 -0
- package/webauthn/Credential/package.json +6 -0
- package/webauthn/Credential.ts +146 -0
- package/webauthn/Registration/package.json +6 -0
- package/webauthn/Registration.ts +805 -0
- package/webauthn/Types/package.json +6 -0
- package/webauthn/Types.ts +158 -0
- package/webauthn/index.ts +38 -0
- package/webauthn/internal/utils.ts +63 -0
- package/webauthn/package.json +6 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../webauthn/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAErD;;;;GAIG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;;GAIG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;;GAIG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;;;GAIG;AACH,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as Base64 from '../../core/Base64.js';
|
|
2
|
+
/** @internal */
|
|
3
|
+
export const base64UrlOptions = { url: true, pad: false };
|
|
4
|
+
/** @internal */
|
|
5
|
+
export const responseKeys = [
|
|
6
|
+
'attestationObject',
|
|
7
|
+
'authenticatorData',
|
|
8
|
+
'clientDataJSON',
|
|
9
|
+
'signature',
|
|
10
|
+
'userHandle',
|
|
11
|
+
];
|
|
12
|
+
/** @internal */
|
|
13
|
+
export function bytesToArrayBuffer(bytes) {
|
|
14
|
+
return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
|
|
15
|
+
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
export function bufferSourceToBytes(source) {
|
|
18
|
+
if (source instanceof Uint8Array)
|
|
19
|
+
return source;
|
|
20
|
+
if (source instanceof ArrayBuffer)
|
|
21
|
+
return new Uint8Array(source);
|
|
22
|
+
return new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
23
|
+
}
|
|
24
|
+
/** @internal */
|
|
25
|
+
export function serializeExtensions(extensions) {
|
|
26
|
+
const { prf, ...rest } = extensions;
|
|
27
|
+
return {
|
|
28
|
+
...rest,
|
|
29
|
+
...(prf && {
|
|
30
|
+
prf: {
|
|
31
|
+
eval: {
|
|
32
|
+
first: Base64.fromBytes(prf.eval.first, base64UrlOptions),
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** @internal */
|
|
39
|
+
export function deserializeExtensions(extensions) {
|
|
40
|
+
const { prf, ...rest } = extensions;
|
|
41
|
+
return {
|
|
42
|
+
...rest,
|
|
43
|
+
...(prf && {
|
|
44
|
+
prf: {
|
|
45
|
+
eval: {
|
|
46
|
+
first: Base64.toBytes(prf.eval.first),
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../webauthn/internal/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAG9C,gBAAgB;AAChB,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAW,CAAA;AAElE,gBAAgB;AAChB,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,mBAAmB;IACnB,mBAAmB;IACnB,gBAAgB;IAChB,WAAW;IACX,YAAY;CACJ,CAAA;AAEV,gBAAgB;AAChB,MAAM,UAAU,kBAAkB,CAAC,KAAiB;IAClD,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CACvB,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CACrB,CAAA;AAClB,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,mBAAmB,CAAC,MAA0B;IAC5D,IAAI,MAAM,YAAY,UAAU;QAAE,OAAO,MAAM,CAAA;IAC/C,IAAI,MAAM,YAAY,WAAW;QAAE,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAA;IAChE,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;AAC5E,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,mBAAmB,CACjC,UAAsD;IAEtD,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,CAAA;IACnC,OAAO;QACL,GAAG,IAAI;QACP,GAAG,CAAC,GAAG,IAAI;YACT,GAAG,EAAE;gBACH,IAAI,EAAE;oBACJ,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,gBAAgB,CAAC;iBAC1D;aACF;SACF,CAAC;KACH,CAAA;AACH,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,qBAAqB,CACnC,UAA4D;IAE5D,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,CAAA;IACnC,OAAO;QACL,GAAG,IAAI;QACP,GAAG,CAAC,GAAG,IAAI;YACT,GAAG,EAAE;gBACH,IAAI,EAAE;oBACJ,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;iBACtC;aACF;SACF,CAAC;KACH,CAAA;AACH,CAAC"}
|
|
@@ -1,28 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as Hash from './Hash.js';
|
|
6
|
-
import * as Hex from './Hex.js';
|
|
7
|
-
import type { Compute, OneOf } from './internal/types.js';
|
|
8
|
-
import * as internal from './internal/webauthn.js';
|
|
9
|
-
import * as P256 from './P256.js';
|
|
10
|
-
import type * as PublicKey from './PublicKey.js';
|
|
11
|
-
import type * as Signature from './Signature.js';
|
|
1
|
+
import * as Authentication from '../webauthn/Authentication.js';
|
|
2
|
+
import * as Authenticator from '../webauthn/Authenticator.js';
|
|
3
|
+
import type * as Credential_ from '../webauthn/Credential.js';
|
|
4
|
+
import * as Registration from '../webauthn/Registration.js';
|
|
12
5
|
/** A WebAuthn-flavored P256 credential. */
|
|
13
|
-
export type P256Credential =
|
|
14
|
-
id: string;
|
|
15
|
-
publicKey: PublicKey.PublicKey;
|
|
16
|
-
raw: internal.PublicKeyCredential;
|
|
17
|
-
};
|
|
6
|
+
export type P256Credential = Credential_.Credential;
|
|
18
7
|
/** Metadata for a WebAuthn P256 signature. */
|
|
19
|
-
export type SignMetadata =
|
|
20
|
-
authenticatorData: Hex.Hex;
|
|
21
|
-
challengeIndex?: number | undefined;
|
|
22
|
-
clientDataJSON: string;
|
|
23
|
-
typeIndex?: number | undefined;
|
|
24
|
-
userVerificationRequired?: boolean | undefined;
|
|
25
|
-
}>;
|
|
8
|
+
export type SignMetadata = Credential_.SignMetadata;
|
|
26
9
|
export declare const createChallenge: Uint8Array;
|
|
27
10
|
/**
|
|
28
11
|
* Creates a new WebAuthn P256 Credential, which can be stored and later used for signing.
|
|
@@ -49,16 +32,8 @@ export declare const createChallenge: Uint8Array;
|
|
|
49
32
|
*/
|
|
50
33
|
export declare function createCredential(options: createCredential.Options): Promise<P256Credential>;
|
|
51
34
|
export declare namespace createCredential {
|
|
52
|
-
type Options =
|
|
53
|
-
|
|
54
|
-
* Credential creation function. Useful for environments that do not support
|
|
55
|
-
* the WebAuthn API natively (i.e. React Native or testing environments).
|
|
56
|
-
*
|
|
57
|
-
* @default window.navigator.credentials.create
|
|
58
|
-
*/
|
|
59
|
-
createFn?: ((options?: internal.CredentialCreationOptions | undefined) => Promise<internal.Credential | null>) | undefined;
|
|
60
|
-
};
|
|
61
|
-
type ErrorType = getCredentialCreationOptions.ErrorType | internal.parseCredentialPublicKey.ErrorType | Errors.GlobalErrorType;
|
|
35
|
+
type Options = Registration.create.Options;
|
|
36
|
+
type ErrorType = Registration.create.ErrorType;
|
|
62
37
|
}
|
|
63
38
|
/**
|
|
64
39
|
* Gets the authenticator data which contains information about the
|
|
@@ -107,24 +82,10 @@ export declare namespace createCredential {
|
|
|
107
82
|
* @param options - Options to construct the authenticator data.
|
|
108
83
|
* @returns The authenticator data.
|
|
109
84
|
*/
|
|
110
|
-
export declare
|
|
85
|
+
export declare const getAuthenticatorData: typeof Authenticator.getAuthenticatorData;
|
|
111
86
|
export declare namespace getAuthenticatorData {
|
|
112
|
-
type Options =
|
|
113
|
-
|
|
114
|
-
credential?: {
|
|
115
|
-
/** The credential ID as raw bytes. */
|
|
116
|
-
id: Uint8Array;
|
|
117
|
-
/** The P256 public key associated with the credential. */
|
|
118
|
-
publicKey: PublicKey.PublicKey;
|
|
119
|
-
} | undefined;
|
|
120
|
-
/** A bitfield that indicates various attributes that were asserted by the authenticator. [Read more](https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API/Authenticator_data#flags) */
|
|
121
|
-
flag?: number | undefined;
|
|
122
|
-
/** The [Relying Party ID](https://w3c.github.io/webauthn/#relying-party-identifier) that the credential is scoped to. */
|
|
123
|
-
rpId?: internal.PublicKeyCredentialRequestOptions['rpId'] | undefined;
|
|
124
|
-
/** A signature counter, if supported by the authenticator (set to 0 otherwise). */
|
|
125
|
-
signCount?: number | undefined;
|
|
126
|
-
};
|
|
127
|
-
type ErrorType = Errors.GlobalErrorType;
|
|
87
|
+
type Options = Authenticator.getAuthenticatorData.Options;
|
|
88
|
+
type ErrorType = Authenticator.getAuthenticatorData.ErrorType;
|
|
128
89
|
}
|
|
129
90
|
/**
|
|
130
91
|
* Constructs the Client Data in stringified JSON format which represents client data that
|
|
@@ -153,21 +114,10 @@ export declare namespace getAuthenticatorData {
|
|
|
153
114
|
* @param options - Options to construct the client data.
|
|
154
115
|
* @returns The client data.
|
|
155
116
|
*/
|
|
156
|
-
export declare
|
|
117
|
+
export declare const getClientDataJSON: typeof Authenticator.getClientDataJSON;
|
|
157
118
|
export declare namespace getClientDataJSON {
|
|
158
|
-
type Options =
|
|
159
|
-
|
|
160
|
-
challenge: Hex.Hex;
|
|
161
|
-
/** If set to `true`, it means that the calling context is an `<iframe>` that is not same origin with its ancestor frames. */
|
|
162
|
-
crossOrigin?: boolean | undefined;
|
|
163
|
-
/** Additional client data to include in the client data JSON. */
|
|
164
|
-
extraClientData?: Record<string, unknown> | undefined;
|
|
165
|
-
/** The fully qualified origin of the relying party which has been given by the client/browser to the authenticator. */
|
|
166
|
-
origin?: string | undefined;
|
|
167
|
-
/** The WebAuthn ceremony type. @default 'webauthn.get' */
|
|
168
|
-
type?: 'webauthn.create' | 'webauthn.get' | undefined;
|
|
169
|
-
};
|
|
170
|
-
type ErrorType = Errors.GlobalErrorType;
|
|
119
|
+
type Options = Authenticator.getClientDataJSON.Options;
|
|
120
|
+
type ErrorType = Authenticator.getClientDataJSON.ErrorType;
|
|
171
121
|
}
|
|
172
122
|
/**
|
|
173
123
|
* Constructs a CBOR-encoded attestation object for testing WebAuthn registration
|
|
@@ -198,17 +148,10 @@ export declare namespace getClientDataJSON {
|
|
|
198
148
|
* @param options - Options to construct the attestation object.
|
|
199
149
|
* @returns The CBOR-encoded attestation object as a Hex string.
|
|
200
150
|
*/
|
|
201
|
-
export declare
|
|
151
|
+
export declare const getAttestationObject: typeof Authenticator.getAttestationObject;
|
|
202
152
|
export declare namespace getAttestationObject {
|
|
203
|
-
type Options =
|
|
204
|
-
|
|
205
|
-
attStmt?: Record<string, unknown> | undefined;
|
|
206
|
-
/** Authenticator data as a Hex string (from {@link ox#WebAuthnP256.(getAuthenticatorData:function)}). */
|
|
207
|
-
authData: Hex.Hex;
|
|
208
|
-
/** Attestation format. @default 'none' */
|
|
209
|
-
fmt?: string | undefined;
|
|
210
|
-
};
|
|
211
|
-
type ErrorType = Cbor.encode.ErrorType | Errors.GlobalErrorType;
|
|
153
|
+
type Options = Authenticator.getAttestationObject.Options;
|
|
154
|
+
type ErrorType = Authenticator.getAttestationObject.ErrorType;
|
|
212
155
|
}
|
|
213
156
|
/**
|
|
214
157
|
* Returns the creation options for a P256 WebAuthn Credential to be used with
|
|
@@ -226,58 +169,10 @@ export declare namespace getAttestationObject {
|
|
|
226
169
|
* @param options - Options.
|
|
227
170
|
* @returns The credential creation options.
|
|
228
171
|
*/
|
|
229
|
-
export declare
|
|
172
|
+
export declare const getCredentialCreationOptions: typeof Registration.getOptions;
|
|
230
173
|
export declare namespace getCredentialCreationOptions {
|
|
231
|
-
type Options =
|
|
232
|
-
|
|
233
|
-
* A string specifying the relying party's preference for how the attestation statement
|
|
234
|
-
* (i.e., provision of verifiable evidence of the authenticity of the authenticator and its data)
|
|
235
|
-
* is conveyed during credential creation.
|
|
236
|
-
*/
|
|
237
|
-
attestation?: internal.PublicKeyCredentialCreationOptions['attestation'] | undefined;
|
|
238
|
-
/**
|
|
239
|
-
* An object whose properties are criteria used to filter out the potential authenticators
|
|
240
|
-
* for the credential creation operation.
|
|
241
|
-
*/
|
|
242
|
-
authenticatorSelection?: internal.PublicKeyCredentialCreationOptions['authenticatorSelection'] | undefined;
|
|
243
|
-
/**
|
|
244
|
-
* An `ArrayBuffer`, `TypedArray`, or `DataView` used as a cryptographic challenge.
|
|
245
|
-
*/
|
|
246
|
-
challenge?: Hex.Hex | internal.PublicKeyCredentialCreationOptions['challenge'] | undefined;
|
|
247
|
-
/**
|
|
248
|
-
* List of credential IDs to exclude from the creation. This property can be used
|
|
249
|
-
* to prevent creation of a credential if it already exists.
|
|
250
|
-
*/
|
|
251
|
-
excludeCredentialIds?: readonly string[] | undefined;
|
|
252
|
-
/**
|
|
253
|
-
* List of Web Authentication API credentials to use during creation or authentication.
|
|
254
|
-
*/
|
|
255
|
-
extensions?: internal.PublicKeyCredentialCreationOptions['extensions'] | undefined;
|
|
256
|
-
/**
|
|
257
|
-
* An object describing the relying party that requested the credential creation
|
|
258
|
-
*/
|
|
259
|
-
rp?: {
|
|
260
|
-
id: string;
|
|
261
|
-
name: string;
|
|
262
|
-
} | undefined;
|
|
263
|
-
/**
|
|
264
|
-
* A numerical hint, in milliseconds, which indicates the time the calling web app is willing to wait for the creation operation to complete.
|
|
265
|
-
*/
|
|
266
|
-
timeout?: internal.PublicKeyCredentialCreationOptions['timeout'] | undefined;
|
|
267
|
-
} & OneOf<{
|
|
268
|
-
/** Name for the credential (user.name). */
|
|
269
|
-
name: string;
|
|
270
|
-
} | {
|
|
271
|
-
/**
|
|
272
|
-
* An object describing the user account for which the credential is generated.
|
|
273
|
-
*/
|
|
274
|
-
user: {
|
|
275
|
-
displayName?: string;
|
|
276
|
-
id?: BufferSource;
|
|
277
|
-
name: string;
|
|
278
|
-
};
|
|
279
|
-
}>;
|
|
280
|
-
type ErrorType = Base64.toBytes.ErrorType | Hash.keccak256.ErrorType | Bytes.fromString.ErrorType | Errors.GlobalErrorType;
|
|
174
|
+
type Options = Registration.getOptions.Options;
|
|
175
|
+
type ErrorType = Registration.getOptions.ErrorType;
|
|
281
176
|
}
|
|
282
177
|
/**
|
|
283
178
|
* Returns the request options to sign a challenge with the Web Authentication API.
|
|
@@ -296,21 +191,10 @@ export declare namespace getCredentialCreationOptions {
|
|
|
296
191
|
* @param options - Options.
|
|
297
192
|
* @returns The credential request options.
|
|
298
193
|
*/
|
|
299
|
-
export declare
|
|
194
|
+
export declare const getCredentialRequestOptions: typeof Authentication.getOptions;
|
|
300
195
|
export declare namespace getCredentialRequestOptions {
|
|
301
|
-
type Options =
|
|
302
|
-
|
|
303
|
-
credentialId?: string | string[] | undefined;
|
|
304
|
-
/** The challenge to sign. */
|
|
305
|
-
challenge: Hex.Hex;
|
|
306
|
-
/** List of Web Authentication API credentials to use during creation or authentication. */
|
|
307
|
-
extensions?: internal.PublicKeyCredentialRequestOptions['extensions'] | undefined;
|
|
308
|
-
/** The relying party identifier to use. */
|
|
309
|
-
rpId?: internal.PublicKeyCredentialRequestOptions['rpId'] | undefined;
|
|
310
|
-
/** The user verification requirement. */
|
|
311
|
-
userVerification?: internal.PublicKeyCredentialRequestOptions['userVerification'] | undefined;
|
|
312
|
-
};
|
|
313
|
-
type ErrorType = Bytes.fromHex.ErrorType | Base64.toBytes.ErrorType | Errors.GlobalErrorType;
|
|
196
|
+
type Options = Authentication.getOptions.Options;
|
|
197
|
+
type ErrorType = Authentication.getOptions.ErrorType;
|
|
314
198
|
}
|
|
315
199
|
/**
|
|
316
200
|
* Constructs the final digest that was signed and computed by the authenticator. This payload includes
|
|
@@ -355,33 +239,11 @@ export declare namespace getCredentialRequestOptions {
|
|
|
355
239
|
* @param options - Options to construct the signing payload.
|
|
356
240
|
* @returns The signing payload.
|
|
357
241
|
*/
|
|
358
|
-
export declare
|
|
242
|
+
export declare const getSignPayload: typeof Authentication.getSignPayload;
|
|
359
243
|
export declare namespace getSignPayload {
|
|
360
|
-
type Options =
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
/** If set to `true`, it means that the calling context is an `<iframe>` that is not same origin with its ancestor frames. */
|
|
364
|
-
crossOrigin?: boolean | undefined;
|
|
365
|
-
/** Additional client data to include in the client data JSON. */
|
|
366
|
-
extraClientData?: Record<string, unknown> | undefined;
|
|
367
|
-
/** If set to `true`, the payload will be hashed before being returned. */
|
|
368
|
-
hash?: boolean | undefined;
|
|
369
|
-
/** A bitfield that indicates various attributes that were asserted by the authenticator. [Read more](https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API/Authenticator_data#flags) */
|
|
370
|
-
flag?: number | undefined;
|
|
371
|
-
/** The fully qualified origin of the relying party which has been given by the client/browser to the authenticator. */
|
|
372
|
-
origin?: string | undefined;
|
|
373
|
-
/** The [Relying Party ID](https://w3c.github.io/webauthn/#relying-party-identifier) that the credential is scoped to. */
|
|
374
|
-
rpId?: internal.PublicKeyCredentialRequestOptions['rpId'] | undefined;
|
|
375
|
-
/** A signature counter, if supported by the authenticator (set to 0 otherwise). */
|
|
376
|
-
signCount?: number | undefined;
|
|
377
|
-
/** The user verification requirement that the authenticator will enforce. */
|
|
378
|
-
userVerification?: internal.PublicKeyCredentialRequestOptions['userVerification'] | undefined;
|
|
379
|
-
};
|
|
380
|
-
type ReturnType = {
|
|
381
|
-
metadata: SignMetadata;
|
|
382
|
-
payload: Hex.Hex;
|
|
383
|
-
};
|
|
384
|
-
type ErrorType = Hash.sha256.ErrorType | Hex.concat.ErrorType | Hex.fromString.ErrorType | getAuthenticatorData.ErrorType | getClientDataJSON.ErrorType | Errors.GlobalErrorType;
|
|
244
|
+
type Options = Authentication.getSignPayload.Options;
|
|
245
|
+
type ReturnType = Authentication.getSignPayload.ReturnType;
|
|
246
|
+
type ErrorType = Authentication.getSignPayload.ErrorType;
|
|
385
247
|
}
|
|
386
248
|
/**
|
|
387
249
|
* Signs a challenge using a stored WebAuthn P256 Credential. If no Credential is provided,
|
|
@@ -417,21 +279,9 @@ export declare namespace getSignPayload {
|
|
|
417
279
|
*/
|
|
418
280
|
export declare function sign(options: sign.Options): Promise<sign.ReturnType>;
|
|
419
281
|
export declare namespace sign {
|
|
420
|
-
type Options =
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
* the WebAuthn API natively (i.e. React Native or testing environments).
|
|
424
|
-
*
|
|
425
|
-
* @default window.navigator.credentials.get
|
|
426
|
-
*/
|
|
427
|
-
getFn?: ((options?: internal.CredentialRequestOptions | undefined) => Promise<internal.Credential | null>) | undefined;
|
|
428
|
-
};
|
|
429
|
-
type ReturnType = {
|
|
430
|
-
metadata: SignMetadata;
|
|
431
|
-
raw: internal.PublicKeyCredential;
|
|
432
|
-
signature: Signature.Signature<false>;
|
|
433
|
-
};
|
|
434
|
-
type ErrorType = Hex.fromBytes.ErrorType | getCredentialRequestOptions.ErrorType | Errors.GlobalErrorType;
|
|
282
|
+
type Options = Authentication.sign.Options;
|
|
283
|
+
type ReturnType = Authentication.sign.ReturnType;
|
|
284
|
+
type ErrorType = Authentication.sign.ErrorType;
|
|
435
285
|
}
|
|
436
286
|
/**
|
|
437
287
|
* Verifies a signature using the Credential's public key and the challenge which was signed.
|
|
@@ -463,33 +313,8 @@ export declare namespace sign {
|
|
|
463
313
|
*/
|
|
464
314
|
export declare function verify(options: verify.Options): boolean;
|
|
465
315
|
export declare namespace verify {
|
|
466
|
-
type Options =
|
|
467
|
-
|
|
468
|
-
challenge: Hex.Hex;
|
|
469
|
-
/** If set to `true`, the payload will be hashed (sha256) before being verified. */
|
|
470
|
-
hash?: boolean | undefined;
|
|
471
|
-
/** The public key to verify the signature with. */
|
|
472
|
-
publicKey: PublicKey.PublicKey;
|
|
473
|
-
/** The signature to verify. */
|
|
474
|
-
signature: Signature.Signature<false>;
|
|
475
|
-
/** The metadata to verify the signature with. */
|
|
476
|
-
metadata: SignMetadata;
|
|
477
|
-
};
|
|
478
|
-
type ErrorType = Base64.toBytes.ErrorType | Bytes.concat.ErrorType | Bytes.fromHex.ErrorType | P256.verify.ErrorType | Errors.GlobalErrorType;
|
|
316
|
+
type Options = Authentication.verify.Options;
|
|
317
|
+
type ErrorType = Authentication.verify.ErrorType;
|
|
479
318
|
}
|
|
480
|
-
|
|
481
|
-
export declare class CredentialCreationFailedError extends Errors.BaseError<Error> {
|
|
482
|
-
readonly name = "WebAuthnP256.CredentialCreationFailedError";
|
|
483
|
-
constructor({ cause }?: {
|
|
484
|
-
cause?: Error | undefined;
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
/** Thrown when a WebAuthn P256 credential request fails. */
|
|
488
|
-
export declare class CredentialRequestFailedError extends Errors.BaseError<Error> {
|
|
489
|
-
readonly name = "WebAuthnP256.CredentialRequestFailedError";
|
|
490
|
-
constructor({ cause }?: {
|
|
491
|
-
cause?: Error | undefined;
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
export type { AttestationConveyancePreference, AuthenticationExtensionsClientInputs, AuthenticatorAttachment, AuthenticatorSelectionCriteria, AuthenticatorTransport, BufferSource, COSEAlgorithmIdentifier, Credential, CredentialCreationOptions, CredentialMediationRequirement, CredentialRequestOptions, LargeBlobSupport, PrfExtension, PublicKeyCredential, PublicKeyCredentialCreationOptions, PublicKeyCredentialDescriptor, PublicKeyCredentialEntity, PublicKeyCredentialParameters, PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, PublicKeyCredentialType, PublicKeyCredentialUserEntity, ResidentKeyRequirement, UserVerificationRequirement, } from './internal/webauthn.js';
|
|
319
|
+
export type { AttestationConveyancePreference, AuthenticationExtensionsClientInputs, AuthenticatorAttachment, AuthenticatorSelectionCriteria, AuthenticatorTransport, BufferSource, COSEAlgorithmIdentifier, Credential, CredentialCreationOptions, CredentialMediationRequirement, CredentialRequestOptions, LargeBlobSupport, PrfExtension, PublicKeyCredential, PublicKeyCredentialCreationOptions, PublicKeyCredentialDescriptor, PublicKeyCredentialEntity, PublicKeyCredentialParameters, PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, PublicKeyCredentialType, PublicKeyCredentialUserEntity, ResidentKeyRequirement, UserVerificationRequirement, } from '../webauthn/Types.js';
|
|
495
320
|
//# sourceMappingURL=WebAuthnP256.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebAuthnP256.d.ts","sourceRoot":"","sources":["../../core/WebAuthnP256.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"WebAuthnP256.d.ts","sourceRoot":"","sources":["../../core/WebAuthnP256.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,aAAa,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,KAAK,WAAW,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,YAAY,MAAM,6BAA6B,CAAA;AAE3D,2CAA2C;AAC3C,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,UAAU,CAAA;AAEnD,8CAA8C;AAC9C,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,CAAA;AAEnD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AEvD;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,KAAK,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,OAAO,CAAA;IAE5C,KAAK,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC,SAAS,CAAA;CACjD;AAGD,YAAY,EACV,+BAA+B,EAC/B,oCAAoC,EACpC,uBAAuB,EACvB,8BAA8B,EAC9B,sBAAsB,EACtB,YAAY,EACZ,uBAAuB,EACvB,UAAU,EACV,yBAAyB,EACzB,8BAA8B,EAC9B,wBAAwB,EACxB,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,kCAAkC,EAClC,6BAA6B,EAC7B,yBAAyB,EACzB,6BAA6B,EAC7B,iCAAiC,EACjC,2BAA2B,EAC3B,uBAAuB,EACvB,6BAA6B,EAC7B,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,sBAAsB,CAAA"}
|
|
@@ -173,6 +173,8 @@ export declare namespace sign {
|
|
|
173
173
|
export declare function verify(options: verify.Options): Promise<boolean>;
|
|
174
174
|
export declare namespace verify {
|
|
175
175
|
type Options = {
|
|
176
|
+
/** If set to `true`, only low-S signatures will be accepted. @default true */
|
|
177
|
+
lowS?: boolean | undefined;
|
|
176
178
|
/** Public key that signed the payload. */
|
|
177
179
|
publicKey: PublicKey.PublicKey<boolean>;
|
|
178
180
|
/** Signature of the payload. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebCryptoP256.d.ts","sourceRoot":"","sources":["../../core/WebCryptoP256.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,KAAK,MAAM,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,KAAK,SAAS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OAAO,WAAW,IAAI,CAAC;IAC5B,KAAK,OAAO,GAAG;QACb,uBAAuB;QACvB,OAAO,EAAE,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,KAAK,CAAA;QAC9B,yBAAyB;QACzB,UAAU,EAAE,SAAS,CAAA;KACtB,CAAA;IAED,KAAK,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,MAAM,CAAC,eAAe,CAAA;CACpE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAuBtE;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,KAAK,OAAO,GAAG;QACb,8EAA8E;QAC9E,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QAC1B,0CAA0C;QAC1C,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;QACvC,gCAAgC;QAChC,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;QACrC,+BAA+B;QAC/B,OAAO,EAAE,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,KAAK,CAAA;KAC/B,CAAA;IAED,KAAK,SAAS,GAAG,MAAM,CAAC,eAAe,CAAA;CACxC"}
|
|
@@ -1,114 +1,6 @@
|
|
|
1
|
+
import * as Registration from '../../webauthn/Registration.js';
|
|
1
2
|
import type * as Errors from '../Errors.js';
|
|
2
3
|
import * as PublicKey from '../PublicKey.js';
|
|
3
|
-
import { CredentialCreationFailedError } from '../WebAuthnP256.js';
|
|
4
|
-
/** @internal */
|
|
5
|
-
export type AttestationConveyancePreference = 'direct' | 'enterprise' | 'indirect' | 'none';
|
|
6
|
-
/** @internal */
|
|
7
|
-
export type AuthenticatorAttachment = 'cross-platform' | 'platform';
|
|
8
|
-
/** @internal */
|
|
9
|
-
export type AuthenticatorTransport = 'ble' | 'hybrid' | 'internal' | 'nfc' | 'usb';
|
|
10
|
-
/** @internal */
|
|
11
|
-
export type COSEAlgorithmIdentifier = number;
|
|
12
|
-
/** @internal */
|
|
13
|
-
export type CredentialMediationRequirement = 'conditional' | 'optional' | 'required' | 'silent';
|
|
14
|
-
/** @internal */
|
|
15
|
-
export type PublicKeyCredentialType = 'public-key';
|
|
16
|
-
/** @internal */
|
|
17
|
-
export type ResidentKeyRequirement = 'discouraged' | 'preferred' | 'required';
|
|
18
|
-
/** @internal */
|
|
19
|
-
export type UserVerificationRequirement = 'discouraged' | 'preferred' | 'required';
|
|
20
|
-
/** @internal */
|
|
21
|
-
export type LargeBlobSupport = {
|
|
22
|
-
support: 'required' | 'preferred';
|
|
23
|
-
};
|
|
24
|
-
/** @internal */
|
|
25
|
-
export type BufferSource = ArrayBufferView | ArrayBuffer;
|
|
26
|
-
/** @internal */
|
|
27
|
-
export type PrfExtension = Record<'eval', Record<'first', Uint8Array>>;
|
|
28
|
-
/** @internal */
|
|
29
|
-
export interface AuthenticationExtensionsClientInputs {
|
|
30
|
-
appid?: string;
|
|
31
|
-
credProps?: boolean;
|
|
32
|
-
hmacCreateSecret?: boolean;
|
|
33
|
-
minPinLength?: boolean;
|
|
34
|
-
prf?: PrfExtension;
|
|
35
|
-
largeBlob?: LargeBlobSupport;
|
|
36
|
-
}
|
|
37
|
-
/** @internal */
|
|
38
|
-
export interface AuthenticatorSelectionCriteria {
|
|
39
|
-
authenticatorAttachment?: AuthenticatorAttachment;
|
|
40
|
-
requireResidentKey?: boolean;
|
|
41
|
-
residentKey?: ResidentKeyRequirement;
|
|
42
|
-
userVerification?: UserVerificationRequirement;
|
|
43
|
-
}
|
|
44
|
-
/** @internal */
|
|
45
|
-
export interface Credential {
|
|
46
|
-
readonly id: string;
|
|
47
|
-
readonly type: string;
|
|
48
|
-
}
|
|
49
|
-
/** @internal */
|
|
50
|
-
export interface CredentialCreationOptions {
|
|
51
|
-
publicKey?: PublicKeyCredentialCreationOptions;
|
|
52
|
-
signal?: AbortSignal;
|
|
53
|
-
}
|
|
54
|
-
/** @internal */
|
|
55
|
-
export interface CredentialRequestOptions {
|
|
56
|
-
mediation?: CredentialMediationRequirement;
|
|
57
|
-
publicKey?: PublicKeyCredentialRequestOptions;
|
|
58
|
-
signal?: AbortSignal;
|
|
59
|
-
}
|
|
60
|
-
/** @internal */
|
|
61
|
-
export interface PublicKeyCredential extends Credential {
|
|
62
|
-
readonly authenticatorAttachment: string | null;
|
|
63
|
-
readonly rawId: ArrayBuffer;
|
|
64
|
-
readonly response: AuthenticatorResponse;
|
|
65
|
-
getClientExtensionResults(): AuthenticationExtensionsClientOutputs;
|
|
66
|
-
}
|
|
67
|
-
/** @internal */
|
|
68
|
-
export interface PublicKeyCredentialCreationOptions {
|
|
69
|
-
attestation?: AttestationConveyancePreference;
|
|
70
|
-
authenticatorSelection?: AuthenticatorSelectionCriteria;
|
|
71
|
-
challenge: BufferSource;
|
|
72
|
-
excludeCredentials?: PublicKeyCredentialDescriptor[];
|
|
73
|
-
extensions?: AuthenticationExtensionsClientInputs;
|
|
74
|
-
pubKeyCredParams: PublicKeyCredentialParameters[];
|
|
75
|
-
rp: PublicKeyCredentialRpEntity;
|
|
76
|
-
timeout?: number;
|
|
77
|
-
user: PublicKeyCredentialUserEntity;
|
|
78
|
-
}
|
|
79
|
-
/** @internal */
|
|
80
|
-
export interface PublicKeyCredentialDescriptor {
|
|
81
|
-
id: BufferSource;
|
|
82
|
-
transports?: AuthenticatorTransport[];
|
|
83
|
-
type: PublicKeyCredentialType;
|
|
84
|
-
}
|
|
85
|
-
/** @internal */
|
|
86
|
-
export interface PublicKeyCredentialEntity {
|
|
87
|
-
name: string;
|
|
88
|
-
}
|
|
89
|
-
/** @internal */
|
|
90
|
-
export interface PublicKeyCredentialParameters {
|
|
91
|
-
alg: COSEAlgorithmIdentifier;
|
|
92
|
-
type: PublicKeyCredentialType;
|
|
93
|
-
}
|
|
94
|
-
/** @internal */
|
|
95
|
-
export interface PublicKeyCredentialRequestOptions {
|
|
96
|
-
allowCredentials?: PublicKeyCredentialDescriptor[];
|
|
97
|
-
challenge: BufferSource;
|
|
98
|
-
extensions?: AuthenticationExtensionsClientInputs;
|
|
99
|
-
rpId?: string;
|
|
100
|
-
timeout?: number;
|
|
101
|
-
userVerification?: UserVerificationRequirement;
|
|
102
|
-
}
|
|
103
|
-
/** @internal */
|
|
104
|
-
export interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity {
|
|
105
|
-
id?: string;
|
|
106
|
-
}
|
|
107
|
-
/** @internal */
|
|
108
|
-
export interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity {
|
|
109
|
-
displayName: string;
|
|
110
|
-
id: BufferSource;
|
|
111
|
-
}
|
|
112
4
|
/**
|
|
113
5
|
* Parses an ASN.1 signature into a r and s value.
|
|
114
6
|
*
|
|
@@ -126,6 +18,6 @@ export declare function parseAsn1Signature(bytes: Uint8Array): {
|
|
|
126
18
|
*/
|
|
127
19
|
export declare function parseCredentialPublicKey(response: AuthenticatorAttestationResponse): Promise<PublicKey.PublicKey>;
|
|
128
20
|
export declare namespace parseCredentialPublicKey {
|
|
129
|
-
type ErrorType =
|
|
21
|
+
type ErrorType = Registration.CreateFailedError | Errors.GlobalErrorType;
|
|
130
22
|
}
|
|
131
23
|
//# sourceMappingURL=webauthn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webauthn.d.ts","sourceRoot":"","sources":["../../../core/internal/webauthn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"webauthn.d.ts","sourceRoot":"","sources":["../../../core/internal/webauthn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAA;AAC9D,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAE5C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU;;;EAGnD;AAED;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,gCAAgC,GACzC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,CAoD9B;AAED,MAAM,CAAC,OAAO,WAAW,wBAAwB,CAAC;IAChD,KAAK,SAAS,GAAG,YAAY,CAAC,iBAAiB,GAAG,MAAM,CAAC,eAAe,CAAA;CACzE"}
|
|
@@ -15,7 +15,7 @@ export type {};
|
|
|
15
15
|
*
|
|
16
16
|
* const dataSuffix2 = Attribution.toDataSuffix({
|
|
17
17
|
* codes: ['baseapp', 'morpho'],
|
|
18
|
-
*
|
|
18
|
+
* codeRegistry: { address: '0x0000000000000000000000000000000000000000', chainId: 1 },
|
|
19
19
|
* })
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
@@ -28,7 +28,7 @@ export type {};
|
|
|
28
28
|
* const attribution = Attribution.fromData('0x...')
|
|
29
29
|
*
|
|
30
30
|
* console.log(attribution)
|
|
31
|
-
* // @log: { codes: ['baseapp', 'morpho'],
|
|
31
|
+
* // @log: { codes: ['baseapp', 'morpho'], codeRegistry: { address: '0x...', chainId: 1 } }
|
|
32
32
|
* ```
|
|
33
33
|
*
|
|
34
34
|
* @category ERC-8021
|
package/_types/index.docs.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.docs.d.ts","sourceRoot":"","sources":["../index.docs.ts"],"names":[],"mappings":"AACA,2FAA2F;AAE3F,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.docs.d.ts","sourceRoot":"","sources":["../index.docs.ts"],"names":[],"mappings":"AACA,2FAA2F;AAE3F,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA"}
|