@coinbase/cdp-core 0.0.114 → 0.0.116
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.web126.js +12 -12
- package/dist/esm/index.web128.js +12 -12
- package/dist/esm/index.web129.js +12 -12
- package/dist/esm/index.web130.js +1 -1
- package/dist/esm/index.web131.js +1 -1
- package/dist/esm/index.web133.js +1 -1
- package/dist/esm/index.web135.js +4 -4
- package/dist/esm/index.web136.js +1 -1
- package/dist/esm/index.web137.js +2 -2
- package/dist/esm/index.web138.js +4 -944
- package/dist/esm/index.web139.js +945 -2
- package/dist/esm/index.web140.js +2 -50
- package/dist/esm/index.web141.js +49 -26
- package/dist/esm/index.web142.js +26 -14
- package/dist/esm/index.web143.js +53 -27
- package/dist/esm/index.web144.js +10 -7
- package/dist/esm/index.web145.js +2 -4
- package/dist/esm/index.web146.js +44 -28
- package/dist/esm/index.web147.js +13 -8
- package/dist/esm/index.web148.js +14 -7
- package/dist/esm/index.web149.js +18 -70
- package/dist/esm/index.web150.js +7 -28
- package/dist/esm/index.web151.js +3 -3
- package/dist/esm/index.web152.js +19 -6
- package/dist/esm/index.web153.js +8 -4
- package/dist/esm/index.web154.js +7 -14
- package/dist/esm/index.web155.js +79 -18
- package/dist/esm/index.web156.js +15 -48
- package/dist/esm/index.web157.js +3 -17
- package/dist/esm/index.web158.js +15 -23
- package/dist/esm/index.web159.js +4 -8
- package/dist/esm/index.web160.js +5 -33
- package/dist/esm/index.web161.js +19 -7
- package/dist/esm/index.web162.js +57 -16
- package/dist/esm/index.web163.js +18 -5
- package/dist/esm/index.web164.js +19 -43
- package/dist/esm/index.web165.js +8 -4
- package/dist/esm/index.web166.js +41 -53
- package/dist/esm/index.web167.js +7 -10
- package/dist/esm/index.web168.js +21 -2
- package/dist/esm/index.web169.js +5 -45
- package/dist/esm/index.web170.js +46 -12
- package/dist/esm/index.web171.js +2 -104
- package/dist/esm/index.web172.js +2 -79
- package/dist/esm/index.web173.js +103 -78
- package/dist/esm/index.web174.js +75 -18
- package/dist/esm/index.web175.js +78 -32
- package/dist/esm/index.web176.js +19 -10
- package/dist/esm/index.web177.js +32 -4
- package/dist/esm/index.web178.js +10 -53
- package/dist/esm/index.web179.js +4 -55
- package/dist/esm/index.web180.js +55 -3
- package/dist/esm/index.web181.js +54 -33
- package/dist/esm/index.web182.js +3 -45
- package/dist/esm/index.web183.js +34 -13
- package/dist/esm/index.web184.js +45 -6
- package/dist/esm/index.web185.js +13 -104
- package/dist/esm/index.web186.js +6 -17
- package/dist/esm/index.web187.js +104 -8
- package/dist/esm/index.web188.js +16 -9
- package/dist/esm/index.web189.js +8 -11
- package/dist/esm/index.web190.js +10 -13
- package/dist/esm/index.web191.js +11 -3
- package/dist/esm/index.web192.js +13 -6
- package/dist/esm/index.web193.js +3 -42
- package/dist/esm/index.web194.js +6 -78
- package/dist/esm/index.web195.js +42 -14
- package/dist/esm/index.web196.js +75 -15
- package/dist/esm/index.web197.js +14 -12
- package/dist/esm/index.web198.js +18 -28
- package/dist/esm/index.web199.js +2 -128
- package/dist/esm/index.web2.js +2 -2
- package/dist/esm/index.web200.js +108 -6
- package/dist/esm/index.web201.js +2 -3
- package/dist/esm/index.web202.js +13 -2
- package/dist/esm/index.web203.js +29 -2
- package/dist/esm/index.web204.js +126 -36
- package/dist/esm/index.web205.js +6 -6
- package/dist/esm/index.web206.js +3 -35
- package/dist/esm/index.web207.js +2 -35
- package/dist/esm/index.web208.js +2 -6
- package/dist/esm/index.web209.js +38 -5
- package/dist/esm/index.web210.js +6 -10
- package/dist/esm/index.web211.js +35 -2
- package/dist/esm/index.web212.js +35 -2
- package/dist/esm/index.web213.js +6 -2
- package/dist/esm/index.web214.js +5 -109
- package/dist/esm/index.web215.js +11 -2
- package/dist/esm/index.web216.js +17 -43
- package/dist/esm/index.web217.js +10 -8
- package/dist/esm/index.web218.js +20 -2
- package/dist/esm/index.web219.js +85 -352
- package/dist/esm/index.web220.js +21 -853
- package/dist/esm/index.web221.js +117 -38
- package/dist/esm/index.web222.js +39 -2
- package/dist/esm/index.web223.js +2 -70
- package/dist/esm/index.web224.js +66 -31
- package/dist/esm/index.web225.js +33 -13
- package/dist/esm/index.web226.js +13 -19
- package/dist/esm/index.web227.js +8 -10
- package/dist/esm/index.web228.js +2 -20
- package/dist/esm/index.web229.js +352 -85
- package/dist/esm/index.web230.js +853 -21
- package/dist/esm/index.web231.js +44 -115
- package/dist/esm/index.web234.js +2 -2
- package/dist/esm/index.web235.js +5 -5
- package/dist/esm/index.web236.js +1 -1
- package/dist/esm/index.web238.js +18 -2
- package/dist/esm/index.web239.js +28 -2
- package/dist/esm/index.web240.js +8 -2
- package/dist/esm/index.web241.js +11 -18
- package/dist/esm/index.web242.js +13 -28
- package/dist/esm/index.web243.js +10 -8
- package/dist/esm/index.web244.js +17 -11
- package/dist/esm/index.web245.js +80 -12
- package/dist/esm/index.web246.js +2 -10
- package/dist/esm/index.web247.js +2 -17
- package/dist/esm/index.web248.js +2 -81
- package/dist/esm/index.web250.js +1 -1
- package/dist/esm/index.web3.js +1 -1
- package/dist/esm/index.web9.js +1 -1
- package/dist/esm/index.web92.js +22 -22
- package/dist/esm/index.web93.js +2 -1
- package/dist/esm/index.web94.js +62 -46
- package/dist/esm/index.web99.js +1 -1
- package/dist/native/index.native101.js +1 -1
- package/dist/native/index.native109.js +3 -3
- package/dist/native/index.native11.js +1 -1
- package/dist/native/index.native112.js +2 -2
- package/dist/native/index.native116.js +1 -1
- package/dist/native/index.native129.js +373 -13
- package/dist/native/index.native130.js +2 -25
- package/dist/native/index.native131.js +63 -48
- package/dist/native/index.native132.js +177 -189
- package/dist/native/index.native133.js +108 -2
- package/dist/native/index.native134.js +14 -63
- package/dist/native/index.native135.js +18 -360
- package/dist/native/index.native136.js +49 -88
- package/dist/native/index.native137.js +12 -12
- package/dist/native/index.native138.js +12 -12
- package/dist/native/index.native139.js +4 -944
- package/dist/native/index.native140.js +945 -2
- package/dist/native/index.native141.js +2 -50
- package/dist/native/index.native142.js +49 -26
- package/dist/native/index.native143.js +26 -54
- package/dist/native/index.native144.js +12 -10
- package/dist/native/index.native145.js +12 -2
- package/dist/native/index.native146.js +54 -44
- package/dist/native/index.native147.js +10 -13
- package/dist/native/index.native148.js +2 -5
- package/dist/native/index.native149.js +45 -5
- package/dist/native/index.native150.js +12 -46
- package/dist/native/index.native151.js +5 -35
- package/dist/native/index.native152.js +40 -60
- package/dist/native/index.native153.js +36 -14
- package/dist/native/index.native154.js +65 -25
- package/dist/native/index.native155.js +13 -7
- package/dist/native/index.native156.js +27 -3
- package/dist/native/index.native157.js +7 -27
- package/dist/native/index.native158.js +3 -8
- package/dist/native/index.native159.js +27 -7
- package/dist/native/index.native160.js +8 -79
- package/dist/native/index.native161.js +7 -27
- package/dist/native/index.native162.js +79 -3
- package/dist/native/index.native163.js +18 -5
- package/dist/native/index.native164.js +3 -4
- package/dist/native/index.native165.js +4 -3
- package/dist/native/index.native166.js +4 -19
- package/dist/native/index.native167.js +5 -52
- package/dist/native/index.native168.js +19 -17
- package/dist/native/index.native169.js +55 -18
- package/dist/native/index.native170.js +17 -8
- package/dist/native/index.native171.js +19 -37
- package/dist/native/index.native172.js +8 -7
- package/dist/native/index.native173.js +38 -17
- package/dist/native/index.native174.js +7 -12
- package/dist/native/index.native175.js +20 -11
- package/dist/native/index.native191.js +1 -1
- package/dist/native/index.native193.js +1 -1
- package/dist/native/index.native194.js +2 -2
- package/dist/native/index.native196.js +1 -1
- package/dist/native/index.native197.js +2 -2
- package/dist/native/index.native2.js +2 -2
- package/dist/native/index.native205.js +2 -2
- package/dist/native/index.native208.js +1 -1
- package/dist/native/index.native209.js +1 -1
- package/dist/native/index.native215.js +108 -20
- package/dist/native/index.native216.js +2 -10
- package/dist/native/index.native217.js +2 -20
- package/dist/native/index.native218.js +99 -89
- package/dist/native/index.native219.js +78 -20
- package/dist/native/index.native220.js +79 -118
- package/dist/native/index.native221.js +21 -2
- package/dist/native/index.native222.js +10 -109
- package/dist/native/index.native223.js +20 -2
- package/dist/native/index.native224.js +94 -39
- package/dist/native/index.native225.js +21 -2
- package/dist/native/index.native226.js +117 -69
- package/dist/native/index.native227.js +7 -34
- package/dist/native/index.native228.js +2 -15
- package/dist/native/index.native229.js +360 -7
- package/dist/native/index.native230.js +853 -2
- package/dist/native/index.native231.js +35 -357
- package/dist/native/index.native232.js +2 -853
- package/dist/native/index.native233.js +69 -103
- package/dist/native/index.native234.js +32 -76
- package/dist/native/index.native235.js +14 -78
- package/dist/native/index.native236.js +40 -14
- package/dist/native/index.native237.js +21 -2
- package/dist/native/index.native238.js +2 -20
- package/dist/native/index.native239.js +18 -31
- package/dist/native/index.native240.js +32 -6
- package/dist/native/index.native241.js +6 -46
- package/dist/native/index.native242.js +3 -17
- package/dist/native/index.native243.js +18 -28
- package/dist/native/index.native244.js +26 -6
- package/dist/native/index.native245.js +6 -9
- package/dist/native/index.native246.js +11 -13
- package/dist/native/index.native247.js +11 -8
- package/dist/native/index.native248.js +7 -14
- package/dist/native/index.native249.js +16 -80
- package/dist/native/index.native250.js +81 -2
- package/dist/native/index.native251.js +2 -2
- package/dist/native/index.native252.js +2 -2
- package/dist/native/index.native253.js +2 -4
- package/dist/native/index.native255.js +14 -78
- package/dist/native/index.native256.js +78 -14
- package/dist/native/index.native3.js +1 -1
- package/dist/native/index.native86.js +1 -1
- package/dist/native-types/actions/createKeyExportIframe.d.ts +60 -3
- package/dist/native-types/index.d.ts +1 -1
- package/dist/native-types/index.web.d.ts +1 -1
- package/dist/native-types/secureIframe/data.d.ts +1 -0
- package/dist/native-types/secureIframe/index.d.ts +1 -1
- package/dist/native-types/secureIframe/types.d.ts +64 -2
- package/dist/native-types/secureIframe/utils.d.ts +38 -0
- package/dist/native-types/version.d.ts +1 -1
- package/dist/types/actions/createKeyExportIframe.d.ts +60 -3
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.web.d.ts +1 -1
- package/dist/types/secureIframe/data.d.ts +1 -0
- package/dist/types/secureIframe/index.d.ts +1 -1
- package/dist/types/secureIframe/types.d.ts +64 -2
- package/dist/types/secureIframe/utils.d.ts +38 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index.web126.js +12 -12
- package/dist/web/index.web128.js +12 -12
- package/dist/web/index.web129.js +12 -12
- package/dist/web/index.web130.js +1 -1
- package/dist/web/index.web131.js +1 -1
- package/dist/web/index.web133.js +1 -1
- package/dist/web/index.web135.js +4 -4
- package/dist/web/index.web136.js +1 -1
- package/dist/web/index.web137.js +2 -2
- package/dist/web/index.web138.js +4 -944
- package/dist/web/index.web139.js +945 -2
- package/dist/web/index.web140.js +2 -50
- package/dist/web/index.web141.js +49 -26
- package/dist/web/index.web142.js +26 -14
- package/dist/web/index.web143.js +53 -27
- package/dist/web/index.web144.js +10 -7
- package/dist/web/index.web145.js +2 -4
- package/dist/web/index.web146.js +44 -28
- package/dist/web/index.web147.js +13 -8
- package/dist/web/index.web148.js +14 -7
- package/dist/web/index.web149.js +18 -70
- package/dist/web/index.web150.js +7 -28
- package/dist/web/index.web151.js +3 -3
- package/dist/web/index.web152.js +19 -6
- package/dist/web/index.web153.js +8 -4
- package/dist/web/index.web154.js +7 -14
- package/dist/web/index.web155.js +79 -18
- package/dist/web/index.web156.js +15 -48
- package/dist/web/index.web157.js +3 -17
- package/dist/web/index.web158.js +15 -23
- package/dist/web/index.web159.js +4 -8
- package/dist/web/index.web160.js +5 -33
- package/dist/web/index.web161.js +19 -7
- package/dist/web/index.web162.js +57 -16
- package/dist/web/index.web163.js +18 -5
- package/dist/web/index.web164.js +19 -43
- package/dist/web/index.web165.js +8 -4
- package/dist/web/index.web166.js +41 -53
- package/dist/web/index.web167.js +7 -10
- package/dist/web/index.web168.js +21 -2
- package/dist/web/index.web169.js +5 -45
- package/dist/web/index.web170.js +46 -12
- package/dist/web/index.web171.js +2 -104
- package/dist/web/index.web172.js +2 -79
- package/dist/web/index.web173.js +103 -78
- package/dist/web/index.web174.js +75 -18
- package/dist/web/index.web175.js +78 -32
- package/dist/web/index.web176.js +19 -10
- package/dist/web/index.web177.js +32 -4
- package/dist/web/index.web178.js +10 -53
- package/dist/web/index.web179.js +4 -55
- package/dist/web/index.web180.js +55 -3
- package/dist/web/index.web181.js +54 -33
- package/dist/web/index.web182.js +3 -45
- package/dist/web/index.web183.js +34 -13
- package/dist/web/index.web184.js +45 -6
- package/dist/web/index.web185.js +13 -104
- package/dist/web/index.web186.js +6 -17
- package/dist/web/index.web187.js +104 -8
- package/dist/web/index.web188.js +16 -9
- package/dist/web/index.web189.js +8 -11
- package/dist/web/index.web190.js +10 -13
- package/dist/web/index.web191.js +11 -3
- package/dist/web/index.web192.js +13 -6
- package/dist/web/index.web193.js +3 -42
- package/dist/web/index.web194.js +6 -78
- package/dist/web/index.web195.js +42 -14
- package/dist/web/index.web196.js +75 -15
- package/dist/web/index.web197.js +14 -12
- package/dist/web/index.web198.js +18 -28
- package/dist/web/index.web199.js +2 -128
- package/dist/web/index.web2.js +2 -2
- package/dist/web/index.web200.js +108 -6
- package/dist/web/index.web201.js +2 -3
- package/dist/web/index.web202.js +13 -2
- package/dist/web/index.web203.js +29 -2
- package/dist/web/index.web204.js +126 -36
- package/dist/web/index.web205.js +6 -6
- package/dist/web/index.web206.js +3 -35
- package/dist/web/index.web207.js +2 -35
- package/dist/web/index.web208.js +2 -6
- package/dist/web/index.web209.js +38 -5
- package/dist/web/index.web210.js +6 -10
- package/dist/web/index.web211.js +35 -2
- package/dist/web/index.web212.js +35 -2
- package/dist/web/index.web213.js +6 -2
- package/dist/web/index.web214.js +5 -109
- package/dist/web/index.web215.js +11 -2
- package/dist/web/index.web216.js +17 -43
- package/dist/web/index.web217.js +10 -8
- package/dist/web/index.web218.js +20 -2
- package/dist/web/index.web219.js +85 -352
- package/dist/web/index.web220.js +21 -853
- package/dist/web/index.web221.js +117 -38
- package/dist/web/index.web222.js +39 -2
- package/dist/web/index.web223.js +2 -70
- package/dist/web/index.web224.js +66 -31
- package/dist/web/index.web225.js +33 -13
- package/dist/web/index.web226.js +13 -19
- package/dist/web/index.web227.js +8 -10
- package/dist/web/index.web228.js +2 -20
- package/dist/web/index.web229.js +352 -85
- package/dist/web/index.web230.js +853 -21
- package/dist/web/index.web231.js +44 -115
- package/dist/web/index.web234.js +2 -2
- package/dist/web/index.web235.js +5 -5
- package/dist/web/index.web236.js +1 -1
- package/dist/web/index.web238.js +18 -2
- package/dist/web/index.web239.js +28 -2
- package/dist/web/index.web240.js +8 -2
- package/dist/web/index.web241.js +11 -18
- package/dist/web/index.web242.js +13 -28
- package/dist/web/index.web243.js +10 -8
- package/dist/web/index.web244.js +17 -11
- package/dist/web/index.web245.js +80 -12
- package/dist/web/index.web246.js +2 -10
- package/dist/web/index.web247.js +2 -17
- package/dist/web/index.web248.js +2 -81
- package/dist/web/index.web250.js +1 -1
- package/dist/web/index.web3.js +1 -1
- package/dist/web/index.web9.js +1 -1
- package/dist/web/index.web92.js +22 -22
- package/dist/web/index.web93.js +2 -1
- package/dist/web/index.web94.js +62 -46
- package/dist/web/index.web99.js +1 -1
- package/dist/web-types/actions/createKeyExportIframe.d.ts +60 -3
- package/dist/web-types/index.d.ts +1 -1
- package/dist/web-types/index.web.d.ts +1 -1
- package/dist/web-types/secureIframe/data.d.ts +1 -0
- package/dist/web-types/secureIframe/index.d.ts +1 -1
- package/dist/web-types/secureIframe/types.d.ts +64 -2
- package/dist/web-types/secureIframe/utils.d.ts +38 -0
- package/dist/web-types/version.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import { SecureIframeStatus, SecureIframeTheme } from '../secureIframe/types.js';
|
|
1
|
+
import { SecureIframeAction, SecureIframeOperation, SecureIframeStatus, SecureIframeTheme } from '../secureIframe/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Extra details that accompany a status update.
|
|
4
|
+
*/
|
|
5
|
+
export interface SecureIframeStatusDetails {
|
|
6
|
+
/** Which action the status refers to (copy or eject). */
|
|
7
|
+
operation?: SecureIframeOperation;
|
|
8
|
+
/** The backend error type, set only for API-backed error statuses. */
|
|
9
|
+
errorType?: string;
|
|
10
|
+
/** The backend correlation ID, useful for support. */
|
|
11
|
+
correlationId?: string;
|
|
12
|
+
}
|
|
2
13
|
/**
|
|
3
14
|
* Options for setting up a key export iframe.
|
|
4
15
|
*/
|
|
@@ -17,27 +28,67 @@ export interface CreateKeyExportIframeOptions {
|
|
|
17
28
|
*/
|
|
18
29
|
projectId: string;
|
|
19
30
|
/**
|
|
20
|
-
*
|
|
31
|
+
* Which button to render initially: "copy" (default) or "eject". When
|
|
32
|
+
* "eject", the iframe renders the eject button immediately (after validating
|
|
33
|
+
* the account is exportable) instead of the copy button.
|
|
34
|
+
*
|
|
35
|
+
* @default "copy"
|
|
36
|
+
*/
|
|
37
|
+
action?: SecureIframeAction;
|
|
38
|
+
/**
|
|
39
|
+
* The label for the copy button displayed in the iframe.
|
|
21
40
|
*/
|
|
22
41
|
label?: string;
|
|
23
42
|
/**
|
|
24
43
|
* The label to display when the key is copied successfully.
|
|
25
44
|
*/
|
|
26
45
|
copiedLabel?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The label for the eject button. Defaults to "Eject wallet"; pass an empty
|
|
48
|
+
* string for an icon-only button.
|
|
49
|
+
*/
|
|
50
|
+
ejectLabel?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The label for the eject button while ejection is in progress. Defaults to
|
|
53
|
+
* "Ejecting…".
|
|
54
|
+
*/
|
|
55
|
+
ejectingLabel?: string;
|
|
56
|
+
/**
|
|
57
|
+
* The label for the eject button once the account has been ejected. Defaults
|
|
58
|
+
* to "Ejected".
|
|
59
|
+
*/
|
|
60
|
+
ejectedLabel?: string;
|
|
27
61
|
/**
|
|
28
62
|
* Whether to show an icon in the button.
|
|
29
63
|
*
|
|
30
64
|
* @default true
|
|
31
65
|
*/
|
|
32
66
|
icon?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether to show an icon on the eject button specifically. Falls back to
|
|
69
|
+
* `icon` when unset, so `icon: true, ejectIcon: false` shows an icon on copy
|
|
70
|
+
* but not on eject (useful since the eject glyph is less widely recognized).
|
|
71
|
+
*/
|
|
72
|
+
ejectIcon?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Whether the button should be full width.
|
|
75
|
+
*
|
|
76
|
+
* @default true
|
|
77
|
+
*/
|
|
78
|
+
fullWidth?: boolean;
|
|
33
79
|
/**
|
|
34
80
|
* Theme overrides for the iframe button.
|
|
35
81
|
*/
|
|
36
82
|
theme?: Partial<SecureIframeTheme>;
|
|
37
83
|
/**
|
|
38
84
|
* Callback invoked when the iframe status changes.
|
|
85
|
+
*
|
|
86
|
+
* @param status - The new status.
|
|
87
|
+
* @param message - Human-readable error message, set only for error statuses.
|
|
88
|
+
* @param details - Extra details: the operation (copy/eject) and, for API
|
|
89
|
+
* errors, the errorType and correlationId.
|
|
39
90
|
*/
|
|
40
|
-
onStatusUpdate?: (status: SecureIframeStatus, message?: string) => void;
|
|
91
|
+
onStatusUpdate?: (status: SecureIframeStatus, message?: string, details?: SecureIframeStatusDetails) => void;
|
|
41
92
|
}
|
|
42
93
|
/**
|
|
43
94
|
* Result of setting up a key export iframe.
|
|
@@ -55,6 +106,12 @@ export interface CreateKeyExportIframeResult {
|
|
|
55
106
|
* Function to update the theme of the iframe.
|
|
56
107
|
*/
|
|
57
108
|
updateTheme: (theme: Partial<SecureIframeTheme>) => void;
|
|
109
|
+
/**
|
|
110
|
+
* Function to reveal the eject button at runtime — e.g. after the consumer's
|
|
111
|
+
* own UI confirms the user has stored their copied key in the copy -> eject
|
|
112
|
+
* flow. Not needed when the iframe was created with `action: "eject"`.
|
|
113
|
+
*/
|
|
114
|
+
showEject: () => void;
|
|
58
115
|
}
|
|
59
116
|
/**
|
|
60
117
|
* Sets up a secure iframe for exporting EVM private keys.
|
|
@@ -59,6 +59,6 @@ export { createCDPEmbeddedWallet } from './eip1193/createCDPEmbeddedWallet.js';
|
|
|
59
59
|
export { EIP1193ProviderError, type EIP1193ErrorCode, type RPCErrorCode, STANDARD_ERROR_CODES, } from './eip1193/errors.js';
|
|
60
60
|
export * from './eip1193/types.js';
|
|
61
61
|
export * from './secureIframe/index.js';
|
|
62
|
-
export { createEvmKeyExportIframe, createSolanaKeyExportIframe, type CreateKeyExportIframeOptions, type CreateKeyExportIframeResult, } from './actions/createKeyExportIframe.js';
|
|
62
|
+
export { createEvmKeyExportIframe, createSolanaKeyExportIframe, type CreateKeyExportIframeOptions, type CreateKeyExportIframeResult, type SecureIframeStatusDetails, } from './actions/createKeyExportIframe.js';
|
|
63
63
|
export { getConfig } from './state.js';
|
|
64
64
|
export { toTransactionSigner } from './solana-kit/toTransactionSigner.js';
|
|
@@ -63,6 +63,6 @@ export { createCDPEmbeddedWallet } from './eip1193/createCDPEmbeddedWallet.js';
|
|
|
63
63
|
export { EIP1193ProviderError, type EIP1193ErrorCode, type RPCErrorCode, STANDARD_ERROR_CODES, } from './eip1193/errors.js';
|
|
64
64
|
export * from './eip1193/types.js';
|
|
65
65
|
export * from './secureIframe/index.js';
|
|
66
|
-
export { createEvmKeyExportIframe, createSolanaKeyExportIframe, type CreateKeyExportIframeOptions, type CreateKeyExportIframeResult, } from './actions/createKeyExportIframe.js';
|
|
66
|
+
export { createEvmKeyExportIframe, createSolanaKeyExportIframe, type CreateKeyExportIframeOptions, type CreateKeyExportIframeResult, type SecureIframeStatusDetails, } from './actions/createKeyExportIframe.js';
|
|
67
67
|
export { getConfig } from './state.js';
|
|
68
68
|
export { toTransactionSigner } from './solana-kit/toTransactionSigner.js';
|
|
@@ -17,6 +17,7 @@ export declare const SECURE_IFRAME_EVENT_TYPE: {
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const SECURE_IFRAME_KEY_EXPORT_EVENT_TYPE: {
|
|
19
19
|
readonly GET_PRIVATE_KEY: "CDP_WEB_SECURE_IFRAME_GET_PRIVATE_KEY";
|
|
20
|
+
readonly SHOW_EJECT: "CDP_WEB_SECURE_IFRAME_SHOW_EJECT";
|
|
20
21
|
readonly INIT: "CDP_WEB_SECURE_IFRAME_INIT";
|
|
21
22
|
readonly LISTENING: "CDP_WEB_SECURE_IFRAME_LISTENING";
|
|
22
23
|
readonly STATUS: "CDP_WEB_SECURE_IFRAME_STATUS";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { buildKeyExportIframeUrl, sendSecureIframeMessage, getSecureIframeOrigin, createIframe, calculateSecureIframeHeight, isSecureIframeKeyExportMessage, validateSecureIframeEnvironment, type BuildKeyExportIframeUrlOptions, } from './utils.js';
|
|
2
2
|
export { DEFAULT_SECURE_IFRAME_BASE_PATH, DEFAULT_SECURE_IFRAME_THEME, SECURE_IFRAME_EVENT_TYPE, SECURE_IFRAME_EVENT_TYPE_PREFIX, SECURE_IFRAME_KEY_EXPORT_EVENT_TYPE, } from './data.js';
|
|
3
|
-
export type { SecureIframeTheme, SecureIframeAuthState, SecureIframeChainType, SecureIframeContext, SecureIframeStatus, SecureIframeEventType, SecureIframeInitMessage, SecureIframeThemeMessage, SecureIframeIncomingMessage, SecureIframeListeningMessage, SecureIframeStatusMessage, SecureIframeOutgoingMessage, SecureIframeKeyExportEventType, SecureIframeGetPrivateKeyMessage, SecureIframeKeyExportIncomingMessage, SecureIframeKeyExportOutgoingMessage, } from './types.js';
|
|
3
|
+
export type { SecureIframeTheme, SecureIframeAuthState, SecureIframeChainType, SecureIframeContext, SecureIframeStatus, SecureIframeOperation, SecureIframeAction, SecureIframeButtonConfig, SecureIframeEventType, SecureIframeInitMessage, SecureIframeThemeMessage, SecureIframeIncomingMessage, SecureIframeListeningMessage, SecureIframeStatusMessage, SecureIframeOutgoingMessage, SecureIframeKeyExportEventType, SecureIframeGetPrivateKeyMessage, SecureIframeShowEjectMessage, SecureIframeKeyExportIncomingMessage, SecureIframeKeyExportOutgoingMessage, } from './types.js';
|
|
@@ -94,7 +94,46 @@ export type SecureIframeListeningMessage = {
|
|
|
94
94
|
/**
|
|
95
95
|
* The status of the secure iframe.
|
|
96
96
|
*/
|
|
97
|
-
export type SecureIframeStatus = "ready" | "success" | "error" | "expiring" | "expired";
|
|
97
|
+
export type SecureIframeStatus = "ready" | "pending" | "success" | "error" | "expiring" | "expired";
|
|
98
|
+
/**
|
|
99
|
+
* The action a `pending`/`success`/`error` status refers to: copying the key or ejecting
|
|
100
|
+
* the account. Absent for lifecycle statuses (ready/expiring/expired).
|
|
101
|
+
*/
|
|
102
|
+
export type SecureIframeOperation = "copy" | "eject";
|
|
103
|
+
/**
|
|
104
|
+
* Which button the iframe should render initially: a copy button or an eject
|
|
105
|
+
* button. Defaults to "copy".
|
|
106
|
+
*/
|
|
107
|
+
export type SecureIframeAction = SecureIframeOperation;
|
|
108
|
+
/**
|
|
109
|
+
* Button presentation/behavior config provided to the iframe via the init
|
|
110
|
+
* message. Preferred over the (deprecated) URL query params; each field that
|
|
111
|
+
* also exists as a URL param (see `BuildKeyExportIframeUrlOptions`) takes
|
|
112
|
+
* precedence over it.
|
|
113
|
+
*/
|
|
114
|
+
export type SecureIframeButtonConfig = {
|
|
115
|
+
/** Which button to render initially. Defaults to "copy". */
|
|
116
|
+
action?: SecureIframeAction;
|
|
117
|
+
/** The label for the copy button. */
|
|
118
|
+
label?: string;
|
|
119
|
+
/** The label shown after a successful copy. */
|
|
120
|
+
copiedLabel?: string;
|
|
121
|
+
/** The label for the eject button. */
|
|
122
|
+
ejectLabel?: string;
|
|
123
|
+
/** The label for the eject button while ejection is in progress. */
|
|
124
|
+
ejectingLabel?: string;
|
|
125
|
+
/** The label for the eject button once the account has been ejected. */
|
|
126
|
+
ejectedLabel?: string;
|
|
127
|
+
/** Whether to show an icon in the button. */
|
|
128
|
+
icon?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Whether to show an icon on the eject button specifically.
|
|
131
|
+
* Falls back to `icon` when unset.
|
|
132
|
+
*/
|
|
133
|
+
ejectIcon?: boolean;
|
|
134
|
+
/** Whether the button should be full width. */
|
|
135
|
+
fullWidth?: boolean;
|
|
136
|
+
};
|
|
98
137
|
/**
|
|
99
138
|
* The message sent from the secure iframe to the parent window to indicate the status of the private key retrieval.
|
|
100
139
|
*/
|
|
@@ -102,7 +141,19 @@ export type SecureIframeStatusMessage = {
|
|
|
102
141
|
type: SecureIframeEventType["STATUS"];
|
|
103
142
|
payload: {
|
|
104
143
|
status: SecureIframeStatus;
|
|
144
|
+
/** Which action a success/error refers to. Absent for lifecycle statuses. */
|
|
145
|
+
operation?: SecureIframeOperation;
|
|
146
|
+
/** Human-readable error message. Only set for error statuses. */
|
|
105
147
|
message?: string;
|
|
148
|
+
/**
|
|
149
|
+
* The backend error type for error statuses (e.g. "invalid_request"). Note
|
|
150
|
+
* that the eject-specific failures (already ejected vs ejection not enabled)
|
|
151
|
+
* currently share the "invalid_request" type, so use `message` to tell them
|
|
152
|
+
* apart. Only set when the error originated from an API error.
|
|
153
|
+
*/
|
|
154
|
+
errorType?: string;
|
|
155
|
+
/** The backend correlation ID for the failed request, useful for support. */
|
|
156
|
+
correlationId?: string;
|
|
106
157
|
};
|
|
107
158
|
};
|
|
108
159
|
/**
|
|
@@ -121,12 +172,23 @@ export type SecureIframeGetPrivateKeyMessage = {
|
|
|
121
172
|
payload: SecureIframeContext & {
|
|
122
173
|
address: string;
|
|
123
174
|
type: SecureIframeChainType;
|
|
175
|
+
/** Button presentation/behavior config. Preferred over URL params. */
|
|
176
|
+
config?: SecureIframeButtonConfig;
|
|
124
177
|
};
|
|
125
178
|
};
|
|
179
|
+
/**
|
|
180
|
+
* The message sent to the secure iframe to reveal the eject button at runtime
|
|
181
|
+
* (e.g. after the parent's own UI confirms the user stored their copied key in
|
|
182
|
+
* the copy -> eject flow). Not needed when the iframe is initialized with
|
|
183
|
+
* `config.action: "eject"`.
|
|
184
|
+
*/
|
|
185
|
+
export type SecureIframeShowEjectMessage = {
|
|
186
|
+
type: SecureIframeKeyExportEventType["SHOW_EJECT"];
|
|
187
|
+
};
|
|
126
188
|
/**
|
|
127
189
|
* The messages sent to the secure iframe from the parent window for key export.
|
|
128
190
|
*/
|
|
129
|
-
export type SecureIframeKeyExportIncomingMessage = SecureIframeIncomingMessage | SecureIframeGetPrivateKeyMessage;
|
|
191
|
+
export type SecureIframeKeyExportIncomingMessage = SecureIframeIncomingMessage | SecureIframeGetPrivateKeyMessage | SecureIframeShowEjectMessage;
|
|
130
192
|
/**
|
|
131
193
|
* The messages sent from the secure iframe to the parent window for key export.
|
|
132
194
|
*/
|
|
@@ -15,18 +15,56 @@ export interface BuildKeyExportIframeUrlOptions {
|
|
|
15
15
|
basePath?: string;
|
|
16
16
|
/**
|
|
17
17
|
* The label for the button displayed in the iframe.
|
|
18
|
+
*
|
|
19
|
+
* Prefer sending button config via the GET_PRIVATE_KEY init message
|
|
20
|
+
* (`config.label`); this URL param is a supported alternative.
|
|
18
21
|
*/
|
|
19
22
|
label?: string;
|
|
20
23
|
/**
|
|
21
24
|
* The label to display when the key is copied successfully.
|
|
25
|
+
*
|
|
26
|
+
* Prefer the init message (`config.copiedLabel`); this URL param is a
|
|
27
|
+
* supported alternative.
|
|
22
28
|
*/
|
|
23
29
|
copiedLabel?: string;
|
|
24
30
|
/**
|
|
25
31
|
* Whether to show an icon in the button.
|
|
26
32
|
*
|
|
27
33
|
* @default true
|
|
34
|
+
*
|
|
35
|
+
* Prefer the init message (`config.icon`); this URL param is a supported
|
|
36
|
+
* alternative.
|
|
28
37
|
*/
|
|
29
38
|
icon?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to show an icon on the eject button specifically. Falls back to
|
|
41
|
+
* `icon` when unset.
|
|
42
|
+
*
|
|
43
|
+
* Prefer the init message (`config.ejectIcon`); this URL param is a supported
|
|
44
|
+
* alternative.
|
|
45
|
+
*/
|
|
46
|
+
ejectIcon?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The label for the eject button.
|
|
49
|
+
*
|
|
50
|
+
* Prefer the init message (`config.ejectLabel`); this URL param is a
|
|
51
|
+
* supported alternative.
|
|
52
|
+
*/
|
|
53
|
+
ejectLabel?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The label for the eject button while ejection is in progress.
|
|
56
|
+
*
|
|
57
|
+
* Prefer the init message (`config.ejectingLabel`); this URL param is a
|
|
58
|
+
* supported alternative.
|
|
59
|
+
*/
|
|
60
|
+
ejectingLabel?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The label for the eject button once the account has been ejected.
|
|
63
|
+
*
|
|
64
|
+
* Prefer the init message (`config.ejectedLabel`); this URL param is a
|
|
65
|
+
* supported alternative.
|
|
66
|
+
*/
|
|
67
|
+
ejectedLabel?: string;
|
|
30
68
|
}
|
|
31
69
|
/**
|
|
32
70
|
* Validates that the function is called in a browser environment.
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import { SecureIframeStatus, SecureIframeTheme } from '../secureIframe/types.js';
|
|
1
|
+
import { SecureIframeAction, SecureIframeOperation, SecureIframeStatus, SecureIframeTheme } from '../secureIframe/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Extra details that accompany a status update.
|
|
4
|
+
*/
|
|
5
|
+
export interface SecureIframeStatusDetails {
|
|
6
|
+
/** Which action the status refers to (copy or eject). */
|
|
7
|
+
operation?: SecureIframeOperation;
|
|
8
|
+
/** The backend error type, set only for API-backed error statuses. */
|
|
9
|
+
errorType?: string;
|
|
10
|
+
/** The backend correlation ID, useful for support. */
|
|
11
|
+
correlationId?: string;
|
|
12
|
+
}
|
|
2
13
|
/**
|
|
3
14
|
* Options for setting up a key export iframe.
|
|
4
15
|
*/
|
|
@@ -17,27 +28,67 @@ export interface CreateKeyExportIframeOptions {
|
|
|
17
28
|
*/
|
|
18
29
|
projectId: string;
|
|
19
30
|
/**
|
|
20
|
-
*
|
|
31
|
+
* Which button to render initially: "copy" (default) or "eject". When
|
|
32
|
+
* "eject", the iframe renders the eject button immediately (after validating
|
|
33
|
+
* the account is exportable) instead of the copy button.
|
|
34
|
+
*
|
|
35
|
+
* @default "copy"
|
|
36
|
+
*/
|
|
37
|
+
action?: SecureIframeAction;
|
|
38
|
+
/**
|
|
39
|
+
* The label for the copy button displayed in the iframe.
|
|
21
40
|
*/
|
|
22
41
|
label?: string;
|
|
23
42
|
/**
|
|
24
43
|
* The label to display when the key is copied successfully.
|
|
25
44
|
*/
|
|
26
45
|
copiedLabel?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The label for the eject button. Defaults to "Eject wallet"; pass an empty
|
|
48
|
+
* string for an icon-only button.
|
|
49
|
+
*/
|
|
50
|
+
ejectLabel?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The label for the eject button while ejection is in progress. Defaults to
|
|
53
|
+
* "Ejecting…".
|
|
54
|
+
*/
|
|
55
|
+
ejectingLabel?: string;
|
|
56
|
+
/**
|
|
57
|
+
* The label for the eject button once the account has been ejected. Defaults
|
|
58
|
+
* to "Ejected".
|
|
59
|
+
*/
|
|
60
|
+
ejectedLabel?: string;
|
|
27
61
|
/**
|
|
28
62
|
* Whether to show an icon in the button.
|
|
29
63
|
*
|
|
30
64
|
* @default true
|
|
31
65
|
*/
|
|
32
66
|
icon?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether to show an icon on the eject button specifically. Falls back to
|
|
69
|
+
* `icon` when unset, so `icon: true, ejectIcon: false` shows an icon on copy
|
|
70
|
+
* but not on eject (useful since the eject glyph is less widely recognized).
|
|
71
|
+
*/
|
|
72
|
+
ejectIcon?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Whether the button should be full width.
|
|
75
|
+
*
|
|
76
|
+
* @default true
|
|
77
|
+
*/
|
|
78
|
+
fullWidth?: boolean;
|
|
33
79
|
/**
|
|
34
80
|
* Theme overrides for the iframe button.
|
|
35
81
|
*/
|
|
36
82
|
theme?: Partial<SecureIframeTheme>;
|
|
37
83
|
/**
|
|
38
84
|
* Callback invoked when the iframe status changes.
|
|
85
|
+
*
|
|
86
|
+
* @param status - The new status.
|
|
87
|
+
* @param message - Human-readable error message, set only for error statuses.
|
|
88
|
+
* @param details - Extra details: the operation (copy/eject) and, for API
|
|
89
|
+
* errors, the errorType and correlationId.
|
|
39
90
|
*/
|
|
40
|
-
onStatusUpdate?: (status: SecureIframeStatus, message?: string) => void;
|
|
91
|
+
onStatusUpdate?: (status: SecureIframeStatus, message?: string, details?: SecureIframeStatusDetails) => void;
|
|
41
92
|
}
|
|
42
93
|
/**
|
|
43
94
|
* Result of setting up a key export iframe.
|
|
@@ -55,6 +106,12 @@ export interface CreateKeyExportIframeResult {
|
|
|
55
106
|
* Function to update the theme of the iframe.
|
|
56
107
|
*/
|
|
57
108
|
updateTheme: (theme: Partial<SecureIframeTheme>) => void;
|
|
109
|
+
/**
|
|
110
|
+
* Function to reveal the eject button at runtime — e.g. after the consumer's
|
|
111
|
+
* own UI confirms the user has stored their copied key in the copy -> eject
|
|
112
|
+
* flow. Not needed when the iframe was created with `action: "eject"`.
|
|
113
|
+
*/
|
|
114
|
+
showEject: () => void;
|
|
58
115
|
}
|
|
59
116
|
/**
|
|
60
117
|
* Sets up a secure iframe for exporting EVM private keys.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -59,6 +59,6 @@ export { createCDPEmbeddedWallet } from './eip1193/createCDPEmbeddedWallet.js';
|
|
|
59
59
|
export { EIP1193ProviderError, type EIP1193ErrorCode, type RPCErrorCode, STANDARD_ERROR_CODES, } from './eip1193/errors.js';
|
|
60
60
|
export * from './eip1193/types.js';
|
|
61
61
|
export * from './secureIframe/index.js';
|
|
62
|
-
export { createEvmKeyExportIframe, createSolanaKeyExportIframe, type CreateKeyExportIframeOptions, type CreateKeyExportIframeResult, } from './actions/createKeyExportIframe.js';
|
|
62
|
+
export { createEvmKeyExportIframe, createSolanaKeyExportIframe, type CreateKeyExportIframeOptions, type CreateKeyExportIframeResult, type SecureIframeStatusDetails, } from './actions/createKeyExportIframe.js';
|
|
63
63
|
export { getConfig } from './state.js';
|
|
64
64
|
export { toTransactionSigner } from './solana-kit/toTransactionSigner.js';
|
|
@@ -63,6 +63,6 @@ export { createCDPEmbeddedWallet } from './eip1193/createCDPEmbeddedWallet.js';
|
|
|
63
63
|
export { EIP1193ProviderError, type EIP1193ErrorCode, type RPCErrorCode, STANDARD_ERROR_CODES, } from './eip1193/errors.js';
|
|
64
64
|
export * from './eip1193/types.js';
|
|
65
65
|
export * from './secureIframe/index.js';
|
|
66
|
-
export { createEvmKeyExportIframe, createSolanaKeyExportIframe, type CreateKeyExportIframeOptions, type CreateKeyExportIframeResult, } from './actions/createKeyExportIframe.js';
|
|
66
|
+
export { createEvmKeyExportIframe, createSolanaKeyExportIframe, type CreateKeyExportIframeOptions, type CreateKeyExportIframeResult, type SecureIframeStatusDetails, } from './actions/createKeyExportIframe.js';
|
|
67
67
|
export { getConfig } from './state.js';
|
|
68
68
|
export { toTransactionSigner } from './solana-kit/toTransactionSigner.js';
|
|
@@ -17,6 +17,7 @@ export declare const SECURE_IFRAME_EVENT_TYPE: {
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const SECURE_IFRAME_KEY_EXPORT_EVENT_TYPE: {
|
|
19
19
|
readonly GET_PRIVATE_KEY: "CDP_WEB_SECURE_IFRAME_GET_PRIVATE_KEY";
|
|
20
|
+
readonly SHOW_EJECT: "CDP_WEB_SECURE_IFRAME_SHOW_EJECT";
|
|
20
21
|
readonly INIT: "CDP_WEB_SECURE_IFRAME_INIT";
|
|
21
22
|
readonly LISTENING: "CDP_WEB_SECURE_IFRAME_LISTENING";
|
|
22
23
|
readonly STATUS: "CDP_WEB_SECURE_IFRAME_STATUS";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { buildKeyExportIframeUrl, sendSecureIframeMessage, getSecureIframeOrigin, createIframe, calculateSecureIframeHeight, isSecureIframeKeyExportMessage, validateSecureIframeEnvironment, type BuildKeyExportIframeUrlOptions, } from './utils.js';
|
|
2
2
|
export { DEFAULT_SECURE_IFRAME_BASE_PATH, DEFAULT_SECURE_IFRAME_THEME, SECURE_IFRAME_EVENT_TYPE, SECURE_IFRAME_EVENT_TYPE_PREFIX, SECURE_IFRAME_KEY_EXPORT_EVENT_TYPE, } from './data.js';
|
|
3
|
-
export type { SecureIframeTheme, SecureIframeAuthState, SecureIframeChainType, SecureIframeContext, SecureIframeStatus, SecureIframeEventType, SecureIframeInitMessage, SecureIframeThemeMessage, SecureIframeIncomingMessage, SecureIframeListeningMessage, SecureIframeStatusMessage, SecureIframeOutgoingMessage, SecureIframeKeyExportEventType, SecureIframeGetPrivateKeyMessage, SecureIframeKeyExportIncomingMessage, SecureIframeKeyExportOutgoingMessage, } from './types.js';
|
|
3
|
+
export type { SecureIframeTheme, SecureIframeAuthState, SecureIframeChainType, SecureIframeContext, SecureIframeStatus, SecureIframeOperation, SecureIframeAction, SecureIframeButtonConfig, SecureIframeEventType, SecureIframeInitMessage, SecureIframeThemeMessage, SecureIframeIncomingMessage, SecureIframeListeningMessage, SecureIframeStatusMessage, SecureIframeOutgoingMessage, SecureIframeKeyExportEventType, SecureIframeGetPrivateKeyMessage, SecureIframeShowEjectMessage, SecureIframeKeyExportIncomingMessage, SecureIframeKeyExportOutgoingMessage, } from './types.js';
|
|
@@ -94,7 +94,46 @@ export type SecureIframeListeningMessage = {
|
|
|
94
94
|
/**
|
|
95
95
|
* The status of the secure iframe.
|
|
96
96
|
*/
|
|
97
|
-
export type SecureIframeStatus = "ready" | "success" | "error" | "expiring" | "expired";
|
|
97
|
+
export type SecureIframeStatus = "ready" | "pending" | "success" | "error" | "expiring" | "expired";
|
|
98
|
+
/**
|
|
99
|
+
* The action a `pending`/`success`/`error` status refers to: copying the key or ejecting
|
|
100
|
+
* the account. Absent for lifecycle statuses (ready/expiring/expired).
|
|
101
|
+
*/
|
|
102
|
+
export type SecureIframeOperation = "copy" | "eject";
|
|
103
|
+
/**
|
|
104
|
+
* Which button the iframe should render initially: a copy button or an eject
|
|
105
|
+
* button. Defaults to "copy".
|
|
106
|
+
*/
|
|
107
|
+
export type SecureIframeAction = SecureIframeOperation;
|
|
108
|
+
/**
|
|
109
|
+
* Button presentation/behavior config provided to the iframe via the init
|
|
110
|
+
* message. Preferred over the (deprecated) URL query params; each field that
|
|
111
|
+
* also exists as a URL param (see `BuildKeyExportIframeUrlOptions`) takes
|
|
112
|
+
* precedence over it.
|
|
113
|
+
*/
|
|
114
|
+
export type SecureIframeButtonConfig = {
|
|
115
|
+
/** Which button to render initially. Defaults to "copy". */
|
|
116
|
+
action?: SecureIframeAction;
|
|
117
|
+
/** The label for the copy button. */
|
|
118
|
+
label?: string;
|
|
119
|
+
/** The label shown after a successful copy. */
|
|
120
|
+
copiedLabel?: string;
|
|
121
|
+
/** The label for the eject button. */
|
|
122
|
+
ejectLabel?: string;
|
|
123
|
+
/** The label for the eject button while ejection is in progress. */
|
|
124
|
+
ejectingLabel?: string;
|
|
125
|
+
/** The label for the eject button once the account has been ejected. */
|
|
126
|
+
ejectedLabel?: string;
|
|
127
|
+
/** Whether to show an icon in the button. */
|
|
128
|
+
icon?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Whether to show an icon on the eject button specifically.
|
|
131
|
+
* Falls back to `icon` when unset.
|
|
132
|
+
*/
|
|
133
|
+
ejectIcon?: boolean;
|
|
134
|
+
/** Whether the button should be full width. */
|
|
135
|
+
fullWidth?: boolean;
|
|
136
|
+
};
|
|
98
137
|
/**
|
|
99
138
|
* The message sent from the secure iframe to the parent window to indicate the status of the private key retrieval.
|
|
100
139
|
*/
|
|
@@ -102,7 +141,19 @@ export type SecureIframeStatusMessage = {
|
|
|
102
141
|
type: SecureIframeEventType["STATUS"];
|
|
103
142
|
payload: {
|
|
104
143
|
status: SecureIframeStatus;
|
|
144
|
+
/** Which action a success/error refers to. Absent for lifecycle statuses. */
|
|
145
|
+
operation?: SecureIframeOperation;
|
|
146
|
+
/** Human-readable error message. Only set for error statuses. */
|
|
105
147
|
message?: string;
|
|
148
|
+
/**
|
|
149
|
+
* The backend error type for error statuses (e.g. "invalid_request"). Note
|
|
150
|
+
* that the eject-specific failures (already ejected vs ejection not enabled)
|
|
151
|
+
* currently share the "invalid_request" type, so use `message` to tell them
|
|
152
|
+
* apart. Only set when the error originated from an API error.
|
|
153
|
+
*/
|
|
154
|
+
errorType?: string;
|
|
155
|
+
/** The backend correlation ID for the failed request, useful for support. */
|
|
156
|
+
correlationId?: string;
|
|
106
157
|
};
|
|
107
158
|
};
|
|
108
159
|
/**
|
|
@@ -121,12 +172,23 @@ export type SecureIframeGetPrivateKeyMessage = {
|
|
|
121
172
|
payload: SecureIframeContext & {
|
|
122
173
|
address: string;
|
|
123
174
|
type: SecureIframeChainType;
|
|
175
|
+
/** Button presentation/behavior config. Preferred over URL params. */
|
|
176
|
+
config?: SecureIframeButtonConfig;
|
|
124
177
|
};
|
|
125
178
|
};
|
|
179
|
+
/**
|
|
180
|
+
* The message sent to the secure iframe to reveal the eject button at runtime
|
|
181
|
+
* (e.g. after the parent's own UI confirms the user stored their copied key in
|
|
182
|
+
* the copy -> eject flow). Not needed when the iframe is initialized with
|
|
183
|
+
* `config.action: "eject"`.
|
|
184
|
+
*/
|
|
185
|
+
export type SecureIframeShowEjectMessage = {
|
|
186
|
+
type: SecureIframeKeyExportEventType["SHOW_EJECT"];
|
|
187
|
+
};
|
|
126
188
|
/**
|
|
127
189
|
* The messages sent to the secure iframe from the parent window for key export.
|
|
128
190
|
*/
|
|
129
|
-
export type SecureIframeKeyExportIncomingMessage = SecureIframeIncomingMessage | SecureIframeGetPrivateKeyMessage;
|
|
191
|
+
export type SecureIframeKeyExportIncomingMessage = SecureIframeIncomingMessage | SecureIframeGetPrivateKeyMessage | SecureIframeShowEjectMessage;
|
|
130
192
|
/**
|
|
131
193
|
* The messages sent from the secure iframe to the parent window for key export.
|
|
132
194
|
*/
|
|
@@ -15,18 +15,56 @@ export interface BuildKeyExportIframeUrlOptions {
|
|
|
15
15
|
basePath?: string;
|
|
16
16
|
/**
|
|
17
17
|
* The label for the button displayed in the iframe.
|
|
18
|
+
*
|
|
19
|
+
* Prefer sending button config via the GET_PRIVATE_KEY init message
|
|
20
|
+
* (`config.label`); this URL param is a supported alternative.
|
|
18
21
|
*/
|
|
19
22
|
label?: string;
|
|
20
23
|
/**
|
|
21
24
|
* The label to display when the key is copied successfully.
|
|
25
|
+
*
|
|
26
|
+
* Prefer the init message (`config.copiedLabel`); this URL param is a
|
|
27
|
+
* supported alternative.
|
|
22
28
|
*/
|
|
23
29
|
copiedLabel?: string;
|
|
24
30
|
/**
|
|
25
31
|
* Whether to show an icon in the button.
|
|
26
32
|
*
|
|
27
33
|
* @default true
|
|
34
|
+
*
|
|
35
|
+
* Prefer the init message (`config.icon`); this URL param is a supported
|
|
36
|
+
* alternative.
|
|
28
37
|
*/
|
|
29
38
|
icon?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to show an icon on the eject button specifically. Falls back to
|
|
41
|
+
* `icon` when unset.
|
|
42
|
+
*
|
|
43
|
+
* Prefer the init message (`config.ejectIcon`); this URL param is a supported
|
|
44
|
+
* alternative.
|
|
45
|
+
*/
|
|
46
|
+
ejectIcon?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The label for the eject button.
|
|
49
|
+
*
|
|
50
|
+
* Prefer the init message (`config.ejectLabel`); this URL param is a
|
|
51
|
+
* supported alternative.
|
|
52
|
+
*/
|
|
53
|
+
ejectLabel?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The label for the eject button while ejection is in progress.
|
|
56
|
+
*
|
|
57
|
+
* Prefer the init message (`config.ejectingLabel`); this URL param is a
|
|
58
|
+
* supported alternative.
|
|
59
|
+
*/
|
|
60
|
+
ejectingLabel?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The label for the eject button once the account has been ejected.
|
|
63
|
+
*
|
|
64
|
+
* Prefer the init message (`config.ejectedLabel`); this URL param is a
|
|
65
|
+
* supported alternative.
|
|
66
|
+
*/
|
|
67
|
+
ejectedLabel?: string;
|
|
30
68
|
}
|
|
31
69
|
/**
|
|
32
70
|
* Validates that the function is called in a browser environment.
|
package/dist/types/version.d.ts
CHANGED
package/dist/web/index.web126.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { serializeAuthorizationList as v } from "./index.
|
|
2
|
-
import { blobsToCommitments as H } from "./index.
|
|
3
|
-
import { blobsToProofs as V } from "./index.
|
|
4
|
-
import { commitmentsToVersionedHashes as k } from "./index.
|
|
5
|
-
import { toBlobSidecars as B } from "./index.
|
|
6
|
-
import { concatHex as T } from "./index.
|
|
7
|
-
import { trim as F } from "./index.
|
|
8
|
-
import { numberToHex as s, bytesToHex as S } from "./index.
|
|
9
|
-
import { toRlp as b } from "./index.
|
|
10
|
-
import { assertTransactionEIP1559 as _, assertTransactionEIP2930 as C, assertTransactionEIP4844 as R, assertTransactionEIP7702 as Y, assertTransactionLegacy as j } from "./index.
|
|
11
|
-
import { getTransactionType as q } from "./index.
|
|
12
|
-
import { serializeAccessList as h } from "./index.
|
|
1
|
+
import { serializeAuthorizationList as v } from "./index.web188.js";
|
|
2
|
+
import { blobsToCommitments as H } from "./index.web189.js";
|
|
3
|
+
import { blobsToProofs as V } from "./index.web190.js";
|
|
4
|
+
import { commitmentsToVersionedHashes as k } from "./index.web191.js";
|
|
5
|
+
import { toBlobSidecars as B } from "./index.web192.js";
|
|
6
|
+
import { concatHex as T } from "./index.web193.js";
|
|
7
|
+
import { trim as F } from "./index.web194.js";
|
|
8
|
+
import { numberToHex as s, bytesToHex as S } from "./index.web184.js";
|
|
9
|
+
import { toRlp as b } from "./index.web195.js";
|
|
10
|
+
import { assertTransactionEIP1559 as _, assertTransactionEIP2930 as C, assertTransactionEIP4844 as R, assertTransactionEIP7702 as Y, assertTransactionLegacy as j } from "./index.web196.js";
|
|
11
|
+
import { getTransactionType as q } from "./index.web197.js";
|
|
12
|
+
import { serializeAccessList as h } from "./index.web198.js";
|
|
13
13
|
function re(e, t) {
|
|
14
14
|
const i = q(e);
|
|
15
15
|
return i === "eip1559" ? J(e, t) : i === "eip2930" ? K(e, t) : i === "eip4844" ? D(e, t) : i === "eip7702" ? w(e, t) : M(e);
|
package/dist/web/index.web128.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { handleAccounts as t } from "./index.
|
|
2
|
-
import { handleEthSign as e } from "./index.
|
|
3
|
-
import { handleGetCallsStatus as a } from "./index.
|
|
4
|
-
import { handleGetCapabilities as n } from "./index.
|
|
5
|
-
import { handlePersonalSign as o } from "./index.
|
|
6
|
-
import { handleRequestAccounts as r } from "./index.
|
|
7
|
-
import { handleSendCalls as i } from "./index.
|
|
8
|
-
import { handleSendTransaction as l } from "./index.
|
|
9
|
-
import { handleSignTypedData as h } from "./index.
|
|
10
|
-
import { handleChainId as s } from "./index.
|
|
11
|
-
import { handleDisconnect as m } from "./index.
|
|
12
|
-
import { handleSwitchEthereumChain as d } from "./index.
|
|
1
|
+
import { handleAccounts as t } from "./index.web148.js";
|
|
2
|
+
import { handleEthSign as e } from "./index.web149.js";
|
|
3
|
+
import { handleGetCallsStatus as a } from "./index.web150.js";
|
|
4
|
+
import { handleGetCapabilities as n } from "./index.web151.js";
|
|
5
|
+
import { handlePersonalSign as o } from "./index.web152.js";
|
|
6
|
+
import { handleRequestAccounts as r } from "./index.web153.js";
|
|
7
|
+
import { handleSendCalls as i } from "./index.web154.js";
|
|
8
|
+
import { handleSendTransaction as l } from "./index.web155.js";
|
|
9
|
+
import { handleSignTypedData as h } from "./index.web156.js";
|
|
10
|
+
import { handleChainId as s } from "./index.web157.js";
|
|
11
|
+
import { handleDisconnect as m } from "./index.web158.js";
|
|
12
|
+
import { handleSwitchEthereumChain as d } from "./index.web159.js";
|
|
13
13
|
function D() {
|
|
14
14
|
return {
|
|
15
15
|
eth_accounts: t,
|