@b3dotfun/sdk 0.0.29-alpha.1 → 0.0.29-alpha.2
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/constants/index.d.ts +1 -0
- package/dist/cjs/anyspend/constants/index.js +2 -1
- package/dist/cjs/anyspend/react/components/AnySpend.js +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +1 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +4 -2
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +9 -8
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +6 -4
- package/dist/cjs/anyspend/react/components/common/OrderStatus.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/OrderStatus.js +2 -2
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +2 -0
- package/dist/esm/anyspend/constants/index.d.ts +1 -0
- package/dist/esm/anyspend/constants/index.js +1 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +1 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +4 -2
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +11 -10
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +7 -5
- package/dist/esm/anyspend/react/components/common/OrderStatus.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/OrderStatus.js +2 -2
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +2 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/constants/index.d.ts +1 -0
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +4 -2
- package/dist/types/anyspend/react/components/common/OrderStatus.d.ts +2 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +2 -0
- package/package.json +1 -1
- package/src/anyspend/constants/index.ts +2 -0
- package/src/anyspend/react/components/AnySpend.tsx +1 -1
- package/src/anyspend/react/components/AnySpendCustom.tsx +1 -1
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +131 -129
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +10 -4
- package/src/anyspend/react/components/common/OrderStatus.tsx +9 -2
- package/src/global-account/react/stores/useModalStore.ts +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B3_TOKEN } from "@b3dotfun/sdk/anyspend";
|
|
1
|
+
import { B3_TOKEN, DEPOSIT_HYPE_ACTION } from "@b3dotfun/sdk/anyspend";
|
|
2
2
|
import { Button, ShinyButton, StyleRoot, TransitionPanel } from "@b3dotfun/sdk/global-account/react";
|
|
3
3
|
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
4
4
|
import invariant from "invariant";
|
|
@@ -32,7 +32,7 @@ function generateEncodedDataForDepositHype(amount: string, beneficiary: string):
|
|
|
32
32
|
return encodedData;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export
|
|
35
|
+
export interface AnySpendDepositHypeProps {
|
|
36
36
|
loadOrder?: string;
|
|
37
37
|
mode?: "modal" | "page";
|
|
38
38
|
recipientAddress: string;
|
|
@@ -41,7 +41,10 @@ export function AnySpendDepositHype(props: {
|
|
|
41
41
|
sourceTokenChainId?: number;
|
|
42
42
|
onSuccess?: () => void;
|
|
43
43
|
depositContractAddress?: string;
|
|
44
|
-
|
|
44
|
+
mainFooter?: React.ReactNode;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function AnySpendDepositHype(props: AnySpendDepositHypeProps) {
|
|
45
48
|
const fingerprintConfig = getFingerprintConfig();
|
|
46
49
|
|
|
47
50
|
return (
|
|
@@ -60,16 +63,8 @@ function AnySpendDepositHypeInner({
|
|
|
60
63
|
sourceTokenChainId,
|
|
61
64
|
onSuccess,
|
|
62
65
|
depositContractAddress,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
mode?: "modal" | "page";
|
|
66
|
-
recipientAddress: string;
|
|
67
|
-
paymentType?: "crypto" | "fiat";
|
|
68
|
-
sourceTokenAddress?: string;
|
|
69
|
-
sourceTokenChainId?: number;
|
|
70
|
-
onSuccess?: () => void;
|
|
71
|
-
depositContractAddress?: string;
|
|
72
|
-
}) {
|
|
66
|
+
mainFooter,
|
|
67
|
+
}: AnySpendDepositHypeProps) {
|
|
73
68
|
// Use shared flow hook
|
|
74
69
|
const {
|
|
75
70
|
activePanel,
|
|
@@ -185,6 +180,125 @@ function AnySpendDepositHypeInner({
|
|
|
185
180
|
}
|
|
186
181
|
};
|
|
187
182
|
|
|
183
|
+
const mainView = (
|
|
184
|
+
<div className="mx-auto flex w-[460px] max-w-full flex-col items-center gap-2">
|
|
185
|
+
{/* Header */}
|
|
186
|
+
<div className="mb-4 flex flex-col items-center gap-3 text-center">
|
|
187
|
+
<div>
|
|
188
|
+
<h1 className="text-as-primary text-xl font-bold">
|
|
189
|
+
{paymentType === "crypto" ? "Deposit Crypto" : "Fund with Fiat"}
|
|
190
|
+
</h1>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
<div className="relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2">
|
|
195
|
+
<div className="relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2">
|
|
196
|
+
{/* Send section */}
|
|
197
|
+
{paymentType === "crypto" ? (
|
|
198
|
+
<PaySection
|
|
199
|
+
paymentType="crypto"
|
|
200
|
+
selectedSrcChainId={selectedSrcChainId}
|
|
201
|
+
setSelectedSrcChainId={setSelectedSrcChainId}
|
|
202
|
+
selectedSrcToken={selectedSrcToken}
|
|
203
|
+
setSelectedSrcToken={setSelectedSrcToken}
|
|
204
|
+
srcAmount={srcAmount}
|
|
205
|
+
setSrcAmount={setSrcAmount}
|
|
206
|
+
setIsSrcInputDirty={setIsSrcInputDirty}
|
|
207
|
+
selectedCryptoPaymentMethod={selectedCryptoPaymentMethod}
|
|
208
|
+
selectedFiatPaymentMethod={selectedFiatPaymentMethod}
|
|
209
|
+
onSelectCryptoPaymentMethod={() => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD)}
|
|
210
|
+
onSelectFiatPaymentMethod={() => setActivePanel(PanelView.FIAT_PAYMENT_METHOD)}
|
|
211
|
+
anyspendQuote={anyspendQuote}
|
|
212
|
+
/>
|
|
213
|
+
) : (
|
|
214
|
+
<motion.div
|
|
215
|
+
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
216
|
+
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
217
|
+
transition={{ duration: 0.3, delay: 0, ease: "easeInOut" }}
|
|
218
|
+
>
|
|
219
|
+
<PanelOnramp
|
|
220
|
+
srcAmountOnRamp={srcAmount}
|
|
221
|
+
setSrcAmountOnRamp={setSrcAmount}
|
|
222
|
+
selectedPaymentMethod={selectedFiatPaymentMethod}
|
|
223
|
+
setActivePanel={setActivePanel}
|
|
224
|
+
_recipientAddress={recipientAddress}
|
|
225
|
+
destinationToken={B3_TOKEN}
|
|
226
|
+
destinationChainId={base.id}
|
|
227
|
+
destinationAmount={dstAmount}
|
|
228
|
+
onDestinationTokenChange={() => {}}
|
|
229
|
+
onDestinationChainChange={() => {}}
|
|
230
|
+
fiatPaymentMethodIndex={PanelView.FIAT_PAYMENT_METHOD}
|
|
231
|
+
/>
|
|
232
|
+
</motion.div>
|
|
233
|
+
)}
|
|
234
|
+
|
|
235
|
+
{/* Reverse swap direction section */}
|
|
236
|
+
<div
|
|
237
|
+
className={cn("relative -my-1 flex h-0 items-center justify-center", paymentType === "fiat" && "hidden")}
|
|
238
|
+
>
|
|
239
|
+
<Button
|
|
240
|
+
variant="ghost"
|
|
241
|
+
className={cn(
|
|
242
|
+
"swap-direction-button border-as-stroke bg-as-surface-primary z-10 h-10 w-10 cursor-default rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl",
|
|
243
|
+
)}
|
|
244
|
+
>
|
|
245
|
+
<div className="relative flex items-center justify-center transition-opacity">
|
|
246
|
+
<ArrowDown className="text-as-primary/50 h-5 w-5" />
|
|
247
|
+
</div>
|
|
248
|
+
</Button>
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
{/* Receive section - Hidden when fiat tab is active */}
|
|
252
|
+
{paymentType === "crypto" && (
|
|
253
|
+
<CryptoReceiveSection
|
|
254
|
+
isDepositMode={false}
|
|
255
|
+
isBuyMode={true}
|
|
256
|
+
selectedRecipientAddress={recipientAddress}
|
|
257
|
+
recipientName={recipientName || undefined}
|
|
258
|
+
onSelectRecipient={() => setActivePanel(PanelView.RECIPIENT_SELECTION)}
|
|
259
|
+
dstAmount={dstAmount}
|
|
260
|
+
dstToken={B3_TOKEN}
|
|
261
|
+
selectedDstChainId={base.id}
|
|
262
|
+
setSelectedDstChainId={() => {}}
|
|
263
|
+
setSelectedDstToken={() => {}}
|
|
264
|
+
onChangeDstAmount={value => {
|
|
265
|
+
setIsSrcInputDirty(false);
|
|
266
|
+
setSrcAmount(value);
|
|
267
|
+
}}
|
|
268
|
+
anyspendQuote={anyspendQuote}
|
|
269
|
+
/>
|
|
270
|
+
)}
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
{/* Error message section */}
|
|
275
|
+
<ErrorSection error={getAnyspendQuoteError} />
|
|
276
|
+
|
|
277
|
+
{/* Main button section */}
|
|
278
|
+
<motion.div
|
|
279
|
+
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
280
|
+
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
281
|
+
transition={{ duration: 0.3, delay: 0.2, ease: "easeInOut" }}
|
|
282
|
+
className={cn("mt-4 flex w-full max-w-[460px] flex-col gap-2", getAnyspendQuoteError && "mt-0")}
|
|
283
|
+
>
|
|
284
|
+
<ShinyButton
|
|
285
|
+
accentColor={"hsl(var(--as-brand))"}
|
|
286
|
+
disabled={btnInfo.disable}
|
|
287
|
+
onClick={onMainButtonClick}
|
|
288
|
+
className={cn(
|
|
289
|
+
"as-main-button relative w-full",
|
|
290
|
+
btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand",
|
|
291
|
+
)}
|
|
292
|
+
textClassName={cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white")}
|
|
293
|
+
>
|
|
294
|
+
{btnInfo.text}
|
|
295
|
+
</ShinyButton>
|
|
296
|
+
</motion.div>
|
|
297
|
+
|
|
298
|
+
{mainFooter ? mainFooter : null}
|
|
299
|
+
</div>
|
|
300
|
+
);
|
|
301
|
+
|
|
188
302
|
// Handle crypto order creation
|
|
189
303
|
const handleCryptoOrder = async () => {
|
|
190
304
|
try {
|
|
@@ -209,7 +323,7 @@ function AnySpendDepositHypeInner({
|
|
|
209
323
|
amount: depositAmountWei,
|
|
210
324
|
data: encodedData,
|
|
211
325
|
to: depositContractAddress,
|
|
212
|
-
action:
|
|
326
|
+
action: DEPOSIT_HYPE_ACTION,
|
|
213
327
|
},
|
|
214
328
|
});
|
|
215
329
|
} catch (err: any) {
|
|
@@ -274,7 +388,7 @@ function AnySpendDepositHypeInner({
|
|
|
274
388
|
amount: depositAmountWei,
|
|
275
389
|
data: encodedData,
|
|
276
390
|
to: depositContractAddress,
|
|
277
|
-
action:
|
|
391
|
+
action: DEPOSIT_HYPE_ACTION,
|
|
278
392
|
},
|
|
279
393
|
});
|
|
280
394
|
} catch (err: any) {
|
|
@@ -289,7 +403,7 @@ function AnySpendDepositHypeInner({
|
|
|
289
403
|
<div className="relative flex flex-col gap-4">
|
|
290
404
|
{oat && (
|
|
291
405
|
<>
|
|
292
|
-
<OrderStatus order={oat.data.order} />
|
|
406
|
+
<OrderStatus order={oat.data.order} selectedCryptoPaymentMethod={selectedCryptoPaymentMethod} />
|
|
293
407
|
<OrderDetails
|
|
294
408
|
mode={mode}
|
|
295
409
|
order={oat.data.order}
|
|
@@ -388,119 +502,7 @@ function AnySpendDepositHypeInner({
|
|
|
388
502
|
>
|
|
389
503
|
{[
|
|
390
504
|
<div key="main-view" className={cn(mode === "page" && "p-6")}>
|
|
391
|
-
|
|
392
|
-
{/* Header */}
|
|
393
|
-
<div className="mb-4 flex flex-col items-center gap-3 text-center">
|
|
394
|
-
<div>
|
|
395
|
-
<h1 className="text-as-primary text-xl font-bold">
|
|
396
|
-
{paymentType === "crypto" ? "Deposit Crypto" : "Fund with Fiat"}
|
|
397
|
-
</h1>
|
|
398
|
-
</div>
|
|
399
|
-
</div>
|
|
400
|
-
|
|
401
|
-
<div className="relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2">
|
|
402
|
-
<div className="relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2">
|
|
403
|
-
{/* Send section */}
|
|
404
|
-
{paymentType === "crypto" ? (
|
|
405
|
-
<PaySection
|
|
406
|
-
paymentType="crypto"
|
|
407
|
-
selectedSrcChainId={selectedSrcChainId}
|
|
408
|
-
setSelectedSrcChainId={setSelectedSrcChainId}
|
|
409
|
-
selectedSrcToken={selectedSrcToken}
|
|
410
|
-
setSelectedSrcToken={setSelectedSrcToken}
|
|
411
|
-
srcAmount={srcAmount}
|
|
412
|
-
setSrcAmount={setSrcAmount}
|
|
413
|
-
setIsSrcInputDirty={setIsSrcInputDirty}
|
|
414
|
-
selectedCryptoPaymentMethod={selectedCryptoPaymentMethod}
|
|
415
|
-
selectedFiatPaymentMethod={selectedFiatPaymentMethod}
|
|
416
|
-
onSelectCryptoPaymentMethod={() => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD)}
|
|
417
|
-
onSelectFiatPaymentMethod={() => setActivePanel(PanelView.FIAT_PAYMENT_METHOD)}
|
|
418
|
-
anyspendQuote={anyspendQuote}
|
|
419
|
-
/>
|
|
420
|
-
) : (
|
|
421
|
-
<motion.div
|
|
422
|
-
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
423
|
-
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
424
|
-
transition={{ duration: 0.3, delay: 0, ease: "easeInOut" }}
|
|
425
|
-
>
|
|
426
|
-
<PanelOnramp
|
|
427
|
-
srcAmountOnRamp={srcAmount}
|
|
428
|
-
setSrcAmountOnRamp={setSrcAmount}
|
|
429
|
-
selectedPaymentMethod={selectedFiatPaymentMethod}
|
|
430
|
-
setActivePanel={setActivePanel}
|
|
431
|
-
_recipientAddress={recipientAddress}
|
|
432
|
-
destinationToken={B3_TOKEN}
|
|
433
|
-
destinationChainId={base.id}
|
|
434
|
-
destinationAmount={dstAmount}
|
|
435
|
-
onDestinationTokenChange={() => {}}
|
|
436
|
-
onDestinationChainChange={() => {}}
|
|
437
|
-
fiatPaymentMethodIndex={PanelView.FIAT_PAYMENT_METHOD}
|
|
438
|
-
/>
|
|
439
|
-
</motion.div>
|
|
440
|
-
)}
|
|
441
|
-
|
|
442
|
-
{/* Reverse swap direction section */}
|
|
443
|
-
<Button
|
|
444
|
-
variant="ghost"
|
|
445
|
-
className={cn(
|
|
446
|
-
"swap-direction-button border-as-stroke bg-as-surface-primary absolute left-1/2 top-[calc(50%+56px)] z-10 h-10 w-10 -translate-x-1/2 -translate-y-1/2 cursor-default rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl",
|
|
447
|
-
paymentType === "fiat" && "hidden",
|
|
448
|
-
)}
|
|
449
|
-
>
|
|
450
|
-
<div className="relative flex items-center justify-center transition-opacity">
|
|
451
|
-
<ArrowDown className="text-as-primary/50 h-5 w-5" />
|
|
452
|
-
</div>
|
|
453
|
-
</Button>
|
|
454
|
-
|
|
455
|
-
{/* Receive section - Hidden when fiat tab is active */}
|
|
456
|
-
{paymentType === "crypto" && (
|
|
457
|
-
<CryptoReceiveSection
|
|
458
|
-
isDepositMode={false}
|
|
459
|
-
isBuyMode={true}
|
|
460
|
-
selectedRecipientAddress={recipientAddress}
|
|
461
|
-
recipientName={recipientName || undefined}
|
|
462
|
-
onSelectRecipient={() => setActivePanel(PanelView.RECIPIENT_SELECTION)}
|
|
463
|
-
dstAmount={dstAmount}
|
|
464
|
-
dstToken={B3_TOKEN}
|
|
465
|
-
selectedDstChainId={base.id}
|
|
466
|
-
setSelectedDstChainId={() => {}}
|
|
467
|
-
setSelectedDstToken={() => {}}
|
|
468
|
-
onChangeDstAmount={value => {
|
|
469
|
-
setIsSrcInputDirty(false);
|
|
470
|
-
setSrcAmount(value);
|
|
471
|
-
}}
|
|
472
|
-
anyspendQuote={anyspendQuote}
|
|
473
|
-
/>
|
|
474
|
-
)}
|
|
475
|
-
</div>
|
|
476
|
-
</div>
|
|
477
|
-
|
|
478
|
-
{/* Error message section */}
|
|
479
|
-
<ErrorSection error={getAnyspendQuoteError} />
|
|
480
|
-
|
|
481
|
-
{/* Main button section */}
|
|
482
|
-
<motion.div
|
|
483
|
-
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
484
|
-
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
485
|
-
transition={{ duration: 0.3, delay: 0.2, ease: "easeInOut" }}
|
|
486
|
-
className={cn("mt-4 flex w-full max-w-[460px] flex-col gap-2", getAnyspendQuoteError && "mt-0")}
|
|
487
|
-
>
|
|
488
|
-
<ShinyButton
|
|
489
|
-
accentColor={"hsl(var(--as-brand))"}
|
|
490
|
-
disabled={btnInfo.disable}
|
|
491
|
-
onClick={onMainButtonClick}
|
|
492
|
-
className={cn(
|
|
493
|
-
"as-main-button relative w-full",
|
|
494
|
-
btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand",
|
|
495
|
-
)}
|
|
496
|
-
textClassName={cn(
|
|
497
|
-
btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white",
|
|
498
|
-
)}
|
|
499
|
-
>
|
|
500
|
-
{btnInfo.text}
|
|
501
|
-
</ShinyButton>
|
|
502
|
-
</motion.div>
|
|
503
|
-
</div>
|
|
505
|
+
{mainView}
|
|
504
506
|
</div>,
|
|
505
507
|
<div key="crypto-payment-method-view" className={cn(mode === "page" && "p-6")}>
|
|
506
508
|
{cryptoPaymentMethodView}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { ALL_CHAINS, capitalizeFirstLetter, getChainName } from "@b3dotfun/sdk/anyspend";
|
|
3
|
+
import { ALL_CHAINS, capitalizeFirstLetter, DEPOSIT_HYPE_ACTION, getChainName } from "@b3dotfun/sdk/anyspend";
|
|
4
4
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
5
5
|
import { CopyToClipboard } from "@b3dotfun/sdk/global-account/react";
|
|
6
6
|
import { cn } from "@b3dotfun/sdk/shared/utils";
|
|
@@ -94,9 +94,11 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({
|
|
|
94
94
|
: order.type === "fund_tournament"
|
|
95
95
|
? "Fund tournament"
|
|
96
96
|
: order.type === "custom"
|
|
97
|
-
? order.metadata.action
|
|
98
|
-
?
|
|
99
|
-
:
|
|
97
|
+
? order.metadata.action === DEPOSIT_HYPE_ACTION
|
|
98
|
+
? "Deposit HYPE"
|
|
99
|
+
: order.metadata.action
|
|
100
|
+
? capitalizeFirstLetter(order.metadata.action)
|
|
101
|
+
: "Contract execution"
|
|
100
102
|
: ""}
|
|
101
103
|
</div>
|
|
102
104
|
|
|
@@ -113,6 +115,10 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({
|
|
|
113
115
|
<img src={tournament?.imageUrl} alt={tournament?.name || "Tournament"} className="h-5 w-5" />
|
|
114
116
|
<div>{tournament?.name || "Tournament"}</div>
|
|
115
117
|
</div>
|
|
118
|
+
) : order.type === "custom" && order.metadata.action === DEPOSIT_HYPE_ACTION ? (
|
|
119
|
+
<div className="flex items-center gap-2">
|
|
120
|
+
<div>{formatTokenAmount(BigInt(order.payload.amount), dstToken.decimals)} HYPE</div>
|
|
121
|
+
</div>
|
|
116
122
|
) : null}
|
|
117
123
|
|
|
118
124
|
<div className="text-as-primary/50 flex items-center gap-2">
|
|
@@ -3,13 +3,20 @@ import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
|
3
3
|
import { useSearchParams } from "@b3dotfun/sdk/shared/react";
|
|
4
4
|
import { Check, X } from "lucide-react";
|
|
5
5
|
import { memo } from "react";
|
|
6
|
+
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
6
7
|
import { Step, StepProgress } from "./StepProgress";
|
|
7
8
|
|
|
8
|
-
export const OrderStatus = memo(function OrderStatus({
|
|
9
|
+
export const OrderStatus = memo(function OrderStatus({
|
|
10
|
+
order,
|
|
11
|
+
selectedCryptoPaymentMethod,
|
|
12
|
+
}: {
|
|
13
|
+
order: components["schemas"]["Order"];
|
|
14
|
+
selectedCryptoPaymentMethod?: CryptoPaymentMethodType;
|
|
15
|
+
}) {
|
|
9
16
|
const isComplete = order.status === "executed";
|
|
10
17
|
const { text, status: displayStatus, description } = getStatusDisplay(order);
|
|
11
18
|
const searchParams = useSearchParams();
|
|
12
|
-
const cryptoPaymentMethod = searchParams.get("cryptoPaymentMethod");
|
|
19
|
+
const cryptoPaymentMethod = selectedCryptoPaymentMethod || searchParams.get("cryptoPaymentMethod");
|
|
13
20
|
|
|
14
21
|
console.log("OrderStatus", displayStatus);
|
|
15
22
|
console.log("OrderStatus", order);
|
|
@@ -318,6 +318,8 @@ export interface AnySpendDepositHypeProps extends BaseModalProps {
|
|
|
318
318
|
paymentType?: "crypto" | "fiat";
|
|
319
319
|
/** Deposit contract address */
|
|
320
320
|
depositContractAddress: string;
|
|
321
|
+
/** Main footer */
|
|
322
|
+
mainFooter?: React.ReactNode;
|
|
321
323
|
/** Callback function called when the deposit is successful */
|
|
322
324
|
onSuccess?: () => void;
|
|
323
325
|
}
|