@coinflowlabs/vue 1.18.1 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/coinflow-vue.js +9013 -8673
- package/dist/coinflow-vue.umd.cjs +18 -18
- package/dist/components/CoinflowPurchase.vue.d.ts +41 -9
- package/dist/components/CoinflowWithdraw.vue.d.ts +21 -0
- package/dist/components/mobile-wallet/MobileWalletButton.vue.d.ts +110 -2
- package/dist/lib/common/CoinflowLibMessageHandlers.d.ts +24 -3
- package/dist/lib/common/CoinflowTypes.d.ts +122 -7
- package/dist/lib/common/CoinflowUtils.d.ts +6 -1
- package/dist/lib/common/bankLinkCallback.d.ts +53 -0
- package/dist/lib/common/card-form/cardFieldValidationError.d.ts +50 -0
- package/dist/lib/common/index.d.ts +3 -0
- package/dist/lib/common/plaidLinkTokenCache.d.ts +34 -0
- package/dist/lib/common/types/Subtotal.d.ts +10 -0
- package/package.json +2 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BankLinkStatus } from './bankLinkCallback';
|
|
1
2
|
import { Connection, VersionedTransaction, PublicKey, Signer, Transaction } from '@solana/web3.js';
|
|
2
3
|
import { Currency, Subtotal } from './types/Subtotal';
|
|
3
4
|
import { GiftCardCartItem } from './types/giftCardCartItem';
|
|
@@ -8,6 +9,7 @@ import { TravelCartItem } from './types/travelCartItem';
|
|
|
8
9
|
import { FlightTicketCartItem } from './types/flightTicketCartItem';
|
|
9
10
|
import { FlightUpgradeCartItem } from './types/flightUpgradeCartItem';
|
|
10
11
|
import { LodgingCartItem } from './types/lodgingCartItem';
|
|
12
|
+
import { InputErrorWalletCallInfo, InputValidWalletCallInfo } from './card-form/cardFieldValidationError';
|
|
11
13
|
export declare enum WithdrawCategory {
|
|
12
14
|
USER = "user",
|
|
13
15
|
BUSINESS = "business",
|
|
@@ -25,7 +27,8 @@ export declare enum WithdrawSpeed {
|
|
|
25
27
|
PAYPAL = "paypal",
|
|
26
28
|
WIRE = "wire",
|
|
27
29
|
INTERAC = "interac",
|
|
28
|
-
SWIFT = "swift"
|
|
30
|
+
SWIFT = "swift",
|
|
31
|
+
CRYPTO = "crypto"
|
|
29
32
|
}
|
|
30
33
|
export declare enum SettlementType {
|
|
31
34
|
Credits = "Credits",
|
|
@@ -137,7 +140,7 @@ export interface SplitNameCustomerInfo extends BaseCustomerInfo {
|
|
|
137
140
|
export type CustomerInfo = SplitNameCustomerInfo | NameCustomerInfo;
|
|
138
141
|
/** Coinflow Types **/
|
|
139
142
|
export type CoinflowBlockchain = 'solana' | 'eth' | 'polygon' | 'base' | 'arbitrum' | 'stellar' | 'monad' | 'tempo' | 'user';
|
|
140
|
-
export type CoinflowEnvs = 'prod' | 'staging' | '
|
|
143
|
+
export type CoinflowEnvs = 'prod' | 'staging' | 'sandbox' | 'local';
|
|
141
144
|
export interface CoinflowTypes {
|
|
142
145
|
merchantId: string;
|
|
143
146
|
env?: CoinflowEnvs;
|
|
@@ -145,6 +148,8 @@ export interface CoinflowTypes {
|
|
|
145
148
|
blockchain?: CoinflowBlockchain | undefined;
|
|
146
149
|
handleHeightChange?: (height: string) => void;
|
|
147
150
|
theme?: MerchantTheme;
|
|
151
|
+
/** Your company email address that the customer can contact. */
|
|
152
|
+
supportEmail?: string;
|
|
148
153
|
}
|
|
149
154
|
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
150
155
|
export type MergeWithOptionalDiff<A, B> = Pick<A, Extract<keyof A, keyof B>> & Pick<B, Extract<keyof B, keyof A>> & Partial<Omit<A, keyof B>> & Partial<Omit<B, keyof A>>;
|
|
@@ -160,6 +165,45 @@ export type AuthDeclinedWalletCallInfo = {
|
|
|
160
165
|
total: string;
|
|
161
166
|
};
|
|
162
167
|
export type OnAuthDeclinedMethod = (args: AuthDeclinedWalletCallInfo) => void | Promise<void>;
|
|
168
|
+
export type OnInputErrorMethod = (args: InputErrorWalletCallInfo) => void | Promise<void>;
|
|
169
|
+
export type OnInputValidMethod = (args: InputValidWalletCallInfo) => void | Promise<void>;
|
|
170
|
+
/**
|
|
171
|
+
* Mirrors `LinkedAccountType` in `@coinflow/common`. Redeclared here because
|
|
172
|
+
* lib-common ships to merchants and cannot depend on the server package.
|
|
173
|
+
*/
|
|
174
|
+
export type AccountLinkedType = 'bank' | 'card' | 'iban' | 'pix' | 'eft' | 'venmo' | 'paypal' | 'wire' | 'interac';
|
|
175
|
+
export interface AccountLinkedInfo {
|
|
176
|
+
type: AccountLinkedType;
|
|
177
|
+
/**
|
|
178
|
+
* The linked bank account tokens, each usable as the `token` field on an ACH
|
|
179
|
+
* checkout request. Present only for bank links.
|
|
180
|
+
*/
|
|
181
|
+
tokens?: string[];
|
|
182
|
+
}
|
|
183
|
+
export type OnAccountLinkedMethod = (info: AccountLinkedInfo) => void;
|
|
184
|
+
/**
|
|
185
|
+
* Why a linking session ended without an account.
|
|
186
|
+
*
|
|
187
|
+
* Derived from the standalone link's `bankLinkStatus` so the two entry points
|
|
188
|
+
* cannot drift: a merchant who moves between them meets the same vocabulary.
|
|
189
|
+
*/
|
|
190
|
+
export type AccountNotLinkedReason = Exclude<BankLinkStatus, 'linked'>;
|
|
191
|
+
export interface AccountNotLinkedInfo {
|
|
192
|
+
type: AccountLinkedType;
|
|
193
|
+
/**
|
|
194
|
+
* `canceled` when the customer backed out, `failed` when the account could
|
|
195
|
+
* not be linked — for example because the account holder's name could not be
|
|
196
|
+
* verified.
|
|
197
|
+
*/
|
|
198
|
+
reason: AccountNotLinkedReason;
|
|
199
|
+
}
|
|
200
|
+
export type OnAccountNotLinkedMethod = (info: AccountNotLinkedInfo) => void;
|
|
201
|
+
export interface AccountLinkErrorInfo {
|
|
202
|
+
type: AccountLinkedType;
|
|
203
|
+
message: string;
|
|
204
|
+
status?: number;
|
|
205
|
+
}
|
|
206
|
+
export type OnAccountLinkErrorMethod = (info: AccountLinkErrorInfo) => void;
|
|
163
207
|
/** Wallets **/
|
|
164
208
|
export interface SolanaWallet {
|
|
165
209
|
publicKey: PublicKey | null;
|
|
@@ -282,6 +326,16 @@ export interface CoinflowCommonPaymentIntentProps extends Omit<CoinflowTypes, 'b
|
|
|
282
326
|
paymentIntentId: string;
|
|
283
327
|
onSuccess?: OnSuccessMethod;
|
|
284
328
|
onAuthDeclined?: OnAuthDeclinedMethod;
|
|
329
|
+
/**
|
|
330
|
+
* Called whenever a card field (card number, expiration, cvv) shows a
|
|
331
|
+
* validation error to the user, with the field name and the displayed message.
|
|
332
|
+
*/
|
|
333
|
+
onInputError?: OnInputErrorMethod;
|
|
334
|
+
/**
|
|
335
|
+
* Called when a card field that was showing a validation error stops showing
|
|
336
|
+
* it, with the field name.
|
|
337
|
+
*/
|
|
338
|
+
onInputValid?: OnInputValidMethod;
|
|
285
339
|
/**
|
|
286
340
|
* If true, pre-checks the partial USDC payment checkbox when USDC balance is available.
|
|
287
341
|
* If false or undefined, maintains default behavior (unchecked).
|
|
@@ -314,10 +368,25 @@ export interface CoinflowCommonPaymentIntentProps extends Omit<CoinflowTypes, 'b
|
|
|
314
368
|
}
|
|
315
369
|
export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
316
370
|
subtotal?: Subtotal;
|
|
371
|
+
/**
|
|
372
|
+
* When true, the Apple Pay button skips the totals (fee quote) fetch and
|
|
373
|
+
* charges exactly the `subtotal` passed to the component.
|
|
374
|
+
*/
|
|
375
|
+
useNativeSubtotal?: boolean;
|
|
317
376
|
presentment?: Currency;
|
|
318
377
|
onSuccess?: OnSuccessMethod;
|
|
319
378
|
sessionKey?: string;
|
|
320
379
|
onAuthDeclined?: OnAuthDeclinedMethod;
|
|
380
|
+
/**
|
|
381
|
+
* Called whenever a card field (card number, expiration, cvv) shows a
|
|
382
|
+
* validation error to the user, with the field name and the displayed message.
|
|
383
|
+
*/
|
|
384
|
+
onInputError?: OnInputErrorMethod;
|
|
385
|
+
/**
|
|
386
|
+
* Called when a card field that was showing a validation error stops showing
|
|
387
|
+
* it, with the field name.
|
|
388
|
+
*/
|
|
389
|
+
onInputValid?: OnInputValidMethod;
|
|
321
390
|
webhookInfo?: {
|
|
322
391
|
[key: string]: any;
|
|
323
392
|
};
|
|
@@ -353,10 +422,6 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
353
422
|
*/
|
|
354
423
|
deviceId?: string;
|
|
355
424
|
jwtToken?: string;
|
|
356
|
-
/**
|
|
357
|
-
* Your company email address that the customer can contact.
|
|
358
|
-
*/
|
|
359
|
-
supportEmail?: string;
|
|
360
425
|
/**
|
|
361
426
|
* If rendering the Coinflow component within multiple nested iframes, all ancestors in the chain must be provided as a comma-separated list.
|
|
362
427
|
*
|
|
@@ -456,6 +521,7 @@ export type CoinflowPurchaseProps = CoinflowSolanaPurchaseProps | CoinflowSessio
|
|
|
456
521
|
/** Withdraw **/
|
|
457
522
|
export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
458
523
|
onSuccess?: OnSuccessMethod;
|
|
524
|
+
onAccountLinkError?: OnAccountLinkErrorMethod;
|
|
459
525
|
tokens?: string[];
|
|
460
526
|
lockDefaultToken?: boolean;
|
|
461
527
|
amount?: number;
|
|
@@ -661,7 +727,36 @@ export interface DecentRedeem extends CommonEvmRedeem {
|
|
|
661
727
|
* 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
728
|
*/
|
|
663
729
|
export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | KnownTokenIdRedeem | NormalRedeem | TokenRedeem | DecentRedeem;
|
|
664
|
-
|
|
730
|
+
/**
|
|
731
|
+
* Props for the embeddable `CoinflowBankLink` component.
|
|
732
|
+
*
|
|
733
|
+
* **Web only.** React Native and other mobile integrations cannot embed this
|
|
734
|
+
* component; send the customer to the standalone bank link URL instead.
|
|
735
|
+
*/
|
|
736
|
+
export interface CoinflowBankLinkProps extends Pick<CoinflowTypes, 'merchantId' | 'env' | 'blockchain' | 'loaderBackground' | 'theme' | 'handleHeightChange'>, Pick<CoinflowCommonPurchaseProps, 'email' | 'customerInfo'> {
|
|
737
|
+
/** The customer must be authenticated to link a bank account. */
|
|
738
|
+
sessionKey: string;
|
|
739
|
+
merchantCss?: string;
|
|
740
|
+
/**
|
|
741
|
+
* Called once Plaid linking completes, with the tokens of the newly linked
|
|
742
|
+
* bank accounts.
|
|
743
|
+
*/
|
|
744
|
+
onAccountLinked?: OnAccountLinkedMethod | undefined;
|
|
745
|
+
/**
|
|
746
|
+
* Called when the session ends without linking an account — the customer
|
|
747
|
+
* cancelled, or the account could not be linked. The component stays
|
|
748
|
+
* mounted and does not navigate, so this is where you close or reset your
|
|
749
|
+
* own UI.
|
|
750
|
+
*/
|
|
751
|
+
onAccountNotLinked?: OnAccountNotLinkedMethod | undefined;
|
|
752
|
+
/**
|
|
753
|
+
* Called when a link attempt fails, with the error that caused it. The
|
|
754
|
+
* component stays on the failure screen, so this is where you surface the
|
|
755
|
+
* reason or log it for support.
|
|
756
|
+
*/
|
|
757
|
+
onAccountLinkError?: OnAccountLinkErrorMethod | undefined;
|
|
758
|
+
}
|
|
759
|
+
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' | 'handleHeightChange'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'chargebackProtectionAccountType' | 'webhookInfo' | 'subtotal' | 'useNativeSubtotal' | 'presentment' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'allowedPaymentMethods' | 'accountFundingTransaction' | 'partialUsdcChecked' | 'isZeroAuthorization' | 'zeroAuthorizationConfig' | 'depositAmounts'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'amount' | 'lockAmount' | 'lockDefaultToken' | 'origins' | 'allowedWithdrawSpeeds'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey' | 'redemptionCheck'>, WithGeo {
|
|
665
760
|
walletPubkey: string | null | undefined;
|
|
666
761
|
sessionKey?: string;
|
|
667
762
|
route: string;
|
|
@@ -676,6 +771,26 @@ export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' |
|
|
|
676
771
|
usePermit?: boolean;
|
|
677
772
|
ownerOverride?: string;
|
|
678
773
|
handleHeightChangeId: string | number;
|
|
774
|
+
/**
|
|
775
|
+
* Identifier linking a React Native Apple Pay WebView to its hidden bridge
|
|
776
|
+
* WebView for subtotal updates relayed through localStorage.
|
|
777
|
+
*/
|
|
778
|
+
bridgeId?: string;
|
|
779
|
+
/**
|
|
780
|
+
* Ends the bank-linking page on its own confirmation instead of continuing
|
|
781
|
+
* into Coinflow's checkout.
|
|
782
|
+
*
|
|
783
|
+
* Internal. `<CoinflowBankLink>` sets it, and so does `POST /checkout/link`'s
|
|
784
|
+
* bank-link sibling when no `callbackUrl` is given, so neither SDK nor API
|
|
785
|
+
* integrators ever pass it themselves. It exists because the page is shared
|
|
786
|
+
* with the in-checkout linking step, where continuing to checkout is right.
|
|
787
|
+
*
|
|
788
|
+
* A hand-built iframe URL that omits it drops the customer into a Coinflow
|
|
789
|
+
* purchase flow once they link, which is wrong inside a merchant's own
|
|
790
|
+
* checkout. Build the URL from the bank-link endpoint rather than by hand.
|
|
791
|
+
* The `accountLinked` message carries the tokens either way.
|
|
792
|
+
*/
|
|
793
|
+
bankLinkOnly?: boolean;
|
|
679
794
|
}
|
|
680
795
|
export interface CoinflowIntentsIFrameProps {
|
|
681
796
|
theme?: MerchantTheme;
|
|
@@ -6,8 +6,13 @@ export declare class CoinflowUtils {
|
|
|
6
6
|
getNSurePartnerId(merchantId: string): Promise<string | undefined>;
|
|
7
7
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
8
8
|
static getCoinflowAppBaseUrl(env?: CoinflowEnvs): string;
|
|
9
|
+
static isCoinflowMessageOrigin({ url, fallbackUrl, env, }: {
|
|
10
|
+
url: string | null | undefined;
|
|
11
|
+
fallbackUrl: string | null | undefined;
|
|
12
|
+
env?: CoinflowEnvs;
|
|
13
|
+
}): boolean;
|
|
9
14
|
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 & {
|
|
15
|
+
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, amount, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, allowedPaymentMethods, accountFundingTransaction, partialUsdcChecked, redemptionCheck, allowedWithdrawSpeeds, isZeroAuthorization, zeroAuthorizationConfig, userLocation, appReturnUrl, depositAmounts, ownerOverride, bridgeId, bankLinkOnly, baseUrl, }: CoinflowIFrameProps & {
|
|
11
16
|
baseUrl?: string;
|
|
12
17
|
} & WithGeo): string;
|
|
13
18
|
static getCoinflowIntentsUrl({ baseUrl, route, color, theme, env, origins, deviceId, merchantCss, loaderBackground, handleHeightChangeId, }: CoinflowIntentsIFrameProps & {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outcome of a standalone bank-link session, reported to the merchant's
|
|
3
|
+
* `callbackUrl` as the `bankLinkStatus` query parameter.
|
|
4
|
+
*
|
|
5
|
+
* The customer returns to the same `callbackUrl` whether they linked an
|
|
6
|
+
* account, backed out, or could not be verified, so arriving there is not by
|
|
7
|
+
* itself evidence of a link.
|
|
8
|
+
*/
|
|
9
|
+
export type BankLinkStatus = 'linked' | 'canceled' | 'failed';
|
|
10
|
+
export declare const BANK_LINK_STATUS_PARAM = "bankLinkStatus";
|
|
11
|
+
/**
|
|
12
|
+
* Query parameters a standalone bank-link session appends to the merchant's
|
|
13
|
+
* `callbackUrl`.
|
|
14
|
+
*
|
|
15
|
+
* The return leg carries no secret — only the outcome. The linked accounts and
|
|
16
|
+
* their tokens are read from Get Customer, which is authenticated, so a
|
|
17
|
+
* payment-instrument token never rides a merchant-supplied redirect. The same
|
|
18
|
+
* invariant lets the shared redirect validator allow native-app deep links
|
|
19
|
+
* without a whitelist, so nothing may be added here.
|
|
20
|
+
*/
|
|
21
|
+
export declare function bankLinkCallbackParams({ status, }: {
|
|
22
|
+
status: BankLinkStatus;
|
|
23
|
+
}): Record<string, string>;
|
|
24
|
+
/**
|
|
25
|
+
* What the hosted bank-linking page does once an account is linked.
|
|
26
|
+
*
|
|
27
|
+
* `emit` is the embedded SDK case: `<CoinflowBankLink>` lives inside the
|
|
28
|
+
* merchant's own checkout, so the page reports the tokens through the
|
|
29
|
+
* accountLinked message and stops. Navigating onward would drop the customer
|
|
30
|
+
* into Coinflow's checkout, which the merchant owns.
|
|
31
|
+
*/
|
|
32
|
+
export type BankLinkCompletion = 'emit' | 'redirect' | 'returnToApp' | 'returnToCheckout';
|
|
33
|
+
/**
|
|
34
|
+
* Picks the completion behaviour for a finished bank link.
|
|
35
|
+
*
|
|
36
|
+
* `bankLinkOnly` wins over everything: the page was opened purely to link an
|
|
37
|
+
* account, so there is nowhere to send the customer afterwards.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveBankLinkCompletion({ bankLinkOnly, hasCallbackRedirect, isReactNativeLink, }: {
|
|
40
|
+
bankLinkOnly: boolean;
|
|
41
|
+
hasCallbackRedirect: boolean;
|
|
42
|
+
isReactNativeLink: boolean;
|
|
43
|
+
}): BankLinkCompletion;
|
|
44
|
+
/**
|
|
45
|
+
* How long the embedded flow holds the page blank before revealing the linked
|
|
46
|
+
* state.
|
|
47
|
+
*
|
|
48
|
+
* A merchant who unmounts <CoinflowBankLink> on the accountLinked event should
|
|
49
|
+
* never flash Coinflow's confirmation at their user, and a merchant who leaves
|
|
50
|
+
* it mounted should not be left looking at nothing. Long enough to cover the
|
|
51
|
+
* message hop and unmount, short enough not to read as a hang.
|
|
52
|
+
*/
|
|
53
|
+
export declare const BANK_LINK_REVEAL_DELAY_MS = 500;
|
|
@@ -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,5 @@ 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';
|
|
23
|
+
export * from './bankLinkCallback';
|
|
@@ -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;
|
|
@@ -186,6 +186,16 @@ export interface Cents {
|
|
|
186
186
|
export interface CurrencyCents extends Cents {
|
|
187
187
|
currency: Currency;
|
|
188
188
|
}
|
|
189
|
+
export interface LamportsAmount {
|
|
190
|
+
/**
|
|
191
|
+
* Amount of lamports. Must be a whole, non-negative number; as a string it may
|
|
192
|
+
* contain digits only (no sign, decimal point, or exponent).
|
|
193
|
+
* @isInt lamports must be an integer
|
|
194
|
+
* @minimum 0 lamports must be non-negative
|
|
195
|
+
* @pattern ^\d+$ lamports must be a non-negative integer
|
|
196
|
+
*/
|
|
197
|
+
lamports: string | number;
|
|
198
|
+
}
|
|
189
199
|
export interface RemainingLimit extends CurrencyCents {
|
|
190
200
|
type: 'single transaction' | 'daily' | 'monthly';
|
|
191
201
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinflowlabs/vue",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.19.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -12,11 +12,9 @@
|
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
14
|
"import": "./dist/coinflow-vue.js",
|
|
15
|
-
"require": "./dist/coinflow-vue.umd.cjs"
|
|
16
|
-
"types": "./dist/index.d.ts"
|
|
15
|
+
"require": "./dist/coinflow-vue.umd.cjs"
|
|
17
16
|
}
|
|
18
17
|
},
|
|
19
|
-
"types": "./dist/index.d.ts",
|
|
20
18
|
"scripts": {
|
|
21
19
|
"clean": "rimraf dist src/lib",
|
|
22
20
|
"vue:dev": "vite",
|