@coinlist-co/react 0.12.1-rc.a230abc → 0.12.1-rc.b45777f
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/{chunk-HLL7IBIS.js → chunk-3ZZCK4IT.js} +9 -9
- package/dist/chunk-3ZZCK4IT.js.map +1 -0
- package/dist/{chunk-GFLU5OMP.js → chunk-D42IQHQZ.js} +649 -640
- package/dist/chunk-D42IQHQZ.js.map +1 -0
- package/dist/{chunk-RPE7XIBV.js → chunk-ZUVVNZJJ.js} +126 -126
- package/dist/chunk-ZUVVNZJJ.js.map +1 -0
- package/dist/client/index.cjs +1368 -1321
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +231 -165
- package/dist/client/index.d.ts +231 -165
- package/dist/client/index.js +537 -500
- package/dist/client/index.js.map +1 -1
- package/dist/{collections-DZZFrizd.d.ts → collections-CMoojQ9M.d.ts} +1 -1
- package/dist/{collections-CAfs2Eww.d.cts → collections-koI4cjYa.d.cts} +1 -1
- package/dist/{config-D19ktBr0.d.cts → config-BmK0t-XO.d.cts} +82 -17
- package/dist/{config-D19ktBr0.d.ts → config-BmK0t-XO.d.ts} +82 -17
- package/dist/server/index.cjs +242 -234
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +4 -4
- package/dist/server/index.d.ts +4 -4
- package/dist/server/index.js +3 -3
- package/dist/server/index.js.map +1 -1
- package/dist/{shared → universal}/index.cjs +860 -848
- package/dist/universal/index.cjs.map +1 -0
- package/dist/{shared → universal}/index.d.cts +557 -557
- package/dist/{shared → universal}/index.d.ts +557 -557
- package/dist/{shared → universal}/index.js +4 -2
- package/package.json +6 -5
- package/dist/chunk-GFLU5OMP.js.map +0 -1
- package/dist/chunk-HLL7IBIS.js.map +0 -1
- package/dist/chunk-RPE7XIBV.js.map +0 -1
- package/dist/shared/index.cjs.map +0 -1
- /package/dist/{shared → universal}/index.js.map +0 -0
package/dist/client/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
3
|
-
import { A as AuthorizationCode, C as CodeVerifier, L as Logger, W as WalletError, E as Erc20Namespace, a as EthereumChain, b as EvmContractAddress, B as BlockchainAmount, c as CoinListTokenSaleNamespace, O as OfferId, d as OfferOptionId, e as AssetId, P as Participation, f as CoinListTokenSaleNamespaceImpl,
|
|
4
|
-
export { a5 as DebugEvent, a6 as FrontlineEventId, a7 as HttpError, a8 as HttpResponse, a9 as KycToken, aa as LogBinding, ab as LogBindings, ac as LogCause, ad as LogLevel, ae as LogScope, af as LogValue, ag as ProductionLogLevel, ah as RedactedWalletError, ai as RequestId, aj as SafeEvent, ak as SafeFields, al as UnredactedFields } from '../config-
|
|
5
|
-
import { P as PKCEConfig, E as EvmWallet, S as SwapQuote, A as AssetIconUrl, a as ShortenedWalletAddress, F as FormattedAmountAssetUi, b as FormattedPercentUi, T as TxExplorerUrl, C as ConnectWallet, N as NonEmptyArray } from '../collections-
|
|
6
|
-
export { B as BroadcastTxParams, c as EvmSigner, W as WriteContractParams } from '../collections-
|
|
3
|
+
import { A as AuthorizationCode, C as CodeVerifier, L as Logger, W as WalletError, E as Erc20Namespace, a as EthereumChain, b as EvmContractAddress, B as BlockchainAmount, c as CoinListTokenSaleNamespace, O as OfferId, d as OfferOptionId, e as AssetId, P as Participation, f as CoinListTokenSaleNamespaceImpl, U as UniversalNamespaceContext, g as OndoNamespace, h as AssetSymbol, i as OfferSwapContract, j as OndoBuyTransaction, k as OndoSellTransaction, l as OndoSwapTransactionCore, m as OrderBookSide, n as OndoNamespaceImpl, S as SuperstateSwapNamespace, o as WalletsNamespace, p as Bps, q as EvmWalletAddress, r as SuperstateSwapNamespaceImpl, R as RequirementsNamespace, s as Requirement, t as RequirementsNamespaceImpl, u as Config, v as OAuthAccessToken, w as OffersNamespace, T as TokensNamespace, x as StablecoinSymbol, y as Erc20Asset, z as OfferDetail, D as TokenMetadata, F as OfferType, G as Offer, H as RequirementStatusInfo, I as RequirementType, J as RequirementStatusValue, K as OfferOptionAddress, M as RequirementId, N as KycLevelName, Q as DocumentSubmission, V as WalletChallengeType, X as PinoLoggerOptions, Y as OndoTradingStatus, Z as AssetDecimals, _ as BuildOndoBuyParams, $ as BuildOndoSellParams, a0 as OndoQuote, a1 as OndoQuoteSize, a2 as TokenIdentifier, a3 as OfferOptionAddressId, a4 as TokenLogo } from '../config-BmK0t-XO.cjs';
|
|
4
|
+
export { a5 as DebugEvent, a6 as FrontlineEventId, a7 as HttpError, a8 as HttpResponse, a9 as KycToken, aa as LogBinding, ab as LogBindings, ac as LogCause, ad as LogLevel, ae as LogScope, af as LogValue, ag as ProductionLogLevel, ah as RedactedWalletError, ai as RequestId, aj as SafeEvent, ak as SafeFields, al as UnredactedFields } from '../config-BmK0t-XO.cjs';
|
|
5
|
+
import { P as PKCEConfig, E as EvmWallet, S as SwapQuote, A as AssetIconUrl, a as ShortenedWalletAddress, F as FormattedAmountAssetUi, b as FormattedPercentUi, T as TxExplorerUrl, C as ConnectWallet, N as NonEmptyArray } from '../collections-koI4cjYa.cjs';
|
|
6
|
+
export { B as BroadcastTxParams, c as EvmSigner, W as WriteContractParams } from '../collections-koI4cjYa.cjs';
|
|
7
7
|
import { Hash } from 'viem';
|
|
8
8
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
9
9
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -250,7 +250,7 @@ interface ClientCoinListTokenSaleNamespace extends CoinListTokenSaleNamespace {
|
|
|
250
250
|
}
|
|
251
251
|
declare class ClientCoinListTokenSaleNamespaceImpl extends CoinListTokenSaleNamespaceImpl implements ClientCoinListTokenSaleNamespace {
|
|
252
252
|
private readonly erc20;
|
|
253
|
-
constructor(ctx:
|
|
253
|
+
constructor(ctx: UniversalNamespaceContext, erc20: Erc20Namespace);
|
|
254
254
|
execute(params: Omit<ExecuteTokenSaleParams, 'erc20' | 'tokenSale'>): Promise<TokenSaleExecutionResult>;
|
|
255
255
|
}
|
|
256
256
|
|
|
@@ -492,7 +492,7 @@ interface ClientOndoNamespace extends OndoNamespace {
|
|
|
492
492
|
}
|
|
493
493
|
declare class ClientOndoNamespaceImpl extends OndoNamespaceImpl implements ClientOndoNamespace {
|
|
494
494
|
private readonly erc20;
|
|
495
|
-
constructor(ctx:
|
|
495
|
+
constructor(ctx: UniversalNamespaceContext, erc20: Erc20Namespace);
|
|
496
496
|
prepareBuy(params: Omit<PrepareOndoBuyParams, 'ondo' | 'erc20'>): Promise<OndoBuyPreparationResult>;
|
|
497
497
|
prepareSell(params: Omit<PrepareOndoSellParams, 'ondo' | 'erc20'>): Promise<OndoSellPreparationResult>;
|
|
498
498
|
executeSwap<T extends OndoSwapTransactionCore & {
|
|
@@ -640,7 +640,7 @@ interface ClientSuperstateSwapNamespace extends SuperstateSwapNamespace {
|
|
|
640
640
|
declare class ClientSuperstateSwapNamespaceImpl extends SuperstateSwapNamespaceImpl implements ClientSuperstateSwapNamespace {
|
|
641
641
|
private readonly erc20;
|
|
642
642
|
private readonly wallets;
|
|
643
|
-
constructor(ctx:
|
|
643
|
+
constructor(ctx: UniversalNamespaceContext, erc20: Erc20Namespace, wallets: WalletsNamespace);
|
|
644
644
|
execute(params: Omit<ExecuteSwapParams, 'swap' | 'erc20'>): Promise<SwapExecutionResult>;
|
|
645
645
|
authorizeWallet(params: Omit<AuthorizeWalletParams, 'swap' | 'wallets'>): Promise<WalletAuthorizationResult>;
|
|
646
646
|
}
|
|
@@ -665,7 +665,7 @@ interface ClientRequirementsNamespace extends RequirementsNamespace {
|
|
|
665
665
|
}
|
|
666
666
|
declare class ClientRequirementsNamespaceImpl extends RequirementsNamespaceImpl implements ClientRequirementsNamespace {
|
|
667
667
|
private readonly coinlistBaseUrl;
|
|
668
|
-
constructor(ctx:
|
|
668
|
+
constructor(ctx: UniversalNamespaceContext, coinlistBaseUrl: string | undefined);
|
|
669
669
|
handle(requirement: Requirement): void;
|
|
670
670
|
}
|
|
671
671
|
|
|
@@ -1901,19 +1901,30 @@ type OndoCheckoutErrorReason =
|
|
|
1901
1901
|
type OndoSidebarUiState = {
|
|
1902
1902
|
asset: CheckoutAssetUi;
|
|
1903
1903
|
/**
|
|
1904
|
-
* Who issues the
|
|
1905
|
-
*
|
|
1906
|
-
* `null` hides the row. No frontline endpoint carries an issuer today, so
|
|
1907
|
-
* absence is the normal case rather than an edge one — the same reasoning as
|
|
1908
|
-
* `coinlistFee` on the review step.
|
|
1904
|
+
* Who issues the *token*, e.g. `Ondo Global Markets` — not the issuer of the
|
|
1905
|
+
* security it tracks, which is the asset's own name. `null` hides the row.
|
|
1909
1906
|
*/
|
|
1910
1907
|
issuer: string | null;
|
|
1911
1908
|
/** The underlying's ticker, e.g. `AAPL` — not the token symbol. `null` hides the row. */
|
|
1912
1909
|
tickerSymbol: string | null;
|
|
1913
|
-
/**
|
|
1910
|
+
/**
|
|
1911
|
+
* The underlying's ISIN, e.g. `US0378331005`. `null` hides the row, and is
|
|
1912
|
+
* the normal case for the few securities the supplier publishes none for.
|
|
1913
|
+
*/
|
|
1914
1914
|
isin: string | null;
|
|
1915
|
-
/**
|
|
1915
|
+
/**
|
|
1916
|
+
* What kind of instrument it is, in the supplier's own vocabulary — a common
|
|
1917
|
+
* stock arrives as `Stock`, not `Common Stock`. Rendered as given, never
|
|
1918
|
+
* branched on, because the vocabulary can grow. `null` hides the row.
|
|
1919
|
+
*/
|
|
1916
1920
|
assetType: string | null;
|
|
1921
|
+
/**
|
|
1922
|
+
* The venue the underlying lists on, e.g. `NASDAQ`. Unlike the rows above it
|
|
1923
|
+
* is recorded by hand rather than served by the supplier, so `null` — which
|
|
1924
|
+
* hides the row — is the normal state until someone records it, and says
|
|
1925
|
+
* nothing about whether the offer tokenizes a security.
|
|
1926
|
+
*/
|
|
1927
|
+
listingVenue: string | null;
|
|
1917
1928
|
/** Display name of the chain the token lives on, e.g. `Ethereum`. */
|
|
1918
1929
|
networkName: string;
|
|
1919
1930
|
price: OndoSidebarPriceUi;
|
|
@@ -3238,6 +3249,11 @@ interface OffersGridContainerProps {
|
|
|
3238
3249
|
* fetch entirely.
|
|
3239
3250
|
*/
|
|
3240
3251
|
data?: Offer[];
|
|
3252
|
+
/**
|
|
3253
|
+
* Default `true`. When `false` nothing is fetched, so the container can be
|
|
3254
|
+
* mounted while the grid is not needed yet.
|
|
3255
|
+
*/
|
|
3256
|
+
enabled?: boolean;
|
|
3241
3257
|
}
|
|
3242
3258
|
/**
|
|
3243
3259
|
* Displays a responsive live-sale grid of {@link OfferSaleCard}, backed by
|
|
@@ -3246,14 +3262,16 @@ interface OffersGridContainerProps {
|
|
|
3246
3262
|
* past-sales browse rows, compose {@link OffersAssetGrid} instead.
|
|
3247
3263
|
*
|
|
3248
3264
|
* Pass `data` (pre-fetched server-side) to use that data as-is and skip the
|
|
3249
|
-
* client-side fetch entirely.
|
|
3250
|
-
*
|
|
3251
|
-
*
|
|
3265
|
+
* client-side fetch entirely. Pass `enabled={false}` to skip the fetch when
|
|
3266
|
+
* the container is mounted but the grid is not needed yet. Uses the
|
|
3267
|
+
* `loading` / `error` / `emptyState` slots when provided; otherwise renders
|
|
3268
|
+
* the standard fallbacks. Cards are interactive only when `onOfferClick` is
|
|
3269
|
+
* provided.
|
|
3252
3270
|
*
|
|
3253
3271
|
* Self-scoped: renders fully styled on its own, with no `CoinListStyleScope`
|
|
3254
3272
|
* needed.
|
|
3255
3273
|
*/
|
|
3256
|
-
declare function OffersGridContainer({ data, onOfferClick, ...viewProps }?: OffersGridContainerProps): ReactNode;
|
|
3274
|
+
declare function OffersGridContainer({ data, onOfferClick, enabled, ...viewProps }?: OffersGridContainerProps): ReactNode;
|
|
3257
3275
|
|
|
3258
3276
|
/**
|
|
3259
3277
|
* An offer as {@link OfferSaleCard} renders it. Countdown copy is derived in
|
|
@@ -3507,6 +3525,82 @@ interface ConnectedWalletListProps {
|
|
|
3507
3525
|
*/
|
|
3508
3526
|
declare function ConnectedWalletList(props: ConnectedWalletListProps): ReactNode;
|
|
3509
3527
|
|
|
3528
|
+
interface IdentityVerificationContainerProps {
|
|
3529
|
+
/**
|
|
3530
|
+
* Sumsub verification level to start. Determines which screens the Sumsub
|
|
3531
|
+
* WebSDK shows. Defaults to the backend's standard identity level.
|
|
3532
|
+
*/
|
|
3533
|
+
levelName?: KycLevelName;
|
|
3534
|
+
/**
|
|
3535
|
+
* Reset the Sumsub applicant before starting the flow, so an
|
|
3536
|
+
* already-approved level can be executed again (e.g. to update stale PII).
|
|
3537
|
+
* Pass the `kycReset` value from the requirement status. Applies only to
|
|
3538
|
+
* the initial token: mid-flow token refreshes never repeat the reset.
|
|
3539
|
+
*/
|
|
3540
|
+
reset?: boolean;
|
|
3541
|
+
/** BCP-47 language tag for the Sumsub UI, e.g. `'en'`. */
|
|
3542
|
+
locale?: string;
|
|
3543
|
+
/**
|
|
3544
|
+
* Called when the user submits their data in the Sumsub flow. Verification
|
|
3545
|
+
* continues asynchronously on the backend, so the requirement typically moves
|
|
3546
|
+
* to a pending state first - refetch requirement statuses to observe it.
|
|
3547
|
+
*/
|
|
3548
|
+
onSubmitted?: () => void;
|
|
3549
|
+
/** Called when the Sumsub flow reports an error. */
|
|
3550
|
+
onError?: (error: Error) => void;
|
|
3551
|
+
className?: string;
|
|
3552
|
+
}
|
|
3553
|
+
/**
|
|
3554
|
+
* Inline Sumsub identity verification flow, backed by
|
|
3555
|
+
* {@link useIdentityVerificationViewModel}, which fetches the Sumsub WebSDK
|
|
3556
|
+
* access token via {@link useKycToken}. Used by
|
|
3557
|
+
* `RequirementsChecklistContainer` for KYC-backed requirements, and can also
|
|
3558
|
+
* be rendered standalone.
|
|
3559
|
+
*/
|
|
3560
|
+
declare function IdentityVerificationContainer({ levelName, reset, locale, onSubmitted, onError, className, }: IdentityVerificationContainerProps): ReactNode;
|
|
3561
|
+
|
|
3562
|
+
type IdentityVerificationUiState = {
|
|
3563
|
+
type: 'loading';
|
|
3564
|
+
} | {
|
|
3565
|
+
type: 'error';
|
|
3566
|
+
message: string;
|
|
3567
|
+
retryable: boolean;
|
|
3568
|
+
} | {
|
|
3569
|
+
type: 'ready';
|
|
3570
|
+
accessToken: string;
|
|
3571
|
+
/** BCP-47 language tag for the Sumsub UI, or `undefined` for its default. */
|
|
3572
|
+
locale: string | undefined;
|
|
3573
|
+
/**
|
|
3574
|
+
* Handed straight to the Sumsub WebSDK, which refreshes an expired token
|
|
3575
|
+
* by calling it and awaiting the new one. It has to be a callback rather
|
|
3576
|
+
* than an event, because the third-party SDK expects a promise back.
|
|
3577
|
+
*/
|
|
3578
|
+
refreshToken: () => Promise<string>;
|
|
3579
|
+
};
|
|
3580
|
+
type IdentityVerificationUiEvent = {
|
|
3581
|
+
type: 'ON_RETRY';
|
|
3582
|
+
} | {
|
|
3583
|
+
type: 'ON_SUBMITTED';
|
|
3584
|
+
} | {
|
|
3585
|
+
type: 'ON_ERROR';
|
|
3586
|
+
error: Error;
|
|
3587
|
+
};
|
|
3588
|
+
|
|
3589
|
+
interface IdentityVerificationViewProps {
|
|
3590
|
+
state: IdentityVerificationUiState;
|
|
3591
|
+
onEvent: (event: IdentityVerificationUiEvent) => void;
|
|
3592
|
+
className?: string;
|
|
3593
|
+
}
|
|
3594
|
+
/**
|
|
3595
|
+
* Renders the inline Sumsub identity verification flow: its loading state, its
|
|
3596
|
+
* failure states, and the Sumsub iframe itself. Pure: the access token arrives
|
|
3597
|
+
* in `state`, and flow outcomes leave through `onEvent`.
|
|
3598
|
+
*
|
|
3599
|
+
* Self-scoped: renders fully styled on its own, with no `CoinListStyleScope`
|
|
3600
|
+
* needed.
|
|
3601
|
+
*/
|
|
3602
|
+
declare function IdentityVerificationView(props: IdentityVerificationViewProps): ReactNode;
|
|
3603
|
+
|
|
3510
3604
|
interface RequirementItemProps {
|
|
3511
3605
|
ui: RequirementItemUi;
|
|
3512
3606
|
expanded?: boolean;
|
|
@@ -3554,6 +3648,12 @@ interface UseRequirementsOptions {
|
|
|
3554
3648
|
* Calling `refetch()` will still trigger a fresh fetch.
|
|
3555
3649
|
*/
|
|
3556
3650
|
data?: RequirementsData;
|
|
3651
|
+
/**
|
|
3652
|
+
* When `false`, the hook sends no request. A seeded or already-fetched
|
|
3653
|
+
* `CONTENT` survives; otherwise the hook stays `LOADING`. Defaults to `true`.
|
|
3654
|
+
* `refetch()` is a no-op while disabled.
|
|
3655
|
+
*/
|
|
3656
|
+
enabled?: boolean;
|
|
3557
3657
|
}
|
|
3558
3658
|
interface UseRequirementsResult {
|
|
3559
3659
|
requirementsState: LoadRequirementsState;
|
|
@@ -3566,6 +3666,8 @@ interface UseRequirementsResult {
|
|
|
3566
3666
|
*
|
|
3567
3667
|
* Pass `data` (pre-fetched server-side) to use that data as-is and skip
|
|
3568
3668
|
* the initial client-side fetch. Calling `refetch()` will still trigger a fresh fetch.
|
|
3669
|
+
* Pass `enabled: false` to skip the fetch when the hook must be called but
|
|
3670
|
+
* the data is not needed yet.
|
|
3569
3671
|
*
|
|
3570
3672
|
* Returns `LOADING` while CoinList is initializing or while data is being fetched.
|
|
3571
3673
|
* Returns `CONTENT` with requirements and statuses on success.
|
|
@@ -3633,6 +3735,11 @@ interface RequirementsChecklistContainerProps {
|
|
|
3633
3735
|
* not part of `RequirementsData` and are always fetched client-side.
|
|
3634
3736
|
*/
|
|
3635
3737
|
data?: RequirementsData;
|
|
3738
|
+
/**
|
|
3739
|
+
* Default `true`. When `false` nothing is fetched, so the container can be
|
|
3740
|
+
* mounted while the checklist is not needed yet.
|
|
3741
|
+
*/
|
|
3742
|
+
enabled?: boolean;
|
|
3636
3743
|
/**
|
|
3637
3744
|
* Options for the inline Sumsub verification flow, shown when
|
|
3638
3745
|
* `onRequirementActionOverride` is not provided. The flow starts whenever
|
|
@@ -3653,7 +3760,8 @@ interface RequirementsChecklistContainerProps {
|
|
|
3653
3760
|
* specified option.
|
|
3654
3761
|
*
|
|
3655
3762
|
* Pass `data` (pre-fetched server-side) to use that data as-is and skip the
|
|
3656
|
-
* initial client-side fetch.
|
|
3763
|
+
* initial client-side fetch. Pass `enabled={false}` to skip fetches when the
|
|
3764
|
+
* container is mounted but the checklist is not needed yet.
|
|
3657
3765
|
*
|
|
3658
3766
|
* When the user is not authenticated, renders a sign-in card instead of the
|
|
3659
3767
|
* checklist - without fetching. Pass `unauthenticatedState` to customize that
|
|
@@ -3667,7 +3775,7 @@ interface RequirementsChecklistContainerProps {
|
|
|
3667
3775
|
*
|
|
3668
3776
|
* Self-scoped: renders fully styled on its own, with no `CoinListStyleScope` needed.
|
|
3669
3777
|
*/
|
|
3670
|
-
declare function RequirementsChecklistContainer({ loading, error, unauthenticatedState, className, ...options }: RequirementsChecklistContainerProps): ReactNode;
|
|
3778
|
+
declare function RequirementsChecklistContainer({ loading, error, unauthenticatedState, className, enabled, ...options }: RequirementsChecklistContainerProps): ReactNode;
|
|
3671
3779
|
|
|
3672
3780
|
interface RequirementsChecklistViewProps {
|
|
3673
3781
|
state: RequirementsChecklistUiState;
|
|
@@ -3697,99 +3805,6 @@ interface RequirementsChecklistViewProps {
|
|
|
3697
3805
|
*/
|
|
3698
3806
|
declare function RequirementsChecklistView(props: RequirementsChecklistViewProps): ReactNode;
|
|
3699
3807
|
|
|
3700
|
-
interface VerificationOverlayProps {
|
|
3701
|
-
onClose: () => void;
|
|
3702
|
-
children: ReactNode;
|
|
3703
|
-
}
|
|
3704
|
-
/**
|
|
3705
|
-
* Full-screen overlay hosting the identity verification flow. Mirrors
|
|
3706
|
-
* frontline-web, where verification runs on a dedicated full page rather than
|
|
3707
|
-
* inside the requirement row.
|
|
3708
|
-
*
|
|
3709
|
-
* Self-scoped: renders fully styled on its own, with no `CoinListStyleScope`
|
|
3710
|
-
* needed. It has to be, because the checklist renders it as a sibling of
|
|
3711
|
-
* `RequirementsChecklistView` rather than inside it, and its backdrop
|
|
3712
|
-
* (`bg-overlay`) is token-backed: outside `.clco-sdk-root` the token is
|
|
3713
|
-
* undefined and the scrim disappears entirely.
|
|
3714
|
-
*/
|
|
3715
|
-
declare function VerificationOverlay({ onClose, children, }: VerificationOverlayProps): ReactNode;
|
|
3716
|
-
|
|
3717
|
-
interface IdentityVerificationContainerProps {
|
|
3718
|
-
/**
|
|
3719
|
-
* Sumsub verification level to start. Determines which screens the Sumsub
|
|
3720
|
-
* WebSDK shows. Defaults to the backend's standard identity level.
|
|
3721
|
-
*/
|
|
3722
|
-
levelName?: KycLevelName;
|
|
3723
|
-
/**
|
|
3724
|
-
* Reset the Sumsub applicant before starting the flow, so an
|
|
3725
|
-
* already-approved level can be executed again (e.g. to update stale PII).
|
|
3726
|
-
* Pass the `kycReset` value from the requirement status. Applies only to
|
|
3727
|
-
* the initial token: mid-flow token refreshes never repeat the reset.
|
|
3728
|
-
*/
|
|
3729
|
-
reset?: boolean;
|
|
3730
|
-
/** BCP-47 language tag for the Sumsub UI, e.g. `'en'`. */
|
|
3731
|
-
locale?: string;
|
|
3732
|
-
/**
|
|
3733
|
-
* Called when the user submits their data in the Sumsub flow. Verification
|
|
3734
|
-
* continues asynchronously on the backend, so the requirement typically moves
|
|
3735
|
-
* to a pending state first - refetch requirement statuses to observe it.
|
|
3736
|
-
*/
|
|
3737
|
-
onSubmitted?: () => void;
|
|
3738
|
-
/** Called when the Sumsub flow reports an error. */
|
|
3739
|
-
onError?: (error: Error) => void;
|
|
3740
|
-
className?: string;
|
|
3741
|
-
}
|
|
3742
|
-
/**
|
|
3743
|
-
* Inline Sumsub identity verification flow, backed by
|
|
3744
|
-
* {@link useIdentityVerificationViewModel}, which fetches the Sumsub WebSDK
|
|
3745
|
-
* access token via {@link useKycToken}. Used by
|
|
3746
|
-
* `RequirementsChecklistContainer` for KYC-backed requirements, and can also
|
|
3747
|
-
* be rendered standalone.
|
|
3748
|
-
*/
|
|
3749
|
-
declare function IdentityVerificationContainer({ levelName, reset, locale, onSubmitted, onError, className, }: IdentityVerificationContainerProps): ReactNode;
|
|
3750
|
-
|
|
3751
|
-
type IdentityVerificationUiState = {
|
|
3752
|
-
type: 'loading';
|
|
3753
|
-
} | {
|
|
3754
|
-
type: 'error';
|
|
3755
|
-
message: string;
|
|
3756
|
-
retryable: boolean;
|
|
3757
|
-
} | {
|
|
3758
|
-
type: 'ready';
|
|
3759
|
-
accessToken: string;
|
|
3760
|
-
/** BCP-47 language tag for the Sumsub UI, or `undefined` for its default. */
|
|
3761
|
-
locale: string | undefined;
|
|
3762
|
-
/**
|
|
3763
|
-
* Handed straight to the Sumsub WebSDK, which refreshes an expired token
|
|
3764
|
-
* by calling it and awaiting the new one. It has to be a callback rather
|
|
3765
|
-
* than an event, because the third-party SDK expects a promise back.
|
|
3766
|
-
*/
|
|
3767
|
-
refreshToken: () => Promise<string>;
|
|
3768
|
-
};
|
|
3769
|
-
type IdentityVerificationUiEvent = {
|
|
3770
|
-
type: 'ON_RETRY';
|
|
3771
|
-
} | {
|
|
3772
|
-
type: 'ON_SUBMITTED';
|
|
3773
|
-
} | {
|
|
3774
|
-
type: 'ON_ERROR';
|
|
3775
|
-
error: Error;
|
|
3776
|
-
};
|
|
3777
|
-
|
|
3778
|
-
interface IdentityVerificationViewProps {
|
|
3779
|
-
state: IdentityVerificationUiState;
|
|
3780
|
-
onEvent: (event: IdentityVerificationUiEvent) => void;
|
|
3781
|
-
className?: string;
|
|
3782
|
-
}
|
|
3783
|
-
/**
|
|
3784
|
-
* Renders the inline Sumsub identity verification flow: its loading state, its
|
|
3785
|
-
* failure states, and the Sumsub iframe itself. Pure: the access token arrives
|
|
3786
|
-
* in `state`, and flow outcomes leave through `onEvent`.
|
|
3787
|
-
*
|
|
3788
|
-
* Self-scoped: renders fully styled on its own, with no `CoinListStyleScope`
|
|
3789
|
-
* needed.
|
|
3790
|
-
*/
|
|
3791
|
-
declare function IdentityVerificationView(props: IdentityVerificationViewProps): ReactNode;
|
|
3792
|
-
|
|
3793
3808
|
interface TaxDocumentModalContainerProps {
|
|
3794
3809
|
isOpen: boolean;
|
|
3795
3810
|
onClose: () => void;
|
|
@@ -3900,6 +3915,23 @@ interface TaxDocumentModalViewProps {
|
|
|
3900
3915
|
*/
|
|
3901
3916
|
declare function TaxDocumentModalView({ state, onEvent, className, }: TaxDocumentModalViewProps): ReactNode;
|
|
3902
3917
|
|
|
3918
|
+
interface VerificationOverlayProps {
|
|
3919
|
+
onClose: () => void;
|
|
3920
|
+
children: ReactNode;
|
|
3921
|
+
}
|
|
3922
|
+
/**
|
|
3923
|
+
* Full-screen overlay hosting the identity verification flow. Mirrors
|
|
3924
|
+
* frontline-web, where verification runs on a dedicated full page rather than
|
|
3925
|
+
* inside the requirement row.
|
|
3926
|
+
*
|
|
3927
|
+
* Self-scoped: renders fully styled on its own, with no `CoinListStyleScope`
|
|
3928
|
+
* needed. It has to be, because the checklist renders it as a sibling of
|
|
3929
|
+
* `RequirementsChecklistView` rather than inside it, and its backdrop
|
|
3930
|
+
* (`bg-overlay`) is token-backed: outside `.clco-sdk-root` the token is
|
|
3931
|
+
* undefined and the scrim disappears entirely.
|
|
3932
|
+
*/
|
|
3933
|
+
declare function VerificationOverlay({ onClose, children, }: VerificationOverlayProps): ReactNode;
|
|
3934
|
+
|
|
3903
3935
|
interface ConnectWalletModalContainerProps {
|
|
3904
3936
|
isOpen: boolean;
|
|
3905
3937
|
onClose: () => void;
|
|
@@ -4196,6 +4228,11 @@ interface UseParticipationsOptions {
|
|
|
4196
4228
|
* When provided, the hook uses this data as-is and skips the client-side fetch entirely.
|
|
4197
4229
|
*/
|
|
4198
4230
|
data?: Participation[];
|
|
4231
|
+
/**
|
|
4232
|
+
* When `false`, the hook sends no request. A seeded or already-fetched
|
|
4233
|
+
* `CONTENT` survives; otherwise the hook stays `LOADING`. Defaults to `true`.
|
|
4234
|
+
*/
|
|
4235
|
+
enabled?: boolean;
|
|
4199
4236
|
}
|
|
4200
4237
|
interface UseParticipationsResult {
|
|
4201
4238
|
participationsState: LoadParticipationsState;
|
|
@@ -4205,7 +4242,8 @@ interface UseParticipationsResult {
|
|
|
4205
4242
|
* Optionally filters by offer when `offerId` is provided.
|
|
4206
4243
|
*
|
|
4207
4244
|
* Pass `data` (pre-fetched server-side) to use that data as-is and skip
|
|
4208
|
-
* the client-side fetch entirely.
|
|
4245
|
+
* the client-side fetch entirely. Pass `enabled: false` to skip the fetch
|
|
4246
|
+
* when the hook must be called but the data is not needed yet.
|
|
4209
4247
|
*
|
|
4210
4248
|
* Returns `LOADING` while CoinList is initializing or while participations are being fetched.
|
|
4211
4249
|
* Returns `CONTENT` with all participations when `fetchParticipations()` succeeds.
|
|
@@ -5649,6 +5687,11 @@ interface UseOfferDetailsOptions {
|
|
|
5649
5687
|
* When provided, the hook uses this data as-is and skips the client-side fetch entirely.
|
|
5650
5688
|
*/
|
|
5651
5689
|
data?: OfferDetail;
|
|
5690
|
+
/**
|
|
5691
|
+
* When `false`, the hook sends no request. A seeded or already-fetched
|
|
5692
|
+
* `CONTENT` survives; otherwise the hook stays `LOADING`. Defaults to `true`.
|
|
5693
|
+
*/
|
|
5694
|
+
enabled?: boolean;
|
|
5652
5695
|
}
|
|
5653
5696
|
interface UseOfferDetailsResult {
|
|
5654
5697
|
offerDetailsState: LoadOfferDetailsState;
|
|
@@ -5657,7 +5700,8 @@ interface UseOfferDetailsResult {
|
|
|
5657
5700
|
* Loads CoinList offer details for a given offer id and exposes a UI-friendly state.
|
|
5658
5701
|
*
|
|
5659
5702
|
* Pass `data` (pre-fetched server-side) to use that data as-is and skip
|
|
5660
|
-
* the client-side fetch entirely.
|
|
5703
|
+
* the client-side fetch entirely. Pass `enabled: false` to skip the fetch
|
|
5704
|
+
* when the hook must be called but the data is not needed yet.
|
|
5661
5705
|
*
|
|
5662
5706
|
* Returns `LOADING` while CoinList is initializing or while details are being fetched.
|
|
5663
5707
|
* Returns `CONTENT` with the offer when `offers.get()` succeeds.
|
|
@@ -5683,6 +5727,11 @@ interface UseOffersOptions {
|
|
|
5683
5727
|
* When provided, the hook uses this data as-is and skips the client-side fetch entirely.
|
|
5684
5728
|
*/
|
|
5685
5729
|
data?: Offer[];
|
|
5730
|
+
/**
|
|
5731
|
+
* When `false`, the hook sends no request. A seeded or already-fetched
|
|
5732
|
+
* `CONTENT` survives; otherwise the hook stays `LOADING`. Defaults to `true`.
|
|
5733
|
+
*/
|
|
5734
|
+
enabled?: boolean;
|
|
5686
5735
|
}
|
|
5687
5736
|
interface UseOffersResult {
|
|
5688
5737
|
offersState: LoadOffersState;
|
|
@@ -5691,7 +5740,8 @@ interface UseOffersResult {
|
|
|
5691
5740
|
* Loads all CoinList offers for the current user and exposes a UI-friendly state.
|
|
5692
5741
|
*
|
|
5693
5742
|
* Pass `data` (pre-fetched server-side) to use that data as-is and skip
|
|
5694
|
-
* the client-side fetch entirely.
|
|
5743
|
+
* the client-side fetch entirely. Pass `enabled: false` to skip the fetch
|
|
5744
|
+
* when the hook must be called but the data is not needed yet.
|
|
5695
5745
|
*
|
|
5696
5746
|
* Returns `LOADING` while CoinList is initializing or while offers are being fetched.
|
|
5697
5747
|
* Returns `CONTENT` with all offers when `fetchOffers()` succeeds.
|
|
@@ -5707,6 +5757,11 @@ interface UseOffersGridViewModelOptions {
|
|
|
5707
5757
|
* When provided, the client-side fetch is skipped entirely.
|
|
5708
5758
|
*/
|
|
5709
5759
|
data?: Offer[];
|
|
5760
|
+
/**
|
|
5761
|
+
* Default `true`. When `false` nothing is fetched, so the hook can be called
|
|
5762
|
+
* unconditionally while the grid is not needed yet.
|
|
5763
|
+
*/
|
|
5764
|
+
enabled?: boolean;
|
|
5710
5765
|
/** Called with the domain offer behind the card the user clicked. */
|
|
5711
5766
|
onOfferClick?: (offer: Offer) => void;
|
|
5712
5767
|
}
|
|
@@ -5717,56 +5772,12 @@ interface UseOffersGridViewModelResult {
|
|
|
5717
5772
|
/**
|
|
5718
5773
|
* Drives {@link OffersGridView}: loads the offers, formats them for the cards,
|
|
5719
5774
|
* and resolves a clicked card back to its domain offer for the host callback.
|
|
5775
|
+
*
|
|
5776
|
+
* Pass `enabled: false` to skip the fetch when the hook must be called but
|
|
5777
|
+
* the grid is not needed yet.
|
|
5720
5778
|
*/
|
|
5721
5779
|
declare function useOffersGridViewModel(options?: UseOffersGridViewModelOptions): UseOffersGridViewModelResult;
|
|
5722
5780
|
|
|
5723
|
-
interface UseRequirementsChecklistViewModelOptions {
|
|
5724
|
-
offerId: OfferId;
|
|
5725
|
-
optionId: OfferOptionId;
|
|
5726
|
-
title: string;
|
|
5727
|
-
description: string;
|
|
5728
|
-
onContinue?: () => void;
|
|
5729
|
-
/**
|
|
5730
|
-
* Called when the user clicks a requirement's action button. Defaults to
|
|
5731
|
-
* `CoinListClient#requirements.handle`, except for `document` requirements,
|
|
5732
|
-
* which open the built-in tax document modal, and wallet requirements with a
|
|
5733
|
-
* host wallet, which open the built-in connect flow. Pass `null` to disable
|
|
5734
|
-
* the action button entirely.
|
|
5735
|
-
*/
|
|
5736
|
-
onRequirementActionOverride?: ((requirement: Requirement) => void) | null;
|
|
5737
|
-
/**
|
|
5738
|
-
* Called when the user clicks "Contact support" on a rejected requirement.
|
|
5739
|
-
* Defaults to `CoinListClient#support.contact`. Pass `null` to disable the
|
|
5740
|
-
* button entirely.
|
|
5741
|
-
*/
|
|
5742
|
-
onContactSupportOverride?: ((requirement: Requirement) => void) | null;
|
|
5743
|
-
/** Host-provided connected wallet, or `null` while none is connected. */
|
|
5744
|
-
wallet?: ConnectWallet | null;
|
|
5745
|
-
/** Called when the user asks to connect a wallet and none is connected yet. */
|
|
5746
|
-
onRequestConnect?: () => void;
|
|
5747
|
-
/** Override the default label for a requirement type. */
|
|
5748
|
-
getLabel?: (requirement: Requirement) => string;
|
|
5749
|
-
/** Override the default description for a requirement type. */
|
|
5750
|
-
getDescription?: (requirement: Requirement) => string | null;
|
|
5751
|
-
/** Requirements pre-fetched on the server. */
|
|
5752
|
-
data?: RequirementsData;
|
|
5753
|
-
/** Options for the inline Sumsub verification flow. */
|
|
5754
|
-
identityVerificationOptions?: {
|
|
5755
|
-
levelName?: KycLevelName;
|
|
5756
|
-
locale?: string;
|
|
5757
|
-
};
|
|
5758
|
-
}
|
|
5759
|
-
interface UseRequirementsChecklistViewModelResult {
|
|
5760
|
-
state: RequirementsChecklistUiState;
|
|
5761
|
-
onEvent: (event: RequirementsChecklistUiEvent) => void;
|
|
5762
|
-
}
|
|
5763
|
-
/**
|
|
5764
|
-
* Drives {@link RequirementsChecklistView}: loads the requirements and their
|
|
5765
|
-
* statuses for one offer option, shapes each row, and owns the three flows the
|
|
5766
|
-
* checklist can open (tax document, wallet connect, identity verification).
|
|
5767
|
-
*/
|
|
5768
|
-
declare function useRequirementsChecklistViewModel(options: UseRequirementsChecklistViewModelOptions): UseRequirementsChecklistViewModelResult;
|
|
5769
|
-
|
|
5770
5781
|
/**
|
|
5771
5782
|
* A display-ready connect-wallet error: the core flow's machine-readable code
|
|
5772
5783
|
* and `retryable` flag, plus copy for the UI.
|
|
@@ -6028,6 +6039,61 @@ interface UseTaxDocumentModalViewModelResult {
|
|
|
6028
6039
|
*/
|
|
6029
6040
|
declare function useTaxDocumentModalViewModel({ isOpen, onClose, onSubmitted, }: UseTaxDocumentModalViewModelOptions): UseTaxDocumentModalViewModelResult;
|
|
6030
6041
|
|
|
6042
|
+
interface UseRequirementsChecklistViewModelOptions {
|
|
6043
|
+
offerId: OfferId;
|
|
6044
|
+
optionId: OfferOptionId;
|
|
6045
|
+
title: string;
|
|
6046
|
+
description: string;
|
|
6047
|
+
onContinue?: () => void;
|
|
6048
|
+
/**
|
|
6049
|
+
* Called when the user clicks a requirement's action button. Defaults to
|
|
6050
|
+
* `CoinListClient#requirements.handle`, except for `document` requirements,
|
|
6051
|
+
* which open the built-in tax document modal, and wallet requirements with a
|
|
6052
|
+
* host wallet, which open the built-in connect flow. Pass `null` to disable
|
|
6053
|
+
* the action button entirely.
|
|
6054
|
+
*/
|
|
6055
|
+
onRequirementActionOverride?: ((requirement: Requirement) => void) | null;
|
|
6056
|
+
/**
|
|
6057
|
+
* Called when the user clicks "Contact support" on a rejected requirement.
|
|
6058
|
+
* Defaults to `CoinListClient#support.contact`. Pass `null` to disable the
|
|
6059
|
+
* button entirely.
|
|
6060
|
+
*/
|
|
6061
|
+
onContactSupportOverride?: ((requirement: Requirement) => void) | null;
|
|
6062
|
+
/** Host-provided connected wallet, or `null` while none is connected. */
|
|
6063
|
+
wallet?: ConnectWallet | null;
|
|
6064
|
+
/** Called when the user asks to connect a wallet and none is connected yet. */
|
|
6065
|
+
onRequestConnect?: () => void;
|
|
6066
|
+
/** Override the default label for a requirement type. */
|
|
6067
|
+
getLabel?: (requirement: Requirement) => string;
|
|
6068
|
+
/** Override the default description for a requirement type. */
|
|
6069
|
+
getDescription?: (requirement: Requirement) => string | null;
|
|
6070
|
+
/** Requirements pre-fetched on the server. */
|
|
6071
|
+
data?: RequirementsData;
|
|
6072
|
+
/**
|
|
6073
|
+
* Default `true`. When `false` nothing is fetched, so the hook can be called
|
|
6074
|
+
* unconditionally while the checklist is not needed yet.
|
|
6075
|
+
*/
|
|
6076
|
+
enabled?: boolean;
|
|
6077
|
+
/** Options for the inline Sumsub verification flow. */
|
|
6078
|
+
identityVerificationOptions?: {
|
|
6079
|
+
levelName?: KycLevelName;
|
|
6080
|
+
locale?: string;
|
|
6081
|
+
};
|
|
6082
|
+
}
|
|
6083
|
+
interface UseRequirementsChecklistViewModelResult {
|
|
6084
|
+
state: RequirementsChecklistUiState;
|
|
6085
|
+
onEvent: (event: RequirementsChecklistUiEvent) => void;
|
|
6086
|
+
}
|
|
6087
|
+
/**
|
|
6088
|
+
* Drives {@link RequirementsChecklistView}: loads the requirements and their
|
|
6089
|
+
* statuses for one offer option, shapes each row, and owns the three flows the
|
|
6090
|
+
* checklist can open (tax document, wallet connect, identity verification).
|
|
6091
|
+
*
|
|
6092
|
+
* Pass `enabled: false` to skip fetches when the hook must be called but
|
|
6093
|
+
* the checklist is not needed yet.
|
|
6094
|
+
*/
|
|
6095
|
+
declare function useRequirementsChecklistViewModel(options: UseRequirementsChecklistViewModelOptions): UseRequirementsChecklistViewModelResult;
|
|
6096
|
+
|
|
6031
6097
|
interface UseConnectWalletModalViewModelOptions {
|
|
6032
6098
|
isOpen: boolean;
|
|
6033
6099
|
onClose: () => void;
|
|
@@ -6253,7 +6319,7 @@ declare function offerAssetIconUrl(offer: OfferDetail, tokenMetadata: TokenMetad
|
|
|
6253
6319
|
* Date presentation helpers.
|
|
6254
6320
|
*
|
|
6255
6321
|
* Every function takes an explicit `locale`, the way
|
|
6256
|
-
* `@/
|
|
6322
|
+
* `@/universal/core/shared/blockchain/formatters` does: the UI layer never reads the
|
|
6257
6323
|
* locale from React context, so it stays pure and testable. Callers get the
|
|
6258
6324
|
* locale from `useLocale()` in a viewmodel and pass it down.
|
|
6259
6325
|
*/
|