@paybutton/react 2.0.3 → 2.1.0
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/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/PayButton/PayButton.d.ts +9 -4
- package/dist/components/PayButton/PayButton.stories.d.ts +10 -0
- package/dist/components/PaymentDialog/PaymentDialog.d.ts +12 -5
- package/dist/components/Widget/Widget.d.ts +10 -6
- package/dist/components/Widget/WidgetContainer.d.ts +12 -8
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/react/src/components/PayButton/PayButton.d.ts +2 -0
- package/dist/react/src/components/PayButton/PayButton.stories.d.ts +10 -0
- package/dist/react/src/components/PaymentDialog/PaymentDialog.d.ts +5 -1
- package/dist/react/src/components/Widget/Widget.d.ts +2 -3
- package/dist/react/src/components/Widget/WidgetContainer.d.ts +5 -3
- package/dist/themes/index.d.ts +3 -2
- package/dist/themes/themes/xec.d.ts +3 -0
- package/dist/util/address.d.ts +7 -2
- package/dist/util/api-client.d.ts +56 -93
- package/dist/util/format.d.ts +7 -2
- package/dist/util/randomizeSats.d.ts +3 -1
- package/dist/util/satoshis.d.ts +3 -11
- package/package.json +2 -2
- package/dist/hooks/useAddressDetails.d.ts +0 -3
- package/dist/react/src/hooks/useAddressDetails.d.ts +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Theme, ThemeName } from '../../themes';
|
|
3
|
-
declare type animation = 'slide' | 'invert' | 'none';
|
|
3
|
+
export declare type animation = 'slide' | 'invert' | 'none';
|
|
4
4
|
export interface ButtonProps {
|
|
5
5
|
animation?: animation;
|
|
6
6
|
text?: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Theme, ThemeName } from '../../themes';
|
|
3
3
|
import { ButtonProps } from '../Button/Button';
|
|
4
|
-
import { currency } from '
|
|
4
|
+
import { currency } from '../../util/api-client';
|
|
5
|
+
import BigNumber from 'bignumber.js';
|
|
5
6
|
export interface PayButtonProps extends ButtonProps {
|
|
6
7
|
to: string;
|
|
7
8
|
amount?: number | string;
|
|
@@ -10,14 +11,18 @@ export interface PayButtonProps extends ButtonProps {
|
|
|
10
11
|
text?: string;
|
|
11
12
|
hoverText?: string;
|
|
12
13
|
successText?: string;
|
|
13
|
-
randomSatoshis?: boolean;
|
|
14
|
+
randomSatoshis?: boolean | number;
|
|
14
15
|
hideToasts?: boolean;
|
|
15
16
|
disabled?: boolean;
|
|
16
17
|
goalAmount?: number | string;
|
|
17
18
|
disableEnforceFocus?: boolean;
|
|
18
19
|
editable?: boolean;
|
|
19
|
-
onSuccess?: (txid: string, amount:
|
|
20
|
-
onTransaction?: (txid: string, amount:
|
|
20
|
+
onSuccess?: (txid: string, amount: BigNumber) => void;
|
|
21
|
+
onTransaction?: (txid: string, amount: BigNumber) => void;
|
|
22
|
+
onOpen?: (expectedAmount?: number | string, address?: string) => void;
|
|
23
|
+
onClose?: (success?: boolean) => void;
|
|
24
|
+
wsBaseUrl?: string;
|
|
25
|
+
apiBaseUrl?: string;
|
|
21
26
|
}
|
|
22
27
|
export declare const PayButton: {
|
|
23
28
|
(props: PayButtonProps): React.ReactElement;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Theme, ThemeName } from '../../themes';
|
|
3
3
|
import { ButtonProps } from '../Button/Button';
|
|
4
|
-
import { currency } from '
|
|
4
|
+
import { currency } from '../../util/api-client';
|
|
5
|
+
import BigNumber from 'bignumber.js';
|
|
6
|
+
import { currencyObject } from '../../util/satoshis';
|
|
5
7
|
export interface PaymentDialogProps extends ButtonProps {
|
|
6
8
|
to: string;
|
|
7
9
|
amount?: number | string;
|
|
10
|
+
setAmount: Function;
|
|
8
11
|
currency?: currency;
|
|
12
|
+
currencyObj?: currencyObject;
|
|
13
|
+
setCurrencyObj: Function;
|
|
9
14
|
theme?: ThemeName | Theme;
|
|
10
15
|
successText?: string;
|
|
11
|
-
randomSatoshis?: boolean;
|
|
16
|
+
randomSatoshis?: boolean | number;
|
|
12
17
|
hideToasts?: boolean;
|
|
13
18
|
goalAmount?: number | string;
|
|
14
19
|
disableEnforceFocus?: boolean;
|
|
@@ -17,9 +22,11 @@ export interface PaymentDialogProps extends ButtonProps {
|
|
|
17
22
|
disableScrollLock?: boolean;
|
|
18
23
|
active?: boolean;
|
|
19
24
|
container?: HTMLElement;
|
|
20
|
-
onClose?: () => void;
|
|
21
|
-
onSuccess?: (txid: string, amount:
|
|
22
|
-
onTransaction?: (txid: string, amount:
|
|
25
|
+
onClose?: (success?: boolean) => void;
|
|
26
|
+
onSuccess?: (txid: string, amount: BigNumber) => void;
|
|
27
|
+
onTransaction?: (txid: string, amount: BigNumber) => void;
|
|
28
|
+
wsBaseUrl?: string;
|
|
29
|
+
apiBaseUrl?: string;
|
|
23
30
|
}
|
|
24
31
|
export declare const PaymentDialog: {
|
|
25
32
|
(props: PaymentDialogProps): React.ReactElement;
|
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Theme, ThemeName } from '../../themes';
|
|
3
|
+
import { animation } from '../Button/Button';
|
|
3
4
|
import { currencyObject } from '../../util/satoshis';
|
|
4
|
-
import {
|
|
5
|
-
export declare type cryptoCurrency = 'BCH' | 'SAT' | 'bits';
|
|
6
|
-
export declare type currency = cryptoCurrency | fiatCurrency;
|
|
5
|
+
import { currency, Transaction } from '../../util/api-client';
|
|
7
6
|
export interface WidgetProps {
|
|
8
7
|
to: string;
|
|
9
8
|
amount?: number | null | string;
|
|
9
|
+
setAmount?: Function;
|
|
10
10
|
text?: string;
|
|
11
11
|
ButtonComponent?: React.ComponentType;
|
|
12
|
-
loading: boolean;
|
|
13
12
|
success: boolean;
|
|
14
13
|
successText?: string;
|
|
15
14
|
theme?: ThemeName | Theme;
|
|
16
15
|
foot?: React.ReactNode;
|
|
17
16
|
disabled: boolean;
|
|
18
|
-
totalReceived?: number | null;
|
|
19
17
|
goalAmount?: number | string | null;
|
|
20
18
|
currency?: currency;
|
|
19
|
+
animation?: animation;
|
|
21
20
|
currencyObject?: currencyObject | undefined;
|
|
22
|
-
|
|
21
|
+
setCurrencyObject?: Function;
|
|
22
|
+
randomSatoshis?: boolean | number;
|
|
23
23
|
price?: number;
|
|
24
24
|
editable?: boolean;
|
|
25
|
+
setNewTxs: Function;
|
|
26
|
+
newTxs?: Transaction[];
|
|
27
|
+
wsBaseUrl?: string;
|
|
28
|
+
apiBaseUrl?: string;
|
|
25
29
|
}
|
|
26
30
|
export declare const Widget: React.FC<WidgetProps>;
|
|
27
31
|
export default Widget;
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { currency } from '../../util/api-client';
|
|
3
|
+
import { currencyObject } from '../../util/satoshis';
|
|
3
4
|
import { WidgetProps } from './Widget';
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export interface WidgetContainerProps extends Omit<Omit<WidgetProps, 'loading'>, 'success'> {
|
|
5
|
+
import BigNumber from 'bignumber.js';
|
|
6
|
+
export interface WidgetContainerProps extends Omit<WidgetProps, 'success' | 'setNewTxs' | 'setCurrencyObject'> {
|
|
7
7
|
active?: boolean;
|
|
8
8
|
amount?: number;
|
|
9
9
|
currency?: currency;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
currencyObj?: currencyObject;
|
|
11
|
+
setCurrencyObj: Function;
|
|
12
|
+
randomSatoshis?: boolean | number;
|
|
12
13
|
hideToasts?: boolean;
|
|
13
|
-
onSuccess?: (txid: string, amount:
|
|
14
|
-
onTransaction?: (txid: string, amount:
|
|
14
|
+
onSuccess?: (txid: string, amount: BigNumber) => void;
|
|
15
|
+
onTransaction?: (txid: string, amount: BigNumber) => void;
|
|
15
16
|
sound?: boolean;
|
|
16
17
|
goalAmount?: number | string;
|
|
17
18
|
disabled: boolean;
|
|
18
19
|
editable: boolean;
|
|
20
|
+
wsBaseUrl?: string;
|
|
21
|
+
apiBaseUrl?: string;
|
|
22
|
+
successText?: string;
|
|
19
23
|
}
|
|
20
24
|
export interface Output {
|
|
21
25
|
index: number;
|