@dubsdotapp/expo 0.5.31 → 0.5.32
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/index.d.mts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -0
package/dist/index.mjs
CHANGED
|
@@ -3271,6 +3271,32 @@ function useEnterJackpot() {
|
|
|
3271
3271
|
|
|
3272
3272
|
// src/hooks/useCredits.ts
|
|
3273
3273
|
import { useState as useState26, useEffect as useEffect17, useCallback as useCallback24 } from "react";
|
|
3274
|
+
function useCredits() {
|
|
3275
|
+
const { client } = useDubs();
|
|
3276
|
+
const [credits, setCredits] = useState26([]);
|
|
3277
|
+
const [totalLamports, setTotalLamports] = useState26(0);
|
|
3278
|
+
const [totalSOL, setTotalSOL] = useState26(0);
|
|
3279
|
+
const [loading, setLoading] = useState26(false);
|
|
3280
|
+
const [error, setError] = useState26(null);
|
|
3281
|
+
const fetch2 = useCallback24(async () => {
|
|
3282
|
+
setLoading(true);
|
|
3283
|
+
setError(null);
|
|
3284
|
+
try {
|
|
3285
|
+
const result = await client.getCredits();
|
|
3286
|
+
setCredits(result.credits);
|
|
3287
|
+
setTotalLamports(result.totalLamports);
|
|
3288
|
+
setTotalSOL(result.totalSOL);
|
|
3289
|
+
} catch (err) {
|
|
3290
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
3291
|
+
} finally {
|
|
3292
|
+
setLoading(false);
|
|
3293
|
+
}
|
|
3294
|
+
}, [client]);
|
|
3295
|
+
useEffect17(() => {
|
|
3296
|
+
fetch2();
|
|
3297
|
+
}, [fetch2]);
|
|
3298
|
+
return { credits, totalLamports, totalSOL, loading, error, refetch: fetch2 };
|
|
3299
|
+
}
|
|
3274
3300
|
|
|
3275
3301
|
// src/ui/AvatarEditor.tsx
|
|
3276
3302
|
import {
|
|
@@ -9400,6 +9426,7 @@ export {
|
|
|
9400
9426
|
useConversations,
|
|
9401
9427
|
useCreateCustomGame,
|
|
9402
9428
|
useCreateGame,
|
|
9429
|
+
useCredits,
|
|
9403
9430
|
useDirectMessages,
|
|
9404
9431
|
useDubs,
|
|
9405
9432
|
useDubsTheme,
|