@coinbase/cdp-core 0.0.58 → 0.0.60
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/dist/esm/index.native.js +55 -54
- package/dist/esm/index.native103.js +1 -1
- package/dist/esm/index.native115.js +1 -1
- package/dist/esm/index.native127.js +1 -1
- package/dist/esm/index.native141.js +46 -3
- package/dist/esm/index.native142.js +3 -46
- package/dist/esm/index.native16.js +8 -0
- package/dist/esm/index.native164.js +1 -1
- package/dist/esm/index.native29.js +10 -2
- package/dist/esm/index.native47.js +1 -1
- package/dist/esm/index.native7.js +52 -51
- package/dist/esm/index.web.js +59 -58
- package/dist/esm/index.web100.js +2 -4
- package/dist/esm/index.web101.js +44 -19
- package/dist/esm/index.web102.js +13 -8
- package/dist/esm/index.web103.js +2 -8
- package/dist/esm/index.web104.js +4 -71
- package/dist/esm/index.web105.js +12 -12
- package/dist/esm/index.web106.js +7 -3
- package/dist/esm/index.web107.js +3 -4
- package/dist/esm/index.web108.js +19 -4
- package/dist/esm/index.web109.js +8 -4
- package/dist/esm/index.web110.js +7 -19
- package/dist/esm/index.web111.js +66 -47
- package/dist/esm/index.web112.js +18 -17
- package/dist/esm/index.web113.js +3 -20
- package/dist/esm/index.web114.js +4 -8
- package/dist/esm/index.web115.js +4 -30
- package/dist/esm/index.web116.js +4 -7
- package/dist/esm/index.web117.js +10 -11
- package/dist/esm/index.web118.js +52 -4
- package/dist/esm/index.web119.js +17 -54
- package/dist/esm/index.web120.js +20 -10
- package/dist/esm/index.web121.js +9 -2
- package/dist/esm/index.web122.js +30 -44
- package/dist/esm/index.web123.js +7 -13
- package/dist/esm/index.web124.js +21 -2
- package/dist/esm/index.web126.js +2 -2
- package/dist/esm/index.web131.js +32 -6
- package/dist/esm/index.web132.js +6 -32
- package/dist/esm/index.web137.js +3 -46
- package/dist/esm/index.web138.js +20 -3
- package/dist/esm/index.web139.js +10 -21
- package/dist/esm/index.web140.js +19 -9
- package/dist/esm/index.web141.js +89 -15
- package/dist/esm/index.web142.js +19 -92
- package/dist/esm/index.web143.js +115 -18
- package/dist/esm/index.web144.js +44 -115
- package/dist/esm/index.web145.js +7 -38
- package/dist/esm/index.web147.js +375 -67
- package/dist/esm/index.web148.js +832 -34
- package/dist/esm/index.web149.js +38 -20
- package/dist/esm/index.web15.js +8 -0
- package/dist/esm/index.web150.js +2 -8
- package/dist/esm/index.web151.js +70 -2
- package/dist/esm/index.web152.js +30 -373
- package/dist/esm/index.web153.js +20 -832
- package/dist/esm/index.web155.js +17 -14
- package/dist/esm/index.web156.js +28 -18
- package/dist/esm/index.web157.js +6 -26
- package/dist/esm/index.web158.js +9 -6
- package/dist/esm/index.web159.js +13 -11
- package/dist/esm/index.web160.js +8 -11
- package/dist/esm/index.web161.js +14 -7
- package/dist/esm/index.web162.js +80 -16
- package/dist/esm/index.web163.js +14 -80
- package/dist/esm/index.web164.js +2 -2
- package/dist/esm/index.web165.js +2 -2
- package/dist/esm/index.web166.js +2 -2
- package/dist/esm/index.web23.js +1 -1
- package/dist/esm/index.web27.js +10 -2
- package/dist/esm/index.web40.js +1 -1
- package/dist/esm/index.web41.js +3 -3
- package/dist/esm/index.web46.js +377 -2
- package/dist/esm/index.web47.js +2 -379
- package/dist/esm/index.web48.js +65 -28
- package/dist/esm/index.web49.js +364 -28
- package/dist/esm/index.web50.js +4 -2
- package/dist/esm/index.web51.js +28 -65
- package/dist/esm/index.web52.js +28 -364
- package/dist/esm/index.web53.js +1 -1
- package/dist/esm/index.web55.js +4 -4
- package/dist/esm/index.web6.js +52 -51
- package/dist/esm/index.web73.js +1 -1
- package/dist/esm/index.web91.js +1 -1
- package/dist/esm/index.web92.js +1 -1
- package/dist/esm/index.web97.js +4 -4
- package/dist/esm/index.web98.js +53 -17
- package/dist/esm/index.web99.js +10 -7
- package/dist/native/index.native.js +55 -54
- package/dist/native/index.native103.js +1 -1
- package/dist/native/index.native115.js +1 -1
- package/dist/native/index.native127.js +1 -1
- package/dist/native/index.native141.js +46 -3
- package/dist/native/index.native142.js +3 -46
- package/dist/native/index.native16.js +8 -0
- package/dist/native/index.native164.js +1 -1
- package/dist/native/index.native29.js +10 -2
- package/dist/native/index.native47.js +1 -1
- package/dist/native/index.native7.js +52 -51
- package/dist/native-types/auth/authManager.d.ts +1 -0
- package/dist/native-types/auth/types.d.ts +1 -0
- package/dist/native-types/core.d.ts +1 -0
- package/dist/native-types/mocks/mockAuthManager.d.ts +1 -0
- package/dist/native-types/types.d.ts +4 -0
- package/dist/native-types/version.d.ts +1 -1
- package/dist/types/auth/authManager.d.ts +1 -0
- package/dist/types/auth/types.d.ts +1 -0
- package/dist/types/core.d.ts +1 -0
- package/dist/types/mocks/mockAuthManager.d.ts +1 -0
- package/dist/types/types.d.ts +4 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index.web.js +59 -58
- package/dist/web/index.web100.js +2 -4
- package/dist/web/index.web101.js +44 -19
- package/dist/web/index.web102.js +13 -8
- package/dist/web/index.web103.js +2 -8
- package/dist/web/index.web104.js +4 -71
- package/dist/web/index.web105.js +12 -12
- package/dist/web/index.web106.js +7 -3
- package/dist/web/index.web107.js +3 -4
- package/dist/web/index.web108.js +19 -4
- package/dist/web/index.web109.js +8 -4
- package/dist/web/index.web110.js +7 -19
- package/dist/web/index.web111.js +66 -47
- package/dist/web/index.web112.js +18 -17
- package/dist/web/index.web113.js +3 -20
- package/dist/web/index.web114.js +4 -8
- package/dist/web/index.web115.js +4 -30
- package/dist/web/index.web116.js +4 -7
- package/dist/web/index.web117.js +10 -11
- package/dist/web/index.web118.js +52 -4
- package/dist/web/index.web119.js +17 -54
- package/dist/web/index.web120.js +20 -10
- package/dist/web/index.web121.js +9 -2
- package/dist/web/index.web122.js +30 -44
- package/dist/web/index.web123.js +7 -13
- package/dist/web/index.web124.js +21 -2
- package/dist/web/index.web126.js +2 -2
- package/dist/web/index.web131.js +32 -6
- package/dist/web/index.web132.js +6 -32
- package/dist/web/index.web137.js +3 -46
- package/dist/web/index.web138.js +20 -3
- package/dist/web/index.web139.js +10 -21
- package/dist/web/index.web140.js +19 -9
- package/dist/web/index.web141.js +89 -15
- package/dist/web/index.web142.js +19 -92
- package/dist/web/index.web143.js +115 -18
- package/dist/web/index.web144.js +44 -115
- package/dist/web/index.web145.js +7 -38
- package/dist/web/index.web147.js +375 -67
- package/dist/web/index.web148.js +832 -34
- package/dist/web/index.web149.js +38 -20
- package/dist/web/index.web15.js +8 -0
- package/dist/web/index.web150.js +2 -8
- package/dist/web/index.web151.js +70 -2
- package/dist/web/index.web152.js +30 -373
- package/dist/web/index.web153.js +20 -832
- package/dist/web/index.web155.js +17 -14
- package/dist/web/index.web156.js +28 -18
- package/dist/web/index.web157.js +6 -26
- package/dist/web/index.web158.js +9 -6
- package/dist/web/index.web159.js +13 -11
- package/dist/web/index.web160.js +8 -11
- package/dist/web/index.web161.js +14 -7
- package/dist/web/index.web162.js +80 -16
- package/dist/web/index.web163.js +14 -80
- package/dist/web/index.web164.js +2 -2
- package/dist/web/index.web165.js +2 -2
- package/dist/web/index.web166.js +2 -2
- package/dist/web/index.web23.js +1 -1
- package/dist/web/index.web27.js +10 -2
- package/dist/web/index.web40.js +1 -1
- package/dist/web/index.web41.js +3 -3
- package/dist/web/index.web46.js +377 -2
- package/dist/web/index.web47.js +2 -379
- package/dist/web/index.web48.js +65 -28
- package/dist/web/index.web49.js +364 -28
- package/dist/web/index.web50.js +4 -2
- package/dist/web/index.web51.js +28 -65
- package/dist/web/index.web52.js +28 -364
- package/dist/web/index.web53.js +1 -1
- package/dist/web/index.web55.js +4 -4
- package/dist/web/index.web6.js +52 -51
- package/dist/web/index.web73.js +1 -1
- package/dist/web/index.web91.js +1 -1
- package/dist/web/index.web92.js +1 -1
- package/dist/web/index.web97.js +4 -4
- package/dist/web/index.web98.js +53 -17
- package/dist/web/index.web99.js +10 -7
- package/dist/web-types/auth/authManager.d.ts +1 -0
- package/dist/web-types/auth/types.d.ts +1 -0
- package/dist/web-types/core.d.ts +1 -0
- package/dist/web-types/mocks/mockAuthManager.d.ts +1 -0
- package/dist/web-types/types.d.ts +4 -0
- package/dist/web-types/version.d.ts +1 -1
- package/package.json +2 -2
package/dist/esm/index.web155.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
function o(t) {
|
|
2
|
+
if (Uint8Array.prototype.toBase64)
|
|
3
|
+
return t.toBase64();
|
|
4
|
+
const e = 32768, n = [];
|
|
5
|
+
for (let r = 0; r < t.length; r += e)
|
|
6
|
+
n.push(String.fromCharCode.apply(null, t.subarray(r, r + e)));
|
|
7
|
+
return btoa(n.join(""));
|
|
8
|
+
}
|
|
9
|
+
function a(t) {
|
|
10
|
+
if (Uint8Array.fromBase64)
|
|
11
|
+
return Uint8Array.fromBase64(t);
|
|
12
|
+
const e = atob(t), n = new Uint8Array(e.length);
|
|
13
|
+
for (let r = 0; r < e.length; r++)
|
|
14
|
+
n[r] = e.charCodeAt(r);
|
|
15
|
+
return n;
|
|
14
16
|
}
|
|
15
17
|
export {
|
|
16
|
-
|
|
18
|
+
a as decodeBase64,
|
|
19
|
+
o as encodeBase64
|
|
17
20
|
};
|
package/dist/esm/index.web156.js
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
1
|
+
import { JOSENotSupported as r } from "./index.web54.js";
|
|
2
|
+
const S = (e, s) => {
|
|
3
|
+
const a = `SHA-${e.slice(-3)}`;
|
|
4
|
+
switch (e) {
|
|
5
|
+
case "HS256":
|
|
6
|
+
case "HS384":
|
|
7
|
+
case "HS512":
|
|
8
|
+
return { hash: a, name: "HMAC" };
|
|
9
|
+
case "PS256":
|
|
10
|
+
case "PS384":
|
|
11
|
+
case "PS512":
|
|
12
|
+
return { hash: a, name: "RSA-PSS", saltLength: parseInt(e.slice(-3), 10) >> 3 };
|
|
13
|
+
case "RS256":
|
|
14
|
+
case "RS384":
|
|
15
|
+
case "RS512":
|
|
16
|
+
return { hash: a, name: "RSASSA-PKCS1-v1_5" };
|
|
17
|
+
case "ES256":
|
|
18
|
+
case "ES384":
|
|
19
|
+
case "ES512":
|
|
20
|
+
return { hash: a, name: "ECDSA", namedCurve: s.namedCurve };
|
|
21
|
+
case "Ed25519":
|
|
22
|
+
case "EdDSA":
|
|
23
|
+
return { name: "Ed25519" };
|
|
24
|
+
default:
|
|
25
|
+
throw new r(`alg ${e} is not supported either by JOSE or your javascript runtime`);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
17
28
|
export {
|
|
18
|
-
|
|
19
|
-
o as encodeBase64
|
|
29
|
+
S as default
|
|
20
30
|
};
|
package/dist/esm/index.web157.js
CHANGED
|
@@ -1,30 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
case "HS384":
|
|
7
|
-
case "HS512":
|
|
8
|
-
return { hash: a, name: "HMAC" };
|
|
9
|
-
case "PS256":
|
|
10
|
-
case "PS384":
|
|
11
|
-
case "PS512":
|
|
12
|
-
return { hash: a, name: "RSA-PSS", saltLength: parseInt(e.slice(-3), 10) >> 3 };
|
|
13
|
-
case "RS256":
|
|
14
|
-
case "RS384":
|
|
15
|
-
case "RS512":
|
|
16
|
-
return { hash: a, name: "RSASSA-PKCS1-v1_5" };
|
|
17
|
-
case "ES256":
|
|
18
|
-
case "ES384":
|
|
19
|
-
case "ES512":
|
|
20
|
-
return { hash: a, name: "ECDSA", namedCurve: s.namedCurve };
|
|
21
|
-
case "Ed25519":
|
|
22
|
-
case "EdDSA":
|
|
23
|
-
return { name: "Ed25519" };
|
|
24
|
-
default:
|
|
25
|
-
throw new r(`alg ${e} is not supported either by JOSE or your javascript runtime`);
|
|
1
|
+
const o = (t, r) => {
|
|
2
|
+
if (t.startsWith("RS") || t.startsWith("PS")) {
|
|
3
|
+
const { modulusLength: e } = r.algorithm;
|
|
4
|
+
if (typeof e != "number" || e < 2048)
|
|
5
|
+
throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`);
|
|
26
6
|
}
|
|
27
7
|
};
|
|
28
8
|
export {
|
|
29
|
-
|
|
9
|
+
o as default
|
|
30
10
|
};
|
package/dist/esm/index.web158.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { checkSigCryptoKey as i } from "./index.web167.js";
|
|
2
|
+
import o from "./index.web159.js";
|
|
3
|
+
const s = async (t, r, e) => {
|
|
4
|
+
if (r instanceof Uint8Array) {
|
|
5
|
+
if (!t.startsWith("HS"))
|
|
6
|
+
throw new TypeError(o(r, "CryptoKey", "KeyObject", "JSON Web Key"));
|
|
7
|
+
return crypto.subtle.importKey("raw", r, { hash: `SHA-${t.slice(-3)}`, name: "HMAC" }, !1, [e]);
|
|
6
8
|
}
|
|
9
|
+
return i(r, t, e), r;
|
|
7
10
|
};
|
|
8
11
|
export {
|
|
9
|
-
|
|
12
|
+
s as default
|
|
10
13
|
};
|
package/dist/esm/index.web159.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
1
|
+
function i(n, e, ...o) {
|
|
2
|
+
if (o = o.filter(Boolean), o.length > 2) {
|
|
3
|
+
const f = o.pop();
|
|
4
|
+
n += `one of type ${o.join(", ")}, or ${f}.`;
|
|
5
|
+
} else o.length === 2 ? n += `one of type ${o[0]} or ${o[1]}.` : n += `of type ${o[0]}.`;
|
|
6
|
+
return e == null ? n += ` Received ${e}` : typeof e == "function" && e.name ? n += ` Received function ${e.name}` : typeof e == "object" && e != null && e.constructor?.name && (n += ` Received an instance of ${e.constructor.name}`), n;
|
|
7
|
+
}
|
|
8
|
+
const r = (n, ...e) => i("Key must be ", n, ...e);
|
|
9
|
+
function t(n, e, ...o) {
|
|
10
|
+
return i(`Key for the ${n} algorithm must be `, e, ...o);
|
|
11
|
+
}
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
r as default,
|
|
14
|
+
t as withAlg
|
|
13
15
|
};
|
package/dist/esm/index.web160.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
const f = o.pop();
|
|
4
|
-
n += `one of type ${o.join(", ")}, or ${f}.`;
|
|
5
|
-
} else o.length === 2 ? n += `one of type ${o[0]} or ${o[1]}.` : n += `of type ${o[0]}.`;
|
|
6
|
-
return e == null ? n += ` Received ${e}` : typeof e == "function" && e.name ? n += ` Received function ${e.name}` : typeof e == "object" && e != null && e.constructor?.name && (n += ` Received an instance of ${e.constructor.name}`), n;
|
|
1
|
+
function e(t) {
|
|
2
|
+
return t?.[Symbol.toStringTag] === "CryptoKey";
|
|
7
3
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return i(`Key for the ${n} algorithm must be `, e, ...o);
|
|
4
|
+
function r(t) {
|
|
5
|
+
return t?.[Symbol.toStringTag] === "KeyObject";
|
|
11
6
|
}
|
|
7
|
+
const n = (t) => e(t) || r(t);
|
|
12
8
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
n as default,
|
|
10
|
+
e as isCryptoKey,
|
|
11
|
+
r as isKeyObject
|
|
15
12
|
};
|
package/dist/esm/index.web161.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
+
import n from "./index.web102.js";
|
|
2
|
+
function r(t) {
|
|
3
|
+
return n(t) && typeof t.kty == "string";
|
|
4
|
+
}
|
|
5
|
+
function o(t) {
|
|
6
|
+
return t.kty !== "oct" && typeof t.d == "string";
|
|
7
|
+
}
|
|
1
8
|
function e(t) {
|
|
2
|
-
return t
|
|
9
|
+
return t.kty !== "oct" && typeof t.d > "u";
|
|
3
10
|
}
|
|
4
|
-
function
|
|
5
|
-
return t
|
|
11
|
+
function c(t) {
|
|
12
|
+
return t.kty === "oct" && typeof t.k == "string";
|
|
6
13
|
}
|
|
7
|
-
const n = (t) => e(t) || r(t);
|
|
8
14
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
r as isJWK,
|
|
16
|
+
o as isPrivateJWK,
|
|
17
|
+
e as isPublicJWK,
|
|
18
|
+
c as isSecretJWK
|
|
12
19
|
};
|
package/dist/esm/index.web162.js
CHANGED
|
@@ -1,19 +1,83 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { JOSENotSupported as s } from "./index.web54.js";
|
|
2
|
+
function n(e) {
|
|
3
|
+
let a, r;
|
|
4
|
+
switch (e.kty) {
|
|
5
|
+
case "RSA": {
|
|
6
|
+
switch (e.alg) {
|
|
7
|
+
case "PS256":
|
|
8
|
+
case "PS384":
|
|
9
|
+
case "PS512":
|
|
10
|
+
a = { name: "RSA-PSS", hash: `SHA-${e.alg.slice(-3)}` }, r = e.d ? ["sign"] : ["verify"];
|
|
11
|
+
break;
|
|
12
|
+
case "RS256":
|
|
13
|
+
case "RS384":
|
|
14
|
+
case "RS512":
|
|
15
|
+
a = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${e.alg.slice(-3)}` }, r = e.d ? ["sign"] : ["verify"];
|
|
16
|
+
break;
|
|
17
|
+
case "RSA-OAEP":
|
|
18
|
+
case "RSA-OAEP-256":
|
|
19
|
+
case "RSA-OAEP-384":
|
|
20
|
+
case "RSA-OAEP-512":
|
|
21
|
+
a = {
|
|
22
|
+
name: "RSA-OAEP",
|
|
23
|
+
hash: `SHA-${parseInt(e.alg.slice(-3), 10) || 1}`
|
|
24
|
+
}, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
|
|
25
|
+
break;
|
|
26
|
+
default:
|
|
27
|
+
throw new s('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
28
|
+
}
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
case "EC": {
|
|
32
|
+
switch (e.alg) {
|
|
33
|
+
case "ES256":
|
|
34
|
+
a = { name: "ECDSA", namedCurve: "P-256" }, r = e.d ? ["sign"] : ["verify"];
|
|
35
|
+
break;
|
|
36
|
+
case "ES384":
|
|
37
|
+
a = { name: "ECDSA", namedCurve: "P-384" }, r = e.d ? ["sign"] : ["verify"];
|
|
38
|
+
break;
|
|
39
|
+
case "ES512":
|
|
40
|
+
a = { name: "ECDSA", namedCurve: "P-521" }, r = e.d ? ["sign"] : ["verify"];
|
|
41
|
+
break;
|
|
42
|
+
case "ECDH-ES":
|
|
43
|
+
case "ECDH-ES+A128KW":
|
|
44
|
+
case "ECDH-ES+A192KW":
|
|
45
|
+
case "ECDH-ES+A256KW":
|
|
46
|
+
a = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
|
|
47
|
+
break;
|
|
48
|
+
default:
|
|
49
|
+
throw new s('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case "OKP": {
|
|
54
|
+
switch (e.alg) {
|
|
55
|
+
case "Ed25519":
|
|
56
|
+
case "EdDSA":
|
|
57
|
+
a = { name: "Ed25519" }, r = e.d ? ["sign"] : ["verify"];
|
|
58
|
+
break;
|
|
59
|
+
case "ECDH-ES":
|
|
60
|
+
case "ECDH-ES+A128KW":
|
|
61
|
+
case "ECDH-ES+A192KW":
|
|
62
|
+
case "ECDH-ES+A256KW":
|
|
63
|
+
a = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
|
|
64
|
+
break;
|
|
65
|
+
default:
|
|
66
|
+
throw new s('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
default:
|
|
71
|
+
throw new s('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
|
|
72
|
+
}
|
|
73
|
+
return { algorithm: a, keyUsages: r };
|
|
13
74
|
}
|
|
75
|
+
const i = async (e) => {
|
|
76
|
+
if (!e.alg)
|
|
77
|
+
throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
|
|
78
|
+
const { algorithm: a, keyUsages: r } = n(e), t = { ...e };
|
|
79
|
+
return delete t.alg, delete t.use, crypto.subtle.importKey("jwk", t, a, e.ext ?? !e.d, e.key_ops ?? r);
|
|
80
|
+
};
|
|
14
81
|
export {
|
|
15
|
-
|
|
16
|
-
o as isPrivateJWK,
|
|
17
|
-
e as isPublicJWK,
|
|
18
|
-
c as isSecretJWK
|
|
82
|
+
i as default
|
|
19
83
|
};
|
package/dist/esm/index.web163.js
CHANGED
|
@@ -1,83 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
case "RS512":
|
|
15
|
-
a = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${e.alg.slice(-3)}` }, r = e.d ? ["sign"] : ["verify"];
|
|
16
|
-
break;
|
|
17
|
-
case "RSA-OAEP":
|
|
18
|
-
case "RSA-OAEP-256":
|
|
19
|
-
case "RSA-OAEP-384":
|
|
20
|
-
case "RSA-OAEP-512":
|
|
21
|
-
a = {
|
|
22
|
-
name: "RSA-OAEP",
|
|
23
|
-
hash: `SHA-${parseInt(e.alg.slice(-3), 10) || 1}`
|
|
24
|
-
}, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
|
|
25
|
-
break;
|
|
26
|
-
default:
|
|
27
|
-
throw new s('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
28
|
-
}
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
case "EC": {
|
|
32
|
-
switch (e.alg) {
|
|
33
|
-
case "ES256":
|
|
34
|
-
a = { name: "ECDSA", namedCurve: "P-256" }, r = e.d ? ["sign"] : ["verify"];
|
|
35
|
-
break;
|
|
36
|
-
case "ES384":
|
|
37
|
-
a = { name: "ECDSA", namedCurve: "P-384" }, r = e.d ? ["sign"] : ["verify"];
|
|
38
|
-
break;
|
|
39
|
-
case "ES512":
|
|
40
|
-
a = { name: "ECDSA", namedCurve: "P-521" }, r = e.d ? ["sign"] : ["verify"];
|
|
41
|
-
break;
|
|
42
|
-
case "ECDH-ES":
|
|
43
|
-
case "ECDH-ES+A128KW":
|
|
44
|
-
case "ECDH-ES+A192KW":
|
|
45
|
-
case "ECDH-ES+A256KW":
|
|
46
|
-
a = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
|
|
47
|
-
break;
|
|
48
|
-
default:
|
|
49
|
-
throw new s('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
50
|
-
}
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
case "OKP": {
|
|
54
|
-
switch (e.alg) {
|
|
55
|
-
case "Ed25519":
|
|
56
|
-
case "EdDSA":
|
|
57
|
-
a = { name: "Ed25519" }, r = e.d ? ["sign"] : ["verify"];
|
|
58
|
-
break;
|
|
59
|
-
case "ECDH-ES":
|
|
60
|
-
case "ECDH-ES+A128KW":
|
|
61
|
-
case "ECDH-ES+A192KW":
|
|
62
|
-
case "ECDH-ES+A256KW":
|
|
63
|
-
a = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
|
|
64
|
-
break;
|
|
65
|
-
default:
|
|
66
|
-
throw new s('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
67
|
-
}
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
default:
|
|
71
|
-
throw new s('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
|
|
72
|
-
}
|
|
73
|
-
return { algorithm: a, keyUsages: r };
|
|
1
|
+
import { SizeExceedsPaddingSizeError as a } from "./index.web144.js";
|
|
2
|
+
function o(r, i = {}) {
|
|
3
|
+
const { dir: n, size: e = 32 } = i;
|
|
4
|
+
if (e === 0)
|
|
5
|
+
return r;
|
|
6
|
+
const t = r.replace("0x", "");
|
|
7
|
+
if (t.length > e * 2)
|
|
8
|
+
throw new a({
|
|
9
|
+
size: Math.ceil(t.length / 2),
|
|
10
|
+
targetSize: e,
|
|
11
|
+
type: "Hex"
|
|
12
|
+
});
|
|
13
|
+
return `0x${t[n === "right" ? "padEnd" : "padStart"](e * 2, "0")}`;
|
|
74
14
|
}
|
|
75
|
-
const i = async (e) => {
|
|
76
|
-
if (!e.alg)
|
|
77
|
-
throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
|
|
78
|
-
const { algorithm: a, keyUsages: r } = n(e), t = { ...e };
|
|
79
|
-
return delete t.alg, delete t.use, crypto.subtle.importKey("jwk", t, a, e.ext ?? !e.d, e.key_ops ?? r);
|
|
80
|
-
};
|
|
81
15
|
export {
|
|
82
|
-
|
|
16
|
+
o as pad
|
|
83
17
|
};
|
package/dist/esm/index.web164.js
CHANGED
package/dist/esm/index.web165.js
CHANGED
package/dist/esm/index.web166.js
CHANGED
package/dist/esm/index.web23.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { __require as r } from "./index.
|
|
1
|
+
import { __require as r } from "./index.web145.js";
|
|
2
2
|
r();
|
package/dist/esm/index.web27.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@coinbase/cdp-api-client";
|
|
2
2
|
import "viem";
|
|
3
3
|
import { mockUser as e } from "./index.web29.js";
|
|
4
|
-
class
|
|
4
|
+
class h {
|
|
5
5
|
authState = null;
|
|
6
6
|
authStateChangeCallback = null;
|
|
7
7
|
/**
|
|
@@ -62,6 +62,14 @@ class r {
|
|
|
62
62
|
async getToken() {
|
|
63
63
|
return this.authState ? (this.authState.expiresAt <= Date.now() && await this.refreshToken(), this.authState?.accessToken ?? null) : null;
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Gets the expiration time of the access token, or null if the user is not signed in.
|
|
67
|
+
*
|
|
68
|
+
* @returns The expiration time of the access token.
|
|
69
|
+
*/
|
|
70
|
+
async getTokenExpiration() {
|
|
71
|
+
return this.authState?.expiresAt ?? null;
|
|
72
|
+
}
|
|
65
73
|
/**
|
|
66
74
|
* Gets the currentlly registered wallet secret ID.
|
|
67
75
|
*
|
|
@@ -117,5 +125,5 @@ class r {
|
|
|
117
125
|
}
|
|
118
126
|
}
|
|
119
127
|
export {
|
|
120
|
-
|
|
128
|
+
h as MockAuthManager
|
|
121
129
|
};
|
package/dist/esm/index.web40.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Analytics as r } from "./index.web22.js";
|
|
2
2
|
import "./index.web23.js";
|
|
3
|
-
import { VERSION as o } from "./index.
|
|
3
|
+
import { VERSION as o } from "./index.web50.js";
|
|
4
4
|
import "./index.web21.js";
|
|
5
5
|
import { APIError as y, ErrorType as A, HttpErrorType as T, OAuth2ProviderType as S, SendEvmTransactionWithEndUserAccountBodyNetwork as f, SendSolanaTransactionWithEndUserAccountBodyNetwork as h } from "@coinbase/cdp-api-client";
|
|
6
6
|
import "@solana/web3.js";
|
package/dist/esm/index.web41.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DisconnectedError as l, from as d } from "./index.
|
|
1
|
+
import { DisconnectedError as l, from as d } from "./index.web46.js";
|
|
2
2
|
import { validateRequest as h, EIP1193ProviderError as m, STANDARD_ERROR_CODES as _ } from "./index.web19.js";
|
|
3
|
-
import { createEOAHandlers as p } from "./index.
|
|
4
|
-
import { createSmartAccountHandlers as g } from "./index.
|
|
3
|
+
import { createEOAHandlers as p } from "./index.web51.js";
|
|
4
|
+
import { createSmartAccountHandlers as g } from "./index.web52.js";
|
|
5
5
|
import "viem";
|
|
6
6
|
import "zustand";
|
|
7
7
|
import "@coinbase/cdp-api-client";
|