@paybutton/react 3.0.2 → 4.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.
Files changed (55) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.modern.js +1 -1
  4. package/dist/index.modern.js.map +1 -1
  5. package/dist/react/lib/altpayment/index.d.ts +21 -0
  6. package/dist/react/lib/altpayment/mocked.d.ts +4 -0
  7. package/dist/react/lib/altpayment/sideshift.d.ts +70 -0
  8. package/dist/{lib → react/lib}/components/BarChart/BarChart.d.ts +1 -0
  9. package/dist/{lib → react/lib}/components/PayButton/PayButton.d.ts +4 -2
  10. package/dist/{lib → react/lib}/components/PayButton/PayButton.stories.d.ts +0 -1
  11. package/dist/{lib → react/lib}/components/PaymentDialog/PaymentDialog.d.ts +5 -4
  12. package/dist/{lib → react/lib}/components/PaymentDialog/PaymentDialog.stories.d.ts +0 -1
  13. package/dist/react/lib/components/Widget/AltpaymentWidget.d.ts +30 -0
  14. package/dist/react/lib/components/Widget/SideShiftLogo.d.ts +2 -0
  15. package/dist/{lib → react/lib}/components/Widget/Widget.d.ts +13 -4
  16. package/dist/{lib → react/lib}/components/Widget/WidgetContainer.d.ts +6 -5
  17. package/dist/react/lib/tests/util/number.test.d.ts +1 -0
  18. package/dist/react/lib/tests/util/opReturn.test.d.ts +1 -0
  19. package/dist/react/lib/tests/util/validate.test.d.ts +1 -0
  20. package/dist/{lib → react/lib}/util/address.d.ts +3 -3
  21. package/dist/react/lib/util/api-client.d.ts +17 -0
  22. package/dist/react/lib/util/constants.d.ts +6 -0
  23. package/dist/react/lib/util/currency.d.ts +4 -0
  24. package/dist/{lib → react/lib}/util/format.d.ts +4 -8
  25. package/dist/react/lib/util/index.d.ts +12 -0
  26. package/dist/react/lib/util/number.d.ts +4 -0
  27. package/dist/{lib → react/lib}/util/randomizeSats.d.ts +2 -2
  28. package/dist/react/lib/util/satoshis.d.ts +6 -0
  29. package/dist/react/lib/util/socket.d.ts +14 -0
  30. package/dist/{lib/util/api-client.d.ts → react/lib/util/types.d.ts} +19 -33
  31. package/dist/react/lib/util/validate.d.ts +3 -0
  32. package/dist/react/src/main.d.ts +1 -0
  33. package/package.json +3 -2
  34. package/dist/lib/util/satoshis.d.ts +0 -11
  35. /package/dist/{index.d.ts → react/index.d.ts} +0 -0
  36. /package/dist/{lib → react/lib}/assets/edit-pencil.d.ts +0 -0
  37. /package/dist/{lib → react/lib}/components/BarChart/BarChart.stories.d.ts +0 -0
  38. /package/dist/{lib → react/lib}/components/BarChart/index.d.ts +0 -0
  39. /package/dist/{lib → react/lib}/components/Button/Button.d.ts +0 -0
  40. /package/dist/{lib → react/lib}/components/Button/Button.stories.d.ts +0 -0
  41. /package/dist/{lib → react/lib}/components/Button/index.d.ts +0 -0
  42. /package/dist/{lib → react/lib}/components/PayButton/index.d.ts +0 -0
  43. /package/dist/{lib → react/lib}/components/PaymentDialog/index.d.ts +0 -0
  44. /package/dist/{lib → react/lib}/components/Widget/Widget.stories.d.ts +0 -0
  45. /package/dist/{lib → react/lib}/components/Widget/index.d.ts +0 -0
  46. /package/dist/{lib → react/lib}/components/index.d.ts +0 -0
  47. /package/dist/{lib/tests/opReturn.test.d.ts → react/lib/tests/util/currency.test.d.ts} +0 -0
  48. /package/dist/{src/main.d.ts → react/lib/tests/util/format.test.d.ts} +0 -0
  49. /package/dist/{lib → react/lib}/themes/Theme.d.ts +0 -0
  50. /package/dist/{lib → react/lib}/themes/index.d.ts +0 -0
  51. /package/dist/{lib → react/lib}/themes/themes/orange.d.ts +0 -0
  52. /package/dist/{lib → react/lib}/themes/themes/paybutton.d.ts +0 -0
  53. /package/dist/{lib → react/lib}/themes/themes/xec.d.ts +0 -0
  54. /package/dist/{lib → react/lib}/util/opReturn.d.ts +0 -0
  55. /package/dist/{src → react/src}/App.d.ts +0 -0
@@ -0,0 +1,21 @@
1
+ import { SideshiftCoin, SideshiftError, SideshiftPair, SideshiftQuote, SideshiftShift } from "./sideshift";
2
+ export declare const MINIMUM_ALTPAYMENT_DOLLAR_AMOUNT = 10;
3
+ export declare const SOCKET_MESSAGES: {
4
+ GET_ALTPAYMENT_RATE: string;
5
+ SEND_ALTPAYMENT_RATE: string;
6
+ SEND_ALTPAYMENT_COINS_INFO: string;
7
+ CREATE_ALTPAYMENT_QUOTE: string;
8
+ SHIFT_CREATED: string;
9
+ ERROR_WHEN_CREATING_QUOTE: string;
10
+ ERROR_WHEN_CREATING_SHIFT: string;
11
+ };
12
+ export declare type AltpaymentClientOptions = 'sideshift' | 'mocked';
13
+ export declare type AltpaymentCoin = SideshiftCoin;
14
+ export declare type AltpaymentQuote = SideshiftQuote;
15
+ export declare type AltpaymentPair = SideshiftPair;
16
+ export declare type AltpaymentShift = SideshiftShift;
17
+ export declare type AltpaymentError = SideshiftError;
18
+ export interface AltpaymentClient {
19
+ getPaymentStatus: (id: string) => Promise<AltpaymentShift>;
20
+ }
21
+ export declare function getAltpaymentClient(): AltpaymentClient;
@@ -0,0 +1,4 @@
1
+ import { AltpaymentClient, AltpaymentShift } from ".";
2
+ export declare class MockedPaymentClient implements AltpaymentClient {
3
+ getPaymentStatus(_id: string): Promise<AltpaymentShift>;
4
+ }
@@ -0,0 +1,70 @@
1
+ import { AltpaymentClient } from ".";
2
+ export declare const SIDESHIFT_BASE_URL = "https://sideshift.ai/api/v2/";
3
+ interface SideshiftTokenDetails {
4
+ [network: string]: {
5
+ contractAddress: string;
6
+ decimals: number;
7
+ };
8
+ }
9
+ export interface SideshiftCoin {
10
+ networks: string[];
11
+ coin: string;
12
+ name: string;
13
+ hasMemo: boolean;
14
+ fixedOnly: string[] | boolean;
15
+ variableOnly: string[] | boolean;
16
+ tokenDetails: SideshiftTokenDetails;
17
+ depositOffline?: string[] | boolean;
18
+ settleOffline?: string[] | boolean;
19
+ }
20
+ export interface SideshiftQuote {
21
+ id: string;
22
+ createdAt: string;
23
+ depositCoin: string;
24
+ settleCoin: string;
25
+ depositNetwork: string;
26
+ settleNetwork: string;
27
+ expiresAt: string;
28
+ depositAmount: string;
29
+ settleAmount: string;
30
+ rate: string;
31
+ affiliateId: string;
32
+ }
33
+ export interface SideshiftPair {
34
+ min: string;
35
+ max: string;
36
+ rate: string;
37
+ depositCoin: string;
38
+ settleCoin: string;
39
+ depositNetwork: string;
40
+ settleNetwork: string;
41
+ }
42
+ export interface SideshiftShift {
43
+ id: string;
44
+ createdAt: string;
45
+ depositCoin: string;
46
+ settleCoin: string;
47
+ depositNetwork: string;
48
+ settleNetwork: string;
49
+ depositAddress: string;
50
+ settleAddress: string;
51
+ depositMin: string;
52
+ depositMax: string;
53
+ averageShiftSeconds: string;
54
+ depositAmount: string;
55
+ expiresAt: string;
56
+ quoteId: string;
57
+ rate: string;
58
+ settleAmount: string;
59
+ status: string;
60
+ type: string;
61
+ }
62
+ declare type ErrorType = 'quote-error' | 'shift-error';
63
+ export interface SideshiftError {
64
+ errorType: ErrorType;
65
+ errorMessage: string;
66
+ }
67
+ export declare class SideshiftClient implements AltpaymentClient {
68
+ getPaymentStatus(shiftId: string): Promise<SideshiftShift>;
69
+ }
70
+ export {};
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  export interface BarChartProps {
3
3
  value: number;
4
4
  color: string;
5
+ disabled: boolean;
5
6
  }
6
7
  export declare const BarChart: {
7
8
  (props: BarChartProps): React.ReactElement;
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { Theme, ThemeName } from '../../themes';
3
3
  import { ButtonProps } from '../Button/Button';
4
- import { Transaction, currency } from '../../util/api-client';
4
+ import { Transaction, Currency } from '../../util';
5
5
  export interface PayButtonProps extends ButtonProps {
6
6
  to: string;
7
7
  amount?: number | string;
8
8
  opReturn?: string;
9
9
  disablePaymentId?: boolean;
10
- currency?: currency;
10
+ currency?: Currency;
11
11
  theme?: ThemeName | Theme;
12
12
  text?: string;
13
13
  hoverText?: string;
@@ -24,6 +24,8 @@ export interface PayButtonProps extends ButtonProps {
24
24
  onClose?: (success?: boolean, paymentId?: string) => void;
25
25
  wsBaseUrl?: string;
26
26
  apiBaseUrl?: string;
27
+ disableAltpayment?: boolean;
28
+ contributionOffset?: number;
27
29
  }
28
30
  export declare const PayButton: {
29
31
  (props: PayButtonProps): React.ReactElement;
@@ -47,4 +47,3 @@ export declare const OrangeTheme: import("@storybook/csf").AnnotatedStoryFn<impo
47
47
  export declare const UsdAmount: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PayButtonProps>;
48
48
  export declare const withGoal: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PayButtonProps>;
49
49
  export declare const withUSDGoalCurrency: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PayButtonProps>;
50
- export declare const withEURGoalCurrency: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PayButtonProps>;
@@ -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 { Transaction, currency } from '../../util/api-client';
5
- import { currencyObject } from '../../util/satoshis';
4
+ import { Currency, CurrencyObject, Transaction } from '../../util';
6
5
  export interface PaymentDialogProps extends ButtonProps {
7
6
  to: string;
8
7
  amount?: number | string;
@@ -10,8 +9,8 @@ export interface PaymentDialogProps extends ButtonProps {
10
9
  opReturn?: string;
11
10
  paymentId?: string;
12
11
  disablePaymentId?: boolean;
13
- currency?: currency;
14
- currencyObj?: currencyObject;
12
+ currency?: Currency;
13
+ currencyObj?: CurrencyObject;
15
14
  cryptoAmount?: string;
16
15
  price?: number;
17
16
  hoverText?: string;
@@ -32,6 +31,8 @@ export interface PaymentDialogProps extends ButtonProps {
32
31
  onTransaction?: (transaction: Transaction) => void;
33
32
  wsBaseUrl?: string;
34
33
  apiBaseUrl?: string;
34
+ disableAltpayment?: boolean;
35
+ contributionOffset?: number;
35
36
  }
36
37
  export declare const PaymentDialog: {
37
38
  (props: PaymentDialogProps): React.ReactElement;
@@ -46,4 +46,3 @@ export declare const OrangeTheme: import("@storybook/csf").AnnotatedStoryFn<impo
46
46
  export declare const UsdAmount: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PaymentDialogProps>;
47
47
  export declare const withGoal: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PaymentDialogProps>;
48
48
  export declare const withUSDGoalCurrency: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PaymentDialogProps>;
49
- export declare const withEURGoalCurrency: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PaymentDialogProps>;
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { CryptoCurrency } from '../../util';
3
+ import { animation } from '../Button/Button';
4
+ import { Socket } from 'socket.io-client';
5
+ import { AltpaymentCoin, AltpaymentError, AltpaymentPair, AltpaymentShift } from '../../altpayment';
6
+ interface AltpaymentProps {
7
+ altpaymentSocket?: Socket;
8
+ setUseAltpayment: Function;
9
+ altpaymentShift?: AltpaymentShift;
10
+ setAltpaymentShift: Function;
11
+ shiftCompleted: boolean;
12
+ setShiftCompleted: Function;
13
+ altpaymentError?: AltpaymentError;
14
+ setAltpaymentError: Function;
15
+ coins: AltpaymentCoin[];
16
+ loadingPair: boolean;
17
+ setLoadingPair: Function;
18
+ loadingShift: boolean;
19
+ setLoadingShift: Function;
20
+ coinPair?: AltpaymentPair;
21
+ setCoinPair: Function;
22
+ altpaymentEditable: boolean;
23
+ animation?: animation;
24
+ addressType: CryptoCurrency;
25
+ to: string;
26
+ thisAmount?: string | number | null;
27
+ updateAmount: Function;
28
+ }
29
+ export declare const AltpaymentWidget: React.FunctionComponent<AltpaymentProps>;
30
+ export default AltpaymentWidget;
@@ -0,0 +1,2 @@
1
+ export declare const sideShiftLogo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABYAAAADACAYAAAC9McflAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs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g4Ozc3Nl5eXt7e3FxcX3t7ea2tr6urq6+vrZmZm9fX129vblpaWvb29DAwMw8PD7Ozsra2twsLC6enpPT09goKC+vr67u7uv7+/Nzc3WVlZmJiYioqKiYmJaGhosrKy0NDQ1dXVpKSkj4+PSEhI4eHhz8/PExMTo6Ojr6+vdnZ2QkJCnJyccXFxOjo65eXltbW1fn5+RkZGn5+fi4uLjIyM5ubmsLCw8/Pz9PT0NTU16Ojo2traKSkp/f39kJCQ/Pz8xsbGXl5ebm5uxcXFbGxsgYGBoKCgoaGhnZ2dmZmZjY2NJCQkiIiIQEBAW1tbaWlpYGBgYWFhXFxcXV1dV1dXAAAA////NCYxYAAAAIB0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wA4BUtnAAACdElEQVR42uzaZ1PbQBAGYDkY48SWhS2FCFeMTQgtgdA7CYH03hPSe+896P56GMB3irwnsG7lT/t+9Gn2mbM0exrdaQxO+UXENnJG0OSMfefev6oV00CiM+JgRJvxQcYcrByWIT2vHbxUZ2Gky8FMG4h8dnDzA0AexZERZ6Ye+YttOMk65IiDnwde5FoISK8X+SXGRm51KGRe54VsL3KDD40xtdzllb56EZsPLSoi4u4aciSriGR5pZwXsfhQWhFJy2dCSENIgQ/NhodU+dBUCMiTM6vfC1YhxYeij63dxbZae++Vd4GUfuqKDSoysBPyBqMPHjvqi1zF6baxbh9kBKunt+SlyCe8lUNbkCAVzPXpmwQ5jv0CBCBF3KX2FIj0uy/ZfB1qb7Duf9e/AxHxb8XPlrPpjZx/ejrdSCpDlzK8iAUic56X40AZF0/xcwgRvf2gQjccrBXJPIQQsahPKyCxWpGJov9M9isgBp+JSQghhBBCCCGEEEIIIYQQQgghhBBCCCFNRirNQIbDQw7xnybFN3xsZOKmuZWONrETg420Z7bj+la8BxuB0o+E7PUx4mYTZrLMcJB8Qm5EGRLSI0fi97EQlpMZ+hJDQ2Q3vjrK8BD4xusrW6PhIRfvfKmdG8BGUpMXOjfS11dybW26tjZU9k9i9Q3SFU0cTzqJMpMihGgcmQ9uDPEDSIkFCFkXz8KHKTNYBlqAjTM3csL9yGWCxVXiN4iUcDczL4MIm8M0Bl/CyCgmcpvBCLuOZ6RMGcKiaMhbJkWGkc4LJsaZHGHsD/4RiXqETSdVCf1Knu2AsPzHdds4EDDJZ61r3T5d558AAwDxw6DYwVV5JQAAAABJRU5ErkJggg==";
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Theme, ThemeName } from '../../themes';
3
3
  import { animation } from '../Button/Button';
4
- import { currencyObject } from '../../util/satoshis';
5
- import { currency, Transaction } from '../../util/api-client';
4
+ import { Currency, Transaction, CurrencyObject } from '../../util';
5
+ import { AltpaymentShift } from '../../altpayment';
6
6
  export interface WidgetProps {
7
7
  to: string;
8
8
  amount?: number | null | string;
@@ -18,12 +18,13 @@ export interface WidgetProps {
18
18
  foot?: React.ReactNode;
19
19
  disabled: boolean;
20
20
  goalAmount?: number | string | null;
21
- currency?: currency;
21
+ currency?: Currency;
22
22
  animation?: animation;
23
- currencyObject?: currencyObject | undefined;
23
+ currencyObject?: CurrencyObject | undefined;
24
24
  setCurrencyObject?: Function;
25
25
  randomSatoshis?: boolean | number;
26
26
  price?: number | undefined;
27
+ usdPrice?: number | undefined;
27
28
  editable?: boolean;
28
29
  setNewTxs: Function;
29
30
  newTxs?: Transaction[];
@@ -31,6 +32,14 @@ export interface WidgetProps {
31
32
  apiBaseUrl?: string;
32
33
  loading?: boolean;
33
34
  hoverText?: string;
35
+ setAltpaymentShift: Function;
36
+ altpaymentShift?: AltpaymentShift | undefined;
37
+ useAltpayment: boolean;
38
+ setUseAltpayment: Function;
39
+ shiftCompleted: boolean;
40
+ setShiftCompleted: Function;
41
+ disableAltpayment?: boolean;
42
+ contributionOffset?: number;
34
43
  }
35
44
  export declare const Widget: React.FunctionComponent<WidgetProps>;
36
45
  export default Widget;
@@ -1,15 +1,14 @@
1
1
  import React from 'react';
2
- import { Transaction, currency } from '../../util/api-client';
3
- import { currencyObject } from '../../util/satoshis';
2
+ import { Currency, CurrencyObject, Transaction } from '../../util';
4
3
  import { WidgetProps } from './Widget';
5
- export interface WidgetContainerProps extends Omit<WidgetProps, 'success' | 'setNewTxs' | 'setCurrencyObject'> {
4
+ export interface WidgetContainerProps extends Omit<WidgetProps, 'success' | 'setNewTxs' | 'setCurrencyObject' | 'setAltpaymentShift' | 'useAltpayment' | 'setUseAltpayment' | 'shiftCompleted' | 'setShiftCompleted'> {
6
5
  active?: boolean;
7
6
  amount?: number;
8
7
  opReturn?: string;
9
8
  paymentId?: string;
10
9
  disablePaymentId?: boolean;
11
- currency?: currency;
12
- currencyObj?: currencyObject;
10
+ currency?: Currency;
11
+ currencyObj?: CurrencyObject;
13
12
  cryptoAmount?: string;
14
13
  price?: number;
15
14
  setCurrencyObj: Function;
@@ -24,6 +23,8 @@ export interface WidgetContainerProps extends Omit<WidgetProps, 'success' | 'set
24
23
  wsBaseUrl?: string;
25
24
  apiBaseUrl?: string;
26
25
  successText?: string;
26
+ disableAltpayment?: boolean;
27
+ contributionOffset?: number;
27
28
  }
28
29
  export interface Output {
29
30
  index: number;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,10 @@
1
- import { cryptoCurrency } from '../util/api-client';
1
+ import { CryptoCurrency } from './types';
2
2
  export declare const isValidCashAddress: (address: string) => boolean;
3
3
  export declare const isValidXecAddress: (address: string) => boolean;
4
- export declare const getCurrencyTypeFromAddress: (address: string) => cryptoCurrency;
4
+ export declare const getCurrencyTypeFromAddress: (address: string) => CryptoCurrency;
5
5
  declare const _default: {
6
6
  isValidCashAddress: (address: string) => boolean;
7
7
  isValidXecAddress: (address: string) => boolean;
8
- getCurrencyTypeFromAddress: (address: string) => "BCH" | "XEC";
8
+ getCurrencyTypeFromAddress: (address: string) => string;
9
9
  };
10
10
  export default _default;
@@ -0,0 +1,17 @@
1
+ import { Transaction, UtxoDetails, PriceData, TransactionDetails, Currency } from './types';
2
+ export declare const getAddressDetails: (address: string, rootUrl?: string) => Promise<Transaction[]>;
3
+ export declare const getAddressBalance: (address: string, rootUrl?: string) => Promise<number | undefined>;
4
+ export declare const getUTXOs: (address: string, rootUrl?: string) => Promise<UtxoDetails>;
5
+ export declare const getBchFiatPrice: (currency: Currency, rootUrl?: string) => Promise<PriceData>;
6
+ export declare const getXecFiatPrice: (currency: Currency, rootUrl?: string) => Promise<PriceData>;
7
+ export declare const getFiatPrice: (currency: string, to: string, apiBaseUrl?: string | undefined) => Promise<number | null>;
8
+ export declare const getTransactionDetails: (txid: string, rootUrl?: string) => Promise<TransactionDetails>;
9
+ declare const _default: {
10
+ getAddressDetails: (address: string, rootUrl?: string) => Promise<Transaction[]>;
11
+ getTransactionDetails: (txid: string, rootUrl?: string) => Promise<TransactionDetails>;
12
+ getBchFiatPrice: (currency: string, rootUrl?: string) => Promise<PriceData>;
13
+ getXecFiatPrice: (currency: string, rootUrl?: string) => Promise<PriceData>;
14
+ getAddressBalance: (address: string, rootUrl?: string) => Promise<number | undefined>;
15
+ };
16
+ export default _default;
17
+ export declare const getCashtabProviderStatus: () => boolean;
@@ -0,0 +1,6 @@
1
+ export declare const FIAT_CURRENCIES: string[];
2
+ export declare const CRYPTO_CURRENCIES: string[];
3
+ export declare const DECIMALS: {
4
+ [key: string]: number;
5
+ };
6
+ export declare const CURRENCY_PREFIXES_MAP: Record<typeof CRYPTO_CURRENCIES[number], string>;
@@ -0,0 +1,4 @@
1
+ import { CryptoCurrency, FiatCurrency } from "./types";
2
+ export declare function isFiat(unknownString: string): unknownString is FiatCurrency;
3
+ export declare function isCrypto(unknownString: string): unknownString is CryptoCurrency;
4
+ export declare function isValidCurrency(unknownString: string): unknownString is CryptoCurrency;
@@ -1,17 +1,13 @@
1
- import { currency } from './api-client';
2
- export declare const DECIMALS: {
3
- BCH: number;
4
- XEC: number;
5
- FIAT: number;
6
- };
1
+ import { Currency } from './types';
7
2
  export declare const amount: (x?: number | null | undefined) => string | undefined;
8
- export declare const formatPrice: (price: number, currencyType: currency, precision?: number) => string;
3
+ export declare const formatPrice: (price: number, currencyType: Currency, precision?: number) => string;
9
4
  export declare const formatComma: (number: number) => string;
10
5
  export declare const formatBCH: (bch: string) => string;
11
6
  export declare const formatXEC: (xec: string) => string;
7
+ export declare const isPropsTrue: (value?: string | boolean | undefined) => boolean;
12
8
  declare const _default: {
13
9
  amount: (x?: number | null | undefined) => string | undefined;
14
- formatPrice: (price: number, currencyType: currency, precision?: number) => string;
10
+ formatPrice: (price: number, currencyType: string, precision?: number) => string;
15
11
  formatComma: (number: number) => string;
16
12
  formatBCH: (bch: string) => string;
17
13
  formatXEC: (xec: string) => string;
@@ -0,0 +1,12 @@
1
+ export * from './address';
2
+ export * from './api-client';
3
+ export * from './constants';
4
+ export * from './format';
5
+ export * from './opReturn';
6
+ export * from './randomizeSats';
7
+ export * from './satoshis';
8
+ export * from './socket';
9
+ export * from './types';
10
+ export * from './number';
11
+ export * from './currency';
12
+ export * from './validate';
@@ -0,0 +1,4 @@
1
+ import BigNumber from 'bignumber.js';
2
+ export declare const zero: BigNumber;
3
+ export declare const resolveNumber: (value: BigNumber.Value) => BigNumber;
4
+ export declare const isGreaterThanZero: (value: BigNumber.Value) => boolean;
@@ -1,4 +1,4 @@
1
- import { cryptoCurrency } from './api-client';
1
+ import { CryptoCurrency } from "./types";
2
2
  export declare const getNSatoshis: (amount: number, randomSatoshis: boolean | number, satsPrecision: number) => number;
3
- export declare const randomizeSatoshis: (amount: number, addressType: cryptoCurrency, randomSatoshis: boolean | number) => number;
3
+ export declare const randomizeSatoshis: (amount: number, addressType: CryptoCurrency, randomSatoshis: boolean | number) => number;
4
4
  export default randomizeSatoshis;
@@ -0,0 +1,6 @@
1
+ import { Currency, CurrencyObject } from './types';
2
+ export declare const getCurrencyObject: (amount: number, currencyType: Currency, randomSatoshis: boolean | number | undefined) => CurrencyObject;
3
+ declare const _default: {
4
+ getCurrencyObject: (amount: number, currencyType: string, randomSatoshis: number | boolean | undefined) => CurrencyObject;
5
+ };
6
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { Socket } from 'socket.io-client';
2
+ export declare const txsListener: (socket: Socket, setNewTxs: Function) => void;
3
+ interface AltpaymentListenerParams {
4
+ addressType: string;
5
+ socket: Socket;
6
+ setCoins: Function;
7
+ setCoinPair: Function;
8
+ setLoadingPair: Function;
9
+ setAltpaymentShift: Function;
10
+ setLoadingShift: Function;
11
+ setAltpaymentError: Function;
12
+ }
13
+ export declare const altpaymentListener: (params: AltpaymentListenerParams) => void;
14
+ export {};
@@ -1,37 +1,9 @@
1
- import { Socket } from 'socket.io-client';
2
- export declare const getAddressDetails: (address: string, rootUrl?: string) => Promise<Transaction[]>;
3
- declare type TxBroadcast = 'NewTx' | 'OldTx';
4
- export interface BroadcastTxData {
5
- address: string;
6
- txs: Transaction[];
7
- messageType: TxBroadcast;
8
- }
9
- export declare const setListener: (socket: Socket, setNewTxs: Function) => void;
10
- export declare const getAddressBalance: (address: string, rootUrl?: string) => Promise<number | undefined>;
11
- export declare const getUTXOs: (address: string, rootUrl?: string) => Promise<UtxoDetails>;
12
- export declare const getBchFiatPrice: (currency: currency, rootUrl?: string) => Promise<PriceData>;
13
- export declare const getXecFiatPrice: (currency: currency, rootUrl?: string) => Promise<PriceData>;
14
- export declare const getFiatPrice: (currency: string, to: string, apiBaseUrl?: string | undefined) => Promise<number | null>;
15
- export declare const getTransactionDetails: (txid: string, rootUrl?: string) => Promise<TransactionDetails>;
16
- declare const _default: {
17
- getAddressDetails: (address: string, rootUrl?: string) => Promise<Transaction[]>;
18
- getTransactionDetails: (txid: string, rootUrl?: string) => Promise<TransactionDetails>;
19
- getBchFiatPrice: (currency: currency, rootUrl?: string) => Promise<PriceData>;
20
- getXecFiatPrice: (currency: currency, rootUrl?: string) => Promise<PriceData>;
21
- getAddressBalance: (address: string, rootUrl?: string) => Promise<number | undefined>;
1
+ import { CRYPTO_CURRENCIES, FIAT_CURRENCIES } from "./constants";
2
+ export declare type CurrencyObject = {
3
+ float: number;
4
+ string: string;
5
+ currency: string;
22
6
  };
23
- export default _default;
24
- export declare const fiatCurrencies: readonly ["USD", "CAD", "EUR", "GBP", "AUD"];
25
- declare type fiatCurrenciesTuple = typeof fiatCurrencies;
26
- export declare type fiatCurrency = fiatCurrenciesTuple[number];
27
- export declare const cryptoCurrencies: readonly ["BCH", "XEC"];
28
- declare type cryptoCurrenciesTuple = typeof cryptoCurrencies;
29
- export declare type cryptoCurrency = cryptoCurrenciesTuple[number];
30
- export declare type currency = cryptoCurrency | fiatCurrency;
31
- export declare function isFiat(unknownString: string): unknownString is fiatCurrency;
32
- export declare function isCrypto(unknownString: string): unknownString is cryptoCurrency;
33
- export declare function isValidCurrency(unknownString: string): unknownString is cryptoCurrency;
34
- export declare const getCashtabProviderStatus: () => boolean;
35
7
  export interface Transaction {
36
8
  hash: string;
37
9
  amount: string;
@@ -40,6 +12,8 @@ export interface Transaction {
40
12
  message: string;
41
13
  timestamp: number;
42
14
  address: string;
15
+ rawMessage?: string;
16
+ inputAddresses?: string[];
43
17
  }
44
18
  export interface UtxoDetails {
45
19
  outputsList: [Output];
@@ -147,3 +121,15 @@ export interface TransactionDetails {
147
121
  };
148
122
  };
149
123
  }
124
+ declare type FiatCurrenciesTuple = typeof FIAT_CURRENCIES;
125
+ declare type CyptoCurrenciesTuple = typeof CRYPTO_CURRENCIES;
126
+ declare type TxBroadcast = 'NewTx' | 'OldTx';
127
+ export declare type CryptoCurrency = FiatCurrenciesTuple[number];
128
+ export declare type FiatCurrency = CyptoCurrenciesTuple[number];
129
+ export declare type Currency = CryptoCurrency | FiatCurrency;
130
+ export interface BroadcastTxData {
131
+ address: string;
132
+ txs: Transaction[];
133
+ messageType: TxBroadcast;
134
+ }
135
+ export {};
@@ -0,0 +1,3 @@
1
+ import BigNumber from "bignumber.js";
2
+ import { CurrencyObject, Transaction } from "./types";
3
+ export declare const shouldTriggerOnSuccess: (transaction: Transaction, currency: string, price: number, disablePaymentId?: boolean | undefined, expectedPaymentId?: string | undefined, expectedAmount?: BigNumber | undefined, expectedOpReturn?: string | undefined, currencyObject?: CurrencyObject | undefined) => Promise<boolean>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paybutton/react",
3
- "version": "3.0.2",
3
+ "version": "4.1.0",
4
4
  "description": "The easiest way to accept eCash online",
5
5
  "author": "Blockchain Ventures Corp.",
6
6
  "license": "MIT",
@@ -24,7 +24,8 @@
24
24
  "dev": "concurrently yarn:watch yarn:storybook",
25
25
  "storybook": "start-storybook -p 6006",
26
26
  "watch": "microbundle watch --jsx React.createElement --no-compress --format modern,cjs",
27
- "test": "jest"
27
+ "test": "jest",
28
+ "test:coverage": "jest --coverage"
28
29
  },
29
30
  "peerDependencies": {
30
31
  "react": "17.0.0",
@@ -1,11 +0,0 @@
1
- import { currency } from './api-client';
2
- export declare type currencyObject = {
3
- float: number;
4
- string: string;
5
- currency: string;
6
- };
7
- export declare const getCurrencyObject: (amount: number, currencyType: currency, randomSatoshis: boolean | number | undefined) => currencyObject;
8
- declare const _default: {
9
- getCurrencyObject: (amount: number, currencyType: currency, randomSatoshis: number | boolean | undefined) => currencyObject;
10
- };
11
- export default _default;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes