@cavos/kit 0.0.2 → 0.0.3
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/{Cavos-C2KHZxxu.d.mts → Cavos-BH2_tOQ2.d.mts} +409 -5
- package/dist/{Cavos-C2KHZxxu.d.ts → Cavos-BH2_tOQ2.d.ts} +409 -5
- package/dist/{chunk-PEUQQZB5.mjs → chunk-BNGLH3Q3.mjs} +1122 -17
- package/dist/chunk-BNGLH3Q3.mjs.map +1 -0
- package/dist/index.d.mts +125 -5
- package/dist/index.d.ts +125 -5
- package/dist/index.js +1223 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +88 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.d.mts +25 -1
- package/dist/react/index.d.ts +25 -1
- package/dist/react/index.js +1072 -8
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +21 -1
- package/dist/react/index.mjs.map +1 -1
- package/package.json +3 -1
- package/dist/chunk-PEUQQZB5.mjs.map +0 -1
package/dist/react/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CavosAuth, HttpRecoveryClient, Cavos, generateRecoveryCode, CavosSolana } from '../chunk-
|
|
1
|
+
import { CavosAuth, HttpRecoveryClient, Cavos, generateRecoveryCode, CavosSolana } from '../chunk-BNGLH3Q3.mjs';
|
|
2
2
|
import { createContext, useState, useRef, useEffect, useCallback, useContext } from 'react';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
|
|
@@ -895,6 +895,24 @@ function CavosProvider({ config, modal, children }) {
|
|
|
895
895
|
},
|
|
896
896
|
[cavos]
|
|
897
897
|
);
|
|
898
|
+
const enrollPasskey = useCallback(
|
|
899
|
+
async (passkey, params) => {
|
|
900
|
+
if (!cavos) throw new Error("Not logged in");
|
|
901
|
+
return cavos.enrollPasskey(passkey, params);
|
|
902
|
+
},
|
|
903
|
+
[cavos]
|
|
904
|
+
);
|
|
905
|
+
const approveThisDeviceWithPasskey = useCallback(
|
|
906
|
+
async (passkey, submit) => {
|
|
907
|
+
if (!cavos) throw new Error("Not logged in");
|
|
908
|
+
if (cavos.chain === "starknet") {
|
|
909
|
+
return cavos.approveThisDeviceWithPasskey({ passkey, ...submit ? { submit } : {} });
|
|
910
|
+
}
|
|
911
|
+
const transactionHash = await cavos.approveThisDeviceWithPasskey(passkey);
|
|
912
|
+
return { transactionHash };
|
|
913
|
+
},
|
|
914
|
+
[cavos]
|
|
915
|
+
);
|
|
898
916
|
const setupRecovery = useCallback(async () => {
|
|
899
917
|
if (!cavos) throw new Error("Not logged in");
|
|
900
918
|
const code = generateRecoveryCode();
|
|
@@ -987,6 +1005,8 @@ function CavosProvider({ config, modal, children }) {
|
|
|
987
1005
|
handleCallback,
|
|
988
1006
|
execute,
|
|
989
1007
|
addSigner,
|
|
1008
|
+
enrollPasskey,
|
|
1009
|
+
approveThisDeviceWithPasskey,
|
|
990
1010
|
resendDeviceApproval,
|
|
991
1011
|
setupRecovery,
|
|
992
1012
|
recover,
|