@depay/widgets 11.5.0 → 11.6.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.
@@ -0,0 +1,184 @@
1
+ declare namespace DePayWidgets {
2
+
3
+ interface ColorsOptions {
4
+ primary?: string;
5
+ text?: string;
6
+ buttonText?: string;
7
+ icons?: string;
8
+ }
9
+
10
+ interface StyleOptions {
11
+ colors?: ColorsOptions;
12
+ fontFamily?: string;
13
+ css?: string;
14
+ }
15
+
16
+ interface AcceptOptions {
17
+ blockchain: string;
18
+ token: string;
19
+ receiver: string;
20
+ amount?: number;
21
+ fee?: {
22
+ amount: string;
23
+ receiver: string;
24
+ };
25
+ }
26
+
27
+ interface BlockchainStringListOptions {
28
+ ethereum?: string[];
29
+ bsc?: string[];
30
+ polygon?: string[];
31
+ solana?: string[];
32
+ }
33
+
34
+ interface BlockchainStringOptions {
35
+ ethereum?: string;
36
+ bsc?: string;
37
+ polygon?: string;
38
+ solana?: string;
39
+ }
40
+
41
+ interface PaymentOptions {
42
+ accept: AcceptOptions[];
43
+ amount?: {
44
+ currency?: string;
45
+ fix?: number;
46
+ };
47
+ sent?: (transaction: any) => void;
48
+ succeeded?: (transaction: any) => void;
49
+ validated?: (successful: boolean, transaction: any) => void;
50
+ failed?: (transaction: any) => void;
51
+ error?: (error: any) => void;
52
+ critical?: (error: any) => void;
53
+ style?: StyleOptions;
54
+ whitelist?: BlockchainStringListOptions;
55
+ blacklist?: BlockchainStringListOptions;
56
+ providers?: BlockchainStringListOptions;
57
+ currency?: string;
58
+ connected?: (address: string) => void;
59
+ closed?: () => void;
60
+ track?: {
61
+ endpoint?: string;
62
+ method?: (payment: any) => void;
63
+ poll?: {
64
+ endpoint?: string;
65
+ method?: (payment: any) => void;
66
+ };
67
+ };
68
+ recover?: {
69
+ blockchain: string;
70
+ transaction: string;
71
+ sender: string;
72
+ nonce: number;
73
+ afterBlock: number;
74
+ token: string;
75
+ amount: number;
76
+ };
77
+ closable?: boolean;
78
+ integration?: string;
79
+ container?: HTMLElement;
80
+ before?: (payment: any) => Promise<void>;
81
+ wallet?: any;
82
+ title?: string;
83
+ action?: string;
84
+ document?: HTMLElement;
85
+ }
86
+
87
+ interface PaymentResponse {
88
+ unmount: () => void;
89
+ }
90
+
91
+ const Payment: (options: PaymentOptions) => Promise<PaymentResponse>;
92
+
93
+ interface ConnectOptions {
94
+ style?: StyleOptions;
95
+ error?: (error: any) => void;
96
+ document?: HTMLElement;
97
+ }
98
+
99
+ interface ConnectResponse {
100
+ account: string;
101
+ wallet: any;
102
+ }
103
+
104
+ const Connect: (options: ConnectOptions) => Promise<ConnectResponse>;
105
+
106
+ interface LoginOptions {
107
+ message: string;
108
+ endpoint?: string;
109
+ recover?: (message: string, signature: string) => void;
110
+ wallet?: any;
111
+ style?: StyleOptions;
112
+ error?: (error: any) => void;
113
+ document?: HTMLElement;
114
+ }
115
+
116
+ interface LoginResponse {
117
+ account: string;
118
+ wallet: any;
119
+ }
120
+
121
+ const Login: (options: LoginOptions) => Promise<LoginResponse>;
122
+
123
+ interface SaleOptions {
124
+ sell: BlockchainStringOptions;
125
+ amount?: {
126
+ start?: number;
127
+ min?: number;
128
+ step?: number;
129
+ token?: boolean;
130
+ };
131
+ sent?: (transaction: any) => void;
132
+ succeeded?: (transaction: any) => void;
133
+ failed?: (transaction: any) => void;
134
+ error?: (error: any) => void;
135
+ critical?: (error: any) => void;
136
+ style?: StyleOptions;
137
+ blacklist?: BlockchainStringListOptions;
138
+ providers?: BlockchainStringListOptions;
139
+ currency?: string;
140
+ connected?: (address: string) => void;
141
+ closed?: () => void;
142
+ tokenImage: string;
143
+ closable?: boolean;
144
+ integration?: string;
145
+ wallet?: any;
146
+ document?: HTMLElement;
147
+ }
148
+
149
+ interface SaleResponse {
150
+ unmount: () => void;
151
+ }
152
+
153
+ const Sale: (options: SaleOptions) => Promise<SaleResponse>;
154
+
155
+ interface SelectOptions {
156
+ what: string;
157
+ style?: StyleOptions;
158
+ error?: (error: any) => void;
159
+ document?: HTMLElement;
160
+ }
161
+
162
+ const Select: (options: SelectOptions) => Promise<any>;
163
+
164
+ interface LoadingOptions {
165
+ text: string;
166
+ style?: StyleOptions;
167
+ error?: (error: any) => void;
168
+ critical?: (error: any) => void;
169
+ document?: HTMLElement;
170
+ }
171
+
172
+ const Loading: (options: LoadingOptions) => Promise<any>;
173
+ }
174
+
175
+ declare const DePayWidgets: {
176
+ Connect: DePayWidgets.Connect;
177
+ Login: DePayWidgets.Login;
178
+ Payment: DePayWidgets.Payment;
179
+ Sale: DePayWidgets.Sale;
180
+ Select: DePayWidgets.Select;
181
+ Loading: DePayWidgets.Loading;
182
+ };
183
+
184
+ export default DePayWidgets;
@@ -23055,13 +23055,17 @@ class Dialog extends React.Component {
23055
23055
  }
23056
23056
 
23057
23057
  componentDidMount() {
23058
- this.setState({ open: false }, () => {
23058
+ if(this.props.animate === false) {
23059
+ this.setState({ open: true });
23060
+ } else {
23059
23061
  // make sure state is false first before opening the dialog
23060
23062
  // to ensure opening is animated
23061
- setTimeout(() => {
23062
- this.setState({ open: true });
23063
- }, 10);
23064
- });
23063
+ this.setState({ open: false }, () => {
23064
+ setTimeout(() => {
23065
+ this.setState({ open: true });
23066
+ }, 10);
23067
+ });
23068
+ }
23065
23069
  this.props.document.addEventListener('keydown', this.handler, true);
23066
23070
  }
23067
23071
 
@@ -23073,10 +23077,10 @@ class Dialog extends React.Component {
23073
23077
  const classNames = ['ReactDialog', this.state.open ? 'ReactDialogOpen' : ''];
23074
23078
  const style = ReactDialogStyle({ background: this.props.background });
23075
23079
  return (
23076
- React.createElement('div', { key: this.props.dialogKey, className: classNames.join(' '), __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 55}}
23077
- , React.createElement('style', {__self: this, __source: {fileName: _jsxFileName$1, lineNumber: 56}}, style)
23078
- , React.createElement('div', { className: "ReactDialogInner", __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 57}}
23079
- , React.createElement('div', { className: "ReactDialogBackground", onClick: this.onClickBackground.bind(this), __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 58}} )
23080
+ React.createElement('div', { key: this.props.dialogKey, className: classNames.join(' '), __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 59}}
23081
+ , React.createElement('style', {__self: this, __source: {fileName: _jsxFileName$1, lineNumber: 60}}, style)
23082
+ , React.createElement('div', { className: "ReactDialogInner", __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 61}}
23083
+ , React.createElement('div', { className: "ReactDialogBackground", onClick: this.onClickBackground.bind(this), __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 62}} )
23080
23084
  , this.props.children
23081
23085
  )
23082
23086
  )
@@ -23113,7 +23117,8 @@ class ReactDialog extends React.Component {
23113
23117
  background: this.props.background,
23114
23118
  close: this.props.close,
23115
23119
  document: _document,
23116
- open: this.props.open, __self: this, __source: {fileName: _jsxFileName, lineNumber: 29}}
23120
+ open: this.props.open,
23121
+ animate: this.props.animate, __self: this, __source: {fileName: _jsxFileName, lineNumber: 29}}
23117
23122
 
23118
23123
  , this.props.children
23119
23124
  ),