@ic-pay/icpay-widget 1.1.56 → 1.2.17

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.
@@ -30,14 +30,18 @@ type PlugNPlayConfig = {
30
30
  };
31
31
  type ProgressBarConfig = {
32
32
  enabled?: boolean;
33
- mode?: 'modal' | 'horizontal' | 'vertical' | 'inline';
34
33
  };
35
34
  type CommonConfig = {
36
35
  publishableKey: string;
37
36
  apiUrl?: string;
38
37
  icHost?: string;
38
+ evmProvider?: any;
39
+ description?: string;
39
40
  chainName?: string;
40
41
  chainId?: number;
42
+ chainShortcodes?: string[];
43
+ tokenShortcodes?: string[];
44
+ chainTypes?: Array<'ic' | 'evm'>;
41
45
  metadata?: Record<string, any>;
42
46
  derivationOrigin?: string;
43
47
  actorProvider?: (canisterId: string, idl: any) => any;
@@ -49,21 +53,13 @@ type CommonConfig = {
49
53
  progressBar?: ProgressBarConfig;
50
54
  disablePaymentButton?: boolean;
51
55
  disableAfterSuccess?: boolean;
52
- showLedgerDropdown?: 'buttons' | 'dropdown' | 'none';
53
56
  onrampDisabled?: boolean;
54
57
  onramp?: OnrampConfig;
55
58
  };
56
- type CryptoOption = {
57
- symbol: string;
58
- label: string;
59
- canisterId?: string;
60
- };
61
59
  type PremiumContentConfig = CommonConfig & {
62
60
  priceUsd: number;
63
- cryptoOptions?: CryptoOption[];
64
61
  imageUrl?: string;
65
62
  buttonLabel?: string;
66
- defaultSymbol?: string;
67
63
  onSuccess?: (tx: {
68
64
  id: number;
69
65
  status: string;
@@ -72,9 +68,6 @@ type PremiumContentConfig = CommonConfig & {
72
68
  type TipJarConfig = CommonConfig & {
73
69
  amountsUsd?: number[];
74
70
  defaultAmountUsd?: number;
75
- cryptoOptions?: CryptoOption[];
76
- defaultSymbol?: string;
77
- showLedgerDropdown?: string;
78
71
  buttonLabel?: string;
79
72
  onSuccess?: (tx: {
80
73
  id: number;
@@ -84,12 +77,10 @@ type TipJarConfig = CommonConfig & {
84
77
  };
85
78
  type ArticlePaywallConfig = CommonConfig & {
86
79
  priceUsd: number;
87
- cryptoOptions?: CryptoOption[];
88
80
  title?: string;
89
81
  preview?: string;
90
82
  lockedContent?: string;
91
83
  buttonLabel?: string;
92
- defaultSymbol?: string;
93
84
  onSuccess?: (tx: {
94
85
  id: number;
95
86
  status: string;
@@ -101,9 +92,7 @@ type CoffeeShopConfig = CommonConfig & {
101
92
  priceUsd: number;
102
93
  }>;
103
94
  defaultItemIndex?: number;
104
- cryptoOptions?: CryptoOption[];
105
95
  buttonLabel?: string;
106
- defaultSymbol?: string;
107
96
  onSuccess?: (tx: {
108
97
  id: number;
109
98
  status: string;
@@ -114,9 +103,7 @@ type DonationThermometerConfig = CommonConfig & {
114
103
  goalUsd: number;
115
104
  defaultAmountUsd?: number;
116
105
  amountsUsd?: number[];
117
- cryptoOptions?: CryptoOption[];
118
106
  buttonLabel?: string;
119
- defaultSymbol?: string;
120
107
  onSuccess?: (tx: {
121
108
  id: number;
122
109
  status: string;
@@ -134,9 +121,6 @@ type OnrampConfig = {
134
121
  };
135
122
  type PayButtonConfig = CommonConfig & {
136
123
  amountUsd?: number;
137
- cryptoOptions?: CryptoOption[];
138
- showLedgerDropdown?: string;
139
- defaultSymbol?: string;
140
124
  buttonLabel?: string;
141
125
  onSuccess?: (tx: {
142
126
  id: number;
@@ -146,9 +130,6 @@ type PayButtonConfig = CommonConfig & {
146
130
  type AmountInputConfig = CommonConfig & {
147
131
  placeholder?: string;
148
132
  defaultAmountUsd?: number;
149
- cryptoOptions?: CryptoOption[];
150
- showLedgerDropdown?: string;
151
- defaultSymbol?: string;
152
133
  minUsd?: number;
153
134
  maxUsd?: number;
154
135
  stepUsd?: number;
@@ -172,6 +153,7 @@ type Step = {
172
153
  declare class ICPayProgressBar extends LitElement {
173
154
  static styles: lit.CSSResult;
174
155
  open: boolean;
156
+ suspended: boolean;
175
157
  steps: Step[];
176
158
  amount: number;
177
159
  currency: string;
@@ -238,12 +220,14 @@ declare class ICPayProgressBar extends LitElement {
238
220
  private handleAddFunds;
239
221
  private startTransitionToProgress;
240
222
  private renderProgressContent;
223
+ private onWalletCancelled;
224
+ private onWalletError;
241
225
  private renderConfirmTip;
242
226
  private retryTransaction;
243
227
  private closeProgress;
244
228
  private renderStep;
245
229
  private get isWalletConnectLoading();
246
- render(): lit.TemplateResult<1>;
230
+ render(): any;
247
231
  }
248
232
  declare global {
249
233
  interface HTMLElementTagNameMap {
@@ -251,39 +235,6 @@ declare global {
251
235
  }
252
236
  }
253
237
 
254
- declare class ICPayTokenSelector extends LitElement {
255
- static styles: lit.CSSResult;
256
- options: CryptoOption[];
257
- value: string | null;
258
- defaultSymbol: string;
259
- mode: 'buttons' | 'dropdown' | 'none';
260
- theme?: {
261
- primaryColor?: string;
262
- secondaryColor?: string;
263
- };
264
- open: boolean;
265
- showLabel: boolean;
266
- private triggerEl?;
267
- private wrapperEl?;
268
- private menuPos;
269
- connectedCallback(): void;
270
- updated(changed: Map<string, unknown>): void;
271
- firstUpdated(): void;
272
- disconnectedCallback(): void;
273
- private get effectiveSymbol();
274
- private getOptionBySymbol;
275
- private getLogoUrl;
276
- private onSelect;
277
- private toggleDropdown;
278
- private closeDropdown;
279
- render(): lit.TemplateResult<1>;
280
- }
281
- declare global {
282
- interface HTMLElementTagNameMap {
283
- 'icpay-token-selector': ICPayTokenSelector;
284
- }
285
- }
286
-
287
238
  declare class ICPayPremiumContent extends LitElement {
288
239
  static styles: lit.CSSResult[];
289
240
  config: PremiumContentConfig;
@@ -291,7 +242,6 @@ declare class ICPayPremiumContent extends LitElement {
291
242
  private unlocked;
292
243
  private succeeded;
293
244
  private processing;
294
- private availableLedgers;
295
245
  private errorMessage;
296
246
  private errorSeverity;
297
247
  private errorAction;
@@ -309,12 +259,15 @@ declare class ICPayPremiumContent extends LitElement {
309
259
  private onrampPollTimer;
310
260
  private onrampPollingActive;
311
261
  private onrampNotifyController;
262
+ private showBalanceModal;
263
+ private balancesLoading;
264
+ private balancesError;
265
+ private walletBalances;
266
+ private sdk;
312
267
  private tryAutoConnectPNP;
313
- private get cryptoOptions();
314
268
  connectedCallback(): void;
315
269
  protected updated(changed: Map<string, unknown>): void;
316
270
  private onSwitchAccount;
317
- private loadVerifiedLedgers;
318
271
  private onPay;
319
272
  private attachTransakMessageListener;
320
273
  private detachTransakMessageListener;
@@ -327,6 +280,8 @@ declare class ICPayPremiumContent extends LitElement {
327
280
  private getWalletLabel;
328
281
  private getWalletIcon;
329
282
  private connectWithWallet;
283
+ private fetchAndShowBalances;
284
+ private onSelectBalanceSymbol;
330
285
  render(): lit.TemplateResult<1>;
331
286
  }
332
287
  declare global {
@@ -343,7 +298,6 @@ declare class ICPayTipJar extends LitElement {
343
298
  private total;
344
299
  private processing;
345
300
  private succeeded;
346
- private availableLedgers;
347
301
  private errorMessage;
348
302
  private errorSeverity;
349
303
  private errorAction;
@@ -361,13 +315,16 @@ declare class ICPayTipJar extends LitElement {
361
315
  private onrampPollTimer;
362
316
  private onrampPollingActive;
363
317
  private onrampNotifyController;
318
+ private sdk;
319
+ private showBalanceModal;
320
+ private balancesLoading;
321
+ private balancesError;
322
+ private walletBalances;
364
323
  private tryAutoConnectPNP;
365
324
  private get amounts();
366
- private get cryptoOptions();
367
325
  connectedCallback(): void;
368
326
  protected updated(changed: Map<string, unknown>): void;
369
327
  private onSwitchAccount;
370
- private loadVerifiedLedgers;
371
328
  private selectAmount;
372
329
  private selectSymbol;
373
330
  private get fillPercentage();
@@ -382,6 +339,8 @@ declare class ICPayTipJar extends LitElement {
382
339
  private getWalletLabel;
383
340
  private getWalletIcon;
384
341
  private connectWithWallet;
342
+ private fetchAndShowBalances;
343
+ private onSelectBalanceSymbol;
385
344
  render(): lit.TemplateResult<1>;
386
345
  }
387
346
  declare global {
@@ -401,7 +360,6 @@ declare class ICPayArticlePaywall extends LitElement {
401
360
  private unlocked;
402
361
  private succeeded;
403
362
  private processing;
404
- private availableLedgers;
405
363
  private errorMessage;
406
364
  private errorSeverity;
407
365
  private errorAction;
@@ -419,6 +377,11 @@ declare class ICPayArticlePaywall extends LitElement {
419
377
  private onrampPollTimer;
420
378
  private onrampPollingActive;
421
379
  private onrampNotifyController;
380
+ private showBalanceModal;
381
+ private balancesLoading;
382
+ private balancesError;
383
+ private walletBalances;
384
+ private sdk;
422
385
  private tryAutoConnectPNP;
423
386
  private attachTransakMessageListener;
424
387
  private detachTransakMessageListener;
@@ -426,17 +389,17 @@ declare class ICPayArticlePaywall extends LitElement {
426
389
  private startOnramp;
427
390
  private createOnrampIntent;
428
391
  private startOnrampPolling;
429
- private get cryptoOptions();
430
392
  connectedCallback(): void;
431
393
  protected updated(changed: Map<string, unknown>): void;
432
394
  private onSwitchAccount;
433
- private loadVerifiedLedgers;
434
395
  private selectSymbol;
435
396
  private unlock;
436
397
  private getWalletId;
437
398
  private getWalletLabel;
438
399
  private getWalletIcon;
439
400
  private connectWithWallet;
401
+ private fetchAndShowBalances;
402
+ private onSelectBalanceSymbol;
440
403
  render(): lit.TemplateResult<1>;
441
404
  }
442
405
  declare global {
@@ -451,7 +414,6 @@ declare class ICPayCoffeeShop extends LitElement {
451
414
  private selectedIndex;
452
415
  private selectedSymbol;
453
416
  private processing;
454
- private availableLedgers;
455
417
  private errorMessage;
456
418
  private errorSeverity;
457
419
  private errorAction;
@@ -469,11 +431,14 @@ declare class ICPayCoffeeShop extends LitElement {
469
431
  private onrampPollTimer;
470
432
  private onrampPollingActive;
471
433
  private onrampNotifyController;
472
- private get cryptoOptions();
434
+ private sdk;
435
+ private showBalanceModal;
436
+ private balancesLoading;
437
+ private balancesError;
438
+ private walletBalances;
473
439
  connectedCallback(): void;
474
440
  protected updated(changed: Map<string, unknown>): void;
475
441
  private onSwitchAccount;
476
- private loadVerifiedLedgers;
477
442
  private selectItem;
478
443
  private selectSymbol;
479
444
  private get selectedItem();
@@ -488,6 +453,8 @@ declare class ICPayCoffeeShop extends LitElement {
488
453
  private getWalletLabel;
489
454
  private getWalletIcon;
490
455
  private connectWithWallet;
456
+ private fetchAndShowBalances;
457
+ private onSelectBalanceSymbol;
491
458
  render(): lit.TemplateResult<1>;
492
459
  }
493
460
  declare global {
@@ -504,7 +471,6 @@ declare class ICPayDonationThermometer extends LitElement {
504
471
  private raised;
505
472
  private processing;
506
473
  private succeeded;
507
- private availableLedgers;
508
474
  private errorMessage;
509
475
  private errorSeverity;
510
476
  private errorAction;
@@ -522,13 +488,16 @@ declare class ICPayDonationThermometer extends LitElement {
522
488
  private onrampPollTimer;
523
489
  private onrampPollingActive;
524
490
  private onrampNotifyController;
491
+ private sdk;
492
+ private showBalanceModal;
493
+ private balancesLoading;
494
+ private balancesError;
495
+ private walletBalances;
525
496
  private tryAutoConnectPNP;
526
497
  private get amounts();
527
- private get cryptoOptions();
528
498
  connectedCallback(): void;
529
499
  protected updated(changed: Map<string, unknown>): void;
530
500
  private onSwitchAccount;
531
- private loadVerifiedLedgers;
532
501
  private selectAmount;
533
502
  private selectSymbol;
534
503
  private get fillPercentage();
@@ -543,6 +512,8 @@ declare class ICPayDonationThermometer extends LitElement {
543
512
  private getWalletLabel;
544
513
  private getWalletIcon;
545
514
  private connectWithWallet;
515
+ private fetchAndShowBalances;
516
+ private onSelectBalanceSymbol;
546
517
  render(): lit.TemplateResult<1>;
547
518
  }
548
519
  declare global {
@@ -557,13 +528,13 @@ declare class ICPayPayButton extends LitElement {
557
528
  private selectedSymbol;
558
529
  private processing;
559
530
  private succeeded;
560
- private availableLedgers;
561
531
  private errorMessage;
562
532
  private errorSeverity;
563
533
  private errorAction;
564
534
  private walletConnected;
565
535
  private pendingAction;
566
536
  private showWalletModal;
537
+ private walletModalStep;
567
538
  private showOnrampModal;
568
539
  private onrampSessionId;
569
540
  private onrampPaymentIntentId;
@@ -572,6 +543,10 @@ declare class ICPayPayButton extends LitElement {
572
543
  private oisySignerPreopened;
573
544
  private skipDisconnectOnce;
574
545
  private lastWalletId;
546
+ private showBalanceModal;
547
+ private balancesLoading;
548
+ private balancesError;
549
+ private walletBalances;
575
550
  private onrampPollTimer;
576
551
  private transakMessageHandlerBound;
577
552
  private pnp;
@@ -580,17 +555,17 @@ declare class ICPayPayButton extends LitElement {
580
555
  private onrampPollingActive;
581
556
  private onrampNotifyController;
582
557
  private getSdk;
583
- private get cryptoOptions();
584
558
  connectedCallback(): void;
585
559
  protected updated(changed: Map<string, unknown>): void;
586
560
  private onSwitchAccount;
587
- private loadVerifiedLedgers;
588
561
  private selectSymbol;
589
562
  private ensureWallet;
590
563
  private getWalletId;
591
564
  private getWalletLabel;
592
565
  private getWalletIcon;
593
566
  private connectWithWallet;
567
+ private fetchAndShowBalances;
568
+ private onSelectBalanceSymbol;
594
569
  private renderWalletModal;
595
570
  private startOnramp;
596
571
  private createOnrampIntent;
@@ -615,7 +590,6 @@ declare class ICPayAmountInput extends LitElement {
615
590
  private selectedSymbol;
616
591
  private processing;
617
592
  private succeeded;
618
- private availableLedgers;
619
593
  private errorMessage;
620
594
  private errorSeverity;
621
595
  private errorAction;
@@ -633,11 +607,14 @@ declare class ICPayAmountInput extends LitElement {
633
607
  private onrampPollTimer;
634
608
  private onrampPollingActive;
635
609
  private onrampNotifyController;
636
- private get cryptoOptions();
610
+ private showBalanceModal;
611
+ private balancesLoading;
612
+ private balancesError;
613
+ private walletBalances;
614
+ private sdk;
637
615
  connectedCallback(): void;
638
616
  protected updated(changed: Map<string, unknown>): void;
639
617
  private onSwitchAccount;
640
- private loadVerifiedLedgers;
641
618
  private onInputChange;
642
619
  private selectSymbol;
643
620
  private isValidAmount;
@@ -646,6 +623,8 @@ declare class ICPayAmountInput extends LitElement {
646
623
  private getWalletLabel;
647
624
  private getWalletIcon;
648
625
  private connectWithWallet;
626
+ private fetchAndShowBalances;
627
+ private onSelectBalanceSymbol;
649
628
  private attachTransakMessageListener;
650
629
  private detachTransakMessageListener;
651
630
  private onTransakMessage;
@@ -661,4 +640,4 @@ declare global {
661
640
  }
662
641
  }
663
642
 
664
- export { type ArticlePaywallConfig as A, type CommonConfig as C, type DonationThermometerConfig as D, ICPayPremiumContent as I, type OnrampConfig as O, type PlugNPlayConfig as P, type ThemeConfig as T, type ProgressBarConfig as a, type CryptoOption as b, type PremiumContentConfig as c, type TipJarConfig as d, type CoffeeShopConfig as e, type PayButtonConfig as f, type AmountInputConfig as g, ICPayTipJar as h, ICPayArticlePaywall as i, ICPayCoffeeShop as j, ICPayDonationThermometer as k, ICPayPayButton as l, ICPayAmountInput as m };
643
+ export { type ArticlePaywallConfig as A, type CommonConfig as C, type DonationThermometerConfig as D, ICPayPremiumContent as I, type OnrampConfig as O, type PlugNPlayConfig as P, type ThemeConfig as T, type ProgressBarConfig as a, type PremiumContentConfig as b, type TipJarConfig as c, type CoffeeShopConfig as d, type PayButtonConfig as e, type AmountInputConfig as f, ICPayTipJar as g, ICPayArticlePaywall as h, ICPayCoffeeShop as i, ICPayDonationThermometer as j, ICPayPayButton as k, ICPayAmountInput as l };