@ic-pay/icpay-widget 1.2.91 → 1.2.106

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.
@@ -50,6 +50,7 @@ type CommonConfig = {
50
50
  chainShortcodes?: string[];
51
51
  tokenShortcodes?: string[];
52
52
  chainTypes?: Array<'ic' | 'evm' | 'sol'>;
53
+ fiat_currency?: string;
53
54
  metadata?: Record<string, any>;
54
55
  derivationOrigin?: string;
55
56
  actorProvider?: (canisterId: string, idl: any) => any;
@@ -184,6 +185,9 @@ declare class ICPayProgressBar extends LitElement {
184
185
  private currentAmount;
185
186
  private currentCurrency;
186
187
  private currentLedgerSymbol;
188
+ /** Fiat currency code/symbol from payment intent (for success message). */
189
+ private currentFiatCode;
190
+ private currentFiatSymbol;
187
191
  private confirmLoadingStartedAt;
188
192
  private progressionTimer;
189
193
  private currentWalletType;
@@ -289,6 +293,28 @@ declare class ICPayPremiumContent extends LitElement {
289
293
  private onTransactionCompleted;
290
294
  private onUnlock;
291
295
  private tryAutoConnectPNP;
296
+ /** Ensure WalletSelect (pnp) is created with same config as wallet modal; used by generateWalletConnectQr / connectWallet. */
297
+ private getOrCreatePnp;
298
+ /**
299
+ * Pre-generate WalletConnect QR as a data URL. Host can show it in a placeholder (e.g. pay page left column).
300
+ * When user scans and approves, the widget is updated to "connected" so Pay does not open the wallet selector.
301
+ * hostOptions.onConnected is called when the phone wallet connects so the host can show "Connected" etc.
302
+ * Returns the QR image as data URL, or null if WalletConnect is not enabled/available.
303
+ */
304
+ generateWalletConnectQr(hostOptions?: {
305
+ onConnected?: () => void;
306
+ }): Promise<string | null>;
307
+ /**
308
+ * Check if Coinbase/Base wallet is already connected (e.g. user returned from Base app deep link).
309
+ * Host can call this on load when showing Base option on mobile to show "Connected".
310
+ */
311
+ checkCoinbaseConnection(): Promise<boolean>;
312
+ /**
313
+ * Connect a specific wallet by id (e.g. 'coinbase' for Base Wallet deep link on mobile).
314
+ * Host can use this for "Connect with Base" without opening the wallet modal.
315
+ * Resolves when connected; rejects on error.
316
+ */
317
+ connectWallet(walletId: string): Promise<void>;
292
318
  connectedCallback(): void;
293
319
  disconnectedCallback(): void;
294
320
  protected updated(changed: Map<string, unknown>): void;
@@ -349,6 +375,28 @@ declare class ICPayTipJar extends LitElement {
349
375
  private walletBalances;
350
376
  private tryAutoConnectPNP;
351
377
  private get amounts();
378
+ /** Ensure WalletSelect (pnp) is created with same config as wallet modal; used by generateWalletConnectQr / connectWallet. */
379
+ private getOrCreatePnp;
380
+ /**
381
+ * Pre-generate WalletConnect QR as a data URL. Host can show it in a placeholder (e.g. pay page left column).
382
+ * When user scans and approves, the widget is updated to "connected" so Pay does not open the wallet selector.
383
+ * hostOptions.onConnected is called when the phone wallet connects so the host can show "Connected" etc.
384
+ * Returns the QR image as data URL, or null if WalletConnect is not enabled/available.
385
+ */
386
+ generateWalletConnectQr(hostOptions?: {
387
+ onConnected?: () => void;
388
+ }): Promise<string | null>;
389
+ /**
390
+ * Check if Coinbase/Base wallet is already connected (e.g. user returned from Base app deep link).
391
+ * Host can call this on load when showing Base option on mobile to show "Connected".
392
+ */
393
+ checkCoinbaseConnection(): Promise<boolean>;
394
+ /**
395
+ * Connect a specific wallet by id (e.g. 'coinbase' for Base Wallet deep link on mobile).
396
+ * Host can use this for "Connect with Base" without opening the wallet modal.
397
+ * Resolves when connected; rejects on error.
398
+ */
399
+ connectWallet(walletId: string): Promise<void>;
352
400
  connectedCallback(): void;
353
401
  protected updated(changed: Map<string, unknown>): void;
354
402
  private onSwitchAccount;
@@ -414,6 +462,28 @@ declare class ICPayArticlePaywall extends LitElement {
414
462
  private onTransactionCompleted;
415
463
  private onUnlock;
416
464
  private tryAutoConnectPNP;
465
+ /** Ensure WalletSelect (pnp) is created with same config as wallet modal; used by generateWalletConnectQr / connectWallet. */
466
+ private getOrCreatePnp;
467
+ /**
468
+ * Pre-generate WalletConnect QR as a data URL. Host can show it in a placeholder (e.g. pay page left column).
469
+ * When user scans and approves, the widget is updated to "connected" so Pay does not open the wallet selector.
470
+ * hostOptions.onConnected is called when the phone wallet connects so the host can show "Connected" etc.
471
+ * Returns the QR image as data URL, or null if WalletConnect is not enabled/available.
472
+ */
473
+ generateWalletConnectQr(hostOptions?: {
474
+ onConnected?: () => void;
475
+ }): Promise<string | null>;
476
+ /**
477
+ * Check if Coinbase/Base wallet is already connected (e.g. user returned from Base app deep link).
478
+ * Host can call this on load when showing Base option on mobile to show "Connected".
479
+ */
480
+ checkCoinbaseConnection(): Promise<boolean>;
481
+ /**
482
+ * Connect a specific wallet by id (e.g. 'coinbase' for Base Wallet deep link on mobile).
483
+ * Host can use this for "Connect with Base" without opening the wallet modal.
484
+ * Resolves when connected; rejects on error.
485
+ */
486
+ connectWallet(walletId: string): Promise<void>;
417
487
  private attachTransakMessageListener;
418
488
  private detachTransakMessageListener;
419
489
  private onTransakMessage;
@@ -476,6 +546,28 @@ declare class ICPayCoffeeShop extends LitElement {
476
546
  private selectItem;
477
547
  private selectSymbol;
478
548
  private get selectedItem();
549
+ /** Ensure WalletSelect (pnp) is created with same config as wallet modal; used by generateWalletConnectQr / connectWallet. */
550
+ private getOrCreatePnp;
551
+ /**
552
+ * Pre-generate WalletConnect QR as a data URL. Host can show it in a placeholder (e.g. pay page left column).
553
+ * When user scans and approves, the widget is updated to "connected" so Pay does not open the wallet selector.
554
+ * hostOptions.onConnected is called when the phone wallet connects so the host can show "Connected" etc.
555
+ * Returns the QR image as data URL, or null if WalletConnect is not enabled/available.
556
+ */
557
+ generateWalletConnectQr(hostOptions?: {
558
+ onConnected?: () => void;
559
+ }): Promise<string | null>;
560
+ /**
561
+ * Check if Coinbase/Base wallet is already connected (e.g. user returned from Base app deep link).
562
+ * Host can call this on load when showing Base option on mobile to show "Connected".
563
+ */
564
+ checkCoinbaseConnection(): Promise<boolean>;
565
+ /**
566
+ * Connect a specific wallet by id (e.g. 'coinbase' for Base Wallet deep link on mobile).
567
+ * Host can use this for "Connect with Base" without opening the wallet modal.
568
+ * Resolves when connected; rejects on error.
569
+ */
570
+ connectWallet(walletId: string): Promise<void>;
479
571
  private resetPaymentFlow;
480
572
  private order;
481
573
  private attachTransakMessageListener;
@@ -531,6 +623,28 @@ declare class ICPayDonationThermometer extends LitElement {
531
623
  private walletBalances;
532
624
  private tryAutoConnectPNP;
533
625
  private get amounts();
626
+ /** Ensure WalletSelect (pnp) is created with same config as wallet modal; used by generateWalletConnectQr / connectWallet. */
627
+ private getOrCreatePnp;
628
+ /**
629
+ * Pre-generate WalletConnect QR as a data URL. Host can show it in a placeholder (e.g. pay page left column).
630
+ * When user scans and approves, the widget is updated to "connected" so Pay does not open the wallet selector.
631
+ * hostOptions.onConnected is called when the phone wallet connects so the host can show "Connected" etc.
632
+ * Returns the QR image as data URL, or null if WalletConnect is not enabled/available.
633
+ */
634
+ generateWalletConnectQr(hostOptions?: {
635
+ onConnected?: () => void;
636
+ }): Promise<string | null>;
637
+ /**
638
+ * Check if Coinbase/Base wallet is already connected (e.g. user returned from Base app deep link).
639
+ * Host can call this on load when showing Base option on mobile to show "Connected".
640
+ */
641
+ checkCoinbaseConnection(): Promise<boolean>;
642
+ /**
643
+ * Connect a specific wallet by id (e.g. 'coinbase' for Base Wallet deep link on mobile).
644
+ * Host can use this for "Connect with Base" without opening the wallet modal.
645
+ * Resolves when connected; rejects on error.
646
+ */
647
+ connectWallet(walletId: string): Promise<void>;
534
648
  connectedCallback(): void;
535
649
  protected updated(changed: Map<string, unknown>): void;
536
650
  private onSwitchAccount;
@@ -593,6 +707,28 @@ declare class ICPayPayButton extends LitElement {
593
707
  private onrampPollingActive;
594
708
  private onrampNotifyController;
595
709
  private getSdk;
710
+ /** Ensure WalletSelect (pnp) is created with same config as wallet modal; used by generateWalletConnectQr. */
711
+ private getOrCreatePnp;
712
+ /**
713
+ * Pre-generate WalletConnect QR as a data URL. Host can show it in a placeholder (e.g. pay page left column).
714
+ * When user scans and approves, the widget is updated to "connected" so Pay does not open the wallet selector.
715
+ * hostOptions.onConnected is called when the phone wallet connects so the host can show "Connected" etc.
716
+ * Returns the QR image as data URL, or null if WalletConnect is not enabled/available.
717
+ */
718
+ generateWalletConnectQr(hostOptions?: {
719
+ onConnected?: () => void;
720
+ }): Promise<string | null>;
721
+ /**
722
+ * Check if Coinbase/Base wallet is already connected (e.g. user returned from Base app deep link).
723
+ * Host can call this on load when showing Base option on mobile to show "Connected".
724
+ */
725
+ checkCoinbaseConnection(): Promise<boolean>;
726
+ /**
727
+ * Connect a specific wallet by id (e.g. 'coinbase' for Base Wallet deep link on mobile).
728
+ * Host can use this for "Connect with Base" without opening the wallet modal.
729
+ * Resolves when connected; rejects on error.
730
+ */
731
+ connectWallet(walletId: string): Promise<void>;
596
732
  connectedCallback(): void;
597
733
  protected updated(changed: Map<string, unknown>): void;
598
734
  private onSwitchAccount;
@@ -655,6 +791,28 @@ declare class ICPayAmountInput extends LitElement {
655
791
  private onInputChange;
656
792
  private selectSymbol;
657
793
  private isValidAmount;
794
+ /** Ensure WalletSelect (pnp) is created with same config as wallet modal; used by generateWalletConnectQr / connectWallet. */
795
+ private getOrCreatePnp;
796
+ /**
797
+ * Pre-generate WalletConnect QR as a data URL. Host can show it in a placeholder (e.g. pay page left column).
798
+ * When user scans and approves, the widget is updated to "connected" so Pay does not open the wallet selector.
799
+ * hostOptions.onConnected is called when the phone wallet connects so the host can show "Connected" etc.
800
+ * Returns the QR image as data URL, or null if WalletConnect is not enabled/available.
801
+ */
802
+ generateWalletConnectQr(hostOptions?: {
803
+ onConnected?: () => void;
804
+ }): Promise<string | null>;
805
+ /**
806
+ * Check if Coinbase/Base wallet is already connected (e.g. user returned from Base app deep link).
807
+ * Host can call this on load when showing Base option on mobile to show "Connected".
808
+ */
809
+ checkCoinbaseConnection(): Promise<boolean>;
810
+ /**
811
+ * Connect a specific wallet by id (e.g. 'coinbase' for Base Wallet deep link on mobile).
812
+ * Host can use this for "Connect with Base" without opening the wallet modal.
813
+ * Resolves when connected; rejects on error.
814
+ */
815
+ connectWallet(walletId: string): Promise<void>;
658
816
  private ensureWallet;
659
817
  private getWalletId;
660
818
  private getWalletLabel;