@coinflowlabs/angular 2.0.1-0 → 3.1.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": "2.0.1-0",
3
+ "version": "3.1.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.17",
6
6
  "@angular/core": "^19.2.17",
@@ -1,7 +1,7 @@
1
1
  import { PublicKey, Transaction, VersionedTransaction, Signer, Connection } from '@solana/web3.js';
2
2
  import * as _coinflowlabs_angular from '@coinflowlabs/angular';
3
3
  import * as i0 from '@angular/core';
4
- import { EventEmitter, ElementRef, OnInit, OnDestroy, NgZone } from '@angular/core';
4
+ import { EventEmitter, ElementRef, OnChanges, OnInit, OnDestroy, NgZone } from '@angular/core';
5
5
  import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';
6
6
 
7
7
  /**
@@ -1585,12 +1585,16 @@ interface CoinflowCommonPaymentIntentProps extends Omit<CoinflowTypes, 'blockcha
1585
1585
  }
1586
1586
  interface CoinflowCommonPurchaseProps extends CoinflowTypes {
1587
1587
  subtotal?: Subtotal;
1588
+ /** @hidden */
1589
+ checkoutVersion?: 'v2' | 'v3';
1588
1590
  /**
1589
1591
  * When true, the Apple Pay button skips the totals (fee quote) fetch and
1590
1592
  * charges exactly the `subtotal` passed to the component.
1591
1593
  */
1592
1594
  useNativeSubtotal?: boolean;
1593
1595
  presentment?: Currency;
1596
+ /** @hidden */
1597
+ inlineCryptoCheckout?: boolean;
1594
1598
  onSuccess?: OnSuccessMethod;
1595
1599
  sessionKey?: string;
1596
1600
  onAuthDeclined?: OnAuthDeclinedMethod;
@@ -1886,9 +1890,7 @@ interface SafeMintRedeem extends NormalRedeem {
1886
1890
  nftContract?: string;
1887
1891
  }
1888
1892
  /**
1889
- * (EVM only) If your contract returns the NFT ID, then utilize this object.
1890
- *
1891
- * 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.
1893
+ * @deprecated No longer supported: requests with `type: 'returned'` are rejected with a 400. Use {@link SafeMintRedeem}, {@link KnownTokenIdRedeem} or {@link NormalRedeem} instead.
1892
1894
  */
1893
1895
  interface ReturnedTokenIdRedeem extends NormalRedeem {
1894
1896
  type: 'returned';
@@ -1968,7 +1970,7 @@ interface CoinflowBankLinkProps extends Pick<CoinflowTypes, 'merchantId' | 'env'
1968
1970
  */
1969
1971
  onAccountLinkError?: OnAccountLinkErrorMethod | undefined;
1970
1972
  }
1971
- 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 {
1973
+ 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 {
1972
1974
  walletPubkey: string | null | undefined;
1973
1975
  sessionKey?: string;
1974
1976
  route: string;
@@ -2068,6 +2070,10 @@ interface RecipientAftInfo {
2068
2070
  documentReference?: string;
2069
2071
  }
2070
2072
  declare const RN_REDIRECT_MESSAGE_NAME = "rnredirect";
2073
+ declare enum RedirectFlow {
2074
+ Venmo = "venmo",
2075
+ Plaid = "plaid"
2076
+ }
2071
2077
 
2072
2078
  declare class CoinflowUtils {
2073
2079
  env: CoinflowEnvs;
@@ -2082,12 +2088,13 @@ declare class CoinflowUtils {
2082
2088
  env?: CoinflowEnvs;
2083
2089
  }): boolean;
2084
2090
  static getCoinflowApiUrl(env?: CoinflowEnvs): string;
2085
- 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 & {
2091
+ 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 & {
2086
2092
  baseUrl?: string;
2087
2093
  } & WithGeo): string;
2088
2094
  static getCoinflowIntentsUrl({ baseUrl, route, color, theme, env, origins, deviceId, merchantCss, loaderBackground, handleHeightChangeId, }: CoinflowIntentsIFrameProps & {
2089
2095
  baseUrl?: string;
2090
2096
  }): string;
2097
+ static getPurchaseRoute({ merchantId, checkoutVersion, }: Pick<CoinflowPurchaseProps, 'merchantId' | 'checkoutVersion'>): Pick<CoinflowIFrameProps, 'route' | 'routePrefix'>;
2091
2098
  static getTransaction(props: CoinflowPurchaseProps): string | undefined;
2092
2099
  static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
2093
2100
  solana: T;
@@ -2145,9 +2152,9 @@ interface IFrameMessageHandlers {
2145
2152
  onAccountLinkError?: OnAccountLinkErrorMethod | undefined;
2146
2153
  /**
2147
2154
  * Called when the iframe opens/closes an in-page overlay (e.g. the PayPal
2148
- * approval modal). `state` is 'open' or 'close'.
2155
+ * approval modal).
2149
2156
  */
2150
- handleOverlay?: (state: string) => void;
2157
+ handleOverlay?: (state: OverlayState) => void;
2151
2158
  }
2152
2159
  declare enum IFrameMessageMethods {
2153
2160
  SignMessage = "signMessage",
@@ -2166,6 +2173,13 @@ declare enum IFrameMessageMethods {
2166
2173
  Overlay = "overlay",
2167
2174
  UpdateSubtotal = "updateSubtotal"
2168
2175
  }
2176
+ declare enum HostMessageMethods {
2177
+ OverlayOffset = "overlayOffset"
2178
+ }
2179
+ declare enum OverlayState {
2180
+ Open = "open",
2181
+ Close = "close"
2182
+ }
2169
2183
  declare function getWalletPubkey(input: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain'>): string | null | undefined;
2170
2184
  declare function handleIFrameMessage(rawMessage: string, handlers: IFrameMessageHandlers, handleHeightChangeId: string | number): Promise<string> | void;
2171
2185
  declare function getHandlers(props: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain' | 'onSuccess' | 'onAuthDeclined' | 'onInputError' | 'onInputValid'> & {
@@ -2369,18 +2383,18 @@ type L2L3Data = {
2369
2383
  };
2370
2384
 
2371
2385
  declare const DEVICE_ID_HEADER = "x-device-id";
2372
- declare const SESSION_ID_HEADER = "x-session-id";
2373
2386
  declare const REFERRER_HEADER = "x-coinflow-referrer";
2387
+ declare const SESSION_ID_HEADER = "x-session-id";
2374
2388
  declare const FORTER_TOKEN_HEADER = "x-forter-token";
2389
+ type WithReferrerHeader<T> = T & {
2390
+ [REFERRER_HEADER]: string | null;
2391
+ };
2392
+
2375
2393
  type CoinflowProtectionHeadersType = {
2376
2394
  [DEVICE_ID_HEADER]: string | null;
2377
- [SESSION_ID_HEADER]: string | null;
2378
- [FORTER_TOKEN_HEADER]: string | null;
2379
2395
  };
2380
2396
  declare function getCoinflowProtectionHeaders(): CoinflowProtectionHeadersType;
2381
- type CoinflowPurchaseHeadersType = CoinflowProtectionHeadersType & {
2382
- [REFERRER_HEADER]: string | null;
2383
- };
2397
+ type CoinflowPurchaseHeadersType = WithReferrerHeader<CoinflowProtectionHeadersType>;
2384
2398
  declare function getCoinflowPurchaseHeaders(): CoinflowPurchaseHeadersType;
2385
2399
 
2386
2400
  interface CoinflowFraudProtectionTokens {
@@ -2400,6 +2414,12 @@ declare function initCoinflowProtection({ coinflowEnv, merchantId, }: {
2400
2414
  merchantId: string;
2401
2415
  }): Promise<void>;
2402
2416
 
2417
+ declare class ForterSnippet {
2418
+ private static readonly siteIds;
2419
+ static siteIdFor(env: CoinflowEnvs): string;
2420
+ static load(siteId: string | undefined | null): void;
2421
+ }
2422
+
2403
2423
  declare function getForterToken(): string | null;
2404
2424
  declare function captureForterToken({ timeoutMs, intervalMs, }?: {
2405
2425
  timeoutMs?: number;
@@ -2478,9 +2498,12 @@ declare class CoinflowPurchaseHistoryComponent {
2478
2498
  static ɵcmp: i0.ɵɵComponentDeclaration<CoinflowPurchaseHistoryComponent, "lib-coinflow-purchase-history", never, {}, {}, never, never, true, never>;
2479
2499
  }
2480
2500
 
2481
- declare class CoinflowPurchaseProtectionComponent {
2501
+ declare class CoinflowPurchaseProtectionComponent implements OnChanges {
2502
+ coinflowEnv: CoinflowEnvs;
2503
+ merchantId: string;
2504
+ ngOnChanges(): void;
2482
2505
  static ɵfac: i0.ɵɵFactoryDeclaration<CoinflowPurchaseProtectionComponent, never>;
2483
- static ɵcmp: i0.ɵɵComponentDeclaration<CoinflowPurchaseProtectionComponent, "lib-coinflow-purchase-protection", never, {}, {}, never, never, true, never>;
2506
+ static ɵcmp: i0.ɵɵComponentDeclaration<CoinflowPurchaseProtectionComponent, "lib-coinflow-purchase-protection", never, { "coinflowEnv": { "alias": "coinflowEnv"; "required": false; }; "merchantId": { "alias": "merchantId"; "required": false; }; }, {}, never, never, true, never>;
2484
2507
  }
2485
2508
 
2486
2509
  declare class CoinflowWithdrawComponent {
@@ -2612,5 +2635,5 @@ type WithOnLoad = {
2612
2635
  onLoad?: () => void | Promise<void>;
2613
2636
  };
2614
2637
 
2615
- 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, productType, recordFrontendError, resolveBankLinkCompletion, serializeCachedLinkToken, shouldStackSkeleton };
2638
+ 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, ForterSnippet, 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, productType, recordFrontendError, resolveBankLinkCompletion, serializeCachedLinkToken, shouldStackSkeleton };
2616
2639
  export type { AccountFundingTransaction, AccountLinkErrorInfo, AccountLinkedInfo, AccountLinkedType, AccountNotLinkedInfo, AccountNotLinkedReason, AnyObject, ArbitrumWalletProps, AuthDeclinedWalletCallInfo, BankLinkCompletion, BankLinkStatus, BankingCurrency, BaseWalletProps, CachedLinkToken, CardEntryConfig, CardEntryDivider, CardEntryInputName, CardEntryLayout, CardFieldInputEvent, CardFormArgs, CardFormTokenResponse, CardFormVariant, Cart, CartClassOmitted, CartItem, CartItemClassOmitted, Cents, ChargebackProtectionData, ChargebackProtectionItem, CoinflowArbitrumHistoryProps, CoinflowArbitrumPurchaseProps, CoinflowArbitrumWithdrawProps, CoinflowBankLinkProps, CoinflowBaseHistoryProps, CoinflowBasePurchaseProps, CoinflowBaseWithdrawProps, CoinflowBlockchain, CoinflowCommonPaymentIntentProps, CoinflowCommonPurchaseProps, CoinflowCommonWithdrawProps, CoinflowEnvs, CoinflowEthHistoryProps, CoinflowEthPurchaseProps, CoinflowEthWithdrawProps, CoinflowEvmHistoryProps, CoinflowEvmPurchaseProps, CoinflowFraudProtectionTokens, CoinflowHistoryProps, CoinflowIFrameProps, CoinflowIntentsIFrameProps, CoinflowMonadHistoryProps, CoinflowMonadPurchaseProps, CoinflowMonadWithdrawProps, CoinflowPolygonHistoryProps, CoinflowPolygonPurchaseProps, CoinflowPolygonWithdrawProps, CoinflowProtectionHeadersType, CoinflowPurchaseHeadersType, CoinflowPurchaseProps, CoinflowSessionKeyHistoryProps, CoinflowSessionKeyPurchaseProps, CoinflowSolanaHistoryProps, CoinflowSolanaPurchaseProps, CoinflowSolanaWithdrawProps, CoinflowTempoHistoryProps, CoinflowTempoPurchaseProps, CoinflowTempoWithdrawProps, CoinflowTypes, CoinflowWithdrawProps, CommonEvmRedeem, CryptoCartItem, CurrencyCents, CustomerInfo, DecentRedeem, EthWallet, EthWalletProps, EventBusCallback, EvmTransactionData, ExchangeRate, FlightTicketCartItem, FlightUpgradeCartItem, FullName, GiftCardCartItem, IFrameMessageHandlers, InputErrorWalletCallInfo, InputValidWalletCallInfo, KnownTokenIdRedeem, L2L3Data, L2L3Item, L2L3Level2, L2L3Level3, L2L3Tax, LamportsAmount, LodgingCartItem, MerchantIdOrCheckoutJwt, MerchantTheme, MergeWithOptionalDiff, MonadWalletProps, NameCustomerInfo, NftCartItemClassOmitted, NormalRedeem, OnAccountLinkErrorMethod, OnAccountLinkedMethod, OnAccountNotLinkedMethod, OnAuthDeclinedMethod, OnInputErrorMethod, OnInputValidMethod, OnSuccessMethod, PartialBy, PolygonWalletProps, PurchaseCustomPayInFee, RecipientAftInfo, RemainingLimit, ReturnedTokenIdRedeem, SafeMintRedeem, SkeletonColors, SkeletonLayout, SolanaWallet, SolanaWalletProps, SplitNameCustomerInfo, Subtotal, TempoWalletProps, TokenRedeem, TokenSubtotal, TravelCartItem, TravelFirstFlight, TravelLodging, TravelLodgingHotel, TravelTrip, TypedCurrencyCents, WalletCall, WalletTypes, WithGeo, WithOnLoad, WithdrawCurrency, ZeroAuthSavedPaymentMethods, ZeroAuthVerifyCard, ZeroAuthorizationConfig };