export { CrossmintInternalEvent, IncomingInternalEvent, OutgoingInternalEvent } from './events/internal/index.js'; import { CrossmintEvents } from './events/public/events.js'; export { CheckoutOrderEvents, CheckoutPaymentErrorEvents, CheckoutPaymentEvents, CheckoutQuoteEvents, CheckoutRecipientEvents, CheckoutTransactionErrorEvents, CheckoutTransactionEvents } from './events/public/events.js'; export { CrossmintInternalEventMap } from './events/internal/payloads.js'; export { CrossmintInternalEvents, IncomingInternalEvents, OutgoingInternalEvents } from './events/internal/events.js'; export { EmbeddedCheckoutV3IncomingEventMap, embeddedCheckoutV3IncomingEvents } from './embed/v3/events/incoming.js'; export { EmbeddedCheckoutV3OutgoingEventMap, embeddedCheckoutV3OutgoingEvents } from './embed/v3/events/outgoing.js'; export { EmbeddedCheckoutV3IFrameEmitter } from './embed/v3/events/EmbeddedCheckoutV3IFrameEmitter.js'; export { PaymentMethodManagementIncomingEventMap, paymentMethodManagementIncomingEvents } from './payment-method-management/events/incoming.js'; export { PaymentMethodManagementOutgoingEventMap, paymentMethodManagementOutgoingEvents } from './payment-method-management/events/outgoing.js'; export { PaymentMethodManagementIFrameEmitter } from './payment-method-management/events/PaymentMethodManagementIFrameEmitter.js'; import { OrderIntentProvider, OrderIntent, OrderIntentMerchant } from './payment-method-management/OrderIntents.js'; export { OrderIntentAgenticTokenRail, OrderIntentCredentialFormat, OrderIntentEncryptedCardRail, OrderIntentRail, OrderIntentSptCredentialFormat, OrderIntentSptRail, OrderIntentStatus, OrderIntentVerificationConfig, OrderIntentWithVerification, OrderIntentWithoutVerification } from './payment-method-management/OrderIntents.js'; export { PaymentMethodAgenticEnrollment, PaymentMethodAgenticEnrollmentVerificationConfig, PaymentMethodAgenticEnrollmentWithVerificationConfig, PaymentMethodAgenticEnrollmentWithoutVerificationConfig } from './payment-method-management/PaymentMethodAgenticEnrollment.js'; import { VerificationAppearance } from './payment-method-management/VerificationAppearance.js'; export { VerificationAppearanceRules, VerificationAppearanceVariables } from './payment-method-management/VerificationAppearance.js'; import { identityVerificationIncomingEvents } from './identity-verification/events/incoming.js'; export { IdentityVerificationIncomingEventMap } from './identity-verification/events/incoming.js'; export { IdentityVerificationOutgoingEventMap, identityVerificationOutgoingEvents } from './identity-verification/events/outgoing.js'; export { IdentityVerificationIFrameEmitter } from './identity-verification/events/IdentityVerificationIFrameEmitter.js'; import { OFFRAMP_STATUSES, OFFRAMP_ERROR_REASONS } from './embedded-offramp/events/incoming.js'; export { EmbeddedOfframpIncomingEventMap, embeddedOfframpIncomingEvents } from './embedded-offramp/events/incoming.js'; export { EmbeddedOfframpOutgoingEventMap, embeddedOfframpOutgoingEvents } from './embedded-offramp/events/outgoing.js'; export { EmbeddedOfframpIFrameEmitter } from './embedded-offramp/events/EmbeddedOfframpIFrameEmitter.js'; import { cvcRecollectionIncomingEvents } from './cvc-recollection/events/incoming.js'; export { CvcRecollectionIncomingEventMap } from './cvc-recollection/events/incoming.js'; export { CvcRecollectionOutgoingEventMap, cvcRecollectionOutgoingEvents } from './cvc-recollection/events/outgoing.js'; export { CvcRecollectionIFrameEmitter } from './cvc-recollection/events/CvcRecollectionIFrameEmitter.js'; export { ProtectedInputIncomingEventMap, protectedInputIncomingEvents } from './protected-input/events/incoming.js'; export { ProtectedInputOutgoingEventMap, protectedInputOutgoingEvents } from './protected-input/events/outgoing.js'; export { ProtectedInputIFrameEmitter } from './protected-input/events/ProtectedInputIFrameEmitter.js'; import { CryptoCurrency } from './CryptoCurrency.js'; export { Erc20Currency, EvmNativeCurrency, SplTokenCurrency, StableCoin } from './CryptoCurrency.js'; import { BlockchainIncludingTestnet, PayerSupportedBlockchains, JSONObject } from '@crossmint/common-sdk-base'; import { EmptyObject } from './system.js'; export { CaseInsensitive, NestedPaths, TypeFromPath } from './system.js'; import { z } from 'zod'; import '@crossmint/client-sdk-window'; interface CrossmintEventMap { [CrossmintEvents.PAYMENT_PREPARATION_SUCCEEDED]: EmptyObject; [CrossmintEvents.QUOTE_STATUS_CHANGED]: InitialQuotePayload; [CrossmintEvents.QUOTE_STATUS_INVALIDATED]: EmptyObject; [CrossmintEvents.PAYMENT_PROCESS_STARTED]: InitialQuotePayload; [CrossmintEvents.PAYMENT_PREPARATION_FAILED]: CrossmintEventErrorPayload; [CrossmintEvents.PAYMENT_PROCESS_SUCCEEDED]: PaymentCompletedPayload; [CrossmintEvents.PAYMENT_PROCESS_CANCELED]: EmptyObject; [CrossmintEvents.PAYMENT_PROCESS_REJECTED]: PaymentRejectedPayload; [CrossmintEvents.ORDER_PROCESS_STARTED]: EmptyObject; [CrossmintEvents.TRANSACTION_FULFILLMENT_SUCCEEDED]: TransactionFulfillmentSucceededPayload; [CrossmintEvents.TRANSACTION_FULFILLMENT_FAILED]: TransactionFulfillmentFailedPayload; [CrossmintEvents.ORDER_PROCESS_FINISHED]: OrderProcessFinishedPayload; [CrossmintEvents.RECIPIENT_WALLET_CHANGED]: RecipientWalletChangedPayload; [CrossmintEvents.RECIPIENT_EMAIL_CHANGED]: RecipientEmailChangedPayload; } interface InitialQuotePayload { totalPrice: FiatPrice; lineItems: LineItem[]; } interface LineItem { price: FiatPrice; gasFee?: FiatPrice; metadata: LineItemMetadata; quantity: number; } interface LineItemMetadata { imageUrl?: string; description?: string; title?: string; collection?: string; } interface CrossmintEventErrorPayload { error: CrossmintEventError; } interface CrossmintEventError { message: string; code: string; } interface PaymentCompletedPayload { orderIdentifier: string; } interface PaymentRejectedPayload extends CrossmintEventErrorPayload { orderIdentifier: string; paymentMethodType: PaymentMethodType; } declare const PaymentMethodType: { readonly CREDIT_CARD: "credit-card"; readonly GOOGLE_PAY: "google-pay"; readonly APPLE_PAY: "apple-pay"; }; type PaymentMethodType = (typeof PaymentMethodType)[keyof typeof PaymentMethodType]; type TransactionFulfillmentSucceededPayload = { transactionIdentifier: string; price: FiatPrice; txId: string; } & (EVMTransaction | SolanaTransaction); interface EVMTransaction { contractAddress: string; tokenIds: string[]; } interface SolanaTransaction { mintHash: string; } interface TransactionFulfillmentFailedPayload { transactionIdentifier: string; price: FiatPrice; error: CrossmintEventError; } interface OrderProcessFinishedPayload { successfulTransactionIdentifiers: string[]; failedTransactionIdentifiers: string[]; verification: { required: false; } | { required: true; url: string; }; totalPrice: FiatPrice; paymentMethodType: PaymentMethodType; } interface RecipientWalletChangedPayload { wallet: string; } interface RecipientEmailChangedPayload { email: string; } type CrossmintEvent = { [K in CrossmintEvents]: { type: K; payload: CrossmintEventMap[K]; }; }[CrossmintEvents]; interface CrossmintEmbeddedCheckoutV3CommonProps { appearance?: EmbeddedCheckoutV3Appearance; payment: EmbeddedCheckoutV3Payment; jwt?: string; /** `"external"`: you mount `CrossmintIdentityVerification` from * `getIdentityVerificationCredentials(order)`, or the buyer cannot finish. */ identityVerificationHandling?: "external"; } interface CrossmintEmbeddedCheckoutV3ExistingOrderProps extends CrossmintEmbeddedCheckoutV3CommonProps { orderId: string; clientSecret?: string; lineItems?: never; recipient?: never; locale?: never; } interface CrossmintEmbeddedCheckoutV3NewOrderProps extends CrossmintEmbeddedCheckoutV3CommonProps { orderId?: never; lineItems: EmbeddedCheckoutV3LineItem | EmbeddedCheckoutV3LineItem[]; recipient?: EmbeddedCheckoutV3Recipient; locale?: Locale; metadata?: JSONObject; } type CrossmintEmbeddedCheckoutV3Props = CrossmintEmbeddedCheckoutV3ExistingOrderProps | CrossmintEmbeddedCheckoutV3NewOrderProps; /** @deprecated `identityVerificationHandling` is on the shared props now. Use `CrossmintEmbeddedCheckoutV3Props`. */ type CrossmintEmbeddedCheckoutV3WebProps = CrossmintEmbeddedCheckoutV3Props; type EmbeddedCheckoutV3Recipient = EmbeddedCheckoutV3EmailRecipient | EmbeddedCheckoutV3WalletAddressRecipient; type EmbeddedCheckoutV3PhysicalAddress = { name: string; line1: string; line2?: string; city: string; state: string; postalCode: string; country: "US"; }; type EmbeddedCheckoutV3EmailRecipient = { email: string; walletAddress?: never; physicalAddress?: EmbeddedCheckoutV3PhysicalAddress; }; type EmbeddedCheckoutV3WalletAddressRecipient = { walletAddress: string; email?: never; physicalAddress?: EmbeddedCheckoutV3PhysicalAddress; }; type EmbeddedCheckoutV3LineItem = { collectionLocator: string; callData?: Record; } | { tokenLocator: string; callData?: Record; executionParameters?: never; } | { tokenLocator: string; callData?: never; executionParameters?: Record; } | { productLocator: string; }; type EmbeddedCheckoutV3Appearance = { fonts?: Array<{ cssSrc: string; }>; variables?: EmbeddedCheckoutV3AppearanceVariables; rules?: EmbeddedCheckoutV3AppearanceRules; }; type EmbeddedCheckoutV3AppearanceVariables = { fontFamily?: string; /** * Multiplier unit for paddings and gaps, not a base spacing. Default `"3.33px"`; each * spacing is `calc(spacingUnit * k)` with k between 3.6 and 4.42. */ spacingUnit?: string; /** * Multiplier unit for font sizes, not a base font size. Default `"4px"`: labels render at * `fontSizeUnit * 3.75` (15px), inputs at `* 4` (16px), the primary button at `* 4.25` (17px). * Passing a body size such as `"14px"` (the `VerificationAppearance` convention) yields ~52px labels. */ fontSizeUnit?: string; borderRadius?: string; colors?: { borderPrimary?: string; backgroundPrimary?: string; textPrimary?: string; textSecondary?: string; danger?: string; warning?: string; accent?: string; }; }; type EmbeddedCheckoutV3AppearanceRules = { DestinationInput?: { display?: "hidden"; }; ReceiptEmailInput?: { display?: "hidden"; }; GlobalMessage?: { display?: "hidden" | "visible"; }; Label?: { font?: { family?: string; size?: string; weight?: string; }; colors?: { text?: string; }; }; Input?: { borderRadius?: string; font?: { family?: string; size?: string; weight?: string; }; colors?: { text?: string; background?: string; border?: string; boxShadow?: string; placeholder?: string; }; hover?: { colors?: { text?: string; background?: string; border?: string; boxShadow?: string; }; }; focus?: { colors?: { background?: string; border?: string; boxShadow?: string; }; }; }; Tab?: { borderRadius?: string; font?: { family?: string; size?: string; weight?: string; }; colors?: { text?: string; background?: string; border?: string; boxShadow?: string; }; hover?: { colors?: { text?: string; background?: string; border?: string; boxShadow?: string; }; }; selected?: { colors?: { text?: string; background?: string; border?: string; boxShadow?: string; }; }; }; PrimaryButton?: { borderRadius?: string; font?: { family?: string; size?: string; weight?: string; }; colors?: { text?: string; background?: string; }; hover?: { colors?: { text?: string; background?: string; }; }; disabled?: { colors?: { text?: string; background?: string; }; }; }; }; type EmbeddedCheckoutV3Payment = { receiptEmail?: string; fiat: EmbeddedCheckoutV3FiatPayment; crypto: EmbeddedCheckoutV3CryptoPayment; defaultMethod?: "fiat" | "crypto"; }; type EmbeddedCheckoutV3FiatPayment = { enabled: boolean; defaultCurrency?: Currency; allowedMethods?: { card?: boolean; applePay?: boolean; googlePay?: boolean; }; }; type EmbeddedCheckoutV3CryptoPayment = { enabled: boolean; defaultChain?: BlockchainIncludingTestnet; defaultCurrency?: CryptoCurrency; payer?: EmbeddedCheckoutPayer; }; type TransactionResponse = { success: true; txId: string; } | { success: false; errorMessage: string; }; type EmbeddedCheckoutPayer = { address: string; initialChain: PayerSupportedBlockchains; supportedChains?: PayerSupportedBlockchains[]; handleSignAndSendTransaction(serializedTransaction: string): Promise; handleChainSwitch(chain: PayerSupportedBlockchains): Promise; handleSignMessage?(message: string): Promise; }; interface CrossmintHostedCheckoutV3Props { recipient?: EmbeddedCheckoutV3Recipient; locale?: Locale; lineItems: EmbeddedCheckoutV3LineItem | EmbeddedCheckoutV3LineItem[]; payment: HostedCheckoutV3Payment; appearance?: CrossmintHostedCheckoutV3Appearance; metadata?: JSONObject; } interface CrossmintHostedCheckoutV3OrderProps { orderId: string; clientSecret: string; locale?: Locale; payment?: Omit & { fiat?: HostedCheckoutV3FiatPayment; crypto?: HostedCheckoutV3CryptoPayment; }; appearance?: CrossmintHostedCheckoutV3Appearance; } type CrossmintHostedCheckoutV3AllProps = CrossmintHostedCheckoutV3Props | CrossmintHostedCheckoutV3OrderProps; declare function isHostedCheckoutV3ExistingOrderProps(props: CrossmintHostedCheckoutV3AllProps): props is CrossmintHostedCheckoutV3OrderProps; type HostedCheckoutV3Payment = { receiptEmail?: string; fiat: HostedCheckoutV3FiatPayment; crypto: HostedCheckoutV3CryptoPayment; defaultMethod?: "fiat" | "crypto"; }; type HostedCheckoutV3FiatPayment = { enabled: boolean; defaultCurrency?: Currency; }; type HostedCheckoutV3CryptoPayment = { enabled: boolean; defaultChain?: BlockchainIncludingTestnet; defaultCurrency?: CryptoCurrency; }; interface CrossmintHostedCheckoutV3Appearance { theme?: { checkout?: CrossmintHostedCheckoutV3Theme; button?: CrossmintHostedCheckoutV3ButtonTheme; }; variables?: CrossmintHostedCheckoutV3AppearanceVariables; overlay?: CrossmintHostedCheckoutV3OverlayOptions; display?: "popup" | "new-tab" | "same-tab"; rules?: HostedCheckoutV3AppearanceRules; } type HostedCheckoutV3AppearanceRules = { DestinationInput?: { display?: "hidden"; }; ReceiptEmailInput?: { display?: "hidden"; }; }; type CrossmintHostedCheckoutV3Theme = "light" | "dark"; type CrossmintHostedCheckoutV3ButtonTheme = "light" | "dark" | "crossmint"; interface CrossmintHostedCheckoutV3AppearanceVariables { colors?: { accent?: string; }; } type CrossmintHostedCheckoutV3OverlayOptions = { enabled: boolean; }; /** * Which payment-method types the management UI offers in its "add new" section. * Bounded by the vault proxy's tokenizable types; LM0 ships rendering for a * single allowed type (the first supported entry). */ type PaymentMethodManagementAllowedType = "card" | "bank-account-us"; /** How the add-card form treats address line 2: shown and optional (default), shown and required, or not shown. */ type PaymentMethodBillingAddressLine2 = "optional" | "required" | "hidden"; /** Starting values of the add-card form. See `CrossmintPaymentMethodManagementProps.defaultValues`. */ type PaymentMethodManagementDefaultValues = { /** `null` at any level means no default, like a missing key. */ billingDetails?: { /** `null` or an empty string means no default for that field. */ address?: { /** * Uppercase ISO 3166-1 alpha-2 code, for example `"ES"`. Without it, the form starts * in the US. */ country?: string | null; line1?: string | null; line2?: string | null; city?: string | null; /** * ISO 3166-2 subdivision code of the starting country, without the country prefix: * `"FL"` (not `"US-FL"`), `"ON"`, `"MU"` (Murcia, Spain), `"AGU"` (Aguascalientes, * Mexico). The match is exact: the iframe ignores a name (`"Florida"`) or a lowercase * code (`"fl"`) and logs a console warning. Without `country`, use a US code. */ stateOrRegion?: string | null; postalCode?: string | null; } | null; } | null; }; interface CrossmintPaymentMethodManagementProps { /** * Pass a user JWT from your own auth provider or a custom JWT. * Crossmint Auth JWTs are not supported. */ jwt: string; appearance?: PaymentMethodManagementAppearance; /** The language of the form. Defaults to the browser or device language, else `en-US`. */ locale?: Locale; /** * Which sections the management UI renders. `["new"]` (default) shows only * the "add new" section: no saved-methods fetch, no auto-open/auto-select of * an existing method. Include `"existing"` to also show the saved-methods * section. */ allowedModes?: Array<"new" | "existing">; /** * Filter array of which method types the "add new" section offers * (default `["card"]`). LM0 renders the first supported entry; passing more * than one type does not yet render a type picker. */ allowedPaymentMethodTypes?: PaymentMethodManagementAllowedType[]; /** * Optional fields of the add-card form, in Stripe's `billingDetails` shape so new * fields need no new prop. `billingDetails.address: true` (default) collects a required * billing address: the card form validates it before saving — for built-in and * `ref.submit()` submissions alike — and it comes back on `card.billing.address` * of the emitted method. Applies to cards only; other method types ignore it. * Pass `address: false` to save cards without a billing address; issuers decline * more cards that have none. * * An object collects it too and configures the fields the payment-methods API * leaves optional: `{ line2: "optional" | "required" | "hidden" }`. * `true` equals `{ line2: "optional" }`. */ fields?: { billingDetails?: { address?: boolean | { line2?: PaymentMethodBillingAddressLine2; }; }; }; /** * Starting values of the add-card form, in the same `billingDetails` shape as `fields`. * The buyer can edit every value. `null` or an empty string means no default for that * field, so values from a database can pass as they are. The form ignores them when * `fields.billingDetails.address` is `false`. * * The iframe checks each value on its own: it ignores an invalid value and logs a console * warning, and keeps the other values. It drops a `line2` default when * `fields.billingDetails.address.line2` is `"hidden"`. * * The values travel in the iframe URL. A change after mount reloads the iframe, so pass * stable values (for example, memoize the object). */ defaultValues?: PaymentMethodManagementDefaultValues | null; onPaymentMethodSelected?: (paymentMethod: CrossmintPaymentMethod) => void | Promise; /** * Fires when `ref.submit()` can first select or save, like Stripe's `ready` event. Until then a * submit answers `unavailable`. It fires again after the iframe reloads, for example when `jwt` * or the form configuration changes. */ onReady?: () => void; /** * Fires after `onReady` and whenever the form state changes, like Stripe's `change` event. Use * `complete` to enable your submit button. When a prop change reloads the iframe, it fires with * `complete: false` until the new form reports its own state. */ onChange?: (event: PaymentMethodManagementChangeEvent) => void; } /** * The form state `onChange` reports. * - `mode`: `"existing"` while a saved method is selected, `"new"` while the add-new form shows. * - `complete`: a submit would select or save without a field error. * - `empty`: the user entered nothing in the add-new form. Prefilled `defaultValues` do not count. */ type PaymentMethodManagementChangeEvent = { mode: "new" | "existing"; empty: boolean; complete: boolean; }; /** * Why a submit did not select or save, for code that branches on the reason or shows its own text. * Each list is the single definition of its codes: the types below and the result validation both * come from it. `unknown` means the component sent no known code. */ declare const PAYMENT_METHOD_SUBMIT_INVALID_CODES: readonly ["incomplete_card", "invalid_billing_address", "incomplete_bank_account", "unknown"]; declare const PAYMENT_METHOD_SUBMIT_FAILED_CODES: readonly ["save_failed", "select_failed", "unknown"]; /** `timeout` comes from the SDK: the component did not answer in time. */ declare const PAYMENT_METHOD_SUBMIT_UNAVAILABLE_CODES: readonly ["not_ready", "timeout", "unknown"]; type PaymentMethodSubmitInvalidCode = (typeof PAYMENT_METHOD_SUBMIT_INVALID_CODES)[number]; type PaymentMethodSubmitFailedCode = (typeof PAYMENT_METHOD_SUBMIT_FAILED_CODES)[number]; type PaymentMethodSubmitUnavailableCode = (typeof PAYMENT_METHOD_SUBMIT_UNAVAILABLE_CODES)[number]; /** * What `ref.submit()` resolves to. It never rejects. * - `selected`: the user had a saved method selected; it is the one to use. * - `saved`: the method in the form was saved; `onPaymentMethodSelected` also fired. * - `invalid`: the form shows a field error the user has to fix. * - `failed`: the save failed with a message the user can read; they can try again. * - `unavailable`: the component is not ready (not loaded, still loading saved methods, or it * did not answer in time). After a timeout the save may still have completed: * `onPaymentMethodSelected` fires if it did, and submitting again returns the same method. * - `superseded`: the component changed or unmounted while submitting. Discard the result; * this does not cancel a save already started on the server. * * `invalid`, `failed` and `unavailable` carry a `code` (see the `PaymentMethodSubmit*Code` types) * and a `message` to show the user. The component shows only field errors itself. */ type PaymentMethodSubmitResult = { status: "selected"; paymentMethod: CrossmintPaymentMethod; } | { status: "saved"; paymentMethod: CrossmintPaymentMethod; } | { status: "invalid"; code: PaymentMethodSubmitInvalidCode; message: string; } | { status: "failed"; code: PaymentMethodSubmitFailedCode; message: string; } | { status: "unavailable"; code: PaymentMethodSubmitUnavailableCode; message: string; } | { status: "superseded"; message: string; }; interface CrossmintPaymentMethodManagementRef { /** * Submits what the component shows: the selected saved method, or the add-new form. A call * while one is in flight returns the same promise. Calling it again on an unchanged saved * form returns that method again; nothing is saved twice. A change of buyer, configuration, * or iframe connection supersedes any pending submit. */ submit(): Promise; } /** * A payment method surfaced to the integrator via `onPaymentMethodSelected`. * Discriminated on `type`; narrow before reading variant-specific fields. */ type CrossmintPaymentMethod = CrossmintCardPaymentMethod | CrossmintBankAccountUSPaymentMethod; type CrossmintCardPaymentMethod = { type: "card"; paymentMethodId: string; card: { source: { type: "basis-theory-token"; id: string; }; brand: string; last4: string; expiration: { month: string; year: string; }; /** * Billing details the card was saved with. `address` is present when the card was * saved with a billing address (the SDK default) or the account has one on file. A card * saved with `fields.billingDetails.address: false`, before this default, or outside * the SDK can lack it. */ billing?: CrossmintPaymentMethodBillingDetails; }; default?: boolean; display?: { imageUrl?: string; }; }; type CrossmintPaymentMethodBillingDetails = { name: string; address?: CrossmintPaymentMethodBillingAddress; phone?: string; }; type CrossmintPaymentMethodBillingAddress = { /** 2-letter ISO country code. */ country: string; line1: string; line2?: string; city: string; stateOrRegion?: string; /** May be empty for countries whose address format has no postal code. */ postalCode: string; }; /** * US bank account. Carries only a safe display summary; intentionally omits any * token id or raw account number (the vault tokenizes those server-side). */ type CrossmintBankAccountUSPaymentMethod = { type: "bank-account-us"; paymentMethodId: string; bankAccount: { accountSuffix: string; bankName: string; accountType: "checking" | "savings"; }; default?: boolean; display?: { imageUrl?: string; }; }; type PaymentMethodManagementAppearance = { fonts?: EmbeddedCheckoutV3Appearance["fonts"]; variables?: EmbeddedCheckoutV3Appearance["variables"]; rules?: EmbeddedCheckoutV3Appearance["rules"]; }; /** * Credentials for an identity verification session, read from an order's `payment.preparation.kyc`. * A merchant taking over the verification step gets them from `useCrossmintCheckout()`. * The order picks the shape, so pass them through as they come and do not read their fields. */ type IdentityVerificationCredentials = { provider: "persona"; inquiryId: string; sessionToken?: string; } | { verificationId: string; clientSecret: string; deviceSessionKey?: string; }; /** * Embedded checkout's appearance, so the same object themes both. The flow reads light or dark from * `variables.colors.backgroundPrimary`. */ type IdentityVerificationAppearance = EmbeddedCheckoutV3Appearance; /** Provider-agnostic outcome. `unknown` is an unrecognised provider state, never a success. */ type IdentityVerificationStatus = z.infer<(typeof identityVerificationIncomingEvents)["kyc:completed"]>["status"]; /** `retriable: false` means the flow is dead and the user cannot finish it. */ type IdentityVerificationError = z.infer<(typeof identityVerificationIncomingEvents)["kyc:error"]>; interface CrossmintIdentityVerificationProps { credentials: IdentityVerificationCredentials; appearance?: IdentityVerificationAppearance; locale?: Locale; onReady?: () => void; /** The flow ended with a result. Unmount here, not when the credentials go away: the order moves on first. */ onComplete?: (result: { status: IdentityVerificationStatus; }) => void; /** The user closed the flow: Done on a blocked screen, or closing document capture. Without it, Done does nothing. */ onCancel?: () => void; onError?: (error: IdentityVerificationError) => void; } /** * The step of the offramp flow, reported by `onStatusChange`. `orderId` can change during one withdrawal, so keep the latest. */ type OfframpStatus = (typeof OFFRAMP_STATUSES)[number]; /** * Why `onError` fired. When `retriable` is `false`, the session cannot continue: unmount the component. */ type OfframpErrorReason = (typeof OFFRAMP_ERROR_REASONS)[number]; /** * The `sessionId` and `clientSecret` that [Create Offramp Session](https://docs.crossmint.com/offramp/api-reference/create-offramp-session) returns. Create the session on your server. */ type EmbeddedOfframpCredentials = { sessionId: string; clientSecret: string; }; /** * Throw it from a custom payer when the user declines the transaction and nothing was broadcast. The component reports `wallet-rejected` and lets the user confirm again. */ declare class OfframpSignatureRejectedError extends Error { readonly rejected = true; } /** * Signs and sends the deposit. Pass `createCrossmintWalletSigner(wallet)` for a Crossmint wallet, or your own object for an external wallet. */ type EmbeddedOfframpPayer = { /** * Sign and broadcast the transaction for `payerAddress` on `chain`, then resolve with the transaction ID. * Throw `OfframpSignatureRejectedError` only when the user declined. */ signAndSendTransaction(tx: { serializedTransaction: string; chain: string; payerAddress: string; }): Promise; }; interface CrossmintEmbeddedOfframpProps { /** The `sessionId` and `clientSecret` from [Create Offramp Session](https://docs.crossmint.com/offramp/api-reference/create-offramp-session). */ credentials: EmbeddedOfframpCredentials; /** Signs and sends the deposit. Use `createCrossmintWalletSigner(wallet)` or your own `EmbeddedOfframpPayer`. */ payer: EmbeddedOfframpPayer; /** Fonts, colors and styles, the same object as embedded checkout's `appearance`. */ appearance?: EmbeddedCheckoutV3Appearance; /** The language of the screens. Defaults to the browser or device language, else `en-US`. */ locale?: Locale; /** Fill the container's height instead of sizing to the content. The container needs a definite height. */ fill?: boolean; /** The first screen is shown. Fires once per load. */ onReady?: () => void; /** The flow moved to another step. See `OfframpStatus`. */ onStatusChange?: (event: { status: OfframpStatus; orderId?: string; }) => void; /** The deposit is confirmed. Can fire again for a reopened withdrawal, so dedupe by `orderId`. */ onComplete?: (event: { orderId: string; txId: string; }) => void; /** The user closed the flow. Without it, the Continue, Close and Cancel buttons do nothing. */ onCancel?: () => void; /** Something went wrong. See `OfframpErrorReason`. `message` is for logs, not for display. */ onError?: (error: { reason: OfframpErrorReason; retriable: boolean; message: string; }) => void; } /** * Error reported by `CrossmintCvcRecollection` through `onError`. * * `retriable: true` means the hosted form stays mounted and the user can submit again * (wrong CVC, provider rejection, `verification-refused` when Crossmint could not confirm the * new CVC, transient failure). `retriable: false` means the flow is dead and the user cannot * finish it: the component renders nothing afterwards, so the parent has to show its own * message (and, for `invalid-configuration`, fix the props). */ type CvcRecollectionError = z.infer<(typeof cvcRecollectionIncomingEvents)["cvc:error"]>; /** * Props of `CrossmintCvcRecollection`. * * Render the component when an order intent's `encrypted-card` rail reports * `status: "pending_cvc_recollection"`, or when creating a credential for that rail is refused * with HTTP 409 `ORDER_INTENT_CVC_RECOLLECTION_REQUIRED`. A rail read as `active` can still * answer that 409 if the CVC expires before the mint; handle both. * * After `onComplete`, re-read the order intent: the rail goes back to `active`. */ interface CrossmintCvcRecollectionProps { /** The user's Crossmint auth token, the same one `CrossmintPaymentMethodManagement` takes. */ jwt: string; /** The saved card whose CVC has to be entered again. */ paymentMethodId: string; /** * Same appearance model as `CrossmintPaymentMethodManagement` and the embedded checkout, * not the one of the verification modal: `variables.fontSizeUnit` / `spacingUnit` are * multiplier units (defaults `"4px"` / `"3.33px"`), not base sizes. See * `EmbeddedCheckoutV3AppearanceVariables`. */ appearance?: PaymentMethodManagementAppearance; /** * Render no Confirm button inside the component (default `false`). Pair it with a * `ref` and call `ref.current.submit()` from your own button. */ hideSubmitButton?: boolean; /** Called once Crossmint has stored the new CVC. Receives no CVC and no token payload. */ onComplete?: () => void; onError?: (error: CvcRecollectionError) => void; } /** * What `ref.submit()` resolves to. It never rejects. * - `complete`: the new CVC was stored; `onComplete` also fired. * - `invalid`: the CVC is empty or incomplete; the component shows the field error. * - `failed`: the update failed with a message the user can read; they can try again. * - `refused`: the flow is dead, with the same `reason`/`message` `onError` reported; the * user cannot finish it. * - `unavailable`: the component is not ready (not loaded, still loading the form, or it * did not answer in time). After a timeout the update may still have completed: * `onComplete` fires if it did, and submitting again returns `complete`. * - `superseded`: the component changed or unmounted while submitting. Discard the result; * this does not cancel an update already started on the server. */ type CvcRecollectionSubmitResult = { status: "complete"; } | { status: "invalid"; message: string; } | { status: "failed"; message: string; } | { status: "refused"; reason: CvcRecollectionError["reason"]; message: string; } | { status: "unavailable"; message: string; } | { status: "superseded"; message: string; }; interface CrossmintCvcRecollectionRef { /** * Runs the same confirm the component's own button would. A call while one is in flight * returns the same promise. Calling it again after `complete` returns `complete` again; * nothing is updated twice. A change of card, configuration, or iframe connection * supersedes any pending submit. */ submit(): Promise; } type ProtectedInputAppearance = Omit; /** Public UC field descriptor. Browser bindings and values never enter this contract. */ type ProtectedInputField = { key: string; label: string; required: boolean; handling: "protected"; input: { kind: "text"; multiline?: false; placeholder?: string; display?: "masked"; autoComplete?: "on" | "off" | "name" | "given-name" | "family-name" | "email" | "username" | "tel" | "current-password" | "new-password" | "one-time-code" | "street-address" | "postal-code"; inputMode?: "none" | "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url"; } | { kind: "number" | "integer"; }; }; type ProtectedInputCollectionResult = { status: "collected"; input: { protectedInputId: string; }; } | { status: "invalid" | "unavailable"; code: string; message: string; } | { status: "superseded"; message: string; }; interface CrossmintProtectedInputRef { collect(): Promise; } interface CrossmintProtectedInputProps { /** Buyer's JWT from the application's external auth integration. */ jwt: string; field: ProtectedInputField; /** ISO 8601; server default is 24 hours, maximum is 7 days. */ expiresAt?: string; appearance?: ProtectedInputAppearance; disabled?: boolean; /** Controls the visual invalid state; the developer renders the error message. */ invalid?: boolean; } /** Card details safe to display. Deliberately omits `card.source`, which carries a vault token id. */ interface AgentCardPaymentMethodSummary { id: string; type: "card"; brand: string; last4: string; } /** The rail used to provide the card credential for the Agent Checkout. */ type AgentCardRail = { rail: "agentic-token"; provider: OrderIntentProvider; } | { rail: "encrypted-card"; provider?: never; }; interface AgentCardAuthorizationResult { /** Submit this as `response.orderIntentId` in the Agent Checkout's `payment` input response. */ orderIntentId: string; paymentMethod: AgentCardPaymentMethodSummary; rail: AgentCardRail; amount: OrderIntent["amount"]; expiresAt: string; } declare const AGENT_CARD_AUTHORIZATION_ERROR_CODES: readonly ["payment_method_selection_failed", "registration_failed", "order_intent_creation_failed", "verification_failed", "rail_unavailable", "expired"]; type AgentCardAuthorizationErrorCode = (typeof AGENT_CARD_AUTHORIZATION_ERROR_CODES)[number]; interface AgentCardAuthorizationError { code: AgentCardAuthorizationErrorCode; message: string; } interface AgentCardAuthorizationAppearance { /** Styles the card selection and the CVC recollection form, which share this appearance model. */ paymentMethodManagement?: PaymentMethodManagementAppearance; /** Styles the card-network verification modal. */ verification?: VerificationAppearance; } interface CrossmintAgentCardAuthorizationProps { /** The buyer's Crossmint auth token, the same one `CrossmintPaymentMethodManagement` takes. */ jwt: string; /** `value` is a decimal string with up to 4 places, greater than 0; `currency` is a 3-letter code. */ amount: { value: string; currency: string; }; merchant: OrderIntentMerchant; description: string; /** ISO 8601 datetime in the future. Defaults to 24 hours from mount. */ expiresAt?: string; /** Sections of the payment-method UI to render. Defaults to `["existing", "new"]`. */ allowedModes?: Array<"new" | "existing">; /** Shown to the buyer by the rail verification UI. */ displayName: string; appearance?: AgentCardAuthorizationAppearance; onAuthorized: (result: AgentCardAuthorizationResult) => void; onError: (error: AgentCardAuthorizationError) => void; } declare const BaseUrls: { readonly prod: "https://www.crossmint.com"; readonly staging: "https://staging.crossmint.com"; readonly dev: "http://localhost:3001"; }; type BaseUrls = (typeof BaseUrls)[keyof typeof BaseUrls]; declare const CryptoPaymentMethod: { readonly ETH: "ETH"; readonly SOL: "SOL"; }; type CryptoPaymentMethod = (typeof CryptoPaymentMethod)[keyof typeof CryptoPaymentMethod]; declare const PaymentMethod: { readonly ETH: "ETH"; readonly SOL: "SOL"; readonly FIAT: "fiat"; }; type PaymentMethod = (typeof PaymentMethod)[keyof typeof PaymentMethod]; declare const paymentMethodIsEth: (paymentMethod?: PaymentMethod) => paymentMethod is "ETH"; declare const paymentMethodIsSol: (paymentMethod?: PaymentMethod) => paymentMethod is "SOL"; type Locale = "en-US" | "es-ES" | "fr-FR" | "fr-CA" | "it-IT" | "ja-JP" | "ko-KR" | "pt-PT" | "zh-CN" | "zh-TW" | "de-DE" | "ru-RU" | "tr-TR" | "uk-UA" | "th-TH" | "vi-VN" | "Klingon"; type Currency = "usd" | "eur" | "gbp" | "aud" | "sgd" | "hkd" | "krw" | "inr" | "vnd" | "jpy" | "mxn" | "xcd"; interface FiatPrice { amount: string; currency: Currency; } type Recipient = { email?: string; wallet?: string; }; export { AGENT_CARD_AUTHORIZATION_ERROR_CODES, type AgentCardAuthorizationAppearance, type AgentCardAuthorizationError, type AgentCardAuthorizationErrorCode, type AgentCardAuthorizationResult, type AgentCardPaymentMethodSummary, type AgentCardRail, BaseUrls, type CrossmintAgentCardAuthorizationProps, type CrossmintBankAccountUSPaymentMethod, type CrossmintCardPaymentMethod, type CrossmintCvcRecollectionProps, type CrossmintCvcRecollectionRef, type CrossmintEmbeddedCheckoutV3ExistingOrderProps, type CrossmintEmbeddedCheckoutV3NewOrderProps, type CrossmintEmbeddedCheckoutV3Props, type CrossmintEmbeddedCheckoutV3WebProps, type CrossmintEmbeddedOfframpProps, type CrossmintEvent, type CrossmintEventError, type CrossmintEventErrorPayload, type CrossmintEventMap, CrossmintEvents, type CrossmintHostedCheckoutV3AllProps, type CrossmintHostedCheckoutV3Appearance, type CrossmintHostedCheckoutV3AppearanceVariables, type CrossmintHostedCheckoutV3ButtonTheme, type CrossmintHostedCheckoutV3OrderProps, type CrossmintHostedCheckoutV3OverlayOptions, type CrossmintHostedCheckoutV3Props, type CrossmintHostedCheckoutV3Theme, type CrossmintIdentityVerificationProps, type CrossmintPaymentMethod, type CrossmintPaymentMethodBillingAddress, type CrossmintPaymentMethodBillingDetails, type CrossmintPaymentMethodManagementProps, type CrossmintPaymentMethodManagementRef, type CrossmintProtectedInputProps, type CrossmintProtectedInputRef, CryptoCurrency, CryptoPaymentMethod, type Currency, type CvcRecollectionError, type CvcRecollectionSubmitResult, type EmbeddedCheckoutPayer, type EmbeddedCheckoutV3Appearance, type EmbeddedCheckoutV3AppearanceRules, type EmbeddedCheckoutV3AppearanceVariables, type EmbeddedCheckoutV3CryptoPayment, type EmbeddedCheckoutV3EmailRecipient, type EmbeddedCheckoutV3FiatPayment, type EmbeddedCheckoutV3LineItem, type EmbeddedCheckoutV3Payment, type EmbeddedCheckoutV3PhysicalAddress, type EmbeddedCheckoutV3Recipient, type EmbeddedCheckoutV3WalletAddressRecipient, type EmbeddedOfframpCredentials, type EmbeddedOfframpPayer, EmptyObject, type FiatPrice, type HostedCheckoutV3AppearanceRules, type HostedCheckoutV3CryptoPayment, type HostedCheckoutV3FiatPayment, type HostedCheckoutV3Payment, type IdentityVerificationAppearance, type IdentityVerificationCredentials, type IdentityVerificationError, type IdentityVerificationStatus, type InitialQuotePayload, type LineItem, type LineItemMetadata, type Locale, OFFRAMP_ERROR_REASONS, OFFRAMP_STATUSES, type OfframpErrorReason, OfframpSignatureRejectedError, type OfframpStatus, OrderIntent, OrderIntentMerchant, OrderIntentProvider, PAYMENT_METHOD_SUBMIT_FAILED_CODES, PAYMENT_METHOD_SUBMIT_INVALID_CODES, PAYMENT_METHOD_SUBMIT_UNAVAILABLE_CODES, PaymentMethod, type PaymentMethodBillingAddressLine2, type PaymentMethodManagementAllowedType, type PaymentMethodManagementAppearance, type PaymentMethodManagementChangeEvent, type PaymentMethodManagementDefaultValues, type PaymentMethodSubmitFailedCode, type PaymentMethodSubmitInvalidCode, type PaymentMethodSubmitResult, type PaymentMethodSubmitUnavailableCode, PaymentMethodType, type ProtectedInputAppearance, type ProtectedInputCollectionResult, type ProtectedInputField, type Recipient, type TransactionResponse, VerificationAppearance, cvcRecollectionIncomingEvents, identityVerificationIncomingEvents, isHostedCheckoutV3ExistingOrderProps, paymentMethodIsEth, paymentMethodIsSol };