@coinbase/cdp-core 0.0.91 → 0.0.92
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.native104.js +1 -1
- package/dist/esm/index.native106.js +4 -4
- package/dist/esm/index.native107.js +3 -3
- package/dist/esm/index.native108.js +2 -31
- package/dist/esm/index.native109.js +65 -28
- package/dist/esm/index.native110.js +367 -2
- package/dist/esm/index.native111.js +28 -65
- package/dist/esm/index.native112.js +28 -364
- package/dist/esm/index.native117.js +11 -53
- package/dist/esm/index.native118.js +11 -10
- package/dist/esm/index.native119.js +55 -2
- package/dist/esm/index.native120.js +11 -45
- package/dist/esm/index.native121.js +2 -14
- package/dist/esm/index.native122.js +44 -12
- package/dist/esm/index.native123.js +13 -11
- package/dist/esm/index.native124.js +2 -2
- package/dist/esm/index.native130.js +1 -1
- package/dist/esm/index.native149.js +1 -1
- package/dist/esm/index.native151.js +1 -1
- package/dist/esm/index.native154.js +2 -2
- package/dist/esm/index.native162.js +1 -1
- package/dist/esm/index.native163.js +1 -1
- package/dist/esm/index.native164.js +2 -2
- package/dist/esm/index.native168.js +102 -19
- package/dist/esm/index.native169.js +79 -10
- package/dist/esm/index.native170.js +80 -20
- package/dist/esm/index.native171.js +14 -94
- package/dist/esm/index.native172.js +27 -20
- package/dist/esm/index.native173.js +8 -118
- package/dist/esm/index.native174.js +3 -103
- package/dist/esm/index.native175.js +26 -77
- package/dist/esm/index.native176.js +8 -79
- package/dist/esm/index.native177.js +7 -13
- package/dist/esm/index.native178.js +71 -19
- package/dist/esm/index.native179.js +27 -7
- package/dist/esm/index.native180.js +3 -3
- package/dist/esm/index.native181.js +6 -19
- package/dist/esm/index.native182.js +4 -8
- package/dist/esm/index.native183.js +13 -7
- package/dist/esm/index.native184.js +18 -78
- package/dist/esm/index.native185.js +47 -14
- package/dist/esm/index.native186.js +17 -3
- package/dist/esm/index.native187.js +23 -14
- package/dist/esm/index.native188.js +8 -4
- package/dist/esm/index.native189.js +33 -5
- package/dist/esm/index.native190.js +7 -19
- package/dist/esm/index.native191.js +15 -55
- package/dist/esm/index.native192.js +20 -17
- package/dist/esm/index.native193.js +10 -24
- package/dist/esm/index.native194.js +20 -9
- package/dist/esm/index.native195.js +93 -41
- package/dist/esm/index.native196.js +21 -8
- package/dist/esm/index.native197.js +117 -20
- package/dist/esm/index.native198.js +2 -8
- package/dist/esm/index.native199.js +39 -2
- package/dist/esm/index.native200.js +2 -378
- package/dist/esm/index.native201.js +69 -835
- package/dist/esm/index.native202.js +33 -37
- package/dist/esm/index.native203.js +21 -2
- package/dist/esm/index.native204.js +7 -69
- package/dist/esm/index.native205.js +2 -35
- package/dist/esm/index.native206.js +374 -17
- package/dist/esm/index.native207.js +836 -2
- package/dist/esm/index.native213.js +32 -6
- package/dist/esm/index.native214.js +6 -32
- package/dist/esm/index.native215.js +3 -17
- package/dist/esm/index.native216.js +18 -28
- package/dist/esm/index.native217.js +26 -6
- package/dist/esm/index.native218.js +6 -9
- package/dist/esm/index.native219.js +11 -13
- package/dist/esm/index.native220.js +11 -8
- package/dist/esm/index.native221.js +7 -14
- package/dist/esm/index.native222.js +16 -80
- package/dist/esm/index.native223.js +80 -3
- package/dist/esm/index.native224.js +2 -2
- package/dist/esm/index.native225.js +2 -2
- package/dist/esm/index.native226.js +2 -2
- package/dist/esm/index.native227.js +1 -1
- package/dist/esm/index.native3.js +1 -1
- package/dist/esm/index.native88.js +2 -2
- package/dist/esm/index.native9.js +1 -1
- package/dist/esm/index.native92.js +2 -2
- package/dist/esm/index.web105.js +1 -1
- package/dist/esm/index.web107.js +4 -4
- package/dist/esm/index.web108.js +3 -3
- package/dist/esm/index.web109.js +31 -2
- package/dist/esm/index.web110.js +28 -65
- package/dist/esm/index.web111.js +2 -367
- package/dist/esm/index.web112.js +65 -28
- package/dist/esm/index.web113.js +364 -28
- package/dist/esm/index.web118.js +53 -11
- package/dist/esm/index.web119.js +10 -11
- package/dist/esm/index.web120.js +2 -55
- package/dist/esm/index.web121.js +45 -11
- package/dist/esm/index.web122.js +14 -2
- package/dist/esm/index.web123.js +12 -44
- package/dist/esm/index.web124.js +11 -13
- package/dist/esm/index.web125.js +2 -2
- package/dist/esm/index.web129.js +1 -1
- package/dist/esm/index.web148.js +1 -1
- package/dist/esm/index.web150.js +1 -1
- package/dist/esm/index.web153.js +2 -2
- package/dist/esm/index.web161.js +1 -1
- package/dist/esm/index.web162.js +1 -1
- package/dist/esm/index.web163.js +2 -2
- package/dist/esm/index.web167.js +19 -102
- package/dist/esm/index.web168.js +10 -79
- package/dist/esm/index.web169.js +20 -80
- package/dist/esm/index.web170.js +94 -15
- package/dist/esm/index.web171.js +20 -28
- package/dist/esm/index.web172.js +118 -8
- package/dist/esm/index.web173.js +103 -3
- package/dist/esm/index.web174.js +77 -27
- package/dist/esm/index.web175.js +79 -8
- package/dist/esm/index.web176.js +14 -7
- package/dist/esm/index.web177.js +18 -70
- package/dist/esm/index.web178.js +7 -28
- package/dist/esm/index.web179.js +3 -3
- package/dist/esm/index.web180.js +19 -6
- package/dist/esm/index.web181.js +8 -4
- package/dist/esm/index.web182.js +7 -14
- package/dist/esm/index.web183.js +79 -18
- package/dist/esm/index.web184.js +15 -48
- package/dist/esm/index.web185.js +3 -17
- package/dist/esm/index.web186.js +15 -23
- package/dist/esm/index.web187.js +4 -8
- package/dist/esm/index.web188.js +5 -33
- package/dist/esm/index.web189.js +19 -7
- package/dist/esm/index.web190.js +57 -16
- package/dist/esm/index.web191.js +17 -20
- package/dist/esm/index.web192.js +24 -10
- package/dist/esm/index.web193.js +9 -20
- package/dist/esm/index.web194.js +42 -93
- package/dist/esm/index.web195.js +8 -21
- package/dist/esm/index.web196.js +20 -117
- package/dist/esm/index.web197.js +8 -2
- package/dist/esm/index.web198.js +2 -8
- package/dist/esm/index.web199.js +378 -2
- package/dist/esm/index.web200.js +812 -354
- package/dist/esm/index.web201.js +38 -835
- package/dist/esm/index.web202.js +2 -39
- package/dist/esm/index.web203.js +70 -2
- package/dist/esm/index.web204.js +31 -66
- package/dist/esm/index.web205.js +19 -33
- package/dist/esm/index.web206.js +2 -21
- package/dist/esm/index.web212.js +32 -6
- package/dist/esm/index.web213.js +6 -32
- package/dist/esm/index.web214.js +17 -3
- package/dist/esm/index.web215.js +28 -2
- package/dist/esm/index.web216.js +8 -2
- package/dist/esm/index.web217.js +11 -2
- package/dist/esm/index.web218.js +11 -16
- package/dist/esm/index.web219.js +10 -28
- package/dist/esm/index.web220.js +17 -8
- package/dist/esm/index.web221.js +79 -9
- package/dist/esm/index.web222.js +3 -12
- package/dist/esm/index.web223.js +2 -10
- package/dist/esm/index.web224.js +2 -17
- package/dist/esm/index.web225.js +2 -81
- package/dist/esm/index.web226.js +1 -1
- package/dist/esm/index.web3.js +1 -1
- package/dist/esm/index.web8.js +1 -1
- package/dist/esm/index.web90.js +2 -2
- package/dist/esm/index.web94.js +2 -2
- package/dist/native/index.native104.js +1 -1
- package/dist/native/index.native106.js +4 -4
- package/dist/native/index.native107.js +3 -3
- package/dist/native/index.native108.js +2 -31
- package/dist/native/index.native109.js +65 -28
- package/dist/native/index.native110.js +367 -2
- package/dist/native/index.native111.js +28 -65
- package/dist/native/index.native112.js +28 -364
- package/dist/native/index.native117.js +11 -53
- package/dist/native/index.native118.js +11 -10
- package/dist/native/index.native119.js +55 -2
- package/dist/native/index.native120.js +11 -45
- package/dist/native/index.native121.js +2 -14
- package/dist/native/index.native122.js +44 -12
- package/dist/native/index.native123.js +13 -11
- package/dist/native/index.native124.js +2 -2
- package/dist/native/index.native130.js +1 -1
- package/dist/native/index.native149.js +1 -1
- package/dist/native/index.native151.js +1 -1
- package/dist/native/index.native154.js +2 -2
- package/dist/native/index.native162.js +1 -1
- package/dist/native/index.native163.js +1 -1
- package/dist/native/index.native164.js +2 -2
- package/dist/native/index.native168.js +102 -19
- package/dist/native/index.native169.js +79 -10
- package/dist/native/index.native170.js +80 -20
- package/dist/native/index.native171.js +14 -94
- package/dist/native/index.native172.js +27 -20
- package/dist/native/index.native173.js +8 -118
- package/dist/native/index.native174.js +3 -103
- package/dist/native/index.native175.js +26 -77
- package/dist/native/index.native176.js +8 -79
- package/dist/native/index.native177.js +7 -13
- package/dist/native/index.native178.js +71 -19
- package/dist/native/index.native179.js +27 -7
- package/dist/native/index.native180.js +3 -3
- package/dist/native/index.native181.js +6 -19
- package/dist/native/index.native182.js +4 -8
- package/dist/native/index.native183.js +13 -7
- package/dist/native/index.native184.js +18 -78
- package/dist/native/index.native185.js +47 -14
- package/dist/native/index.native186.js +17 -3
- package/dist/native/index.native187.js +23 -14
- package/dist/native/index.native188.js +8 -4
- package/dist/native/index.native189.js +33 -5
- package/dist/native/index.native190.js +7 -19
- package/dist/native/index.native191.js +15 -55
- package/dist/native/index.native192.js +20 -17
- package/dist/native/index.native193.js +10 -24
- package/dist/native/index.native194.js +20 -9
- package/dist/native/index.native195.js +93 -41
- package/dist/native/index.native196.js +21 -8
- package/dist/native/index.native197.js +117 -20
- package/dist/native/index.native198.js +2 -8
- package/dist/native/index.native199.js +39 -2
- package/dist/native/index.native200.js +2 -378
- package/dist/native/index.native201.js +69 -835
- package/dist/native/index.native202.js +33 -37
- package/dist/native/index.native203.js +21 -2
- package/dist/native/index.native204.js +7 -69
- package/dist/native/index.native205.js +2 -35
- package/dist/native/index.native206.js +374 -17
- package/dist/native/index.native207.js +836 -2
- package/dist/native/index.native213.js +32 -6
- package/dist/native/index.native214.js +6 -32
- package/dist/native/index.native215.js +3 -17
- package/dist/native/index.native216.js +18 -28
- package/dist/native/index.native217.js +26 -6
- package/dist/native/index.native218.js +6 -9
- package/dist/native/index.native219.js +11 -13
- package/dist/native/index.native220.js +11 -8
- package/dist/native/index.native221.js +7 -14
- package/dist/native/index.native222.js +16 -80
- package/dist/native/index.native223.js +80 -3
- package/dist/native/index.native224.js +2 -2
- package/dist/native/index.native225.js +2 -2
- package/dist/native/index.native226.js +2 -2
- package/dist/native/index.native227.js +1 -1
- package/dist/native/index.native3.js +1 -1
- package/dist/native/index.native88.js +2 -2
- package/dist/native/index.native9.js +1 -1
- package/dist/native/index.native92.js +2 -2
- package/dist/native-types/index.d.ts +1 -0
- package/dist/native-types/version.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index.web105.js +1 -1
- package/dist/web/index.web107.js +4 -4
- package/dist/web/index.web108.js +3 -3
- package/dist/web/index.web109.js +31 -2
- package/dist/web/index.web110.js +28 -65
- package/dist/web/index.web111.js +2 -367
- package/dist/web/index.web112.js +65 -28
- package/dist/web/index.web113.js +364 -28
- package/dist/web/index.web118.js +53 -11
- package/dist/web/index.web119.js +10 -11
- package/dist/web/index.web120.js +2 -55
- package/dist/web/index.web121.js +45 -11
- package/dist/web/index.web122.js +14 -2
- package/dist/web/index.web123.js +12 -44
- package/dist/web/index.web124.js +11 -13
- package/dist/web/index.web125.js +2 -2
- package/dist/web/index.web129.js +1 -1
- package/dist/web/index.web148.js +1 -1
- package/dist/web/index.web150.js +1 -1
- package/dist/web/index.web153.js +2 -2
- package/dist/web/index.web161.js +1 -1
- package/dist/web/index.web162.js +1 -1
- package/dist/web/index.web163.js +2 -2
- package/dist/web/index.web167.js +19 -102
- package/dist/web/index.web168.js +10 -79
- package/dist/web/index.web169.js +20 -80
- package/dist/web/index.web170.js +94 -15
- package/dist/web/index.web171.js +20 -28
- package/dist/web/index.web172.js +118 -8
- package/dist/web/index.web173.js +103 -3
- package/dist/web/index.web174.js +77 -27
- package/dist/web/index.web175.js +79 -8
- package/dist/web/index.web176.js +14 -7
- package/dist/web/index.web177.js +18 -70
- package/dist/web/index.web178.js +7 -28
- package/dist/web/index.web179.js +3 -3
- package/dist/web/index.web180.js +19 -6
- package/dist/web/index.web181.js +8 -4
- package/dist/web/index.web182.js +7 -14
- package/dist/web/index.web183.js +79 -18
- package/dist/web/index.web184.js +15 -48
- package/dist/web/index.web185.js +3 -17
- package/dist/web/index.web186.js +15 -23
- package/dist/web/index.web187.js +4 -8
- package/dist/web/index.web188.js +5 -33
- package/dist/web/index.web189.js +19 -7
- package/dist/web/index.web190.js +57 -16
- package/dist/web/index.web191.js +17 -20
- package/dist/web/index.web192.js +24 -10
- package/dist/web/index.web193.js +9 -20
- package/dist/web/index.web194.js +42 -93
- package/dist/web/index.web195.js +8 -21
- package/dist/web/index.web196.js +20 -117
- package/dist/web/index.web197.js +8 -2
- package/dist/web/index.web198.js +2 -8
- package/dist/web/index.web199.js +378 -2
- package/dist/web/index.web200.js +812 -354
- package/dist/web/index.web201.js +38 -835
- package/dist/web/index.web202.js +2 -39
- package/dist/web/index.web203.js +70 -2
- package/dist/web/index.web204.js +31 -66
- package/dist/web/index.web205.js +19 -33
- package/dist/web/index.web206.js +2 -21
- package/dist/web/index.web212.js +32 -6
- package/dist/web/index.web213.js +6 -32
- package/dist/web/index.web214.js +17 -3
- package/dist/web/index.web215.js +28 -2
- package/dist/web/index.web216.js +8 -2
- package/dist/web/index.web217.js +11 -2
- package/dist/web/index.web218.js +11 -16
- package/dist/web/index.web219.js +10 -28
- package/dist/web/index.web220.js +17 -8
- package/dist/web/index.web221.js +79 -9
- package/dist/web/index.web222.js +3 -12
- package/dist/web/index.web223.js +2 -10
- package/dist/web/index.web224.js +2 -17
- package/dist/web/index.web225.js +2 -81
- package/dist/web/index.web226.js +1 -1
- package/dist/web/index.web3.js +1 -1
- package/dist/web/index.web8.js +1 -1
- package/dist/web/index.web90.js +2 -2
- package/dist/web/index.web94.js +2 -2
- package/dist/web-types/index.d.ts +1 -0
- package/dist/web-types/version.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { maxBytesPerTransaction as y, bytesPerBlob as a, fieldElementsPerBlob as f, bytesPerFieldElement as p } from "./index.native228.js";
|
|
2
|
+
import { EmptyBlobError as c, BlobSizeTooLargeError as h } from "./index.native157.js";
|
|
3
|
+
import { createCursor as B } from "./index.native146.js";
|
|
4
|
+
import { size as u } from "./index.native141.js";
|
|
5
|
+
import { hexToBytes as x } from "./index.native134.js";
|
|
6
|
+
import { bytesToHex as d } from "./index.native132.js";
|
|
7
|
+
function S(e) {
|
|
8
|
+
const m = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), i = typeof e.data == "string" ? x(e.data) : e.data, o = u(i);
|
|
9
|
+
if (!o)
|
|
10
|
+
throw new c();
|
|
11
|
+
if (o > y)
|
|
12
|
+
throw new h({
|
|
13
|
+
maxSize: y,
|
|
14
|
+
size: o
|
|
15
|
+
});
|
|
16
|
+
const s = [];
|
|
17
|
+
let n = !0, r = 0;
|
|
18
|
+
for (; n; ) {
|
|
19
|
+
const t = B(new Uint8Array(a));
|
|
20
|
+
let l = 0;
|
|
21
|
+
for (; l < f; ) {
|
|
22
|
+
const b = i.slice(r, r + (p - 1));
|
|
23
|
+
if (t.pushByte(0), t.pushBytes(b), b.length < 31) {
|
|
24
|
+
t.pushByte(128), n = !1;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
l++, r += 31;
|
|
28
|
+
}
|
|
29
|
+
s.push(t);
|
|
30
|
+
}
|
|
31
|
+
return m === "bytes" ? s.map((t) => t.bytes) : s.map((t) => d(t.bytes));
|
|
6
32
|
}
|
|
7
33
|
export {
|
|
8
|
-
|
|
34
|
+
S as toBlobs
|
|
9
35
|
};
|
|
@@ -1,35 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { bytesToHex as d } from "./index.native132.js";
|
|
7
|
-
function S(e) {
|
|
8
|
-
const m = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), i = typeof e.data == "string" ? x(e.data) : e.data, o = u(i);
|
|
9
|
-
if (!o)
|
|
10
|
-
throw new c();
|
|
11
|
-
if (o > y)
|
|
12
|
-
throw new h({
|
|
13
|
-
maxSize: y,
|
|
14
|
-
size: o
|
|
15
|
-
});
|
|
16
|
-
const s = [];
|
|
17
|
-
let n = !0, r = 0;
|
|
18
|
-
for (; n; ) {
|
|
19
|
-
const t = B(new Uint8Array(a));
|
|
20
|
-
let l = 0;
|
|
21
|
-
for (; l < f; ) {
|
|
22
|
-
const b = i.slice(r, r + (p - 1));
|
|
23
|
-
if (t.pushByte(0), t.pushBytes(b), b.length < 31) {
|
|
24
|
-
t.pushByte(128), n = !1;
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
l++, r += 31;
|
|
28
|
-
}
|
|
29
|
-
s.push(t);
|
|
30
|
-
}
|
|
31
|
-
return m === "bytes" ? s.map((t) => t.bytes) : s.map((t) => d(t.bytes));
|
|
1
|
+
import { bytesToHex as i } from "./index.native132.js";
|
|
2
|
+
import { sha256 as m } from "./index.native150.js";
|
|
3
|
+
function f(t) {
|
|
4
|
+
const { commitment: e, version: s = 1 } = t, n = t.to ?? (typeof e == "string" ? "hex" : "bytes"), o = m(e);
|
|
5
|
+
return o.set([s], 0), n === "bytes" ? o : i(o);
|
|
32
6
|
}
|
|
33
7
|
export {
|
|
34
|
-
|
|
8
|
+
f as commitmentToVersionedHash
|
|
35
9
|
};
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
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;
|
|
1
|
+
function e(t) {
|
|
2
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
16
3
|
}
|
|
17
4
|
export {
|
|
18
|
-
|
|
19
|
-
o as encodeBase64
|
|
5
|
+
e as getDefaultExportFromCjs
|
|
20
6
|
};
|
|
@@ -1,30 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
};
|
|
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
|
+
}
|
|
28
17
|
export {
|
|
29
|
-
|
|
18
|
+
a as decodeBase64,
|
|
19
|
+
o as encodeBase64
|
|
30
20
|
};
|
|
@@ -1,10 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { JOSENotSupported as r } from "./index.native105.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`);
|
|
6
26
|
}
|
|
7
27
|
};
|
|
8
28
|
export {
|
|
9
|
-
|
|
29
|
+
S as default
|
|
10
30
|
};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
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]);
|
|
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`);
|
|
8
6
|
}
|
|
9
|
-
return i(r, t, e), r;
|
|
10
7
|
};
|
|
11
8
|
export {
|
|
12
|
-
|
|
9
|
+
o as default
|
|
13
10
|
};
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import { checkSigCryptoKey as i } from "./index.native229.js";
|
|
2
|
+
import o from "./index.native220.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
|
+
};
|
|
12
11
|
export {
|
|
13
|
-
|
|
14
|
-
t as withAlg
|
|
12
|
+
s as default
|
|
15
13
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
function e
|
|
2
|
-
|
|
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;
|
|
3
7
|
}
|
|
4
|
-
|
|
5
|
-
|
|
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);
|
|
6
11
|
}
|
|
7
|
-
const n = (t) => e(t) || r(t);
|
|
8
12
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
r as isKeyObject
|
|
13
|
+
r as default,
|
|
14
|
+
t as withAlg
|
|
12
15
|
};
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import n from "./index.native121.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
1
|
function e(t) {
|
|
9
|
-
return t.
|
|
2
|
+
return t?.[Symbol.toStringTag] === "CryptoKey";
|
|
10
3
|
}
|
|
11
|
-
function
|
|
12
|
-
return t.
|
|
4
|
+
function r(t) {
|
|
5
|
+
return t?.[Symbol.toStringTag] === "KeyObject";
|
|
13
6
|
}
|
|
7
|
+
const n = (t) => e(t) || r(t);
|
|
14
8
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
c as isSecretJWK
|
|
9
|
+
n as default,
|
|
10
|
+
e as isCryptoKey,
|
|
11
|
+
r as isKeyObject
|
|
19
12
|
};
|
|
@@ -1,83 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
+
import n from "./index.native123.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";
|
|
74
13
|
}
|
|
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
14
|
export {
|
|
82
|
-
|
|
15
|
+
r as isJWK,
|
|
16
|
+
o as isPrivateJWK,
|
|
17
|
+
e as isPublicJWK,
|
|
18
|
+
c as isSecretJWK
|
|
83
19
|
};
|
|
@@ -1,6 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { JOSENotSupported as s } from "./index.native105.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 };
|
|
3
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
|
+
};
|
|
4
81
|
export {
|
|
5
|
-
|
|
82
|
+
i as default
|
|
6
83
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { __require as r } from "./index.
|
|
1
|
+
import { __require as r } from "./index.native204.js";
|
|
2
2
|
r();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InvalidAddressError as s } from "./index.
|
|
2
|
-
import { isAddress as a } from "./index.
|
|
1
|
+
import { InvalidAddressError as s } from "./index.native117.js";
|
|
2
|
+
import { isAddress as a } from "./index.native118.js";
|
|
3
3
|
function r(n) {
|
|
4
4
|
if (typeof n == "string") {
|
|
5
5
|
if (!a(n, { strict: !1 }))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DisconnectedError as l, from as d } from "./index.native107.js";
|
|
2
2
|
import { validateRequest as h, EIP1193ProviderError as m, STANDARD_ERROR_CODES as _ } from "./index.native75.js";
|
|
3
|
-
import { createEOAHandlers as p } from "./index.
|
|
4
|
-
import { createSmartAccountHandlers as g } from "./index.
|
|
3
|
+
import { createEOAHandlers as p } from "./index.native111.js";
|
|
4
|
+
import { createSmartAccountHandlers as g } from "./index.native112.js";
|
|
5
5
|
import "viem";
|
|
6
6
|
import "zustand";
|
|
7
7
|
import "@coinbase/cdp-api-client";
|
|
@@ -43,3 +43,4 @@ export * from './eip1193/types.js';
|
|
|
43
43
|
export * from './secureIframe/index.js';
|
|
44
44
|
export { createEvmKeyExportIframe, createSolanaKeyExportIframe, type CreateKeyExportIframeOptions, type CreateKeyExportIframeResult, } from './actions/createKeyExportIframe.js';
|
|
45
45
|
export { getConfig } from './state.js';
|
|
46
|
+
export { toTransactionSigner } from './solana-kit/toTransactionSigner.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.0.
|
|
1
|
+
export declare const VERSION = "0.0.92";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -43,3 +43,4 @@ export * from './eip1193/types.js';
|
|
|
43
43
|
export * from './secureIframe/index.js';
|
|
44
44
|
export { createEvmKeyExportIframe, createSolanaKeyExportIframe, type CreateKeyExportIframeOptions, type CreateKeyExportIframeResult, } from './actions/createKeyExportIframe.js';
|
|
45
45
|
export { getConfig } from './state.js';
|
|
46
|
+
export { toTransactionSigner } from './solana-kit/toTransactionSigner.js';
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.0.
|
|
1
|
+
export declare const VERSION = "0.0.92";
|
package/dist/web/index.web105.js
CHANGED
package/dist/web/index.web107.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { encoder as n } from "./index.
|
|
2
|
-
import e from "./index.
|
|
3
|
-
import i from "./index.
|
|
4
|
-
import o from "./index.
|
|
1
|
+
import { encoder as n } from "./index.web119.js";
|
|
2
|
+
import e from "./index.web120.js";
|
|
3
|
+
import i from "./index.web121.js";
|
|
4
|
+
import o from "./index.web122.js";
|
|
5
5
|
function s(r, t) {
|
|
6
6
|
if (!Number.isFinite(t))
|
|
7
7
|
throw new TypeError(`Invalid ${r} input`);
|
package/dist/web/index.web108.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index.
|
|
2
|
-
import { BaseError as P } from "./index.
|
|
3
|
-
import { parse as y, parseError as j, InternalError as g } from "./index.
|
|
1
|
+
import "./index.web111.js";
|
|
2
|
+
import { BaseError as P } from "./index.web112.js";
|
|
3
|
+
import { parse as y, parseError as j, InternalError as g } from "./index.web113.js";
|
|
4
4
|
class u extends Error {
|
|
5
5
|
constructor(e, t) {
|
|
6
6
|
super(t), Object.defineProperty(this, "name", {
|
package/dist/web/index.web109.js
CHANGED
|
@@ -1,2 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
e
|
|
1
|
+
import { handleAccounts as t } from "./index.web176.js";
|
|
2
|
+
import { handleEthSign as e } from "./index.web177.js";
|
|
3
|
+
import { handleGetCallsStatus as a } from "./index.web178.js";
|
|
4
|
+
import { handleGetCapabilities as n } from "./index.web179.js";
|
|
5
|
+
import { handlePersonalSign as o } from "./index.web180.js";
|
|
6
|
+
import { handleRequestAccounts as r } from "./index.web181.js";
|
|
7
|
+
import { handleSendCalls as i } from "./index.web182.js";
|
|
8
|
+
import { handleSendTransaction as l } from "./index.web183.js";
|
|
9
|
+
import { handleSignTypedData as h } from "./index.web184.js";
|
|
10
|
+
import { handleChainId as s } from "./index.web185.js";
|
|
11
|
+
import { handleDisconnect as m } from "./index.web186.js";
|
|
12
|
+
import { handleSwitchEthereumChain as d } from "./index.web187.js";
|
|
13
|
+
function D() {
|
|
14
|
+
return {
|
|
15
|
+
eth_accounts: t,
|
|
16
|
+
eth_requestAccounts: r,
|
|
17
|
+
personal_sign: o,
|
|
18
|
+
eth_sendTransaction: l,
|
|
19
|
+
eth_signTypedData_v4: h,
|
|
20
|
+
wallet_disconnect: m,
|
|
21
|
+
wallet_switchEthereumChain: d,
|
|
22
|
+
eth_sign: e,
|
|
23
|
+
eth_chainId: s,
|
|
24
|
+
wallet_sendCalls: i,
|
|
25
|
+
wallet_getCallsStatus: a,
|
|
26
|
+
wallet_getCapabilities: n
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
D as createEOAHandlers
|
|
31
|
+
};
|