@paybutton/react 2.0.4 → 2.1.1

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.
@@ -11,7 +11,7 @@ export interface PayButtonProps extends ButtonProps {
11
11
  text?: string;
12
12
  hoverText?: string;
13
13
  successText?: string;
14
- randomSatoshis?: boolean;
14
+ randomSatoshis?: boolean | number;
15
15
  hideToasts?: boolean;
16
16
  disabled?: boolean;
17
17
  goalAmount?: number | string;
@@ -19,6 +19,8 @@ export interface PayButtonProps extends ButtonProps {
19
19
  editable?: boolean;
20
20
  onSuccess?: (txid: string, amount: BigNumber) => void;
21
21
  onTransaction?: (txid: string, amount: BigNumber) => void;
22
+ onOpen?: (expectedAmount?: number | string, address?: string) => void;
23
+ onClose?: (success?: boolean) => void;
22
24
  wsBaseUrl?: string;
23
25
  apiBaseUrl?: string;
24
26
  }
@@ -26,6 +26,16 @@ declare const _default: {
26
26
  disable: boolean;
27
27
  };
28
28
  };
29
+ onOpen: {
30
+ table: {
31
+ disable: boolean;
32
+ };
33
+ };
34
+ onClose: {
35
+ table: {
36
+ disable: boolean;
37
+ };
38
+ };
29
39
  onTransaction: {
30
40
  table: {
31
41
  disable: boolean;
@@ -3,13 +3,17 @@ import { Theme, ThemeName } from '../../themes';
3
3
  import { ButtonProps } from '../Button/Button';
4
4
  import { currency } from '../../util/api-client';
5
5
  import BigNumber from 'bignumber.js';
6
+ import { currencyObject } from '../../util/satoshis';
6
7
  export interface PaymentDialogProps extends ButtonProps {
7
8
  to: string;
8
9
  amount?: number | string;
10
+ setAmount: Function;
9
11
  currency?: currency;
12
+ currencyObj?: currencyObject;
13
+ setCurrencyObj: Function;
10
14
  theme?: ThemeName | Theme;
11
15
  successText?: string;
12
- randomSatoshis?: boolean;
16
+ randomSatoshis?: boolean | number;
13
17
  hideToasts?: boolean;
14
18
  goalAmount?: number | string;
15
19
  disableEnforceFocus?: boolean;
@@ -18,7 +22,7 @@ export interface PaymentDialogProps extends ButtonProps {
18
22
  disableScrollLock?: boolean;
19
23
  active?: boolean;
20
24
  container?: HTMLElement;
21
- onClose?: () => void;
25
+ onClose?: (success?: boolean) => void;
22
26
  onSuccess?: (txid: string, amount: BigNumber) => void;
23
27
  onTransaction?: (txid: string, amount: BigNumber) => void;
24
28
  wsBaseUrl?: string;
@@ -6,9 +6,9 @@ import { currency, Transaction } from '../../util/api-client';
6
6
  export interface WidgetProps {
7
7
  to: string;
8
8
  amount?: number | null | string;
9
+ setAmount?: Function;
9
10
  text?: string;
10
11
  ButtonComponent?: React.ComponentType;
11
- loading: boolean;
12
12
  success: boolean;
13
13
  successText?: string;
14
14
  theme?: ThemeName | Theme;
@@ -18,7 +18,8 @@ export interface WidgetProps {
18
18
  currency?: currency;
19
19
  animation?: animation;
20
20
  currencyObject?: currencyObject | undefined;
21
- randomSatoshis?: boolean;
21
+ setCurrencyObject?: Function;
22
+ randomSatoshis?: boolean | number;
22
23
  price?: number;
23
24
  editable?: boolean;
24
25
  setNewTxs: Function;
@@ -1,13 +1,15 @@
1
1
  import React from 'react';
2
- import { cryptoCurrency, currency } from '../../util/api-client';
2
+ import { currency } from '../../util/api-client';
3
+ import { currencyObject } from '../../util/satoshis';
3
4
  import { WidgetProps } from './Widget';
4
5
  import BigNumber from 'bignumber.js';
5
- export interface WidgetContainerProps extends Omit<WidgetProps, 'loading' | 'success' | 'setNewTxs'> {
6
+ export interface WidgetContainerProps extends Omit<WidgetProps, 'success' | 'setNewTxs' | 'setCurrencyObject'> {
6
7
  active?: boolean;
7
8
  amount?: number;
8
9
  currency?: currency;
9
- randomSatoshis?: boolean;
10
- displayCurrency?: cryptoCurrency;
10
+ currencyObj?: currencyObject;
11
+ setCurrencyObj: Function;
12
+ randomSatoshis?: boolean | number;
11
13
  hideToasts?: boolean;
12
14
  onSuccess?: (txid: string, amount: BigNumber) => void;
13
15
  onTransaction?: (txid: string, amount: BigNumber) => void;
@@ -17,6 +19,7 @@ export interface WidgetContainerProps extends Omit<WidgetProps, 'loading' | 'suc
17
19
  editable: boolean;
18
20
  wsBaseUrl?: string;
19
21
  apiBaseUrl?: string;
22
+ successText?: string;
20
23
  }
21
24
  export interface Output {
22
25
  index: number;