@unifold/headless-react 0.1.75 → 0.1.77
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 +156 -14
- package/dist/index.d.mts +183 -3
- package/dist/index.d.ts +183 -3
- package/dist/index.js +276 -35
- package/dist/index.mjs +256 -14
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -20,25 +20,30 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
-
ActionType: () =>
|
|
24
|
-
DepositSession: () =>
|
|
25
|
-
DepositSessionEventType: () =>
|
|
26
|
-
DepositSessionWaitError: () =>
|
|
27
|
-
ExecutionStatus: () =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
ActionType: () => import_core10.ActionType,
|
|
24
|
+
DepositSession: () => import_core10.DepositSession,
|
|
25
|
+
DepositSessionEventType: () => import_core10.DepositSessionEventType,
|
|
26
|
+
DepositSessionWaitError: () => import_core10.DepositSessionWaitError,
|
|
27
|
+
ExecutionStatus: () => import_core10.ExecutionStatus,
|
|
28
|
+
OnrampSession: () => import_core10.OnrampSession,
|
|
29
|
+
OnrampSessionEventType: () => import_core10.OnrampSessionEventType,
|
|
30
|
+
OnrampSessionWaitError: () => import_core10.OnrampSessionWaitError,
|
|
31
|
+
UnifoldClient: () => import_core10.UnifoldClient,
|
|
32
|
+
UnifoldProvider: () => import_react_provider10.UnifoldProvider,
|
|
33
|
+
createUnifoldClient: () => import_core10.createUnifoldClient,
|
|
31
34
|
useAddressValidation: () => useAddressValidation,
|
|
32
35
|
useAllowedCountry: () => useAllowedCountry,
|
|
33
36
|
useDeposit: () => useDeposit,
|
|
34
37
|
useDepositAddresses: () => useDepositAddresses,
|
|
35
38
|
useExecutions: () => useExecutions,
|
|
39
|
+
useFiatCurrencies: () => useFiatCurrencies,
|
|
40
|
+
useOnramp: () => useOnramp,
|
|
36
41
|
useSupportedDepositTokens: () => useSupportedDepositTokens,
|
|
37
|
-
useUnifold: () =>
|
|
42
|
+
useUnifold: () => import_react_provider10.useUnifold,
|
|
38
43
|
useUnifoldClient: () => useUnifoldClient
|
|
39
44
|
});
|
|
40
45
|
module.exports = __toCommonJS(index_exports);
|
|
41
|
-
var
|
|
46
|
+
var import_react_provider10 = require("@unifold/react-provider");
|
|
42
47
|
|
|
43
48
|
// src/use-unifold-client.ts
|
|
44
49
|
var import_react = require("react");
|
|
@@ -194,12 +199,225 @@ function useDeposit(options) {
|
|
|
194
199
|
};
|
|
195
200
|
}
|
|
196
201
|
|
|
197
|
-
// src/use-
|
|
198
|
-
var
|
|
202
|
+
// src/use-onramp.ts
|
|
203
|
+
var import_react3 = require("react");
|
|
199
204
|
var import_core3 = require("@unifold/core");
|
|
200
205
|
var import_react_provider3 = require("@unifold/react-provider");
|
|
201
|
-
|
|
206
|
+
var IDLE_SNAPSHOT2 = {
|
|
207
|
+
status: "idle",
|
|
208
|
+
countryCode: null,
|
|
209
|
+
addresses: [],
|
|
210
|
+
destinationToken: null,
|
|
211
|
+
quotes: [],
|
|
212
|
+
selectedQuote: null,
|
|
213
|
+
isQuoteAutoSelected: true,
|
|
214
|
+
canSelectProvider: false,
|
|
215
|
+
isRefreshingQuotes: false,
|
|
216
|
+
quotesUpdatedAt: null,
|
|
217
|
+
checkout: null,
|
|
218
|
+
executions: [],
|
|
219
|
+
latestExecution: null,
|
|
220
|
+
isCheckingDeposit: false,
|
|
221
|
+
error: null
|
|
222
|
+
};
|
|
223
|
+
function useOnramp(options) {
|
|
202
224
|
const { publishableKey } = (0, import_react_provider3.useUnifold)();
|
|
225
|
+
const {
|
|
226
|
+
externalUserId,
|
|
227
|
+
destination,
|
|
228
|
+
countryCode,
|
|
229
|
+
subdivisionCode,
|
|
230
|
+
sourceAmount,
|
|
231
|
+
destinationAmount,
|
|
232
|
+
sourceCurrency = "usd",
|
|
233
|
+
paymentMethodType,
|
|
234
|
+
email,
|
|
235
|
+
quoteRefreshIntervalMs,
|
|
236
|
+
quoteDebounceMs = 500,
|
|
237
|
+
autoStart = true
|
|
238
|
+
} = options;
|
|
239
|
+
const callbacksRef = (0, import_react3.useRef)(options);
|
|
240
|
+
(0, import_react3.useEffect)(() => {
|
|
241
|
+
callbacksRef.current = options;
|
|
242
|
+
});
|
|
243
|
+
const autoStartRef = (0, import_react3.useRef)(autoStart);
|
|
244
|
+
autoStartRef.current = autoStart;
|
|
245
|
+
const quoteRequestRef = (0, import_react3.useRef)({
|
|
246
|
+
countryCode,
|
|
247
|
+
subdivisionCode,
|
|
248
|
+
sourceAmount,
|
|
249
|
+
destinationAmount,
|
|
250
|
+
sourceCurrency
|
|
251
|
+
});
|
|
252
|
+
quoteRequestRef.current = {
|
|
253
|
+
countryCode,
|
|
254
|
+
subdivisionCode,
|
|
255
|
+
sourceAmount,
|
|
256
|
+
destinationAmount,
|
|
257
|
+
sourceCurrency
|
|
258
|
+
};
|
|
259
|
+
const [session, setSession] = (0, import_react3.useState)(null);
|
|
260
|
+
const sessionKey = [
|
|
261
|
+
publishableKey,
|
|
262
|
+
externalUserId ?? "",
|
|
263
|
+
destination.chainType,
|
|
264
|
+
destination.chainId,
|
|
265
|
+
destination.tokenAddress,
|
|
266
|
+
destination.recipientAddress,
|
|
267
|
+
JSON.stringify(destination.contractCalls ?? null),
|
|
268
|
+
paymentMethodType ?? "",
|
|
269
|
+
email ?? "",
|
|
270
|
+
quoteRefreshIntervalMs ?? ""
|
|
271
|
+
].join("|");
|
|
272
|
+
(0, import_react3.useEffect)(() => {
|
|
273
|
+
if (!publishableKey || !externalUserId) {
|
|
274
|
+
setSession(null);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const nextSession = new import_core3.OnrampSession({
|
|
278
|
+
publishableKey,
|
|
279
|
+
externalUserId,
|
|
280
|
+
destination,
|
|
281
|
+
quoteRequest: quoteRequestRef.current,
|
|
282
|
+
paymentMethodType,
|
|
283
|
+
email,
|
|
284
|
+
quoteRefreshIntervalMs
|
|
285
|
+
});
|
|
286
|
+
let previousStatus = nextSession.getSnapshot().status;
|
|
287
|
+
const offEvents = nextSession.on("*", (event) => {
|
|
288
|
+
const callbacks = callbacksRef.current;
|
|
289
|
+
callbacks.onEvent?.(event);
|
|
290
|
+
switch (event.type) {
|
|
291
|
+
case import_core3.OnrampSessionEventType.ADDRESSES_CREATED:
|
|
292
|
+
callbacks.onAddressesReady?.(event.data.object.addresses);
|
|
293
|
+
break;
|
|
294
|
+
case import_core3.OnrampSessionEventType.QUOTES_UPDATED:
|
|
295
|
+
callbacks.onQuotes?.(event.data.object.quotes, event.data.object.selectedQuote);
|
|
296
|
+
break;
|
|
297
|
+
case import_core3.OnrampSessionEventType.CHECKOUT_CREATED:
|
|
298
|
+
callbacks.onCheckoutCreated?.({
|
|
299
|
+
externalId: event.data.object.externalId,
|
|
300
|
+
url: event.data.object.url,
|
|
301
|
+
serviceProvider: event.data.object.serviceProvider
|
|
302
|
+
});
|
|
303
|
+
break;
|
|
304
|
+
case import_core3.OnrampSessionEventType.EXECUTION_DETECTED:
|
|
305
|
+
callbacks.onExecutionDetected?.(event.data.object);
|
|
306
|
+
break;
|
|
307
|
+
case import_core3.OnrampSessionEventType.EXECUTION_UPDATED:
|
|
308
|
+
callbacks.onExecutionUpdated?.(event.data.object);
|
|
309
|
+
break;
|
|
310
|
+
case import_core3.OnrampSessionEventType.EXECUTION_SUCCEEDED:
|
|
311
|
+
callbacks.onSuccess?.(event.data.object);
|
|
312
|
+
break;
|
|
313
|
+
case import_core3.OnrampSessionEventType.EXECUTION_FAILED:
|
|
314
|
+
callbacks.onError?.({
|
|
315
|
+
code: "DEPOSIT_FAILED",
|
|
316
|
+
message: "Deposit failed",
|
|
317
|
+
fatal: false,
|
|
318
|
+
cause: event.data.object
|
|
319
|
+
});
|
|
320
|
+
break;
|
|
321
|
+
case import_core3.OnrampSessionEventType.SESSION_ERRORED:
|
|
322
|
+
callbacks.onError?.({
|
|
323
|
+
code: event.data.object.code,
|
|
324
|
+
message: event.data.object.message,
|
|
325
|
+
fatal: event.data.object.fatal
|
|
326
|
+
});
|
|
327
|
+
break;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
const offStatus = nextSession.subscribe(() => {
|
|
331
|
+
const status = nextSession.getSnapshot().status;
|
|
332
|
+
if (status !== previousStatus) {
|
|
333
|
+
previousStatus = status;
|
|
334
|
+
callbacksRef.current.onStatusChange?.(status);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
setSession(nextSession);
|
|
338
|
+
if (autoStartRef.current) {
|
|
339
|
+
void nextSession.start();
|
|
340
|
+
}
|
|
341
|
+
return () => {
|
|
342
|
+
offEvents();
|
|
343
|
+
offStatus();
|
|
344
|
+
nextSession.destroy();
|
|
345
|
+
};
|
|
346
|
+
}, [sessionKey]);
|
|
347
|
+
const quoteInputKey = [
|
|
348
|
+
countryCode ?? "",
|
|
349
|
+
subdivisionCode ?? "",
|
|
350
|
+
sourceAmount ?? "",
|
|
351
|
+
destinationAmount ?? "",
|
|
352
|
+
sourceCurrency
|
|
353
|
+
].join("|");
|
|
354
|
+
(0, import_react3.useEffect)(() => {
|
|
355
|
+
if (!session) return;
|
|
356
|
+
const timer = setTimeout(() => {
|
|
357
|
+
session.updateQuoteRequest({
|
|
358
|
+
// undefined keeps the session's value (and IP detection for geo).
|
|
359
|
+
countryCode,
|
|
360
|
+
subdivisionCode,
|
|
361
|
+
sourceAmount,
|
|
362
|
+
destinationAmount,
|
|
363
|
+
sourceCurrency
|
|
364
|
+
});
|
|
365
|
+
}, quoteDebounceMs);
|
|
366
|
+
return () => clearTimeout(timer);
|
|
367
|
+
}, [session, quoteInputKey, quoteDebounceMs]);
|
|
368
|
+
const subscribe = (0, import_react3.useCallback)(
|
|
369
|
+
(listener) => session ? session.subscribe(listener) : () => {
|
|
370
|
+
},
|
|
371
|
+
[session]
|
|
372
|
+
);
|
|
373
|
+
const getSnapshot = (0, import_react3.useCallback)(
|
|
374
|
+
() => session ? session.getSnapshot() : IDLE_SNAPSHOT2,
|
|
375
|
+
[session]
|
|
376
|
+
);
|
|
377
|
+
const snapshot = (0, import_react3.useSyncExternalStore)(subscribe, getSnapshot, () => IDLE_SNAPSHOT2);
|
|
378
|
+
const controls = (0, import_react3.useMemo)(
|
|
379
|
+
() => ({
|
|
380
|
+
start: () => session?.start() ?? Promise.resolve(),
|
|
381
|
+
refreshQuotes: () => session?.refreshQuotes() ?? Promise.resolve(),
|
|
382
|
+
updateQuoteRequest: (patch) => session?.updateQuoteRequest(patch),
|
|
383
|
+
selectQuote: (serviceProvider) => session?.selectQuote(serviceProvider) ?? null,
|
|
384
|
+
createCheckout: (checkoutOptions) => session ? session.createCheckout(checkoutOptions) : null,
|
|
385
|
+
stop: () => session?.stop(),
|
|
386
|
+
restart: async () => {
|
|
387
|
+
if (!session) return;
|
|
388
|
+
session.stop();
|
|
389
|
+
await session.start();
|
|
390
|
+
}
|
|
391
|
+
}),
|
|
392
|
+
[session]
|
|
393
|
+
);
|
|
394
|
+
return {
|
|
395
|
+
status: snapshot.status,
|
|
396
|
+
countryCode: snapshot.countryCode,
|
|
397
|
+
addresses: snapshot.addresses,
|
|
398
|
+
destinationToken: snapshot.destinationToken,
|
|
399
|
+
quotes: snapshot.quotes,
|
|
400
|
+
selectedQuote: snapshot.selectedQuote,
|
|
401
|
+
isQuoteAutoSelected: snapshot.isQuoteAutoSelected,
|
|
402
|
+
canSelectProvider: snapshot.canSelectProvider,
|
|
403
|
+
isRefreshingQuotes: snapshot.isRefreshingQuotes,
|
|
404
|
+
quotesUpdatedAt: snapshot.quotesUpdatedAt,
|
|
405
|
+
checkout: snapshot.checkout,
|
|
406
|
+
executions: snapshot.executions,
|
|
407
|
+
latestExecution: snapshot.latestExecution,
|
|
408
|
+
isCheckingDeposit: snapshot.isCheckingDeposit,
|
|
409
|
+
error: snapshot.error,
|
|
410
|
+
...controls,
|
|
411
|
+
session
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// src/use-deposit-addresses.ts
|
|
416
|
+
var import_react_query = require("@tanstack/react-query");
|
|
417
|
+
var import_core4 = require("@unifold/core");
|
|
418
|
+
var import_react_provider4 = require("@unifold/react-provider");
|
|
419
|
+
function useDepositAddresses(options) {
|
|
420
|
+
const { publishableKey } = (0, import_react_provider4.useUnifold)();
|
|
203
421
|
const { externalUserId, destination, actionType, enabled = true } = options;
|
|
204
422
|
return (0, import_react_query.useQuery)({
|
|
205
423
|
// Key parity with @unifold/ui-react's useDepositAddress — do not reorder.
|
|
@@ -215,7 +433,7 @@ function useDepositAddresses(options) {
|
|
|
215
433
|
destination?.contractCalls ?? null,
|
|
216
434
|
publishableKey
|
|
217
435
|
],
|
|
218
|
-
queryFn: () => (0,
|
|
436
|
+
queryFn: () => (0, import_core4.createDepositAddress)(
|
|
219
437
|
{
|
|
220
438
|
external_user_id: externalUserId,
|
|
221
439
|
recipient_address: destination?.recipientAddress,
|
|
@@ -227,7 +445,7 @@ function useDepositAddresses(options) {
|
|
|
227
445
|
},
|
|
228
446
|
publishableKey
|
|
229
447
|
),
|
|
230
|
-
select: (response) => response.data.map(
|
|
448
|
+
select: (response) => response.data.map(import_core4.mapWalletToDepositAddress),
|
|
231
449
|
// When a destination is supplied it must be complete — never issue a
|
|
232
450
|
// create call with a partially-filled destination.
|
|
233
451
|
enabled: enabled && !!externalUserId && !!publishableKey && (!destination || !!destination.chainType && !!destination.chainId && !!destination.tokenAddress && !!destination.recipientAddress),
|
|
@@ -243,10 +461,10 @@ function useDepositAddresses(options) {
|
|
|
243
461
|
|
|
244
462
|
// src/use-supported-deposit-tokens.ts
|
|
245
463
|
var import_react_query2 = require("@tanstack/react-query");
|
|
246
|
-
var
|
|
247
|
-
var
|
|
464
|
+
var import_core5 = require("@unifold/core");
|
|
465
|
+
var import_react_provider5 = require("@unifold/react-provider");
|
|
248
466
|
function useSupportedDepositTokens(options = {}) {
|
|
249
|
-
const { publishableKey } = (0,
|
|
467
|
+
const { publishableKey } = (0, import_react_provider5.useUnifold)();
|
|
250
468
|
const { destination, productType, enabled = true } = options;
|
|
251
469
|
const completeDestination = destination?.chainType && destination?.chainId && destination?.tokenAddress ? destination : void 0;
|
|
252
470
|
const apiOptions = completeDestination || productType ? {
|
|
@@ -268,7 +486,7 @@ function useSupportedDepositTokens(options = {}) {
|
|
|
268
486
|
destination?.chainType ?? null,
|
|
269
487
|
productType ?? null
|
|
270
488
|
],
|
|
271
|
-
queryFn: () => (0,
|
|
489
|
+
queryFn: () => (0, import_core5.getSupportedDepositTokens)(publishableKey, apiOptions),
|
|
272
490
|
select: (response) => response.data,
|
|
273
491
|
enabled: enabled && !!publishableKey,
|
|
274
492
|
staleTime: 1e3 * 60 * 5,
|
|
@@ -280,21 +498,21 @@ function useSupportedDepositTokens(options = {}) {
|
|
|
280
498
|
|
|
281
499
|
// src/use-executions.ts
|
|
282
500
|
var import_react_query3 = require("@tanstack/react-query");
|
|
283
|
-
var
|
|
284
|
-
var
|
|
501
|
+
var import_core6 = require("@unifold/core");
|
|
502
|
+
var import_react_provider6 = require("@unifold/react-provider");
|
|
285
503
|
function useExecutions(options) {
|
|
286
|
-
const { publishableKey } = (0,
|
|
504
|
+
const { publishableKey } = (0, import_react_provider6.useUnifold)();
|
|
287
505
|
const {
|
|
288
506
|
externalUserId,
|
|
289
507
|
refetchInterval = false,
|
|
290
508
|
enabled = true,
|
|
291
|
-
actionType =
|
|
509
|
+
actionType = import_core6.ActionType.Deposit
|
|
292
510
|
} = options;
|
|
293
511
|
return (0, import_react_query3.useQuery)({
|
|
294
512
|
// Key parity with @unifold/ui-react's useExecutions.
|
|
295
513
|
queryKey: ["unifold", "executions", actionType, externalUserId, publishableKey],
|
|
296
|
-
queryFn: () => (0,
|
|
297
|
-
select: (response) => response.data.map(
|
|
514
|
+
queryFn: () => (0, import_core6.queryExecutions)(externalUserId, publishableKey, actionType),
|
|
515
|
+
select: (response) => response.data.map(import_core6.mapDirectExecution),
|
|
298
516
|
enabled: enabled && !!externalUserId && !!publishableKey,
|
|
299
517
|
refetchInterval,
|
|
300
518
|
staleTime: 0,
|
|
@@ -305,15 +523,15 @@ function useExecutions(options) {
|
|
|
305
523
|
|
|
306
524
|
// src/use-allowed-country.ts
|
|
307
525
|
var import_react_query4 = require("@tanstack/react-query");
|
|
308
|
-
var
|
|
309
|
-
var
|
|
526
|
+
var import_core7 = require("@unifold/core");
|
|
527
|
+
var import_react_provider7 = require("@unifold/react-provider");
|
|
310
528
|
function useAllowedCountry() {
|
|
311
|
-
const { publishableKey } = (0,
|
|
529
|
+
const { publishableKey } = (0, import_react_provider7.useUnifold)();
|
|
312
530
|
const ipQuery = (0, import_react_query4.useQuery)({
|
|
313
531
|
// Key parity with @unifold/core's useUserIp.
|
|
314
532
|
queryKey: ["unifold", "userIpInfo"],
|
|
315
533
|
queryFn: async () => {
|
|
316
|
-
const data = await (0,
|
|
534
|
+
const data = await (0, import_core7.getIpAddress)();
|
|
317
535
|
const subdivision = data.subdivision_code || data.state || null;
|
|
318
536
|
return { alpha2: data.alpha2, country: data.country, subdivisionCode: subdivision };
|
|
319
537
|
},
|
|
@@ -327,7 +545,7 @@ function useAllowedCountry() {
|
|
|
327
545
|
const configQuery = (0, import_react_query4.useQuery)({
|
|
328
546
|
// Key parity with @unifold/ui-react's useProjectConfig.
|
|
329
547
|
queryKey: ip?.alpha2 ? ["unifold", "projectConfig", publishableKey, ip.alpha2, ip.subdivisionCode ?? null] : ["unifold", "projectConfig", publishableKey],
|
|
330
|
-
queryFn: () => (0,
|
|
548
|
+
queryFn: () => (0, import_core7.getProjectConfig)(
|
|
331
549
|
publishableKey,
|
|
332
550
|
ip?.alpha2 ? { countryCode: ip.alpha2, subdivisionCode: ip.subdivisionCode ?? void 0 } : void 0
|
|
333
551
|
),
|
|
@@ -363,10 +581,10 @@ function useAllowedCountry() {
|
|
|
363
581
|
|
|
364
582
|
// src/use-address-validation.ts
|
|
365
583
|
var import_react_query5 = require("@tanstack/react-query");
|
|
366
|
-
var
|
|
367
|
-
var
|
|
584
|
+
var import_core8 = require("@unifold/core");
|
|
585
|
+
var import_react_provider8 = require("@unifold/react-provider");
|
|
368
586
|
function useAddressValidation(options) {
|
|
369
|
-
const { publishableKey } = (0,
|
|
587
|
+
const { publishableKey } = (0, import_react_provider8.useUnifold)();
|
|
370
588
|
const { recipientAddress, destination, enabled = true } = options;
|
|
371
589
|
const hasCompleteDestination = !!destination?.chainType && !!destination?.chainId && !!destination?.tokenAddress;
|
|
372
590
|
const shouldValidate = enabled && !!publishableKey && !!recipientAddress && hasCompleteDestination;
|
|
@@ -380,7 +598,7 @@ function useAddressValidation(options) {
|
|
|
380
598
|
destination?.chainId,
|
|
381
599
|
destination?.tokenAddress
|
|
382
600
|
],
|
|
383
|
-
queryFn: () => (0,
|
|
601
|
+
queryFn: () => (0, import_core8.verifyRecipientAddress)(
|
|
384
602
|
{
|
|
385
603
|
chain_type: destination.chainType,
|
|
386
604
|
chain_id: destination.chainId,
|
|
@@ -412,8 +630,26 @@ function useAddressValidation(options) {
|
|
|
412
630
|
};
|
|
413
631
|
}
|
|
414
632
|
|
|
633
|
+
// src/use-fiat-currencies.ts
|
|
634
|
+
var import_react_query6 = require("@tanstack/react-query");
|
|
635
|
+
var import_core9 = require("@unifold/core");
|
|
636
|
+
var import_react_provider9 = require("@unifold/react-provider");
|
|
637
|
+
function useFiatCurrencies(options = {}) {
|
|
638
|
+
const { publishableKey } = (0, import_react_provider9.useUnifold)();
|
|
639
|
+
const { enabled = true } = options;
|
|
640
|
+
return (0, import_react_query6.useQuery)({
|
|
641
|
+
queryKey: ["unifold", "fiatCurrencies", publishableKey],
|
|
642
|
+
queryFn: () => (0, import_core9.getFiatCurrencies)(publishableKey),
|
|
643
|
+
enabled: enabled && !!publishableKey,
|
|
644
|
+
staleTime: 1e3 * 60 * 5,
|
|
645
|
+
gcTime: 1e3 * 60 * 30,
|
|
646
|
+
refetchOnMount: false,
|
|
647
|
+
refetchOnWindowFocus: false
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
|
|
415
651
|
// src/index.ts
|
|
416
|
-
var
|
|
652
|
+
var import_core10 = require("@unifold/core");
|
|
417
653
|
// Annotate the CommonJS export names for ESM import in node:
|
|
418
654
|
0 && (module.exports = {
|
|
419
655
|
ActionType,
|
|
@@ -421,6 +657,9 @@ var import_core8 = require("@unifold/core");
|
|
|
421
657
|
DepositSessionEventType,
|
|
422
658
|
DepositSessionWaitError,
|
|
423
659
|
ExecutionStatus,
|
|
660
|
+
OnrampSession,
|
|
661
|
+
OnrampSessionEventType,
|
|
662
|
+
OnrampSessionWaitError,
|
|
424
663
|
UnifoldClient,
|
|
425
664
|
UnifoldProvider,
|
|
426
665
|
createUnifoldClient,
|
|
@@ -429,6 +668,8 @@ var import_core8 = require("@unifold/core");
|
|
|
429
668
|
useDeposit,
|
|
430
669
|
useDepositAddresses,
|
|
431
670
|
useExecutions,
|
|
671
|
+
useFiatCurrencies,
|
|
672
|
+
useOnramp,
|
|
432
673
|
useSupportedDepositTokens,
|
|
433
674
|
useUnifold,
|
|
434
675
|
useUnifoldClient
|