@paybutton/react 2.0.0 → 2.0.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
  # @paybutton/react
2
2
 
3
- > The easiest way to accept Bitcoin Cash online
3
+ > The easiest way to accept eCash online
4
4
 
5
5
  [![NPM](https://img.shields.io/npm/v/@paybutton/react.svg)](https://www.npmjs.com/package/@paybutton/react)
6
6
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Theme, ThemeName } from '../../themes';
3
- export declare type animation = 'slide' | 'invert' | 'none';
3
+ declare type animation = 'slide' | 'invert' | 'none';
4
4
  export interface ButtonProps {
5
5
  animation?: animation;
6
6
  text?: string;
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Theme, ThemeName } from '../../themes';
3
3
  import { ButtonProps } from '../Button/Button';
4
- import { currency } from '../../util/api-client';
5
- import BigNumber from 'bignumber.js';
4
+ import { currency } from '../Widget/WidgetContainer';
6
5
  export interface PayButtonProps extends ButtonProps {
7
6
  to: string;
8
7
  amount?: number | string;
@@ -17,10 +16,8 @@ export interface PayButtonProps extends ButtonProps {
17
16
  goalAmount?: number | string;
18
17
  disableEnforceFocus?: boolean;
19
18
  editable?: boolean;
20
- onSuccess?: (txid: string, amount: BigNumber) => void;
21
- onTransaction?: (txid: string, amount: BigNumber) => void;
22
- wsBaseUrl?: string;
23
- apiBaseUrl?: string;
19
+ onSuccess?: (txid: string, amount: number) => void;
20
+ onTransaction?: (txid: string, amount: number) => void;
24
21
  }
25
22
  export declare const PayButton: {
26
23
  (props: PayButtonProps): React.ReactElement;
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Theme, ThemeName } from '../../themes';
3
3
  import { ButtonProps } from '../Button/Button';
4
- import { currency } from '../../util/api-client';
5
- import BigNumber from 'bignumber.js';
4
+ import { currency } from '../Widget/WidgetContainer';
6
5
  export interface PaymentDialogProps extends ButtonProps {
7
6
  to: string;
8
7
  amount?: number | string;
@@ -19,10 +18,8 @@ export interface PaymentDialogProps extends ButtonProps {
19
18
  active?: boolean;
20
19
  container?: HTMLElement;
21
20
  onClose?: () => void;
22
- onSuccess?: (txid: string, amount: BigNumber) => void;
23
- onTransaction?: (txid: string, amount: BigNumber) => void;
24
- wsBaseUrl?: string;
25
- apiBaseUrl?: string;
21
+ onSuccess?: (txid: string, amount: number) => void;
22
+ onTransaction?: (txid: string, amount: number) => void;
26
23
  }
27
24
  export declare const PaymentDialog: {
28
25
  (props: PaymentDialogProps): React.ReactElement;
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { Theme, ThemeName } from '../../themes';
3
- import { animation } from '../Button/Button';
4
3
  import { currencyObject } from '../../util/satoshis';
5
- import { currency, Transaction } from '../../util/api-client';
4
+ import { fiatCurrency } from '../../util/api-client';
5
+ export declare type cryptoCurrency = 'BCH' | 'SAT' | 'bits';
6
+ export declare type currency = cryptoCurrency | fiatCurrency;
6
7
  export interface WidgetProps {
7
8
  to: string;
8
9
  amount?: number | null | string;
@@ -14,17 +15,13 @@ export interface WidgetProps {
14
15
  theme?: ThemeName | Theme;
15
16
  foot?: React.ReactNode;
16
17
  disabled: boolean;
18
+ totalReceived?: number | null;
17
19
  goalAmount?: number | string | null;
18
20
  currency?: currency;
19
- animation?: animation;
20
21
  currencyObject?: currencyObject | undefined;
21
22
  randomSatoshis?: boolean;
22
23
  price?: number;
23
24
  editable?: boolean;
24
- setNewTxs: Function;
25
- newTxs?: Transaction[];
26
- wsBaseUrl?: string;
27
- apiBaseUrl?: string;
28
25
  }
29
26
  export declare const Widget: React.FC<WidgetProps>;
30
27
  export default Widget;
@@ -1,22 +1,21 @@
1
1
  import React from 'react';
2
- import { cryptoCurrency, currency } from '../../util/api-client';
2
+ import { fiatCurrency } from '../../util/api-client';
3
3
  import { WidgetProps } from './Widget';
4
- import BigNumber from 'bignumber.js';
5
- export interface WidgetContainerProps extends Omit<WidgetProps, 'loading' | 'success' | 'setNewTxs'> {
4
+ export declare type cryptoCurrency = 'BCH' | 'SAT' | 'bits';
5
+ export declare type currency = cryptoCurrency | fiatCurrency;
6
+ export interface WidgetContainerProps extends Omit<Omit<WidgetProps, 'loading'>, 'success'> {
6
7
  active?: boolean;
7
8
  amount?: number;
8
9
  currency?: currency;
9
10
  randomSatoshis?: boolean;
10
11
  displayCurrency?: cryptoCurrency;
11
12
  hideToasts?: boolean;
12
- onSuccess?: (txid: string, amount: BigNumber) => void;
13
- onTransaction?: (txid: string, amount: BigNumber) => void;
13
+ onSuccess?: (txid: string, amount: number) => void;
14
+ onTransaction?: (txid: string, amount: number) => void;
14
15
  sound?: boolean;
15
16
  goalAmount?: number | string;
16
17
  disabled: boolean;
17
18
  editable: boolean;
18
- wsBaseUrl?: string;
19
- apiBaseUrl?: string;
20
19
  }
21
20
  export interface Output {
22
21
  index: number;
@@ -1,3 +1,3 @@
1
- import { Transaction } from '../util/api-client';
2
- export declare const useAddressDetails: (address: string, active?: boolean) => Transaction[] | undefined;
1
+ import { AddressDetails } from '../util/api-client';
2
+ export declare const useAddressDetails: (address: string, active?: boolean) => AddressDetails | undefined;
3
3
  export default useAddressDetails;