@b3dotfun/sdk 0.0.1-alpha.22 → 0.0.1-alpha.3
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/README.md +230 -328
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpend.js +4 -4
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +51 -124
- package/dist/cjs/anyspend/utils/chain.js +0 -3
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +2 -2
- package/dist/{esm/global-account/react/components/B3Provider → cjs/global-account/react/components}/B3Provider.d.ts +29 -3
- package/dist/cjs/global-account/react/components/{B3Provider/B3Provider.js → B3Provider.js} +34 -6
- package/dist/cjs/global-account/react/components/{B3Provider/B3Provider.native.d.ts → B3Provider.native.d.ts} +25 -2
- package/dist/cjs/global-account/react/components/{B3Provider/B3Provider.native.js → B3Provider.native.js} +28 -5
- package/dist/cjs/global-account/react/components/StyleRoot.js +2 -2
- package/dist/cjs/global-account/react/components/index.d.ts +6 -8
- package/dist/cjs/global-account/react/components/index.js +16 -18
- package/dist/cjs/global-account/react/hooks/index.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/index.js +1 -2
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -2
- package/dist/cjs/global-account/types/chain-networks.d.ts +34 -34
- package/dist/cjs/global-account/types/feature-flags.d.ts +5 -5
- package/dist/cjs/shared/constants/chains/b3Chain.d.ts +1 -1
- package/dist/cjs/shared/constants/chains/supported.d.ts +3 -4
- package/dist/cjs/shared/constants/chains/supported.js +1 -3
- package/dist/cjs/shared/utils/chains.js +0 -4
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpend.js +4 -4
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +51 -124
- package/dist/esm/anyspend/utils/chain.js +0 -3
- package/dist/esm/global-account/react/components/B3DynamicModal.js +1 -1
- package/dist/{cjs/global-account/react/components/B3Provider → esm/global-account/react/components}/B3Provider.d.ts +29 -3
- package/dist/esm/global-account/react/components/{B3Provider/B3Provider.js → B3Provider.js} +32 -5
- package/dist/esm/global-account/react/components/{B3Provider/B3Provider.native.d.ts → B3Provider.native.d.ts} +25 -2
- package/dist/esm/global-account/react/components/{B3Provider/B3Provider.native.js → B3Provider.native.js} +26 -5
- package/dist/esm/global-account/react/components/StyleRoot.js +1 -1
- package/dist/esm/global-account/react/components/index.d.ts +6 -8
- package/dist/esm/global-account/react/components/index.js +5 -7
- package/dist/esm/global-account/react/hooks/index.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/index.js +1 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -2
- package/dist/esm/global-account/types/chain-networks.d.ts +34 -34
- package/dist/esm/global-account/types/feature-flags.d.ts +5 -5
- package/dist/esm/shared/constants/chains/b3Chain.d.ts +1 -1
- package/dist/esm/shared/constants/chains/supported.d.ts +3 -4
- package/dist/esm/shared/constants/chains/supported.js +0 -2
- package/dist/esm/shared/utils/chains.js +0 -4
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/types/global-account/react/components/{B3Provider/B3Provider.d.ts → B3Provider.d.ts} +28 -2
- package/dist/types/global-account/react/components/{B3Provider/B3Provider.native.d.ts → B3Provider.native.d.ts} +24 -1
- package/dist/types/global-account/react/components/index.d.ts +6 -8
- package/dist/types/global-account/react/hooks/index.d.ts +1 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -2
- package/dist/types/global-account/types/chain-networks.d.ts +34 -34
- package/dist/types/global-account/types/feature-flags.d.ts +5 -5
- package/dist/types/shared/constants/chains/b3Chain.d.ts +1 -1
- package/dist/types/shared/constants/chains/supported.d.ts +3 -4
- package/package.json +11 -25
- package/src/anyspend/react/components/AnySpend.tsx +5 -6
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +180 -233
- package/src/anyspend/utils/chain.ts +0 -3
- package/src/global-account/react/components/B3DynamicModal.tsx +1 -1
- package/src/global-account/react/components/{B3Provider/B3Provider.native.tsx → B3Provider.native.tsx} +45 -4
- package/src/global-account/react/components/{B3Provider/B3Provider.tsx → B3Provider.tsx} +53 -4
- package/src/global-account/react/components/StyleRoot.tsx +1 -1
- package/src/global-account/react/components/index.ts +6 -8
- package/src/global-account/react/hooks/index.ts +1 -1
- package/src/global-account/react/stores/useModalStore.ts +0 -2
- package/src/shared/constants/chains/supported.ts +0 -2
- package/src/shared/utils/chains.ts +1 -4
- package/dist/cjs/anyspend/index.native.d.ts +0 -13
- package/dist/cjs/anyspend/index.native.js +0 -35
- package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +0 -25
- package/dist/cjs/global-account/react/components/B3Provider/types.js +0 -20
- package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +0 -5
- package/dist/cjs/global-account/react/components/B3Provider/useB3.js +0 -17
- package/dist/cjs/global-account/react/index.native.d.ts +0 -7
- package/dist/cjs/global-account/react/index.native.js +0 -21
- package/dist/esm/anyspend/index.native.d.ts +0 -13
- package/dist/esm/anyspend/index.native.js +0 -19
- package/dist/esm/global-account/react/components/B3Provider/types.d.ts +0 -25
- package/dist/esm/global-account/react/components/B3Provider/types.js +0 -17
- package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +0 -5
- package/dist/esm/global-account/react/components/B3Provider/useB3.js +0 -14
- package/dist/esm/global-account/react/index.native.d.ts +0 -7
- package/dist/esm/global-account/react/index.native.js +0 -11
- package/dist/types/anyspend/index.native.d.ts +0 -13
- package/dist/types/global-account/react/components/B3Provider/types.d.ts +0 -25
- package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +0 -5
- package/dist/types/global-account/react/index.native.d.ts +0 -7
- package/src/anyspend/index.native.ts +0 -24
- package/src/global-account/react/components/B3Provider/types.ts +0 -40
- package/src/global-account/react/components/B3Provider/useB3.ts +0 -17
- package/src/global-account/react/index.native.ts +0 -14
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { B3_TOKEN, OrderType } from "../../../anyspend";
|
|
3
|
-
import { baseMainnet } from "../../../shared/constants/chains/supported";
|
|
4
3
|
import { EthIcon } from "./icons/EthIcon";
|
|
5
4
|
import { SolIcon } from "./icons/SolIcon";
|
|
6
5
|
import { UsdcIcon } from "./icons/USDCIcon";
|
|
@@ -12,6 +11,7 @@ import { ArrowRight, Loader2 } from "lucide-react";
|
|
|
12
11
|
import { useCallback, useEffect, useState } from "react";
|
|
13
12
|
import { toast } from "sonner";
|
|
14
13
|
import { createPublicClient, encodeFunctionData, erc20Abi, formatUnits, http } from "viem";
|
|
14
|
+
import { base } from "viem/chains";
|
|
15
15
|
import { useAccount, useWaitForTransactionReceipt, useWriteContract } from "wagmi";
|
|
16
16
|
import { AnySpendCustom } from "./AnySpendCustom";
|
|
17
17
|
const SPIN_WHEEL_ABI = [
|
|
@@ -43,37 +43,8 @@ const SPIN_WHEEL_ABI = [
|
|
|
43
43
|
outputs: [],
|
|
44
44
|
stateMutability: "payable",
|
|
45
45
|
type: "function"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
inputs: [],
|
|
49
|
-
name: "getWheelInfo",
|
|
50
|
-
outputs: [
|
|
51
|
-
{ internalType: "address", name: "creator_", type: "address" },
|
|
52
|
-
{ internalType: "uint256", name: "startTime_", type: "uint256" },
|
|
53
|
-
{ internalType: "uint256", name: "endTime_", type: "uint256" },
|
|
54
|
-
{ internalType: "uint256", name: "totalPrizesAvailable_", type: "uint256" },
|
|
55
|
-
{ internalType: "uint256", name: "prizesRequestedCount_", type: "uint256" },
|
|
56
|
-
{ internalType: "enum SpinWheelV2.WheelState", name: "state_", type: "uint8" }
|
|
57
|
-
],
|
|
58
|
-
stateMutability: "view",
|
|
59
|
-
type: "function"
|
|
60
46
|
}
|
|
61
47
|
];
|
|
62
|
-
function getWheelStatus(wheelInfo) {
|
|
63
|
-
const now = BigInt(Math.floor(Date.now() / 1000));
|
|
64
|
-
console.log("@@anyspend-buy-spin:now:", now);
|
|
65
|
-
console.log("@@anyspend-buy-spin:wheelInfo:", wheelInfo);
|
|
66
|
-
if (now < wheelInfo.startTime_) {
|
|
67
|
-
return "not_started";
|
|
68
|
-
}
|
|
69
|
-
if (now > wheelInfo.endTime_) {
|
|
70
|
-
return "ended";
|
|
71
|
-
}
|
|
72
|
-
if (wheelInfo.totalPrizesAvailable_ <= wheelInfo.prizesRequestedCount_) {
|
|
73
|
-
return "sold_out";
|
|
74
|
-
}
|
|
75
|
-
return "active";
|
|
76
|
-
}
|
|
77
48
|
function generateEncodedDataForBuyEntriesAndSpin(user, quantity) {
|
|
78
49
|
invariant(BigInt(quantity) > 0, "Quantity must be greater than zero");
|
|
79
50
|
console.log("@@anyspend-buy-spin:encoded-data:", { user, quantity });
|
|
@@ -85,17 +56,16 @@ function generateEncodedDataForBuyEntriesAndSpin(user, quantity) {
|
|
|
85
56
|
return encodedData;
|
|
86
57
|
}
|
|
87
58
|
const basePublicClient = createPublicClient({
|
|
88
|
-
chain:
|
|
59
|
+
chain: base,
|
|
89
60
|
transport: http()
|
|
90
61
|
});
|
|
91
|
-
export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", spinwheelContractAddress, chainId, recipientAddress,
|
|
62
|
+
export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", spinwheelContractAddress, chainId, recipientAddress, onSuccess }) {
|
|
92
63
|
const hasMounted = useHasMounted();
|
|
93
64
|
const { setB3ModalOpen } = useModalStore();
|
|
94
65
|
// Payment config state
|
|
95
66
|
const [paymentConfig, setPaymentConfig] = useState(null);
|
|
96
67
|
const [isLoadingConfig, setIsLoadingConfig] = useState(true);
|
|
97
68
|
const [configError, setConfigError] = useState("");
|
|
98
|
-
const [wheelInfo, setWheelInfo] = useState(null);
|
|
99
69
|
// Fetch B3 token balance
|
|
100
70
|
const { formattedBalance: b3Balance, isLoading: isBalanceLoading, rawBalance: b3RawBalance } = useTokenBalance({
|
|
101
71
|
token: B3_TOKEN
|
|
@@ -107,29 +77,22 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
107
77
|
// State for direct buying flow (when user has B3 tokens)
|
|
108
78
|
const [isBuying, setIsBuying] = useState(false);
|
|
109
79
|
const [buyingTxHash, setBuyingTxHash] = useState("");
|
|
110
|
-
const
|
|
80
|
+
const [showSuccessModal, setShowSuccessModal] = useState(false);
|
|
81
|
+
// Wait for transaction confirmation
|
|
82
|
+
const { isLoading: isTxPending, isSuccess: isTxSuccess } = useWaitForTransactionReceipt({
|
|
111
83
|
hash: buyingTxHash,
|
|
112
84
|
query: {
|
|
113
85
|
structuralSharing: false
|
|
114
86
|
}
|
|
115
87
|
});
|
|
116
|
-
//
|
|
88
|
+
// Show success modal when transaction is confirmed
|
|
117
89
|
useEffect(() => {
|
|
118
|
-
if (
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
setB3ModalOpen(false);
|
|
122
|
-
onSuccess?.(buyingTxHash);
|
|
123
|
-
toast.success("Spin purchase transaction confirmed!");
|
|
124
|
-
setIsBuying(false);
|
|
125
|
-
}
|
|
126
|
-
else if (isTxError) {
|
|
127
|
-
console.error("@@anyspend-buy-spin:tx-error:", txError);
|
|
128
|
-
toast.error("Transaction failed. Please try again.");
|
|
129
|
-
setB3ModalOpen(false);
|
|
90
|
+
if (isTxSuccess && buyingTxHash) {
|
|
91
|
+
setShowAmountPrompt(false);
|
|
92
|
+
setShowSuccessModal(true);
|
|
130
93
|
setIsBuying(false);
|
|
131
94
|
}
|
|
132
|
-
}, [isTxSuccess,
|
|
95
|
+
}, [isTxSuccess, buyingTxHash]);
|
|
133
96
|
// Spin quantity state
|
|
134
97
|
const [userSpinQuantity, setUserSpinQuantity] = useState("");
|
|
135
98
|
const [showAmountPrompt, setShowAmountPrompt] = useState(true);
|
|
@@ -137,17 +100,9 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
137
100
|
const [validationError, setValidationError] = useState("");
|
|
138
101
|
const [displayQuantity, setDisplayQuantity] = useState("");
|
|
139
102
|
const [debouncedQuantity, setDebouncedQuantity] = useState("");
|
|
140
|
-
const [debouncedUserSpinQuantity, setDebouncedUserSpinQuantity] = useState("");
|
|
141
|
-
useEffect(() => {
|
|
142
|
-
if (prefillQuantity && wheelInfo) {
|
|
143
|
-
const remainingSpins = wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_;
|
|
144
|
-
const adjustedQuantity = BigInt(prefillQuantity) > remainingSpins ? remainingSpins.toString() : prefillQuantity;
|
|
145
|
-
validateAndSetQuantity(adjustedQuantity);
|
|
146
|
-
}
|
|
147
|
-
}, [prefillQuantity, wheelInfo]);
|
|
148
103
|
// Calculate total cost
|
|
149
104
|
const totalCost = paymentConfig && userSpinQuantity ? paymentConfig.pricePerEntry * BigInt(userSpinQuantity) : BigInt(0);
|
|
150
|
-
// Fetch payment configuration
|
|
105
|
+
// Fetch payment configuration
|
|
151
106
|
const fetchPaymentConfig = useCallback(async () => {
|
|
152
107
|
if (!basePublicClient || !spinwheelContractAddress)
|
|
153
108
|
return;
|
|
@@ -155,7 +110,7 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
155
110
|
setIsLoadingConfig(true);
|
|
156
111
|
setConfigError("");
|
|
157
112
|
console.log("@@anyspend-buy-spin:fetch-config:", { spinwheelContractAddress, chainId });
|
|
158
|
-
const [config, entryModuleAddress
|
|
113
|
+
const [config, entryModuleAddress] = await Promise.all([
|
|
159
114
|
basePublicClient.readContract({
|
|
160
115
|
address: spinwheelContractAddress,
|
|
161
116
|
abi: SPIN_WHEEL_ABI,
|
|
@@ -165,11 +120,6 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
165
120
|
address: spinwheelContractAddress,
|
|
166
121
|
abi: SPIN_WHEEL_ABI,
|
|
167
122
|
functionName: "entryModule"
|
|
168
|
-
}),
|
|
169
|
-
basePublicClient.readContract({
|
|
170
|
-
address: spinwheelContractAddress,
|
|
171
|
-
abi: SPIN_WHEEL_ABI,
|
|
172
|
-
functionName: "getWheelInfo"
|
|
173
123
|
})
|
|
174
124
|
]);
|
|
175
125
|
const paymentConfig = {
|
|
@@ -178,16 +128,13 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
178
128
|
paymentRecipient: config[3],
|
|
179
129
|
entryModule: entryModuleAddress
|
|
180
130
|
};
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
state_: wheelInfo[5]
|
|
188
|
-
};
|
|
131
|
+
console.log("@@anyspend-buy-spin:config-fetched:", {
|
|
132
|
+
pricePerEntry: paymentConfig.pricePerEntry.toString(),
|
|
133
|
+
maxEntriesPerUser: paymentConfig.maxEntriesPerUser.toString(),
|
|
134
|
+
paymentRecipient: paymentConfig.paymentRecipient,
|
|
135
|
+
entryModule: paymentConfig.entryModule
|
|
136
|
+
});
|
|
189
137
|
setPaymentConfig(paymentConfig);
|
|
190
|
-
setWheelInfo(wheelInfoData);
|
|
191
138
|
}
|
|
192
139
|
catch (error) {
|
|
193
140
|
console.error("@@anyspend-buy-spin:config-error:", error);
|
|
@@ -206,7 +153,6 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
206
153
|
useEffect(() => {
|
|
207
154
|
const timer = setTimeout(() => {
|
|
208
155
|
setDebouncedQuantity(displayQuantity);
|
|
209
|
-
setDebouncedUserSpinQuantity(userSpinQuantity);
|
|
210
156
|
}, 500);
|
|
211
157
|
return () => clearTimeout(timer);
|
|
212
158
|
}, [displayQuantity, userSpinQuantity]);
|
|
@@ -232,19 +178,12 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
232
178
|
return;
|
|
233
179
|
}
|
|
234
180
|
// Check maximum entries per user (0 means no limit)
|
|
235
|
-
if (paymentConfig && paymentConfig.maxEntriesPerUser >
|
|
181
|
+
if (paymentConfig && paymentConfig.maxEntriesPerUser > BigInt(0) && BigInt(numValue) > paymentConfig.maxEntriesPerUser) {
|
|
236
182
|
setIsQuantityValid(false);
|
|
237
183
|
setUserSpinQuantity("");
|
|
238
184
|
setValidationError(`Maximum ${paymentConfig.maxEntriesPerUser.toString()} spins allowed`);
|
|
239
185
|
return;
|
|
240
186
|
}
|
|
241
|
-
// Check if quantity exceeds remaining entries
|
|
242
|
-
if (wheelInfo && BigInt(numValue) > wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_) {
|
|
243
|
-
setIsQuantityValid(false);
|
|
244
|
-
setUserSpinQuantity("");
|
|
245
|
-
setValidationError(`Only ${(wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_).toString()} spins remaining`);
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
187
|
setUserSpinQuantity(value);
|
|
249
188
|
setIsQuantityValid(true);
|
|
250
189
|
setValidationError("");
|
|
@@ -294,7 +233,7 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
294
233
|
catch (error) {
|
|
295
234
|
console.error("@@anyspend-buy-spin:error:", error);
|
|
296
235
|
toast.error("Spin purchase failed. Please try again.");
|
|
297
|
-
|
|
236
|
+
setShowSuccessModal(false);
|
|
298
237
|
}
|
|
299
238
|
finally {
|
|
300
239
|
setIsBuying(false);
|
|
@@ -332,58 +271,46 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
332
271
|
// Render quantity input prompt
|
|
333
272
|
if (showAmountPrompt) {
|
|
334
273
|
const pricePerEntry = formatUnits(paymentConfig.pricePerEntry, 18);
|
|
335
|
-
const remainingEntries = wheelInfo ? wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_ : 0n;
|
|
336
|
-
const wheelStatus = wheelInfo ? getWheelStatus(wheelInfo) : null;
|
|
337
|
-
const isSoldOut = wheelStatus === "sold_out";
|
|
338
|
-
const isActive = wheelStatus === "active";
|
|
339
|
-
const getStatusMessage = () => {
|
|
340
|
-
if (!wheelInfo)
|
|
341
|
-
return null;
|
|
342
|
-
const formatDate = (timestamp) => {
|
|
343
|
-
return new Date(Number(timestamp) * 1000).toLocaleString();
|
|
344
|
-
};
|
|
345
|
-
switch (wheelStatus) {
|
|
346
|
-
case "not_started":
|
|
347
|
-
return {
|
|
348
|
-
title: "Spin Wheel Not Started",
|
|
349
|
-
message: `Starts at ${formatDate(wheelInfo.startTime_)}`
|
|
350
|
-
};
|
|
351
|
-
case "ended":
|
|
352
|
-
return {
|
|
353
|
-
title: "Spin Wheel Ended",
|
|
354
|
-
message: `Ended at ${formatDate(wheelInfo.endTime_)}`
|
|
355
|
-
};
|
|
356
|
-
case "sold_out":
|
|
357
|
-
return {
|
|
358
|
-
title: "All Spins Have Been Claimed",
|
|
359
|
-
message: "Stay tuned for the next spin wheel event!"
|
|
360
|
-
};
|
|
361
|
-
default:
|
|
362
|
-
return null;
|
|
363
|
-
}
|
|
364
|
-
};
|
|
365
|
-
const statusInfo = getStatusMessage();
|
|
366
274
|
return (_jsx(StyleRoot, { children: _jsxs("div", { className: "bg-b3-react-background flex w-full flex-col items-center", children: [_jsxs("div", { className: "w-full px-4 pb-2 pt-4", children: [_jsx(motion.div, { initial: false, animate: {
|
|
367
275
|
opacity: hasMounted ? 1 : 0,
|
|
368
276
|
y: hasMounted ? 0 : 20,
|
|
369
277
|
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
370
|
-
}, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, className:
|
|
278
|
+
}, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, className: "mb-4 flex justify-center", children: _jsx("img", { alt: "B3 Token", loading: "lazy", width: "64", height: "64", decoding: "async", className: "rounded-full", src: "https://cdn.b3.fun/b3-coin-3d.png" }) }), _jsxs(motion.div, { initial: false, animate: {
|
|
279
|
+
opacity: hasMounted ? 1 : 0,
|
|
280
|
+
y: hasMounted ? 0 : 20,
|
|
281
|
+
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
282
|
+
}, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "text-center", children: [_jsx("h2", { className: "font-sf-rounded text-as-primary mb-2 text-2xl font-bold", children: (() => {
|
|
283
|
+
const hasEnoughBalance = b3RawBalance && totalCost <= b3RawBalance;
|
|
284
|
+
return hasEnoughBalance || !debouncedQuantity ? "Buy Spins" : `Swap & Buy Spins`;
|
|
285
|
+
})() }), _jsx("div", { className: "bg-as-on-surface-2/50 inline-flex items-center gap-2 rounded-full border border-white/10 px-3 py-1 backdrop-blur-sm", children: _jsxs("p", { className: "text-as-primary/80 text-sm", children: [pricePerEntry, " $B3 per spin"] }) })] })] }), _jsxs(motion.div, { initial: false, animate: {
|
|
286
|
+
opacity: hasMounted ? 1 : 0,
|
|
287
|
+
y: hasMounted ? 0 : 20,
|
|
288
|
+
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
289
|
+
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("p", { className: "text-as-primary/70 text-sm font-medium", children: "Number of spins" }), _jsxs("span", { className: "text-as-primary/50 flex items-center gap-1 text-sm", children: ["Available: ", isBalanceLoading ? _jsx(Loader2, { className: "h-3 w-3 animate-spin" }) : `${b3Balance} B3`] })] }), _jsxs("div", { className: "relative", children: [_jsx(Input, { onFocus: onFocusQuantityInput, type: "text", placeholder: "1", value: displayQuantity, onChange: e => validateAndSetQuantity(e.target.value), className: `h-14 px-4 pr-20 text-lg ${!isQuantityValid && displayQuantity ? "border-as-red" : "border-b3-react-border"}` }), _jsx("div", { className: "font-pack absolute right-4 top-1/2 -translate-y-1/2 text-lg font-medium text-blue-500/70", children: displayQuantity === "1" ? "Spin" : "Spins" })] }), !isQuantityValid && displayQuantity && _jsx("p", { className: "text-as-red text-sm", children: validationError }), _jsx("div", { className: "bg-as-on-surface-2/30 rounded-lg border border-white/10 p-4 backdrop-blur-sm", children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-as-primary/70 text-sm font-medium", children: "Total Cost:" }), _jsx("div", { className: "flex items-center gap-2", children: _jsxs("span", { className: "text-as-primary text-lg font-bold", children: [displayQuantity && isQuantityValid ? formatUnits(totalCost, 18) : "0", " B3"] }) })] }) })] }), _jsx("div", { className: "mt-4", children: (() => {
|
|
290
|
+
const hasEnoughBalance = b3RawBalance && totalCost <= b3RawBalance;
|
|
291
|
+
if (!hasEnoughBalance && debouncedQuantity) {
|
|
292
|
+
return (_jsxs("div", { className: "bg-as-brand/10 flex flex-col items-center gap-2 rounded-lg p-4 pb-5", children: [_jsxs("div", { className: "flex items-center justify-center gap-2", children: [_jsx("span", { className: "text-as-primary text-sm font-semibold", children: "Swap & buy from any token" }), _jsxs(TextLoop, { children: [_jsx(EthIcon, { className: "h-8 w-8" }), _jsx(SolIcon, { className: "h-8 w-8" }), _jsx(UsdcIcon, { className: "h-8 w-8" })] }), _jsx(ArrowRight, { className: "text-as-primary h-4 w-4" }), _jsx("img", { src: "https://cdn.b3.fun/b3-coin-3d.png", className: "h-7 w-7", alt: "B3 Token" })] }), _jsx("p", { className: "text-as-primary/50 text-sm font-medium", children: "No problem, we'll help you swap to B3 for your spins!" })] }));
|
|
293
|
+
}
|
|
294
|
+
})() }), _jsx(Button, { onClick: confirmQuantity, disabled: !isQuantityValid || !displayQuantity || isBuying || isTxPending, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary mt-4 h-14 w-full rounded-xl text-lg font-medium", children: isBuying ? "Buying..." : isTxPending ? "Confirming..." : "Continue" })] })] }) }));
|
|
295
|
+
}
|
|
296
|
+
// Success Modal for Direct Buying
|
|
297
|
+
if (showSuccessModal) {
|
|
298
|
+
return (_jsx(StyleRoot, { children: _jsxs("div", { className: "bg-b3-react-background flex w-full flex-col items-center", children: [_jsxs("div", { className: "w-full p-4", children: [_jsxs(motion.div, { initial: false, animate: {
|
|
299
|
+
opacity: hasMounted ? 1 : 0,
|
|
300
|
+
y: hasMounted ? 0 : 20,
|
|
301
|
+
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
302
|
+
}, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, className: "relative mx-auto mb-4 size-[120px]", children: [_jsx("div", { className: "absolute inset-0 scale-95 rounded-[50%] bg-gradient-to-br from-green-500/30 to-blue-500/30 blur-xl" }), _jsxs(GlareCardRounded, { className: "overflow-hidden rounded-full border-none bg-gradient-to-br from-green-500/10 to-blue-500/10 backdrop-blur-sm", children: [_jsx("img", { alt: "B3 Token", loading: "lazy", width: "120", height: "120", decoding: "async", "data-nimg": "1", className: "size-full shrink-0 bg-transparent text-transparent", src: "https://cdn.b3.fun/b3-coin-3d.png" }), _jsx("div", { className: "absolute inset-0 rounded-[50%] border border-white/20" })] })] }), _jsxs(motion.div, { initial: false, animate: {
|
|
371
303
|
opacity: hasMounted ? 1 : 0,
|
|
372
304
|
y: hasMounted ? 0 : 20,
|
|
373
305
|
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
374
|
-
}, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "text-center", children:
|
|
375
|
-
const hasEnoughBalance = b3RawBalance && totalCost <= b3RawBalance;
|
|
376
|
-
return hasEnoughBalance || !debouncedQuantity ? "Buy Spins" : `Swap & Buy Spins`;
|
|
377
|
-
})() }), wheelInfo && (_jsxs("div", { className: "inline-flex items-center gap-2", children: [_jsx("div", { className: "bg-as-brand/10 border-as-brand/10 inline-flex items-center rounded-full border px-3 py-1", children: _jsxs("p", { className: "text-as-brand text-sm font-medium", children: [pricePerEntry, " $B3 per spin"] }) }), _jsx("div", { className: "bg-as-brand/10 border-as-brand/10 inline-flex items-center rounded-full border px-3 py-1", children: _jsxs("p", { className: "text-as-brand text-sm font-medium", children: [remainingEntries.toString(), " remaining"] }) })] }))] })) : (statusInfo && (_jsxs("div", { className: "text-center", children: [_jsx("p", { className: "text-as-primary text-lg font-semibold", children: statusInfo.title }), _jsx("p", { className: "text-as-primary/70 mt-2 text-sm", children: statusInfo.message })] }))) })] }), _jsx(motion.div, { initial: false, animate: {
|
|
306
|
+
}, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "text-center", children: [_jsx("h2", { className: "font-sf-rounded mb-3 bg-gradient-to-r from-green-400 to-blue-500 bg-clip-text text-3xl font-bold text-transparent", children: "\uD83C\uDF89 Purchase Complete!" }), _jsx("div", { className: "bg-as-on-surface-2/50 inline-flex items-center gap-2 rounded-full border border-white/10 px-4 py-2 backdrop-blur-sm", children: _jsxs("span", { className: "text-as-primary/80 text-sm font-medium", children: [userSpinQuantity, " Spin", userSpinQuantity !== "1" ? "s" : "", " \u2022 ", formatUnits(totalCost, 18), " B3"] }) })] })] }), _jsxs(motion.div, { initial: false, animate: {
|
|
378
307
|
opacity: hasMounted ? 1 : 0,
|
|
379
308
|
y: hasMounted ? 0 : 20,
|
|
380
309
|
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
381
|
-
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children:
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
}
|
|
386
|
-
})() }), _jsx(Button, { onClick: confirmQuantity, disabled: !isQuantityValid || !displayQuantity || isBuying || isTxPending, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary mt-4 h-14 w-full rounded-xl text-lg font-medium", children: isBuying ? "Buying..." : isTxPending ? "Confirming..." : "Continue" })] })) : null })] }) }));
|
|
310
|
+
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [_jsx("div", { className: "mb-6", children: _jsx("a", { href: `https://basescan.org/tx/${buyingTxHash}`, target: "_blank", rel: "noopener noreferrer", className: "text-as-primary/70 hover:text-as-primary block break-all text-center font-mono text-sm underline transition-colors", children: "View transaction" }) }), _jsx(Button, { onClick: () => {
|
|
311
|
+
setB3ModalOpen(false);
|
|
312
|
+
onSuccess?.(buyingTxHash);
|
|
313
|
+
}, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary h-14 w-full rounded-xl text-lg font-medium", children: "Done" })] })] }) }));
|
|
387
314
|
}
|
|
388
315
|
// AnySpend flow for when user needs to swap to B3
|
|
389
316
|
const encodedData = generateEncodedDataForBuyEntriesAndSpin(address || "", userSpinQuantity);
|
|
@@ -244,9 +244,6 @@ export function getPaymentUrl(address, amount, currency) {
|
|
|
244
244
|
return `ethereum:${address}`;
|
|
245
245
|
}
|
|
246
246
|
export function getExplorerTxUrl(chainId, txHash) {
|
|
247
|
-
if (chainId === b3.id) {
|
|
248
|
-
return "https://explorer.b3.fun/b3/tx/" + txHash;
|
|
249
|
-
}
|
|
250
247
|
if (EVM_CHAINS[chainId]) {
|
|
251
248
|
return EVM_CHAINS[chainId].viem.blockExplorers?.default.url + "/tx/" + txHash;
|
|
252
249
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { AnySpend, AnySpendBuySpin, AnySpendNFT, AnySpendStakeB3, AnySpendTournament, OrderHistory } from "../../../anyspend/react";
|
|
3
3
|
import { useIsMobile, useModalStore } from "../../../global-account/react";
|
|
4
4
|
import { debugB3React } from "../../../shared/utils/debug";
|
|
5
|
-
import { useB3 } from "./B3Provider
|
|
5
|
+
import { useB3 } from "./B3Provider";
|
|
6
6
|
import { ManageAccount } from "./ManageAccount/ManageAccount";
|
|
7
7
|
import { RequestPermissions } from "./RequestPermissions/RequestPermissions";
|
|
8
8
|
import { SignInWithB3Flow } from "./SignInWithB3/SignInWithB3Flow";
|
|
@@ -1,8 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { User } from "../../../global-account/types/b3-api.types";
|
|
2
|
+
import { PermissionsConfig } from "../../../global-account/types/permissions";
|
|
3
|
+
import { Account, Wallet } from "thirdweb/wallets";
|
|
3
4
|
import "@reservoir0x/relay-kit-ui/styles.css";
|
|
4
|
-
import { B3ContextType } from "./types";
|
|
5
5
|
export declare const wagmiConfig: import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], any, readonly import("wagmi").CreateConnectorFn[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Context type for B3Provider
|
|
8
|
+
*/
|
|
9
|
+
export interface B3ContextType {
|
|
10
|
+
account?: Account;
|
|
11
|
+
automaticallySetFirstEoa: boolean;
|
|
12
|
+
user?: User;
|
|
13
|
+
setAccount: (account: Account) => void;
|
|
14
|
+
setWallet: (wallet: Wallet) => void;
|
|
15
|
+
wallet?: Wallet;
|
|
16
|
+
setUser: (user?: User) => void;
|
|
17
|
+
initialized: boolean;
|
|
18
|
+
ready: boolean;
|
|
19
|
+
environment?: "development" | "production";
|
|
20
|
+
defaultPermissions?: PermissionsConfig;
|
|
21
|
+
theme: "light" | "dark";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Context for B3 provider
|
|
25
|
+
*/
|
|
26
|
+
export declare const B3Context: import("react").Context<B3ContextType>;
|
|
27
|
+
/**
|
|
28
|
+
* Hook to access the B3 context
|
|
29
|
+
* @throws Error if used outside a B3Provider
|
|
30
|
+
*/
|
|
31
|
+
export declare function useB3(): B3ContextType;
|
|
6
32
|
/**
|
|
7
33
|
* Main B3Provider component
|
|
8
34
|
*/
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { supportedChains } from "
|
|
2
|
+
import { supportedChains } from "../../../shared/constants/chains/supported";
|
|
3
3
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
4
|
-
import { useEffect, useState } from "react";
|
|
4
|
+
import { createContext, useContext, useEffect, useMemo, useState } from "react";
|
|
5
5
|
import { Toaster } from "sonner";
|
|
6
6
|
import { ThirdwebProvider, useActiveAccount, useConnectedWallets, useSetActiveWallet } from "thirdweb/react";
|
|
7
7
|
import { createConfig, http, WagmiProvider } from "wagmi";
|
|
8
|
-
import { RelayKitProviderWrapper } from "
|
|
9
|
-
import { StyleRoot } from "
|
|
8
|
+
import { RelayKitProviderWrapper } from "./RelayKitProviderWrapper";
|
|
9
|
+
import { StyleRoot } from "./StyleRoot";
|
|
10
10
|
import "@reservoir0x/relay-kit-ui/styles.css";
|
|
11
|
-
import { B3Context } from "./types";
|
|
12
11
|
/**
|
|
13
12
|
* Default permissions configuration for B3 provider
|
|
14
13
|
*/
|
|
@@ -22,6 +21,34 @@ export const wagmiConfig = createConfig({
|
|
|
22
21
|
chains: [supportedChains[0], ...supportedChains.slice(1)],
|
|
23
22
|
transports: Object.fromEntries(supportedChains.map(chain => [chain.id, http()]))
|
|
24
23
|
});
|
|
24
|
+
/**
|
|
25
|
+
* Context for B3 provider
|
|
26
|
+
*/
|
|
27
|
+
export const B3Context = createContext({
|
|
28
|
+
account: undefined,
|
|
29
|
+
automaticallySetFirstEoa: false,
|
|
30
|
+
user: undefined,
|
|
31
|
+
setAccount: () => { },
|
|
32
|
+
setWallet: () => { },
|
|
33
|
+
wallet: undefined,
|
|
34
|
+
setUser: () => { },
|
|
35
|
+
initialized: false,
|
|
36
|
+
ready: false,
|
|
37
|
+
environment: "development",
|
|
38
|
+
theme: "light"
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Hook to access the B3 context
|
|
42
|
+
* @throws Error if used outside a B3Provider
|
|
43
|
+
*/
|
|
44
|
+
export function useB3() {
|
|
45
|
+
const context = useContext(B3Context);
|
|
46
|
+
if (!context.initialized) {
|
|
47
|
+
throw new Error("useB3 must be used within a B3Provider");
|
|
48
|
+
}
|
|
49
|
+
// Return a stable reference
|
|
50
|
+
return useMemo(() => context, [context]);
|
|
51
|
+
}
|
|
25
52
|
// Create queryClient instance
|
|
26
53
|
const queryClient = new QueryClient();
|
|
27
54
|
/**
|
|
@@ -1,6 +1,29 @@
|
|
|
1
|
-
import { PermissionsConfig } from "
|
|
1
|
+
import { PermissionsConfig } from "../../../global-account/types/permissions";
|
|
2
2
|
import { Account } from "thirdweb/wallets";
|
|
3
|
-
import {
|
|
3
|
+
import { User } from "../../../global-account/types/b3-api.types";
|
|
4
|
+
/**
|
|
5
|
+
* Context type for B3Provider
|
|
6
|
+
*/
|
|
7
|
+
export interface B3ContextType {
|
|
8
|
+
account?: Account;
|
|
9
|
+
user?: User;
|
|
10
|
+
setAccount: (account: Account) => void;
|
|
11
|
+
setUser: (user?: User) => void;
|
|
12
|
+
initialized: boolean;
|
|
13
|
+
ready: boolean;
|
|
14
|
+
environment?: "development" | "production";
|
|
15
|
+
defaultPermissions?: PermissionsConfig;
|
|
16
|
+
theme: "light" | "dark";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Context for B3 provider
|
|
20
|
+
*/
|
|
21
|
+
export declare const B3Context: import("react").Context<B3ContextType>;
|
|
22
|
+
/**
|
|
23
|
+
* Hook to access the B3 context
|
|
24
|
+
* @throws Error if used outside a B3Provider
|
|
25
|
+
*/
|
|
26
|
+
export declare function useB3(): B3ContextType;
|
|
4
27
|
/**
|
|
5
28
|
* Main B3Provider component
|
|
6
29
|
*/
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
3
|
-
import { useState } from "react";
|
|
3
|
+
import { createContext, useContext, useMemo, useState } from "react";
|
|
4
4
|
import { ThirdwebProvider, useActiveAccount } from "thirdweb/react";
|
|
5
|
-
import { B3Context } from "./types";
|
|
6
5
|
/**
|
|
7
6
|
* Default permissions configuration for B3 provider
|
|
8
7
|
*/
|
|
@@ -12,6 +11,31 @@ const DEFAULT_PERMISSIONS = {
|
|
|
12
11
|
startDate: new Date(),
|
|
13
12
|
endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365) // 1 year from now
|
|
14
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Context for B3 provider
|
|
16
|
+
*/
|
|
17
|
+
export const B3Context = createContext({
|
|
18
|
+
account: undefined,
|
|
19
|
+
user: undefined,
|
|
20
|
+
setAccount: () => { },
|
|
21
|
+
setUser: () => { },
|
|
22
|
+
initialized: false,
|
|
23
|
+
ready: false,
|
|
24
|
+
environment: "development",
|
|
25
|
+
theme: "light"
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Hook to access the B3 context
|
|
29
|
+
* @throws Error if used outside a B3Provider
|
|
30
|
+
*/
|
|
31
|
+
export function useB3() {
|
|
32
|
+
const context = useContext(B3Context);
|
|
33
|
+
if (!context.initialized) {
|
|
34
|
+
throw new Error("useB3 must be used within a B3Provider");
|
|
35
|
+
}
|
|
36
|
+
// Return a stable reference
|
|
37
|
+
return useMemo(() => context, [context]);
|
|
38
|
+
}
|
|
15
39
|
// Create queryClient instance
|
|
16
40
|
const queryClient = new QueryClient();
|
|
17
41
|
/**
|
|
@@ -34,9 +58,6 @@ export function InnerProvider({ children, accountOverride, environment, defaultP
|
|
|
34
58
|
};
|
|
35
59
|
return (_jsx(B3Context.Provider, { value: {
|
|
36
60
|
account: effectiveAccount,
|
|
37
|
-
automaticallySetFirstEoa: false,
|
|
38
|
-
setWallet: () => { },
|
|
39
|
-
wallet: undefined,
|
|
40
61
|
setAccount,
|
|
41
62
|
user,
|
|
42
63
|
setUser,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useB3 } from "./B3Provider
|
|
2
|
+
import { useB3 } from "./B3Provider";
|
|
3
3
|
export function StyleRoot({ children, id }) {
|
|
4
4
|
const { theme: b3Theme } = useB3();
|
|
5
5
|
// eslint-disable-next-line tailwindcss/no-custom-classname
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
export { B3DynamicModal } from "./B3DynamicModal";
|
|
2
|
-
export { B3Provider, InnerProvider } from "./B3Provider
|
|
3
|
-
export { useB3 } from "./B3Provider/useB3";
|
|
4
|
-
export { B3Context, type B3ContextType } from "./B3Provider/types";
|
|
2
|
+
export { B3Context, B3Provider, InnerProvider, useB3, type B3ContextType } from "./B3Provider";
|
|
5
3
|
export { RelayKitProviderWrapper } from "./RelayKitProviderWrapper";
|
|
6
4
|
export { StyleRoot } from "./StyleRoot";
|
|
7
|
-
export { AuthButton } from "./SignInWithB3/components/AuthButton";
|
|
8
|
-
export { PermissionItem } from "./SignInWithB3/components/PermissionItem";
|
|
9
|
-
export { WalletRow } from "./SignInWithB3/components/WalletRow";
|
|
10
5
|
export { SignInWithB3 } from "./SignInWithB3/SignInWithB3";
|
|
11
6
|
export { SignInWithB3Flow } from "./SignInWithB3/SignInWithB3Flow";
|
|
12
7
|
export { SignInWithB3Privy } from "./SignInWithB3/SignInWithB3Privy";
|
|
8
|
+
export { PermissionItem } from "./SignInWithB3/components/PermissionItem";
|
|
9
|
+
export { WalletRow } from "./SignInWithB3/components/WalletRow";
|
|
10
|
+
export { AuthButton } from "./SignInWithB3/components/AuthButton";
|
|
13
11
|
export { LoginStepContainer } from "./SignInWithB3/steps/LoginStep";
|
|
14
|
-
export { getConnectOptionsFromStrategy, isWalletType
|
|
12
|
+
export { type AllowedStrategy, getConnectOptionsFromStrategy, isWalletType } from "./SignInWithB3/utils/signInUtils";
|
|
15
13
|
export { ManageAccount } from "./ManageAccount/ManageAccount";
|
|
16
14
|
export { RequestPermissions } from "./RequestPermissions/RequestPermissions";
|
|
17
15
|
export { RequestPermissionsButton } from "./RequestPermissions/RequestPermissionsButton";
|
|
@@ -36,8 +34,8 @@ export { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
|
|
|
36
34
|
export { ScrollArea, ScrollBar } from "./ui/scroll-area";
|
|
37
35
|
export { ShinyButton } from "./ui/ShinyButton";
|
|
38
36
|
export { Skeleton } from "./ui/skeleton";
|
|
39
|
-
export { TabsContent as TabsContentPrimitive, TabsList as TabsListPrimitive, Tabs as TabsPrimitive, TabTrigger as TabTriggerPrimitive } from "./ui/Tabs";
|
|
40
37
|
export { Tabs, TabsContent, TabsList, TabsTransitionWrapper, TabTrigger } from "./ui/TabSystem";
|
|
38
|
+
export { TabsContent as TabsContentPrimitive, TabsList as TabsListPrimitive, Tabs as TabsPrimitive, TabTrigger as TabTriggerPrimitive } from "./ui/Tabs";
|
|
41
39
|
export { TextLoop } from "./ui/text-loop";
|
|
42
40
|
export { TextShimmer } from "./ui/text-shimmer";
|
|
43
41
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip";
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
// Core Components
|
|
2
2
|
export { B3DynamicModal } from "./B3DynamicModal";
|
|
3
|
-
export { B3Provider, InnerProvider } from "./B3Provider
|
|
4
|
-
export { useB3 } from "./B3Provider/useB3";
|
|
5
|
-
export { B3Context } from "./B3Provider/types";
|
|
3
|
+
export { B3Context, B3Provider, InnerProvider, useB3 } from "./B3Provider";
|
|
6
4
|
export { RelayKitProviderWrapper } from "./RelayKitProviderWrapper";
|
|
7
5
|
export { StyleRoot } from "./StyleRoot";
|
|
8
6
|
// SignInWithB3 Components
|
|
9
|
-
export { AuthButton } from "./SignInWithB3/components/AuthButton";
|
|
10
|
-
export { PermissionItem } from "./SignInWithB3/components/PermissionItem";
|
|
11
|
-
export { WalletRow } from "./SignInWithB3/components/WalletRow";
|
|
12
7
|
export { SignInWithB3 } from "./SignInWithB3/SignInWithB3";
|
|
13
8
|
export { SignInWithB3Flow } from "./SignInWithB3/SignInWithB3Flow";
|
|
14
9
|
export { SignInWithB3Privy } from "./SignInWithB3/SignInWithB3Privy";
|
|
10
|
+
export { PermissionItem } from "./SignInWithB3/components/PermissionItem";
|
|
11
|
+
export { WalletRow } from "./SignInWithB3/components/WalletRow";
|
|
12
|
+
export { AuthButton } from "./SignInWithB3/components/AuthButton";
|
|
15
13
|
export { LoginStepContainer } from "./SignInWithB3/steps/LoginStep";
|
|
16
14
|
export { getConnectOptionsFromStrategy, isWalletType } from "./SignInWithB3/utils/signInUtils";
|
|
17
15
|
// ManageAccount Components
|
|
@@ -45,8 +43,8 @@ export { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
|
|
|
45
43
|
export { ScrollArea, ScrollBar } from "./ui/scroll-area";
|
|
46
44
|
export { ShinyButton } from "./ui/ShinyButton";
|
|
47
45
|
export { Skeleton } from "./ui/skeleton";
|
|
48
|
-
export { TabsContent as TabsContentPrimitive, TabsList as TabsListPrimitive, Tabs as TabsPrimitive, TabTrigger as TabTriggerPrimitive } from "./ui/Tabs";
|
|
49
46
|
export { Tabs, TabsContent, TabsList, TabsTransitionWrapper, TabTrigger } from "./ui/TabSystem";
|
|
47
|
+
export { TabsContent as TabsContentPrimitive, TabsList as TabsListPrimitive, Tabs as TabsPrimitive, TabTrigger as TabTriggerPrimitive } from "./ui/Tabs";
|
|
50
48
|
export { TextLoop } from "./ui/text-loop";
|
|
51
49
|
export { TextShimmer } from "./ui/text-shimmer";
|
|
52
50
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip";
|
|
@@ -16,7 +16,7 @@ export { useHasMounted } from "./useHasMounted";
|
|
|
16
16
|
export { useIsMobile } from "./useIsMobile";
|
|
17
17
|
export { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect";
|
|
18
18
|
export { useMediaQuery } from "./useMediaQuery";
|
|
19
|
-
export { useNativeBalance
|
|
19
|
+
export { useNativeBalance } from "./useNativeBalance";
|
|
20
20
|
export { useOnchainName } from "./useOnchainName";
|
|
21
21
|
export { useOneBalance } from "./useOneBalance";
|
|
22
22
|
export { useQueryB3 } from "./useQueryB3";
|
|
@@ -16,7 +16,7 @@ export { useHasMounted } from "./useHasMounted";
|
|
|
16
16
|
export { useIsMobile } from "./useIsMobile";
|
|
17
17
|
export { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect";
|
|
18
18
|
export { useMediaQuery } from "./useMediaQuery";
|
|
19
|
-
export { useNativeBalance
|
|
19
|
+
export { useNativeBalance } from "./useNativeBalance";
|
|
20
20
|
export { useOnchainName } from "./useOnchainName";
|
|
21
21
|
export { useOneBalance } from "./useOneBalance";
|
|
22
22
|
export { useQueryB3 } from "./useQueryB3";
|
|
@@ -231,8 +231,6 @@ export interface AnySpendBuySpinProps extends BaseModalProps {
|
|
|
231
231
|
recipientAddress: string;
|
|
232
232
|
/** Callback function called when the spin purchase is successful */
|
|
233
233
|
onSuccess?: (txHash?: string) => void;
|
|
234
|
-
/** Prefill quantity of spins to purchase */
|
|
235
|
-
prefillQuantity?: string;
|
|
236
234
|
}
|
|
237
235
|
/**
|
|
238
236
|
* Union type of all possible modal content types
|