@b3dotfun/sdk 0.0.70-alpha.1 → 0.0.70
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/cjs/anyspend/index.d.ts +0 -1
- package/dist/cjs/anyspend/index.js +0 -1
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +0 -6
- package/dist/cjs/anyspend/react/components/AnySpend.js +1 -13
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +1 -3
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +2 -6
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +1 -3
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendTournament.d.ts +0 -2
- package/dist/cjs/anyspend/react/components/AnySpendTournament.js +1 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +0 -16
- package/dist/cjs/anyspend/services/anyspend.d.ts +1 -2
- package/dist/cjs/anyspend/services/anyspend.js +1 -2
- package/dist/cjs/anyspend/types/api.d.ts +0 -295
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -4
- package/dist/esm/anyspend/index.d.ts +0 -1
- package/dist/esm/anyspend/index.js +0 -1
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +0 -6
- package/dist/esm/anyspend/react/components/AnySpend.js +1 -13
- package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +1 -3
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +2 -6
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -1
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +1 -3
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendTournament.d.ts +0 -2
- package/dist/esm/anyspend/react/components/AnySpendTournament.js +1 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +0 -16
- package/dist/esm/anyspend/services/anyspend.d.ts +1 -2
- package/dist/esm/anyspend/services/anyspend.js +1 -2
- package/dist/esm/anyspend/types/api.d.ts +0 -295
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -4
- package/dist/types/anyspend/index.d.ts +0 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +0 -6
- package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +1 -3
- package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -1
- package/dist/types/anyspend/react/components/AnySpendDepositUpside.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendTournament.d.ts +0 -2
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +1 -2
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +0 -16
- package/dist/types/anyspend/services/anyspend.d.ts +1 -2
- package/dist/types/anyspend/types/api.d.ts +0 -295
- package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -4
- package/package.json +1 -1
- package/src/anyspend/index.ts +0 -1
- package/src/anyspend/react/components/AnySpend.tsx +0 -23
- package/src/anyspend/react/components/AnySpendBondKit.tsx +1 -3
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +0 -3
- package/src/anyspend/react/components/AnySpendCustom.tsx +1 -8
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +0 -4
- package/src/anyspend/react/components/AnySpendDepositUpside.tsx +0 -3
- package/src/anyspend/react/components/AnySpendNFT.tsx +0 -3
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +0 -3
- package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +0 -3
- package/src/anyspend/react/components/AnySpendStakeUpside.tsx +0 -3
- package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +0 -3
- package/src/anyspend/react/components/AnySpendTournament.tsx +0 -3
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +0 -3
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +0 -3
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +0 -2
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +1 -13
- package/src/anyspend/services/anyspend.ts +0 -3
- package/src/anyspend/types/api.ts +0 -295
- package/src/global-account/react/stores/useModalStore.ts +0 -4
- package/dist/cjs/anyspend/utils/validation.d.ts +0 -67
- package/dist/cjs/anyspend/utils/validation.js +0 -157
- package/dist/esm/anyspend/utils/validation.d.ts +0 -67
- package/dist/esm/anyspend/utils/validation.js +0 -153
- package/dist/types/anyspend/utils/validation.d.ts +0 -67
- package/src/anyspend/utils/validation.ts +0 -209
|
@@ -122,8 +122,6 @@ export interface AnySpendModalProps extends BaseModalProps {
|
|
|
122
122
|
destinationTokenChainId?: number;
|
|
123
123
|
/** Custom USD input values for quick amount buttons in fiat onramp */
|
|
124
124
|
customUsdInputValues?: string[];
|
|
125
|
-
/** Client-provided reference ID for tracking orders */
|
|
126
|
-
clientReferenceId?: string;
|
|
127
125
|
}
|
|
128
126
|
/**
|
|
129
127
|
* Props for the AnySpend NFT modal
|
|
@@ -138,8 +136,6 @@ export interface AnySpendNftProps extends BaseModalProps {
|
|
|
138
136
|
recipientAddress?: string;
|
|
139
137
|
/** Callback function called when the NFT is successfully transferred */
|
|
140
138
|
onSuccess?: (txHash?: string) => void;
|
|
141
|
-
/** Client-provided reference ID for tracking orders */
|
|
142
|
-
clientReferenceId?: string;
|
|
143
139
|
}
|
|
144
140
|
/**
|
|
145
141
|
* Props for the AnySpend tournament modal
|
package/package.json
CHANGED
package/src/anyspend/index.ts
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
useAnyspendQuote,
|
|
9
9
|
useGeoOnrampOptions,
|
|
10
10
|
} from "@b3dotfun/sdk/anyspend/react";
|
|
11
|
-
import { Validators } from "@b3dotfun/sdk/anyspend/utils/validation";
|
|
12
11
|
import {
|
|
13
12
|
Button,
|
|
14
13
|
ShinyButton,
|
|
@@ -88,12 +87,6 @@ export function AnySpend(props: {
|
|
|
88
87
|
onTokenSelect?: (token: components["schemas"]["Token"], event: { preventDefault: () => void }) => void;
|
|
89
88
|
onSuccess?: (txHash?: string) => void;
|
|
90
89
|
customUsdInputValues?: string[];
|
|
91
|
-
/**
|
|
92
|
-
* Client-provided reference ID for tracking orders.
|
|
93
|
-
* Must be alphanumeric with optional hyphens, underscores, and dots (max 255 chars).
|
|
94
|
-
* Auto-generates UUID if not provided.
|
|
95
|
-
*/
|
|
96
|
-
clientReferenceId?: string;
|
|
97
90
|
}) {
|
|
98
91
|
const fingerprintConfig = getFingerprintConfig();
|
|
99
92
|
|
|
@@ -115,7 +108,6 @@ function AnySpendInner({
|
|
|
115
108
|
onTokenSelect,
|
|
116
109
|
onSuccess,
|
|
117
110
|
customUsdInputValues,
|
|
118
|
-
clientReferenceId: clientReferenceIdFromProps,
|
|
119
111
|
}: {
|
|
120
112
|
destinationTokenAddress?: string;
|
|
121
113
|
destinationTokenChainId?: number;
|
|
@@ -127,23 +119,10 @@ function AnySpendInner({
|
|
|
127
119
|
onTokenSelect?: (token: components["schemas"]["Token"], event: { preventDefault: () => void }) => void;
|
|
128
120
|
onSuccess?: (txHash?: string) => void;
|
|
129
121
|
customUsdInputValues?: string[];
|
|
130
|
-
clientReferenceId?: string;
|
|
131
122
|
}) {
|
|
132
123
|
const searchParams = useSearchParamsSSR();
|
|
133
124
|
const router = useRouter();
|
|
134
125
|
|
|
135
|
-
// Validate and clean clientReferenceId
|
|
136
|
-
const validatedClientReferenceId = useMemo(() => {
|
|
137
|
-
const validation = Validators.clientReferenceId(clientReferenceIdFromProps);
|
|
138
|
-
if (!validation.isValid) {
|
|
139
|
-
console.error(
|
|
140
|
-
`[AnySpend] Invalid clientReferenceId: ${validation.error || "Validation failed"}. Will be set to undefined.`,
|
|
141
|
-
);
|
|
142
|
-
return undefined;
|
|
143
|
-
}
|
|
144
|
-
return validation.cleaned;
|
|
145
|
-
}, [clientReferenceIdFromProps]);
|
|
146
|
-
|
|
147
126
|
// Determine if we're in "buy mode" based on whether destination token props are provided
|
|
148
127
|
const isBuyMode = !!(destinationTokenAddress && destinationTokenChainId);
|
|
149
128
|
|
|
@@ -844,7 +823,6 @@ function AnySpendInner({
|
|
|
844
823
|
srcAmount: srcAmountBigInt.toString(),
|
|
845
824
|
expectedDstAmount: anyspendQuote?.data?.currencyOut?.amount || "0",
|
|
846
825
|
creatorAddress: globalAddress,
|
|
847
|
-
clientReferenceId: validatedClientReferenceId,
|
|
848
826
|
});
|
|
849
827
|
} catch (err: any) {
|
|
850
828
|
console.error(err);
|
|
@@ -913,7 +891,6 @@ function AnySpendInner({
|
|
|
913
891
|
},
|
|
914
892
|
expectedDstAmount: anyspendQuote?.data?.currencyOut?.amount?.toString() || "0",
|
|
915
893
|
creatorAddress: globalAddress,
|
|
916
|
-
clientReferenceId: validatedClientReferenceId,
|
|
917
894
|
});
|
|
918
895
|
} catch (err: any) {
|
|
919
896
|
console.error(err);
|
|
@@ -38,8 +38,7 @@ export function AnySpendBondKit({
|
|
|
38
38
|
imageUrl,
|
|
39
39
|
b3Amount: initialB3Amount,
|
|
40
40
|
onSuccess,
|
|
41
|
-
|
|
42
|
-
}: AnySpendBondKitProps & { clientReferenceId?: string }) {
|
|
41
|
+
}: AnySpendBondKitProps) {
|
|
43
42
|
const hasMounted = useHasMounted();
|
|
44
43
|
const [showAmountPrompt, setShowAmountPrompt] = useState(!initialB3Amount);
|
|
45
44
|
const [b3Amount, setB3Amount] = useState(initialB3Amount || "");
|
|
@@ -372,7 +371,6 @@ export function AnySpendBondKit({
|
|
|
372
371
|
header={header}
|
|
373
372
|
onSuccess={onSuccess}
|
|
374
373
|
showRecipient={true}
|
|
375
|
-
clientReferenceId={clientReferenceId}
|
|
376
374
|
/>
|
|
377
375
|
);
|
|
378
376
|
}
|
|
@@ -129,7 +129,6 @@ export function AnySpendBuySpin({
|
|
|
129
129
|
recipientAddress,
|
|
130
130
|
prefillQuantity,
|
|
131
131
|
onSuccess,
|
|
132
|
-
clientReferenceId,
|
|
133
132
|
}: {
|
|
134
133
|
loadOrder?: string;
|
|
135
134
|
mode?: "modal" | "page";
|
|
@@ -138,7 +137,6 @@ export function AnySpendBuySpin({
|
|
|
138
137
|
recipientAddress: string;
|
|
139
138
|
prefillQuantity?: string;
|
|
140
139
|
onSuccess?: (txHash?: string) => void;
|
|
141
|
-
clientReferenceId?: string;
|
|
142
140
|
}) {
|
|
143
141
|
const hasMounted = useHasMounted();
|
|
144
142
|
const { setB3ModalOpen } = useModalStore();
|
|
@@ -682,7 +680,6 @@ export function AnySpendBuySpin({
|
|
|
682
680
|
header={header}
|
|
683
681
|
onSuccess={txHash => onSuccess?.(txHash)}
|
|
684
682
|
showRecipient={false}
|
|
685
|
-
clientReferenceId={clientReferenceId}
|
|
686
683
|
/>
|
|
687
684
|
);
|
|
688
685
|
}
|
|
@@ -187,7 +187,6 @@ export function AnySpendCustom(props: {
|
|
|
187
187
|
onSuccess?: (txHash?: string) => void;
|
|
188
188
|
showRecipient?: boolean;
|
|
189
189
|
onShowPointsDetail?: () => void;
|
|
190
|
-
clientReferenceId?: string;
|
|
191
190
|
}) {
|
|
192
191
|
const fingerprintConfig = getFingerprintConfig();
|
|
193
192
|
|
|
@@ -215,7 +214,6 @@ function AnySpendCustomInner({
|
|
|
215
214
|
onSuccess,
|
|
216
215
|
showRecipient = true,
|
|
217
216
|
onShowPointsDetail,
|
|
218
|
-
clientReferenceId,
|
|
219
217
|
}: {
|
|
220
218
|
loadOrder?: string;
|
|
221
219
|
mode?: "modal" | "page";
|
|
@@ -239,7 +237,6 @@ function AnySpendCustomInner({
|
|
|
239
237
|
onSuccess?: (txHash?: string) => void;
|
|
240
238
|
showRecipient?: boolean;
|
|
241
239
|
onShowPointsDetail?: () => void;
|
|
242
|
-
clientReferenceId?: string;
|
|
243
240
|
}) {
|
|
244
241
|
const hasMounted = useHasMounted();
|
|
245
242
|
const featureFlags = useFeatureFlags();
|
|
@@ -535,13 +532,9 @@ function AnySpendCustomInner({
|
|
|
535
532
|
: window.location.origin,
|
|
536
533
|
},
|
|
537
534
|
expectedDstAmount: anyspendQuote?.data?.currencyOut?.amount?.toString() || "0",
|
|
538
|
-
clientReferenceId: clientReferenceId,
|
|
539
535
|
});
|
|
540
536
|
} else {
|
|
541
|
-
void createRegularOrder(
|
|
542
|
-
...createOrderParams,
|
|
543
|
-
clientReferenceId: clientReferenceId,
|
|
544
|
-
});
|
|
537
|
+
void createRegularOrder(createOrderParams);
|
|
545
538
|
}
|
|
546
539
|
} catch (err) {
|
|
547
540
|
console.error(err);
|
|
@@ -57,7 +57,6 @@ export interface AnySpendCustomExactInProps {
|
|
|
57
57
|
anyspendPrice: GetQuoteResponse | undefined;
|
|
58
58
|
isLoadingAnyspendPrice: boolean;
|
|
59
59
|
}) => React.JSX.Element;
|
|
60
|
-
clientReferenceId?: string;
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
export function AnySpendCustomExactIn(props: AnySpendCustomExactInProps) {
|
|
@@ -88,7 +87,6 @@ function AnySpendCustomExactInInner({
|
|
|
88
87
|
orderType = "custom_exact_in",
|
|
89
88
|
minDestinationAmount,
|
|
90
89
|
header,
|
|
91
|
-
clientReferenceId,
|
|
92
90
|
}: AnySpendCustomExactInProps) {
|
|
93
91
|
const actionLabel = customExactInConfig?.action ?? "Custom Execution";
|
|
94
92
|
|
|
@@ -435,7 +433,6 @@ function AnySpendCustomExactInInner({
|
|
|
435
433
|
expectedDstAmount: expectedDstAmountRaw,
|
|
436
434
|
creatorAddress: globalAddress,
|
|
437
435
|
payload,
|
|
438
|
-
clientReferenceId: clientReferenceId,
|
|
439
436
|
});
|
|
440
437
|
} catch (err: any) {
|
|
441
438
|
console.error(err);
|
|
@@ -491,7 +488,6 @@ function AnySpendCustomExactInInner({
|
|
|
491
488
|
expectedDstAmount: expectedDstAmountRaw,
|
|
492
489
|
creatorAddress: globalAddress,
|
|
493
490
|
payload,
|
|
494
|
-
clientReferenceId: clientReferenceId,
|
|
495
491
|
});
|
|
496
492
|
} catch (err: any) {
|
|
497
493
|
console.error(err);
|
|
@@ -33,7 +33,6 @@ export function AnySpendDepositUpside({
|
|
|
33
33
|
depositContractAddress,
|
|
34
34
|
token,
|
|
35
35
|
onSuccess,
|
|
36
|
-
clientReferenceId,
|
|
37
36
|
}: {
|
|
38
37
|
loadOrder?: string;
|
|
39
38
|
mode?: "modal" | "page";
|
|
@@ -43,7 +42,6 @@ export function AnySpendDepositUpside({
|
|
|
43
42
|
depositContractAddress: string;
|
|
44
43
|
token: components["schemas"]["Token"];
|
|
45
44
|
onSuccess?: (amount: string) => void;
|
|
46
|
-
clientReferenceId?: string;
|
|
47
45
|
}) {
|
|
48
46
|
if (!recipientAddress) return null;
|
|
49
47
|
|
|
@@ -78,7 +76,6 @@ export function AnySpendDepositUpside({
|
|
|
78
76
|
customExactInConfig={customExactInConfig}
|
|
79
77
|
header={header}
|
|
80
78
|
onSuccess={onSuccess}
|
|
81
|
-
clientReferenceId={clientReferenceId}
|
|
82
79
|
/>
|
|
83
80
|
);
|
|
84
81
|
}
|
|
@@ -37,7 +37,6 @@ export function AnySpendNFT({
|
|
|
37
37
|
nftContract,
|
|
38
38
|
onSuccess,
|
|
39
39
|
onShowPointsDetail,
|
|
40
|
-
clientReferenceId,
|
|
41
40
|
}: {
|
|
42
41
|
loadOrder?: string;
|
|
43
42
|
mode?: "modal" | "page";
|
|
@@ -45,7 +44,6 @@ export function AnySpendNFT({
|
|
|
45
44
|
nftContract: components["schemas"]["NftContract"];
|
|
46
45
|
onSuccess?: (txHash?: string) => void;
|
|
47
46
|
onShowPointsDetail?: () => void;
|
|
48
|
-
clientReferenceId?: string;
|
|
49
47
|
}) {
|
|
50
48
|
const [imageUrlWithFallback, setFallbackImageUrl] = useState<string | null>(nftContract.imageUrl);
|
|
51
49
|
const [isLoadingFallback, setIsLoadingFallback] = useState(false);
|
|
@@ -169,7 +167,6 @@ export function AnySpendNFT({
|
|
|
169
167
|
header={header}
|
|
170
168
|
onSuccess={onSuccess}
|
|
171
169
|
onShowPointsDetail={onShowPointsDetail}
|
|
172
|
-
clientReferenceId={clientReferenceId}
|
|
173
170
|
/>
|
|
174
171
|
);
|
|
175
172
|
}
|
|
@@ -48,14 +48,12 @@ export function AnySpendStakeB3({
|
|
|
48
48
|
recipientAddress,
|
|
49
49
|
stakeAmount,
|
|
50
50
|
onSuccess,
|
|
51
|
-
clientReferenceId,
|
|
52
51
|
}: {
|
|
53
52
|
loadOrder?: string;
|
|
54
53
|
mode?: "modal" | "page";
|
|
55
54
|
recipientAddress: string;
|
|
56
55
|
stakeAmount?: string;
|
|
57
56
|
onSuccess?: () => void;
|
|
58
|
-
clientReferenceId?: string;
|
|
59
57
|
}) {
|
|
60
58
|
const hasMounted = useHasMounted();
|
|
61
59
|
const { setB3ModalOpen } = useModalStore();
|
|
@@ -508,7 +506,6 @@ export function AnySpendStakeB3({
|
|
|
508
506
|
header={header}
|
|
509
507
|
onSuccess={onSuccess}
|
|
510
508
|
showRecipient={true}
|
|
511
|
-
clientReferenceId={clientReferenceId}
|
|
512
509
|
/>
|
|
513
510
|
);
|
|
514
511
|
}
|
|
@@ -53,7 +53,6 @@ export function AnySpendStakeB3ExactIn({
|
|
|
53
53
|
recipientAddress,
|
|
54
54
|
stakeAmount,
|
|
55
55
|
onSuccess,
|
|
56
|
-
clientReferenceId,
|
|
57
56
|
}: {
|
|
58
57
|
loadOrder?: string;
|
|
59
58
|
mode?: "modal" | "page";
|
|
@@ -62,7 +61,6 @@ export function AnySpendStakeB3ExactIn({
|
|
|
62
61
|
recipientAddress: string;
|
|
63
62
|
stakeAmount?: string;
|
|
64
63
|
onSuccess?: (amount: string) => void;
|
|
65
|
-
clientReferenceId?: string;
|
|
66
64
|
}) {
|
|
67
65
|
const hasMounted = useHasMounted();
|
|
68
66
|
const { setB3ModalOpen } = useModalStore();
|
|
@@ -519,7 +517,6 @@ export function AnySpendStakeB3ExactIn({
|
|
|
519
517
|
customExactInConfig={customExactInConfig}
|
|
520
518
|
header={header}
|
|
521
519
|
onSuccess={onSuccess}
|
|
522
|
-
clientReferenceId={clientReferenceId}
|
|
523
520
|
/>
|
|
524
521
|
);
|
|
525
522
|
}
|
|
@@ -25,7 +25,6 @@ export function AnySpendStakeUpside({
|
|
|
25
25
|
token,
|
|
26
26
|
onSuccess,
|
|
27
27
|
activeTab,
|
|
28
|
-
clientReferenceId,
|
|
29
28
|
}: {
|
|
30
29
|
loadOrder?: string;
|
|
31
30
|
mode?: "modal" | "page";
|
|
@@ -35,7 +34,6 @@ export function AnySpendStakeUpside({
|
|
|
35
34
|
token: components["schemas"]["Token"];
|
|
36
35
|
onSuccess?: () => void;
|
|
37
36
|
activeTab?: "crypto" | "fiat";
|
|
38
|
-
clientReferenceId?: string;
|
|
39
37
|
}) {
|
|
40
38
|
const header = () => (
|
|
41
39
|
<>
|
|
@@ -82,7 +80,6 @@ export function AnySpendStakeUpside({
|
|
|
82
80
|
onSuccess={onSuccess}
|
|
83
81
|
showRecipient={true}
|
|
84
82
|
activeTab={activeTab}
|
|
85
|
-
clientReferenceId={clientReferenceId}
|
|
86
83
|
/>
|
|
87
84
|
);
|
|
88
85
|
}
|
|
@@ -25,7 +25,6 @@ export function AnySpendStakeUpsideExactIn({
|
|
|
25
25
|
stakingContractAddress,
|
|
26
26
|
token,
|
|
27
27
|
onSuccess,
|
|
28
|
-
clientReferenceId,
|
|
29
28
|
}: {
|
|
30
29
|
loadOrder?: string;
|
|
31
30
|
mode?: "modal" | "page";
|
|
@@ -35,7 +34,6 @@ export function AnySpendStakeUpsideExactIn({
|
|
|
35
34
|
stakingContractAddress: string;
|
|
36
35
|
token: components["schemas"]["Token"];
|
|
37
36
|
onSuccess?: (amount: string) => void;
|
|
38
|
-
clientReferenceId?: string;
|
|
39
37
|
}) {
|
|
40
38
|
if (!recipientAddress) return null;
|
|
41
39
|
|
|
@@ -70,7 +68,6 @@ export function AnySpendStakeUpsideExactIn({
|
|
|
70
68
|
customExactInConfig={customExactInConfig}
|
|
71
69
|
header={header}
|
|
72
70
|
onSuccess={onSuccess}
|
|
73
|
-
clientReferenceId={clientReferenceId}
|
|
74
71
|
/>
|
|
75
72
|
);
|
|
76
73
|
}
|
|
@@ -17,7 +17,6 @@ type AnySpendTournamentProps =
|
|
|
17
17
|
tournamentEntryToken: components["schemas"]["Token"];
|
|
18
18
|
tournamentEntryFee: string;
|
|
19
19
|
onSuccess?: () => void;
|
|
20
|
-
clientReferenceId?: string;
|
|
21
20
|
}
|
|
22
21
|
| {
|
|
23
22
|
mode?: "modal" | "page";
|
|
@@ -29,7 +28,6 @@ type AnySpendTournamentProps =
|
|
|
29
28
|
tournamentFundToken: components["schemas"]["Token"];
|
|
30
29
|
tournamentFundAmount: string;
|
|
31
30
|
onSuccess?: () => void;
|
|
32
|
-
clientReferenceId?: string;
|
|
33
31
|
};
|
|
34
32
|
|
|
35
33
|
export function AnySpendTournament(props: AnySpendTournamentProps) {
|
|
@@ -106,7 +104,6 @@ export function AnySpendTournament(props: AnySpendTournamentProps) {
|
|
|
106
104
|
header={header}
|
|
107
105
|
onSuccess={onSuccess}
|
|
108
106
|
showRecipient={action === "join"}
|
|
109
|
-
clientReferenceId={props.clientReferenceId}
|
|
110
107
|
/>
|
|
111
108
|
);
|
|
112
109
|
}
|
|
@@ -24,7 +24,6 @@ export interface AnySpendDepositHypeProps {
|
|
|
24
24
|
onTokenSelect?: (token: components["schemas"]["Token"], event: { preventDefault: () => void }) => void;
|
|
25
25
|
customUsdInputValues?: string[];
|
|
26
26
|
preferEoa?: boolean;
|
|
27
|
-
clientReferenceId?: string;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
export function AnySpendDepositHype({
|
|
@@ -39,7 +38,6 @@ export function AnySpendDepositHype({
|
|
|
39
38
|
onTokenSelect,
|
|
40
39
|
customUsdInputValues,
|
|
41
40
|
preferEoa,
|
|
42
|
-
clientReferenceId,
|
|
43
41
|
}: AnySpendDepositHypeProps) {
|
|
44
42
|
if (!recipientAddress) return null;
|
|
45
43
|
|
|
@@ -81,7 +79,6 @@ export function AnySpendDepositHype({
|
|
|
81
79
|
onTokenSelect={onTokenSelect}
|
|
82
80
|
customUsdInputValues={customUsdInputValues}
|
|
83
81
|
preferEoa={preferEoa}
|
|
84
|
-
clientReferenceId={clientReferenceId}
|
|
85
82
|
/>
|
|
86
83
|
);
|
|
87
84
|
}
|
|
@@ -47,14 +47,12 @@ export function AnyspendSignatureMint({
|
|
|
47
47
|
signatureData,
|
|
48
48
|
imageUrl,
|
|
49
49
|
onSuccess,
|
|
50
|
-
clientReferenceId,
|
|
51
50
|
}: {
|
|
52
51
|
loadOrder?: string;
|
|
53
52
|
mode?: "modal" | "page";
|
|
54
53
|
signatureData: GenerateSigMintResponse;
|
|
55
54
|
imageUrl?: string;
|
|
56
55
|
onSuccess?: (txHash?: string) => void;
|
|
57
|
-
clientReferenceId?: string;
|
|
58
56
|
}) {
|
|
59
57
|
// Get token data
|
|
60
58
|
const {
|
|
@@ -151,7 +149,6 @@ export function AnyspendSignatureMint({
|
|
|
151
149
|
header={header}
|
|
152
150
|
onSuccess={onSuccess}
|
|
153
151
|
showRecipient={true}
|
|
154
|
-
clientReferenceId={clientReferenceId}
|
|
155
152
|
/>
|
|
156
153
|
);
|
|
157
154
|
}
|
|
@@ -55,7 +55,6 @@ export function useAnyspendCreateOnrampOrder({ onSuccess, onError }: UseAnyspend
|
|
|
55
55
|
tournament,
|
|
56
56
|
payload,
|
|
57
57
|
partnerId,
|
|
58
|
-
clientReferenceId,
|
|
59
58
|
} = params;
|
|
60
59
|
|
|
61
60
|
try {
|
|
@@ -103,7 +102,6 @@ export function useAnyspendCreateOnrampOrder({ onSuccess, onError }: UseAnyspend
|
|
|
103
102
|
}),
|
|
104
103
|
creatorAddress: creatorAddress ? normalizeAddress(creatorAddress) : undefined,
|
|
105
104
|
partnerId,
|
|
106
|
-
clientReferenceId,
|
|
107
105
|
visitorData,
|
|
108
106
|
});
|
|
109
107
|
} catch (error: any) {
|
|
@@ -20,7 +20,6 @@ export type CreateOrderParams = {
|
|
|
20
20
|
creatorAddress?: string;
|
|
21
21
|
payload?: any;
|
|
22
22
|
partnerId?: string;
|
|
23
|
-
clientReferenceId?: string;
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
export type UseAnyspendCreateOrderProps = {
|
|
@@ -42,17 +41,7 @@ export function useAnyspendCreateOrder({ onSuccess, onError }: UseAnyspendCreate
|
|
|
42
41
|
};
|
|
43
42
|
const { mutate: createOrder, isPending } = useMutation({
|
|
44
43
|
mutationFn: async (params: CreateOrderParams) => {
|
|
45
|
-
const {
|
|
46
|
-
recipientAddress,
|
|
47
|
-
orderType,
|
|
48
|
-
srcChain,
|
|
49
|
-
dstChain,
|
|
50
|
-
srcToken,
|
|
51
|
-
dstToken,
|
|
52
|
-
srcAmount,
|
|
53
|
-
creatorAddress,
|
|
54
|
-
clientReferenceId,
|
|
55
|
-
} = params;
|
|
44
|
+
const { recipientAddress, orderType, srcChain, dstChain, srcToken, dstToken, srcAmount, creatorAddress } = params;
|
|
56
45
|
|
|
57
46
|
try {
|
|
58
47
|
return await anyspendService.createOrder({
|
|
@@ -86,7 +75,6 @@ export function useAnyspendCreateOrder({ onSuccess, onError }: UseAnyspendCreate
|
|
|
86
75
|
},
|
|
87
76
|
}),
|
|
88
77
|
creatorAddress: creatorAddress ? normalizeAddress(creatorAddress) : undefined,
|
|
89
|
-
clientReferenceId,
|
|
90
78
|
visitorData,
|
|
91
79
|
});
|
|
92
80
|
} catch (error: any) {
|
|
@@ -67,7 +67,6 @@ export const anyspendService = {
|
|
|
67
67
|
metadata,
|
|
68
68
|
creatorAddress,
|
|
69
69
|
partnerId,
|
|
70
|
-
clientReferenceId,
|
|
71
70
|
visitorData,
|
|
72
71
|
}: {
|
|
73
72
|
recipientAddress: string;
|
|
@@ -82,7 +81,6 @@ export const anyspendService = {
|
|
|
82
81
|
metadata: Record<string, any>;
|
|
83
82
|
creatorAddress?: string;
|
|
84
83
|
partnerId?: string;
|
|
85
|
-
clientReferenceId?: string;
|
|
86
84
|
visitorData?: VisitorData;
|
|
87
85
|
}) => {
|
|
88
86
|
const response = await fetch(`${ANYSPEND_MAINNET_BASE_URL}/orders`, {
|
|
@@ -105,7 +103,6 @@ export const anyspendService = {
|
|
|
105
103
|
metadata,
|
|
106
104
|
creatorAddress,
|
|
107
105
|
partnerId,
|
|
108
|
-
...(clientReferenceId && { clientReferenceId }),
|
|
109
106
|
}),
|
|
110
107
|
});
|
|
111
108
|
const data: CreateOrderResponse = await response.json();
|