@b3dotfun/sdk 0.1.65 → 0.1.66-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.
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +7 -16
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +6 -1
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +151 -22
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +4 -50
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +4 -2
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +31 -0
- package/dist/cjs/anyspend/react/components/AnySpendWorkflowTrigger.js +14 -0
- package/dist/cjs/anyspend/react/components/QRDeposit.js +5 -13
- package/dist/cjs/anyspend/react/components/ccShopAbi.d.ts +113 -0
- package/dist/cjs/anyspend/react/components/ccShopAbi.js +63 -0
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.d.ts +1 -3
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +3 -3
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.d.ts +1 -4
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.js +3 -57
- package/dist/cjs/anyspend/react/components/common/PaySection.js +1 -1
- package/dist/cjs/anyspend/react/components/index.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/index.js +3 -1
- package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/hooks/index.js +1 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +1 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -0
- package/dist/cjs/anyspend/react/hooks/useOnOrderSuccess.d.ts +10 -0
- package/dist/cjs/anyspend/react/hooks/useOnOrderSuccess.js +27 -0
- package/dist/cjs/anyspend/services/anyspend.d.ts +2 -1
- package/dist/cjs/anyspend/services/anyspend.js +2 -1
- package/dist/cjs/anyspend/utils/chain.d.ts +1 -1
- package/dist/cjs/anyspend/utils/chain.js +72 -62
- package/dist/cjs/app.shared.js +8 -0
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +4 -0
- package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +4 -4
- package/dist/cjs/global-account/react/hooks/useUserQuery.js +10 -0
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +37 -1
- package/dist/cjs/global-account/react/stores/userStore.js +1 -0
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +7 -16
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +6 -1
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +152 -23
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +4 -17
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +4 -2
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +31 -0
- package/dist/esm/anyspend/react/components/AnySpendWorkflowTrigger.js +11 -0
- package/dist/esm/anyspend/react/components/QRDeposit.js +6 -14
- package/dist/esm/anyspend/react/components/ccShopAbi.d.ts +113 -0
- package/dist/esm/anyspend/react/components/ccShopAbi.js +60 -0
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.d.ts +1 -3
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +3 -3
- package/dist/esm/anyspend/react/components/common/OrderTokenAmount.d.ts +1 -4
- package/dist/esm/anyspend/react/components/common/OrderTokenAmount.js +2 -56
- package/dist/esm/anyspend/react/components/common/PaySection.js +1 -1
- package/dist/esm/anyspend/react/components/index.d.ts +2 -0
- package/dist/esm/anyspend/react/components/index.js +1 -0
- package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/esm/anyspend/react/hooks/index.js +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -0
- package/dist/esm/anyspend/react/hooks/useOnOrderSuccess.d.ts +10 -0
- package/dist/esm/anyspend/react/hooks/useOnOrderSuccess.js +24 -0
- package/dist/esm/anyspend/services/anyspend.d.ts +2 -1
- package/dist/esm/anyspend/services/anyspend.js +2 -1
- package/dist/esm/anyspend/utils/chain.d.ts +1 -1
- package/dist/esm/anyspend/utils/chain.js +72 -62
- package/dist/esm/app.shared.js +8 -0
- package/dist/esm/global-account/react/components/B3DynamicModal.js +4 -0
- package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +4 -4
- package/dist/esm/global-account/react/hooks/useUserQuery.js +11 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +37 -1
- package/dist/esm/global-account/react/stores/userStore.js +1 -0
- package/dist/types/anyspend/react/components/AnySpend.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +6 -1
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +31 -0
- package/dist/types/anyspend/react/components/ccShopAbi.d.ts +113 -0
- package/dist/types/anyspend/react/components/common/CryptoPaySection.d.ts +1 -3
- package/dist/types/anyspend/react/components/common/OrderTokenAmount.d.ts +1 -4
- package/dist/types/anyspend/react/components/index.d.ts +2 -0
- package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useOnOrderSuccess.d.ts +10 -0
- package/dist/types/anyspend/services/anyspend.d.ts +2 -1
- package/dist/types/anyspend/utils/chain.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +4 -4
- package/dist/types/global-account/react/stores/useModalStore.d.ts +37 -1
- package/package.json +1 -1
- package/src/anyspend/README.md +14 -0
- package/src/anyspend/docs/checkout-sessions.md +228 -0
- package/src/anyspend/docs/components.md +26 -0
- package/src/anyspend/docs/examples.md +58 -0
- package/src/anyspend/docs/hooks.md +32 -0
- package/src/anyspend/llms.txt +185 -0
- package/src/anyspend/react/components/AnySpend.tsx +9 -17
- package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +206 -22
- package/src/anyspend/react/components/AnySpendCustom.tsx +3 -18
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +5 -1
- package/src/anyspend/react/components/AnySpendDeposit.tsx +5 -0
- package/src/anyspend/react/components/AnySpendWorkflowTrigger.tsx +73 -0
- package/src/anyspend/react/components/QRDeposit.tsx +19 -15
- package/src/anyspend/react/components/ccShopAbi.ts +64 -0
- package/src/anyspend/react/components/common/CryptoPaySection.tsx +0 -5
- package/src/anyspend/react/components/common/OrderTokenAmount.tsx +1 -70
- package/src/anyspend/react/components/common/PaySection.tsx +0 -1
- package/src/anyspend/react/components/index.ts +2 -0
- package/src/anyspend/react/hooks/index.ts +1 -0
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +1 -0
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +2 -0
- package/src/anyspend/react/hooks/useOnOrderSuccess.ts +36 -0
- package/src/anyspend/services/anyspend.ts +3 -0
- package/src/anyspend/utils/chain.ts +81 -65
- package/src/app.shared.ts +11 -0
- package/src/global-account/react/components/B3DynamicModal.tsx +4 -0
- package/src/global-account/react/hooks/useUserQuery.ts +12 -1
- package/src/global-account/react/stores/useModalStore.ts +39 -2
- package/src/global-account/react/stores/userStore.ts +1 -0
|
@@ -7451,6 +7451,8 @@ export declare function useFirstEOA(chain?: {
|
|
|
7451
7451
|
[x: `bool[${string}]`]: undefined;
|
|
7452
7452
|
[x: `bytes[${string}]`]: undefined;
|
|
7453
7453
|
[x: `bytes1[${string}]`]: undefined;
|
|
7454
|
+
[x: `bytes4[${string}]`]: undefined;
|
|
7455
|
+
[x: `bytes30[${string}]`]: undefined;
|
|
7454
7456
|
[x: `bytes18[${string}]`]: undefined;
|
|
7455
7457
|
[x: `bytes6[${string}]`]: undefined;
|
|
7456
7458
|
[x: `bytes9[${string}]`]: undefined;
|
|
@@ -7458,7 +7460,6 @@ export declare function useFirstEOA(chain?: {
|
|
|
7458
7460
|
[x: `bytes10[${string}]`]: undefined;
|
|
7459
7461
|
[x: `bytes2[${string}]`]: undefined;
|
|
7460
7462
|
[x: `bytes3[${string}]`]: undefined;
|
|
7461
|
-
[x: `bytes4[${string}]`]: undefined;
|
|
7462
7463
|
[x: `bytes5[${string}]`]: undefined;
|
|
7463
7464
|
[x: `bytes7[${string}]`]: undefined;
|
|
7464
7465
|
[x: `bytes11[${string}]`]: undefined;
|
|
@@ -7479,7 +7480,6 @@ export declare function useFirstEOA(chain?: {
|
|
|
7479
7480
|
[x: `bytes27[${string}]`]: undefined;
|
|
7480
7481
|
[x: `bytes28[${string}]`]: undefined;
|
|
7481
7482
|
[x: `bytes29[${string}]`]: undefined;
|
|
7482
|
-
[x: `bytes30[${string}]`]: undefined;
|
|
7483
7483
|
[x: `bytes31[${string}]`]: undefined;
|
|
7484
7484
|
[x: `bytes32[${string}]`]: undefined;
|
|
7485
7485
|
[x: `int[${string}]`]: undefined;
|
|
@@ -7553,6 +7553,8 @@ export declare function useFirstEOA(chain?: {
|
|
|
7553
7553
|
bool?: undefined;
|
|
7554
7554
|
bytes?: undefined;
|
|
7555
7555
|
bytes1?: undefined;
|
|
7556
|
+
bytes4?: undefined;
|
|
7557
|
+
bytes30?: undefined;
|
|
7556
7558
|
bytes18?: undefined;
|
|
7557
7559
|
bytes6?: undefined;
|
|
7558
7560
|
bytes9?: undefined;
|
|
@@ -7560,7 +7562,6 @@ export declare function useFirstEOA(chain?: {
|
|
|
7560
7562
|
bytes10?: undefined;
|
|
7561
7563
|
bytes2?: undefined;
|
|
7562
7564
|
bytes3?: undefined;
|
|
7563
|
-
bytes4?: undefined;
|
|
7564
7565
|
bytes5?: undefined;
|
|
7565
7566
|
bytes7?: undefined;
|
|
7566
7567
|
bytes11?: undefined;
|
|
@@ -7581,7 +7582,6 @@ export declare function useFirstEOA(chain?: {
|
|
|
7581
7582
|
bytes27?: undefined;
|
|
7582
7583
|
bytes28?: undefined;
|
|
7583
7584
|
bytes29?: undefined;
|
|
7584
|
-
bytes30?: undefined;
|
|
7585
7585
|
bytes31?: undefined;
|
|
7586
7586
|
bytes32?: undefined;
|
|
7587
7587
|
int56?: undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
1
|
+
import { useEffect, useLayoutEffect } from "react";
|
|
2
2
|
import { useUserStore } from "../stores/userStore.js";
|
|
3
3
|
const USER_QUERY_KEY = ["b3-user"];
|
|
4
4
|
/**
|
|
@@ -11,6 +11,16 @@ export function useUserQuery() {
|
|
|
11
11
|
const user = useUserStore(state => state.user);
|
|
12
12
|
const setUserStore = useUserStore(state => state.setUser);
|
|
13
13
|
const clearUserStore = useUserStore(state => state.clearUser);
|
|
14
|
+
// Manually rehydrate persisted store inside useLayoutEffect to avoid
|
|
15
|
+
// updating AuthenticationProvider state during Hydrate render.
|
|
16
|
+
// useLayoutEffect (not useEffect) ensures rehydration triggers a
|
|
17
|
+
// synchronous re-render before any useEffect callbacks fire, so
|
|
18
|
+
// downstream effects always see the persisted user value.
|
|
19
|
+
useLayoutEffect(() => {
|
|
20
|
+
if (!useUserStore.persist.hasHydrated()) {
|
|
21
|
+
useUserStore.persist.rehydrate();
|
|
22
|
+
}
|
|
23
|
+
}, []);
|
|
14
24
|
// Listen for storage events from other tabs/windows
|
|
15
25
|
useEffect(() => {
|
|
16
26
|
const handleStorageChange = (e) => {
|
|
@@ -470,11 +470,45 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
|
|
|
470
470
|
forceFiatPayment?: boolean;
|
|
471
471
|
/** Staging environment support */
|
|
472
472
|
isStaging?: boolean;
|
|
473
|
+
/** Optional discount code to apply to the purchase */
|
|
474
|
+
discountCode?: string;
|
|
473
475
|
}
|
|
474
476
|
/**
|
|
475
477
|
* Props for the AnySpend Deposit modal
|
|
476
478
|
* Flexible deposit component with optional chain selection
|
|
477
479
|
*/
|
|
480
|
+
/**
|
|
481
|
+
* Props for the AnySpend Workflow Trigger modal
|
|
482
|
+
* Handles payments that trigger b3os-workflow runs
|
|
483
|
+
*/
|
|
484
|
+
export interface AnySpendWorkflowTriggerModalProps extends BaseModalProps {
|
|
485
|
+
/** Modal type identifier */
|
|
486
|
+
type: "anySpendWorkflowTrigger";
|
|
487
|
+
/** Payment recipient address (hex) */
|
|
488
|
+
recipientAddress: string;
|
|
489
|
+
/** Destination chain ID */
|
|
490
|
+
chainId: number;
|
|
491
|
+
/** Destination token address */
|
|
492
|
+
tokenAddress: string;
|
|
493
|
+
/** Required payment amount in token base units (wei) */
|
|
494
|
+
amount: string;
|
|
495
|
+
/** Workflow ID to trigger */
|
|
496
|
+
workflowId: string;
|
|
497
|
+
/** Organization ID that owns the workflow */
|
|
498
|
+
orgId: string;
|
|
499
|
+
/** Optional callback metadata */
|
|
500
|
+
callbackMetadata?: {
|
|
501
|
+
inputs?: Record<string, unknown>;
|
|
502
|
+
} & Record<string, unknown>;
|
|
503
|
+
/** Callback when payment succeeds */
|
|
504
|
+
onSuccess?: (amount: string) => void;
|
|
505
|
+
/** Callback when modal is closed */
|
|
506
|
+
onClose?: () => void;
|
|
507
|
+
/** Custom action label */
|
|
508
|
+
actionLabel?: string;
|
|
509
|
+
/** Custom class names */
|
|
510
|
+
classes?: AnySpendAllClasses;
|
|
511
|
+
}
|
|
478
512
|
export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
479
513
|
/** Modal type identifier */
|
|
480
514
|
type: "anySpendDeposit";
|
|
@@ -534,11 +568,13 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
534
568
|
classes?: AnySpendAllClasses;
|
|
535
569
|
/** Whether to allow direct transfer without swap */
|
|
536
570
|
allowDirectTransfer?: boolean;
|
|
571
|
+
/** Opaque metadata passed to the order for callbacks (e.g., workflow form data) */
|
|
572
|
+
callbackMetadata?: Record<string, unknown>;
|
|
537
573
|
}
|
|
538
574
|
/**
|
|
539
575
|
* Union type of all possible modal content types
|
|
540
576
|
*/
|
|
541
|
-
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps;
|
|
577
|
+
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps | AnySpendWorkflowTriggerModalProps;
|
|
542
578
|
/**
|
|
543
579
|
* State interface for the modal store
|
|
544
580
|
*/
|
|
@@ -53,4 +53,6 @@ export declare function AnySpend(props: {
|
|
|
53
53
|
allowDirectTransfer?: boolean;
|
|
54
54
|
/** Fixed destination token amount (in wei/smallest unit). When provided, user cannot change the amount. */
|
|
55
55
|
destinationTokenAmount?: string;
|
|
56
|
+
/** Opaque metadata passed to the order for callbacks (e.g., workflow form data) */
|
|
57
|
+
callbackMetadata?: Record<string, unknown>;
|
|
56
58
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -69,5 +69,10 @@ export interface AnySpendCollectorClubPurchaseProps {
|
|
|
69
69
|
* Force fiat payment
|
|
70
70
|
*/
|
|
71
71
|
forceFiatPayment?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Optional discount code to apply to the purchase.
|
|
74
|
+
* When provided, validates on-chain and adjusts the price accordingly.
|
|
75
|
+
*/
|
|
76
|
+
discountCode?: string;
|
|
72
77
|
}
|
|
73
|
-
export declare function AnySpendCollectorClubPurchase({ loadOrder, mode, activeTab, packId, packAmount, pricePerPack, paymentToken, recipientAddress, spenderAddress, isStaging, onSuccess, header, showRecipient, vendingMachineId, packType, forceFiatPayment, }: AnySpendCollectorClubPurchaseProps): import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
export declare function AnySpendCollectorClubPurchase({ loadOrder, mode, activeTab, packId, packAmount, pricePerPack, paymentToken, recipientAddress, spenderAddress, isStaging, onSuccess, header, showRecipient, vendingMachineId, packType, forceFiatPayment, discountCode, }: AnySpendCollectorClubPurchaseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -44,6 +44,8 @@ export interface AnySpendCustomExactInProps {
|
|
|
44
44
|
classes?: AnySpendCustomExactInClasses;
|
|
45
45
|
/** When true, allows direct transfer without swap if source and destination token/chain are the same */
|
|
46
46
|
allowDirectTransfer?: boolean;
|
|
47
|
+
/** Opaque metadata passed to the order for callbacks (e.g., workflow form data) */
|
|
48
|
+
callbackMetadata?: Record<string, unknown>;
|
|
47
49
|
}
|
|
48
50
|
export declare function AnySpendCustomExactIn(props: AnySpendCustomExactInProps): import("react/jsx-runtime").JSX.Element;
|
|
49
51
|
export {};
|
|
@@ -101,6 +101,8 @@ export interface AnySpendDepositProps {
|
|
|
101
101
|
allowDirectTransfer?: boolean;
|
|
102
102
|
/** Fixed destination token amount (in wei/smallest unit). When provided, user cannot change the amount. */
|
|
103
103
|
destinationTokenAmount?: string;
|
|
104
|
+
/** Opaque metadata passed to the order for callbacks (e.g., workflow form data) */
|
|
105
|
+
callbackMetadata?: Record<string, unknown>;
|
|
104
106
|
}
|
|
105
107
|
/**
|
|
106
108
|
* A flexible deposit component that wraps AnySpendCustomExactIn with optional chain selection.
|
|
@@ -137,4 +139,4 @@ export interface AnySpendDepositProps {
|
|
|
137
139
|
* onSuccess={(amount) => console.log(`Deposited ${amount}`)}
|
|
138
140
|
* />
|
|
139
141
|
*/
|
|
140
|
-
export declare function AnySpendDeposit({ loadOrder, mode, recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationTokenAddress, destinationTokenChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains, minPoolSize, topChainsCount, onClose, returnToHomeUrl, customRecipientLabel, returnHomeLabel, isCustomDeposit, classes, allowDirectTransfer, destinationTokenAmount, }: AnySpendDepositProps): import("react/jsx-runtime").JSX.Element | null;
|
|
142
|
+
export declare function AnySpendDeposit({ loadOrder, mode, recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationTokenAddress, destinationTokenChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains, minPoolSize, topChainsCount, onClose, returnToHomeUrl, customRecipientLabel, returnHomeLabel, isCustomDeposit, classes, allowDirectTransfer, destinationTokenAmount, callbackMetadata, }: AnySpendDepositProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AnySpendAllClasses } from "./types/classes";
|
|
2
|
+
export interface AnySpendWorkflowTriggerProps {
|
|
3
|
+
/** Payment recipient address (hex) */
|
|
4
|
+
recipientAddress: string;
|
|
5
|
+
/** Destination chain ID */
|
|
6
|
+
chainId: number;
|
|
7
|
+
/** Destination token address */
|
|
8
|
+
tokenAddress: string;
|
|
9
|
+
/** Required payment amount in token base units (wei) */
|
|
10
|
+
amount: string;
|
|
11
|
+
/** Workflow ID to trigger */
|
|
12
|
+
workflowId: string;
|
|
13
|
+
/** Organization ID that owns the workflow */
|
|
14
|
+
orgId: string;
|
|
15
|
+
/** Optional callback metadata merged into the order */
|
|
16
|
+
callbackMetadata?: {
|
|
17
|
+
/** Passed as trigger result inputs — accessible via {{root.result.inputs.*}} */
|
|
18
|
+
inputs?: Record<string, unknown>;
|
|
19
|
+
} & Record<string, unknown>;
|
|
20
|
+
/** Callback when payment succeeds */
|
|
21
|
+
onSuccess?: (amount: string) => void;
|
|
22
|
+
/** Callback when modal is closed */
|
|
23
|
+
onClose?: () => void;
|
|
24
|
+
/** Display mode */
|
|
25
|
+
mode?: "modal" | "page";
|
|
26
|
+
/** Custom action label */
|
|
27
|
+
actionLabel?: string;
|
|
28
|
+
/** Custom class names */
|
|
29
|
+
classes?: AnySpendAllClasses;
|
|
30
|
+
}
|
|
31
|
+
export declare function AnySpendWorkflowTrigger({ recipientAddress, chainId, tokenAddress, amount, workflowId, orgId, callbackMetadata, onSuccess, onClose, mode, actionLabel, classes, }: AnySpendWorkflowTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export declare const BUY_PACKS_FOR_ABI: {
|
|
2
|
+
readonly inputs: readonly [{
|
|
3
|
+
readonly internalType: "address";
|
|
4
|
+
readonly name: "user";
|
|
5
|
+
readonly type: "address";
|
|
6
|
+
}, {
|
|
7
|
+
readonly internalType: "uint256";
|
|
8
|
+
readonly name: "packId";
|
|
9
|
+
readonly type: "uint256";
|
|
10
|
+
}, {
|
|
11
|
+
readonly internalType: "uint256";
|
|
12
|
+
readonly name: "amount";
|
|
13
|
+
readonly type: "uint256";
|
|
14
|
+
}];
|
|
15
|
+
readonly name: "buyPacksFor";
|
|
16
|
+
readonly outputs: readonly [];
|
|
17
|
+
readonly stateMutability: "nonpayable";
|
|
18
|
+
readonly type: "function";
|
|
19
|
+
};
|
|
20
|
+
export declare const BUY_PACKS_FOR_WITH_DISCOUNT_ABI: {
|
|
21
|
+
readonly inputs: readonly [{
|
|
22
|
+
readonly internalType: "address";
|
|
23
|
+
readonly name: "user";
|
|
24
|
+
readonly type: "address";
|
|
25
|
+
}, {
|
|
26
|
+
readonly internalType: "uint256";
|
|
27
|
+
readonly name: "packId";
|
|
28
|
+
readonly type: "uint256";
|
|
29
|
+
}, {
|
|
30
|
+
readonly internalType: "uint256";
|
|
31
|
+
readonly name: "amount";
|
|
32
|
+
readonly type: "uint256";
|
|
33
|
+
}, {
|
|
34
|
+
readonly internalType: "string";
|
|
35
|
+
readonly name: "discountCode";
|
|
36
|
+
readonly type: "string";
|
|
37
|
+
}];
|
|
38
|
+
readonly name: "buyPacksForWithDiscount";
|
|
39
|
+
readonly outputs: readonly [];
|
|
40
|
+
readonly stateMutability: "nonpayable";
|
|
41
|
+
readonly type: "function";
|
|
42
|
+
};
|
|
43
|
+
export declare const IS_DISCOUNT_CODE_VALID_FOR_PACK_ABI: {
|
|
44
|
+
readonly inputs: readonly [{
|
|
45
|
+
readonly internalType: "string";
|
|
46
|
+
readonly name: "code";
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
}, {
|
|
49
|
+
readonly internalType: "uint256";
|
|
50
|
+
readonly name: "packId";
|
|
51
|
+
readonly type: "uint256";
|
|
52
|
+
}];
|
|
53
|
+
readonly name: "isDiscountCodeValidForPack";
|
|
54
|
+
readonly outputs: readonly [{
|
|
55
|
+
readonly internalType: "bool";
|
|
56
|
+
readonly name: "isValid";
|
|
57
|
+
readonly type: "bool";
|
|
58
|
+
}, {
|
|
59
|
+
readonly internalType: "uint256";
|
|
60
|
+
readonly name: "discountAmount";
|
|
61
|
+
readonly type: "uint256";
|
|
62
|
+
}];
|
|
63
|
+
readonly stateMutability: "view";
|
|
64
|
+
readonly type: "function";
|
|
65
|
+
};
|
|
66
|
+
export declare const GET_DISCOUNT_CODE_ABI: {
|
|
67
|
+
readonly inputs: readonly [{
|
|
68
|
+
readonly internalType: "string";
|
|
69
|
+
readonly name: "code";
|
|
70
|
+
readonly type: "string";
|
|
71
|
+
}];
|
|
72
|
+
readonly name: "getDiscountCode";
|
|
73
|
+
readonly outputs: readonly [{
|
|
74
|
+
readonly components: readonly [{
|
|
75
|
+
readonly internalType: "uint256";
|
|
76
|
+
readonly name: "discountAmount";
|
|
77
|
+
readonly type: "uint256";
|
|
78
|
+
}, {
|
|
79
|
+
readonly internalType: "uint256";
|
|
80
|
+
readonly name: "expiresAt";
|
|
81
|
+
readonly type: "uint256";
|
|
82
|
+
}, {
|
|
83
|
+
readonly internalType: "bool";
|
|
84
|
+
readonly name: "used";
|
|
85
|
+
readonly type: "bool";
|
|
86
|
+
}, {
|
|
87
|
+
readonly internalType: "bool";
|
|
88
|
+
readonly name: "exists";
|
|
89
|
+
readonly type: "bool";
|
|
90
|
+
}, {
|
|
91
|
+
readonly internalType: "uint256";
|
|
92
|
+
readonly name: "maxUses";
|
|
93
|
+
readonly type: "uint256";
|
|
94
|
+
}, {
|
|
95
|
+
readonly internalType: "uint256";
|
|
96
|
+
readonly name: "usedCount";
|
|
97
|
+
readonly type: "uint256";
|
|
98
|
+
}, {
|
|
99
|
+
readonly internalType: "uint256";
|
|
100
|
+
readonly name: "packId";
|
|
101
|
+
readonly type: "uint256";
|
|
102
|
+
}, {
|
|
103
|
+
readonly internalType: "uint256";
|
|
104
|
+
readonly name: "minPurchaseAmount";
|
|
105
|
+
readonly type: "uint256";
|
|
106
|
+
}];
|
|
107
|
+
readonly internalType: "struct CCShop.DiscountCode";
|
|
108
|
+
readonly name: "";
|
|
109
|
+
readonly type: "tuple";
|
|
110
|
+
}];
|
|
111
|
+
readonly stateMutability: "view";
|
|
112
|
+
readonly type: "function";
|
|
113
|
+
};
|
|
@@ -18,8 +18,6 @@ interface CryptoPaySectionProps {
|
|
|
18
18
|
}) => void;
|
|
19
19
|
onShowFeeDetail?: () => void;
|
|
20
20
|
classes?: CryptoPaySectionClasses;
|
|
21
|
-
/** When true, skip auto-setting max balance when token changes (used for fixed destination amount mode) */
|
|
22
|
-
skipAutoMaxOnTokenChange?: boolean;
|
|
23
21
|
}
|
|
24
|
-
export declare function CryptoPaySection({ selectedSrcChainId, setSelectedSrcChainId, selectedSrcToken, setSelectedSrcToken, srcAmount, setSrcAmount, isSrcInputDirty, setIsSrcInputDirty, selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod, anyspendQuote, onTokenSelect, onShowFeeDetail, classes,
|
|
22
|
+
export declare function CryptoPaySection({ selectedSrcChainId, setSelectedSrcChainId, selectedSrcToken, setSelectedSrcToken, srcAmount, setSrcAmount, isSrcInputDirty, setIsSrcInputDirty, selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod, anyspendQuote, onTokenSelect, onShowFeeDetail, classes, }: CryptoPaySectionProps): import("react/jsx-runtime").JSX.Element;
|
|
25
23
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
|
-
export declare function OrderTokenAmount({ disabled, inputValue, onChangeInput, context, address, chainId, setChainId, token, setToken, hideTokenSelect, canEditAmount, className, innerClassName, amountClassName, tokenSelectClassName, onTokenSelect,
|
|
2
|
+
export declare function OrderTokenAmount({ disabled, inputValue, onChangeInput, context, address, chainId, setChainId, token, setToken, hideTokenSelect, canEditAmount, className, innerClassName, amountClassName, tokenSelectClassName, onTokenSelect, }: {
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
inputValue: string;
|
|
5
5
|
onChangeInput: (value: string) => void;
|
|
@@ -18,7 +18,4 @@ export declare function OrderTokenAmount({ disabled, inputValue, onChangeInput,
|
|
|
18
18
|
onTokenSelect?: (token: components["schemas"]["Token"], event: {
|
|
19
19
|
preventDefault: () => void;
|
|
20
20
|
}) => void;
|
|
21
|
-
walletAddress?: string | undefined;
|
|
22
|
-
/** When true, skip auto-setting max balance when token changes (used for fixed destination amount mode) */
|
|
23
|
-
skipAutoMaxOnTokenChange?: boolean;
|
|
24
21
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,6 +8,8 @@ export { AnySpendDeposit } from "./AnySpendDeposit";
|
|
|
8
8
|
export type { AnySpendDepositProps, ChainConfig, DepositContractConfig } from "./AnySpendDeposit";
|
|
9
9
|
export type { AnySpendAllClasses, AnySpendClasses, AnySpendCustomExactInClasses, AnySpendDepositClasses, CryptoPaymentMethodClasses, CryptoPaySectionClasses, CryptoReceiveSectionClasses, FiatPaymentMethodClasses, OrderDetailsClasses, PanelOnrampClasses, QRDepositClasses, RecipientSelectionClasses, } from "./types/classes";
|
|
10
10
|
export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
|
|
11
|
+
export { AnySpendWorkflowTrigger } from "./AnySpendWorkflowTrigger";
|
|
12
|
+
export type { AnySpendWorkflowTriggerProps } from "./AnySpendWorkflowTrigger";
|
|
11
13
|
export * from "./AnySpendFingerprintWrapper";
|
|
12
14
|
export { AnySpendNFT } from "./AnySpendNFT";
|
|
13
15
|
export { AnyspendSignatureMint } from "./AnyspendSignatureMint";
|
|
@@ -12,6 +12,7 @@ export * from "./useGasPrice";
|
|
|
12
12
|
export * from "./useGeoOnrampOptions";
|
|
13
13
|
export * from "./useGetGeo";
|
|
14
14
|
export * from "./useHyperliquidTransfer";
|
|
15
|
+
export * from "./useOnOrderSuccess";
|
|
15
16
|
export * from "./useRecipientAddressState";
|
|
16
17
|
export * from "./useSigMint";
|
|
17
18
|
export * from "./useStripeClientSecret";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GetOrderAndTxsResponse } from "../../types/api_req_res";
|
|
2
|
+
/**
|
|
3
|
+
* Hook to call onSuccess callback when an order is executed.
|
|
4
|
+
* Handles fallback to relayTxs when executeTx is null.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useOnOrderSuccess({ orderData, orderId, onSuccess, }: {
|
|
7
|
+
orderData: GetOrderAndTxsResponse | undefined;
|
|
8
|
+
orderId: string | undefined;
|
|
9
|
+
onSuccess?: (txHash?: string) => void;
|
|
10
|
+
}): void;
|
|
@@ -6,7 +6,7 @@ export declare const anyspendService: {
|
|
|
6
6
|
getTokenList: (chainId: number, query: string) => Promise<components["schemas"]["Token"][]>;
|
|
7
7
|
getToken: (chainId: number, tokenAddress: string) => Promise<components["schemas"]["Token"]>;
|
|
8
8
|
getQuote: (req: GetQuoteRequest, partnerId?: string) => Promise<GetQuoteResponse>;
|
|
9
|
-
createOrder: ({ recipientAddress, type, srcChain, dstChain, srcTokenAddress, dstTokenAddress, srcAmount, payload, onramp, metadata, creatorAddress, partnerId, clientReferenceId, visitorData, }: {
|
|
9
|
+
createOrder: ({ recipientAddress, type, srcChain, dstChain, srcTokenAddress, dstTokenAddress, srcAmount, payload, onramp, metadata, creatorAddress, partnerId, clientReferenceId, visitorData, callbackMetadata, }: {
|
|
10
10
|
recipientAddress: string;
|
|
11
11
|
type: string;
|
|
12
12
|
srcChain: number;
|
|
@@ -21,6 +21,7 @@ export declare const anyspendService: {
|
|
|
21
21
|
partnerId?: string;
|
|
22
22
|
clientReferenceId?: string;
|
|
23
23
|
visitorData?: VisitorData;
|
|
24
|
+
callbackMetadata?: Record<string, unknown>;
|
|
24
25
|
}) => Promise<{
|
|
25
26
|
success: boolean;
|
|
26
27
|
message: string;
|
|
@@ -82,7 +82,7 @@ export declare function isTestnet(chainId: number): boolean;
|
|
|
82
82
|
export declare function getDefaultToken(chainId: number): components["schemas"]["Token"];
|
|
83
83
|
export declare function getChainName(chainId: number): string;
|
|
84
84
|
export declare function getCoingeckoName(chainId: number): string | null;
|
|
85
|
-
export declare function getPaymentUrl(address: string, amount: bigint, currency: string, chainId: number, decimals?: number): string;
|
|
85
|
+
export declare function getPaymentUrl(address: string, amount: bigint | undefined, currency: string, chainId: number, decimals?: number): string;
|
|
86
86
|
export declare function getExplorerTxUrl(chainId: number, txHash: string): string;
|
|
87
87
|
export declare function getExplorerAddressUrl(chainId: number, address: string): string;
|
|
88
88
|
export declare function getMulticall3Address(chainId: number): string;
|
|
@@ -7451,6 +7451,8 @@ export declare function useFirstEOA(chain?: {
|
|
|
7451
7451
|
[x: `bool[${string}]`]: undefined;
|
|
7452
7452
|
[x: `bytes[${string}]`]: undefined;
|
|
7453
7453
|
[x: `bytes1[${string}]`]: undefined;
|
|
7454
|
+
[x: `bytes4[${string}]`]: undefined;
|
|
7455
|
+
[x: `bytes30[${string}]`]: undefined;
|
|
7454
7456
|
[x: `bytes18[${string}]`]: undefined;
|
|
7455
7457
|
[x: `bytes6[${string}]`]: undefined;
|
|
7456
7458
|
[x: `bytes9[${string}]`]: undefined;
|
|
@@ -7458,7 +7460,6 @@ export declare function useFirstEOA(chain?: {
|
|
|
7458
7460
|
[x: `bytes10[${string}]`]: undefined;
|
|
7459
7461
|
[x: `bytes2[${string}]`]: undefined;
|
|
7460
7462
|
[x: `bytes3[${string}]`]: undefined;
|
|
7461
|
-
[x: `bytes4[${string}]`]: undefined;
|
|
7462
7463
|
[x: `bytes5[${string}]`]: undefined;
|
|
7463
7464
|
[x: `bytes7[${string}]`]: undefined;
|
|
7464
7465
|
[x: `bytes11[${string}]`]: undefined;
|
|
@@ -7479,7 +7480,6 @@ export declare function useFirstEOA(chain?: {
|
|
|
7479
7480
|
[x: `bytes27[${string}]`]: undefined;
|
|
7480
7481
|
[x: `bytes28[${string}]`]: undefined;
|
|
7481
7482
|
[x: `bytes29[${string}]`]: undefined;
|
|
7482
|
-
[x: `bytes30[${string}]`]: undefined;
|
|
7483
7483
|
[x: `bytes31[${string}]`]: undefined;
|
|
7484
7484
|
[x: `bytes32[${string}]`]: undefined;
|
|
7485
7485
|
[x: `int[${string}]`]: undefined;
|
|
@@ -7553,6 +7553,8 @@ export declare function useFirstEOA(chain?: {
|
|
|
7553
7553
|
bool?: undefined;
|
|
7554
7554
|
bytes?: undefined;
|
|
7555
7555
|
bytes1?: undefined;
|
|
7556
|
+
bytes4?: undefined;
|
|
7557
|
+
bytes30?: undefined;
|
|
7556
7558
|
bytes18?: undefined;
|
|
7557
7559
|
bytes6?: undefined;
|
|
7558
7560
|
bytes9?: undefined;
|
|
@@ -7560,7 +7562,6 @@ export declare function useFirstEOA(chain?: {
|
|
|
7560
7562
|
bytes10?: undefined;
|
|
7561
7563
|
bytes2?: undefined;
|
|
7562
7564
|
bytes3?: undefined;
|
|
7563
|
-
bytes4?: undefined;
|
|
7564
7565
|
bytes5?: undefined;
|
|
7565
7566
|
bytes7?: undefined;
|
|
7566
7567
|
bytes11?: undefined;
|
|
@@ -7581,7 +7582,6 @@ export declare function useFirstEOA(chain?: {
|
|
|
7581
7582
|
bytes27?: undefined;
|
|
7582
7583
|
bytes28?: undefined;
|
|
7583
7584
|
bytes29?: undefined;
|
|
7584
|
-
bytes30?: undefined;
|
|
7585
7585
|
bytes31?: undefined;
|
|
7586
7586
|
bytes32?: undefined;
|
|
7587
7587
|
int56?: undefined;
|
|
@@ -470,11 +470,45 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
|
|
|
470
470
|
forceFiatPayment?: boolean;
|
|
471
471
|
/** Staging environment support */
|
|
472
472
|
isStaging?: boolean;
|
|
473
|
+
/** Optional discount code to apply to the purchase */
|
|
474
|
+
discountCode?: string;
|
|
473
475
|
}
|
|
474
476
|
/**
|
|
475
477
|
* Props for the AnySpend Deposit modal
|
|
476
478
|
* Flexible deposit component with optional chain selection
|
|
477
479
|
*/
|
|
480
|
+
/**
|
|
481
|
+
* Props for the AnySpend Workflow Trigger modal
|
|
482
|
+
* Handles payments that trigger b3os-workflow runs
|
|
483
|
+
*/
|
|
484
|
+
export interface AnySpendWorkflowTriggerModalProps extends BaseModalProps {
|
|
485
|
+
/** Modal type identifier */
|
|
486
|
+
type: "anySpendWorkflowTrigger";
|
|
487
|
+
/** Payment recipient address (hex) */
|
|
488
|
+
recipientAddress: string;
|
|
489
|
+
/** Destination chain ID */
|
|
490
|
+
chainId: number;
|
|
491
|
+
/** Destination token address */
|
|
492
|
+
tokenAddress: string;
|
|
493
|
+
/** Required payment amount in token base units (wei) */
|
|
494
|
+
amount: string;
|
|
495
|
+
/** Workflow ID to trigger */
|
|
496
|
+
workflowId: string;
|
|
497
|
+
/** Organization ID that owns the workflow */
|
|
498
|
+
orgId: string;
|
|
499
|
+
/** Optional callback metadata */
|
|
500
|
+
callbackMetadata?: {
|
|
501
|
+
inputs?: Record<string, unknown>;
|
|
502
|
+
} & Record<string, unknown>;
|
|
503
|
+
/** Callback when payment succeeds */
|
|
504
|
+
onSuccess?: (amount: string) => void;
|
|
505
|
+
/** Callback when modal is closed */
|
|
506
|
+
onClose?: () => void;
|
|
507
|
+
/** Custom action label */
|
|
508
|
+
actionLabel?: string;
|
|
509
|
+
/** Custom class names */
|
|
510
|
+
classes?: AnySpendAllClasses;
|
|
511
|
+
}
|
|
478
512
|
export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
479
513
|
/** Modal type identifier */
|
|
480
514
|
type: "anySpendDeposit";
|
|
@@ -534,11 +568,13 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
534
568
|
classes?: AnySpendAllClasses;
|
|
535
569
|
/** Whether to allow direct transfer without swap */
|
|
536
570
|
allowDirectTransfer?: boolean;
|
|
571
|
+
/** Opaque metadata passed to the order for callbacks (e.g., workflow form data) */
|
|
572
|
+
callbackMetadata?: Record<string, unknown>;
|
|
537
573
|
}
|
|
538
574
|
/**
|
|
539
575
|
* Union type of all possible modal content types
|
|
540
576
|
*/
|
|
541
|
-
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps;
|
|
577
|
+
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps | AnySpendWorkflowTriggerModalProps;
|
|
542
578
|
/**
|
|
543
579
|
* State interface for the modal store
|
|
544
580
|
*/
|
package/package.json
CHANGED
package/src/anyspend/README.md
CHANGED
|
@@ -81,6 +81,7 @@ That's it! Your users can now purchase NFTs with any token from any supported ch
|
|
|
81
81
|
| [🧩 Components API](./docs/components.md) | Pre-built React components for common use cases |
|
|
82
82
|
| [🪝 Hooks API](./docs/hooks.md) | React hooks for custom implementations |
|
|
83
83
|
| [💡 Examples & Use Cases](./docs/examples.md) | Real-world integration examples |
|
|
84
|
+
| [🛒 Checkout Sessions](./docs/checkout-sessions.md) | Stripe-like checkout sessions for merchant integrations |
|
|
84
85
|
| [⚠️ Error Handling](./docs/error-handling.md) | Error handling patterns and troubleshooting |
|
|
85
86
|
| [🤝 Contributing](./docs/contributing.md) | How to contribute to AnySpend |
|
|
86
87
|
|
|
@@ -123,6 +124,19 @@ That's it! Your users can now purchase NFTs with any token from any supported ch
|
|
|
123
124
|
/>
|
|
124
125
|
```
|
|
125
126
|
|
|
127
|
+
### Merchant Checkout Sessions
|
|
128
|
+
```tsx
|
|
129
|
+
<AnySpend
|
|
130
|
+
defaultActiveTab="fiat"
|
|
131
|
+
destinationTokenAddress="0x..." // USDC
|
|
132
|
+
recipientAddress={userAddress}
|
|
133
|
+
checkoutSession={{
|
|
134
|
+
success_url: "https://myshop.com/success?session={SESSION_ID}",
|
|
135
|
+
metadata: { sku: "widget-1" },
|
|
136
|
+
}}
|
|
137
|
+
/>
|
|
138
|
+
```
|
|
139
|
+
|
|
126
140
|
## 🌐 Supported Networks
|
|
127
141
|
|
|
128
142
|
- **Ethereum** (Mainnet & Sepolia)
|