@coinbase/cdp-core 0.0.47 → 0.0.49
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.native12.js +4 -4
- package/dist/esm/index.native17.js +1 -1
- package/dist/esm/index.native18.js +33 -24
- package/dist/esm/index.native2.js +8 -6
- package/dist/esm/index.native22.js +1 -1
- package/dist/esm/index.native3.js +2 -2
- package/dist/esm/index.native32.js +940 -149
- package/dist/esm/index.native33.js +2 -48
- package/dist/esm/index.native34.js +43 -244
- package/dist/esm/index.native35.js +27 -55
- package/dist/esm/index.native36.js +149 -940
- package/dist/esm/index.native37.js +48 -2
- package/dist/esm/index.native38.js +244 -43
- package/dist/esm/index.native39.js +55 -27
- package/dist/esm/index.native4.js +4 -2
- package/dist/esm/index.native5.js +19 -17
- package/dist/esm/index.native6.js +10 -8
- package/dist/esm/index.web100.js +2 -7
- package/dist/esm/index.web101.js +17 -17
- package/dist/esm/index.web102.js +20 -10
- package/dist/esm/index.web103.js +80 -20
- package/dist/esm/index.web104.js +99 -89
- package/dist/esm/index.web105.js +32 -20
- package/dist/esm/index.web106.js +7 -118
- package/dist/esm/index.web107.js +10 -79
- package/dist/esm/index.web108.js +79 -10
- package/dist/esm/index.web109.js +18 -5
- package/dist/esm/index.web110.js +28 -18
- package/dist/esm/index.web111.js +6 -26
- package/dist/esm/index.web112.js +9 -6
- package/dist/esm/index.web113.js +13 -11
- package/dist/esm/index.web114.js +8 -11
- package/dist/esm/index.web115.js +14 -7
- package/dist/esm/index.web116.js +80 -16
- package/dist/esm/index.web117.js +5 -81
- package/dist/esm/index.web119.js +4 -4
- package/dist/esm/index.web120.js +5 -5
- package/dist/esm/index.web16.js +1 -1
- package/dist/esm/index.web17.js +33 -24
- package/dist/esm/index.web2.js +10 -8
- package/dist/esm/index.web21.js +1 -1
- package/dist/esm/index.web25.js +13 -13
- package/dist/esm/index.web27.js +3 -3
- package/dist/esm/index.web3.js +4 -2
- package/dist/esm/index.web30.js +2 -2
- package/dist/esm/index.web34.js +2 -2
- package/dist/esm/index.web35.js +16 -950
- package/dist/esm/index.web36.js +23 -2
- package/dist/esm/index.web37.js +50 -49
- package/dist/esm/index.web38.js +950 -27
- package/dist/esm/index.web39.js +2 -17
- package/dist/esm/index.web4.js +12 -12
- package/dist/esm/index.web40.js +48 -21
- package/dist/esm/index.web41.js +27 -50
- package/dist/esm/index.web44.js +54 -8
- package/dist/esm/index.web45.js +9 -16
- package/dist/esm/index.web46.js +2 -46
- package/dist/esm/index.web47.js +45 -14
- package/dist/esm/index.web48.js +12 -54
- package/dist/esm/index.web49.js +8 -6
- package/dist/esm/index.web5.js +4 -2
- package/dist/esm/index.web50.js +16 -20
- package/dist/esm/index.web51.js +45 -11
- package/dist/esm/index.web52.js +13 -3
- package/dist/esm/index.web53.js +55 -3
- package/dist/esm/index.web54.js +6 -34
- package/dist/esm/index.web55.js +19 -10
- package/dist/esm/index.web56.js +11 -4
- package/dist/esm/index.web57.js +3 -28
- package/dist/esm/index.web58.js +3 -6
- package/dist/esm/index.web59.js +34 -24
- package/dist/esm/index.web60.js +12 -16
- package/dist/esm/index.web61.js +4 -54
- package/dist/esm/index.web62.js +25 -20
- package/dist/esm/index.web63.js +6 -11
- package/dist/esm/index.web64.js +23 -26
- package/dist/esm/index.web65.js +16 -42
- package/dist/esm/index.web66.js +52 -53
- package/dist/esm/index.web67.js +23 -127
- package/dist/esm/index.web68.js +11 -12
- package/dist/esm/index.web69.js +27 -104
- package/dist/esm/index.web70.js +42 -6
- package/dist/esm/index.web71.js +56 -3
- package/dist/esm/index.web72.js +127 -14
- package/dist/esm/index.web73.js +9 -39
- package/dist/esm/index.web74.js +100 -74
- package/dist/esm/index.web75.js +7 -2
- package/dist/esm/index.web76.js +3 -2
- package/dist/esm/index.web77.js +14 -12
- package/dist/esm/index.web78.js +34 -29
- package/dist/esm/index.web79.js +77 -5
- package/dist/esm/index.web80.js +2 -35
- package/dist/esm/index.web81.js +2 -9
- package/dist/esm/index.web82.js +11 -9
- package/dist/esm/index.web83.js +37 -11
- package/dist/esm/index.web84.js +6 -13
- package/dist/esm/index.web85.js +33 -17
- package/dist/esm/index.web86.js +8 -5
- package/dist/esm/index.web87.js +11 -5
- package/dist/esm/index.web88.js +11 -10
- package/dist/esm/index.web89.js +13 -54
- package/dist/esm/index.web90.js +18 -10
- package/dist/esm/index.web91.js +6 -2
- package/dist/esm/index.web92.js +4 -44
- package/dist/esm/index.web93.js +10 -13
- package/dist/esm/index.web94.js +21 -2
- package/dist/esm/index.web95.js +10 -21
- package/dist/esm/index.web96.js +19 -19
- package/dist/esm/index.web97.js +94 -80
- package/dist/esm/index.web98.js +20 -103
- package/dist/esm/index.web99.js +115 -30
- package/dist/native/index.native12.js +4 -4
- package/dist/native/index.native17.js +1 -1
- package/dist/native/index.native18.js +33 -24
- package/dist/native/index.native2.js +8 -6
- package/dist/native/index.native22.js +1 -1
- package/dist/native/index.native3.js +2 -2
- package/dist/native/index.native32.js +940 -149
- package/dist/native/index.native33.js +2 -48
- package/dist/native/index.native34.js +43 -244
- package/dist/native/index.native35.js +27 -55
- package/dist/native/index.native36.js +149 -940
- package/dist/native/index.native37.js +48 -2
- package/dist/native/index.native38.js +244 -43
- package/dist/native/index.native39.js +55 -27
- package/dist/native/index.native4.js +4 -2
- package/dist/native/index.native5.js +19 -17
- package/dist/native/index.native6.js +10 -8
- package/dist/native-types/platform/types.d.ts +3 -3
- package/dist/native-types/types.d.ts +5 -7
- package/dist/types/platform/types.d.ts +3 -3
- package/dist/types/types.d.ts +5 -7
- package/dist/web/index.web100.js +2 -7
- package/dist/web/index.web101.js +17 -17
- package/dist/web/index.web102.js +20 -10
- package/dist/web/index.web103.js +80 -20
- package/dist/web/index.web104.js +99 -89
- package/dist/web/index.web105.js +32 -20
- package/dist/web/index.web106.js +7 -118
- package/dist/web/index.web107.js +10 -79
- package/dist/web/index.web108.js +79 -10
- package/dist/web/index.web109.js +18 -5
- package/dist/web/index.web110.js +28 -18
- package/dist/web/index.web111.js +6 -26
- package/dist/web/index.web112.js +9 -6
- package/dist/web/index.web113.js +13 -11
- package/dist/web/index.web114.js +8 -11
- package/dist/web/index.web115.js +14 -7
- package/dist/web/index.web116.js +80 -16
- package/dist/web/index.web117.js +5 -81
- package/dist/web/index.web119.js +4 -4
- package/dist/web/index.web120.js +5 -5
- package/dist/web/index.web16.js +1 -1
- package/dist/web/index.web17.js +33 -24
- package/dist/web/index.web2.js +10 -8
- package/dist/web/index.web21.js +1 -1
- package/dist/web/index.web25.js +13 -13
- package/dist/web/index.web27.js +3 -3
- package/dist/web/index.web3.js +4 -2
- package/dist/web/index.web30.js +2 -2
- package/dist/web/index.web34.js +2 -2
- package/dist/web/index.web35.js +16 -950
- package/dist/web/index.web36.js +23 -2
- package/dist/web/index.web37.js +50 -49
- package/dist/web/index.web38.js +950 -27
- package/dist/web/index.web39.js +2 -17
- package/dist/web/index.web4.js +12 -12
- package/dist/web/index.web40.js +48 -21
- package/dist/web/index.web41.js +27 -50
- package/dist/web/index.web44.js +54 -8
- package/dist/web/index.web45.js +9 -16
- package/dist/web/index.web46.js +2 -46
- package/dist/web/index.web47.js +45 -14
- package/dist/web/index.web48.js +12 -54
- package/dist/web/index.web49.js +8 -6
- package/dist/web/index.web5.js +4 -2
- package/dist/web/index.web50.js +16 -20
- package/dist/web/index.web51.js +45 -11
- package/dist/web/index.web52.js +13 -3
- package/dist/web/index.web53.js +55 -3
- package/dist/web/index.web54.js +6 -34
- package/dist/web/index.web55.js +19 -10
- package/dist/web/index.web56.js +11 -4
- package/dist/web/index.web57.js +3 -28
- package/dist/web/index.web58.js +3 -6
- package/dist/web/index.web59.js +34 -24
- package/dist/web/index.web60.js +12 -16
- package/dist/web/index.web61.js +4 -54
- package/dist/web/index.web62.js +25 -20
- package/dist/web/index.web63.js +6 -11
- package/dist/web/index.web64.js +23 -26
- package/dist/web/index.web65.js +16 -42
- package/dist/web/index.web66.js +52 -53
- package/dist/web/index.web67.js +23 -127
- package/dist/web/index.web68.js +11 -12
- package/dist/web/index.web69.js +27 -104
- package/dist/web/index.web70.js +42 -6
- package/dist/web/index.web71.js +56 -3
- package/dist/web/index.web72.js +127 -14
- package/dist/web/index.web73.js +9 -39
- package/dist/web/index.web74.js +100 -74
- package/dist/web/index.web75.js +7 -2
- package/dist/web/index.web76.js +3 -2
- package/dist/web/index.web77.js +14 -12
- package/dist/web/index.web78.js +34 -29
- package/dist/web/index.web79.js +77 -5
- package/dist/web/index.web80.js +2 -35
- package/dist/web/index.web81.js +2 -9
- package/dist/web/index.web82.js +11 -9
- package/dist/web/index.web83.js +37 -11
- package/dist/web/index.web84.js +6 -13
- package/dist/web/index.web85.js +33 -17
- package/dist/web/index.web86.js +8 -5
- package/dist/web/index.web87.js +11 -5
- package/dist/web/index.web88.js +11 -10
- package/dist/web/index.web89.js +13 -54
- package/dist/web/index.web90.js +18 -10
- package/dist/web/index.web91.js +6 -2
- package/dist/web/index.web92.js +4 -44
- package/dist/web/index.web93.js +10 -13
- package/dist/web/index.web94.js +21 -2
- package/dist/web/index.web95.js +10 -21
- package/dist/web/index.web96.js +19 -19
- package/dist/web/index.web97.js +94 -80
- package/dist/web/index.web98.js +20 -103
- package/dist/web/index.web99.js +115 -30
- package/dist/web-types/platform/types.d.ts +3 -3
- package/dist/web-types/types.d.ts +5 -7
- package/package.json +2 -2
package/dist/web/index.web108.js
CHANGED
|
@@ -1,12 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Hash as g, createView as l, aexists as b, toBytes as a, abytes as d, aoutput as x, clean as w } from "./index.web103.js";
|
|
2
|
+
function y(o, t, s, n) {
|
|
3
|
+
if (typeof o.setBigUint64 == "function")
|
|
4
|
+
return o.setBigUint64(t, s, n);
|
|
5
|
+
const i = BigInt(32), h = BigInt(4294967295), e = Number(s >> i & h), r = Number(s & h), c = n ? 4 : 0, u = n ? 0 : 4;
|
|
6
|
+
o.setUint32(t + c, e, n), o.setUint32(t + u, r, n);
|
|
7
|
+
}
|
|
8
|
+
function U(o, t, s) {
|
|
9
|
+
return o & t ^ ~o & s;
|
|
10
|
+
}
|
|
11
|
+
function _(o, t, s) {
|
|
12
|
+
return o & t ^ o & s ^ t & s;
|
|
13
|
+
}
|
|
14
|
+
class m extends g {
|
|
15
|
+
constructor(t, s, n, i) {
|
|
16
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = t, this.outputLen = s, this.padOffset = n, this.isLE = i, this.buffer = new Uint8Array(t), this.view = l(this.buffer);
|
|
17
|
+
}
|
|
18
|
+
update(t) {
|
|
19
|
+
b(this), t = a(t), d(t);
|
|
20
|
+
const { view: s, buffer: n, blockLen: i } = this, h = t.length;
|
|
21
|
+
for (let e = 0; e < h; ) {
|
|
22
|
+
const r = Math.min(i - this.pos, h - e);
|
|
23
|
+
if (r === i) {
|
|
24
|
+
const c = l(t);
|
|
25
|
+
for (; i <= h - e; e += i)
|
|
26
|
+
this.process(c, e);
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
n.set(t.subarray(e, e + r), this.pos), this.pos += r, e += r, this.pos === i && (this.process(s, 0), this.pos = 0);
|
|
30
|
+
}
|
|
31
|
+
return this.length += t.length, this.roundClean(), this;
|
|
32
|
+
}
|
|
33
|
+
digestInto(t) {
|
|
34
|
+
b(this), x(t, this), this.finished = !0;
|
|
35
|
+
const { buffer: s, view: n, blockLen: i, isLE: h } = this;
|
|
36
|
+
let { pos: e } = this;
|
|
37
|
+
s[e++] = 128, w(this.buffer.subarray(e)), this.padOffset > i - e && (this.process(n, 0), e = 0);
|
|
38
|
+
for (let f = e; f < i; f++)
|
|
39
|
+
s[f] = 0;
|
|
40
|
+
y(n, i - 8, BigInt(this.length * 8), h), this.process(n, 0);
|
|
41
|
+
const r = l(t), c = this.outputLen;
|
|
42
|
+
if (c % 4)
|
|
43
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
44
|
+
const u = c / 4, p = this.get();
|
|
45
|
+
if (u > p.length)
|
|
46
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
47
|
+
for (let f = 0; f < u; f++)
|
|
48
|
+
r.setUint32(4 * f, p[f], h);
|
|
49
|
+
}
|
|
50
|
+
digest() {
|
|
51
|
+
const { buffer: t, outputLen: s } = this;
|
|
52
|
+
this.digestInto(t);
|
|
53
|
+
const n = t.slice(0, s);
|
|
54
|
+
return this.destroy(), n;
|
|
55
|
+
}
|
|
56
|
+
_cloneInto(t) {
|
|
57
|
+
t || (t = new this.constructor()), t.set(...this.get());
|
|
58
|
+
const { blockLen: s, buffer: n, length: i, finished: h, destroyed: e, pos: r } = this;
|
|
59
|
+
return t.destroyed = e, t.finished = h, t.length = i, t.pos = r, i % s && t.buffer.set(n), t;
|
|
60
|
+
}
|
|
61
|
+
clone() {
|
|
62
|
+
return this._cloneInto();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const B = /* @__PURE__ */ Uint32Array.from([
|
|
66
|
+
1779033703,
|
|
67
|
+
3144134277,
|
|
68
|
+
1013904242,
|
|
69
|
+
2773480762,
|
|
70
|
+
1359893119,
|
|
71
|
+
2600822924,
|
|
72
|
+
528734635,
|
|
73
|
+
1541459225
|
|
74
|
+
]);
|
|
10
75
|
export {
|
|
11
|
-
|
|
76
|
+
U as Chi,
|
|
77
|
+
m as HashMD,
|
|
78
|
+
_ as Maj,
|
|
79
|
+
B as SHA256_IV,
|
|
80
|
+
y as setBigUint64
|
|
12
81
|
};
|
package/dist/web/index.web109.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
|
|
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;
|
|
16
|
+
}
|
|
2
17
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
s as fieldElementsPerBlob,
|
|
6
|
-
l as maxBytesPerTransaction
|
|
18
|
+
a as decodeBase64,
|
|
19
|
+
o as encodeBase64
|
|
7
20
|
};
|
package/dist/web/index.web110.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.web36.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/web/index.web111.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/web/index.web112.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { checkSigCryptoKey as i } from "./index.web121.js";
|
|
2
|
+
import o from "./index.web113.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/web/index.web113.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/web/index.web114.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/web/index.web115.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
+
import n from "./index.web48.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/web/index.web116.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.web36.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/web/index.web117.js
CHANGED
|
@@ -1,83 +1,7 @@
|
|
|
1
|
-
|
|
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 };
|
|
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
|
-
};
|
|
1
|
+
const e = 32, s = 4096, t = 131072, l = 761855;
|
|
81
2
|
export {
|
|
82
|
-
|
|
3
|
+
t as bytesPerBlob,
|
|
4
|
+
e as bytesPerFieldElement,
|
|
5
|
+
s as fieldElementsPerBlob,
|
|
6
|
+
l as maxBytesPerTransaction
|
|
83
7
|
};
|
package/dist/web/index.web119.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { hexToBigInt as n } from "./index.
|
|
2
|
-
import { defineBlock as r } from "./index.
|
|
3
|
-
import { defineTransaction as s, formatTransaction as m } from "./index.
|
|
4
|
-
import { defineTransactionReceipt as l } from "./index.
|
|
1
|
+
import { hexToBigInt as n } from "./index.web67.js";
|
|
2
|
+
import { defineBlock as r } from "./index.web64.js";
|
|
3
|
+
import { defineTransaction as s, formatTransaction as m } from "./index.web66.js";
|
|
4
|
+
import { defineTransactionReceipt as l } from "./index.web69.js";
|
|
5
5
|
const p = {
|
|
6
6
|
block: /* @__PURE__ */ r({
|
|
7
7
|
format(e) {
|
package/dist/web/index.web120.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { InvalidAddressError as a } from "./index.
|
|
2
|
-
import { isAddress as f } from "./index.
|
|
3
|
-
import { concatHex as p } from "./index.
|
|
4
|
-
import { toHex as i } from "./index.
|
|
5
|
-
import { toRlp as x } from "./index.
|
|
1
|
+
import { InvalidAddressError as a } from "./index.web82.js";
|
|
2
|
+
import { isAddress as f } from "./index.web56.js";
|
|
3
|
+
import { concatHex as p } from "./index.web57.js";
|
|
4
|
+
import { toHex as i } from "./index.web51.js";
|
|
5
|
+
import { toRlp as x } from "./index.web70.js";
|
|
6
6
|
import { serializeTransaction as l } from "./index.web25.js";
|
|
7
7
|
function T(r, e) {
|
|
8
8
|
return h(r) ? z(r) : l(r, e);
|
package/dist/web/index.web16.js
CHANGED
package/dist/web/index.web17.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { verifyOAuth as
|
|
2
|
-
import { getPlatformOAuth as
|
|
3
|
-
import { getCoreAuthManager as
|
|
1
|
+
import { verifyOAuth as u } from "./index.web6.js";
|
|
2
|
+
import { getPlatformOAuth as s } from "./index.web2.js";
|
|
3
|
+
import { getCoreAuthManager as i } from "./index.web24.js";
|
|
4
4
|
import "@coinbase/cdp-api-client";
|
|
5
5
|
import "viem";
|
|
6
6
|
class p {
|
|
@@ -40,36 +40,45 @@ class p {
|
|
|
40
40
|
* Handles the OAuth code.
|
|
41
41
|
*/
|
|
42
42
|
async handleOAuthCode() {
|
|
43
|
-
let t, a, e;
|
|
44
|
-
a = null, t = null, e = null;
|
|
45
43
|
try {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
const t = await s().getOAuthParams();
|
|
45
|
+
if (await s().cleanupOAuthParams(), !t || await i().isSignedIn())
|
|
46
|
+
return;
|
|
47
|
+
const { providerType: a, code: e, flowId: r, error: o, errorDescription: h } = t;
|
|
48
|
+
if (o || h) {
|
|
49
|
+
await this.setOAuthFlowState({
|
|
50
|
+
providerType: a,
|
|
51
|
+
status: "error",
|
|
52
|
+
errorDescription: o ?? h,
|
|
53
|
+
code: e,
|
|
54
|
+
flowId: r,
|
|
55
|
+
error: o
|
|
56
|
+
});
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (!e || !a || !r)
|
|
52
60
|
return;
|
|
53
61
|
await this.setOAuthFlowState({
|
|
54
62
|
providerType: a,
|
|
55
63
|
status: "pending",
|
|
56
|
-
code:
|
|
57
|
-
flowId:
|
|
58
|
-
}), await
|
|
64
|
+
code: e,
|
|
65
|
+
flowId: r
|
|
66
|
+
}), await u({
|
|
67
|
+
code: e,
|
|
68
|
+
providerType: a,
|
|
69
|
+
flowId: r
|
|
70
|
+
}), await this.setOAuthFlowState({
|
|
59
71
|
providerType: a,
|
|
60
72
|
status: "success",
|
|
61
|
-
code:
|
|
62
|
-
flowId:
|
|
73
|
+
code: e,
|
|
74
|
+
flowId: r
|
|
63
75
|
});
|
|
64
|
-
} catch (
|
|
65
|
-
const
|
|
66
|
-
await
|
|
67
|
-
providerType: a ?? null,
|
|
76
|
+
} catch (t) {
|
|
77
|
+
const a = t instanceof Error ? t.message : "Unknown error";
|
|
78
|
+
await s().cleanupOAuthParams(), await this.setOAuthFlowState({
|
|
68
79
|
status: "error",
|
|
69
|
-
errorDescription:
|
|
70
|
-
|
|
71
|
-
flowId: e
|
|
72
|
-
}), console.error("Error handling OAuth param change:", o);
|
|
80
|
+
errorDescription: a
|
|
81
|
+
});
|
|
73
82
|
}
|
|
74
83
|
}
|
|
75
84
|
}
|
package/dist/web/index.web2.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import "@coinbase/cdp-api-client";
|
|
2
|
+
import "viem";
|
|
1
3
|
let r = null;
|
|
2
|
-
function
|
|
4
|
+
function n(t) {
|
|
3
5
|
r = t;
|
|
4
6
|
}
|
|
5
7
|
function e() {
|
|
@@ -9,19 +11,19 @@ function e() {
|
|
|
9
11
|
);
|
|
10
12
|
return r;
|
|
11
13
|
}
|
|
12
|
-
function
|
|
14
|
+
function i() {
|
|
13
15
|
return e().crypto;
|
|
14
16
|
}
|
|
15
|
-
function
|
|
17
|
+
function u() {
|
|
16
18
|
return e().storage;
|
|
17
19
|
}
|
|
18
|
-
function
|
|
20
|
+
function p() {
|
|
19
21
|
return e().oauth;
|
|
20
22
|
}
|
|
21
23
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
i as getPlatformCrypto,
|
|
25
|
+
p as getPlatformOAuth,
|
|
24
26
|
e as getPlatformServices,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
u as getPlatformStorage,
|
|
28
|
+
n as setPlatformServices
|
|
27
29
|
};
|
package/dist/web/index.web21.js
CHANGED
|
@@ -45,7 +45,7 @@ class i {
|
|
|
45
45
|
* Awaitable method whose promise only resolves when the OAuth manager is ready to be used.
|
|
46
46
|
*/
|
|
47
47
|
async handleOAuthCode() {
|
|
48
|
-
await e()?.
|
|
48
|
+
await e()?.cleanupOAuthParams(), await this.setOAuthFlowState({
|
|
49
49
|
providerType: "google",
|
|
50
50
|
status: "pending",
|
|
51
51
|
code: "mock-oauth-code",
|