@b3dotfun/sdk 0.0.70-alpha.1 → 0.0.70-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/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/AnySpendCollectorClubPurchase.d.ts +57 -0
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +82 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +1 -3
- 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/components/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/index.js +3 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +5 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +5 -2
- package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/cjs/anyspend/react/hooks/useValidatedClientReferenceId.d.ts +5 -0
- package/dist/cjs/anyspend/react/hooks/useValidatedClientReferenceId.js +35 -0
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +2 -0
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +4 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +4 -3
- package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +1 -0
- package/dist/cjs/global-account/react/components/B3Provider/types.js +1 -0
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +1 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +23 -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/AnySpendCollectorClubPurchase.d.ts +57 -0
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +79 -0
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +1 -3
- 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/components/index.d.ts +1 -0
- package/dist/esm/anyspend/react/components/index.js +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +5 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +5 -2
- package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/esm/anyspend/react/hooks/useValidatedClientReferenceId.d.ts +5 -0
- package/dist/esm/anyspend/react/hooks/useValidatedClientReferenceId.js +32 -0
- package/dist/esm/global-account/react/components/B3DynamicModal.js +3 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +4 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +4 -3
- package/dist/esm/global-account/react/components/B3Provider/types.d.ts +1 -0
- package/dist/esm/global-account/react/components/B3Provider/types.js +1 -0
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +1 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +23 -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/AnySpendCollectorClubPurchase.d.ts +57 -0
- 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/components/index.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/types/anyspend/react/hooks/useValidatedClientReferenceId.d.ts +5 -0
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +4 -2
- package/dist/types/global-account/react/components/B3Provider/types.d.ts +1 -0
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useUserQuery.d.ts +1 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +23 -1
- package/package.json +1 -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/AnySpendCollectorClubPurchase.tsx +178 -0
- package/src/anyspend/react/components/AnySpendCustom.tsx +0 -5
- 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/components/index.ts +1 -0
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +5 -2
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +6 -13
- package/src/anyspend/react/hooks/useValidatedClientReferenceId.ts +40 -0
- package/src/global-account/react/components/B3DynamicModal.tsx +3 -0
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +6 -0
- package/src/global-account/react/components/B3Provider/types.ts +2 -0
- package/src/global-account/react/stores/useModalStore.ts +25 -1
|
@@ -1,10 +1,9 @@
|
|
|
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, }: {
|
|
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;
|
|
10
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -26,7 +26,7 @@ const CONTRACT_URI_ABI = [
|
|
|
26
26
|
type: "function",
|
|
27
27
|
},
|
|
28
28
|
];
|
|
29
|
-
export function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftContract, onSuccess, onShowPointsDetail,
|
|
29
|
+
export function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftContract, onSuccess, onShowPointsDetail, }) {
|
|
30
30
|
const [imageUrlWithFallback, setFallbackImageUrl] = useState(nftContract.imageUrl);
|
|
31
31
|
const [isLoadingFallback, setIsLoadingFallback] = useState(false);
|
|
32
32
|
// Fetch contract metadata when imageUrl is empty
|
|
@@ -86,7 +86,7 @@ export function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftCo
|
|
|
86
86
|
return (_jsx(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: {
|
|
87
87
|
type: "mint_nft",
|
|
88
88
|
nftContract: nftContract,
|
|
89
|
-
}, header: header, onSuccess: onSuccess, onShowPointsDetail: onShowPointsDetail
|
|
89
|
+
}, header: header, onSuccess: onSuccess, onShowPointsDetail: onShowPointsDetail }));
|
|
90
90
|
}
|
|
91
91
|
function DropdownMenu({ nftContract }) {
|
|
92
92
|
const [open, setOpen] = useState(false);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export declare function AnySpendStakeB3({ loadOrder, mode, recipientAddress, stakeAmount, onSuccess,
|
|
1
|
+
export declare function AnySpendStakeB3({ loadOrder, mode, recipientAddress, stakeAmount, onSuccess, }: {
|
|
2
2
|
loadOrder?: string;
|
|
3
3
|
mode?: "modal" | "page";
|
|
4
4
|
recipientAddress: string;
|
|
5
5
|
stakeAmount?: string;
|
|
6
6
|
onSuccess?: () => void;
|
|
7
|
-
clientReferenceId?: string;
|
|
8
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -29,7 +29,7 @@ function generateEncodedDataForStakingB3(amount, beneficiary) {
|
|
|
29
29
|
});
|
|
30
30
|
return encodedData;
|
|
31
31
|
}
|
|
32
|
-
export function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, stakeAmount, onSuccess,
|
|
32
|
+
export function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, stakeAmount, onSuccess, }) {
|
|
33
33
|
const hasMounted = useHasMounted();
|
|
34
34
|
const { setB3ModalOpen } = useModalStore();
|
|
35
35
|
// Wagmi hooks for direct staking
|
|
@@ -271,5 +271,5 @@ export function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, s
|
|
|
271
271
|
const encodedData = generateEncodedDataForStakingB3(userStakeAmount, recipientAddress);
|
|
272
272
|
return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: base.id, dstToken: B3_TOKEN, dstAmount: userStakeAmount, contractAddress: ERC20Staking, encodedData: encodedData, metadata: {
|
|
273
273
|
action: "stake B3",
|
|
274
|
-
}, header: header, onSuccess: onSuccess, showRecipient: true
|
|
274
|
+
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
275
275
|
}
|
|
@@ -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, }: {
|
|
2
2
|
loadOrder?: string;
|
|
3
3
|
mode?: "modal" | "page";
|
|
4
4
|
sourceTokenAddress?: string;
|
|
@@ -6,5 +6,4 @@ export declare function AnySpendStakeB3ExactIn({ loadOrder, mode, sourceTokenAdd
|
|
|
6
6
|
recipientAddress: string;
|
|
7
7
|
stakeAmount?: string;
|
|
8
8
|
onSuccess?: (amount: string) => void;
|
|
9
|
-
clientReferenceId?: string;
|
|
10
9
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -32,7 +32,7 @@ const STAKE_FUNCTION_ABI = JSON.stringify([
|
|
|
32
32
|
outputs: [],
|
|
33
33
|
},
|
|
34
34
|
]);
|
|
35
|
-
export function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess,
|
|
35
|
+
export function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess, }) {
|
|
36
36
|
const hasMounted = useHasMounted();
|
|
37
37
|
const { setB3ModalOpen } = useModalStore();
|
|
38
38
|
// Wagmi hooks for direct staking
|
|
@@ -281,5 +281,5 @@ export function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenA
|
|
|
281
281
|
onSuccess?.(formatTokenAmount(BigInt(userStakeAmount), 18) ?? "");
|
|
282
282
|
}, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary h-14 w-full rounded-xl text-lg font-medium", children: "Done" })] })] }) }));
|
|
283
283
|
}
|
|
284
|
-
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: B3_TOKEN, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess
|
|
284
|
+
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: B3_TOKEN, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
|
|
285
285
|
}
|
|
@@ -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, }: {
|
|
3
3
|
loadOrder?: string;
|
|
4
4
|
mode?: "modal" | "page";
|
|
5
5
|
beneficiaryAddress: string;
|
|
@@ -8,5 +8,4 @@ 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;
|
|
12
11
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,7 +14,7 @@ function generateEncodedDataForStaking(amount, beneficiary) {
|
|
|
14
14
|
args: [beneficiary, BigInt(amount)],
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
export function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab,
|
|
17
|
+
export function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, }) {
|
|
18
18
|
const header = () => (_jsx(_Fragment, { children: _jsxs("div", { className: "from-b3-react-background to-as-on-surface-1 mt-[-60px] w-full rounded-t-lg bg-gradient-to-t", children: [_jsx("div", { className: "h-[60px] w-full" }), _jsx("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: _jsxs("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", stakeAmount ? formatTokenAmount(BigInt(stakeAmount), token.decimals) : "", " ", token.symbol] }) })] }) }));
|
|
19
19
|
// Only generate encoded data if we have a valid beneficiary address
|
|
20
20
|
// This is used for the AnySpendCustom swap & stake flow
|
|
@@ -24,5 +24,5 @@ export function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddr
|
|
|
24
24
|
const encodedData = generateEncodedDataForStaking(stakeAmount, beneficiaryAddress);
|
|
25
25
|
return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: beneficiaryAddress, orderType: "custom", dstChainId: base.id, dstToken: token, dstAmount: stakeAmount, contractAddress: stakingContractAddress, encodedData: encodedData, metadata: {
|
|
26
26
|
action: `stake ${token.symbol}`,
|
|
27
|
-
}, header: header, onSuccess: onSuccess, showRecipient: true, activeTab: activeTab
|
|
27
|
+
}, header: header, onSuccess: onSuccess, showRecipient: true, activeTab: activeTab }));
|
|
28
28
|
}
|
|
@@ -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, }: {
|
|
3
3
|
loadOrder?: string;
|
|
4
4
|
mode?: "modal" | "page";
|
|
5
5
|
recipientAddress: string;
|
|
@@ -8,5 +8,4 @@ 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;
|
|
12
11
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -14,7 +14,7 @@ const STAKE_FOR_FUNCTION_ABI = JSON.stringify([
|
|
|
14
14
|
outputs: [],
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
|
-
export function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess,
|
|
17
|
+
export function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess, }) {
|
|
18
18
|
if (!recipientAddress)
|
|
19
19
|
return null;
|
|
20
20
|
const header = () => (_jsx(_Fragment, { children: _jsx("div", { className: "from-b3-react-background to-as-on-surface-1 w-full rounded-t-lg bg-gradient-to-t", children: _jsx("div", { className: "mb-1 flex w-full flex-col items-center gap-2", children: _jsxs("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", token.symbol, " (Exact In)"] }) }) }) }));
|
|
@@ -26,5 +26,5 @@ export function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipien
|
|
|
26
26
|
spenderAddress: stakingContractAddress,
|
|
27
27
|
action: `stake ${token.symbol}`,
|
|
28
28
|
};
|
|
29
|
-
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess
|
|
29
|
+
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
|
|
30
30
|
}
|
|
@@ -10,7 +10,6 @@ type AnySpendTournamentProps = {
|
|
|
10
10
|
tournamentEntryToken: components["schemas"]["Token"];
|
|
11
11
|
tournamentEntryFee: string;
|
|
12
12
|
onSuccess?: () => void;
|
|
13
|
-
clientReferenceId?: string;
|
|
14
13
|
} | {
|
|
15
14
|
mode?: "modal" | "page";
|
|
16
15
|
action: "fund";
|
|
@@ -21,7 +20,6 @@ type AnySpendTournamentProps = {
|
|
|
21
20
|
tournamentFundToken: components["schemas"]["Token"];
|
|
22
21
|
tournamentFundAmount: string;
|
|
23
22
|
onSuccess?: () => void;
|
|
24
|
-
clientReferenceId?: string;
|
|
25
23
|
};
|
|
26
24
|
export declare function AnySpendTournament(props: AnySpendTournamentProps): import("react/jsx-runtime").JSX.Element;
|
|
27
25
|
export {};
|
|
@@ -13,5 +13,5 @@ export function AnySpendTournament(props) {
|
|
|
13
13
|
return (_jsx(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: {
|
|
14
14
|
type: action === "join" ? "join_tournament" : "fund_tournament",
|
|
15
15
|
tournament: tournamentMetadata,
|
|
16
|
-
}, header: header, onSuccess: onSuccess, showRecipient: action === "join"
|
|
16
|
+
}, header: header, onSuccess: onSuccess, showRecipient: action === "join" }));
|
|
17
17
|
}
|
|
@@ -21,6 +21,5 @@ export interface AnySpendDepositHypeProps {
|
|
|
21
21
|
}) => void;
|
|
22
22
|
customUsdInputValues?: string[];
|
|
23
23
|
preferEoa?: boolean;
|
|
24
|
-
clientReferenceId?: string;
|
|
25
24
|
}
|
|
26
|
-
export declare function AnySpendDepositHype({ loadOrder, mode, recipientAddress, paymentType, sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa,
|
|
25
|
+
export declare function AnySpendDepositHype({ loadOrder, mode, recipientAddress, paymentType, sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, }: AnySpendDepositHypeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -6,7 +6,7 @@ export const HYPE_TOKEN_DETAILS = {
|
|
|
6
6
|
SYMBOL: "HYPE",
|
|
7
7
|
LOGO_URI: "https://cdn.hypeduel.com/hypes-coin.svg",
|
|
8
8
|
};
|
|
9
|
-
export function AnySpendDepositHype({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa,
|
|
9
|
+
export function AnySpendDepositHype({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, }) {
|
|
10
10
|
if (!recipientAddress)
|
|
11
11
|
return null;
|
|
12
12
|
const header = () => (_jsx("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: _jsx("div", { children: _jsx("h1", { className: "text-as-primary text-xl font-bold", children: paymentType === "crypto" ? "Deposit Crypto" : "Fund with Fiat" }) }) }));
|
|
@@ -19,5 +19,5 @@ export function AnySpendDepositHype({ loadOrder, mode = "modal", recipientAddres
|
|
|
19
19
|
logoURI: HYPE_TOKEN_DETAILS.LOGO_URI,
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
|
-
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: hypeToken, destinationChainId: base.id, orderType: "hype_duel", minDestinationAmount: 10, header: header, onSuccess: onSuccess, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa
|
|
22
|
+
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: hypeToken, destinationChainId: base.id, orderType: "hype_duel", minDestinationAmount: 10, header: header, onSuccess: onSuccess, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa }));
|
|
23
23
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
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, }: {
|
|
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;
|
|
9
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -35,7 +35,7 @@ function generateEncodedDataForSignatureMint(signatureData) {
|
|
|
35
35
|
});
|
|
36
36
|
return encodedData;
|
|
37
37
|
}
|
|
38
|
-
export function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, imageUrl, onSuccess,
|
|
38
|
+
export function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, imageUrl, onSuccess, }) {
|
|
39
39
|
// Get token data
|
|
40
40
|
const { data: tokenData, isError: isTokenError, isLoading, } = useTokenData(signatureData.collection.chainId, signatureData.collection.signatureRequestBody?.currency);
|
|
41
41
|
// Convert token data to AnySpend Token type
|
|
@@ -68,5 +68,5 @@ export function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData
|
|
|
68
68
|
const price = parseEther(signatureData.payload.price?.toString() || "0");
|
|
69
69
|
return (_jsx(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: {
|
|
70
70
|
action: "Signature Mint",
|
|
71
|
-
}, header: header, onSuccess: onSuccess, showRecipient: true
|
|
71
|
+
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
72
72
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { AnySpend } from "./AnySpend";
|
|
2
2
|
export { AnySpendBondKit } from "./AnySpendBondKit";
|
|
3
3
|
export { AnySpendBuySpin } from "./AnySpendBuySpin";
|
|
4
|
+
export { AnySpendCollectorClubPurchase } from "./AnySpendCollectorClubPurchase";
|
|
4
5
|
export { AnySpendCustom } from "./AnySpendCustom";
|
|
5
6
|
export { AnySpendCustomExactIn } from "./AnySpendCustomExactIn";
|
|
6
7
|
export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export { AnySpend } from "./AnySpend.js";
|
|
3
3
|
export { AnySpendBondKit } from "./AnySpendBondKit.js";
|
|
4
4
|
export { AnySpendBuySpin } from "./AnySpendBuySpin.js";
|
|
5
|
+
export { AnySpendCollectorClubPurchase } from "./AnySpendCollectorClubPurchase.js";
|
|
5
6
|
export { AnySpendCustom } from "./AnySpendCustom.js";
|
|
6
7
|
export { AnySpendCustomExactIn } from "./AnySpendCustomExactIn.js";
|
|
7
8
|
export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype.js";
|
|
@@ -6,11 +6,14 @@ import { useMutation } from "@tanstack/react-query";
|
|
|
6
6
|
import { useMemo } from "react";
|
|
7
7
|
import { parseUnits } from "viem";
|
|
8
8
|
import { base } from "viem/chains";
|
|
9
|
+
import { useValidatedClientReferenceId } from "./useValidatedClientReferenceId.js";
|
|
9
10
|
/**
|
|
10
11
|
* Hook for creating onramp orders in the Anyspend protocol
|
|
11
12
|
* Specifically handles orders that involve fiat-to-crypto onramp functionality
|
|
12
13
|
*/
|
|
13
14
|
export function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
15
|
+
// Get validated client reference ID from B3 context
|
|
16
|
+
const validatedClientReferenceId = useValidatedClientReferenceId();
|
|
14
17
|
// Get fingerprint data
|
|
15
18
|
const { data: fpData } = useVisitorData({ extendedResult: true }, { immediate: true });
|
|
16
19
|
const visitorData = fpData && {
|
|
@@ -19,7 +22,7 @@ export function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
|
19
22
|
};
|
|
20
23
|
const { mutate: createOrder, isPending } = useMutation({
|
|
21
24
|
mutationFn: async (params) => {
|
|
22
|
-
const { recipientAddress, orderType, dstChain, dstToken, srcFiatAmount, onramp, creatorAddress, expectedDstAmount, nft, tournament, payload, partnerId,
|
|
25
|
+
const { recipientAddress, orderType, dstChain, dstToken, srcFiatAmount, onramp, creatorAddress, expectedDstAmount, nft, tournament, payload, partnerId, } = params;
|
|
23
26
|
try {
|
|
24
27
|
// Validate required onramp fields
|
|
25
28
|
if (!onramp.vendor || !onramp.country) {
|
|
@@ -62,7 +65,7 @@ export function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
|
62
65
|
}),
|
|
63
66
|
creatorAddress: creatorAddress ? normalizeAddress(creatorAddress) : undefined,
|
|
64
67
|
partnerId,
|
|
65
|
-
clientReferenceId,
|
|
68
|
+
clientReferenceId: validatedClientReferenceId,
|
|
66
69
|
visitorData,
|
|
67
70
|
});
|
|
68
71
|
}
|
|
@@ -3,12 +3,15 @@ import { buildMetadata, buildPayload, normalizeAddress } from "../../../anyspend
|
|
|
3
3
|
import { useVisitorData } from "@fingerprintjs/fingerprintjs-pro-react";
|
|
4
4
|
import { useMutation } from "@tanstack/react-query";
|
|
5
5
|
import { useMemo } from "react";
|
|
6
|
+
import { useValidatedClientReferenceId } from "./useValidatedClientReferenceId.js";
|
|
6
7
|
/**
|
|
7
8
|
* Hook for creating orders in the Anyspend protocol
|
|
8
9
|
* Handles regular order creation for swaps, NFT minting, tournament participation, etc.
|
|
9
10
|
* For onramp orders, use useAnyspendCreateOnrampOrder instead.
|
|
10
11
|
*/
|
|
11
12
|
export function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
|
|
13
|
+
// Get validated client reference ID from B3 context
|
|
14
|
+
const validatedClientReferenceId = useValidatedClientReferenceId();
|
|
12
15
|
// Get fingerprint data
|
|
13
16
|
const { data: fpData } = useVisitorData({ extendedResult: true }, { immediate: true });
|
|
14
17
|
const visitorData = fpData && {
|
|
@@ -17,7 +20,7 @@ export function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
|
|
|
17
20
|
};
|
|
18
21
|
const { mutate: createOrder, isPending } = useMutation({
|
|
19
22
|
mutationFn: async (params) => {
|
|
20
|
-
const { recipientAddress, orderType, srcChain, dstChain, srcToken, dstToken, srcAmount, creatorAddress
|
|
23
|
+
const { recipientAddress, orderType, srcChain, dstChain, srcToken, dstToken, srcAmount, creatorAddress } = params;
|
|
21
24
|
try {
|
|
22
25
|
return await anyspendService.createOrder({
|
|
23
26
|
recipientAddress: normalizeAddress(recipientAddress),
|
|
@@ -50,7 +53,7 @@ export function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
|
|
|
50
53
|
},
|
|
51
54
|
}),
|
|
52
55
|
creatorAddress: creatorAddress ? normalizeAddress(creatorAddress) : undefined,
|
|
53
|
-
clientReferenceId,
|
|
56
|
+
clientReferenceId: validatedClientReferenceId,
|
|
54
57
|
visitorData,
|
|
55
58
|
});
|
|
56
59
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Validators } from "../../../anyspend/utils/validation.js";
|
|
2
|
+
import { useB3 } from "../../../global-account/react/index.js";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
/**
|
|
5
|
+
* Hook that provides a validated client reference ID
|
|
6
|
+
* Gets the createClientReferenceId function from B3 context and validates the result
|
|
7
|
+
*/
|
|
8
|
+
export function useValidatedClientReferenceId() {
|
|
9
|
+
const { createClientReferenceId } = useB3();
|
|
10
|
+
const validatedClientReferenceId = useMemo(() => {
|
|
11
|
+
// If no function provided, return undefined
|
|
12
|
+
if (!createClientReferenceId) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
// Call the function to generate the ID
|
|
17
|
+
const generatedId = createClientReferenceId();
|
|
18
|
+
// Validate the generated ID
|
|
19
|
+
const validation = Validators.clientReferenceId(generatedId);
|
|
20
|
+
if (!validation.isValid) {
|
|
21
|
+
console.error(`[AnySpend] Invalid clientReferenceId generated: ${validation.error || "Validation failed"}. Will be set to undefined.`);
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
return validation.cleaned;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error("[AnySpend] Error generating clientReferenceId:", error);
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
}, [createClientReferenceId]);
|
|
31
|
+
return validatedClientReferenceId;
|
|
32
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { AnySpend, AnySpendBondKit, AnySpendBuySpin, AnySpendNFT, AnyspendSignatureMint, AnySpendStakeB3, AnySpendStakeB3ExactIn, AnySpendTournament, OrderHistory, } from "../../../anyspend/react/index.js";
|
|
2
|
+
import { AnySpend, AnySpendBondKit, AnySpendBuySpin, AnySpendCollectorClubPurchase, AnySpendNFT, AnyspendSignatureMint, AnySpendStakeB3, AnySpendStakeB3ExactIn, AnySpendTournament, OrderHistory, } from "../../../anyspend/react/index.js";
|
|
3
3
|
import { AnySpendDepositHype } from "../../../anyspend/react/components/AnyspendDepositHype.js";
|
|
4
4
|
import { AnySpendStakeUpside } from "../../../anyspend/react/components/AnySpendStakeUpside.js";
|
|
5
5
|
import { AnySpendStakeUpsideExactIn } from "../../../anyspend/react/components/AnySpendStakeUpsideExactIn.js";
|
|
@@ -115,6 +115,8 @@ export function B3DynamicModal() {
|
|
|
115
115
|
return _jsx(LinkAccount, { ...contentType });
|
|
116
116
|
case "anySpendDepositHype":
|
|
117
117
|
return _jsx(AnySpendDepositHype, { ...contentType, mode: "modal" });
|
|
118
|
+
case "anySpendCollectorClubPurchase":
|
|
119
|
+
return _jsx(AnySpendCollectorClubPurchase, { ...contentType, mode: "modal" });
|
|
118
120
|
case "avatarEditor":
|
|
119
121
|
return _jsx(AvatarEditor, { onSetAvatar: contentType.onSuccess });
|
|
120
122
|
case "profileEditor":
|
|
@@ -7,7 +7,7 @@ import { B3ContextType } from "./types";
|
|
|
7
7
|
/**
|
|
8
8
|
* Main B3Provider component
|
|
9
9
|
*/
|
|
10
|
-
export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType, rpcUrls, partnerId, onConnect, connectors, overrideDefaultConnectors, }: {
|
|
10
|
+
export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType, rpcUrls, partnerId, onConnect, connectors, overrideDefaultConnectors, createClientReferenceId, }: {
|
|
11
11
|
theme: "light" | "dark";
|
|
12
12
|
children: React.ReactNode;
|
|
13
13
|
accountOverride?: Account;
|
|
@@ -24,11 +24,12 @@ export declare function B3Provider({ theme, children, accountOverride, environme
|
|
|
24
24
|
onConnect?: (wallet: Wallet, b3Jwt: string) => void | Promise<void>;
|
|
25
25
|
connectors?: CreateConnectorFn[];
|
|
26
26
|
overrideDefaultConnectors?: boolean;
|
|
27
|
+
createClientReferenceId?: () => string;
|
|
27
28
|
}): import("react/jsx-runtime").JSX.Element;
|
|
28
29
|
/**
|
|
29
30
|
* Inner provider component that provides the actual B3Context
|
|
30
31
|
*/
|
|
31
|
-
export declare function InnerProvider({ children, accountOverride, environment, defaultPermissions, automaticallySetFirstEoa, theme, clientType, partnerId, }: {
|
|
32
|
+
export declare function InnerProvider({ children, accountOverride, environment, defaultPermissions, automaticallySetFirstEoa, theme, clientType, partnerId, createClientReferenceId, }: {
|
|
32
33
|
children: React.ReactNode;
|
|
33
34
|
accountOverride?: Account;
|
|
34
35
|
environment: B3ContextType["environment"];
|
|
@@ -37,4 +38,5 @@ export declare function InnerProvider({ children, accountOverride, environment,
|
|
|
37
38
|
theme: "light" | "dark";
|
|
38
39
|
clientType?: ClientType;
|
|
39
40
|
partnerId: string;
|
|
41
|
+
createClientReferenceId?: () => string;
|
|
40
42
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -28,7 +28,7 @@ const queryClient = new QueryClient();
|
|
|
28
28
|
/**
|
|
29
29
|
* Main B3Provider component
|
|
30
30
|
*/
|
|
31
|
-
export function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType = "rest", rpcUrls, partnerId, onConnect, connectors, overrideDefaultConnectors = false, }) {
|
|
31
|
+
export function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType = "rest", rpcUrls, partnerId, onConnect, connectors, overrideDefaultConnectors = false, createClientReferenceId, }) {
|
|
32
32
|
// Initialize Google Analytics on mount
|
|
33
33
|
useEffect(() => {
|
|
34
34
|
loadGA4Script();
|
|
@@ -38,12 +38,12 @@ export function B3Provider({ theme = "light", children, accountOverride, environ
|
|
|
38
38
|
setClientType(clientType);
|
|
39
39
|
}, [clientType]);
|
|
40
40
|
const wagmiConfig = createWagmiConfig({ partnerId, rpcUrls, connectors, overrideDefaultConnectors });
|
|
41
|
-
return (_jsx(ThirdwebProvider, { children: _jsx(WagmiProvider, { config: wagmiConfig, reconnectOnMount: false, children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(TooltipProvider, { children: _jsx(LocalSDKProvider, { onConnectCallback: onConnect, children: _jsx(InnerProvider, { accountOverride: accountOverride, environment: environment, theme: theme, automaticallySetFirstEoa: !!automaticallySetFirstEoa, clientType: clientType, partnerId: partnerId, children: _jsxs(RelayKitProviderWrapper, { simDuneApiKey: simDuneApiKey, children: [children, _jsx(StyleRoot, { id: "b3-root" }), _jsx(Toaster, { theme: theme, position: toaster?.position, style: toaster?.style })] }) }) }) }) }) }) }));
|
|
41
|
+
return (_jsx(ThirdwebProvider, { children: _jsx(WagmiProvider, { config: wagmiConfig, reconnectOnMount: false, children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(TooltipProvider, { children: _jsx(LocalSDKProvider, { onConnectCallback: onConnect, children: _jsx(InnerProvider, { accountOverride: accountOverride, environment: environment, theme: theme, automaticallySetFirstEoa: !!automaticallySetFirstEoa, clientType: clientType, partnerId: partnerId, createClientReferenceId: createClientReferenceId, children: _jsxs(RelayKitProviderWrapper, { simDuneApiKey: simDuneApiKey, children: [children, _jsx(StyleRoot, { id: "b3-root" }), _jsx(Toaster, { theme: theme, position: toaster?.position, style: toaster?.style })] }) }) }) }) }) }) }));
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* Inner provider component that provides the actual B3Context
|
|
45
45
|
*/
|
|
46
|
-
export function InnerProvider({ children, accountOverride, environment, defaultPermissions = DEFAULT_PERMISSIONS, automaticallySetFirstEoa, theme = "light", clientType = "socket", partnerId, }) {
|
|
46
|
+
export function InnerProvider({ children, accountOverride, environment, defaultPermissions = DEFAULT_PERMISSIONS, automaticallySetFirstEoa, theme = "light", clientType = "socket", partnerId, createClientReferenceId, }) {
|
|
47
47
|
const activeAccount = useActiveAccount();
|
|
48
48
|
const [manuallySelectedWallet, setManuallySelectedWallet] = useState(undefined);
|
|
49
49
|
const wallets = useConnectedWallets();
|
|
@@ -97,6 +97,7 @@ export function InnerProvider({ children, accountOverride, environment, defaultP
|
|
|
97
97
|
theme,
|
|
98
98
|
clientType,
|
|
99
99
|
partnerId: partnerId,
|
|
100
|
+
createClientReferenceId,
|
|
100
101
|
}, children: _jsx(InnerProvider2, { children: children }) }));
|
|
101
102
|
}
|
|
102
103
|
const InnerProvider2 = ({ children }) => {
|
|
@@ -13,8 +13,8 @@ export declare function useAuthentication(partnerId: string): {
|
|
|
13
13
|
onConnect: (_walleAutoConnectedWith: Wallet, allConnectedWallets: Wallet[]) => Promise<void>;
|
|
14
14
|
user: {
|
|
15
15
|
email?: string | undefined;
|
|
16
|
-
username?: string | undefined;
|
|
17
16
|
telNumber?: string | undefined;
|
|
17
|
+
username?: string | undefined;
|
|
18
18
|
ens?: string | undefined;
|
|
19
19
|
avatar?: string | undefined;
|
|
20
20
|
preferences?: {} | undefined;
|
|
@@ -8,8 +8,8 @@ import { Users } from "@b3dotfun/b3-api";
|
|
|
8
8
|
export declare function useUserQuery(): {
|
|
9
9
|
user: {
|
|
10
10
|
email?: string | undefined;
|
|
11
|
-
username?: string | undefined;
|
|
12
11
|
telNumber?: string | undefined;
|
|
12
|
+
username?: string | undefined;
|
|
13
13
|
ens?: string | undefined;
|
|
14
14
|
avatar?: string | undefined;
|
|
15
15
|
preferences?: {} | undefined;
|
|
@@ -381,10 +381,32 @@ export interface ProfileEditorModalProps extends BaseModalProps {
|
|
|
381
381
|
/** Callback function called when profile is successfully updated */
|
|
382
382
|
onSuccess?: () => void;
|
|
383
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* Props for the AnySpend Collector Club Purchase modal
|
|
386
|
+
* Handles Collector Club pack purchases
|
|
387
|
+
*/
|
|
388
|
+
export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
|
|
389
|
+
/** Modal type identifier */
|
|
390
|
+
type: "anySpendCollectorClubPurchase";
|
|
391
|
+
/** The pack ID to purchase */
|
|
392
|
+
packId: number;
|
|
393
|
+
/** The number of packs to purchase */
|
|
394
|
+
packAmount: number;
|
|
395
|
+
/** Price per pack in wei (e.g., "10000" for 0.01 USDC with 6 decimals) */
|
|
396
|
+
pricePerPack: string;
|
|
397
|
+
/** Recipient address to receive the packs */
|
|
398
|
+
recipientAddress: string;
|
|
399
|
+
/** Payment type - crypto or fiat */
|
|
400
|
+
paymentType?: "crypto" | "fiat";
|
|
401
|
+
/** Callback function called when the purchase is successful */
|
|
402
|
+
onSuccess?: (txHash?: string) => void;
|
|
403
|
+
/** Client-provided reference ID for tracking orders */
|
|
404
|
+
clientReferenceId?: string;
|
|
405
|
+
}
|
|
384
406
|
/**
|
|
385
407
|
* Union type of all possible modal content types
|
|
386
408
|
*/
|
|
387
|
-
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | ProfileEditorModalProps;
|
|
409
|
+
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | ProfileEditorModalProps | AnySpendCollectorClubPurchaseProps;
|
|
388
410
|
/**
|
|
389
411
|
* State interface for the modal store
|
|
390
412
|
*/
|
|
@@ -34,10 +34,4 @@ 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;
|
|
43
37
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { AnySpendBondKitProps } from "@b3dotfun/sdk/global-account/react/stores/useModalStore";
|
|
2
|
-
export declare function AnySpendBondKit({ mode, recipientAddress, contractAddress, minTokensOut, imageUrl, b3Amount: initialB3Amount, onSuccess,
|
|
3
|
-
clientReferenceId?: string;
|
|
4
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function AnySpendBondKit({ mode, recipientAddress, contractAddress, minTokensOut, imageUrl, b3Amount: initialB3Amount, onSuccess, }: AnySpendBondKitProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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, }: {
|
|
2
2
|
loadOrder?: string;
|
|
3
3
|
mode?: "modal" | "page";
|
|
4
4
|
spinwheelContractAddress: string;
|
|
@@ -6,5 +6,4 @@ export declare function AnySpendBuySpin({ loadOrder, mode, spinwheelContractAddr
|
|
|
6
6
|
recipientAddress: string;
|
|
7
7
|
prefillQuantity?: string;
|
|
8
8
|
onSuccess?: (txHash?: string) => void;
|
|
9
|
-
clientReferenceId?: string;
|
|
10
9
|
}): import("react/jsx-runtime").JSX.Element;
|