@b3dotfun/sdk 0.1.1 → 0.1.2-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +3 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +12 -6
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +10 -4
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +4 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +19 -4
- package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +4 -1
- package/dist/cjs/anyspend/react/components/QRDeposit.js +12 -4
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +7 -5
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +4 -3
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +7 -6
- package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +15 -6
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +10 -6
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +3 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +7 -4
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +3 -2
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +2 -2
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +20 -7
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +3 -2
- package/dist/cjs/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
- package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +5 -2
- package/dist/cjs/anyspend/react/components/common/TabSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/TabSection.js +16 -7
- package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +3 -2
- package/dist/cjs/anyspend/react/components/common/WarningText.d.ts +8 -7
- package/dist/cjs/anyspend/react/components/common/WarningText.js +5 -6
- package/dist/cjs/anyspend/react/components/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/types/classes.d.ts +390 -0
- package/dist/cjs/anyspend/react/components/types/classes.js +6 -0
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +3 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +2 -2
- package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +4 -1
- package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +12 -3
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +3 -0
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +3 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +12 -6
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +10 -4
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +4 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +19 -4
- package/dist/esm/anyspend/react/components/QRDeposit.d.ts +4 -1
- package/dist/esm/anyspend/react/components/QRDeposit.js +12 -4
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +7 -5
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +4 -3
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +7 -6
- package/dist/esm/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +15 -6
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +10 -6
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +3 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +7 -4
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +3 -2
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -2
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +20 -7
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +3 -2
- package/dist/esm/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
- package/dist/esm/anyspend/react/components/common/RecipientSelection.js +5 -2
- package/dist/esm/anyspend/react/components/common/TabSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/TabSection.js +16 -7
- package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +3 -2
- package/dist/esm/anyspend/react/components/common/WarningText.d.ts +8 -7
- package/dist/esm/anyspend/react/components/common/WarningText.js +5 -6
- package/dist/esm/anyspend/react/components/index.d.ts +1 -0
- package/dist/esm/anyspend/react/components/types/classes.d.ts +390 -0
- package/dist/esm/anyspend/react/components/types/classes.js +5 -0
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +3 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +2 -2
- package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +4 -1
- package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +13 -4
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +3 -0
- package/dist/types/anyspend/react/components/AnySpend.d.ts +3 -0
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -0
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +4 -1
- package/dist/types/anyspend/react/components/QRDeposit.d.ts +4 -1
- package/dist/types/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +3 -0
- package/dist/types/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
- package/dist/types/anyspend/react/components/common/TabSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/WarningText.d.ts +8 -7
- package/dist/types/anyspend/react/components/index.d.ts +1 -0
- package/dist/types/anyspend/react/components/types/classes.d.ts +390 -0
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +3 -1
- package/dist/types/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +4 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +3 -0
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +41 -20
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +31 -13
- package/src/anyspend/react/components/AnySpendDeposit.tsx +171 -52
- package/src/anyspend/react/components/QRDeposit.tsx +91 -35
- package/src/anyspend/react/components/common/CryptoPaySection.tsx +31 -19
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +14 -4
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +43 -23
- package/src/anyspend/react/components/common/FeeDetailPanel.tsx +53 -32
- package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +26 -13
- package/src/anyspend/react/components/common/OrderDetails.tsx +16 -3
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +5 -1
- package/src/anyspend/react/components/common/PanelOnramp.tsx +4 -1
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +118 -40
- package/src/anyspend/react/components/common/PointsDetailPanel.tsx +28 -14
- package/src/anyspend/react/components/common/RecipientSelection.tsx +20 -5
- package/src/anyspend/react/components/common/TabSection.tsx +21 -12
- package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +12 -4
- package/src/anyspend/react/components/common/WarningText.tsx +10 -10
- package/src/anyspend/react/components/index.ts +16 -0
- package/src/anyspend/react/components/types/classes.ts +476 -0
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +8 -1
- package/src/global-account/react/components/B3Provider/LocalSDKProvider.tsx +6 -0
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +17 -5
- package/src/global-account/react/stores/useModalStore.ts +3 -0
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classes prop types for AnySpend components customization.
|
|
3
|
+
* Use these to override default styling of specific elements.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** Classes for AnySpendDeposit component */
|
|
7
|
+
export interface AnySpendDepositClasses {
|
|
8
|
+
// Root containers
|
|
9
|
+
root?: string;
|
|
10
|
+
chainSelection?: string;
|
|
11
|
+
form?: string;
|
|
12
|
+
formContent?: string;
|
|
13
|
+
|
|
14
|
+
// Close button
|
|
15
|
+
closeButton?: string;
|
|
16
|
+
|
|
17
|
+
// Balance header
|
|
18
|
+
balanceContainer?: string;
|
|
19
|
+
balanceLabel?: string;
|
|
20
|
+
balanceValue?: string;
|
|
21
|
+
|
|
22
|
+
// Options container
|
|
23
|
+
optionsContainer?: string;
|
|
24
|
+
|
|
25
|
+
// Loading skeleton
|
|
26
|
+
chainsSkeleton?: string;
|
|
27
|
+
skeletonItem?: string;
|
|
28
|
+
|
|
29
|
+
// Chains list
|
|
30
|
+
chainsContainer?: string;
|
|
31
|
+
chainButton?: string;
|
|
32
|
+
chainContent?: string;
|
|
33
|
+
chainInfo?: string;
|
|
34
|
+
chainName?: string;
|
|
35
|
+
chainIcon?: string;
|
|
36
|
+
chainBalance?: string;
|
|
37
|
+
chainChevron?: string;
|
|
38
|
+
|
|
39
|
+
// General options
|
|
40
|
+
generalOptions?: string;
|
|
41
|
+
optionButton?: string;
|
|
42
|
+
cryptoButton?: string;
|
|
43
|
+
qrButton?: string;
|
|
44
|
+
fiatButton?: string;
|
|
45
|
+
optionContent?: string;
|
|
46
|
+
optionInfo?: string;
|
|
47
|
+
optionTitle?: string;
|
|
48
|
+
optionDescription?: string;
|
|
49
|
+
optionIcon?: string;
|
|
50
|
+
optionChevron?: string;
|
|
51
|
+
|
|
52
|
+
// Divider
|
|
53
|
+
divider?: string;
|
|
54
|
+
dividerLine?: string;
|
|
55
|
+
dividerText?: string;
|
|
56
|
+
|
|
57
|
+
// Back button
|
|
58
|
+
backButton?: string;
|
|
59
|
+
backIcon?: string;
|
|
60
|
+
backText?: string;
|
|
61
|
+
|
|
62
|
+
// Header
|
|
63
|
+
header?: string;
|
|
64
|
+
title?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Classes for AnySpend component */
|
|
68
|
+
export interface AnySpendClasses {
|
|
69
|
+
// Root container
|
|
70
|
+
root?: string;
|
|
71
|
+
container?: string;
|
|
72
|
+
|
|
73
|
+
// Header
|
|
74
|
+
header?: string;
|
|
75
|
+
headerLogo?: string;
|
|
76
|
+
headerTitle?: string;
|
|
77
|
+
|
|
78
|
+
// Tab section
|
|
79
|
+
tabSection?: string;
|
|
80
|
+
tabList?: string;
|
|
81
|
+
tabTrigger?: string;
|
|
82
|
+
tabTriggerActive?: string;
|
|
83
|
+
|
|
84
|
+
// Main content area
|
|
85
|
+
mainContent?: string;
|
|
86
|
+
inputSection?: string;
|
|
87
|
+
|
|
88
|
+
// Swap direction button
|
|
89
|
+
swapDirectionButton?: string;
|
|
90
|
+
|
|
91
|
+
// Main action button
|
|
92
|
+
mainButton?: string;
|
|
93
|
+
mainButtonDisabled?: string;
|
|
94
|
+
mainButtonError?: string;
|
|
95
|
+
|
|
96
|
+
// Transaction history button
|
|
97
|
+
historyButton?: string;
|
|
98
|
+
|
|
99
|
+
// Bottom navigation
|
|
100
|
+
bottomNavigation?: string;
|
|
101
|
+
|
|
102
|
+
// Gas indicator
|
|
103
|
+
gasIndicator?: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Classes for AnySpendCustomExactIn component */
|
|
107
|
+
export interface AnySpendCustomExactInClasses {
|
|
108
|
+
// Root container
|
|
109
|
+
root?: string;
|
|
110
|
+
container?: string;
|
|
111
|
+
|
|
112
|
+
// Header
|
|
113
|
+
header?: string;
|
|
114
|
+
headerTitle?: string;
|
|
115
|
+
headerDescription?: string;
|
|
116
|
+
|
|
117
|
+
// Content area
|
|
118
|
+
contentArea?: string;
|
|
119
|
+
inputSection?: string;
|
|
120
|
+
|
|
121
|
+
// Swap direction button
|
|
122
|
+
swapDirectionButton?: string;
|
|
123
|
+
|
|
124
|
+
// Main action button
|
|
125
|
+
mainButton?: string;
|
|
126
|
+
mainButtonDisabled?: string;
|
|
127
|
+
mainButtonError?: string;
|
|
128
|
+
|
|
129
|
+
// Footer
|
|
130
|
+
footer?: string;
|
|
131
|
+
|
|
132
|
+
// Gas indicator
|
|
133
|
+
gasIndicator?: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Classes for CryptoPaySection component */
|
|
137
|
+
export interface CryptoPaySectionClasses {
|
|
138
|
+
root?: string;
|
|
139
|
+
container?: string;
|
|
140
|
+
label?: string;
|
|
141
|
+
inputContainer?: string;
|
|
142
|
+
input?: string;
|
|
143
|
+
tokenSelector?: string;
|
|
144
|
+
tokenIcon?: string;
|
|
145
|
+
tokenSymbol?: string;
|
|
146
|
+
chainBadge?: string;
|
|
147
|
+
balanceRow?: string;
|
|
148
|
+
balanceLabel?: string;
|
|
149
|
+
balanceValue?: string;
|
|
150
|
+
maxButton?: string;
|
|
151
|
+
paymentMethodButton?: string;
|
|
152
|
+
feeRow?: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** Classes for CryptoReceiveSection component */
|
|
156
|
+
export interface CryptoReceiveSectionClasses {
|
|
157
|
+
root?: string;
|
|
158
|
+
container?: string;
|
|
159
|
+
label?: string;
|
|
160
|
+
inputContainer?: string;
|
|
161
|
+
input?: string;
|
|
162
|
+
tokenSelector?: string;
|
|
163
|
+
tokenIcon?: string;
|
|
164
|
+
tokenSymbol?: string;
|
|
165
|
+
chainBadge?: string;
|
|
166
|
+
recipientRow?: string;
|
|
167
|
+
recipientLabel?: string;
|
|
168
|
+
recipientValue?: string;
|
|
169
|
+
recipientButton?: string;
|
|
170
|
+
pointsRow?: string;
|
|
171
|
+
feeRow?: string;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** Classes for PanelOnramp component */
|
|
175
|
+
export interface PanelOnrampClasses {
|
|
176
|
+
root?: string;
|
|
177
|
+
container?: string;
|
|
178
|
+
amountInput?: string;
|
|
179
|
+
presetButtons?: string;
|
|
180
|
+
presetButton?: string;
|
|
181
|
+
paymentMethodRow?: string;
|
|
182
|
+
recipientRow?: string;
|
|
183
|
+
destinationRow?: string;
|
|
184
|
+
feeRow?: string;
|
|
185
|
+
pointsRow?: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** Classes for OrderDetails component */
|
|
189
|
+
export interface OrderDetailsClasses {
|
|
190
|
+
root?: string;
|
|
191
|
+
container?: string;
|
|
192
|
+
header?: string;
|
|
193
|
+
statusBadge?: string;
|
|
194
|
+
statusPending?: string;
|
|
195
|
+
statusSuccess?: string;
|
|
196
|
+
statusFailed?: string;
|
|
197
|
+
amountSection?: string;
|
|
198
|
+
detailsSection?: string;
|
|
199
|
+
detailRow?: string;
|
|
200
|
+
detailLabel?: string;
|
|
201
|
+
detailValue?: string;
|
|
202
|
+
transactionLink?: string;
|
|
203
|
+
actionButton?: string;
|
|
204
|
+
backButton?: string;
|
|
205
|
+
returnButton?: string;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** Classes for RecipientSelection component */
|
|
209
|
+
export interface RecipientSelectionClasses {
|
|
210
|
+
root?: string;
|
|
211
|
+
container?: string;
|
|
212
|
+
header?: string;
|
|
213
|
+
searchInput?: string;
|
|
214
|
+
recipientList?: string;
|
|
215
|
+
recipientItem?: string;
|
|
216
|
+
recipientItemActive?: string;
|
|
217
|
+
recipientAvatar?: string;
|
|
218
|
+
recipientName?: string;
|
|
219
|
+
recipientAddress?: string;
|
|
220
|
+
confirmButton?: string;
|
|
221
|
+
backButton?: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** Classes for CryptoPaymentMethod component */
|
|
225
|
+
export interface CryptoPaymentMethodClasses {
|
|
226
|
+
root?: string;
|
|
227
|
+
container?: string;
|
|
228
|
+
header?: string;
|
|
229
|
+
optionsList?: string;
|
|
230
|
+
optionItem?: string;
|
|
231
|
+
optionItemActive?: string;
|
|
232
|
+
optionIcon?: string;
|
|
233
|
+
optionLabel?: string;
|
|
234
|
+
optionDescription?: string;
|
|
235
|
+
backButton?: string;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** Classes for FiatPaymentMethod component */
|
|
239
|
+
export interface FiatPaymentMethodClasses {
|
|
240
|
+
root?: string;
|
|
241
|
+
container?: string;
|
|
242
|
+
header?: string;
|
|
243
|
+
optionsList?: string;
|
|
244
|
+
optionItem?: string;
|
|
245
|
+
optionItemActive?: string;
|
|
246
|
+
optionIcon?: string;
|
|
247
|
+
optionLabel?: string;
|
|
248
|
+
optionDescription?: string;
|
|
249
|
+
backButton?: string;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** Classes for WarningText component */
|
|
253
|
+
export interface WarningTextClasses {
|
|
254
|
+
root?: string;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/** Classes for ChainWarningText component */
|
|
258
|
+
export interface ChainWarningTextClasses {
|
|
259
|
+
root?: string;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/** Classes for TabSection component */
|
|
263
|
+
export interface TabSectionClasses {
|
|
264
|
+
root?: string;
|
|
265
|
+
container?: string;
|
|
266
|
+
tabIndicator?: string;
|
|
267
|
+
tabButton?: string;
|
|
268
|
+
tabButtonActive?: string;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** Classes for FeeDetailPanel component */
|
|
272
|
+
export interface FeeDetailPanelClasses {
|
|
273
|
+
root?: string;
|
|
274
|
+
container?: string;
|
|
275
|
+
title?: string;
|
|
276
|
+
tierCard?: string;
|
|
277
|
+
tierCardTitle?: string;
|
|
278
|
+
tierRow?: string;
|
|
279
|
+
tierRowActive?: string;
|
|
280
|
+
tierLabel?: string;
|
|
281
|
+
tierValue?: string;
|
|
282
|
+
expandButton?: string;
|
|
283
|
+
summaryCard?: string;
|
|
284
|
+
summaryRow?: string;
|
|
285
|
+
summaryLabel?: string;
|
|
286
|
+
summaryValue?: string;
|
|
287
|
+
summaryDivider?: string;
|
|
288
|
+
totalRow?: string;
|
|
289
|
+
totalLabel?: string;
|
|
290
|
+
totalValue?: string;
|
|
291
|
+
backButton?: string;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** Classes for PointsDetailPanel component */
|
|
295
|
+
export interface PointsDetailPanelClasses {
|
|
296
|
+
root?: string;
|
|
297
|
+
container?: string;
|
|
298
|
+
title?: string;
|
|
299
|
+
description?: string;
|
|
300
|
+
highlightText?: string;
|
|
301
|
+
link?: string;
|
|
302
|
+
infoCard?: string;
|
|
303
|
+
infoCardTitle?: string;
|
|
304
|
+
infoList?: string;
|
|
305
|
+
infoListItem?: string;
|
|
306
|
+
backButton?: string;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/** Classes for PanelOnrampPayment component */
|
|
310
|
+
export interface PanelOnrampPaymentClasses {
|
|
311
|
+
root?: string;
|
|
312
|
+
container?: string;
|
|
313
|
+
summaryTitle?: string;
|
|
314
|
+
summaryCard?: string;
|
|
315
|
+
summaryRow?: string;
|
|
316
|
+
summaryLabel?: string;
|
|
317
|
+
summaryValue?: string;
|
|
318
|
+
summaryDivider?: string;
|
|
319
|
+
amountRow?: string;
|
|
320
|
+
amountValue?: string;
|
|
321
|
+
feeText?: string;
|
|
322
|
+
loadingContainer?: string;
|
|
323
|
+
loadingSpinner?: string;
|
|
324
|
+
loadingText?: string;
|
|
325
|
+
paymentMethodTitle?: string;
|
|
326
|
+
paymentMethodIcons?: string;
|
|
327
|
+
paymentOption?: string;
|
|
328
|
+
paymentOptionIcon?: string;
|
|
329
|
+
paymentOptionContent?: string;
|
|
330
|
+
paymentOptionTitle?: string;
|
|
331
|
+
paymentOptionDescription?: string;
|
|
332
|
+
paymentOptionFee?: string;
|
|
333
|
+
paymentOptionChevron?: string;
|
|
334
|
+
backButton?: string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/** Classes for OrderDetailsCollapsible component */
|
|
338
|
+
export interface OrderDetailsCollapsibleClasses {
|
|
339
|
+
root?: string;
|
|
340
|
+
container?: string;
|
|
341
|
+
expandedContent?: string;
|
|
342
|
+
recipientSection?: string;
|
|
343
|
+
recipientLabel?: string;
|
|
344
|
+
recipientInfo?: string;
|
|
345
|
+
recipientName?: string;
|
|
346
|
+
recipientAddress?: string;
|
|
347
|
+
recipientCopyIcon?: string;
|
|
348
|
+
divider?: string;
|
|
349
|
+
expectedSection?: string;
|
|
350
|
+
expectedLabel?: string;
|
|
351
|
+
expectedValue?: string;
|
|
352
|
+
expectedAmount?: string;
|
|
353
|
+
chainInfo?: string;
|
|
354
|
+
chainText?: string;
|
|
355
|
+
chainLogo?: string;
|
|
356
|
+
pointsSection?: string;
|
|
357
|
+
pointsLabel?: string;
|
|
358
|
+
pointsValue?: string;
|
|
359
|
+
idSection?: string;
|
|
360
|
+
idLabel?: string;
|
|
361
|
+
idValue?: string;
|
|
362
|
+
collapsedContainer?: string;
|
|
363
|
+
collapsedButton?: string;
|
|
364
|
+
collapsedChevron?: string;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/** Classes for TransferCryptoDetails component */
|
|
368
|
+
export interface TransferCryptoDetailsClasses {
|
|
369
|
+
root?: string;
|
|
370
|
+
container?: string;
|
|
371
|
+
header?: string;
|
|
372
|
+
backButton?: string;
|
|
373
|
+
title?: string;
|
|
374
|
+
timer?: string;
|
|
375
|
+
timerSvg?: string;
|
|
376
|
+
timerBackground?: string;
|
|
377
|
+
timerProgress?: string;
|
|
378
|
+
timerText?: string;
|
|
379
|
+
cardsContainer?: string;
|
|
380
|
+
amountCard?: string;
|
|
381
|
+
amountLabel?: string;
|
|
382
|
+
amountContainer?: string;
|
|
383
|
+
amountText?: string;
|
|
384
|
+
amountCopyIcon?: string;
|
|
385
|
+
chainCard?: string;
|
|
386
|
+
chainLabel?: string;
|
|
387
|
+
chainContainer?: string;
|
|
388
|
+
chainLogo?: string;
|
|
389
|
+
chainName?: string;
|
|
390
|
+
qrDepositCard?: string;
|
|
391
|
+
qrSection?: string;
|
|
392
|
+
qrWrapper?: string;
|
|
393
|
+
qrContainer?: string;
|
|
394
|
+
qrCode?: string;
|
|
395
|
+
walletHint?: string;
|
|
396
|
+
walletText?: string;
|
|
397
|
+
walletIcon?: string;
|
|
398
|
+
addressSection?: string;
|
|
399
|
+
addressLabel?: string;
|
|
400
|
+
addressCopyContainer?: string;
|
|
401
|
+
addressText?: string;
|
|
402
|
+
addressCopyIcon?: string;
|
|
403
|
+
actionsContainer?: string;
|
|
404
|
+
copyButton?: string;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/** Classes for QRDeposit component */
|
|
408
|
+
export interface QRDepositClasses {
|
|
409
|
+
// Root containers
|
|
410
|
+
root?: string;
|
|
411
|
+
container?: string;
|
|
412
|
+
content?: string;
|
|
413
|
+
|
|
414
|
+
// Header
|
|
415
|
+
header?: string;
|
|
416
|
+
backButton?: string;
|
|
417
|
+
title?: string;
|
|
418
|
+
closeButton?: string;
|
|
419
|
+
|
|
420
|
+
// Token selector
|
|
421
|
+
tokenSelectorContainer?: string;
|
|
422
|
+
tokenSelectorLabel?: string;
|
|
423
|
+
tokenSelectorTrigger?: string;
|
|
424
|
+
|
|
425
|
+
// QR Code area
|
|
426
|
+
qrContent?: string;
|
|
427
|
+
qrCodeContainer?: string;
|
|
428
|
+
qrCode?: string;
|
|
429
|
+
qrScanHint?: string;
|
|
430
|
+
|
|
431
|
+
// Address area
|
|
432
|
+
addressContainer?: string;
|
|
433
|
+
addressLabel?: string;
|
|
434
|
+
addressRow?: string;
|
|
435
|
+
address?: string;
|
|
436
|
+
addressCopyIcon?: string;
|
|
437
|
+
|
|
438
|
+
// Watching indicator
|
|
439
|
+
watchingIndicator?: string;
|
|
440
|
+
|
|
441
|
+
// Copy button
|
|
442
|
+
copyButton?: string;
|
|
443
|
+
|
|
444
|
+
// Loading state
|
|
445
|
+
loadingContainer?: string;
|
|
446
|
+
loadingContent?: string;
|
|
447
|
+
loadingSpinner?: string;
|
|
448
|
+
loadingText?: string;
|
|
449
|
+
|
|
450
|
+
// Order details wrapper
|
|
451
|
+
orderDetailsContainer?: string;
|
|
452
|
+
orderDetailsContent?: string;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/** Combined classes for all AnySpend-related components */
|
|
456
|
+
export interface AnySpendAllClasses {
|
|
457
|
+
deposit?: AnySpendDepositClasses;
|
|
458
|
+
anySpend?: AnySpendClasses;
|
|
459
|
+
customExactIn?: AnySpendCustomExactInClasses;
|
|
460
|
+
cryptoPaySection?: CryptoPaySectionClasses;
|
|
461
|
+
cryptoReceiveSection?: CryptoReceiveSectionClasses;
|
|
462
|
+
panelOnramp?: PanelOnrampClasses;
|
|
463
|
+
orderDetails?: OrderDetailsClasses;
|
|
464
|
+
recipientSelection?: RecipientSelectionClasses;
|
|
465
|
+
cryptoPaymentMethod?: CryptoPaymentMethodClasses;
|
|
466
|
+
fiatPaymentMethod?: FiatPaymentMethodClasses;
|
|
467
|
+
qrDeposit?: QRDepositClasses;
|
|
468
|
+
warningText?: WarningTextClasses;
|
|
469
|
+
chainWarningText?: ChainWarningTextClasses;
|
|
470
|
+
tabSection?: TabSectionClasses;
|
|
471
|
+
feeDetailPanel?: FeeDetailPanelClasses;
|
|
472
|
+
pointsDetailPanel?: PointsDetailPanelClasses;
|
|
473
|
+
panelOnrampPayment?: PanelOnrampPaymentClasses;
|
|
474
|
+
orderDetailsCollapsible?: OrderDetailsCollapsibleClasses;
|
|
475
|
+
transferCryptoDetails?: TransferCryptoDetailsClasses;
|
|
476
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Users } from "@b3dotfun/b3-api";
|
|
1
2
|
import { CreateOnrampOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOnrampOrder";
|
|
2
3
|
import { CreateOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOrder";
|
|
3
4
|
import { RelayKitProviderWrapper, TooltipProvider } from "@b3dotfun/sdk/global-account/react";
|
|
@@ -43,6 +44,7 @@ export function B3Provider({
|
|
|
43
44
|
createClientReferenceId,
|
|
44
45
|
enableTurnkey = false,
|
|
45
46
|
defaultPermissions,
|
|
47
|
+
onTurnkeyConnect,
|
|
46
48
|
}: {
|
|
47
49
|
theme: "light" | "dark";
|
|
48
50
|
children: React.ReactNode;
|
|
@@ -66,6 +68,7 @@ export function B3Provider({
|
|
|
66
68
|
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
67
69
|
enableTurnkey?: boolean;
|
|
68
70
|
defaultPermissions?: PermissionsConfig;
|
|
71
|
+
onTurnkeyConnect?: (user: Users) => void | Promise<void>;
|
|
69
72
|
}) {
|
|
70
73
|
// Initialize Google Analytics on mount
|
|
71
74
|
useEffect(() => {
|
|
@@ -88,7 +91,11 @@ export function B3Provider({
|
|
|
88
91
|
<QueryClientProvider client={queryClient}>
|
|
89
92
|
<TooltipProvider>
|
|
90
93
|
<ToastProvider>
|
|
91
|
-
<LocalSDKProvider
|
|
94
|
+
<LocalSDKProvider
|
|
95
|
+
onConnectCallback={onConnect}
|
|
96
|
+
onLogoutCallback={onLogout}
|
|
97
|
+
onTurnkeyConnect={onTurnkeyConnect}
|
|
98
|
+
>
|
|
92
99
|
<B3ConfigProvider
|
|
93
100
|
accountOverride={accountOverride}
|
|
94
101
|
environment={environment}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Users } from "@b3dotfun/b3-api";
|
|
1
2
|
import { createContext } from "react";
|
|
2
3
|
import { Wallet } from "thirdweb/wallets";
|
|
3
4
|
|
|
@@ -8,11 +9,13 @@ import { Wallet } from "thirdweb/wallets";
|
|
|
8
9
|
export interface LocalSDKContextType {
|
|
9
10
|
onConnectCallback?: (wallet: Wallet, b3Jwt: string) => void | Promise<void>;
|
|
10
11
|
onLogoutCallback?: () => void | Promise<void>;
|
|
12
|
+
onTurnkeyConnect?: (user: Users) => void | Promise<void>;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export const LocalSDKContext = createContext<LocalSDKContextType>({
|
|
14
16
|
onConnectCallback: undefined,
|
|
15
17
|
onLogoutCallback: undefined,
|
|
18
|
+
onTurnkeyConnect: undefined,
|
|
16
19
|
});
|
|
17
20
|
|
|
18
21
|
/**
|
|
@@ -22,16 +25,19 @@ export function LocalSDKProvider({
|
|
|
22
25
|
children,
|
|
23
26
|
onConnectCallback,
|
|
24
27
|
onLogoutCallback,
|
|
28
|
+
onTurnkeyConnect,
|
|
25
29
|
}: {
|
|
26
30
|
children: React.ReactNode;
|
|
27
31
|
onConnectCallback?: (wallet: Wallet, b3Jwt: string) => void | Promise<void>;
|
|
28
32
|
onLogoutCallback?: () => void | Promise<void>;
|
|
33
|
+
onTurnkeyConnect?: (user: Users) => void | Promise<void>;
|
|
29
34
|
}) {
|
|
30
35
|
return (
|
|
31
36
|
<LocalSDKContext.Provider
|
|
32
37
|
value={{
|
|
33
38
|
onConnectCallback,
|
|
34
39
|
onLogoutCallback,
|
|
40
|
+
onTurnkeyConnect,
|
|
35
41
|
}}
|
|
36
42
|
>
|
|
37
43
|
{children}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Users } from "@b3dotfun/b3-api";
|
|
1
2
|
import {
|
|
2
3
|
Loading,
|
|
3
4
|
SignInWithB3ModalProps,
|
|
@@ -8,9 +9,10 @@ import {
|
|
|
8
9
|
useModalStore,
|
|
9
10
|
} from "@b3dotfun/sdk/global-account/react";
|
|
10
11
|
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
11
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
12
|
+
import { useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
12
13
|
import { useActiveAccount } from "thirdweb/react";
|
|
13
14
|
import { Account } from "thirdweb/wallets";
|
|
15
|
+
import { LocalSDKContext } from "../B3Provider/LocalSDKProvider";
|
|
14
16
|
import { TurnkeyAuthModal } from "../TurnkeyAuthModal";
|
|
15
17
|
import { SignInWithB3Privy } from "./SignInWithB3Privy";
|
|
16
18
|
import { LoginStep, LoginStepContainer } from "./steps/LoginStep";
|
|
@@ -37,6 +39,7 @@ export function SignInWithB3Flow({
|
|
|
37
39
|
}: SignInWithB3ModalProps) {
|
|
38
40
|
const { automaticallySetFirstEoa, enableTurnkey } = useB3Config();
|
|
39
41
|
const { user, refetchUser, logout } = useAuthentication(partnerId);
|
|
42
|
+
const { onTurnkeyConnect } = useContext(LocalSDKContext);
|
|
40
43
|
|
|
41
44
|
// FIXME Logout before login to ensure a clean state
|
|
42
45
|
const hasLoggedOutRef = useRef(false);
|
|
@@ -163,13 +166,17 @@ export function SignInWithB3Flow({
|
|
|
163
166
|
// Define handleTurnkeySuccess before the useEffect that uses it
|
|
164
167
|
const handleTurnkeySuccess = useCallback(
|
|
165
168
|
async (user: any) => {
|
|
166
|
-
debug("Turnkey authentication successful - setting completed flag", { user });
|
|
169
|
+
debug("Turnkey authentication successful - setting completed flag", { user, onTurnkeyConnect });
|
|
170
|
+
|
|
171
|
+
// Call the onTurnkeyConnect callback
|
|
172
|
+
onTurnkeyConnect?.(user);
|
|
167
173
|
|
|
168
174
|
// Set completed flag FIRST before any async operations
|
|
169
175
|
setTurnkeyAuthCompleted(true);
|
|
170
176
|
|
|
171
177
|
// Refetch user to update the user state with Turnkey ID
|
|
172
178
|
debug("Refetching user after Turnkey success...");
|
|
179
|
+
// TODO: See why sometimes this fails with "No wallet found during auto-connect"
|
|
173
180
|
await refetchUser();
|
|
174
181
|
debug("User refetched successfully");
|
|
175
182
|
|
|
@@ -196,6 +203,7 @@ export function SignInWithB3Flow({
|
|
|
196
203
|
// The useEffect will re-run with updated user data to complete the sign-in process
|
|
197
204
|
},
|
|
198
205
|
[
|
|
206
|
+
onTurnkeyConnect,
|
|
199
207
|
refetchUser,
|
|
200
208
|
strategies,
|
|
201
209
|
onLoginSuccess,
|
|
@@ -395,11 +403,9 @@ export function SignInWithB3Flow({
|
|
|
395
403
|
content = (
|
|
396
404
|
<LoginStepContainer partnerId={partnerId}>
|
|
397
405
|
<TurnkeyAuthModal
|
|
398
|
-
onSuccess={async (authenticatedUser:
|
|
406
|
+
onSuccess={async (authenticatedUser: Users) => {
|
|
399
407
|
debug("Turnkey authentication successful in primary flow", { authenticatedUser });
|
|
400
408
|
setTurnkeyAuthCompleted(true);
|
|
401
|
-
// After Turnkey auth, refetch user to get the full user object
|
|
402
|
-
await refetchUser();
|
|
403
409
|
// User is now authenticated via Turnkey
|
|
404
410
|
// Set both isAuthenticated and isConnected to true so UI updates properly
|
|
405
411
|
// Wallet connection is optional and can happen later for signing transactions
|
|
@@ -408,6 +414,12 @@ export function SignInWithB3Flow({
|
|
|
408
414
|
setJustCompletedLogin(true);
|
|
409
415
|
// Call the login success callback
|
|
410
416
|
onLoginSuccess?.({} as Account);
|
|
417
|
+
// Call the onTurnkeyConnect callback
|
|
418
|
+
onTurnkeyConnect?.(authenticatedUser);
|
|
419
|
+
|
|
420
|
+
// After Turnkey auth, refetch user to get the full user object
|
|
421
|
+
// TODO: See why sometimes this fails with "No wallet found during auto-connect"
|
|
422
|
+
await refetchUser();
|
|
411
423
|
}}
|
|
412
424
|
onClose={() => {
|
|
413
425
|
// If user closes Turnkey modal, they can still use wallet connection as fallback
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnySpendAllClasses } from "@b3dotfun/sdk/anyspend/react";
|
|
1
2
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
3
|
import { GenerateSigMintResponse } from "@b3dotfun/sdk/anyspend/types/signatureMint";
|
|
3
4
|
import { AllowedStrategy } from "@b3dotfun/sdk/global-account/react";
|
|
@@ -568,6 +569,8 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
568
569
|
returnHomeLabel?: string;
|
|
569
570
|
/** Whether the deposit requires a custom function (uses AnySpendCustomExactIn). Defaults to false. */
|
|
570
571
|
isCustomDeposit?: boolean;
|
|
572
|
+
/** Custom class names for styling specific elements */
|
|
573
|
+
classes?: AnySpendAllClasses;
|
|
571
574
|
}
|
|
572
575
|
|
|
573
576
|
/**
|