@ton-pay/ui-react 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @ton-pay/ui-react
2
2
 
3
- React components and hooks for TonPay SDK.
3
+ React components and hooks for TON Pay SDK.
4
4
 
5
5
  ## Documentation
6
6
 
@@ -9,7 +9,7 @@ Full documentation: https://docs.tonpay.tech
9
9
  ## Installation
10
10
 
11
11
  ```bash
12
- npm install @ton-pay/ui @tonconnect/ui-react
12
+ npm install @ton-pay/ui-react @tonconnect/ui-react
13
13
  ```
14
14
 
15
15
  ## Quick Start
@@ -29,7 +29,7 @@ function PaymentForm() {
29
29
  {
30
30
  amount: 10.5,
31
31
  asset: TON,
32
- recipientAddr: "EQC...",
32
+ recipientAddr: "EQC...", // Optional if API key is provided
33
33
  senderAddr,
34
34
  commentToSender: "Payment for order #123",
35
35
  },
@@ -76,7 +76,7 @@ function PaymentComponent() {
76
76
  {
77
77
  amount: 10.5,
78
78
  asset: TON,
79
- recipientAddr: "EQC...",
79
+ recipientAddr: "EQC...", // Optional if API key is provided
80
80
  senderAddr,
81
81
  commentToSender: "Payment for order #123",
82
82
  },
package/dist/index.d.mts CHANGED
@@ -6,6 +6,8 @@ type TonPayButtonProps = {
6
6
  isLoading?: boolean;
7
7
  variant?: "long" | "short";
8
8
  preset?: TonPayPreset;
9
+ onError?: (error: unknown) => void;
10
+ showErrorNotification?: boolean;
9
11
  bgColor?: string;
10
12
  textColor?: string;
11
13
  borderRadius?: number | string;
@@ -19,7 +21,7 @@ type TonPayButtonProps = {
19
21
  showMenu?: boolean;
20
22
  disabled?: boolean;
21
23
  };
22
- declare const TonPayButton: ({ handlePay, isLoading, variant, preset, bgColor, textColor, borderRadius, fontFamily, width, height, text, loadingText, style, className, showMenu, disabled, }: TonPayButtonProps) => JSX.Element;
24
+ declare const TonPayButton: ({ handlePay, isLoading, variant, preset, bgColor, textColor, borderRadius, fontFamily, width, height, text, loadingText, style, className, showMenu, disabled, onError, showErrorNotification, }: TonPayButtonProps) => JSX.Element;
23
25
 
24
26
  type NotificationProps = {
25
27
  title: string;
package/dist/index.d.ts CHANGED
@@ -6,6 +6,8 @@ type TonPayButtonProps = {
6
6
  isLoading?: boolean;
7
7
  variant?: "long" | "short";
8
8
  preset?: TonPayPreset;
9
+ onError?: (error: unknown) => void;
10
+ showErrorNotification?: boolean;
9
11
  bgColor?: string;
10
12
  textColor?: string;
11
13
  borderRadius?: number | string;
@@ -19,7 +21,7 @@ type TonPayButtonProps = {
19
21
  showMenu?: boolean;
20
22
  disabled?: boolean;
21
23
  };
22
- declare const TonPayButton: ({ handlePay, isLoading, variant, preset, bgColor, textColor, borderRadius, fontFamily, width, height, text, loadingText, style, className, showMenu, disabled, }: TonPayButtonProps) => JSX.Element;
24
+ declare const TonPayButton: ({ handlePay, isLoading, variant, preset, bgColor, textColor, borderRadius, fontFamily, width, height, text, loadingText, style, className, showMenu, disabled, onError, showErrorNotification, }: TonPayButtonProps) => JSX.Element;
23
25
 
24
26
  type NotificationProps = {
25
27
  title: string;