@coinbase/cdp-core 0.0.46 → 0.0.48
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.native102.js +77 -19
- package/dist/esm/index.native103.js +9 -9
- package/dist/esm/index.native104.js +20 -19
- package/dist/esm/index.native105.js +9 -93
- package/dist/esm/index.native106.js +18 -19
- package/dist/esm/index.native107.js +81 -105
- package/dist/esm/index.native108.js +20 -9
- package/dist/esm/index.native109.js +112 -73
- package/dist/esm/index.native111.js +13 -18
- package/dist/esm/index.native112.js +35 -27
- package/dist/esm/index.native113.js +41 -7
- package/dist/esm/index.native114.js +18 -11
- package/dist/esm/index.native115.js +28 -13
- package/dist/esm/index.native116.js +8 -10
- package/dist/esm/index.native117.js +11 -17
- package/dist/esm/index.native118.js +12 -80
- package/dist/esm/index.native119.js +10 -13
- package/dist/esm/index.native120.js +17 -36
- package/dist/esm/index.native121.js +79 -40
- package/dist/esm/index.native35.js +1 -1
- package/dist/esm/index.native90.js +6 -6
- package/dist/esm/index.native99.js +1 -1
- package/dist/esm/index.web101.js +19 -77
- package/dist/esm/index.web102.js +9 -9
- package/dist/esm/index.web103.js +19 -20
- package/dist/esm/index.web104.js +93 -9
- package/dist/esm/index.web105.js +19 -18
- package/dist/esm/index.web106.js +105 -81
- package/dist/esm/index.web107.js +78 -20
- package/dist/esm/index.web108.js +9 -117
- package/dist/esm/index.web11.js +4 -4
- package/dist/esm/index.web110.js +18 -13
- package/dist/esm/index.web111.js +27 -35
- package/dist/esm/index.web112.js +7 -41
- package/dist/esm/index.web113.js +11 -18
- package/dist/esm/index.web114.js +13 -28
- package/dist/esm/index.web115.js +10 -8
- package/dist/esm/index.web116.js +17 -11
- package/dist/esm/index.web117.js +80 -12
- package/dist/esm/index.web118.js +13 -10
- package/dist/esm/index.web119.js +36 -17
- package/dist/esm/index.web120.js +40 -79
- package/dist/esm/index.web16.js +1 -1
- package/dist/esm/index.web31.js +149 -940
- package/dist/esm/index.web32.js +48 -2
- package/dist/esm/index.web33.js +244 -43
- package/dist/esm/index.web34.js +55 -27
- package/dist/esm/index.web35.js +940 -149
- package/dist/esm/index.web36.js +2 -48
- package/dist/esm/index.web37.js +43 -244
- package/dist/esm/index.web38.js +27 -55
- package/dist/esm/index.web89.js +6 -6
- package/dist/esm/index.web98.js +1 -1
- package/dist/native/index.native102.js +77 -19
- package/dist/native/index.native103.js +9 -9
- package/dist/native/index.native104.js +20 -19
- package/dist/native/index.native105.js +9 -93
- package/dist/native/index.native106.js +18 -19
- package/dist/native/index.native107.js +81 -105
- package/dist/native/index.native108.js +20 -9
- package/dist/native/index.native109.js +112 -73
- package/dist/native/index.native111.js +13 -18
- package/dist/native/index.native112.js +35 -27
- package/dist/native/index.native113.js +41 -7
- package/dist/native/index.native114.js +18 -11
- package/dist/native/index.native115.js +28 -13
- package/dist/native/index.native116.js +8 -10
- package/dist/native/index.native117.js +11 -17
- package/dist/native/index.native118.js +12 -80
- package/dist/native/index.native119.js +10 -13
- package/dist/native/index.native120.js +17 -36
- package/dist/native/index.native121.js +79 -40
- package/dist/native/index.native35.js +1 -1
- package/dist/native/index.native90.js +6 -6
- package/dist/native/index.native99.js +1 -1
- package/dist/web/index.web101.js +19 -77
- package/dist/web/index.web102.js +9 -9
- package/dist/web/index.web103.js +19 -20
- package/dist/web/index.web104.js +93 -9
- package/dist/web/index.web105.js +19 -18
- package/dist/web/index.web106.js +105 -81
- package/dist/web/index.web107.js +78 -20
- package/dist/web/index.web108.js +9 -117
- package/dist/web/index.web11.js +4 -4
- package/dist/web/index.web110.js +18 -13
- package/dist/web/index.web111.js +27 -35
- package/dist/web/index.web112.js +7 -41
- package/dist/web/index.web113.js +11 -18
- package/dist/web/index.web114.js +13 -28
- package/dist/web/index.web115.js +10 -8
- package/dist/web/index.web116.js +17 -11
- package/dist/web/index.web117.js +80 -12
- package/dist/web/index.web118.js +13 -10
- package/dist/web/index.web119.js +36 -17
- package/dist/web/index.web120.js +40 -79
- package/dist/web/index.web16.js +1 -1
- package/dist/web/index.web31.js +149 -940
- package/dist/web/index.web32.js +48 -2
- package/dist/web/index.web33.js +244 -43
- package/dist/web/index.web34.js +55 -27
- package/dist/web/index.web35.js +940 -149
- package/dist/web/index.web36.js +2 -48
- package/dist/web/index.web37.js +43 -244
- package/dist/web/index.web38.js +27 -55
- package/dist/web/index.web89.js +6 -6
- package/dist/web/index.web98.js +1 -1
- package/package.json +2 -2
|
@@ -1,30 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { hexToBigInt as n } from "./index.native63.js";
|
|
2
|
+
import { defineBlock as r } from "./index.native60.js";
|
|
3
|
+
import { defineTransaction as s, formatTransaction as m } from "./index.native62.js";
|
|
4
|
+
import { defineTransactionReceipt as l } from "./index.native65.js";
|
|
5
|
+
const p = {
|
|
6
|
+
block: /* @__PURE__ */ r({
|
|
7
|
+
format(e) {
|
|
8
|
+
return {
|
|
9
|
+
transactions: e.transactions?.map((t) => {
|
|
10
|
+
if (typeof t == "string")
|
|
11
|
+
return t;
|
|
12
|
+
const i = m(t);
|
|
13
|
+
return i.typeHex === "0x7e" && (i.isSystemTx = t.isSystemTx, i.mint = t.mint ? n(t.mint) : void 0, i.sourceHash = t.sourceHash, i.type = "deposit"), i;
|
|
14
|
+
}),
|
|
15
|
+
stateRoot: e.stateRoot
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
19
|
+
transaction: /* @__PURE__ */ s({
|
|
20
|
+
format(e) {
|
|
21
|
+
const o = {};
|
|
22
|
+
return e.type === "0x7e" && (o.isSystemTx = e.isSystemTx, o.mint = e.mint ? n(e.mint) : void 0, o.sourceHash = e.sourceHash, o.type = "deposit"), o;
|
|
23
|
+
}
|
|
24
|
+
}),
|
|
25
|
+
transactionReceipt: /* @__PURE__ */ l({
|
|
26
|
+
format(e) {
|
|
27
|
+
return {
|
|
28
|
+
l1GasPrice: e.l1GasPrice ? n(e.l1GasPrice) : null,
|
|
29
|
+
l1GasUsed: e.l1GasUsed ? n(e.l1GasUsed) : null,
|
|
30
|
+
l1Fee: e.l1Fee ? n(e.l1Fee) : null,
|
|
31
|
+
l1FeeScalar: e.l1FeeScalar ? Number(e.l1FeeScalar) : null
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
})
|
|
27
35
|
};
|
|
28
36
|
export {
|
|
29
|
-
|
|
37
|
+
p as formatters
|
|
30
38
|
};
|
|
@@ -1,10 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { InvalidAddressError as a } from "./index.native78.js";
|
|
2
|
+
import { isAddress as f } from "./index.native52.js";
|
|
3
|
+
import { concatHex as p } from "./index.native53.js";
|
|
4
|
+
import { toHex as i } from "./index.native47.js";
|
|
5
|
+
import { toRlp as x } from "./index.native66.js";
|
|
6
|
+
import { serializeTransaction as l } from "./index.native26.js";
|
|
7
|
+
function T(r, e) {
|
|
8
|
+
return h(r) ? z(r) : l(r, e);
|
|
9
|
+
}
|
|
10
|
+
const E = {
|
|
11
|
+
transaction: T
|
|
7
12
|
};
|
|
13
|
+
function z(r) {
|
|
14
|
+
w(r);
|
|
15
|
+
const { sourceHash: e, data: o, from: m, gas: t, isSystemTx: u, mint: s, to: c, value: n } = r, d = [
|
|
16
|
+
e,
|
|
17
|
+
m,
|
|
18
|
+
c ?? "0x",
|
|
19
|
+
s ? i(s) : "0x",
|
|
20
|
+
n ? i(n) : "0x",
|
|
21
|
+
t ? i(t) : "0x",
|
|
22
|
+
u ? "0x1" : "0x",
|
|
23
|
+
o ?? "0x"
|
|
24
|
+
];
|
|
25
|
+
return p([
|
|
26
|
+
"0x7e",
|
|
27
|
+
x(d)
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
function h(r) {
|
|
31
|
+
return r.type === "deposit" || typeof r.sourceHash < "u";
|
|
32
|
+
}
|
|
33
|
+
function w(r) {
|
|
34
|
+
const { from: e, to: o } = r;
|
|
35
|
+
if (e && !f(e))
|
|
36
|
+
throw new a({ address: e });
|
|
37
|
+
if (o && !f(o))
|
|
38
|
+
throw new a({ address: o });
|
|
39
|
+
}
|
|
8
40
|
export {
|
|
9
|
-
|
|
41
|
+
w as assertTransactionDeposit,
|
|
42
|
+
T as serializeTransaction,
|
|
43
|
+
E as serializers
|
|
10
44
|
};
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
}
|
|
11
17
|
export {
|
|
12
|
-
|
|
18
|
+
a as decodeBase64,
|
|
19
|
+
o as encodeBase64
|
|
13
20
|
};
|
|
@@ -1,15 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { JOSENotSupported as r } from "./index.native41.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
|
+
};
|
|
12
28
|
export {
|
|
13
|
-
|
|
14
|
-
t as withAlg
|
|
29
|
+
S as default
|
|
15
30
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
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`);
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
e as isCryptoKey,
|
|
11
|
-
r as isKeyObject
|
|
9
|
+
o as default
|
|
12
10
|
};
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return
|
|
10
|
-
}
|
|
11
|
-
function c(t) {
|
|
12
|
-
return t.kty === "oct" && typeof t.k == "string";
|
|
13
|
-
}
|
|
1
|
+
import { checkSigCryptoKey as i } from "./index.native122.js";
|
|
2
|
+
import o from "./index.native118.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]);
|
|
8
|
+
}
|
|
9
|
+
return i(r, t, e), r;
|
|
10
|
+
};
|
|
14
11
|
export {
|
|
15
|
-
|
|
16
|
-
o as isPrivateJWK,
|
|
17
|
-
e as isPublicJWK,
|
|
18
|
-
c as isSecretJWK
|
|
12
|
+
s as default
|
|
19
13
|
};
|
|
@@ -1,83 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 };
|
|
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);
|
|
74
11
|
}
|
|
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
12
|
export {
|
|
82
|
-
|
|
13
|
+
r as default,
|
|
14
|
+
t as withAlg
|
|
83
15
|
};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
l2StandardBridge: { address: "0x4200000000000000000000000000000000000010" },
|
|
9
|
-
l2ToL1MessagePasser: {
|
|
10
|
-
address: "0x4200000000000000000000000000000000000016"
|
|
11
|
-
}
|
|
12
|
-
};
|
|
1
|
+
function e(t) {
|
|
2
|
+
return t?.[Symbol.toStringTag] === "CryptoKey";
|
|
3
|
+
}
|
|
4
|
+
function r(t) {
|
|
5
|
+
return t?.[Symbol.toStringTag] === "KeyObject";
|
|
6
|
+
}
|
|
7
|
+
const n = (t) => e(t) || r(t);
|
|
13
8
|
export {
|
|
14
|
-
|
|
9
|
+
n as default,
|
|
10
|
+
e as isCryptoKey,
|
|
11
|
+
r as isKeyObject
|
|
15
12
|
};
|
|
@@ -1,38 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}),
|
|
15
|
-
stateRoot: e.stateRoot
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}),
|
|
19
|
-
transaction: /* @__PURE__ */ s({
|
|
20
|
-
format(e) {
|
|
21
|
-
const o = {};
|
|
22
|
-
return e.type === "0x7e" && (o.isSystemTx = e.isSystemTx, o.mint = e.mint ? n(e.mint) : void 0, o.sourceHash = e.sourceHash, o.type = "deposit"), o;
|
|
23
|
-
}
|
|
24
|
-
}),
|
|
25
|
-
transactionReceipt: /* @__PURE__ */ l({
|
|
26
|
-
format(e) {
|
|
27
|
-
return {
|
|
28
|
-
l1GasPrice: e.l1GasPrice ? n(e.l1GasPrice) : null,
|
|
29
|
-
l1GasUsed: e.l1GasUsed ? n(e.l1GasUsed) : null,
|
|
30
|
-
l1Fee: e.l1Fee ? n(e.l1Fee) : null,
|
|
31
|
-
l1FeeScalar: e.l1FeeScalar ? Number(e.l1FeeScalar) : null
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
};
|
|
1
|
+
import n from "./index.native94.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
|
+
}
|
|
8
|
+
function e(t) {
|
|
9
|
+
return t.kty !== "oct" && typeof t.d > "u";
|
|
10
|
+
}
|
|
11
|
+
function c(t) {
|
|
12
|
+
return t.kty === "oct" && typeof t.k == "string";
|
|
13
|
+
}
|
|
36
14
|
export {
|
|
37
|
-
|
|
15
|
+
r as isJWK,
|
|
16
|
+
o as isPrivateJWK,
|
|
17
|
+
e as isPublicJWK,
|
|
18
|
+
c as isSecretJWK
|
|
38
19
|
};
|
|
@@ -1,44 +1,83 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { JOSENotSupported as s } from "./index.native41.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 };
|
|
9
74
|
}
|
|
10
|
-
const
|
|
11
|
-
|
|
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);
|
|
12
80
|
};
|
|
13
|
-
function z(r) {
|
|
14
|
-
w(r);
|
|
15
|
-
const { sourceHash: e, data: o, from: m, gas: t, isSystemTx: u, mint: s, to: c, value: n } = r, d = [
|
|
16
|
-
e,
|
|
17
|
-
m,
|
|
18
|
-
c ?? "0x",
|
|
19
|
-
s ? i(s) : "0x",
|
|
20
|
-
n ? i(n) : "0x",
|
|
21
|
-
t ? i(t) : "0x",
|
|
22
|
-
u ? "0x1" : "0x",
|
|
23
|
-
o ?? "0x"
|
|
24
|
-
];
|
|
25
|
-
return p([
|
|
26
|
-
"0x7e",
|
|
27
|
-
x(d)
|
|
28
|
-
]);
|
|
29
|
-
}
|
|
30
|
-
function h(r) {
|
|
31
|
-
return r.type === "deposit" || typeof r.sourceHash < "u";
|
|
32
|
-
}
|
|
33
|
-
function w(r) {
|
|
34
|
-
const { from: e, to: o } = r;
|
|
35
|
-
if (e && !f(e))
|
|
36
|
-
throw new a({ address: e });
|
|
37
|
-
if (o && !f(o))
|
|
38
|
-
throw new a({ address: o });
|
|
39
|
-
}
|
|
40
81
|
export {
|
|
41
|
-
|
|
42
|
-
T as serializeTransaction,
|
|
43
|
-
E as serializers
|
|
82
|
+
i as default
|
|
44
83
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { encode as d } from "./index.
|
|
2
|
-
import y from "./index.
|
|
3
|
-
import b from "./index.
|
|
1
|
+
import { encode as d } from "./index.native104.js";
|
|
2
|
+
import y from "./index.native105.js";
|
|
3
|
+
import b from "./index.native106.js";
|
|
4
4
|
import { JWSInvalid as r } from "./index.native41.js";
|
|
5
5
|
import { encoder as s, concat as u, decoder as h } from "./index.native91.js";
|
|
6
|
-
import g from "./index.
|
|
7
|
-
import H from "./index.
|
|
8
|
-
import P from "./index.
|
|
6
|
+
import g from "./index.native107.js";
|
|
7
|
+
import H from "./index.native108.js";
|
|
8
|
+
import P from "./index.native109.js";
|
|
9
9
|
class x {
|
|
10
10
|
#r;
|
|
11
11
|
#e;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index.
|
|
1
|
+
import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index.native102.js";
|
|
2
2
|
import { createHasher as u, clean as C, rotr as i } from "./index.native98.js";
|
|
3
3
|
const B = /* @__PURE__ */ Uint32Array.from([
|
|
4
4
|
1116352408,
|