@coinbase/cdp-core 0.0.35 → 0.0.37
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/README.md +52 -8
- package/dist/esm/index.native.js +38 -36
- package/dist/esm/index.native100.js +117 -41
- package/dist/esm/index.native101.js +77 -16
- package/dist/esm/index.native102.js +9 -27
- package/dist/esm/index.native103.js +5 -8
- package/dist/esm/index.native104.js +18 -11
- package/dist/esm/index.native105.js +28 -13
- package/dist/esm/index.native106.js +8 -10
- package/dist/esm/index.native107.js +11 -17
- package/dist/esm/index.native108.js +12 -80
- package/dist/esm/index.native109.js +8 -77
- package/dist/esm/index.native110.js +19 -0
- package/dist/esm/index.native111.js +83 -0
- package/dist/esm/index.native112.js +15 -0
- package/dist/esm/index.native113.js +38 -0
- package/dist/esm/index.native114.js +44 -0
- package/dist/esm/index.native115.js +81 -0
- package/dist/esm/index.native13.js +3 -9
- package/dist/esm/index.native2.js +4 -5
- package/dist/esm/index.native20.js +13 -13
- package/dist/esm/index.native21.js +3 -3
- package/dist/esm/index.native24.js +2 -2
- package/dist/esm/index.native25.js +940 -149
- package/dist/esm/index.native26.js +2 -48
- package/dist/esm/index.native27.js +43 -243
- package/dist/esm/index.native28.js +27 -55
- package/dist/esm/index.native29.js +158 -15
- package/dist/esm/index.native30.js +46 -21
- package/dist/esm/index.native31.js +243 -44
- package/dist/esm/index.native32.js +56 -9
- package/dist/esm/index.native33.js +15 -16
- package/dist/esm/index.native34.js +19 -42
- package/dist/esm/index.native35.js +50 -13
- package/dist/esm/index.native36.js +2 -56
- package/dist/esm/index.native37.js +2 -7
- package/dist/esm/index.native38.js +8 -21
- package/dist/esm/index.native39.js +17 -11
- package/dist/esm/index.native40.js +45 -3
- package/dist/esm/index.native41.js +13 -3
- package/dist/esm/index.native42.js +52 -31
- package/dist/esm/index.native43.js +6 -12
- package/dist/esm/index.native44.js +21 -4
- package/dist/esm/index.native45.js +11 -28
- package/dist/esm/index.native46.js +3 -6
- package/dist/esm/index.native47.js +3 -24
- package/dist/esm/index.native48.js +34 -16
- package/dist/esm/index.native49.js +11 -53
- package/dist/esm/index.native50.js +4 -23
- package/dist/esm/index.native51.js +28 -11
- package/dist/esm/index.native52.js +6 -27
- package/dist/esm/index.native53.js +22 -40
- package/dist/esm/index.native54.js +16 -55
- package/dist/esm/index.native55.js +53 -126
- package/dist/esm/index.native56.js +22 -11
- package/dist/esm/index.native57.js +11 -104
- package/dist/esm/index.native58.js +27 -6
- package/dist/esm/index.native59.js +43 -3
- package/dist/esm/index.native6.js +236 -199
- package/dist/esm/index.native60.js +55 -14
- package/dist/esm/index.native61.js +126 -41
- package/dist/esm/index.native62.js +10 -76
- package/dist/esm/index.native63.js +105 -2
- package/dist/esm/index.native64.js +7 -2
- package/dist/esm/index.native65.js +3 -13
- package/dist/esm/index.native66.js +14 -37
- package/dist/esm/index.native67.js +41 -5
- package/dist/esm/index.native68.js +76 -32
- package/dist/esm/index.native69.js +2 -9
- package/dist/esm/index.native70.js +2 -11
- package/dist/esm/index.native71.js +12 -11
- package/dist/esm/index.native72.js +36 -12
- package/dist/esm/index.native73.js +5 -17
- package/dist/esm/index.native74.js +34 -5
- package/dist/esm/index.native75.js +9 -5
- package/dist/esm/index.native76.js +10 -10
- package/dist/esm/index.native77.js +11 -54
- package/dist/esm/index.native78.js +13 -10
- package/dist/esm/index.native79.js +19 -2
- package/dist/esm/index.native8.js +48 -48
- package/dist/esm/index.native80.js +6 -45
- package/dist/esm/index.native81.js +4 -13
- package/dist/esm/index.native82.js +11 -2
- package/dist/esm/index.native83.js +51 -17
- package/dist/esm/index.native84.js +10 -19
- package/dist/esm/index.native85.js +2 -80
- package/dist/esm/index.native86.js +44 -103
- package/dist/esm/index.native87.js +13 -32
- package/dist/esm/index.native88.js +2 -7
- package/dist/esm/index.native89.js +21 -10
- package/dist/esm/index.native90.js +18 -19
- package/dist/esm/index.native91.js +80 -10
- package/dist/esm/index.native92.js +101 -17
- package/dist/esm/index.native93.js +30 -91
- package/dist/esm/index.native94.js +7 -21
- package/dist/esm/index.native95.js +20 -117
- package/dist/esm/index.native96.js +10 -79
- package/dist/esm/index.native97.js +20 -5
- package/dist/esm/index.native98.js +92 -11
- package/dist/esm/index.native99.js +20 -35
- package/dist/esm/index.web.js +35 -33
- package/dist/esm/index.web100.js +6 -12
- package/dist/esm/index.web101.js +10 -10
- package/dist/esm/index.web102.js +15 -14
- package/dist/esm/index.web103.js +25 -78
- package/dist/esm/index.web104.js +6 -11
- package/dist/esm/index.web105.js +10 -35
- package/dist/esm/index.web106.js +11 -40
- package/dist/esm/index.web107.js +8 -77
- package/dist/esm/index.web108.js +19 -0
- package/dist/esm/index.web109.js +83 -0
- package/dist/esm/index.web110.js +7 -0
- package/dist/esm/index.web111.js +15 -0
- package/dist/esm/index.web112.js +38 -0
- package/dist/esm/index.web113.js +44 -0
- package/dist/esm/index.web114.js +81 -0
- package/dist/esm/index.web12.js +3 -16
- package/dist/esm/index.web13.js +15 -17
- package/dist/esm/index.web14.js +15 -116
- package/dist/esm/index.web15.js +116 -12
- package/dist/esm/index.web16.js +15 -42
- package/dist/esm/index.web17.js +42 -20
- package/dist/esm/index.web18.js +20 -172
- package/dist/esm/index.web19.js +170 -39
- package/dist/esm/index.web20.js +41 -49
- package/dist/esm/index.web21.js +47 -70
- package/dist/esm/index.web22.js +69 -23
- package/dist/esm/index.web23.js +22 -156
- package/dist/esm/index.web24.js +13 -44
- package/dist/esm/index.web25.js +18 -245
- package/dist/esm/index.web26.js +51 -56
- package/dist/esm/index.web27.js +158 -15
- package/dist/esm/index.web28.js +46 -21
- package/dist/esm/index.web29.js +243 -44
- package/dist/esm/index.web3.js +7 -7
- package/dist/esm/index.web30.js +56 -9
- package/dist/esm/index.web31.js +950 -17
- package/dist/esm/index.web32.js +2 -46
- package/dist/esm/index.web33.js +49 -13
- package/dist/esm/index.web34.js +27 -55
- package/dist/esm/index.web35.js +12 -6
- package/dist/esm/index.web36.js +11 -21
- package/dist/esm/index.web37.js +2 -12
- package/dist/esm/index.web38.js +2 -4
- package/dist/esm/index.web39.js +54 -3
- package/dist/esm/index.web40.js +10 -34
- package/dist/esm/index.web41.js +2 -13
- package/dist/esm/index.web42.js +45 -5
- package/dist/esm/index.web43.js +13 -28
- package/dist/esm/index.web44.js +8 -6
- package/dist/esm/index.web45.js +17 -24
- package/dist/esm/index.web46.js +45 -16
- package/dist/esm/index.web47.js +13 -54
- package/dist/esm/index.web48.js +53 -21
- package/dist/esm/index.web49.js +6 -11
- package/dist/esm/index.web5.js +236 -199
- package/dist/esm/index.web50.js +21 -27
- package/dist/esm/index.web51.js +3 -42
- package/dist/esm/index.web52.js +3 -55
- package/dist/esm/index.web53.js +33 -126
- package/dist/esm/index.web54.js +9 -9
- package/dist/esm/index.web55.js +4 -104
- package/dist/esm/index.web56.js +28 -6
- package/dist/esm/index.web57.js +7 -3
- package/dist/esm/index.web58.js +24 -14
- package/dist/esm/index.web59.js +16 -42
- package/dist/esm/index.web6.js +3 -3
- package/dist/esm/index.web60.js +52 -76
- package/dist/esm/index.web61.js +24 -2
- package/dist/esm/index.web62.js +12 -2
- package/dist/esm/index.web63.js +27 -12
- package/dist/esm/index.web64.js +39 -34
- package/dist/esm/index.web65.js +54 -5
- package/dist/esm/index.web66.js +126 -33
- package/dist/esm/index.web67.js +12 -8
- package/dist/esm/index.web68.js +104 -10
- package/dist/esm/index.web69.js +6 -11
- package/dist/esm/index.web7.js +48 -48
- package/dist/esm/index.web70.js +3 -14
- package/dist/esm/index.web71.js +14 -18
- package/dist/esm/index.web72.js +42 -5
- package/dist/esm/index.web73.js +79 -5
- package/dist/esm/index.web74.js +2 -11
- package/dist/esm/index.web75.js +2 -55
- package/dist/esm/index.web76.js +37 -10
- package/dist/esm/index.web77.js +7 -2
- package/dist/esm/index.web78.js +34 -44
- package/dist/esm/index.web79.js +8 -13
- package/dist/esm/index.web80.js +11 -2
- package/dist/esm/index.web81.js +11 -20
- package/dist/esm/index.web82.js +13 -19
- package/dist/esm/index.web83.js +18 -79
- package/dist/esm/index.web84.js +5 -103
- package/dist/esm/index.web85.js +5 -33
- package/dist/esm/index.web86.js +10 -6
- package/dist/esm/index.web87.js +102 -19
- package/dist/esm/index.web88.js +79 -10
- package/dist/esm/index.web89.js +80 -20
- package/dist/esm/index.web9.js +3 -3
- package/dist/esm/index.web90.js +20 -93
- package/dist/esm/index.web91.js +9 -20
- package/dist/esm/index.web92.js +16 -114
- package/dist/esm/index.web93.js +90 -75
- package/dist/esm/index.web94.js +20 -9
- package/dist/esm/index.web95.js +118 -5
- package/dist/esm/index.web96.js +2 -18
- package/dist/esm/index.web97.js +20 -27
- package/dist/esm/index.web98.js +19 -7
- package/dist/esm/index.web99.js +32 -10
- package/dist/native/index.native.js +38 -36
- package/dist/native/index.native100.js +117 -41
- package/dist/native/index.native101.js +77 -16
- package/dist/native/index.native102.js +9 -27
- package/dist/native/index.native103.js +5 -8
- package/dist/native/index.native104.js +18 -11
- package/dist/native/index.native105.js +28 -13
- package/dist/native/index.native106.js +8 -10
- package/dist/native/index.native107.js +11 -17
- package/dist/native/index.native108.js +12 -80
- package/dist/native/index.native109.js +8 -77
- package/dist/native/index.native110.js +19 -0
- package/dist/native/index.native111.js +83 -0
- package/dist/native/index.native112.js +15 -0
- package/dist/native/index.native113.js +38 -0
- package/dist/native/index.native114.js +44 -0
- package/dist/native/index.native115.js +81 -0
- package/dist/native/index.native13.js +3 -9
- package/dist/native/index.native2.js +4 -5
- package/dist/native/index.native20.js +13 -13
- package/dist/native/index.native21.js +3 -3
- package/dist/native/index.native24.js +2 -2
- package/dist/native/index.native25.js +940 -149
- package/dist/native/index.native26.js +2 -48
- package/dist/native/index.native27.js +43 -243
- package/dist/native/index.native28.js +27 -55
- package/dist/native/index.native29.js +158 -15
- package/dist/native/index.native30.js +46 -21
- package/dist/native/index.native31.js +243 -44
- package/dist/native/index.native32.js +56 -9
- package/dist/native/index.native33.js +15 -16
- package/dist/native/index.native34.js +19 -42
- package/dist/native/index.native35.js +50 -13
- package/dist/native/index.native36.js +2 -56
- package/dist/native/index.native37.js +2 -7
- package/dist/native/index.native38.js +8 -21
- package/dist/native/index.native39.js +17 -11
- package/dist/native/index.native40.js +45 -3
- package/dist/native/index.native41.js +13 -3
- package/dist/native/index.native42.js +52 -31
- package/dist/native/index.native43.js +6 -12
- package/dist/native/index.native44.js +21 -4
- package/dist/native/index.native45.js +11 -28
- package/dist/native/index.native46.js +3 -6
- package/dist/native/index.native47.js +3 -24
- package/dist/native/index.native48.js +34 -16
- package/dist/native/index.native49.js +11 -53
- package/dist/native/index.native50.js +4 -23
- package/dist/native/index.native51.js +28 -11
- package/dist/native/index.native52.js +6 -27
- package/dist/native/index.native53.js +22 -40
- package/dist/native/index.native54.js +16 -55
- package/dist/native/index.native55.js +53 -126
- package/dist/native/index.native56.js +22 -11
- package/dist/native/index.native57.js +11 -104
- package/dist/native/index.native58.js +27 -6
- package/dist/native/index.native59.js +43 -3
- package/dist/native/index.native6.js +236 -199
- package/dist/native/index.native60.js +55 -14
- package/dist/native/index.native61.js +126 -41
- package/dist/native/index.native62.js +10 -76
- package/dist/native/index.native63.js +105 -2
- package/dist/native/index.native64.js +7 -2
- package/dist/native/index.native65.js +3 -13
- package/dist/native/index.native66.js +14 -37
- package/dist/native/index.native67.js +41 -5
- package/dist/native/index.native68.js +76 -32
- package/dist/native/index.native69.js +2 -9
- package/dist/native/index.native70.js +2 -11
- package/dist/native/index.native71.js +12 -11
- package/dist/native/index.native72.js +36 -12
- package/dist/native/index.native73.js +5 -17
- package/dist/native/index.native74.js +34 -5
- package/dist/native/index.native75.js +9 -5
- package/dist/native/index.native76.js +10 -10
- package/dist/native/index.native77.js +11 -54
- package/dist/native/index.native78.js +13 -10
- package/dist/native/index.native79.js +19 -2
- package/dist/native/index.native8.js +48 -48
- package/dist/native/index.native80.js +6 -45
- package/dist/native/index.native81.js +4 -13
- package/dist/native/index.native82.js +11 -2
- package/dist/native/index.native83.js +51 -17
- package/dist/native/index.native84.js +10 -19
- package/dist/native/index.native85.js +2 -80
- package/dist/native/index.native86.js +44 -103
- package/dist/native/index.native87.js +13 -32
- package/dist/native/index.native88.js +2 -7
- package/dist/native/index.native89.js +21 -10
- package/dist/native/index.native90.js +18 -19
- package/dist/native/index.native91.js +80 -10
- package/dist/native/index.native92.js +101 -17
- package/dist/native/index.native93.js +30 -91
- package/dist/native/index.native94.js +7 -21
- package/dist/native/index.native95.js +20 -117
- package/dist/native/index.native96.js +10 -79
- package/dist/native/index.native97.js +20 -5
- package/dist/native/index.native98.js +92 -11
- package/dist/native/index.native99.js +20 -35
- package/dist/native-types/core.d.ts +3 -1
- package/dist/native-types/platform/types.d.ts +1 -1
- package/dist/native-types/types.d.ts +32 -2
- package/dist/types/core.d.ts +3 -1
- package/dist/types/platform/types.d.ts +1 -1
- package/dist/types/types.d.ts +32 -2
- package/dist/web/index.web.js +35 -33
- package/dist/web/index.web100.js +6 -12
- package/dist/web/index.web101.js +10 -10
- package/dist/web/index.web102.js +15 -14
- package/dist/web/index.web103.js +25 -78
- package/dist/web/index.web104.js +6 -11
- package/dist/web/index.web105.js +10 -35
- package/dist/web/index.web106.js +11 -40
- package/dist/web/index.web107.js +8 -77
- package/dist/web/index.web108.js +19 -0
- package/dist/web/index.web109.js +83 -0
- package/dist/web/index.web110.js +7 -0
- package/dist/web/index.web111.js +15 -0
- package/dist/web/index.web112.js +38 -0
- package/dist/web/index.web113.js +44 -0
- package/dist/web/index.web114.js +81 -0
- package/dist/web/index.web12.js +3 -16
- package/dist/web/index.web13.js +15 -17
- package/dist/web/index.web14.js +15 -116
- package/dist/web/index.web15.js +116 -12
- package/dist/web/index.web16.js +15 -42
- package/dist/web/index.web17.js +42 -20
- package/dist/web/index.web18.js +20 -172
- package/dist/web/index.web19.js +170 -39
- package/dist/web/index.web20.js +41 -49
- package/dist/web/index.web21.js +47 -70
- package/dist/web/index.web22.js +69 -23
- package/dist/web/index.web23.js +22 -156
- package/dist/web/index.web24.js +13 -44
- package/dist/web/index.web25.js +18 -245
- package/dist/web/index.web26.js +51 -56
- package/dist/web/index.web27.js +158 -15
- package/dist/web/index.web28.js +46 -21
- package/dist/web/index.web29.js +243 -44
- package/dist/web/index.web3.js +7 -7
- package/dist/web/index.web30.js +56 -9
- package/dist/web/index.web31.js +950 -17
- package/dist/web/index.web32.js +2 -46
- package/dist/web/index.web33.js +49 -13
- package/dist/web/index.web34.js +27 -55
- package/dist/web/index.web35.js +12 -6
- package/dist/web/index.web36.js +11 -21
- package/dist/web/index.web37.js +2 -12
- package/dist/web/index.web38.js +2 -4
- package/dist/web/index.web39.js +54 -3
- package/dist/web/index.web40.js +10 -34
- package/dist/web/index.web41.js +2 -13
- package/dist/web/index.web42.js +45 -5
- package/dist/web/index.web43.js +13 -28
- package/dist/web/index.web44.js +8 -6
- package/dist/web/index.web45.js +17 -24
- package/dist/web/index.web46.js +45 -16
- package/dist/web/index.web47.js +13 -54
- package/dist/web/index.web48.js +53 -21
- package/dist/web/index.web49.js +6 -11
- package/dist/web/index.web5.js +236 -199
- package/dist/web/index.web50.js +21 -27
- package/dist/web/index.web51.js +3 -42
- package/dist/web/index.web52.js +3 -55
- package/dist/web/index.web53.js +33 -126
- package/dist/web/index.web54.js +9 -9
- package/dist/web/index.web55.js +4 -104
- package/dist/web/index.web56.js +28 -6
- package/dist/web/index.web57.js +7 -3
- package/dist/web/index.web58.js +24 -14
- package/dist/web/index.web59.js +16 -42
- package/dist/web/index.web6.js +3 -3
- package/dist/web/index.web60.js +52 -76
- package/dist/web/index.web61.js +24 -2
- package/dist/web/index.web62.js +12 -2
- package/dist/web/index.web63.js +27 -12
- package/dist/web/index.web64.js +39 -34
- package/dist/web/index.web65.js +54 -5
- package/dist/web/index.web66.js +126 -33
- package/dist/web/index.web67.js +12 -8
- package/dist/web/index.web68.js +104 -10
- package/dist/web/index.web69.js +6 -11
- package/dist/web/index.web7.js +48 -48
- package/dist/web/index.web70.js +3 -14
- package/dist/web/index.web71.js +14 -18
- package/dist/web/index.web72.js +42 -5
- package/dist/web/index.web73.js +79 -5
- package/dist/web/index.web74.js +2 -11
- package/dist/web/index.web75.js +2 -55
- package/dist/web/index.web76.js +37 -10
- package/dist/web/index.web77.js +7 -2
- package/dist/web/index.web78.js +34 -44
- package/dist/web/index.web79.js +8 -13
- package/dist/web/index.web80.js +11 -2
- package/dist/web/index.web81.js +11 -20
- package/dist/web/index.web82.js +13 -19
- package/dist/web/index.web83.js +18 -79
- package/dist/web/index.web84.js +5 -103
- package/dist/web/index.web85.js +5 -33
- package/dist/web/index.web86.js +10 -6
- package/dist/web/index.web87.js +102 -19
- package/dist/web/index.web88.js +79 -10
- package/dist/web/index.web89.js +80 -20
- package/dist/web/index.web9.js +3 -3
- package/dist/web/index.web90.js +20 -93
- package/dist/web/index.web91.js +9 -20
- package/dist/web/index.web92.js +16 -114
- package/dist/web/index.web93.js +90 -75
- package/dist/web/index.web94.js +20 -9
- package/dist/web/index.web95.js +118 -5
- package/dist/web/index.web96.js +2 -18
- package/dist/web/index.web97.js +20 -27
- package/dist/web/index.web98.js +19 -7
- package/dist/web/index.web99.js +32 -10
- package/dist/web-types/core.d.ts +3 -1
- package/dist/web-types/platform/types.d.ts +1 -1
- package/dist/web-types/types.d.ts +32 -2
- package/package.json +9 -7
package/dist/esm/index.web5.js
CHANGED
|
@@ -1,171 +1,184 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { b as d } from "./index.web12.js";
|
|
2
|
+
import { configureCdpApiClient as U, setAuthManager as T, initiateAuthentication as M, createEndUserEvmAccount as P, createEndUserEvmSmartAccount as y, createEndUserSolanaAccount as j, verifyEmailAuthentication as K, verifySmsAuthentication as x, signEvmHashWithEndUserAccount as O, signEvmTransactionWithEndUserAccount as b, signSolanaTransactionWithEndUserAccount as C, sendEvmTransactionWithEndUserAccount as W, sendSolanaTransactionWithEndUserAccount as H, signEvmMessageWithEndUserAccount as B, signSolanaMessageWithEndUserAccount as D, signEvmTypedDataWithEndUserAccount as _, sendUserOperationWithEndUserAccount as N, getUserOperationWithEndUserAccount as z, exportEndUserEvmAccount as F, exportEndUserSolanaAccount as L } from "@coinbase/cdp-api-client";
|
|
3
|
+
import { Keypair as p } from "@solana/web3.js";
|
|
4
|
+
import l from "bs58";
|
|
5
|
+
import { AuthManager as $ } from "./index.web6.js";
|
|
6
|
+
import { toAuthState as g } from "./index.web13.js";
|
|
7
|
+
import { withAuth as u } from "./index.web14.js";
|
|
8
|
+
import { MockAuthManager as V } from "./index.web15.js";
|
|
9
|
+
import { mockUser as f } from "./index.web16.js";
|
|
10
|
+
import { getPlatformServices as I, getPlatformCrypto as S } from "./index.web2.js";
|
|
11
|
+
import { isChainSupportedForCDPSends as q } from "./index.web17.js";
|
|
12
|
+
import { getConfig as s, setCoreAuthManager as h, getCoreAuthManager as c, setConfig as G } from "./index.web18.js";
|
|
10
13
|
import "viem";
|
|
11
|
-
import { serializeTransaction as
|
|
12
|
-
const
|
|
14
|
+
import { serializeTransaction as A } from "./index.web19.js";
|
|
15
|
+
const ue = async (e) => {
|
|
13
16
|
if (!e.projectId)
|
|
14
17
|
throw new Error("Project ID is required");
|
|
15
|
-
let
|
|
18
|
+
let t;
|
|
16
19
|
try {
|
|
17
|
-
|
|
20
|
+
t = s().projectId !== e.projectId;
|
|
18
21
|
} catch {
|
|
19
|
-
|
|
22
|
+
t = !0;
|
|
20
23
|
}
|
|
21
|
-
if (
|
|
22
|
-
|
|
24
|
+
if (G(e), s().useMock) {
|
|
25
|
+
h(new V(s().projectId));
|
|
23
26
|
return;
|
|
24
27
|
}
|
|
25
|
-
let
|
|
28
|
+
let r;
|
|
26
29
|
try {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
getRefreshToken: () =>
|
|
30
|
-
setRefreshToken: (
|
|
31
|
-
removeRefreshToken: () =>
|
|
30
|
+
const n = I();
|
|
31
|
+
r = n.secureStorage ? {
|
|
32
|
+
getRefreshToken: () => n.secureStorage.getItem("cdp_refresh_token"),
|
|
33
|
+
setRefreshToken: (a) => n.secureStorage.setItem("cdp_refresh_token", a),
|
|
34
|
+
removeRefreshToken: () => n.secureStorage.removeItem("cdp_refresh_token")
|
|
32
35
|
} : void 0;
|
|
33
36
|
} catch {
|
|
34
|
-
|
|
37
|
+
r = void 0;
|
|
35
38
|
}
|
|
36
|
-
if (
|
|
37
|
-
debugging:
|
|
38
|
-
basePath:
|
|
39
|
-
refreshTokenStorage:
|
|
40
|
-
}),
|
|
41
|
-
const
|
|
42
|
-
|
|
39
|
+
if (U({
|
|
40
|
+
debugging: s().debugging,
|
|
41
|
+
basePath: s().basePath,
|
|
42
|
+
refreshTokenStorage: r
|
|
43
|
+
}), t) {
|
|
44
|
+
const n = new $(s().projectId);
|
|
45
|
+
h(n), T(n);
|
|
43
46
|
}
|
|
44
|
-
await
|
|
45
|
-
},
|
|
47
|
+
await c().ensureInitialized();
|
|
48
|
+
}, de = async (e) => v({
|
|
46
49
|
email: e.email,
|
|
47
50
|
type: "email"
|
|
48
|
-
}),
|
|
51
|
+
}), me = async (e) => v({
|
|
49
52
|
phoneNumber: e.phoneNumber,
|
|
50
53
|
type: "sms"
|
|
51
|
-
}),
|
|
54
|
+
}), ge = async (e) => k(
|
|
52
55
|
e,
|
|
53
56
|
"Mock email OTP verified",
|
|
54
|
-
(
|
|
55
|
-
),
|
|
57
|
+
(t, r) => K(t, r)
|
|
58
|
+
), ye = async (e) => k(
|
|
56
59
|
e,
|
|
57
60
|
"Mock SMS OTP verified",
|
|
58
|
-
(
|
|
59
|
-
),
|
|
60
|
-
if (
|
|
61
|
-
await
|
|
61
|
+
(t, r) => x(t, r)
|
|
62
|
+
), pe = async () => c().getUser(), le = async () => c().isSignedIn(), fe = async () => {
|
|
63
|
+
if (s().useMock) {
|
|
64
|
+
await c().signOut();
|
|
62
65
|
return;
|
|
63
66
|
}
|
|
64
|
-
if (!await
|
|
67
|
+
if (!await c().isSignedIn())
|
|
65
68
|
throw new Error("User not signed in");
|
|
66
|
-
await
|
|
69
|
+
await c().signOut();
|
|
67
70
|
try {
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
71
|
+
const t = I();
|
|
72
|
+
if (t.secureStorage)
|
|
70
73
|
try {
|
|
71
|
-
await
|
|
72
|
-
} catch (
|
|
73
|
-
console.warn("Failed to clear stored refresh token:",
|
|
74
|
+
await t.secureStorage.removeItem("cdp_refresh_token");
|
|
75
|
+
} catch (r) {
|
|
76
|
+
console.warn("Failed to clear stored refresh token:", r);
|
|
74
77
|
}
|
|
75
78
|
} catch {
|
|
76
79
|
}
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
signature: (await
|
|
80
|
+
}, he = async () => c().getToken(), we = (e) => {
|
|
81
|
+
c().addAuthStateChangeCallback(e);
|
|
82
|
+
}, Ie = async (e) => s().useMock ? { signature: "0x0" } : u(e, c(), async ({ user: t, walletSecretId: r }) => ({
|
|
83
|
+
signature: (await O(s().projectId, t.userId, {
|
|
81
84
|
hash: e.hash,
|
|
82
85
|
address: e.evmAccount,
|
|
83
|
-
walletSecretId:
|
|
86
|
+
walletSecretId: r
|
|
84
87
|
})).signature
|
|
85
|
-
})),
|
|
86
|
-
const
|
|
88
|
+
})), Se = async (e) => s().useMock ? { signedTransaction: "0x0" } : u(e, c(), async ({ user: t, walletSecretId: r }) => {
|
|
89
|
+
const n = A(e.transaction);
|
|
87
90
|
return {
|
|
88
|
-
signedTransaction: (await
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
signedTransaction: (await b(
|
|
92
|
+
s().projectId,
|
|
93
|
+
t.userId,
|
|
91
94
|
{
|
|
92
|
-
transaction:
|
|
95
|
+
transaction: n,
|
|
93
96
|
address: e.evmAccount,
|
|
94
|
-
walletSecretId:
|
|
97
|
+
walletSecretId: r
|
|
95
98
|
}
|
|
96
99
|
)).signedTransaction
|
|
97
100
|
};
|
|
98
|
-
}),
|
|
99
|
-
signedTransaction: (await
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
}), Ae = async (e) => s().useMock ? { signedTransaction: "mock-signed-transaction" } : u(e, c(), async ({ user: t, walletSecretId: r }) => ({
|
|
102
|
+
signedTransaction: (await C(
|
|
103
|
+
s().projectId,
|
|
104
|
+
t.userId,
|
|
102
105
|
{
|
|
103
106
|
transaction: e.transaction,
|
|
104
107
|
address: e.solanaAccount,
|
|
105
|
-
walletSecretId:
|
|
108
|
+
walletSecretId: r
|
|
106
109
|
}
|
|
107
110
|
)).signedTransaction
|
|
108
|
-
})),
|
|
109
|
-
if (!
|
|
111
|
+
})), ve = async (e) => {
|
|
112
|
+
if (!q(e.network))
|
|
110
113
|
throw new Error(`Chain ${e.network} is not supported by the CDP Apis`);
|
|
111
|
-
if (
|
|
114
|
+
if (s().useMock)
|
|
112
115
|
return { transactionHash: "0x0" };
|
|
113
|
-
const
|
|
114
|
-
return
|
|
115
|
-
transactionHash: (await
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
const t = A(e.transaction);
|
|
117
|
+
return u(e, c(), async ({ user: r, walletSecretId: n }) => ({
|
|
118
|
+
transactionHash: (await W(
|
|
119
|
+
s().projectId,
|
|
120
|
+
r.userId,
|
|
118
121
|
{
|
|
119
|
-
transaction:
|
|
122
|
+
transaction: t,
|
|
120
123
|
address: e.evmAccount,
|
|
121
|
-
walletSecretId:
|
|
124
|
+
walletSecretId: n,
|
|
122
125
|
network: e.network
|
|
123
126
|
}
|
|
124
127
|
)).transactionHash
|
|
125
128
|
}));
|
|
126
|
-
},
|
|
127
|
-
transactionSignature: (await
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
}, ke = async (e) => s().useMock ? { transactionSignature: "mock-signature" } : u(e, c(), async ({ user: t, walletSecretId: r }) => ({
|
|
130
|
+
transactionSignature: (await H(
|
|
131
|
+
s().projectId,
|
|
132
|
+
t.userId,
|
|
130
133
|
{
|
|
131
134
|
transaction: e.transaction,
|
|
132
135
|
address: e.solanaAccount,
|
|
133
|
-
walletSecretId:
|
|
136
|
+
walletSecretId: r,
|
|
134
137
|
network: e.network
|
|
135
138
|
}
|
|
136
139
|
)).transactionSignature
|
|
137
|
-
})),
|
|
138
|
-
signature: (await
|
|
140
|
+
})), Ee = async (e) => s().useMock ? { signature: "0x0" } : u(e, c(), async ({ user: t, walletSecretId: r }) => ({
|
|
141
|
+
signature: (await B(s().projectId, t.userId, {
|
|
139
142
|
message: e.message,
|
|
140
143
|
address: e.evmAccount,
|
|
141
|
-
walletSecretId:
|
|
144
|
+
walletSecretId: r
|
|
142
145
|
})).signature
|
|
143
|
-
})),
|
|
144
|
-
signature: (await
|
|
146
|
+
})), Ue = async (e) => s().useMock ? { signature: "mockSignature" } : u(e, c(), async ({ user: t, walletSecretId: r }) => ({
|
|
147
|
+
signature: (await D(
|
|
148
|
+
s().projectId,
|
|
149
|
+
t.userId,
|
|
150
|
+
{
|
|
151
|
+
message: e.message,
|
|
152
|
+
address: e.solanaAccount,
|
|
153
|
+
walletSecretId: r
|
|
154
|
+
}
|
|
155
|
+
)).signature
|
|
156
|
+
})), Te = async (e) => s().useMock ? { signature: "0x0" } : u(e, c(), async ({ user: t, walletSecretId: r }) => ({
|
|
157
|
+
signature: (await _(s().projectId, t.userId, {
|
|
145
158
|
typedData: e.typedData,
|
|
146
159
|
address: e.evmAccount,
|
|
147
|
-
walletSecretId:
|
|
160
|
+
walletSecretId: r
|
|
148
161
|
})).signature
|
|
149
|
-
})),
|
|
162
|
+
})), Me = async (e) => s().useMock ? {
|
|
150
163
|
userOperationHash: "0x1234567890123456789012345678901234567890123456789012345678901234"
|
|
151
|
-
} :
|
|
152
|
-
userOperationHash: (await
|
|
153
|
-
|
|
154
|
-
|
|
164
|
+
} : u(e, c(), async ({ user: t, walletSecretId: r }) => ({
|
|
165
|
+
userOperationHash: (await N(
|
|
166
|
+
s().projectId,
|
|
167
|
+
t.userId,
|
|
155
168
|
e.evmSmartAccount,
|
|
156
169
|
{
|
|
157
170
|
network: e.network,
|
|
158
|
-
calls: e.calls.map((
|
|
159
|
-
to:
|
|
160
|
-
value: String(
|
|
161
|
-
data:
|
|
171
|
+
calls: e.calls.map((a) => ({
|
|
172
|
+
to: a.to,
|
|
173
|
+
value: String(a.value ?? 0n),
|
|
174
|
+
data: a.data ?? "0x"
|
|
162
175
|
})),
|
|
163
|
-
walletSecretId:
|
|
176
|
+
walletSecretId: r,
|
|
164
177
|
useCdpPaymaster: e.useCdpPaymaster ?? !1,
|
|
165
178
|
paymasterUrl: e.paymasterUrl
|
|
166
179
|
}
|
|
167
180
|
)).userOpHash
|
|
168
|
-
})),
|
|
181
|
+
})), Pe = async (e) => s().useMock ? {
|
|
169
182
|
userOpHash: e.userOperationHash,
|
|
170
183
|
network: e.network,
|
|
171
184
|
calls: [
|
|
@@ -178,80 +191,114 @@ const R = async (e) => {
|
|
|
178
191
|
status: "complete",
|
|
179
192
|
transactionHash: "0x9876543210987654321098765432109876543210987654321098765432109876",
|
|
180
193
|
receipts: []
|
|
181
|
-
} :
|
|
182
|
-
|
|
183
|
-
|
|
194
|
+
} : u(e, c(), async ({ user: t }) => await z(
|
|
195
|
+
s().projectId,
|
|
196
|
+
t.userId,
|
|
184
197
|
e.evmSmartAccount,
|
|
185
198
|
e.userOperationHash
|
|
186
|
-
)),
|
|
187
|
-
if (
|
|
199
|
+
)), je = async (e) => {
|
|
200
|
+
if (s().useMock)
|
|
188
201
|
return {
|
|
189
|
-
privateKey: "mock-private-key"
|
|
202
|
+
privateKey: d.Buffer.from("mock-private-key").toString("hex")
|
|
190
203
|
};
|
|
191
|
-
const
|
|
192
|
-
return
|
|
193
|
-
const
|
|
204
|
+
const t = S(), r = await t.createExportKeyPair();
|
|
205
|
+
return u(e, c(), async ({ user: n, walletSecretId: a }) => {
|
|
206
|
+
const o = await F(s().projectId, n.userId, {
|
|
194
207
|
address: e.evmAccount,
|
|
195
|
-
walletSecretId:
|
|
196
|
-
exportEncryptionKey:
|
|
197
|
-
})
|
|
208
|
+
walletSecretId: a,
|
|
209
|
+
exportEncryptionKey: r.publicKeyBase64
|
|
210
|
+
}), i = await t.decryptWithPrivateKey(
|
|
211
|
+
r.privateKey,
|
|
212
|
+
o.encryptedPrivateKey
|
|
213
|
+
);
|
|
198
214
|
return {
|
|
199
|
-
privateKey:
|
|
200
|
-
t.privateKey,
|
|
201
|
-
i.encryptedPrivateKey
|
|
202
|
-
)
|
|
215
|
+
privateKey: d.Buffer.from(i).toString("hex")
|
|
203
216
|
};
|
|
204
217
|
});
|
|
205
|
-
},
|
|
206
|
-
if (
|
|
218
|
+
}, Ke = async (e) => {
|
|
219
|
+
if (s().useMock) {
|
|
220
|
+
const n = d.Buffer.from("mock-private-key").subarray(0, 32), a = d.Buffer.alloc(32);
|
|
221
|
+
n.copy(a);
|
|
222
|
+
const o = p.fromSeed(a), i = d.Buffer.concat([o.secretKey.subarray(0, 32), o.publicKey.toBytes()]);
|
|
223
|
+
return {
|
|
224
|
+
privateKey: l.encode(i)
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
const t = S(), r = await t.createExportKeyPair();
|
|
228
|
+
return u(e, c(), async ({ user: n, walletSecretId: a }) => {
|
|
229
|
+
const o = await L(s().projectId, n.userId, {
|
|
230
|
+
address: e.solanaAccount,
|
|
231
|
+
walletSecretId: a,
|
|
232
|
+
exportEncryptionKey: r.publicKeyBase64
|
|
233
|
+
}), i = await t.decryptWithPrivateKey(
|
|
234
|
+
r.privateKey,
|
|
235
|
+
o.encryptedPrivateKey
|
|
236
|
+
), m = p.fromSeed(new Uint8Array(i)), E = d.Buffer.concat([m.secretKey.subarray(0, 32), m.publicKey.toBytes()]);
|
|
237
|
+
return {
|
|
238
|
+
privateKey: l.encode(E)
|
|
239
|
+
};
|
|
240
|
+
});
|
|
241
|
+
}, v = async (e) => {
|
|
242
|
+
if (s().useMock)
|
|
207
243
|
return {
|
|
208
244
|
message: "Mock sign in initiated",
|
|
209
245
|
flowId: "mock-flow-id"
|
|
210
246
|
};
|
|
211
|
-
if (await
|
|
247
|
+
if (await c().isSignedIn())
|
|
212
248
|
throw new Error("User is already authenticated. Please sign out first.");
|
|
213
|
-
const
|
|
249
|
+
const r = await M(s().projectId, e);
|
|
214
250
|
return {
|
|
215
|
-
flowId:
|
|
216
|
-
message:
|
|
251
|
+
flowId: r.flowId,
|
|
252
|
+
message: r.message
|
|
217
253
|
};
|
|
218
|
-
},
|
|
219
|
-
if (
|
|
220
|
-
return await
|
|
254
|
+
}, k = async (e, t, r) => {
|
|
255
|
+
if (s().useMock)
|
|
256
|
+
return await c().setAuthState({
|
|
221
257
|
accessToken: "mock-access-token",
|
|
222
258
|
expiresAt: Date.now() + 1e3 * 60 * 60 * 24,
|
|
223
|
-
user:
|
|
259
|
+
user: f
|
|
224
260
|
}), {
|
|
225
|
-
message:
|
|
226
|
-
user:
|
|
261
|
+
message: t,
|
|
262
|
+
user: f,
|
|
227
263
|
isNewUser: !1
|
|
228
264
|
};
|
|
229
|
-
if (await
|
|
265
|
+
if (await c().isSignedIn())
|
|
230
266
|
throw new Error("User is already authenticated. Please sign out first.");
|
|
231
|
-
const
|
|
267
|
+
const a = await r(s().projectId, {
|
|
232
268
|
flowId: e.flowId,
|
|
233
269
|
otp: e.otp
|
|
234
|
-
})
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
270
|
+
});
|
|
271
|
+
let o = g(
|
|
272
|
+
a.accessToken,
|
|
273
|
+
a.validUntil,
|
|
274
|
+
a.endUser
|
|
238
275
|
);
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
276
|
+
await c().setAuthState(o);
|
|
277
|
+
const i = s();
|
|
278
|
+
i.ethereum?.createOnLogin && (o = await w(
|
|
279
|
+
a,
|
|
280
|
+
o,
|
|
281
|
+
i.ethereum.createOnLogin
|
|
282
|
+
)), i.solana?.createOnLogin && (o = await J(a, o)), !i.ethereum?.createOnLogin && !i.solana?.createOnLogin && (o = await w(a, o, "eoa"));
|
|
283
|
+
const m = await c().getUser();
|
|
284
|
+
return {
|
|
285
|
+
message: a.message,
|
|
286
|
+
user: m,
|
|
287
|
+
isNewUser: a.isNewEndUser
|
|
288
|
+
};
|
|
289
|
+
}, w = async (e, t, r) => {
|
|
290
|
+
let n = t;
|
|
291
|
+
if (!t.user.evmAccounts || t.user.evmAccounts.length === 0)
|
|
245
292
|
try {
|
|
246
|
-
const
|
|
247
|
-
let
|
|
248
|
-
walletSecretId:
|
|
293
|
+
const a = await c().getWalletSecretId();
|
|
294
|
+
let o = await P(s().projectId, t.user.userId, {
|
|
295
|
+
walletSecretId: a
|
|
249
296
|
});
|
|
250
|
-
if (
|
|
251
|
-
const [i] =
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
297
|
+
if (r === "smart") {
|
|
298
|
+
const [i] = o.evmAccounts;
|
|
299
|
+
o = await y(
|
|
300
|
+
s().projectId,
|
|
301
|
+
t.user.userId,
|
|
255
302
|
{
|
|
256
303
|
owner: i,
|
|
257
304
|
enableSpendPermissions: !1
|
|
@@ -259,74 +306,64 @@ const R = async (e) => {
|
|
|
259
306
|
}
|
|
260
307
|
);
|
|
261
308
|
}
|
|
262
|
-
|
|
263
|
-
} catch (
|
|
264
|
-
throw new Error(`Failed to create EVM account: ${
|
|
309
|
+
n = g(e.accessToken, e.validUntil, o), await c().setAuthState(n);
|
|
310
|
+
} catch (a) {
|
|
311
|
+
throw new Error(`Failed to create EVM account: ${a}`);
|
|
265
312
|
}
|
|
266
|
-
if (
|
|
313
|
+
if (r === "smart" && (!n.user.evmSmartAccounts || n.user.evmSmartAccounts.length === 0))
|
|
267
314
|
try {
|
|
268
|
-
const [
|
|
269
|
-
|
|
270
|
-
|
|
315
|
+
const [a] = n.user.evmAccounts, o = await y(
|
|
316
|
+
s().projectId,
|
|
317
|
+
n.user.userId,
|
|
271
318
|
{
|
|
272
|
-
owner:
|
|
319
|
+
owner: a,
|
|
273
320
|
enableSpendPermissions: !1
|
|
274
321
|
// Defaulting to false until the feature is ready.
|
|
275
322
|
}
|
|
276
323
|
);
|
|
277
|
-
|
|
278
|
-
} catch (
|
|
279
|
-
throw new Error(`Failed to create EVM Smart Account: ${
|
|
324
|
+
n = g(e.accessToken, e.validUntil, o), await c().setAuthState(n);
|
|
325
|
+
} catch (a) {
|
|
326
|
+
throw new Error(`Failed to create EVM Smart Account: ${a}`);
|
|
280
327
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
isNewUser: e.isNewEndUser
|
|
286
|
-
};
|
|
287
|
-
}, F = async ({
|
|
288
|
-
authResponse: e,
|
|
289
|
-
authState: r
|
|
290
|
-
}) => {
|
|
291
|
-
if (!r.user.solanaAccounts || r.user.solanaAccounts.length === 0)
|
|
328
|
+
return n;
|
|
329
|
+
}, J = async (e, t) => {
|
|
330
|
+
let r = t;
|
|
331
|
+
if (!t.user.solanaAccounts || t.user.solanaAccounts.length === 0)
|
|
292
332
|
try {
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
|
|
333
|
+
const n = await c().getWalletSecretId(), a = await j(
|
|
334
|
+
s().projectId,
|
|
335
|
+
t.user.userId,
|
|
296
336
|
{
|
|
297
|
-
walletSecretId:
|
|
337
|
+
walletSecretId: n
|
|
298
338
|
}
|
|
299
339
|
);
|
|
300
|
-
r =
|
|
301
|
-
} catch (
|
|
302
|
-
throw new Error(`Failed to create Solana account: ${
|
|
340
|
+
r = g(e.accessToken, e.validUntil, a), await c().setAuthState(r);
|
|
341
|
+
} catch (n) {
|
|
342
|
+
throw new Error(`Failed to create Solana account: ${n}`);
|
|
303
343
|
}
|
|
304
|
-
|
|
305
|
-
return {
|
|
306
|
-
message: e.message,
|
|
307
|
-
user: t,
|
|
308
|
-
isNewUser: e.isNewEndUser
|
|
309
|
-
};
|
|
344
|
+
return r;
|
|
310
345
|
};
|
|
311
346
|
export {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
347
|
+
je as exportEvmAccount,
|
|
348
|
+
Ke as exportSolanaAccount,
|
|
349
|
+
he as getAccessToken,
|
|
350
|
+
pe as getCurrentUser,
|
|
351
|
+
Pe as getUserOperation,
|
|
352
|
+
ue as initialize,
|
|
353
|
+
le as isSignedIn,
|
|
354
|
+
we as onAuthStateChange,
|
|
355
|
+
ve as sendEvmTransaction,
|
|
356
|
+
ke as sendSolanaTransaction,
|
|
357
|
+
Me as sendUserOperation,
|
|
358
|
+
Ie as signEvmHash,
|
|
359
|
+
Ee as signEvmMessage,
|
|
360
|
+
Se as signEvmTransaction,
|
|
361
|
+
Te as signEvmTypedData,
|
|
362
|
+
de as signInWithEmail,
|
|
363
|
+
me as signInWithSms,
|
|
364
|
+
fe as signOut,
|
|
365
|
+
Ue as signSolanaMessage,
|
|
366
|
+
Ae as signSolanaTransaction,
|
|
367
|
+
ge as verifyEmailOTP,
|
|
368
|
+
ye as verifySmsOTP
|
|
332
369
|
};
|
package/dist/esm/index.web50.js
CHANGED
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
type: l.type ? o[l.type] || l.type : null
|
|
22
|
-
};
|
|
23
|
-
return l.blobGasPrice && (s.blobGasPrice = BigInt(l.blobGasPrice)), l.blobGasUsed && (s.blobGasUsed = BigInt(l.blobGasUsed)), s;
|
|
1
|
+
class r extends Map {
|
|
2
|
+
constructor(e) {
|
|
3
|
+
super(), Object.defineProperty(this, "maxSize", {
|
|
4
|
+
enumerable: !0,
|
|
5
|
+
configurable: !0,
|
|
6
|
+
writable: !0,
|
|
7
|
+
value: void 0
|
|
8
|
+
}), this.maxSize = e;
|
|
9
|
+
}
|
|
10
|
+
get(e) {
|
|
11
|
+
const t = super.get(e);
|
|
12
|
+
return super.has(e) && t !== void 0 && (this.delete(e), super.set(e, t)), t;
|
|
13
|
+
}
|
|
14
|
+
set(e, t) {
|
|
15
|
+
if (super.set(e, t), this.maxSize && this.size > this.maxSize) {
|
|
16
|
+
const s = this.keys().next().value;
|
|
17
|
+
s && this.delete(s);
|
|
18
|
+
}
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
24
21
|
}
|
|
25
|
-
const U = /* @__PURE__ */ b("transactionReceipt", r);
|
|
26
22
|
export {
|
|
27
|
-
|
|
28
|
-
r as formatTransactionReceipt,
|
|
29
|
-
f as receiptStatuses
|
|
23
|
+
r as LruMap
|
|
30
24
|
};
|