@frak-labs/react-sdk 0.1.1-beta.d96bc28d → 0.1.1-beta.df5fa6b3
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 +25 -0
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/package.json +3 -3
- package/src/hook/useDisplayModal.ts +1 -1
- package/src/hook/useGetMerchantInformation.ts +6 -2
- package/src/hook/useOpenSso.ts +1 -1
- package/src/hook/useSendTransaction.ts +1 -1
- package/src/hook/useSiweAuthenticate.ts +2 -2
package/README.md
CHANGED
|
@@ -6,3 +6,28 @@ Checkout our documentation for more information's about the usage:
|
|
|
6
6
|
- [React client usage](https://docs.frak.id/wallet-sdk/getting-started/react)
|
|
7
7
|
- [Core client usage](https://docs.frak.id/wallet-sdk/getting-started/javascript)
|
|
8
8
|
- [CDN / Browser usage](https://docs.frak.id/wallet-sdk/getting-started/cdn)
|
|
9
|
+
|
|
10
|
+
## Hooks
|
|
11
|
+
|
|
12
|
+
| Hook | Purpose |
|
|
13
|
+
|------|---------|
|
|
14
|
+
| `useWalletStatus` | Watch wallet connection state and account information |
|
|
15
|
+
| `useDisplayModal` | Trigger SDK modal display for user interactions |
|
|
16
|
+
| `useSiweAuthenticate` | SIWE (Sign-In with Ethereum) authentication flow |
|
|
17
|
+
| `useOpenSso` | Open SSO authentication flow |
|
|
18
|
+
| `usePrepareSso` | Prepare SSO data before opening authentication |
|
|
19
|
+
| `useSendTransactionAction` | Send blockchain transaction actions |
|
|
20
|
+
| `useGetMerchantInformation` | Query merchant info and available rewards |
|
|
21
|
+
| `useReferralInteraction` | Auto-submit referral interactions |
|
|
22
|
+
| `useFrakClient` | Access the FrakClient instance |
|
|
23
|
+
| `useFrakConfig` | Access SDK configuration |
|
|
24
|
+
|
|
25
|
+
## Providers
|
|
26
|
+
|
|
27
|
+
Wrap your application root with these providers:
|
|
28
|
+
|
|
29
|
+
- **`FrakConfigProvider`** — SDK configuration context. Required at app root.
|
|
30
|
+
- **`FrakIFrameClientProvider`** — Iframe client context for SDK communication.
|
|
31
|
+
|
|
32
|
+
Both providers export TypeScript types: `FrakConfigProviderProps`, `FrakIFrameClientProps`.
|
|
33
|
+
|
package/dist/index.d.cts
CHANGED
|
@@ -46,7 +46,7 @@ interface UseDisplayModalParams<T extends ModalStepTypes[] = ModalStepTypes[]> {
|
|
|
46
46
|
*
|
|
47
47
|
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.displayModal | `displayModal()`} action
|
|
48
48
|
*
|
|
49
|
-
* @param args
|
|
49
|
+
* @param args - Optional config object with `mutations` for customizing the underlying {@link @tanstack/react-query!useMutation | `useMutation()`}
|
|
50
50
|
*
|
|
51
51
|
* @typeParam T
|
|
52
52
|
* The modal steps types to display (the result will correspond to the steps types asked in params)
|
|
@@ -88,7 +88,7 @@ declare function useFrakConfig(): _frak_labs_core_sdk0.FrakWalletSdkConfig;
|
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region src/hook/useGetMerchantInformation.d.ts
|
|
90
90
|
/** @ignore */
|
|
91
|
-
type QueryOptions = Omit<UseQueryOptions<GetMerchantInformationReturnType, FrakRpcError,
|
|
91
|
+
type QueryOptions = Omit<UseQueryOptions<GetMerchantInformationReturnType, FrakRpcError, GetMerchantInformationReturnType>, "queryKey" | "queryFn">;
|
|
92
92
|
/** @inline */
|
|
93
93
|
interface UseGetMerchantInformationParams {
|
|
94
94
|
/**
|
|
@@ -101,7 +101,7 @@ interface UseGetMerchantInformationParams {
|
|
|
101
101
|
*
|
|
102
102
|
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} action
|
|
103
103
|
*
|
|
104
|
-
* @param args
|
|
104
|
+
* @param args - Optional config object with `query` for customizing the underlying {@link @tanstack/react-query!useQuery | `useQuery()`}
|
|
105
105
|
*
|
|
106
106
|
* @group hooks
|
|
107
107
|
*
|
|
@@ -114,7 +114,7 @@ interface UseGetMerchantInformationParams {
|
|
|
114
114
|
*/
|
|
115
115
|
declare function useGetMerchantInformation({
|
|
116
116
|
query
|
|
117
|
-
}?: UseGetMerchantInformationParams): _tanstack_react_query0.UseQueryResult<
|
|
117
|
+
}?: UseGetMerchantInformationParams): _tanstack_react_query0.UseQueryResult<GetMerchantInformationReturnType, FrakRpcError<undefined>>;
|
|
118
118
|
//#endregion
|
|
119
119
|
//#region src/hook/useOpenSso.d.ts
|
|
120
120
|
/** @ignore */
|
|
@@ -131,7 +131,7 @@ interface UseOpenSsoParams {
|
|
|
131
131
|
*
|
|
132
132
|
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.openSso | `openSso()`} action
|
|
133
133
|
*
|
|
134
|
-
* @param args
|
|
134
|
+
* @param args - Optional config object with `mutations` for customizing the underlying {@link @tanstack/react-query!useMutation | `useMutation()`}
|
|
135
135
|
*
|
|
136
136
|
* @group hooks
|
|
137
137
|
*
|
|
@@ -201,7 +201,7 @@ interface UseSendTransactionParams {
|
|
|
201
201
|
*
|
|
202
202
|
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.sendTransaction | `sendTransaction()`} action
|
|
203
203
|
*
|
|
204
|
-
* @param args
|
|
204
|
+
* @param args - Optional config object with `mutations` for customizing the underlying {@link @tanstack/react-query!useMutation | `useMutation()`}
|
|
205
205
|
*
|
|
206
206
|
* @group hooks
|
|
207
207
|
*
|
|
@@ -230,9 +230,9 @@ interface UseSiweAuthenticateParams {
|
|
|
230
230
|
/**
|
|
231
231
|
* Hook that return a mutation helping to send perform a SIWE authentication
|
|
232
232
|
*
|
|
233
|
-
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.
|
|
233
|
+
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.siweAuthenticate | `siweAuthenticate()`} action
|
|
234
234
|
*
|
|
235
|
-
* @param args
|
|
235
|
+
* @param args - Optional config object with `mutations` for customizing the underlying {@link @tanstack/react-query!useMutation | `useMutation()`}
|
|
236
236
|
*
|
|
237
237
|
* @group hooks
|
|
238
238
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ interface UseDisplayModalParams<T extends ModalStepTypes[] = ModalStepTypes[]> {
|
|
|
46
46
|
*
|
|
47
47
|
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.displayModal | `displayModal()`} action
|
|
48
48
|
*
|
|
49
|
-
* @param args
|
|
49
|
+
* @param args - Optional config object with `mutations` for customizing the underlying {@link @tanstack/react-query!useMutation | `useMutation()`}
|
|
50
50
|
*
|
|
51
51
|
* @typeParam T
|
|
52
52
|
* The modal steps types to display (the result will correspond to the steps types asked in params)
|
|
@@ -88,7 +88,7 @@ declare function useFrakConfig(): _frak_labs_core_sdk0.FrakWalletSdkConfig;
|
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region src/hook/useGetMerchantInformation.d.ts
|
|
90
90
|
/** @ignore */
|
|
91
|
-
type QueryOptions = Omit<UseQueryOptions<GetMerchantInformationReturnType, FrakRpcError,
|
|
91
|
+
type QueryOptions = Omit<UseQueryOptions<GetMerchantInformationReturnType, FrakRpcError, GetMerchantInformationReturnType>, "queryKey" | "queryFn">;
|
|
92
92
|
/** @inline */
|
|
93
93
|
interface UseGetMerchantInformationParams {
|
|
94
94
|
/**
|
|
@@ -101,7 +101,7 @@ interface UseGetMerchantInformationParams {
|
|
|
101
101
|
*
|
|
102
102
|
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} action
|
|
103
103
|
*
|
|
104
|
-
* @param args
|
|
104
|
+
* @param args - Optional config object with `query` for customizing the underlying {@link @tanstack/react-query!useQuery | `useQuery()`}
|
|
105
105
|
*
|
|
106
106
|
* @group hooks
|
|
107
107
|
*
|
|
@@ -114,7 +114,7 @@ interface UseGetMerchantInformationParams {
|
|
|
114
114
|
*/
|
|
115
115
|
declare function useGetMerchantInformation({
|
|
116
116
|
query
|
|
117
|
-
}?: UseGetMerchantInformationParams): _tanstack_react_query0.UseQueryResult<
|
|
117
|
+
}?: UseGetMerchantInformationParams): _tanstack_react_query0.UseQueryResult<GetMerchantInformationReturnType, FrakRpcError<undefined>>;
|
|
118
118
|
//#endregion
|
|
119
119
|
//#region src/hook/useOpenSso.d.ts
|
|
120
120
|
/** @ignore */
|
|
@@ -131,7 +131,7 @@ interface UseOpenSsoParams {
|
|
|
131
131
|
*
|
|
132
132
|
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.openSso | `openSso()`} action
|
|
133
133
|
*
|
|
134
|
-
* @param args
|
|
134
|
+
* @param args - Optional config object with `mutations` for customizing the underlying {@link @tanstack/react-query!useMutation | `useMutation()`}
|
|
135
135
|
*
|
|
136
136
|
* @group hooks
|
|
137
137
|
*
|
|
@@ -201,7 +201,7 @@ interface UseSendTransactionParams {
|
|
|
201
201
|
*
|
|
202
202
|
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.sendTransaction | `sendTransaction()`} action
|
|
203
203
|
*
|
|
204
|
-
* @param args
|
|
204
|
+
* @param args - Optional config object with `mutations` for customizing the underlying {@link @tanstack/react-query!useMutation | `useMutation()`}
|
|
205
205
|
*
|
|
206
206
|
* @group hooks
|
|
207
207
|
*
|
|
@@ -230,9 +230,9 @@ interface UseSiweAuthenticateParams {
|
|
|
230
230
|
/**
|
|
231
231
|
* Hook that return a mutation helping to send perform a SIWE authentication
|
|
232
232
|
*
|
|
233
|
-
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.
|
|
233
|
+
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.siweAuthenticate | `siweAuthenticate()`} action
|
|
234
234
|
*
|
|
235
|
-
* @param args
|
|
235
|
+
* @param args - Optional config object with `mutations` for customizing the underlying {@link @tanstack/react-query!useMutation | `useMutation()`}
|
|
236
236
|
*
|
|
237
237
|
* @group hooks
|
|
238
238
|
*
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "0.1.1-beta.
|
|
14
|
+
"version": "0.1.1-beta.df5fa6b3",
|
|
15
15
|
"description": "React SDK of the Frak wallet, low level library to interact directly with the frak ecosystem.",
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/frak-id/wallet",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"publish": "echo 'Publishing react...'"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@frak-labs/frame-connector": "0.1.0-beta.
|
|
71
|
-
"@frak-labs/core-sdk": "0.1.1-beta.
|
|
70
|
+
"@frak-labs/frame-connector": "0.1.0-beta.df5fa6b3",
|
|
71
|
+
"@frak-labs/core-sdk": "0.1.1-beta.df5fa6b3"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
74
|
"viem": "^2.x",
|
|
@@ -31,7 +31,7 @@ interface UseDisplayModalParams<T extends ModalStepTypes[] = ModalStepTypes[]> {
|
|
|
31
31
|
*
|
|
32
32
|
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.displayModal | `displayModal()`} action
|
|
33
33
|
*
|
|
34
|
-
* @param args
|
|
34
|
+
* @param args - Optional config object with `mutations` for customizing the underlying {@link @tanstack/react-query!useMutation | `useMutation()`}
|
|
35
35
|
*
|
|
36
36
|
* @typeParam T
|
|
37
37
|
* The modal steps types to display (the result will correspond to the steps types asked in params)
|
|
@@ -6,7 +6,11 @@ import { useFrakClient } from "./useFrakClient";
|
|
|
6
6
|
|
|
7
7
|
/** @ignore */
|
|
8
8
|
type QueryOptions = Omit<
|
|
9
|
-
UseQueryOptions<
|
|
9
|
+
UseQueryOptions<
|
|
10
|
+
GetMerchantInformationReturnType,
|
|
11
|
+
FrakRpcError,
|
|
12
|
+
GetMerchantInformationReturnType
|
|
13
|
+
>,
|
|
10
14
|
"queryKey" | "queryFn"
|
|
11
15
|
>;
|
|
12
16
|
|
|
@@ -23,7 +27,7 @@ interface UseGetMerchantInformationParams {
|
|
|
23
27
|
*
|
|
24
28
|
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} action
|
|
25
29
|
*
|
|
26
|
-
* @param args
|
|
30
|
+
* @param args - Optional config object with `query` for customizing the underlying {@link @tanstack/react-query!useQuery | `useQuery()`}
|
|
27
31
|
*
|
|
28
32
|
* @group hooks
|
|
29
33
|
*
|
package/src/hook/useOpenSso.ts
CHANGED
|
@@ -23,7 +23,7 @@ interface UseOpenSsoParams {
|
|
|
23
23
|
*
|
|
24
24
|
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.openSso | `openSso()`} action
|
|
25
25
|
*
|
|
26
|
-
* @param args
|
|
26
|
+
* @param args - Optional config object with `mutations` for customizing the underlying {@link @tanstack/react-query!useMutation | `useMutation()`}
|
|
27
27
|
*
|
|
28
28
|
* @group hooks
|
|
29
29
|
*
|
|
@@ -30,7 +30,7 @@ interface UseSendTransactionParams {
|
|
|
30
30
|
*
|
|
31
31
|
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.sendTransaction | `sendTransaction()`} action
|
|
32
32
|
*
|
|
33
|
-
* @param args
|
|
33
|
+
* @param args - Optional config object with `mutations` for customizing the underlying {@link @tanstack/react-query!useMutation | `useMutation()`}
|
|
34
34
|
*
|
|
35
35
|
* @group hooks
|
|
36
36
|
*
|
|
@@ -28,9 +28,9 @@ interface UseSiweAuthenticateParams {
|
|
|
28
28
|
/**
|
|
29
29
|
* Hook that return a mutation helping to send perform a SIWE authentication
|
|
30
30
|
*
|
|
31
|
-
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.
|
|
31
|
+
* It's a {@link @tanstack/react-query!home | `tanstack`} wrapper around the {@link @frak-labs/core-sdk!actions.siweAuthenticate | `siweAuthenticate()`} action
|
|
32
32
|
*
|
|
33
|
-
* @param args
|
|
33
|
+
* @param args - Optional config object with `mutations` for customizing the underlying {@link @tanstack/react-query!useMutation | `useMutation()`}
|
|
34
34
|
*
|
|
35
35
|
* @group hooks
|
|
36
36
|
*
|