@coinflowlabs/vue 2.0.1-0 → 3.0.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.
@@ -8,9 +8,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
8
8
  }>, {}, {}, {
9
9
  handleHeightChangeId(): string;
10
10
  iframeProps(): {
11
- walletPubkey: string | null | undefined;
12
- route: string;
13
11
  transaction: string | undefined;
12
+ route: string;
13
+ routePrefix?: string | undefined;
14
+ walletPubkey: string | null | undefined;
14
15
  wallet: import('..').SolanaWallet;
15
16
  partialSigners?: import('@solana/web3.js').Signer[];
16
17
  debugTx?: boolean;
@@ -24,8 +25,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
24
25
  };
25
26
  redemptionCheck?: boolean;
26
27
  subtotal?: import('..').Subtotal;
28
+ checkoutVersion?: "v2" | "v3";
27
29
  useNativeSubtotal?: boolean;
28
30
  presentment?: import('..').Currency;
31
+ inlineCryptoCheckout?: boolean;
29
32
  onSuccess?: import('..').OnSuccessMethod;
30
33
  sessionKey?: string;
31
34
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
@@ -60,15 +63,18 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
60
63
  theme?: import('..').MerchantTheme;
61
64
  supportEmail?: string;
62
65
  } | {
63
- walletPubkey: string | null | undefined;
64
- route: string;
65
66
  transaction: string | undefined;
67
+ route: string;
68
+ routePrefix?: string | undefined;
69
+ walletPubkey: string | null | undefined;
66
70
  sessionKey: string;
67
71
  wallet?: undefined;
68
72
  blockchain?: import('..').CoinflowBlockchain | undefined;
69
73
  subtotal?: import('..').Subtotal;
74
+ checkoutVersion?: "v2" | "v3";
70
75
  useNativeSubtotal?: boolean;
71
76
  presentment?: import('..').Currency;
77
+ inlineCryptoCheckout?: boolean;
72
78
  onSuccess?: import('..').OnSuccessMethod;
73
79
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
74
80
  onInputError?: import('..').OnInputErrorMethod;
@@ -102,14 +108,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
102
108
  theme?: import('..').MerchantTheme;
103
109
  supportEmail?: string;
104
110
  } | {
105
- walletPubkey: string | null | undefined;
106
- route: string;
107
111
  transaction: string | undefined;
112
+ route: string;
113
+ routePrefix?: string | undefined;
114
+ walletPubkey: string | null | undefined;
108
115
  blockchain: "polygon";
109
116
  wallet: import('..').EthWallet;
110
117
  subtotal?: import('..').Subtotal;
118
+ checkoutVersion?: "v2" | "v3";
111
119
  useNativeSubtotal?: boolean;
112
120
  presentment?: import('..').Currency;
121
+ inlineCryptoCheckout?: boolean;
113
122
  onSuccess?: import('..').OnSuccessMethod;
114
123
  sessionKey?: string;
115
124
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
@@ -144,14 +153,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
144
153
  theme?: import('..').MerchantTheme;
145
154
  supportEmail?: string;
146
155
  } | {
147
- walletPubkey: string | null | undefined;
148
- route: string;
149
156
  transaction: string | undefined;
157
+ route: string;
158
+ routePrefix?: string | undefined;
159
+ walletPubkey: string | null | undefined;
150
160
  blockchain: "eth";
151
161
  wallet: import('..').EthWallet;
152
162
  subtotal?: import('..').Subtotal;
163
+ checkoutVersion?: "v2" | "v3";
153
164
  useNativeSubtotal?: boolean;
154
165
  presentment?: import('..').Currency;
166
+ inlineCryptoCheckout?: boolean;
155
167
  onSuccess?: import('..').OnSuccessMethod;
156
168
  sessionKey?: string;
157
169
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
@@ -186,14 +198,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
186
198
  theme?: import('..').MerchantTheme;
187
199
  supportEmail?: string;
188
200
  } | {
189
- walletPubkey: string | null | undefined;
190
- route: string;
191
201
  transaction: string | undefined;
202
+ route: string;
203
+ routePrefix?: string | undefined;
204
+ walletPubkey: string | null | undefined;
192
205
  blockchain: "base";
193
206
  wallet: import('..').EthWallet;
194
207
  subtotal?: import('..').Subtotal;
208
+ checkoutVersion?: "v2" | "v3";
195
209
  useNativeSubtotal?: boolean;
196
210
  presentment?: import('..').Currency;
211
+ inlineCryptoCheckout?: boolean;
197
212
  onSuccess?: import('..').OnSuccessMethod;
198
213
  sessionKey?: string;
199
214
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
@@ -228,14 +243,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
228
243
  theme?: import('..').MerchantTheme;
229
244
  supportEmail?: string;
230
245
  } | {
231
- walletPubkey: string | null | undefined;
232
- route: string;
233
246
  transaction: string | undefined;
247
+ route: string;
248
+ routePrefix?: string | undefined;
249
+ walletPubkey: string | null | undefined;
234
250
  blockchain: "arbitrum";
235
251
  wallet: import('..').EthWallet;
236
252
  subtotal?: import('..').Subtotal;
253
+ checkoutVersion?: "v2" | "v3";
237
254
  useNativeSubtotal?: boolean;
238
255
  presentment?: import('..').Currency;
256
+ inlineCryptoCheckout?: boolean;
239
257
  onSuccess?: import('..').OnSuccessMethod;
240
258
  sessionKey?: string;
241
259
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
@@ -270,14 +288,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
270
288
  theme?: import('..').MerchantTheme;
271
289
  supportEmail?: string;
272
290
  } | {
273
- walletPubkey: string | null | undefined;
274
- route: string;
275
291
  transaction: string | undefined;
292
+ route: string;
293
+ routePrefix?: string | undefined;
294
+ walletPubkey: string | null | undefined;
276
295
  blockchain: "monad";
277
296
  wallet: import('..').EthWallet;
278
297
  subtotal?: import('..').Subtotal;
298
+ checkoutVersion?: "v2" | "v3";
279
299
  useNativeSubtotal?: boolean;
280
300
  presentment?: import('..').Currency;
301
+ inlineCryptoCheckout?: boolean;
281
302
  onSuccess?: import('..').OnSuccessMethod;
282
303
  sessionKey?: string;
283
304
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
@@ -312,14 +333,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
312
333
  theme?: import('..').MerchantTheme;
313
334
  supportEmail?: string;
314
335
  } | {
315
- walletPubkey: string | null | undefined;
316
- route: string;
317
336
  transaction: string | undefined;
337
+ route: string;
338
+ routePrefix?: string | undefined;
339
+ walletPubkey: string | null | undefined;
318
340
  blockchain: "tempo";
319
341
  wallet: import('..').EthWallet;
320
342
  subtotal?: import('..').Subtotal;
343
+ checkoutVersion?: "v2" | "v3";
321
344
  useNativeSubtotal?: boolean;
322
345
  presentment?: import('..').Currency;
346
+ inlineCryptoCheckout?: boolean;
323
347
  onSuccess?: import('..').OnSuccessMethod;
324
348
  sessionKey?: string;
325
349
  onAuthDeclined?: import('..').OnAuthDeclinedMethod;
@@ -366,7 +390,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
366
390
  handleSendTransaction: (transaction: string) => Promise<string>;
367
391
  handleSignMessage?: ((message: string) => Promise<string>) | undefined;
368
392
  handleSignTransaction?: ((transaction: string) => Promise<string>) | undefined;
369
- handleOverlay?: ((state: string) => void) | undefined;
393
+ handleOverlay?: ((state: import('..').OverlayState) => void) | undefined;
370
394
  };
371
395
  }, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
372
396
  args: {
@@ -259,7 +259,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
259
259
  handleSendTransaction: (transaction: string) => Promise<string>;
260
260
  handleSignMessage?: ((message: string) => Promise<string>) | undefined;
261
261
  handleSignTransaction?: ((transaction: string) => Promise<string>) | undefined;
262
- handleOverlay?: ((state: string) => void) | undefined;
262
+ handleOverlay?: ((state: import('..').OverlayState) => void) | undefined;
263
263
  };
264
264
  }, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
265
265
  args: {
@@ -32,9 +32,9 @@ export interface IFrameMessageHandlers {
32
32
  onAccountLinkError?: OnAccountLinkErrorMethod | undefined;
33
33
  /**
34
34
  * Called when the iframe opens/closes an in-page overlay (e.g. the PayPal
35
- * approval modal). `state` is 'open' or 'close'.
35
+ * approval modal).
36
36
  */
37
- handleOverlay?: (state: string) => void;
37
+ handleOverlay?: (state: OverlayState) => void;
38
38
  }
39
39
  export declare enum IFrameMessageMethods {
40
40
  SignMessage = "signMessage",
@@ -53,6 +53,13 @@ export declare enum IFrameMessageMethods {
53
53
  Overlay = "overlay",
54
54
  UpdateSubtotal = "updateSubtotal"
55
55
  }
56
+ export declare enum HostMessageMethods {
57
+ OverlayOffset = "overlayOffset"
58
+ }
59
+ export declare enum OverlayState {
60
+ Open = "open",
61
+ Close = "close"
62
+ }
56
63
  export declare function getWalletPubkey(input: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain'>): string | null | undefined;
57
64
  export declare function handleIFrameMessage(rawMessage: string, handlers: IFrameMessageHandlers, handleHeightChangeId: string | number): Promise<string> | void;
58
65
  export declare function getHandlers(props: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain' | 'onSuccess' | 'onAuthDeclined' | 'onInputError' | 'onInputValid'> & {
@@ -369,12 +369,16 @@ export interface CoinflowCommonPaymentIntentProps extends Omit<CoinflowTypes, 'b
369
369
  }
370
370
  export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
371
371
  subtotal?: Subtotal;
372
+ /** @hidden */
373
+ checkoutVersion?: 'v2' | 'v3';
372
374
  /**
373
375
  * When true, the Apple Pay button skips the totals (fee quote) fetch and
374
376
  * charges exactly the `subtotal` passed to the component.
375
377
  */
376
378
  useNativeSubtotal?: boolean;
377
379
  presentment?: Currency;
380
+ /** @hidden */
381
+ inlineCryptoCheckout?: boolean;
378
382
  onSuccess?: OnSuccessMethod;
379
383
  sessionKey?: string;
380
384
  onAuthDeclined?: OnAuthDeclinedMethod;
@@ -670,9 +674,7 @@ export interface SafeMintRedeem extends NormalRedeem {
670
674
  nftContract?: string;
671
675
  }
672
676
  /**
673
- * (EVM only) If your contract returns the NFT ID, then utilize this object.
674
- *
675
- * The contract mints the NFT to msg.sender (which is the Coinflow contract), the Coinflow contract picks up the returned NFT ID, and fwd's the NFT to the end user's wallet.
677
+ * @deprecated No longer supported: requests with `type: 'returned'` are rejected with a 400. Use {@link SafeMintRedeem}, {@link KnownTokenIdRedeem} or {@link NormalRedeem} instead.
676
678
  */
677
679
  export interface ReturnedTokenIdRedeem extends NormalRedeem {
678
680
  type: 'returned';
@@ -752,7 +754,7 @@ export interface CoinflowBankLinkProps extends Pick<CoinflowTypes, 'merchantId'
752
754
  */
753
755
  onAccountLinkError?: OnAccountLinkErrorMethod | undefined;
754
756
  }
755
- 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' | 'allowedCardFunding' | 'accountFundingTransaction' | 'partialUsdcChecked' | 'isZeroAuthorization' | 'zeroAuthorizationConfig' | 'depositAmounts'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'amount' | 'lockAmount' | 'lockDefaultToken' | 'origins' | 'allowedWithdrawSpeeds'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey'>, WithGeo {
757
+ export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' | 'handleHeightChange'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'chargebackProtectionAccountType' | 'webhookInfo' | 'subtotal' | 'useNativeSubtotal' | 'presentment' | 'inlineCryptoCheckout' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'allowedPaymentMethods' | 'allowedCardFunding' | 'accountFundingTransaction' | 'partialUsdcChecked' | 'isZeroAuthorization' | 'zeroAuthorizationConfig' | 'depositAmounts'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'amount' | 'lockAmount' | 'lockDefaultToken' | 'origins' | 'allowedWithdrawSpeeds'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey'>, WithGeo {
756
758
  walletPubkey: string | null | undefined;
757
759
  sessionKey?: string;
758
760
  route: string;
@@ -852,4 +854,8 @@ export interface RecipientAftInfo {
852
854
  documentReference?: string;
853
855
  }
854
856
  export declare const RN_REDIRECT_MESSAGE_NAME = "rnredirect";
857
+ export declare enum RedirectFlow {
858
+ Venmo = "venmo",
859
+ Plaid = "plaid"
860
+ }
855
861
  export {};
@@ -12,12 +12,13 @@ export declare class CoinflowUtils {
12
12
  env?: CoinflowEnvs;
13
13
  }): boolean;
14
14
  static getCoinflowApiUrl(env?: CoinflowEnvs): string;
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, allowedCardFunding, accountFundingTransaction, partialUsdcChecked, allowedWithdrawSpeeds, isZeroAuthorization, zeroAuthorizationConfig, userLocation, appReturnUrl, depositAmounts, ownerOverride, bridgeId, bankLinkOnly, baseUrl, }: CoinflowIFrameProps & {
15
+ static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, useNativeSubtotal, presentment, inlineCryptoCheckout, 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, allowedCardFunding, accountFundingTransaction, partialUsdcChecked, allowedWithdrawSpeeds, isZeroAuthorization, zeroAuthorizationConfig, userLocation, appReturnUrl, depositAmounts, ownerOverride, bridgeId, bankLinkOnly, baseUrl, }: CoinflowIFrameProps & {
16
16
  baseUrl?: string;
17
17
  } & WithGeo): string;
18
18
  static getCoinflowIntentsUrl({ baseUrl, route, color, theme, env, origins, deviceId, merchantCss, loaderBackground, handleHeightChangeId, }: CoinflowIntentsIFrameProps & {
19
19
  baseUrl?: string;
20
20
  }): string;
21
+ static getPurchaseRoute({ merchantId, checkoutVersion, }: Pick<CoinflowPurchaseProps, 'merchantId' | 'checkoutVersion'>): Pick<CoinflowIFrameProps, 'route' | 'routePrefix'>;
21
22
  static getTransaction(props: CoinflowPurchaseProps): string | undefined;
22
23
  static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
23
24
  solana: T;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coinflowlabs/vue",
3
3
  "private": false,
4
- "version": "2.0.1-0",
4
+ "version": "3.0.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",