@paybutton/react 5.1.0 → 5.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.
@@ -60,9 +60,11 @@ export interface PaymentDialogProps extends ButtonProps {
60
60
  newTxs?: Transaction[];
61
61
  autoClose?: boolean | number | string;
62
62
  disableSound?: boolean;
63
- transactionText?: string;
64
63
  donationAddress?: string;
65
64
  donationRate?: number;
65
+ transactionText?: string;
66
+ convertedCurrencyObj?: CurrencyObject;
67
+ setConvertedCurrencyObj?: Function;
66
68
  }
67
- export declare const PaymentDialog: ({ to, amount, setAmount, opReturn, paymentId, disablePaymentId, currency, currencyObj, setCurrencyObj, cryptoAmount, price, successText, animation, randomSatoshis, hideToasts, onClose, onSuccess, onTransaction, goalAmount, disableEnforceFocus, editable, dialogOpen, setDialogOpen, container, wsBaseUrl, apiBaseUrl, hoverText, disableAltpayment, contributionOffset, autoClose, useAltpayment, setUseAltpayment, setTxsSocket, txsSocket, setAltpaymentSocket, altpaymentSocket, setCoins, coins, setCoinPair, coinPair, setLoadingPair, loadingPair, setAltpaymentShift, altpaymentShift, setLoadingShift, loadingShift, setAltpaymentError, altpaymentError, addressType, newTxs, setNewTxs, setAddressType, disableSound, transactionText, disabled, theme: themeProp, donationAddress, donationRate }: PaymentDialogProps) => React.ReactElement;
69
+ export declare const PaymentDialog: ({ to, amount, setAmount, opReturn, paymentId, disablePaymentId, currency, currencyObj, setCurrencyObj, cryptoAmount, price, successText, animation, randomSatoshis, hideToasts, onClose, onSuccess, onTransaction, goalAmount, disableEnforceFocus, editable, dialogOpen, setDialogOpen, container, wsBaseUrl, apiBaseUrl, hoverText, disableAltpayment, contributionOffset, autoClose, useAltpayment, setUseAltpayment, setTxsSocket, txsSocket, setAltpaymentSocket, altpaymentSocket, setCoins, coins, setCoinPair, coinPair, setLoadingPair, loadingPair, setAltpaymentShift, altpaymentShift, setLoadingShift, loadingShift, setAltpaymentError, altpaymentError, addressType, newTxs, setNewTxs, setAddressType, disableSound, transactionText, disabled, convertedCurrencyObj, setConvertedCurrencyObj, theme: themeProp, donationAddress, donationRate }: PaymentDialogProps) => React.ReactElement;
68
70
  export default PaymentDialog;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { PaymentDialogProps } from './PaymentDialog';
3
3
  declare const _default: {
4
4
  title: string;
5
- component: ({ to, amount, setAmount, opReturn, paymentId, disablePaymentId, currency, currencyObj, setCurrencyObj, cryptoAmount, price, successText, animation, randomSatoshis, hideToasts, onClose, onSuccess, onTransaction, goalAmount, disableEnforceFocus, editable, dialogOpen, setDialogOpen, container, wsBaseUrl, apiBaseUrl, hoverText, disableAltpayment, contributionOffset, autoClose, useAltpayment, setUseAltpayment, setTxsSocket, txsSocket, setAltpaymentSocket, altpaymentSocket, setCoins, coins, setCoinPair, coinPair, setLoadingPair, loadingPair, setAltpaymentShift, altpaymentShift, setLoadingShift, loadingShift, setAltpaymentError, altpaymentError, addressType, newTxs, setNewTxs, setAddressType, disableSound, transactionText, disabled, theme: themeProp, donationAddress, donationRate }: PaymentDialogProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
5
+ component: ({ to, amount, setAmount, opReturn, paymentId, disablePaymentId, currency, currencyObj, setCurrencyObj, cryptoAmount, price, successText, animation, randomSatoshis, hideToasts, onClose, onSuccess, onTransaction, goalAmount, disableEnforceFocus, editable, dialogOpen, setDialogOpen, container, wsBaseUrl, apiBaseUrl, hoverText, disableAltpayment, contributionOffset, autoClose, useAltpayment, setUseAltpayment, setTxsSocket, txsSocket, setAltpaymentSocket, altpaymentSocket, setCoins, coins, setCoinPair, coinPair, setLoadingPair, loadingPair, setAltpaymentShift, altpaymentShift, setLoadingShift, loadingShift, setAltpaymentError, altpaymentError, addressType, newTxs, setNewTxs, setAddressType, disableSound, transactionText, disabled, convertedCurrencyObj, setConvertedCurrencyObj, theme: themeProp, donationAddress, donationRate }: PaymentDialogProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
6
6
  decorators: ((Story: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("@storybook/types").Args>) => JSX.Element)[];
7
7
  argTypes: {
8
8
  onClick: {
@@ -28,7 +28,7 @@ export interface WidgetProps {
28
28
  price?: number | undefined;
29
29
  usdPrice?: number | undefined;
30
30
  editable?: boolean;
31
- setNewTxs: Function;
31
+ setNewTxs?: Function;
32
32
  newTxs?: Transaction[];
33
33
  wsBaseUrl?: string;
34
34
  apiBaseUrl?: string;
@@ -45,6 +45,8 @@ export interface WidgetProps {
45
45
  altpaymentSocket?: Socket;
46
46
  setAltpaymentSocket?: Function;
47
47
  shiftCompleted?: boolean;
48
+ donationAddress?: string;
49
+ donationRate?: number;
48
50
  setShiftCompleted?: Function;
49
51
  setCoins?: Function;
50
52
  coins?: AltpaymentCoin[];
@@ -60,8 +62,9 @@ export interface WidgetProps {
60
62
  setAddressType?: Function;
61
63
  newTxText?: string;
62
64
  transactionText?: string;
63
- donationAddress?: string;
64
- donationRate?: number;
65
+ convertedCurrencyObj?: CurrencyObject;
66
+ setConvertedCurrencyObj?: Function;
67
+ setPaymentId?: Function;
65
68
  }
66
69
  export declare const Widget: React.FunctionComponent<WidgetProps>;
67
70
  export default Widget;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Currency, CurrencyObject, Transaction } from '../../util';
3
3
  import { WidgetProps } from './Widget';
4
- export interface WidgetContainerProps extends Omit<WidgetProps, 'success' | 'setCurrencyObject' | 'shiftCompleted' | 'setShiftCompleted'> {
4
+ export interface WidgetContainerProps extends Omit<WidgetProps, 'success' | 'setCurrencyObject' | 'shiftCompleted' | 'setShiftCompleted' | 'setPaymentId'> {
5
5
  active?: boolean;
6
6
  amount?: number;
7
7
  opReturn?: string;
@@ -30,6 +30,7 @@ export interface WidgetContainerProps extends Omit<WidgetProps, 'success' | 'set
30
30
  transactionText?: string;
31
31
  donationAddress?: string;
32
32
  donationRate?: number;
33
+ convertedCurrencyObj?: CurrencyObject;
33
34
  }
34
35
  export interface Output {
35
36
  index: number;
@@ -6,6 +6,7 @@ export declare const getBchFiatPrice: (currency: Currency, rootUrl?: string) =>
6
6
  export declare const getXecFiatPrice: (currency: Currency, rootUrl?: string) => Promise<PriceData>;
7
7
  export declare const getFiatPrice: (currency: string, to: string, apiBaseUrl?: string) => Promise<number | null>;
8
8
  export declare const getTransactionDetails: (txid: string, rootUrl?: string) => Promise<TransactionDetails>;
9
+ export declare const createPayment: (amount: string | number | undefined, address: string, rootUrl?: string) => Promise<string | undefined>;
9
10
  declare const _default: {
10
11
  getAddressDetails: (address: string, rootUrl?: string) => Promise<Transaction[]>;
11
12
  getTransactionDetails: (txid: string, rootUrl?: string) => Promise<TransactionDetails>;
@@ -3,8 +3,12 @@ export declare const CRYPTO_CURRENCIES: string[];
3
3
  export declare const DECIMALS: {
4
4
  [key: string]: number;
5
5
  };
6
+ export declare const MAX_AMOUNT: {
7
+ [key: string]: number;
8
+ };
6
9
  export declare const AUTO_CLOSE_DEFAULT_MS = 2000;
7
10
  export declare const CURRENCY_PREFIXES_MAP: Record<typeof CRYPTO_CURRENCIES[number], string>;
11
+ export declare const CURRENCY_TYPES_MAP: Record<typeof CRYPTO_CURRENCIES[number], string>;
8
12
  export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | "extrasmall" | "small" | "medium" | "large" | "extralarge" | undefined;
9
13
  export declare const DEFAULT_DONATION_RATE = 2;
10
14
  export declare const DONATION_RATE_STORAGE_KEY = "paybutton_donation_rate";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paybutton/react",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "The easiest way to accept eCash online",
5
5
  "author": "Blockchain Ventures Corp.",
6
6
  "license": "MIT",
@@ -105,6 +105,7 @@
105
105
  "notistack": "3.0.0",
106
106
  "qrcode.react": "3",
107
107
  "react-jss": "10.10.0",
108
+ "react-number-format": "^5.4.4",
108
109
  "socket.io-client": "4.7.4",
109
110
  "ts-jest": "^29.4.5",
110
111
  "xecaddrjs": "^0.0.1"