@coinflowlabs/vue 1.18.1 → 1.19.0

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.
@@ -24,10 +24,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
24
24
  };
25
25
  redemptionCheck?: boolean;
26
26
  subtotal?: import('..').Subtotal;
27
+ useNativeSubtotal?: boolean;
27
28
  presentment?: import('..').Currency;
28
29
  onSuccess?: import('..').OnSuccessMethod;
29
30
  sessionKey?: string;
30
31
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
32
+ onInputError?: import('..').OnInputErrorMethod;
33
+ onInputValid?: import('..').OnInputValidMethod;
31
34
  webhookInfo?: {
32
35
  [key: string]: any;
33
36
  };
@@ -63,9 +66,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
63
66
  wallet?: undefined;
64
67
  blockchain?: import('..').CoinflowBlockchain | undefined;
65
68
  subtotal?: import('..').Subtotal;
69
+ useNativeSubtotal?: boolean;
66
70
  presentment?: import('..').Currency;
67
71
  onSuccess?: import('..').OnSuccessMethod;
68
72
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
73
+ onInputError?: import('..').OnInputErrorMethod;
74
+ onInputValid?: import('..').OnInputValidMethod;
69
75
  webhookInfo?: {
70
76
  [key: string]: any;
71
77
  };
@@ -100,10 +106,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
100
106
  blockchain: "polygon";
101
107
  wallet: import('..').EthWallet;
102
108
  subtotal?: import('..').Subtotal;
109
+ useNativeSubtotal?: boolean;
103
110
  presentment?: import('..').Currency;
104
111
  onSuccess?: import('..').OnSuccessMethod;
105
112
  sessionKey?: string;
106
113
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
114
+ onInputError?: import('..').OnInputErrorMethod;
115
+ onInputValid?: import('..').OnInputValidMethod;
107
116
  webhookInfo?: {
108
117
  [key: string]: any;
109
118
  };
@@ -138,10 +147,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
138
147
  blockchain: "eth";
139
148
  wallet: import('..').EthWallet;
140
149
  subtotal?: import('..').Subtotal;
150
+ useNativeSubtotal?: boolean;
141
151
  presentment?: import('..').Currency;
142
152
  onSuccess?: import('..').OnSuccessMethod;
143
153
  sessionKey?: string;
144
154
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
155
+ onInputError?: import('..').OnInputErrorMethod;
156
+ onInputValid?: import('..').OnInputValidMethod;
145
157
  webhookInfo?: {
146
158
  [key: string]: any;
147
159
  };
@@ -176,10 +188,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
176
188
  blockchain: "base";
177
189
  wallet: import('..').EthWallet;
178
190
  subtotal?: import('..').Subtotal;
191
+ useNativeSubtotal?: boolean;
179
192
  presentment?: import('..').Currency;
180
193
  onSuccess?: import('..').OnSuccessMethod;
181
194
  sessionKey?: string;
182
195
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
196
+ onInputError?: import('..').OnInputErrorMethod;
197
+ onInputValid?: import('..').OnInputValidMethod;
183
198
  webhookInfo?: {
184
199
  [key: string]: any;
185
200
  };
@@ -214,10 +229,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
214
229
  blockchain: "arbitrum";
215
230
  wallet: import('..').EthWallet;
216
231
  subtotal?: import('..').Subtotal;
232
+ useNativeSubtotal?: boolean;
217
233
  presentment?: import('..').Currency;
218
234
  onSuccess?: import('..').OnSuccessMethod;
219
235
  sessionKey?: string;
220
236
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
237
+ onInputError?: import('..').OnInputErrorMethod;
238
+ onInputValid?: import('..').OnInputValidMethod;
221
239
  webhookInfo?: {
222
240
  [key: string]: any;
223
241
  };
@@ -252,10 +270,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
252
270
  wallet: import('..').StellarWallet;
253
271
  blockchain: "stellar";
254
272
  subtotal?: import('..').Subtotal;
273
+ useNativeSubtotal?: boolean;
255
274
  presentment?: import('..').Currency;
256
275
  onSuccess?: import('..').OnSuccessMethod;
257
276
  sessionKey?: string;
258
277
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
278
+ onInputError?: import('..').OnInputErrorMethod;
279
+ onInputValid?: import('..').OnInputValidMethod;
259
280
  webhookInfo?: {
260
281
  [key: string]: any;
261
282
  };
@@ -290,10 +311,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
290
311
  blockchain: "monad";
291
312
  wallet: import('..').EthWallet;
292
313
  subtotal?: import('..').Subtotal;
314
+ useNativeSubtotal?: boolean;
293
315
  presentment?: import('..').Currency;
294
316
  onSuccess?: import('..').OnSuccessMethod;
295
317
  sessionKey?: string;
296
318
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
319
+ onInputError?: import('..').OnInputErrorMethod;
320
+ onInputValid?: import('..').OnInputValidMethod;
297
321
  webhookInfo?: {
298
322
  [key: string]: any;
299
323
  };
@@ -328,10 +352,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
328
352
  blockchain: "tempo";
329
353
  wallet: import('..').EthWallet;
330
354
  subtotal?: import('..').Subtotal;
355
+ useNativeSubtotal?: boolean;
331
356
  presentment?: import('..').Currency;
332
357
  onSuccess?: import('..').OnSuccessMethod;
333
358
  sessionKey?: string;
334
359
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
360
+ onInputError?: import('..').OnInputErrorMethod;
361
+ onInputValid?: import('..').OnInputValidMethod;
335
362
  webhookInfo?: {
336
363
  [key: string]: any;
337
364
  };
@@ -364,6 +391,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
364
391
  handleHeightChange: ((height: string) => void) | undefined;
365
392
  onSuccess: import('..').OnSuccessMethod | undefined;
366
393
  onAuthDeclined: import('..').OnAuthDeclinedMethod | undefined;
394
+ onInputError?: import('..').OnInputErrorMethod | undefined;
395
+ onInputValid?: import('..').OnInputValidMethod | undefined;
367
396
  handleSendTransaction: (transaction: string) => Promise<string>;
368
397
  handleSignMessage?: ((message: string) => Promise<string>) | undefined;
369
398
  handleSignTransaction?: ((transaction: string) => Promise<string>) | undefined;
@@ -268,6 +268,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
268
268
  handleHeightChange: ((height: string) => void) | undefined;
269
269
  onSuccess: import('..').OnSuccessMethod | undefined;
270
270
  onAuthDeclined: import('..').OnAuthDeclinedMethod | undefined;
271
+ onInputError?: import('..').OnInputErrorMethod | undefined;
272
+ onInputValid?: import('..').OnInputValidMethod | undefined;
271
273
  handleSendTransaction: (transaction: string) => Promise<string>;
272
274
  handleSignMessage?: ((message: string) => Promise<string>) | undefined;
273
275
  handleSignTransaction?: ((transaction: string) => Promise<string>) | undefined;
@@ -9,7 +9,61 @@ declare function __VLS_template(): {
9
9
  slots: {
10
10
  default?(_: {}): any;
11
11
  };
12
- refs: {};
12
+ refs: {
13
+ iframeRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
14
+ args: {
15
+ type: PropType<import('../..').CoinflowIFrameProps & import('../..').IFrameMessageHandlers>;
16
+ required: true;
17
+ };
18
+ }>> & Readonly<{
19
+ onOnMessage?: ((_data: {
20
+ data: string;
21
+ origin: string;
22
+ }) => any) | undefined;
23
+ }>, {}, {}, {
24
+ url(): string;
25
+ }, {
26
+ sendMessage(message: string): void;
27
+ handleIframeMessages({ data, origin }: {
28
+ data: unknown;
29
+ origin: string;
30
+ }): void;
31
+ listenForMessage(isResponseValid: (response: string) => boolean): Promise<string>;
32
+ sendAndReceiveMessage(message: string, isResponseValid: (response: string) => boolean): Promise<string>;
33
+ }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
34
+ onMessage(_data: {
35
+ data: string;
36
+ origin: string;
37
+ }): true;
38
+ }, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
39
+ P: {};
40
+ B: {};
41
+ D: {};
42
+ C: {};
43
+ M: {};
44
+ Defaults: {};
45
+ }, Readonly<import('vue').ExtractPropTypes<{
46
+ args: {
47
+ type: PropType<import('../..').CoinflowIFrameProps & import('../..').IFrameMessageHandlers>;
48
+ required: true;
49
+ };
50
+ }>> & Readonly<{
51
+ onOnMessage?: ((_data: {
52
+ data: string;
53
+ origin: string;
54
+ }) => any) | undefined;
55
+ }>, {}, {}, {
56
+ url(): string;
57
+ }, {
58
+ sendMessage(message: string): void;
59
+ handleIframeMessages({ data, origin }: {
60
+ data: unknown;
61
+ origin: string;
62
+ }): void;
63
+ listenForMessage(isResponseValid: (response: string) => boolean): Promise<string>;
64
+ sendAndReceiveMessage(message: string, isResponseValid: (response: string) => boolean): Promise<string>;
65
+ }, {}> | null;
66
+ };
13
67
  rootEl: HTMLDivElement;
14
68
  };
15
69
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
@@ -47,7 +101,61 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
47
101
  type: StringConstructor;
48
102
  required: false;
49
103
  };
50
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
104
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
105
+ iframeRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
106
+ args: {
107
+ type: PropType<import('../..').CoinflowIFrameProps & import('../..').IFrameMessageHandlers>;
108
+ required: true;
109
+ };
110
+ }>> & Readonly<{
111
+ onOnMessage?: ((_data: {
112
+ data: string;
113
+ origin: string;
114
+ }) => any) | undefined;
115
+ }>, {}, {}, {
116
+ url(): string;
117
+ }, {
118
+ sendMessage(message: string): void;
119
+ handleIframeMessages({ data, origin }: {
120
+ data: unknown;
121
+ origin: string;
122
+ }): void;
123
+ listenForMessage(isResponseValid: (response: string) => boolean): Promise<string>;
124
+ sendAndReceiveMessage(message: string, isResponseValid: (response: string) => boolean): Promise<string>;
125
+ }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
126
+ onMessage(_data: {
127
+ data: string;
128
+ origin: string;
129
+ }): true;
130
+ }, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
131
+ P: {};
132
+ B: {};
133
+ D: {};
134
+ C: {};
135
+ M: {};
136
+ Defaults: {};
137
+ }, Readonly<import('vue').ExtractPropTypes<{
138
+ args: {
139
+ type: PropType<import('../..').CoinflowIFrameProps & import('../..').IFrameMessageHandlers>;
140
+ required: true;
141
+ };
142
+ }>> & Readonly<{
143
+ onOnMessage?: ((_data: {
144
+ data: string;
145
+ origin: string;
146
+ }) => any) | undefined;
147
+ }>, {}, {}, {
148
+ url(): string;
149
+ }, {
150
+ sendMessage(message: string): void;
151
+ handleIframeMessages({ data, origin }: {
152
+ data: unknown;
153
+ origin: string;
154
+ }): void;
155
+ listenForMessage(isResponseValid: (response: string) => boolean): Promise<string>;
156
+ sendAndReceiveMessage(message: string, isResponseValid: (response: string) => boolean): Promise<string>;
157
+ }, {}> | null;
158
+ }, HTMLDivElement>;
51
159
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
52
160
  export default _default;
53
161
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,4 +1,4 @@
1
- import { CoinflowPurchaseProps, OnAuthDeclinedMethod, OnSuccessMethod } from './CoinflowTypes';
1
+ import { CoinflowPurchaseProps, OnAuthDeclinedMethod, OnInputErrorMethod, OnInputValidMethod, OnSuccessMethod } from './CoinflowTypes';
2
2
  export type WalletCall = {
3
3
  method: IFrameMessageMethods;
4
4
  data: string;
@@ -18,6 +18,8 @@ export interface IFrameMessageHandlers {
18
18
  handleHeightChange?: (height: string) => void;
19
19
  onSuccess: OnSuccessMethod | undefined;
20
20
  onAuthDeclined: OnAuthDeclinedMethod | undefined;
21
+ onInputError?: OnInputErrorMethod | undefined;
22
+ onInputValid?: OnInputValidMethod | undefined;
21
23
  /**
22
24
  * Called when the iframe opens/closes an in-page overlay (e.g. the PayPal
23
25
  * approval modal). `state` is 'open' or 'close'.
@@ -31,12 +33,15 @@ export declare enum IFrameMessageMethods {
31
33
  HeightChange = "heightChange",
32
34
  Success = "success",
33
35
  AuthDeclined = "authDeclined",
36
+ InputError = "inputError",
37
+ InputValid = "inputValid",
34
38
  Loaded = "loaded",
35
39
  AccountLinked = "accountLinked",
36
40
  Redirect = "redirect",
37
- Overlay = "overlay"
41
+ Overlay = "overlay",
42
+ UpdateSubtotal = "updateSubtotal"
38
43
  }
39
44
  export declare function getWalletPubkey(input: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain'>): string | null | undefined;
40
45
  export declare function handleIFrameMessage(rawMessage: string, handlers: IFrameMessageHandlers, handleHeightChangeId: string | number): Promise<string> | void;
41
- export declare function getHandlers(props: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain' | 'onSuccess' | 'onAuthDeclined'>): Omit<IFrameMessageHandlers, 'handleHeightChange'>;
46
+ export declare function getHandlers(props: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain' | 'onSuccess' | 'onAuthDeclined' | 'onInputError' | 'onInputValid'>): Omit<IFrameMessageHandlers, 'handleHeightChange'>;
42
47
  export {};
@@ -8,6 +8,7 @@ import { TravelCartItem } from './types/travelCartItem';
8
8
  import { FlightTicketCartItem } from './types/flightTicketCartItem';
9
9
  import { FlightUpgradeCartItem } from './types/flightUpgradeCartItem';
10
10
  import { LodgingCartItem } from './types/lodgingCartItem';
11
+ import { InputErrorWalletCallInfo, InputValidWalletCallInfo } from './card-form/cardFieldValidationError';
11
12
  export declare enum WithdrawCategory {
12
13
  USER = "user",
13
14
  BUSINESS = "business",
@@ -160,6 +161,8 @@ export type AuthDeclinedWalletCallInfo = {
160
161
  total: string;
161
162
  };
162
163
  export type OnAuthDeclinedMethod = (args: AuthDeclinedWalletCallInfo) => void | Promise<void>;
164
+ export type OnInputErrorMethod = (args: InputErrorWalletCallInfo) => void | Promise<void>;
165
+ export type OnInputValidMethod = (args: InputValidWalletCallInfo) => void | Promise<void>;
163
166
  /** Wallets **/
164
167
  export interface SolanaWallet {
165
168
  publicKey: PublicKey | null;
@@ -282,6 +285,16 @@ export interface CoinflowCommonPaymentIntentProps extends Omit<CoinflowTypes, 'b
282
285
  paymentIntentId: string;
283
286
  onSuccess?: OnSuccessMethod;
284
287
  onAuthDeclined?: OnAuthDeclinedMethod;
288
+ /**
289
+ * Called whenever a card field (card number, expiration, cvv) shows a
290
+ * validation error to the user, with the field name and the displayed message.
291
+ */
292
+ onInputError?: OnInputErrorMethod;
293
+ /**
294
+ * Called when a card field that was showing a validation error stops showing
295
+ * it, with the field name.
296
+ */
297
+ onInputValid?: OnInputValidMethod;
285
298
  /**
286
299
  * If true, pre-checks the partial USDC payment checkbox when USDC balance is available.
287
300
  * If false or undefined, maintains default behavior (unchecked).
@@ -314,10 +327,25 @@ export interface CoinflowCommonPaymentIntentProps extends Omit<CoinflowTypes, 'b
314
327
  }
315
328
  export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
316
329
  subtotal?: Subtotal;
330
+ /**
331
+ * When true, the Apple Pay button skips the totals (fee quote) fetch and
332
+ * charges exactly the `subtotal` passed to the component.
333
+ */
334
+ useNativeSubtotal?: boolean;
317
335
  presentment?: Currency;
318
336
  onSuccess?: OnSuccessMethod;
319
337
  sessionKey?: string;
320
338
  onAuthDeclined?: OnAuthDeclinedMethod;
339
+ /**
340
+ * Called whenever a card field (card number, expiration, cvv) shows a
341
+ * validation error to the user, with the field name and the displayed message.
342
+ */
343
+ onInputError?: OnInputErrorMethod;
344
+ /**
345
+ * Called when a card field that was showing a validation error stops showing
346
+ * it, with the field name.
347
+ */
348
+ onInputValid?: OnInputValidMethod;
321
349
  webhookInfo?: {
322
350
  [key: string]: any;
323
351
  };
@@ -661,7 +689,7 @@ export interface DecentRedeem extends CommonEvmRedeem {
661
689
  * Gas fees for the transaction will be automatically calculated and added to the total charged to the customer. Optionally the merchant can opt to pay for these gas fees.
662
690
  */
663
691
  export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | KnownTokenIdRedeem | NormalRedeem | TokenRedeem | DecentRedeem;
664
- export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' | 'handleHeightChange'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'chargebackProtectionAccountType' | 'webhookInfo' | 'subtotal' | 'presentment' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail' | 'allowedPaymentMethods' | 'accountFundingTransaction' | 'partialUsdcChecked' | 'isZeroAuthorization' | 'zeroAuthorizationConfig' | 'depositAmounts'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins' | 'allowedWithdrawSpeeds'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey' | 'redemptionCheck'>, WithGeo {
692
+ export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' | 'handleHeightChange'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'chargebackProtectionAccountType' | 'webhookInfo' | 'subtotal' | 'useNativeSubtotal' | 'presentment' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail' | 'allowedPaymentMethods' | 'accountFundingTransaction' | 'partialUsdcChecked' | 'isZeroAuthorization' | 'zeroAuthorizationConfig' | 'depositAmounts'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins' | 'allowedWithdrawSpeeds'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey' | 'redemptionCheck'>, WithGeo {
665
693
  walletPubkey: string | null | undefined;
666
694
  sessionKey?: string;
667
695
  route: string;
@@ -676,6 +704,11 @@ export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' |
676
704
  usePermit?: boolean;
677
705
  ownerOverride?: string;
678
706
  handleHeightChangeId: string | number;
707
+ /**
708
+ * Identifier linking a React Native Apple Pay WebView to its hidden bridge
709
+ * WebView for subtotal updates relayed through localStorage.
710
+ */
711
+ bridgeId?: string;
679
712
  }
680
713
  export interface CoinflowIntentsIFrameProps {
681
714
  theme?: MerchantTheme;
@@ -7,7 +7,7 @@ export declare class CoinflowUtils {
7
7
  static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
8
8
  static getCoinflowAppBaseUrl(env?: CoinflowEnvs): string;
9
9
  static getCoinflowApiUrl(env?: CoinflowEnvs): string;
10
- static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, presentment, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChangeId, bankAccountLinkRedirect, additionalWallets, chargebackProtectionData, chargebackProtectionAccountType, merchantCss, color, rent, lockDefaultToken, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, allowedPaymentMethods, accountFundingTransaction, partialUsdcChecked, redemptionCheck, allowedWithdrawSpeeds, isZeroAuthorization, zeroAuthorizationConfig, userLocation, appReturnUrl, depositAmounts, ownerOverride, baseUrl, }: CoinflowIFrameProps & {
10
+ static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, useNativeSubtotal, presentment, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChangeId, bankAccountLinkRedirect, additionalWallets, chargebackProtectionData, chargebackProtectionAccountType, merchantCss, color, rent, lockDefaultToken, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, allowedPaymentMethods, accountFundingTransaction, partialUsdcChecked, redemptionCheck, allowedWithdrawSpeeds, isZeroAuthorization, zeroAuthorizationConfig, userLocation, appReturnUrl, depositAmounts, ownerOverride, bridgeId, baseUrl, }: CoinflowIFrameProps & {
11
11
  baseUrl?: string;
12
12
  } & WithGeo): string;
13
13
  static getCoinflowIntentsUrl({ baseUrl, route, color, theme, env, origins, deviceId, merchantCss, loaderBackground, handleHeightChangeId, }: CoinflowIntentsIFrameProps & {
@@ -0,0 +1,50 @@
1
+ import { CardEntryInputName } from './cardEntryLayout';
2
+ export type InputErrorWalletCallInfo = {
3
+ field: CardEntryInputName;
4
+ message: string;
5
+ };
6
+ /** Emitted when a field that was showing an error stops showing it. */
7
+ export type InputValidWalletCallInfo = {
8
+ field: CardEntryInputName;
9
+ };
10
+ export declare const CARD_FIELD_ERROR_MESSAGES: {
11
+ readonly cardNumber: "Card number is invalid. Please double check information.";
12
+ readonly expiration: "Expiration is invalid. Please double check information.";
13
+ readonly cvv: "CVV is invalid. Please double check information.";
14
+ readonly cvvEmpty: "Please enter your CVV to proceed.";
15
+ };
16
+ export declare function getCardFieldValidationError({ cardError, expirationError, cvvError, cvvEmpty, isCvvOnly, }: {
17
+ cardError: boolean;
18
+ expirationError: boolean;
19
+ cvvError: boolean;
20
+ cvvEmpty: boolean;
21
+ isCvvOnly: boolean;
22
+ }): InputErrorWalletCallInfo | null;
23
+ /**
24
+ * An iframe message the card entry should emit for a change in validation
25
+ * state. `kind` rather than IFrameMessageMethods keeps this module free of a
26
+ * circular import (CoinflowLibMessageHandlers imports the payload types here).
27
+ */
28
+ export type CardFieldInputEvent = {
29
+ kind: 'error';
30
+ info: InputErrorWalletCallInfo;
31
+ } | {
32
+ kind: 'valid';
33
+ info: InputValidWalletCallInfo;
34
+ };
35
+ /**
36
+ * Derives which messages to emit for a transition between two validation
37
+ * states, so the parent hears about each change exactly once.
38
+ *
39
+ * Nothing is emitted while the state is unchanged (including the pristine
40
+ * state, where both sides are null), so a field that is never invalid stays
41
+ * silent and a visible error is not re-sent on every render.
42
+ *
43
+ * Only one error is displayed at a time (see getCardFieldValidationError's
44
+ * precedence), so when the displayed error moves to a different field the
45
+ * previous field has necessarily become valid and gets its own clear event.
46
+ */
47
+ export declare function getCardFieldInputEvents({ previous, current, }: {
48
+ previous: InputErrorWalletCallInfo | null;
49
+ current: InputErrorWalletCallInfo | null;
50
+ }): CardFieldInputEvent[];
@@ -6,6 +6,7 @@ export * from './card-form/TokenEx';
6
6
  export * from './card-form/tokenexHelpers';
7
7
  export * from './card-form/cardEntryLayout';
8
8
  export * from './card-form/cardFormSkeleton';
9
+ export * from './card-form/cardFieldValidationError';
9
10
  export * from './types/Subtotal';
10
11
  export * from './types/AnyObject';
11
12
  export * from './types/giftCardCartItem';
@@ -18,3 +19,4 @@ export * from './types/lodgingCartItem';
18
19
  export * from './CoinflowPurchaseProtectionHeaders';
19
20
  export * from './CoinflowProtectionInit';
20
21
  export { default as getForterToken, captureForterToken, awaitForterToken, } from './Forter';
22
+ export * from './plaidLinkTokenCache';
@@ -0,0 +1,34 @@
1
+ /**
2
+ * A Plaid link token is scoped to exactly one country at mint time, and the
3
+ * OAuth leg of Plaid Link requires the *same* token the session started with.
4
+ * So the token has to be cached, which makes it easy to hand a session a token
5
+ * minted for the wrong rail — a US-scoped token opens the US institution list
6
+ * no matter which country the caller asked for.
7
+ *
8
+ * Caching the country alongside the token lets a reader refuse a token that was
9
+ * not minted for the rail it needs.
10
+ */
11
+ export interface CachedLinkToken {
12
+ token: string;
13
+ /** Absent for flows that do not choose a rail, and for legacy cache entries. */
14
+ country?: string;
15
+ }
16
+ export declare function serializeCachedLinkToken(cached: CachedLinkToken): string;
17
+ /**
18
+ * Reads a cache entry, tolerating the bare-token strings written before the
19
+ * country was recorded. Those have unknown provenance, so they come back with
20
+ * no country and `canReuseLinkToken` will refuse them for a specific rail.
21
+ */
22
+ export declare function parseCachedLinkToken(raw: string | null | undefined): CachedLinkToken | null;
23
+ /**
24
+ * True when a cached token may be handed to a session for `country`.
25
+ *
26
+ * A caller that names a country needs a token minted for that same country;
27
+ * anything else (a different rail, or an entry whose rail we never recorded)
28
+ * has to be re-minted. A caller that names no country takes what is cached,
29
+ * which is what the OAuth leg does when resuming a session already in flight.
30
+ */
31
+ export declare function canReuseLinkToken({ cached, country, }: {
32
+ cached: CachedLinkToken | null;
33
+ country?: string;
34
+ }): boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coinflowlabs/vue",
3
3
  "private": false,
4
- "version": "1.18.1",
4
+ "version": "1.19.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",