@coinbase/cdp-core 0.0.121 → 0.0.123
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.web.js +110 -100
- package/dist/esm/index.web10.js +68 -67
- package/dist/esm/index.web100.js +86 -41
- package/dist/esm/index.web101.js +31 -13
- package/dist/esm/index.web102.js +25 -24
- package/dist/esm/index.web103.js +45 -15
- package/dist/esm/index.web104.js +3 -25
- package/dist/esm/index.web105.js +42 -20
- package/dist/esm/index.web106.js +13 -16
- package/dist/esm/index.web107.js +23 -28
- package/dist/esm/index.web108.js +14 -40
- package/dist/esm/index.web109.js +24 -48
- package/dist/esm/index.web11.js +1 -1
- package/dist/esm/index.web110.js +21 -81
- package/dist/esm/index.web111.js +15 -24
- package/dist/esm/index.web112.js +28 -158
- package/dist/esm/index.web113.js +39 -46
- package/dist/esm/index.web114.js +49 -28
- package/dist/esm/index.web115.js +77 -68
- package/dist/esm/index.web116.js +25 -8
- package/dist/esm/index.web117.js +156 -114
- package/dist/esm/index.web118.js +30 -119
- package/dist/esm/index.web119.js +24 -65
- package/dist/esm/index.web12.js +1 -1
- package/dist/esm/index.web120.js +72 -26
- package/dist/esm/index.web121.js +11 -33
- package/dist/esm/index.web122.js +9 -24
- package/dist/esm/index.web123.js +100 -47
- package/dist/esm/index.web124.js +137 -24
- package/dist/esm/index.web125.js +69 -51
- package/dist/esm/index.web126.js +26 -20
- package/dist/esm/index.web127.js +32 -152
- package/dist/esm/index.web128.js +24 -17
- package/dist/esm/index.web129.js +63 -21
- package/dist/esm/index.web13.js +3 -3
- package/dist/esm/index.web130.js +24 -51
- package/dist/esm/index.web131.js +48 -374
- package/dist/esm/index.web132.js +21 -29
- package/dist/esm/index.web133.js +152 -28
- package/dist/esm/index.web134.js +19 -2
- package/dist/esm/index.web135.js +20 -63
- package/dist/esm/index.web136.js +37 -351
- package/dist/esm/index.web137.js +369 -937
- package/dist/esm/index.web138.js +29 -2
- package/dist/esm/index.web139.js +28 -49
- package/dist/esm/index.web140.js +2 -29
- package/dist/esm/index.web141.js +63 -52
- package/dist/esm/index.web142.js +364 -10
- package/dist/esm/index.web143.js +945 -2
- package/dist/esm/index.web144.js +2 -45
- package/dist/esm/index.web145.js +49 -13
- package/dist/esm/index.web146.js +26 -12
- package/dist/esm/index.web147.js +54 -11
- package/dist/esm/index.web148.js +10 -4
- package/dist/esm/index.web149.js +2 -5
- package/dist/esm/index.web15.js +1 -1
- package/dist/esm/index.web150.js +44 -47
- package/dist/esm/index.web151.js +13 -14
- package/dist/esm/index.web152.js +10 -26
- package/dist/esm/index.web153.js +11 -7
- package/dist/esm/index.web154.js +5 -4
- package/dist/esm/index.web155.js +43 -24
- package/dist/esm/index.web156.js +14 -8
- package/dist/esm/index.web157.js +28 -7
- package/dist/esm/index.web158.js +7 -80
- package/dist/esm/index.web159.js +3 -28
- package/dist/esm/index.web16.js +1 -1
- package/dist/esm/index.web160.js +28 -3
- package/dist/esm/index.web161.js +8 -15
- package/dist/esm/index.web162.js +7 -4
- package/dist/esm/index.web163.js +74 -8
- package/dist/esm/index.web164.js +21 -12
- package/dist/esm/index.web165.js +3 -61
- package/dist/esm/index.web166.js +14 -16
- package/dist/esm/index.web167.js +4 -23
- package/dist/esm/index.web168.js +14 -8
- package/dist/esm/index.web169.js +15 -38
- package/dist/esm/index.web17.js +1 -1
- package/dist/esm/index.web170.js +61 -7
- package/dist/esm/index.web171.js +17 -20
- package/dist/esm/index.web172.js +23 -13
- package/dist/esm/index.web173.js +8 -55
- package/dist/esm/index.web174.js +42 -6
- package/dist/esm/index.web175.js +7 -21
- package/dist/esm/index.web176.js +19 -16
- package/dist/esm/index.web177.js +4 -45
- package/dist/esm/index.web178.js +2 -4
- package/dist/esm/index.web179.js +2 -4
- package/dist/esm/index.web18.js +2 -2
- package/dist/esm/index.web180.js +13 -34
- package/dist/esm/index.web181.js +53 -10
- package/dist/esm/index.web182.js +6 -4
- package/dist/esm/index.web183.js +21 -28
- package/dist/esm/index.web184.js +17 -6
- package/dist/esm/index.web185.js +42 -29
- package/dist/esm/index.web186.js +3 -12
- package/dist/esm/index.web187.js +3 -55
- package/dist/esm/index.web188.js +32 -40
- package/dist/esm/index.web189.js +11 -126
- package/dist/esm/index.web19.js +2 -2
- package/dist/esm/index.web190.js +4 -104
- package/dist/esm/index.web191.js +28 -6
- package/dist/esm/index.web192.js +7 -3
- package/dist/esm/index.web193.js +30 -76
- package/dist/esm/index.web194.js +13 -2
- package/dist/esm/index.web195.js +56 -2
- package/dist/esm/index.web196.js +39 -34
- package/dist/esm/index.web197.js +126 -5
- package/dist/esm/index.web198.js +101 -31
- package/dist/esm/index.web199.js +6 -14
- package/dist/esm/index.web2.js +2 -2
- package/dist/esm/index.web20.js +7 -7
- package/dist/esm/index.web200.js +3 -35
- package/dist/esm/index.web201.js +77 -17
- package/dist/esm/index.web202.js +2 -9
- package/dist/esm/index.web203.js +2 -11
- package/dist/esm/index.web204.js +37 -11
- package/dist/esm/index.web205.js +6 -13
- package/dist/esm/index.web206.js +34 -5
- package/dist/esm/index.web207.js +15 -5
- package/dist/esm/index.web208.js +34 -10
- package/dist/esm/index.web209.js +19 -2
- package/dist/esm/index.web21.js +1 -1
- package/dist/esm/index.web210.js +9 -2
- package/dist/esm/index.web211.js +9 -19
- package/dist/esm/index.web212.js +12 -10
- package/dist/esm/index.web213.js +14 -20
- package/dist/esm/index.web214.js +6 -94
- package/dist/esm/index.web215.js +4 -20
- package/dist/esm/index.web216.js +11 -118
- package/dist/esm/index.web217.js +19 -102
- package/dist/esm/index.web218.js +10 -79
- package/dist/esm/index.web219.js +20 -79
- package/dist/esm/index.web220.js +94 -2
- package/dist/esm/index.web221.js +21 -109
- package/dist/esm/index.web222.js +118 -2
- package/dist/esm/index.web223.js +103 -7
- package/dist/esm/index.web224.js +79 -2
- package/dist/esm/index.web225.js +78 -360
- package/dist/esm/index.web226.js +105 -849
- package/dist/esm/index.web227.js +2 -39
- package/dist/esm/index.web228.js +2 -2
- package/dist/esm/index.web229.js +36 -67
- package/dist/esm/index.web230.js +2 -35
- package/dist/esm/index.web231.js +69 -14
- package/dist/esm/index.web232.js +34 -46
- package/dist/esm/index.web233.js +12 -18
- package/dist/esm/index.web234.js +8 -2
- package/dist/esm/index.web235.js +2 -20
- package/dist/esm/index.web236.js +356 -28
- package/dist/esm/index.web237.js +852 -6
- package/dist/esm/index.web238.js +45 -16
- package/dist/esm/index.web239.js +20 -27
- package/dist/esm/index.web240.js +2 -8
- package/dist/esm/index.web241.js +19 -10
- package/dist/esm/index.web242.js +32 -12
- package/dist/esm/index.web243.js +6 -9
- package/dist/esm/index.web244.js +2 -15
- package/dist/esm/index.web245.js +17 -80
- package/dist/esm/index.web246.js +28 -2
- package/dist/esm/index.web247.js +8 -2
- package/dist/esm/index.web248.js +11 -2
- package/dist/esm/index.web249.js +12 -3
- package/dist/esm/index.web250.js +10 -5
- package/dist/esm/index.web251.js +16 -14
- package/dist/esm/index.web252.js +72 -70
- package/dist/esm/index.web253.js +4 -0
- package/dist/esm/index.web254.js +4 -0
- package/dist/esm/index.web255.js +4 -0
- package/dist/esm/index.web256.js +7 -0
- package/dist/esm/index.web257.js +81 -0
- package/dist/esm/index.web258.js +17 -0
- package/dist/esm/index.web28.js +5 -5
- package/dist/esm/index.web29.js +6 -6
- package/dist/esm/index.web3.js +1 -1
- package/dist/esm/index.web30.js +5 -5
- package/dist/esm/index.web31.js +5 -5
- package/dist/esm/index.web32.js +5 -5
- package/dist/esm/index.web33.js +5 -5
- package/dist/esm/index.web34.js +6 -6
- package/dist/esm/index.web35.js +5 -5
- package/dist/esm/index.web36.js +5 -5
- package/dist/esm/index.web37.js +1 -1
- package/dist/esm/index.web38.js +5 -5
- package/dist/esm/index.web39.js +5 -5
- package/dist/esm/index.web4.js +1 -1
- package/dist/esm/index.web40.js +6 -6
- package/dist/esm/index.web41.js +1 -1
- package/dist/esm/index.web42.js +5 -5
- package/dist/esm/index.web43.js +5 -5
- package/dist/esm/index.web45.js +2 -2
- package/dist/esm/index.web46.js +1 -1
- package/dist/esm/index.web49.js +4 -4
- package/dist/esm/index.web50.js +1 -1
- package/dist/esm/index.web52.js +3 -3
- package/dist/esm/index.web53.js +3 -3
- package/dist/esm/index.web54.js +2 -2
- package/dist/esm/index.web55.js +1 -1
- package/dist/esm/index.web57.js +3 -3
- package/dist/esm/index.web58.js +1 -1
- package/dist/esm/index.web59.js +2 -2
- package/dist/esm/index.web6.js +1 -1
- package/dist/esm/index.web60.js +4 -4
- package/dist/esm/index.web61.js +2 -2
- package/dist/esm/index.web62.js +3 -3
- package/dist/esm/index.web63.js +3 -3
- package/dist/esm/index.web64.js +3 -3
- package/dist/esm/index.web65.js +5 -5
- package/dist/esm/index.web66.js +5 -5
- package/dist/esm/index.web67.js +5 -5
- package/dist/esm/index.web68.js +5 -5
- package/dist/esm/index.web70.js +3 -3
- package/dist/esm/index.web71.js +9 -9
- package/dist/esm/index.web75.js +2 -2
- package/dist/esm/index.web76.js +3 -3
- package/dist/esm/index.web77.js +12 -12
- package/dist/esm/index.web78.js +1 -1
- package/dist/esm/index.web79.js +1 -1
- package/dist/esm/index.web80.js +1 -1
- package/dist/esm/index.web81.js +55 -19
- package/dist/esm/index.web82.js +62 -47
- package/dist/esm/index.web83.js +6 -40
- package/dist/esm/index.web84.js +17 -17
- package/dist/esm/index.web85.js +18 -349
- package/dist/esm/index.web86.js +47 -17
- package/dist/esm/index.web87.js +35 -127
- package/dist/esm/index.web88.js +18 -87
- package/dist/esm/index.web89.js +351 -6
- package/dist/esm/index.web9.js +1 -1
- package/dist/esm/index.web90.js +17 -54
- package/dist/esm/index.web91.js +125 -155
- package/dist/esm/index.web92.js +82 -61
- package/dist/esm/index.web93.js +7 -36
- package/dist/esm/index.web94.js +49 -99
- package/dist/esm/index.web95.js +156 -36
- package/dist/esm/index.web96.js +65 -29
- package/dist/esm/index.web97.js +36 -26
- package/dist/esm/index.web98.js +106 -45
- package/dist/esm/index.web99.js +43 -3
- package/dist/native/index.native101.js +1 -1
- package/dist/native/index.native11.js +1 -1
- package/dist/native/index.native113.js +2 -2
- package/dist/native/index.native118.js +6 -6
- package/dist/native/index.native12.js +62 -61
- package/dist/native/index.native129.js +12 -12
- package/dist/native/index.native130.js +2 -2
- package/dist/native/index.native132.js +1 -1
- package/dist/native/index.native133.js +1 -1
- package/dist/native/index.native135.js +12 -12
- package/dist/native/index.native136.js +12 -12
- package/dist/native/index.native137.js +1 -1
- package/dist/native/index.native139.js +4 -4
- package/dist/native/index.native140.js +11 -943
- package/dist/native/index.native141.js +12 -2
- package/dist/native/index.native142.js +4 -49
- package/dist/native/index.native143.js +944 -26
- package/dist/native/index.native144.js +2 -5
- package/dist/native/index.native145.js +45 -43
- package/dist/native/index.native146.js +27 -36
- package/dist/native/index.native147.js +5 -68
- package/dist/native/index.native148.js +47 -4
- package/dist/native/index.native149.js +36 -13
- package/dist/native/index.native150.js +67 -11
- package/dist/native/index.native151.js +13 -54
- package/dist/native/index.native152.js +27 -10
- package/dist/native/index.native153.js +8 -2
- package/dist/native/index.native154.js +4 -45
- package/dist/native/index.native155.js +27 -13
- package/dist/native/index.native156.js +9 -2
- package/dist/native/index.native157.js +8 -2
- package/dist/native/index.native158.js +72 -6
- package/dist/native/index.native159.js +10 -10
- package/dist/native/index.native160.js +3 -7
- package/dist/native/index.native161.js +14 -3
- package/dist/native/index.native162.js +4 -27
- package/dist/native/index.native163.js +13 -8
- package/dist/native/index.native164.js +19 -7
- package/dist/native/index.native165.js +48 -67
- package/dist/native/index.native166.js +16 -26
- package/dist/native/index.native167.js +23 -3
- package/dist/native/index.native168.js +8 -14
- package/dist/native/index.native169.js +41 -4
- package/dist/native/index.native170.js +7 -13
- package/dist/native/index.native171.js +11 -10
- package/dist/native/index.native172.js +52 -58
- package/dist/native/index.native173.js +10 -17
- package/dist/native/index.native174.js +2 -24
- package/dist/native/index.native175.js +45 -9
- package/dist/native/index.native176.js +13 -41
- package/dist/native/index.native177.js +13 -7
- package/dist/native/index.native178.js +54 -19
- package/dist/native/index.native179.js +6 -13
- package/dist/native/index.native180.js +20 -54
- package/dist/native/index.native181.js +17 -6
- package/dist/native/index.native182.js +44 -20
- package/dist/native/index.native183.js +3 -17
- package/dist/native/index.native184.js +3 -45
- package/dist/native/index.native185.js +34 -3
- package/dist/native/index.native186.js +12 -3
- package/dist/native/index.native187.js +4 -34
- package/dist/native/index.native188.js +27 -11
- package/dist/native/index.native189.js +6 -4
- package/dist/native/index.native190.js +29 -25
- package/dist/native/index.native191.js +12 -6
- package/dist/native/index.native192.js +54 -31
- package/dist/native/index.native193.js +41 -11
- package/dist/native/index.native194.js +126 -54
- package/dist/native/index.native195.js +100 -38
- package/dist/native/index.native196.js +6 -127
- package/dist/native/index.native197.js +3 -105
- package/dist/native/index.native198.js +78 -6
- package/dist/native/index.native199.js +2 -3
- package/dist/native/index.native2.js +2 -2
- package/dist/native/index.native200.js +2 -79
- package/dist/native/index.native201.js +38 -2
- package/dist/native/index.native202.js +7 -2
- package/dist/native/index.native203.js +29 -32
- package/dist/native/index.native204.js +14 -6
- package/dist/native/index.native205.js +30 -30
- package/dist/native/index.native206.js +18 -14
- package/dist/native/index.native207.js +8 -34
- package/dist/native/index.native208.js +9 -17
- package/dist/native/index.native209.js +11 -8
- package/dist/native/index.native210.js +13 -10
- package/dist/native/index.native211.js +5 -11
- package/dist/native/index.native212.js +5 -14
- package/dist/native/index.native213.js +10 -5
- package/dist/native/index.native214.js +2 -5
- package/dist/native/index.native215.js +2 -11
- package/dist/native/index.native216.js +104 -2
- package/dist/native/index.native217.js +77 -107
- package/dist/native/index.native218.js +79 -2
- package/dist/native/index.native219.js +2 -39
- package/dist/native/index.native220.js +109 -2
- package/dist/native/index.native221.js +2 -70
- package/dist/native/index.native222.js +7 -34
- package/dist/native/index.native223.js +2 -15
- package/dist/native/index.native224.js +360 -7
- package/dist/native/index.native225.js +853 -2
- package/dist/native/index.native226.js +35 -357
- package/dist/native/index.native227.js +2 -853
- package/dist/native/index.native228.js +69 -103
- package/dist/native/index.native229.js +32 -76
- package/dist/native/index.native230.js +14 -78
- package/dist/native/index.native231.js +1 -1
- package/dist/native/index.native237.js +40 -14
- package/dist/native/index.native238.js +21 -2
- package/dist/native/index.native239.js +2 -20
- package/dist/native/index.native240.js +18 -31
- package/dist/native/index.native241.js +32 -6
- package/dist/native/index.native242.js +6 -46
- package/dist/native/index.native243.js +2 -4
- package/dist/native/index.native244.js +2 -2
- package/dist/native/index.native245.js +2 -2
- package/dist/native/index.native246.js +4 -2
- package/dist/native/index.native253.js +1 -1
- package/dist/native/index.native256.js +1 -1
- package/dist/native/index.native3.js +1 -1
- package/dist/native/index.native79.js +12 -12
- package/dist/native/index.native84.js +12 -9
- package/dist/native/index.native87.js +46 -48
- package/dist/native/index.native90.js +4 -2
- package/dist/native-types/actions/deletePasskey.d.ts +21 -0
- package/dist/native-types/actions/enrollPasskey.d.ts +44 -0
- package/dist/native-types/actions/listPasskeys.d.ts +16 -0
- package/dist/native-types/actions/verifyPasskey.d.ts +30 -0
- package/dist/native-types/auth/authManager.d.ts +6 -2
- package/dist/native-types/auth/createAuthManager.d.ts +5 -1
- package/dist/native-types/errors.d.ts +10 -2
- package/dist/native-types/index.web.d.ts +5 -0
- package/dist/native-types/mfa/utils.d.ts +3 -3
- package/dist/native-types/shared/base64url.d.ts +21 -0
- package/dist/native-types/shared/webauthn.d.ts +121 -0
- package/dist/native-types/types.d.ts +4 -2
- package/dist/native-types/version.d.ts +1 -1
- package/dist/types/actions/deletePasskey.d.ts +21 -0
- package/dist/types/actions/enrollPasskey.d.ts +44 -0
- package/dist/types/actions/listPasskeys.d.ts +16 -0
- package/dist/types/actions/verifyPasskey.d.ts +30 -0
- package/dist/types/auth/authManager.d.ts +6 -2
- package/dist/types/auth/createAuthManager.d.ts +5 -1
- package/dist/types/errors.d.ts +10 -2
- package/dist/types/index.web.d.ts +5 -0
- package/dist/types/mfa/utils.d.ts +3 -3
- package/dist/types/shared/base64url.d.ts +21 -0
- package/dist/types/shared/webauthn.d.ts +121 -0
- package/dist/types/types.d.ts +4 -2
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index.web.js +110 -100
- package/dist/web/index.web10.js +68 -67
- package/dist/web/index.web100.js +86 -41
- package/dist/web/index.web101.js +31 -13
- package/dist/web/index.web102.js +25 -24
- package/dist/web/index.web103.js +45 -15
- package/dist/web/index.web104.js +3 -25
- package/dist/web/index.web105.js +42 -20
- package/dist/web/index.web106.js +13 -16
- package/dist/web/index.web107.js +23 -28
- package/dist/web/index.web108.js +14 -40
- package/dist/web/index.web109.js +24 -48
- package/dist/web/index.web11.js +1 -1
- package/dist/web/index.web110.js +21 -81
- package/dist/web/index.web111.js +15 -24
- package/dist/web/index.web112.js +28 -158
- package/dist/web/index.web113.js +39 -46
- package/dist/web/index.web114.js +49 -28
- package/dist/web/index.web115.js +77 -68
- package/dist/web/index.web116.js +25 -8
- package/dist/web/index.web117.js +156 -114
- package/dist/web/index.web118.js +30 -119
- package/dist/web/index.web119.js +24 -65
- package/dist/web/index.web12.js +1 -1
- package/dist/web/index.web120.js +72 -26
- package/dist/web/index.web121.js +11 -33
- package/dist/web/index.web122.js +9 -24
- package/dist/web/index.web123.js +100 -47
- package/dist/web/index.web124.js +137 -24
- package/dist/web/index.web125.js +69 -51
- package/dist/web/index.web126.js +26 -20
- package/dist/web/index.web127.js +32 -152
- package/dist/web/index.web128.js +24 -17
- package/dist/web/index.web129.js +63 -21
- package/dist/web/index.web13.js +3 -3
- package/dist/web/index.web130.js +24 -51
- package/dist/web/index.web131.js +48 -374
- package/dist/web/index.web132.js +21 -29
- package/dist/web/index.web133.js +152 -28
- package/dist/web/index.web134.js +19 -2
- package/dist/web/index.web135.js +20 -63
- package/dist/web/index.web136.js +37 -351
- package/dist/web/index.web137.js +369 -937
- package/dist/web/index.web138.js +29 -2
- package/dist/web/index.web139.js +28 -49
- package/dist/web/index.web140.js +2 -29
- package/dist/web/index.web141.js +63 -52
- package/dist/web/index.web142.js +364 -10
- package/dist/web/index.web143.js +945 -2
- package/dist/web/index.web144.js +2 -45
- package/dist/web/index.web145.js +49 -13
- package/dist/web/index.web146.js +26 -12
- package/dist/web/index.web147.js +54 -11
- package/dist/web/index.web148.js +10 -4
- package/dist/web/index.web149.js +2 -5
- package/dist/web/index.web15.js +1 -1
- package/dist/web/index.web150.js +44 -47
- package/dist/web/index.web151.js +13 -14
- package/dist/web/index.web152.js +10 -26
- package/dist/web/index.web153.js +11 -7
- package/dist/web/index.web154.js +5 -4
- package/dist/web/index.web155.js +43 -24
- package/dist/web/index.web156.js +14 -8
- package/dist/web/index.web157.js +28 -7
- package/dist/web/index.web158.js +7 -80
- package/dist/web/index.web159.js +3 -28
- package/dist/web/index.web16.js +1 -1
- package/dist/web/index.web160.js +28 -3
- package/dist/web/index.web161.js +8 -15
- package/dist/web/index.web162.js +7 -4
- package/dist/web/index.web163.js +74 -8
- package/dist/web/index.web164.js +21 -12
- package/dist/web/index.web165.js +3 -61
- package/dist/web/index.web166.js +14 -16
- package/dist/web/index.web167.js +4 -23
- package/dist/web/index.web168.js +14 -8
- package/dist/web/index.web169.js +15 -38
- package/dist/web/index.web17.js +1 -1
- package/dist/web/index.web170.js +61 -7
- package/dist/web/index.web171.js +17 -20
- package/dist/web/index.web172.js +23 -13
- package/dist/web/index.web173.js +8 -55
- package/dist/web/index.web174.js +42 -6
- package/dist/web/index.web175.js +7 -21
- package/dist/web/index.web176.js +19 -16
- package/dist/web/index.web177.js +4 -45
- package/dist/web/index.web178.js +2 -4
- package/dist/web/index.web179.js +2 -4
- package/dist/web/index.web18.js +2 -2
- package/dist/web/index.web180.js +13 -34
- package/dist/web/index.web181.js +53 -10
- package/dist/web/index.web182.js +6 -4
- package/dist/web/index.web183.js +21 -28
- package/dist/web/index.web184.js +17 -6
- package/dist/web/index.web185.js +42 -29
- package/dist/web/index.web186.js +3 -12
- package/dist/web/index.web187.js +3 -55
- package/dist/web/index.web188.js +32 -40
- package/dist/web/index.web189.js +11 -126
- package/dist/web/index.web19.js +2 -2
- package/dist/web/index.web190.js +4 -104
- package/dist/web/index.web191.js +28 -6
- package/dist/web/index.web192.js +7 -3
- package/dist/web/index.web193.js +30 -76
- package/dist/web/index.web194.js +13 -2
- package/dist/web/index.web195.js +56 -2
- package/dist/web/index.web196.js +39 -34
- package/dist/web/index.web197.js +126 -5
- package/dist/web/index.web198.js +101 -31
- package/dist/web/index.web199.js +6 -14
- package/dist/web/index.web2.js +2 -2
- package/dist/web/index.web20.js +7 -7
- package/dist/web/index.web200.js +3 -35
- package/dist/web/index.web201.js +77 -17
- package/dist/web/index.web202.js +2 -9
- package/dist/web/index.web203.js +2 -11
- package/dist/web/index.web204.js +37 -11
- package/dist/web/index.web205.js +6 -13
- package/dist/web/index.web206.js +34 -5
- package/dist/web/index.web207.js +15 -5
- package/dist/web/index.web208.js +34 -10
- package/dist/web/index.web209.js +19 -2
- package/dist/web/index.web21.js +1 -1
- package/dist/web/index.web210.js +9 -2
- package/dist/web/index.web211.js +9 -19
- package/dist/web/index.web212.js +12 -10
- package/dist/web/index.web213.js +14 -20
- package/dist/web/index.web214.js +6 -94
- package/dist/web/index.web215.js +4 -20
- package/dist/web/index.web216.js +11 -118
- package/dist/web/index.web217.js +19 -102
- package/dist/web/index.web218.js +10 -79
- package/dist/web/index.web219.js +20 -79
- package/dist/web/index.web220.js +94 -2
- package/dist/web/index.web221.js +21 -109
- package/dist/web/index.web222.js +118 -2
- package/dist/web/index.web223.js +103 -7
- package/dist/web/index.web224.js +79 -2
- package/dist/web/index.web225.js +78 -360
- package/dist/web/index.web226.js +105 -849
- package/dist/web/index.web227.js +2 -39
- package/dist/web/index.web228.js +2 -2
- package/dist/web/index.web229.js +36 -67
- package/dist/web/index.web230.js +2 -35
- package/dist/web/index.web231.js +69 -14
- package/dist/web/index.web232.js +34 -46
- package/dist/web/index.web233.js +12 -18
- package/dist/web/index.web234.js +8 -2
- package/dist/web/index.web235.js +2 -20
- package/dist/web/index.web236.js +356 -28
- package/dist/web/index.web237.js +852 -6
- package/dist/web/index.web238.js +45 -16
- package/dist/web/index.web239.js +20 -27
- package/dist/web/index.web240.js +2 -8
- package/dist/web/index.web241.js +19 -10
- package/dist/web/index.web242.js +32 -12
- package/dist/web/index.web243.js +6 -9
- package/dist/web/index.web244.js +2 -15
- package/dist/web/index.web245.js +17 -80
- package/dist/web/index.web246.js +28 -2
- package/dist/web/index.web247.js +8 -2
- package/dist/web/index.web248.js +11 -2
- package/dist/web/index.web249.js +12 -3
- package/dist/web/index.web250.js +10 -5
- package/dist/web/index.web251.js +16 -14
- package/dist/web/index.web252.js +72 -70
- package/dist/web/index.web253.js +4 -0
- package/dist/web/index.web254.js +4 -0
- package/dist/web/index.web255.js +4 -0
- package/dist/web/index.web256.js +7 -0
- package/dist/web/index.web257.js +81 -0
- package/dist/web/index.web258.js +17 -0
- package/dist/web/index.web28.js +5 -5
- package/dist/web/index.web29.js +6 -6
- package/dist/web/index.web3.js +1 -1
- package/dist/web/index.web30.js +5 -5
- package/dist/web/index.web31.js +5 -5
- package/dist/web/index.web32.js +5 -5
- package/dist/web/index.web33.js +5 -5
- package/dist/web/index.web34.js +6 -6
- package/dist/web/index.web35.js +5 -5
- package/dist/web/index.web36.js +5 -5
- package/dist/web/index.web37.js +1 -1
- package/dist/web/index.web38.js +5 -5
- package/dist/web/index.web39.js +5 -5
- package/dist/web/index.web4.js +1 -1
- package/dist/web/index.web40.js +6 -6
- package/dist/web/index.web41.js +1 -1
- package/dist/web/index.web42.js +5 -5
- package/dist/web/index.web43.js +5 -5
- package/dist/web/index.web45.js +2 -2
- package/dist/web/index.web46.js +1 -1
- package/dist/web/index.web49.js +4 -4
- package/dist/web/index.web50.js +1 -1
- package/dist/web/index.web52.js +3 -3
- package/dist/web/index.web53.js +3 -3
- package/dist/web/index.web54.js +2 -2
- package/dist/web/index.web55.js +1 -1
- package/dist/web/index.web57.js +3 -3
- package/dist/web/index.web58.js +1 -1
- package/dist/web/index.web59.js +2 -2
- package/dist/web/index.web6.js +1 -1
- package/dist/web/index.web60.js +4 -4
- package/dist/web/index.web61.js +2 -2
- package/dist/web/index.web62.js +3 -3
- package/dist/web/index.web63.js +3 -3
- package/dist/web/index.web64.js +3 -3
- package/dist/web/index.web65.js +5 -5
- package/dist/web/index.web66.js +5 -5
- package/dist/web/index.web67.js +5 -5
- package/dist/web/index.web68.js +5 -5
- package/dist/web/index.web70.js +3 -3
- package/dist/web/index.web71.js +9 -9
- package/dist/web/index.web75.js +2 -2
- package/dist/web/index.web76.js +3 -3
- package/dist/web/index.web77.js +12 -12
- package/dist/web/index.web78.js +1 -1
- package/dist/web/index.web79.js +1 -1
- package/dist/web/index.web80.js +1 -1
- package/dist/web/index.web81.js +55 -19
- package/dist/web/index.web82.js +62 -47
- package/dist/web/index.web83.js +6 -40
- package/dist/web/index.web84.js +17 -17
- package/dist/web/index.web85.js +18 -349
- package/dist/web/index.web86.js +47 -17
- package/dist/web/index.web87.js +35 -127
- package/dist/web/index.web88.js +18 -87
- package/dist/web/index.web89.js +351 -6
- package/dist/web/index.web9.js +1 -1
- package/dist/web/index.web90.js +17 -54
- package/dist/web/index.web91.js +125 -155
- package/dist/web/index.web92.js +82 -61
- package/dist/web/index.web93.js +7 -36
- package/dist/web/index.web94.js +49 -99
- package/dist/web/index.web95.js +156 -36
- package/dist/web/index.web96.js +65 -29
- package/dist/web/index.web97.js +36 -26
- package/dist/web/index.web98.js +106 -45
- package/dist/web/index.web99.js +43 -3
- package/dist/web-types/actions/deletePasskey.d.ts +21 -0
- package/dist/web-types/actions/enrollPasskey.d.ts +44 -0
- package/dist/web-types/actions/listPasskeys.d.ts +16 -0
- package/dist/web-types/actions/verifyPasskey.d.ts +30 -0
- package/dist/web-types/auth/authManager.d.ts +6 -2
- package/dist/web-types/auth/createAuthManager.d.ts +5 -1
- package/dist/web-types/errors.d.ts +10 -2
- package/dist/web-types/index.web.d.ts +5 -0
- package/dist/web-types/mfa/utils.d.ts +3 -3
- package/dist/web-types/shared/base64url.d.ts +21 -0
- package/dist/web-types/shared/webauthn.d.ts +121 -0
- package/dist/web-types/types.d.ts +4 -2
- package/dist/web-types/version.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { __require as r } from "./index.
|
|
1
|
+
import { __require as r } from "./index.native222.js";
|
|
2
2
|
r();
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { submitMfaEnrollment as
|
|
2
|
-
import { Analytics as
|
|
1
|
+
import { submitMfaEnrollment as u } from "@coinbase/cdp-api-client";
|
|
2
|
+
import { Analytics as i } from "./index.native2.js";
|
|
3
3
|
import "./index.native3.js";
|
|
4
|
-
import { toAuthStateUser as
|
|
5
|
-
import { withAuth as
|
|
6
|
-
import { mockUser as
|
|
7
|
-
import { validateUserAuthState as
|
|
4
|
+
import { toAuthStateUser as f } from "./index.native104.js";
|
|
5
|
+
import { withAuth as c } from "./index.native99.js";
|
|
6
|
+
import { mockUser as l } from "./index.native109.js";
|
|
7
|
+
import { validateUserAuthState as h } from "./index.native105.js";
|
|
8
8
|
import { getConfig as o, getCoreAuthManager as p } from "./index.native76.js";
|
|
9
9
|
const E = async (e) => {
|
|
10
|
-
if (
|
|
10
|
+
if (i.sendActionCallEvent({ name: "submit_mfa_enrollment" }), o().useMock)
|
|
11
11
|
return {
|
|
12
|
-
user:
|
|
12
|
+
user: l
|
|
13
13
|
};
|
|
14
|
-
const t = p(), { authState:
|
|
15
|
-
|
|
14
|
+
const t = p(), { authState: a } = h(t.getUser(), t.getAuthState()), m = await c({}, t, async ({ user: s }) => u(
|
|
15
|
+
s.userId,
|
|
16
16
|
e.mfaMethod,
|
|
17
17
|
{
|
|
18
18
|
mfaCode: e.mfaCode
|
|
19
19
|
},
|
|
20
20
|
{ projectID: o().projectId },
|
|
21
21
|
e.idempotencyKey
|
|
22
|
-
)), r =
|
|
23
|
-
return await t.setAuthState({ ...
|
|
22
|
+
)), r = f(m.endUser), n = t.getAuthState() ?? a;
|
|
23
|
+
return await t.setAuthState({ ...n, user: r }), { user: r };
|
|
24
24
|
};
|
|
25
25
|
export {
|
|
26
26
|
E as submitMfaEnrollment
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { getMfaConfigState as f } from "./index.native76.js";
|
|
2
2
|
import "@coinbase/cdp-api-client";
|
|
3
3
|
import "viem";
|
|
4
|
-
const r = ["totp", "sms"], o = (t, e) => {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const r = ["totp", "sms", "passkey"], s = (t) => !!t && Date.now() > new Date(t).getTime(), o = (t, e) => {
|
|
5
|
+
if (e === "passkey") {
|
|
6
|
+
const n = t.mfaMethods.passkey;
|
|
7
|
+
return Array.isArray(n) && n.some((a) => s(a.enrolledAt));
|
|
8
|
+
}
|
|
9
|
+
return s(t.mfaMethods[e]?.enrolledAt);
|
|
7
10
|
};
|
|
8
|
-
function
|
|
11
|
+
function M(t) {
|
|
9
12
|
return t.mfaMethods ? r.filter((e) => o(t, e)) : [];
|
|
10
13
|
}
|
|
11
|
-
function
|
|
14
|
+
function c(t, e) {
|
|
12
15
|
return e ? o(t, e) : t.mfaMethods ? r.some((n) => o(t, n)) : !1;
|
|
13
16
|
}
|
|
14
|
-
function
|
|
17
|
+
function m() {
|
|
15
18
|
const t = f(), e = r.filter((n) => t?.[`${n}Config`]?.enabled);
|
|
16
19
|
return e.length ? e : ["totp"];
|
|
17
20
|
}
|
|
18
21
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
m as getEnabledMfaMethods,
|
|
23
|
+
M as getEnrolledMfaMethods,
|
|
24
|
+
c as isEnrolledInMfa
|
|
22
25
|
};
|
|
@@ -13,24 +13,24 @@ const l = 60 * 1e3, R = {
|
|
|
13
13
|
baseDelayMs: 1e3,
|
|
14
14
|
maxDelayMs: 1e4
|
|
15
15
|
};
|
|
16
|
-
function g(
|
|
17
|
-
const n = e * Math.pow(2,
|
|
18
|
-
return Math.min(n + o,
|
|
16
|
+
function g(r, e, t) {
|
|
17
|
+
const n = e * Math.pow(2, r), o = Math.random() * 0.3 * n;
|
|
18
|
+
return Math.min(n + o, t);
|
|
19
19
|
}
|
|
20
|
-
function A(
|
|
21
|
-
return new Promise((e) => setTimeout(e,
|
|
20
|
+
function A(r) {
|
|
21
|
+
return new Promise((e) => setTimeout(e, r));
|
|
22
22
|
}
|
|
23
|
-
function E(
|
|
24
|
-
if (
|
|
23
|
+
function E(r) {
|
|
24
|
+
if (r instanceof TypeError && r.message.includes("fetch"))
|
|
25
25
|
return !0;
|
|
26
|
-
if (
|
|
27
|
-
if (
|
|
26
|
+
if (r instanceof y) {
|
|
27
|
+
if (r.statusCode >= 500 && r.statusCode < 600 || r.statusCode === 408 || r.statusCode === 429)
|
|
28
28
|
return !0;
|
|
29
|
-
if (
|
|
29
|
+
if (r.statusCode === 401)
|
|
30
30
|
return !1;
|
|
31
31
|
}
|
|
32
|
-
if (
|
|
33
|
-
const e =
|
|
32
|
+
if (r instanceof Error) {
|
|
33
|
+
const e = r.message.toLowerCase();
|
|
34
34
|
if (e.includes("network") || e.includes("timeout") || e.includes("econnrefused") || e.includes("enotfound") || e.includes("socket"))
|
|
35
35
|
return !0;
|
|
36
36
|
}
|
|
@@ -48,9 +48,11 @@ class j {
|
|
|
48
48
|
* Initializes the token manager.
|
|
49
49
|
*
|
|
50
50
|
* @param projectId - The project ID.
|
|
51
|
+
* @param options - Options that control initial session refresh behavior.
|
|
52
|
+
* @param options.deferInitialization - Whether to defer the initial session refresh until ensureInitialized is called.
|
|
51
53
|
*/
|
|
52
|
-
constructor(e) {
|
|
53
|
-
this.projectId = e, this.initPromise = this._doInitialize();
|
|
54
|
+
constructor(e, t = {}) {
|
|
55
|
+
this.projectId = e, t.deferInitialization || (this.initPromise = this._doInitialize());
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
56
58
|
* Gets the current user, or null if there is no user signed in.
|
|
@@ -139,12 +141,12 @@ class j {
|
|
|
139
141
|
if (!await this.isSignedIn())
|
|
140
142
|
throw new Error("Cannot get X-Wallet-Auth header if the user is not signed in");
|
|
141
143
|
this.shouldRefreshWalletSecret() && await this.refreshWalletSecret();
|
|
142
|
-
const
|
|
143
|
-
uris: [
|
|
144
|
+
const t = `${e.requestMethod} ${e.requestHost}${e.requestPath}`, n = Math.floor(Date.now() / 1e3), o = c(), a = {
|
|
145
|
+
uris: [t]
|
|
144
146
|
};
|
|
145
147
|
if (e.requestData && Object.keys(e.requestData).length > 0) {
|
|
146
|
-
const
|
|
147
|
-
a.reqHash = await o.hash(new TextEncoder().encode(JSON.stringify(
|
|
148
|
+
const s = p(e.requestData);
|
|
149
|
+
a.reqHash = await o.hash(new TextEncoder().encode(JSON.stringify(s)));
|
|
148
150
|
}
|
|
149
151
|
return await new _(a).setProtectedHeader({ alg: "ES256", typ: "JWT" }).setIssuedAt(n).setNotBefore(n).setJti(o.generateRandomId()).sign(this.walletSecret.keyPair.privateKey);
|
|
150
152
|
}
|
|
@@ -162,7 +164,7 @@ class j {
|
|
|
162
164
|
* @param authState - The authentication state.
|
|
163
165
|
*/
|
|
164
166
|
async setAuthState(e) {
|
|
165
|
-
this.authState = e, i.endUserIdentifier = e.user.userId, this.authStateChangeCallbacks.forEach((
|
|
167
|
+
this.authState = e, i.endUserIdentifier = e.user.userId, this.authStateChangeCallbacks.forEach((t) => t(this.authState?.user ?? null)), this.scheduleTokenRefresh();
|
|
166
168
|
}
|
|
167
169
|
/**
|
|
168
170
|
* Clears the authentication state.
|
|
@@ -172,14 +174,10 @@ class j {
|
|
|
172
174
|
}
|
|
173
175
|
/**
|
|
174
176
|
* Ensures the AuthManager is initialized before proceeding.
|
|
175
|
-
*
|
|
177
|
+
* Starts deferred initialization when necessary, otherwise waits for initialization already in progress.
|
|
176
178
|
*/
|
|
177
179
|
async ensureInitialized() {
|
|
178
|
-
|
|
179
|
-
await this.initPromise;
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
throw new Error("AuthManager not initialized");
|
|
180
|
+
this.initPromise ??= this._doInitialize(), await this.initPromise;
|
|
183
181
|
}
|
|
184
182
|
/**
|
|
185
183
|
* Internal async initialization logic.
|
|
@@ -210,19 +208,19 @@ class j {
|
|
|
210
208
|
* @returns The new access token.
|
|
211
209
|
*/
|
|
212
210
|
async refreshAccessToken(e = "on_demand") {
|
|
213
|
-
const { maxRetries:
|
|
211
|
+
const { maxRetries: t, baseDelayMs: n, maxDelayMs: o } = R;
|
|
214
212
|
i.sendSessionRefreshEvent({
|
|
215
213
|
name: "refresh_token_start",
|
|
216
214
|
trigger: e
|
|
217
215
|
});
|
|
218
|
-
for (let a = 0; a <=
|
|
216
|
+
for (let a = 0; a <= t; a++)
|
|
219
217
|
try {
|
|
220
|
-
const
|
|
218
|
+
const s = await d(this.projectId, {
|
|
221
219
|
grantType: "refresh_token"
|
|
222
220
|
}), h = k(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
221
|
+
s.accessToken,
|
|
222
|
+
s.validUntil,
|
|
223
|
+
s.endUser
|
|
226
224
|
);
|
|
227
225
|
await this.setAuthState(h), i.sendSessionRefreshEvent({
|
|
228
226
|
name: "refresh_token_success",
|
|
@@ -230,15 +228,15 @@ class j {
|
|
|
230
228
|
attempt: a
|
|
231
229
|
});
|
|
232
230
|
return;
|
|
233
|
-
} catch (
|
|
234
|
-
const h =
|
|
235
|
-
if (m(
|
|
236
|
-
if (S(
|
|
231
|
+
} catch (s) {
|
|
232
|
+
const h = s instanceof Error ? s.message : String(s);
|
|
233
|
+
if (m(s)) {
|
|
234
|
+
if (S(s)) {
|
|
237
235
|
i.sendSessionRefreshEvent({
|
|
238
236
|
name: "refresh_token_skipped_transient",
|
|
239
237
|
trigger: e,
|
|
240
238
|
attempt: a,
|
|
241
|
-
read_outcome:
|
|
239
|
+
read_outcome: s.outcome,
|
|
242
240
|
error_message: h
|
|
243
241
|
});
|
|
244
242
|
return;
|
|
@@ -248,12 +246,12 @@ class j {
|
|
|
248
246
|
trigger: e,
|
|
249
247
|
attempt: a,
|
|
250
248
|
error_type: "non_transient",
|
|
251
|
-
read_outcome:
|
|
249
|
+
read_outcome: s.outcome,
|
|
252
250
|
error_message: h
|
|
253
251
|
}), await this.signOut();
|
|
254
252
|
return;
|
|
255
253
|
}
|
|
256
|
-
if (!E(
|
|
254
|
+
if (!E(s)) {
|
|
257
255
|
i.sendSessionRefreshEvent({
|
|
258
256
|
name: "refresh_token_failure",
|
|
259
257
|
trigger: e,
|
|
@@ -263,7 +261,7 @@ class j {
|
|
|
263
261
|
}), await this.signOut();
|
|
264
262
|
return;
|
|
265
263
|
}
|
|
266
|
-
if (a ===
|
|
264
|
+
if (a === t) {
|
|
267
265
|
i.sendSessionRefreshEvent({
|
|
268
266
|
name: "refresh_token_exhausted",
|
|
269
267
|
trigger: e,
|
|
@@ -291,13 +289,13 @@ class j {
|
|
|
291
289
|
scheduleTokenRefresh() {
|
|
292
290
|
if (this.cancelTokenRefresh(), !this.authState)
|
|
293
291
|
return;
|
|
294
|
-
const
|
|
295
|
-
|
|
292
|
+
const t = this.authState.expiresAt - l - Date.now();
|
|
293
|
+
t <= 0 || (i.sendSessionRefreshEvent({
|
|
296
294
|
name: "refresh_token_scheduled",
|
|
297
|
-
time_until_refresh_ms:
|
|
295
|
+
time_until_refresh_ms: t
|
|
298
296
|
}), this.refreshTimeout = setTimeout(async () => {
|
|
299
297
|
await this.refreshAccessToken("scheduled"), this.scheduleTokenRefresh();
|
|
300
|
-
},
|
|
298
|
+
}, t));
|
|
301
299
|
}
|
|
302
300
|
/**
|
|
303
301
|
* Cancels any scheduled token refresh.
|
|
@@ -334,20 +332,20 @@ class j {
|
|
|
334
332
|
* Internal wallet secret refresh logic.
|
|
335
333
|
*/
|
|
336
334
|
async _doRefreshWalletSecret() {
|
|
337
|
-
const e = c(),
|
|
338
|
-
this.walletSecret = { walletSecretId:
|
|
335
|
+
const e = c(), t = this.walletSecret?.walletSecretId ?? e.generateRandomId(), n = this.walletSecret?.keyPair ?? await e.createKeyPair(), o = this.authState.expiresAt, a = new Date(o).toISOString();
|
|
336
|
+
this.walletSecret = { walletSecretId: t, keyPair: n, expiresAt: o };
|
|
339
337
|
try {
|
|
340
338
|
await w(
|
|
341
339
|
this.authState.user.userId,
|
|
342
340
|
{
|
|
343
|
-
walletSecretId:
|
|
341
|
+
walletSecretId: t,
|
|
344
342
|
publicKey: n.publicKeyBase64,
|
|
345
343
|
validUntil: a
|
|
346
344
|
},
|
|
347
345
|
{ projectID: this.projectId }
|
|
348
346
|
);
|
|
349
|
-
} catch (
|
|
350
|
-
throw this.walletSecret = null,
|
|
347
|
+
} catch (s) {
|
|
348
|
+
throw this.walletSecret = null, s;
|
|
351
349
|
}
|
|
352
350
|
}
|
|
353
351
|
}
|
|
@@ -59,9 +59,11 @@ class l extends Error {
|
|
|
59
59
|
*
|
|
60
60
|
* @param code - The error code identifying the type of MFA error.
|
|
61
61
|
* @param message - The error message.
|
|
62
|
+
* @param options - Additional error options.
|
|
63
|
+
* @param options.cause - The underlying error this one was mapped from, when there is one.
|
|
62
64
|
*/
|
|
63
|
-
constructor(r, e) {
|
|
64
|
-
super(e), this.name = "MfaError", this.code = r;
|
|
65
|
+
constructor(r, e, o) {
|
|
66
|
+
super(e, o), this.name = "MfaError", this.code = r;
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
class u extends Error {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deletes a single enrolled passkey (WebAuthn) credential by its credential ID.
|
|
3
|
+
*
|
|
4
|
+
* Last Method Protection: if deleting this passkey would leave the end user with
|
|
5
|
+
* no enrolled MFA methods of any type (no other passkeys, TOTP, or SMS) and the
|
|
6
|
+
* project requires MFA verification on login, the request is rejected with a 403.
|
|
7
|
+
*
|
|
8
|
+
* The signed-in user is refreshed afterwards, so `user.mfaMethods.passkey` and
|
|
9
|
+
* `isEnrolledInMfa(user, "passkey")` reflect the deletion. A `listPasskeys` result you are
|
|
10
|
+
* already holding is not refreshed; re-run it to get the new list.
|
|
11
|
+
*
|
|
12
|
+
* @param credentialId - The base64url-encoded WebAuthn credential ID of the passkey to delete.
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const [passkey] = await listPasskeys();
|
|
16
|
+
* await deletePasskey(passkey.credentialId);
|
|
17
|
+
* const remaining = await listPasskeys();
|
|
18
|
+
* ```
|
|
19
|
+
* @returns A promise that resolves once the passkey has been deleted.
|
|
20
|
+
*/
|
|
21
|
+
export declare const deletePasskey: (credentialId: string) => Promise<void>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { User } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Options for enrolling a passkey (WebAuthn) as an MFA method.
|
|
4
|
+
*/
|
|
5
|
+
export type EnrollPasskeyOptions = {
|
|
6
|
+
/** An optional human-friendly name for the passkey (e.g. the device or browser), shown when listing enrolled passkeys. */
|
|
7
|
+
name?: string;
|
|
8
|
+
/** Optional idempotency key for safe retries. */
|
|
9
|
+
idempotencyKey?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Result of enrollPasskey.
|
|
13
|
+
*/
|
|
14
|
+
export type EnrollPasskeyResult = {
|
|
15
|
+
/** The updated user with the passkey enrolled. */
|
|
16
|
+
user: User;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Enrolls a passkey (WebAuthn) as an MFA method for the current end user.
|
|
20
|
+
*
|
|
21
|
+
* This runs the full WebAuthn registration ceremony in one call: it initiates
|
|
22
|
+
* enrollment with the server to obtain credential creation options, prompts the
|
|
23
|
+
* browser to create a new credential via `navigator.credentials.create()`, and
|
|
24
|
+
* submits the resulting attestation to the server to complete enrollment.
|
|
25
|
+
*
|
|
26
|
+
* Passkey MFA is supported in web environments only. Call `isPasskeySupported`
|
|
27
|
+
* first to check availability before offering passkey enrollment in your UI.
|
|
28
|
+
*
|
|
29
|
+
* @param options - The options for enrolling the passkey.
|
|
30
|
+
* @param options.name - An optional human-friendly name for the passkey.
|
|
31
|
+
* @param options.idempotencyKey - Optional idempotency key for safe retries.
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* if (await isPasskeySupported()) {
|
|
35
|
+
* const { user } = await enrollPasskey({ name: "MacBook Pro" });
|
|
36
|
+
* console.log("Passkey enrolled for user:", user.userId);
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
* @returns The result containing the updated user.
|
|
40
|
+
* @throws {MfaError} With code `PASSKEY_NOT_SUPPORTED` when passkeys are not available in the current environment.
|
|
41
|
+
* @throws {MfaError} With code `CANCELLED` when the user dismisses the passkey prompt or it times out.
|
|
42
|
+
* @throws {MfaError} With code `PASSKEY_ALREADY_ENROLLED` when this device already holds a passkey for the account.
|
|
43
|
+
*/
|
|
44
|
+
export declare const enrollPasskey: (options?: EnrollPasskeyOptions) => Promise<EnrollPasskeyResult>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PasskeySummary } from '@coinbase/cdp-api-client';
|
|
2
|
+
/**
|
|
3
|
+
* Lists the passkey (WebAuthn) credentials enrolled by the current end user.
|
|
4
|
+
*
|
|
5
|
+
* Never returns the COSE public key or any other sensitive credential material.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const passkeys = await listPasskeys();
|
|
10
|
+
* for (const passkey of passkeys) {
|
|
11
|
+
* console.log(passkey.name, passkey.credentialId, passkey.enrolledAt);
|
|
12
|
+
* }
|
|
13
|
+
* ```
|
|
14
|
+
* @returns A promise resolving to the list of enrolled passkey summaries.
|
|
15
|
+
*/
|
|
16
|
+
export declare const listPasskeys: () => Promise<PasskeySummary[]>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for verifying a passkey (WebAuthn).
|
|
3
|
+
*/
|
|
4
|
+
export type VerifyPasskeyOptions = {
|
|
5
|
+
/** Optional idempotency key for safe retries. */
|
|
6
|
+
idempotencyKey?: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Completes an MFA verification using an enrolled passkey (WebAuthn).
|
|
10
|
+
*
|
|
11
|
+
* This runs the full WebAuthn authentication ceremony in one call: it initiates
|
|
12
|
+
* verification with the server to obtain credential request options, prompts the
|
|
13
|
+
* browser for an assertion via `navigator.credentials.get()`, and submits the
|
|
14
|
+
* resulting assertion to the server. After successful verification, any pending
|
|
15
|
+
* operation that was waiting for MFA will automatically continue.
|
|
16
|
+
*
|
|
17
|
+
* Passkey MFA is supported in web environments only. Call `isPasskeySupported`
|
|
18
|
+
* first to check availability before offering passkey verification in your UI.
|
|
19
|
+
*
|
|
20
|
+
* @param options - The options for the verification.
|
|
21
|
+
* @param options.idempotencyKey - Optional idempotency key for safe retries.
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* await verifyPasskey();
|
|
25
|
+
* ```
|
|
26
|
+
* @returns A promise that resolves if passkey verification is successful.
|
|
27
|
+
* @throws {MfaError} With code `PASSKEY_NOT_SUPPORTED` when passkeys are not available in the current environment.
|
|
28
|
+
* @throws {MfaError} With code `CANCELLED` when the user dismisses the passkey prompt or it times out.
|
|
29
|
+
*/
|
|
30
|
+
export declare const verifyPasskey: (options?: VerifyPasskeyOptions) => Promise<void>;
|
|
@@ -16,8 +16,12 @@ export declare class AuthManager implements IAuthManager {
|
|
|
16
16
|
* Initializes the token manager.
|
|
17
17
|
*
|
|
18
18
|
* @param projectId - The project ID.
|
|
19
|
+
* @param options - Options that control initial session refresh behavior.
|
|
20
|
+
* @param options.deferInitialization - Whether to defer the initial session refresh until ensureInitialized is called.
|
|
19
21
|
*/
|
|
20
|
-
constructor(projectId: string
|
|
22
|
+
constructor(projectId: string, options?: {
|
|
23
|
+
deferInitialization?: boolean;
|
|
24
|
+
});
|
|
21
25
|
/**
|
|
22
26
|
* Gets the current user, or null if there is no user signed in.
|
|
23
27
|
*
|
|
@@ -98,7 +102,7 @@ export declare class AuthManager implements IAuthManager {
|
|
|
98
102
|
clearAuthState(): Promise<void>;
|
|
99
103
|
/**
|
|
100
104
|
* Ensures the AuthManager is initialized before proceeding.
|
|
101
|
-
*
|
|
105
|
+
* Starts deferred initialization when necessary, otherwise waits for initialization already in progress.
|
|
102
106
|
*/
|
|
103
107
|
ensureInitialized(): Promise<void>;
|
|
104
108
|
/**
|
|
@@ -6,6 +6,10 @@ import { IAuthManager } from './types.js';
|
|
|
6
6
|
* - Otherwise, returns an AuthManager for standard CDP authentication
|
|
7
7
|
*
|
|
8
8
|
* @param projectId - The project ID.
|
|
9
|
+
* @param options - Options that control initial session refresh behavior.
|
|
10
|
+
* @param options.deferInitialization - Whether to defer the initial session refresh until ensureInitialized is called.
|
|
9
11
|
* @returns The appropriate AuthManager instance.
|
|
10
12
|
*/
|
|
11
|
-
export declare function createAuthManager(projectId: string
|
|
13
|
+
export declare function createAuthManager(projectId: string, options?: {
|
|
14
|
+
deferInitialization?: boolean;
|
|
15
|
+
}): IAuthManager;
|
|
@@ -63,7 +63,11 @@ export type MfaErrorCode =
|
|
|
63
63
|
/** No MFA listener is registered to handle verification. */
|
|
64
64
|
| "LISTENER_REQUIRED"
|
|
65
65
|
/** MFA listeners are registered but none matched the trigger value. */
|
|
66
|
-
| "NO_LISTENER_MATCHED"
|
|
66
|
+
| "NO_LISTENER_MATCHED"
|
|
67
|
+
/** Passkeys (WebAuthn) are not supported in the current environment. */
|
|
68
|
+
| "PASSKEY_NOT_SUPPORTED"
|
|
69
|
+
/** This device already holds a passkey for this account, so it cannot enroll another. */
|
|
70
|
+
| "PASSKEY_ALREADY_ENROLLED";
|
|
67
71
|
/**
|
|
68
72
|
* Error thrown when an MFA operation fails.
|
|
69
73
|
*/
|
|
@@ -77,8 +81,12 @@ export declare class MfaError extends Error {
|
|
|
77
81
|
*
|
|
78
82
|
* @param code - The error code identifying the type of MFA error.
|
|
79
83
|
* @param message - The error message.
|
|
84
|
+
* @param options - Additional error options.
|
|
85
|
+
* @param options.cause - The underlying error this one was mapped from, when there is one.
|
|
80
86
|
*/
|
|
81
|
-
constructor(code: MfaErrorCode, message: string
|
|
87
|
+
constructor(code: MfaErrorCode, message: string, options?: {
|
|
88
|
+
cause?: unknown;
|
|
89
|
+
});
|
|
82
90
|
}
|
|
83
91
|
/**
|
|
84
92
|
* Error codes for swap-related errors returned by the backend.
|
|
@@ -49,6 +49,10 @@ export { submitMfaEnrollment, type SubmitMfaEnrollmentOptions, type SubmitMfaEnr
|
|
|
49
49
|
export { initiateMfaVerification } from './actions/initiateMfaVerification.js';
|
|
50
50
|
export { submitMfaVerification, type SubmitMfaVerificationOptions, } from './actions/submitMfaVerification.js';
|
|
51
51
|
export { cancelMfaVerification } from './actions/cancelMfaVerification.js';
|
|
52
|
+
export { enrollPasskey, type EnrollPasskeyOptions, type EnrollPasskeyResult, } from './actions/enrollPasskey.js';
|
|
53
|
+
export { verifyPasskey, type VerifyPasskeyOptions } from './actions/verifyPasskey.js';
|
|
54
|
+
export { listPasskeys } from './actions/listPasskeys.js';
|
|
55
|
+
export { deletePasskey } from './actions/deletePasskey.js';
|
|
52
56
|
export { getEnabledMfaMethods, getEnrolledMfaMethods, isEnrolledInMfa, isMfaProtectedAction, isMfaRequired, MFA_PROTECTED_ACTIONS, MFA_PROTECTED_FUNCTIONS, type MfaProtectedAction, type MfaListener, type MfaVerificationContext, } from './mfa/index.js';
|
|
53
57
|
export { registerMfaListener, type MfaListenerOptions } from './mfa/state.web.js';
|
|
54
58
|
export * from './auth/authManager.js';
|
|
@@ -66,3 +70,4 @@ export * from './secureIframe/index.js';
|
|
|
66
70
|
export { createEvmKeyExportIframe, createSolanaKeyExportIframe, type CreateKeyExportIframeOptions, type CreateKeyExportIframeResult, type SecureIframeStatusDetails, } from './actions/createKeyExportIframe.js';
|
|
67
71
|
export { getConfig } from './state.js';
|
|
68
72
|
export { toTransactionSigner } from './solana-kit/toTransactionSigner.js';
|
|
73
|
+
export { isPasskeySupported } from './shared/webauthn.js';
|
|
@@ -3,13 +3,13 @@ import { User, MfaMethod } from '../types.js';
|
|
|
3
3
|
* Gets the list of MFA methods that the user has enrolled in.
|
|
4
4
|
*
|
|
5
5
|
* @param user - The user object.
|
|
6
|
-
* @returns An array of enrolled MFA methods
|
|
6
|
+
* @returns An array of enrolled MFA methods, any of 'totp', 'sms', and 'passkey'.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```typescript
|
|
10
10
|
* const user = await getCurrentUser();
|
|
11
11
|
* const methods = getEnrolledMfaMethods(user);
|
|
12
|
-
* // methods = ['totp', '
|
|
12
|
+
* // methods = ['totp', 'passkey']
|
|
13
13
|
*
|
|
14
14
|
* if (methods.length > 1) {
|
|
15
15
|
* // Prompt user to choose which method to use
|
|
@@ -56,7 +56,7 @@ export declare function isEnrolledInMfa(user: User, method?: MfaMethod): boolean
|
|
|
56
56
|
* const config = getMfaConfigState();
|
|
57
57
|
* if (config) {
|
|
58
58
|
* const methods = getEnabledMfaMethods(config);
|
|
59
|
-
* // methods = ['totp', '
|
|
59
|
+
* // methods = ['totp', 'passkey']
|
|
60
60
|
* }
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encodes binary data to a URL-safe base64 string (base64url), with no padding.
|
|
3
|
+
*
|
|
4
|
+
* URL-safe base64 replaces the standard `+` and `/` characters with `-` and `_`
|
|
5
|
+
* respectively, and omits the `=` padding. This is the encoding WebAuthn uses for
|
|
6
|
+
* binary fields (challenge, credential IDs, etc.) when serialized to JSON.
|
|
7
|
+
*
|
|
8
|
+
* @param data - The binary data to encode, as an ArrayBuffer or Uint8Array.
|
|
9
|
+
* @returns The base64url-encoded string (no padding).
|
|
10
|
+
*/
|
|
11
|
+
export declare function encodeBase64url(data: ArrayBuffer | Uint8Array): string;
|
|
12
|
+
/**
|
|
13
|
+
* Decodes a URL-safe base64 string (base64url) to binary data.
|
|
14
|
+
*
|
|
15
|
+
* Accepts input with or without padding, and tolerates the standard base64
|
|
16
|
+
* alphabet as well. Reverses {@link encodeBase64url}.
|
|
17
|
+
*
|
|
18
|
+
* @param base64url - The base64url-encoded string to decode.
|
|
19
|
+
* @returns The decoded bytes as a Uint8Array.
|
|
20
|
+
*/
|
|
21
|
+
export declare function decodeBase64url(base64url: string): Uint8Array;
|