@coinflowlabs/angular 1.1.4 → 1.1.5

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.
@@ -6,13 +6,17 @@ export declare class CoinflowIFrameComponent {
6
6
  private sanitizer;
7
7
  iframeProps: CoinflowIFrameProps;
8
8
  messageHandlers: IFrameMessageHandlers;
9
+ onLoad?: () => void | Promise<void>;
10
+ waitForLoadedMessage?: boolean;
9
11
  messageEvent: EventEmitter<any>;
10
12
  dynamicUrl?: SafeResourceUrl;
11
13
  iframe?: ElementRef<HTMLIFrameElement>;
14
+ private isLoading;
12
15
  constructor(sanitizer: DomSanitizer);
13
16
  ngOnInit(): void;
14
17
  onPostMessage(event: any): void;
15
18
  sendMessage(message: string): void;
19
+ handleIframeLoad(): void;
16
20
  static ɵfac: i0.ɵɵFactoryDeclaration<CoinflowIFrameComponent, never>;
17
- static ɵcmp: i0.ɵɵComponentDeclaration<CoinflowIFrameComponent, "lib-coinflow-iframe", never, { "iframeProps": { "alias": "iframeProps"; "required": false; }; "messageHandlers": { "alias": "messageHandlers"; "required": false; }; }, { "messageEvent": "messageEvent"; }, never, never, true, never>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<CoinflowIFrameComponent, "lib-coinflow-iframe", never, { "iframeProps": { "alias": "iframeProps"; "required": false; }; "messageHandlers": { "alias": "messageHandlers"; "required": false; }; "onLoad": { "alias": "onLoad"; "required": false; }; "waitForLoadedMessage": { "alias": "waitForLoadedMessage"; "required": false; }; }, { "messageEvent": "messageEvent"; }, never, never, true, never>;
18
22
  }
@@ -1,7 +1,8 @@
1
1
  import { CoinflowIFrameProps, CoinflowPurchaseProps, IFrameMessageHandlers } from './common';
2
+ import { WithOnLoad } from '../public-api';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class CoinflowPurchaseComponent {
4
- purchaseProps: CoinflowPurchaseProps;
5
+ purchaseProps: CoinflowPurchaseProps & WithOnLoad;
5
6
  iframeProps?: CoinflowIFrameProps;
6
7
  messageHandlers?: IFrameMessageHandlers;
7
8
  ngOnInit(): void;
@@ -1,7 +1,8 @@
1
1
  import { CoinflowIFrameProps, CoinflowWithdrawProps, IFrameMessageHandlers } from './common';
2
+ import { WithOnLoad } from '../public-api';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class CoinflowWithdrawComponent {
4
- withdrawProps: CoinflowWithdrawProps;
5
+ withdrawProps: CoinflowWithdrawProps & WithOnLoad;
5
6
  iframeProps?: CoinflowIFrameProps;
6
7
  messageHandlers?: IFrameMessageHandlers;
7
8
  ngOnInit(): void;
@@ -212,6 +212,17 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
212
212
  origins?: string[];
213
213
  threeDsChallengePreference?: ThreeDsChallengePreference;
214
214
  destinationAuthKey?: string;
215
+ accountFundingTransaction?: AccountFundingTransaction;
216
+ }
217
+ /**
218
+ * Used for Account Funding Transactions
219
+ */
220
+ export interface AccountFundingTransaction {
221
+ /**
222
+ * Recipient information for Account Funding Transactions (AFT).
223
+ * Required when AFT is enabled and type requires it.
224
+ */
225
+ recipientAftInfo?: RecipientAftInfo;
215
226
  }
216
227
  export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
217
228
  wallet: SolanaWallet;
@@ -314,27 +325,62 @@ export interface CommonEvmRedeem {
314
325
  */
315
326
  waitForHash?: boolean;
316
327
  }
328
+ /**
329
+ * (EVM only) If your contract sends the item/service being purchased via a custom "receiver" field, then utilize this object.
330
+ *
331
+ * The coinflow contract calls the "to" contract, which transfers the NFT/item to the "receiver" address defined in the contract function arguments.
332
+ */
317
333
  export interface NormalRedeem extends CommonEvmRedeem {
334
+ /**
335
+ * Transaction to be called.
336
+ */
318
337
  transaction: {
338
+ /**
339
+ * The merchant's whitelisted contract
340
+ */
319
341
  to: string;
342
+ /**
343
+ * The data to call this contract with, HEX encoded.
344
+ *
345
+ * The coinflow contract calls the "to" contract, contract pulls USDC from msg.sender, and transfers the NFT/item to the "receiver" address defined in the contract function arguments.
346
+ */
320
347
  data: string;
321
348
  };
322
349
  }
350
+ /**
351
+ * (EVM only) If your know the ID of the NFT being purchased, then utilize this object.
352
+ *
353
+ * The contract transfers the NFT to msg.sender (which is the Coinflow contract), the Coinflow contract fwd's the NFT to the end user's wallet.
354
+ */
323
355
  export interface KnownTokenIdRedeem extends NormalRedeem {
324
356
  /**
325
- * @minLength 42 Please provide a valid EVM Public Key (42 Characters Long)
326
- * @maxLength 42 Please provide a valid EVM Public Key (42 Characters Long)
357
+ * The address of the Nft's Contract
358
+ *
359
+ * @minLength 42 Please provide a valid EVM Address (42 Characters Long)
360
+ * @maxLength 42 Please provide a valid EVM Address (42 Characters Long)
327
361
  */
328
362
  nftContract: string;
329
363
  /**
364
+ * The ID of the NFT being purchased. Will be forwarded by the Coinflow contract to the customer's wallet.
365
+ *
330
366
  * @minLength 1 Please provide a valid Nft Id
331
367
  */
332
368
  nftId: string;
333
369
  }
370
+ /**
371
+ * (EVM only) If your contract mints an NFT via a OpenZeppelin Safe Mint Call, then utilize this object.
372
+ *
373
+ * The contract mints the NFT to msg.sender (which is the Coinflow contract), the Coinflow contract picks up the SafeMint event, and fwd's the NFT to the end user's wallet.
374
+ */
334
375
  export interface SafeMintRedeem extends NormalRedeem {
335
376
  type: 'safeMint';
336
377
  nftContract?: string;
337
378
  }
379
+ /**
380
+ * (EVM only) If your contract returns the NFT ID, then utilize this object.
381
+ *
382
+ * 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.
383
+ */
338
384
  export interface ReturnedTokenIdRedeem extends NormalRedeem {
339
385
  type: 'returned';
340
386
  nftContract?: string;
@@ -359,13 +405,13 @@ export interface ReservoirRedeem extends CommonEvmRedeem {
359
405
  /** @deprecated Reservoir decided to sunset Reservoir NFT, including their API and associated services, effective October 15, 2025. */
360
406
  taker?: string;
361
407
  }
362
- /** @deprecated */
363
408
  export interface TokenRedeem extends CommonEvmRedeem {
364
- /** @deprecated */
365
409
  type: 'token';
366
- /** @deprecated */
367
410
  destination: string;
368
411
  }
412
+ /**
413
+ * If your contract exists on a chain supported by Decent, pass this object in order to call it.
414
+ */
369
415
  export interface DecentRedeem extends CommonEvmRedeem {
370
416
  type: 'decent';
371
417
  /**
@@ -398,8 +444,13 @@ export interface DecentRedeem extends CommonEvmRedeem {
398
444
  isNative: boolean;
399
445
  };
400
446
  }
447
+ /**
448
+ * (EVM only) if you want to execute an EVM transaction on a successful purchase, you can pass a transaction request here.
449
+ *
450
+ * 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.
451
+ */
401
452
  export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | KnownTokenIdRedeem | NormalRedeem | TokenRedeem | DecentRedeem | ReservoirRedeem;
402
- export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' | 'handleHeightChange'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'subtotal' | 'presentment' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail' | 'allowedPaymentMethods'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey'> {
453
+ export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId' | 'handleHeightChange'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'subtotal' | 'presentment' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail' | 'allowedPaymentMethods' | 'accountFundingTransaction'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'destinationAuthKey'> {
403
454
  walletPubkey: string | null | undefined;
404
455
  sessionKey?: string;
405
456
  route: string;
@@ -420,4 +471,44 @@ export declare enum CardType {
420
471
  AMEX = "AMEX",
421
472
  DISCOVER = "DISC"
422
473
  }
474
+ export interface RecipientAftInfo {
475
+ /**
476
+ * @minLength 2
477
+ */
478
+ firstName: string;
479
+ /**
480
+ * @minLength 2
481
+ */
482
+ lastName: string;
483
+ /**
484
+ * @minLength 2
485
+ */
486
+ address1: string;
487
+ /**
488
+ * @minLength 2
489
+ */
490
+ city: string;
491
+ /**
492
+ * @minLength 2
493
+ */
494
+ postalCode: string;
495
+ /**
496
+ * @minLength 2
497
+ */
498
+ state?: string;
499
+ /**
500
+ * @minLength 2
501
+ * @maxLength 2
502
+ */
503
+ countryCode: string;
504
+ /**
505
+ * @pattern ^\d{8}$
506
+ */
507
+ dateOfBirth: string;
508
+ /**
509
+ * @pattern ^\d+$
510
+ */
511
+ phoneNumber?: string;
512
+ documentReference?: string;
513
+ }
423
514
  export {};
@@ -6,7 +6,7 @@ export declare class CoinflowUtils {
6
6
  getNSurePartnerId(merchantId: string): Promise<string | undefined>;
7
7
  static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
8
8
  static getCoinflowApiUrl(env?: CoinflowEnvs): string;
9
- static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, presentment, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChangeId, bankAccountLinkRedirect, additionalWallets, chargebackProtectionData, merchantCss, color, rent, lockDefaultToken, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, allowedPaymentMethods, }: CoinflowIFrameProps): string;
9
+ static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, subtotal, presentment, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChangeId, bankAccountLinkRedirect, additionalWallets, chargebackProtectionData, merchantCss, color, rent, lockDefaultToken, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, allowedPaymentMethods, accountFundingTransaction, }: CoinflowIFrameProps): string;
10
10
  static getTransaction(props: CoinflowPurchaseProps): string | undefined;
11
11
  static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
12
12
  solana: T;
@@ -0,0 +1,6 @@
1
+ export type EventBusCallback = (event: Event) => void;
2
+ export declare class EventBus {
3
+ static on(type: string, callback: EventBusCallback): void;
4
+ static dispatch(type: string, data: any): void;
5
+ static remove(type: string, callback: EventBusCallback): void;
6
+ }
@@ -1,6 +1,7 @@
1
1
  export * from './CoinflowTypes';
2
2
  export * from './CoinflowUtils';
3
3
  export * from './CoinflowLibMessageHandlers';
4
+ export * from './EventBus';
4
5
  export * from './card-form/TokenEx';
5
6
  export * from './card-form/tokenexHelpers';
6
7
  export * from './types/Subtotal';
@@ -5,6 +5,7 @@ export declare enum Currency {
5
5
  ALL = "ALL",
6
6
  ANG = "ANG",
7
7
  AOA = "AOA",
8
+ ARS = "ARS",
8
9
  AUD = "AUD",
9
10
  AWG = "AWG",
10
11
  AZN = "AZN",
@@ -14,18 +15,23 @@ export declare enum Currency {
14
15
  BGN = "BGN",
15
16
  BHD = "BHD",
16
17
  BIF = "BIF",
18
+ BMD = "BMD",
17
19
  BND = "BND",
18
20
  BOB = "BOB",
19
21
  BRL = "BRL",
22
+ BSD = "BSD",
20
23
  BTN = "BTN",
21
24
  BWP = "BWP",
25
+ BYN = "BYN",
22
26
  BZD = "BZD",
23
27
  CAD = "CAD",
24
28
  CHF = "CHF",
29
+ CLF = "CLF",
25
30
  CLP = "CLP",
26
31
  CNY = "CNY",
27
32
  COP = "COP",
28
33
  CRC = "CRC",
34
+ CUP = "CUP",
29
35
  CVE = "CVE",
30
36
  CZK = "CZK",
31
37
  DJF = "DJF",
@@ -35,6 +41,7 @@ export declare enum Currency {
35
41
  EGP = "EGP",
36
42
  ETB = "ETB",
37
43
  EUR = "EUR",
44
+ FJD = "FJD",
38
45
  GBP = "GBP",
39
46
  GEL = "GEL",
40
47
  GHS = "GHS",
@@ -47,6 +54,7 @@ export declare enum Currency {
47
54
  HTG = "HTG",
48
55
  HUF = "HUF",
49
56
  IDR = "IDR",
57
+ ILS = "ILS",
50
58
  INR = "INR",
51
59
  IQD = "IQD",
52
60
  IRR = "IRR",
@@ -62,6 +70,8 @@ export declare enum Currency {
62
70
  KWD = "KWD",
63
71
  KYD = "KYD",
64
72
  KZT = "KZT",
73
+ LAK = "LAK",
74
+ LBP = "LBP",
65
75
  LKR = "LKR",
66
76
  LRD = "LRD",
67
77
  LSL = "LSL",
@@ -75,9 +85,11 @@ export declare enum Currency {
75
85
  MOP = "MOP",
76
86
  MRU = "MRU",
77
87
  MUR = "MUR",
88
+ MWK = "MWK",
78
89
  MVR = "MVR",
79
90
  MXN = "MXN",
80
91
  MYR = "MYR",
92
+ MZN = "MZN",
81
93
  NAD = "NAD",
82
94
  NGN = "NGN",
83
95
  NIO = "NIO",
@@ -87,6 +99,7 @@ export declare enum Currency {
87
99
  OMR = "OMR",
88
100
  PAB = "PAB",
89
101
  PEN = "PEN",
102
+ PGK = "PGK",
90
103
  PHP = "PHP",
91
104
  PKR = "PKR",
92
105
  PLN = "PLN",
@@ -103,6 +116,7 @@ export declare enum Currency {
103
116
  SLE = "SLE",
104
117
  SLL = "SLL",
105
118
  SOS = "SOS",
119
+ SRD = "SRD",
106
120
  STN = "STN",
107
121
  SVC = "SVC",
108
122
  SYP = "SYP",
@@ -111,6 +125,7 @@ export declare enum Currency {
111
125
  TJS = "TJS",
112
126
  TMT = "TMT",
113
127
  TND = "TND",
128
+ TOP = "TOP",
114
129
  TRY = "TRY",
115
130
  TTD = "TTD",
116
131
  TWD = "TWD",
@@ -120,13 +135,15 @@ export declare enum Currency {
120
135
  UYU = "UYU",
121
136
  UZS = "UZS",
122
137
  VND = "VND",
138
+ VUV = "VUV",
123
139
  XAF = "XAF",
124
140
  XCD = "XCD",
125
141
  XOF = "XOF",
126
142
  XPF = "XPF",
127
143
  YER = "YER",
128
144
  ZAR = "ZAR",
129
- ZMW = "ZMW"
145
+ ZMW = "ZMW",
146
+ ZWL = "ZWL"
130
147
  }
131
148
  export declare const CurrencyToISO4217: Record<Currency, string>;
132
149
  export type WithdrawCurrency = Currency.USD | Currency.EUR | Currency.GBP | Currency.BRL | Currency.CAD;
@@ -1,7 +1,8 @@
1
1
  import { CoinflowIFrameProps, CoinflowPurchaseProps, IFrameMessageHandlers } from '../common';
2
+ import { WithOnLoad } from '../../public-api';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class CoinflowMobileWalletButtonComponent {
4
- purchaseProps: CoinflowPurchaseProps & {
5
+ purchaseProps: CoinflowPurchaseProps & WithOnLoad & {
5
6
  color: 'white' | 'black';
6
7
  onError?: (message: string) => void;
7
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinflowlabs/angular",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.0",
6
6
  "@angular/core": "^17.3.0",
package/public-api.d.ts CHANGED
@@ -10,3 +10,7 @@ export * from './lib/card-form/coinflow-cvv-input.component';
10
10
  export * from './lib/card-form/coinflow-cvv-only-input.component';
11
11
  export * from './lib/mobile-wallet/coinflow-apple-pay-button.component';
12
12
  export * from './lib/mobile-wallet/coinflow-google-pay-button.component';
13
+ export * from './lib/common';
14
+ export type WithOnLoad = {
15
+ onLoad?: () => void | Promise<void>;
16
+ };