@coinflowlabs/angular 1.9.0 → 1.11.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinflowlabs/angular",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.17",
6
6
  "@angular/core": "^19.2.17",
@@ -2,8 +2,8 @@ import { PublicKey, Transaction, VersionedTransaction, Signer, Connection } from
2
2
  import { Properties } from 'csstype';
3
3
  import * as i0 from '@angular/core';
4
4
  import { EventEmitter, ElementRef, OnDestroy, SimpleChanges, OnInit } from '@angular/core';
5
- import * as _coinflowlabs_angular from '@coinflowlabs/angular';
6
5
  import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';
6
+ import * as _coinflowlabs_angular from '@coinflowlabs/angular';
7
7
 
8
8
  declare enum Currency {
9
9
  USD = "USD",
@@ -694,7 +694,7 @@ declare enum SettlementType {
694
694
  }
695
695
  /**
696
696
  * Configuration for a single custom pay-in fee line item.
697
- * Use with customPayInFees prop on purchase flows.
697
+ * Pass via the `customPayInFees` field on `/checkout/link` or `/checkout/jwt-token`.
698
698
  */
699
699
  interface PurchaseCustomPayInFee {
700
700
  lineItemLabel: string;
@@ -744,6 +744,7 @@ declare enum MerchantStyle {
744
744
  type MerchantTheme = {
745
745
  primary?: string;
746
746
  background?: string;
747
+ cardBackground?: string;
747
748
  backgroundAccent?: string;
748
749
  backgroundAccent2?: string;
749
750
  textColor?: string;
@@ -757,6 +758,7 @@ type MerchantTheme = {
757
758
  cardNumberPlaceholder?: string;
758
759
  cvvPlaceholder?: string;
759
760
  expirationPlaceholder?: string;
761
+ placeholderColor?: string;
760
762
  showCardIcon?: boolean;
761
763
  };
762
764
  interface BaseCustomerInfo {
@@ -929,16 +931,48 @@ declare enum PaymentMethods {
929
931
  credits = "credits",
930
932
  crypto = "crypto",
931
933
  wire = "wire",
932
- cashApp = "cashApp"
934
+ cashApp = "cashApp",
935
+ rain = "rain"
933
936
  }
934
937
  declare const paymentMethodLabels: Record<PaymentMethods, string>;
935
- interface CoinflowCommonPurchaseProps extends CoinflowTypes {
936
- subtotal?: Subtotal;
938
+ interface CoinflowCommonPaymentIntentProps extends Omit<CoinflowTypes, 'blockchain'> {
939
+ paymentIntentId: string;
940
+ onSuccess?: OnSuccessMethod;
941
+ onAuthDeclined?: OnAuthDeclinedMethod;
937
942
  /**
938
- * Custom pay-in fees to add to checkout. Each fee appears as a separate line item.
939
- * These fees are added to the subtotal and displayed to the customer.
943
+ * If true, pre-checks the partial USDC payment checkbox when USDC balance is available.
944
+ * If false or undefined, maintains default behavior (unchecked).
940
945
  */
941
- customPayInFees?: PurchaseCustomPayInFee[];
946
+ partialUsdcChecked?: boolean;
947
+ /**
948
+ * The DeviceID gotten from the Coinflow SDK:
949
+ * https://docs.coinflow.cash/guides/checkout/fraud-protection/chargeback-protection/implement-chargeback-protection#how-to-add-chargeback-protection
950
+ *
951
+ * nSureSDK.getDeviceId()
952
+ */
953
+ deviceId?: string;
954
+ /**
955
+ * If rendering the Coinflow component within multiple nested iframes, all ancestors in the chain must be provided as a comma-separated list.
956
+ *
957
+ * Example:
958
+ * Primary origin that will be interacting with the Coinflow iFrame: foo.com
959
+ * Subsequent origins that will render foo.com: bar.com
960
+ * The origin array would then be: [https://foo.com,https://bar.com]
961
+ */
962
+ origins?: string[];
963
+ /**
964
+ * End-user wallet used for wallet-authenticated payment-intent checkout flows.
965
+ *
966
+ * Required when the target payment intent type depends on a customer wallet
967
+ * (for example: EVM/Solana/Stellar transaction intents or credits/USDC signing flows).
968
+ *
969
+ * The wallet implementation must match the active blockchain.
970
+ */
971
+ wallet?: WalletTypes;
972
+ blockchain?: 'solana' | 'eth' | 'polygon' | 'base' | 'arbitrum' | 'stellar' | 'monad';
973
+ }
974
+ interface CoinflowCommonPurchaseProps extends CoinflowTypes {
975
+ subtotal?: Subtotal;
942
976
  presentment?: Currency;
943
977
  onSuccess?: OnSuccessMethod;
944
978
  sessionKey?: string;
@@ -1266,7 +1300,7 @@ interface DecentRedeem extends CommonEvmRedeem {
1266
1300
  * 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.
1267
1301
  */
1268
1302
  type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | KnownTokenIdRedeem | NormalRedeem | TokenRedeem | DecentRedeem;
1269
- interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' | 'handleHeightChange'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'chargebackProtectionAccountType' | 'webhookInfo' | 'subtotal' | 'customPayInFees' | 'presentment' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail' | 'allowedPaymentMethods' | 'accountFundingTransaction' | 'partialUsdcChecked' | 'isZeroAuthorization' | 'zeroAuthorizationConfig'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins' | 'allowedWithdrawSpeeds'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey' | 'redemptionCheck'>, WithGeo {
1303
+ 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'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins' | 'allowedWithdrawSpeeds'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey' | 'redemptionCheck'>, WithGeo {
1270
1304
  walletPubkey: string | null | undefined;
1271
1305
  sessionKey?: string;
1272
1306
  route: string;
@@ -1281,6 +1315,22 @@ interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' | 'handle
1281
1315
  usePermit?: boolean;
1282
1316
  handleHeightChangeId: string | number;
1283
1317
  }
1318
+ interface CoinflowIntentsIFrameProps {
1319
+ theme?: MerchantTheme;
1320
+ merchantCss?: string;
1321
+ color?: 'white' | 'black';
1322
+ intentId: string;
1323
+ route: string;
1324
+ routePrefix?: string;
1325
+ handleHeightChangeId: string | number;
1326
+ env?: CoinflowEnvs;
1327
+ loaderBackground?: string;
1328
+ handleHeightChange?: (height: string) => void;
1329
+ origins?: string[];
1330
+ deviceId?: string;
1331
+ walletPubkey?: string | undefined | null;
1332
+ blockchain?: 'solana' | 'eth' | 'polygon' | 'base' | 'arbitrum' | 'stellar' | 'monad';
1333
+ }
1284
1334
  declare enum CardType {
1285
1335
  VISA = "VISA",
1286
1336
  MASTERCARD = "MSTR",
@@ -1338,9 +1388,12 @@ declare class CoinflowUtils {
1338
1388
  static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
1339
1389
  static getCoinflowAppBaseUrl(env?: CoinflowEnvs): string;
1340
1390
  static getCoinflowApiUrl(env?: CoinflowEnvs): string;
1341
- static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, customPayInFees, 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, baseUrl, }: CoinflowIFrameProps & {
1391
+ 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, baseUrl, }: CoinflowIFrameProps & {
1342
1392
  baseUrl?: string;
1343
1393
  } & WithGeo): string;
1394
+ static getCoinflowIntentsUrl({ baseUrl, route, color, theme, env, origins, deviceId, merchantCss, loaderBackground, handleHeightChangeId, }: CoinflowIntentsIFrameProps & {
1395
+ baseUrl?: string;
1396
+ }): string;
1344
1397
  static getTransaction(props: CoinflowPurchaseProps): string | undefined;
1345
1398
  static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
1346
1399
  solana: T;
@@ -1649,14 +1702,16 @@ interface CardFormTokenResponse {
1649
1702
  expMonth?: string;
1650
1703
  expYear?: string;
1651
1704
  }
1652
- declare class CoinflowCardForm implements OnInit, OnDestroy {
1705
+ declare class CoinflowCardForm implements OnInit {
1706
+ private sanitizer;
1653
1707
  args: CardFormArgs;
1654
1708
  iframeRef: ElementRef<HTMLIFrameElement>;
1655
- url: string;
1709
+ url?: SafeResourceUrl;
1656
1710
  loaded: boolean;
1657
- private messageHandler;
1711
+ iframeHeight: number | null;
1712
+ constructor(sanitizer: DomSanitizer);
1658
1713
  ngOnInit(): void;
1659
- ngOnDestroy(): void;
1714
+ onMessage(event: MessageEvent): void;
1660
1715
  private buildUrl;
1661
1716
  private handleMessage;
1662
1717
  tokenize(): Promise<CardFormTokenResponse>;
@@ -1690,4 +1745,4 @@ type WithOnLoad = {
1690
1745
  };
1691
1746
 
1692
1747
  export { BankingCurrencies, CARD_TYPE_MAPPING, CardType, ChargebackProtectionAccountType, CoinflowApplePayButtonComponent, CoinflowCardForm, CoinflowCardFormV2, CoinflowCardNumberInput, CoinflowCardNumberOnlyInput, CoinflowCvvInputComponent, CoinflowCvvOnlyInputComponent, CoinflowGooglePayButtonComponent, CoinflowIFrameComponent, CoinflowPurchaseComponent, CoinflowPurchaseHistoryComponent, CoinflowPurchaseProtectionComponent, CoinflowUtils, CoinflowWithdrawComponent, CoinflowWithdrawHistoryComponent, Currency, CurrencyToISO4217, DEVICE_ID_HEADER, EventBus, IFrameMessageMethods, MerchantStyle, PaymentMethods, REFERRER_HEADER, RN_REDIRECT_MESSAGE_NAME, SESSION_ID_HEADER, SettlementType, ThreeDsChallengePreference, TokenExCardNumberIframeId, TokenExCvvContainerID, WithdrawCategory, WithdrawCurrencies, WithdrawSpeed, doInitializeCvvOnlyTokenExIframe, doInitializeTokenExCardOnlyIframe, doInitializeTokenExIframe, getCoinflowProtectionHeaders, getCoinflowPurchaseHeaders, getCurrencyDecimals, getCustomerName, getHandlers, getIframeConfig, getWalletPubkey, handleIFrameMessage, initCoinflowProtection, invertRate, isBankingCurrency, isTypedCurrencyCents, isWithdrawCurrency, isZeroAuthSavedPaymentMethods, isZeroAuthVerifyCard, nftCartItem, paymentMethodLabels, productType, recordFrontendError, setTokenExScriptTag };
1693
- export type { AccountFundingTransaction, AnyObject, ArbitrumWalletProps, AuthDeclinedWalletCallInfo, BankingCurrency, BaseWalletProps, CardFormArgs, CardFormInputStyles, CardFormTokenResponse, Cart, CartClassOmitted, CartItem, CartItemClassOmitted, Cents, ChargebackProtectionData, ChargebackProtectionItem, CoinflowArbitrumHistoryProps, CoinflowArbitrumPurchaseProps, CoinflowArbitrumWithdrawProps, CoinflowBaseHistoryProps, CoinflowBasePurchaseProps, CoinflowBaseWithdrawProps, CoinflowBlockchain, CoinflowCardNumberInputProps, CoinflowCardTokenResponse, CoinflowCommonPurchaseProps, CoinflowCommonWithdrawProps, CoinflowCvvOnlyInputProps, CoinflowEnvs, CoinflowEthHistoryProps, CoinflowEthPurchaseProps, CoinflowEthWithdrawProps, CoinflowEvmHistoryProps, CoinflowEvmPurchaseProps, CoinflowHistoryProps, CoinflowIFrameProps, CoinflowMonadHistoryProps, CoinflowMonadPurchaseProps, CoinflowMonadWithdrawProps, CoinflowPolygonHistoryProps, CoinflowPolygonPurchaseProps, CoinflowPolygonWithdrawProps, CoinflowProtectionHeadersType, CoinflowPurchaseHeadersType, CoinflowPurchaseProps, CoinflowSessionKeyHistoryProps, CoinflowSessionKeyPurchaseProps, CoinflowSolanaHistoryProps, CoinflowSolanaPurchaseProps, CoinflowSolanaWithdrawProps, CoinflowStellarHistoryProps, CoinflowStellarPurchaseProps, CoinflowStellarWithdrawProps, CoinflowTempoHistoryProps, CoinflowTempoPurchaseProps, CoinflowTempoWithdrawProps, CoinflowTypes, CoinflowWithdrawProps, CommonDoInitializeTokenExIframeArgs, CommonEvmRedeem, CryptoCartItem, CurrencyCents, CustomerInfo, DecentRedeem, DoInitializeCvvOnlyTokenExIframeArgs, DoInitializeTokenExIframeArgs, EthWallet, EthWalletProps, EventBusCallback, EvmTransactionData, ExchangeRate, FullName, GetIFrameConfigArgs, GiftCardCartItem, IFrameMessageHandlers, KnownTokenIdRedeem, MerchantIdOrCheckoutJwt, MerchantTheme, MergeWithOptionalDiff, MonadWalletProps, NameCustomerInfo, NftCartItemClassOmitted, NormalRedeem, OnAuthDeclinedMethod, OnSuccessMethod, PartialBy, PolygonWalletProps, PurchaseCustomPayInFee, RecipientAftInfo, RemainingLimit, ReturnedTokenIdRedeem, SafeMintRedeem, SolanaWallet, SolanaWalletProps, SplitNameCustomerInfo, StellarWallet, StellarWalletProps, Subtotal, TempoWalletProps, TokenExIFrameConfiguration, TokenExIframe, TokenRedeem, TokenSubtotal, TokenizationResponse, TypedCurrencyCents, VersionDetail, WalletCall, WalletTypes, WithGeo, WithOnLoad, WithdrawCurrency, ZeroAuthSavedPaymentMethods, ZeroAuthVerifyCard, ZeroAuthorizationConfig };
1748
+ export type { AccountFundingTransaction, AnyObject, ArbitrumWalletProps, AuthDeclinedWalletCallInfo, BankingCurrency, BaseWalletProps, CardFormArgs, CardFormInputStyles, CardFormTokenResponse, Cart, CartClassOmitted, CartItem, CartItemClassOmitted, Cents, ChargebackProtectionData, ChargebackProtectionItem, CoinflowArbitrumHistoryProps, CoinflowArbitrumPurchaseProps, CoinflowArbitrumWithdrawProps, CoinflowBaseHistoryProps, CoinflowBasePurchaseProps, CoinflowBaseWithdrawProps, CoinflowBlockchain, CoinflowCardNumberInputProps, CoinflowCardTokenResponse, CoinflowCommonPaymentIntentProps, CoinflowCommonPurchaseProps, CoinflowCommonWithdrawProps, CoinflowCvvOnlyInputProps, CoinflowEnvs, CoinflowEthHistoryProps, CoinflowEthPurchaseProps, CoinflowEthWithdrawProps, CoinflowEvmHistoryProps, CoinflowEvmPurchaseProps, CoinflowHistoryProps, CoinflowIFrameProps, CoinflowIntentsIFrameProps, CoinflowMonadHistoryProps, CoinflowMonadPurchaseProps, CoinflowMonadWithdrawProps, CoinflowPolygonHistoryProps, CoinflowPolygonPurchaseProps, CoinflowPolygonWithdrawProps, CoinflowProtectionHeadersType, CoinflowPurchaseHeadersType, CoinflowPurchaseProps, CoinflowSessionKeyHistoryProps, CoinflowSessionKeyPurchaseProps, CoinflowSolanaHistoryProps, CoinflowSolanaPurchaseProps, CoinflowSolanaWithdrawProps, CoinflowStellarHistoryProps, CoinflowStellarPurchaseProps, CoinflowStellarWithdrawProps, CoinflowTempoHistoryProps, CoinflowTempoPurchaseProps, CoinflowTempoWithdrawProps, CoinflowTypes, CoinflowWithdrawProps, CommonDoInitializeTokenExIframeArgs, CommonEvmRedeem, CryptoCartItem, CurrencyCents, CustomerInfo, DecentRedeem, DoInitializeCvvOnlyTokenExIframeArgs, DoInitializeTokenExIframeArgs, EthWallet, EthWalletProps, EventBusCallback, EvmTransactionData, ExchangeRate, FullName, GetIFrameConfigArgs, GiftCardCartItem, IFrameMessageHandlers, KnownTokenIdRedeem, MerchantIdOrCheckoutJwt, MerchantTheme, MergeWithOptionalDiff, MonadWalletProps, NameCustomerInfo, NftCartItemClassOmitted, NormalRedeem, OnAuthDeclinedMethod, OnSuccessMethod, PartialBy, PolygonWalletProps, PurchaseCustomPayInFee, RecipientAftInfo, RemainingLimit, ReturnedTokenIdRedeem, SafeMintRedeem, SolanaWallet, SolanaWalletProps, SplitNameCustomerInfo, StellarWallet, StellarWalletProps, Subtotal, TempoWalletProps, TokenExIFrameConfiguration, TokenExIframe, TokenRedeem, TokenSubtotal, TokenizationResponse, TypedCurrencyCents, VersionDetail, WalletCall, WalletTypes, WithGeo, WithOnLoad, WithdrawCurrency, ZeroAuthSavedPaymentMethods, ZeroAuthVerifyCard, ZeroAuthorizationConfig };