@dubsdotapp/expo 0.2.7 → 0.2.8

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 CHANGED
@@ -625,6 +625,7 @@ interface CreateCustomGameMutationResult {
625
625
  gameAddress: string;
626
626
  signature: string;
627
627
  explorerUrl: string;
628
+ buyIn: number;
628
629
  }
629
630
  declare function useCreateCustomGame(): {
630
631
  execute: (params: CreateCustomGameParams) => Promise<CreateCustomGameMutationResult>;
@@ -788,10 +789,11 @@ interface CreateCustomGameSheetProps {
788
789
  presetAmounts?: number[];
789
790
  defaultAmount?: number;
790
791
  metadata?: Record<string, unknown>;
792
+ onAmountChange?: (amount: number | null) => void;
791
793
  onSuccess?: (result: CreateCustomGameMutationResult) => void;
792
794
  onError?: (error: Error) => void;
793
795
  }
794
- declare function CreateCustomGameSheet({ visible, onDismiss, title, maxPlayers, fee, presetAmounts, defaultAmount, metadata, onSuccess, onError, }: CreateCustomGameSheetProps): react_jsx_runtime.JSX.Element;
796
+ declare function CreateCustomGameSheet({ visible, onDismiss, title, maxPlayers, fee, presetAmounts, defaultAmount, metadata, onAmountChange, onSuccess, onError, }: CreateCustomGameSheetProps): react_jsx_runtime.JSX.Element;
795
797
 
796
798
  /**
797
799
  * Deserialize a base64-encoded transaction, sign via wallet adapter, send to Solana.
package/dist/index.d.ts CHANGED
@@ -625,6 +625,7 @@ interface CreateCustomGameMutationResult {
625
625
  gameAddress: string;
626
626
  signature: string;
627
627
  explorerUrl: string;
628
+ buyIn: number;
628
629
  }
629
630
  declare function useCreateCustomGame(): {
630
631
  execute: (params: CreateCustomGameParams) => Promise<CreateCustomGameMutationResult>;
@@ -788,10 +789,11 @@ interface CreateCustomGameSheetProps {
788
789
  presetAmounts?: number[];
789
790
  defaultAmount?: number;
790
791
  metadata?: Record<string, unknown>;
792
+ onAmountChange?: (amount: number | null) => void;
791
793
  onSuccess?: (result: CreateCustomGameMutationResult) => void;
792
794
  onError?: (error: Error) => void;
793
795
  }
794
- declare function CreateCustomGameSheet({ visible, onDismiss, title, maxPlayers, fee, presetAmounts, defaultAmount, metadata, onSuccess, onError, }: CreateCustomGameSheetProps): react_jsx_runtime.JSX.Element;
796
+ declare function CreateCustomGameSheet({ visible, onDismiss, title, maxPlayers, fee, presetAmounts, defaultAmount, metadata, onAmountChange, onSuccess, onError, }: CreateCustomGameSheetProps): react_jsx_runtime.JSX.Element;
795
797
 
796
798
  /**
797
799
  * Deserialize a base64-encoded transaction, sign via wallet adapter, send to Solana.
package/dist/index.js CHANGED
@@ -1279,7 +1279,8 @@ function useCreateCustomGame() {
1279
1279
  gameId: createResult.gameId,
1280
1280
  gameAddress: createResult.gameAddress,
1281
1281
  signature,
1282
- explorerUrl
1282
+ explorerUrl,
1283
+ buyIn: params.wagerAmount
1283
1284
  };
1284
1285
  setData(result);
1285
1286
  setStatus("success");
@@ -2807,6 +2808,7 @@ function CreateCustomGameSheet({
2807
2808
  presetAmounts = [0.01, 0.1, 0.5, 1],
2808
2809
  defaultAmount = 0.01,
2809
2810
  metadata,
2811
+ onAmountChange,
2810
2812
  onSuccess,
2811
2813
  onError
2812
2814
  }) {
@@ -2850,17 +2852,21 @@ function CreateCustomGameSheet({
2850
2852
  setSelectedAmount(amount);
2851
2853
  setIsCustom(false);
2852
2854
  setCustomAmount("");
2853
- }, []);
2855
+ onAmountChange?.(amount);
2856
+ }, [onAmountChange]);
2854
2857
  const handleCustomSelect = (0, import_react20.useCallback)(() => {
2855
2858
  setIsCustom(true);
2856
2859
  setSelectedAmount(null);
2857
- }, []);
2860
+ onAmountChange?.(null);
2861
+ }, [onAmountChange]);
2858
2862
  const handleCustomAmountChange = (0, import_react20.useCallback)((text) => {
2859
2863
  const cleaned = text.replace(/[^0-9.]/g, "").replace(/(\..*?)\..*/g, "$1");
2860
2864
  setCustomAmount(cleaned);
2861
2865
  const parsed = parseFloat(cleaned);
2862
- setSelectedAmount(parsed > 0 ? parsed : null);
2863
- }, []);
2866
+ const amount = parsed > 0 ? parsed : null;
2867
+ setSelectedAmount(amount);
2868
+ onAmountChange?.(amount);
2869
+ }, [onAmountChange]);
2864
2870
  const effectiveAmount = selectedAmount;
2865
2871
  const playerCount = maxPlayers || 2;
2866
2872
  const pot = effectiveAmount ? effectiveAmount * playerCount : 0;