@coinflowlabs/angular 2.0.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.
package/README.md CHANGED
@@ -4,6 +4,11 @@ This library was generated with [Angular CLI](https://github.com/angular/angular
4
4
 
5
5
  # Changelog
6
6
 
7
+ ## 3.0.0
8
+
9
+ - **Breaking:** Remove Stellar support: `blockchain: 'stellar'` and the `StellarWallet`, `CoinflowStellarPurchaseProps` and `CoinflowStellarHistoryProps` types. Coinflow no longer processes Stellar payments.
10
+ - Deprecate the `type: 'returned'` EVM redeem. The API now rejects it; use `SafeMintRedeem`, `KnownTokenIdRedeem` or `NormalRedeem`.
11
+
7
12
  ## 2.0.0
8
13
 
9
14
  - **Breaking:** Removed the deprecated legacy card form components: `CoinflowCardNumberInput` (`lib-coinflow-card-number-input`), `CoinflowCardNumberOnlyInput` (`lib-coinflow-card-number-only-input`), `CoinflowCvvInputComponent` (`lib-coinflow-cvv-input`) and `CoinflowCvvOnlyInputComponent` (`lib-coinflow-cvv-only-input`). Use `CoinflowCardFormV2` instead.
@@ -115,6 +115,11 @@ var CardType;
115
115
  CardType["DISCOVER"] = "DISC";
116
116
  })(CardType || (CardType = {}));
117
117
  const RN_REDIRECT_MESSAGE_NAME = 'rnredirect'; // DO NOT CHANGE
118
+ var RedirectFlow;
119
+ (function (RedirectFlow) {
120
+ RedirectFlow["Venmo"] = "venmo";
121
+ RedirectFlow["Plaid"] = "plaid";
122
+ })(RedirectFlow || (RedirectFlow = {}));
118
123
 
119
124
  // This works in angular, but not react
120
125
  // let web3: typeof import('@solana/web3.js') | undefined;
@@ -589,7 +594,7 @@ class CoinflowUtils {
589
594
  return 'http://localhost:5000';
590
595
  return `https://api-${env}.coinflow.cash`;
591
596
  }
592
- static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, useNativeSubtotal, presentment, transaction, blockchain = 'solana', 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, }) {
597
+ static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, useNativeSubtotal, presentment, inlineCryptoCheckout, transaction, blockchain = 'solana', 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, }) {
593
598
  const prefix = routePrefix
594
599
  ? `/${routePrefix}/${blockchain}`
595
600
  : `/${blockchain}`;
@@ -624,6 +629,8 @@ class CoinflowUtils {
624
629
  url.searchParams.append('bridgeId', bridgeId);
625
630
  if (presentment)
626
631
  url.searchParams.append('presentment', presentment);
632
+ if (inlineCryptoCheckout !== undefined)
633
+ url.searchParams.append('inlineCryptoCheckout', String(inlineCryptoCheckout));
627
634
  if (webhookInfo) {
628
635
  url.searchParams.append('webhookInfo', LZString.compressToEncodedURIComponent(JSON.stringify(webhookInfo)));
629
636
  }
@@ -759,6 +766,11 @@ class CoinflowUtils {
759
766
  }
760
767
  return url.toString();
761
768
  }
769
+ static getPurchaseRoute({ merchantId, checkoutVersion, }) {
770
+ if (checkoutVersion === 'v3')
771
+ return { route: `/purchase/${merchantId}`, routePrefix: 'v3' };
772
+ return { route: `/purchase-v2/${merchantId}` };
773
+ }
762
774
  static getTransaction(props) {
763
775
  if (!props.blockchain)
764
776
  return undefined;
@@ -802,15 +814,6 @@ class CoinflowUtils {
802
814
  const { transaction } = props;
803
815
  return LZString.compressToEncodedURIComponent(JSON.stringify(transaction));
804
816
  },
805
- stellar: () => {
806
- if (!('transaction' in props))
807
- return undefined;
808
- const { transaction } = props;
809
- if (!transaction)
810
- return undefined;
811
- // Transaction is already base64 XDR string, pass through directly
812
- return transaction;
813
- },
814
817
  monad: () => {
815
818
  if (!('transaction' in props))
816
819
  return undefined;
@@ -840,8 +843,6 @@ class CoinflowUtils {
840
843
  return args.base;
841
844
  case 'arbitrum':
842
845
  return args.arbitrum;
843
- case 'stellar':
844
- return args.stellar;
845
846
  case 'monad':
846
847
  return args.monad;
847
848
  case 'tempo':
@@ -903,6 +904,15 @@ var IFrameMessageMethods;
903
904
  IFrameMessageMethods["Overlay"] = "overlay";
904
905
  IFrameMessageMethods["UpdateSubtotal"] = "updateSubtotal";
905
906
  })(IFrameMessageMethods || (IFrameMessageMethods = {}));
907
+ var HostMessageMethods;
908
+ (function (HostMessageMethods) {
909
+ HostMessageMethods["OverlayOffset"] = "overlayOffset";
910
+ })(HostMessageMethods || (HostMessageMethods = {}));
911
+ var OverlayState;
912
+ (function (OverlayState) {
913
+ OverlayState["Open"] = "open";
914
+ OverlayState["Close"] = "close";
915
+ })(OverlayState || (OverlayState = {}));
906
916
  function getWalletPubkey(input) {
907
917
  let wallet;
908
918
  if ('signer' in input &&
@@ -1070,13 +1080,6 @@ function getHandlers(props) {
1070
1080
  onInputError: props.onInputError,
1071
1081
  onInputValid: props.onInputValid,
1072
1082
  }),
1073
- stellar: () => getStellarWalletHandlers({
1074
- wallet: wallet,
1075
- onSuccess: props.onSuccess,
1076
- onAuthDeclined: props.onAuthDeclined,
1077
- onInputError: props.onInputError,
1078
- onInputValid: props.onInputValid,
1079
- }),
1080
1083
  monad: () => getEvmWalletHandlers({
1081
1084
  wallet: wallet,
1082
1085
  onSuccess: props.onSuccess,
@@ -1163,33 +1166,6 @@ function getEvmWalletHandlers({ wallet, onSuccess, onAuthDeclined, onInputError,
1163
1166
  onInputValid,
1164
1167
  };
1165
1168
  }
1166
- function getStellarWalletHandlers({ wallet, onSuccess, onAuthDeclined, onInputError, onInputValid, }) {
1167
- return {
1168
- handleSendTransaction: async (transaction) => {
1169
- // transaction is unsigned base64 XDR
1170
- // dapp needs to handle sending and confirming
1171
- throw new Error(`sendTransaction is not supported on stellar, error when sending: ${transaction}`);
1172
- },
1173
- handleSignMessage: async (message) => {
1174
- if (!wallet.signMessage) {
1175
- throw new Error('signMessage is not supported by this wallet');
1176
- }
1177
- // Returns base64-encoded signature
1178
- return await wallet.signMessage(message);
1179
- },
1180
- handleSignTransaction: async (transaction) => {
1181
- if (!wallet.signTransaction) {
1182
- throw new Error('signTransaction is not supported by this wallet');
1183
- }
1184
- // Returns signed base64 XDR
1185
- return await wallet.signTransaction(transaction);
1186
- },
1187
- onSuccess,
1188
- onAuthDeclined,
1189
- onInputError,
1190
- onInputValid,
1191
- };
1192
- }
1193
1169
  function getSessionKeyHandlers({ onSuccess, onAuthDeclined, onInputError, onInputValid, }) {
1194
1170
  return {
1195
1171
  handleSendTransaction: async () => {
@@ -2124,7 +2100,7 @@ class CoinflowPurchaseComponent {
2124
2100
  this.iframeProps = {
2125
2101
  ...this.purchaseProps,
2126
2102
  walletPubkey,
2127
- route: `/purchase-v2/${this.purchaseProps?.merchantId}`,
2103
+ ...CoinflowUtils.getPurchaseRoute(this.purchaseProps),
2128
2104
  transaction: CoinflowUtils.getTransaction(this.purchaseProps),
2129
2105
  handleHeightChangeId,
2130
2106
  };
@@ -2892,5 +2868,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
2892
2868
  * Generated bundle index. Do not edit.
2893
2869
  */
2894
2870
 
2895
- export { BANK_LINK_REVEAL_DELAY_MS, BANK_LINK_STATUS_PARAM, BankingCurrencies, CARD_ENTRY_BORDER_PX, CARD_ENTRY_DIVIDER_PX, CARD_ENTRY_MARGIN_PX, CARD_ENTRY_MIN_WIDTHS, CARD_ENTRY_ROW_HEIGHT, CARD_ENTRY_ROW_HEIGHT_PX, CARD_ENTRY_SLOT_GAP_PX, CARD_FIELD_ERROR_MESSAGES, COMPACT_SKELETON_HEIGHT_PX, CardFunding, CardType, ChargebackProtectionAccountType, CoinflowApplePayButtonComponent, CoinflowCardForm, CoinflowCardFormV2, CoinflowFraudProtectionHeader, CoinflowGooglePayButtonComponent, CoinflowIFrameComponent, CoinflowPurchaseComponent, CoinflowPurchaseHistoryComponent, CoinflowPurchaseProtectionComponent, CoinflowUtils, CoinflowWithdrawComponent, CoinflowWithdrawHistoryComponent, Currency, CurrencyToISO4217, DEVICE_ID_HEADER, EventBus, FORTER_TOKEN_HEADER, IFrameMessageMethods, INLINE_SKELETON_HEIGHT_PX, MerchantStyle, PaymentMethods, REFERRER_HEADER, RN_REDIRECT_MESSAGE_NAME, SESSION_ID_HEADER, SKELETON_BOX_STYLE, SKELETON_FADE_MS, SKELETON_LAYOUTS, SKELETON_PULSE_ANIMATION_NAME, SKELETON_ROOT_PADDING_PX, SettlementType, ThreeDsChallengePreference, WithdrawCategory, WithdrawCurrencies, WithdrawSpeed, awaitForterToken, bankLinkCallbackParams, buildCardEntryGridCss, buildCardEntryLayout, buildSkeletonCss, canReuseLinkToken, captureForterToken, getCardFieldInputEvents, getCardFieldValidationError, getCoinflowProtectionHeaders, getCoinflowPurchaseHeaders, getCurrencyDecimals, getCustomerName, getForterToken, getHandlers, getSkeletonColors, getSkeletonGridClass, getSkeletonGridTemplate, getWalletPubkey, guessSkeletonHeightPx, handleIFrameMessage, initCoinflowProtection, invertRate, isBankingCurrency, isTypedCurrencyCents, isWithdrawCurrency, isZeroAuthSavedPaymentMethods, isZeroAuthVerifyCard, nftCartItem, parseCachedLinkToken, paymentMethodLabels, recordFrontendError, resolveBankLinkCompletion, serializeCachedLinkToken, shouldStackSkeleton };
2871
+ export { BANK_LINK_REVEAL_DELAY_MS, BANK_LINK_STATUS_PARAM, BankingCurrencies, CARD_ENTRY_BORDER_PX, CARD_ENTRY_DIVIDER_PX, CARD_ENTRY_MARGIN_PX, CARD_ENTRY_MIN_WIDTHS, CARD_ENTRY_ROW_HEIGHT, CARD_ENTRY_ROW_HEIGHT_PX, CARD_ENTRY_SLOT_GAP_PX, CARD_FIELD_ERROR_MESSAGES, COMPACT_SKELETON_HEIGHT_PX, CardFunding, CardType, ChargebackProtectionAccountType, CoinflowApplePayButtonComponent, CoinflowCardForm, CoinflowCardFormV2, CoinflowFraudProtectionHeader, CoinflowGooglePayButtonComponent, CoinflowIFrameComponent, CoinflowPurchaseComponent, CoinflowPurchaseHistoryComponent, CoinflowPurchaseProtectionComponent, CoinflowUtils, CoinflowWithdrawComponent, CoinflowWithdrawHistoryComponent, Currency, CurrencyToISO4217, DEVICE_ID_HEADER, EventBus, FORTER_TOKEN_HEADER, HostMessageMethods, IFrameMessageMethods, INLINE_SKELETON_HEIGHT_PX, MerchantStyle, OverlayState, PaymentMethods, REFERRER_HEADER, RN_REDIRECT_MESSAGE_NAME, RedirectFlow, SESSION_ID_HEADER, SKELETON_BOX_STYLE, SKELETON_FADE_MS, SKELETON_LAYOUTS, SKELETON_PULSE_ANIMATION_NAME, SKELETON_ROOT_PADDING_PX, SettlementType, ThreeDsChallengePreference, WithdrawCategory, WithdrawCurrencies, WithdrawSpeed, awaitForterToken, bankLinkCallbackParams, buildCardEntryGridCss, buildCardEntryLayout, buildSkeletonCss, canReuseLinkToken, captureForterToken, getCardFieldInputEvents, getCardFieldValidationError, getCoinflowProtectionHeaders, getCoinflowPurchaseHeaders, getCurrencyDecimals, getCustomerName, getForterToken, getHandlers, getSkeletonColors, getSkeletonGridClass, getSkeletonGridTemplate, getWalletPubkey, guessSkeletonHeightPx, handleIFrameMessage, initCoinflowProtection, invertRate, isBankingCurrency, isTypedCurrencyCents, isWithdrawCurrency, isZeroAuthSavedPaymentMethods, isZeroAuthVerifyCard, nftCartItem, parseCachedLinkToken, paymentMethodLabels, recordFrontendError, resolveBankLinkCompletion, serializeCachedLinkToken, shouldStackSkeleton };
2896
2872
  //# sourceMappingURL=coinflowlabs-angular.mjs.map