@b3dotfun/sdk 0.0.70-alpha.0 → 0.0.70-alpha.1

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.
Files changed (123) hide show
  1. package/dist/cjs/anyspend/index.d.ts +1 -0
  2. package/dist/cjs/anyspend/index.js +1 -0
  3. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +6 -0
  4. package/dist/cjs/anyspend/react/components/AnySpend.js +13 -1
  5. package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +3 -1
  6. package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -2
  7. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
  8. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -2
  9. package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +1 -0
  10. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +6 -2
  11. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -0
  12. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +3 -1
  13. package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
  14. package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.js +2 -2
  15. package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +2 -1
  16. package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
  17. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
  18. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -2
  19. package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
  20. package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
  21. package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.d.ts +2 -1
  22. package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.js +2 -2
  23. package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
  24. package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
  25. package/dist/cjs/anyspend/react/components/AnySpendTournament.d.ts +2 -0
  26. package/dist/cjs/anyspend/react/components/AnySpendTournament.js +1 -1
  27. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
  28. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
  29. package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
  30. package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +2 -2
  31. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +2 -1
  32. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +1 -0
  33. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +2 -1
  34. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +16 -0
  35. package/dist/cjs/anyspend/services/anyspend.d.ts +2 -1
  36. package/dist/cjs/anyspend/services/anyspend.js +2 -1
  37. package/dist/cjs/anyspend/types/api.d.ts +295 -0
  38. package/dist/cjs/anyspend/utils/validation.d.ts +67 -0
  39. package/dist/cjs/anyspend/utils/validation.js +157 -0
  40. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +4 -0
  41. package/dist/esm/anyspend/index.d.ts +1 -0
  42. package/dist/esm/anyspend/index.js +1 -0
  43. package/dist/esm/anyspend/react/components/AnySpend.d.ts +6 -0
  44. package/dist/esm/anyspend/react/components/AnySpend.js +13 -1
  45. package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +3 -1
  46. package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -2
  47. package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
  48. package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -2
  49. package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +1 -0
  50. package/dist/esm/anyspend/react/components/AnySpendCustom.js +6 -2
  51. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -0
  52. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +3 -1
  53. package/dist/esm/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
  54. package/dist/esm/anyspend/react/components/AnySpendDepositUpside.js +2 -2
  55. package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +2 -1
  56. package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
  57. package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
  58. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
  59. package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
  60. package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
  61. package/dist/esm/anyspend/react/components/AnySpendStakeUpside.d.ts +2 -1
  62. package/dist/esm/anyspend/react/components/AnySpendStakeUpside.js +2 -2
  63. package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
  64. package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
  65. package/dist/esm/anyspend/react/components/AnySpendTournament.d.ts +2 -0
  66. package/dist/esm/anyspend/react/components/AnySpendTournament.js +1 -1
  67. package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
  68. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
  69. package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
  70. package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +2 -2
  71. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +2 -1
  72. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +1 -0
  73. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +2 -1
  74. package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +16 -0
  75. package/dist/esm/anyspend/services/anyspend.d.ts +2 -1
  76. package/dist/esm/anyspend/services/anyspend.js +2 -1
  77. package/dist/esm/anyspend/types/api.d.ts +295 -0
  78. package/dist/esm/anyspend/utils/validation.d.ts +67 -0
  79. package/dist/esm/anyspend/utils/validation.js +153 -0
  80. package/dist/esm/global-account/react/stores/useModalStore.d.ts +4 -0
  81. package/dist/types/anyspend/index.d.ts +1 -0
  82. package/dist/types/anyspend/react/components/AnySpend.d.ts +6 -0
  83. package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +3 -1
  84. package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
  85. package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +1 -0
  86. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -0
  87. package/dist/types/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
  88. package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +2 -1
  89. package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
  90. package/dist/types/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
  91. package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +2 -1
  92. package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
  93. package/dist/types/anyspend/react/components/AnySpendTournament.d.ts +2 -0
  94. package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
  95. package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
  96. package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +1 -0
  97. package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +16 -0
  98. package/dist/types/anyspend/services/anyspend.d.ts +2 -1
  99. package/dist/types/anyspend/types/api.d.ts +295 -0
  100. package/dist/types/anyspend/utils/validation.d.ts +67 -0
  101. package/dist/types/global-account/react/stores/useModalStore.d.ts +4 -0
  102. package/package.json +1 -1
  103. package/src/anyspend/index.ts +1 -0
  104. package/src/anyspend/react/components/AnySpend.tsx +23 -0
  105. package/src/anyspend/react/components/AnySpendBondKit.tsx +3 -1
  106. package/src/anyspend/react/components/AnySpendBuySpin.tsx +3 -0
  107. package/src/anyspend/react/components/AnySpendCustom.tsx +8 -1
  108. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +4 -0
  109. package/src/anyspend/react/components/AnySpendDepositUpside.tsx +3 -0
  110. package/src/anyspend/react/components/AnySpendNFT.tsx +3 -0
  111. package/src/anyspend/react/components/AnySpendStakeB3.tsx +3 -0
  112. package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +3 -0
  113. package/src/anyspend/react/components/AnySpendStakeUpside.tsx +3 -0
  114. package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +3 -0
  115. package/src/anyspend/react/components/AnySpendTournament.tsx +3 -0
  116. package/src/anyspend/react/components/AnyspendDepositHype.tsx +3 -0
  117. package/src/anyspend/react/components/AnyspendSignatureMint.tsx +3 -0
  118. package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +2 -0
  119. package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +13 -1
  120. package/src/anyspend/services/anyspend.ts +3 -0
  121. package/src/anyspend/types/api.ts +295 -0
  122. package/src/anyspend/utils/validation.ts +209 -0
  123. package/src/global-account/react/stores/useModalStore.ts +4 -0
@@ -6,6 +6,7 @@ export * from "./utils/json";
6
6
  export * from "./utils/number";
7
7
  export * from "./utils/string";
8
8
  export * from "./utils/token";
9
+ export * from "./utils/validation";
9
10
  export * from "./constants";
10
11
  export * from "./abis/abiUsdcBase";
11
12
  export * from "./abis/erc20Staking";
@@ -24,6 +24,7 @@ __exportStar(require("./utils/json"), exports);
24
24
  __exportStar(require("./utils/number"), exports);
25
25
  __exportStar(require("./utils/string"), exports);
26
26
  __exportStar(require("./utils/token"), exports);
27
+ __exportStar(require("./utils/validation"), exports);
27
28
  // Constants
28
29
  __exportStar(require("./constants"), exports);
29
30
  // Abis
@@ -34,4 +34,10 @@ export declare function AnySpend(props: {
34
34
  }) => void;
35
35
  onSuccess?: (txHash?: string) => void;
36
36
  customUsdInputValues?: string[];
37
+ /**
38
+ * Client-provided reference ID for tracking orders.
39
+ * Must be alphanumeric with optional hyphens, underscores, and dots (max 255 chars).
40
+ * Auto-generates UUID if not provided.
41
+ */
42
+ clientReferenceId?: string;
37
43
  }): import("react/jsx-runtime").JSX.Element;
@@ -9,6 +9,7 @@ exports.AnySpend = AnySpend;
9
9
  const jsx_runtime_1 = require("react/jsx-runtime");
10
10
  const anyspend_1 = require("../../../anyspend");
11
11
  const react_1 = require("../../../anyspend/react");
12
+ const validation_1 = require("../../../anyspend/utils/validation");
12
13
  const react_2 = require("../../../global-account/react");
13
14
  const cn_1 = require("../../../shared/utils/cn");
14
15
  const number_1 = require("../../../shared/utils/number");
@@ -55,9 +56,18 @@ function AnySpend(props) {
55
56
  const fingerprintConfig = (0, AnySpendFingerprintWrapper_1.getFingerprintConfig)();
56
57
  return ((0, jsx_runtime_1.jsx)(AnySpendFingerprintWrapper_1.AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: (0, jsx_runtime_1.jsx)(AnySpendInner, { ...props }) }));
57
58
  }
58
- function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, }) {
59
+ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, clientReferenceId: clientReferenceIdFromProps, }) {
59
60
  const searchParams = (0, react_2.useSearchParamsSSR)();
60
61
  const router = (0, react_2.useRouter)();
62
+ // Validate and clean clientReferenceId
63
+ const validatedClientReferenceId = (0, react_4.useMemo)(() => {
64
+ const validation = validation_1.Validators.clientReferenceId(clientReferenceIdFromProps);
65
+ if (!validation.isValid) {
66
+ console.error(`[AnySpend] Invalid clientReferenceId: ${validation.error || "Validation failed"}. Will be set to undefined.`);
67
+ return undefined;
68
+ }
69
+ return validation.cleaned;
70
+ }, [clientReferenceIdFromProps]);
61
71
  // Determine if we're in "buy mode" based on whether destination token props are provided
62
72
  const isBuyMode = !!(destinationTokenAddress && destinationTokenChainId);
63
73
  // Add refs to track URL state
@@ -645,6 +655,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
645
655
  srcAmount: srcAmountBigInt.toString(),
646
656
  expectedDstAmount: anyspendQuote?.data?.currencyOut?.amount || "0",
647
657
  creatorAddress: globalAddress,
658
+ clientReferenceId: validatedClientReferenceId,
648
659
  });
649
660
  }
650
661
  catch (err) {
@@ -709,6 +720,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
709
720
  },
710
721
  expectedDstAmount: anyspendQuote?.data?.currencyOut?.amount?.toString() || "0",
711
722
  creatorAddress: globalAddress,
723
+ clientReferenceId: validatedClientReferenceId,
712
724
  });
713
725
  }
714
726
  catch (err) {
@@ -1,2 +1,4 @@
1
1
  import { AnySpendBondKitProps } from "../../../global-account/react/stores/useModalStore";
2
- export declare function AnySpendBondKit({ mode, recipientAddress, contractAddress, minTokensOut, imageUrl, b3Amount: initialB3Amount, onSuccess, }: AnySpendBondKitProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function AnySpendBondKit({ mode, recipientAddress, contractAddress, minTokensOut, imageUrl, b3Amount: initialB3Amount, onSuccess, clientReferenceId, }: AnySpendBondKitProps & {
3
+ clientReferenceId?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -23,7 +23,7 @@ function formatNumberWithCommas(x) {
23
23
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
24
24
  return parts.join(".");
25
25
  }
26
- function AnySpendBondKit({ mode = "modal", recipientAddress, contractAddress, minTokensOut = "0", imageUrl, b3Amount: initialB3Amount, onSuccess, }) {
26
+ function AnySpendBondKit({ mode = "modal", recipientAddress, contractAddress, minTokensOut = "0", imageUrl, b3Amount: initialB3Amount, onSuccess, clientReferenceId, }) {
27
27
  const hasMounted = (0, react_1.useHasMounted)();
28
28
  const [showAmountPrompt, setShowAmountPrompt] = (0, react_3.useState)(!initialB3Amount);
29
29
  const [b3Amount, setB3Amount] = (0, react_3.useState)(initialB3Amount || "");
@@ -203,5 +203,5 @@ function AnySpendBondKit({ mode = "modal", recipientAddress, contractAddress, mi
203
203
  });
204
204
  return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: supported_1.baseMainnet.id, dstToken: dstToken, dstAmount: (0, viem_1.parseEther)(b3Amount).toString(), contractAddress: contractAddress, encodedData: encodedData, metadata: {
205
205
  action: "BondKit Buy",
206
- }, header: header, onSuccess: onSuccess, showRecipient: true }));
206
+ }, header: header, onSuccess: onSuccess, showRecipient: true, clientReferenceId: clientReferenceId }));
207
207
  }
@@ -1,4 +1,4 @@
1
- export declare function AnySpendBuySpin({ loadOrder, mode, spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess, }: {
1
+ export declare function AnySpendBuySpin({ loadOrder, mode, spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess, clientReferenceId, }: {
2
2
  loadOrder?: string;
3
3
  mode?: "modal" | "page";
4
4
  spinwheelContractAddress: string;
@@ -6,4 +6,5 @@ export declare function AnySpendBuySpin({ loadOrder, mode, spinwheelContractAddr
6
6
  recipientAddress: string;
7
7
  prefillQuantity?: string;
8
8
  onSuccess?: (txHash?: string) => void;
9
+ clientReferenceId?: string;
9
10
  }): import("react/jsx-runtime").JSX.Element;
@@ -91,7 +91,7 @@ const basePublicClient = (0, viem_1.createPublicClient)({
91
91
  chain: supported_1.baseMainnet,
92
92
  transport: (0, viem_1.http)(constants_1.PUBLIC_BASE_RPC_URL),
93
93
  });
94
- function AnySpendBuySpin({ loadOrder, mode = "modal", spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess, }) {
94
+ function AnySpendBuySpin({ loadOrder, mode = "modal", spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess, clientReferenceId, }) {
95
95
  const hasMounted = (0, react_1.useHasMounted)();
96
96
  const { setB3ModalOpen } = (0, react_1.useModalStore)();
97
97
  // Payment config state
@@ -397,5 +397,5 @@ function AnySpendBuySpin({ loadOrder, mode = "modal", spinwheelContractAddress,
397
397
  const encodedData = generateEncodedDataForBuyEntriesAndSpin(address || "", userSpinQuantity);
398
398
  return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: chainId, dstToken: anyspend_1.B3_TOKEN, dstAmount: totalCost.toString(), contractAddress: spinwheelContractAddress, spenderAddress: paymentConfig.entryModule, encodedData: encodedData, metadata: {
399
399
  action: `buy ${userSpinQuantity} spin${userSpinQuantity !== "1" ? "s" : ""}`,
400
- }, header: header, onSuccess: txHash => onSuccess?.(txHash), showRecipient: false }));
400
+ }, header: header, onSuccess: txHash => onSuccess?.(txHash), showRecipient: false, clientReferenceId: clientReferenceId }));
401
401
  }
@@ -21,4 +21,5 @@ export declare function AnySpendCustom(props: {
21
21
  onSuccess?: (txHash?: string) => void;
22
22
  showRecipient?: boolean;
23
23
  onShowPointsDetail?: () => void;
24
+ clientReferenceId?: string;
24
25
  }): import("react/jsx-runtime").JSX.Element;
@@ -147,7 +147,7 @@ function AnySpendCustom(props) {
147
147
  const fingerprintConfig = (0, AnySpendFingerprintWrapper_1.getFingerprintConfig)();
148
148
  return ((0, jsx_runtime_1.jsx)(AnySpendFingerprintWrapper_1.AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: (0, jsx_runtime_1.jsx)(AnySpendCustomInner, { ...props }) }));
149
149
  }
150
- function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabProps = "crypto", recipientAddress: recipientAddressProps, spenderAddress, orderType, dstChainId, dstToken, dstAmount, contractAddress, encodedData, metadata, header, onSuccess, showRecipient = true, onShowPointsDetail, }) {
150
+ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabProps = "crypto", recipientAddress: recipientAddressProps, spenderAddress, orderType, dstChainId, dstToken, dstAmount, contractAddress, encodedData, metadata, header, onSuccess, showRecipient = true, onShowPointsDetail, clientReferenceId, }) {
151
151
  const hasMounted = (0, react_2.useHasMounted)();
152
152
  const featureFlags = (0, FeatureFlagsContext_1.useFeatureFlags)();
153
153
  const searchParams = (0, react_2.useSearchParamsSSR)();
@@ -390,10 +390,14 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
390
390
  : window.location.origin,
391
391
  },
392
392
  expectedDstAmount: anyspendQuote?.data?.currencyOut?.amount?.toString() || "0",
393
+ clientReferenceId: clientReferenceId,
393
394
  });
394
395
  }
395
396
  else {
396
- void createRegularOrder(createOrderParams);
397
+ void createRegularOrder({
398
+ ...createOrderParams,
399
+ clientReferenceId: clientReferenceId,
400
+ });
397
401
  }
398
402
  }
399
403
  catch (err) {
@@ -31,6 +31,7 @@ export interface AnySpendCustomExactInProps {
31
31
  anyspendPrice: GetQuoteResponse | undefined;
32
32
  isLoadingAnyspendPrice: boolean;
33
33
  }) => React.JSX.Element;
34
+ clientReferenceId?: string;
34
35
  }
35
36
  export declare function AnySpendCustomExactIn(props: AnySpendCustomExactInProps): import("react/jsx-runtime").JSX.Element;
36
37
  export {};
@@ -31,7 +31,7 @@ function AnySpendCustomExactIn(props) {
31
31
  const fingerprintConfig = (0, AnySpendFingerprintWrapper_1.getFingerprintConfig)();
32
32
  return ((0, jsx_runtime_1.jsx)(AnySpendFingerprintWrapper_1.AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: (0, jsx_runtime_1.jsx)(AnySpendCustomExactInInner, { ...props }) }));
33
33
  }
34
- function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, destinationToken, destinationChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, customExactInConfig, orderType = "custom_exact_in", minDestinationAmount, header, }) {
34
+ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, destinationToken, destinationChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, customExactInConfig, orderType = "custom_exact_in", minDestinationAmount, header, clientReferenceId, }) {
35
35
  const actionLabel = customExactInConfig?.action ?? "Custom Execution";
36
36
  const DESTINATION_TOKEN_DETAILS = {
37
37
  SYMBOL: destinationToken.symbol ?? "TOKEN",
@@ -195,6 +195,7 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
195
195
  expectedDstAmount: expectedDstAmountRaw,
196
196
  creatorAddress: globalAddress,
197
197
  payload,
198
+ clientReferenceId: clientReferenceId,
198
199
  });
199
200
  }
200
201
  catch (err) {
@@ -247,6 +248,7 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
247
248
  expectedDstAmount: expectedDstAmountRaw,
248
249
  creatorAddress: globalAddress,
249
250
  payload,
251
+ clientReferenceId: clientReferenceId,
250
252
  });
251
253
  }
252
254
  catch (err) {
@@ -1,5 +1,5 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
- export declare function AnySpendDepositUpside({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess, }: {
2
+ export declare function AnySpendDepositUpside({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess, clientReferenceId, }: {
3
3
  loadOrder?: string;
4
4
  mode?: "modal" | "page";
5
5
  recipientAddress: string;
@@ -8,4 +8,5 @@ export declare function AnySpendDepositUpside({ loadOrder, mode, recipientAddres
8
8
  depositContractAddress: string;
9
9
  token: components["schemas"]["Token"];
10
10
  onSuccess?: (amount: string) => void;
11
+ clientReferenceId?: string;
11
12
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -25,7 +25,7 @@ const DEPOSIT_FOR_FUNCTION_ABI = JSON.stringify([
25
25
  type: "function",
26
26
  },
27
27
  ]);
28
- function AnySpendDepositUpside({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess, }) {
28
+ function AnySpendDepositUpside({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess, clientReferenceId, }) {
29
29
  if (!recipientAddress)
30
30
  return null;
31
31
  const header = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { className: "from-b3-react-background to-as-on-surface-1 w-full rounded-t-lg bg-gradient-to-t", children: (0, jsx_runtime_1.jsx)("div", { className: "mb-1 flex w-full flex-col items-center gap-2", children: (0, jsx_runtime_1.jsxs)("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Deposit ", token.symbol] }) }) }) }));
@@ -37,5 +37,5 @@ function AnySpendDepositUpside({ loadOrder, mode = "modal", recipientAddress, so
37
37
  spenderAddress: depositContractAddress,
38
38
  action: `deposit ${token.symbol}`,
39
39
  };
40
- return ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: chains_1.base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
40
+ return ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: chains_1.base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess, clientReferenceId: clientReferenceId }));
41
41
  }
@@ -1,9 +1,10 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
- export declare function AnySpendNFT({ loadOrder, mode, recipientAddress, nftContract, onSuccess, onShowPointsDetail, }: {
2
+ export declare function AnySpendNFT({ loadOrder, mode, recipientAddress, nftContract, onSuccess, onShowPointsDetail, clientReferenceId, }: {
3
3
  loadOrder?: string;
4
4
  mode?: "modal" | "page";
5
5
  recipientAddress?: string;
6
6
  nftContract: components["schemas"]["NftContract"];
7
7
  onSuccess?: (txHash?: string) => void;
8
8
  onShowPointsDetail?: () => void;
9
+ clientReferenceId?: string;
9
10
  }): import("react/jsx-runtime").JSX.Element;
@@ -29,7 +29,7 @@ const CONTRACT_URI_ABI = [
29
29
  type: "function",
30
30
  },
31
31
  ];
32
- function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftContract, onSuccess, onShowPointsDetail, }) {
32
+ function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftContract, onSuccess, onShowPointsDetail, clientReferenceId, }) {
33
33
  const [imageUrlWithFallback, setFallbackImageUrl] = (0, react_3.useState)(nftContract.imageUrl);
34
34
  const [isLoadingFallback, setIsLoadingFallback] = (0, react_3.useState)(false);
35
35
  // Fetch contract metadata when imageUrl is empty
@@ -89,7 +89,7 @@ function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftContract,
89
89
  return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, activeTab: "fiat", recipientAddress: recipientAddress, orderType: "mint_nft", dstChainId: nftContract.chainId, dstToken: nftContract.currency, dstAmount: nftContract.price, contractAddress: nftContract.contractAddress, encodedData: "0x", metadata: {
90
90
  type: "mint_nft",
91
91
  nftContract: nftContract,
92
- }, header: header, onSuccess: onSuccess, onShowPointsDetail: onShowPointsDetail }));
92
+ }, header: header, onSuccess: onSuccess, onShowPointsDetail: onShowPointsDetail, clientReferenceId: clientReferenceId }));
93
93
  }
94
94
  function DropdownMenu({ nftContract }) {
95
95
  const [open, setOpen] = (0, react_3.useState)(false);
@@ -1,7 +1,8 @@
1
- export declare function AnySpendStakeB3({ loadOrder, mode, recipientAddress, stakeAmount, onSuccess, }: {
1
+ export declare function AnySpendStakeB3({ loadOrder, mode, recipientAddress, stakeAmount, onSuccess, clientReferenceId, }: {
2
2
  loadOrder?: string;
3
3
  mode?: "modal" | "page";
4
4
  recipientAddress: string;
5
5
  stakeAmount?: string;
6
6
  onSuccess?: () => void;
7
+ clientReferenceId?: string;
7
8
  }): import("react/jsx-runtime").JSX.Element;
@@ -35,7 +35,7 @@ function generateEncodedDataForStakingB3(amount, beneficiary) {
35
35
  });
36
36
  return encodedData;
37
37
  }
38
- function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, stakeAmount, onSuccess, }) {
38
+ function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, stakeAmount, onSuccess, clientReferenceId, }) {
39
39
  const hasMounted = (0, react_1.useHasMounted)();
40
40
  const { setB3ModalOpen } = (0, react_1.useModalStore)();
41
41
  // Wagmi hooks for direct staking
@@ -277,5 +277,5 @@ function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, stakeAmo
277
277
  const encodedData = generateEncodedDataForStakingB3(userStakeAmount, recipientAddress);
278
278
  return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: chains_1.base.id, dstToken: anyspend_1.B3_TOKEN, dstAmount: userStakeAmount, contractAddress: ERC20Staking, encodedData: encodedData, metadata: {
279
279
  action: "stake B3",
280
- }, header: header, onSuccess: onSuccess, showRecipient: true }));
280
+ }, header: header, onSuccess: onSuccess, showRecipient: true, clientReferenceId: clientReferenceId }));
281
281
  }
@@ -1,4 +1,4 @@
1
- export declare function AnySpendStakeB3ExactIn({ loadOrder, mode, sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess, }: {
1
+ export declare function AnySpendStakeB3ExactIn({ loadOrder, mode, sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess, clientReferenceId, }: {
2
2
  loadOrder?: string;
3
3
  mode?: "modal" | "page";
4
4
  sourceTokenAddress?: string;
@@ -6,4 +6,5 @@ export declare function AnySpendStakeB3ExactIn({ loadOrder, mode, sourceTokenAdd
6
6
  recipientAddress: string;
7
7
  stakeAmount?: string;
8
8
  onSuccess?: (amount: string) => void;
9
+ clientReferenceId?: string;
9
10
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -35,7 +35,7 @@ const STAKE_FUNCTION_ABI = JSON.stringify([
35
35
  outputs: [],
36
36
  },
37
37
  ]);
38
- function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess, }) {
38
+ function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess, clientReferenceId, }) {
39
39
  const hasMounted = (0, react_1.useHasMounted)();
40
40
  const { setB3ModalOpen } = (0, react_1.useModalStore)();
41
41
  // Wagmi hooks for direct staking
@@ -284,5 +284,5 @@ function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenAddress,
284
284
  onSuccess?.((0, number_1.formatTokenAmount)(BigInt(userStakeAmount), 18) ?? "");
285
285
  }, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary h-14 w-full rounded-xl text-lg font-medium", children: "Done" })] })] }) }));
286
286
  }
287
- return ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: anyspend_1.B3_TOKEN, destinationChainId: chains_1.base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
287
+ return ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: anyspend_1.B3_TOKEN, destinationChainId: chains_1.base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess, clientReferenceId: clientReferenceId }));
288
288
  }
@@ -1,5 +1,5 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
- export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, }: {
2
+ export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, clientReferenceId, }: {
3
3
  loadOrder?: string;
4
4
  mode?: "modal" | "page";
5
5
  beneficiaryAddress: string;
@@ -8,4 +8,5 @@ export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddres
8
8
  token: components["schemas"]["Token"];
9
9
  onSuccess?: () => void;
10
10
  activeTab?: "crypto" | "fiat";
11
+ clientReferenceId?: string;
11
12
  }): import("react/jsx-runtime").JSX.Element;
@@ -20,7 +20,7 @@ function generateEncodedDataForStaking(amount, beneficiary) {
20
20
  args: [beneficiary, BigInt(amount)],
21
21
  });
22
22
  }
23
- function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, }) {
23
+ function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, clientReferenceId, }) {
24
24
  const header = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", { className: "from-b3-react-background to-as-on-surface-1 mt-[-60px] w-full rounded-t-lg bg-gradient-to-t", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-[60px] w-full" }), (0, jsx_runtime_1.jsx)("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: (0, jsx_runtime_1.jsxs)("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", stakeAmount ? (0, number_1.formatTokenAmount)(BigInt(stakeAmount), token.decimals) : "", " ", token.symbol] }) })] }) }));
25
25
  // Only generate encoded data if we have a valid beneficiary address
26
26
  // This is used for the AnySpendCustom swap & stake flow
@@ -30,5 +30,5 @@ function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, st
30
30
  const encodedData = generateEncodedDataForStaking(stakeAmount, beneficiaryAddress);
31
31
  return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: beneficiaryAddress, orderType: "custom", dstChainId: chains_1.base.id, dstToken: token, dstAmount: stakeAmount, contractAddress: stakingContractAddress, encodedData: encodedData, metadata: {
32
32
  action: `stake ${token.symbol}`,
33
- }, header: header, onSuccess: onSuccess, showRecipient: true, activeTab: activeTab }));
33
+ }, header: header, onSuccess: onSuccess, showRecipient: true, activeTab: activeTab, clientReferenceId: clientReferenceId }));
34
34
  }
@@ -1,5 +1,5 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
- export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess, }: {
2
+ export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess, clientReferenceId, }: {
3
3
  loadOrder?: string;
4
4
  mode?: "modal" | "page";
5
5
  recipientAddress: string;
@@ -8,4 +8,5 @@ export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientA
8
8
  stakingContractAddress: string;
9
9
  token: components["schemas"]["Token"];
10
10
  onSuccess?: (amount: string) => void;
11
+ clientReferenceId?: string;
11
12
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -17,7 +17,7 @@ const STAKE_FOR_FUNCTION_ABI = JSON.stringify([
17
17
  outputs: [],
18
18
  },
19
19
  ]);
20
- function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess, }) {
20
+ function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess, clientReferenceId, }) {
21
21
  if (!recipientAddress)
22
22
  return null;
23
23
  const header = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { className: "from-b3-react-background to-as-on-surface-1 w-full rounded-t-lg bg-gradient-to-t", children: (0, jsx_runtime_1.jsx)("div", { className: "mb-1 flex w-full flex-col items-center gap-2", children: (0, jsx_runtime_1.jsxs)("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", token.symbol, " (Exact In)"] }) }) }) }));
@@ -29,5 +29,5 @@ function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddres
29
29
  spenderAddress: stakingContractAddress,
30
30
  action: `stake ${token.symbol}`,
31
31
  };
32
- return ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: chains_1.base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
32
+ return ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: chains_1.base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess, clientReferenceId: clientReferenceId }));
33
33
  }
@@ -10,6 +10,7 @@ type AnySpendTournamentProps = {
10
10
  tournamentEntryToken: components["schemas"]["Token"];
11
11
  tournamentEntryFee: string;
12
12
  onSuccess?: () => void;
13
+ clientReferenceId?: string;
13
14
  } | {
14
15
  mode?: "modal" | "page";
15
16
  action: "fund";
@@ -20,6 +21,7 @@ type AnySpendTournamentProps = {
20
21
  tournamentFundToken: components["schemas"]["Token"];
21
22
  tournamentFundAmount: string;
22
23
  onSuccess?: () => void;
24
+ clientReferenceId?: string;
23
25
  };
24
26
  export declare function AnySpendTournament(props: AnySpendTournamentProps): import("react/jsx-runtime").JSX.Element;
25
27
  export {};
@@ -16,5 +16,5 @@ function AnySpendTournament(props) {
16
16
  return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: action === "join" ? props.joinFor : undefined, orderType: action === "join" ? "join_tournament" : "fund_tournament", dstChainId: tournamentChainId, dstToken: dstToken, dstAmount: dstAmount, contractAddress: tournamentContractAddress, encodedData: "0x", metadata: {
17
17
  type: action === "join" ? "join_tournament" : "fund_tournament",
18
18
  tournament: tournamentMetadata,
19
- }, header: header, onSuccess: onSuccess, showRecipient: action === "join" }));
19
+ }, header: header, onSuccess: onSuccess, showRecipient: action === "join", clientReferenceId: props.clientReferenceId }));
20
20
  }
@@ -21,5 +21,6 @@ export interface AnySpendDepositHypeProps {
21
21
  }) => void;
22
22
  customUsdInputValues?: string[];
23
23
  preferEoa?: boolean;
24
+ clientReferenceId?: string;
24
25
  }
25
- export declare function AnySpendDepositHype({ loadOrder, mode, recipientAddress, paymentType, sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, }: AnySpendDepositHypeProps): import("react/jsx-runtime").JSX.Element | null;
26
+ export declare function AnySpendDepositHype({ loadOrder, mode, recipientAddress, paymentType, sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, clientReferenceId, }: AnySpendDepositHypeProps): import("react/jsx-runtime").JSX.Element | null;
@@ -10,7 +10,7 @@ exports.HYPE_TOKEN_DETAILS = {
10
10
  SYMBOL: "HYPE",
11
11
  LOGO_URI: "https://cdn.hypeduel.com/hypes-coin.svg",
12
12
  };
13
- function AnySpendDepositHype({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, }) {
13
+ function AnySpendDepositHype({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, clientReferenceId, }) {
14
14
  if (!recipientAddress)
15
15
  return null;
16
16
  const header = () => ((0, jsx_runtime_1.jsx)("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("h1", { className: "text-as-primary text-xl font-bold", children: paymentType === "crypto" ? "Deposit Crypto" : "Fund with Fiat" }) }) }));
@@ -23,5 +23,5 @@ function AnySpendDepositHype({ loadOrder, mode = "modal", recipientAddress, paym
23
23
  logoURI: exports.HYPE_TOKEN_DETAILS.LOGO_URI,
24
24
  },
25
25
  };
26
- return ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: hypeToken, destinationChainId: chains_1.base.id, orderType: "hype_duel", minDestinationAmount: 10, header: header, onSuccess: onSuccess, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa }));
26
+ return ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: hypeToken, destinationChainId: chains_1.base.id, orderType: "hype_duel", minDestinationAmount: 10, header: header, onSuccess: onSuccess, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa, clientReferenceId: clientReferenceId }));
27
27
  }
@@ -1,8 +1,9 @@
1
1
  import { GenerateSigMintResponse } from "../../types/signatureMint";
2
- export declare function AnyspendSignatureMint({ loadOrder, mode, signatureData, imageUrl, onSuccess, }: {
2
+ export declare function AnyspendSignatureMint({ loadOrder, mode, signatureData, imageUrl, onSuccess, clientReferenceId, }: {
3
3
  loadOrder?: string;
4
4
  mode?: "modal" | "page";
5
5
  signatureData: GenerateSigMintResponse;
6
6
  imageUrl?: string;
7
7
  onSuccess?: (txHash?: string) => void;
8
+ clientReferenceId?: string;
8
9
  }): import("react/jsx-runtime").JSX.Element;
@@ -41,7 +41,7 @@ function generateEncodedDataForSignatureMint(signatureData) {
41
41
  });
42
42
  return encodedData;
43
43
  }
44
- function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, imageUrl, onSuccess, }) {
44
+ function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, imageUrl, onSuccess, clientReferenceId, }) {
45
45
  // Get token data
46
46
  const { data: tokenData, isError: isTokenError, isLoading, } = (0, react_1.useTokenData)(signatureData.collection.chainId, signatureData.collection.signatureRequestBody?.currency);
47
47
  // Convert token data to AnySpend Token type
@@ -74,5 +74,5 @@ function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, image
74
74
  const price = (0, viem_1.parseEther)(signatureData.payload.price?.toString() || "0");
75
75
  return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: signatureData.payload.to, orderType: "custom", dstChainId: signatureData.collection.chainId, dstToken: dstToken, dstAmount: price.toString(), contractAddress: signatureData.collection.address || "", encodedData: encodedData, metadata: {
76
76
  action: "Signature Mint",
77
- }, header: header, onSuccess: onSuccess, showRecipient: true }));
77
+ }, header: header, onSuccess: onSuccess, showRecipient: true, clientReferenceId: clientReferenceId }));
78
78
  }
@@ -22,7 +22,7 @@ function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
22
22
  };
23
23
  const { mutate: createOrder, isPending } = (0, react_query_1.useMutation)({
24
24
  mutationFn: async (params) => {
25
- const { recipientAddress, orderType, dstChain, dstToken, srcFiatAmount, onramp, creatorAddress, expectedDstAmount, nft, tournament, payload, partnerId, } = params;
25
+ const { recipientAddress, orderType, dstChain, dstToken, srcFiatAmount, onramp, creatorAddress, expectedDstAmount, nft, tournament, payload, partnerId, clientReferenceId, } = params;
26
26
  try {
27
27
  // Validate required onramp fields
28
28
  if (!onramp.vendor || !onramp.country) {
@@ -65,6 +65,7 @@ function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
65
65
  }),
66
66
  creatorAddress: creatorAddress ? (0, utils_1.normalizeAddress)(creatorAddress) : undefined,
67
67
  partnerId,
68
+ clientReferenceId,
68
69
  visitorData,
69
70
  });
70
71
  }
@@ -18,6 +18,7 @@ export type CreateOrderParams = {
18
18
  creatorAddress?: string;
19
19
  payload?: any;
20
20
  partnerId?: string;
21
+ clientReferenceId?: string;
21
22
  };
22
23
  export type UseAnyspendCreateOrderProps = {
23
24
  onSuccess?: (data: any) => void;
@@ -20,7 +20,7 @@ function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
20
20
  };
21
21
  const { mutate: createOrder, isPending } = (0, react_query_1.useMutation)({
22
22
  mutationFn: async (params) => {
23
- const { recipientAddress, orderType, srcChain, dstChain, srcToken, dstToken, srcAmount, creatorAddress } = params;
23
+ const { recipientAddress, orderType, srcChain, dstChain, srcToken, dstToken, srcAmount, creatorAddress, clientReferenceId, } = params;
24
24
  try {
25
25
  return await anyspend_1.anyspendService.createOrder({
26
26
  recipientAddress: (0, utils_1.normalizeAddress)(recipientAddress),
@@ -53,6 +53,7 @@ function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
53
53
  },
54
54
  }),
55
55
  creatorAddress: creatorAddress ? (0, utils_1.normalizeAddress)(creatorAddress) : undefined,
56
+ clientReferenceId,
56
57
  visitorData,
57
58
  });
58
59
  }